summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binutils/ChangeLog548
-rw-r--r--binutils/Makefile.am706
-rw-r--r--binutils/Makefile.in1462
-rw-r--r--binutils/dlltool.c3678
-rw-r--r--binutils/dwarf.c4642
-rw-r--r--binutils/objdump.c3395
-rw-r--r--binutils/readelf.c10851
-rw-r--r--binutils/resrc.c3345
-rw-r--r--binutils/resres.c737
-rw-r--r--binutils/size.c611
-rw-r--r--binutils/windmc.c1206
-rw-r--r--gas/ChangeLog1073
-rw-r--r--gas/Makefile.am2215
-rw-r--r--gas/Makefile.in3060
-rw-r--r--gas/config/tc-i386.c10030
-rw-r--r--gas/config/tc-mips.c15425
-rw-r--r--gas/config/tc-mips.h183
-rw-r--r--gas/config/tc-ppc.c6216
-rw-r--r--gas/doc/as.texinfo7180
-rw-r--r--gas/doc/c-ppc.texi153
-rw-r--r--gas/dwarf2dbg.c1729
-rw-r--r--gas/messages.c537
-rw-r--r--gas/po/POTFILES.in232
-rw-r--r--gas/symbols.c3176
-rw-r--r--gas/testsuite/ChangeLog950
-rw-r--r--gas/testsuite/gas/cfi/cfi-i386.d152
-rw-r--r--gas/testsuite/gas/cfi/cfi-i386.s165
-rw-r--r--gas/testsuite/gas/cfi/cfi-x86_64.d227
-rw-r--r--gas/testsuite/gas/cfi/cfi-x86_64.s214
-rw-r--r--gas/testsuite/gas/ppc/cell.d37
-rw-r--r--gas/testsuite/gas/ppc/cell.s31
-rw-r--r--gas/testsuite/gas/ppc/power6.d31
-rw-r--r--gas/testsuite/gas/ppc/power6.s25
-rw-r--r--gas/testsuite/gas/ppc/power7.d57
-rw-r--r--gas/testsuite/gas/ppc/power7.s58
-rw-r--r--gas/testsuite/gas/ppc/ppc.exp51
-rw-r--r--gas/write.c2539
-rw-r--r--gdb/gdbtk/ChangeLog171
-rw-r--r--gdb/gdbtk/ChangeLog-20011719
-rw-r--r--gdb/gdbtk/ChangeLog-2002878
-rw-r--r--gdb/gdbtk/ChangeLog-2003431
-rw-r--r--gdb/gdbtk/ChangeLog-2004209
-rw-r--r--gdb/gdbtk/ChangeLog-2005214
-rw-r--r--gdb/gdbtk/ChangeLog-200698
-rw-r--r--gdb/gdbtk/ChangeLog-200760
-rw-r--r--gdb/gdbtk/Makefile.am4
-rw-r--r--gdb/gdbtk/Makefile.in410
-rw-r--r--gdb/gdbtk/README289
-rw-r--r--gdb/gdbtk/TODO113
-rw-r--r--gdb/gdbtk/aclocal.m4879
-rwxr-xr-xgdb/gdbtk/configure4285
-rw-r--r--gdb/gdbtk/configure.ac12
-rw-r--r--gdb/gdbtk/gdb.rc1
-rw-r--r--gdb/gdbtk/gdbtool.icobin4710 -> 0 bytes
-rw-r--r--gdb/gdbtk/generic/ChangeLog-19971196
-rw-r--r--gdb/gdbtk/generic/ChangeLog-1998837
-rw-r--r--gdb/gdbtk/generic/ChangeLog-19992624
-rw-r--r--gdb/gdbtk/generic/ChangeLog-2000211
-rw-r--r--gdb/gdbtk/generic/gdbtk-bp.c996
-rw-r--r--gdb/gdbtk/generic/gdbtk-cmds.c3025
-rw-r--r--gdb/gdbtk/generic/gdbtk-cmds.h60
-rw-r--r--gdb/gdbtk/generic/gdbtk-hooks.c843
-rw-r--r--gdb/gdbtk/generic/gdbtk-interp.c187
-rw-r--r--gdb/gdbtk/generic/gdbtk-main.c37
-rw-r--r--gdb/gdbtk/generic/gdbtk-register.c585
-rw-r--r--gdb/gdbtk/generic/gdbtk-stack.c601
-rw-r--r--gdb/gdbtk/generic/gdbtk-varobj.c619
-rw-r--r--gdb/gdbtk/generic/gdbtk-wrapper.c757
-rw-r--r--gdb/gdbtk/generic/gdbtk-wrapper.h96
-rw-r--r--gdb/gdbtk/generic/gdbtk.c775
-rw-r--r--gdb/gdbtk/generic/gdbtk.h192
-rw-r--r--gdb/gdbtk/library/ChangeLog-19971487
-rw-r--r--gdb/gdbtk/library/ChangeLog-19983486
-rw-r--r--gdb/gdbtk/library/ChangeLog-19991083
-rw-r--r--gdb/gdbtk/library/ChangeLog-2000409
-rw-r--r--gdb/gdbtk/library/Makefile11
-rw-r--r--gdb/gdbtk/library/about.tcl43
-rw-r--r--gdb/gdbtk/library/actiondlg.tcl810
-rw-r--r--gdb/gdbtk/library/attachdlg.itb232
-rw-r--r--gdb/gdbtk/library/attachdlg.ith35
-rw-r--r--gdb/gdbtk/library/blockframe.itb227
-rw-r--r--gdb/gdbtk/library/blockframe.ith63
-rw-r--r--gdb/gdbtk/library/bpwin.itb728
-rw-r--r--gdb/gdbtk/library/bpwin.ith59
-rw-r--r--gdb/gdbtk/library/browserwin.itb731
-rw-r--r--gdb/gdbtk/library/browserwin.ith77
-rw-r--r--gdb/gdbtk/library/console.itb747
-rw-r--r--gdb/gdbtk/library/console.ith77
-rw-r--r--gdb/gdbtk/library/cspref.itb152
-rw-r--r--gdb/gdbtk/library/cspref.ith36
-rw-r--r--gdb/gdbtk/library/debugwin.itb483
-rw-r--r--gdb/gdbtk/library/debugwin.ith93
-rw-r--r--gdb/gdbtk/library/download.itb303
-rw-r--r--gdb/gdbtk/library/download.ith45
-rw-r--r--gdb/gdbtk/library/editor.tcl47
-rw-r--r--gdb/gdbtk/library/ehandler.itb31
-rw-r--r--gdb/gdbtk/library/ehandler.ith48
-rw-r--r--gdb/gdbtk/library/embeddedwin.ith25
-rw-r--r--gdb/gdbtk/library/gdbevent.itb205
-rw-r--r--gdb/gdbtk/library/gdbevent.ith220
-rw-r--r--gdb/gdbtk/library/gdbmenubar.itcl332
-rw-r--r--gdb/gdbtk/library/gdbtoolbar.itcl396
-rw-r--r--gdb/gdbtk/library/gdbwin.ith25
-rw-r--r--gdb/gdbtk/library/globalpref.itb482
-rw-r--r--gdb/gdbtk/library/globalpref.ith47
-rw-r--r--gdb/gdbtk/library/help/breakpoint.html107
-rw-r--r--gdb/gdbtk/library/help/browser.html77
-rw-r--r--gdb/gdbtk/library/help/console.html74
-rw-r--r--gdb/gdbtk/library/help/debug.html133
-rw-r--r--gdb/gdbtk/library/help/gbl_pref.html20
-rw-r--r--gdb/gdbtk/library/help/help.html34
-rw-r--r--gdb/gdbtk/library/help/images/browser1.pngbin11253 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/browser2.pngbin13764 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/frame_info.gifbin1196 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/insightbwr.pngbin1556 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/mem_menu.gifbin854 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/mem_popup.gifbin1264 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/mem_pref.gifbin5380 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/reg.pngbin12541 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/reg_menu.pngbin14377 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/src_bal.gifbin1267 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/src_bp_bal.gifbin2928 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/src_bpop.gifbin1099 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/src_menu.gifbin392 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/src_pop.gifbin1060 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/src_stat.gifbin1156 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/src_thread.gifbin3589 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/src_toolbar.gifbin3288 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/images/watch.pngbin14695 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/help/index.html35
-rw-r--r--gdb/gdbtk/library/help/license.html305
-rw-r--r--gdb/gdbtk/library/help/locals.html47
-rw-r--r--gdb/gdbtk/library/help/memory.html240
-rw-r--r--gdb/gdbtk/library/help/register.html48
-rw-r--r--gdb/gdbtk/library/help/session.html40
-rw-r--r--gdb/gdbtk/library/help/source.html424
-rw-r--r--gdb/gdbtk/library/help/src_pref.html20
-rw-r--r--gdb/gdbtk/library/help/stack.html50
-rw-r--r--gdb/gdbtk/library/help/target.html110
-rw-r--r--gdb/gdbtk/library/help/thread.html46
-rw-r--r--gdb/gdbtk/library/help/trace/console.html47
-rw-r--r--gdb/gdbtk/library/help/trace/gbl_pref.html20
-rw-r--r--gdb/gdbtk/library/help/trace/help.html32
-rw-r--r--gdb/gdbtk/library/help/trace/index.toc10
-rw-r--r--gdb/gdbtk/library/help/trace/license.html305
-rw-r--r--gdb/gdbtk/library/help/trace/locals.html83
-rw-r--r--gdb/gdbtk/library/help/trace/memory.html142
-rw-r--r--gdb/gdbtk/library/help/trace/reg_pref.html20
-rw-r--r--gdb/gdbtk/library/help/trace/register.html105
-rw-r--r--gdb/gdbtk/library/help/trace/source.html371
-rw-r--r--gdb/gdbtk/library/help/trace/src_pref.html20
-rw-r--r--gdb/gdbtk/library/help/trace/stack.html51
-rw-r--r--gdb/gdbtk/library/help/trace/target.html68
-rw-r--r--gdb/gdbtk/library/help/trace/tdump.html16
-rw-r--r--gdb/gdbtk/library/help/trace/tp.html111
-rw-r--r--gdb/gdbtk/library/help/trace/tracedlg.html134
-rw-r--r--gdb/gdbtk/library/help/trace/watch.html118
-rw-r--r--gdb/gdbtk/library/help/watch.html86
-rw-r--r--gdb/gdbtk/library/helpviewer.tcl98
-rw-r--r--gdb/gdbtk/library/images/Movie_off.gifbin326 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/Movie_on.gifbin359 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/bottom.gifbin84 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/bp.gifbin144 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/check.gifbin73 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/console.gifbin189 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/continue.gifbin108 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/down.gifbin80 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/edit.gifbin379 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/finish.gifbin89 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/gdbtk_icon.gifbin333 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/help.gifbin117 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/home.gifbin388 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/icons.txt1
-rw-r--r--gdb/gdbtk/library/images/insight.gifbin7573 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/less.gifbin115 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/memory.gifbin178 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/more.gifbin116 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/next.gifbin79 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/next_check.gifbin242 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/next_frame.gifbin217 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/next_hit.gifbin223 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/next_line.gifbin244 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/nexti.gifbin97 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/open.gifbin110 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/prev_hit.gifbin220 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/reg.gifbin121 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/rewind.gifbin217 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/run.gifbin105 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/run_expt.gifbin435 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/src.gifbin297 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/stack.gifbin174 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/step.gifbin89 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/stepi.gifbin104 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/stop.gifbin129 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/tdump.gifbin311 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/tp.gifbin228 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/up.gifbin79 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/vars.gifbin110 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/watch.gifbin185 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images/watch_movie.gifbin1106 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/Movie_off.gifbin326 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/Movie_on.gifbin359 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/bottom.gifbin178 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/bp.gifbin144 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/check.gifbin73 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/console.gifbin189 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/continue.gifbin131 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/down.gifbin175 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/edit.gifbin131 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/finish.gifbin145 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/function.gifbin137 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/gdbtk_icon.gifbin333 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/help.gifbin139 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/home.gifbin388 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/icons.txt1
-rw-r--r--gdb/gdbtk/library/images2/insight.gifbin7573 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/less.gifbin115 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/memory.gifbin178 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/more.gifbin116 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/next.gifbin144 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/next_check.gifbin242 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/next_frame.gifbin217 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/next_hit.gifbin223 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/next_line.gifbin244 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/nexti.gifbin154 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/open.gifbin110 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/prev_hit.gifbin220 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/reg.gifbin137 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/rewind.gifbin217 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/run.gifbin159 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/run_expt.gifbin435 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/src.gifbin269 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/stack.gifbin174 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/step.gifbin145 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/stepi.gifbin153 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/stop.gifbin168 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/target.gifbin205 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/tdump.gifbin311 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/tp.gifbin228 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/up.gifbin175 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/vars.gifbin110 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/watch.gifbin185 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/images2/watch_movie.gifbin1106 -> 0 bytes
-rw-r--r--gdb/gdbtk/library/interface.tcl1829
-rwxr-xr-xgdb/gdbtk/library/ipc.tcl135
-rw-r--r--gdb/gdbtk/library/ipcpref.itb135
-rw-r--r--gdb/gdbtk/library/ipcpref.ith33
-rw-r--r--gdb/gdbtk/library/kod.itb474
-rw-r--r--gdb/gdbtk/library/kod.ith63
-rw-r--r--gdb/gdbtk/library/locals.tcl170
-rw-r--r--gdb/gdbtk/library/main.tcl195
-rw-r--r--gdb/gdbtk/library/managedwin.itb419
-rw-r--r--gdb/gdbtk/library/managedwin.ith72
-rw-r--r--gdb/gdbtk/library/mempref.itb424
-rw-r--r--gdb/gdbtk/library/mempref.ith70
-rw-r--r--gdb/gdbtk/library/memwin.itb776
-rw-r--r--gdb/gdbtk/library/memwin.ith85
-rw-r--r--gdb/gdbtk/library/modal.tcl105
-rw-r--r--gdb/gdbtk/library/pluginwin.itcl184
-rw-r--r--gdb/gdbtk/library/prefs.tcl764
-rw-r--r--gdb/gdbtk/library/process.itb161
-rw-r--r--gdb/gdbtk/library/process.ith41
-rw-r--r--gdb/gdbtk/library/regwin.itb1051
-rw-r--r--gdb/gdbtk/library/regwin.ith103
-rw-r--r--gdb/gdbtk/library/session.tcl335
-rw-r--r--gdb/gdbtk/library/srcbar.itcl1245
-rw-r--r--gdb/gdbtk/library/srcpref.itb281
-rw-r--r--gdb/gdbtk/library/srcpref.ith38
-rw-r--r--gdb/gdbtk/library/srctextwin.itb2971
-rw-r--r--gdb/gdbtk/library/srctextwin.ith163
-rw-r--r--gdb/gdbtk/library/srcwin.itb1058
-rw-r--r--gdb/gdbtk/library/srcwin.ith106
-rw-r--r--gdb/gdbtk/library/stackwin.itb158
-rw-r--r--gdb/gdbtk/library/stackwin.ith46
-rw-r--r--gdb/gdbtk/library/targetselection.itb1100
-rw-r--r--gdb/gdbtk/library/targetselection.ith100
-rw-r--r--gdb/gdbtk/library/tclIndex639
-rw-r--r--gdb/gdbtk/library/tdump.tcl93
-rw-r--r--gdb/gdbtk/library/tfind_args.tcl139
-rw-r--r--gdb/gdbtk/library/toplevelwin.ith64
-rw-r--r--gdb/gdbtk/library/tracedlg.tcl800
-rw-r--r--gdb/gdbtk/library/tty.tcl55
-rw-r--r--gdb/gdbtk/library/util.tcl331
-rw-r--r--gdb/gdbtk/library/vartree.itb431
-rw-r--r--gdb/gdbtk/library/vartree.ith77
-rw-r--r--gdb/gdbtk/library/warning.tcl102
-rw-r--r--gdb/gdbtk/library/watch.tcl218
-rw-r--r--gdb/gdbtk/plugins/ChangeLog22
-rw-r--r--gdb/gdbtk/plugins/HOW-TO414
-rw-r--r--gdb/gdbtk/plugins/Make-rules166
-rw-r--r--gdb/gdbtk/plugins/Makefile.am4
-rw-r--r--gdb/gdbtk/plugins/Makefile.in460
-rw-r--r--gdb/gdbtk/plugins/acinclude.m41
-rw-r--r--gdb/gdbtk/plugins/aclocal.m4880
-rwxr-xr-xgdb/gdbtk/plugins/configure4974
-rw-r--r--gdb/gdbtk/plugins/configure.ac111
-rw-r--r--gdb/gdbtk/plugins/intel-pentium/ChangeLog43
-rw-r--r--gdb/gdbtk/plugins/intel-pentium/Makefile.in6
-rw-r--r--gdb/gdbtk/plugins/intel-pentium/cpuinfo.tcl33
-rw-r--r--gdb/gdbtk/plugins/intel-pentium/intel-pentium.tcl.in4
-rw-r--r--gdb/gdbtk/plugins/intel-pentium/msrselection.itb192
-rw-r--r--gdb/gdbtk/plugins/intel-pentium/msrselection.ith38
-rw-r--r--gdb/gdbtk/plugins/intel-pentium/pkgIndex.tcl1
-rw-r--r--gdb/gdbtk/plugins/intel-pentium/tclIndex17
-rw-r--r--gdb/gdbtk/plugins/plugins.tcl30
-rw-r--r--gdb/gdbtk/plugins/rhabout/ChangeLog24
-rw-r--r--gdb/gdbtk/plugins/rhabout/Makefile.in9
-rw-r--r--gdb/gdbtk/plugins/rhabout/pkgIndex.tcl2
-rw-r--r--gdb/gdbtk/plugins/rhabout/rhabout.c57
-rw-r--r--gdb/gdbtk/plugins/rhabout/rhabout.itcl87
-rw-r--r--gdb/gdbtk/plugins/rhabout/rhabout.tcl.in5
-rw-r--r--gdb/gdbtk/plugins/rhabout/tclIndex9
-rw-r--r--gold/ChangeLog1884
-rw-r--r--gold/Makefile.am227
-rw-r--r--gold/Makefile.in1139
-rw-r--r--gold/i386.cc2610
-rw-r--r--gold/po/POTFILES.in79
-rw-r--r--gold/powerpc.cc1973
-rw-r--r--gold/script.cc2517
-rw-r--r--gold/sparc.cc3200
-rw-r--r--gold/symtab.h1603
-rw-r--r--gold/testsuite/Makefile.am893
-rw-r--r--gold/testsuite/Makefile.in2300
-rw-r--r--gold/testsuite/script_test_2.cc74
-rw-r--r--gold/testsuite/script_test_2.t68
-rwxr-xr-xgold/testsuite/weak_plt.sh28
-rw-r--r--gold/testsuite/weak_plt_main.cc33
-rw-r--r--gold/testsuite/weak_plt_shared.cc29
-rw-r--r--gold/x86_64.cc2608
-rw-r--r--gprof/ChangeLog429
-rw-r--r--gprof/Makefile.am313
-rw-r--r--gprof/Makefile.in1064
-rw-r--r--gprof/corefile.c790
-rw-r--r--gprof/symtab.c275
-rw-r--r--itcl/ChangeLog1295
-rwxr-xr-xitcl/itk/configure11928
-rw-r--r--itcl/itk/configure.ac275
-rw-r--r--itcl/itk/itkConfig.sh.in58
-rw-r--r--ld/ChangeLog664
-rw-r--r--ld/Makefile.am2051
-rw-r--r--ld/Makefile.in2844
-rw-r--r--ld/emultempl/pe.em1954
-rw-r--r--ld/emultempl/pep.em1717
-rw-r--r--ld/emultempl/spu_ovl.o_c101
-rw-r--r--ld/emultempl/spuelf.em682
-rw-r--r--ld/pe-dll.c2896
-rw-r--r--ld/po/POTFILES.in32
-rw-r--r--ld/testsuite/ChangeLog566
-rw-r--r--ld/testsuite/ld-elf/sec-to-seg-script-adjoining-pages.t11
-rw-r--r--ld/testsuite/ld-elf/sec-to-seg-script-disjoint-pages.t11
-rw-r--r--ld/testsuite/ld-elf/sec-to-seg-script-same-page.t10
-rw-r--r--ld/testsuite/ld-elf/sec-to-seg.exp97
-rw-r--r--ld/testsuite/ld-elf/sec-to-seg1.s9
-rw-r--r--ld/testsuite/ld-elf/sec-to-seg2.s13
-rw-r--r--ld/testsuite/ld-gc/gc.exp81
-rw-r--r--ld/testsuite/ld-i386/tlsbindesc.dd456
-rw-r--r--ld/testsuite/ld-i386/tlsbindesc.rd151
-rw-r--r--ld/testsuite/ld-x86-64/tlsbindesc.dd301
-rw-r--r--ld/testsuite/ld-x86-64/tlsbindesc.rd138
-rw-r--r--libgui/ChangeLog1285
-rw-r--r--libgui/Makefile.in475
-rw-r--r--libgui/acinclude.m443
-rw-r--r--libgui/aclocal.m4892
-rwxr-xr-xlibgui/configure6398
-rw-r--r--libgui/configure.ac131
-rw-r--r--libgui/library/Makefile.in395
-rw-r--r--libgui/src/Makefile.in499
-rw-r--r--winsup/cygwin/ChangeLog2551
-rw-r--r--winsup/cygwin/Makefile.in478
-rw-r--r--winsup/cygwin/cygwin.din1765
-rw-r--r--winsup/cygwin/dcrt0.cc1176
-rw-r--r--winsup/cygwin/dll_init.cc461
-rw-r--r--winsup/cygwin/dll_init.h93
-rw-r--r--winsup/cygwin/exceptions.cc1432
-rw-r--r--winsup/cygwin/external.cc365
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc2109
-rw-r--r--winsup/cygwin/fhandler_socket.cc1878
-rw-r--r--winsup/cygwin/include/cygwin/version.h410
-rw-r--r--winsup/cygwin/include/sys/utmp.h54
-rw-r--r--winsup/cygwin/init.cc161
-rw-r--r--winsup/cygwin/lib/crt0.h23
-rw-r--r--winsup/cygwin/lib/cygwin_crt0.c24
-rw-r--r--winsup/cygwin/libc/bsdlib.cc303
-rw-r--r--winsup/cygwin/mount.cc1359
-rw-r--r--winsup/cygwin/path.cc3627
-rw-r--r--winsup/cygwin/path.h360
-rw-r--r--winsup/cygwin/regex/regex.h76
-rw-r--r--winsup/cygwin/sec_auth.cc1171
-rw-r--r--winsup/cygwin/security.h450
-rw-r--r--winsup/cygwin/select.cc1606
-rw-r--r--winsup/cygwin/shared.cc431
-rw-r--r--winsup/cygwin/shared_info.h191
-rw-r--r--winsup/cygwin/spawn.cc1101
-rw-r--r--winsup/cygwin/syscalls.cc3875
-rw-r--r--winsup/mingw/ChangeLog3903
-rw-r--r--winsup/mingw/Makefile.in538
-rwxr-xr-xwinsup/mingw/configure4351
-rw-r--r--winsup/mingw/configure.in86
-rw-r--r--winsup/mingw/mingwex/Makefile.in307
-rw-r--r--winsup/mingw/mingwex/stdio/pformat.c2511
-rw-r--r--winsup/mingw/mingwex/stdio/pformat.h90
-rw-r--r--winsup/mingw/mingwex/stdio/snprintf.c44
-rw-r--r--winsup/mingw/mingwex/stdio/vsnprintf.c55
-rw-r--r--winsup/mingw/ofmt_stub.s40
-rw-r--r--winsup/utils/ChangeLog2452
-rw-r--r--winsup/utils/Makefile.in180
-rw-r--r--winsup/utils/cygcheck.cc2183
407 files changed, 0 insertions, 259558 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
deleted file mode 100644
index 1023e26b0a4..00000000000
--- a/binutils/ChangeLog
+++ /dev/null
@@ -1,548 +0,0 @@
-2008-08-04 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am (POTFILES.in): Set LC_ALL=C.
- * Makefile.in: Regenerate.
-
-2008-08-04 Markus Weiss <weissms@aros.org>
-
- * readelf.c (get_osabi_name <ELFOSABI_AROS>): Change name.
-
-2008-08-01 H.J. Lu <hongjiu.lu@intel.com>
-
- * dwarf.c (dwarf_regnames_i386): Remove AVX registers.
- (dwarf_regnames_x86_64): Likewise.
-
-2008-07-30 Alan Modra <amodra@bigpond.net.au>
-
- * dlltool.c, dwarf.c, objdump.c, readelf.c, resrc.c, resres.c,
- windmc.c: Silence gcc warnings.
-
-2008-07-28 Alan Modra <amodra@bigpond.net.au>
-
- * readelf.c (print_vma): Typo fix.
-
-2008-07-28 Alan Modra <amodra@bigpond.net.au>
-
- PR 6769
- * readelf.c (print_dec_vma, print_hex_vma): Delete.
- (print_vma): Use BFD_VMA_FMT.
- * size.c (size_number, rprint_number): Likewise.
-
-2008-07-26 Michael Eager <eager@eagercon.com>
-
- * readelf.c (display_power_gnu_attribute): Display
- single-precision hard float.
-
-2008-07-21 Luis Machado <luisgpm@br.ibm.com>
-
- * readelf.c (get_note_type): Handle VSX notes.
-
-2008-07-15 H.J. Lu <hongjiu.lu@intel.com>
-
- * objdump.c (load_debug_section): Initialize section_is_compressed
- for gcc 3.4/ia64.
- * readelf.c (load_debug_section): Likewise.
-
-2008-07-12 Jie Zhang <jie.zhang@analog.com>
-
- Revert
- 2008-07-12 Jie Zhang <jie.zhang@analog.com>
- * readelf.c (get_machine_flags): Deal with Blackfin specific
- flags.
-
-2008-07-12 Jie Zhang <jie.zhang@analog.com>
-
- * readelf.c (get_machine_flags): Deal with Blackfin specific
- flags.
-
-2008-07-09 Craig Silverstein <csilvers@google.com>
-
- * config.in: Add HAVE_ZLIB_H
- * configure.in: Add test for libz and zlib.h
- * configure: Regenerate.
- * dwarf.c (debug_displays): Add .zdebug_* strings.
- * dwarf.h (struct dwarf_section): Add fields uncompressed_namd
- and compressed_name.
- * objdump.c (load_debug_section): Call
- bfd_uncompress_section_contents when loading a compressed
- section.
- (dump_dwarf_section): Recognize compressed section name.
- (mach_o_dwarf_sections): Rename as
- mach_o_uncompressed_dwarf_sections.
- (mach_o_compressed_dwarf_sections): New variable.
- (generic_dwarf_section): Rename as
- generic_uncompressed_dwarf_sections.
- (generic_compressed_dwarf_sections): New variable.
- (check_mach_o_dwarf): Save and restore
- mach_o_compressed_dwarf_sections.
- * readelf.c: Add #include for config.h and zlib.h
- (process_section_headers): Recognize compressed section name.
- (uncompress_section_contents): New function.
- (load_debug_section): Call uncompress_section_contents when
- loading a compressed section.
- (display_debug_section): Recognize compressed section name.
-
-2008-07-07 Alan Modra <amodra@bigpond.net.au>
-
- * objdump.c (find_symbol_for_address): Prefer symbols in current
- section.
-
-2008-07-07 Alan Modra <amodra@bigpond.net.au>
-
- * ieee.c (write_ieee_debugging_info): Use bfd_make_section_with_flags.
- * nlmconv.c (main, powerpc_build_stubs): Likewise.
- * rescoff.c (write_coff_file): Likewise.
- * resres.c (write_res_file): Likewise.
- * windmc.c (windmc_write_bin): Likewise.
-
-2008-06-18 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
-
- * readelf.c (guess_is_rela): Add EM_CR16_OLD.
- (dump_relocations): Likewise.
- (get_machine_name): Likewise.
- (is_32bit_abs_reloc): Likewise.
-
-2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * configure: Regenerate.
-
-2008-06-12 DJ Delorie <dj@redhat.com>
-
- * readelf.c (guess_is_rela): Add EM_M32C_OLD.
- (dump_relocations): Likewise.
- (process_section_headers): Likewise.
- (is_32bit_abs_reloc): Likewise.
- (is_16bit_abs_reloc): Likewise.
-
-2008-06-12 Nick Clifton <nickc@redhat.com>
-
- PR binutils/6483
- * objdump.c (dump_bfd): If the -g option found no STABS or IEEE
- debug information to display, try dumping DWARF information
- instead.
- * rddbg.c (read_debugging_info): Add a parameter to suppress the
- display of a warning message when no debug information is found.
- * budbg.h (read_debugging_info): Update prototype.
- * objcopy.c (copy_object): Continue to allow read_debugging_info
- to produce warning messages.
- * doc/binutils.texi (--debugging): Document new behaviour of the
- -g/--debugging option.
-
-2008-06-10 Ben Elliston <bje@gnu.org>
-
- * MAINTAINERS: Remove myself as m68k maintainer.
-
-2008-05-14 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.in: Regenerate.
- * doc/Makefile.in: Regenerate.
-
-2008-05-12 Alan Modra <amodra@bigpond.net.au>
-
- * embedspu.sh: Test for presence of ._ea by looking at section
- table rather than looking at relocs. Correct toe_addr substitution.
-
-2008-05-08 Alan Modra <amodra@bigpond.net.au>
-
- * embedspu.sh: Take note of R_SPU_PPU32/64 relocs without a symbol,
- and if present, put image in ".data.speelf". Put program handle
- in ".data.spehandle".
-
-2008-05-01 Nick Clifton <nickc@redhat.com>
-
- * readelf.c (print_symbol): Add code to display non-printing
- characters.
-
-2008-04-30 John Heidemann <johnh@isi.edu>
-
- * doc/binutils.texi (strings): Add "unicode" to the documentation
- of strings in order to make explicit that it supports this
- feature.
-
-2008-04-30 Alan Modra <amodra@bigpond.net.au>
-
- * readelf.c (process_program_headers): Correct section in segment
- display.
-
-2008-04-28 M Thomas <mthomas@rhrk.uni-kl.de>
- Nick Clifton <nickc@redhat.com>
-
- PR binutils/6449
- * objdump.c (slurp_file): Open the file in binary mode.
- * ar.c: Remove conditional definition of O_BINARY.
- * bin2.c: Likewise.
- * rename.c: Likewise.
- * strings.c: Likewise.
- * sysdep.h: Add conditional definition of O_BINARY.
-
-2008-04-23 Paolo Bonzini <bonzini@gnu.org>
-
- * aclocal.m4: Regenerate.
- * configure: Regenerate.
-
-2008-04-16 Jean-Yves Lefort <jylefort@brutele.be>
-
- PR binutils/6034
- * objcopy.c (stuct symlist): Rename to
- is_specified_symbol_predicate_data.
- (strip_specific_list): Rename to strip_specific_htab.
- (strip_unneeded_list): Rename to strip_unneeded_htab.
- (keep_specific_list): Rename to keep_specific_htab.
- (localize_specific_list): Rename to localize_specific_htab.
- (globalize_specific_list): Rename to globalize_specific_htab.
- (keepglobal_specific_list): Rename to keepglobal_specific_htab.
- (weaken_specific_list): Rename to weaken_specific_htab.
- (eq_string): New function.
- (create_symbol_htab): New function.
- (create_symbol_htabs): New function.
- (add_specific_symbol): Change to use hash tables.
- (is_specified_symbol_predicate): New function.
- (is_specified_symbol): Use hash table lookup.
- (is_strip_section): Update to use new functions and hash tables.
- (filter_symbols): Likewise.
- (copy_object): Likewise.
- (copy_section): Likewise.
- (strip_main): Likewise.
- (copy_main): Likewise.
- (main): Likewise.
-
-2008-04-14 David S. Miller <davem@davemloft.net>
-
- * readelf.c (get_gnu_elf_note_type): Recognize NT_GNU_GOLD_VERSION.
-
-2008-04-11 Torleif Sandnes <torleif.sandnes@gmail.com>
-
- * dwarf.c (display_debug_lines): Rename to
- display_debug_lines_raw.
- (display_debug_lines_decoded): New function. Displays the
- interpreted contents of a .debug_line section.
- (display_debug_lines): New function: Selects either a raw dump or
- a decoded dump (or both) as requested by the user.
- * dwarf.h (do_debug_lines_decoded): New extern.
- * readelf.c: Add support for -wL or --debug-dump=decodedline
- option to display the decoded contents of a .debug_line section.
- * doc/binutils.texi: Document the new option.
- * NEWS: Mention the new feature.
-
-2008-04-08 Alan Modra <amodra@bigpond.net.au>
-
- * dwarf.c: Remove trailing whitespace throughout file.
-
-2008-04-04 Nick Clifton <nickc@redhat.com>
-
- * po/sk.po: Updated Slovak translation.
-
-2008-04-03 H.J. Lu <hongjiu.lu@intel.com>
-
- * dwarf.c (dwarf_regnames_i386): Add AVX registers.
- (dwarf_regnames_x86_64): Likewise.
-
-2008-03-27 Cary Coutant <ccoutant@google.com>
-
- Add support for thin archives.
- * ar.c (make_thin_archive): New global flag.
- (map_over_members): Deal with full pathnames in thin archives.
- (usage, main): Add 'T' option for building thin archives.
- (replace_members): Pass thin archive flag to ar_emul_append.
- * arsup.c (ar_open): Initialize new flag.
- * binemul.c (ar_emul_append): Add new parameter for
- flattening nested archives.
- (do_ar_emul_default_append): New function.
- (ar_emul_default_append): Factored out recursive code.
- * binutils/binemul.h (ar_emul_default_append): Add new parameter.
- (struct bin_emulation_xfer_struct): New parameter for ar_append.
- * dlltool.c (gen_lib_file): Initialize thin archive flag.
- * emul_aix.c (ar_emul_aix_internal): Add new flatten
- parameter, currently unimplemented.
- All callers changed.
- * objcopy.c (copy_archive): Preserve thin archive flag.
- * doc/binutils.texi: Update ar documentation.
- * NEWS: Mention the new feature.
-
-2008-03-20 H.J. Lu <hongjiu.lu@intel.com>
-
- * readelf.c (process_mips_specific): Declare addr_size as int.
-
-2008-03-20 Richard Sandiford <rsandifo@nildram.co.uk>
-
- * readelf.c (print_mips_got_entry): New function.
- (process_mips_specific): Print GOT information.
-
-2008-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * aclocal.m4: Regenerate.
- * configure: Likewise.
- * Makefile.in: Likewise.
- * doc/Makefile.in: Likewise.
-
-2008-03-16 Brian Dessent <brian@dessent.net>
-
- * rcparse.y (resid): Allow control text to span multiple lines.
-
-2008-03-13 Alan Modra <amodra@bigpond.net.au>
-
- * readelf.c: Use %u throughout when printing sh_link or sh_info,
- %lu when printing sh_addralign.
- (process_version_sections): Use identical formats when printing
- all offset and sh_link fields.
-
-2008-03-13 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am: Run "make dep-am".
- * Makefile.in: Regenerate.
- * doc/Makefile.in: Regenerate.
- * configure: Regenerate.
-
-2008-03-12 Alan Modra <amodra@bigpond.net.au>
-
- PR 5900
- * readelf.c (SECTION_HEADER_INDEX, SECTION_HEADER_NUM): Delete.
- Remove use throughout file.
- (SECTION_HEADER): Likewise.
- (dump_relocations): Don't adjust st_shndx for reserved range.
- (process_file_header): Mask SHN_XINDEX to values seen in external
- elf structs. Simplify valid section index tests.
- (get_32bit_elf_symbols, get_64bit_elf_symbols): Mask SHN_XINDEX.
- Map reserved st_shndx to internal form.
- (process_section_groups): Test that group symbol st_shndx is in
- range, not just non-zero. Delete reserved range check.
- (get_symbol_index_type): Mask "type" to 16 bits when printing PRC,
- OS or RSV.
-
-2008-03-09 Paul Brook <paul@codesourcery.com>
-
- * readelf.c (arm_attr_tag_VFP_arch): Add "VFPv3-D16".
-
-2008-03-03 James E. Wilson <wilson@tuliptree.org>
-
- * MAINTAINERS: Update my email address.
-
-2008-03-03 Nick Clifton <nickc@redhat.com>
-
- * dwarf.c (decode_location_expression): Handle
- DW_OP_PGI_omp_thread_num.
-
-2008-03-01 Alan Modra <amodra@bigpond.net.au>
-
- * objdump.c (objdump_print_addr): Initialise "sym".
-
-2008-02-27 Justin Pryzby <justinpryzby@users.sourceforge.net>
- Nick Clifton <nickc@redhat.com>
-
- * ar.c (usage): Mention -t command line switch.
- * doc/binutils.texi (ranlib): Document -t command line switch.
-
-2008-02-26 Nick Clifton <nickc@redhat.com>
-
- * objdump.c (objdump_print_addr): If displaying file offsets, show
- the offset even if there are no symbols available.
- (dump_section): Display nothing if none of the section is going to
- be dumped. Display the file offset, if requested, of the location
- from where the dump starts.
- * doc/binutils.texi (objdump): Mention that dumping via the -s
- switch is also affected by the -F option.
-
-2008-02-26 Nick Clifton <nickc@redhat.com>
-
- Re-apply this patch which was accidentally deleted:
- 2006-05-16 Carlos O'Donell <carlos@codesourcery.com>
-
- * doc/binutils.texi: Use "Binutils Index" for index name.
-
-2008-02-22 Nick Clifton <nickc@redhat.com>
-
- * objdump.c (display_file_offsets): New variable.
- (long_options): Add -F/--file-offsets.
- (objdump_print_addr_with_sym): If displaying file offsets, print
- the offset of the given address.
- (disassemble_bytes): If displaying file offsets, tell the user how
- many zeroes are skipped and the file offset of the point where
- dumping resumes.
- (disassemble_section): Only display the name of the section if
- data is going to be dumped from it.
- (main): Handle new option. Produce error messages if the start or
- stop addresses do not make sense.
- * doc/binutils.texi: Document the new feature.
- * NEWS: Mention the new feature.
-
-2008-02-15 Chu Li <chul@cn.fujitsu.com>
- Nick Clifton <nickc@redhat.com>
-
- PR binutils/5713
- * strings.c (integer_arg): Delete function.
- (string_min): Initialise to 4.
- (main): Use strtoul to parse integer arguments.
- Move check for an invalid string length to after all the arguments
- have been parsed.
- (usage): Use indentation to indicate that -<n> is a another form
- of the --bytes= command line option.
-
-2008-02-12 Nick Clifton <nickc@redhat.com>
-
- * dlltool.c (mcore_elf_cache_filename): Add a const qualifier to
- the argument.
- (scan_obj_filename): Do not drop the const qualifier when calling
- mcore_elf_cache_filename.
- (struct fname_cache): Add const qualifier to filename field.
-
-2008-02-08 H.J. Lu <hongjiu.lu@intel.com>
-
- PR binutils/5713
- * strings.c (main): Set string_min to 4 if it is <= 0.
-
-2008-02-07 Alan Modra <amodra@bigpond.net.au>
-
- * objdump.c (main): Don't pass unadorned NULL to concat.
-
-2008-02-04 H.J. Lu <hongjiu.lu@intel.com>
-
- PR 5715
- * configure: Regenerated.
-
-2008-02-03 Adam Nemet <anemet@caviumnetworks.com>
-
- * readelf.c (get_machine_flags): Handle Octeon.
-
-2008-01-30 Tristan Gingold <gingold@adacore.com>
-
- * readelf.c (dump_relocations): Decode OpenVMS-specific sections.
- (get_ia64_dynamic_type): Decode OpenVMS-specific tags.
- (get_dynamic_type): Handle IA64-specific tags.
- (get_ia64_section_type_name): Handle OpenVMS-specific sections.
- (get_section_type_name): Handle OS-specific sections (and
- particularly IA64 OpenVMS one).
- (get_elf_section_flags): Makes flags static. Add entries for IA64 and
- decode them.
-
-2008-01-29 Nick Clifton <nickc@redhat.com>
-
- * dwarf.c (print_dwarf_vma): New function. Display the value of a
- dwarf_vma type at a specified precision. Use mingw field type
- specifier if necessary.
- (display_debug_loc): Use dwarf_vma type for begin and end values.
- Use print_dwarf_vma to display their values. Use byte_get_signed
- in order to correctly detect the -1 escape value.
- (display_debug_aranges): Likewise.
- (display_debug_ranges): Likewise.
-
-2008-01-29 Alan Modra <amodra@bigpond.net.au>
-
- * dwarf.c (display_debug_loc): Correct test for base address
- entry when 64-bit host dumping 32-bit object.
-
-2008-01-29 Alan Modra <amodra@bigpond.net.au>
-
- * MAINTAINERS: Remove myself as ix86 maintainer. Add for SPU.
-
-2008-01-28 Nick Clifton <nickc@redhat.com>
-
- PR binutils/5529
- * rclex.c (yylex): Also allow the hypen character.
-
-2008-01-28 H.J. Lu <hongjiu.lu@intel.com>
-
- * dwarf.c: Include "elf/common.h".
- (eh_addr_size): Changed to int.
- (dwarf_regnames_i386): New.
- (dwarf_regnames_x86_64): Likewise.
- (dwarf_regnames): Likewise.
- (dwarf_regnames_count): Likewise.
- (init_dwarf_regnames): Likewise.
- (regname): Likewise.
- (frame_display_row): Properly support different address size.
- Call regname to get register name.
- (display_debug_frames): Call regname to get register name.
- Display DW_CFA_def_cfa_register as DW_CFA_def_cfa_register
- instead of DW_CFA_def_cfa_reg.
-
- * dwarf.h (init_dwarf_regnames): New.
-
- * objdump.c: Include "elf-bfd.h".
- (dump_dwarf): Call init_dwarf_regnames on ELF input.
-
- * readelf.c (guess_is_rela): Change argument to int.
- (parse_args): Remove the undocumented upper case options for
- -wX.
- (process_file_header): Call init_dwarf_regnames.
-
-2008-01-25 DJ Delorie <dj@redhat.com>
-
- * readelf.c (process_section_headers): Add m16c handler.
- (is_16bit_abs_reloc): Recognize R_M32C_16.
-
-2008-01-25 Kai Tietz <kai.tietz@onevision.com>
-
- * prdbg.c: Correct formatter style use.
- * readelf.c: Likewise.
- * strings.c: Likewise.
-
-2008-01-25 Nick Clifton <nickc@redhat.com>
-
- * po/ru.po: Updated Russian translation.
-
-2008-01-17 H.J. Lu <hjl.tools@gmail.com>
-
- * MAINTAINERS: Update my email address.
-
-2008-01-14 Nick Clifton <nickc@redhat.com>
-
- * dwarf.c (process_debug_info): Include the CU offset and corrupt
- version value when reporting unrecognised DWARF version numbers.
- (load_debug_info): Remember a failed attempt to load and parse the
- .debug_info section and do not repeat such attempts.
- (display_debug_lines): Check the return value from load_debug_info
- and return whilst displaying a warning message if the load failed.
- (display_debug_loc): Likewise.
- (display_debug_ranges): Likewise.
- (DEBUG_INFO_UNAVAILABLE): Value stored in num_debug_info_entries
- when the .debug_info section could not be loaded/parsed.
- (process_debug_info): Display the length of the compilation unit
- in hex, so that it corresponds with the offsets that will follow.
- Tell the user if the length was 32-bit or 64-bit.
- If a DIE abbreviation could not be found, tell the user the offset
- of the DIE.
- (free_debug_memory): Do not attempt to free any entries in the
- debug_information array if num_debug_info_entries is set to
- DEBUG_INFO_UNAVAILABLE.
-
-2008-01-10 Andreas Schwab <schwab@suse.de>
-
- * readelf.c (is_64bit_abs_reloc): Handle R_S390_64.
-
-2008-01-09 Jakub Zawadzki <darkjames@darkjames.ath.cx>
-
- PR binutils/55326
- * bucomm.c (list_supported_architectures): Free architecture list
- after use.
- * windres.c (set_endianess): Likewise.
- * windmc.c (set_endianess): Likewise.
-
-2008-01-08 Kai Tietz <kai.tietz@onevision.com>
-
- PR binutils/5529
- * binutils/rclex.c: (yylex): Add ':', '_', '\\', and '/' to post
- characters for name tokens.
-
-2008-01-04 Greg McGary <greg@mcgary.org>
-
- * prdbg.c (print_vma): Print as long long, if host supports it.
-
-2008-01-03 Nick Clifton <nickc@redhat.com>
-
- * dwarf.c (read_and_display_attr_value): Prefix values that are
- displayed in hexadecimal with 0x.
- For the DW_AT_import attribute display the abbreviation number and
- tag of the imported DIE.
- (process_debug_info): Warn about lengths that reserved by the
- DWARF3 specification.
- Provide more information when corrupted DIEs are detected.
- Warn if DIE corruption makes the sibling level negative.
-
-For older changes see ChangeLog-2007
-
-Local Variables:
-mode: change-log
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
diff --git a/binutils/Makefile.am b/binutils/Makefile.am
deleted file mode 100644
index 3a1d19a1fa0..00000000000
--- a/binutils/Makefile.am
+++ /dev/null
@@ -1,706 +0,0 @@
-## Process this file with automake to generate Makefile.in
-
-AUTOMAKE_OPTIONS = cygnus dejagnu
-ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
-
-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@
-NO_WERROR = @NO_WERROR@
-AM_CFLAGS = $(WARN_CFLAGS)
-LIBICONV = @LIBICONV@
-
-# 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
-WINDMC_PROG=windmc
-DLLWRAP_PROG=dllwrap
-
-SRCONV_PROG=srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT)
-
-bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ @BUILD_WINDMC@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_INSTALL_MISC@
-
-## We need a special rule to install the programs which are built with
-## -new, and to rename cxxfilt to c++filt.
-RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
-noinst_PROGRAMS = $(RENAMED_PROGS) @BUILD_MISC@
-
-EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG)
-
-# Stuff that goes in tooldir/ if appropriate.
-TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy
-
-BASEDIR = $(srcdir)/..
-BFDDIR = $(BASEDIR)/bfd
-INCDIR = $(BASEDIR)/include
-
-MKDEP = gcc -MM
-
-INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
- @HDEFINES@ \
- @INCINTL@ \
- -DLOCALEDIR="\"$(datadir)/locale\"" \
- -Dbin_dummy_emulation=$(EMULATION_VECTOR)
-
-HFILES = \
- arsup.h binemul.h bucomm.h budbg.h \
- coffgrok.h debug.h dlltool.h dwarf.h nlmconv.h \
- sysdep.h unwind-ia64.h windres.h winduni.h windint.h \
- windmc.h
-
-GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h mcparse.h
-
-CFILES = \
- addr2line.c ar.c arsup.c bin2c.c binemul.c bucomm.c \
- coffdump.c coffgrok.c cxxfilt.c \
- dwarf.c debug.c dlltool.c dllwrap.c \
- emul_aix.c emul_vanilla.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 \
- rclex.c rdcoff.c rddbg.c readelf.c rename.c \
- resbin.c rescoff.c resrc.c resres.c \
- size.c srconv.c stabs.c strings.c sysdump.c \
- unwind-ia64.c version.c \
- windres.c winduni.c wrstabs.c \
- windmc.c mclex.c
-
-GENERATED_CFILES = \
- arparse.c arlex.c sysroff.c sysinfo.c syslex.c \
- defparse.c deflex.c nlmheader.c rcparse.c mcparse.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
-
-.PHONY: install-html install-html-am install-html-recursive
-
-install-html: install-html-recursive
-
-install-html-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-POTFILES = $(CFILES) $(DEBUG_SRCS) $(HFILES)
-po/POTFILES.in: @MAINT@ Makefile
- for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
- && mv tmp $(srcdir)/po/POTFILES.in
-
-EXPECT = expect
-RUNTEST = runtest
-
-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; \
- runtest=$(RUNTEST); \
- if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
- CC_FOR_TARGET="$(CC_FOR_TARGET)" CFLAGS_FOR_TARGET="$(CFLAGS)" \
- $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
- $(RUNTESTFLAGS); \
- else echo "WARNING: could not find \`runtest'" 1>&2; :;\
- fi
-
-installcheck:
- /bin/sh $(srcdir)/sanity.sh $(bindir)
-
-# There's no global DEPENDENCIES. So, we must explicitly list everything
-# which depends on libintl, since we don't know whether LIBINTL_DEP will be
-# non-empty until configure time. Ugh!
-size_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-objdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) $(OPCODES)
-nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-ar_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-strings_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-ranlib_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-cxxfilt_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-objcopy_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-nlmconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-srconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-dlltool_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-windres_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-windmc_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
-dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
-
-LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
-
-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 dwarf.c
-readelf_LDADD = $(LIBINTL) $(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 dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS)
-objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
-
-objdump.o:objdump.c
- $(COMPILE) -c $(OBJDUMP_DEFS) $(srcdir)/objdump.c
-
-cxxfilt_SOURCES = cxxfilt.c $(BULIBS)
-
-ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \
- emul_$(EMULATION).c $(BULIBS)
-ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL)
-
-ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c \
- binemul.c emul_$(EMULATION).c $(BULIBS)
-ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL)
-
-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:
- if [ -r syslex.c ]; then \
- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) syslex.c -Wno-error ; \
- else \
- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/syslex.c -Wno-error ;\
- fi
-
-sysinfo.o:
- if [ -r sysinfo.c ]; then \
- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) sysinfo.c -Wno-error ; \
- else \
- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c -Wno-error ; \
- fi
-
-bin2c$(EXEEXT_FOR_BUILD):
- $(CC_FOR_BUILD) -o $@ $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) $(srcdir)/bin2c.c $(srcdir)/version.c
-
-embedspu: embedspu.sh
- sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@
- chmod a+x $@
-
-# We need these for parallel make.
-arparse.h: arparse.c
-defparse.h: defparse.c
-nlmheader.h: nlmheader.c
-rcparse.h: rcparse.c
-mcparse.h: mcparse.c
-sysinfo.h: sysinfo.c
-
-# Disable -Werror, if it has been enabled, since old versions of bison/
-# yacc will produce working code which contain compile time warnings.
-arparse.o:
- $(COMPILE) -c $< $(NO_WERROR)
-arlex.o:
- $(COMPILE) -c $< $(NO_WERROR)
-sysroff.o:
- $(COMPILE) -c $< $(NO_WERROR)
-defparse.o:
- $(COMPILE) -c $< $(NO_WERROR)
-deflex.o:
- $(COMPILE) -c $< $(NO_WERROR)
-nlmheader.o:
- $(COMPILE) -c $< $(NO_WERROR)
-rcparse.o:
- $(COMPILE) -c $< $(NO_WERROR)
-mcparse.o:
- $(COMPILE) -c $< $(NO_WERROR)
-rclex.o:
- $(COMPILE) -c $< $(NO_WERROR)
-mclex.o:
- $(COMPILE) -c $< $(NO_WERROR)
-
-srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
-
-dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
-dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL)
-
-dlltool.o:
- $(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
-
-rescoff.o:
- $(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.c \
- winduni.c resres.c $(BULIBS)
-windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV)
-
-windmc_SOURCES = windmc.c mcparse.y mclex.c \
- winduni.c $(BULIBS)
-windmc_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV)
-
-dllwrap_SOURCES = dllwrap.c version.c
-dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL)
-
-
-EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
- syslex.c deflex.c defparse.h defparse.c rcparse.h rcparse.c \
- mcparse.h mcparse.c
-
-diststuff: $(EXTRA_DIST) info
-all: info
-
-DISTCLEANFILES = 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}!" \
- -e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/binutils$$,,`'!'
-
-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$(EXEEXT_FOR_BUILD) bin2c$(EXEEXT_FOR_BUILD) \
- 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='$(RENAMED_PROGS)'; for p in $$list; do \
- if test -f $$p$(EXEEXT); then \
- echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
- else :; fi; \
- done
- $(mkinstalldirs) $(DESTDIR)$(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" != "$(tooldir)/bin/$$j" ]; then \
- rm -f $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \
- ln $(DESTDIR)$(bindir)/$$k$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT) >/dev/null 2>/dev/null \
- || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXEEXT) $(DESTDIR)$(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 sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
- bucomm.h
-ar.o: ar.c sysdep.h config.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \
- $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/progress.h $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h \
- $(INCDIR)/hashtab.h bucomm.h arsup.h $(INCDIR)/filenames.h \
- binemul.h
-arsup.o: arsup.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/filenames.h bucomm.h \
- arsup.h
-bin2c.o: bin2c.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h
-binemul.o: binemul.c binemul.h sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h
-bucomm.o: bucomm.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h \
- $(INCDIR)/hashtab.h bucomm.h
-coffdump.o: coffdump.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h bucomm.h coffgrok.h
-coffgrok.o: coffgrok.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h bucomm.h coffgrok.h
-cxxfilt.o: cxxfilt.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h bucomm.h
-dwarf.o: dwarf.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h bucomm.h $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/dwarf2.h dwarf.h
-debug.o: debug.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h debug.h
-dlltool.o: dlltool.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
- $(INCDIR)/dyn-string.h bucomm.h dlltool.h $(INCDIR)/safe-ctype.h
-dllwrap.o: dllwrap.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h bucomm.h
-emul_aix.o: emul_aix.c binemul.h sysdep.h config.h \
- $(INCDIR)/ansidecl.h ../bfd/bfdver.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- bucomm.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/xcoff.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- $(BFDDIR)/libxcoff.h
-emul_vanilla.o: emul_vanilla.c binemul.h sysdep.h config.h \
- $(INCDIR)/ansidecl.h ../bfd/bfdver.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- bucomm.h
-filemode.o: filemode.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h
-ieee.o: ieee.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/ieee.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.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 sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(BFDDIR)/libnlm.h \
- $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h \
- nlmconv.h bucomm.h
-nm.o: nm.c sysdep.h config.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \
- $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h $(INCDIR)/progress.h $(INCDIR)/aout/stab_gnu.h \
- $(INCDIR)/aout/stab.def $(INCDIR)/aout/ranlib.h $(INCDIR)/demangle.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/common.h \
- bucomm.h
-not-ranlib.o: not-ranlib.c
-not-strip.o: not-strip.c
-objcopy.o: objcopy.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/progress.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \
- budbg.h $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h
-objdump.o: objdump.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/progress.h bucomm.h dwarf.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/dis-asm.h ../bfd/bfd.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \
- $(INCDIR)/libiberty.h debug.h budbg.h $(INCDIR)/aout/aout64.h
-prdbg.o: prdbg.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
- debug.h budbg.h
-rclex.o: rclex.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h windres.h \
- winduni.h windint.h rcparse.h
-rdcoff.o: rdcoff.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \
- debug.h budbg.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-rddbg.o: rddbg.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h bucomm.h debug.h budbg.h
-readelf.o: readelf.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h dwarf.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/alpha.h \
- $(INCDIR)/elf/arc.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/avr.h \
- $(INCDIR)/elf/bfin.h $(INCDIR)/elf/cr16.h $(INCDIR)/elf/cris.h \
- $(INCDIR)/elf/crx.h $(INCDIR)/elf/d10v.h $(INCDIR)/elf/d30v.h \
- $(INCDIR)/elf/dlx.h $(INCDIR)/elf/fr30.h $(INCDIR)/elf/frv.h \
- $(INCDIR)/elf/hppa.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/i370.h \
- $(INCDIR)/elf/i860.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/ia64.h \
- $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/iq2000.h $(INCDIR)/elf/m32c.h \
- $(INCDIR)/elf/m32r.h $(INCDIR)/elf/m68k.h $(INCDIR)/elf/m68hc11.h \
- $(INCDIR)/elf/mcore.h $(INCDIR)/elf/mep.h $(INCDIR)/elf/mips.h \
- $(INCDIR)/elf/mmix.h $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h \
- $(INCDIR)/elf/mt.h $(INCDIR)/elf/msp430.h $(INCDIR)/elf/or32.h \
- $(INCDIR)/elf/pj.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/ppc64.h \
- $(INCDIR)/elf/s390.h $(INCDIR)/elf/score.h $(INCDIR)/elf/sh.h \
- $(INCDIR)/elf/sparc.h $(INCDIR)/elf/spu.h $(INCDIR)/elf/v850.h \
- $(INCDIR)/elf/vax.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/xstormy16.h \
- $(INCDIR)/elf/xtensa.h $(INCDIR)/aout/ar.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h unwind-ia64.h
-rename.o: rename.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h
-resbin.o: resbin.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h windres.h winduni.h windint.h
-rescoff.o: rescoff.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h windres.h winduni.h windint.h \
- $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-resrc.o: resrc.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h windres.h \
- winduni.h windint.h
-resres.o: resres.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h windres.h winduni.h windint.h
-size.o: size.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h bucomm.h
-srconv.o: srconv.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h sysroff.h \
- coffgrok.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- sysroff.c
-stabs.o: stabs.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/demangle.h \
- $(INCDIR)/libiberty.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 sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h bucomm.h
-sysdump.o: sysdump.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \
- sysroff.h sysroff.c $(INCDIR)/ansidecl.h
-unwind-ia64.o: unwind-ia64.c unwind-ia64.h $(INCDIR)/elf/ia64.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/ansidecl.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h
-version.o: version.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h
-windres.o: windres.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
- windres.h winduni.h windint.h
-winduni.o: winduni.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h bucomm.h winduni.h $(INCDIR)/safe-ctype.h
-wrstabs.o: wrstabs.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h bucomm.h \
- debug.h budbg.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
- $(INCDIR)/aout/stab.def
-windmc.o: windmc.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
- windmc.h winduni.h windint.h
-mclex.o: mclex.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h windmc.h \
- winduni.h mcparse.h
-arparse.o: arparse.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h arsup.h
-arlex.o: arlex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h arparse.h
-sysroff.o: sysroff.c
-sysinfo.o: sysinfo.c
-syslex.o: syslex.c config.h sysinfo.h
-defparse.o: defparse.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h dlltool.h
-deflex.o: deflex.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- defparse.h dlltool.h $(INCDIR)/ansidecl.h
-nlmheader.o: nlmheader.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h bucomm.h \
- nlmconv.h
-rcparse.o: rcparse.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h windres.h winduni.h windint.h \
- $(INCDIR)/safe-ctype.h
-mcparse.o: mcparse.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h windmc.h winduni.h $(INCDIR)/safe-ctype.h
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/binutils/Makefile.in b/binutils/Makefile.in
deleted file mode 100644
index 14b973218f4..00000000000
--- a/binutils/Makefile.in
+++ /dev/null
@@ -1,1462 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 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.
-
-@SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-bin_PROGRAMS = $(am__EXEEXT_6) $(am__EXEEXT_7) $(am__EXEEXT_8) \
- $(am__EXEEXT_9) $(am__EXEEXT_10) $(am__EXEEXT_11) \
- @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ \
- @BUILD_WINDMC@ $(am__EXEEXT_12) $(am__EXEEXT_13) \
- @BUILD_DLLWRAP@ @BUILD_INSTALL_MISC@ $(am__empty)
-noinst_PROGRAMS = $(am__EXEEXT_17) @BUILD_MISC@
-EXTRA_PROGRAMS = $(am__EXEEXT_1) srconv$(EXEEXT) sysdump$(EXEEXT) \
- coffdump$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) \
- $(am__EXEEXT_4) $(am__EXEEXT_5)
-DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \
- README ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/config.in $(srcdir)/../mkinstalldirs \
- $(top_srcdir)/po/Make-in arparse.h arparse.c arlex.c \
- defparse.h defparse.c deflex.c nlmheader.h nlmheader.c \
- arparse.h arparse.c arlex.c mcparse.h mcparse.c rcparse.h \
- rcparse.c $(srcdir)/../ylwrap $(srcdir)/../ltmain.sh \
- $(srcdir)/../config.guess $(srcdir)/../config.sub
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \
- $(top_srcdir)/../bfd/warning.m4 \
- $(top_srcdir)/../config/depstand.m4 \
- $(top_srcdir)/../config/gettext-sister.m4 \
- $(top_srcdir)/../config/iconv.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
- $(top_srcdir)/../config/lib-ld.m4 \
- $(top_srcdir)/../config/lib-link.m4 \
- $(top_srcdir)/../config/lib-prefix.m4 \
- $(top_srcdir)/../config/nls.m4 \
- $(top_srcdir)/../config/override.m4 \
- $(top_srcdir)/../config/po.m4 \
- $(top_srcdir)/../config/proginstall.m4 \
- $(top_srcdir)/../config/progtest.m4 \
- $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
- $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = po/Makefile.in
-am__EXEEXT_1 = nlmconv$(EXEEXT)
-am__EXEEXT_2 = dlltool$(EXEEXT)
-am__EXEEXT_3 = windres$(EXEEXT)
-am__EXEEXT_4 = windmc$(EXEEXT)
-am__EXEEXT_5 = dllwrap$(EXEEXT)
-am__EXEEXT_6 = size$(EXEEXT)
-am__EXEEXT_7 = objdump$(EXEEXT)
-am__EXEEXT_8 = ar$(EXEEXT)
-am__EXEEXT_9 = strings$(EXEEXT)
-am__EXEEXT_10 = ranlib$(EXEEXT)
-am__EXEEXT_11 = objcopy$(EXEEXT)
-am__EXEEXT_12 = addr2line$(EXEEXT)
-am__EXEEXT_13 = readelf$(EXEEXT)
-am__installdirs = "$(DESTDIR)$(bindir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-am__EXEEXT_14 = nm-new$(EXEEXT)
-am__EXEEXT_15 = strip-new$(EXEEXT)
-am__EXEEXT_16 = cxxfilt$(EXEEXT)
-am__EXEEXT_17 = $(am__EXEEXT_14) $(am__EXEEXT_15) $(am__EXEEXT_16)
-PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
-am__objects_1 = bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT)
-am_addr2line_OBJECTS = addr2line.$(OBJEXT) $(am__objects_1)
-addr2line_OBJECTS = $(am_addr2line_OBJECTS)
-addr2line_LDADD = $(LDADD)
-am__DEPENDENCIES_1 = ../bfd/libbfd.la
-am__DEPENDENCIES_2 = ../libiberty/libiberty.a
-am__DEPENDENCIES_3 =
-am_ar_OBJECTS = arparse.$(OBJEXT) arlex.$(OBJEXT) ar.$(OBJEXT) \
- not-ranlib.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) \
- binemul.$(OBJEXT) emul_$(EMULATION).$(OBJEXT) $(am__objects_1)
-ar_OBJECTS = $(am_ar_OBJECTS)
-am_coffdump_OBJECTS = coffdump.$(OBJEXT) coffgrok.$(OBJEXT) \
- $(am__objects_1)
-coffdump_OBJECTS = $(am_coffdump_OBJECTS)
-coffdump_LDADD = $(LDADD)
-am_cxxfilt_OBJECTS = cxxfilt.$(OBJEXT) $(am__objects_1)
-cxxfilt_OBJECTS = $(am_cxxfilt_OBJECTS)
-cxxfilt_LDADD = $(LDADD)
-am_dlltool_OBJECTS = dlltool.$(OBJEXT) defparse.$(OBJEXT) \
- deflex.$(OBJEXT) $(am__objects_1)
-dlltool_OBJECTS = $(am_dlltool_OBJECTS)
-am_dllwrap_OBJECTS = dllwrap.$(OBJEXT) version.$(OBJEXT)
-dllwrap_OBJECTS = $(am_dllwrap_OBJECTS)
-am_nlmconv_OBJECTS = nlmconv.$(OBJEXT) nlmheader.$(OBJEXT) \
- $(am__objects_1)
-nlmconv_OBJECTS = $(am_nlmconv_OBJECTS)
-nlmconv_LDADD = $(LDADD)
-am_nm_new_OBJECTS = nm.$(OBJEXT) $(am__objects_1)
-nm_new_OBJECTS = $(am_nm_new_OBJECTS)
-nm_new_LDADD = $(LDADD)
-am__objects_2 = rddbg.$(OBJEXT) debug.$(OBJEXT) stabs.$(OBJEXT) \
- ieee.$(OBJEXT) rdcoff.$(OBJEXT)
-am__objects_3 = $(am__objects_2) wrstabs.$(OBJEXT)
-am_objcopy_OBJECTS = objcopy.$(OBJEXT) not-strip.$(OBJEXT) \
- rename.$(OBJEXT) $(am__objects_3) $(am__objects_1)
-objcopy_OBJECTS = $(am_objcopy_OBJECTS)
-objcopy_LDADD = $(LDADD)
-am_objdump_OBJECTS = objdump.$(OBJEXT) dwarf.$(OBJEXT) prdbg.$(OBJEXT) \
- $(am__objects_2) $(am__objects_1)
-objdump_OBJECTS = $(am_objdump_OBJECTS)
-am__DEPENDENCIES_4 = ../opcodes/libopcodes.la
-am_ranlib_OBJECTS = ar.$(OBJEXT) is-ranlib.$(OBJEXT) arparse.$(OBJEXT) \
- arlex.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) \
- binemul.$(OBJEXT) emul_$(EMULATION).$(OBJEXT) $(am__objects_1)
-ranlib_OBJECTS = $(am_ranlib_OBJECTS)
-am_readelf_OBJECTS = readelf.$(OBJEXT) version.$(OBJEXT) \
- unwind-ia64.$(OBJEXT) dwarf.$(OBJEXT)
-readelf_OBJECTS = $(am_readelf_OBJECTS)
-am_size_OBJECTS = size.$(OBJEXT) $(am__objects_1)
-size_OBJECTS = $(am_size_OBJECTS)
-size_LDADD = $(LDADD)
-am_srconv_OBJECTS = srconv.$(OBJEXT) coffgrok.$(OBJEXT) \
- $(am__objects_1)
-srconv_OBJECTS = $(am_srconv_OBJECTS)
-srconv_LDADD = $(LDADD)
-am_strings_OBJECTS = strings.$(OBJEXT) $(am__objects_1)
-strings_OBJECTS = $(am_strings_OBJECTS)
-strings_LDADD = $(LDADD)
-am_strip_new_OBJECTS = objcopy.$(OBJEXT) is-strip.$(OBJEXT) \
- rename.$(OBJEXT) $(am__objects_3) $(am__objects_1)
-strip_new_OBJECTS = $(am_strip_new_OBJECTS)
-strip_new_LDADD = $(LDADD)
-am_sysdump_OBJECTS = sysdump.$(OBJEXT) $(am__objects_1)
-sysdump_OBJECTS = $(am_sysdump_OBJECTS)
-sysdump_LDADD = $(LDADD)
-am_windmc_OBJECTS = windmc.$(OBJEXT) mcparse.$(OBJEXT) mclex.$(OBJEXT) \
- winduni.$(OBJEXT) $(am__objects_1)
-windmc_OBJECTS = $(am_windmc_OBJECTS)
-am_windres_OBJECTS = windres.$(OBJEXT) resrc.$(OBJEXT) \
- rescoff.$(OBJEXT) resbin.$(OBJEXT) rcparse.$(OBJEXT) \
- rclex.$(OBJEXT) winduni.$(OBJEXT) resres.$(OBJEXT) \
- $(am__objects_1)
-windres_OBJECTS = $(am_windres_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
-LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
-YLWRAP = $(top_srcdir)/../ylwrap
-YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
-LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \
- $(AM_YFLAGS)
-SOURCES = $(addr2line_SOURCES) $(ar_SOURCES) $(coffdump_SOURCES) \
- $(cxxfilt_SOURCES) $(dlltool_SOURCES) $(dllwrap_SOURCES) \
- $(nlmconv_SOURCES) $(nm_new_SOURCES) $(objcopy_SOURCES) \
- $(objdump_SOURCES) $(ranlib_SOURCES) $(readelf_SOURCES) \
- $(size_SOURCES) $(srconv_SOURCES) $(strings_SOURCES) \
- $(strip_new_SOURCES) $(sysdump_SOURCES) $(windmc_SOURCES) \
- $(windres_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
-ETAGS = etags
-CTAGS = ctags
-DEJATOOL = $(PACKAGE)
-RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
-DIST_SUBDIRS = $(SUBDIRS)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BUILD_DLLTOOL = @BUILD_DLLTOOL@
-BUILD_DLLWRAP = @BUILD_DLLWRAP@
-BUILD_INSTALL_MISC = @BUILD_INSTALL_MISC@
-BUILD_MISC = @BUILD_MISC@
-BUILD_NLMCONV = @BUILD_NLMCONV@
-BUILD_SRCONV = @BUILD_SRCONV@
-BUILD_WINDMC = @BUILD_WINDMC@
-BUILD_WINDRES = @BUILD_WINDRES@
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATADIRNAME = @DATADIRNAME@
-DEFS = @DEFS@
-DEMANGLER_NAME = @DEMANGLER_NAME@
-DEPDIR = @DEPDIR@
-DLLTOOL_DEFS = @DLLTOOL_DEFS@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EMULATION = @EMULATION@
-EMULATION_VECTOR = @EMULATION_VECTOR@
-EXEEXT = @EXEEXT@
-EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
-FGREP = @FGREP@
-GENCAT = @GENCAT@
-GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@
-GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@
-GMSGFMT = @GMSGFMT@
-GREP = @GREP@
-HDEFINES = @HDEFINES@
-INCINTL = @INCINTL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INSTOBJEXT = @INSTOBJEXT@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi`
-LEXLIB = @LEXLIB@
-LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-LIBICONV = @LIBICONV@
-LIBINTL = @LIBINTL@
-LIBINTL_DEP = @LIBINTL_DEP@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBICONV = @LTLIBICONV@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-MSGMERGE = @MSGMERGE@
-NLMCONV_DEFS = @NLMCONV_DEFS@
-NM = @NM@
-NO_WERROR = @NO_WERROR@
-OBJDUMP_DEFS = @OBJDUMP_DEFS@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POSUB = @POSUB@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-WARN_CFLAGS = @WARN_CFLAGS@
-XGETTEXT = @XGETTEXT@
-YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi`
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-AUTOMAKE_OPTIONS = cygnus dejagnu
-ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
-SUBDIRS = doc po
-tooldir = $(exec_prefix)/$(target_alias)
-YFLAGS = -d
-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
-WINDMC_PROG = windmc
-DLLWRAP_PROG = dllwrap
-SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT)
-RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
-
-# Stuff that goes in tooldir/ if appropriate.
-TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy
-BASEDIR = $(srcdir)/..
-BFDDIR = $(BASEDIR)/bfd
-INCDIR = $(BASEDIR)/include
-MKDEP = gcc -MM
-INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
- @HDEFINES@ \
- @INCINTL@ \
- -DLOCALEDIR="\"$(datadir)/locale\"" \
- -Dbin_dummy_emulation=$(EMULATION_VECTOR)
-
-HFILES = \
- arsup.h binemul.h bucomm.h budbg.h \
- coffgrok.h debug.h dlltool.h dwarf.h nlmconv.h \
- sysdep.h unwind-ia64.h windres.h winduni.h windint.h \
- windmc.h
-
-GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h mcparse.h
-CFILES = \
- addr2line.c ar.c arsup.c bin2c.c binemul.c bucomm.c \
- coffdump.c coffgrok.c cxxfilt.c \
- dwarf.c debug.c dlltool.c dllwrap.c \
- emul_aix.c emul_vanilla.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 \
- rclex.c rdcoff.c rddbg.c readelf.c rename.c \
- resbin.c rescoff.c resrc.c resres.c \
- size.c srconv.c stabs.c strings.c sysdump.c \
- unwind-ia64.c version.c \
- windres.c winduni.c wrstabs.c \
- windmc.c mclex.c
-
-GENERATED_CFILES = \
- arparse.c arlex.c sysroff.c sysinfo.c syslex.c \
- defparse.c deflex.c nlmheader.c rcparse.c mcparse.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)
-EXPECT = expect
-RUNTEST = runtest
-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`
-
-
-# There's no global DEPENDENCIES. So, we must explicitly list everything
-# which depends on libintl, since we don't know whether LIBINTL_DEP will be
-# non-empty until configure time. Ugh!
-size_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-objdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) $(OPCODES)
-nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-ar_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-strings_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-strip_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-ranlib_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-cxxfilt_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-objcopy_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-nlmconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-srconv_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-dlltool_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-windres_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-windmc_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
-readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
-dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
-LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
-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 dwarf.c
-readelf_LDADD = $(LIBINTL) $(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 dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS)
-objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
-cxxfilt_SOURCES = cxxfilt.c $(BULIBS)
-ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \
- emul_$(EMULATION).c $(BULIBS)
-
-ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL)
-ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c \
- binemul.c emul_$(EMULATION).c $(BULIBS)
-
-ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL)
-addr2line_SOURCES = addr2line.c $(BULIBS)
-srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
-dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
-dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL)
-coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
-sysdump_SOURCES = sysdump.c $(BULIBS)
-nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS)
-windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.c \
- winduni.c resres.c $(BULIBS)
-
-windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV)
-windmc_SOURCES = windmc.c mcparse.y mclex.c \
- winduni.c $(BULIBS)
-
-windmc_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV)
-dllwrap_SOURCES = dllwrap.c version.c
-dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL)
-EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
- syslex.c deflex.c defparse.h defparse.c rcparse.h rcparse.c \
- mcparse.h mcparse.c
-
-DISTCLEANFILES = sysroff.c sysroff.h site.exp site.bak
-
-###
-MOSTLYCLEANFILES = sysinfo$(EXEEXT_FOR_BUILD) bin2c$(EXEEXT_FOR_BUILD) \
- binutils.log binutils.sum abcdefgh*
-
-CLEANFILES = dep.sed DEP DEPA DEP1 DEP2
-all: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .c .l .lo .o .obj .y
-am--refresh:
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \
- cd $(srcdir) && $(AUTOMAKE) --cygnus \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --cygnus Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-
-config.h: stamp-h1
- @if test ! -f $@; then \
- rm -f stamp-h1; \
- $(MAKE) stamp-h1; \
- else :; fi
-
-stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_srcdir) && $(AUTOHEADER)
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f config.h stamp-h1
-po/Makefile.in: $(top_builddir)/config.status $(top_srcdir)/po/Make-in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
- rm -f "$(DESTDIR)$(bindir)/$$f"; \
- done
-
-clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-
-clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-addr2line$(EXEEXT): $(addr2line_OBJECTS) $(addr2line_DEPENDENCIES)
- @rm -f addr2line$(EXEEXT)
- $(LINK) $(addr2line_LDFLAGS) $(addr2line_OBJECTS) $(addr2line_LDADD) $(LIBS)
-ar$(EXEEXT): $(ar_OBJECTS) $(ar_DEPENDENCIES)
- @rm -f ar$(EXEEXT)
- $(LINK) $(ar_LDFLAGS) $(ar_OBJECTS) $(ar_LDADD) $(LIBS)
-coffdump$(EXEEXT): $(coffdump_OBJECTS) $(coffdump_DEPENDENCIES)
- @rm -f coffdump$(EXEEXT)
- $(LINK) $(coffdump_LDFLAGS) $(coffdump_OBJECTS) $(coffdump_LDADD) $(LIBS)
-cxxfilt$(EXEEXT): $(cxxfilt_OBJECTS) $(cxxfilt_DEPENDENCIES)
- @rm -f cxxfilt$(EXEEXT)
- $(LINK) $(cxxfilt_LDFLAGS) $(cxxfilt_OBJECTS) $(cxxfilt_LDADD) $(LIBS)
-dlltool$(EXEEXT): $(dlltool_OBJECTS) $(dlltool_DEPENDENCIES)
- @rm -f dlltool$(EXEEXT)
- $(LINK) $(dlltool_LDFLAGS) $(dlltool_OBJECTS) $(dlltool_LDADD) $(LIBS)
-dllwrap$(EXEEXT): $(dllwrap_OBJECTS) $(dllwrap_DEPENDENCIES)
- @rm -f dllwrap$(EXEEXT)
- $(LINK) $(dllwrap_LDFLAGS) $(dllwrap_OBJECTS) $(dllwrap_LDADD) $(LIBS)
-nlmconv$(EXEEXT): $(nlmconv_OBJECTS) $(nlmconv_DEPENDENCIES)
- @rm -f nlmconv$(EXEEXT)
- $(LINK) $(nlmconv_LDFLAGS) $(nlmconv_OBJECTS) $(nlmconv_LDADD) $(LIBS)
-nm-new$(EXEEXT): $(nm_new_OBJECTS) $(nm_new_DEPENDENCIES)
- @rm -f nm-new$(EXEEXT)
- $(LINK) $(nm_new_LDFLAGS) $(nm_new_OBJECTS) $(nm_new_LDADD) $(LIBS)
-objcopy$(EXEEXT): $(objcopy_OBJECTS) $(objcopy_DEPENDENCIES)
- @rm -f objcopy$(EXEEXT)
- $(LINK) $(objcopy_LDFLAGS) $(objcopy_OBJECTS) $(objcopy_LDADD) $(LIBS)
-objdump$(EXEEXT): $(objdump_OBJECTS) $(objdump_DEPENDENCIES)
- @rm -f objdump$(EXEEXT)
- $(LINK) $(objdump_LDFLAGS) $(objdump_OBJECTS) $(objdump_LDADD) $(LIBS)
-ranlib$(EXEEXT): $(ranlib_OBJECTS) $(ranlib_DEPENDENCIES)
- @rm -f ranlib$(EXEEXT)
- $(LINK) $(ranlib_LDFLAGS) $(ranlib_OBJECTS) $(ranlib_LDADD) $(LIBS)
-readelf$(EXEEXT): $(readelf_OBJECTS) $(readelf_DEPENDENCIES)
- @rm -f readelf$(EXEEXT)
- $(LINK) $(readelf_LDFLAGS) $(readelf_OBJECTS) $(readelf_LDADD) $(LIBS)
-size$(EXEEXT): $(size_OBJECTS) $(size_DEPENDENCIES)
- @rm -f size$(EXEEXT)
- $(LINK) $(size_LDFLAGS) $(size_OBJECTS) $(size_LDADD) $(LIBS)
-srconv$(EXEEXT): $(srconv_OBJECTS) $(srconv_DEPENDENCIES)
- @rm -f srconv$(EXEEXT)
- $(LINK) $(srconv_LDFLAGS) $(srconv_OBJECTS) $(srconv_LDADD) $(LIBS)
-strings$(EXEEXT): $(strings_OBJECTS) $(strings_DEPENDENCIES)
- @rm -f strings$(EXEEXT)
- $(LINK) $(strings_LDFLAGS) $(strings_OBJECTS) $(strings_LDADD) $(LIBS)
-strip-new$(EXEEXT): $(strip_new_OBJECTS) $(strip_new_DEPENDENCIES)
- @rm -f strip-new$(EXEEXT)
- $(LINK) $(strip_new_LDFLAGS) $(strip_new_OBJECTS) $(strip_new_LDADD) $(LIBS)
-sysdump$(EXEEXT): $(sysdump_OBJECTS) $(sysdump_DEPENDENCIES)
- @rm -f sysdump$(EXEEXT)
- $(LINK) $(sysdump_LDFLAGS) $(sysdump_OBJECTS) $(sysdump_LDADD) $(LIBS)
-windmc$(EXEEXT): $(windmc_OBJECTS) $(windmc_DEPENDENCIES)
- @rm -f windmc$(EXEEXT)
- $(LINK) $(windmc_LDFLAGS) $(windmc_OBJECTS) $(windmc_LDADD) $(LIBS)
-windres$(EXEEXT): $(windres_OBJECTS) $(windres_DEPENDENCIES)
- @rm -f windres$(EXEEXT)
- $(LINK) $(windres_LDFLAGS) $(windres_OBJECTS) $(windres_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c $<
-
-.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- $(LTCOMPILE) -c -o $@ $<
-
-.l.c:
- $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
-
-.y.c:
- $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-site.exp: Makefile
- @echo 'Making a new site.exp file...'
- @echo '## these variables are automatically generated by make ##' >site.tmp
- @echo '# Do not edit here. If you wish to override these values' >>site.tmp
- @echo '# edit the last section' >>site.tmp
- @echo 'set srcdir $(srcdir)' >>site.tmp
- @echo "set objdir `pwd`" >>site.tmp
- @echo 'set build_alias "$(build_alias)"' >>site.tmp
- @echo 'set build_triplet $(build_triplet)' >>site.tmp
- @echo 'set host_alias "$(host_alias)"' >>site.tmp
- @echo 'set host_triplet $(host_triplet)' >>site.tmp
- @echo 'set target_alias "$(target_alias)"' >>site.tmp
- @echo 'set target_triplet $(target_triplet)' >>site.tmp
- @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
- @test ! -f site.exp || \
- sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
- @-rm -f site.bak
- @test ! -f site.exp || mv site.exp site.bak
- @mv site.tmp site.exp
-
-distclean-DEJAGNU:
- -rm -f site.exp site.bak
- -l='$(DEJATOOL)'; for tool in $$l; do \
- rm -f $$tool.sum $$tool.log; \
- done
-check-am:
- $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
-check: check-recursive
-all-am: Makefile $(PROGRAMS) config.h
-installdirs: installdirs-recursive
-installdirs-am:
- for dir in "$(DESTDIR)$(bindir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -rm -f arlex.c
- -rm -f arparse.c
- -rm -f arparse.h
- -rm -f deflex.c
- -rm -f defparse.c
- -rm -f defparse.h
- -rm -f mcparse.c
- -rm -f mcparse.h
- -rm -f nlmheader.c
- -rm -f nlmheader.h
- -rm -f rcparse.c
- -rm -f rcparse.h
-clean: clean-recursive
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool \
- clean-noinstPROGRAMS mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-DEJAGNU distclean-compile \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-exec-am: install-binPROGRAMS install-exec-local
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool mostlyclean-local
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
- check-DEJAGNU check-am clean clean-binPROGRAMS clean-generic \
- clean-libtool clean-noinstPROGRAMS clean-recursive ctags \
- ctags-recursive distclean distclean-DEJAGNU distclean-compile \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-recursive distclean-tags dvi dvi-am html html-am \
- info info-am install install-am install-binPROGRAMS \
- install-data install-data-am install-exec install-exec-am \
- install-exec-local install-info install-info-am install-man \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- maintainer-clean-recursive mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool mostlyclean-local \
- mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
- uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am
-
-
-.PHONY: install-html install-html-am install-html-recursive
-
-install-html: install-html-recursive
-
-install-html-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-po/POTFILES.in: @MAINT@ Makefile
- for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
- && mv tmp $(srcdir)/po/POTFILES.in
-
-check-DEJAGNU: site.exp
- srcdir=`cd $(srcdir) && pwd`; export srcdir; \
- r=`pwd`; export r; \
- EXPECT=$(EXPECT); export EXPECT; \
- runtest=$(RUNTEST); \
- if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
- CC_FOR_TARGET="$(CC_FOR_TARGET)" CFLAGS_FOR_TARGET="$(CFLAGS)" \
- $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
- $(RUNTESTFLAGS); \
- else echo "WARNING: could not find \`runtest'" 1>&2; :;\
- fi
-
-installcheck:
- /bin/sh $(srcdir)/sanity.sh $(bindir)
-
-objdump.o:objdump.c
- $(COMPILE) -c $(OBJDUMP_DEFS) $(srcdir)/objdump.c
-
-# 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:
- if [ -r syslex.c ]; then \
- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) syslex.c -Wno-error ; \
- else \
- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/syslex.c -Wno-error ;\
- fi
-
-sysinfo.o:
- if [ -r sysinfo.c ]; then \
- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) sysinfo.c -Wno-error ; \
- else \
- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c -Wno-error ; \
- fi
-
-bin2c$(EXEEXT_FOR_BUILD):
- $(CC_FOR_BUILD) -o $@ $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) $(srcdir)/bin2c.c $(srcdir)/version.c
-
-embedspu: embedspu.sh
- sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@
- chmod a+x $@
-
-# We need these for parallel make.
-arparse.h: arparse.c
-defparse.h: defparse.c
-nlmheader.h: nlmheader.c
-rcparse.h: rcparse.c
-mcparse.h: mcparse.c
-sysinfo.h: sysinfo.c
-
-# Disable -Werror, if it has been enabled, since old versions of bison/
-# yacc will produce working code which contain compile time warnings.
-arparse.o:
- $(COMPILE) -c $< $(NO_WERROR)
-arlex.o:
- $(COMPILE) -c $< $(NO_WERROR)
-sysroff.o:
- $(COMPILE) -c $< $(NO_WERROR)
-defparse.o:
- $(COMPILE) -c $< $(NO_WERROR)
-deflex.o:
- $(COMPILE) -c $< $(NO_WERROR)
-nlmheader.o:
- $(COMPILE) -c $< $(NO_WERROR)
-rcparse.o:
- $(COMPILE) -c $< $(NO_WERROR)
-mcparse.o:
- $(COMPILE) -c $< $(NO_WERROR)
-rclex.o:
- $(COMPILE) -c $< $(NO_WERROR)
-mclex.o:
- $(COMPILE) -c $< $(NO_WERROR)
-
-dlltool.o:
- $(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
-
-rescoff.o:
- $(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/rescoff.c
-
-# 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
-
-diststuff: $(EXTRA_DIST) info
-all: info
-
-# 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}!" \
- -e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/binutils$$,,`'!'
-
-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
-mostlyclean-local:
- -rm -rf tmpdir
-
-.PHONY: install-exec-local
-
-install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS)
- @list='$(RENAMED_PROGS)'; for p in $$list; do \
- if test -f $$p$(EXEEXT); then \
- echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
- else :; fi; \
- done
- $(mkinstalldirs) $(DESTDIR)$(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" != "$(tooldir)/bin/$$j" ]; then \
- rm -f $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \
- ln $(DESTDIR)$(bindir)/$$k$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT) >/dev/null 2>/dev/null \
- || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXEEXT) $(DESTDIR)$(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 sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
- bucomm.h
-ar.o: ar.c sysdep.h config.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \
- $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/progress.h $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h \
- $(INCDIR)/hashtab.h bucomm.h arsup.h $(INCDIR)/filenames.h \
- binemul.h
-arsup.o: arsup.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/filenames.h bucomm.h \
- arsup.h
-bin2c.o: bin2c.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h
-binemul.o: binemul.c binemul.h sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h
-bucomm.o: bucomm.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h \
- $(INCDIR)/hashtab.h bucomm.h
-coffdump.o: coffdump.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h bucomm.h coffgrok.h
-coffgrok.o: coffgrok.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h bucomm.h coffgrok.h
-cxxfilt.o: cxxfilt.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h bucomm.h
-dwarf.o: dwarf.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h bucomm.h $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/dwarf2.h dwarf.h
-debug.o: debug.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h debug.h
-dlltool.o: dlltool.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
- $(INCDIR)/dyn-string.h bucomm.h dlltool.h $(INCDIR)/safe-ctype.h
-dllwrap.o: dllwrap.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h bucomm.h
-emul_aix.o: emul_aix.c binemul.h sysdep.h config.h \
- $(INCDIR)/ansidecl.h ../bfd/bfdver.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- bucomm.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/xcoff.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- $(BFDDIR)/libxcoff.h
-emul_vanilla.o: emul_vanilla.c binemul.h sysdep.h config.h \
- $(INCDIR)/ansidecl.h ../bfd/bfdver.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- bucomm.h
-filemode.o: filemode.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h
-ieee.o: ieee.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/ieee.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.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 sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(BFDDIR)/libnlm.h \
- $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h \
- nlmconv.h bucomm.h
-nm.o: nm.c sysdep.h config.h $(INCDIR)/ansidecl.h ../bfd/bfdver.h \
- $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h $(INCDIR)/progress.h $(INCDIR)/aout/stab_gnu.h \
- $(INCDIR)/aout/stab.def $(INCDIR)/aout/ranlib.h $(INCDIR)/demangle.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/common.h \
- bucomm.h
-not-ranlib.o: not-ranlib.c
-not-strip.o: not-strip.c
-objcopy.o: objcopy.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/progress.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \
- budbg.h $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h
-objdump.o: objdump.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/progress.h bucomm.h dwarf.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/dis-asm.h ../bfd/bfd.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \
- $(INCDIR)/libiberty.h debug.h budbg.h $(INCDIR)/aout/aout64.h
-prdbg.o: prdbg.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
- debug.h budbg.h
-rclex.o: rclex.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h windres.h \
- winduni.h windint.h rcparse.h
-rdcoff.o: rdcoff.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \
- debug.h budbg.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-rddbg.o: rddbg.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h bucomm.h debug.h budbg.h
-readelf.o: readelf.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h dwarf.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/elf/alpha.h \
- $(INCDIR)/elf/arc.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/avr.h \
- $(INCDIR)/elf/bfin.h $(INCDIR)/elf/cr16.h $(INCDIR)/elf/cris.h \
- $(INCDIR)/elf/crx.h $(INCDIR)/elf/d10v.h $(INCDIR)/elf/d30v.h \
- $(INCDIR)/elf/dlx.h $(INCDIR)/elf/fr30.h $(INCDIR)/elf/frv.h \
- $(INCDIR)/elf/hppa.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/i370.h \
- $(INCDIR)/elf/i860.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/ia64.h \
- $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/iq2000.h $(INCDIR)/elf/m32c.h \
- $(INCDIR)/elf/m32r.h $(INCDIR)/elf/m68k.h $(INCDIR)/elf/m68hc11.h \
- $(INCDIR)/elf/mcore.h $(INCDIR)/elf/mep.h $(INCDIR)/elf/mips.h \
- $(INCDIR)/elf/mmix.h $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h \
- $(INCDIR)/elf/mt.h $(INCDIR)/elf/msp430.h $(INCDIR)/elf/or32.h \
- $(INCDIR)/elf/pj.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/ppc64.h \
- $(INCDIR)/elf/s390.h $(INCDIR)/elf/score.h $(INCDIR)/elf/sh.h \
- $(INCDIR)/elf/sparc.h $(INCDIR)/elf/spu.h $(INCDIR)/elf/v850.h \
- $(INCDIR)/elf/vax.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/xstormy16.h \
- $(INCDIR)/elf/xtensa.h $(INCDIR)/aout/ar.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h unwind-ia64.h
-rename.o: rename.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h
-resbin.o: resbin.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h windres.h winduni.h windint.h
-rescoff.o: rescoff.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h windres.h winduni.h windint.h \
- $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-resrc.o: resrc.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h windres.h \
- winduni.h windint.h
-resres.o: resres.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h windres.h winduni.h windint.h
-size.o: size.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h bucomm.h
-srconv.o: srconv.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h sysroff.h \
- coffgrok.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- sysroff.c
-stabs.o: stabs.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/demangle.h \
- $(INCDIR)/libiberty.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 sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h bucomm.h
-sysdump.o: sysdump.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h bucomm.h \
- sysroff.h sysroff.c $(INCDIR)/ansidecl.h
-unwind-ia64.o: unwind-ia64.c unwind-ia64.h $(INCDIR)/elf/ia64.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/ansidecl.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h
-version.o: version.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h
-windres.o: windres.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
- windres.h winduni.h windint.h
-winduni.o: winduni.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h bucomm.h winduni.h $(INCDIR)/safe-ctype.h
-wrstabs.o: wrstabs.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h bucomm.h \
- debug.h budbg.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
- $(INCDIR)/aout/stab.def
-windmc.o: windmc.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
- windmc.h winduni.h windint.h
-mclex.o: mclex.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h windmc.h \
- winduni.h mcparse.h
-arparse.o: arparse.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h arsup.h
-arlex.o: arlex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h arparse.h
-sysroff.o: sysroff.c
-sysinfo.o: sysinfo.c
-syslex.o: syslex.c config.h sysinfo.h
-defparse.o: defparse.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h dlltool.h
-deflex.o: deflex.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- defparse.h dlltool.h $(INCDIR)/ansidecl.h
-nlmheader.o: nlmheader.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h bucomm.h \
- nlmconv.h
-rcparse.o: rcparse.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h windres.h winduni.h windint.h \
- $(INCDIR)/safe-ctype.h
-mcparse.o: mcparse.c sysdep.h config.h $(INCDIR)/ansidecl.h \
- ../bfd/bfdver.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h bucomm.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h windmc.h winduni.h $(INCDIR)/safe-ctype.h
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
-# 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:
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
deleted file mode 100644
index 505402bf663..00000000000
--- a/binutils/dlltool.c
+++ /dev/null
@@ -1,3678 +0,0 @@
-/* dlltool.c -- tool to generate stuff for PE style DLLs
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-
- This file is part of GNU Binutils.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-
-/* This program allows you to build the files necessary to create
- DLLs to run on a system which understands PE format image files.
- (eg, Windows NT)
-
- See "Peering Inside the PE: A Tour of the Win32 Portable Executable
- File Format", MSJ 1994, Volume 9 for more information.
- Also see "Microsoft Portable Executable and Common Object File Format,
- Specification 4.1" for more information.
-
- A DLL contains an export table which contains the information
- which the runtime loader needs to tie up references from a
- referencing program.
-
- The export table is generated by this program by reading
- in a .DEF file or scanning the .a and .o files which will be in the
- DLL. A .o file can contain information in special ".drectve" sections
- with export information.
-
- A DEF file contains any number of the following commands:
-
-
- NAME <name> [ , <base> ]
- The result is going to be <name>.EXE
-
- LIBRARY <name> [ , <base> ]
- The result is going to be <name>.DLL
-
- EXPORTS ( ( ( <name1> [ = <name2> ] )
- | ( <name1> = <module-name> . <external-name>))
- [ @ <integer> ] [ NONAME ] [CONSTANT] [DATA] [PRIVATE] ) *
- Declares name1 as an exported symbol from the
- DLL, with optional ordinal number <integer>.
- Or declares name1 as an alias (forward) of the function <external-name>
- in the DLL <module-name>.
-
- IMPORTS ( ( <internal-name> = <module-name> . <integer> )
- | ( [ <internal-name> = ] <module-name> . <external-name> )) *
- Declares that <external-name> or the exported function whose ordinal number
- is <integer> is to be imported from the file <module-name>. If
- <internal-name> is specified then this is the name that the imported
- function will be refereed to in the body of the DLL.
-
- DESCRIPTION <string>
- Puts <string> into output .exp file in the .rdata section
-
- [STACKSIZE|HEAPSIZE] <number-reserve> [ , <number-commit> ]
- Generates --stack|--heap <number-reserve>,<number-commit>
- in the output .drectve section. The linker will
- see this and act upon it.
-
- [CODE|DATA] <attr>+
- SECTIONS ( <sectionname> <attr>+ )*
- <attr> = READ | WRITE | EXECUTE | SHARED
- Generates --attr <sectionname> <attr> in the output
- .drectve section. The linker will see this and act
- upon it.
-
-
- A -export:<name> in a .drectve section in an input .o or .a
- file to this program is equivalent to a EXPORTS <name>
- in a .DEF file.
-
-
-
- The program generates output files with the prefix supplied
- on the command line, or in the def file, or taken from the first
- supplied argument.
-
- The .exp.s file contains the information necessary to export
- the routines in the DLL. The .lib.s file contains the information
- necessary to use the DLL's routines from a referencing program.
-
-
-
- Example:
-
- file1.c:
- asm (".section .drectve");
- asm (".ascii \"-export:adef\"");
-
- void adef (char * s)
- {
- printf ("hello from the dll %s\n", s);
- }
-
- void bdef (char * s)
- {
- printf ("hello from the dll and the other entry point %s\n", s);
- }
-
- file2.c:
- asm (".section .drectve");
- asm (".ascii \"-export:cdef\"");
- asm (".ascii \"-export:ddef\"");
-
- void cdef (char * s)
- {
- printf ("hello from the dll %s\n", s);
- }
-
- void ddef (char * s)
- {
- printf ("hello from the dll and the other entry point %s\n", s);
- }
-
- int printf (void)
- {
- return 9;
- }
-
- themain.c:
- int main (void)
- {
- cdef ();
- return 0;
- }
-
- thedll.def
-
- LIBRARY thedll
- HEAPSIZE 0x40000, 0x2000
- EXPORTS bdef @ 20
- cdef @ 30 NONAME
-
- SECTIONS donkey READ WRITE
- aardvark EXECUTE
-
- # Compile up the parts of the dll and the program
-
- gcc -c file1.c file2.c themain.c
-
- # Optional: put the dll objects into a library
- # (you don't have to, you could name all the object
- # files on the dlltool line)
-
- ar qcv thedll.in file1.o file2.o
- ranlib thedll.in
-
- # Run this tool over the DLL's .def file and generate an exports
- # file (thedll.o) and an imports file (thedll.a).
- # (You may have to use -S to tell dlltool where to find the assembler).
-
- dlltool --def thedll.def --output-exp thedll.o --output-lib thedll.a
-
- # Build the dll with the library and the export table
-
- ld -o thedll.dll thedll.o thedll.in
-
- # Link the executable with the import library
-
- gcc -o themain.exe themain.o thedll.a
-
- This example can be extended if relocations are needed in the DLL:
-
- # Compile up the parts of the dll and the program
-
- gcc -c file1.c file2.c themain.c
-
- # Run this tool over the DLL's .def file and generate an imports file.
-
- dlltool --def thedll.def --output-lib thedll.lib
-
- # Link the executable with the import library and generate a base file
- # at the same time
-
- gcc -o themain.exe themain.o thedll.lib -Wl,--base-file -Wl,themain.base
-
- # Run this tool over the DLL's .def file and generate an exports file
- # which includes the relocations from the base file.
-
- dlltool --def thedll.def --base-file themain.base --output-exp thedll.exp
-
- # Build the dll with file1.o, file2.o and the export table
-
- ld -o thedll.dll thedll.exp file1.o file2.o */
-
-/* .idata section description
-
- The .idata section is the import table. It is a collection of several
- subsections used to keep the pieces for each dll together: .idata$[234567].
- IE: Each dll's .idata$2's are catenated together, each .idata$3's, etc.
-
- .idata$2 = Import Directory Table
- = array of IMAGE_IMPORT_DESCRIPTOR's.
-
- DWORD Import Lookup Table; - pointer to .idata$4
- DWORD TimeDateStamp; - currently always 0
- DWORD ForwarderChain; - currently always 0
- DWORD Name; - pointer to dll's name
- PIMAGE_THUNK_DATA FirstThunk; - pointer to .idata$5
-
- .idata$3 = null terminating entry for .idata$2.
-
- .idata$4 = Import Lookup Table
- = array of array of pointers to hint name table.
- There is one for each dll being imported from, and each dll's set is
- terminated by a trailing NULL.
-
- .idata$5 = Import Address Table
- = array of array of pointers to hint name table.
- There is one for each dll being imported from, and each dll's set is
- terminated by a trailing NULL.
- Initially, this table is identical to the Import Lookup Table. However,
- at load time, the loader overwrites the entries with the address of the
- function.
-
- .idata$6 = Hint Name Table
- = Array of { short, asciz } entries, one for each imported function.
- The `short' is the function's ordinal number.
-
- .idata$7 = dll name (eg: "kernel32.dll"). (.idata$6 for ppc). */
-
-/* AIX requires this to be the first thing in the file. */
-#ifndef __GNUC__
-# ifdef _AIX
- #pragma alloca
-#endif
-#endif
-
-#define show_allnames 0
-
-#define PAGE_SIZE 4096
-#define PAGE_MASK (-PAGE_SIZE)
-#include "sysdep.h"
-#include "bfd.h"
-#include "libiberty.h"
-#include "getopt.h"
-#include "demangle.h"
-#include "dyn-string.h"
-#include "bucomm.h"
-#include "dlltool.h"
-#include "safe-ctype.h"
-
-#include <time.h>
-#include <sys/stat.h>
-#include <stdarg.h>
-#include <assert.h>
-
-#ifdef DLLTOOL_ARM
-#include "coff/arm.h"
-#include "coff/internal.h"
-#endif
-#ifdef DLLTOOL_MX86_64
-#include "coff/x86_64.h"
-#endif
-
-/* Forward references. */
-static char *look_for_prog (const char *, const char *, int);
-static char *deduce_name (const char *);
-
-#ifdef DLLTOOL_MCORE_ELF
-static void mcore_elf_cache_filename (const char *);
-static void mcore_elf_gen_out_file (void);
-#endif
-
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#else /* ! HAVE_SYS_WAIT_H */
-#if ! defined (_WIN32) || defined (__CYGWIN32__)
-#ifndef WIFEXITED
-#define WIFEXITED(w) (((w) & 0377) == 0)
-#endif
-#ifndef WIFSIGNALED
-#define WIFSIGNALED(w) (((w) & 0377) != 0177 && ((w) & ~0377) == 0)
-#endif
-#ifndef WTERMSIG
-#define WTERMSIG(w) ((w) & 0177)
-#endif
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(w) (((w) >> 8) & 0377)
-#endif
-#else /* defined (_WIN32) && ! defined (__CYGWIN32__) */
-#ifndef WIFEXITED
-#define WIFEXITED(w) (((w) & 0xff) == 0)
-#endif
-#ifndef WIFSIGNALED
-#define WIFSIGNALED(w) (((w) & 0xff) != 0 && ((w) & 0xff) != 0x7f)
-#endif
-#ifndef WTERMSIG
-#define WTERMSIG(w) ((w) & 0x7f)
-#endif
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(w) (((w) & 0xff00) >> 8)
-#endif
-#endif /* defined (_WIN32) && ! defined (__CYGWIN32__) */
-#endif /* ! HAVE_SYS_WAIT_H */
-
-/* ifunc and ihead data structures: ttk@cygnus.com 1997
-
- When IMPORT declarations are encountered in a .def file the
- function import information is stored in a structure referenced by
- the global variable IMPORT_LIST. The structure is a linked list
- containing the names of the dll files each function is imported
- from and a linked list of functions being imported from that dll
- file. This roughly parallels the structure of the .idata section
- in the PE object file.
-
- The contents of .def file are interpreted from within the
- process_def_file function. Every time an IMPORT declaration is
- encountered, it is broken up into its component parts and passed to
- def_import. IMPORT_LIST is initialized to NULL in function main. */
-
-typedef struct ifunct
-{
- char * name; /* Name of function being imported. */
- int ord; /* Two-byte ordinal value associated with function. */
- struct ifunct *next;
-} ifunctype;
-
-typedef struct iheadt
-{
- char *dllname; /* Name of dll file imported from. */
- long nfuncs; /* Number of functions in list. */
- struct ifunct *funchead; /* First function in list. */
- struct ifunct *functail; /* Last function in list. */
- struct iheadt *next; /* Next dll file in list. */
-} iheadtype;
-
-/* Structure containing all import information as defined in .def file
- (qv "ihead structure"). */
-
-static iheadtype *import_list = NULL;
-
-static char *as_name = NULL;
-static char * as_flags = "";
-
-static char *tmp_prefix;
-
-static int no_idata4;
-static int no_idata5;
-static char *exp_name;
-static char *imp_name;
-static char *head_label;
-static char *imp_name_lab;
-static char *dll_name;
-
-static int add_indirect = 0;
-static int add_underscore = 0;
-static int add_stdcall_underscore = 0;
-static int dontdeltemps = 0;
-
-/* TRUE if we should export all symbols. Otherwise, we only export
- symbols listed in .drectve sections or in the def file. */
-static bfd_boolean export_all_symbols;
-
-/* TRUE if we should exclude the symbols in DEFAULT_EXCLUDES when
- exporting all symbols. */
-static bfd_boolean do_default_excludes = TRUE;
-
-/* Default symbols to exclude when exporting all the symbols. */
-static const char *default_excludes = "DllMain@12,DllEntryPoint@0,impure_ptr";
-
-/* TRUE if we should add __imp_<SYMBOL> to import libraries for backward
- compatibility to old Cygwin releases. */
-static bfd_boolean create_compat_implib;
-
-static char *def_file;
-
-extern char * program_name;
-
-static int machine;
-static int killat;
-static int add_stdcall_alias;
-static const char *ext_prefix_alias;
-static int verbose;
-static FILE *output_def;
-static FILE *base_file;
-
-#ifdef DLLTOOL_DEFAULT_ARM
-static const char *mname = "arm";
-#endif
-
-#ifdef DLLTOOL_DEFAULT_ARM_EPOC
-static const char *mname = "arm-epoc";
-#endif
-
-#ifdef DLLTOOL_DEFAULT_ARM_WINCE
-static const char *mname = "arm-wince";
-#endif
-
-#ifdef DLLTOOL_DEFAULT_I386
-static const char *mname = "i386";
-#endif
-
-#ifdef DLLTOOL_DEFAULT_MX86_64
-static const char *mname = "i386:x86-64";
-#endif
-
-#ifdef DLLTOOL_DEFAULT_PPC
-static const char *mname = "ppc";
-#endif
-
-#ifdef DLLTOOL_DEFAULT_SH
-static const char *mname = "sh";
-#endif
-
-#ifdef DLLTOOL_DEFAULT_MIPS
-static const char *mname = "mips";
-#endif
-
-#ifdef DLLTOOL_DEFAULT_MCORE
-static const char * mname = "mcore-le";
-#endif
-
-#ifdef DLLTOOL_DEFAULT_MCORE_ELF
-static const char * mname = "mcore-elf";
-static char * mcore_elf_out_file = NULL;
-static char * mcore_elf_linker = NULL;
-static char * mcore_elf_linker_flags = NULL;
-
-#define DRECTVE_SECTION_NAME ((machine == MMCORE_ELF || machine == MMCORE_ELF_LE) ? ".exports" : ".drectve")
-#endif
-
-#ifndef DRECTVE_SECTION_NAME
-#define DRECTVE_SECTION_NAME ".drectve"
-#endif
-
-/* What's the right name for this ? */
-#define PATHMAX 250
-
-/* External name alias numbering starts here. */
-#define PREFIX_ALIAS_BASE 20000
-
-char *tmp_asm_buf;
-char *tmp_head_s_buf;
-char *tmp_head_o_buf;
-char *tmp_tail_s_buf;
-char *tmp_tail_o_buf;
-char *tmp_stub_buf;
-
-#define TMP_ASM dlltmp (&tmp_asm_buf, "%sc.s")
-#define TMP_HEAD_S dlltmp (&tmp_head_s_buf, "%sh.s")
-#define TMP_HEAD_O dlltmp (&tmp_head_o_buf, "%sh.o")
-#define TMP_TAIL_S dlltmp (&tmp_tail_s_buf, "%st.s")
-#define TMP_TAIL_O dlltmp (&tmp_tail_o_buf, "%st.o")
-#define TMP_STUB dlltmp (&tmp_stub_buf, "%ss")
-
-/* This bit of assembly does jmp * .... */
-static const unsigned char i386_jtab[] =
-{
- 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90
-};
-
-static const unsigned char arm_jtab[] =
-{
- 0x00, 0xc0, 0x9f, 0xe5, /* ldr ip, [pc] */
- 0x00, 0xf0, 0x9c, 0xe5, /* ldr pc, [ip] */
- 0, 0, 0, 0
-};
-
-static const unsigned char arm_interwork_jtab[] =
-{
- 0x04, 0xc0, 0x9f, 0xe5, /* ldr ip, [pc] */
- 0x00, 0xc0, 0x9c, 0xe5, /* ldr ip, [ip] */
- 0x1c, 0xff, 0x2f, 0xe1, /* bx ip */
- 0, 0, 0, 0
-};
-
-static const unsigned char thumb_jtab[] =
-{
- 0x40, 0xb4, /* push {r6} */
- 0x02, 0x4e, /* ldr r6, [pc, #8] */
- 0x36, 0x68, /* ldr r6, [r6] */
- 0xb4, 0x46, /* mov ip, r6 */
- 0x40, 0xbc, /* pop {r6} */
- 0x60, 0x47, /* bx ip */
- 0, 0, 0, 0
-};
-
-static const unsigned char mcore_be_jtab[] =
-{
- 0x71, 0x02, /* lrw r1,2 */
- 0x81, 0x01, /* ld.w r1,(r1,0) */
- 0x00, 0xC1, /* jmp r1 */
- 0x12, 0x00, /* nop */
- 0x00, 0x00, 0x00, 0x00 /* <address> */
-};
-
-static const unsigned char mcore_le_jtab[] =
-{
- 0x02, 0x71, /* lrw r1,2 */
- 0x01, 0x81, /* ld.w r1,(r1,0) */
- 0xC1, 0x00, /* jmp r1 */
- 0x00, 0x12, /* nop */
- 0x00, 0x00, 0x00, 0x00 /* <address> */
-};
-
-/* This is the glue sequence for PowerPC PE. There is a
- tocrel16-tocdefn reloc against the first instruction.
- We also need a IMGLUE reloc against the glue function
- to restore the toc saved by the third instruction in
- the glue. */
-static const unsigned char ppc_jtab[] =
-{
- 0x00, 0x00, 0x62, 0x81, /* lwz r11,0(r2) */
- /* Reloc TOCREL16 __imp_xxx */
- 0x00, 0x00, 0x8B, 0x81, /* lwz r12,0(r11) */
- 0x04, 0x00, 0x41, 0x90, /* stw r2,4(r1) */
- 0xA6, 0x03, 0x89, 0x7D, /* mtctr r12 */
- 0x04, 0x00, 0x4B, 0x80, /* lwz r2,4(r11) */
- 0x20, 0x04, 0x80, 0x4E /* bctr */
-};
-
-#ifdef DLLTOOL_PPC
-/* The glue instruction, picks up the toc from the stw in
- the above code: "lwz r2,4(r1)". */
-static bfd_vma ppc_glue_insn = 0x80410004;
-#endif
-
-struct mac
- {
- const char *type;
- const char *how_byte;
- const char *how_short;
- const char *how_long;
- const char *how_asciz;
- const char *how_comment;
- const char *how_jump;
- const char *how_global;
- const char *how_space;
- const char *how_align_short;
- const char *how_align_long;
- const char *how_default_as_switches;
- const char *how_bfd_target;
- enum bfd_architecture how_bfd_arch;
- const unsigned char *how_jtab;
- int how_jtab_size; /* Size of the jtab entry. */
- int how_jtab_roff; /* Offset into it for the ind 32 reloc into idata 5. */
- };
-
-static const struct mac
-mtable[] =
-{
- {
-#define MARM 0
- "arm", ".byte", ".short", ".long", ".asciz", "@",
- "ldr\tip,[pc]\n\tldr\tpc,[ip]\n\t.long",
- ".global", ".space", ".align\t2",".align\t4", "-mapcs-32",
- "pe-arm-little", bfd_arch_arm,
- arm_jtab, sizeof (arm_jtab), 8
- }
- ,
- {
-#define M386 1
- "i386", ".byte", ".short", ".long", ".asciz", "#",
- "jmp *", ".global", ".space", ".align\t2",".align\t4", "",
- "pe-i386",bfd_arch_i386,
- i386_jtab, sizeof (i386_jtab), 2
- }
- ,
- {
-#define MPPC 2
- "ppc", ".byte", ".short", ".long", ".asciz", "#",
- "jmp *", ".global", ".space", ".align\t2",".align\t4", "",
- "pe-powerpcle",bfd_arch_powerpc,
- ppc_jtab, sizeof (ppc_jtab), 0
- }
- ,
- {
-#define MTHUMB 3
- "thumb", ".byte", ".short", ".long", ".asciz", "@",
- "push\t{r6}\n\tldr\tr6, [pc, #8]\n\tldr\tr6, [r6]\n\tmov\tip, r6\n\tpop\t{r6}\n\tbx\tip",
- ".global", ".space", ".align\t2",".align\t4", "-mthumb-interwork",
- "pe-arm-little", bfd_arch_arm,
- thumb_jtab, sizeof (thumb_jtab), 12
- }
- ,
-#define MARM_INTERWORK 4
- {
- "arm_interwork", ".byte", ".short", ".long", ".asciz", "@",
- "ldr\tip,[pc]\n\tldr\tip,[ip]\n\tbx\tip\n\t.long",
- ".global", ".space", ".align\t2",".align\t4", "-mthumb-interwork",
- "pe-arm-little", bfd_arch_arm,
- arm_interwork_jtab, sizeof (arm_interwork_jtab), 12
- }
- ,
- {
-#define MMCORE_BE 5
- "mcore-be", ".byte", ".short", ".long", ".asciz", "//",
- "lrw r1,[1f]\n\tld.w r1,(r1,0)\n\tjmp r1\n\tnop\n1:.long",
- ".global", ".space", ".align\t2",".align\t4", "",
- "pe-mcore-big", bfd_arch_mcore,
- mcore_be_jtab, sizeof (mcore_be_jtab), 8
- }
- ,
- {
-#define MMCORE_LE 6
- "mcore-le", ".byte", ".short", ".long", ".asciz", "//",
- "lrw r1,[1f]\n\tld.w r1,(r1,0)\n\tjmp r1\n\tnop\n1:.long",
- ".global", ".space", ".align\t2",".align\t4", "-EL",
- "pe-mcore-little", bfd_arch_mcore,
- mcore_le_jtab, sizeof (mcore_le_jtab), 8
- }
- ,
- {
-#define MMCORE_ELF 7
- "mcore-elf-be", ".byte", ".short", ".long", ".asciz", "//",
- "lrw r1,[1f]\n\tld.w r1,(r1,0)\n\tjmp r1\n\tnop\n1:.long",
- ".global", ".space", ".align\t2",".align\t4", "",
- "elf32-mcore-big", bfd_arch_mcore,
- mcore_be_jtab, sizeof (mcore_be_jtab), 8
- }
- ,
- {
-#define MMCORE_ELF_LE 8
- "mcore-elf-le", ".byte", ".short", ".long", ".asciz", "//",
- "lrw r1,[1f]\n\tld.w r1,(r1,0)\n\tjmp r1\n\tnop\n1:.long",
- ".global", ".space", ".align\t2",".align\t4", "-EL",
- "elf32-mcore-little", bfd_arch_mcore,
- mcore_le_jtab, sizeof (mcore_le_jtab), 8
- }
- ,
- {
-#define MARM_EPOC 9
- "arm-epoc", ".byte", ".short", ".long", ".asciz", "@",
- "ldr\tip,[pc]\n\tldr\tpc,[ip]\n\t.long",
- ".global", ".space", ".align\t2",".align\t4", "",
- "epoc-pe-arm-little", bfd_arch_arm,
- arm_jtab, sizeof (arm_jtab), 8
- }
- ,
- {
-#define MARM_WINCE 10
- "arm-wince", ".byte", ".short", ".long", ".asciz", "@",
- "ldr\tip,[pc]\n\tldr\tpc,[ip]\n\t.long",
- ".global", ".space", ".align\t2",".align\t4", "-mapcs-32",
- "pe-arm-wince-little", bfd_arch_arm,
- arm_jtab, sizeof (arm_jtab), 8
- }
- ,
- {
-#define MX86 11
- "i386:x86-64", ".byte", ".short", ".long", ".asciz", "#",
- "jmp *", ".global", ".space", ".align\t2",".align\t4", "",
- "pe-x86-64",bfd_arch_i386,
- i386_jtab, sizeof (i386_jtab), 2
- }
- ,
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-typedef struct dlist
-{
- char *text;
- struct dlist *next;
-}
-dlist_type;
-
-typedef struct export
- {
- const char *name;
- const char *internal_name;
- const char *import_name;
- int ordinal;
- int constant;
- int noname; /* Don't put name in image file. */
- int private; /* Don't put reference in import lib. */
- int data;
- int hint;
- int forward; /* Number of forward label, 0 means no forward. */
- struct export *next;
- }
-export_type;
-
-/* A list of symbols which we should not export. */
-
-struct string_list
-{
- struct string_list *next;
- char *string;
-};
-
-static struct string_list *excludes;
-
-static const char *rvaafter (int);
-static const char *rvabefore (int);
-static const char *asm_prefix (int, const char *);
-static void process_def_file (const char *);
-static void new_directive (char *);
-static void append_import (const char *, const char *, int);
-static void run (const char *, char *);
-static void scan_drectve_symbols (bfd *);
-static void scan_filtered_symbols (bfd *, void *, long, unsigned int);
-static void add_excludes (const char *);
-static bfd_boolean match_exclude (const char *);
-static void set_default_excludes (void);
-static long filter_symbols (bfd *, void *, long, unsigned int);
-static void scan_all_symbols (bfd *);
-static void scan_open_obj_file (bfd *);
-static void scan_obj_file (const char *);
-static void dump_def_info (FILE *);
-static int sfunc (const void *, const void *);
-static void flush_page (FILE *, long *, int, int);
-static void gen_def_file (void);
-static void generate_idata_ofile (FILE *);
-static void assemble_file (const char *, const char *);
-static void gen_exp_file (void);
-static const char *xlate (const char *);
-static char *make_label (const char *, const char *);
-static char *make_imp_label (const char *, const char *);
-static bfd *make_one_lib_file (export_type *, int);
-static bfd *make_head (void);
-static bfd *make_tail (void);
-static void gen_lib_file (void);
-static int pfunc (const void *, const void *);
-static int nfunc (const void *, const void *);
-static void remove_null_names (export_type **);
-static void process_duplicates (export_type **);
-static void fill_ordinals (export_type **);
-static void mangle_defs (void);
-static void usage (FILE *, int);
-static void inform (const char *, ...) ATTRIBUTE_PRINTF_1;
-static void set_dll_name_from_def (const char *);
-
-static char *
-prefix_encode (char *start, unsigned code)
-{
- static char alpha[26] = "abcdefghijklmnopqrstuvwxyz";
- static char buf[32];
- char *p;
- strcpy (buf, start);
- p = strchr (buf, '\0');
- do
- *p++ = alpha[code % sizeof (alpha)];
- while ((code /= sizeof (alpha)) != 0);
- *p = '\0';
- return buf;
-}
-
-static char *
-dlltmp (char **buf, const char *fmt)
-{
- if (!*buf)
- {
- *buf = malloc (strlen (tmp_prefix) + 64);
- sprintf (*buf, fmt, tmp_prefix);
- }
- return *buf;
-}
-
-static void
-inform VPARAMS ((const char * message, ...))
-{
- VA_OPEN (args, message);
- VA_FIXEDARG (args, const char *, message);
-
- if (!verbose)
- return;
-
- report (message, args);
-
- VA_CLOSE (args);
-}
-
-static const char *
-rvaafter (int machine)
-{
- switch (machine)
- {
- case MARM:
- case M386:
- case MX86:
- case MPPC:
- case MTHUMB:
- case MARM_INTERWORK:
- case MMCORE_BE:
- case MMCORE_LE:
- case MMCORE_ELF:
- case MMCORE_ELF_LE:
- case MARM_EPOC:
- case MARM_WINCE:
- break;
- default:
- /* xgettext:c-format */
- fatal (_("Internal error: Unknown machine type: %d"), machine);
- break;
- }
- return "";
-}
-
-static const char *
-rvabefore (int machine)
-{
- switch (machine)
- {
- case MARM:
- case M386:
- case MX86:
- case MPPC:
- case MTHUMB:
- case MARM_INTERWORK:
- case MMCORE_BE:
- case MMCORE_LE:
- case MMCORE_ELF:
- case MMCORE_ELF_LE:
- case MARM_EPOC:
- case MARM_WINCE:
- return ".rva\t";
- default:
- /* xgettext:c-format */
- fatal (_("Internal error: Unknown machine type: %d"), machine);
- break;
- }
- return "";
-}
-
-static const char *
-asm_prefix (int machine, const char *name)
-{
- switch (machine)
- {
- case MARM:
- case MPPC:
- case MTHUMB:
- case MARM_INTERWORK:
- case MMCORE_BE:
- case MMCORE_LE:
- case MMCORE_ELF:
- case MMCORE_ELF_LE:
- case MARM_EPOC:
- case MARM_WINCE:
- break;
- case M386:
- case MX86:
- /* Symbol names starting with ? do not have a leading underscore. */
- if (name && *name == '?')
- break;
- else
- return "_";
- default:
- /* xgettext:c-format */
- fatal (_("Internal error: Unknown machine type: %d"), machine);
- break;
- }
- return "";
-}
-
-#define ASM_BYTE mtable[machine].how_byte
-#define ASM_SHORT mtable[machine].how_short
-#define ASM_LONG mtable[machine].how_long
-#define ASM_TEXT mtable[machine].how_asciz
-#define ASM_C mtable[machine].how_comment
-#define ASM_JUMP mtable[machine].how_jump
-#define ASM_GLOBAL mtable[machine].how_global
-#define ASM_SPACE mtable[machine].how_space
-#define ASM_ALIGN_SHORT mtable[machine].how_align_short
-#define ASM_RVA_BEFORE rvabefore (machine)
-#define ASM_RVA_AFTER rvaafter (machine)
-#define ASM_PREFIX(NAME) asm_prefix (machine, (NAME))
-#define ASM_ALIGN_LONG mtable[machine].how_align_long
-#define HOW_BFD_READ_TARGET 0 /* Always default. */
-#define HOW_BFD_WRITE_TARGET mtable[machine].how_bfd_target
-#define HOW_BFD_ARCH mtable[machine].how_bfd_arch
-#define HOW_JTAB mtable[machine].how_jtab
-#define HOW_JTAB_SIZE mtable[machine].how_jtab_size
-#define HOW_JTAB_ROFF mtable[machine].how_jtab_roff
-#define ASM_SWITCHES mtable[machine].how_default_as_switches
-
-static char **oav;
-
-static void
-process_def_file (const char *name)
-{
- FILE *f = fopen (name, FOPEN_RT);
-
- if (!f)
- /* xgettext:c-format */
- fatal (_("Can't open def file: %s"), name);
-
- yyin = f;
-
- /* xgettext:c-format */
- inform (_("Processing def file: %s"), name);
-
- yyparse ();
-
- inform (_("Processed def file"));
-}
-
-/**********************************************************************/
-
-/* Communications with the parser. */
-
-static int d_nfuncs; /* Number of functions exported. */
-static int d_named_nfuncs; /* Number of named functions exported. */
-static int d_low_ord; /* Lowest ordinal index. */
-static int d_high_ord; /* Highest ordinal index. */
-static export_type *d_exports; /* List of exported functions. */
-static export_type **d_exports_lexically; /* Vector of exported functions in alpha order. */
-static dlist_type *d_list; /* Descriptions. */
-static dlist_type *a_list; /* Stuff to go in directives. */
-static int d_nforwards = 0; /* Number of forwarded exports. */
-
-static int d_is_dll;
-static int d_is_exe;
-
-int
-yyerror (const char * err ATTRIBUTE_UNUSED)
-{
- /* xgettext:c-format */
- non_fatal (_("Syntax error in def file %s:%d"), def_file, linenumber);
-
- return 0;
-}
-
-void
-def_exports (const char *name, const char *internal_name, int ordinal,
- int noname, int constant, int data, int private)
-{
- struct export *p = (struct export *) xmalloc (sizeof (*p));
-
- p->name = name;
- p->internal_name = internal_name ? internal_name : name;
- p->import_name = name;
- p->ordinal = ordinal;
- p->constant = constant;
- p->noname = noname;
- p->private = private;
- p->data = data;
- p->next = d_exports;
- d_exports = p;
- d_nfuncs++;
-
- if ((internal_name != NULL)
- && (strchr (internal_name, '.') != NULL))
- p->forward = ++d_nforwards;
- else
- p->forward = 0; /* no forward */
-}
-
-static void
-set_dll_name_from_def (const char * name)
-{
- const char* image_basename = lbasename (name);
- if (image_basename != name)
- non_fatal (_("%s: Path components stripped from image name, '%s'."),
- def_file, name);
- dll_name = xstrdup (image_basename);
-}
-
-void
-def_name (const char *name, int base)
-{
- /* xgettext:c-format */
- inform (_("NAME: %s base: %x"), name, base);
-
- if (d_is_dll)
- non_fatal (_("Can't have LIBRARY and NAME"));
-
- /* If --dllname not provided, use the one in the DEF file.
- FIXME: Is this appropriate for executables? */
- if (! dll_name)
- set_dll_name_from_def (name);
- d_is_exe = 1;
-}
-
-void
-def_library (const char *name, int base)
-{
- /* xgettext:c-format */
- inform (_("LIBRARY: %s base: %x"), name, base);
-
- if (d_is_exe)
- non_fatal (_("Can't have LIBRARY and NAME"));
-
- /* If --dllname not provided, use the one in the DEF file. */
- if (! dll_name)
- set_dll_name_from_def (name);
- d_is_dll = 1;
-}
-
-void
-def_description (const char *desc)
-{
- dlist_type *d = (dlist_type *) xmalloc (sizeof (dlist_type));
- d->text = xstrdup (desc);
- d->next = d_list;
- d_list = d;
-}
-
-static void
-new_directive (char *dir)
-{
- dlist_type *d = (dlist_type *) xmalloc (sizeof (dlist_type));
- d->text = xstrdup (dir);
- d->next = a_list;
- a_list = d;
-}
-
-void
-def_heapsize (int reserve, int commit)
-{
- char b[200];
- if (commit > 0)
- sprintf (b, "-heap 0x%x,0x%x ", reserve, commit);
- else
- sprintf (b, "-heap 0x%x ", reserve);
- new_directive (xstrdup (b));
-}
-
-void
-def_stacksize (int reserve, int commit)
-{
- char b[200];
- if (commit > 0)
- sprintf (b, "-stack 0x%x,0x%x ", reserve, commit);
- else
- sprintf (b, "-stack 0x%x ", reserve);
- new_directive (xstrdup (b));
-}
-
-/* append_import simply adds the given import definition to the global
- import_list. It is used by def_import. */
-
-static void
-append_import (const char *symbol_name, const char *dll_name, int func_ordinal)
-{
- iheadtype **pq;
- iheadtype *q;
-
- for (pq = &import_list; *pq != NULL; pq = &(*pq)->next)
- {
- if (strcmp ((*pq)->dllname, dll_name) == 0)
- {
- q = *pq;
- q->functail->next = xmalloc (sizeof (ifunctype));
- q->functail = q->functail->next;
- q->functail->ord = func_ordinal;
- q->functail->name = xstrdup (symbol_name);
- q->functail->next = NULL;
- q->nfuncs++;
- return;
- }
- }
-
- q = xmalloc (sizeof (iheadtype));
- q->dllname = xstrdup (dll_name);
- q->nfuncs = 1;
- q->funchead = xmalloc (sizeof (ifunctype));
- q->functail = q->funchead;
- q->next = NULL;
- q->functail->name = xstrdup (symbol_name);
- q->functail->ord = func_ordinal;
- q->functail->next = NULL;
-
- *pq = q;
-}
-
-/* def_import is called from within defparse.y when an IMPORT
- declaration is encountered. Depending on the form of the
- declaration, the module name may or may not need ".dll" to be
- appended to it, the name of the function may be stored in internal
- or entry, and there may or may not be an ordinal value associated
- with it. */
-
-/* A note regarding the parse modes:
- In defparse.y we have to accept import declarations which follow
- any one of the following forms:
- <func_name_in_app> = <dll_name>.<func_name_in_dll>
- <func_name_in_app> = <dll_name>.<number>
- <dll_name>.<func_name_in_dll>
- <dll_name>.<number>
- Furthermore, the dll's name may or may not end with ".dll", which
- complicates the parsing a little. Normally the dll's name is
- passed to def_import() in the "module" parameter, but when it ends
- with ".dll" it gets passed in "module" sans ".dll" and that needs
- to be reappended.
-
- def_import gets five parameters:
- APP_NAME - the name of the function in the application, if
- present, or NULL if not present.
- MODULE - the name of the dll, possibly sans extension (ie, '.dll').
- DLLEXT - the extension of the dll, if present, NULL if not present.
- ENTRY - the name of the function in the dll, if present, or NULL.
- ORD_VAL - the numerical tag of the function in the dll, if present,
- or NULL. Exactly one of <entry> or <ord_val> must be
- present (i.e., not NULL). */
-
-void
-def_import (const char *app_name, const char *module, const char *dllext,
- const char *entry, int ord_val)
-{
- const char *application_name;
- char *buf;
-
- if (entry != NULL)
- application_name = entry;
- else
- {
- if (app_name != NULL)
- application_name = app_name;
- else
- application_name = "";
- }
-
- if (dllext != NULL)
- {
- buf = (char *) alloca (strlen (module) + strlen (dllext) + 2);
- sprintf (buf, "%s.%s", module, dllext);
- module = buf;
- }
-
- append_import (application_name, module, ord_val);
-}
-
-void
-def_version (int major, int minor)
-{
- printf ("VERSION %d.%d\n", major, minor);
-}
-
-void
-def_section (const char *name, int attr)
-{
- char buf[200];
- char atts[5];
- char *d = atts;
- if (attr & 1)
- *d++ = 'R';
-
- if (attr & 2)
- *d++ = 'W';
- if (attr & 4)
- *d++ = 'X';
- if (attr & 8)
- *d++ = 'S';
- *d++ = 0;
- sprintf (buf, "-attr %s %s", name, atts);
- new_directive (xstrdup (buf));
-}
-
-void
-def_code (int attr)
-{
-
- def_section ("CODE", attr);
-}
-
-void
-def_data (int attr)
-{
- def_section ("DATA", attr);
-}
-
-/**********************************************************************/
-
-static void
-run (const char *what, char *args)
-{
- char *s;
- int pid, wait_status;
- int i;
- const char **argv;
- char *errmsg_fmt, *errmsg_arg;
- char *temp_base = choose_temp_base ();
-
- inform ("run: %s %s", what, args);
-
- /* Count the args */
- i = 0;
- for (s = args; *s; s++)
- if (*s == ' ')
- i++;
- i++;
- argv = alloca (sizeof (char *) * (i + 3));
- i = 0;
- argv[i++] = what;
- s = args;
- while (1)
- {
- while (*s == ' ')
- ++s;
- argv[i++] = s;
- while (*s != ' ' && *s != 0)
- s++;
- if (*s == 0)
- break;
- *s++ = 0;
- }
- argv[i++] = NULL;
-
- pid = pexecute (argv[0], (char * const *) argv, program_name, temp_base,
- &errmsg_fmt, &errmsg_arg, PEXECUTE_ONE | PEXECUTE_SEARCH);
-
- if (pid == -1)
- {
- inform (strerror (errno));
-
- fatal (errmsg_fmt, errmsg_arg);
- }
-
- pid = pwait (pid, & wait_status, 0);
-
- if (pid == -1)
- {
- /* xgettext:c-format */
- fatal (_("wait: %s"), strerror (errno));
- }
- else if (WIFSIGNALED (wait_status))
- {
- /* xgettext:c-format */
- fatal (_("subprocess got fatal signal %d"), WTERMSIG (wait_status));
- }
- else if (WIFEXITED (wait_status))
- {
- if (WEXITSTATUS (wait_status) != 0)
- /* xgettext:c-format */
- non_fatal (_("%s exited with status %d"),
- what, WEXITSTATUS (wait_status));
- }
- else
- abort ();
-}
-
-/* Look for a list of symbols to export in the .drectve section of
- ABFD. Pass each one to def_exports. */
-
-static void
-scan_drectve_symbols (bfd *abfd)
-{
- asection * s;
- int size;
- char * buf;
- char * p;
- char * e;
-
- /* Look for .drectve's */
- s = bfd_get_section_by_name (abfd, DRECTVE_SECTION_NAME);
-
- if (s == NULL)
- return;
-
- size = bfd_get_section_size (s);
- buf = xmalloc (size);
-
- bfd_get_section_contents (abfd, s, buf, 0, size);
-
- /* xgettext:c-format */
- inform (_("Sucking in info from %s section in %s"),
- DRECTVE_SECTION_NAME, bfd_get_filename (abfd));
-
- /* Search for -export: strings. The exported symbols can optionally
- have type tags (eg., -export:foo,data), so handle those as well.
- Currently only data tag is supported. */
- p = buf;
- e = buf + size;
- while (p < e)
- {
- if (p[0] == '-'
- && CONST_STRNEQ (p, "-export:"))
- {
- char * name;
- char * c;
- flagword flags = BSF_FUNCTION;
-
- p += 8;
- name = p;
- while (p < e && *p != ',' && *p != ' ' && *p != '-')
- p++;
- c = xmalloc (p - name + 1);
- memcpy (c, name, p - name);
- c[p - name] = 0;
- if (p < e && *p == ',') /* found type tag. */
- {
- char *tag_start = ++p;
- while (p < e && *p != ' ' && *p != '-')
- p++;
- if (CONST_STRNEQ (tag_start, "data"))
- flags &= ~BSF_FUNCTION;
- }
-
- /* FIXME: The 5th arg is for the `constant' field.
- What should it be? Not that it matters since it's not
- currently useful. */
- def_exports (c, 0, -1, 0, 0, ! (flags & BSF_FUNCTION), 0);
-
- if (add_stdcall_alias && strchr (c, '@'))
- {
- int lead_at = (*c == '@') ;
- char *exported_name = xstrdup (c + lead_at);
- char *atsym = strchr (exported_name, '@');
- *atsym = '\0';
- /* Note: stdcall alias symbols can never be data. */
- def_exports (exported_name, xstrdup (c), -1, 0, 0, 0, 0);
- }
- }
- else
- p++;
- }
- free (buf);
-}
-
-/* Look through the symbols in MINISYMS, and add each one to list of
- symbols to export. */
-
-static void
-scan_filtered_symbols (bfd *abfd, void *minisyms, long symcount,
- unsigned int size)
-{
- asymbol *store;
- bfd_byte *from, *fromend;
-
- store = bfd_make_empty_symbol (abfd);
- if (store == NULL)
- bfd_fatal (bfd_get_filename (abfd));
-
- from = (bfd_byte *) minisyms;
- fromend = from + symcount * size;
- for (; from < fromend; from += size)
- {
- asymbol *sym;
- const char *symbol_name;
-
- sym = bfd_minisymbol_to_symbol (abfd, FALSE, from, store);
- if (sym == NULL)
- bfd_fatal (bfd_get_filename (abfd));
-
- symbol_name = bfd_asymbol_name (sym);
- if (bfd_get_symbol_leading_char (abfd) == symbol_name[0])
- ++symbol_name;
-
- def_exports (xstrdup (symbol_name) , 0, -1, 0, 0,
- ! (sym->flags & BSF_FUNCTION), 0);
-
- if (add_stdcall_alias && strchr (symbol_name, '@'))
- {
- int lead_at = (*symbol_name == '@');
- char *exported_name = xstrdup (symbol_name + lead_at);
- char *atsym = strchr (exported_name, '@');
- *atsym = '\0';
- /* Note: stdcall alias symbols can never be data. */
- def_exports (exported_name, xstrdup (symbol_name), -1, 0, 0, 0, 0);
- }
- }
-}
-
-/* Add a list of symbols to exclude. */
-
-static void
-add_excludes (const char *new_excludes)
-{
- char *local_copy;
- char *exclude_string;
-
- local_copy = xstrdup (new_excludes);
-
- exclude_string = strtok (local_copy, ",:");
- for (; exclude_string; exclude_string = strtok (NULL, ",:"))
- {
- struct string_list *new_exclude;
-
- new_exclude = ((struct string_list *)
- xmalloc (sizeof (struct string_list)));
- new_exclude->string = (char *) xmalloc (strlen (exclude_string) + 2);
- /* Don't add a leading underscore for fastcall symbols. */
- if (*exclude_string == '@')
- sprintf (new_exclude->string, "%s", exclude_string);
- else
- sprintf (new_exclude->string, "_%s", exclude_string);
- new_exclude->next = excludes;
- excludes = new_exclude;
-
- /* xgettext:c-format */
- inform (_("Excluding symbol: %s"), exclude_string);
- }
-
- free (local_copy);
-}
-
-/* See if STRING is on the list of symbols to exclude. */
-
-static bfd_boolean
-match_exclude (const char *string)
-{
- struct string_list *excl_item;
-
- for (excl_item = excludes; excl_item; excl_item = excl_item->next)
- if (strcmp (string, excl_item->string) == 0)
- return TRUE;
- return FALSE;
-}
-
-/* Add the default list of symbols to exclude. */
-
-static void
-set_default_excludes (void)
-{
- add_excludes (default_excludes);
-}
-
-/* Choose which symbols to export. */
-
-static long
-filter_symbols (bfd *abfd, void *minisyms, long symcount, unsigned int size)
-{
- bfd_byte *from, *fromend, *to;
- asymbol *store;
-
- store = bfd_make_empty_symbol (abfd);
- if (store == NULL)
- bfd_fatal (bfd_get_filename (abfd));
-
- from = (bfd_byte *) minisyms;
- fromend = from + symcount * size;
- to = (bfd_byte *) minisyms;
-
- for (; from < fromend; from += size)
- {
- int keep = 0;
- asymbol *sym;
-
- sym = bfd_minisymbol_to_symbol (abfd, FALSE, (const void *) from, store);
- if (sym == NULL)
- bfd_fatal (bfd_get_filename (abfd));
-
- /* Check for external and defined only symbols. */
- keep = (((sym->flags & BSF_GLOBAL) != 0
- || (sym->flags & BSF_WEAK) != 0
- || bfd_is_com_section (sym->section))
- && ! bfd_is_und_section (sym->section));
-
- keep = keep && ! match_exclude (sym->name);
-
- if (keep)
- {
- memcpy (to, from, size);
- to += size;
- }
- }
-
- return (to - (bfd_byte *) minisyms) / size;
-}
-
-/* Export all symbols in ABFD, except for ones we were told not to
- export. */
-
-static void
-scan_all_symbols (bfd *abfd)
-{
- long symcount;
- void *minisyms;
- unsigned int size;
-
- /* Ignore bfds with an import descriptor table. We assume that any
- such BFD contains symbols which are exported from another DLL,
- and we don't want to reexport them from here. */
- if (bfd_get_section_by_name (abfd, ".idata$4"))
- return;
-
- if (! (bfd_get_file_flags (abfd) & HAS_SYMS))
- {
- /* xgettext:c-format */
- non_fatal (_("%s: no symbols"), bfd_get_filename (abfd));
- return;
- }
-
- symcount = bfd_read_minisymbols (abfd, FALSE, &minisyms, &size);
- if (symcount < 0)
- bfd_fatal (bfd_get_filename (abfd));
-
- if (symcount == 0)
- {
- /* xgettext:c-format */
- non_fatal (_("%s: no symbols"), bfd_get_filename (abfd));
- return;
- }
-
- /* Discard the symbols we don't want to export. It's OK to do this
- in place; we'll free the storage anyway. */
-
- symcount = filter_symbols (abfd, minisyms, symcount, size);
- scan_filtered_symbols (abfd, minisyms, symcount, size);
-
- free (minisyms);
-}
-
-/* Look at the object file to decide which symbols to export. */
-
-static void
-scan_open_obj_file (bfd *abfd)
-{
- if (export_all_symbols)
- scan_all_symbols (abfd);
- else
- scan_drectve_symbols (abfd);
-
- /* FIXME: we ought to read in and block out the base relocations. */
-
- /* xgettext:c-format */
- inform (_("Done reading %s"), bfd_get_filename (abfd));
-}
-
-static void
-scan_obj_file (const char *filename)
-{
- bfd * f = bfd_openr (filename, 0);
-
- if (!f)
- /* xgettext:c-format */
- fatal (_("Unable to open object file: %s"), filename);
-
- /* xgettext:c-format */
- inform (_("Scanning object file %s"), filename);
-
- if (bfd_check_format (f, bfd_archive))
- {
- bfd *arfile = bfd_openr_next_archived_file (f, 0);
- while (arfile)
- {
- if (bfd_check_format (arfile, bfd_object))
- scan_open_obj_file (arfile);
- bfd_close (arfile);
- arfile = bfd_openr_next_archived_file (f, arfile);
- }
-
-#ifdef DLLTOOL_MCORE_ELF
- if (mcore_elf_out_file)
- inform (_("Cannot produce mcore-elf dll from archive file: %s"), filename);
-#endif
- }
- else if (bfd_check_format (f, bfd_object))
- {
- scan_open_obj_file (f);
-
-#ifdef DLLTOOL_MCORE_ELF
- if (mcore_elf_out_file)
- mcore_elf_cache_filename (filename);
-#endif
- }
-
- bfd_close (f);
-}
-
-/**********************************************************************/
-
-static void
-dump_def_info (FILE *f)
-{
- int i;
- export_type *exp;
- fprintf (f, "%s ", ASM_C);
- for (i = 0; oav[i]; i++)
- fprintf (f, "%s ", oav[i]);
- fprintf (f, "\n");
- for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
- {
- fprintf (f, "%s %d = %s %s @ %d %s%s%s%s\n",
- ASM_C,
- i,
- exp->name,
- exp->internal_name,
- exp->ordinal,
- exp->noname ? "NONAME " : "",
- exp->private ? "PRIVATE " : "",
- exp->constant ? "CONSTANT" : "",
- exp->data ? "DATA" : "");
- }
-}
-
-/* Generate the .exp file. */
-
-static int
-sfunc (const void *a, const void *b)
-{
- return *(const long *) a - *(const long *) b;
-}
-
-static void
-flush_page (FILE *f, long *need, int page_addr, int on_page)
-{
- int i;
-
- /* Flush this page. */
- fprintf (f, "\t%s\t0x%08x\t%s Starting RVA for chunk\n",
- ASM_LONG,
- page_addr,
- ASM_C);
- fprintf (f, "\t%s\t0x%x\t%s Size of block\n",
- ASM_LONG,
- (on_page * 2) + (on_page & 1) * 2 + 8,
- ASM_C);
-
- for (i = 0; i < on_page; i++)
- {
- unsigned long needed = need[i];
-
- if (needed)
- needed = ((needed - page_addr) | 0x3000) & 0xffff;
-
- fprintf (f, "\t%s\t0x%lx\n", ASM_SHORT, needed);
- }
-
- /* And padding */
- if (on_page & 1)
- fprintf (f, "\t%s\t0x%x\n", ASM_SHORT, 0 | 0x0000);
-}
-
-static void
-gen_def_file (void)
-{
- int i;
- export_type *exp;
-
- inform (_("Adding exports to output file"));
-
- fprintf (output_def, ";");
- for (i = 0; oav[i]; i++)
- fprintf (output_def, " %s", oav[i]);
-
- fprintf (output_def, "\nEXPORTS\n");
-
- for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
- {
- char *quote = strchr (exp->name, '.') ? "\"" : "";
- char *res = cplus_demangle (exp->internal_name, DMGL_ANSI | DMGL_PARAMS);
-
- if (res)
- {
- fprintf (output_def,";\t%s\n", res);
- free (res);
- }
-
- if (strcmp (exp->name, exp->internal_name) == 0)
- {
- fprintf (output_def, "\t%s%s%s @ %d%s%s%s\n",
- quote,
- exp->name,
- quote,
- exp->ordinal,
- exp->noname ? " NONAME" : "",
- exp->private ? "PRIVATE " : "",
- exp->data ? " DATA" : "");
- }
- else
- {
- char * quote1 = strchr (exp->internal_name, '.') ? "\"" : "";
- /* char *alias = */
- fprintf (output_def, "\t%s%s%s = %s%s%s @ %d%s%s%s\n",
- quote,
- exp->name,
- quote,
- quote1,
- exp->internal_name,
- quote1,
- exp->ordinal,
- exp->noname ? " NONAME" : "",
- exp->private ? "PRIVATE " : "",
- exp->data ? " DATA" : "");
- }
- }
-
- inform (_("Added exports to output file"));
-}
-
-/* generate_idata_ofile generates the portable assembly source code
- for the idata sections. It appends the source code to the end of
- the file. */
-
-static void
-generate_idata_ofile (FILE *filvar)
-{
- iheadtype *headptr;
- ifunctype *funcptr;
- int headindex;
- int funcindex;
- int nheads;
-
- if (import_list == NULL)
- return;
-
- fprintf (filvar, "%s Import data sections\n", ASM_C);
- fprintf (filvar, "\n\t.section\t.idata$2\n");
- fprintf (filvar, "\t%s\tdoi_idata\n", ASM_GLOBAL);
- fprintf (filvar, "doi_idata:\n");
-
- nheads = 0;
- for (headptr = import_list; headptr != NULL; headptr = headptr->next)
- {
- fprintf (filvar, "\t%slistone%d%s\t%s %s\n",
- ASM_RVA_BEFORE, nheads, ASM_RVA_AFTER,
- ASM_C, headptr->dllname);
- fprintf (filvar, "\t%s\t0\n", ASM_LONG);
- fprintf (filvar, "\t%s\t0\n", ASM_LONG);
- fprintf (filvar, "\t%sdllname%d%s\n",
- ASM_RVA_BEFORE, nheads, ASM_RVA_AFTER);
- fprintf (filvar, "\t%slisttwo%d%s\n\n",
- ASM_RVA_BEFORE, nheads, ASM_RVA_AFTER);
- nheads++;
- }
-
- fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* NULL record at */
- fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* end of idata$2 */
- fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* section */
- fprintf (filvar, "\t%s\t0\n", ASM_LONG);
- fprintf (filvar, "\t%s\t0\n", ASM_LONG);
-
- fprintf (filvar, "\n\t.section\t.idata$4\n");
- headindex = 0;
- for (headptr = import_list; headptr != NULL; headptr = headptr->next)
- {
- fprintf (filvar, "listone%d:\n", headindex);
- for (funcindex = 0; funcindex < headptr->nfuncs; funcindex++)
-#ifdef DLLTOOL_MX86_64
- fprintf (filvar, "\t%sfuncptr%d_%d%s\n%s\t0\n",
- ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER,ASM_LONG);
-#else
- fprintf (filvar, "\t%sfuncptr%d_%d%s\n",
- ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER);
-#endif
-#ifdef DLLTOOL_MX86_64
- fprintf (filvar, "\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */
-#else
- fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* NULL terminating list. */
-#endif
- headindex++;
- }
-
- fprintf (filvar, "\n\t.section\t.idata$5\n");
- headindex = 0;
- for (headptr = import_list; headptr != NULL; headptr = headptr->next)
- {
- fprintf (filvar, "listtwo%d:\n", headindex);
- for (funcindex = 0; funcindex < headptr->nfuncs; funcindex++)
-#ifdef DLLTOOL_MX86_64
- fprintf (filvar, "\t%sfuncptr%d_%d%s\n%s\t0\n",
- ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER,ASM_LONG);
-#else
- fprintf (filvar, "\t%sfuncptr%d_%d%s\n",
- ASM_RVA_BEFORE, headindex, funcindex, ASM_RVA_AFTER);
-#endif
-#ifdef DLLTOOL_MX86_64
- fprintf (filvar, "\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */
-#else
- fprintf (filvar, "\t%s\t0\n", ASM_LONG); /* NULL terminating list. */
-#endif
- headindex++;
- }
-
- fprintf (filvar, "\n\t.section\t.idata$6\n");
- headindex = 0;
- for (headptr = import_list; headptr != NULL; headptr = headptr->next)
- {
- funcindex = 0;
- for (funcptr = headptr->funchead; funcptr != NULL;
- funcptr = funcptr->next)
- {
- fprintf (filvar,"funcptr%d_%d:\n", headindex, funcindex);
- fprintf (filvar,"\t%s\t%d\n", ASM_SHORT,
- ((funcptr->ord) & 0xFFFF));
- fprintf (filvar,"\t%s\t\"%s\"\n", ASM_TEXT, funcptr->name);
- fprintf (filvar,"\t%s\t0\n", ASM_BYTE);
- funcindex++;
- }
- headindex++;
- }
-
- fprintf (filvar, "\n\t.section\t.idata$7\n");
- headindex = 0;
- for (headptr = import_list; headptr != NULL; headptr = headptr->next)
- {
- fprintf (filvar,"dllname%d:\n", headindex);
- fprintf (filvar,"\t%s\t\"%s\"\n", ASM_TEXT, headptr->dllname);
- fprintf (filvar,"\t%s\t0\n", ASM_BYTE);
- headindex++;
- }
-}
-
-/* Assemble the specified file. */
-static void
-assemble_file (const char * source, const char * dest)
-{
- char * cmd;
-
- cmd = (char *) alloca (strlen (ASM_SWITCHES) + strlen (as_flags)
- + strlen (source) + strlen (dest) + 50);
-
- sprintf (cmd, "%s %s -o %s %s", ASM_SWITCHES, as_flags, dest, source);
-
- run (as_name, cmd);
-}
-
-static void
-gen_exp_file (void)
-{
- FILE *f;
- int i;
- export_type *exp;
- dlist_type *dl;
-
- /* xgettext:c-format */
- inform (_("Generating export file: %s"), exp_name);
-
- f = fopen (TMP_ASM, FOPEN_WT);
- if (!f)
- /* xgettext:c-format */
- fatal (_("Unable to open temporary assembler file: %s"), TMP_ASM);
-
- /* xgettext:c-format */
- inform (_("Opened temporary file: %s"), TMP_ASM);
-
- dump_def_info (f);
-
- if (d_exports)
- {
- fprintf (f, "\t.section .edata\n\n");
- fprintf (f, "\t%s 0 %s Allways 0\n", ASM_LONG, ASM_C);
- fprintf (f, "\t%s 0x%lx %s Time and date\n", ASM_LONG,
- (unsigned long) time(0), ASM_C);
- fprintf (f, "\t%s 0 %s Major and Minor version\n", ASM_LONG, ASM_C);
- fprintf (f, "\t%sname%s %s Ptr to name of dll\n", ASM_RVA_BEFORE, ASM_RVA_AFTER, ASM_C);
- fprintf (f, "\t%s %d %s Starting ordinal of exports\n", ASM_LONG, d_low_ord, ASM_C);
-
-
- fprintf (f, "\t%s %d %s Number of functions\n", ASM_LONG, d_high_ord - d_low_ord + 1, ASM_C);
- fprintf(f,"\t%s named funcs %d, low ord %d, high ord %d\n",
- ASM_C,
- d_named_nfuncs, d_low_ord, d_high_ord);
- fprintf (f, "\t%s %d %s Number of names\n", ASM_LONG,
- show_allnames ? d_high_ord - d_low_ord + 1 : d_named_nfuncs, ASM_C);
- fprintf (f, "\t%safuncs%s %s Address of functions\n", ASM_RVA_BEFORE, ASM_RVA_AFTER, ASM_C);
-
- fprintf (f, "\t%sanames%s %s Address of Name Pointer Table\n",
- ASM_RVA_BEFORE, ASM_RVA_AFTER, ASM_C);
-
- fprintf (f, "\t%sanords%s %s Address of ordinals\n", ASM_RVA_BEFORE, ASM_RVA_AFTER, ASM_C);
-
- fprintf (f, "name: %s \"%s\"\n", ASM_TEXT, dll_name);
-
-
- fprintf(f,"%s Export address Table\n", ASM_C);
- fprintf(f,"\t%s\n", ASM_ALIGN_LONG);
- fprintf (f, "afuncs:\n");
- i = d_low_ord;
-
- for (exp = d_exports; exp; exp = exp->next)
- {
- if (exp->ordinal != i)
- {
- while (i < exp->ordinal)
- {
- fprintf(f,"\t%s\t0\n", ASM_LONG);
- i++;
- }
- }
-
- if (exp->forward == 0)
- {
- if (exp->internal_name[0] == '@')
- fprintf (f, "\t%s%s%s\t%s %d\n", ASM_RVA_BEFORE,
- exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal);
- else
- fprintf (f, "\t%s%s%s%s\t%s %d\n", ASM_RVA_BEFORE,
- ASM_PREFIX (exp->internal_name),
- exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal);
- }
- else
- fprintf (f, "\t%sf%d%s\t%s %d\n", ASM_RVA_BEFORE,
- exp->forward, ASM_RVA_AFTER, ASM_C, exp->ordinal);
- i++;
- }
-
- fprintf (f,"%s Export Name Pointer Table\n", ASM_C);
- fprintf (f, "anames:\n");
-
- for (i = 0; (exp = d_exports_lexically[i]); i++)
- {
- if (!exp->noname || show_allnames)
- fprintf (f, "\t%sn%d%s\n",
- ASM_RVA_BEFORE, exp->ordinal, ASM_RVA_AFTER);
- }
-
- fprintf (f,"%s Export Ordinal Table\n", ASM_C);
- fprintf (f, "anords:\n");
- for (i = 0; (exp = d_exports_lexically[i]); i++)
- {
- if (!exp->noname || show_allnames)
- fprintf (f, "\t%s %d\n", ASM_SHORT, exp->ordinal - d_low_ord);
- }
-
- fprintf(f,"%s Export Name Table\n", ASM_C);
- for (i = 0; (exp = d_exports_lexically[i]); i++)
- {
- if (!exp->noname || show_allnames)
- fprintf (f, "n%d: %s \"%s\"\n",
- exp->ordinal, ASM_TEXT, xlate (exp->name));
- if (exp->forward != 0)
- fprintf (f, "f%d: %s \"%s\"\n",
- exp->forward, ASM_TEXT, exp->internal_name);
- }
-
- if (a_list)
- {
- fprintf (f, "\t.section %s\n", DRECTVE_SECTION_NAME);
- for (dl = a_list; dl; dl = dl->next)
- {
- fprintf (f, "\t%s\t\"%s\"\n", ASM_TEXT, dl->text);
- }
- }
-
- if (d_list)
- {
- fprintf (f, "\t.section .rdata\n");
- for (dl = d_list; dl; dl = dl->next)
- {
- char *p;
- int l;
-
- /* We don't output as ascii because there can
- be quote characters in the string. */
- l = 0;
- for (p = dl->text; *p; p++)
- {
- if (l == 0)
- fprintf (f, "\t%s\t", ASM_BYTE);
- else
- fprintf (f, ",");
- fprintf (f, "%d", *p);
- if (p[1] == 0)
- {
- fprintf (f, ",0\n");
- break;
- }
- if (++l == 10)
- {
- fprintf (f, "\n");
- l = 0;
- }
- }
- }
- }
- }
-
-
- /* Add to the output file a way of getting to the exported names
- without using the import library. */
- if (add_indirect)
- {
- fprintf (f, "\t.section\t.rdata\n");
- for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
- if (!exp->noname || show_allnames)
- {
- /* We use a single underscore for MS compatibility, and a
- double underscore for backward compatibility with old
- cygwin releases. */
- if (create_compat_implib)
- fprintf (f, "\t%s\t__imp_%s\n", ASM_GLOBAL, exp->name);
- fprintf (f, "\t%s\t_imp__%s\n", ASM_GLOBAL, exp->name);
- if (create_compat_implib)
- fprintf (f, "__imp_%s:\n", exp->name);
- fprintf (f, "_imp__%s:\n", exp->name);
- fprintf (f, "\t%s\t%s\n", ASM_LONG, exp->name);
- }
- }
-
- /* Dump the reloc section if a base file is provided. */
- if (base_file)
- {
- int addr;
- long need[PAGE_SIZE];
- long page_addr;
- int numbytes;
- int num_entries;
- long *copy;
- int j;
- int on_page;
- fprintf (f, "\t.section\t.init\n");
- fprintf (f, "lab:\n");
-
- fseek (base_file, 0, SEEK_END);
- numbytes = ftell (base_file);
- fseek (base_file, 0, SEEK_SET);
- copy = xmalloc (numbytes);
- fread (copy, 1, numbytes, base_file);
- num_entries = numbytes / sizeof (long);
-
-
- fprintf (f, "\t.section\t.reloc\n");
- if (num_entries)
- {
- int src;
- int dst = 0;
- int last = -1;
- qsort (copy, num_entries, sizeof (long), sfunc);
- /* Delete duplicates */
- for (src = 0; src < num_entries; src++)
- {
- if (last != copy[src])
- last = copy[dst++] = copy[src];
- }
- num_entries = dst;
- addr = copy[0];
- page_addr = addr & PAGE_MASK; /* work out the page addr */
- on_page = 0;
- for (j = 0; j < num_entries; j++)
- {
- addr = copy[j];
- if ((addr & PAGE_MASK) != page_addr)
- {
- flush_page (f, need, page_addr, on_page);
- on_page = 0;
- page_addr = addr & PAGE_MASK;
- }
- need[on_page++] = addr;
- }
- flush_page (f, need, page_addr, on_page);
-
-/* fprintf (f, "\t%s\t0,0\t%s End\n", ASM_LONG, ASM_C);*/
- }
- }
-
- generate_idata_ofile (f);
-
- fclose (f);
-
- /* Assemble the file. */
- assemble_file (TMP_ASM, exp_name);
-
- if (dontdeltemps == 0)
- unlink (TMP_ASM);
-
- inform (_("Generated exports file"));
-}
-
-static const char *
-xlate (const char *name)
-{
- int lead_at = (*name == '@');
-
- if (!lead_at && (add_underscore
- || (add_stdcall_underscore
- && strchr (name, '@'))))
- {
- char *copy = xmalloc (strlen (name) + 2);
-
- copy[0] = '_';
- strcpy (copy + 1, name);
- name = copy;
- }
-
- if (killat)
- {
- char *p;
-
- name += lead_at;
- p = strchr (name, '@');
- if (p)
- *p = 0;
- }
- return name;
-}
-
-typedef struct
-{
- int id;
- const char *name;
- int flags;
- int align;
- asection *sec;
- asymbol *sym;
- asymbol **sympp;
- int size;
- unsigned char *data;
-} sinfo;
-
-#ifndef DLLTOOL_PPC
-
-#define TEXT 0
-#define DATA 1
-#define BSS 2
-#define IDATA7 3
-#define IDATA5 4
-#define IDATA4 5
-#define IDATA6 6
-
-#define NSECS 7
-
-#define TEXT_SEC_FLAGS \
- (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_READONLY | SEC_HAS_CONTENTS)
-#define DATA_SEC_FLAGS (SEC_ALLOC | SEC_LOAD | SEC_DATA)
-#define BSS_SEC_FLAGS SEC_ALLOC
-
-#define INIT_SEC_DATA(id, name, flags, align) \
- { id, name, flags, align, NULL, NULL, NULL, 0, NULL }
-static sinfo secdata[NSECS] =
-{
- INIT_SEC_DATA (TEXT, ".text", TEXT_SEC_FLAGS, 2),
- INIT_SEC_DATA (DATA, ".data", DATA_SEC_FLAGS, 2),
- INIT_SEC_DATA (BSS, ".bss", BSS_SEC_FLAGS, 2),
- INIT_SEC_DATA (IDATA7, ".idata$7", SEC_HAS_CONTENTS, 2),
- INIT_SEC_DATA (IDATA5, ".idata$5", SEC_HAS_CONTENTS, 2),
- INIT_SEC_DATA (IDATA4, ".idata$4", SEC_HAS_CONTENTS, 2),
- INIT_SEC_DATA (IDATA6, ".idata$6", SEC_HAS_CONTENTS, 1)
-};
-
-#else
-
-/* Sections numbered to make the order the same as other PowerPC NT
- compilers. This also keeps funny alignment thingies from happening. */
-#define TEXT 0
-#define PDATA 1
-#define RDATA 2
-#define IDATA5 3
-#define IDATA4 4
-#define IDATA6 5
-#define IDATA7 6
-#define DATA 7
-#define BSS 8
-
-#define NSECS 9
-
-static sinfo secdata[NSECS] =
-{
- { TEXT, ".text", SEC_CODE | SEC_HAS_CONTENTS, 3},
- { PDATA, ".pdata", SEC_HAS_CONTENTS, 2},
- { RDATA, ".reldata", SEC_HAS_CONTENTS, 2},
- { IDATA5, ".idata$5", SEC_HAS_CONTENTS, 2},
- { IDATA4, ".idata$4", SEC_HAS_CONTENTS, 2},
- { IDATA6, ".idata$6", SEC_HAS_CONTENTS, 1},
- { IDATA7, ".idata$7", SEC_HAS_CONTENTS, 2},
- { DATA, ".data", SEC_DATA, 2},
- { BSS, ".bss", 0, 2}
-};
-
-#endif
-
-/* This is what we're trying to make. We generate the imp symbols with
- both single and double underscores, for compatibility.
-
- .text
- .global _GetFileVersionInfoSizeW@8
- .global __imp_GetFileVersionInfoSizeW@8
-_GetFileVersionInfoSizeW@8:
- jmp * __imp_GetFileVersionInfoSizeW@8
- .section .idata$7 # To force loading of head
- .long __version_a_head
-# Import Address Table
- .section .idata$5
-__imp_GetFileVersionInfoSizeW@8:
- .rva ID2
-
-# Import Lookup Table
- .section .idata$4
- .rva ID2
-# Hint/Name table
- .section .idata$6
-ID2: .short 2
- .asciz "GetFileVersionInfoSizeW"
-
-
- For the PowerPC, here's the variation on the above scheme:
-
-# Rather than a simple "jmp *", the code to get to the dll function
-# looks like:
- .text
- lwz r11,[tocv]__imp_function_name(r2)
-# RELOC: 00000000 TOCREL16,TOCDEFN __imp_function_name
- lwz r12,0(r11)
- stw r2,4(r1)
- mtctr r12
- lwz r2,4(r11)
- bctr */
-
-static char *
-make_label (const char *prefix, const char *name)
-{
- int len = strlen (ASM_PREFIX (name)) + strlen (prefix) + strlen (name);
- char *copy = xmalloc (len + 1);
-
- strcpy (copy, ASM_PREFIX (name));
- strcat (copy, prefix);
- strcat (copy, name);
- return copy;
-}
-
-static char *
-make_imp_label (const char *prefix, const char *name)
-{
- int len;
- char *copy;
-
- if (name[0] == '@')
- {
- len = strlen (prefix) + strlen (name);
- copy = xmalloc (len + 1);
- strcpy (copy, prefix);
- strcat (copy, name);
- }
- else
- {
- len = strlen (ASM_PREFIX (name)) + strlen (prefix) + strlen (name);
- copy = xmalloc (len + 1);
- strcpy (copy, prefix);
- strcat (copy, ASM_PREFIX (name));
- strcat (copy, name);
- }
- return copy;
-}
-
-static bfd *
-make_one_lib_file (export_type *exp, int i)
-{
- bfd * abfd;
- asymbol * exp_label;
- asymbol * iname = 0;
- asymbol * iname2;
- asymbol * iname_lab;
- asymbol ** iname_lab_pp;
- asymbol ** iname_pp;
-#ifdef DLLTOOL_PPC
- asymbol ** fn_pp;
- asymbol ** toc_pp;
-#define EXTRA 2
-#endif
-#ifndef EXTRA
-#define EXTRA 0
-#endif
- asymbol * ptrs[NSECS + 4 + EXTRA + 1];
- flagword applicable;
- char * outname = xmalloc (strlen (TMP_STUB) + 10);
- int oidx = 0;
-
-
- sprintf (outname, "%s%05d.o", TMP_STUB, i);
-
- abfd = bfd_openw (outname, HOW_BFD_WRITE_TARGET);
-
- if (!abfd)
- /* xgettext:c-format */
- fatal (_("bfd_open failed open stub file: %s"), outname);
-
- /* xgettext:c-format */
- inform (_("Creating stub file: %s"), outname);
-
- bfd_set_format (abfd, bfd_object);
- bfd_set_arch_mach (abfd, HOW_BFD_ARCH, 0);
-
-#ifdef DLLTOOL_ARM
- if (machine == MARM_INTERWORK || machine == MTHUMB)
- bfd_set_private_flags (abfd, F_INTERWORK);
-#endif
-
- applicable = bfd_applicable_section_flags (abfd);
-
- /* First make symbols for the sections. */
- for (i = 0; i < NSECS; i++)
- {
- sinfo *si = secdata + i;
-
- if (si->id != i)
- abort();
- si->sec = bfd_make_section_old_way (abfd, si->name);
- bfd_set_section_flags (abfd,
- si->sec,
- si->flags & applicable);
-
- bfd_set_section_alignment(abfd, si->sec, si->align);
- si->sec->output_section = si->sec;
- si->sym = bfd_make_empty_symbol(abfd);
- si->sym->name = si->sec->name;
- si->sym->section = si->sec;
- si->sym->flags = BSF_LOCAL;
- si->sym->value = 0;
- ptrs[oidx] = si->sym;
- si->sympp = ptrs + oidx;
- si->size = 0;
- si->data = NULL;
-
- oidx++;
- }
-
- if (! exp->data)
- {
- exp_label = bfd_make_empty_symbol (abfd);
- exp_label->name = make_imp_label ("", exp->name);
-
- /* On PowerPC, the function name points to a descriptor in
- the rdata section, the first element of which is a
- pointer to the code (..function_name), and the second
- points to the .toc. */
-#ifdef DLLTOOL_PPC
- if (machine == MPPC)
- exp_label->section = secdata[RDATA].sec;
- else
-#endif
- exp_label->section = secdata[TEXT].sec;
-
- exp_label->flags = BSF_GLOBAL;
- exp_label->value = 0;
-
-#ifdef DLLTOOL_ARM
- if (machine == MTHUMB)
- bfd_coff_set_symbol_class (abfd, exp_label, C_THUMBEXTFUNC);
-#endif
- ptrs[oidx++] = exp_label;
- }
-
- /* Generate imp symbols with one underscore for Microsoft
- compatibility, and with two underscores for backward
- compatibility with old versions of cygwin. */
- if (create_compat_implib)
- {
- iname = bfd_make_empty_symbol (abfd);
- iname->name = make_imp_label ("___imp", exp->name);
- iname->section = secdata[IDATA5].sec;
- iname->flags = BSF_GLOBAL;
- iname->value = 0;
- }
-
- iname2 = bfd_make_empty_symbol (abfd);
- iname2->name = make_imp_label ("__imp_", exp->name);
- iname2->section = secdata[IDATA5].sec;
- iname2->flags = BSF_GLOBAL;
- iname2->value = 0;
-
- iname_lab = bfd_make_empty_symbol (abfd);
-
- iname_lab->name = head_label;
- iname_lab->section = (asection *) &bfd_und_section;
- iname_lab->flags = 0;
- iname_lab->value = 0;
-
- iname_pp = ptrs + oidx;
- if (create_compat_implib)
- ptrs[oidx++] = iname;
- ptrs[oidx++] = iname2;
-
- iname_lab_pp = ptrs + oidx;
- ptrs[oidx++] = iname_lab;
-
-#ifdef DLLTOOL_PPC
- /* The symbol referring to the code (.text). */
- {
- asymbol *function_name;
-
- function_name = bfd_make_empty_symbol(abfd);
- function_name->name = make_label ("..", exp->name);
- function_name->section = secdata[TEXT].sec;
- function_name->flags = BSF_GLOBAL;
- function_name->value = 0;
-
- fn_pp = ptrs + oidx;
- ptrs[oidx++] = function_name;
- }
-
- /* The .toc symbol. */
- {
- asymbol *toc_symbol;
-
- toc_symbol = bfd_make_empty_symbol (abfd);
- toc_symbol->name = make_label (".", "toc");
- toc_symbol->section = (asection *)&bfd_und_section;
- toc_symbol->flags = BSF_GLOBAL;
- toc_symbol->value = 0;
-
- toc_pp = ptrs + oidx;
- ptrs[oidx++] = toc_symbol;
- }
-#endif
-
- ptrs[oidx] = 0;
-
- for (i = 0; i < NSECS; i++)
- {
- sinfo *si = secdata + i;
- asection *sec = si->sec;
- arelent *rel;
- arelent **rpp;
-
- switch (i)
- {
- case TEXT:
- if (! exp->data)
- {
- si->size = HOW_JTAB_SIZE;
- si->data = xmalloc (HOW_JTAB_SIZE);
- memcpy (si->data, HOW_JTAB, HOW_JTAB_SIZE);
-
- /* Add the reloc into idata$5. */
- rel = xmalloc (sizeof (arelent));
-
- rpp = xmalloc (sizeof (arelent *) * 2);
- rpp[0] = rel;
- rpp[1] = 0;
-
- rel->address = HOW_JTAB_ROFF;
- rel->addend = 0;
-
- if (machine == MPPC)
- {
- rel->howto = bfd_reloc_type_lookup (abfd,
- BFD_RELOC_16_GOTOFF);
- rel->sym_ptr_ptr = iname_pp;
- }
- else if (machine == MX86)
- {
- rel->howto = bfd_reloc_type_lookup (abfd,
- BFD_RELOC_32_PCREL);
- rel->sym_ptr_ptr = iname_pp;
- }
- else
- {
- rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32);
- rel->sym_ptr_ptr = secdata[IDATA5].sympp;
- }
- sec->orelocation = rpp;
- sec->reloc_count = 1;
- }
- break;
- case IDATA4:
- case IDATA5:
- /* An idata$4 or idata$5 is one word long, and has an
- rva to idata$6. */
-
-#ifdef DLLTOOL_MX86_64
- si->data = xmalloc (8);
- si->size = 8;
-
- if (exp->noname)
- {
- si->data[0] = exp->ordinal ;
- si->data[1] = exp->ordinal >> 8;
- si->data[2] = exp->ordinal >> 16;
- si->data[3] = exp->ordinal >> 24;
- si->data[4] = 0;
- si->data[5] = 0;
- si->data[6] = 0;
- si->data[7] = 0x80;
- }
- else
- {
- sec->reloc_count = 1;
- memset (si->data, 0, si->size);
- rel = xmalloc (sizeof (arelent));
- rpp = xmalloc (sizeof (arelent *) * 2);
- rpp[0] = rel;
- rpp[1] = 0;
- rel->address = 0;
- rel->addend = 0;
- rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_RVA);
- rel->sym_ptr_ptr = secdata[IDATA6].sympp;
- sec->orelocation = rpp;
- }
-#else
- si->data = xmalloc (4);
- si->size = 4;
-
- if (exp->noname)
- {
- si->data[0] = exp->ordinal ;
- si->data[1] = exp->ordinal >> 8;
- si->data[2] = exp->ordinal >> 16;
- si->data[3] = 0x80;
- }
- else
- {
- sec->reloc_count = 1;
- memset (si->data, 0, si->size);
- rel = xmalloc (sizeof (arelent));
- rpp = xmalloc (sizeof (arelent *) * 2);
- rpp[0] = rel;
- rpp[1] = 0;
- rel->address = 0;
- rel->addend = 0;
- rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_RVA);
- rel->sym_ptr_ptr = secdata[IDATA6].sympp;
- sec->orelocation = rpp;
- }
-#endif
- break;
-
- case IDATA6:
- if (!exp->noname)
- {
- /* This used to add 1 to exp->hint. I don't know
- why it did that, and it does not match what I see
- in programs compiled with the MS tools. */
- int idx = exp->hint;
- si->size = strlen (xlate (exp->import_name)) + 3;
- si->data = xmalloc (si->size);
- si->data[0] = idx & 0xff;
- si->data[1] = idx >> 8;
- strcpy ((char *) si->data + 2, xlate (exp->import_name));
- }
- break;
- case IDATA7:
- si->size = 4;
- si->data = xmalloc (4);
- memset (si->data, 0, si->size);
- rel = xmalloc (sizeof (arelent));
- rpp = xmalloc (sizeof (arelent *) * 2);
- rpp[0] = rel;
- rel->address = 0;
- rel->addend = 0;
- rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_RVA);
- rel->sym_ptr_ptr = iname_lab_pp;
- sec->orelocation = rpp;
- sec->reloc_count = 1;
- break;
-
-#ifdef DLLTOOL_PPC
- case PDATA:
- {
- /* The .pdata section is 5 words long.
- Think of it as:
- struct
- {
- bfd_vma BeginAddress, [0x00]
- EndAddress, [0x04]
- ExceptionHandler, [0x08]
- HandlerData, [0x0c]
- PrologEndAddress; [0x10]
- }; */
-
- /* So this pdata section setups up this as a glue linkage to
- a dll routine. There are a number of house keeping things
- we need to do:
-
- 1. In the name of glue trickery, the ADDR32 relocs for 0,
- 4, and 0x10 are set to point to the same place:
- "..function_name".
- 2. There is one more reloc needed in the pdata section.
- The actual glue instruction to restore the toc on
- return is saved as the offset in an IMGLUE reloc.
- So we need a total of four relocs for this section.
-
- 3. Lastly, the HandlerData field is set to 0x03, to indicate
- that this is a glue routine. */
- arelent *imglue, *ba_rel, *ea_rel, *pea_rel;
-
- /* Alignment must be set to 2**2 or you get extra stuff. */
- bfd_set_section_alignment(abfd, sec, 2);
-
- si->size = 4 * 5;
- si->data = xmalloc (si->size);
- memset (si->data, 0, si->size);
- rpp = xmalloc (sizeof (arelent *) * 5);
- rpp[0] = imglue = xmalloc (sizeof (arelent));
- rpp[1] = ba_rel = xmalloc (sizeof (arelent));
- rpp[2] = ea_rel = xmalloc (sizeof (arelent));
- rpp[3] = pea_rel = xmalloc (sizeof (arelent));
- rpp[4] = 0;
-
- /* Stick the toc reload instruction in the glue reloc. */
- bfd_put_32(abfd, ppc_glue_insn, (char *) &imglue->address);
-
- imglue->addend = 0;
- imglue->howto = bfd_reloc_type_lookup (abfd,
- BFD_RELOC_32_GOTOFF);
- imglue->sym_ptr_ptr = fn_pp;
-
- ba_rel->address = 0;
- ba_rel->addend = 0;
- ba_rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32);
- ba_rel->sym_ptr_ptr = fn_pp;
-
- bfd_put_32 (abfd, 0x18, si->data + 0x04);
- ea_rel->address = 4;
- ea_rel->addend = 0;
- ea_rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32);
- ea_rel->sym_ptr_ptr = fn_pp;
-
- /* Mark it as glue. */
- bfd_put_32 (abfd, 0x03, si->data + 0x0c);
-
- /* Mark the prolog end address. */
- bfd_put_32 (abfd, 0x0D, si->data + 0x10);
- pea_rel->address = 0x10;
- pea_rel->addend = 0;
- pea_rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32);
- pea_rel->sym_ptr_ptr = fn_pp;
-
- sec->orelocation = rpp;
- sec->reloc_count = 4;
- break;
- }
- case RDATA:
- /* Each external function in a PowerPC PE file has a two word
- descriptor consisting of:
- 1. The address of the code.
- 2. The address of the appropriate .toc
- We use relocs to build this. */
- si->size = 8;
- si->data = xmalloc (8);
- memset (si->data, 0, si->size);
-
- rpp = xmalloc (sizeof (arelent *) * 3);
- rpp[0] = rel = xmalloc (sizeof (arelent));
- rpp[1] = xmalloc (sizeof (arelent));
- rpp[2] = 0;
-
- rel->address = 0;
- rel->addend = 0;
- rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32);
- rel->sym_ptr_ptr = fn_pp;
-
- rel = rpp[1];
-
- rel->address = 4;
- rel->addend = 0;
- rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32);
- rel->sym_ptr_ptr = toc_pp;
-
- sec->orelocation = rpp;
- sec->reloc_count = 2;
- break;
-#endif /* DLLTOOL_PPC */
- }
- }
-
- {
- bfd_vma vma = 0;
- /* Size up all the sections. */
- for (i = 0; i < NSECS; i++)
- {
- sinfo *si = secdata + i;
-
- bfd_set_section_size (abfd, si->sec, si->size);
- bfd_set_section_vma (abfd, si->sec, vma);
- }
- }
- /* Write them out. */
- for (i = 0; i < NSECS; i++)
- {
- sinfo *si = secdata + i;
-
- if (i == IDATA5 && no_idata5)
- continue;
-
- if (i == IDATA4 && no_idata4)
- continue;
-
- bfd_set_section_contents (abfd, si->sec,
- si->data, 0,
- si->size);
- }
-
- bfd_set_symtab (abfd, ptrs, oidx);
- bfd_close (abfd);
- abfd = bfd_openr (outname, HOW_BFD_READ_TARGET);
- return abfd;
-}
-
-static bfd *
-make_head (void)
-{
- FILE *f = fopen (TMP_HEAD_S, FOPEN_WT);
-
- if (f == NULL)
- {
- fatal (_("failed to open temporary head file: %s"), TMP_HEAD_S);
- return NULL;
- }
-
- fprintf (f, "%s IMAGE_IMPORT_DESCRIPTOR\n", ASM_C);
- fprintf (f, "\t.section .idata$2\n");
-
- fprintf(f,"\t%s\t%s\n", ASM_GLOBAL,head_label);
-
- fprintf (f, "%s:\n", head_label);
-
- fprintf (f, "\t%shname%s\t%sPtr to image import by name list\n",
- ASM_RVA_BEFORE, ASM_RVA_AFTER, ASM_C);
-
- fprintf (f, "\t%sthis should be the timestamp, but NT sometimes\n", ASM_C);
- fprintf (f, "\t%sdoesn't load DLLs when this is set.\n", ASM_C);
- fprintf (f, "\t%s\t0\t%s loaded time\n", ASM_LONG, ASM_C);
- fprintf (f, "\t%s\t0\t%s Forwarder chain\n", ASM_LONG, ASM_C);
- fprintf (f, "\t%s__%s_iname%s\t%s imported dll's name\n",
- ASM_RVA_BEFORE,
- imp_name_lab,
- ASM_RVA_AFTER,
- ASM_C);
- fprintf (f, "\t%sfthunk%s\t%s pointer to firstthunk\n",
- ASM_RVA_BEFORE,
- ASM_RVA_AFTER, ASM_C);
-
- fprintf (f, "%sStuff for compatibility\n", ASM_C);
-
- if (!no_idata5)
- {
- fprintf (f, "\t.section\t.idata$5\n");
-#ifdef DLLTOOL_MX86_64
- fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */
-#else
- fprintf (f,"\t%s\t0\n", ASM_LONG); /* NULL terminating list. */
-#endif
- fprintf (f, "fthunk:\n");
- }
-
- if (!no_idata4)
- {
- fprintf (f, "\t.section\t.idata$4\n");
- fprintf (f, "\t%s\t0\n", ASM_LONG);
- fprintf (f, "\t.section .idata$4\n");
- fprintf (f, "hname:\n");
- }
-
- fclose (f);
-
- assemble_file (TMP_HEAD_S, TMP_HEAD_O);
-
- return bfd_openr (TMP_HEAD_O, HOW_BFD_READ_TARGET);
-}
-
-static bfd *
-make_tail (void)
-{
- FILE *f = fopen (TMP_TAIL_S, FOPEN_WT);
-
- if (f == NULL)
- {
- fatal (_("failed to open temporary tail file: %s"), TMP_TAIL_S);
- return NULL;
- }
-
- if (!no_idata4)
- {
- fprintf (f, "\t.section .idata$4\n");
-#ifdef DLLTOOL_MX86_64
- fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */
-#else
- fprintf (f,"\t%s\t0\n", ASM_LONG); /* NULL terminating list. */
-#endif
- }
-
- if (!no_idata5)
- {
- fprintf (f, "\t.section .idata$5\n");
-#ifdef DLLTOOL_MX86_64
- fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); /* NULL terminating list. */
-#else
- fprintf (f,"\t%s\t0\n", ASM_LONG); /* NULL terminating list. */
-#endif
- }
-
-#ifdef DLLTOOL_PPC
- /* Normally, we need to see a null descriptor built in idata$3 to
- act as the terminator for the list. The ideal way, I suppose,
- would be to mark this section as a comdat type 2 section, so
- only one would appear in the final .exe (if our linker supported
- comdat, that is) or cause it to be inserted by something else (say
- crt0). */
-
- fprintf (f, "\t.section .idata$3\n");
- fprintf (f, "\t%s\t0\n", ASM_LONG);
- fprintf (f, "\t%s\t0\n", ASM_LONG);
- fprintf (f, "\t%s\t0\n", ASM_LONG);
- fprintf (f, "\t%s\t0\n", ASM_LONG);
- fprintf (f, "\t%s\t0\n", ASM_LONG);
-#endif
-
-#ifdef DLLTOOL_PPC
- /* Other PowerPC NT compilers use idata$6 for the dllname, so I
- do too. Original, huh? */
- fprintf (f, "\t.section .idata$6\n");
-#else
- fprintf (f, "\t.section .idata$7\n");
-#endif
-
- fprintf (f, "\t%s\t__%s_iname\n", ASM_GLOBAL, imp_name_lab);
- fprintf (f, "__%s_iname:\t%s\t\"%s\"\n",
- imp_name_lab, ASM_TEXT, dll_name);
-
- fclose (f);
-
- assemble_file (TMP_TAIL_S, TMP_TAIL_O);
-
- return bfd_openr (TMP_TAIL_O, HOW_BFD_READ_TARGET);
-}
-
-static void
-gen_lib_file (void)
-{
- int i;
- export_type *exp;
- bfd *ar_head;
- bfd *ar_tail;
- bfd *outarch;
- bfd * head = 0;
-
- unlink (imp_name);
-
- outarch = bfd_openw (imp_name, HOW_BFD_WRITE_TARGET);
-
- if (!outarch)
- /* xgettext:c-format */
- fatal (_("Can't open .lib file: %s"), imp_name);
-
- /* xgettext:c-format */
- inform (_("Creating library file: %s"), imp_name);
-
- bfd_set_format (outarch, bfd_archive);
- outarch->has_armap = 1;
- outarch->is_thin_archive = 0;
-
- /* Work out a reasonable size of things to put onto one line. */
- ar_head = make_head ();
- ar_tail = make_tail();
-
- if (ar_head == NULL || ar_tail == NULL)
- return;
-
- for (i = 0; (exp = d_exports_lexically[i]); i++)
- {
- bfd *n;
- /* Don't add PRIVATE entries to import lib. */
- if (exp->private)
- continue;
- n = make_one_lib_file (exp, i);
- n->archive_next = head;
- head = n;
- if (ext_prefix_alias)
- {
- export_type alias_exp;
-
- assert (i < PREFIX_ALIAS_BASE);
- alias_exp.name = make_imp_label (ext_prefix_alias, exp->name);
- alias_exp.internal_name = exp->internal_name;
- alias_exp.import_name = exp->name;
- alias_exp.ordinal = exp->ordinal;
- alias_exp.constant = exp->constant;
- alias_exp.noname = exp->noname;
- alias_exp.private = exp->private;
- alias_exp.data = exp->data;
- alias_exp.hint = exp->hint;
- alias_exp.forward = exp->forward;
- alias_exp.next = exp->next;
- n = make_one_lib_file (&alias_exp, i + PREFIX_ALIAS_BASE);
- n->archive_next = head;
- head = n;
- }
- }
-
- /* Now stick them all into the archive. */
- ar_head->archive_next = head;
- ar_tail->archive_next = ar_head;
- head = ar_tail;
-
- if (! bfd_set_archive_head (outarch, head))
- bfd_fatal ("bfd_set_archive_head");
-
- if (! bfd_close (outarch))
- bfd_fatal (imp_name);
-
- while (head != NULL)
- {
- bfd *n = head->archive_next;
- bfd_close (head);
- head = n;
- }
-
- /* Delete all the temp files. */
- if (dontdeltemps == 0)
- {
- unlink (TMP_HEAD_O);
- unlink (TMP_HEAD_S);
- unlink (TMP_TAIL_O);
- unlink (TMP_TAIL_S);
- }
-
- if (dontdeltemps < 2)
- {
- char *name;
-
- name = (char *) alloca (strlen (TMP_STUB) + 10);
- for (i = 0; (exp = d_exports_lexically[i]); i++)
- {
- /* Don't delete non-existent stubs for PRIVATE entries. */
- if (exp->private)
- continue;
- sprintf (name, "%s%05d.o", TMP_STUB, i);
- if (unlink (name) < 0)
- /* xgettext:c-format */
- non_fatal (_("cannot delete %s: %s"), name, strerror (errno));
- if (ext_prefix_alias)
- {
- sprintf (name, "%s%05d.o", TMP_STUB, i + PREFIX_ALIAS_BASE);
- if (unlink (name) < 0)
- /* xgettext:c-format */
- non_fatal (_("cannot delete %s: %s"), name, strerror (errno));
- }
- }
- }
-
- inform (_("Created lib file"));
-}
-
-/* Run through the information gathered from the .o files and the
- .def file and work out the best stuff. */
-
-static int
-pfunc (const void *a, const void *b)
-{
- export_type *ap = *(export_type **) a;
- export_type *bp = *(export_type **) b;
- if (ap->ordinal == bp->ordinal)
- return 0;
-
- /* Unset ordinals go to the bottom. */
- if (ap->ordinal == -1)
- return 1;
- if (bp->ordinal == -1)
- return -1;
- return (ap->ordinal - bp->ordinal);
-}
-
-static int
-nfunc (const void *a, const void *b)
-{
- export_type *ap = *(export_type **) a;
- export_type *bp = *(export_type **) b;
- const char *an = ap->name;
- const char *bn = bp->name;
-
- if (killat)
- {
- an = (an[0] == '@') ? an + 1 : an;
- bn = (bn[0] == '@') ? bn + 1 : bn;
- }
-
- return (strcmp (an, bn));
-}
-
-static void
-remove_null_names (export_type **ptr)
-{
- int src;
- int dst;
-
- for (dst = src = 0; src < d_nfuncs; src++)
- {
- if (ptr[src])
- {
- ptr[dst] = ptr[src];
- dst++;
- }
- }
- d_nfuncs = dst;
-}
-
-static void
-process_duplicates (export_type **d_export_vec)
-{
- int more = 1;
- int i;
-
- while (more)
- {
- more = 0;
- /* Remove duplicates. */
- qsort (d_export_vec, d_nfuncs, sizeof (export_type *), nfunc);
-
- for (i = 0; i < d_nfuncs - 1; i++)
- {
- if (strcmp (d_export_vec[i]->name,
- d_export_vec[i + 1]->name) == 0)
- {
- export_type *a = d_export_vec[i];
- export_type *b = d_export_vec[i + 1];
-
- more = 1;
-
- /* xgettext:c-format */
- inform (_("Warning, ignoring duplicate EXPORT %s %d,%d"),
- a->name, a->ordinal, b->ordinal);
-
- if (a->ordinal != -1
- && b->ordinal != -1)
- /* xgettext:c-format */
- fatal (_("Error, duplicate EXPORT with ordinals: %s"),
- a->name);
-
- /* Merge attributes. */
- b->ordinal = a->ordinal > 0 ? a->ordinal : b->ordinal;
- b->constant |= a->constant;
- b->noname |= a->noname;
- b->data |= a->data;
- d_export_vec[i] = 0;
- }
-
- remove_null_names (d_export_vec);
- }
- }
-
- /* Count the names. */
- for (i = 0; i < d_nfuncs; i++)
- if (!d_export_vec[i]->noname)
- d_named_nfuncs++;
-}
-
-static void
-fill_ordinals (export_type **d_export_vec)
-{
- int lowest = -1;
- int i;
- char *ptr;
- int size = 65536;
-
- qsort (d_export_vec, d_nfuncs, sizeof (export_type *), pfunc);
-
- /* Fill in the unset ordinals with ones from our range. */
- ptr = (char *) xmalloc (size);
-
- memset (ptr, 0, size);
-
- /* Mark in our large vector all the numbers that are taken. */
- for (i = 0; i < d_nfuncs; i++)
- {
- if (d_export_vec[i]->ordinal != -1)
- {
- ptr[d_export_vec[i]->ordinal] = 1;
-
- if (lowest == -1 || d_export_vec[i]->ordinal < lowest)
- lowest = d_export_vec[i]->ordinal;
- }
- }
-
- /* Start at 1 for compatibility with MS toolchain. */
- if (lowest == -1)
- lowest = 1;
-
- /* Now fill in ordinals where the user wants us to choose. */
- for (i = 0; i < d_nfuncs; i++)
- {
- if (d_export_vec[i]->ordinal == -1)
- {
- int j;
-
- /* First try within or after any user supplied range. */
- for (j = lowest; j < size; j++)
- if (ptr[j] == 0)
- {
- ptr[j] = 1;
- d_export_vec[i]->ordinal = j;
- goto done;
- }
-
- /* Then try before the range. */
- for (j = lowest; j >0; j--)
- if (ptr[j] == 0)
- {
- ptr[j] = 1;
- d_export_vec[i]->ordinal = j;
- goto done;
- }
- done:;
- }
- }
-
- free (ptr);
-
- /* And resort. */
- qsort (d_export_vec, d_nfuncs, sizeof (export_type *), pfunc);
-
- /* Work out the lowest and highest ordinal numbers. */
- if (d_nfuncs)
- {
- if (d_export_vec[0])
- d_low_ord = d_export_vec[0]->ordinal;
- if (d_export_vec[d_nfuncs-1])
- d_high_ord = d_export_vec[d_nfuncs-1]->ordinal;
- }
-}
-
-static void
-mangle_defs (void)
-{
- /* First work out the minimum ordinal chosen. */
- export_type *exp;
-
- int i;
- int hint = 0;
- export_type **d_export_vec = xmalloc (sizeof (export_type *) * d_nfuncs);
-
- inform (_("Processing definitions"));
-
- for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
- d_export_vec[i] = exp;
-
- process_duplicates (d_export_vec);
- fill_ordinals (d_export_vec);
-
- /* Put back the list in the new order. */
- d_exports = 0;
- for (i = d_nfuncs - 1; i >= 0; i--)
- {
- d_export_vec[i]->next = d_exports;
- d_exports = d_export_vec[i];
- }
-
- /* Build list in alpha order. */
- d_exports_lexically = (export_type **)
- xmalloc (sizeof (export_type *) * (d_nfuncs + 1));
-
- for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
- d_exports_lexically[i] = exp;
-
- d_exports_lexically[i] = 0;
-
- qsort (d_exports_lexically, i, sizeof (export_type *), nfunc);
-
- /* Fill exp entries with their hint values. */
- for (i = 0; i < d_nfuncs; i++)
- if (!d_exports_lexically[i]->noname || show_allnames)
- d_exports_lexically[i]->hint = hint++;
-
- inform (_("Processed definitions"));
-}
-
-static void
-usage (FILE *file, int status)
-{
- /* xgetext:c-format */
- fprintf (file, _("Usage %s <option(s)> <object-file(s)>\n"), program_name);
- /* xgetext:c-format */
- fprintf (file, _(" -m --machine <machine> Create as DLL for <machine>. [default: %s]\n"), mname);
- fprintf (file, _(" possible <machine>: arm[_interwork], i386, mcore[-elf]{-le|-be}, ppc, thumb\n"));
- fprintf (file, _(" -e --output-exp <outname> Generate an export file.\n"));
- fprintf (file, _(" -l --output-lib <outname> Generate an interface library.\n"));
- fprintf (file, _(" -a --add-indirect Add dll indirects to export file.\n"));
- fprintf (file, _(" -D --dllname <name> Name of input dll to put into interface lib.\n"));
- fprintf (file, _(" -d --input-def <deffile> Name of .def file to be read in.\n"));
- fprintf (file, _(" -z --output-def <deffile> Name of .def file to be created.\n"));
- fprintf (file, _(" --export-all-symbols Export all symbols to .def\n"));
- fprintf (file, _(" --no-export-all-symbols Only export listed symbols\n"));
- fprintf (file, _(" --exclude-symbols <list> Don't export <list>\n"));
- fprintf (file, _(" --no-default-excludes Clear default exclude symbols\n"));
- fprintf (file, _(" -b --base-file <basefile> Read linker generated base file.\n"));
- fprintf (file, _(" -x --no-idata4 Don't generate idata$4 section.\n"));
- fprintf (file, _(" -c --no-idata5 Don't generate idata$5 section.\n"));
- fprintf (file, _(" -U --add-underscore Add underscores to all symbols in interface library.\n"));
- fprintf (file, _(" --add-stdcall-underscore Add underscores to stdcall symbols in interface library.\n"));
- fprintf (file, _(" -k --kill-at Kill @<n> from exported names.\n"));
- fprintf (file, _(" -A --add-stdcall-alias Add aliases without @<n>.\n"));
- fprintf (file, _(" -p --ext-prefix-alias <prefix> Add aliases with <prefix>.\n"));
- fprintf (file, _(" -S --as <name> Use <name> for assembler.\n"));
- fprintf (file, _(" -f --as-flags <flags> Pass <flags> to the assembler.\n"));
- fprintf (file, _(" -C --compat-implib Create backward compatible import library.\n"));
- fprintf (file, _(" -n --no-delete Keep temp files (repeat for extra preservation).\n"));
- fprintf (file, _(" -t --temp-prefix <prefix> Use <prefix> to construct temp file names.\n"));
- fprintf (file, _(" -v --verbose Be verbose.\n"));
- fprintf (file, _(" -V --version Display the program version.\n"));
- fprintf (file, _(" -h --help Display this information.\n"));
- fprintf (file, _(" @<file> Read options from <file>.\n"));
-#ifdef DLLTOOL_MCORE_ELF
- fprintf (file, _(" -M --mcore-elf <outname> Process mcore-elf object files into <outname>.\n"));
- fprintf (file, _(" -L --linker <name> Use <name> as the linker.\n"));
- fprintf (file, _(" -F --linker-flags <flags> Pass <flags> to the linker.\n"));
-#endif
- if (REPORT_BUGS_TO[0] && status == 0)
- fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO);
- exit (status);
-}
-
-#define OPTION_EXPORT_ALL_SYMS 150
-#define OPTION_NO_EXPORT_ALL_SYMS (OPTION_EXPORT_ALL_SYMS + 1)
-#define OPTION_EXCLUDE_SYMS (OPTION_NO_EXPORT_ALL_SYMS + 1)
-#define OPTION_NO_DEFAULT_EXCLUDES (OPTION_EXCLUDE_SYMS + 1)
-#define OPTION_ADD_STDCALL_UNDERSCORE (OPTION_NO_DEFAULT_EXCLUDES + 1)
-
-static const struct option long_options[] =
-{
- {"no-delete", no_argument, NULL, 'n'},
- {"dllname", required_argument, NULL, 'D'},
- {"no-idata4", no_argument, NULL, 'x'},
- {"no-idata5", no_argument, NULL, 'c'},
- {"output-exp", required_argument, NULL, 'e'},
- {"output-def", required_argument, NULL, 'z'},
- {"export-all-symbols", no_argument, NULL, OPTION_EXPORT_ALL_SYMS},
- {"no-export-all-symbols", no_argument, NULL, OPTION_NO_EXPORT_ALL_SYMS},
- {"exclude-symbols", required_argument, NULL, OPTION_EXCLUDE_SYMS},
- {"no-default-excludes", no_argument, NULL, OPTION_NO_DEFAULT_EXCLUDES},
- {"output-lib", required_argument, NULL, 'l'},
- {"def", required_argument, NULL, 'd'}, /* for compatibility with older versions */
- {"input-def", required_argument, NULL, 'd'},
- {"add-underscore", no_argument, NULL, 'U'},
- {"add-stdcall-underscore", no_argument, NULL, OPTION_ADD_STDCALL_UNDERSCORE},
- {"kill-at", no_argument, NULL, 'k'},
- {"add-stdcall-alias", no_argument, NULL, 'A'},
- {"ext-prefix-alias", required_argument, NULL, 'p'},
- {"verbose", no_argument, NULL, 'v'},
- {"version", no_argument, NULL, 'V'},
- {"help", no_argument, NULL, 'h'},
- {"machine", required_argument, NULL, 'm'},
- {"add-indirect", no_argument, NULL, 'a'},
- {"base-file", required_argument, NULL, 'b'},
- {"as", required_argument, NULL, 'S'},
- {"as-flags", required_argument, NULL, 'f'},
- {"mcore-elf", required_argument, NULL, 'M'},
- {"compat-implib", no_argument, NULL, 'C'},
- {"temp-prefix", required_argument, NULL, 't'},
- {NULL,0,NULL,0}
-};
-
-int main (int, char **);
-
-int
-main (int ac, char **av)
-{
- int c;
- int i;
- char *firstarg = 0;
- program_name = av[0];
- oav = av;
-
-#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
- setlocale (LC_MESSAGES, "");
-#endif
-#if defined (HAVE_SETLOCALE)
- setlocale (LC_CTYPE, "");
-#endif
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
-
- expandargv (&ac, &av);
-
- while ((c = getopt_long (ac, av,
-#ifdef DLLTOOL_MCORE_ELF
- "m:e:l:aD:d:z:b:xp:cCuUkAS:f:nvVHhM:L:F:",
-#else
- "m:e:l:aD:d:z:b:xp:cCuUkAS:f:nvVHh",
-#endif
- long_options, 0))
- != EOF)
- {
- switch (c)
- {
- case OPTION_EXPORT_ALL_SYMS:
- export_all_symbols = TRUE;
- break;
- case OPTION_NO_EXPORT_ALL_SYMS:
- export_all_symbols = FALSE;
- break;
- case OPTION_EXCLUDE_SYMS:
- add_excludes (optarg);
- break;
- case OPTION_NO_DEFAULT_EXCLUDES:
- do_default_excludes = FALSE;
- break;
- case OPTION_ADD_STDCALL_UNDERSCORE:
- add_stdcall_underscore = 1;
- break;
- case 'x':
- no_idata4 = 1;
- break;
- case 'c':
- no_idata5 = 1;
- break;
- case 'S':
- as_name = optarg;
- break;
- case 't':
- tmp_prefix = optarg;
- break;
- case 'f':
- as_flags = optarg;
- break;
-
- /* Ignored for compatibility. */
- case 'u':
- break;
- case 'a':
- add_indirect = 1;
- break;
- case 'z':
- output_def = fopen (optarg, FOPEN_WT);
- break;
- case 'D':
- dll_name = (char*) lbasename (optarg);
- if (dll_name != optarg)
- non_fatal (_("Path components stripped from dllname, '%s'."),
- optarg);
- break;
- case 'l':
- imp_name = optarg;
- break;
- case 'e':
- exp_name = optarg;
- break;
- case 'H':
- case 'h':
- usage (stdout, 0);
- break;
- case 'm':
- mname = optarg;
- break;
- case 'v':
- verbose = 1;
- break;
- case 'V':
- print_version (program_name);
- break;
- case 'U':
- add_underscore = 1;
- break;
- case 'k':
- killat = 1;
- break;
- case 'A':
- add_stdcall_alias = 1;
- break;
- case 'p':
- ext_prefix_alias = optarg;
- break;
- case 'd':
- def_file = optarg;
- break;
- case 'n':
- dontdeltemps++;
- break;
- case 'b':
- base_file = fopen (optarg, FOPEN_RB);
-
- if (!base_file)
- /* xgettext:c-format */
- fatal (_("Unable to open base-file: %s"), optarg);
-
- break;
-#ifdef DLLTOOL_MCORE_ELF
- case 'M':
- mcore_elf_out_file = optarg;
- break;
- case 'L':
- mcore_elf_linker = optarg;
- break;
- case 'F':
- mcore_elf_linker_flags = optarg;
- break;
-#endif
- case 'C':
- create_compat_implib = 1;
- break;
- default:
- usage (stderr, 1);
- break;
- }
- }
-
- if (!tmp_prefix)
- tmp_prefix = prefix_encode ("d", getpid ());
-
- for (i = 0; mtable[i].type; i++)
- if (strcmp (mtable[i].type, mname) == 0)
- break;
-
- if (!mtable[i].type)
- /* xgettext:c-format */
- fatal (_("Machine '%s' not supported"), mname);
-
- machine = i;
-
- if (!dll_name && exp_name)
- {
- /* If we are inferring dll_name from exp_name,
- strip off any path components, without emitting
- a warning. */
- const char* exp_basename = lbasename (exp_name);
- const int len = strlen (exp_basename) + 5;
- dll_name = xmalloc (len);
- strcpy (dll_name, exp_basename);
- strcat (dll_name, ".dll");
- }
-
- if (as_name == NULL)
- as_name = deduce_name ("as");
-
- /* Don't use the default exclude list if we're reading only the
- symbols in the .drectve section. The default excludes are meant
- to avoid exporting DLL entry point and Cygwin32 impure_ptr. */
- if (! export_all_symbols)
- do_default_excludes = FALSE;
-
- if (do_default_excludes)
- set_default_excludes ();
-
- if (def_file)
- process_def_file (def_file);
-
- while (optind < ac)
- {
- if (!firstarg)
- firstarg = av[optind];
- scan_obj_file (av[optind]);
- optind++;
- }
-
- mangle_defs ();
-
- if (exp_name)
- gen_exp_file ();
-
- if (imp_name)
- {
- /* Make imp_name safe for use as a label. */
- char *p;
-
- imp_name_lab = xstrdup (imp_name);
- for (p = imp_name_lab; *p; p++)
- {
- if (!ISALNUM (*p))
- *p = '_';
- }
- head_label = make_label("_head_", imp_name_lab);
- gen_lib_file ();
- }
-
- if (output_def)
- gen_def_file ();
-
-#ifdef DLLTOOL_MCORE_ELF
- if (mcore_elf_out_file)
- mcore_elf_gen_out_file ();
-#endif
-
- return 0;
-}
-
-/* Look for the program formed by concatenating PROG_NAME and the
- string running from PREFIX to END_PREFIX. If the concatenated
- string contains a '/', try appending EXECUTABLE_SUFFIX if it is
- appropriate. */
-
-static char *
-look_for_prog (const char *prog_name, const char *prefix, int end_prefix)
-{
- struct stat s;
- char *cmd;
-
- cmd = xmalloc (strlen (prefix)
- + strlen (prog_name)
-#ifdef HAVE_EXECUTABLE_SUFFIX
- + strlen (EXECUTABLE_SUFFIX)
-#endif
- + 10);
- strcpy (cmd, prefix);
-
- sprintf (cmd + end_prefix, "%s", prog_name);
-
- if (strchr (cmd, '/') != NULL)
- {
- int found;
-
- found = (stat (cmd, &s) == 0
-#ifdef HAVE_EXECUTABLE_SUFFIX
- || stat (strcat (cmd, EXECUTABLE_SUFFIX), &s) == 0
-#endif
- );
-
- if (! found)
- {
- /* xgettext:c-format */
- inform (_("Tried file: %s"), cmd);
- free (cmd);
- return NULL;
- }
- }
-
- /* xgettext:c-format */
- inform (_("Using file: %s"), cmd);
-
- return cmd;
-}
-
-/* Deduce the name of the program we are want to invoke.
- PROG_NAME is the basic name of the program we want to run,
- eg "as" or "ld". The catch is that we might want actually
- run "i386-pe-as" or "ppc-pe-ld".
-
- If argv[0] contains the full path, then try to find the program
- in the same place, with and then without a target-like prefix.
-
- Given, argv[0] = /usr/local/bin/i586-cygwin32-dlltool,
- deduce_name("as") uses the following search order:
-
- /usr/local/bin/i586-cygwin32-as
- /usr/local/bin/as
- as
-
- If there's an EXECUTABLE_SUFFIX, it'll use that as well; for each
- name, it'll try without and then with EXECUTABLE_SUFFIX.
-
- Given, argv[0] = i586-cygwin32-dlltool, it will not even try "as"
- as the fallback, but rather return i586-cygwin32-as.
-
- Oh, and given, argv[0] = dlltool, it'll return "as".
-
- Returns a dynamically allocated string. */
-
-static char *
-deduce_name (const char *prog_name)
-{
- char *cmd;
- char *dash, *slash, *cp;
-
- dash = NULL;
- slash = NULL;
- for (cp = program_name; *cp != '\0'; ++cp)
- {
- if (*cp == '-')
- dash = cp;
- if (
-#if defined(__DJGPP__) || defined (__CYGWIN__) || defined(__WIN32__)
- *cp == ':' || *cp == '\\' ||
-#endif
- *cp == '/')
- {
- slash = cp;
- dash = NULL;
- }
- }
-
- cmd = NULL;
-
- if (dash != NULL)
- {
- /* First, try looking for a prefixed PROG_NAME in the
- PROGRAM_NAME directory, with the same prefix as PROGRAM_NAME. */
- cmd = look_for_prog (prog_name, program_name, dash - program_name + 1);
- }
-
- if (slash != NULL && cmd == NULL)
- {
- /* Next, try looking for a PROG_NAME in the same directory as
- that of this program. */
- cmd = look_for_prog (prog_name, program_name, slash - program_name + 1);
- }
-
- if (cmd == NULL)
- {
- /* Just return PROG_NAME as is. */
- cmd = xstrdup (prog_name);
- }
-
- return cmd;
-}
-
-#ifdef DLLTOOL_MCORE_ELF
-typedef struct fname_cache
-{
- const char * filename;
- struct fname_cache * next;
-}
-fname_cache;
-
-static fname_cache fnames;
-
-static void
-mcore_elf_cache_filename (const char * filename)
-{
- fname_cache * ptr;
-
- ptr = & fnames;
-
- while (ptr->next != NULL)
- ptr = ptr->next;
-
- ptr->filename = filename;
- ptr->next = (fname_cache *) malloc (sizeof (fname_cache));
- if (ptr->next != NULL)
- ptr->next->next = NULL;
-}
-
-#define MCORE_ELF_TMP_OBJ "mcoreelf.o"
-#define MCORE_ELF_TMP_EXP "mcoreelf.exp"
-#define MCORE_ELF_TMP_LIB "mcoreelf.lib"
-
-static void
-mcore_elf_gen_out_file (void)
-{
- fname_cache * ptr;
- dyn_string_t ds;
-
- /* Step one. Run 'ld -r' on the input object files in order to resolve
- any internal references and to generate a single .exports section. */
- ptr = & fnames;
-
- ds = dyn_string_new (100);
- dyn_string_append_cstr (ds, "-r ");
-
- if (mcore_elf_linker_flags != NULL)
- dyn_string_append_cstr (ds, mcore_elf_linker_flags);
-
- while (ptr->next != NULL)
- {
- dyn_string_append_cstr (ds, ptr->filename);
- dyn_string_append_cstr (ds, " ");
-
- ptr = ptr->next;
- }
-
- dyn_string_append_cstr (ds, "-o ");
- dyn_string_append_cstr (ds, MCORE_ELF_TMP_OBJ);
-
- if (mcore_elf_linker == NULL)
- mcore_elf_linker = deduce_name ("ld");
-
- run (mcore_elf_linker, ds->s);
-
- dyn_string_delete (ds);
-
- /* Step two. Create a .exp file and a .lib file from the temporary file.
- Do this by recursively invoking dlltool... */
- ds = dyn_string_new (100);
-
- dyn_string_append_cstr (ds, "-S ");
- dyn_string_append_cstr (ds, as_name);
-
- dyn_string_append_cstr (ds, " -e ");
- dyn_string_append_cstr (ds, MCORE_ELF_TMP_EXP);
- dyn_string_append_cstr (ds, " -l ");
- dyn_string_append_cstr (ds, MCORE_ELF_TMP_LIB);
- dyn_string_append_cstr (ds, " " );
- dyn_string_append_cstr (ds, MCORE_ELF_TMP_OBJ);
-
- if (verbose)
- dyn_string_append_cstr (ds, " -v");
-
- if (dontdeltemps)
- {
- dyn_string_append_cstr (ds, " -n");
-
- if (dontdeltemps > 1)
- dyn_string_append_cstr (ds, " -n");
- }
-
- /* XXX - FIME: ought to check/copy other command line options as well. */
- run (program_name, ds->s);
-
- dyn_string_delete (ds);
-
- /* Step four. Feed the .exp and object files to ld -shared to create the dll. */
- ds = dyn_string_new (100);
-
- dyn_string_append_cstr (ds, "-shared ");
-
- if (mcore_elf_linker_flags)
- dyn_string_append_cstr (ds, mcore_elf_linker_flags);
-
- dyn_string_append_cstr (ds, " ");
- dyn_string_append_cstr (ds, MCORE_ELF_TMP_EXP);
- dyn_string_append_cstr (ds, " ");
- dyn_string_append_cstr (ds, MCORE_ELF_TMP_OBJ);
- dyn_string_append_cstr (ds, " -o ");
- dyn_string_append_cstr (ds, mcore_elf_out_file);
-
- run (mcore_elf_linker, ds->s);
-
- dyn_string_delete (ds);
-
- if (dontdeltemps == 0)
- unlink (MCORE_ELF_TMP_EXP);
-
- if (dontdeltemps < 2)
- unlink (MCORE_ELF_TMP_OBJ);
-}
-#endif /* DLLTOOL_MCORE_ELF */
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
deleted file mode 100644
index 3a5ef0ff3e9..00000000000
--- a/binutils/dwarf.c
+++ /dev/null
@@ -1,4642 +0,0 @@
-/* dwarf.c -- display DWARF contents of a BFD binary file
- Copyright 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
-
- This file is part of GNU Binutils.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-#include "sysdep.h"
-#include "libiberty.h"
-#include "bfd.h"
-#include "bucomm.h"
-#include "elf/common.h"
-#include "elf/dwarf2.h"
-#include "dwarf.h"
-
-static int have_frame_base;
-static int need_base_address;
-
-static unsigned int last_pointer_size = 0;
-static int warned_about_missing_comp_units = FALSE;
-
-static unsigned int num_debug_info_entries = 0;
-static debug_info *debug_information = NULL;
-/* Special value for num_debug_info_entries to indicate
- that the .debug_info section could not be loaded/parsed. */
-#define DEBUG_INFO_UNAVAILABLE (unsigned int) -1
-
-int eh_addr_size;
-
-int do_debug_info;
-int do_debug_abbrevs;
-int do_debug_lines;
-int do_debug_lines_decoded;
-int do_debug_pubnames;
-int do_debug_aranges;
-int do_debug_ranges;
-int do_debug_frames;
-int do_debug_frames_interp;
-int do_debug_macinfo;
-int do_debug_str;
-int do_debug_loc;
-int do_wide;
-
-dwarf_vma (*byte_get) (unsigned char *, int);
-
-dwarf_vma
-byte_get_little_endian (unsigned char *field, int size)
-{
- switch (size)
- {
- case 1:
- return *field;
-
- case 2:
- return ((unsigned int) (field[0]))
- | (((unsigned int) (field[1])) << 8);
-
- case 4:
- return ((unsigned long) (field[0]))
- | (((unsigned long) (field[1])) << 8)
- | (((unsigned long) (field[2])) << 16)
- | (((unsigned long) (field[3])) << 24);
-
- case 8:
- if (sizeof (dwarf_vma) == 8)
- return ((dwarf_vma) (field[0]))
- | (((dwarf_vma) (field[1])) << 8)
- | (((dwarf_vma) (field[2])) << 16)
- | (((dwarf_vma) (field[3])) << 24)
- | (((dwarf_vma) (field[4])) << 32)
- | (((dwarf_vma) (field[5])) << 40)
- | (((dwarf_vma) (field[6])) << 48)
- | (((dwarf_vma) (field[7])) << 56);
- else if (sizeof (dwarf_vma) == 4)
- /* We want to extract data from an 8 byte wide field and
- place it into a 4 byte wide field. Since this is a little
- endian source we can just use the 4 byte extraction code. */
- return ((unsigned long) (field[0]))
- | (((unsigned long) (field[1])) << 8)
- | (((unsigned long) (field[2])) << 16)
- | (((unsigned long) (field[3])) << 24);
-
- default:
- error (_("Unhandled data length: %d\n"), size);
- abort ();
- }
-}
-
-dwarf_vma
-byte_get_big_endian (unsigned char *field, int size)
-{
- switch (size)
- {
- case 1:
- return *field;
-
- case 2:
- return ((unsigned int) (field[1])) | (((int) (field[0])) << 8);
-
- case 4:
- return ((unsigned long) (field[3]))
- | (((unsigned long) (field[2])) << 8)
- | (((unsigned long) (field[1])) << 16)
- | (((unsigned long) (field[0])) << 24);
-
- case 8:
- if (sizeof (dwarf_vma) == 8)
- return ((dwarf_vma) (field[7]))
- | (((dwarf_vma) (field[6])) << 8)
- | (((dwarf_vma) (field[5])) << 16)
- | (((dwarf_vma) (field[4])) << 24)
- | (((dwarf_vma) (field[3])) << 32)
- | (((dwarf_vma) (field[2])) << 40)
- | (((dwarf_vma) (field[1])) << 48)
- | (((dwarf_vma) (field[0])) << 56);
- else if (sizeof (dwarf_vma) == 4)
- {
- /* Although we are extracing data from an 8 byte wide field,
- we are returning only 4 bytes of data. */
- field += 4;
- return ((unsigned long) (field[3]))
- | (((unsigned long) (field[2])) << 8)
- | (((unsigned long) (field[1])) << 16)
- | (((unsigned long) (field[0])) << 24);
- }
-
- default:
- error (_("Unhandled data length: %d\n"), size);
- abort ();
- }
-}
-
-static dwarf_vma
-byte_get_signed (unsigned char *field, int size)
-{
- dwarf_vma x = byte_get (field, size);
-
- switch (size)
- {
- case 1:
- return (x ^ 0x80) - 0x80;
- case 2:
- return (x ^ 0x8000) - 0x8000;
- case 4:
- return (x ^ 0x80000000) - 0x80000000;
- case 8:
- return x;
- default:
- abort ();
- }
-}
-
-/* Print a dwarf_vma value (typically an address, offset or length) in
- hexadecimal format, followed by a space. The length of the value (and
- hence the precision displayed) is determined by the byte_size parameter. */
-
-static void
-print_dwarf_vma (dwarf_vma val, unsigned byte_size)
-{
- static char buff[18];
-
- /* Printf does not have a way of specifiying a maximum field width for an
- integer value, so we print the full value into a buffer and then select
- the precision we need. */
-#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
-#ifndef __MSVCRT__
- snprintf (buff, sizeof (buff), "%16.16llx ", val);
-#else
- snprintf (buff, sizeof (buff), "%016I64x ", val);
-#endif
-#else
- snprintf (buff, sizeof (buff), "%16.16lx ", val);
-#endif
-
- printf (buff + (byte_size == 4 ? 8 : 0));
-}
-
-static unsigned long int
-read_leb128 (unsigned char *data, unsigned int *length_return, int sign)
-{
- unsigned long int result = 0;
- unsigned int num_read = 0;
- unsigned int shift = 0;
- unsigned char byte;
-
- do
- {
- byte = *data++;
- num_read++;
-
- result |= ((unsigned long int) (byte & 0x7f)) << shift;
-
- shift += 7;
-
- }
- while (byte & 0x80);
-
- if (length_return != NULL)
- *length_return = num_read;
-
- if (sign && (shift < 8 * sizeof (result)) && (byte & 0x40))
- result |= -1L << shift;
-
- return result;
-}
-
-typedef struct State_Machine_Registers
-{
- unsigned long address;
- unsigned int file;
- unsigned int line;
- unsigned int column;
- int is_stmt;
- int basic_block;
- int end_sequence;
-/* This variable hold the number of the last entry seen
- in the File Table. */
- unsigned int last_file_entry;
-} SMR;
-
-static SMR state_machine_regs;
-
-static void
-reset_state_machine (int is_stmt)
-{
- state_machine_regs.address = 0;
- state_machine_regs.file = 1;
- state_machine_regs.line = 1;
- state_machine_regs.column = 0;
- state_machine_regs.is_stmt = is_stmt;
- state_machine_regs.basic_block = 0;
- state_machine_regs.end_sequence = 0;
- state_machine_regs.last_file_entry = 0;
-}
-
-/* Handled an extend line op.
- Returns the number of bytes read. */
-
-static int
-process_extended_line_op (unsigned char *data, int is_stmt)
-{
- unsigned char op_code;
- unsigned int bytes_read;
- unsigned int len;
- unsigned char *name;
- unsigned long adr;
-
- len = read_leb128 (data, & bytes_read, 0);
- data += bytes_read;
-
- if (len == 0)
- {
- warn (_("badly formed extended line op encountered!\n"));
- return bytes_read;
- }
-
- len += bytes_read;
- op_code = *data++;
-
- printf (_(" Extended opcode %d: "), op_code);
-
- switch (op_code)
- {
- case DW_LNE_end_sequence:
- printf (_("End of Sequence\n\n"));
- reset_state_machine (is_stmt);
- break;
-
- case DW_LNE_set_address:
- adr = byte_get (data, len - bytes_read - 1);
- printf (_("set Address to 0x%lx\n"), adr);
- state_machine_regs.address = adr;
- break;
-
- case DW_LNE_define_file:
- printf (_(" define new File Table entry\n"));
- printf (_(" Entry\tDir\tTime\tSize\tName\n"));
-
- printf (_(" %d\t"), ++state_machine_regs.last_file_entry);
- name = data;
- data += strlen ((char *) data) + 1;
- printf (_("%lu\t"), read_leb128 (data, & bytes_read, 0));
- data += bytes_read;
- printf (_("%lu\t"), read_leb128 (data, & bytes_read, 0));
- data += bytes_read;
- printf (_("%lu\t"), read_leb128 (data, & bytes_read, 0));
- printf (_("%s\n\n"), name);
- break;
-
- /* HP extensions. */
- case DW_LNE_HP_negate_is_UV_update:
- printf ("DW_LNE_HP_negate_is_UV_update");
- break;
- case DW_LNE_HP_push_context:
- printf ("DW_LNE_HP_push_context");
- break;
- case DW_LNE_HP_pop_context:
- printf ("DW_LNE_HP_pop_context");
- break;
- case DW_LNE_HP_set_file_line_column:
- printf ("DW_LNE_HP_set_file_line_column");
- break;
- case DW_LNE_HP_set_routine_name:
- printf ("DW_LNE_HP_set_routine_name");
- break;
- case DW_LNE_HP_set_sequence:
- printf ("DW_LNE_HP_set_sequence");
- break;
- case DW_LNE_HP_negate_post_semantics:
- printf ("DW_LNE_HP_negate_post_semantics");
- break;
- case DW_LNE_HP_negate_function_exit:
- printf ("DW_LNE_HP_negate_function_exit");
- break;
- case DW_LNE_HP_negate_front_end_logical:
- printf ("DW_LNE_HP_negate_front_end_logical");
- break;
- case DW_LNE_HP_define_proc:
- printf ("DW_LNE_HP_define_proc");
- break;
-
- default:
- if (op_code >= DW_LNE_lo_user
- /* The test against DW_LNW_hi_user is redundant due to
- the limited range of the unsigned char data type used
- for op_code. */
- /*&& op_code <= DW_LNE_hi_user*/)
- printf (_("user defined: length %d\n"), len - bytes_read);
- else
- printf (_("UNKNOWN: length %d\n"), len - bytes_read);
- break;
- }
-
- return len;
-}
-
-static const char *
-fetch_indirect_string (unsigned long offset)
-{
- struct dwarf_section *section = &debug_displays [str].section;
-
- if (section->start == NULL)
- return _("<no .debug_str section>");
-
- /* DWARF sections under Mach-O have non-zero addresses. */
- offset -= section->address;
- if (offset > section->size)
- {
- warn (_("DW_FORM_strp offset too big: %lx\n"), offset);
- return _("<offset is too big>");
- }
-
- return (const char *) section->start + offset;
-}
-
-/* FIXME: There are better and more efficient ways to handle
- these structures. For now though, I just want something that
- is simple to implement. */
-typedef struct abbrev_attr
-{
- unsigned long attribute;
- unsigned long form;
- struct abbrev_attr *next;
-}
-abbrev_attr;
-
-typedef struct abbrev_entry
-{
- unsigned long entry;
- unsigned long tag;
- int children;
- struct abbrev_attr *first_attr;
- struct abbrev_attr *last_attr;
- struct abbrev_entry *next;
-}
-abbrev_entry;
-
-static abbrev_entry *first_abbrev = NULL;
-static abbrev_entry *last_abbrev = NULL;
-
-static void
-free_abbrevs (void)
-{
- abbrev_entry *abbrev;
-
- for (abbrev = first_abbrev; abbrev;)
- {
- abbrev_entry *next = abbrev->next;
- abbrev_attr *attr;
-
- for (attr = abbrev->first_attr; attr;)
- {
- abbrev_attr *next = attr->next;
-
- free (attr);
- attr = next;
- }
-
- free (abbrev);
- abbrev = next;
- }
-
- last_abbrev = first_abbrev = NULL;
-}
-
-static void
-add_abbrev (unsigned long number, unsigned long tag, int children)
-{
- abbrev_entry *entry;
-
- entry = malloc (sizeof (*entry));
-
- if (entry == NULL)
- /* ugg */
- return;
-
- entry->entry = number;
- entry->tag = tag;
- entry->children = children;
- entry->first_attr = NULL;
- entry->last_attr = NULL;
- entry->next = NULL;
-
- if (first_abbrev == NULL)
- first_abbrev = entry;
- else
- last_abbrev->next = entry;
-
- last_abbrev = entry;
-}
-
-static void
-add_abbrev_attr (unsigned long attribute, unsigned long form)
-{
- abbrev_attr *attr;
-
- attr = malloc (sizeof (*attr));
-
- if (attr == NULL)
- /* ugg */
- return;
-
- attr->attribute = attribute;
- attr->form = form;
- attr->next = NULL;
-
- if (last_abbrev->first_attr == NULL)
- last_abbrev->first_attr = attr;
- else
- last_abbrev->last_attr->next = attr;
-
- last_abbrev->last_attr = attr;
-}
-
-/* Processes the (partial) contents of a .debug_abbrev section.
- Returns NULL if the end of the section was encountered.
- Returns the address after the last byte read if the end of
- an abbreviation set was found. */
-
-static unsigned char *
-process_abbrev_section (unsigned char *start, unsigned char *end)
-{
- if (first_abbrev != NULL)
- return NULL;
-
- while (start < end)
- {
- unsigned int bytes_read;
- unsigned long entry;
- unsigned long tag;
- unsigned long attribute;
- int children;
-
- entry = read_leb128 (start, & bytes_read, 0);
- start += bytes_read;
-
- /* A single zero is supposed to end the section according
- to the standard. If there's more, then signal that to
- the caller. */
- if (entry == 0)
- return start == end ? NULL : start;
-
- tag = read_leb128 (start, & bytes_read, 0);
- start += bytes_read;
-
- children = *start++;
-
- add_abbrev (entry, tag, children);
-
- do
- {
- unsigned long form;
-
- attribute = read_leb128 (start, & bytes_read, 0);
- start += bytes_read;
-
- form = read_leb128 (start, & bytes_read, 0);
- start += bytes_read;
-
- if (attribute != 0)
- add_abbrev_attr (attribute, form);
- }
- while (attribute != 0);
- }
-
- return NULL;
-}
-
-static char *
-get_TAG_name (unsigned long tag)
-{
- switch (tag)
- {
- case DW_TAG_padding: return "DW_TAG_padding";
- case DW_TAG_array_type: return "DW_TAG_array_type";
- case DW_TAG_class_type: return "DW_TAG_class_type";
- case DW_TAG_entry_point: return "DW_TAG_entry_point";
- case DW_TAG_enumeration_type: return "DW_TAG_enumeration_type";
- case DW_TAG_formal_parameter: return "DW_TAG_formal_parameter";
- case DW_TAG_imported_declaration: return "DW_TAG_imported_declaration";
- case DW_TAG_label: return "DW_TAG_label";
- case DW_TAG_lexical_block: return "DW_TAG_lexical_block";
- case DW_TAG_member: return "DW_TAG_member";
- case DW_TAG_pointer_type: return "DW_TAG_pointer_type";
- case DW_TAG_reference_type: return "DW_TAG_reference_type";
- case DW_TAG_compile_unit: return "DW_TAG_compile_unit";
- case DW_TAG_string_type: return "DW_TAG_string_type";
- case DW_TAG_structure_type: return "DW_TAG_structure_type";
- case DW_TAG_subroutine_type: return "DW_TAG_subroutine_type";
- case DW_TAG_typedef: return "DW_TAG_typedef";
- case DW_TAG_union_type: return "DW_TAG_union_type";
- case DW_TAG_unspecified_parameters: return "DW_TAG_unspecified_parameters";
- case DW_TAG_variant: return "DW_TAG_variant";
- case DW_TAG_common_block: return "DW_TAG_common_block";
- case DW_TAG_common_inclusion: return "DW_TAG_common_inclusion";
- case DW_TAG_inheritance: return "DW_TAG_inheritance";
- case DW_TAG_inlined_subroutine: return "DW_TAG_inlined_subroutine";
- case DW_TAG_module: return "DW_TAG_module";
- case DW_TAG_ptr_to_member_type: return "DW_TAG_ptr_to_member_type";
- case DW_TAG_set_type: return "DW_TAG_set_type";
- case DW_TAG_subrange_type: return "DW_TAG_subrange_type";
- case DW_TAG_with_stmt: return "DW_TAG_with_stmt";
- case DW_TAG_access_declaration: return "DW_TAG_access_declaration";
- case DW_TAG_base_type: return "DW_TAG_base_type";
- case DW_TAG_catch_block: return "DW_TAG_catch_block";
- case DW_TAG_const_type: return "DW_TAG_const_type";
- case DW_TAG_constant: return "DW_TAG_constant";
- case DW_TAG_enumerator: return "DW_TAG_enumerator";
- case DW_TAG_file_type: return "DW_TAG_file_type";
- case DW_TAG_friend: return "DW_TAG_friend";
- case DW_TAG_namelist: return "DW_TAG_namelist";
- case DW_TAG_namelist_item: return "DW_TAG_namelist_item";
- case DW_TAG_packed_type: return "DW_TAG_packed_type";
- case DW_TAG_subprogram: return "DW_TAG_subprogram";
- case DW_TAG_template_type_param: return "DW_TAG_template_type_param";
- case DW_TAG_template_value_param: return "DW_TAG_template_value_param";
- case DW_TAG_thrown_type: return "DW_TAG_thrown_type";
- case DW_TAG_try_block: return "DW_TAG_try_block";
- case DW_TAG_variant_part: return "DW_TAG_variant_part";
- case DW_TAG_variable: return "DW_TAG_variable";
- case DW_TAG_volatile_type: return "DW_TAG_volatile_type";
- case DW_TAG_MIPS_loop: return "DW_TAG_MIPS_loop";
- case DW_TAG_format_label: return "DW_TAG_format_label";
- case DW_TAG_function_template: return "DW_TAG_function_template";
- case DW_TAG_class_template: return "DW_TAG_class_template";
- /* DWARF 2.1 values. */
- case DW_TAG_dwarf_procedure: return "DW_TAG_dwarf_procedure";
- case DW_TAG_restrict_type: return "DW_TAG_restrict_type";
- case DW_TAG_interface_type: return "DW_TAG_interface_type";
- case DW_TAG_namespace: return "DW_TAG_namespace";
- case DW_TAG_imported_module: return "DW_TAG_imported_module";
- case DW_TAG_unspecified_type: return "DW_TAG_unspecified_type";
- case DW_TAG_partial_unit: return "DW_TAG_partial_unit";
- case DW_TAG_imported_unit: return "DW_TAG_imported_unit";
- /* UPC values. */
- case DW_TAG_upc_shared_type: return "DW_TAG_upc_shared_type";
- case DW_TAG_upc_strict_type: return "DW_TAG_upc_strict_type";
- case DW_TAG_upc_relaxed_type: return "DW_TAG_upc_relaxed_type";
- default:
- {
- static char buffer[100];
-
- snprintf (buffer, sizeof (buffer), _("Unknown TAG value: %lx"), tag);
- return buffer;
- }
- }
-}
-
-static char *
-get_FORM_name (unsigned long form)
-{
- switch (form)
- {
- case DW_FORM_addr: return "DW_FORM_addr";
- case DW_FORM_block2: return "DW_FORM_block2";
- case DW_FORM_block4: return "DW_FORM_block4";
- case DW_FORM_data2: return "DW_FORM_data2";
- case DW_FORM_data4: return "DW_FORM_data4";
- case DW_FORM_data8: return "DW_FORM_data8";
- case DW_FORM_string: return "DW_FORM_string";
- case DW_FORM_block: return "DW_FORM_block";
- case DW_FORM_block1: return "DW_FORM_block1";
- case DW_FORM_data1: return "DW_FORM_data1";
- case DW_FORM_flag: return "DW_FORM_flag";
- case DW_FORM_sdata: return "DW_FORM_sdata";
- case DW_FORM_strp: return "DW_FORM_strp";
- case DW_FORM_udata: return "DW_FORM_udata";
- case DW_FORM_ref_addr: return "DW_FORM_ref_addr";
- case DW_FORM_ref1: return "DW_FORM_ref1";
- case DW_FORM_ref2: return "DW_FORM_ref2";
- case DW_FORM_ref4: return "DW_FORM_ref4";
- case DW_FORM_ref8: return "DW_FORM_ref8";
- case DW_FORM_ref_udata: return "DW_FORM_ref_udata";
- case DW_FORM_indirect: return "DW_FORM_indirect";
- default:
- {
- static char buffer[100];
-
- snprintf (buffer, sizeof (buffer), _("Unknown FORM value: %lx"), form);
- return buffer;
- }
- }
-}
-
-static unsigned char *
-display_block (unsigned char *data, unsigned long length)
-{
- printf (_(" %lu byte block: "), length);
-
- while (length --)
- printf ("%lx ", (unsigned long) byte_get (data++, 1));
-
- return data;
-}
-
-static int
-decode_location_expression (unsigned char * data,
- unsigned int pointer_size,
- unsigned long length,
- unsigned long cu_offset)
-{
- unsigned op;
- unsigned int bytes_read;
- unsigned long uvalue;
- unsigned char *end = data + length;
- int need_frame_base = 0;
-
- while (data < end)
- {
- op = *data++;
-
- switch (op)
- {
- case DW_OP_addr:
- printf ("DW_OP_addr: %lx",
- (unsigned long) byte_get (data, pointer_size));
- data += pointer_size;
- break;
- case DW_OP_deref:
- printf ("DW_OP_deref");
- break;
- case DW_OP_const1u:
- printf ("DW_OP_const1u: %lu", (unsigned long) byte_get (data++, 1));
- break;
- case DW_OP_const1s:
- printf ("DW_OP_const1s: %ld", (long) byte_get_signed (data++, 1));
- break;
- case DW_OP_const2u:
- printf ("DW_OP_const2u: %lu", (unsigned long) byte_get (data, 2));
- data += 2;
- break;
- case DW_OP_const2s:
- printf ("DW_OP_const2s: %ld", (long) byte_get_signed (data, 2));
- data += 2;
- break;
- case DW_OP_const4u:
- printf ("DW_OP_const4u: %lu", (unsigned long) byte_get (data, 4));
- data += 4;
- break;
- case DW_OP_const4s:
- printf ("DW_OP_const4s: %ld", (long) byte_get_signed (data, 4));
- data += 4;
- break;
- case DW_OP_const8u:
- printf ("DW_OP_const8u: %lu %lu", (unsigned long) byte_get (data, 4),
- (unsigned long) byte_get (data + 4, 4));
- data += 8;
- break;
- case DW_OP_const8s:
- printf ("DW_OP_const8s: %ld %ld", (long) byte_get (data, 4),
- (long) byte_get (data + 4, 4));
- data += 8;
- break;
- case DW_OP_constu:
- printf ("DW_OP_constu: %lu", read_leb128 (data, &bytes_read, 0));
- data += bytes_read;
- break;
- case DW_OP_consts:
- printf ("DW_OP_consts: %ld", read_leb128 (data, &bytes_read, 1));
- data += bytes_read;
- break;
- case DW_OP_dup:
- printf ("DW_OP_dup");
- break;
- case DW_OP_drop:
- printf ("DW_OP_drop");
- break;
- case DW_OP_over:
- printf ("DW_OP_over");
- break;
- case DW_OP_pick:
- printf ("DW_OP_pick: %ld", (unsigned long) byte_get (data++, 1));
- break;
- case DW_OP_swap:
- printf ("DW_OP_swap");
- break;
- case DW_OP_rot:
- printf ("DW_OP_rot");
- break;
- case DW_OP_xderef:
- printf ("DW_OP_xderef");
- break;
- case DW_OP_abs:
- printf ("DW_OP_abs");
- break;
- case DW_OP_and:
- printf ("DW_OP_and");
- break;
- case DW_OP_div:
- printf ("DW_OP_div");
- break;
- case DW_OP_minus:
- printf ("DW_OP_minus");
- break;
- case DW_OP_mod:
- printf ("DW_OP_mod");
- break;
- case DW_OP_mul:
- printf ("DW_OP_mul");
- break;
- case DW_OP_neg:
- printf ("DW_OP_neg");
- break;
- case DW_OP_not:
- printf ("DW_OP_not");
- break;
- case DW_OP_or:
- printf ("DW_OP_or");
- break;
- case DW_OP_plus:
- printf ("DW_OP_plus");
- break;
- case DW_OP_plus_uconst:
- printf ("DW_OP_plus_uconst: %lu",
- read_leb128 (data, &bytes_read, 0));
- data += bytes_read;
- break;
- case DW_OP_shl:
- printf ("DW_OP_shl");
- break;
- case DW_OP_shr:
- printf ("DW_OP_shr");
- break;
- case DW_OP_shra:
- printf ("DW_OP_shra");
- break;
- case DW_OP_xor:
- printf ("DW_OP_xor");
- break;
- case DW_OP_bra:
- printf ("DW_OP_bra: %ld", (long) byte_get_signed (data, 2));
- data += 2;
- break;
- case DW_OP_eq:
- printf ("DW_OP_eq");
- break;
- case DW_OP_ge:
- printf ("DW_OP_ge");
- break;
- case DW_OP_gt:
- printf ("DW_OP_gt");
- break;
- case DW_OP_le:
- printf ("DW_OP_le");
- break;
- case DW_OP_lt:
- printf ("DW_OP_lt");
- break;
- case DW_OP_ne:
- printf ("DW_OP_ne");
- break;
- case DW_OP_skip:
- printf ("DW_OP_skip: %ld", (long) byte_get_signed (data, 2));
- data += 2;
- break;
-
- case DW_OP_lit0:
- case DW_OP_lit1:
- case DW_OP_lit2:
- case DW_OP_lit3:
- case DW_OP_lit4:
- case DW_OP_lit5:
- case DW_OP_lit6:
- case DW_OP_lit7:
- case DW_OP_lit8:
- case DW_OP_lit9:
- case DW_OP_lit10:
- case DW_OP_lit11:
- case DW_OP_lit12:
- case DW_OP_lit13:
- case DW_OP_lit14:
- case DW_OP_lit15:
- case DW_OP_lit16:
- case DW_OP_lit17:
- case DW_OP_lit18:
- case DW_OP_lit19:
- case DW_OP_lit20:
- case DW_OP_lit21:
- case DW_OP_lit22:
- case DW_OP_lit23:
- case DW_OP_lit24:
- case DW_OP_lit25:
- case DW_OP_lit26:
- case DW_OP_lit27:
- case DW_OP_lit28:
- case DW_OP_lit29:
- case DW_OP_lit30:
- case DW_OP_lit31:
- printf ("DW_OP_lit%d", op - DW_OP_lit0);
- break;
-
- case DW_OP_reg0:
- case DW_OP_reg1:
- case DW_OP_reg2:
- case DW_OP_reg3:
- case DW_OP_reg4:
- case DW_OP_reg5:
- case DW_OP_reg6:
- case DW_OP_reg7:
- case DW_OP_reg8:
- case DW_OP_reg9:
- case DW_OP_reg10:
- case DW_OP_reg11:
- case DW_OP_reg12:
- case DW_OP_reg13:
- case DW_OP_reg14:
- case DW_OP_reg15:
- case DW_OP_reg16:
- case DW_OP_reg17:
- case DW_OP_reg18:
- case DW_OP_reg19:
- case DW_OP_reg20:
- case DW_OP_reg21:
- case DW_OP_reg22:
- case DW_OP_reg23:
- case DW_OP_reg24:
- case DW_OP_reg25:
- case DW_OP_reg26:
- case DW_OP_reg27:
- case DW_OP_reg28:
- case DW_OP_reg29:
- case DW_OP_reg30:
- case DW_OP_reg31:
- printf ("DW_OP_reg%d", op - DW_OP_reg0);
- break;
-
- case DW_OP_breg0:
- case DW_OP_breg1:
- case DW_OP_breg2:
- case DW_OP_breg3:
- case DW_OP_breg4:
- case DW_OP_breg5:
- case DW_OP_breg6:
- case DW_OP_breg7:
- case DW_OP_breg8:
- case DW_OP_breg9:
- case DW_OP_breg10:
- case DW_OP_breg11:
- case DW_OP_breg12:
- case DW_OP_breg13:
- case DW_OP_breg14:
- case DW_OP_breg15:
- case DW_OP_breg16:
- case DW_OP_breg17:
- case DW_OP_breg18:
- case DW_OP_breg19:
- case DW_OP_breg20:
- case DW_OP_breg21:
- case DW_OP_breg22:
- case DW_OP_breg23:
- case DW_OP_breg24:
- case DW_OP_breg25:
- case DW_OP_breg26:
- case DW_OP_breg27:
- case DW_OP_breg28:
- case DW_OP_breg29:
- case DW_OP_breg30:
- case DW_OP_breg31:
- printf ("DW_OP_breg%d: %ld", op - DW_OP_breg0,
- read_leb128 (data, &bytes_read, 1));
- data += bytes_read;
- break;
-
- case DW_OP_regx:
- printf ("DW_OP_regx: %lu", read_leb128 (data, &bytes_read, 0));
- data += bytes_read;
- break;
- case DW_OP_fbreg:
- need_frame_base = 1;
- printf ("DW_OP_fbreg: %ld", read_leb128 (data, &bytes_read, 1));
- data += bytes_read;
- break;
- case DW_OP_bregx:
- uvalue = read_leb128 (data, &bytes_read, 0);
- data += bytes_read;
- printf ("DW_OP_bregx: %lu %ld", uvalue,
- read_leb128 (data, &bytes_read, 1));
- data += bytes_read;
- break;
- case DW_OP_piece:
- printf ("DW_OP_piece: %lu", read_leb128 (data, &bytes_read, 0));
- data += bytes_read;
- break;
- case DW_OP_deref_size:
- printf ("DW_OP_deref_size: %ld", (long) byte_get (data++, 1));
- break;
- case DW_OP_xderef_size:
- printf ("DW_OP_xderef_size: %ld", (long) byte_get (data++, 1));
- break;
- case DW_OP_nop:
- printf ("DW_OP_nop");
- break;
-
- /* DWARF 3 extensions. */
- case DW_OP_push_object_address:
- printf ("DW_OP_push_object_address");
- break;
- case DW_OP_call2:
- /* XXX: Strictly speaking for 64-bit DWARF3 files
- this ought to be an 8-byte wide computation. */
- printf ("DW_OP_call2: <%lx>", (long) byte_get (data, 2) + cu_offset);
- data += 2;
- break;
- case DW_OP_call4:
- /* XXX: Strictly speaking for 64-bit DWARF3 files
- this ought to be an 8-byte wide computation. */
- printf ("DW_OP_call4: <%lx>", (long) byte_get (data, 4) + cu_offset);
- data += 4;
- break;
- case DW_OP_call_ref:
- /* XXX: Strictly speaking for 64-bit DWARF3 files
- this ought to be an 8-byte wide computation. */
- printf ("DW_OP_call_ref: <%lx>", (long) byte_get (data, 4) + cu_offset);
- data += 4;
- break;
- case DW_OP_form_tls_address:
- printf ("DW_OP_form_tls_address");
- break;
- case DW_OP_call_frame_cfa:
- printf ("DW_OP_call_frame_cfa");
- break;
- case DW_OP_bit_piece:
- printf ("DW_OP_bit_piece: ");
- printf ("size: %lu ", read_leb128 (data, &bytes_read, 0));
- data += bytes_read;
- printf ("offset: %lu ", read_leb128 (data, &bytes_read, 0));
- data += bytes_read;
- break;
-
- /* GNU extensions. */
- case DW_OP_GNU_push_tls_address:
- printf ("DW_OP_GNU_push_tls_address or DW_OP_HP_unknown");
- break;
- case DW_OP_GNU_uninit:
- printf ("DW_OP_GNU_uninit");
- /* FIXME: Is there data associated with this OP ? */
- break;
-
- /* HP extensions. */
- case DW_OP_HP_is_value:
- printf ("DW_OP_HP_is_value");
- /* FIXME: Is there data associated with this OP ? */
- break;
- case DW_OP_HP_fltconst4:
- printf ("DW_OP_HP_fltconst4");
- /* FIXME: Is there data associated with this OP ? */
- break;
- case DW_OP_HP_fltconst8:
- printf ("DW_OP_HP_fltconst8");
- /* FIXME: Is there data associated with this OP ? */
- break;
- case DW_OP_HP_mod_range:
- printf ("DW_OP_HP_mod_range");
- /* FIXME: Is there data associated with this OP ? */
- break;
- case DW_OP_HP_unmod_range:
- printf ("DW_OP_HP_unmod_range");
- /* FIXME: Is there data associated with this OP ? */
- break;
- case DW_OP_HP_tls:
- printf ("DW_OP_HP_tls");
- /* FIXME: Is there data associated with this OP ? */
- break;
-
- /* PGI (STMicroelectronics) extensions. */
- case DW_OP_PGI_omp_thread_num:
- /* Pushes the thread number for the current thread as it would be
- returned by the standard OpenMP library function:
- omp_get_thread_num(). The "current thread" is the thread for
- which the expression is being evaluated. */
- printf ("DW_OP_PGI_omp_thread_num");
- break;
-
- default:
- if (op >= DW_OP_lo_user
- && op <= DW_OP_hi_user)
- printf (_("(User defined location op)"));
- else
- printf (_("(Unknown location op)"));
- /* No way to tell where the next op is, so just bail. */
- return need_frame_base;
- }
-
- /* Separate the ops. */
- if (data < end)
- printf ("; ");
- }
-
- return need_frame_base;
-}
-
-static unsigned char *
-read_and_display_attr_value (unsigned long attribute,
- unsigned long form,
- unsigned char * data,
- unsigned long cu_offset,
- unsigned long pointer_size,
- unsigned long offset_size,
- int dwarf_version,
- debug_info * debug_info_p,
- int do_loc,
- struct dwarf_section * section)
-{
- unsigned long uvalue = 0;
- unsigned char *block_start = NULL;
- unsigned char * orig_data = data;
- unsigned int bytes_read;
-
- switch (form)
- {
- default:
- break;
-
- case DW_FORM_ref_addr:
- if (dwarf_version == 2)
- {
- uvalue = byte_get (data, pointer_size);
- data += pointer_size;
- }
- else if (dwarf_version == 3)
- {
- uvalue = byte_get (data, offset_size);
- data += offset_size;
- }
- else
- {
- error (_("Internal error: DWARF version is not 2 or 3.\n"));
- }
- break;
-
- case DW_FORM_addr:
- uvalue = byte_get (data, pointer_size);
- data += pointer_size;
- break;
-
- case DW_FORM_strp:
- uvalue = byte_get (data, offset_size);
- data += offset_size;
- break;
-
- case DW_FORM_ref1:
- case DW_FORM_flag:
- case DW_FORM_data1:
- uvalue = byte_get (data++, 1);
- break;
-
- case DW_FORM_ref2:
- case DW_FORM_data2:
- uvalue = byte_get (data, 2);
- data += 2;
- break;
-
- case DW_FORM_ref4:
- case DW_FORM_data4:
- uvalue = byte_get (data, 4);
- data += 4;
- break;
-
- case DW_FORM_sdata:
- uvalue = read_leb128 (data, & bytes_read, 1);
- data += bytes_read;
- break;
-
- case DW_FORM_ref_udata:
- case DW_FORM_udata:
- uvalue = read_leb128 (data, & bytes_read, 0);
- data += bytes_read;
- break;
-
- case DW_FORM_indirect:
- form = read_leb128 (data, & bytes_read, 0);
- data += bytes_read;
- if (!do_loc)
- printf (" %s", get_FORM_name (form));
- return read_and_display_attr_value (attribute, form, data,
- cu_offset, pointer_size,
- offset_size, dwarf_version,
- debug_info_p, do_loc,
- section);
- }
-
- switch (form)
- {
- case DW_FORM_ref_addr:
- if (!do_loc)
- printf (" <0x%lx>", uvalue);
- break;
-
- case DW_FORM_ref1:
- case DW_FORM_ref2:
- case DW_FORM_ref4:
- case DW_FORM_ref_udata:
- if (!do_loc)
- printf (" <0x%lx>", uvalue + cu_offset);
- break;
-
- case DW_FORM_data4:
- case DW_FORM_addr:
- if (!do_loc)
- printf (" 0x%lx", uvalue);
- break;
-
- case DW_FORM_flag:
- case DW_FORM_data1:
- case DW_FORM_data2:
- case DW_FORM_sdata:
- case DW_FORM_udata:
- if (!do_loc)
- printf (" %ld", uvalue);
- break;
-
- case DW_FORM_ref8:
- case DW_FORM_data8:
- if (!do_loc)
- {
- uvalue = byte_get (data, 4);
- printf (" 0x%lx", uvalue);
- printf (" 0x%lx", (unsigned long) byte_get (data + 4, 4));
- }
- if ((do_loc || do_debug_loc || do_debug_ranges)
- && num_debug_info_entries == 0)
- {
- if (sizeof (uvalue) == 8)
- uvalue = byte_get (data, 8);
- else
- error (_("DW_FORM_data8 is unsupported when sizeof (unsigned long) != 8\n"));
- }
- data += 8;
- break;
-
- case DW_FORM_string:
- if (!do_loc)
- printf (" %s", data);
- data += strlen ((char *) data) + 1;
- break;
-
- case DW_FORM_block:
- uvalue = read_leb128 (data, & bytes_read, 0);
- block_start = data + bytes_read;
- if (do_loc)
- data = block_start + uvalue;
- else
- data = display_block (block_start, uvalue);
- break;
-
- case DW_FORM_block1:
- uvalue = byte_get (data, 1);
- block_start = data + 1;
- if (do_loc)
- data = block_start + uvalue;
- else
- data = display_block (block_start, uvalue);
- break;
-
- case DW_FORM_block2:
- uvalue = byte_get (data, 2);
- block_start = data + 2;
- if (do_loc)
- data = block_start + uvalue;
- else
- data = display_block (block_start, uvalue);
- break;
-
- case DW_FORM_block4:
- uvalue = byte_get (data, 4);
- block_start = data + 4;
- if (do_loc)
- data = block_start + uvalue;
- else
- data = display_block (block_start, uvalue);
- break;
-
- case DW_FORM_strp:
- if (!do_loc)
- printf (_(" (indirect string, offset: 0x%lx): %s"),
- uvalue, fetch_indirect_string (uvalue));
- break;
-
- case DW_FORM_indirect:
- /* Handled above. */
- break;
-
- default:
- warn (_("Unrecognized form: %lu\n"), form);
- break;
- }
-
- if ((do_loc || do_debug_loc || do_debug_ranges)
- && num_debug_info_entries == 0)
- {
- switch (attribute)
- {
- case DW_AT_frame_base:
- have_frame_base = 1;
- case DW_AT_location:
- case DW_AT_string_length:
- case DW_AT_return_addr:
- case DW_AT_data_member_location:
- case DW_AT_vtable_elem_location:
- case DW_AT_segment:
- case DW_AT_static_link:
- case DW_AT_use_location:
- if (form == DW_FORM_data4 || form == DW_FORM_data8)
- {
- /* Process location list. */
- unsigned int max = debug_info_p->max_loc_offsets;
- unsigned int num = debug_info_p->num_loc_offsets;
-
- if (max == 0 || num >= max)
- {
- max += 1024;
- debug_info_p->loc_offsets
- = xcrealloc (debug_info_p->loc_offsets,
- max, sizeof (*debug_info_p->loc_offsets));
- debug_info_p->have_frame_base
- = xcrealloc (debug_info_p->have_frame_base,
- max, sizeof (*debug_info_p->have_frame_base));
- debug_info_p->max_loc_offsets = max;
- }
- debug_info_p->loc_offsets [num] = uvalue;
- debug_info_p->have_frame_base [num] = have_frame_base;
- debug_info_p->num_loc_offsets++;
- }
- break;
-
- case DW_AT_low_pc:
- if (need_base_address)
- debug_info_p->base_address = uvalue;
- break;
-
- case DW_AT_ranges:
- if (form == DW_FORM_data4 || form == DW_FORM_data8)
- {
- /* Process range list. */
- unsigned int max = debug_info_p->max_range_lists;
- unsigned int num = debug_info_p->num_range_lists;
-
- if (max == 0 || num >= max)
- {
- max += 1024;
- debug_info_p->range_lists
- = xcrealloc (debug_info_p->range_lists,
- max, sizeof (*debug_info_p->range_lists));
- debug_info_p->max_range_lists = max;
- }
- debug_info_p->range_lists [num] = uvalue;
- debug_info_p->num_range_lists++;
- }
- break;
-
- default:
- break;
- }
- }
-
- if (do_loc)
- return data;
-
- /* For some attributes we can display further information. */
- printf ("\t");
-
- switch (attribute)
- {
- case DW_AT_inline:
- switch (uvalue)
- {
- case DW_INL_not_inlined:
- printf (_("(not inlined)"));
- break;
- case DW_INL_inlined:
- printf (_("(inlined)"));
- break;
- case DW_INL_declared_not_inlined:
- printf (_("(declared as inline but ignored)"));
- break;
- case DW_INL_declared_inlined:
- printf (_("(declared as inline and inlined)"));
- break;
- default:
- printf (_(" (Unknown inline attribute value: %lx)"), uvalue);
- break;
- }
- break;
-
- case DW_AT_language:
- switch (uvalue)
- {
- /* Ordered by the numeric value of these constants. */
- case DW_LANG_C89: printf ("(ANSI C)"); break;
- case DW_LANG_C: printf ("(non-ANSI C)"); break;
- case DW_LANG_Ada83: printf ("(Ada)"); break;
- case DW_LANG_C_plus_plus: printf ("(C++)"); break;
- case DW_LANG_Cobol74: printf ("(Cobol 74)"); break;
- case DW_LANG_Cobol85: printf ("(Cobol 85)"); break;
- case DW_LANG_Fortran77: printf ("(FORTRAN 77)"); break;
- case DW_LANG_Fortran90: printf ("(Fortran 90)"); break;
- case DW_LANG_Pascal83: printf ("(ANSI Pascal)"); break;
- case DW_LANG_Modula2: printf ("(Modula 2)"); break;
- /* DWARF 2.1 values. */
- case DW_LANG_Java: printf ("(Java)"); break;
- case DW_LANG_C99: printf ("(ANSI C99)"); break;
- case DW_LANG_Ada95: printf ("(ADA 95)"); break;
- case DW_LANG_Fortran95: printf ("(Fortran 95)"); break;
- /* DWARF 3 values. */
- case DW_LANG_PLI: printf ("(PLI)"); break;
- case DW_LANG_ObjC: printf ("(Objective C)"); break;
- case DW_LANG_ObjC_plus_plus: printf ("(Objective C++)"); break;
- case DW_LANG_UPC: printf ("(Unified Parallel C)"); break;
- case DW_LANG_D: printf ("(D)"); break;
- /* MIPS extension. */
- case DW_LANG_Mips_Assembler: printf ("(MIPS assembler)"); break;
- /* UPC extension. */
- case DW_LANG_Upc: printf ("(Unified Parallel C)"); break;
- default:
- if (uvalue >= DW_LANG_lo_user && uvalue <= DW_LANG_hi_user)
- printf ("(implementation defined: %lx)", uvalue);
- else
- printf ("(Unknown: %lx)", uvalue);
- break;
- }
- break;
-
- case DW_AT_encoding:
- switch (uvalue)
- {
- case DW_ATE_void: printf ("(void)"); break;
- case DW_ATE_address: printf ("(machine address)"); break;
- case DW_ATE_boolean: printf ("(boolean)"); break;
- case DW_ATE_complex_float: printf ("(complex float)"); break;
- case DW_ATE_float: printf ("(float)"); break;
- case DW_ATE_signed: printf ("(signed)"); break;
- case DW_ATE_signed_char: printf ("(signed char)"); break;
- case DW_ATE_unsigned: printf ("(unsigned)"); break;
- case DW_ATE_unsigned_char: printf ("(unsigned char)"); break;
- /* DWARF 2.1 values: */
- case DW_ATE_imaginary_float: printf ("(imaginary float)"); break;
- case DW_ATE_decimal_float: printf ("(decimal float)"); break;
- /* DWARF 3 values: */
- case DW_ATE_packed_decimal: printf ("(packed_decimal)"); break;
- case DW_ATE_numeric_string: printf ("(numeric_string)"); break;
- case DW_ATE_edited: printf ("(edited)"); break;
- case DW_ATE_signed_fixed: printf ("(signed_fixed)"); break;
- case DW_ATE_unsigned_fixed: printf ("(unsigned_fixed)"); break;
- /* HP extensions: */
- case DW_ATE_HP_float80: printf ("(HP_float80)"); break;
- case DW_ATE_HP_complex_float80: printf ("(HP_complex_float80)"); break;
- case DW_ATE_HP_float128: printf ("(HP_float128)"); break;
- case DW_ATE_HP_complex_float128:printf ("(HP_complex_float128)"); break;
- case DW_ATE_HP_floathpintel: printf ("(HP_floathpintel)"); break;
- case DW_ATE_HP_imaginary_float80: printf ("(HP_imaginary_float80)"); break;
- case DW_ATE_HP_imaginary_float128: printf ("(HP_imaginary_float128)"); break;
-
- default:
- if (uvalue >= DW_ATE_lo_user
- && uvalue <= DW_ATE_hi_user)
- printf ("(user defined type)");
- else
- printf ("(unknown type)");
- break;
- }
- break;
-
- case DW_AT_accessibility:
- switch (uvalue)
- {
- case DW_ACCESS_public: printf ("(public)"); break;
- case DW_ACCESS_protected: printf ("(protected)"); break;
- case DW_ACCESS_private: printf ("(private)"); break;
- default:
- printf ("(unknown accessibility)");
- break;
- }
- break;
-
- case DW_AT_visibility:
- switch (uvalue)
- {
- case DW_VIS_local: printf ("(local)"); break;
- case DW_VIS_exported: printf ("(exported)"); break;
- case DW_VIS_qualified: printf ("(qualified)"); break;
- default: printf ("(unknown visibility)"); break;
- }
- break;
-
- case DW_AT_virtuality:
- switch (uvalue)
- {
- case DW_VIRTUALITY_none: printf ("(none)"); break;
- case DW_VIRTUALITY_virtual: printf ("(virtual)"); break;
- case DW_VIRTUALITY_pure_virtual:printf ("(pure_virtual)"); break;
- default: printf ("(unknown virtuality)"); break;
- }
- break;
-
- case DW_AT_identifier_case:
- switch (uvalue)
- {
- case DW_ID_case_sensitive: printf ("(case_sensitive)"); break;
- case DW_ID_up_case: printf ("(up_case)"); break;
- case DW_ID_down_case: printf ("(down_case)"); break;
- case DW_ID_case_insensitive: printf ("(case_insensitive)"); break;
- default: printf ("(unknown case)"); break;
- }
- break;
-
- case DW_AT_calling_convention:
- switch (uvalue)
- {
- case DW_CC_normal: printf ("(normal)"); break;
- case DW_CC_program: printf ("(program)"); break;
- case DW_CC_nocall: printf ("(nocall)"); break;
- default:
- if (uvalue >= DW_CC_lo_user
- && uvalue <= DW_CC_hi_user)
- printf ("(user defined)");
- else
- printf ("(unknown convention)");
- }
- break;
-
- case DW_AT_ordering:
- switch (uvalue)
- {
- case -1: printf ("(undefined)"); break;
- case 0: printf ("(row major)"); break;
- case 1: printf ("(column major)"); break;
- }
- break;
-
- case DW_AT_frame_base:
- have_frame_base = 1;
- case DW_AT_location:
- case DW_AT_string_length:
- case DW_AT_return_addr:
- case DW_AT_data_member_location:
- case DW_AT_vtable_elem_location:
- case DW_AT_segment:
- case DW_AT_static_link:
- case DW_AT_use_location:
- if (form == DW_FORM_data4 || form == DW_FORM_data8)
- printf (_("(location list)"));
- /* Fall through. */
- case DW_AT_allocated:
- case DW_AT_associated:
- case DW_AT_data_location:
- case DW_AT_stride:
- case DW_AT_upper_bound:
- case DW_AT_lower_bound:
- if (block_start)
- {
- int need_frame_base;
-
- printf ("(");
- need_frame_base = decode_location_expression (block_start,
- pointer_size,
- uvalue,
- cu_offset);
- printf (")");
- if (need_frame_base && !have_frame_base)
- printf (_(" [without DW_AT_frame_base]"));
- }
- break;
-
- case DW_AT_import:
- {
- if (form == DW_FORM_ref1
- || form == DW_FORM_ref2
- || form == DW_FORM_ref4)
- uvalue += cu_offset;
-
- if (uvalue >= section->size)
- warn (_("Offset %lx used as value for DW_AT_import attribute of DIE at offset %lx is too big.\n"),
- uvalue, (unsigned long) (orig_data - section->start));
- else
- {
- unsigned long abbrev_number;
- abbrev_entry * entry;
-
- abbrev_number = read_leb128 (section->start + uvalue, NULL, 0);
-
- printf ("[Abbrev Number: %ld", abbrev_number);
- for (entry = first_abbrev; entry != NULL; entry = entry->next)
- if (entry->entry == abbrev_number)
- break;
- if (entry != NULL)
- printf (" (%s)", get_TAG_name (entry->tag));
- printf ("]");
- }
- }
- break;
-
- default:
- break;
- }
-
- return data;
-}
-
-static char *
-get_AT_name (unsigned long attribute)
-{
- switch (attribute)
- {
- case DW_AT_sibling: return "DW_AT_sibling";
- case DW_AT_location: return "DW_AT_location";
- case DW_AT_name: return "DW_AT_name";
- case DW_AT_ordering: return "DW_AT_ordering";
- case DW_AT_subscr_data: return "DW_AT_subscr_data";
- case DW_AT_byte_size: return "DW_AT_byte_size";
- case DW_AT_bit_offset: return "DW_AT_bit_offset";
- case DW_AT_bit_size: return "DW_AT_bit_size";
- case DW_AT_element_list: return "DW_AT_element_list";
- case DW_AT_stmt_list: return "DW_AT_stmt_list";
- case DW_AT_low_pc: return "DW_AT_low_pc";
- case DW_AT_high_pc: return "DW_AT_high_pc";
- case DW_AT_language: return "DW_AT_language";
- case DW_AT_member: return "DW_AT_member";
- case DW_AT_discr: return "DW_AT_discr";
- case DW_AT_discr_value: return "DW_AT_discr_value";
- case DW_AT_visibility: return "DW_AT_visibility";
- case DW_AT_import: return "DW_AT_import";
- case DW_AT_string_length: return "DW_AT_string_length";
- case DW_AT_common_reference: return "DW_AT_common_reference";
- case DW_AT_comp_dir: return "DW_AT_comp_dir";
- case DW_AT_const_value: return "DW_AT_const_value";
- case DW_AT_containing_type: return "DW_AT_containing_type";
- case DW_AT_default_value: return "DW_AT_default_value";
- case DW_AT_inline: return "DW_AT_inline";
- case DW_AT_is_optional: return "DW_AT_is_optional";
- case DW_AT_lower_bound: return "DW_AT_lower_bound";
- case DW_AT_producer: return "DW_AT_producer";
- case DW_AT_prototyped: return "DW_AT_prototyped";
- case DW_AT_return_addr: return "DW_AT_return_addr";
- case DW_AT_start_scope: return "DW_AT_start_scope";
- case DW_AT_stride_size: return "DW_AT_stride_size";
- case DW_AT_upper_bound: return "DW_AT_upper_bound";
- case DW_AT_abstract_origin: return "DW_AT_abstract_origin";
- case DW_AT_accessibility: return "DW_AT_accessibility";
- case DW_AT_address_class: return "DW_AT_address_class";
- case DW_AT_artificial: return "DW_AT_artificial";
- case DW_AT_base_types: return "DW_AT_base_types";
- case DW_AT_calling_convention: return "DW_AT_calling_convention";
- case DW_AT_count: return "DW_AT_count";
- case DW_AT_data_member_location: return "DW_AT_data_member_location";
- case DW_AT_decl_column: return "DW_AT_decl_column";
- case DW_AT_decl_file: return "DW_AT_decl_file";
- case DW_AT_decl_line: return "DW_AT_decl_line";
- case DW_AT_declaration: return "DW_AT_declaration";
- case DW_AT_discr_list: return "DW_AT_discr_list";
- case DW_AT_encoding: return "DW_AT_encoding";
- case DW_AT_external: return "DW_AT_external";
- case DW_AT_frame_base: return "DW_AT_frame_base";
- case DW_AT_friend: return "DW_AT_friend";
- case DW_AT_identifier_case: return "DW_AT_identifier_case";
- case DW_AT_macro_info: return "DW_AT_macro_info";
- case DW_AT_namelist_items: return "DW_AT_namelist_items";
- case DW_AT_priority: return "DW_AT_priority";
- case DW_AT_segment: return "DW_AT_segment";
- case DW_AT_specification: return "DW_AT_specification";
- case DW_AT_static_link: return "DW_AT_static_link";
- case DW_AT_type: return "DW_AT_type";
- case DW_AT_use_location: return "DW_AT_use_location";
- case DW_AT_variable_parameter: return "DW_AT_variable_parameter";
- case DW_AT_virtuality: return "DW_AT_virtuality";
- case DW_AT_vtable_elem_location: return "DW_AT_vtable_elem_location";
- /* DWARF 2.1 values. */
- case DW_AT_allocated: return "DW_AT_allocated";
- case DW_AT_associated: return "DW_AT_associated";
- case DW_AT_data_location: return "DW_AT_data_location";
- case DW_AT_stride: return "DW_AT_stride";
- case DW_AT_entry_pc: return "DW_AT_entry_pc";
- case DW_AT_use_UTF8: return "DW_AT_use_UTF8";
- case DW_AT_extension: return "DW_AT_extension";
- case DW_AT_ranges: return "DW_AT_ranges";
- case DW_AT_trampoline: return "DW_AT_trampoline";
- case DW_AT_call_column: return "DW_AT_call_column";
- case DW_AT_call_file: return "DW_AT_call_file";
- case DW_AT_call_line: return "DW_AT_call_line";
- case DW_AT_description: return "DW_AT_description";
- case DW_AT_binary_scale: return "DW_AT_binary_scale";
- case DW_AT_decimal_scale: return "DW_AT_decimal_scale";
- case DW_AT_small: return "DW_AT_small";
- case DW_AT_decimal_sign: return "DW_AT_decimal_sign";
- case DW_AT_digit_count: return "DW_AT_digit_count";
- case DW_AT_picture_string: return "DW_AT_picture_string";
- case DW_AT_mutable: return "DW_AT_mutable";
- case DW_AT_threads_scaled: return "DW_AT_threads_scaled";
- case DW_AT_explicit: return "DW_AT_explicit";
- case DW_AT_object_pointer: return "DW_AT_object_pointer";
- case DW_AT_endianity: return "DW_AT_endianity";
- case DW_AT_elemental: return "DW_AT_elemental";
- case DW_AT_pure: return "DW_AT_pure";
- case DW_AT_recursive: return "DW_AT_recursive";
-
- /* HP and SGI/MIPS extensions. */
- case DW_AT_MIPS_loop_begin: return "DW_AT_MIPS_loop_begin";
- case DW_AT_MIPS_tail_loop_begin: return "DW_AT_MIPS_tail_loop_begin";
- case DW_AT_MIPS_epilog_begin: return "DW_AT_MIPS_epilog_begin";
- case DW_AT_MIPS_loop_unroll_factor: return "DW_AT_MIPS_loop_unroll_factor";
- case DW_AT_MIPS_software_pipeline_depth: return "DW_AT_MIPS_software_pipeline_depth";
- case DW_AT_MIPS_linkage_name: return "DW_AT_MIPS_linkage_name";
- case DW_AT_MIPS_stride: return "DW_AT_MIPS_stride";
- case DW_AT_MIPS_abstract_name: return "DW_AT_MIPS_abstract_name";
- case DW_AT_MIPS_clone_origin: return "DW_AT_MIPS_clone_origin";
- case DW_AT_MIPS_has_inlines: return "DW_AT_MIPS_has_inlines";
-
- /* HP Extensions. */
- case DW_AT_HP_block_index: return "DW_AT_HP_block_index";
- case DW_AT_HP_actuals_stmt_list: return "DW_AT_HP_actuals_stmt_list";
- case DW_AT_HP_proc_per_section: return "DW_AT_HP_proc_per_section";
- case DW_AT_HP_raw_data_ptr: return "DW_AT_HP_raw_data_ptr";
- case DW_AT_HP_pass_by_reference: return "DW_AT_HP_pass_by_reference";
- case DW_AT_HP_opt_level: return "DW_AT_HP_opt_level";
- case DW_AT_HP_prof_version_id: return "DW_AT_HP_prof_version_id";
- case DW_AT_HP_opt_flags: return "DW_AT_HP_opt_flags";
- case DW_AT_HP_cold_region_low_pc: return "DW_AT_HP_cold_region_low_pc";
- case DW_AT_HP_cold_region_high_pc: return "DW_AT_HP_cold_region_high_pc";
- case DW_AT_HP_all_variables_modifiable: return "DW_AT_HP_all_variables_modifiable";
- case DW_AT_HP_linkage_name: return "DW_AT_HP_linkage_name";
- case DW_AT_HP_prof_flags: return "DW_AT_HP_prof_flags";
-
- /* One value is shared by the MIPS and HP extensions: */
- case DW_AT_MIPS_fde: return "DW_AT_MIPS_fde or DW_AT_HP_unmodifiable";
-
- /* GNU extensions. */
- case DW_AT_sf_names: return "DW_AT_sf_names";
- case DW_AT_src_info: return "DW_AT_src_info";
- case DW_AT_mac_info: return "DW_AT_mac_info";
- case DW_AT_src_coords: return "DW_AT_src_coords";
- case DW_AT_body_begin: return "DW_AT_body_begin";
- case DW_AT_body_end: return "DW_AT_body_end";
- case DW_AT_GNU_vector: return "DW_AT_GNU_vector";
-
- /* UPC extension. */
- case DW_AT_upc_threads_scaled: return "DW_AT_upc_threads_scaled";
-
- /* PGI (STMicroelectronics) extensions. */
- case DW_AT_PGI_lbase: return "DW_AT_PGI_lbase";
- case DW_AT_PGI_soffset: return "DW_AT_PGI_soffset";
- case DW_AT_PGI_lstride: return "DW_AT_PGI_lstride";
-
- default:
- {
- static char buffer[100];
-
- snprintf (buffer, sizeof (buffer), _("Unknown AT value: %lx"),
- attribute);
- return buffer;
- }
- }
-}
-
-static unsigned char *
-read_and_display_attr (unsigned long attribute,
- unsigned long form,
- unsigned char * data,
- unsigned long cu_offset,
- unsigned long pointer_size,
- unsigned long offset_size,
- int dwarf_version,
- debug_info * debug_info_p,
- int do_loc,
- struct dwarf_section * section)
-{
- if (!do_loc)
- printf (" %-18s:", get_AT_name (attribute));
- data = read_and_display_attr_value (attribute, form, data, cu_offset,
- pointer_size, offset_size,
- dwarf_version, debug_info_p,
- do_loc, section);
- if (!do_loc)
- printf ("\n");
- return data;
-}
-
-
-/* Process the contents of a .debug_info section. If do_loc is non-zero
- then we are scanning for location lists and we do not want to display
- anything to the user. */
-
-static int
-process_debug_info (struct dwarf_section *section,
- void *file,
- int do_loc)
-{
- unsigned char *start = section->start;
- unsigned char *end = start + section->size;
- unsigned char *section_begin;
- unsigned int unit;
- unsigned int num_units = 0;
-
- if ((do_loc || do_debug_loc || do_debug_ranges)
- && num_debug_info_entries == 0)
- {
- unsigned long length;
-
- /* First scan the section to get the number of comp units. */
- for (section_begin = start, num_units = 0; section_begin < end;
- num_units ++)
- {
- /* Read the first 4 bytes. For a 32-bit DWARF section, this
- will be the length. For a 64-bit DWARF section, it'll be
- the escape code 0xffffffff followed by an 8 byte length. */
- length = byte_get (section_begin, 4);
-
- if (length == 0xffffffff)
- {
- length = byte_get (section_begin + 4, 8);
- section_begin += length + 12;
- }
- else if (length >= 0xfffffff0 && length < 0xffffffff)
- {
- warn (_("Reserved length value (%lx) found in section %s\n"), length, section->name);
- return 0;
- }
- else
- section_begin += length + 4;
-
- /* Negative values are illegal, they may even cause infinite
- looping. This can happen if we can't accurately apply
- relocations to an object file. */
- if ((signed long) length <= 0)
- {
- warn (_("Corrupt unit length (%lx) found in section %s\n"), length, section->name);
- return 0;
- }
- }
-
- if (num_units == 0)
- {
- error (_("No comp units in %s section ?"), section->name);
- return 0;
- }
-
- /* Then allocate an array to hold the information. */
- debug_information = cmalloc (num_units,
- sizeof (* debug_information));
- if (debug_information == NULL)
- {
- error (_("Not enough memory for a debug info array of %u entries"),
- num_units);
- return 0;
- }
- }
-
- if (!do_loc)
- {
- printf (_("The section %s contains:\n\n"), section->name);
-
- load_debug_section (str, file);
- }
-
- load_debug_section (abbrev, file);
- if (debug_displays [abbrev].section.start == NULL)
- {
- warn (_("Unable to locate %s section!\n"),
- debug_displays [abbrev].section.name);
- return 0;
- }
-
- for (section_begin = start, unit = 0; start < end; unit++)
- {
- DWARF2_Internal_CompUnit compunit;
- unsigned char *hdrptr;
- unsigned char *cu_abbrev_offset_ptr;
- unsigned char *tags;
- int level;
- unsigned long cu_offset;
- int offset_size;
- int initial_length_size;
-
- hdrptr = start;
-
- compunit.cu_length = byte_get (hdrptr, 4);
- hdrptr += 4;
-
- if (compunit.cu_length == 0xffffffff)
- {
- compunit.cu_length = byte_get (hdrptr, 8);
- hdrptr += 8;
- offset_size = 8;
- initial_length_size = 12;
- }
- else
- {
- offset_size = 4;
- initial_length_size = 4;
- }
-
- compunit.cu_version = byte_get (hdrptr, 2);
- hdrptr += 2;
-
- cu_offset = start - section_begin;
-
- cu_abbrev_offset_ptr = hdrptr;
- compunit.cu_abbrev_offset = byte_get (hdrptr, offset_size);
- hdrptr += offset_size;
-
- compunit.cu_pointer_size = byte_get (hdrptr, 1);
- hdrptr += 1;
- if ((do_loc || do_debug_loc || do_debug_ranges)
- && num_debug_info_entries == 0)
- {
- debug_information [unit].cu_offset = cu_offset;
- debug_information [unit].pointer_size
- = compunit.cu_pointer_size;
- debug_information [unit].base_address = 0;
- debug_information [unit].loc_offsets = NULL;
- debug_information [unit].have_frame_base = NULL;
- debug_information [unit].max_loc_offsets = 0;
- debug_information [unit].num_loc_offsets = 0;
- debug_information [unit].range_lists = NULL;
- debug_information [unit].max_range_lists= 0;
- debug_information [unit].num_range_lists = 0;
- }
-
- if (!do_loc)
- {
- printf (_(" Compilation Unit @ offset 0x%lx:\n"), cu_offset);
- printf (_(" Length: 0x%lx (%s)\n"), compunit.cu_length,
- initial_length_size == 8 ? "64-bit" : "32-bit");
- printf (_(" Version: %d\n"), compunit.cu_version);
- printf (_(" Abbrev Offset: %ld\n"), compunit.cu_abbrev_offset);
- printf (_(" Pointer Size: %d\n"), compunit.cu_pointer_size);
- }
-
- if (cu_offset + compunit.cu_length + initial_length_size
- > section->size)
- {
- warn (_("Debug info is corrupted, length of CU at %lx extends beyond end of section (length = %lx)\n"),
- cu_offset, compunit.cu_length);
- break;
- }
- tags = hdrptr;
- start += compunit.cu_length + initial_length_size;
-
- if (compunit.cu_version != 2 && compunit.cu_version != 3)
- {
- warn (_("CU at offset %lx contains corrupt or unsupported version number: %d.\n"),
- cu_offset, compunit.cu_version);
- continue;
- }
-
- free_abbrevs ();
-
- /* Process the abbrevs used by this compilation unit. DWARF
- sections under Mach-O have non-zero addresses. */
- if (compunit.cu_abbrev_offset >= debug_displays [abbrev].section.size)
- warn (_("Debug info is corrupted, abbrev offset (%lx) is larger than abbrev section size (%lx)\n"),
- (unsigned long) compunit.cu_abbrev_offset,
- (unsigned long) debug_displays [abbrev].section.size);
- else
- process_abbrev_section
- ((unsigned char *) debug_displays [abbrev].section.start
- + compunit.cu_abbrev_offset - debug_displays [abbrev].section.address,
- (unsigned char *) debug_displays [abbrev].section.start
- + debug_displays [abbrev].section.size);
-
- level = 0;
- while (tags < start)
- {
- unsigned int bytes_read;
- unsigned long abbrev_number;
- unsigned long die_offset;
- abbrev_entry *entry;
- abbrev_attr *attr;
-
- die_offset = tags - section_begin;
-
- abbrev_number = read_leb128 (tags, & bytes_read, 0);
- tags += bytes_read;
-
- /* A null DIE marks the end of a list of siblings. */
- if (abbrev_number == 0)
- {
- --level;
- if (level < 0)
- {
- static unsigned num_bogus_warns = 0;
-
- if (num_bogus_warns < 3)
- {
- warn (_("Bogus end-of-siblings marker detected at offset %lx in .debug_info section\n"),
- die_offset);
- num_bogus_warns ++;
- if (num_bogus_warns == 3)
- warn (_("Further warnings about bogus end-of-sibling markers suppressed\n"));
- }
- }
- continue;
- }
-
- if (!do_loc)
- printf (_(" <%d><%lx>: Abbrev Number: %lu"),
- level, die_offset, abbrev_number);
-
- /* Scan through the abbreviation list until we reach the
- correct entry. */
- for (entry = first_abbrev;
- entry && entry->entry != abbrev_number;
- entry = entry->next)
- continue;
-
- if (entry == NULL)
- {
- if (!do_loc)
- {
- printf ("\n");
- fflush (stdout);
- }
- warn (_("DIE at offset %lx refers to abbreviation number %lu which does not exist\n"),
- die_offset, abbrev_number);
- return 0;
- }
-
- if (!do_loc)
- printf (_(" (%s)\n"), get_TAG_name (entry->tag));
-
- switch (entry->tag)
- {
- default:
- need_base_address = 0;
- break;
- case DW_TAG_compile_unit:
- need_base_address = 1;
- break;
- case DW_TAG_entry_point:
- case DW_TAG_subprogram:
- need_base_address = 0;
- /* Assuming that there is no DW_AT_frame_base. */
- have_frame_base = 0;
- break;
- }
-
- for (attr = entry->first_attr; attr; attr = attr->next)
- {
- if (! do_loc)
- /* Show the offset from where the tag was extracted. */
- printf (" <%2lx>", (unsigned long)(tags - section_begin));
-
- tags = read_and_display_attr (attr->attribute,
- attr->form,
- tags, cu_offset,
- compunit.cu_pointer_size,
- offset_size,
- compunit.cu_version,
- debug_information + unit,
- do_loc, section);
- }
-
- if (entry->children)
- ++level;
- }
- }
-
- /* Set num_debug_info_entries here so that it can be used to check if
- we need to process .debug_loc and .debug_ranges sections. */
- if ((do_loc || do_debug_loc || do_debug_ranges)
- && num_debug_info_entries == 0)
- num_debug_info_entries = num_units;
-
- if (!do_loc)
- {
- printf ("\n");
- }
-
- return 1;
-}
-
-/* Locate and scan the .debug_info section in the file and record the pointer
- sizes and offsets for the compilation units in it. Usually an executable
- will have just one pointer size, but this is not guaranteed, and so we try
- not to make any assumptions. Returns zero upon failure, or the number of
- compilation units upon success. */
-
-static unsigned int
-load_debug_info (void * file)
-{
- /* Reset the last pointer size so that we can issue correct error
- messages if we are displaying the contents of more than one section. */
- last_pointer_size = 0;
- warned_about_missing_comp_units = FALSE;
-
- /* If we have already tried and failed to load the .debug_info
- section then do not bother to repear the task. */
- if (num_debug_info_entries == DEBUG_INFO_UNAVAILABLE)
- return 0;
-
- /* If we already have the information there is nothing else to do. */
- if (num_debug_info_entries > 0)
- return num_debug_info_entries;
-
- if (load_debug_section (info, file)
- && process_debug_info (&debug_displays [info].section, file, 1))
- return num_debug_info_entries;
-
- num_debug_info_entries = DEBUG_INFO_UNAVAILABLE;
- return 0;
-}
-
-static int
-display_debug_lines_raw (struct dwarf_section *section,
- unsigned char *data,
- unsigned char *end)
-{
- unsigned char *start = section->start;
-
- printf (_("Raw dump of debug contents of section %s:\n\n"),
- section->name);
-
- while (data < end)
- {
- DWARF2_Internal_LineInfo info;
- unsigned char *standard_opcodes;
- unsigned char *end_of_sequence;
- unsigned char *hdrptr;
- unsigned long hdroff;
- int initial_length_size;
- int offset_size;
- int i;
-
- hdrptr = data;
- hdroff = hdrptr - start;
-
- /* Check the length of the block. */
- info.li_length = byte_get (hdrptr, 4);
- hdrptr += 4;
-
- if (info.li_length == 0xffffffff)
- {
- /* This section is 64-bit DWARF 3. */
- info.li_length = byte_get (hdrptr, 8);
- hdrptr += 8;
- offset_size = 8;
- initial_length_size = 12;
- }
- else
- {
- offset_size = 4;
- initial_length_size = 4;
- }
-
- if (info.li_length + initial_length_size > section->size)
- {
- warn
- (_("The line info appears to be corrupt - the section is too small\n"));
- return 0;
- }
-
- /* Check its version number. */
- info.li_version = byte_get (hdrptr, 2);
- hdrptr += 2;
- if (info.li_version != 2 && info.li_version != 3)
- {
- warn (_("Only DWARF version 2 and 3 line info is currently supported.\n"));
- return 0;
- }
-
- info.li_prologue_length = byte_get (hdrptr, offset_size);
- hdrptr += offset_size;
- info.li_min_insn_length = byte_get (hdrptr, 1);
- hdrptr++;
- info.li_default_is_stmt = byte_get (hdrptr, 1);
- hdrptr++;
- info.li_line_base = byte_get (hdrptr, 1);
- hdrptr++;
- info.li_line_range = byte_get (hdrptr, 1);
- hdrptr++;
- info.li_opcode_base = byte_get (hdrptr, 1);
- hdrptr++;
-
- /* Sign extend the line base field. */
- info.li_line_base <<= 24;
- info.li_line_base >>= 24;
-
- printf (_(" Offset: 0x%lx\n"), hdroff);
- printf (_(" Length: %ld\n"), info.li_length);
- printf (_(" DWARF Version: %d\n"), info.li_version);
- printf (_(" Prologue Length: %d\n"), info.li_prologue_length);
- printf (_(" Minimum Instruction Length: %d\n"), info.li_min_insn_length);
- printf (_(" Initial value of 'is_stmt': %d\n"), info.li_default_is_stmt);
- printf (_(" Line Base: %d\n"), info.li_line_base);
- printf (_(" Line Range: %d\n"), info.li_line_range);
- printf (_(" Opcode Base: %d\n"), info.li_opcode_base);
-
- end_of_sequence = data + info.li_length + initial_length_size;
-
- reset_state_machine (info.li_default_is_stmt);
-
- /* Display the contents of the Opcodes table. */
- standard_opcodes = hdrptr;
-
- printf (_("\n Opcodes:\n"));
-
- for (i = 1; i < info.li_opcode_base; i++)
- printf (_(" Opcode %d has %d args\n"), i, standard_opcodes[i - 1]);
-
- /* Display the contents of the Directory table. */
- data = standard_opcodes + info.li_opcode_base - 1;
-
- if (*data == 0)
- printf (_("\n The Directory Table is empty.\n"));
- else
- {
- printf (_("\n The Directory Table:\n"));
-
- while (*data != 0)
- {
- printf (_(" %s\n"), data);
-
- data += strlen ((char *) data) + 1;
- }
- }
-
- /* Skip the NUL at the end of the table. */
- data++;
-
- /* Display the contents of the File Name table. */
- if (*data == 0)
- printf (_("\n The File Name Table is empty.\n"));
- else
- {
- printf (_("\n The File Name Table:\n"));
- printf (_(" Entry\tDir\tTime\tSize\tName\n"));
-
- while (*data != 0)
- {
- unsigned char *name;
- unsigned int bytes_read;
-
- printf (_(" %d\t"), ++state_machine_regs.last_file_entry);
- name = data;
-
- data += strlen ((char *) data) + 1;
-
- printf (_("%lu\t"), read_leb128 (data, & bytes_read, 0));
- data += bytes_read;
- printf (_("%lu\t"), read_leb128 (data, & bytes_read, 0));
- data += bytes_read;
- printf (_("%lu\t"), read_leb128 (data, & bytes_read, 0));
- data += bytes_read;
- printf (_("%s\n"), name);
- }
- }
-
- /* Skip the NUL at the end of the table. */
- data++;
-
- /* Now display the statements. */
- printf (_("\n Line Number Statements:\n"));
-
- while (data < end_of_sequence)
- {
- unsigned char op_code;
- int adv;
- unsigned long int uladv;
- unsigned int bytes_read;
-
- op_code = *data++;
-
- if (op_code >= info.li_opcode_base)
- {
- op_code -= info.li_opcode_base;
- uladv = (op_code / info.li_line_range) * info.li_min_insn_length;
- state_machine_regs.address += uladv;
- printf (_(" Special opcode %d: advance Address by %lu to 0x%lx"),
- op_code, uladv, state_machine_regs.address);
- adv = (op_code % info.li_line_range) + info.li_line_base;
- state_machine_regs.line += adv;
- printf (_(" and Line by %d to %d\n"),
- adv, state_machine_regs.line);
- }
- else switch (op_code)
- {
- case DW_LNS_extended_op:
- data += process_extended_line_op (data, info.li_default_is_stmt);
- break;
-
- case DW_LNS_copy:
- printf (_(" Copy\n"));
- break;
-
- case DW_LNS_advance_pc:
- uladv = read_leb128 (data, & bytes_read, 0);
- uladv *= info.li_min_insn_length;
- data += bytes_read;
- state_machine_regs.address += uladv;
- printf (_(" Advance PC by %lu to 0x%lx\n"), uladv,
- state_machine_regs.address);
- break;
-
- case DW_LNS_advance_line:
- adv = read_leb128 (data, & bytes_read, 1);
- data += bytes_read;
- state_machine_regs.line += adv;
- printf (_(" Advance Line by %d to %d\n"), adv,
- state_machine_regs.line);
- break;
-
- case DW_LNS_set_file:
- adv = read_leb128 (data, & bytes_read, 0);
- data += bytes_read;
- printf (_(" Set File Name to entry %d in the File Name Table\n"),
- adv);
- state_machine_regs.file = adv;
- break;
-
- case DW_LNS_set_column:
- uladv = read_leb128 (data, & bytes_read, 0);
- data += bytes_read;
- printf (_(" Set column to %lu\n"), uladv);
- state_machine_regs.column = uladv;
- break;
-
- case DW_LNS_negate_stmt:
- adv = state_machine_regs.is_stmt;
- adv = ! adv;
- printf (_(" Set is_stmt to %d\n"), adv);
- state_machine_regs.is_stmt = adv;
- break;
-
- case DW_LNS_set_basic_block:
- printf (_(" Set basic block\n"));
- state_machine_regs.basic_block = 1;
- break;
-
- case DW_LNS_const_add_pc:
- uladv = (((255 - info.li_opcode_base) / info.li_line_range)
- * info.li_min_insn_length);
- state_machine_regs.address += uladv;
- printf (_(" Advance PC by constant %lu to 0x%lx\n"), uladv,
- state_machine_regs.address);
- break;
-
- case DW_LNS_fixed_advance_pc:
- uladv = byte_get (data, 2);
- data += 2;
- state_machine_regs.address += uladv;
- printf (_(" Advance PC by fixed size amount %lu to 0x%lx\n"),
- uladv, state_machine_regs.address);
- break;
-
- case DW_LNS_set_prologue_end:
- printf (_(" Set prologue_end to true\n"));
- break;
-
- case DW_LNS_set_epilogue_begin:
- printf (_(" Set epilogue_begin to true\n"));
- break;
-
- case DW_LNS_set_isa:
- uladv = read_leb128 (data, & bytes_read, 0);
- data += bytes_read;
- printf (_(" Set ISA to %lu\n"), uladv);
- break;
-
- default:
- printf (_(" Unknown opcode %d with operands: "), op_code);
-
- for (i = standard_opcodes[op_code - 1]; i > 0 ; --i)
- {
- printf ("0x%lx%s", read_leb128 (data, &bytes_read, 0),
- i == 1 ? "" : ", ");
- data += bytes_read;
- }
- putchar ('\n');
- break;
- }
- }
- putchar ('\n');
- }
-
- return 1;
-}
-
-typedef struct
-{
- unsigned char *name;
- unsigned int directory_index;
- unsigned int modification_date;
- unsigned int length;
-} File_Entry;
-
-/* Output a decoded representation of the .debug_line section. */
-
-static int
-display_debug_lines_decoded (struct dwarf_section *section,
- unsigned char *data,
- unsigned char *end)
-{
- printf (_("Decoded dump of debug contents of section %s:\n\n"),
- section->name);
-
- while (data < end)
- {
- /* This loop amounts to one iteration per compilation unit. */
- DWARF2_Internal_LineInfo info;
- unsigned char *standard_opcodes;
- unsigned char *end_of_sequence;
- unsigned char *hdrptr;
- int initial_length_size;
- int offset_size;
- int i;
- File_Entry *file_table = NULL;
- unsigned char **directory_table = NULL;
- unsigned int prev_line = 0;
-
- hdrptr = data;
-
- /* Extract information from the Line Number Program Header.
- (section 6.2.4 in the Dwarf3 doc). */
-
- /* Get the length of this CU's line number information block. */
- info.li_length = byte_get (hdrptr, 4);
- hdrptr += 4;
-
- if (info.li_length == 0xffffffff)
- {
- /* This section is 64-bit DWARF 3. */
- info.li_length = byte_get (hdrptr, 8);
- hdrptr += 8;
- offset_size = 8;
- initial_length_size = 12;
- }
- else
- {
- offset_size = 4;
- initial_length_size = 4;
- }
-
- if (info.li_length + initial_length_size > section->size)
- {
- warn (_("The line info appears to be corrupt - "
- "the section is too small\n"));
- return 0;
- }
-
- /* Get this CU's Line Number Block version number. */
- info.li_version = byte_get (hdrptr, 2);
- hdrptr += 2;
- if (info.li_version != 2 && info.li_version != 3)
- {
- warn (_("Only DWARF version 2 and 3 line info is currently "
- "supported.\n"));
- return 0;
- }
-
- info.li_prologue_length = byte_get (hdrptr, offset_size);
- hdrptr += offset_size;
- info.li_min_insn_length = byte_get (hdrptr, 1);
- hdrptr++;
- info.li_default_is_stmt = byte_get (hdrptr, 1);
- hdrptr++;
- info.li_line_base = byte_get (hdrptr, 1);
- hdrptr++;
- info.li_line_range = byte_get (hdrptr, 1);
- hdrptr++;
- info.li_opcode_base = byte_get (hdrptr, 1);
- hdrptr++;
-
- /* Sign extend the line base field. */
- info.li_line_base <<= 24;
- info.li_line_base >>= 24;
-
- /* Find the end of this CU's Line Number Information Block. */
- end_of_sequence = data + info.li_length + initial_length_size;
-
- reset_state_machine (info.li_default_is_stmt);
-
- /* Save a pointer to the contents of the Opcodes table. */
- standard_opcodes = hdrptr;
-
- /* Traverse the Directory table just to count entries. */
- data = standard_opcodes + info.li_opcode_base - 1;
- if (*data != 0)
- {
- unsigned int n_directories = 0;
- unsigned char *ptr_directory_table = data;
- int i;
-
- while (*data != 0)
- {
- data += strlen ((char *) data) + 1;
- n_directories++;
- }
-
- /* Go through the directory table again to save the directories. */
- directory_table = xmalloc (n_directories * sizeof (unsigned char *));
-
- i = 0;
- while (*ptr_directory_table != 0)
- {
- directory_table[i] = ptr_directory_table;
- ptr_directory_table += strlen ((char *) ptr_directory_table) + 1;
- i++;
- }
- }
- /* Skip the NUL at the end of the table. */
- data++;
-
- /* Traverse the File Name table just to count the entries. */
- if (*data != 0)
- {
- unsigned int n_files = 0;
- unsigned char *ptr_file_name_table = data;
- int i;
-
- while (*data != 0)
- {
- unsigned int bytes_read;
-
- /* Skip Name, directory index, last modification time and length
- of file. */
- data += strlen ((char *) data) + 1;
- read_leb128 (data, & bytes_read, 0);
- data += bytes_read;
- read_leb128 (data, & bytes_read, 0);
- data += bytes_read;
- read_leb128 (data, & bytes_read, 0);
- data += bytes_read;
-
- n_files++;
- }
-
- /* Go through the file table again to save the strings. */
- file_table = xmalloc (n_files * sizeof (File_Entry));
-
- i = 0;
- while (*ptr_file_name_table != 0)
- {
- unsigned int bytes_read;
-
- file_table[i].name = ptr_file_name_table;
- ptr_file_name_table += strlen ((char *) ptr_file_name_table) + 1;
-
- /* We are not interested in directory, time or size. */
- file_table[i].directory_index = read_leb128 (ptr_file_name_table,
- & bytes_read, 0);
- ptr_file_name_table += bytes_read;
- file_table[i].modification_date = read_leb128 (ptr_file_name_table,
- & bytes_read, 0);
- ptr_file_name_table += bytes_read;
- file_table[i].length = read_leb128 (ptr_file_name_table, & bytes_read, 0);
- ptr_file_name_table += bytes_read;
- i++;
- }
- i = 0;
-
- /* Print the Compilation Unit's name and a header. */
- if (directory_table == NULL)
- {
- printf (_("CU: %s:\n"), file_table[0].name);
- printf (_("File name Line number Starting address\n"));
- }
- else
- {
- if (do_wide || strlen ((char *) directory_table[0]) < 76)
- {
- printf (_("CU: %s/%s:\n"), directory_table[0],
- file_table[0].name);
- }
- else
- {
- printf (_("%s:\n"), file_table[0].name);
- }
- printf (_("File name Line number Starting address\n"));
- }
- }
-
- /* Skip the NUL at the end of the table. */
- data++;
-
- /* This loop iterates through the Dwarf Line Number Program. */
- while (data < end_of_sequence)
- {
- unsigned char op_code;
- int adv;
- unsigned long int uladv;
- unsigned int bytes_read;
- int is_special_opcode = 0;
-
- op_code = *data++;
- prev_line = state_machine_regs.line;
-
- if (op_code >= info.li_opcode_base)
- {
- op_code -= info.li_opcode_base;
- uladv = (op_code / info.li_line_range) * info.li_min_insn_length;
- state_machine_regs.address += uladv;
-
- adv = (op_code % info.li_line_range) + info.li_line_base;
- state_machine_regs.line += adv;
- is_special_opcode = 1;
- }
- else switch (op_code)
- {
- case DW_LNS_extended_op:
- {
- unsigned int ext_op_code_len;
- unsigned int bytes_read;
- unsigned char ext_op_code;
- unsigned char *op_code_data = data;
-
- ext_op_code_len = read_leb128 (op_code_data, &bytes_read, 0);
- op_code_data += bytes_read;
-
- if (ext_op_code_len == 0)
- {
- warn (_("badly formed extended line op encountered!\n"));
- break;
- }
- ext_op_code_len += bytes_read;
- ext_op_code = *op_code_data++;
-
- switch (ext_op_code)
- {
- case DW_LNE_end_sequence:
- reset_state_machine (info.li_default_is_stmt);
- break;
- case DW_LNE_set_address:
- state_machine_regs.address =
- byte_get (op_code_data, ext_op_code_len - bytes_read - 1);
- break;
- case DW_LNE_define_file:
- {
- unsigned int dir_index = 0;
-
- ++state_machine_regs.last_file_entry;
- op_code_data += strlen ((char *) op_code_data) + 1;
- dir_index = read_leb128 (op_code_data, & bytes_read, 0);
- op_code_data += bytes_read;
- read_leb128 (op_code_data, & bytes_read, 0);
- op_code_data += bytes_read;
- read_leb128 (op_code_data, & bytes_read, 0);
-
- printf (_("%s:\n"), directory_table[dir_index]);
- break;
- }
- default:
- printf (_("UNKNOWN: length %d\n"), ext_op_code_len - bytes_read);
- break;
- }
- data += ext_op_code_len;
- break;
- }
- case DW_LNS_copy:
- break;
-
- case DW_LNS_advance_pc:
- uladv = read_leb128 (data, & bytes_read, 0);
- uladv *= info.li_min_insn_length;
- data += bytes_read;
- state_machine_regs.address += uladv;
- break;
-
- case DW_LNS_advance_line:
- adv = read_leb128 (data, & bytes_read, 1);
- data += bytes_read;
- state_machine_regs.line += adv;
- break;
-
- case DW_LNS_set_file:
- adv = read_leb128 (data, & bytes_read, 0);
- data += bytes_read;
- state_machine_regs.file = adv;
- if (file_table[state_machine_regs.file - 1].directory_index == 0)
- {
- /* If directory index is 0, that means current directory. */
- printf (_("\n./%s:[++]\n"),
- file_table[state_machine_regs.file - 1].name);
- }
- else
- {
- /* The directory index starts counting at 1. */
- printf (_("\n%s/%s:\n"),
- directory_table[file_table[state_machine_regs.file - 1].directory_index - 1],
- file_table[state_machine_regs.file - 1].name);
- }
- break;
-
- case DW_LNS_set_column:
- uladv = read_leb128 (data, & bytes_read, 0);
- data += bytes_read;
- state_machine_regs.column = uladv;
- break;
-
- case DW_LNS_negate_stmt:
- adv = state_machine_regs.is_stmt;
- adv = ! adv;
- state_machine_regs.is_stmt = adv;
- break;
-
- case DW_LNS_set_basic_block:
- state_machine_regs.basic_block = 1;
- break;
-
- case DW_LNS_const_add_pc:
- uladv = (((255 - info.li_opcode_base) / info.li_line_range)
- * info.li_min_insn_length);
- state_machine_regs.address += uladv;
- break;
-
- case DW_LNS_fixed_advance_pc:
- uladv = byte_get (data, 2);
- data += 2;
- state_machine_regs.address += uladv;
- break;
-
- case DW_LNS_set_prologue_end:
- break;
-
- case DW_LNS_set_epilogue_begin:
- break;
-
- case DW_LNS_set_isa:
- uladv = read_leb128 (data, & bytes_read, 0);
- data += bytes_read;
- printf (_(" Set ISA to %lu\n"), uladv);
- break;
-
- default:
- printf (_(" Unknown opcode %d with operands: "), op_code);
-
- for (i = standard_opcodes[op_code - 1]; i > 0 ; --i)
- {
- printf ("0x%lx%s", read_leb128 (data, &bytes_read, 0),
- i == 1 ? "" : ", ");
- data += bytes_read;
- }
- putchar ('\n');
- break;
- }
-
- /* Only Special opcodes, DW_LNS_copy and DW_LNE_end_sequence adds a row
- to the DWARF address/line matrix. */
- if ((is_special_opcode) || (op_code == DW_LNE_end_sequence)
- || (op_code == DW_LNS_copy))
- {
- const unsigned int MAX_FILENAME_LENGTH = 35;
- char *fileName = (char *)file_table[state_machine_regs.file - 1].name;
- char *newFileName = NULL;
- size_t fileNameLength = strlen (fileName);
-
- if ((fileNameLength > MAX_FILENAME_LENGTH) && (!do_wide))
- {
- newFileName = xmalloc (MAX_FILENAME_LENGTH + 1);
- /* Truncate file name */
- strncpy (newFileName,
- fileName + fileNameLength - MAX_FILENAME_LENGTH,
- MAX_FILENAME_LENGTH + 1);
- }
- else
- {
- newFileName = xmalloc (fileNameLength + 1);
- strncpy (newFileName, fileName, fileNameLength + 1);
- }
-
- if (!do_wide || (fileNameLength <= MAX_FILENAME_LENGTH))
- {
- printf (_("%-35s %11d %#18lx\n"), newFileName,
- state_machine_regs.line, state_machine_regs.address);
- }
- else
- {
- printf (_("%s %11d %#18lx\n"), newFileName,
- state_machine_regs.line, state_machine_regs.address);
- }
-
- if (op_code == DW_LNE_end_sequence)
- printf ("\n");
-
- free (newFileName);
- }
- }
- free (file_table);
- file_table = NULL;
- free (directory_table);
- directory_table = NULL;
- putchar ('\n');
- }
-
- return 1;
-}
-
-static int
-display_debug_lines (struct dwarf_section *section, void *file)
-{
- unsigned char *data = section->start;
- unsigned char *end = data + section->size;
- int retValRaw = 0;
- int retValDecoded = 0;
-
- if (load_debug_info (file) == 0)
- {
- warn (_("Unable to load/parse the .debug_info section, so cannot interpret the %s section.\n"),
- section->name);
- return 0;
- }
-
- if (do_debug_lines)
- retValRaw = display_debug_lines_raw (section, data, end);
-
- if (do_debug_lines_decoded)
- retValDecoded = display_debug_lines_decoded (section, data, end);
-
- if ((do_debug_lines && !retValRaw)
- || (do_debug_lines_decoded && !retValDecoded))
- return 0;
-
- return 1;
-}
-
-static debug_info *
-find_debug_info_for_offset (unsigned long offset)
-{
- unsigned int i;
-
- if (num_debug_info_entries == DEBUG_INFO_UNAVAILABLE)
- return NULL;
-
- for (i = 0; i < num_debug_info_entries; i++)
- if (debug_information[i].cu_offset == offset)
- return debug_information + i;
-
- return NULL;
-}
-
-static int
-display_debug_pubnames (struct dwarf_section *section,
- void *file ATTRIBUTE_UNUSED)
-{
- DWARF2_Internal_PubNames pubnames;
- unsigned char *start = section->start;
- unsigned char *end = start + section->size;
-
- /* It does not matter if this load fails,
- we test for that later on. */
- load_debug_info (file);
-
- printf (_("Contents of the %s section:\n\n"), section->name);
-
- while (start < end)
- {
- unsigned char *data;
- unsigned long offset;
- int offset_size, initial_length_size;
-
- data = start;
-
- pubnames.pn_length = byte_get (data, 4);
- data += 4;
- if (pubnames.pn_length == 0xffffffff)
- {
- pubnames.pn_length = byte_get (data, 8);
- data += 8;
- offset_size = 8;
- initial_length_size = 12;
- }
- else
- {
- offset_size = 4;
- initial_length_size = 4;
- }
-
- pubnames.pn_version = byte_get (data, 2);
- data += 2;
-
- pubnames.pn_offset = byte_get (data, offset_size);
- data += offset_size;
-
- if (num_debug_info_entries != DEBUG_INFO_UNAVAILABLE
- && num_debug_info_entries > 0
- && find_debug_info_for_offset (pubnames.pn_offset) == NULL)
- warn (_(".debug_info offset of 0x%lx in %s section does not point to a CU header.\n"),
- pubnames.pn_offset, section->name);
-
- pubnames.pn_size = byte_get (data, offset_size);
- data += offset_size;
-
- start += pubnames.pn_length + initial_length_size;
-
- if (pubnames.pn_version != 2 && pubnames.pn_version != 3)
- {
- static int warned = 0;
-
- if (! warned)
- {
- warn (_("Only DWARF 2 and 3 pubnames are currently supported\n"));
- warned = 1;
- }
-
- continue;
- }
-
- printf (_(" Length: %ld\n"),
- pubnames.pn_length);
- printf (_(" Version: %d\n"),
- pubnames.pn_version);
- printf (_(" Offset into .debug_info section: 0x%lx\n"),
- pubnames.pn_offset);
- printf (_(" Size of area in .debug_info section: %ld\n"),
- pubnames.pn_size);
-
- printf (_("\n Offset\tName\n"));
-
- do
- {
- offset = byte_get (data, offset_size);
-
- if (offset != 0)
- {
- data += offset_size;
- printf (" %-6ld\t\t%s\n", offset, data);
- data += strlen ((char *) data) + 1;
- }
- }
- while (offset != 0);
- }
-
- printf ("\n");
- return 1;
-}
-
-static int
-display_debug_macinfo (struct dwarf_section *section,
- void *file ATTRIBUTE_UNUSED)
-{
- unsigned char *start = section->start;
- unsigned char *end = start + section->size;
- unsigned char *curr = start;
- unsigned int bytes_read;
- enum dwarf_macinfo_record_type op;
-
- printf (_("Contents of the %s section:\n\n"), section->name);
-
- while (curr < end)
- {
- unsigned int lineno;
- const char *string;
-
- op = *curr;
- curr++;
-
- switch (op)
- {
- case DW_MACINFO_start_file:
- {
- unsigned int filenum;
-
- lineno = read_leb128 (curr, & bytes_read, 0);
- curr += bytes_read;
- filenum = read_leb128 (curr, & bytes_read, 0);
- curr += bytes_read;
-
- printf (_(" DW_MACINFO_start_file - lineno: %d filenum: %d\n"),
- lineno, filenum);
- }
- break;
-
- case DW_MACINFO_end_file:
- printf (_(" DW_MACINFO_end_file\n"));
- break;
-
- case DW_MACINFO_define:
- lineno = read_leb128 (curr, & bytes_read, 0);
- curr += bytes_read;
- string = (char *) curr;
- curr += strlen (string) + 1;
- printf (_(" DW_MACINFO_define - lineno : %d macro : %s\n"),
- lineno, string);
- break;
-
- case DW_MACINFO_undef:
- lineno = read_leb128 (curr, & bytes_read, 0);
- curr += bytes_read;
- string = (char *) curr;
- curr += strlen (string) + 1;
- printf (_(" DW_MACINFO_undef - lineno : %d macro : %s\n"),
- lineno, string);
- break;
-
- case DW_MACINFO_vendor_ext:
- {
- unsigned int constant;
-
- constant = read_leb128 (curr, & bytes_read, 0);
- curr += bytes_read;
- string = (char *) curr;
- curr += strlen (string) + 1;
- printf (_(" DW_MACINFO_vendor_ext - constant : %d string : %s\n"),
- constant, string);
- }
- break;
- }
- }
-
- return 1;
-}
-
-static int
-display_debug_abbrev (struct dwarf_section *section,
- void *file ATTRIBUTE_UNUSED)
-{
- abbrev_entry *entry;
- unsigned char *start = section->start;
- unsigned char *end = start + section->size;
-
- printf (_("Contents of the %s section:\n\n"), section->name);
-
- do
- {
- free_abbrevs ();
-
- start = process_abbrev_section (start, end);
-
- if (first_abbrev == NULL)
- continue;
-
- printf (_(" Number TAG\n"));
-
- for (entry = first_abbrev; entry; entry = entry->next)
- {
- abbrev_attr *attr;
-
- printf (_(" %ld %s [%s]\n"),
- entry->entry,
- get_TAG_name (entry->tag),
- entry->children ? _("has children") : _("no children"));
-
- for (attr = entry->first_attr; attr; attr = attr->next)
- printf (_(" %-18s %s\n"),
- get_AT_name (attr->attribute),
- get_FORM_name (attr->form));
- }
- }
- while (start);
-
- printf ("\n");
-
- return 1;
-}
-
-static int
-display_debug_loc (struct dwarf_section *section, void *file)
-{
- unsigned char *start = section->start;
- unsigned char *section_end;
- unsigned long bytes;
- unsigned char *section_begin = start;
- unsigned int num_loc_list = 0;
- unsigned long last_offset = 0;
- unsigned int first = 0;
- unsigned int i;
- unsigned int j;
- int seen_first_offset = 0;
- int use_debug_info = 1;
- unsigned char *next;
-
- bytes = section->size;
- section_end = start + bytes;
-
- if (bytes == 0)
- {
- printf (_("\nThe %s section is empty.\n"), section->name);
- return 0;
- }
-
- if (load_debug_info (file) == 0)
- {
- warn (_("Unable to load/parse the .debug_info section, so cannot interpret the %s section.\n"),
- section->name);
- return 0;
- }
-
- /* Check the order of location list in .debug_info section. If
- offsets of location lists are in the ascending order, we can
- use `debug_information' directly. */
- for (i = 0; i < num_debug_info_entries; i++)
- {
- unsigned int num;
-
- num = debug_information [i].num_loc_offsets;
- num_loc_list += num;
-
- /* Check if we can use `debug_information' directly. */
- if (use_debug_info && num != 0)
- {
- if (!seen_first_offset)
- {
- /* This is the first location list. */
- last_offset = debug_information [i].loc_offsets [0];
- first = i;
- seen_first_offset = 1;
- j = 1;
- }
- else
- j = 0;
-
- for (; j < num; j++)
- {
- if (last_offset >
- debug_information [i].loc_offsets [j])
- {
- use_debug_info = 0;
- break;
- }
- last_offset = debug_information [i].loc_offsets [j];
- }
- }
- }
-
- if (!use_debug_info)
- /* FIXME: Should we handle this case? */
- error (_("Location lists in .debug_info section aren't in ascending order!\n"));
-
- if (!seen_first_offset)
- error (_("No location lists in .debug_info section!\n"));
-
- /* DWARF sections under Mach-O have non-zero addresses. */
- if (debug_information [first].num_loc_offsets > 0
- && debug_information [first].loc_offsets [0] != section->address)
- warn (_("Location lists in %s section start at 0x%lx\n"),
- section->name, debug_information [first].loc_offsets [0]);
-
- printf (_("Contents of the %s section:\n\n"), section->name);
- printf (_(" Offset Begin End Expression\n"));
-
- seen_first_offset = 0;
- for (i = first; i < num_debug_info_entries; i++)
- {
- dwarf_vma begin;
- dwarf_vma end;
- unsigned short length;
- unsigned long offset;
- unsigned int pointer_size;
- unsigned long cu_offset;
- unsigned long base_address;
- int need_frame_base;
- int has_frame_base;
-
- pointer_size = debug_information [i].pointer_size;
- cu_offset = debug_information [i].cu_offset;
-
- for (j = 0; j < debug_information [i].num_loc_offsets; j++)
- {
- has_frame_base = debug_information [i].have_frame_base [j];
- /* DWARF sections under Mach-O have non-zero addresses. */
- offset = debug_information [i].loc_offsets [j] - section->address;
- next = section_begin + offset;
- base_address = debug_information [i].base_address;
-
- if (!seen_first_offset)
- seen_first_offset = 1;
- else
- {
- if (start < next)
- warn (_("There is a hole [0x%lx - 0x%lx] in .debug_loc section.\n"),
- (unsigned long) (start - section_begin),
- (unsigned long) (next - section_begin));
- else if (start > next)
- warn (_("There is an overlap [0x%lx - 0x%lx] in .debug_loc section.\n"),
- (unsigned long) (start - section_begin),
- (unsigned long) (next - section_begin));
- }
- start = next;
-
- if (offset >= bytes)
- {
- warn (_("Offset 0x%lx is bigger than .debug_loc section size.\n"),
- offset);
- continue;
- }
-
- while (1)
- {
- if (start + 2 * pointer_size > section_end)
- {
- warn (_("Location list starting at offset 0x%lx is not terminated.\n"),
- offset);
- break;
- }
-
- /* Note: we use sign extension here in order to be sure that
- we can detect the -1 escape value. Sign extension into the
- top 32 bits of a 32-bit address will not affect the values
- that we display since we always show hex values, and always
- the bottom 32-bits. */
- begin = byte_get_signed (start, pointer_size);
- start += pointer_size;
- end = byte_get_signed (start, pointer_size);
- start += pointer_size;
-
- printf (" %8.8lx ", offset);
-
- if (begin == 0 && end == 0)
- {
- printf (_("<End of list>\n"));
- break;
- }
-
- /* Check base address specifiers. */
- if (begin == (dwarf_vma) -1 && end != (dwarf_vma) -1)
- {
- base_address = end;
- print_dwarf_vma (begin, pointer_size);
- print_dwarf_vma (end, pointer_size);
- printf (_("(base address)\n"));
- continue;
- }
-
- if (start + 2 > section_end)
- {
- warn (_("Location list starting at offset 0x%lx is not terminated.\n"),
- offset);
- break;
- }
-
- length = byte_get (start, 2);
- start += 2;
-
- if (start + length > section_end)
- {
- warn (_("Location list starting at offset 0x%lx is not terminated.\n"),
- offset);
- break;
- }
-
- print_dwarf_vma (begin + base_address, pointer_size);
- print_dwarf_vma (end + base_address, pointer_size);
-
- putchar ('(');
- need_frame_base = decode_location_expression (start,
- pointer_size,
- length,
- cu_offset);
- putchar (')');
-
- if (need_frame_base && !has_frame_base)
- printf (_(" [without DW_AT_frame_base]"));
-
- if (begin == end)
- fputs (_(" (start == end)"), stdout);
- else if (begin > end)
- fputs (_(" (start > end)"), stdout);
-
- putchar ('\n');
-
- start += length;
- }
- }
- }
-
- if (start < section_end)
- warn (_("There are %ld unused bytes at the end of section %s\n"),
- (long) (section_end - start), section->name);
- return 1;
-}
-
-static int
-display_debug_str (struct dwarf_section *section,
- void *file ATTRIBUTE_UNUSED)
-{
- unsigned char *start = section->start;
- unsigned long bytes = section->size;
- dwarf_vma addr = section->address;
-
- if (bytes == 0)
- {
- printf (_("\nThe %s section is empty.\n"), section->name);
- return 0;
- }
-
- printf (_("Contents of the %s section:\n\n"), section->name);
-
- while (bytes)
- {
- int j;
- int k;
- int lbytes;
-
- lbytes = (bytes > 16 ? 16 : bytes);
-
- printf (" 0x%8.8lx ", (unsigned long) addr);
-
- for (j = 0; j < 16; j++)
- {
- if (j < lbytes)
- printf ("%2.2x", start[j]);
- else
- printf (" ");
-
- if ((j & 3) == 3)
- printf (" ");
- }
-
- for (j = 0; j < lbytes; j++)
- {
- k = start[j];
- if (k >= ' ' && k < 0x80)
- printf ("%c", k);
- else
- printf (".");
- }
-
- putchar ('\n');
-
- start += lbytes;
- addr += lbytes;
- bytes -= lbytes;
- }
-
- putchar ('\n');
-
- return 1;
-}
-
-static int
-display_debug_info (struct dwarf_section *section, void *file)
-{
- return process_debug_info (section, file, 0);
-}
-
-
-static int
-display_debug_aranges (struct dwarf_section *section,
- void *file ATTRIBUTE_UNUSED)
-{
- unsigned char *start = section->start;
- unsigned char *end = start + section->size;
-
- printf (_("The section %s contains:\n\n"), section->name);
-
- /* It does not matter if this load fails,
- we test for that later on. */
- load_debug_info (file);
-
- while (start < end)
- {
- unsigned char *hdrptr;
- DWARF2_Internal_ARange arange;
- unsigned char *ranges;
- dwarf_vma length;
- dwarf_vma address;
- unsigned char address_size;
- int excess;
- int offset_size;
- int initial_length_size;
-
- hdrptr = start;
-
- arange.ar_length = byte_get (hdrptr, 4);
- hdrptr += 4;
-
- if (arange.ar_length == 0xffffffff)
- {
- arange.ar_length = byte_get (hdrptr, 8);
- hdrptr += 8;
- offset_size = 8;
- initial_length_size = 12;
- }
- else
- {
- offset_size = 4;
- initial_length_size = 4;
- }
-
- arange.ar_version = byte_get (hdrptr, 2);
- hdrptr += 2;
-
- arange.ar_info_offset = byte_get (hdrptr, offset_size);
- hdrptr += offset_size;
-
- if (num_debug_info_entries != DEBUG_INFO_UNAVAILABLE
- && num_debug_info_entries > 0
- && find_debug_info_for_offset (arange.ar_info_offset) == NULL)
- warn (_(".debug_info offset of 0x%lx in %s section does not point to a CU header.\n"),
- arange.ar_info_offset, section->name);
-
- arange.ar_pointer_size = byte_get (hdrptr, 1);
- hdrptr += 1;
-
- arange.ar_segment_size = byte_get (hdrptr, 1);
- hdrptr += 1;
-
- if (arange.ar_version != 2 && arange.ar_version != 3)
- {
- warn (_("Only DWARF 2 and 3 aranges are currently supported.\n"));
- break;
- }
-
- printf (_(" Length: %ld\n"), arange.ar_length);
- printf (_(" Version: %d\n"), arange.ar_version);
- printf (_(" Offset into .debug_info: 0x%lx\n"), arange.ar_info_offset);
- printf (_(" Pointer Size: %d\n"), arange.ar_pointer_size);
- printf (_(" Segment Size: %d\n"), arange.ar_segment_size);
-
- address_size = arange.ar_pointer_size + arange.ar_segment_size;
-
- /* The DWARF spec does not require that the address size be a power
- of two, but we do. This will have to change if we ever encounter
- an uneven architecture. */
- if ((address_size & (address_size - 1)) != 0)
- {
- warn (_("Pointer size + Segment size is not a power of two.\n"));
- break;
- }
-
- if (address_size > 4)
- printf (_("\n Address Length\n"));
- else
- printf (_("\n Address Length\n"));
-
- ranges = hdrptr;
-
- /* Must pad to an alignment boundary that is twice the address size. */
- excess = (hdrptr - start) % (2 * address_size);
- if (excess)
- ranges += (2 * address_size) - excess;
-
- start += arange.ar_length + initial_length_size;
-
- while (ranges + 2 * address_size <= start)
- {
- address = byte_get (ranges, address_size);
-
- ranges += address_size;
-
- length = byte_get (ranges, address_size);
-
- ranges += address_size;
-
- print_dwarf_vma (address, address_size);
- print_dwarf_vma (length, address_size);
- putchar ('\n');
- }
- }
-
- printf ("\n");
-
- return 1;
-}
-
-static int
-display_debug_ranges (struct dwarf_section *section,
- void *file ATTRIBUTE_UNUSED)
-{
- unsigned char *start = section->start;
- unsigned char *section_end;
- unsigned long bytes;
- unsigned char *section_begin = start;
- unsigned int num_range_list = 0;
- unsigned long last_offset = 0;
- unsigned int first = 0;
- unsigned int i;
- unsigned int j;
- int seen_first_offset = 0;
- int use_debug_info = 1;
- unsigned char *next;
-
- bytes = section->size;
- section_end = start + bytes;
-
- if (bytes == 0)
- {
- printf (_("\nThe %s section is empty.\n"), section->name);
- return 0;
- }
-
- if (load_debug_info (file) == 0)
- {
- warn (_("Unable to load/parse the .debug_info section, so cannot interpret the %s section.\n"),
- section->name);
- return 0;
- }
-
- /* Check the order of range list in .debug_info section. If
- offsets of range lists are in the ascending order, we can
- use `debug_information' directly. */
- for (i = 0; i < num_debug_info_entries; i++)
- {
- unsigned int num;
-
- num = debug_information [i].num_range_lists;
- num_range_list += num;
-
- /* Check if we can use `debug_information' directly. */
- if (use_debug_info && num != 0)
- {
- if (!seen_first_offset)
- {
- /* This is the first range list. */
- last_offset = debug_information [i].range_lists [0];
- first = i;
- seen_first_offset = 1;
- j = 1;
- }
- else
- j = 0;
-
- for (; j < num; j++)
- {
- if (last_offset >
- debug_information [i].range_lists [j])
- {
- use_debug_info = 0;
- break;
- }
- last_offset = debug_information [i].range_lists [j];
- }
- }
- }
-
- if (!use_debug_info)
- /* FIXME: Should we handle this case? */
- error (_("Range lists in .debug_info section aren't in ascending order!\n"));
-
- if (!seen_first_offset)
- error (_("No range lists in .debug_info section!\n"));
-
- /* DWARF sections under Mach-O have non-zero addresses. */
- if (debug_information [first].num_range_lists > 0
- && debug_information [first].range_lists [0] != section->address)
- warn (_("Range lists in %s section start at 0x%lx\n"),
- section->name, debug_information [first].range_lists [0]);
-
- printf (_("Contents of the %s section:\n\n"), section->name);
- printf (_(" Offset Begin End\n"));
-
- seen_first_offset = 0;
- for (i = first; i < num_debug_info_entries; i++)
- {
- dwarf_vma begin;
- dwarf_vma end;
- unsigned long offset;
- unsigned int pointer_size;
- unsigned long base_address;
-
- pointer_size = debug_information [i].pointer_size;
-
- for (j = 0; j < debug_information [i].num_range_lists; j++)
- {
- /* DWARF sections under Mach-O have non-zero addresses. */
- offset = debug_information [i].range_lists [j] - section->address;
- next = section_begin + offset;
- base_address = debug_information [i].base_address;
-
- if (!seen_first_offset)
- seen_first_offset = 1;
- else
- {
- if (start < next)
- warn (_("There is a hole [0x%lx - 0x%lx] in %s section.\n"),
- (unsigned long) (start - section_begin),
- (unsigned long) (next - section_begin), section->name);
- else if (start > next)
- warn (_("There is an overlap [0x%lx - 0x%lx] in %s section.\n"),
- (unsigned long) (start - section_begin),
- (unsigned long) (next - section_begin), section->name);
- }
- start = next;
-
- while (1)
- {
- /* Note: we use sign extension here in order to be sure that
- we can detect the -1 escape value. Sign extension into the
- top 32 bits of a 32-bit address will not affect the values
- that we display since we always show hex values, and always
- the bottom 32-bits. */
- begin = byte_get_signed (start, pointer_size);
- start += pointer_size;
- end = byte_get_signed (start, pointer_size);
- start += pointer_size;
-
- printf (" %8.8lx ", offset);
-
- if (begin == 0 && end == 0)
- {
- printf (_("<End of list>\n"));
- break;
- }
-
- print_dwarf_vma (begin, pointer_size);
- print_dwarf_vma (end, pointer_size);
-
- /* Check base address specifiers. */
- if (begin == (dwarf_vma) -1 && end != (dwarf_vma) -1)
- {
- base_address = end;
- printf ("(base address)\n");
- continue;
- }
-
- if (begin == end)
- fputs (_("(start == end)"), stdout);
- else if (begin > end)
- fputs (_("(start > end)"), stdout);
-
- putchar ('\n');
- }
- }
- }
- putchar ('\n');
- return 1;
-}
-
-typedef struct Frame_Chunk
-{
- struct Frame_Chunk *next;
- unsigned char *chunk_start;
- int ncols;
- /* DW_CFA_{undefined,same_value,offset,register,unreferenced} */
- short int *col_type;
- int *col_offset;
- char *augmentation;
- unsigned int code_factor;
- int data_factor;
- unsigned long pc_begin;
- unsigned long pc_range;
- int cfa_reg;
- int cfa_offset;
- int ra;
- unsigned char fde_encoding;
- unsigned char cfa_exp;
-}
-Frame_Chunk;
-
-/* A marker for a col_type that means this column was never referenced
- in the frame info. */
-#define DW_CFA_unreferenced (-1)
-
-static void
-frame_need_space (Frame_Chunk *fc, int reg)
-{
- int prev = fc->ncols;
-
- if (reg < fc->ncols)
- return;
-
- fc->ncols = reg + 1;
- fc->col_type = xcrealloc (fc->col_type, fc->ncols, sizeof (short int));
- fc->col_offset = xcrealloc (fc->col_offset, fc->ncols, sizeof (int));
-
- while (prev < fc->ncols)
- {
- fc->col_type[prev] = DW_CFA_unreferenced;
- fc->col_offset[prev] = 0;
- prev++;
- }
-}
-
-static const char *const dwarf_regnames_i386[] =
-{
- "eax", "ecx", "edx", "ebx",
- "esp", "ebp", "esi", "edi",
- "eip", "eflags", NULL,
- "st0", "st1", "st2", "st3",
- "st4", "st5", "st6", "st7",
- NULL, NULL,
- "xmm0", "xmm1", "xmm2", "xmm3",
- "xmm4", "xmm5", "xmm6", "xmm7",
- "mm0", "mm1", "mm2", "mm3",
- "mm4", "mm5", "mm6", "mm7",
- "fcw", "fsw", "mxcsr",
- "es", "cs", "ss", "ds", "fs", "gs", NULL, NULL,
- "tr", "ldtr"
-};
-
-static const char *const dwarf_regnames_x86_64[] =
-{
- "rax", "rdx", "rcx", "rbx",
- "rsi", "rdi", "rbp", "rsp",
- "r8", "r9", "r10", "r11",
- "r12", "r13", "r14", "r15",
- "rip",
- "xmm0", "xmm1", "xmm2", "xmm3",
- "xmm4", "xmm5", "xmm6", "xmm7",
- "xmm8", "xmm9", "xmm10", "xmm11",
- "xmm12", "xmm13", "xmm14", "xmm15",
- "st0", "st1", "st2", "st3",
- "st4", "st5", "st6", "st7",
- "mm0", "mm1", "mm2", "mm3",
- "mm4", "mm5", "mm6", "mm7",
- "rflags",
- "es", "cs", "ss", "ds", "fs", "gs", NULL, NULL,
- "fs.base", "gs.base", NULL, NULL,
- "tr", "ldtr",
- "mxcsr", "fcw", "fsw"
-};
-
-static const char *const *dwarf_regnames;
-static unsigned int dwarf_regnames_count;
-
-void
-init_dwarf_regnames (unsigned int e_machine)
-{
- switch (e_machine)
- {
- case EM_386:
- case EM_486:
- dwarf_regnames = dwarf_regnames_i386;
- dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_i386);
- break;
-
- case EM_X86_64:
- dwarf_regnames = dwarf_regnames_x86_64;
- dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_x86_64);
- break;
-
- default:
- break;
- }
-}
-
-static const char *
-regname (unsigned int regno, int row)
-{
- static char reg[64];
- if (dwarf_regnames
- && regno < dwarf_regnames_count
- && dwarf_regnames [regno] != NULL)
- {
- if (row)
- return dwarf_regnames [regno];
- snprintf (reg, sizeof (reg), "r%d (%s)", regno,
- dwarf_regnames [regno]);
- }
- else
- snprintf (reg, sizeof (reg), "r%d", regno);
- return reg;
-}
-
-static void
-frame_display_row (Frame_Chunk *fc, int *need_col_headers, int *max_regs)
-{
- int r;
- char tmp[100];
-
- if (*max_regs < fc->ncols)
- *max_regs = fc->ncols;
-
- if (*need_col_headers)
- {
- static const char *loc = " LOC";
-
- *need_col_headers = 0;
-
- printf ("%-*s CFA ", eh_addr_size * 2, loc);
-
- for (r = 0; r < *max_regs; r++)
- if (fc->col_type[r] != DW_CFA_unreferenced)
- {
- if (r == fc->ra)
- printf ("ra ");
- else
- printf ("%-5s ", regname (r, 1));
- }
-
- printf ("\n");
- }
-
- printf ("%0*lx ", eh_addr_size * 2, fc->pc_begin);
- if (fc->cfa_exp)
- strcpy (tmp, "exp");
- else
- sprintf (tmp, "%s%+d", regname (fc->cfa_reg, 1), fc->cfa_offset);
- printf ("%-8s ", tmp);
-
- for (r = 0; r < fc->ncols; r++)
- {
- if (fc->col_type[r] != DW_CFA_unreferenced)
- {
- switch (fc->col_type[r])
- {
- case DW_CFA_undefined:
- strcpy (tmp, "u");
- break;
- case DW_CFA_same_value:
- strcpy (tmp, "s");
- break;
- case DW_CFA_offset:
- sprintf (tmp, "c%+d", fc->col_offset[r]);
- break;
- case DW_CFA_val_offset:
- sprintf (tmp, "v%+d", fc->col_offset[r]);
- break;
- case DW_CFA_register:
- sprintf (tmp, "%s", regname (fc->col_offset[r], 0));
- break;
- case DW_CFA_expression:
- strcpy (tmp, "exp");
- break;
- case DW_CFA_val_expression:
- strcpy (tmp, "vexp");
- break;
- default:
- strcpy (tmp, "n/a");
- break;
- }
- printf ("%-5s ", tmp);
- }
- }
- printf ("\n");
-}
-
-static int
-size_of_encoded_value (int encoding)
-{
- switch (encoding & 0x7)
- {
- default: /* ??? */
- case 0: return eh_addr_size;
- case 2: return 2;
- case 3: return 4;
- case 4: return 8;
- }
-}
-
-static dwarf_vma
-get_encoded_value (unsigned char *data, int encoding)
-{
- int size = size_of_encoded_value (encoding);
-
- if (encoding & DW_EH_PE_signed)
- return byte_get_signed (data, size);
- else
- return byte_get (data, size);
-}
-
-#define GET(N) byte_get (start, N); start += N
-#define LEB() read_leb128 (start, & length_return, 0); start += length_return
-#define SLEB() read_leb128 (start, & length_return, 1); start += length_return
-
-static int
-display_debug_frames (struct dwarf_section *section,
- void *file ATTRIBUTE_UNUSED)
-{
- unsigned char *start = section->start;
- unsigned char *end = start + section->size;
- unsigned char *section_start = start;
- Frame_Chunk *chunks = 0;
- Frame_Chunk *remembered_state = 0;
- Frame_Chunk *rs;
- int is_eh = strcmp (section->name, ".eh_frame") == 0;
- unsigned int length_return;
- int max_regs = 0;
-
- printf (_("The section %s contains:\n"), section->name);
-
- while (start < end)
- {
- unsigned char *saved_start;
- unsigned char *block_end;
- unsigned long length;
- unsigned long cie_id;
- Frame_Chunk *fc;
- Frame_Chunk *cie;
- int need_col_headers = 1;
- unsigned char *augmentation_data = NULL;
- unsigned long augmentation_data_len = 0;
- int encoded_ptr_size = eh_addr_size;
- int offset_size;
- int initial_length_size;
-
- saved_start = start;
- length = byte_get (start, 4); start += 4;
-
- if (length == 0)
- {
- printf ("\n%08lx ZERO terminator\n\n",
- (unsigned long)(saved_start - section_start));
- continue;
- }
-
- if (length == 0xffffffff)
- {
- length = byte_get (start, 8);
- start += 8;
- offset_size = 8;
- initial_length_size = 12;
- }
- else
- {
- offset_size = 4;
- initial_length_size = 4;
- }
-
- block_end = saved_start + length + initial_length_size;
- if (block_end > end)
- {
- warn ("Invalid length %#08lx in FDE at %#08lx\n",
- length, (unsigned long)(saved_start - section_start));
- block_end = end;
- }
- cie_id = byte_get (start, offset_size); start += offset_size;
-
- if (is_eh ? (cie_id == 0) : (cie_id == DW_CIE_ID))
- {
- int version;
-
- fc = xmalloc (sizeof (Frame_Chunk));
- memset (fc, 0, sizeof (Frame_Chunk));
-
- fc->next = chunks;
- chunks = fc;
- fc->chunk_start = saved_start;
- fc->ncols = 0;
- fc->col_type = xmalloc (sizeof (short int));
- fc->col_offset = xmalloc (sizeof (int));
- frame_need_space (fc, max_regs - 1);
-
- version = *start++;
-
- fc->augmentation = (char *) start;
- start = (unsigned char *) strchr ((char *) start, '\0') + 1;
-
- if (fc->augmentation[0] == 'z')
- {
- fc->code_factor = LEB ();
- fc->data_factor = SLEB ();
- if (version == 1)
- {
- fc->ra = GET (1);
- }
- else
- {
- fc->ra = LEB ();
- }
- augmentation_data_len = LEB ();
- augmentation_data = start;
- start += augmentation_data_len;
- }
- else if (strcmp (fc->augmentation, "eh") == 0)
- {
- start += eh_addr_size;
- fc->code_factor = LEB ();
- fc->data_factor = SLEB ();
- if (version == 1)
- {
- fc->ra = GET (1);
- }
- else
- {
- fc->ra = LEB ();
- }
- }
- else
- {
- fc->code_factor = LEB ();
- fc->data_factor = SLEB ();
- if (version == 1)
- {
- fc->ra = GET (1);
- }
- else
- {
- fc->ra = LEB ();
- }
- }
- cie = fc;
-
- if (do_debug_frames_interp)
- printf ("\n%08lx %08lx %08lx CIE \"%s\" cf=%d df=%d ra=%d\n",
- (unsigned long)(saved_start - section_start), length, cie_id,
- fc->augmentation, fc->code_factor, fc->data_factor,
- fc->ra);
- else
- {
- printf ("\n%08lx %08lx %08lx CIE\n",
- (unsigned long)(saved_start - section_start), length, cie_id);
- printf (" Version: %d\n", version);
- printf (" Augmentation: \"%s\"\n", fc->augmentation);
- printf (" Code alignment factor: %u\n", fc->code_factor);
- printf (" Data alignment factor: %d\n", fc->data_factor);
- printf (" Return address column: %d\n", fc->ra);
-
- if (augmentation_data_len)
- {
- unsigned long i;
- printf (" Augmentation data: ");
- for (i = 0; i < augmentation_data_len; ++i)
- printf (" %02x", augmentation_data[i]);
- putchar ('\n');
- }
- putchar ('\n');
- }
-
- if (augmentation_data_len)
- {
- unsigned char *p, *q;
- p = (unsigned char *) fc->augmentation + 1;
- q = augmentation_data;
-
- while (1)
- {
- if (*p == 'L')
- q++;
- else if (*p == 'P')
- q += 1 + size_of_encoded_value (*q);
- else if (*p == 'R')
- fc->fde_encoding = *q++;
- else
- break;
- p++;
- }
-
- if (fc->fde_encoding)
- encoded_ptr_size = size_of_encoded_value (fc->fde_encoding);
- }
-
- frame_need_space (fc, fc->ra);
- }
- else
- {
- unsigned char *look_for;
- static Frame_Chunk fde_fc;
-
- fc = & fde_fc;
- memset (fc, 0, sizeof (Frame_Chunk));
-
- look_for = is_eh ? start - 4 - cie_id : section_start + cie_id;
-
- for (cie = chunks; cie ; cie = cie->next)
- if (cie->chunk_start == look_for)
- break;
-
- if (!cie)
- {
- warn ("Invalid CIE pointer %#08lx in FDE at %#08lx\n",
- cie_id, (unsigned long)(saved_start - section_start));
- fc->ncols = 0;
- fc->col_type = xmalloc (sizeof (short int));
- fc->col_offset = xmalloc (sizeof (int));
- frame_need_space (fc, max_regs - 1);
- cie = fc;
- fc->augmentation = "";
- fc->fde_encoding = 0;
- }
- else
- {
- fc->ncols = cie->ncols;
- fc->col_type = xcmalloc (fc->ncols, sizeof (short int));
- fc->col_offset = xcmalloc (fc->ncols, sizeof (int));
- memcpy (fc->col_type, cie->col_type, fc->ncols * sizeof (short int));
- memcpy (fc->col_offset, cie->col_offset, fc->ncols * sizeof (int));
- fc->augmentation = cie->augmentation;
- fc->code_factor = cie->code_factor;
- fc->data_factor = cie->data_factor;
- fc->cfa_reg = cie->cfa_reg;
- fc->cfa_offset = cie->cfa_offset;
- fc->ra = cie->ra;
- frame_need_space (fc, max_regs - 1);
- fc->fde_encoding = cie->fde_encoding;
- }
-
- if (fc->fde_encoding)
- encoded_ptr_size = size_of_encoded_value (fc->fde_encoding);
-
- fc->pc_begin = get_encoded_value (start, fc->fde_encoding);
- if ((fc->fde_encoding & 0x70) == DW_EH_PE_pcrel)
- fc->pc_begin += section->address + (start - section_start);
- start += encoded_ptr_size;
- fc->pc_range = byte_get (start, encoded_ptr_size);
- start += encoded_ptr_size;
-
- if (cie->augmentation[0] == 'z')
- {
- augmentation_data_len = LEB ();
- augmentation_data = start;
- start += augmentation_data_len;
- }
-
- printf ("\n%08lx %08lx %08lx FDE cie=%08lx pc=%08lx..%08lx\n",
- (unsigned long)(saved_start - section_start), length, cie_id,
- (unsigned long)(cie->chunk_start - section_start),
- fc->pc_begin, fc->pc_begin + fc->pc_range);
- if (! do_debug_frames_interp && augmentation_data_len)
- {
- unsigned long i;
-
- printf (" Augmentation data: ");
- for (i = 0; i < augmentation_data_len; ++i)
- printf (" %02x", augmentation_data[i]);
- putchar ('\n');
- putchar ('\n');
- }
- }
-
- /* At this point, fc is the current chunk, cie (if any) is set, and
- we're about to interpret instructions for the chunk. */
- /* ??? At present we need to do this always, since this sizes the
- fc->col_type and fc->col_offset arrays, which we write into always.
- We should probably split the interpreted and non-interpreted bits
- into two different routines, since there's so much that doesn't
- really overlap between them. */
- if (1 || do_debug_frames_interp)
- {
- /* Start by making a pass over the chunk, allocating storage
- and taking note of what registers are used. */
- unsigned char *tmp = start;
-
- while (start < block_end)
- {
- unsigned op, opa;
- unsigned long reg, tmp;
-
- op = *start++;
- opa = op & 0x3f;
- if (op & 0xc0)
- op &= 0xc0;
-
- /* Warning: if you add any more cases to this switch, be
- sure to add them to the corresponding switch below. */
- switch (op)
- {
- case DW_CFA_advance_loc:
- break;
- case DW_CFA_offset:
- LEB ();
- frame_need_space (fc, opa);
- fc->col_type[opa] = DW_CFA_undefined;
- break;
- case DW_CFA_restore:
- frame_need_space (fc, opa);
- fc->col_type[opa] = DW_CFA_undefined;
- break;
- case DW_CFA_set_loc:
- start += encoded_ptr_size;
- break;
- case DW_CFA_advance_loc1:
- start += 1;
- break;
- case DW_CFA_advance_loc2:
- start += 2;
- break;
- case DW_CFA_advance_loc4:
- start += 4;
- break;
- case DW_CFA_offset_extended:
- case DW_CFA_val_offset:
- reg = LEB (); LEB ();
- frame_need_space (fc, reg);
- fc->col_type[reg] = DW_CFA_undefined;
- break;
- case DW_CFA_restore_extended:
- reg = LEB ();
- frame_need_space (fc, reg);
- fc->col_type[reg] = DW_CFA_undefined;
- break;
- case DW_CFA_undefined:
- reg = LEB ();
- frame_need_space (fc, reg);
- fc->col_type[reg] = DW_CFA_undefined;
- break;
- case DW_CFA_same_value:
- reg = LEB ();
- frame_need_space (fc, reg);
- fc->col_type[reg] = DW_CFA_undefined;
- break;
- case DW_CFA_register:
- reg = LEB (); LEB ();
- frame_need_space (fc, reg);
- fc->col_type[reg] = DW_CFA_undefined;
- break;
- case DW_CFA_def_cfa:
- LEB (); LEB ();
- break;
- case DW_CFA_def_cfa_register:
- LEB ();
- break;
- case DW_CFA_def_cfa_offset:
- LEB ();
- break;
- case DW_CFA_def_cfa_expression:
- tmp = LEB ();
- start += tmp;
- break;
- case DW_CFA_expression:
- case DW_CFA_val_expression:
- reg = LEB ();
- tmp = LEB ();
- start += tmp;
- frame_need_space (fc, reg);
- fc->col_type[reg] = DW_CFA_undefined;
- break;
- case DW_CFA_offset_extended_sf:
- case DW_CFA_val_offset_sf:
- reg = LEB (); SLEB ();
- frame_need_space (fc, reg);
- fc->col_type[reg] = DW_CFA_undefined;
- break;
- case DW_CFA_def_cfa_sf:
- LEB (); SLEB ();
- break;
- case DW_CFA_def_cfa_offset_sf:
- SLEB ();
- break;
- case DW_CFA_MIPS_advance_loc8:
- start += 8;
- break;
- case DW_CFA_GNU_args_size:
- LEB ();
- break;
- case DW_CFA_GNU_negative_offset_extended:
- reg = LEB (); LEB ();
- frame_need_space (fc, reg);
- fc->col_type[reg] = DW_CFA_undefined;
-
- default:
- break;
- }
- }
- start = tmp;
- }
-
- /* Now we know what registers are used, make a second pass over
- the chunk, this time actually printing out the info. */
-
- while (start < block_end)
- {
- unsigned op, opa;
- unsigned long ul, reg, roffs;
- long l, ofs;
- dwarf_vma vma;
-
- op = *start++;
- opa = op & 0x3f;
- if (op & 0xc0)
- op &= 0xc0;
-
- /* Warning: if you add any more cases to this switch, be
- sure to add them to the corresponding switch above. */
- switch (op)
- {
- case DW_CFA_advance_loc:
- if (do_debug_frames_interp)
- frame_display_row (fc, &need_col_headers, &max_regs);
- else
- printf (" DW_CFA_advance_loc: %d to %08lx\n",
- opa * fc->code_factor,
- fc->pc_begin + opa * fc->code_factor);
- fc->pc_begin += opa * fc->code_factor;
- break;
-
- case DW_CFA_offset:
- roffs = LEB ();
- if (! do_debug_frames_interp)
- printf (" DW_CFA_offset: %s at cfa%+ld\n",
- regname (opa, 0), roffs * fc->data_factor);
- fc->col_type[opa] = DW_CFA_offset;
- fc->col_offset[opa] = roffs * fc->data_factor;
- break;
-
- case DW_CFA_restore:
- if (! do_debug_frames_interp)
- printf (" DW_CFA_restore: %s\n", regname (opa, 0));
- fc->col_type[opa] = cie->col_type[opa];
- fc->col_offset[opa] = cie->col_offset[opa];
- break;
-
- case DW_CFA_set_loc:
- vma = get_encoded_value (start, fc->fde_encoding);
- if ((fc->fde_encoding & 0x70) == DW_EH_PE_pcrel)
- vma += section->address + (start - section_start);
- start += encoded_ptr_size;
- if (do_debug_frames_interp)
- frame_display_row (fc, &need_col_headers, &max_regs);
- else
- printf (" DW_CFA_set_loc: %08lx\n", (unsigned long)vma);
- fc->pc_begin = vma;
- break;
-
- case DW_CFA_advance_loc1:
- ofs = byte_get (start, 1); start += 1;
- if (do_debug_frames_interp)
- frame_display_row (fc, &need_col_headers, &max_regs);
- else
- printf (" DW_CFA_advance_loc1: %ld to %08lx\n",
- ofs * fc->code_factor,
- fc->pc_begin + ofs * fc->code_factor);
- fc->pc_begin += ofs * fc->code_factor;
- break;
-
- case DW_CFA_advance_loc2:
- ofs = byte_get (start, 2); start += 2;
- if (do_debug_frames_interp)
- frame_display_row (fc, &need_col_headers, &max_regs);
- else
- printf (" DW_CFA_advance_loc2: %ld to %08lx\n",
- ofs * fc->code_factor,
- fc->pc_begin + ofs * fc->code_factor);
- fc->pc_begin += ofs * fc->code_factor;
- break;
-
- case DW_CFA_advance_loc4:
- ofs = byte_get (start, 4); start += 4;
- if (do_debug_frames_interp)
- frame_display_row (fc, &need_col_headers, &max_regs);
- else
- printf (" DW_CFA_advance_loc4: %ld to %08lx\n",
- ofs * fc->code_factor,
- fc->pc_begin + ofs * fc->code_factor);
- fc->pc_begin += ofs * fc->code_factor;
- break;
-
- case DW_CFA_offset_extended:
- reg = LEB ();
- roffs = LEB ();
- if (! do_debug_frames_interp)
- printf (" DW_CFA_offset_extended: %s at cfa%+ld\n",
- regname (reg, 0), roffs * fc->data_factor);
- fc->col_type[reg] = DW_CFA_offset;
- fc->col_offset[reg] = roffs * fc->data_factor;
- break;
-
- case DW_CFA_val_offset:
- reg = LEB ();
- roffs = LEB ();
- if (! do_debug_frames_interp)
- printf (" DW_CFA_val_offset: %s at cfa%+ld\n",
- regname (reg, 0), roffs * fc->data_factor);
- fc->col_type[reg] = DW_CFA_val_offset;
- fc->col_offset[reg] = roffs * fc->data_factor;
- break;
-
- case DW_CFA_restore_extended:
- reg = LEB ();
- if (! do_debug_frames_interp)
- printf (" DW_CFA_restore_extended: %s\n",
- regname (reg, 0));
- fc->col_type[reg] = cie->col_type[reg];
- fc->col_offset[reg] = cie->col_offset[reg];
- break;
-
- case DW_CFA_undefined:
- reg = LEB ();
- if (! do_debug_frames_interp)
- printf (" DW_CFA_undefined: %s\n", regname (reg, 0));
- fc->col_type[reg] = DW_CFA_undefined;
- fc->col_offset[reg] = 0;
- break;
-
- case DW_CFA_same_value:
- reg = LEB ();
- if (! do_debug_frames_interp)
- printf (" DW_CFA_same_value: %s\n", regname (reg, 0));
- fc->col_type[reg] = DW_CFA_same_value;
- fc->col_offset[reg] = 0;
- break;
-
- case DW_CFA_register:
- reg = LEB ();
- roffs = LEB ();
- if (! do_debug_frames_interp)
- {
- printf (" DW_CFA_register: %s in ",
- regname (reg, 0));
- puts (regname (roffs, 0));
- }
- fc->col_type[reg] = DW_CFA_register;
- fc->col_offset[reg] = roffs;
- break;
-
- case DW_CFA_remember_state:
- if (! do_debug_frames_interp)
- printf (" DW_CFA_remember_state\n");
- rs = xmalloc (sizeof (Frame_Chunk));
- rs->ncols = fc->ncols;
- rs->col_type = xcmalloc (rs->ncols, sizeof (short int));
- rs->col_offset = xcmalloc (rs->ncols, sizeof (int));
- memcpy (rs->col_type, fc->col_type, rs->ncols);
- memcpy (rs->col_offset, fc->col_offset, rs->ncols * sizeof (int));
- rs->next = remembered_state;
- remembered_state = rs;
- break;
-
- case DW_CFA_restore_state:
- if (! do_debug_frames_interp)
- printf (" DW_CFA_restore_state\n");
- rs = remembered_state;
- if (rs)
- {
- remembered_state = rs->next;
- frame_need_space (fc, rs->ncols - 1);
- memcpy (fc->col_type, rs->col_type, rs->ncols);
- memcpy (fc->col_offset, rs->col_offset,
- rs->ncols * sizeof (int));
- free (rs->col_type);
- free (rs->col_offset);
- free (rs);
- }
- else if (do_debug_frames_interp)
- printf ("Mismatched DW_CFA_restore_state\n");
- break;
-
- case DW_CFA_def_cfa:
- fc->cfa_reg = LEB ();
- fc->cfa_offset = LEB ();
- fc->cfa_exp = 0;
- if (! do_debug_frames_interp)
- printf (" DW_CFA_def_cfa: %s ofs %d\n",
- regname (fc->cfa_reg, 0), fc->cfa_offset);
- break;
-
- case DW_CFA_def_cfa_register:
- fc->cfa_reg = LEB ();
- fc->cfa_exp = 0;
- if (! do_debug_frames_interp)
- printf (" DW_CFA_def_cfa_register: %s\n",
- regname (fc->cfa_reg, 0));
- break;
-
- case DW_CFA_def_cfa_offset:
- fc->cfa_offset = LEB ();
- if (! do_debug_frames_interp)
- printf (" DW_CFA_def_cfa_offset: %d\n", fc->cfa_offset);
- break;
-
- case DW_CFA_nop:
- if (! do_debug_frames_interp)
- printf (" DW_CFA_nop\n");
- break;
-
- case DW_CFA_def_cfa_expression:
- ul = LEB ();
- if (! do_debug_frames_interp)
- {
- printf (" DW_CFA_def_cfa_expression (");
- decode_location_expression (start, eh_addr_size, ul, 0);
- printf (")\n");
- }
- fc->cfa_exp = 1;
- start += ul;
- break;
-
- case DW_CFA_expression:
- reg = LEB ();
- ul = LEB ();
- if (! do_debug_frames_interp)
- {
- printf (" DW_CFA_expression: %s (",
- regname (reg, 0));
- decode_location_expression (start, eh_addr_size,
- ul, 0);
- printf (")\n");
- }
- fc->col_type[reg] = DW_CFA_expression;
- start += ul;
- break;
-
- case DW_CFA_val_expression:
- reg = LEB ();
- ul = LEB ();
- if (! do_debug_frames_interp)
- {
- printf (" DW_CFA_val_expression: %s (",
- regname (reg, 0));
- decode_location_expression (start, eh_addr_size, ul, 0);
- printf (")\n");
- }
- fc->col_type[reg] = DW_CFA_val_expression;
- start += ul;
- break;
-
- case DW_CFA_offset_extended_sf:
- reg = LEB ();
- l = SLEB ();
- frame_need_space (fc, reg);
- if (! do_debug_frames_interp)
- printf (" DW_CFA_offset_extended_sf: %s at cfa%+ld\n",
- regname (reg, 0), l * fc->data_factor);
- fc->col_type[reg] = DW_CFA_offset;
- fc->col_offset[reg] = l * fc->data_factor;
- break;
-
- case DW_CFA_val_offset_sf:
- reg = LEB ();
- l = SLEB ();
- frame_need_space (fc, reg);
- if (! do_debug_frames_interp)
- printf (" DW_CFA_val_offset_sf: %s at cfa%+ld\n",
- regname (reg, 0), l * fc->data_factor);
- fc->col_type[reg] = DW_CFA_val_offset;
- fc->col_offset[reg] = l * fc->data_factor;
- break;
-
- case DW_CFA_def_cfa_sf:
- fc->cfa_reg = LEB ();
- fc->cfa_offset = SLEB ();
- fc->cfa_offset = fc->cfa_offset * fc->data_factor;
- fc->cfa_exp = 0;
- if (! do_debug_frames_interp)
- printf (" DW_CFA_def_cfa_sf: %s ofs %d\n",
- regname (fc->cfa_reg, 0), fc->cfa_offset);
- break;
-
- case DW_CFA_def_cfa_offset_sf:
- fc->cfa_offset = SLEB ();
- fc->cfa_offset = fc->cfa_offset * fc->data_factor;
- if (! do_debug_frames_interp)
- printf (" DW_CFA_def_cfa_offset_sf: %d\n", fc->cfa_offset);
- break;
-
- case DW_CFA_MIPS_advance_loc8:
- ofs = byte_get (start, 8); start += 8;
- if (do_debug_frames_interp)
- frame_display_row (fc, &need_col_headers, &max_regs);
- else
- printf (" DW_CFA_MIPS_advance_loc8: %ld to %08lx\n",
- ofs * fc->code_factor,
- fc->pc_begin + ofs * fc->code_factor);
- fc->pc_begin += ofs * fc->code_factor;
- break;
-
- case DW_CFA_GNU_window_save:
- if (! do_debug_frames_interp)
- printf (" DW_CFA_GNU_window_save\n");
- break;
-
- case DW_CFA_GNU_args_size:
- ul = LEB ();
- if (! do_debug_frames_interp)
- printf (" DW_CFA_GNU_args_size: %ld\n", ul);
- break;
-
- case DW_CFA_GNU_negative_offset_extended:
- reg = LEB ();
- l = - LEB ();
- frame_need_space (fc, reg);
- if (! do_debug_frames_interp)
- printf (" DW_CFA_GNU_negative_offset_extended: %s at cfa%+ld\n",
- regname (reg, 0), l * fc->data_factor);
- fc->col_type[reg] = DW_CFA_offset;
- fc->col_offset[reg] = l * fc->data_factor;
- break;
-
- default:
- if (op >= DW_CFA_lo_user && op <= DW_CFA_hi_user)
- printf (_(" DW_CFA_??? (User defined call frame op: %#x)\n"), op);
- else
- warn (_("unsupported or unknown Dwarf Call Frame Instruction number: %#x\n"), op);
- start = block_end;
- }
- }
-
- if (do_debug_frames_interp)
- frame_display_row (fc, &need_col_headers, &max_regs);
-
- start = block_end;
- }
-
- printf ("\n");
-
- return 1;
-}
-
-#undef GET
-#undef LEB
-#undef SLEB
-
-static int
-display_debug_not_supported (struct dwarf_section *section,
- void *file ATTRIBUTE_UNUSED)
-{
- printf (_("Displaying the debug contents of section %s is not yet supported.\n"),
- section->name);
-
- return 1;
-}
-
-void *
-cmalloc (size_t nmemb, size_t size)
-{
- /* Check for overflow. */
- if (nmemb >= ~(size_t) 0 / size)
- return NULL;
- else
- return malloc (nmemb * size);
-}
-
-void *
-xcmalloc (size_t nmemb, size_t size)
-{
- /* Check for overflow. */
- if (nmemb >= ~(size_t) 0 / size)
- return NULL;
- else
- return xmalloc (nmemb * size);
-}
-
-void *
-xcrealloc (void *ptr, size_t nmemb, size_t size)
-{
- /* Check for overflow. */
- if (nmemb >= ~(size_t) 0 / size)
- return NULL;
- else
- return xrealloc (ptr, nmemb * size);
-}
-
-void
-error (const char *message, ...)
-{
- va_list args;
-
- va_start (args, message);
- fprintf (stderr, _("%s: Error: "), program_name);
- vfprintf (stderr, message, args);
- va_end (args);
-}
-
-void
-warn (const char *message, ...)
-{
- va_list args;
-
- va_start (args, message);
- fprintf (stderr, _("%s: Warning: "), program_name);
- vfprintf (stderr, message, args);
- va_end (args);
-}
-
-void
-free_debug_memory (void)
-{
- enum dwarf_section_display_enum i;
-
- free_abbrevs ();
-
- for (i = 0; i < max; i++)
- free_debug_section (i);
-
- if (debug_information != NULL)
- {
- if (num_debug_info_entries != DEBUG_INFO_UNAVAILABLE)
- {
- for (i = 0; i < num_debug_info_entries; i++)
- {
- if (!debug_information [i].max_loc_offsets)
- {
- free (debug_information [i].loc_offsets);
- free (debug_information [i].have_frame_base);
- }
- if (!debug_information [i].max_range_lists)
- free (debug_information [i].range_lists);
- }
- }
-
- free (debug_information);
- debug_information = NULL;
- num_debug_info_entries = 0;
- }
-}
-
-struct dwarf_section_display debug_displays[] =
-{
- { { ".debug_abbrev", ".zdebug_abbrev", NULL, NULL, 0, 0 },
- display_debug_abbrev, 0, 0 },
- { { ".debug_aranges", ".zdebug_aranges", NULL, NULL, 0, 0 },
- display_debug_aranges, 0, 0 },
- { { ".debug_frame", ".zdebug_frame", NULL, NULL, 0, 0 },
- display_debug_frames, 1, 0 },
- { { ".debug_info", ".zdebug_info", NULL, NULL, 0, 0 },
- display_debug_info, 1, 0 },
- { { ".debug_line", ".zdebug_line", NULL, NULL, 0, 0 },
- display_debug_lines, 0, 0 },
- { { ".debug_pubnames", ".zdebug_pubnames", NULL, NULL, 0, 0 },
- display_debug_pubnames, 0, 0 },
- { { ".eh_frame", "", NULL, NULL, 0, 0 },
- display_debug_frames, 1, 1 },
- { { ".debug_macinfo", ".zdebug_macinfo", NULL, NULL, 0, 0 },
- display_debug_macinfo, 0, 0 },
- { { ".debug_str", ".zdebug_str", NULL, NULL, 0, 0 },
- display_debug_str, 0, 0 },
- { { ".debug_loc", ".zdebug_loc", NULL, NULL, 0, 0 },
- display_debug_loc, 0, 0 },
- { { ".debug_pubtypes", ".zdebug_pubtypes", NULL, NULL, 0, 0 },
- display_debug_pubnames, 0, 0 },
- { { ".debug_ranges", ".zdebug_ranges", NULL, NULL, 0, 0 },
- display_debug_ranges, 0, 0 },
- { { ".debug_static_func", ".zdebug_static_func", NULL, NULL, 0, 0 },
- display_debug_not_supported, 0, 0 },
- { { ".debug_static_vars", ".zdebug_static_vars", NULL, NULL, 0, 0 },
- display_debug_not_supported, 0, 0 },
- { { ".debug_types", ".zdebug_types", NULL, NULL, 0, 0 },
- display_debug_not_supported, 0, 0 },
- { { ".debug_weaknames", ".zdebug_weaknames", NULL, NULL, 0, 0 },
- display_debug_not_supported, 0, 0 }
-};
diff --git a/binutils/objdump.c b/binutils/objdump.c
deleted file mode 100644
index d4c32c03a24..00000000000
--- a/binutils/objdump.c
+++ /dev/null
@@ -1,3395 +0,0 @@
-/* objdump.c -- dump information about an object file.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
-
- This file is part of GNU Binutils.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
-
-
-/* Objdump overview.
-
- Objdump displays information about one or more object files, either on
- their own, or inside libraries. It is commonly used as a disassembler,
- but it can also display information about file headers, symbol tables,
- relocations, debugging directives and more.
-
- The flow of execution is as follows:
-
- 1. Command line arguments are checked for control switches and the
- information to be displayed is selected.
-
- 2. Any remaining arguments are assumed to be object files, and they are
- processed in order by display_bfd(). If the file is an archive each
- of its elements is processed in turn.
-
- 3. The file's target architecture and binary file format are determined
- by bfd_check_format(). If they are recognised, then dump_bfd() is
- called.
-
- 4. dump_bfd() in turn calls separate functions to display the requested
- item(s) of information(s). For example disassemble_data() is called if
- a disassembly has been requested.
-
- When disassembling the code loops through blocks of instructions bounded
- by symbols, calling disassemble_bytes() on each block. The actual
- disassembling is done by the libopcodes library, via a function pointer
- supplied by the disassembler() function. */
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "elf-bfd.h"
-#include "progress.h"
-#include "bucomm.h"
-#include "dwarf.h"
-#include "getopt.h"
-#include "safe-ctype.h"
-#include "dis-asm.h"
-#include "libiberty.h"
-#include "demangle.h"
-#include "debug.h"
-#include "budbg.h"
-
-#ifdef HAVE_MMAP
-#include <sys/mman.h>
-#endif
-
-#include <sys/stat.h>
-
-/* Internal headers for the ELF .stab-dump code - sorry. */
-#define BYTES_IN_WORD 32
-#include "aout/aout64.h"
-
-/* Exit status. */
-static int exit_status = 0;
-
-static char *default_target = NULL; /* Default at runtime. */
-
-/* The following variables are set based on arguments passed on the
- command line. */
-static int show_version = 0; /* Show the version number. */
-static int dump_section_contents; /* -s */
-static int dump_section_headers; /* -h */
-static bfd_boolean dump_file_header; /* -f */
-static int dump_symtab; /* -t */
-static int dump_dynamic_symtab; /* -T */
-static int dump_reloc_info; /* -r */
-static int dump_dynamic_reloc_info; /* -R */
-static int dump_ar_hdrs; /* -a */
-static int dump_private_headers; /* -p */
-static int prefix_addresses; /* --prefix-addresses */
-static int with_line_numbers; /* -l */
-static bfd_boolean with_source_code; /* -S */
-static int show_raw_insn; /* --show-raw-insn */
-static int dump_dwarf_section_info; /* --dwarf */
-static int dump_stab_section_info; /* --stabs */
-static int do_demangle; /* -C, --demangle */
-static bfd_boolean disassemble; /* -d */
-static bfd_boolean disassemble_all; /* -D */
-static int disassemble_zeroes; /* --disassemble-zeroes */
-static bfd_boolean formats_info; /* -i */
-static int wide_output; /* -w */
-static bfd_vma start_address = (bfd_vma) -1; /* --start-address */
-static bfd_vma stop_address = (bfd_vma) -1; /* --stop-address */
-static int dump_debugging; /* --debugging */
-static int dump_debugging_tags; /* --debugging-tags */
-static int dump_special_syms = 0; /* --special-syms */
-static bfd_vma adjust_section_vma = 0; /* --adjust-vma */
-static int file_start_context = 0; /* --file-start-context */
-static bfd_boolean display_file_offsets;/* -F */
-
-/* Pointer to an array of section names provided by
- one or more "-j secname" command line options. */
-static char **only;
-/* The total number of slots in the only[] array. */
-static size_t only_size = 0;
-/* The number of occupied slots in the only[] array. */
-static size_t only_used = 0;
-
-/* Variables for handling include file path table. */
-static const char **include_paths;
-static int include_path_count;
-
-/* Extra info to pass to the section disassembler and address printing
- function. */
-struct objdump_disasm_info
-{
- bfd * abfd;
- asection * sec;
- bfd_boolean require_sec;
- arelent ** dynrelbuf;
- long dynrelcount;
- disassembler_ftype disassemble_fn;
- arelent * reloc;
-};
-
-/* Architecture to disassemble for, or default if NULL. */
-static char *machine = NULL;
-
-/* Target specific options to the disassembler. */
-static char *disassembler_options = NULL;
-
-/* Endianness to disassemble for, or default if BFD_ENDIAN_UNKNOWN. */
-static enum bfd_endian endian = BFD_ENDIAN_UNKNOWN;
-
-/* The symbol table. */
-static asymbol **syms;
-
-/* Number of symbols in `syms'. */
-static long symcount = 0;
-
-/* The sorted symbol table. */
-static asymbol **sorted_syms;
-
-/* Number of symbols in `sorted_syms'. */
-static long sorted_symcount = 0;
-
-/* The dynamic symbol table. */
-static asymbol **dynsyms;
-
-/* The synthetic symbol table. */
-static asymbol *synthsyms;
-static long synthcount = 0;
-
-/* Number of symbols in `dynsyms'. */
-static long dynsymcount = 0;
-
-static bfd_byte *stabs;
-static bfd_size_type stab_size;
-
-static char *strtab;
-static bfd_size_type stabstr_size;
-
-static bfd_boolean is_relocatable = FALSE;
-
-static void
-usage (FILE *stream, int status)
-{
- fprintf (stream, _("Usage: %s <option(s)> <file(s)>\n"), program_name);
- fprintf (stream, _(" Display information from object <file(s)>.\n"));
- fprintf (stream, _(" At least one of the following switches must be given:\n"));
- fprintf (stream, _("\
- -a, --archive-headers Display archive header information\n\
- -f, --file-headers Display the contents of the overall file header\n\
- -p, --private-headers Display object format specific file header contents\n\
- -h, --[section-]headers Display the contents of the section headers\n\
- -x, --all-headers Display the contents of all headers\n\
- -d, --disassemble Display assembler contents of executable sections\n\
- -D, --disassemble-all Display assembler contents of all sections\n\
- -S, --source Intermix source code with disassembly\n\
- -s, --full-contents Display the full contents of all sections requested\n\
- -g, --debugging Display debug information in object file\n\
- -e, --debugging-tags Display debug information using ctags style\n\
- -G, --stabs Display (in raw form) any STABS info in the file\n\
- -W, --dwarf Display DWARF info in the file\n\
- -t, --syms Display the contents of the symbol table(s)\n\
- -T, --dynamic-syms Display the contents of the dynamic symbol table\n\
- -r, --reloc Display the relocation entries in the file\n\
- -R, --dynamic-reloc Display the dynamic relocation entries in the file\n\
- @<file> Read options from <file>\n\
- -v, --version Display this program's version number\n\
- -i, --info List object formats and architectures supported\n\
- -H, --help Display this information\n\
-"));
- if (status != 2)
- {
- fprintf (stream, _("\n The following switches are optional:\n"));
- fprintf (stream, _("\
- -b, --target=BFDNAME Specify the target object format as BFDNAME\n\
- -m, --architecture=MACHINE Specify the target architecture as MACHINE\n\
- -j, --section=NAME Only display information for section NAME\n\
- -M, --disassembler-options=OPT Pass text OPT on to the disassembler\n\
- -EB --endian=big Assume big endian format when disassembling\n\
- -EL --endian=little Assume little endian format when disassembling\n\
- --file-start-context Include context from start of file (with -S)\n\
- -I, --include=DIR Add DIR to search list for source files\n\
- -l, --line-numbers Include line numbers and filenames in output\n\
- -F, --file-offsets Include file offsets when displaying information\n\
- -C, --demangle[=STYLE] Decode mangled/processed symbol names\n\
- The STYLE, if specified, can be `auto', `gnu',\n\
- `lucid', `arm', `hp', `edg', `gnu-v3', `java'\n\
- or `gnat'\n\
- -w, --wide Format output for more than 80 columns\n\
- -z, --disassemble-zeroes Do not skip blocks of zeroes when disassembling\n\
- --start-address=ADDR Only process data whose address is >= ADDR\n\
- --stop-address=ADDR Only process data whose address is <= ADDR\n\
- --prefix-addresses Print complete address alongside disassembly\n\
- --[no-]show-raw-insn Display hex alongside symbolic disassembly\n\
- --adjust-vma=OFFSET Add OFFSET to all displayed section addresses\n\
- --special-syms Include special symbols in symbol dumps\n\
-\n"));
- list_supported_targets (program_name, stream);
- list_supported_architectures (program_name, stream);
-
- disassembler_usage (stream);
- }
- if (REPORT_BUGS_TO[0] && status == 0)
- fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO);
- exit (status);
-}
-
-/* 150 isn't special; it's just an arbitrary non-ASCII char value. */
-enum option_values
- {
- OPTION_ENDIAN=150,
- OPTION_START_ADDRESS,
- OPTION_STOP_ADDRESS,
- OPTION_ADJUST_VMA
- };
-
-static struct option long_options[]=
-{
- {"adjust-vma", required_argument, NULL, OPTION_ADJUST_VMA},
- {"all-headers", no_argument, NULL, 'x'},
- {"private-headers", no_argument, NULL, 'p'},
- {"architecture", required_argument, NULL, 'm'},
- {"archive-headers", no_argument, NULL, 'a'},
- {"debugging", no_argument, NULL, 'g'},
- {"debugging-tags", no_argument, NULL, 'e'},
- {"demangle", optional_argument, NULL, 'C'},
- {"disassemble", no_argument, NULL, 'd'},
- {"disassemble-all", no_argument, NULL, 'D'},
- {"disassembler-options", required_argument, NULL, 'M'},
- {"disassemble-zeroes", no_argument, NULL, 'z'},
- {"dynamic-reloc", no_argument, NULL, 'R'},
- {"dynamic-syms", no_argument, NULL, 'T'},
- {"endian", required_argument, NULL, OPTION_ENDIAN},
- {"file-headers", no_argument, NULL, 'f'},
- {"file-offsets", no_argument, NULL, 'F'},
- {"file-start-context", no_argument, &file_start_context, 1},
- {"full-contents", no_argument, NULL, 's'},
- {"headers", no_argument, NULL, 'h'},
- {"help", no_argument, NULL, 'H'},
- {"info", no_argument, NULL, 'i'},
- {"line-numbers", no_argument, NULL, 'l'},
- {"no-show-raw-insn", no_argument, &show_raw_insn, -1},
- {"prefix-addresses", no_argument, &prefix_addresses, 1},
- {"reloc", no_argument, NULL, 'r'},
- {"section", required_argument, NULL, 'j'},
- {"section-headers", no_argument, NULL, 'h'},
- {"show-raw-insn", no_argument, &show_raw_insn, 1},
- {"source", no_argument, NULL, 'S'},
- {"special-syms", no_argument, &dump_special_syms, 1},
- {"include", required_argument, NULL, 'I'},
- {"dwarf", no_argument, NULL, 'W'},
- {"stabs", no_argument, NULL, 'G'},
- {"start-address", required_argument, NULL, OPTION_START_ADDRESS},
- {"stop-address", required_argument, NULL, OPTION_STOP_ADDRESS},
- {"syms", no_argument, NULL, 't'},
- {"target", required_argument, NULL, 'b'},
- {"version", no_argument, NULL, 'V'},
- {"wide", no_argument, NULL, 'w'},
- {0, no_argument, 0, 0}
-};
-
-static void
-nonfatal (const char *msg)
-{
- bfd_nonfatal (msg);
- exit_status = 1;
-}
-
-static void
-dump_section_header (bfd *abfd, asection *section,
- void *ignored ATTRIBUTE_UNUSED)
-{
- char *comma = "";
- unsigned int opb = bfd_octets_per_byte (abfd);
-
- /* Ignore linker created section. See elfNN_ia64_object_p in
- bfd/elfxx-ia64.c. */
- if (section->flags & SEC_LINKER_CREATED)
- return;
-
- printf ("%3d %-13s %08lx ", section->index,
- bfd_get_section_name (abfd, section),
- (unsigned long) bfd_section_size (abfd, section) / opb);
- bfd_printf_vma (abfd, bfd_get_section_vma (abfd, section));
- printf (" ");
- bfd_printf_vma (abfd, section->lma);
- printf (" %08lx 2**%u", (unsigned long) section->filepos,
- bfd_get_section_alignment (abfd, section));
- if (! wide_output)
- printf ("\n ");
- printf (" ");
-
-#define PF(x, y) \
- if (section->flags & x) { printf ("%s%s", comma, y); comma = ", "; }
-
- PF (SEC_HAS_CONTENTS, "CONTENTS");
- PF (SEC_ALLOC, "ALLOC");
- PF (SEC_CONSTRUCTOR, "CONSTRUCTOR");
- PF (SEC_LOAD, "LOAD");
- PF (SEC_RELOC, "RELOC");
- PF (SEC_READONLY, "READONLY");
- PF (SEC_CODE, "CODE");
- PF (SEC_DATA, "DATA");
- PF (SEC_ROM, "ROM");
- PF (SEC_DEBUGGING, "DEBUGGING");
- PF (SEC_NEVER_LOAD, "NEVER_LOAD");
- PF (SEC_EXCLUDE, "EXCLUDE");
- PF (SEC_SORT_ENTRIES, "SORT_ENTRIES");
- if (bfd_get_arch (abfd) == bfd_arch_tic54x)
- {
- PF (SEC_TIC54X_BLOCK, "BLOCK");
- PF (SEC_TIC54X_CLINK, "CLINK");
- }
- PF (SEC_SMALL_DATA, "SMALL_DATA");
- if (bfd_get_flavour (abfd) == bfd_target_coff_flavour)
- PF (SEC_COFF_SHARED, "SHARED");
- PF (SEC_THREAD_LOCAL, "THREAD_LOCAL");
- PF (SEC_GROUP, "GROUP");
-
- if ((section->flags & SEC_LINK_ONCE) != 0)
- {
- const char *ls;
- struct coff_comdat_info *comdat;
-
- switch (section->flags & SEC_LINK_DUPLICATES)
- {
- default:
- abort ();
- case SEC_LINK_DUPLICATES_DISCARD:
- ls = "LINK_ONCE_DISCARD";
- break;
- case SEC_LINK_DUPLICATES_ONE_ONLY:
- ls = "LINK_ONCE_ONE_ONLY";
- break;
- case SEC_LINK_DUPLICATES_SAME_SIZE:
- ls = "LINK_ONCE_SAME_SIZE";
- break;
- case SEC_LINK_DUPLICATES_SAME_CONTENTS:
- ls = "LINK_ONCE_SAME_CONTENTS";
- break;
- }
- printf ("%s%s", comma, ls);
-
- comdat = bfd_coff_get_comdat_section (abfd, section);
- if (comdat != NULL)
- printf (" (COMDAT %s %ld)", comdat->name, comdat->symbol);
-
- comma = ", ";
- }
-
- printf ("\n");
-#undef PF
-}
-
-static void
-dump_headers (bfd *abfd)
-{
- printf (_("Sections:\n"));
-
-#ifndef BFD64
- printf (_("Idx Name Size VMA LMA File off Algn"));
-#else
- /* With BFD64, non-ELF returns -1 and wants always 64 bit addresses. */
- if (bfd_get_arch_size (abfd) == 32)
- printf (_("Idx Name Size VMA LMA File off Algn"));
- else
- printf (_("Idx Name Size VMA LMA File off Algn"));
-#endif
-
- if (wide_output)
- printf (_(" Flags"));
- if (abfd->flags & HAS_LOAD_PAGE)
- printf (_(" Pg"));
- printf ("\n");
-
- bfd_map_over_sections (abfd, dump_section_header, NULL);
-}
-
-static asymbol **
-slurp_symtab (bfd *abfd)
-{
- asymbol **sy = NULL;
- long storage;
-
- if (!(bfd_get_file_flags (abfd) & HAS_SYMS))
- {
- symcount = 0;
- return NULL;
- }
-
- storage = bfd_get_symtab_upper_bound (abfd);
- if (storage < 0)
- bfd_fatal (bfd_get_filename (abfd));
- if (storage)
- sy = xmalloc (storage);
-
- symcount = bfd_canonicalize_symtab (abfd, sy);
- if (symcount < 0)
- bfd_fatal (bfd_get_filename (abfd));
- return sy;
-}
-
-/* Read in the dynamic symbols. */
-
-static asymbol **
-slurp_dynamic_symtab (bfd *abfd)
-{
- asymbol **sy = NULL;
- long storage;
-
- storage = bfd_get_dynamic_symtab_upper_bound (abfd);
- if (storage < 0)
- {
- if (!(bfd_get_file_flags (abfd) & DYNAMIC))
- {
- non_fatal (_("%s: not a dynamic object"), bfd_get_filename (abfd));
- dynsymcount = 0;
- return NULL;
- }
-
- bfd_fatal (bfd_get_filename (abfd));
- }
- if (storage)
- sy = xmalloc (storage);
-
- dynsymcount = bfd_canonicalize_dynamic_symtab (abfd, sy);
- if (dynsymcount < 0)
- bfd_fatal (bfd_get_filename (abfd));
- return sy;
-}
-
-/* Filter out (in place) symbols that are useless for disassembly.
- COUNT is the number of elements in SYMBOLS.
- Return the number of useful symbols. */
-
-static long
-remove_useless_symbols (asymbol **symbols, long count)
-{
- asymbol **in_ptr = symbols, **out_ptr = symbols;
-
- while (--count >= 0)
- {
- asymbol *sym = *in_ptr++;
-
- if (sym->name == NULL || sym->name[0] == '\0')
- continue;
- if (sym->flags & (BSF_DEBUGGING | BSF_SECTION_SYM))
- continue;
- if (bfd_is_und_section (sym->section)
- || bfd_is_com_section (sym->section))
- continue;
-
- *out_ptr++ = sym;
- }
- return out_ptr - symbols;
-}
-
-/* Sort symbols into value order. */
-
-static int
-compare_symbols (const void *ap, const void *bp)
-{
- const asymbol *a = * (const asymbol **) ap;
- const asymbol *b = * (const asymbol **) bp;
- const char *an;
- const char *bn;
- size_t anl;
- size_t bnl;
- bfd_boolean af;
- bfd_boolean bf;
- flagword aflags;
- flagword bflags;
-
- if (bfd_asymbol_value (a) > bfd_asymbol_value (b))
- return 1;
- else if (bfd_asymbol_value (a) < bfd_asymbol_value (b))
- return -1;
-
- if (a->section > b->section)
- return 1;
- else if (a->section < b->section)
- return -1;
-
- an = bfd_asymbol_name (a);
- bn = bfd_asymbol_name (b);
- anl = strlen (an);
- bnl = strlen (bn);
-
- /* The symbols gnu_compiled and gcc2_compiled convey no real
- information, so put them after other symbols with the same value. */
- af = (strstr (an, "gnu_compiled") != NULL
- || strstr (an, "gcc2_compiled") != NULL);
- bf = (strstr (bn, "gnu_compiled") != NULL
- || strstr (bn, "gcc2_compiled") != NULL);
-
- if (af && ! bf)
- return 1;
- if (! af && bf)
- return -1;
-
- /* We use a heuristic for the file name, to try to sort it after
- more useful symbols. It may not work on non Unix systems, but it
- doesn't really matter; the only difference is precisely which
- symbol names get printed. */
-
-#define file_symbol(s, sn, snl) \
- (((s)->flags & BSF_FILE) != 0 \
- || ((sn)[(snl) - 2] == '.' \
- && ((sn)[(snl) - 1] == 'o' \
- || (sn)[(snl) - 1] == 'a')))
-
- af = file_symbol (a, an, anl);
- bf = file_symbol (b, bn, bnl);
-
- if (af && ! bf)
- return 1;
- if (! af && bf)
- return -1;
-
- /* Try to sort global symbols before local symbols before function
- symbols before debugging symbols. */
-
- aflags = a->flags;
- bflags = b->flags;
-
- if ((aflags & BSF_DEBUGGING) != (bflags & BSF_DEBUGGING))
- {
- if ((aflags & BSF_DEBUGGING) != 0)
- return 1;
- else
- return -1;
- }
- if ((aflags & BSF_FUNCTION) != (bflags & BSF_FUNCTION))
- {
- if ((aflags & BSF_FUNCTION) != 0)
- return -1;
- else
- return 1;
- }
- if ((aflags & BSF_LOCAL) != (bflags & BSF_LOCAL))
- {
- if ((aflags & BSF_LOCAL) != 0)
- return 1;
- else
- return -1;
- }
- if ((aflags & BSF_GLOBAL) != (bflags & BSF_GLOBAL))
- {
- if ((aflags & BSF_GLOBAL) != 0)
- return -1;
- else
- return 1;
- }
-
- /* Symbols that start with '.' might be section names, so sort them
- after symbols that don't start with '.'. */
- if (an[0] == '.' && bn[0] != '.')
- return 1;
- if (an[0] != '.' && bn[0] == '.')
- return -1;
-
- /* Finally, if we can't distinguish them in any other way, try to
- get consistent results by sorting the symbols by name. */
- return strcmp (an, bn);
-}
-
-/* Sort relocs into address order. */
-
-static int
-compare_relocs (const void *ap, const void *bp)
-{
- const arelent *a = * (const arelent **) ap;
- const arelent *b = * (const arelent **) bp;
-
- if (a->address > b->address)
- return 1;
- else if (a->address < b->address)
- return -1;
-
- /* So that associated relocations tied to the same address show up
- in the correct order, we don't do any further sorting. */
- if (a > b)
- return 1;
- else if (a < b)
- return -1;
- else
- return 0;
-}
-
-/* Print an address (VMA) to the output stream in INFO.
- If SKIP_ZEROES is TRUE, omit leading zeroes. */
-
-static void
-objdump_print_value (bfd_vma vma, struct disassemble_info *info,
- bfd_boolean skip_zeroes)
-{
- char buf[30];
- char *p;
- struct objdump_disasm_info *aux;
-
- aux = (struct objdump_disasm_info *) info->application_data;
- bfd_sprintf_vma (aux->abfd, buf, vma);
- if (! skip_zeroes)
- p = buf;
- else
- {
- for (p = buf; *p == '0'; ++p)
- ;
- if (*p == '\0')
- --p;
- }
- (*info->fprintf_func) (info->stream, "%s", p);
-}
-
-/* Print the name of a symbol. */
-
-static void
-objdump_print_symname (bfd *abfd, struct disassemble_info *info,
- asymbol *sym)
-{
- char *alloc;
- const char *name;
-
- alloc = NULL;
- name = bfd_asymbol_name (sym);
- if (do_demangle && name[0] != '\0')
- {
- /* Demangle the name. */
- alloc = bfd_demangle (abfd, name, DMGL_ANSI | DMGL_PARAMS);
- if (alloc != NULL)
- name = alloc;
- }
-
- if (info != NULL)
- (*info->fprintf_func) (info->stream, "%s", name);
- else
- printf ("%s", name);
-
- if (alloc != NULL)
- free (alloc);
-}
-
-/* Locate a symbol given a bfd and a section (from INFO->application_data),
- and a VMA. If INFO->application_data->require_sec is TRUE, then always
- require the symbol to be in the section. Returns NULL if there is no
- suitable symbol. If PLACE is not NULL, then *PLACE is set to the index
- of the symbol in sorted_syms. */
-
-static asymbol *
-find_symbol_for_address (bfd_vma vma,
- struct disassemble_info *info,
- long *place)
-{
- /* @@ Would it speed things up to cache the last two symbols returned,
- and maybe their address ranges? For many processors, only one memory
- operand can be present at a time, so the 2-entry cache wouldn't be
- constantly churned by code doing heavy memory accesses. */
-
- /* Indices in `sorted_syms'. */
- long min = 0;
- long max = sorted_symcount;
- long thisplace;
- struct objdump_disasm_info *aux;
- bfd *abfd;
- asection *sec;
- unsigned int opb;
- bfd_boolean want_section;
-
- if (sorted_symcount < 1)
- return NULL;
-
- aux = (struct objdump_disasm_info *) info->application_data;
- abfd = aux->abfd;
- sec = aux->sec;
- opb = bfd_octets_per_byte (abfd);
-
- /* Perform a binary search looking for the closest symbol to the
- required value. We are searching the range (min, max]. */
- while (min + 1 < max)
- {
- asymbol *sym;
-
- thisplace = (max + min) / 2;
- sym = sorted_syms[thisplace];
-
- if (bfd_asymbol_value (sym) > vma)
- max = thisplace;
- else if (bfd_asymbol_value (sym) < vma)
- min = thisplace;
- else
- {
- min = thisplace;
- break;
- }
- }
-
- /* The symbol we want is now in min, the low end of the range we
- were searching. If there are several symbols with the same
- value, we want the first one. */
- thisplace = min;
- while (thisplace > 0
- && (bfd_asymbol_value (sorted_syms[thisplace])
- == bfd_asymbol_value (sorted_syms[thisplace - 1])))
- --thisplace;
-
- /* Prefer a symbol in the current section if we have multple symbols
- with the same value, as can occur with overlays or zero size
- sections. */
- min = thisplace;
- while (min < max
- && (bfd_asymbol_value (sorted_syms[min])
- == bfd_asymbol_value (sorted_syms[thisplace])))
- {
- if (sorted_syms[min]->section == sec
- && info->symbol_is_valid (sorted_syms[min], info))
- {
- thisplace = min;
-
- if (place != NULL)
- *place = thisplace;
-
- return sorted_syms[thisplace];
- }
- ++min;
- }
-
- /* If the file is relocatable, and the symbol could be from this
- section, prefer a symbol from this section over symbols from
- others, even if the other symbol's value might be closer.
-
- Note that this may be wrong for some symbol references if the
- sections have overlapping memory ranges, but in that case there's
- no way to tell what's desired without looking at the relocation
- table.
-
- Also give the target a chance to reject symbols. */
- want_section = (aux->require_sec
- || ((abfd->flags & HAS_RELOC) != 0
- && vma >= bfd_get_section_vma (abfd, sec)
- && vma < (bfd_get_section_vma (abfd, sec)
- + bfd_section_size (abfd, sec) / opb)));
- if ((sorted_syms[thisplace]->section != sec && want_section)
- || !info->symbol_is_valid (sorted_syms[thisplace], info))
- {
- long i;
- long newplace = sorted_symcount;
-
- for (i = min - 1; i >= 0; i--)
- {
- if ((sorted_syms[i]->section == sec || !want_section)
- && info->symbol_is_valid (sorted_syms[i], info))
- {
- if (newplace == sorted_symcount)
- newplace = i;
-
- if (bfd_asymbol_value (sorted_syms[i])
- != bfd_asymbol_value (sorted_syms[newplace]))
- break;
-
- /* Remember this symbol and keep searching until we reach
- an earlier address. */
- newplace = i;
- }
- }
-
- if (newplace != sorted_symcount)
- thisplace = newplace;
- else
- {
- /* We didn't find a good symbol with a smaller value.
- Look for one with a larger value. */
- for (i = thisplace + 1; i < sorted_symcount; i++)
- {
- if ((sorted_syms[i]->section == sec || !want_section)
- && info->symbol_is_valid (sorted_syms[i], info))
- {
- thisplace = i;
- break;
- }
- }
- }
-
- if ((sorted_syms[thisplace]->section != sec && want_section)
- || !info->symbol_is_valid (sorted_syms[thisplace], info))
- /* There is no suitable symbol. */
- return NULL;
- }
-
- if (place != NULL)
- *place = thisplace;
-
- return sorted_syms[thisplace];
-}
-
-/* Print an address and the offset to the nearest symbol. */
-
-static void
-objdump_print_addr_with_sym (bfd *abfd, asection *sec, asymbol *sym,
- bfd_vma vma, struct disassemble_info *info,
- bfd_boolean skip_zeroes)
-{
- objdump_print_value (vma, info, skip_zeroes);
-
- if (sym == NULL)
- {
- bfd_vma secaddr;
-
- (*info->fprintf_func) (info->stream, " <%s",
- bfd_get_section_name (abfd, sec));
- secaddr = bfd_get_section_vma (abfd, sec);
- if (vma < secaddr)
- {
- (*info->fprintf_func) (info->stream, "-0x");
- objdump_print_value (secaddr - vma, info, TRUE);
- }
- else if (vma > secaddr)
- {
- (*info->fprintf_func) (info->stream, "+0x");
- objdump_print_value (vma - secaddr, info, TRUE);
- }
- (*info->fprintf_func) (info->stream, ">");
- }
- else
- {
- (*info->fprintf_func) (info->stream, " <");
- objdump_print_symname (abfd, info, sym);
- if (bfd_asymbol_value (sym) > vma)
- {
- (*info->fprintf_func) (info->stream, "-0x");
- objdump_print_value (bfd_asymbol_value (sym) - vma, info, TRUE);
- }
- else if (vma > bfd_asymbol_value (sym))
- {
- (*info->fprintf_func) (info->stream, "+0x");
- objdump_print_value (vma - bfd_asymbol_value (sym), info, TRUE);
- }
- (*info->fprintf_func) (info->stream, ">");
- }
-
- if (display_file_offsets)
- info->fprintf_func (info->stream, _(" (File Offset: 0x%lx)"),
- (long int)(sec->filepos + (vma - sec->vma)));
-}
-
-/* Print an address (VMA), symbolically if possible.
- If SKIP_ZEROES is TRUE, don't output leading zeroes. */
-
-static void
-objdump_print_addr (bfd_vma vma,
- struct disassemble_info *info,
- bfd_boolean skip_zeroes)
-{
- struct objdump_disasm_info *aux;
- asymbol *sym = NULL;
- bfd_boolean skip_find = FALSE;
-
- aux = (struct objdump_disasm_info *) info->application_data;
-
- if (sorted_symcount < 1)
- {
- (*info->fprintf_func) (info->stream, "0x");
- objdump_print_value (vma, info, skip_zeroes);
-
- if (display_file_offsets)
- info->fprintf_func (info->stream, _(" (File Offset: 0x%lx)"),
- (long int)(aux->sec->filepos + (vma - aux->sec->vma)));
- return;
- }
-
- if (aux->reloc != NULL
- && aux->reloc->sym_ptr_ptr != NULL
- && * aux->reloc->sym_ptr_ptr != NULL)
- {
- sym = * aux->reloc->sym_ptr_ptr;
-
- /* Adjust the vma to the reloc. */
- vma += bfd_asymbol_value (sym);
-
- if (bfd_is_und_section (bfd_get_section (sym)))
- skip_find = TRUE;
- }
-
- if (!skip_find)
- sym = find_symbol_for_address (vma, info, NULL);
-
- objdump_print_addr_with_sym (aux->abfd, aux->sec, sym, vma, info,
- skip_zeroes);
-}
-
-/* Print VMA to INFO. This function is passed to the disassembler
- routine. */
-
-static void
-objdump_print_address (bfd_vma vma, struct disassemble_info *info)
-{
- objdump_print_addr (vma, info, ! prefix_addresses);
-}
-
-/* Determine if the given address has a symbol associated with it. */
-
-static int
-objdump_symbol_at_address (bfd_vma vma, struct disassemble_info * info)
-{
- asymbol * sym;
-
- sym = find_symbol_for_address (vma, info, NULL);
-
- return (sym != NULL && (bfd_asymbol_value (sym) == vma));
-}
-
-/* Hold the last function name and the last line number we displayed
- in a disassembly. */
-
-static char *prev_functionname;
-static unsigned int prev_line;
-
-/* We keep a list of all files that we have seen when doing a
- disassembly with source, so that we know how much of the file to
- display. This can be important for inlined functions. */
-
-struct print_file_list
-{
- struct print_file_list *next;
- const char *filename;
- const char *modname;
- const char *map;
- size_t mapsize;
- const char **linemap;
- unsigned maxline;
- unsigned last_line;
- int first;
-};
-
-static struct print_file_list *print_files;
-
-/* The number of preceding context lines to show when we start
- displaying a file for the first time. */
-
-#define SHOW_PRECEDING_CONTEXT_LINES (5)
-
-/* Read a complete file into memory. */
-
-static const char *
-slurp_file (const char *fn, size_t *size)
-{
-#ifdef HAVE_MMAP
- int ps = getpagesize ();
- size_t msize;
-#endif
- const char *map;
- struct stat st;
- int fd = open (fn, O_RDONLY | O_BINARY);
-
- if (fd < 0)
- return NULL;
- if (fstat (fd, &st) < 0)
- return NULL;
- *size = st.st_size;
-#ifdef HAVE_MMAP
- msize = (*size + ps - 1) & ~(ps - 1);
- map = mmap (NULL, msize, PROT_READ, MAP_SHARED, fd, 0);
- if (map != (char *)-1L)
- {
- close(fd);
- return map;
- }
-#endif
- map = malloc (*size);
- if (!map || (size_t) read (fd, (char *)map, *size) != *size)
- {
- free ((void *)map);
- map = NULL;
- }
- close (fd);
- return map;
-}
-
-#define line_map_decrease 5
-
-/* Precompute array of lines for a mapped file. */
-
-static const char **
-index_file (const char *map, size_t size, unsigned int *maxline)
-{
- const char *p, *lstart, *end;
- int chars_per_line = 45; /* First iteration will use 40. */
- unsigned int lineno;
- const char **linemap = NULL;
- unsigned long line_map_size = 0;
-
- lineno = 0;
- lstart = map;
- end = map + size;
-
- for (p = map; p < end; p++)
- {
- if (*p == '\n')
- {
- if (p + 1 < end && p[1] == '\r')
- p++;
- }
- else if (*p == '\r')
- {
- if (p + 1 < end && p[1] == '\n')
- p++;
- }
- else
- continue;
-
- /* End of line found. */
-
- if (linemap == NULL || line_map_size < lineno + 1)
- {
- unsigned long newsize;
-
- chars_per_line -= line_map_decrease;
- if (chars_per_line <= 1)
- chars_per_line = 1;
- line_map_size = size / chars_per_line + 1;
- if (line_map_size < lineno + 1)
- line_map_size = lineno + 1;
- newsize = line_map_size * sizeof (char *);
- linemap = xrealloc (linemap, newsize);
- }
-
- linemap[lineno++] = lstart;
- lstart = p + 1;
- }
-
- *maxline = lineno;
- return linemap;
-}
-
-/* Tries to open MODNAME, and if successful adds a node to print_files
- linked list and returns that node. Returns NULL on failure. */
-
-static struct print_file_list *
-try_print_file_open (const char *origname, const char *modname)
-{
- struct print_file_list *p;
-
- p = xmalloc (sizeof (struct print_file_list));
-
- p->map = slurp_file (modname, &p->mapsize);
- if (p->map == NULL)
- {
- free (p);
- return NULL;
- }
-
- p->linemap = index_file (p->map, p->mapsize, &p->maxline);
- p->last_line = 0;
- p->filename = origname;
- p->modname = modname;
- p->next = print_files;
- p->first = 1;
- print_files = p;
- return p;
-}
-
-/* If the the source file, as described in the symtab, is not found
- try to locate it in one of the paths specified with -I
- If found, add location to print_files linked list. */
-
-static struct print_file_list *
-update_source_path (const char *filename)
-{
- struct print_file_list *p;
- const char *fname;
- int i;
-
- if (filename == NULL)
- return NULL;
-
- p = try_print_file_open (filename, filename);
- if (p != NULL)
- return p;
-
- if (include_path_count == 0)
- return NULL;
-
- /* Get the name of the file. */
- fname = strrchr (filename, '/');
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
- {
- /* We could have a mixed forward/back slash case. */
- char *backslash = strrchr (filename, '\\');
- if (fname == NULL || (backslash != NULL && backslash > fname))
- fname = backslash;
- if (fname == NULL && filename[0] != '\0' && filename[1] == ':')
- fname = filename + 1;
- }
-#endif
- if (fname == NULL)
- fname = filename;
- else
- ++fname;
-
- /* If file exists under a new path, we need to add it to the list
- so that show_line knows about it. */
- for (i = 0; i < include_path_count; i++)
- {
- char *modname = concat (include_paths[i], "/", fname, (const char *) 0);
-
- p = try_print_file_open (filename, modname);
- if (p)
- return p;
-
- free (modname);
- }
-
- return NULL;
-}
-
-/* Print a source file line. */
-
-static void
-print_line (struct print_file_list *p, unsigned int line)
-{
- const char *l;
- size_t len;
-
- --line;
- if (line >= p->maxline)
- return;
- l = p->linemap [line];
- /* Test fwrite return value to quiet glibc warning. */
- len = strcspn (l, "\n\r");
- if (len == 0 || fwrite (l, len, 1, stdout) == 1)
- putchar ('\n');
-}
-
-/* Print a range of source code lines. */
-
-static void
-dump_lines (struct print_file_list *p, unsigned int start, unsigned int end)
-{
- if (p->map == NULL)
- return;
- while (start <= end)
- {
- print_line (p, start);
- start++;
- }
-}
-
-/* Show the line number, or the source line, in a disassembly
- listing. */
-
-static void
-show_line (bfd *abfd, asection *section, bfd_vma addr_offset)
-{
- const char *filename;
- const char *functionname;
- unsigned int line;
-
- if (! with_line_numbers && ! with_source_code)
- return;
-
- if (! bfd_find_nearest_line (abfd, section, syms, addr_offset, &filename,
- &functionname, &line))
- return;
-
- if (filename != NULL && *filename == '\0')
- filename = NULL;
- if (functionname != NULL && *functionname == '\0')
- functionname = NULL;
-
- if (with_line_numbers)
- {
- if (functionname != NULL
- && (prev_functionname == NULL
- || strcmp (functionname, prev_functionname) != 0))
- printf ("%s():\n", functionname);
- if (line > 0 && line != prev_line)
- printf ("%s:%u\n", filename == NULL ? "???" : filename, line);
- }
-
- if (with_source_code
- && filename != NULL
- && line > 0)
- {
- struct print_file_list **pp, *p;
- unsigned l;
-
- for (pp = &print_files; *pp != NULL; pp = &(*pp)->next)
- if (strcmp ((*pp)->filename, filename) == 0)
- break;
- p = *pp;
-
- if (p == NULL)
- p = update_source_path (filename);
-
- if (p != NULL && line != p->last_line)
- {
- if (file_start_context && p->first)
- l = 1;
- else
- {
- l = line - SHOW_PRECEDING_CONTEXT_LINES;
- if (l >= line)
- l = 1;
- if (p->last_line >= l && p->last_line <= line)
- l = p->last_line + 1;
- }
- dump_lines (p, l, line);
- p->last_line = line;
- p->first = 0;
- }
- }
-
- if (functionname != NULL
- && (prev_functionname == NULL
- || strcmp (functionname, prev_functionname) != 0))
- {
- if (prev_functionname != NULL)
- free (prev_functionname);
- prev_functionname = xmalloc (strlen (functionname) + 1);
- strcpy (prev_functionname, functionname);
- }
-
- if (line > 0 && line != prev_line)
- prev_line = line;
-}
-
-/* Pseudo FILE object for strings. */
-typedef struct
-{
- char *buffer;
- size_t pos;
- size_t alloc;
-} SFILE;
-
-/* sprintf to a "stream". */
-
-static int ATTRIBUTE_PRINTF_2
-objdump_sprintf (SFILE *f, const char *format, ...)
-{
- size_t n;
- va_list args;
-
- while (1)
- {
- size_t space = f->alloc - f->pos;
-
- va_start (args, format);
- n = vsnprintf (f->buffer + f->pos, space, format, args);
- va_end (args);
-
- if (space > n)
- break;
-
- f->alloc = (f->alloc + n) * 2;
- f->buffer = xrealloc (f->buffer, f->alloc);
- }
- f->pos += n;
-
- return n;
-}
-
-/* Returns TRUE if the specified section should be dumped. */
-
-static bfd_boolean
-process_section_p (asection * section)
-{
- size_t i;
-
- if (only == NULL)
- return TRUE;
-
- for (i = 0; i < only_used; i++)
- if (strcmp (only [i], section->name) == 0)
- return TRUE;
-
- return FALSE;
-}
-
-
-/* The number of zeroes we want to see before we start skipping them.
- The number is arbitrarily chosen. */
-
-#define DEFAULT_SKIP_ZEROES 8
-
-/* The number of zeroes to skip at the end of a section. If the
- number of zeroes at the end is between SKIP_ZEROES_AT_END and
- SKIP_ZEROES, they will be disassembled. If there are fewer than
- SKIP_ZEROES_AT_END, they will be skipped. This is a heuristic
- attempt to avoid disassembling zeroes inserted by section
- alignment. */
-
-#define DEFAULT_SKIP_ZEROES_AT_END 3
-
-/* Disassemble some data in memory between given values. */
-
-static void
-disassemble_bytes (struct disassemble_info * info,
- disassembler_ftype disassemble_fn,
- bfd_boolean insns,
- bfd_byte * data,
- bfd_vma start_offset,
- bfd_vma stop_offset,
- bfd_vma rel_offset,
- arelent *** relppp,
- arelent ** relppend)
-{
- struct objdump_disasm_info *aux;
- asection *section;
- int octets_per_line;
- bfd_boolean done_dot;
- int skip_addr_chars;
- bfd_vma addr_offset;
- unsigned int opb = info->octets_per_byte;
- unsigned int skip_zeroes = info->skip_zeroes;
- unsigned int skip_zeroes_at_end = info->skip_zeroes_at_end;
- int octets = opb;
- SFILE sfile;
-
- aux = (struct objdump_disasm_info *) info->application_data;
- section = aux->sec;
-
- sfile.alloc = 120;
- sfile.buffer = xmalloc (sfile.alloc);
- sfile.pos = 0;
-
- if (insns)
- octets_per_line = 4;
- else
- octets_per_line = 16;
-
- /* Figure out how many characters to skip at the start of an
- address, to make the disassembly look nicer. We discard leading
- zeroes in chunks of 4, ensuring that there is always a leading
- zero remaining. */
- skip_addr_chars = 0;
- if (! prefix_addresses)
- {
- char buf[30];
- char *s;
-
- bfd_sprintf_vma
- (aux->abfd, buf,
- (section->vma
- + bfd_section_size (section->owner, section) / opb));
- s = buf;
- while (s[0] == '0' && s[1] == '0' && s[2] == '0' && s[3] == '0'
- && s[4] == '0')
- {
- skip_addr_chars += 4;
- s += 4;
- }
- }
-
- info->insn_info_valid = 0;
-
- done_dot = FALSE;
- addr_offset = start_offset;
- while (addr_offset < stop_offset)
- {
- bfd_vma z;
- bfd_boolean need_nl = FALSE;
- int previous_octets;
-
- /* Remember the length of the previous instruction. */
- previous_octets = octets;
- octets = 0;
-
- /* If we see more than SKIP_ZEROES octets of zeroes, we just
- print `...'. */
- for (z = addr_offset * opb; z < stop_offset * opb; z++)
- if (data[z] != 0)
- break;
- if (! disassemble_zeroes
- && (info->insn_info_valid == 0
- || info->branch_delay_insns == 0)
- && (z - addr_offset * opb >= skip_zeroes
- || (z == stop_offset * opb &&
- z - addr_offset * opb < skip_zeroes_at_end)))
- {
- /* If there are more nonzero octets to follow, we only skip
- zeroes in multiples of 4, to try to avoid running over
- the start of an instruction which happens to start with
- zero. */
- if (z != stop_offset * opb)
- z = addr_offset * opb + ((z - addr_offset * opb) &~ 3);
-
- octets = z - addr_offset * opb;
-
- /* If we are going to display more data, and we are displaying
- file offsets, then tell the user how many zeroes we skip
- and the file offset from where we resume dumping. */
- if (display_file_offsets && ((addr_offset + (octets / opb)) < stop_offset))
- printf ("\t... (skipping %d zeroes, resuming at file offset: 0x%lx)\n",
- octets / opb,
- (unsigned long) (section->filepos
- + (addr_offset + (octets / opb))));
- else
- printf ("\t...\n");
- }
- else
- {
- char buf[50];
- int bpc = 0;
- int pb = 0;
-
- done_dot = FALSE;
-
- if (with_line_numbers || with_source_code)
- show_line (aux->abfd, section, addr_offset);
-
- if (! prefix_addresses)
- {
- char *s;
-
- bfd_sprintf_vma (aux->abfd, buf, section->vma + addr_offset);
- for (s = buf + skip_addr_chars; *s == '0'; s++)
- *s = ' ';
- if (*s == '\0')
- *--s = '0';
- printf ("%s:\t", buf + skip_addr_chars);
- }
- else
- {
- aux->require_sec = TRUE;
- objdump_print_address (section->vma + addr_offset, info);
- aux->require_sec = FALSE;
- putchar (' ');
- }
-
- if (insns)
- {
- sfile.pos = 0;
- info->fprintf_func = (fprintf_ftype) objdump_sprintf;
- info->stream = &sfile;
- info->bytes_per_line = 0;
- info->bytes_per_chunk = 0;
- info->flags = 0;
-
- if (info->disassembler_needs_relocs
- && (bfd_get_file_flags (aux->abfd) & EXEC_P) == 0
- && (bfd_get_file_flags (aux->abfd) & DYNAMIC) == 0
- && *relppp < relppend)
- {
- bfd_signed_vma distance_to_rel;
-
- distance_to_rel = (**relppp)->address
- - (rel_offset + addr_offset);
-
- /* Check to see if the current reloc is associated with
- the instruction that we are about to disassemble. */
- if (distance_to_rel == 0
- /* FIXME: This is wrong. We are trying to catch
- relocs that are addressed part way through the
- current instruction, as might happen with a packed
- VLIW instruction. Unfortunately we do not know the
- length of the current instruction since we have not
- disassembled it yet. Instead we take a guess based
- upon the length of the previous instruction. The
- proper solution is to have a new target-specific
- disassembler function which just returns the length
- of an instruction at a given address without trying
- to display its disassembly. */
- || (distance_to_rel > 0
- && distance_to_rel < (bfd_signed_vma) (previous_octets/ opb)))
- {
- info->flags = INSN_HAS_RELOC;
- aux->reloc = **relppp;
- }
- else
- aux->reloc = NULL;
- }
-
- octets = (*disassemble_fn) (section->vma + addr_offset, info);
- info->fprintf_func = (fprintf_ftype) fprintf;
- info->stream = stdout;
- if (info->bytes_per_line != 0)
- octets_per_line = info->bytes_per_line;
- if (octets < 0)
- {
- if (sfile.pos)
- printf ("%s\n", sfile.buffer);
- break;
- }
- }
- else
- {
- bfd_vma j;
-
- octets = octets_per_line;
- if (addr_offset + octets / opb > stop_offset)
- octets = (stop_offset - addr_offset) * opb;
-
- for (j = addr_offset * opb; j < addr_offset * opb + octets; ++j)
- {
- if (ISPRINT (data[j]))
- buf[j - addr_offset * opb] = data[j];
- else
- buf[j - addr_offset * opb] = '.';
- }
- buf[j - addr_offset * opb] = '\0';
- }
-
- if (prefix_addresses
- ? show_raw_insn > 0
- : show_raw_insn >= 0)
- {
- bfd_vma j;
-
- /* If ! prefix_addresses and ! wide_output, we print
- octets_per_line octets per line. */
- pb = octets;
- if (pb > octets_per_line && ! prefix_addresses && ! wide_output)
- pb = octets_per_line;
-
- if (info->bytes_per_chunk)
- bpc = info->bytes_per_chunk;
- else
- bpc = 1;
-
- for (j = addr_offset * opb; j < addr_offset * opb + pb; j += bpc)
- {
- int k;
-
- if (bpc > 1 && info->display_endian == BFD_ENDIAN_LITTLE)
- {
- for (k = bpc - 1; k >= 0; k--)
- printf ("%02x", (unsigned) data[j + k]);
- putchar (' ');
- }
- else
- {
- for (k = 0; k < bpc; k++)
- printf ("%02x", (unsigned) data[j + k]);
- putchar (' ');
- }
- }
-
- for (; pb < octets_per_line; pb += bpc)
- {
- int k;
-
- for (k = 0; k < bpc; k++)
- printf (" ");
- putchar (' ');
- }
-
- /* Separate raw data from instruction by extra space. */
- if (insns)
- putchar ('\t');
- else
- printf (" ");
- }
-
- if (! insns)
- printf ("%s", buf);
- else if (sfile.pos)
- printf ("%s", sfile.buffer);
-
- if (prefix_addresses
- ? show_raw_insn > 0
- : show_raw_insn >= 0)
- {
- while (pb < octets)
- {
- bfd_vma j;
- char *s;
-
- putchar ('\n');
- j = addr_offset * opb + pb;
-
- bfd_sprintf_vma (aux->abfd, buf, section->vma + j / opb);
- for (s = buf + skip_addr_chars; *s == '0'; s++)
- *s = ' ';
- if (*s == '\0')
- *--s = '0';
- printf ("%s:\t", buf + skip_addr_chars);
-
- pb += octets_per_line;
- if (pb > octets)
- pb = octets;
- for (; j < addr_offset * opb + pb; j += bpc)
- {
- int k;
-
- if (bpc > 1 && info->display_endian == BFD_ENDIAN_LITTLE)
- {
- for (k = bpc - 1; k >= 0; k--)
- printf ("%02x", (unsigned) data[j + k]);
- putchar (' ');
- }
- else
- {
- for (k = 0; k < bpc; k++)
- printf ("%02x", (unsigned) data[j + k]);
- putchar (' ');
- }
- }
- }
- }
-
- if (!wide_output)
- putchar ('\n');
- else
- need_nl = TRUE;
- }
-
- while ((*relppp) < relppend
- && (**relppp)->address < rel_offset + addr_offset + octets / opb)
- {
- if (dump_reloc_info || dump_dynamic_reloc_info)
- {
- arelent *q;
-
- q = **relppp;
-
- if (wide_output)
- putchar ('\t');
- else
- printf ("\t\t\t");
-
- objdump_print_value (section->vma - rel_offset + q->address,
- info, TRUE);
-
- if (q->howto == NULL)
- printf (": *unknown*\t");
- else if (q->howto->name)
- printf (": %s\t", q->howto->name);
- else
- printf (": %d\t", q->howto->type);
-
- if (q->sym_ptr_ptr == NULL || *q->sym_ptr_ptr == NULL)
- printf ("*unknown*");
- else
- {
- const char *sym_name;
-
- sym_name = bfd_asymbol_name (*q->sym_ptr_ptr);
- if (sym_name != NULL && *sym_name != '\0')
- objdump_print_symname (aux->abfd, info, *q->sym_ptr_ptr);
- else
- {
- asection *sym_sec;
-
- sym_sec = bfd_get_section (*q->sym_ptr_ptr);
- sym_name = bfd_get_section_name (aux->abfd, sym_sec);
- if (sym_name == NULL || *sym_name == '\0')
- sym_name = "*unknown*";
- printf ("%s", sym_name);
- }
- }
-
- if (q->addend)
- {
- printf ("+0x");
- objdump_print_value (q->addend, info, TRUE);
- }
-
- printf ("\n");
- need_nl = FALSE;
- }
- ++(*relppp);
- }
-
- if (need_nl)
- printf ("\n");
-
- addr_offset += octets / opb;
- }
-
- free (sfile.buffer);
-}
-
-static void
-disassemble_section (bfd *abfd, asection *section, void *info)
-{
- struct disassemble_info * pinfo = (struct disassemble_info *) info;
- struct objdump_disasm_info * paux;
- unsigned int opb = pinfo->octets_per_byte;
- bfd_byte * data = NULL;
- bfd_size_type datasize = 0;
- arelent ** rel_pp = NULL;
- arelent ** rel_ppstart = NULL;
- arelent ** rel_ppend;
- unsigned long stop_offset;
- asymbol * sym = NULL;
- long place = 0;
- long rel_count;
- bfd_vma rel_offset;
- unsigned long addr_offset;
-
- /* Sections that do not contain machine
- code are not normally disassembled. */
- if (! disassemble_all
- && only == NULL
- && ((section->flags & (SEC_CODE | SEC_HAS_CONTENTS))
- != (SEC_CODE | SEC_HAS_CONTENTS)))
- return;
-
- if (! process_section_p (section))
- return;
-
- datasize = bfd_get_section_size (section);
- if (datasize == 0)
- return;
-
- /* Decide which set of relocs to use. Load them if necessary. */
- paux = (struct objdump_disasm_info *) pinfo->application_data;
- if (paux->dynrelbuf)
- {
- rel_pp = paux->dynrelbuf;
- rel_count = paux->dynrelcount;
- /* Dynamic reloc addresses are absolute, non-dynamic are section
- relative. REL_OFFSET specifies the reloc address corresponding
- to the start of this section. */
- rel_offset = section->vma;
- }
- else
- {
- rel_count = 0;
- rel_pp = NULL;
- rel_offset = 0;
-
- if ((section->flags & SEC_RELOC) != 0
- && (dump_reloc_info || pinfo->disassembler_needs_relocs))
- {
- long relsize;
-
- relsize = bfd_get_reloc_upper_bound (abfd, section);
- if (relsize < 0)
- bfd_fatal (bfd_get_filename (abfd));
-
- if (relsize > 0)
- {
- rel_ppstart = rel_pp = xmalloc (relsize);
- rel_count = bfd_canonicalize_reloc (abfd, section, rel_pp, syms);
- if (rel_count < 0)
- bfd_fatal (bfd_get_filename (abfd));
-
- /* Sort the relocs by address. */
- qsort (rel_pp, rel_count, sizeof (arelent *), compare_relocs);
- }
- }
-
- }
- rel_ppend = rel_pp + rel_count;
-
- data = xmalloc (datasize);
-
- bfd_get_section_contents (abfd, section, data, 0, datasize);
-
- paux->sec = section;
- pinfo->buffer = data;
- pinfo->buffer_vma = section->vma;
- pinfo->buffer_length = datasize;
- pinfo->section = section;
-
- if (start_address == (bfd_vma) -1
- || start_address < pinfo->buffer_vma)
- addr_offset = 0;
- else
- addr_offset = start_address - pinfo->buffer_vma;
-
- if (stop_address == (bfd_vma) -1)
- stop_offset = datasize / opb;
- else
- {
- if (stop_address < pinfo->buffer_vma)
- stop_offset = 0;
- else
- stop_offset = stop_address - pinfo->buffer_vma;
- if (stop_offset > pinfo->buffer_length / opb)
- stop_offset = pinfo->buffer_length / opb;
- }
-
- /* Skip over the relocs belonging to addresses below the
- start address. */
- while (rel_pp < rel_ppend
- && (*rel_pp)->address < rel_offset + addr_offset)
- ++rel_pp;
-
- if (addr_offset < stop_offset)
- printf (_("\nDisassembly of section %s:\n"), section->name);
-
- /* Find the nearest symbol forwards from our current position. */
- paux->require_sec = TRUE;
- sym = find_symbol_for_address (section->vma + addr_offset, info, &place);
- paux->require_sec = FALSE;
-
- /* Disassemble a block of instructions up to the address associated with
- the symbol we have just found. Then print the symbol and find the
- next symbol on. Repeat until we have disassembled the entire section
- or we have reached the end of the address range we are interested in. */
- while (addr_offset < stop_offset)
- {
- bfd_vma addr;
- asymbol *nextsym;
- unsigned long nextstop_offset;
- bfd_boolean insns;
-
- addr = section->vma + addr_offset;
-
- if (sym != NULL && bfd_asymbol_value (sym) <= addr)
- {
- int x;
-
- for (x = place;
- (x < sorted_symcount
- && (bfd_asymbol_value (sorted_syms[x]) <= addr));
- ++x)
- continue;
-
- pinfo->symbols = sorted_syms + place;
- pinfo->num_symbols = x - place;
- pinfo->symtab_pos = place;
- }
- else
- {
- pinfo->symbols = NULL;
- pinfo->num_symbols = 0;
- pinfo->symtab_pos = -1;
- }
-
- if (! prefix_addresses)
- {
- pinfo->fprintf_func (pinfo->stream, "\n");
- objdump_print_addr_with_sym (abfd, section, sym, addr,
- pinfo, FALSE);
- pinfo->fprintf_func (pinfo->stream, ":\n");
- }
-
- if (sym != NULL && bfd_asymbol_value (sym) > addr)
- nextsym = sym;
- else if (sym == NULL)
- nextsym = NULL;
- else
- {
-#define is_valid_next_sym(SYM) \
- ((SYM)->section == section \
- && (bfd_asymbol_value (SYM) > bfd_asymbol_value (sym)) \
- && pinfo->symbol_is_valid (SYM, pinfo))
-
- /* Search forward for the next appropriate symbol in
- SECTION. Note that all the symbols are sorted
- together into one big array, and that some sections
- may have overlapping addresses. */
- while (place < sorted_symcount
- && ! is_valid_next_sym (sorted_syms [place]))
- ++place;
-
- if (place >= sorted_symcount)
- nextsym = NULL;
- else
- nextsym = sorted_syms[place];
- }
-
- if (sym != NULL && bfd_asymbol_value (sym) > addr)
- nextstop_offset = bfd_asymbol_value (sym) - section->vma;
- else if (nextsym == NULL)
- nextstop_offset = stop_offset;
- else
- nextstop_offset = bfd_asymbol_value (nextsym) - section->vma;
-
- if (nextstop_offset > stop_offset)
- nextstop_offset = stop_offset;
-
- /* If a symbol is explicitly marked as being an object
- rather than a function, just dump the bytes without
- disassembling them. */
- if (disassemble_all
- || sym == NULL
- || bfd_asymbol_value (sym) > addr
- || ((sym->flags & BSF_OBJECT) == 0
- && (strstr (bfd_asymbol_name (sym), "gnu_compiled")
- == NULL)
- && (strstr (bfd_asymbol_name (sym), "gcc2_compiled")
- == NULL))
- || (sym->flags & BSF_FUNCTION) != 0)
- insns = TRUE;
- else
- insns = FALSE;
-
- disassemble_bytes (pinfo, paux->disassemble_fn, insns, data,
- addr_offset, nextstop_offset,
- rel_offset, &rel_pp, rel_ppend);
-
- addr_offset = nextstop_offset;
- sym = nextsym;
- }
-
- free (data);
-
- if (rel_ppstart != NULL)
- free (rel_ppstart);
-}
-
-/* Disassemble the contents of an object file. */
-
-static void
-disassemble_data (bfd *abfd)
-{
- struct disassemble_info disasm_info;
- struct objdump_disasm_info aux;
- long i;
-
- print_files = NULL;
- prev_functionname = NULL;
- prev_line = -1;
-
- /* We make a copy of syms to sort. We don't want to sort syms
- because that will screw up the relocs. */
- sorted_symcount = symcount ? symcount : dynsymcount;
- sorted_syms = xmalloc ((sorted_symcount + synthcount) * sizeof (asymbol *));
- memcpy (sorted_syms, symcount ? syms : dynsyms,
- sorted_symcount * sizeof (asymbol *));
-
- sorted_symcount = remove_useless_symbols (sorted_syms, sorted_symcount);
-
- for (i = 0; i < synthcount; ++i)
- {
- sorted_syms[sorted_symcount] = synthsyms + i;
- ++sorted_symcount;
- }
-
- /* Sort the symbols into section and symbol order. */
- qsort (sorted_syms, sorted_symcount, sizeof (asymbol *), compare_symbols);
-
- init_disassemble_info (&disasm_info, stdout, (fprintf_ftype) fprintf);
-
- disasm_info.application_data = (void *) &aux;
- aux.abfd = abfd;
- aux.require_sec = FALSE;
- aux.dynrelbuf = NULL;
- aux.dynrelcount = 0;
- aux.reloc = NULL;
-
- disasm_info.print_address_func = objdump_print_address;
- disasm_info.symbol_at_address_func = objdump_symbol_at_address;
-
- if (machine != NULL)
- {
- const bfd_arch_info_type *info = bfd_scan_arch (machine);
-
- if (info == NULL)
- fatal (_("Can't use supplied machine %s"), machine);
-
- abfd->arch_info = info;
- }
-
- if (endian != BFD_ENDIAN_UNKNOWN)
- {
- struct bfd_target *xvec;
-
- xvec = xmalloc (sizeof (struct bfd_target));
- memcpy (xvec, abfd->xvec, sizeof (struct bfd_target));
- xvec->byteorder = endian;
- abfd->xvec = xvec;
- }
-
- /* Use libopcodes to locate a suitable disassembler. */
- aux.disassemble_fn = disassembler (abfd);
- if (!aux.disassemble_fn)
- {
- non_fatal (_("Can't disassemble for architecture %s\n"),
- bfd_printable_arch_mach (bfd_get_arch (abfd), 0));
- exit_status = 1;
- return;
- }
-
- disasm_info.flavour = bfd_get_flavour (abfd);
- disasm_info.arch = bfd_get_arch (abfd);
- disasm_info.mach = bfd_get_mach (abfd);
- disasm_info.disassembler_options = disassembler_options;
- disasm_info.octets_per_byte = bfd_octets_per_byte (abfd);
- disasm_info.skip_zeroes = DEFAULT_SKIP_ZEROES;
- disasm_info.skip_zeroes_at_end = DEFAULT_SKIP_ZEROES_AT_END;
- disasm_info.disassembler_needs_relocs = FALSE;
-
- if (bfd_big_endian (abfd))
- disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_BIG;
- else if (bfd_little_endian (abfd))
- disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_LITTLE;
- else
- /* ??? Aborting here seems too drastic. We could default to big or little
- instead. */
- disasm_info.endian = BFD_ENDIAN_UNKNOWN;
-
- /* Allow the target to customize the info structure. */
- disassemble_init_for_target (& disasm_info);
-
- /* Pre-load the dynamic relocs if we are going
- to be dumping them along with the disassembly. */
- if (dump_dynamic_reloc_info)
- {
- long relsize = bfd_get_dynamic_reloc_upper_bound (abfd);
-
- if (relsize < 0)
- bfd_fatal (bfd_get_filename (abfd));
-
- if (relsize > 0)
- {
- aux.dynrelbuf = xmalloc (relsize);
- aux.dynrelcount = bfd_canonicalize_dynamic_reloc (abfd,
- aux.dynrelbuf,
- dynsyms);
- if (aux.dynrelcount < 0)
- bfd_fatal (bfd_get_filename (abfd));
-
- /* Sort the relocs by address. */
- qsort (aux.dynrelbuf, aux.dynrelcount, sizeof (arelent *),
- compare_relocs);
- }
- }
- disasm_info.symtab = sorted_syms;
- disasm_info.symtab_size = sorted_symcount;
-
- bfd_map_over_sections (abfd, disassemble_section, & disasm_info);
-
- if (aux.dynrelbuf != NULL)
- free (aux.dynrelbuf);
- free (sorted_syms);
-}
-
-int
-load_debug_section (enum dwarf_section_display_enum debug, void *file)
-{
- struct dwarf_section *section = &debug_displays [debug].section;
- bfd *abfd = file;
- asection *sec;
- bfd_boolean ret;
- int section_is_compressed;
-
- /* If it is already loaded, do nothing. */
- if (section->start != NULL)
- return 1;
-
- /* Locate the debug section. */
- sec = bfd_get_section_by_name (abfd, section->uncompressed_name);
- if (sec != NULL)
- section->name = section->uncompressed_name;
- else
- {
- sec = bfd_get_section_by_name (abfd, section->compressed_name);
- if (sec != NULL)
- section->name = section->compressed_name;
- }
- if (sec == NULL)
- return 0;
- section_is_compressed = section->name == section->compressed_name;
-
- /* Compute a bias to be added to offsets found within the DWARF debug
- information. These offsets are meant to be relative to the start of
- the dwarf section, and hence the bias should be 0. For MACH-O however
- a dwarf section is really just a region of a much larger section and so
- the bias is the address of the start of that area within the larger
- section. This test is important for PE and COFF based targets which
- use DWARF debug information, since unlike ELF, they do not allow the
- dwarf sections to be placed at address 0. */
- if (bfd_get_flavour (abfd) == bfd_target_mach_o_flavour)
- section->address = bfd_get_section_vma (abfd, sec);
- else
- section->address = 0;
-
- section->size = bfd_get_section_size (sec);
- section->start = xmalloc (section->size);
-
- if (is_relocatable && debug_displays [debug].relocate)
- ret = bfd_simple_get_relocated_section_contents (abfd,
- sec,
- section->start,
- syms) != NULL;
- else
- ret = bfd_get_section_contents (abfd, sec, section->start, 0,
- section->size);
-
- if (! ret)
- {
- free_debug_section (debug);
- printf (_("\nCan't get contents for section '%s'.\n"),
- section->name);
- return 0;
- }
-
- if (section_is_compressed)
- {
- bfd_size_type size = section->size;
- if (! bfd_uncompress_section_contents (&section->start, &size))
- {
- free_debug_section (debug);
- printf (_("\nCan't uncompress section '%s'.\n"), section->name);
- return 0;
- }
- section->size = size;
- }
-
- return ret;
-}
-
-void
-free_debug_section (enum dwarf_section_display_enum debug)
-{
- struct dwarf_section *section = &debug_displays [debug].section;
-
- if (section->start == NULL)
- return;
-
- free ((char *) section->start);
- section->start = NULL;
- section->address = 0;
- section->size = 0;
-}
-
-static void
-dump_dwarf_section (bfd *abfd, asection *section,
- void *arg ATTRIBUTE_UNUSED)
-{
- const char *name = bfd_get_section_name (abfd, section);
- const char *match;
- enum dwarf_section_display_enum i;
-
- if (CONST_STRNEQ (name, ".gnu.linkonce.wi."))
- match = ".debug_info";
- else
- match = name;
-
- for (i = 0; i < max; i++)
- if (strcmp (debug_displays [i].section.uncompressed_name, match) == 0
- || strcmp (debug_displays [i].section.compressed_name, match) == 0)
- {
- if (!debug_displays [i].eh_frame)
- {
- struct dwarf_section *sec = &debug_displays [i].section;
-
- if (load_debug_section (i, abfd))
- {
- debug_displays [i].display (sec, abfd);
-
- if (i != info && i != abbrev)
- free_debug_section (i);
- }
- }
- break;
- }
-}
-
-static const char *mach_o_uncompressed_dwarf_sections [] = {
- "LC_SEGMENT.__DWARFA.__debug_abbrev", /* .debug_abbrev */
- "LC_SEGMENT.__DWARFA.__debug_aranges", /* .debug_aranges */
- "LC_SEGMENT.__DWARFA.__debug_frame", /* .debug_frame */
- "LC_SEGMENT.__DWARFA.__debug_info", /* .debug_info */
- "LC_SEGMENT.__DWARFA.__debug_line", /* .debug_line */
- "LC_SEGMENT.__DWARFA.__debug_pubnames", /* .debug_pubnames */
- ".eh_frame", /* .eh_frame */
- "LC_SEGMENT.__DWARFA.__debug_macinfo", /* .debug_macinfo */
- "LC_SEGMENT.__DWARFA.__debug_str", /* .debug_str */
- "LC_SEGMENT.__DWARFA.__debug_loc", /* .debug_loc */
- "LC_SEGMENT.__DWARFA.__debug_pubtypes", /* .debug_pubtypes */
- "LC_SEGMENT.__DWARFA.__debug_ranges", /* .debug_ranges */
- "LC_SEGMENT.__DWARFA.__debug_static_func", /* .debug_static_func */
- "LC_SEGMENT.__DWARFA.__debug_static_vars", /* .debug_static_vars */
- "LC_SEGMENT.__DWARFA.__debug_types", /* .debug_types */
- "LC_SEGMENT.__DWARFA.__debug_weaknames" /* .debug_weaknames */
-};
-
-static const char *mach_o_compressed_dwarf_sections [] = {
- "LC_SEGMENT.__DWARFA.__zdebug_abbrev", /* .zdebug_abbrev */
- "LC_SEGMENT.__DWARFA.__zdebug_aranges", /* .zdebug_aranges */
- "LC_SEGMENT.__DWARFA.__zdebug_frame", /* .zdebug_frame */
- "LC_SEGMENT.__DWARFA.__zdebug_info", /* .zdebug_info */
- "LC_SEGMENT.__DWARFA.__zdebug_line", /* .zdebug_line */
- "LC_SEGMENT.__DWARFA.__zdebug_pubnames", /* .zdebug_pubnames */
- ".eh_frame", /* .eh_frame */
- "LC_SEGMENT.__DWARFA.__zdebug_macinfo", /* .zdebug_macinfo */
- "LC_SEGMENT.__DWARFA.__zdebug_str", /* .zdebug_str */
- "LC_SEGMENT.__DWARFA.__zdebug_loc", /* .zdebug_loc */
- "LC_SEGMENT.__DWARFA.__zdebug_pubtypes", /* .zdebug_pubtypes */
- "LC_SEGMENT.__DWARFA.__zdebug_ranges", /* .zdebug_ranges */
- "LC_SEGMENT.__DWARFA.__zdebug_static_func", /* .zdebug_static_func */
- "LC_SEGMENT.__DWARFA.__zdebug_static_vars", /* .zdebug_static_vars */
- "LC_SEGMENT.__DWARFA.__zdebug_types", /* .zdebug_types */
- "LC_SEGMENT.__DWARFA.__zdebug_weaknames" /* .zdebug_weaknames */
-};
-
-static const char *generic_uncompressed_dwarf_sections [max];
-static const char *generic_compressed_dwarf_sections [max];
-
-static void
-check_mach_o_dwarf (bfd *abfd)
-{
- static enum bfd_flavour old_flavour = bfd_target_unknown_flavour;
- enum bfd_flavour current_flavour = bfd_get_flavour (abfd);
- enum dwarf_section_display_enum i;
-
- if (generic_uncompressed_dwarf_sections [0] == NULL)
- for (i = 0; i < max; i++)
- {
- generic_uncompressed_dwarf_sections [i]
- = debug_displays[i].section.uncompressed_name;
- generic_compressed_dwarf_sections [i]
- = debug_displays[i].section.compressed_name;
- }
-
- if (old_flavour != current_flavour)
- {
- if (current_flavour == bfd_target_mach_o_flavour)
- for (i = 0; i < max; i++)
- {
- debug_displays[i].section.uncompressed_name
- = mach_o_uncompressed_dwarf_sections [i];
- debug_displays[i].section.compressed_name
- = mach_o_compressed_dwarf_sections [i];
- }
- else if (old_flavour == bfd_target_mach_o_flavour)
- for (i = 0; i < max; i++)
- {
- debug_displays[i].section.uncompressed_name
- = generic_uncompressed_dwarf_sections [i];
- debug_displays[i].section.compressed_name
- = generic_compressed_dwarf_sections [i];
- }
-
- old_flavour = current_flavour;
- }
-}
-
-/* Dump the dwarf debugging information. */
-
-static void
-dump_dwarf (bfd *abfd)
-{
- is_relocatable = (abfd->flags & (EXEC_P | DYNAMIC)) == 0;
-
- /* FIXME: bfd_get_arch_size may return -1. We assume that 64bit
- targets will return 64. */
- eh_addr_size = bfd_get_arch_size (abfd) == 64 ? 8 : 4;
-
- if (bfd_big_endian (abfd))
- byte_get = byte_get_big_endian;
- else if (bfd_little_endian (abfd))
- byte_get = byte_get_little_endian;
- else
- abort ();
-
- check_mach_o_dwarf (abfd);
-
- if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
- {
- const struct elf_backend_data *bed = get_elf_backend_data (abfd);
- init_dwarf_regnames (bed->elf_machine_code);
- }
-
- bfd_map_over_sections (abfd, dump_dwarf_section, NULL);
-
- free_debug_memory ();
-}
-
-/* Read ABFD's stabs section STABSECT_NAME, and return a pointer to
- it. Return NULL on failure. */
-
-static char *
-read_section_stabs (bfd *abfd, const char *sect_name, bfd_size_type *size_ptr)
-{
- asection *stabsect;
- bfd_size_type size;
- char *contents;
-
- stabsect = bfd_get_section_by_name (abfd, sect_name);
- if (stabsect == NULL)
- {
- printf (_("No %s section present\n\n"), sect_name);
- return FALSE;
- }
-
- size = bfd_section_size (abfd, stabsect);
- contents = xmalloc (size);
-
- if (! bfd_get_section_contents (abfd, stabsect, contents, 0, size))
- {
- non_fatal (_("Reading %s section of %s failed: %s"),
- sect_name, bfd_get_filename (abfd),
- bfd_errmsg (bfd_get_error ()));
- free (contents);
- exit_status = 1;
- return NULL;
- }
-
- *size_ptr = size;
-
- return contents;
-}
-
-/* Stabs entries use a 12 byte format:
- 4 byte string table index
- 1 byte stab type
- 1 byte stab other field
- 2 byte stab desc field
- 4 byte stab value
- FIXME: This will have to change for a 64 bit object format. */
-
-#define STRDXOFF (0)
-#define TYPEOFF (4)
-#define OTHEROFF (5)
-#define DESCOFF (6)
-#define VALOFF (8)
-#define STABSIZE (12)
-
-/* Print ABFD's stabs section STABSECT_NAME (in `stabs'),
- using string table section STRSECT_NAME (in `strtab'). */
-
-static void
-print_section_stabs (bfd *abfd,
- const char *stabsect_name,
- unsigned *string_offset_ptr)
-{
- int i;
- unsigned file_string_table_offset = 0;
- unsigned next_file_string_table_offset = *string_offset_ptr;
- bfd_byte *stabp, *stabs_end;
-
- stabp = stabs;
- stabs_end = stabp + stab_size;
-
- printf (_("Contents of %s section:\n\n"), stabsect_name);
- printf ("Symnum n_type n_othr n_desc n_value n_strx String\n");
-
- /* Loop through all symbols and print them.
-
- We start the index at -1 because there is a dummy symbol on
- the front of stabs-in-{coff,elf} sections that supplies sizes. */
- for (i = -1; stabp < stabs_end; stabp += STABSIZE, i++)
- {
- const char *name;
- unsigned long strx;
- unsigned char type, other;
- unsigned short desc;
- bfd_vma value;
-
- strx = bfd_h_get_32 (abfd, stabp + STRDXOFF);
- type = bfd_h_get_8 (abfd, stabp + TYPEOFF);
- other = bfd_h_get_8 (abfd, stabp + OTHEROFF);
- desc = bfd_h_get_16 (abfd, stabp + DESCOFF);
- value = bfd_h_get_32 (abfd, stabp + VALOFF);
-
- printf ("\n%-6d ", i);
- /* Either print the stab name, or, if unnamed, print its number
- again (makes consistent formatting for tools like awk). */
- name = bfd_get_stab_name (type);
- if (name != NULL)
- printf ("%-6s", name);
- else if (type == N_UNDF)
- printf ("HdrSym");
- else
- printf ("%-6d", type);
- printf (" %-6d %-6d ", other, desc);
- bfd_printf_vma (abfd, value);
- printf (" %-6lu", strx);
-
- /* Symbols with type == 0 (N_UNDF) specify the length of the
- string table associated with this file. We use that info
- to know how to relocate the *next* file's string table indices. */
- if (type == N_UNDF)
- {
- file_string_table_offset = next_file_string_table_offset;
- next_file_string_table_offset += value;
- }
- else
- {
- /* Using the (possibly updated) string table offset, print the
- string (if any) associated with this symbol. */
- if ((strx + file_string_table_offset) < stabstr_size)
- printf (" %s", &strtab[strx + file_string_table_offset]);
- else
- printf (" *");
- }
- }
- printf ("\n\n");
- *string_offset_ptr = next_file_string_table_offset;
-}
-
-typedef struct
-{
- const char * section_name;
- const char * string_section_name;
- unsigned string_offset;
-}
-stab_section_names;
-
-static void
-find_stabs_section (bfd *abfd, asection *section, void *names)
-{
- int len;
- stab_section_names * sought = (stab_section_names *) names;
-
- /* Check for section names for which stabsect_name is a prefix, to
- handle .stab.N, etc. */
- len = strlen (sought->section_name);
-
- /* If the prefix matches, and the files section name ends with a
- nul or a digit, then we match. I.e., we want either an exact
- match or a section followed by a number. */
- if (strncmp (sought->section_name, section->name, len) == 0
- && (section->name[len] == 0
- || (section->name[len] == '.' && ISDIGIT (section->name[len + 1]))))
- {
- if (strtab == NULL)
- strtab = read_section_stabs (abfd, sought->string_section_name,
- &stabstr_size);
-
- if (strtab)
- {
- stabs = (bfd_byte *) read_section_stabs (abfd, section->name,
- &stab_size);
- if (stabs)
- print_section_stabs (abfd, section->name, &sought->string_offset);
- }
- }
-}
-
-static void
-dump_stabs_section (bfd *abfd, char *stabsect_name, char *strsect_name)
-{
- stab_section_names s;
-
- s.section_name = stabsect_name;
- s.string_section_name = strsect_name;
- s.string_offset = 0;
-
- bfd_map_over_sections (abfd, find_stabs_section, & s);
-
- free (strtab);
- strtab = NULL;
-}
-
-/* Dump the any sections containing stabs debugging information. */
-
-static void
-dump_stabs (bfd *abfd)
-{
- dump_stabs_section (abfd, ".stab", ".stabstr");
- dump_stabs_section (abfd, ".stab.excl", ".stab.exclstr");
- dump_stabs_section (abfd, ".stab.index", ".stab.indexstr");
- dump_stabs_section (abfd, "$GDB_SYMBOLS$", "$GDB_STRINGS$");
-}
-
-static void
-dump_bfd_header (bfd *abfd)
-{
- char *comma = "";
-
- printf (_("architecture: %s, "),
- bfd_printable_arch_mach (bfd_get_arch (abfd),
- bfd_get_mach (abfd)));
- printf (_("flags 0x%08x:\n"), abfd->flags);
-
-#define PF(x, y) if (abfd->flags & x) {printf("%s%s", comma, y); comma=", ";}
- PF (HAS_RELOC, "HAS_RELOC");
- PF (EXEC_P, "EXEC_P");
- PF (HAS_LINENO, "HAS_LINENO");
- PF (HAS_DEBUG, "HAS_DEBUG");
- PF (HAS_SYMS, "HAS_SYMS");
- PF (HAS_LOCALS, "HAS_LOCALS");
- PF (DYNAMIC, "DYNAMIC");
- PF (WP_TEXT, "WP_TEXT");
- PF (D_PAGED, "D_PAGED");
- PF (BFD_IS_RELAXABLE, "BFD_IS_RELAXABLE");
- PF (HAS_LOAD_PAGE, "HAS_LOAD_PAGE");
- printf (_("\nstart address 0x"));
- bfd_printf_vma (abfd, abfd->start_address);
- printf ("\n");
-}
-
-
-static void
-dump_bfd_private_header (bfd *abfd)
-{
- bfd_print_private_bfd_data (abfd, stdout);
-}
-
-
-/* Display a section in hexadecimal format with associated characters.
- Each line prefixed by the zero padded address. */
-
-static void
-dump_section (bfd *abfd, asection *section, void *dummy ATTRIBUTE_UNUSED)
-{
- bfd_byte *data = 0;
- bfd_size_type datasize;
- bfd_size_type addr_offset;
- bfd_size_type start_offset;
- bfd_size_type stop_offset;
- unsigned int opb = bfd_octets_per_byte (abfd);
- /* Bytes per line. */
- const int onaline = 16;
- char buf[64];
- int count;
- int width;
-
- if ((section->flags & SEC_HAS_CONTENTS) == 0)
- return;
-
- if (! process_section_p (section))
- return;
-
- if ((datasize = bfd_section_size (abfd, section)) == 0)
- return;
-
- /* Compute the address range to display. */
- if (start_address == (bfd_vma) -1
- || start_address < section->vma)
- start_offset = 0;
- else
- start_offset = start_address - section->vma;
-
- if (stop_address == (bfd_vma) -1)
- stop_offset = datasize / opb;
- else
- {
- if (stop_address < section->vma)
- stop_offset = 0;
- else
- stop_offset = stop_address - section->vma;
-
- if (stop_offset > datasize / opb)
- stop_offset = datasize / opb;
- }
-
- if (start_offset >= stop_offset)
- return;
-
- printf (_("Contents of section %s:"), section->name);
- if (display_file_offsets)
- printf (_(" (Starting at file offset: 0x%lx)"),
- (unsigned long) (section->filepos + start_offset));
- printf ("\n");
-
- data = xmalloc (datasize);
-
- bfd_get_section_contents (abfd, section, data, 0, datasize);
-
- width = 4;
-
- bfd_sprintf_vma (abfd, buf, start_offset + section->vma);
- if (strlen (buf) >= sizeof (buf))
- abort ();
-
- count = 0;
- while (buf[count] == '0' && buf[count+1] != '\0')
- count++;
- count = strlen (buf) - count;
- if (count > width)
- width = count;
-
- bfd_sprintf_vma (abfd, buf, stop_offset + section->vma - 1);
- if (strlen (buf) >= sizeof (buf))
- abort ();
-
- count = 0;
- while (buf[count] == '0' && buf[count+1] != '\0')
- count++;
- count = strlen (buf) - count;
- if (count > width)
- width = count;
-
- for (addr_offset = start_offset;
- addr_offset < stop_offset; addr_offset += onaline / opb)
- {
- bfd_size_type j;
-
- bfd_sprintf_vma (abfd, buf, (addr_offset + section->vma));
- count = strlen (buf);
- if ((size_t) count >= sizeof (buf))
- abort ();
-
- putchar (' ');
- while (count < width)
- {
- putchar ('0');
- count++;
- }
- fputs (buf + count - width, stdout);
- putchar (' ');
-
- for (j = addr_offset * opb;
- j < addr_offset * opb + onaline; j++)
- {
- if (j < stop_offset * opb)
- printf ("%02x", (unsigned) (data[j]));
- else
- printf (" ");
- if ((j & 3) == 3)
- printf (" ");
- }
-
- printf (" ");
- for (j = addr_offset * opb;
- j < addr_offset * opb + onaline; j++)
- {
- if (j >= stop_offset * opb)
- printf (" ");
- else
- printf ("%c", ISPRINT (data[j]) ? data[j] : '.');
- }
- putchar ('\n');
- }
- free (data);
-}
-
-/* Actually display the various requested regions. */
-
-static void
-dump_data (bfd *abfd)
-{
- bfd_map_over_sections (abfd, dump_section, NULL);
-}
-
-/* Should perhaps share code and display with nm? */
-
-static void
-dump_symbols (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean dynamic)
-{
- asymbol **current;
- long max;
- long count;
-
- if (dynamic)
- {
- current = dynsyms;
- max = dynsymcount;
- printf ("DYNAMIC SYMBOL TABLE:\n");
- }
- else
- {
- current = syms;
- max = symcount;
- printf ("SYMBOL TABLE:\n");
- }
-
- if (max == 0)
- printf (_("no symbols\n"));
-
- for (count = 0; count < max; count++)
- {
- bfd *cur_bfd;
-
- if (*current == NULL)
- printf (_("no information for symbol number %ld\n"), count);
-
- else if ((cur_bfd = bfd_asymbol_bfd (*current)) == NULL)
- printf (_("could not determine the type of symbol number %ld\n"),
- count);
-
- else if (process_section_p ((* current)->section)
- && (dump_special_syms
- || !bfd_is_target_special_symbol (cur_bfd, *current)))
- {
- const char *name = (*current)->name;
-
- if (do_demangle && name != NULL && *name != '\0')
- {
- char *alloc;
-
- /* If we want to demangle the name, we demangle it
- here, and temporarily clobber it while calling
- bfd_print_symbol. FIXME: This is a gross hack. */
- alloc = bfd_demangle (cur_bfd, name, DMGL_ANSI | DMGL_PARAMS);
- if (alloc != NULL)
- (*current)->name = alloc;
- bfd_print_symbol (cur_bfd, stdout, *current,
- bfd_print_symbol_all);
- if (alloc != NULL)
- {
- (*current)->name = name;
- free (alloc);
- }
- }
- else
- bfd_print_symbol (cur_bfd, stdout, *current,
- bfd_print_symbol_all);
- printf ("\n");
- }
-
- current++;
- }
- printf ("\n\n");
-}
-
-static void
-dump_reloc_set (bfd *abfd, asection *sec, arelent **relpp, long relcount)
-{
- arelent **p;
- char *last_filename, *last_functionname;
- unsigned int last_line;
-
- /* Get column headers lined up reasonably. */
- {
- static int width;
-
- if (width == 0)
- {
- char buf[30];
-
- bfd_sprintf_vma (abfd, buf, (bfd_vma) -1);
- width = strlen (buf) - 7;
- }
- printf ("OFFSET %*s TYPE %*s VALUE \n", width, "", 12, "");
- }
-
- last_filename = NULL;
- last_functionname = NULL;
- last_line = 0;
-
- for (p = relpp; relcount && *p != NULL; p++, relcount--)
- {
- arelent *q = *p;
- const char *filename, *functionname;
- unsigned int line;
- const char *sym_name;
- const char *section_name;
-
- if (start_address != (bfd_vma) -1
- && q->address < start_address)
- continue;
- if (stop_address != (bfd_vma) -1
- && q->address > stop_address)
- continue;
-
- if (with_line_numbers
- && sec != NULL
- && bfd_find_nearest_line (abfd, sec, syms, q->address,
- &filename, &functionname, &line))
- {
- if (functionname != NULL
- && (last_functionname == NULL
- || strcmp (functionname, last_functionname) != 0))
- {
- printf ("%s():\n", functionname);
- if (last_functionname != NULL)
- free (last_functionname);
- last_functionname = xstrdup (functionname);
- }
-
- if (line > 0
- && (line != last_line
- || (filename != NULL
- && last_filename != NULL
- && strcmp (filename, last_filename) != 0)))
- {
- printf ("%s:%u\n", filename == NULL ? "???" : filename, line);
- last_line = line;
- if (last_filename != NULL)
- free (last_filename);
- if (filename == NULL)
- last_filename = NULL;
- else
- last_filename = xstrdup (filename);
- }
- }
-
- if (q->sym_ptr_ptr && *q->sym_ptr_ptr)
- {
- sym_name = (*(q->sym_ptr_ptr))->name;
- section_name = (*(q->sym_ptr_ptr))->section->name;
- }
- else
- {
- sym_name = NULL;
- section_name = NULL;
- }
-
- bfd_printf_vma (abfd, q->address);
- if (q->howto == NULL)
- printf (" *unknown* ");
- else if (q->howto->name)
- printf (" %-16s ", q->howto->name);
- else
- printf (" %-16d ", q->howto->type);
- if (sym_name)
- objdump_print_symname (abfd, NULL, *q->sym_ptr_ptr);
- else
- {
- if (section_name == NULL)
- section_name = "*unknown*";
- printf ("[%s]", section_name);
- }
-
- if (q->addend)
- {
- printf ("+0x");
- bfd_printf_vma (abfd, q->addend);
- }
-
- printf ("\n");
- }
-}
-
-static void
-dump_relocs_in_section (bfd *abfd,
- asection *section,
- void *dummy ATTRIBUTE_UNUSED)
-{
- arelent **relpp;
- long relcount;
- long relsize;
-
- if ( bfd_is_abs_section (section)
- || bfd_is_und_section (section)
- || bfd_is_com_section (section)
- || (! process_section_p (section))
- || ((section->flags & SEC_RELOC) == 0))
- return;
-
- relsize = bfd_get_reloc_upper_bound (abfd, section);
- if (relsize < 0)
- bfd_fatal (bfd_get_filename (abfd));
-
- printf ("RELOCATION RECORDS FOR [%s]:", section->name);
-
- if (relsize == 0)
- {
- printf (" (none)\n\n");
- return;
- }
-
- relpp = xmalloc (relsize);
- relcount = bfd_canonicalize_reloc (abfd, section, relpp, syms);
-
- if (relcount < 0)
- bfd_fatal (bfd_get_filename (abfd));
- else if (relcount == 0)
- printf (" (none)\n\n");
- else
- {
- printf ("\n");
- dump_reloc_set (abfd, section, relpp, relcount);
- printf ("\n\n");
- }
- free (relpp);
-}
-
-static void
-dump_relocs (bfd *abfd)
-{
- bfd_map_over_sections (abfd, dump_relocs_in_section, NULL);
-}
-
-static void
-dump_dynamic_relocs (bfd *abfd)
-{
- long relsize;
- arelent **relpp;
- long relcount;
-
- relsize = bfd_get_dynamic_reloc_upper_bound (abfd);
- if (relsize < 0)
- bfd_fatal (bfd_get_filename (abfd));
-
- printf ("DYNAMIC RELOCATION RECORDS");
-
- if (relsize == 0)
- printf (" (none)\n\n");
- else
- {
- relpp = xmalloc (relsize);
- relcount = bfd_canonicalize_dynamic_reloc (abfd, relpp, dynsyms);
-
- if (relcount < 0)
- bfd_fatal (bfd_get_filename (abfd));
- else if (relcount == 0)
- printf (" (none)\n\n");
- else
- {
- printf ("\n");
- dump_reloc_set (abfd, NULL, relpp, relcount);
- printf ("\n\n");
- }
- free (relpp);
- }
-}
-
-/* Creates a table of paths, to search for source files. */
-
-static void
-add_include_path (const char *path)
-{
- if (path[0] == 0)
- return;
- include_path_count++;
- include_paths = xrealloc (include_paths,
- include_path_count * sizeof (*include_paths));
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
- if (path[1] == ':' && path[2] == 0)
- path = concat (path, ".", (const char *) 0);
-#endif
- include_paths[include_path_count - 1] = path;
-}
-
-static void
-adjust_addresses (bfd *abfd ATTRIBUTE_UNUSED,
- asection *section,
- void *arg)
-{
- if ((section->flags & SEC_DEBUGGING) == 0)
- {
- bfd_boolean *has_reloc_p = (bfd_boolean *) arg;
- section->vma += adjust_section_vma;
- if (*has_reloc_p)
- section->lma += adjust_section_vma;
- }
-}
-
-/* Dump selected contents of ABFD. */
-
-static void
-dump_bfd (bfd *abfd)
-{
- /* If we are adjusting section VMA's, change them all now. Changing
- the BFD information is a hack. However, we must do it, or
- bfd_find_nearest_line will not do the right thing. */
- if (adjust_section_vma != 0)
- {
- bfd_boolean has_reloc = (abfd->flags & HAS_RELOC);
- bfd_map_over_sections (abfd, adjust_addresses, &has_reloc);
- }
-
- if (! dump_debugging_tags)
- printf (_("\n%s: file format %s\n"), bfd_get_filename (abfd),
- abfd->xvec->name);
- if (dump_ar_hdrs)
- print_arelt_descr (stdout, abfd, TRUE);
- if (dump_file_header)
- dump_bfd_header (abfd);
- if (dump_private_headers)
- dump_bfd_private_header (abfd);
- if (! dump_debugging_tags)
- putchar ('\n');
- if (dump_section_headers)
- dump_headers (abfd);
-
- if (dump_symtab
- || dump_reloc_info
- || disassemble
- || dump_debugging
- || dump_dwarf_section_info)
- syms = slurp_symtab (abfd);
- if (dump_dynamic_symtab || dump_dynamic_reloc_info
- || (disassemble && bfd_get_dynamic_symtab_upper_bound (abfd) > 0))
- dynsyms = slurp_dynamic_symtab (abfd);
- if (disassemble)
- {
- synthcount = bfd_get_synthetic_symtab (abfd, symcount, syms,
- dynsymcount, dynsyms, &synthsyms);
- if (synthcount < 0)
- synthcount = 0;
- }
-
- if (dump_symtab)
- dump_symbols (abfd, FALSE);
- if (dump_dynamic_symtab)
- dump_symbols (abfd, TRUE);
- if (dump_dwarf_section_info)
- dump_dwarf (abfd);
- if (dump_stab_section_info)
- dump_stabs (abfd);
- if (dump_reloc_info && ! disassemble)
- dump_relocs (abfd);
- if (dump_dynamic_reloc_info && ! disassemble)
- dump_dynamic_relocs (abfd);
- if (dump_section_contents)
- dump_data (abfd);
- if (disassemble)
- disassemble_data (abfd);
-
- if (dump_debugging)
- {
- void *dhandle;
-
- dhandle = read_debugging_info (abfd, syms, symcount, TRUE);
- if (dhandle != NULL)
- {
- if (!print_debugging_info (stdout, dhandle, abfd, syms,
- bfd_demangle,
- dump_debugging_tags ? TRUE : FALSE))
- {
- non_fatal (_("%s: printing debugging information failed"),
- bfd_get_filename (abfd));
- exit_status = 1;
- }
- }
- /* PR 6483: If there was no STABS or IEEE debug
- info in the file, try DWARF instead. */
- else if (! dump_dwarf_section_info)
- {
- dump_dwarf (abfd);
- }
- }
-
- if (syms)
- {
- free (syms);
- syms = NULL;
- }
-
- if (dynsyms)
- {
- free (dynsyms);
- dynsyms = NULL;
- }
-
- if (synthsyms)
- {
- free (synthsyms);
- synthsyms = NULL;
- }
-
- symcount = 0;
- dynsymcount = 0;
- synthcount = 0;
-}
-
-static void
-display_bfd (bfd *abfd)
-{
- char **matching;
-
- if (bfd_check_format_matches (abfd, bfd_object, &matching))
- {
- dump_bfd (abfd);
- return;
- }
-
- if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- nonfatal (bfd_get_filename (abfd));
- list_matching_formats (matching);
- free (matching);
- return;
- }
-
- if (bfd_get_error () != bfd_error_file_not_recognized)
- {
- nonfatal (bfd_get_filename (abfd));
- return;
- }
-
- if (bfd_check_format_matches (abfd, bfd_core, &matching))
- {
- dump_bfd (abfd);
- return;
- }
-
- nonfatal (bfd_get_filename (abfd));
-
- if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
- {
- list_matching_formats (matching);
- free (matching);
- }
-}
-
-static void
-display_file (char *filename, char *target)
-{
- bfd *file;
- bfd *arfile = NULL;
-
- if (get_file_size (filename) < 1)
- {
- exit_status = 1;
- return;
- }
-
- file = bfd_openr (filename, target);
- if (file == NULL)
- {
- nonfatal (filename);
- return;
- }
-
- /* If the file is an archive, process all of its elements. */
- if (bfd_check_format (file, bfd_archive))
- {
- bfd *last_arfile = NULL;
-
- printf (_("In archive %s:\n"), bfd_get_filename (file));
- 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)
- nonfatal (bfd_get_filename (file));
- break;
- }
-
- display_bfd (arfile);
-
- if (last_arfile != NULL)
- bfd_close (last_arfile);
- last_arfile = arfile;
- }
-
- if (last_arfile != NULL)
- bfd_close (last_arfile);
- }
- else
- display_bfd (file);
-
- bfd_close (file);
-}
-
-int
-main (int argc, char **argv)
-{
- int c;
- char *target = default_target;
- bfd_boolean seenflag = FALSE;
-
-#if defined (HAVE_SETLOCALE)
-#if defined (HAVE_LC_MESSAGES)
- setlocale (LC_MESSAGES, "");
-#endif
- setlocale (LC_CTYPE, "");
-#endif
-
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
-
- program_name = *argv;
- xmalloc_set_program_name (program_name);
-
- START_PROGRESS (program_name, 0);
-
- expandargv (&argc, &argv);
-
- bfd_init ();
- set_default_bfd_target ();
-
- while ((c = getopt_long (argc, argv, "pib:m:M:VvCdDlfFaHhrRtTxsSI:j:wE:zgeGW",
- long_options, (int *) 0))
- != EOF)
- {
- switch (c)
- {
- case 0:
- break; /* We've been given a long option. */
- case 'm':
- machine = optarg;
- break;
- case 'M':
- if (disassembler_options)
- /* Ignore potential memory leak for now. */
- disassembler_options = concat (disassembler_options, ",",
- optarg, (const char *) NULL);
- else
- disassembler_options = optarg;
- break;
- case 'j':
- if (only_used == only_size)
- {
- only_size += 8;
- only = xrealloc (only, only_size * sizeof (char *));
- }
- only [only_used++] = optarg;
- break;
- case 'F':
- display_file_offsets = TRUE;
- break;
- case 'l':
- with_line_numbers = TRUE;
- break;
- 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 'w':
- wide_output = TRUE;
- break;
- case OPTION_ADJUST_VMA:
- adjust_section_vma = parse_vma (optarg, "--adjust-vma");
- break;
- case OPTION_START_ADDRESS:
- start_address = parse_vma (optarg, "--start-address");
- if ((stop_address != (bfd_vma) -1) && stop_address <= start_address)
- fatal (_("error: the start address should be before the end address"));
- break;
- case OPTION_STOP_ADDRESS:
- stop_address = parse_vma (optarg, "--stop-address");
- if ((start_address != (bfd_vma) -1) && stop_address <= start_address)
- fatal (_("error: the stop address should be after the start address"));
- break;
- case 'E':
- if (strcmp (optarg, "B") == 0)
- endian = BFD_ENDIAN_BIG;
- else if (strcmp (optarg, "L") == 0)
- endian = BFD_ENDIAN_LITTLE;
- else
- {
- non_fatal (_("unrecognized -E option"));
- usage (stderr, 1);
- }
- break;
- case OPTION_ENDIAN:
- if (strncmp (optarg, "big", strlen (optarg)) == 0)
- endian = BFD_ENDIAN_BIG;
- else if (strncmp (optarg, "little", strlen (optarg)) == 0)
- endian = BFD_ENDIAN_LITTLE;
- else
- {
- non_fatal (_("unrecognized --endian type `%s'"), optarg);
- usage (stderr, 1);
- }
- break;
-
- case 'f':
- dump_file_header = TRUE;
- seenflag = TRUE;
- break;
- case 'i':
- formats_info = TRUE;
- seenflag = TRUE;
- break;
- case 'I':
- add_include_path (optarg);
- break;
- case 'p':
- dump_private_headers = TRUE;
- seenflag = TRUE;
- break;
- case 'x':
- dump_private_headers = TRUE;
- dump_symtab = TRUE;
- dump_reloc_info = TRUE;
- dump_file_header = TRUE;
- dump_ar_hdrs = TRUE;
- dump_section_headers = TRUE;
- seenflag = TRUE;
- break;
- case 't':
- dump_symtab = TRUE;
- seenflag = TRUE;
- break;
- case 'T':
- dump_dynamic_symtab = TRUE;
- seenflag = TRUE;
- break;
- case 'd':
- disassemble = TRUE;
- seenflag = TRUE;
- break;
- case 'z':
- disassemble_zeroes = TRUE;
- break;
- case 'D':
- disassemble = TRUE;
- disassemble_all = TRUE;
- seenflag = TRUE;
- break;
- case 'S':
- disassemble = TRUE;
- with_source_code = TRUE;
- seenflag = TRUE;
- break;
- case 'g':
- dump_debugging = 1;
- seenflag = TRUE;
- break;
- case 'e':
- dump_debugging = 1;
- dump_debugging_tags = 1;
- do_demangle = TRUE;
- seenflag = TRUE;
- break;
- case 'W':
- dump_dwarf_section_info = TRUE;
- seenflag = TRUE;
- do_debug_info = 1;
- do_debug_abbrevs = 1;
- do_debug_lines = 1;
- do_debug_pubnames = 1;
- do_debug_aranges = 1;
- do_debug_ranges = 1;
- do_debug_frames = 1;
- do_debug_macinfo = 1;
- do_debug_str = 1;
- do_debug_loc = 1;
- break;
- case 'G':
- dump_stab_section_info = TRUE;
- seenflag = TRUE;
- break;
- case 's':
- dump_section_contents = TRUE;
- seenflag = TRUE;
- break;
- case 'r':
- dump_reloc_info = TRUE;
- seenflag = TRUE;
- break;
- case 'R':
- dump_dynamic_reloc_info = TRUE;
- seenflag = TRUE;
- break;
- case 'a':
- dump_ar_hdrs = TRUE;
- seenflag = TRUE;
- break;
- case 'h':
- dump_section_headers = TRUE;
- seenflag = TRUE;
- break;
- case 'H':
- usage (stdout, 0);
- seenflag = TRUE;
- case 'v':
- case 'V':
- show_version = TRUE;
- seenflag = TRUE;
- break;
-
- default:
- usage (stderr, 1);
- }
- }
-
- if (show_version)
- print_version ("objdump");
-
- if (!seenflag)
- usage (stderr, 2);
-
- if (formats_info)
- exit_status = display_info ();
- else
- {
- if (optind == argc)
- display_file ("a.out", target);
- else
- for (; optind < argc;)
- display_file (argv[optind++], target);
- }
-
- END_PROGRESS (program_name);
-
- return exit_status;
-}
diff --git a/binutils/readelf.c b/binutils/readelf.c
deleted file mode 100644
index c260e9ab3a7..00000000000
--- a/binutils/readelf.c
+++ /dev/null
@@ -1,10851 +0,0 @@
-/* readelf.c -- display contents of an ELF format file
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008 Free Software Foundation, Inc.
-
- Originally developed by Eric Youngdale <eric@andante.jic.com>
- Modifications by Nick Clifton <nickc@redhat.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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-/* The difference between readelf and objdump:
-
- Both programs are capable of displaying the contents of ELF format files,
- so why does the binutils project have two file dumpers ?
-
- The reason is that objdump sees an ELF file through a BFD filter of the
- world; if BFD has a bug where, say, it disagrees about a machine constant
- in e_flags, then the odds are good that it will remain internally
- consistent. The linker sees it the BFD way, objdump sees it the BFD way,
- GAS sees it the BFD way. There was need for a tool to go find out what
- the file actually says.
-
- This is why the readelf program does not link against the BFD library - it
- exists as an independent program to help verify the correct working of BFD.
-
- There is also the case that readelf can provide more information about an
- ELF file than is provided by objdump. In particular it can display DWARF
- debugging information which (at the moment) objdump cannot. */
-
-#include "config.h"
-#include "sysdep.h"
-#include <assert.h>
-#include <sys/stat.h>
-#include <time.h>
-#ifdef HAVE_ZLIB_H
-#include <zlib.h>
-#endif
-
-/* for PATH_MAX */
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
-#ifndef PATH_MAX
-/* for MAXPATHLEN */
-# ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-# endif
-# ifndef PATH_MAX
-# ifdef MAXPATHLEN
-# define PATH_MAX MAXPATHLEN
-# else
-# define PATH_MAX 1024
-# endif
-# endif
-#endif
-
-#if __GNUC__ >= 2
-/* Define BFD64 here, even if our default architecture is 32 bit ELF
- as this will allow us to read in and parse 64bit and 32bit ELF files.
- Only do this if we believe that the compiler can support a 64 bit
- data type. For now we only rely on GCC being able to do this. */
-#define BFD64
-#endif
-
-#include "bfd.h"
-#include "bucomm.h"
-#include "dwarf.h"
-
-#include "elf/common.h"
-#include "elf/external.h"
-#include "elf/internal.h"
-
-
-/* Included here, before RELOC_MACROS_GEN_FUNC is defined, so that
- we can obtain the H8 reloc numbers. We need these for the
- get_reloc_size() function. We include h8.h again after defining
- RELOC_MACROS_GEN_FUNC so that we get the naming function as well. */
-
-#include "elf/h8.h"
-#undef _ELF_H8_H
-
-/* Undo the effects of #including reloc-macros.h. */
-
-#undef START_RELOC_NUMBERS
-#undef RELOC_NUMBER
-#undef FAKE_RELOC
-#undef EMPTY_RELOC
-#undef END_RELOC_NUMBERS
-#undef _RELOC_MACROS_H
-
-/* The following headers use the elf/reloc-macros.h file to
- automatically generate relocation recognition functions
- such as elf_mips_reloc_type() */
-
-#define RELOC_MACROS_GEN_FUNC
-
-#include "elf/alpha.h"
-#include "elf/arc.h"
-#include "elf/arm.h"
-#include "elf/avr.h"
-#include "elf/bfin.h"
-#include "elf/cr16.h"
-#include "elf/cris.h"
-#include "elf/crx.h"
-#include "elf/d10v.h"
-#include "elf/d30v.h"
-#include "elf/dlx.h"
-#include "elf/fr30.h"
-#include "elf/frv.h"
-#include "elf/h8.h"
-#include "elf/hppa.h"
-#include "elf/i386.h"
-#include "elf/i370.h"
-#include "elf/i860.h"
-#include "elf/i960.h"
-#include "elf/ia64.h"
-#include "elf/ip2k.h"
-#include "elf/iq2000.h"
-#include "elf/m32c.h"
-#include "elf/m32r.h"
-#include "elf/m68k.h"
-#include "elf/m68hc11.h"
-#include "elf/mcore.h"
-#include "elf/mep.h"
-#include "elf/mips.h"
-#include "elf/mmix.h"
-#include "elf/mn10200.h"
-#include "elf/mn10300.h"
-#include "elf/mt.h"
-#include "elf/msp430.h"
-#include "elf/or32.h"
-#include "elf/pj.h"
-#include "elf/ppc.h"
-#include "elf/ppc64.h"
-#include "elf/s390.h"
-#include "elf/score.h"
-#include "elf/sh.h"
-#include "elf/sparc.h"
-#include "elf/spu.h"
-#include "elf/v850.h"
-#include "elf/vax.h"
-#include "elf/x86-64.h"
-#include "elf/xstormy16.h"
-#include "elf/xtensa.h"
-
-#include "aout/ar.h"
-
-#include "getopt.h"
-#include "libiberty.h"
-#include "safe-ctype.h"
-
-char *program_name = "readelf";
-int do_wide;
-static long archive_file_offset;
-static unsigned long archive_file_size;
-static unsigned long dynamic_addr;
-static bfd_size_type dynamic_size;
-static unsigned int dynamic_nent;
-static char *dynamic_strings;
-static unsigned long dynamic_strings_length;
-static char *string_table;
-static unsigned long string_table_length;
-static unsigned long num_dynamic_syms;
-static Elf_Internal_Sym *dynamic_symbols;
-static Elf_Internal_Syminfo *dynamic_syminfo;
-static unsigned long dynamic_syminfo_offset;
-static unsigned int dynamic_syminfo_nent;
-static char program_interpreter[PATH_MAX];
-static bfd_vma dynamic_info[DT_JMPREL + 1];
-static bfd_vma dynamic_info_DT_GNU_HASH;
-static bfd_vma version_info[16];
-static Elf_Internal_Ehdr elf_header;
-static Elf_Internal_Shdr *section_headers;
-static Elf_Internal_Phdr *program_headers;
-static Elf_Internal_Dyn *dynamic_section;
-static Elf_Internal_Shdr *symtab_shndx_hdr;
-static int show_name;
-static int do_dynamic;
-static int do_syms;
-static int do_reloc;
-static int do_sections;
-static int do_section_groups;
-static int do_section_details;
-static int do_segments;
-static int do_unwind;
-static int do_using_dynamic;
-static int do_header;
-static int do_dump;
-static int do_version;
-static int do_histogram;
-static int do_debugging;
-static int do_arch;
-static int do_notes;
-static int do_archive_index;
-static int is_32bit_elf;
-
-struct group_list
-{
- struct group_list *next;
- unsigned int section_index;
-};
-
-struct group
-{
- struct group_list *root;
- unsigned int group_index;
-};
-
-static size_t group_count;
-static struct group *section_groups;
-static struct group **section_headers_groups;
-
-
-/* Flag bits indicating particular types of dump. */
-#define HEX_DUMP (1 << 0) /* The -x command line switch. */
-#define DISASS_DUMP (1 << 1) /* The -i command line switch. */
-#define DEBUG_DUMP (1 << 2) /* The -w command line switch. */
-#define STRING_DUMP (1 << 3) /* The -p command line switch. */
-
-typedef unsigned char dump_type;
-
-/* A linked list of the section names for which dumps were requested. */
-struct dump_list_entry
-{
- char *name;
- dump_type type;
- struct dump_list_entry *next;
-};
-static struct dump_list_entry *dump_sects_byname;
-
-/* A dynamic array of flags indicating for which sections a dump
- has been requested via command line switches. */
-static dump_type * cmdline_dump_sects = NULL;
-static unsigned int num_cmdline_dump_sects = 0;
-
-/* A dynamic array of flags indicating for which sections a dump of
- some kind has been requested. It is reset on a per-object file
- basis and then initialised from the cmdline_dump_sects array,
- the results of interpreting the -w switch, and the
- dump_sects_byname list. */
-static dump_type * dump_sects = NULL;
-static unsigned int num_dump_sects = 0;
-
-
-/* How to print a vma value. */
-typedef enum print_mode
-{
- HEX,
- DEC,
- DEC_5,
- UNSIGNED,
- PREFIX_HEX,
- FULL_HEX,
- LONG_HEX
-}
-print_mode;
-
-static void (*byte_put) (unsigned char *, bfd_vma, int);
-
-#define UNKNOWN -1
-
-#define SECTION_NAME(X) \
- ((X) == NULL ? "<none>" \
- : string_table == NULL ? "<no-name>" \
- : ((X)->sh_name >= string_table_length ? "<corrupt>" \
- : string_table + (X)->sh_name))
-
-#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */
-
-#define BYTE_GET(field) byte_get (field, sizeof (field))
-
-#define GET_ELF_SYMBOLS(file, section) \
- (is_32bit_elf ? get_32bit_elf_symbols (file, section) \
- : get_64bit_elf_symbols (file, section))
-
-#define VALID_DYNAMIC_NAME(offset) ((dynamic_strings != NULL) && (offset < dynamic_strings_length))
-/* GET_DYNAMIC_NAME asssumes that VALID_DYNAMIC_NAME has
- already been called and verified that the string exists. */
-#define GET_DYNAMIC_NAME(offset) (dynamic_strings + offset)
-
-/* This is just a bit of syntatic sugar. */
-#define streq(a,b) (strcmp ((a), (b)) == 0)
-#define strneq(a,b,n) (strncmp ((a), (b), (n)) == 0)
-#define const_strneq(a,b) (strncmp ((a), (b), sizeof (b) - 1) == 0)
-
-static void *
-get_data (void *var, FILE *file, long offset, size_t size, size_t nmemb,
- const char *reason)
-{
- void *mvar;
-
- if (size == 0 || nmemb == 0)
- return NULL;
-
- if (fseek (file, archive_file_offset + offset, SEEK_SET))
- {
- error (_("Unable to seek to 0x%lx for %s\n"),
- (unsigned long) archive_file_offset + offset, reason);
- return NULL;
- }
-
- mvar = var;
- if (mvar == NULL)
- {
- /* Check for overflow. */
- if (nmemb < (~(size_t) 0 - 1) / size)
- /* + 1 so that we can '\0' terminate invalid string table sections. */
- mvar = malloc (size * nmemb + 1);
-
- if (mvar == NULL)
- {
- error (_("Out of memory allocating 0x%lx bytes for %s\n"),
- (unsigned long)(size * nmemb), reason);
- return NULL;
- }
-
- ((char *) mvar)[size * nmemb] = '\0';
- }
-
- if (fread (mvar, size, nmemb, file) != nmemb)
- {
- error (_("Unable to read in 0x%lx bytes of %s\n"),
- (unsigned long)(size * nmemb), reason);
- if (mvar != var)
- free (mvar);
- return NULL;
- }
-
- return mvar;
-}
-
-static void
-byte_put_little_endian (unsigned char *field, bfd_vma value, int size)
-{
- switch (size)
- {
- case 8:
- field[7] = (((value >> 24) >> 24) >> 8) & 0xff;
- field[6] = ((value >> 24) >> 24) & 0xff;
- field[5] = ((value >> 24) >> 16) & 0xff;
- field[4] = ((value >> 24) >> 8) & 0xff;
- /* Fall through. */
- case 4:
- field[3] = (value >> 24) & 0xff;
- field[2] = (value >> 16) & 0xff;
- /* Fall through. */
- case 2:
- field[1] = (value >> 8) & 0xff;
- /* Fall through. */
- case 1:
- field[0] = value & 0xff;
- break;
-
- default:
- error (_("Unhandled data length: %d\n"), size);
- abort ();
- }
-}
-
-/* Print a VMA value. */
-static int
-print_vma (bfd_vma vma, print_mode mode)
-{
- int nc = 0;
-
- switch (mode)
- {
- case FULL_HEX:
- nc = printf ("0x");
- /* Drop through. */
-
- case LONG_HEX:
-#ifdef BFD64
- if (is_32bit_elf)
- return nc + printf ("%8.8" BFD_VMA_FMT "x", vma);
-#endif
- printf_vma (vma);
- return nc + 16;
-
- case DEC_5:
- if (vma <= 99999)
- return printf ("%5" BFD_VMA_FMT "d", vma);
- /* Drop through. */
-
- case PREFIX_HEX:
- nc = printf ("0x");
- /* Drop through. */
-
- case HEX:
- return nc + printf ("%" BFD_VMA_FMT "x", vma);
-
- case DEC:
- return printf ("%" BFD_VMA_FMT "d", vma);
-
- case UNSIGNED:
- return printf ("%" BFD_VMA_FMT "u", vma);
- }
- return 0;
-}
-
-/* Display a symbol on stdout. Handles the display of
- non-printing characters.
- If DO_WIDE is not true then format the symbol to be
- at most WIDTH characters, truncating as necessary.
- If WIDTH is negative then format the string to be
- exactly - WIDTH characters, truncating or padding
- as necessary. */
-
-static void
-print_symbol (int width, const char *symbol)
-{
- const char * format_string;
- const char * c;
-
- if (do_wide)
- {
- format_string = "%.*s";
- /* Set the width to a very large value. This simplifies the code below. */
- width = INT_MAX;
- }
- else if (width < 0)
- {
- format_string = "%-*.*2s";
- /* Keep the width positive. This also helps. */
- width = - width;
- }
- else
- {
- format_string = "%-.*s";
- }
-
- while (width)
- {
- int len;
-
- c = symbol;
-
- /* Look for non-printing symbols inside the symbol's name.
- This test is triggered in particular by the names generated
- by the assembler for local labels. */
- while (ISPRINT (* c))
- c++;
-
- len = c - symbol;
-
- if (len)
- {
- if (len > width)
- len = width;
-
- printf (format_string, len, symbol);
-
- width -= len;
- }
-
- if (* c == 0 || width == 0)
- break;
-
- /* Now display the non-printing character, if
- there is room left in which to dipslay it. */
- if (*c < 32)
- {
- if (width < 2)
- break;
-
- printf ("^%c", *c + 0x40);
-
- width -= 2;
- }
- else
- {
- if (width < 6)
- break;
-
- printf ("<0x%.2x>", *c);
-
- width -= 6;
- }
-
- symbol = c + 1;
- }
-}
-
-static void
-byte_put_big_endian (unsigned char *field, bfd_vma value, int size)
-{
- switch (size)
- {
- case 8:
- field[7] = value & 0xff;
- field[6] = (value >> 8) & 0xff;
- field[5] = (value >> 16) & 0xff;
- field[4] = (value >> 24) & 0xff;
- value >>= 16;
- value >>= 16;
- /* Fall through. */
- case 4:
- field[3] = value & 0xff;
- field[2] = (value >> 8) & 0xff;
- value >>= 16;
- /* Fall through. */
- case 2:
- field[1] = value & 0xff;
- value >>= 8;
- /* Fall through. */
- case 1:
- field[0] = value & 0xff;
- break;
-
- default:
- error (_("Unhandled data length: %d\n"), size);
- abort ();
- }
-}
-
-/* Return a pointer to section NAME, or NULL if no such section exists. */
-
-static Elf_Internal_Shdr *
-find_section (const char *name)
-{
- unsigned int i;
-
- for (i = 0; i < elf_header.e_shnum; i++)
- if (streq (SECTION_NAME (section_headers + i), name))
- return section_headers + i;
-
- return NULL;
-}
-
-/* Guess the relocation size commonly used by the specific machines. */
-
-static int
-guess_is_rela (unsigned int e_machine)
-{
- switch (e_machine)
- {
- /* Targets that use REL relocations. */
- case EM_386:
- case EM_486:
- case EM_960:
- case EM_ARM:
- case EM_D10V:
- case EM_CYGNUS_D10V:
- case EM_DLX:
- case EM_MIPS:
- case EM_MIPS_RS3_LE:
- case EM_CYGNUS_M32R:
- case EM_OPENRISC:
- case EM_OR32:
- case EM_SCORE:
- return FALSE;
-
- /* Targets that use RELA relocations. */
- case EM_68K:
- case EM_860:
- case EM_ALPHA:
- case EM_ALTERA_NIOS2:
- case EM_AVR:
- case EM_AVR_OLD:
- case EM_BLACKFIN:
- case EM_CR16:
- case EM_CR16_OLD:
- case EM_CRIS:
- case EM_CRX:
- case EM_D30V:
- case EM_CYGNUS_D30V:
- case EM_FR30:
- case EM_CYGNUS_FR30:
- case EM_CYGNUS_FRV:
- case EM_H8S:
- case EM_H8_300:
- case EM_H8_300H:
- case EM_IA_64:
- case EM_IP2K:
- case EM_IP2K_OLD:
- case EM_IQ2000:
- case EM_M32C_OLD:
- case EM_M32C:
- case EM_M32R:
- case EM_MCORE:
- case EM_CYGNUS_MEP:
- case EM_MMIX:
- case EM_MN10200:
- case EM_CYGNUS_MN10200:
- case EM_MN10300:
- case EM_CYGNUS_MN10300:
- case EM_MSP430:
- case EM_MSP430_OLD:
- case EM_MT:
- case EM_NIOS32:
- case EM_PPC64:
- case EM_PPC:
- case EM_S390:
- case EM_S390_OLD:
- case EM_SH:
- case EM_SPARC:
- case EM_SPARC32PLUS:
- case EM_SPARCV9:
- case EM_SPU:
- case EM_V850:
- case EM_CYGNUS_V850:
- case EM_VAX:
- case EM_X86_64:
- case EM_XSTORMY16:
- case EM_XTENSA:
- case EM_XTENSA_OLD:
- return TRUE;
-
- case EM_68HC05:
- case EM_68HC08:
- case EM_68HC11:
- case EM_68HC16:
- case EM_FX66:
- case EM_ME16:
- case EM_MMA:
- case EM_NCPU:
- case EM_NDR1:
- case EM_PCP:
- case EM_ST100:
- case EM_ST19:
- case EM_ST7:
- case EM_ST9PLUS:
- case EM_STARCORE:
- case EM_SVX:
- case EM_TINYJ:
- default:
- warn (_("Don't know about relocations on this machine architecture\n"));
- return FALSE;
- }
-}
-
-static int
-slurp_rela_relocs (FILE *file,
- unsigned long rel_offset,
- unsigned long rel_size,
- Elf_Internal_Rela **relasp,
- unsigned long *nrelasp)
-{
- Elf_Internal_Rela *relas;
- unsigned long nrelas;
- unsigned int i;
-
- if (is_32bit_elf)
- {
- Elf32_External_Rela *erelas;
-
- erelas = get_data (NULL, file, rel_offset, 1, rel_size, _("relocs"));
- if (!erelas)
- return 0;
-
- nrelas = rel_size / sizeof (Elf32_External_Rela);
-
- relas = cmalloc (nrelas, sizeof (Elf_Internal_Rela));
-
- if (relas == NULL)
- {
- free (erelas);
- error (_("out of memory parsing relocs\n"));
- return 0;
- }
-
- for (i = 0; i < nrelas; i++)
- {
- relas[i].r_offset = BYTE_GET (erelas[i].r_offset);
- relas[i].r_info = BYTE_GET (erelas[i].r_info);
- relas[i].r_addend = BYTE_GET (erelas[i].r_addend);
- }
-
- free (erelas);
- }
- else
- {
- Elf64_External_Rela *erelas;
-
- erelas = get_data (NULL, file, rel_offset, 1, rel_size, _("relocs"));
- if (!erelas)
- return 0;
-
- nrelas = rel_size / sizeof (Elf64_External_Rela);
-
- relas = cmalloc (nrelas, sizeof (Elf_Internal_Rela));
-
- if (relas == NULL)
- {
- free (erelas);
- error (_("out of memory parsing relocs\n"));
- return 0;
- }
-
- for (i = 0; i < nrelas; i++)
- {
- relas[i].r_offset = BYTE_GET (erelas[i].r_offset);
- relas[i].r_info = BYTE_GET (erelas[i].r_info);
- relas[i].r_addend = BYTE_GET (erelas[i].r_addend);
- }
-
- free (erelas);
- }
- *relasp = relas;
- *nrelasp = nrelas;
- return 1;
-}
-
-static int
-slurp_rel_relocs (FILE *file,
- unsigned long rel_offset,
- unsigned long rel_size,
- Elf_Internal_Rela **relsp,
- unsigned long *nrelsp)
-{
- Elf_Internal_Rela *rels;
- unsigned long nrels;
- unsigned int i;
-
- if (is_32bit_elf)
- {
- Elf32_External_Rel *erels;
-
- erels = get_data (NULL, file, rel_offset, 1, rel_size, _("relocs"));
- if (!erels)
- return 0;
-
- nrels = rel_size / sizeof (Elf32_External_Rel);
-
- rels = cmalloc (nrels, sizeof (Elf_Internal_Rela));
-
- if (rels == NULL)
- {
- free (erels);
- error (_("out of memory parsing relocs\n"));
- return 0;
- }
-
- for (i = 0; i < nrels; i++)
- {
- rels[i].r_offset = BYTE_GET (erels[i].r_offset);
- rels[i].r_info = BYTE_GET (erels[i].r_info);
- rels[i].r_addend = 0;
- }
-
- free (erels);
- }
- else
- {
- Elf64_External_Rel *erels;
-
- erels = get_data (NULL, file, rel_offset, 1, rel_size, _("relocs"));
- if (!erels)
- return 0;
-
- nrels = rel_size / sizeof (Elf64_External_Rel);
-
- rels = cmalloc (nrels, sizeof (Elf_Internal_Rela));
-
- if (rels == NULL)
- {
- free (erels);
- error (_("out of memory parsing relocs\n"));
- return 0;
- }
-
- for (i = 0; i < nrels; i++)
- {
- rels[i].r_offset = BYTE_GET (erels[i].r_offset);
- rels[i].r_info = BYTE_GET (erels[i].r_info);
- rels[i].r_addend = 0;
- }
-
- free (erels);
- }
- *relsp = rels;
- *nrelsp = nrels;
- return 1;
-}
-
-/* Returns the reloc type extracted from the reloc info field. */
-
-static unsigned int
-get_reloc_type (bfd_vma reloc_info)
-{
- if (is_32bit_elf)
- return ELF32_R_TYPE (reloc_info);
-
- switch (elf_header.e_machine)
- {
- case EM_MIPS:
- /* Note: We assume that reloc_info has already been adjusted for us. */
- return ELF64_MIPS_R_TYPE (reloc_info);
-
- case EM_SPARCV9:
- return ELF64_R_TYPE_ID (reloc_info);
-
- default:
- return ELF64_R_TYPE (reloc_info);
- }
-}
-
-/* Return the symbol index extracted from the reloc info field. */
-
-static bfd_vma
-get_reloc_symindex (bfd_vma reloc_info)
-{
- return is_32bit_elf ? ELF32_R_SYM (reloc_info) : ELF64_R_SYM (reloc_info);
-}
-
-/* Display the contents of the relocation data found at the specified
- offset. */
-
-static void
-dump_relocations (FILE *file,
- unsigned long rel_offset,
- unsigned long rel_size,
- Elf_Internal_Sym *symtab,
- unsigned long nsyms,
- char *strtab,
- unsigned long strtablen,
- int is_rela)
-{
- unsigned int i;
- Elf_Internal_Rela *rels;
-
-
- if (is_rela == UNKNOWN)
- is_rela = guess_is_rela (elf_header.e_machine);
-
- if (is_rela)
- {
- if (!slurp_rela_relocs (file, rel_offset, rel_size, &rels, &rel_size))
- return;
- }
- else
- {
- if (!slurp_rel_relocs (file, rel_offset, rel_size, &rels, &rel_size))
- return;
- }
-
- if (is_32bit_elf)
- {
- if (is_rela)
- {
- if (do_wide)
- printf (_(" Offset Info Type Sym. Value Symbol's Name + Addend\n"));
- else
- printf (_(" Offset Info Type Sym.Value Sym. Name + Addend\n"));
- }
- else
- {
- if (do_wide)
- printf (_(" Offset Info Type Sym. Value Symbol's Name\n"));
- else
- printf (_(" Offset Info Type Sym.Value Sym. Name\n"));
- }
- }
- else
- {
- if (is_rela)
- {
- if (do_wide)
- printf (_(" Offset Info Type Symbol's Value Symbol's Name + Addend\n"));
- else
- printf (_(" Offset Info Type Sym. Value Sym. Name + Addend\n"));
- }
- else
- {
- if (do_wide)
- printf (_(" Offset Info Type Symbol's Value Symbol's Name\n"));
- else
- printf (_(" Offset Info Type Sym. Value Sym. Name\n"));
- }
- }
-
- for (i = 0; i < rel_size; i++)
- {
- const char *rtype;
- bfd_vma offset;
- bfd_vma info;
- bfd_vma symtab_index;
- bfd_vma type;
-
- offset = rels[i].r_offset;
- info = rels[i].r_info;
-
- /* The #ifdef BFD64 below is to prevent a compile time warning.
- We know that if we do not have a 64 bit data type that we
- will never execute this code anyway. */
-#ifdef BFD64
- if (!is_32bit_elf
- && elf_header.e_machine == EM_MIPS
- && elf_header.e_ident[EI_DATA] != ELFDATA2MSB)
- {
- /* In little-endian objects, r_info isn't really a 64-bit
- little-endian value: it has a 32-bit little-endian
- symbol index followed by four individual byte fields.
- Reorder INFO accordingly. */
- info = (((info & 0xffffffff) << 32)
- | ((info >> 56) & 0xff)
- | ((info >> 40) & 0xff00)
- | ((info >> 24) & 0xff0000)
- | ((info >> 8) & 0xff000000));
- }
-#endif /* BFD64 */
-
- type = get_reloc_type (info);
- symtab_index = get_reloc_symindex (info);
-
- if (is_32bit_elf)
- {
- printf ("%8.8lx %8.8lx ",
- (unsigned long) offset & 0xffffffff,
- (unsigned long) info & 0xffffffff);
- }
- else
- {
-#if BFD_HOST_64BIT_LONG
- printf (do_wide
- ? "%16.16lx %16.16lx "
- : "%12.12lx %12.12lx ",
- offset, info);
-#elif BFD_HOST_64BIT_LONG_LONG
-#ifndef __MSVCRT__
- printf (do_wide
- ? "%16.16llx %16.16llx "
- : "%12.12llx %12.12llx ",
- offset, info);
-#else
- printf (do_wide
- ? "%16.16I64x %16.16I64x "
- : "%12.12I64x %12.12I64x ",
- offset, info);
-#endif
-#else
- printf (do_wide
- ? "%8.8lx%8.8lx %8.8lx%8.8lx "
- : "%4.4lx%8.8lx %4.4lx%8.8lx ",
- _bfd_int64_high (offset),
- _bfd_int64_low (offset),
- _bfd_int64_high (info),
- _bfd_int64_low (info));
-#endif
- }
-
- switch (elf_header.e_machine)
- {
- default:
- rtype = NULL;
- break;
-
- case EM_M32R:
- case EM_CYGNUS_M32R:
- rtype = elf_m32r_reloc_type (type);
- break;
-
- case EM_386:
- case EM_486:
- rtype = elf_i386_reloc_type (type);
- break;
-
- case EM_68HC11:
- case EM_68HC12:
- rtype = elf_m68hc11_reloc_type (type);
- break;
-
- case EM_68K:
- rtype = elf_m68k_reloc_type (type);
- break;
-
- case EM_960:
- rtype = elf_i960_reloc_type (type);
- break;
-
- case EM_AVR:
- case EM_AVR_OLD:
- rtype = elf_avr_reloc_type (type);
- break;
-
- case EM_OLD_SPARCV9:
- case EM_SPARC32PLUS:
- case EM_SPARCV9:
- case EM_SPARC:
- rtype = elf_sparc_reloc_type (type);
- break;
-
- case EM_SPU:
- rtype = elf_spu_reloc_type (type);
- break;
-
- case EM_V850:
- case EM_CYGNUS_V850:
- rtype = v850_reloc_type (type);
- break;
-
- case EM_D10V:
- case EM_CYGNUS_D10V:
- rtype = elf_d10v_reloc_type (type);
- break;
-
- case EM_D30V:
- case EM_CYGNUS_D30V:
- rtype = elf_d30v_reloc_type (type);
- break;
-
- case EM_DLX:
- rtype = elf_dlx_reloc_type (type);
- break;
-
- case EM_SH:
- rtype = elf_sh_reloc_type (type);
- break;
-
- case EM_MN10300:
- case EM_CYGNUS_MN10300:
- rtype = elf_mn10300_reloc_type (type);
- break;
-
- case EM_MN10200:
- case EM_CYGNUS_MN10200:
- rtype = elf_mn10200_reloc_type (type);
- break;
-
- case EM_FR30:
- case EM_CYGNUS_FR30:
- rtype = elf_fr30_reloc_type (type);
- break;
-
- case EM_CYGNUS_FRV:
- rtype = elf_frv_reloc_type (type);
- break;
-
- case EM_MCORE:
- rtype = elf_mcore_reloc_type (type);
- break;
-
- case EM_MMIX:
- rtype = elf_mmix_reloc_type (type);
- break;
-
- case EM_MSP430:
- case EM_MSP430_OLD:
- rtype = elf_msp430_reloc_type (type);
- break;
-
- case EM_PPC:
- rtype = elf_ppc_reloc_type (type);
- break;
-
- case EM_PPC64:
- rtype = elf_ppc64_reloc_type (type);
- break;
-
- case EM_MIPS:
- case EM_MIPS_RS3_LE:
- rtype = elf_mips_reloc_type (type);
- break;
-
- case EM_ALPHA:
- rtype = elf_alpha_reloc_type (type);
- break;
-
- case EM_ARM:
- rtype = elf_arm_reloc_type (type);
- break;
-
- case EM_ARC:
- rtype = elf_arc_reloc_type (type);
- break;
-
- case EM_PARISC:
- rtype = elf_hppa_reloc_type (type);
- break;
-
- case EM_H8_300:
- case EM_H8_300H:
- case EM_H8S:
- rtype = elf_h8_reloc_type (type);
- break;
-
- case EM_OPENRISC:
- case EM_OR32:
- rtype = elf_or32_reloc_type (type);
- break;
-
- case EM_PJ:
- case EM_PJ_OLD:
- rtype = elf_pj_reloc_type (type);
- break;
- case EM_IA_64:
- rtype = elf_ia64_reloc_type (type);
- break;
-
- case EM_CRIS:
- rtype = elf_cris_reloc_type (type);
- break;
-
- case EM_860:
- rtype = elf_i860_reloc_type (type);
- break;
-
- case EM_X86_64:
- rtype = elf_x86_64_reloc_type (type);
- break;
-
- case EM_S370:
- rtype = i370_reloc_type (type);
- break;
-
- case EM_S390_OLD:
- case EM_S390:
- rtype = elf_s390_reloc_type (type);
- break;
-
- case EM_SCORE:
- rtype = elf_score_reloc_type (type);
- break;
-
- case EM_XSTORMY16:
- rtype = elf_xstormy16_reloc_type (type);
- break;
-
- case EM_CRX:
- rtype = elf_crx_reloc_type (type);
- break;
-
- case EM_VAX:
- rtype = elf_vax_reloc_type (type);
- break;
-
- case EM_IP2K:
- case EM_IP2K_OLD:
- rtype = elf_ip2k_reloc_type (type);
- break;
-
- case EM_IQ2000:
- rtype = elf_iq2000_reloc_type (type);
- break;
-
- case EM_XTENSA_OLD:
- case EM_XTENSA:
- rtype = elf_xtensa_reloc_type (type);
- break;
-
- case EM_M32C_OLD:
- case EM_M32C:
- rtype = elf_m32c_reloc_type (type);
- break;
-
- case EM_MT:
- rtype = elf_mt_reloc_type (type);
- break;
-
- case EM_BLACKFIN:
- rtype = elf_bfin_reloc_type (type);
- break;
-
- case EM_CYGNUS_MEP:
- rtype = elf_mep_reloc_type (type);
- break;
-
- case EM_CR16:
- case EM_CR16_OLD:
- rtype = elf_cr16_reloc_type (type);
- break;
- }
-
- if (rtype == NULL)
- printf (_("unrecognized: %-7lx"), (unsigned long) type & 0xffffffff);
- else
- printf (do_wide ? "%-22.22s" : "%-17.17s", rtype);
-
- if (elf_header.e_machine == EM_ALPHA
- && rtype != NULL
- && streq (rtype, "R_ALPHA_LITUSE")
- && is_rela)
- {
- switch (rels[i].r_addend)
- {
- case LITUSE_ALPHA_ADDR: rtype = "ADDR"; break;
- case LITUSE_ALPHA_BASE: rtype = "BASE"; break;
- case LITUSE_ALPHA_BYTOFF: rtype = "BYTOFF"; break;
- case LITUSE_ALPHA_JSR: rtype = "JSR"; break;
- case LITUSE_ALPHA_TLSGD: rtype = "TLSGD"; break;
- case LITUSE_ALPHA_TLSLDM: rtype = "TLSLDM"; break;
- case LITUSE_ALPHA_JSRDIRECT: rtype = "JSRDIRECT"; break;
- default: rtype = NULL;
- }
- if (rtype)
- printf (" (%s)", rtype);
- else
- {
- putchar (' ');
- printf (_("<unknown addend: %lx>"),
- (unsigned long) rels[i].r_addend);
- }
- }
- else if (symtab_index)
- {
- if (symtab == NULL || symtab_index >= nsyms)
- printf (" bad symbol index: %08lx", (unsigned long) symtab_index);
- else
- {
- Elf_Internal_Sym *psym;
-
- psym = symtab + symtab_index;
-
- printf (" ");
- print_vma (psym->st_value, LONG_HEX);
- printf (is_32bit_elf ? " " : " ");
-
- if (psym->st_name == 0)
- {
- const char *sec_name = "<null>";
- char name_buf[40];
-
- if (ELF_ST_TYPE (psym->st_info) == STT_SECTION)
- {
- if (psym->st_shndx < elf_header.e_shnum)
- sec_name
- = SECTION_NAME (section_headers + psym->st_shndx);
- else if (psym->st_shndx == SHN_ABS)
- sec_name = "ABS";
- else if (psym->st_shndx == SHN_COMMON)
- sec_name = "COMMON";
- else if (elf_header.e_machine == EM_MIPS
- && psym->st_shndx == SHN_MIPS_SCOMMON)
- sec_name = "SCOMMON";
- else if (elf_header.e_machine == EM_MIPS
- && psym->st_shndx == SHN_MIPS_SUNDEFINED)
- sec_name = "SUNDEF";
- else if (elf_header.e_machine == EM_X86_64
- && psym->st_shndx == SHN_X86_64_LCOMMON)
- sec_name = "LARGE_COMMON";
- else if (elf_header.e_machine == EM_IA_64
- && elf_header.e_ident[EI_OSABI] == ELFOSABI_HPUX
- && psym->st_shndx == SHN_IA_64_ANSI_COMMON)
- sec_name = "ANSI_COM";
- else if (elf_header.e_machine == EM_IA_64
- && (elf_header.e_ident[EI_OSABI]
- == ELFOSABI_OPENVMS)
- && psym->st_shndx == SHN_IA_64_VMS_SYMVEC)
- sec_name = "VMS_SYMVEC";
- else
- {
- sprintf (name_buf, "<section 0x%x>",
- (unsigned int) psym->st_shndx);
- sec_name = name_buf;
- }
- }
- print_symbol (22, sec_name);
- }
- else if (strtab == NULL)
- printf (_("<string table index: %3ld>"), psym->st_name);
- else if (psym->st_name >= strtablen)
- printf (_("<corrupt string table index: %3ld>"), psym->st_name);
- else
- print_symbol (22, strtab + psym->st_name);
-
- if (is_rela)
- printf (" + %lx", (unsigned long) rels[i].r_addend);
- }
- }
- else if (is_rela)
- {
- printf ("%*c", is_32bit_elf ?
- (do_wide ? 34 : 28) : (do_wide ? 26 : 20), ' ');
- print_vma (rels[i].r_addend, LONG_HEX);
- }
-
- if (elf_header.e_machine == EM_SPARCV9
- && rtype != NULL
- && streq (rtype, "R_SPARC_OLO10"))
- printf (" + %lx", (unsigned long) ELF64_R_TYPE_DATA (info));
-
- putchar ('\n');
-
-#ifdef BFD64
- if (! is_32bit_elf && elf_header.e_machine == EM_MIPS)
- {
- bfd_vma type2 = ELF64_MIPS_R_TYPE2 (info);
- bfd_vma type3 = ELF64_MIPS_R_TYPE3 (info);
- const char *rtype2 = elf_mips_reloc_type (type2);
- const char *rtype3 = elf_mips_reloc_type (type3);
-
- printf (" Type2: ");
-
- if (rtype2 == NULL)
- printf (_("unrecognized: %-7lx"),
- (unsigned long) type2 & 0xffffffff);
- else
- printf ("%-17.17s", rtype2);
-
- printf ("\n Type3: ");
-
- if (rtype3 == NULL)
- printf (_("unrecognized: %-7lx"),
- (unsigned long) type3 & 0xffffffff);
- else
- printf ("%-17.17s", rtype3);
-
- putchar ('\n');
- }
-#endif /* BFD64 */
- }
-
- free (rels);
-}
-
-static const char *
-get_mips_dynamic_type (unsigned long type)
-{
- switch (type)
- {
- case DT_MIPS_RLD_VERSION: return "MIPS_RLD_VERSION";
- case DT_MIPS_TIME_STAMP: return "MIPS_TIME_STAMP";
- case DT_MIPS_ICHECKSUM: return "MIPS_ICHECKSUM";
- case DT_MIPS_IVERSION: return "MIPS_IVERSION";
- case DT_MIPS_FLAGS: return "MIPS_FLAGS";
- case DT_MIPS_BASE_ADDRESS: return "MIPS_BASE_ADDRESS";
- case DT_MIPS_MSYM: return "MIPS_MSYM";
- case DT_MIPS_CONFLICT: return "MIPS_CONFLICT";
- case DT_MIPS_LIBLIST: return "MIPS_LIBLIST";
- case DT_MIPS_LOCAL_GOTNO: return "MIPS_LOCAL_GOTNO";
- case DT_MIPS_CONFLICTNO: return "MIPS_CONFLICTNO";
- case DT_MIPS_LIBLISTNO: return "MIPS_LIBLISTNO";
- case DT_MIPS_SYMTABNO: return "MIPS_SYMTABNO";
- case DT_MIPS_UNREFEXTNO: return "MIPS_UNREFEXTNO";
- case DT_MIPS_GOTSYM: return "MIPS_GOTSYM";
- case DT_MIPS_HIPAGENO: return "MIPS_HIPAGENO";
- case DT_MIPS_RLD_MAP: return "MIPS_RLD_MAP";
- case DT_MIPS_DELTA_CLASS: return "MIPS_DELTA_CLASS";
- case DT_MIPS_DELTA_CLASS_NO: return "MIPS_DELTA_CLASS_NO";
- case DT_MIPS_DELTA_INSTANCE: return "MIPS_DELTA_INSTANCE";
- case DT_MIPS_DELTA_INSTANCE_NO: return "MIPS_DELTA_INSTANCE_NO";
- case DT_MIPS_DELTA_RELOC: return "MIPS_DELTA_RELOC";
- case DT_MIPS_DELTA_RELOC_NO: return "MIPS_DELTA_RELOC_NO";
- case DT_MIPS_DELTA_SYM: return "MIPS_DELTA_SYM";
- case DT_MIPS_DELTA_SYM_NO: return "MIPS_DELTA_SYM_NO";
- case DT_MIPS_DELTA_CLASSSYM: return "MIPS_DELTA_CLASSSYM";
- case DT_MIPS_DELTA_CLASSSYM_NO: return "MIPS_DELTA_CLASSSYM_NO";
- case DT_MIPS_CXX_FLAGS: return "MIPS_CXX_FLAGS";
- case DT_MIPS_PIXIE_INIT: return "MIPS_PIXIE_INIT";
- case DT_MIPS_SYMBOL_LIB: return "MIPS_SYMBOL_LIB";
- case DT_MIPS_LOCALPAGE_GOTIDX: return "MIPS_LOCALPAGE_GOTIDX";
- case DT_MIPS_LOCAL_GOTIDX: return "MIPS_LOCAL_GOTIDX";
- case DT_MIPS_HIDDEN_GOTIDX: return "MIPS_HIDDEN_GOTIDX";
- case DT_MIPS_PROTECTED_GOTIDX: return "MIPS_PROTECTED_GOTIDX";
- case DT_MIPS_OPTIONS: return "MIPS_OPTIONS";
- case DT_MIPS_INTERFACE: return "MIPS_INTERFACE";
- case DT_MIPS_DYNSTR_ALIGN: return "MIPS_DYNSTR_ALIGN";
- case DT_MIPS_INTERFACE_SIZE: return "MIPS_INTERFACE_SIZE";
- case DT_MIPS_RLD_TEXT_RESOLVE_ADDR: return "MIPS_RLD_TEXT_RESOLVE_ADDR";
- case DT_MIPS_PERF_SUFFIX: return "MIPS_PERF_SUFFIX";
- case DT_MIPS_COMPACT_SIZE: return "MIPS_COMPACT_SIZE";
- case DT_MIPS_GP_VALUE: return "MIPS_GP_VALUE";
- case DT_MIPS_AUX_DYNAMIC: return "MIPS_AUX_DYNAMIC";
- default:
- return NULL;
- }
-}
-
-static const char *
-get_sparc64_dynamic_type (unsigned long type)
-{
- switch (type)
- {
- case DT_SPARC_REGISTER: return "SPARC_REGISTER";
- default:
- return NULL;
- }
-}
-
-static const char *
-get_ppc_dynamic_type (unsigned long type)
-{
- switch (type)
- {
- case DT_PPC_GOT: return "PPC_GOT";
- default:
- return NULL;
- }
-}
-
-static const char *
-get_ppc64_dynamic_type (unsigned long type)
-{
- switch (type)
- {
- case DT_PPC64_GLINK: return "PPC64_GLINK";
- case DT_PPC64_OPD: return "PPC64_OPD";
- case DT_PPC64_OPDSZ: return "PPC64_OPDSZ";
- default:
- return NULL;
- }
-}
-
-static const char *
-get_parisc_dynamic_type (unsigned long type)
-{
- switch (type)
- {
- case DT_HP_LOAD_MAP: return "HP_LOAD_MAP";
- case DT_HP_DLD_FLAGS: return "HP_DLD_FLAGS";
- case DT_HP_DLD_HOOK: return "HP_DLD_HOOK";
- case DT_HP_UX10_INIT: return "HP_UX10_INIT";
- case DT_HP_UX10_INITSZ: return "HP_UX10_INITSZ";
- case DT_HP_PREINIT: return "HP_PREINIT";
- case DT_HP_PREINITSZ: return "HP_PREINITSZ";
- case DT_HP_NEEDED: return "HP_NEEDED";
- case DT_HP_TIME_STAMP: return "HP_TIME_STAMP";
- case DT_HP_CHECKSUM: return "HP_CHECKSUM";
- case DT_HP_GST_SIZE: return "HP_GST_SIZE";
- case DT_HP_GST_VERSION: return "HP_GST_VERSION";
- case DT_HP_GST_HASHVAL: return "HP_GST_HASHVAL";
- case DT_HP_EPLTREL: return "HP_GST_EPLTREL";
- case DT_HP_EPLTRELSZ: return "HP_GST_EPLTRELSZ";
- case DT_HP_FILTERED: return "HP_FILTERED";
- case DT_HP_FILTER_TLS: return "HP_FILTER_TLS";
- case DT_HP_COMPAT_FILTERED: return "HP_COMPAT_FILTERED";
- case DT_HP_LAZYLOAD: return "HP_LAZYLOAD";
- case DT_HP_BIND_NOW_COUNT: return "HP_BIND_NOW_COUNT";
- case DT_PLT: return "PLT";
- case DT_PLT_SIZE: return "PLT_SIZE";
- case DT_DLT: return "DLT";
- case DT_DLT_SIZE: return "DLT_SIZE";
- default:
- return NULL;
- }
-}
-
-static const char *
-get_ia64_dynamic_type (unsigned long type)
-{
- switch (type)
- {
- case DT_IA_64_PLT_RESERVE: return "IA_64_PLT_RESERVE";
- case DT_IA_64_VMS_SUBTYPE: return "VMS_SUBTYPE";
- case DT_IA_64_VMS_IMGIOCNT: return "VMS_IMGIOCNT";
- case DT_IA_64_VMS_LNKFLAGS: return "VMS_LNKFLAGS";
- case DT_IA_64_VMS_VIR_MEM_BLK_SIZ: return "VMS_VIR_MEM_BLK_SIZ";
- case DT_IA_64_VMS_IDENT: return "VMS_IDENT";
- case DT_IA_64_VMS_NEEDED_IDENT: return "VMS_NEEDED_IDENT";
- case DT_IA_64_VMS_IMG_RELA_CNT: return "VMS_IMG_RELA_CNT";
- case DT_IA_64_VMS_SEG_RELA_CNT: return "VMS_SEG_RELA_CNT";
- case DT_IA_64_VMS_FIXUP_RELA_CNT: return "VMS_FIXUP_RELA_CNT";
- case DT_IA_64_VMS_FIXUP_NEEDED: return "VMS_FIXUP_NEEDED";
- case DT_IA_64_VMS_SYMVEC_CNT: return "VMS_SYMVEC_CNT";
- case DT_IA_64_VMS_XLATED: return "VMS_XLATED";
- case DT_IA_64_VMS_STACKSIZE: return "VMS_STACKSIZE";
- case DT_IA_64_VMS_UNWINDSZ: return "VMS_UNWINDSZ";
- case DT_IA_64_VMS_UNWIND_CODSEG: return "VMS_UNWIND_CODSEG";
- case DT_IA_64_VMS_UNWIND_INFOSEG: return "VMS_UNWIND_INFOSEG";
- case DT_IA_64_VMS_LINKTIME: return "VMS_LINKTIME";
- case DT_IA_64_VMS_SEG_NO: return "VMS_SEG_NO";
- case DT_IA_64_VMS_SYMVEC_OFFSET: return "VMS_SYMVEC_OFFSET";
- case DT_IA_64_VMS_SYMVEC_SEG: return "VMS_SYMVEC_SEG";
- case DT_IA_64_VMS_UNWIND_OFFSET: return "VMS_UNWIND_OFFSET";
- case DT_IA_64_VMS_UNWIND_SEG: return "VMS_UNWIND_SEG";
- case DT_IA_64_VMS_STRTAB_OFFSET: return "VMS_STRTAB_OFFSET";
- case DT_IA_64_VMS_SYSVER_OFFSET: return "VMS_SYSVER_OFFSET";
- case DT_IA_64_VMS_IMG_RELA_OFF: return "VMS_IMG_RELA_OFF";
- case DT_IA_64_VMS_SEG_RELA_OFF: return "VMS_SEG_RELA_OFF";
- case DT_IA_64_VMS_FIXUP_RELA_OFF: return "VMS_FIXUP_RELA_OFF";
- case DT_IA_64_VMS_PLTGOT_OFFSET: return "VMS_PLTGOT_OFFSET";
- case DT_IA_64_VMS_PLTGOT_SEG: return "VMS_PLTGOT_SEG";
- case DT_IA_64_VMS_FPMODE: return "VMS_FPMODE";
- default:
- return NULL;
- }
-}
-
-static const char *
-get_alpha_dynamic_type (unsigned long type)
-{
- switch (type)
- {
- case DT_ALPHA_PLTRO: return "ALPHA_PLTRO";
- default:
- return NULL;
- }
-}
-
-static const char *
-get_score_dynamic_type (unsigned long type)
-{
- switch (type)
- {
- case DT_SCORE_BASE_ADDRESS: return "SCORE_BASE_ADDRESS";
- case DT_SCORE_LOCAL_GOTNO: return "SCORE_LOCAL_GOTNO";
- case DT_SCORE_SYMTABNO: return "SCORE_SYMTABNO";
- case DT_SCORE_GOTSYM: return "SCORE_GOTSYM";
- case DT_SCORE_UNREFEXTNO: return "SCORE_UNREFEXTNO";
- case DT_SCORE_HIPAGENO: return "SCORE_HIPAGENO";
- default:
- return NULL;
- }
-}
-
-
-static const char *
-get_dynamic_type (unsigned long type)
-{
- static char buff[64];
-
- switch (type)
- {
- case DT_NULL: return "NULL";
- case DT_NEEDED: return "NEEDED";
- case DT_PLTRELSZ: return "PLTRELSZ";
- case DT_PLTGOT: return "PLTGOT";
- case DT_HASH: return "HASH";
- case DT_STRTAB: return "STRTAB";
- case DT_SYMTAB: return "SYMTAB";
- case DT_RELA: return "RELA";
- case DT_RELASZ: return "RELASZ";
- case DT_RELAENT: return "RELAENT";
- case DT_STRSZ: return "STRSZ";
- case DT_SYMENT: return "SYMENT";
- case DT_INIT: return "INIT";
- case DT_FINI: return "FINI";
- case DT_SONAME: return "SONAME";
- case DT_RPATH: return "RPATH";
- case DT_SYMBOLIC: return "SYMBOLIC";
- case DT_REL: return "REL";
- case DT_RELSZ: return "RELSZ";
- case DT_RELENT: return "RELENT";
- case DT_PLTREL: return "PLTREL";
- case DT_DEBUG: return "DEBUG";
- case DT_TEXTREL: return "TEXTREL";
- case DT_JMPREL: return "JMPREL";
- case DT_BIND_NOW: return "BIND_NOW";
- case DT_INIT_ARRAY: return "INIT_ARRAY";
- case DT_FINI_ARRAY: return "FINI_ARRAY";
- case DT_INIT_ARRAYSZ: return "INIT_ARRAYSZ";
- case DT_FINI_ARRAYSZ: return "FINI_ARRAYSZ";
- case DT_RUNPATH: return "RUNPATH";
- case DT_FLAGS: return "FLAGS";
-
- case DT_PREINIT_ARRAY: return "PREINIT_ARRAY";
- case DT_PREINIT_ARRAYSZ: return "PREINIT_ARRAYSZ";
-
- case DT_CHECKSUM: return "CHECKSUM";
- case DT_PLTPADSZ: return "PLTPADSZ";
- case DT_MOVEENT: return "MOVEENT";
- case DT_MOVESZ: return "MOVESZ";
- case DT_FEATURE: return "FEATURE";
- case DT_POSFLAG_1: return "POSFLAG_1";
- case DT_SYMINSZ: return "SYMINSZ";
- case DT_SYMINENT: return "SYMINENT"; /* aka VALRNGHI */
-
- case DT_ADDRRNGLO: return "ADDRRNGLO";
- case DT_CONFIG: return "CONFIG";
- case DT_DEPAUDIT: return "DEPAUDIT";
- case DT_AUDIT: return "AUDIT";
- case DT_PLTPAD: return "PLTPAD";
- case DT_MOVETAB: return "MOVETAB";
- case DT_SYMINFO: return "SYMINFO"; /* aka ADDRRNGHI */
-
- case DT_VERSYM: return "VERSYM";
-
- case DT_TLSDESC_GOT: return "TLSDESC_GOT";
- case DT_TLSDESC_PLT: return "TLSDESC_PLT";
- case DT_RELACOUNT: return "RELACOUNT";
- case DT_RELCOUNT: return "RELCOUNT";
- case DT_FLAGS_1: return "FLAGS_1";
- case DT_VERDEF: return "VERDEF";
- case DT_VERDEFNUM: return "VERDEFNUM";
- case DT_VERNEED: return "VERNEED";
- case DT_VERNEEDNUM: return "VERNEEDNUM";
-
- case DT_AUXILIARY: return "AUXILIARY";
- case DT_USED: return "USED";
- case DT_FILTER: return "FILTER";
-
- case DT_GNU_PRELINKED: return "GNU_PRELINKED";
- case DT_GNU_CONFLICT: return "GNU_CONFLICT";
- case DT_GNU_CONFLICTSZ: return "GNU_CONFLICTSZ";
- case DT_GNU_LIBLIST: return "GNU_LIBLIST";
- case DT_GNU_LIBLISTSZ: return "GNU_LIBLISTSZ";
- case DT_GNU_HASH: return "GNU_HASH";
-
- default:
- if ((type >= DT_LOPROC) && (type <= DT_HIPROC))
- {
- const char *result;
-
- switch (elf_header.e_machine)
- {
- case EM_MIPS:
- case EM_MIPS_RS3_LE:
- result = get_mips_dynamic_type (type);
- break;
- case EM_SPARCV9:
- result = get_sparc64_dynamic_type (type);
- break;
- case EM_PPC:
- result = get_ppc_dynamic_type (type);
- break;
- case EM_PPC64:
- result = get_ppc64_dynamic_type (type);
- break;
- case EM_IA_64:
- result = get_ia64_dynamic_type (type);
- break;
- case EM_ALPHA:
- result = get_alpha_dynamic_type (type);
- break;
- case EM_SCORE:
- result = get_score_dynamic_type (type);
- break;
- default:
- result = NULL;
- break;
- }
-
- if (result != NULL)
- return result;
-
- snprintf (buff, sizeof (buff), _("Processor Specific: %lx"), type);
- }
- else if (((type >= DT_LOOS) && (type <= DT_HIOS))
- || (elf_header.e_machine == EM_PARISC
- && (type >= OLD_DT_LOOS) && (type <= OLD_DT_HIOS)))
- {
- const char *result;
-
- switch (elf_header.e_machine)
- {
- case EM_PARISC:
- result = get_parisc_dynamic_type (type);
- break;
- case EM_IA_64:
- result = get_ia64_dynamic_type (type);
- break;
- default:
- result = NULL;
- break;
- }
-
- if (result != NULL)
- return result;
-
- snprintf (buff, sizeof (buff), _("Operating System specific: %lx"),
- type);
- }
- else
- snprintf (buff, sizeof (buff), _("<unknown>: %lx"), type);
-
- return buff;
- }
-}
-
-static char *
-get_file_type (unsigned e_type)
-{
- static char buff[32];
-
- switch (e_type)
- {
- case ET_NONE: return _("NONE (None)");
- case ET_REL: return _("REL (Relocatable file)");
- case ET_EXEC: return _("EXEC (Executable file)");
- case ET_DYN: return _("DYN (Shared object file)");
- case ET_CORE: return _("CORE (Core file)");
-
- default:
- if ((e_type >= ET_LOPROC) && (e_type <= ET_HIPROC))
- snprintf (buff, sizeof (buff), _("Processor Specific: (%x)"), e_type);
- else if ((e_type >= ET_LOOS) && (e_type <= ET_HIOS))
- snprintf (buff, sizeof (buff), _("OS Specific: (%x)"), e_type);
- else
- snprintf (buff, sizeof (buff), _("<unknown>: %x"), e_type);
- return buff;
- }
-}
-
-static char *
-get_machine_name (unsigned e_machine)
-{
- static char buff[64]; /* XXX */
-
- switch (e_machine)
- {
- case EM_NONE: return _("None");
- case EM_M32: return "WE32100";
- case EM_SPARC: return "Sparc";
- case EM_SPU: return "SPU";
- case EM_386: return "Intel 80386";
- case EM_68K: return "MC68000";
- case EM_88K: return "MC88000";
- case EM_486: return "Intel 80486";
- case EM_860: return "Intel 80860";
- case EM_MIPS: return "MIPS R3000";
- case EM_S370: return "IBM System/370";
- case EM_MIPS_RS3_LE: return "MIPS R4000 big-endian";
- case EM_OLD_SPARCV9: return "Sparc v9 (old)";
- case EM_PARISC: return "HPPA";
- case EM_PPC_OLD: return "Power PC (old)";
- case EM_SPARC32PLUS: return "Sparc v8+" ;
- case EM_960: return "Intel 90860";
- case EM_PPC: return "PowerPC";
- case EM_PPC64: return "PowerPC64";
- case EM_V800: return "NEC V800";
- case EM_FR20: return "Fujitsu FR20";
- case EM_RH32: return "TRW RH32";
- case EM_MCORE: return "MCORE";
- case EM_ARM: return "ARM";
- case EM_OLD_ALPHA: return "Digital Alpha (old)";
- case EM_SH: return "Renesas / SuperH SH";
- case EM_SPARCV9: return "Sparc v9";
- case EM_TRICORE: return "Siemens Tricore";
- case EM_ARC: return "ARC";
- case EM_H8_300: return "Renesas H8/300";
- case EM_H8_300H: return "Renesas H8/300H";
- case EM_H8S: return "Renesas H8S";
- case EM_H8_500: return "Renesas H8/500";
- case EM_IA_64: return "Intel IA-64";
- case EM_MIPS_X: return "Stanford MIPS-X";
- case EM_COLDFIRE: return "Motorola Coldfire";
- case EM_68HC12: return "Motorola M68HC12";
- case EM_ALPHA: return "Alpha";
- case EM_CYGNUS_D10V:
- case EM_D10V: return "d10v";
- case EM_CYGNUS_D30V:
- case EM_D30V: return "d30v";
- case EM_CYGNUS_M32R:
- case EM_M32R: return "Renesas M32R (formerly Mitsubishi M32r)";
- case EM_CYGNUS_V850:
- case EM_V850: return "NEC v850";
- case EM_CYGNUS_MN10300:
- case EM_MN10300: return "mn10300";
- case EM_CYGNUS_MN10200:
- case EM_MN10200: return "mn10200";
- case EM_CYGNUS_FR30:
- case EM_FR30: return "Fujitsu FR30";
- case EM_CYGNUS_FRV: return "Fujitsu FR-V";
- case EM_PJ_OLD:
- case EM_PJ: return "picoJava";
- case EM_MMA: return "Fujitsu Multimedia Accelerator";
- case EM_PCP: return "Siemens PCP";
- case EM_NCPU: return "Sony nCPU embedded RISC processor";
- case EM_NDR1: return "Denso NDR1 microprocesspr";
- case EM_STARCORE: return "Motorola Star*Core processor";
- case EM_ME16: return "Toyota ME16 processor";
- case EM_ST100: return "STMicroelectronics ST100 processor";
- case EM_TINYJ: return "Advanced Logic Corp. TinyJ embedded processor";
- case EM_FX66: return "Siemens FX66 microcontroller";
- case EM_ST9PLUS: return "STMicroelectronics ST9+ 8/16 bit microcontroller";
- case EM_ST7: return "STMicroelectronics ST7 8-bit microcontroller";
- case EM_68HC16: return "Motorola MC68HC16 Microcontroller";
- case EM_68HC11: return "Motorola MC68HC11 Microcontroller";
- case EM_68HC08: return "Motorola MC68HC08 Microcontroller";
- case EM_68HC05: return "Motorola MC68HC05 Microcontroller";
- case EM_SVX: return "Silicon Graphics SVx";
- case EM_ST19: return "STMicroelectronics ST19 8-bit microcontroller";
- case EM_VAX: return "Digital VAX";
- case EM_AVR_OLD:
- case EM_AVR: return "Atmel AVR 8-bit microcontroller";
- case EM_CRIS: return "Axis Communications 32-bit embedded processor";
- case EM_JAVELIN: return "Infineon Technologies 32-bit embedded cpu";
- case EM_FIREPATH: return "Element 14 64-bit DSP processor";
- case EM_ZSP: return "LSI Logic's 16-bit DSP processor";
- case EM_MMIX: return "Donald Knuth's educational 64-bit processor";
- case EM_HUANY: return "Harvard Universitys's machine-independent object format";
- case EM_PRISM: return "Vitesse Prism";
- case EM_X86_64: return "Advanced Micro Devices X86-64";
- case EM_S390_OLD:
- case EM_S390: return "IBM S/390";
- case EM_SCORE: return "SUNPLUS S+Core";
- case EM_XSTORMY16: return "Sanyo Xstormy16 CPU core";
- case EM_OPENRISC:
- case EM_OR32: return "OpenRISC";
- case EM_CRX: return "National Semiconductor CRX microprocessor";
- case EM_DLX: return "OpenDLX";
- case EM_IP2K_OLD:
- case EM_IP2K: return "Ubicom IP2xxx 8-bit microcontrollers";
- case EM_IQ2000: return "Vitesse IQ2000";
- case EM_XTENSA_OLD:
- case EM_XTENSA: return "Tensilica Xtensa Processor";
- case EM_M32C_OLD:
- case EM_M32C: return "Renesas M32c";
- case EM_MT: return "Morpho Techologies MT processor";
- case EM_BLACKFIN: return "Analog Devices Blackfin";
- case EM_NIOS32: return "Altera Nios";
- case EM_ALTERA_NIOS2: return "Altera Nios II";
- case EM_XC16X: return "Infineon Technologies xc16x";
- case EM_CYGNUS_MEP: return "Toshiba MeP Media Engine";
- case EM_CR16:
- case EM_CR16_OLD: return "National Semiconductor's CR16";
- default:
- snprintf (buff, sizeof (buff), _("<unknown>: 0x%x"), e_machine);
- return buff;
- }
-}
-
-static void
-decode_ARM_machine_flags (unsigned e_flags, char buf[])
-{
- unsigned eabi;
- int unknown = 0;
-
- eabi = EF_ARM_EABI_VERSION (e_flags);
- e_flags &= ~ EF_ARM_EABIMASK;
-
- /* Handle "generic" ARM flags. */
- if (e_flags & EF_ARM_RELEXEC)
- {
- strcat (buf, ", relocatable executable");
- e_flags &= ~ EF_ARM_RELEXEC;
- }
-
- if (e_flags & EF_ARM_HASENTRY)
- {
- strcat (buf, ", has entry point");
- e_flags &= ~ EF_ARM_HASENTRY;
- }
-
- /* Now handle EABI specific flags. */
- switch (eabi)
- {
- default:
- strcat (buf, ", <unrecognized EABI>");
- if (e_flags)
- unknown = 1;
- break;
-
- case EF_ARM_EABI_VER1:
- strcat (buf, ", Version1 EABI");
- while (e_flags)
- {
- unsigned flag;
-
- /* Process flags one bit at a time. */
- flag = e_flags & - e_flags;
- e_flags &= ~ flag;
-
- switch (flag)
- {
- case EF_ARM_SYMSARESORTED: /* Conflicts with EF_ARM_INTERWORK. */
- strcat (buf, ", sorted symbol tables");
- break;
-
- default:
- unknown = 1;
- break;
- }
- }
- break;
-
- case EF_ARM_EABI_VER2:
- strcat (buf, ", Version2 EABI");
- while (e_flags)
- {
- unsigned flag;
-
- /* Process flags one bit at a time. */
- flag = e_flags & - e_flags;
- e_flags &= ~ flag;
-
- switch (flag)
- {
- case EF_ARM_SYMSARESORTED: /* Conflicts with EF_ARM_INTERWORK. */
- strcat (buf, ", sorted symbol tables");
- break;
-
- case EF_ARM_DYNSYMSUSESEGIDX:
- strcat (buf, ", dynamic symbols use segment index");
- break;
-
- case EF_ARM_MAPSYMSFIRST:
- strcat (buf, ", mapping symbols precede others");
- break;
-
- default:
- unknown = 1;
- break;
- }
- }
- break;
-
- case EF_ARM_EABI_VER3:
- strcat (buf, ", Version3 EABI");
- break;
-
- case EF_ARM_EABI_VER4:
- strcat (buf, ", Version4 EABI");
- goto eabi;
-
- case EF_ARM_EABI_VER5:
- strcat (buf, ", Version5 EABI");
- eabi:
- while (e_flags)
- {
- unsigned flag;
-
- /* Process flags one bit at a time. */
- flag = e_flags & - e_flags;
- e_flags &= ~ flag;
-
- switch (flag)
- {
- case EF_ARM_BE8:
- strcat (buf, ", BE8");
- break;
-
- case EF_ARM_LE8:
- strcat (buf, ", LE8");
- break;
-
- default:
- unknown = 1;
- break;
- }
- }
- break;
-
- case EF_ARM_EABI_UNKNOWN:
- strcat (buf, ", GNU EABI");
- while (e_flags)
- {
- unsigned flag;
-
- /* Process flags one bit at a time. */
- flag = e_flags & - e_flags;
- e_flags &= ~ flag;
-
- switch (flag)
- {
- case EF_ARM_INTERWORK:
- strcat (buf, ", interworking enabled");
- break;
-
- case EF_ARM_APCS_26:
- strcat (buf, ", uses APCS/26");
- break;
-
- case EF_ARM_APCS_FLOAT:
- strcat (buf, ", uses APCS/float");
- break;
-
- case EF_ARM_PIC:
- strcat (buf, ", position independent");
- break;
-
- case EF_ARM_ALIGN8:
- strcat (buf, ", 8 bit structure alignment");
- break;
-
- case EF_ARM_NEW_ABI:
- strcat (buf, ", uses new ABI");
- break;
-
- case EF_ARM_OLD_ABI:
- strcat (buf, ", uses old ABI");
- break;
-
- case EF_ARM_SOFT_FLOAT:
- strcat (buf, ", software FP");
- break;
-
- case EF_ARM_VFP_FLOAT:
- strcat (buf, ", VFP");
- break;
-
- case EF_ARM_MAVERICK_FLOAT:
- strcat (buf, ", Maverick FP");
- break;
-
- default:
- unknown = 1;
- break;
- }
- }
- }
-
- if (unknown)
- strcat (buf,", <unknown>");
-}
-
-static char *
-get_machine_flags (unsigned e_flags, unsigned e_machine)
-{
- static char buf[1024];
-
- buf[0] = '\0';
-
- if (e_flags)
- {
- switch (e_machine)
- {
- default:
- break;
-
- case EM_ARM:
- decode_ARM_machine_flags (e_flags, buf);
- break;
-
- case EM_CYGNUS_FRV:
- switch (e_flags & EF_FRV_CPU_MASK)
- {
- case EF_FRV_CPU_GENERIC:
- break;
-
- default:
- strcat (buf, ", fr???");
- break;
-
- case EF_FRV_CPU_FR300:
- strcat (buf, ", fr300");
- break;
-
- case EF_FRV_CPU_FR400:
- strcat (buf, ", fr400");
- break;
- case EF_FRV_CPU_FR405:
- strcat (buf, ", fr405");
- break;
-
- case EF_FRV_CPU_FR450:
- strcat (buf, ", fr450");
- break;
-
- case EF_FRV_CPU_FR500:
- strcat (buf, ", fr500");
- break;
- case EF_FRV_CPU_FR550:
- strcat (buf, ", fr550");
- break;
-
- case EF_FRV_CPU_SIMPLE:
- strcat (buf, ", simple");
- break;
- case EF_FRV_CPU_TOMCAT:
- strcat (buf, ", tomcat");
- break;
- }
- break;
-
- case EM_68K:
- if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_M68000)
- strcat (buf, ", m68000");
- else if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32)
- strcat (buf, ", cpu32");
- else if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_FIDO)
- strcat (buf, ", fido_a");
- else
- {
- char const *isa = _("unknown");
- char const *mac = _("unknown mac");
- char const *additional = NULL;
-
- switch (e_flags & EF_M68K_CF_ISA_MASK)
- {
- case EF_M68K_CF_ISA_A_NODIV:
- isa = "A";
- additional = ", nodiv";
- break;
- case EF_M68K_CF_ISA_A:
- isa = "A";
- break;
- case EF_M68K_CF_ISA_A_PLUS:
- isa = "A+";
- break;
- case EF_M68K_CF_ISA_B_NOUSP:
- isa = "B";
- additional = ", nousp";
- break;
- case EF_M68K_CF_ISA_B:
- isa = "B";
- break;
- }
- strcat (buf, ", cf, isa ");
- strcat (buf, isa);
- if (additional)
- strcat (buf, additional);
- if (e_flags & EF_M68K_CF_FLOAT)
- strcat (buf, ", float");
- switch (e_flags & EF_M68K_CF_MAC_MASK)
- {
- case 0:
- mac = NULL;
- break;
- case EF_M68K_CF_MAC:
- mac = "mac";
- break;
- case EF_M68K_CF_EMAC:
- mac = "emac";
- break;
- }
- if (mac)
- {
- strcat (buf, ", ");
- strcat (buf, mac);
- }
- }
- break;
-
- case EM_PPC:
- if (e_flags & EF_PPC_EMB)
- strcat (buf, ", emb");
-
- if (e_flags & EF_PPC_RELOCATABLE)
- strcat (buf, ", relocatable");
-
- if (e_flags & EF_PPC_RELOCATABLE_LIB)
- strcat (buf, ", relocatable-lib");
- break;
-
- case EM_V850:
- case EM_CYGNUS_V850:
- switch (e_flags & EF_V850_ARCH)
- {
- case E_V850E1_ARCH:
- strcat (buf, ", v850e1");
- break;
- case E_V850E_ARCH:
- strcat (buf, ", v850e");
- break;
- case E_V850_ARCH:
- strcat (buf, ", v850");
- break;
- default:
- strcat (buf, ", unknown v850 architecture variant");
- break;
- }
- break;
-
- case EM_M32R:
- case EM_CYGNUS_M32R:
- if ((e_flags & EF_M32R_ARCH) == E_M32R_ARCH)
- strcat (buf, ", m32r");
- break;
-
- case EM_MIPS:
- case EM_MIPS_RS3_LE:
- if (e_flags & EF_MIPS_NOREORDER)
- strcat (buf, ", noreorder");
-
- if (e_flags & EF_MIPS_PIC)
- strcat (buf, ", pic");
-
- if (e_flags & EF_MIPS_CPIC)
- strcat (buf, ", cpic");
-
- if (e_flags & EF_MIPS_UCODE)
- strcat (buf, ", ugen_reserved");
-
- if (e_flags & EF_MIPS_ABI2)
- strcat (buf, ", abi2");
-
- if (e_flags & EF_MIPS_OPTIONS_FIRST)
- strcat (buf, ", odk first");
-
- if (e_flags & EF_MIPS_32BITMODE)
- strcat (buf, ", 32bitmode");
-
- switch ((e_flags & EF_MIPS_MACH))
- {
- case E_MIPS_MACH_3900: strcat (buf, ", 3900"); break;
- case E_MIPS_MACH_4010: strcat (buf, ", 4010"); break;
- case E_MIPS_MACH_4100: strcat (buf, ", 4100"); break;
- case E_MIPS_MACH_4111: strcat (buf, ", 4111"); break;
- case E_MIPS_MACH_4120: strcat (buf, ", 4120"); break;
- case E_MIPS_MACH_4650: strcat (buf, ", 4650"); break;
- case E_MIPS_MACH_5400: strcat (buf, ", 5400"); break;
- case E_MIPS_MACH_5500: strcat (buf, ", 5500"); break;
- case E_MIPS_MACH_SB1: strcat (buf, ", sb1"); break;
- case E_MIPS_MACH_9000: strcat (buf, ", 9000"); break;
- case E_MIPS_MACH_LS2E: strcat (buf, ", loongson-2e"); break;
- case E_MIPS_MACH_LS2F: strcat (buf, ", loongson-2f"); break;
- case E_MIPS_MACH_OCTEON: strcat (buf, ", octeon"); break;
- case 0:
- /* We simply ignore the field in this case to avoid confusion:
- MIPS ELF does not specify EF_MIPS_MACH, it is a GNU
- extension. */
- break;
- default: strcat (buf, ", unknown CPU"); break;
- }
-
- switch ((e_flags & EF_MIPS_ABI))
- {
- case E_MIPS_ABI_O32: strcat (buf, ", o32"); break;
- case E_MIPS_ABI_O64: strcat (buf, ", o64"); break;
- case E_MIPS_ABI_EABI32: strcat (buf, ", eabi32"); break;
- case E_MIPS_ABI_EABI64: strcat (buf, ", eabi64"); break;
- case 0:
- /* We simply ignore the field in this case to avoid confusion:
- MIPS ELF does not specify EF_MIPS_ABI, it is a GNU extension.
- This means it is likely to be an o32 file, but not for
- sure. */
- break;
- default: strcat (buf, ", unknown ABI"); break;
- }
-
- if (e_flags & EF_MIPS_ARCH_ASE_MDMX)
- strcat (buf, ", mdmx");
-
- if (e_flags & EF_MIPS_ARCH_ASE_M16)
- strcat (buf, ", mips16");
-
- switch ((e_flags & EF_MIPS_ARCH))
- {
- case E_MIPS_ARCH_1: strcat (buf, ", mips1"); break;
- case E_MIPS_ARCH_2: strcat (buf, ", mips2"); break;
- case E_MIPS_ARCH_3: strcat (buf, ", mips3"); break;
- case E_MIPS_ARCH_4: strcat (buf, ", mips4"); break;
- case E_MIPS_ARCH_5: strcat (buf, ", mips5"); break;
- case E_MIPS_ARCH_32: strcat (buf, ", mips32"); break;
- case E_MIPS_ARCH_32R2: strcat (buf, ", mips32r2"); break;
- case E_MIPS_ARCH_64: strcat (buf, ", mips64"); break;
- case E_MIPS_ARCH_64R2: strcat (buf, ", mips64r2"); break;
- default: strcat (buf, ", unknown ISA"); break;
- }
-
- break;
-
- case EM_SH:
- switch ((e_flags & EF_SH_MACH_MASK))
- {
- case EF_SH1: strcat (buf, ", sh1"); break;
- case EF_SH2: strcat (buf, ", sh2"); break;
- case EF_SH3: strcat (buf, ", sh3"); break;
- case EF_SH_DSP: strcat (buf, ", sh-dsp"); break;
- case EF_SH3_DSP: strcat (buf, ", sh3-dsp"); break;
- case EF_SH4AL_DSP: strcat (buf, ", sh4al-dsp"); break;
- case EF_SH3E: strcat (buf, ", sh3e"); break;
- case EF_SH4: strcat (buf, ", sh4"); break;
- case EF_SH5: strcat (buf, ", sh5"); break;
- case EF_SH2E: strcat (buf, ", sh2e"); break;
- case EF_SH4A: strcat (buf, ", sh4a"); break;
- case EF_SH2A: strcat (buf, ", sh2a"); break;
- case EF_SH4_NOFPU: strcat (buf, ", sh4-nofpu"); break;
- case EF_SH4A_NOFPU: strcat (buf, ", sh4a-nofpu"); break;
- case EF_SH2A_NOFPU: strcat (buf, ", sh2a-nofpu"); break;
- case EF_SH3_NOMMU: strcat (buf, ", sh3-nommu"); break;
- case EF_SH4_NOMMU_NOFPU: strcat (buf, ", sh4-nommu-nofpu"); break;
- case EF_SH2A_SH4_NOFPU: strcat (buf, ", sh2a-nofpu-or-sh4-nommu-nofpu"); break;
- case EF_SH2A_SH3_NOFPU: strcat (buf, ", sh2a-nofpu-or-sh3-nommu"); break;
- case EF_SH2A_SH4: strcat (buf, ", sh2a-or-sh4"); break;
- case EF_SH2A_SH3E: strcat (buf, ", sh2a-or-sh3e"); break;
- default: strcat (buf, ", unknown ISA"); break;
- }
-
- break;
-
- case EM_SPARCV9:
- if (e_flags & EF_SPARC_32PLUS)
- strcat (buf, ", v8+");
-
- if (e_flags & EF_SPARC_SUN_US1)
- strcat (buf, ", ultrasparcI");
-
- if (e_flags & EF_SPARC_SUN_US3)
- strcat (buf, ", ultrasparcIII");
-
- if (e_flags & EF_SPARC_HAL_R1)
- strcat (buf, ", halr1");
-
- if (e_flags & EF_SPARC_LEDATA)
- strcat (buf, ", ledata");
-
- if ((e_flags & EF_SPARCV9_MM) == EF_SPARCV9_TSO)
- strcat (buf, ", tso");
-
- if ((e_flags & EF_SPARCV9_MM) == EF_SPARCV9_PSO)
- strcat (buf, ", pso");
-
- if ((e_flags & EF_SPARCV9_MM) == EF_SPARCV9_RMO)
- strcat (buf, ", rmo");
- break;
-
- case EM_PARISC:
- switch (e_flags & EF_PARISC_ARCH)
- {
- case EFA_PARISC_1_0:
- strcpy (buf, ", PA-RISC 1.0");
- break;
- case EFA_PARISC_1_1:
- strcpy (buf, ", PA-RISC 1.1");
- break;
- case EFA_PARISC_2_0:
- strcpy (buf, ", PA-RISC 2.0");
- break;
- default:
- break;
- }
- if (e_flags & EF_PARISC_TRAPNIL)
- strcat (buf, ", trapnil");
- if (e_flags & EF_PARISC_EXT)
- strcat (buf, ", ext");
- if (e_flags & EF_PARISC_LSB)
- strcat (buf, ", lsb");
- if (e_flags & EF_PARISC_WIDE)
- strcat (buf, ", wide");
- if (e_flags & EF_PARISC_NO_KABP)
- strcat (buf, ", no kabp");
- if (e_flags & EF_PARISC_LAZYSWAP)
- strcat (buf, ", lazyswap");
- break;
-
- case EM_PJ:
- case EM_PJ_OLD:
- if ((e_flags & EF_PICOJAVA_NEWCALLS) == EF_PICOJAVA_NEWCALLS)
- strcat (buf, ", new calling convention");
-
- if ((e_flags & EF_PICOJAVA_GNUCALLS) == EF_PICOJAVA_GNUCALLS)
- strcat (buf, ", gnu calling convention");
- break;
-
- case EM_IA_64:
- if ((e_flags & EF_IA_64_ABI64))
- strcat (buf, ", 64-bit");
- else
- strcat (buf, ", 32-bit");
- if ((e_flags & EF_IA_64_REDUCEDFP))
- strcat (buf, ", reduced fp model");
- if ((e_flags & EF_IA_64_NOFUNCDESC_CONS_GP))
- strcat (buf, ", no function descriptors, constant gp");
- else if ((e_flags & EF_IA_64_CONS_GP))
- strcat (buf, ", constant gp");
- if ((e_flags & EF_IA_64_ABSOLUTE))
- strcat (buf, ", absolute");
- break;
-
- case EM_VAX:
- if ((e_flags & EF_VAX_NONPIC))
- strcat (buf, ", non-PIC");
- if ((e_flags & EF_VAX_DFLOAT))
- strcat (buf, ", D-Float");
- if ((e_flags & EF_VAX_GFLOAT))
- strcat (buf, ", G-Float");
- break;
- }
- }
-
- return buf;
-}
-
-static const char *
-get_osabi_name (unsigned int osabi)
-{
- static char buff[32];
-
- switch (osabi)
- {
- case ELFOSABI_NONE: return "UNIX - System V";
- case ELFOSABI_HPUX: return "UNIX - HP-UX";
- case ELFOSABI_NETBSD: return "UNIX - NetBSD";
- case ELFOSABI_LINUX: return "UNIX - Linux";
- case ELFOSABI_HURD: return "GNU/Hurd";
- case ELFOSABI_SOLARIS: return "UNIX - Solaris";
- case ELFOSABI_AIX: return "UNIX - AIX";
- case ELFOSABI_IRIX: return "UNIX - IRIX";
- case ELFOSABI_FREEBSD: return "UNIX - FreeBSD";
- case ELFOSABI_TRU64: return "UNIX - TRU64";
- case ELFOSABI_MODESTO: return "Novell - Modesto";
- case ELFOSABI_OPENBSD: return "UNIX - OpenBSD";
- case ELFOSABI_OPENVMS: return "VMS - OpenVMS";
- case ELFOSABI_NSK: return "HP - Non-Stop Kernel";
- case ELFOSABI_AROS: return "AROS";
- case ELFOSABI_STANDALONE: return _("Standalone App");
- case ELFOSABI_ARM: return "ARM";
- default:
- snprintf (buff, sizeof (buff), _("<unknown: %x>"), osabi);
- return buff;
- }
-}
-
-static const char *
-get_arm_segment_type (unsigned long type)
-{
- switch (type)
- {
- case PT_ARM_EXIDX:
- return "EXIDX";
- default:
- break;
- }
-
- return NULL;
-}
-
-static const char *
-get_mips_segment_type (unsigned long type)
-{
- switch (type)
- {
- case PT_MIPS_REGINFO:
- return "REGINFO";
- case PT_MIPS_RTPROC:
- return "RTPROC";
- case PT_MIPS_OPTIONS:
- return "OPTIONS";
- default:
- break;
- }
-
- return NULL;
-}
-
-static const char *
-get_parisc_segment_type (unsigned long type)
-{
- switch (type)
- {
- case PT_HP_TLS: return "HP_TLS";
- case PT_HP_CORE_NONE: return "HP_CORE_NONE";
- case PT_HP_CORE_VERSION: return "HP_CORE_VERSION";
- case PT_HP_CORE_KERNEL: return "HP_CORE_KERNEL";
- case PT_HP_CORE_COMM: return "HP_CORE_COMM";
- case PT_HP_CORE_PROC: return "HP_CORE_PROC";
- case PT_HP_CORE_LOADABLE: return "HP_CORE_LOADABLE";
- case PT_HP_CORE_STACK: return "HP_CORE_STACK";
- case PT_HP_CORE_SHM: return "HP_CORE_SHM";
- case PT_HP_CORE_MMF: return "HP_CORE_MMF";
- case PT_HP_PARALLEL: return "HP_PARALLEL";
- case PT_HP_FASTBIND: return "HP_FASTBIND";
- case PT_HP_OPT_ANNOT: return "HP_OPT_ANNOT";
- case PT_HP_HSL_ANNOT: return "HP_HSL_ANNOT";
- case PT_HP_STACK: return "HP_STACK";
- case PT_HP_CORE_UTSNAME: return "HP_CORE_UTSNAME";
- case PT_PARISC_ARCHEXT: return "PARISC_ARCHEXT";
- case PT_PARISC_UNWIND: return "PARISC_UNWIND";
- case PT_PARISC_WEAKORDER: return "PARISC_WEAKORDER";
- default:
- break;
- }
-
- return NULL;
-}
-
-static const char *
-get_ia64_segment_type (unsigned long type)
-{
- switch (type)
- {
- case PT_IA_64_ARCHEXT: return "IA_64_ARCHEXT";
- case PT_IA_64_UNWIND: return "IA_64_UNWIND";
- case PT_HP_TLS: return "HP_TLS";
- case PT_IA_64_HP_OPT_ANOT: return "HP_OPT_ANNOT";
- case PT_IA_64_HP_HSL_ANOT: return "HP_HSL_ANNOT";
- case PT_IA_64_HP_STACK: return "HP_STACK";
- default:
- break;
- }
-
- return NULL;
-}
-
-static const char *
-get_segment_type (unsigned long p_type)
-{
- static char buff[32];
-
- switch (p_type)
- {
- case PT_NULL: return "NULL";
- case PT_LOAD: return "LOAD";
- case PT_DYNAMIC: return "DYNAMIC";
- case PT_INTERP: return "INTERP";
- case PT_NOTE: return "NOTE";
- case PT_SHLIB: return "SHLIB";
- case PT_PHDR: return "PHDR";
- case PT_TLS: return "TLS";
-
- case PT_GNU_EH_FRAME:
- return "GNU_EH_FRAME";
- case PT_GNU_STACK: return "GNU_STACK";
- case PT_GNU_RELRO: return "GNU_RELRO";
-
- default:
- if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))
- {
- const char *result;
-
- switch (elf_header.e_machine)
- {
- case EM_ARM:
- result = get_arm_segment_type (p_type);
- break;
- case EM_MIPS:
- case EM_MIPS_RS3_LE:
- result = get_mips_segment_type (p_type);
- break;
- case EM_PARISC:
- result = get_parisc_segment_type (p_type);
- break;
- case EM_IA_64:
- result = get_ia64_segment_type (p_type);
- break;
- default:
- result = NULL;
- break;
- }
-
- if (result != NULL)
- return result;
-
- sprintf (buff, "LOPROC+%lx", p_type - PT_LOPROC);
- }
- else if ((p_type >= PT_LOOS) && (p_type <= PT_HIOS))
- {
- const char *result;
-
- switch (elf_header.e_machine)
- {
- case EM_PARISC:
- result = get_parisc_segment_type (p_type);
- break;
- case EM_IA_64:
- result = get_ia64_segment_type (p_type);
- break;
- default:
- result = NULL;
- break;
- }
-
- if (result != NULL)
- return result;
-
- sprintf (buff, "LOOS+%lx", p_type - PT_LOOS);
- }
- else
- snprintf (buff, sizeof (buff), _("<unknown>: %lx"), p_type);
-
- return buff;
- }
-}
-
-static const char *
-get_mips_section_type_name (unsigned int sh_type)
-{
- switch (sh_type)
- {
- case SHT_MIPS_LIBLIST: return "MIPS_LIBLIST";
- case SHT_MIPS_MSYM: return "MIPS_MSYM";
- case SHT_MIPS_CONFLICT: return "MIPS_CONFLICT";
- case SHT_MIPS_GPTAB: return "MIPS_GPTAB";
- case SHT_MIPS_UCODE: return "MIPS_UCODE";
- case SHT_MIPS_DEBUG: return "MIPS_DEBUG";
- case SHT_MIPS_REGINFO: return "MIPS_REGINFO";
- case SHT_MIPS_PACKAGE: return "MIPS_PACKAGE";
- case SHT_MIPS_PACKSYM: return "MIPS_PACKSYM";
- case SHT_MIPS_RELD: return "MIPS_RELD";
- case SHT_MIPS_IFACE: return "MIPS_IFACE";
- case SHT_MIPS_CONTENT: return "MIPS_CONTENT";
- case SHT_MIPS_OPTIONS: return "MIPS_OPTIONS";
- case SHT_MIPS_SHDR: return "MIPS_SHDR";
- case SHT_MIPS_FDESC: return "MIPS_FDESC";
- case SHT_MIPS_EXTSYM: return "MIPS_EXTSYM";
- case SHT_MIPS_DENSE: return "MIPS_DENSE";
- case SHT_MIPS_PDESC: return "MIPS_PDESC";
- case SHT_MIPS_LOCSYM: return "MIPS_LOCSYM";
- case SHT_MIPS_AUXSYM: return "MIPS_AUXSYM";
- case SHT_MIPS_OPTSYM: return "MIPS_OPTSYM";
- case SHT_MIPS_LOCSTR: return "MIPS_LOCSTR";
- case SHT_MIPS_LINE: return "MIPS_LINE";
- case SHT_MIPS_RFDESC: return "MIPS_RFDESC";
- case SHT_MIPS_DELTASYM: return "MIPS_DELTASYM";
- case SHT_MIPS_DELTAINST: return "MIPS_DELTAINST";
- case SHT_MIPS_DELTACLASS: return "MIPS_DELTACLASS";
- case SHT_MIPS_DWARF: return "MIPS_DWARF";
- case SHT_MIPS_DELTADECL: return "MIPS_DELTADECL";
- case SHT_MIPS_SYMBOL_LIB: return "MIPS_SYMBOL_LIB";
- case SHT_MIPS_EVENTS: return "MIPS_EVENTS";
- case SHT_MIPS_TRANSLATE: return "MIPS_TRANSLATE";
- case SHT_MIPS_PIXIE: return "MIPS_PIXIE";
- case SHT_MIPS_XLATE: return "MIPS_XLATE";
- case SHT_MIPS_XLATE_DEBUG: return "MIPS_XLATE_DEBUG";
- case SHT_MIPS_WHIRL: return "MIPS_WHIRL";
- case SHT_MIPS_EH_REGION: return "MIPS_EH_REGION";
- case SHT_MIPS_XLATE_OLD: return "MIPS_XLATE_OLD";
- case SHT_MIPS_PDR_EXCEPTION: return "MIPS_PDR_EXCEPTION";
- default:
- break;
- }
- return NULL;
-}
-
-static const char *
-get_parisc_section_type_name (unsigned int sh_type)
-{
- switch (sh_type)
- {
- case SHT_PARISC_EXT: return "PARISC_EXT";
- case SHT_PARISC_UNWIND: return "PARISC_UNWIND";
- case SHT_PARISC_DOC: return "PARISC_DOC";
- case SHT_PARISC_ANNOT: return "PARISC_ANNOT";
- case SHT_PARISC_SYMEXTN: return "PARISC_SYMEXTN";
- case SHT_PARISC_STUBS: return "PARISC_STUBS";
- case SHT_PARISC_DLKM: return "PARISC_DLKM";
- default:
- break;
- }
- return NULL;
-}
-
-static const char *
-get_ia64_section_type_name (unsigned int sh_type)
-{
- /* If the top 8 bits are 0x78 the next 8 are the os/abi ID. */
- if ((sh_type & 0xFF000000) == SHT_IA_64_LOPSREG)
- return get_osabi_name ((sh_type & 0x00FF0000) >> 16);
-
- switch (sh_type)
- {
- case SHT_IA_64_EXT: return "IA_64_EXT";
- case SHT_IA_64_UNWIND: return "IA_64_UNWIND";
- case SHT_IA_64_PRIORITY_INIT: return "IA_64_PRIORITY_INIT";
- case SHT_IA_64_VMS_TRACE: return "VMS_TRACE";
- case SHT_IA_64_VMS_TIE_SIGNATURES: return "VMS_TIE_SIGNATURES";
- case SHT_IA_64_VMS_DEBUG: return "VMS_DEBUG";
- case SHT_IA_64_VMS_DEBUG_STR: return "VMS_DEBUG_STR";
- case SHT_IA_64_VMS_LINKAGES: return "VMS_LINKAGES";
- case SHT_IA_64_VMS_SYMBOL_VECTOR: return "VMS_SYMBOL_VECTOR";
- case SHT_IA_64_VMS_FIXUP: return "VMS_FIXUP";
- default:
- break;
- }
- return NULL;
-}
-
-static const char *
-get_x86_64_section_type_name (unsigned int sh_type)
-{
- switch (sh_type)
- {
- case SHT_X86_64_UNWIND: return "X86_64_UNWIND";
- default:
- break;
- }
- return NULL;
-}
-
-static const char *
-get_arm_section_type_name (unsigned int sh_type)
-{
- switch (sh_type)
- {
- case SHT_ARM_EXIDX:
- return "ARM_EXIDX";
- case SHT_ARM_PREEMPTMAP:
- return "ARM_PREEMPTMAP";
- case SHT_ARM_ATTRIBUTES:
- return "ARM_ATTRIBUTES";
- default:
- break;
- }
- return NULL;
-}
-
-static const char *
-get_section_type_name (unsigned int sh_type)
-{
- static char buff[32];
-
- switch (sh_type)
- {
- case SHT_NULL: return "NULL";
- case SHT_PROGBITS: return "PROGBITS";
- case SHT_SYMTAB: return "SYMTAB";
- case SHT_STRTAB: return "STRTAB";
- case SHT_RELA: return "RELA";
- case SHT_HASH: return "HASH";
- case SHT_DYNAMIC: return "DYNAMIC";
- case SHT_NOTE: return "NOTE";
- case SHT_NOBITS: return "NOBITS";
- case SHT_REL: return "REL";
- case SHT_SHLIB: return "SHLIB";
- case SHT_DYNSYM: return "DYNSYM";
- case SHT_INIT_ARRAY: return "INIT_ARRAY";
- case SHT_FINI_ARRAY: return "FINI_ARRAY";
- case SHT_PREINIT_ARRAY: return "PREINIT_ARRAY";
- case SHT_GNU_HASH: return "GNU_HASH";
- case SHT_GROUP: return "GROUP";
- case SHT_SYMTAB_SHNDX: return "SYMTAB SECTION INDICIES";
- case SHT_GNU_verdef: return "VERDEF";
- case SHT_GNU_verneed: return "VERNEED";
- case SHT_GNU_versym: return "VERSYM";
- case 0x6ffffff0: return "VERSYM";
- case 0x6ffffffc: return "VERDEF";
- case 0x7ffffffd: return "AUXILIARY";
- case 0x7fffffff: return "FILTER";
- case SHT_GNU_LIBLIST: return "GNU_LIBLIST";
-
- default:
- if ((sh_type >= SHT_LOPROC) && (sh_type <= SHT_HIPROC))
- {
- const char *result;
-
- switch (elf_header.e_machine)
- {
- case EM_MIPS:
- case EM_MIPS_RS3_LE:
- result = get_mips_section_type_name (sh_type);
- break;
- case EM_PARISC:
- result = get_parisc_section_type_name (sh_type);
- break;
- case EM_IA_64:
- result = get_ia64_section_type_name (sh_type);
- break;
- case EM_X86_64:
- result = get_x86_64_section_type_name (sh_type);
- break;
- case EM_ARM:
- result = get_arm_section_type_name (sh_type);
- break;
- default:
- result = NULL;
- break;
- }
-
- if (result != NULL)
- return result;
-
- sprintf (buff, "LOPROC+%x", sh_type - SHT_LOPROC);
- }
- else if ((sh_type >= SHT_LOOS) && (sh_type <= SHT_HIOS))
- {
- const char *result;
-
- switch (elf_header.e_machine)
- {
- case EM_IA_64:
- result = get_ia64_section_type_name (sh_type);
- break;
- default:
- result = NULL;
- break;
- }
-
- if (result != NULL)
- return result;
-
- sprintf (buff, "LOOS+%x", sh_type - SHT_LOOS);
- }
- else if ((sh_type >= SHT_LOUSER) && (sh_type <= SHT_HIUSER))
- sprintf (buff, "LOUSER+%x", sh_type - SHT_LOUSER);
- else
- snprintf (buff, sizeof (buff), _("<unknown>: %x"), sh_type);
-
- return buff;
- }
-}
-
-#define OPTION_DEBUG_DUMP 512
-
-static struct option options[] =
-{
- {"all", no_argument, 0, 'a'},
- {"file-header", no_argument, 0, 'h'},
- {"program-headers", no_argument, 0, 'l'},
- {"headers", no_argument, 0, 'e'},
- {"histogram", no_argument, 0, 'I'},
- {"segments", no_argument, 0, 'l'},
- {"sections", no_argument, 0, 'S'},
- {"section-headers", no_argument, 0, 'S'},
- {"section-groups", no_argument, 0, 'g'},
- {"section-details", no_argument, 0, 't'},
- {"full-section-name",no_argument, 0, 'N'},
- {"symbols", no_argument, 0, 's'},
- {"syms", no_argument, 0, 's'},
- {"relocs", no_argument, 0, 'r'},
- {"notes", no_argument, 0, 'n'},
- {"dynamic", no_argument, 0, 'd'},
- {"arch-specific", no_argument, 0, 'A'},
- {"version-info", no_argument, 0, 'V'},
- {"use-dynamic", no_argument, 0, 'D'},
- {"unwind", no_argument, 0, 'u'},
- {"archive-index", no_argument, 0, 'c'},
- {"hex-dump", required_argument, 0, 'x'},
- {"debug-dump", optional_argument, 0, OPTION_DEBUG_DUMP},
- {"string-dump", required_argument, 0, 'p'},
-#ifdef SUPPORT_DISASSEMBLY
- {"instruction-dump", required_argument, 0, 'i'},
-#endif
-
- {"version", no_argument, 0, 'v'},
- {"wide", no_argument, 0, 'W'},
- {"help", no_argument, 0, 'H'},
- {0, no_argument, 0, 0}
-};
-
-static void
-usage (FILE *stream)
-{
- fprintf (stream, _("Usage: readelf <option(s)> elf-file(s)\n"));
- fprintf (stream, _(" Display information about the contents of ELF format files\n"));
- fprintf (stream, _(" Options are:\n\
- -a --all Equivalent to: -h -l -S -s -r -d -V -A -I\n\
- -h --file-header Display the ELF file header\n\
- -l --program-headers Display the program headers\n\
- --segments An alias for --program-headers\n\
- -S --section-headers Display the sections' header\n\
- --sections An alias for --section-headers\n\
- -g --section-groups Display the section groups\n\
- -t --section-details Display the section details\n\
- -e --headers Equivalent to: -h -l -S\n\
- -s --syms Display the symbol table\n\
- --symbols An alias for --syms\n\
- -n --notes Display the core notes (if present)\n\
- -r --relocs Display the relocations (if present)\n\
- -u --unwind Display the unwind info (if present)\n\
- -d --dynamic Display the dynamic section (if present)\n\
- -V --version-info Display the version sections (if present)\n\
- -A --arch-specific Display architecture specific information (if any).\n\
- -c --archive-index Display the symbol/file index in an archive\n\
- -D --use-dynamic Use the dynamic section info when displaying symbols\n\
- -x --hex-dump=<number|name>\n\
- Dump the contents of section <number|name> as bytes\n\
- -p --string-dump=<number|name>\n\
- Dump the contents of section <number|name> as strings\n\
- -w[lLiaprmfFsoR] or\n\
- --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=str,=loc,=Ranges]\n\
- Display the contents of DWARF2 debug sections\n"));
-#ifdef SUPPORT_DISASSEMBLY
- fprintf (stream, _("\
- -i --instruction-dump=<number|name>\n\
- Disassemble the contents of section <number|name>\n"));
-#endif
- fprintf (stream, _("\
- -I --histogram Display histogram of bucket list lengths\n\
- -W --wide Allow output width to exceed 80 characters\n\
- @<file> Read options from <file>\n\
- -H --help Display this information\n\
- -v --version Display the version number of readelf\n"));
-
- if (REPORT_BUGS_TO[0] && stream == stdout)
- fprintf (stdout, _("Report bugs to %s\n"), REPORT_BUGS_TO);
-
- exit (stream == stdout ? 0 : 1);
-}
-
-/* Record the fact that the user wants the contents of section number
- SECTION to be displayed using the method(s) encoded as flags bits
- in TYPE. Note, TYPE can be zero if we are creating the array for
- the first time. */
-
-static void
-request_dump_bynumber (unsigned int section, dump_type type)
-{
- if (section >= num_dump_sects)
- {
- dump_type *new_dump_sects;
-
- new_dump_sects = calloc (section + 1, sizeof (* dump_sects));
-
- if (new_dump_sects == NULL)
- error (_("Out of memory allocating dump request table.\n"));
- else
- {
- /* Copy current flag settings. */
- memcpy (new_dump_sects, dump_sects, num_dump_sects * sizeof (* dump_sects));
-
- free (dump_sects);
-
- dump_sects = new_dump_sects;
- num_dump_sects = section + 1;
- }
- }
-
- if (dump_sects)
- dump_sects[section] |= type;
-
- return;
-}
-
-/* Request a dump by section name. */
-
-static void
-request_dump_byname (const char *section, dump_type type)
-{
- struct dump_list_entry *new_request;
-
- new_request = malloc (sizeof (struct dump_list_entry));
- if (!new_request)
- error (_("Out of memory allocating dump request table.\n"));
-
- new_request->name = strdup (section);
- if (!new_request->name)
- error (_("Out of memory allocating dump request table.\n"));
-
- new_request->type = type;
-
- new_request->next = dump_sects_byname;
- dump_sects_byname = new_request;
-}
-
-static void
-parse_args (int argc, char **argv)
-{
- int c;
-
- if (argc < 2)
- usage (stderr);
-
- while ((c = getopt_long
- (argc, argv, "ADHINSVWacdeghi:lnp:rstuvw::x:", options, NULL)) != EOF)
- {
- char *cp;
- int section;
-
- switch (c)
- {
- case 0:
- /* Long options. */
- break;
- case 'H':
- usage (stdout);
- break;
-
- case 'a':
- do_syms++;
- do_reloc++;
- do_unwind++;
- do_dynamic++;
- do_header++;
- do_sections++;
- do_section_groups++;
- do_segments++;
- do_version++;
- do_histogram++;
- do_arch++;
- do_notes++;
- break;
- case 'g':
- do_section_groups++;
- break;
- case 't':
- case 'N':
- do_sections++;
- do_section_details++;
- break;
- case 'e':
- do_header++;
- do_sections++;
- do_segments++;
- break;
- case 'A':
- do_arch++;
- break;
- case 'D':
- do_using_dynamic++;
- break;
- case 'r':
- do_reloc++;
- break;
- case 'u':
- do_unwind++;
- break;
- case 'h':
- do_header++;
- break;
- case 'l':
- do_segments++;
- break;
- case 's':
- do_syms++;
- break;
- case 'S':
- do_sections++;
- break;
- case 'd':
- do_dynamic++;
- break;
- case 'I':
- do_histogram++;
- break;
- case 'n':
- do_notes++;
- break;
- case 'c':
- do_archive_index++;
- break;
- case 'x':
- do_dump++;
- section = strtoul (optarg, & cp, 0);
- if (! *cp && section >= 0)
- request_dump_bynumber (section, HEX_DUMP);
- else
- request_dump_byname (optarg, HEX_DUMP);
- break;
- case 'p':
- do_dump++;
- section = strtoul (optarg, & cp, 0);
- if (! *cp && section >= 0)
- request_dump_bynumber (section, STRING_DUMP);
- else
- request_dump_byname (optarg, STRING_DUMP);
- break;
- case 'w':
- do_dump++;
- if (optarg == 0)
- do_debugging = 1;
- else
- {
- unsigned int index = 0;
-
- do_debugging = 0;
-
- while (optarg[index])
- switch (optarg[index++])
- {
- case 'i':
- do_debug_info = 1;
- break;
-
- case 'a':
- do_debug_abbrevs = 1;
- break;
-
- case 'l':
- do_debug_lines = 1;
- break;
-
- case 'L':
- do_debug_lines_decoded = 1;
- break;
-
- case 'p':
- do_debug_pubnames = 1;
- break;
-
- case 'r':
- do_debug_aranges = 1;
- break;
-
- case 'R':
- do_debug_ranges = 1;
- break;
-
- case 'F':
- do_debug_frames_interp = 1;
- case 'f':
- do_debug_frames = 1;
- break;
-
- case 'm':
- do_debug_macinfo = 1;
- break;
-
- case 's':
- do_debug_str = 1;
- break;
-
- case 'o':
- do_debug_loc = 1;
- break;
-
- default:
- warn (_("Unrecognized debug option '%s'\n"), optarg);
- break;
- }
- }
- break;
- case OPTION_DEBUG_DUMP:
- do_dump++;
- if (optarg == 0)
- do_debugging = 1;
- else
- {
- typedef struct
- {
- const char * option;
- int * variable;
- }
- debug_dump_long_opts;
-
- debug_dump_long_opts opts_table [] =
- {
- /* Please keep this table alpha- sorted. */
- { "Ranges", & do_debug_ranges },
- { "abbrev", & do_debug_abbrevs },
- { "aranges", & do_debug_aranges },
- { "frames", & do_debug_frames },
- { "frames-interp", & do_debug_frames_interp },
- { "info", & do_debug_info },
- { "line", & do_debug_lines }, /* For backwards compatibility. */
- { "rawline", & do_debug_lines },
- { "decodedline", & do_debug_lines_decoded },
- { "loc", & do_debug_loc },
- { "macro", & do_debug_macinfo },
- { "pubnames", & do_debug_pubnames },
- /* This entry is for compatability
- with earlier versions of readelf. */
- { "ranges", & do_debug_aranges },
- { "str", & do_debug_str },
- { NULL, NULL }
- };
-
- const char *p;
-
- do_debugging = 0;
-
- p = optarg;
- while (*p)
- {
- debug_dump_long_opts * entry;
-
- for (entry = opts_table; entry->option; entry++)
- {
- size_t len = strlen (entry->option);
-
- if (strneq (p, entry->option, len)
- && (p[len] == ',' || p[len] == '\0'))
- {
- * entry->variable = 1;
-
- /* The --debug-dump=frames-interp option also
- enables the --debug-dump=frames option. */
- if (do_debug_frames_interp)
- do_debug_frames = 1;
-
- p += len;
- break;
- }
- }
-
- if (entry->option == NULL)
- {
- warn (_("Unrecognized debug option '%s'\n"), p);
- p = strchr (p, ',');
- if (p == NULL)
- break;
- }
-
- if (*p == ',')
- p++;
- }
- }
- break;
-#ifdef SUPPORT_DISASSEMBLY
- case 'i':
- do_dump++;
- section = strtoul (optarg, & cp, 0);
- if (! *cp && section >= 0)
- request_dump_bynumber (section, DISASS_DUMP);
- else
- request_dump_byname (optarg, DISASS_DUMP);
-#endif
- case 'v':
- print_version (program_name);
- break;
- case 'V':
- do_version++;
- break;
- case 'W':
- do_wide++;
- break;
- default:
- /* xgettext:c-format */
- error (_("Invalid option '-%c'\n"), c);
- /* Drop through. */
- case '?':
- usage (stderr);
- }
- }
-
- if (!do_dynamic && !do_syms && !do_reloc && !do_unwind && !do_sections
- && !do_segments && !do_header && !do_dump && !do_version
- && !do_histogram && !do_debugging && !do_arch && !do_notes
- && !do_section_groups && !do_archive_index)
- usage (stderr);
- else if (argc < 3)
- {
- warn (_("Nothing to do.\n"));
- usage (stderr);
- }
-}
-
-static const char *
-get_elf_class (unsigned int elf_class)
-{
- static char buff[32];
-
- switch (elf_class)
- {
- case ELFCLASSNONE: return _("none");
- case ELFCLASS32: return "ELF32";
- case ELFCLASS64: return "ELF64";
- default:
- snprintf (buff, sizeof (buff), _("<unknown: %x>"), elf_class);
- return buff;
- }
-}
-
-static const char *
-get_data_encoding (unsigned int encoding)
-{
- static char buff[32];
-
- switch (encoding)
- {
- case ELFDATANONE: return _("none");
- case ELFDATA2LSB: return _("2's complement, little endian");
- case ELFDATA2MSB: return _("2's complement, big endian");
- default:
- snprintf (buff, sizeof (buff), _("<unknown: %x>"), encoding);
- return buff;
- }
-}
-
-/* Decode the data held in 'elf_header'. */
-
-static int
-process_file_header (void)
-{
- if ( elf_header.e_ident[EI_MAG0] != ELFMAG0
- || elf_header.e_ident[EI_MAG1] != ELFMAG1
- || elf_header.e_ident[EI_MAG2] != ELFMAG2
- || elf_header.e_ident[EI_MAG3] != ELFMAG3)
- {
- error
- (_("Not an ELF file - it has the wrong magic bytes at the start\n"));
- return 0;
- }
-
- init_dwarf_regnames (elf_header.e_machine);
-
- if (do_header)
- {
- int i;
-
- printf (_("ELF Header:\n"));
- printf (_(" Magic: "));
- for (i = 0; i < EI_NIDENT; i++)
- printf ("%2.2x ", elf_header.e_ident[i]);
- printf ("\n");
- printf (_(" Class: %s\n"),
- get_elf_class (elf_header.e_ident[EI_CLASS]));
- printf (_(" Data: %s\n"),
- get_data_encoding (elf_header.e_ident[EI_DATA]));
- printf (_(" Version: %d %s\n"),
- elf_header.e_ident[EI_VERSION],
- (elf_header.e_ident[EI_VERSION] == EV_CURRENT
- ? "(current)"
- : (elf_header.e_ident[EI_VERSION] != EV_NONE
- ? "<unknown: %lx>"
- : "")));
- printf (_(" OS/ABI: %s\n"),
- get_osabi_name (elf_header.e_ident[EI_OSABI]));
- printf (_(" ABI Version: %d\n"),
- elf_header.e_ident[EI_ABIVERSION]);
- printf (_(" Type: %s\n"),
- get_file_type (elf_header.e_type));
- printf (_(" Machine: %s\n"),
- get_machine_name (elf_header.e_machine));
- printf (_(" Version: 0x%lx\n"),
- (unsigned long) elf_header.e_version);
-
- printf (_(" Entry point address: "));
- print_vma ((bfd_vma) elf_header.e_entry, PREFIX_HEX);
- printf (_("\n Start of program headers: "));
- print_vma ((bfd_vma) elf_header.e_phoff, DEC);
- printf (_(" (bytes into file)\n Start of section headers: "));
- print_vma ((bfd_vma) elf_header.e_shoff, DEC);
- printf (_(" (bytes into file)\n"));
-
- printf (_(" Flags: 0x%lx%s\n"),
- (unsigned long) elf_header.e_flags,
- get_machine_flags (elf_header.e_flags, elf_header.e_machine));
- printf (_(" Size of this header: %ld (bytes)\n"),
- (long) elf_header.e_ehsize);
- printf (_(" Size of program headers: %ld (bytes)\n"),
- (long) elf_header.e_phentsize);
- printf (_(" Number of program headers: %ld\n"),
- (long) elf_header.e_phnum);
- printf (_(" Size of section headers: %ld (bytes)\n"),
- (long) elf_header.e_shentsize);
- printf (_(" Number of section headers: %ld"),
- (long) elf_header.e_shnum);
- if (section_headers != NULL && elf_header.e_shnum == SHN_UNDEF)
- printf (" (%ld)", (long) section_headers[0].sh_size);
- putc ('\n', stdout);
- printf (_(" Section header string table index: %ld"),
- (long) elf_header.e_shstrndx);
- if (section_headers != NULL
- && elf_header.e_shstrndx == (SHN_XINDEX & 0xffff))
- printf (" (%u)", section_headers[0].sh_link);
- else if (elf_header.e_shstrndx >= elf_header.e_shnum)
- printf (" <corrupt: out of range>");
- putc ('\n', stdout);
- }
-
- if (section_headers != NULL)
- {
- if (elf_header.e_shnum == SHN_UNDEF)
- elf_header.e_shnum = section_headers[0].sh_size;
- if (elf_header.e_shstrndx == (SHN_XINDEX & 0xffff))
- elf_header.e_shstrndx = section_headers[0].sh_link;
- else if (elf_header.e_shstrndx >= elf_header.e_shnum)
- elf_header.e_shstrndx = SHN_UNDEF;
- free (section_headers);
- section_headers = NULL;
- }
-
- return 1;
-}
-
-
-static int
-get_32bit_program_headers (FILE *file, Elf_Internal_Phdr *program_headers)
-{
- Elf32_External_Phdr *phdrs;
- Elf32_External_Phdr *external;
- Elf_Internal_Phdr *internal;
- unsigned int i;
-
- phdrs = get_data (NULL, file, elf_header.e_phoff,
- elf_header.e_phentsize, elf_header.e_phnum,
- _("program headers"));
- if (!phdrs)
- return 0;
-
- for (i = 0, internal = program_headers, external = phdrs;
- i < elf_header.e_phnum;
- i++, internal++, external++)
- {
- internal->p_type = BYTE_GET (external->p_type);
- internal->p_offset = BYTE_GET (external->p_offset);
- internal->p_vaddr = BYTE_GET (external->p_vaddr);
- internal->p_paddr = BYTE_GET (external->p_paddr);
- internal->p_filesz = BYTE_GET (external->p_filesz);
- internal->p_memsz = BYTE_GET (external->p_memsz);
- internal->p_flags = BYTE_GET (external->p_flags);
- internal->p_align = BYTE_GET (external->p_align);
- }
-
- free (phdrs);
-
- return 1;
-}
-
-static int
-get_64bit_program_headers (FILE *file, Elf_Internal_Phdr *program_headers)
-{
- Elf64_External_Phdr *phdrs;
- Elf64_External_Phdr *external;
- Elf_Internal_Phdr *internal;
- unsigned int i;
-
- phdrs = get_data (NULL, file, elf_header.e_phoff,
- elf_header.e_phentsize, elf_header.e_phnum,
- _("program headers"));
- if (!phdrs)
- return 0;
-
- for (i = 0, internal = program_headers, external = phdrs;
- i < elf_header.e_phnum;
- i++, internal++, external++)
- {
- internal->p_type = BYTE_GET (external->p_type);
- internal->p_flags = BYTE_GET (external->p_flags);
- internal->p_offset = BYTE_GET (external->p_offset);
- internal->p_vaddr = BYTE_GET (external->p_vaddr);
- internal->p_paddr = BYTE_GET (external->p_paddr);
- internal->p_filesz = BYTE_GET (external->p_filesz);
- internal->p_memsz = BYTE_GET (external->p_memsz);
- internal->p_align = BYTE_GET (external->p_align);
- }
-
- free (phdrs);
-
- return 1;
-}
-
-/* Returns 1 if the program headers were read into `program_headers'. */
-
-static int
-get_program_headers (FILE *file)
-{
- Elf_Internal_Phdr *phdrs;
-
- /* Check cache of prior read. */
- if (program_headers != NULL)
- return 1;
-
- phdrs = cmalloc (elf_header.e_phnum, sizeof (Elf_Internal_Phdr));
-
- if (phdrs == NULL)
- {
- error (_("Out of memory\n"));
- return 0;
- }
-
- if (is_32bit_elf
- ? get_32bit_program_headers (file, phdrs)
- : get_64bit_program_headers (file, phdrs))
- {
- program_headers = phdrs;
- return 1;
- }
-
- free (phdrs);
- return 0;
-}
-
-/* Returns 1 if the program headers were loaded. */
-
-static int
-process_program_headers (FILE *file)
-{
- Elf_Internal_Phdr *segment;
- unsigned int i;
-
- if (elf_header.e_phnum == 0)
- {
- if (do_segments)
- printf (_("\nThere are no program headers in this file.\n"));
- return 0;
- }
-
- if (do_segments && !do_header)
- {
- printf (_("\nElf file type is %s\n"), get_file_type (elf_header.e_type));
- printf (_("Entry point "));
- print_vma ((bfd_vma) elf_header.e_entry, PREFIX_HEX);
- printf (_("\nThere are %d program headers, starting at offset "),
- elf_header.e_phnum);
- print_vma ((bfd_vma) elf_header.e_phoff, DEC);
- printf ("\n");
- }
-
- if (! get_program_headers (file))
- return 0;
-
- if (do_segments)
- {
- if (elf_header.e_phnum > 1)
- printf (_("\nProgram Headers:\n"));
- else
- printf (_("\nProgram Headers:\n"));
-
- if (is_32bit_elf)
- printf
- (_(" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n"));
- else if (do_wide)
- printf
- (_(" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n"));
- else
- {
- printf
- (_(" Type Offset VirtAddr PhysAddr\n"));
- printf
- (_(" FileSiz MemSiz Flags Align\n"));
- }
- }
-
- dynamic_addr = 0;
- dynamic_size = 0;
-
- for (i = 0, segment = program_headers;
- i < elf_header.e_phnum;
- i++, segment++)
- {
- if (do_segments)
- {
- printf (" %-14.14s ", get_segment_type (segment->p_type));
-
- if (is_32bit_elf)
- {
- printf ("0x%6.6lx ", (unsigned long) segment->p_offset);
- printf ("0x%8.8lx ", (unsigned long) segment->p_vaddr);
- printf ("0x%8.8lx ", (unsigned long) segment->p_paddr);
- printf ("0x%5.5lx ", (unsigned long) segment->p_filesz);
- printf ("0x%5.5lx ", (unsigned long) segment->p_memsz);
- printf ("%c%c%c ",
- (segment->p_flags & PF_R ? 'R' : ' '),
- (segment->p_flags & PF_W ? 'W' : ' '),
- (segment->p_flags & PF_X ? 'E' : ' '));
- printf ("%#lx", (unsigned long) segment->p_align);
- }
- else if (do_wide)
- {
- if ((unsigned long) segment->p_offset == segment->p_offset)
- printf ("0x%6.6lx ", (unsigned long) segment->p_offset);
- else
- {
- print_vma (segment->p_offset, FULL_HEX);
- putchar (' ');
- }
-
- print_vma (segment->p_vaddr, FULL_HEX);
- putchar (' ');
- print_vma (segment->p_paddr, FULL_HEX);
- putchar (' ');
-
- if ((unsigned long) segment->p_filesz == segment->p_filesz)
- printf ("0x%6.6lx ", (unsigned long) segment->p_filesz);
- else
- {
- print_vma (segment->p_filesz, FULL_HEX);
- putchar (' ');
- }
-
- if ((unsigned long) segment->p_memsz == segment->p_memsz)
- printf ("0x%6.6lx", (unsigned long) segment->p_memsz);
- else
- {
- print_vma (segment->p_offset, FULL_HEX);
- }
-
- printf (" %c%c%c ",
- (segment->p_flags & PF_R ? 'R' : ' '),
- (segment->p_flags & PF_W ? 'W' : ' '),
- (segment->p_flags & PF_X ? 'E' : ' '));
-
- if ((unsigned long) segment->p_align == segment->p_align)
- printf ("%#lx", (unsigned long) segment->p_align);
- else
- {
- print_vma (segment->p_align, PREFIX_HEX);
- }
- }
- else
- {
- print_vma (segment->p_offset, FULL_HEX);
- putchar (' ');
- print_vma (segment->p_vaddr, FULL_HEX);
- putchar (' ');
- print_vma (segment->p_paddr, FULL_HEX);
- printf ("\n ");
- print_vma (segment->p_filesz, FULL_HEX);
- putchar (' ');
- print_vma (segment->p_memsz, FULL_HEX);
- printf (" %c%c%c ",
- (segment->p_flags & PF_R ? 'R' : ' '),
- (segment->p_flags & PF_W ? 'W' : ' '),
- (segment->p_flags & PF_X ? 'E' : ' '));
- print_vma (segment->p_align, HEX);
- }
- }
-
- switch (segment->p_type)
- {
- case PT_DYNAMIC:
- if (dynamic_addr)
- error (_("more than one dynamic segment\n"));
-
- /* By default, assume that the .dynamic section is the first
- section in the DYNAMIC segment. */
- dynamic_addr = segment->p_offset;
- dynamic_size = segment->p_filesz;
-
- /* Try to locate the .dynamic section. If there is
- a section header table, we can easily locate it. */
- if (section_headers != NULL)
- {
- Elf_Internal_Shdr *sec;
-
- sec = find_section (".dynamic");
- if (sec == NULL || sec->sh_size == 0)
- {
- error (_("no .dynamic section in the dynamic segment\n"));
- break;
- }
-
- if (sec->sh_type == SHT_NOBITS)
- {
- dynamic_size = 0;
- break;
- }
-
- dynamic_addr = sec->sh_offset;
- dynamic_size = sec->sh_size;
-
- if (dynamic_addr < segment->p_offset
- || dynamic_addr > segment->p_offset + segment->p_filesz)
- warn (_("the .dynamic section is not contained"
- " within the dynamic segment\n"));
- else if (dynamic_addr > segment->p_offset)
- warn (_("the .dynamic section is not the first section"
- " in the dynamic segment.\n"));
- }
- break;
-
- case PT_INTERP:
- if (fseek (file, archive_file_offset + (long) segment->p_offset,
- SEEK_SET))
- error (_("Unable to find program interpreter name\n"));
- else
- {
- char fmt [32];
- int ret = snprintf (fmt, sizeof (fmt), "%%%ds", PATH_MAX);
-
- if (ret >= (int) sizeof (fmt) || ret < 0)
- error (_("Internal error: failed to create format string to display program interpreter\n"));
-
- program_interpreter[0] = 0;
- if (fscanf (file, fmt, program_interpreter) <= 0)
- error (_("Unable to read program interpreter name\n"));
-
- if (do_segments)
- printf (_("\n [Requesting program interpreter: %s]"),
- program_interpreter);
- }
- break;
- }
-
- if (do_segments)
- putc ('\n', stdout);
- }
-
- if (do_segments && section_headers != NULL && string_table != NULL)
- {
- printf (_("\n Section to Segment mapping:\n"));
- printf (_(" Segment Sections...\n"));
-
- for (i = 0; i < elf_header.e_phnum; i++)
- {
- unsigned int j;
- Elf_Internal_Shdr *section;
-
- segment = program_headers + i;
- section = section_headers + 1;
-
- printf (" %2.2d ", i);
-
- for (j = 1; j < elf_header.e_shnum; j++, section++)
- {
- if (ELF_IS_SECTION_IN_SEGMENT_MEMORY(section, segment))
- printf ("%s ", SECTION_NAME (section));
- }
-
- putc ('\n',stdout);
- }
- }
-
- return 1;
-}
-
-
-/* Find the file offset corresponding to VMA by using the program headers. */
-
-static long
-offset_from_vma (FILE *file, bfd_vma vma, bfd_size_type size)
-{
- Elf_Internal_Phdr *seg;
-
- if (! get_program_headers (file))
- {
- warn (_("Cannot interpret virtual addresses without program headers.\n"));
- return (long) vma;
- }
-
- for (seg = program_headers;
- seg < program_headers + elf_header.e_phnum;
- ++seg)
- {
- if (seg->p_type != PT_LOAD)
- continue;
-
- if (vma >= (seg->p_vaddr & -seg->p_align)
- && vma + size <= seg->p_vaddr + seg->p_filesz)
- return vma - seg->p_vaddr + seg->p_offset;
- }
-
- warn (_("Virtual address 0x%lx not located in any PT_LOAD segment.\n"),
- (unsigned long) vma);
- return (long) vma;
-}
-
-
-static int
-get_32bit_section_headers (FILE *file, unsigned int num)
-{
- Elf32_External_Shdr *shdrs;
- Elf_Internal_Shdr *internal;
- unsigned int i;
-
- shdrs = get_data (NULL, file, elf_header.e_shoff,
- elf_header.e_shentsize, num, _("section headers"));
- if (!shdrs)
- return 0;
-
- section_headers = cmalloc (num, sizeof (Elf_Internal_Shdr));
-
- if (section_headers == NULL)
- {
- error (_("Out of memory\n"));
- return 0;
- }
-
- for (i = 0, internal = section_headers;
- i < num;
- i++, internal++)
- {
- internal->sh_name = BYTE_GET (shdrs[i].sh_name);
- internal->sh_type = BYTE_GET (shdrs[i].sh_type);
- internal->sh_flags = BYTE_GET (shdrs[i].sh_flags);
- internal->sh_addr = BYTE_GET (shdrs[i].sh_addr);
- internal->sh_offset = BYTE_GET (shdrs[i].sh_offset);
- internal->sh_size = BYTE_GET (shdrs[i].sh_size);
- internal->sh_link = BYTE_GET (shdrs[i].sh_link);
- internal->sh_info = BYTE_GET (shdrs[i].sh_info);
- internal->sh_addralign = BYTE_GET (shdrs[i].sh_addralign);
- internal->sh_entsize = BYTE_GET (shdrs[i].sh_entsize);
- }
-
- free (shdrs);
-
- return 1;
-}
-
-static int
-get_64bit_section_headers (FILE *file, unsigned int num)
-{
- Elf64_External_Shdr *shdrs;
- Elf_Internal_Shdr *internal;
- unsigned int i;
-
- shdrs = get_data (NULL, file, elf_header.e_shoff,
- elf_header.e_shentsize, num, _("section headers"));
- if (!shdrs)
- return 0;
-
- section_headers = cmalloc (num, sizeof (Elf_Internal_Shdr));
-
- if (section_headers == NULL)
- {
- error (_("Out of memory\n"));
- return 0;
- }
-
- for (i = 0, internal = section_headers;
- i < num;
- i++, internal++)
- {
- internal->sh_name = BYTE_GET (shdrs[i].sh_name);
- internal->sh_type = BYTE_GET (shdrs[i].sh_type);
- internal->sh_flags = BYTE_GET (shdrs[i].sh_flags);
- internal->sh_addr = BYTE_GET (shdrs[i].sh_addr);
- internal->sh_size = BYTE_GET (shdrs[i].sh_size);
- internal->sh_entsize = BYTE_GET (shdrs[i].sh_entsize);
- internal->sh_link = BYTE_GET (shdrs[i].sh_link);
- internal->sh_info = BYTE_GET (shdrs[i].sh_info);
- internal->sh_offset = BYTE_GET (shdrs[i].sh_offset);
- internal->sh_addralign = BYTE_GET (shdrs[i].sh_addralign);
- }
-
- free (shdrs);
-
- return 1;
-}
-
-static Elf_Internal_Sym *
-get_32bit_elf_symbols (FILE *file, Elf_Internal_Shdr *section)
-{
- unsigned long number;
- Elf32_External_Sym *esyms;
- Elf_External_Sym_Shndx *shndx;
- Elf_Internal_Sym *isyms;
- Elf_Internal_Sym *psym;
- unsigned int j;
-
- esyms = get_data (NULL, file, section->sh_offset, 1, section->sh_size,
- _("symbols"));
- if (!esyms)
- return NULL;
-
- shndx = NULL;
- if (symtab_shndx_hdr != NULL
- && (symtab_shndx_hdr->sh_link
- == (unsigned long) (section - section_headers)))
- {
- shndx = get_data (NULL, file, symtab_shndx_hdr->sh_offset,
- 1, symtab_shndx_hdr->sh_size, _("symtab shndx"));
- if (!shndx)
- {
- free (esyms);
- return NULL;
- }
- }
-
- number = section->sh_size / section->sh_entsize;
- isyms = cmalloc (number, sizeof (Elf_Internal_Sym));
-
- if (isyms == NULL)
- {
- error (_("Out of memory\n"));
- if (shndx)
- free (shndx);
- free (esyms);
- return NULL;
- }
-
- for (j = 0, psym = isyms;
- j < number;
- j++, psym++)
- {
- psym->st_name = BYTE_GET (esyms[j].st_name);
- psym->st_value = BYTE_GET (esyms[j].st_value);
- psym->st_size = BYTE_GET (esyms[j].st_size);
- psym->st_shndx = BYTE_GET (esyms[j].st_shndx);
- if (psym->st_shndx == (SHN_XINDEX & 0xffff) && shndx != NULL)
- psym->st_shndx
- = byte_get ((unsigned char *) &shndx[j], sizeof (shndx[j]));
- else if (psym->st_shndx >= (SHN_LORESERVE & 0xffff))
- psym->st_shndx += SHN_LORESERVE - (SHN_LORESERVE & 0xffff);
- psym->st_info = BYTE_GET (esyms[j].st_info);
- psym->st_other = BYTE_GET (esyms[j].st_other);
- }
-
- if (shndx)
- free (shndx);
- free (esyms);
-
- return isyms;
-}
-
-static Elf_Internal_Sym *
-get_64bit_elf_symbols (FILE *file, Elf_Internal_Shdr *section)
-{
- unsigned long number;
- Elf64_External_Sym *esyms;
- Elf_External_Sym_Shndx *shndx;
- Elf_Internal_Sym *isyms;
- Elf_Internal_Sym *psym;
- unsigned int j;
-
- esyms = get_data (NULL, file, section->sh_offset, 1, section->sh_size,
- _("symbols"));
- if (!esyms)
- return NULL;
-
- shndx = NULL;
- if (symtab_shndx_hdr != NULL
- && (symtab_shndx_hdr->sh_link
- == (unsigned long) (section - section_headers)))
- {
- shndx = get_data (NULL, file, symtab_shndx_hdr->sh_offset,
- 1, symtab_shndx_hdr->sh_size, _("symtab shndx"));
- if (!shndx)
- {
- free (esyms);
- return NULL;
- }
- }
-
- number = section->sh_size / section->sh_entsize;
- isyms = cmalloc (number, sizeof (Elf_Internal_Sym));
-
- if (isyms == NULL)
- {
- error (_("Out of memory\n"));
- if (shndx)
- free (shndx);
- free (esyms);
- return NULL;
- }
-
- for (j = 0, psym = isyms;
- j < number;
- j++, psym++)
- {
- psym->st_name = BYTE_GET (esyms[j].st_name);
- psym->st_info = BYTE_GET (esyms[j].st_info);
- psym->st_other = BYTE_GET (esyms[j].st_other);
- psym->st_shndx = BYTE_GET (esyms[j].st_shndx);
- if (psym->st_shndx == (SHN_XINDEX & 0xffff) && shndx != NULL)
- psym->st_shndx
- = byte_get ((unsigned char *) &shndx[j], sizeof (shndx[j]));
- else if (psym->st_shndx >= (SHN_LORESERVE & 0xffff))
- psym->st_shndx += SHN_LORESERVE - (SHN_LORESERVE & 0xffff);
- psym->st_value = BYTE_GET (esyms[j].st_value);
- psym->st_size = BYTE_GET (esyms[j].st_size);
- }
-
- if (shndx)
- free (shndx);
- free (esyms);
-
- return isyms;
-}
-
-static const char *
-get_elf_section_flags (bfd_vma sh_flags)
-{
- static char buff[1024];
- char *p = buff;
- int field_size = is_32bit_elf ? 8 : 16;
- int index, size = sizeof (buff) - (field_size + 4 + 1);
- bfd_vma os_flags = 0;
- bfd_vma proc_flags = 0;
- bfd_vma unknown_flags = 0;
- static const struct
- {
- const char *str;
- int len;
- }
- flags [] =
- {
- { "WRITE", 5 },
- { "ALLOC", 5 },
- { "EXEC", 4 },
- { "MERGE", 5 },
- { "STRINGS", 7 },
- { "INFO LINK", 9 },
- { "LINK ORDER", 10 },
- { "OS NONCONF", 10 },
- { "GROUP", 5 },
- { "TLS", 3 },
- /* IA-64 specific. */
- { "SHORT", 5 },
- { "NORECOV", 7 },
- /* IA-64 OpenVMS specific. */
- { "VMS_GLOBAL", 10 },
- { "VMS_OVERLAID", 12 },
- { "VMS_SHARED", 10 },
- { "VMS_VECTOR", 10 },
- { "VMS_ALLOC_64BIT", 15 },
- { "VMS_PROTECTED", 13}
- };
-
- if (do_section_details)
- {
- sprintf (buff, "[%*.*lx]: ",
- field_size, field_size, (unsigned long) sh_flags);
- p += field_size + 4;
- }
-
- while (sh_flags)
- {
- bfd_vma flag;
-
- flag = sh_flags & - sh_flags;
- sh_flags &= ~ flag;
-
- if (do_section_details)
- {
- switch (flag)
- {
- case SHF_WRITE: index = 0; break;
- case SHF_ALLOC: index = 1; break;
- case SHF_EXECINSTR: index = 2; break;
- case SHF_MERGE: index = 3; break;
- case SHF_STRINGS: index = 4; break;
- case SHF_INFO_LINK: index = 5; break;
- case SHF_LINK_ORDER: index = 6; break;
- case SHF_OS_NONCONFORMING: index = 7; break;
- case SHF_GROUP: index = 8; break;
- case SHF_TLS: index = 9; break;
-
- default:
- index = -1;
- if (elf_header.e_machine == EM_IA_64)
- {
- if (flag == SHF_IA_64_SHORT)
- index = 10;
- else if (flag == SHF_IA_64_NORECOV)
- index = 11;
-#ifdef BFD64
- else if (elf_header.e_ident[EI_OSABI] == ELFOSABI_OPENVMS)
- switch (flag)
- {
- case SHF_IA_64_VMS_GLOBAL: index = 12; break;
- case SHF_IA_64_VMS_OVERLAID: index = 13; break;
- case SHF_IA_64_VMS_SHARED: index = 14; break;
- case SHF_IA_64_VMS_VECTOR: index = 15; break;
- case SHF_IA_64_VMS_ALLOC_64BIT: index = 16; break;
- case SHF_IA_64_VMS_PROTECTED: index = 17; break;
- default: break;
- }
-#endif
- }
- break;
- }
-
- if (index != -1)
- {
- if (p != buff + field_size + 4)
- {
- if (size < (10 + 2))
- abort ();
- size -= 2;
- *p++ = ',';
- *p++ = ' ';
- }
-
- size -= flags [index].len;
- p = stpcpy (p, flags [index].str);
- }
- else if (flag & SHF_MASKOS)
- os_flags |= flag;
- else if (flag & SHF_MASKPROC)
- proc_flags |= flag;
- else
- unknown_flags |= flag;
- }
- else
- {
- switch (flag)
- {
- case SHF_WRITE: *p = 'W'; break;
- case SHF_ALLOC: *p = 'A'; break;
- case SHF_EXECINSTR: *p = 'X'; break;
- case SHF_MERGE: *p = 'M'; break;
- case SHF_STRINGS: *p = 'S'; break;
- case SHF_INFO_LINK: *p = 'I'; break;
- case SHF_LINK_ORDER: *p = 'L'; break;
- case SHF_OS_NONCONFORMING: *p = 'O'; break;
- case SHF_GROUP: *p = 'G'; break;
- case SHF_TLS: *p = 'T'; break;
-
- default:
- if (elf_header.e_machine == EM_X86_64
- && flag == SHF_X86_64_LARGE)
- *p = 'l';
- else if (flag & SHF_MASKOS)
- {
- *p = 'o';
- sh_flags &= ~ SHF_MASKOS;
- }
- else if (flag & SHF_MASKPROC)
- {
- *p = 'p';
- sh_flags &= ~ SHF_MASKPROC;
- }
- else
- *p = 'x';
- break;
- }
- p++;
- }
- }
-
- if (do_section_details)
- {
- if (os_flags)
- {
- size -= 5 + field_size;
- if (p != buff + field_size + 4)
- {
- if (size < (2 + 1))
- abort ();
- size -= 2;
- *p++ = ',';
- *p++ = ' ';
- }
- sprintf (p, "OS (%*.*lx)", field_size, field_size,
- (unsigned long) os_flags);
- p += 5 + field_size;
- }
- if (proc_flags)
- {
- size -= 7 + field_size;
- if (p != buff + field_size + 4)
- {
- if (size < (2 + 1))
- abort ();
- size -= 2;
- *p++ = ',';
- *p++ = ' ';
- }
- sprintf (p, "PROC (%*.*lx)", field_size, field_size,
- (unsigned long) proc_flags);
- p += 7 + field_size;
- }
- if (unknown_flags)
- {
- size -= 10 + field_size;
- if (p != buff + field_size + 4)
- {
- if (size < (2 + 1))
- abort ();
- size -= 2;
- *p++ = ',';
- *p++ = ' ';
- }
- sprintf (p, "UNKNOWN (%*.*lx)", field_size, field_size,
- (unsigned long) unknown_flags);
- p += 10 + field_size;
- }
- }
-
- *p = '\0';
- return buff;
-}
-
-static int
-process_section_headers (FILE *file)
-{
- Elf_Internal_Shdr *section;
- unsigned int i;
-
- section_headers = NULL;
-
- if (elf_header.e_shnum == 0)
- {
- if (do_sections)
- printf (_("\nThere are no sections in this file.\n"));
-
- return 1;
- }
-
- if (do_sections && !do_header)
- printf (_("There are %d section headers, starting at offset 0x%lx:\n"),
- elf_header.e_shnum, (unsigned long) elf_header.e_shoff);
-
- if (is_32bit_elf)
- {
- if (! get_32bit_section_headers (file, elf_header.e_shnum))
- return 0;
- }
- else if (! get_64bit_section_headers (file, elf_header.e_shnum))
- return 0;
-
- /* Read in the string table, so that we have names to display. */
- if (elf_header.e_shstrndx != SHN_UNDEF
- && elf_header.e_shstrndx < elf_header.e_shnum)
- {
- section = section_headers + elf_header.e_shstrndx;
-
- if (section->sh_size != 0)
- {
- string_table = get_data (NULL, file, section->sh_offset,
- 1, section->sh_size, _("string table"));
-
- string_table_length = string_table != NULL ? section->sh_size : 0;
- }
- }
-
- /* Scan the sections for the dynamic symbol table
- and dynamic string table and debug sections. */
- dynamic_symbols = NULL;
- dynamic_strings = NULL;
- dynamic_syminfo = NULL;
- symtab_shndx_hdr = NULL;
-
- eh_addr_size = is_32bit_elf ? 4 : 8;
- switch (elf_header.e_machine)
- {
- case EM_MIPS:
- case EM_MIPS_RS3_LE:
- /* The 64-bit MIPS EABI uses a combination of 32-bit ELF and 64-bit
- FDE addresses. However, the ABI also has a semi-official ILP32
- variant for which the normal FDE address size rules apply.
-
- GCC 4.0 marks EABI64 objects with a dummy .gcc_compiled_longXX
- section, where XX is the size of longs in bits. Unfortunately,
- earlier compilers provided no way of distinguishing ILP32 objects
- from LP64 objects, so if there's any doubt, we should assume that
- the official LP64 form is being used. */
- if ((elf_header.e_flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI64
- && find_section (".gcc_compiled_long32") == NULL)
- eh_addr_size = 8;
- break;
-
- case EM_H8_300:
- case EM_H8_300H:
- switch (elf_header.e_flags & EF_H8_MACH)
- {
- case E_H8_MACH_H8300:
- case E_H8_MACH_H8300HN:
- case E_H8_MACH_H8300SN:
- case E_H8_MACH_H8300SXN:
- eh_addr_size = 2;
- break;
- case E_H8_MACH_H8300H:
- case E_H8_MACH_H8300S:
- case E_H8_MACH_H8300SX:
- eh_addr_size = 4;
- break;
- }
- break;
-
- case EM_M32C_OLD:
- case EM_M32C:
- switch (elf_header.e_flags & EF_M32C_CPU_MASK)
- {
- case EF_M32C_CPU_M16C:
- eh_addr_size = 2;
- break;
- }
- break;
- }
-
-#define CHECK_ENTSIZE_VALUES(section, i, size32, size64) \
- do \
- { \
- size_t expected_entsize \
- = is_32bit_elf ? size32 : size64; \
- if (section->sh_entsize != expected_entsize) \
- error (_("Section %d has invalid sh_entsize %lx (expected %lx)\n"), \
- i, (unsigned long int) section->sh_entsize, \
- (unsigned long int) expected_entsize); \
- section->sh_entsize = expected_entsize; \
- } \
- while (0)
-#define CHECK_ENTSIZE(section, i, type) \
- CHECK_ENTSIZE_VALUES (section, i, sizeof (Elf32_External_##type), \
- sizeof (Elf64_External_##type))
-
- for (i = 0, section = section_headers;
- i < elf_header.e_shnum;
- i++, section++)
- {
- char *name = SECTION_NAME (section);
-
- if (section->sh_type == SHT_DYNSYM)
- {
- if (dynamic_symbols != NULL)
- {
- error (_("File contains multiple dynamic symbol tables\n"));
- continue;
- }
-
- CHECK_ENTSIZE (section, i, Sym);
- num_dynamic_syms = section->sh_size / section->sh_entsize;
- dynamic_symbols = GET_ELF_SYMBOLS (file, section);
- }
- else if (section->sh_type == SHT_STRTAB
- && streq (name, ".dynstr"))
- {
- if (dynamic_strings != NULL)
- {
- error (_("File contains multiple dynamic string tables\n"));
- continue;
- }
-
- dynamic_strings = get_data (NULL, file, section->sh_offset,
- 1, section->sh_size, _("dynamic strings"));
- dynamic_strings_length = section->sh_size;
- }
- else if (section->sh_type == SHT_SYMTAB_SHNDX)
- {
- if (symtab_shndx_hdr != NULL)
- {
- error (_("File contains multiple symtab shndx tables\n"));
- continue;
- }
- symtab_shndx_hdr = section;
- }
- else if (section->sh_type == SHT_SYMTAB)
- CHECK_ENTSIZE (section, i, Sym);
- else if (section->sh_type == SHT_GROUP)
- CHECK_ENTSIZE_VALUES (section, i, GRP_ENTRY_SIZE, GRP_ENTRY_SIZE);
- else if (section->sh_type == SHT_REL)
- CHECK_ENTSIZE (section, i, Rel);
- else if (section->sh_type == SHT_RELA)
- CHECK_ENTSIZE (section, i, Rela);
- else if ((do_debugging || do_debug_info || do_debug_abbrevs
- || do_debug_lines || do_debug_lines_decoded || do_debug_pubnames
- || do_debug_aranges || do_debug_frames || do_debug_macinfo
- || do_debug_str || do_debug_loc || do_debug_ranges)
- && (const_strneq (name, ".debug_")
- || const_strneq (name, ".zdebug_")))
- {
- if (name[1] == 'z')
- name += sizeof (".zdebug_") - 1;
- else
- name += sizeof (".debug_") - 1;
-
- if (do_debugging
- || (do_debug_info && streq (name, "info"))
- || (do_debug_abbrevs && streq (name, "abbrev"))
- || ((do_debug_lines || do_debug_lines_decoded)
- && streq (name, "line"))
- || (do_debug_pubnames && streq (name, "pubnames"))
- || (do_debug_aranges && streq (name, "aranges"))
- || (do_debug_ranges && streq (name, "ranges"))
- || (do_debug_frames && streq (name, "frame"))
- || (do_debug_macinfo && streq (name, "macinfo"))
- || (do_debug_str && streq (name, "str"))
- || (do_debug_loc && streq (name, "loc"))
- )
- request_dump_bynumber (i, DEBUG_DUMP);
- }
- /* Linkonce section to be combined with .debug_info at link time. */
- else if ((do_debugging || do_debug_info)
- && const_strneq (name, ".gnu.linkonce.wi."))
- request_dump_bynumber (i, DEBUG_DUMP);
- else if (do_debug_frames && streq (name, ".eh_frame"))
- request_dump_bynumber (i, DEBUG_DUMP);
- }
-
- if (! do_sections)
- return 1;
-
- if (elf_header.e_shnum > 1)
- printf (_("\nSection Headers:\n"));
- else
- printf (_("\nSection Header:\n"));
-
- if (is_32bit_elf)
- {
- if (do_section_details)
- {
- printf (_(" [Nr] Name\n"));
- printf (_(" Type Addr Off Size ES Lk Inf Al\n"));
- }
- else
- printf
- (_(" [Nr] Name Type Addr Off Size ES Flg Lk Inf Al\n"));
- }
- else if (do_wide)
- {
- if (do_section_details)
- {
- printf (_(" [Nr] Name\n"));
- printf (_(" Type Address Off Size ES Lk Inf Al\n"));
- }
- else
- printf
- (_(" [Nr] Name Type Address Off Size ES Flg Lk Inf Al\n"));
- }
- else
- {
- if (do_section_details)
- {
- printf (_(" [Nr] Name\n"));
- printf (_(" Type Address Offset Link\n"));
- printf (_(" Size EntSize Info Align\n"));
- }
- else
- {
- printf (_(" [Nr] Name Type Address Offset\n"));
- printf (_(" Size EntSize Flags Link Info Align\n"));
- }
- }
-
- if (do_section_details)
- printf (_(" Flags\n"));
-
- for (i = 0, section = section_headers;
- i < elf_header.e_shnum;
- i++, section++)
- {
- if (do_section_details)
- {
- printf (" [%2u] %s\n",
- i,
- SECTION_NAME (section));
- if (is_32bit_elf || do_wide)
- printf (" %-15.15s ",
- get_section_type_name (section->sh_type));
- }
- else
- printf (" [%2u] %-17.17s %-15.15s ",
- i,
- SECTION_NAME (section),
- get_section_type_name (section->sh_type));
-
- if (is_32bit_elf)
- {
- print_vma (section->sh_addr, LONG_HEX);
-
- printf ( " %6.6lx %6.6lx %2.2lx",
- (unsigned long) section->sh_offset,
- (unsigned long) section->sh_size,
- (unsigned long) section->sh_entsize);
-
- if (do_section_details)
- fputs (" ", stdout);
- else
- printf (" %3s ", get_elf_section_flags (section->sh_flags));
-
- printf ("%2u %3u %2lu\n",
- section->sh_link,
- section->sh_info,
- (unsigned long) section->sh_addralign);
- }
- else if (do_wide)
- {
- print_vma (section->sh_addr, LONG_HEX);
-
- if ((long) section->sh_offset == section->sh_offset)
- printf (" %6.6lx", (unsigned long) section->sh_offset);
- else
- {
- putchar (' ');
- print_vma (section->sh_offset, LONG_HEX);
- }
-
- if ((unsigned long) section->sh_size == section->sh_size)
- printf (" %6.6lx", (unsigned long) section->sh_size);
- else
- {
- putchar (' ');
- print_vma (section->sh_size, LONG_HEX);
- }
-
- if ((unsigned long) section->sh_entsize == section->sh_entsize)
- printf (" %2.2lx", (unsigned long) section->sh_entsize);
- else
- {
- putchar (' ');
- print_vma (section->sh_entsize, LONG_HEX);
- }
-
- if (do_section_details)
- fputs (" ", stdout);
- else
- printf (" %3s ", get_elf_section_flags (section->sh_flags));
-
- printf ("%2u %3u ", section->sh_link, section->sh_info);
-
- if ((unsigned long) section->sh_addralign == section->sh_addralign)
- printf ("%2lu\n", (unsigned long) section->sh_addralign);
- else
- {
- print_vma (section->sh_addralign, DEC);
- putchar ('\n');
- }
- }
- else if (do_section_details)
- {
- printf (" %-15.15s ",
- get_section_type_name (section->sh_type));
- print_vma (section->sh_addr, LONG_HEX);
- if ((long) section->sh_offset == section->sh_offset)
- printf (" %16.16lx", (unsigned long) section->sh_offset);
- else
- {
- printf (" ");
- print_vma (section->sh_offset, LONG_HEX);
- }
- printf (" %u\n ", section->sh_link);
- print_vma (section->sh_size, LONG_HEX);
- putchar (' ');
- print_vma (section->sh_entsize, LONG_HEX);
-
- printf (" %-16u %lu\n",
- section->sh_info,
- (unsigned long) section->sh_addralign);
- }
- else
- {
- putchar (' ');
- print_vma (section->sh_addr, LONG_HEX);
- if ((long) section->sh_offset == section->sh_offset)
- printf (" %8.8lx", (unsigned long) section->sh_offset);
- else
- {
- printf (" ");
- print_vma (section->sh_offset, LONG_HEX);
- }
- printf ("\n ");
- print_vma (section->sh_size, LONG_HEX);
- printf (" ");
- print_vma (section->sh_entsize, LONG_HEX);
-
- printf (" %3s ", get_elf_section_flags (section->sh_flags));
-
- printf (" %2u %3u %lu\n",
- section->sh_link,
- section->sh_info,
- (unsigned long) section->sh_addralign);
- }
-
- if (do_section_details)
- printf (" %s\n", get_elf_section_flags (section->sh_flags));
- }
-
- if (!do_section_details)
- printf (_("Key to Flags:\n\
- W (write), A (alloc), X (execute), M (merge), S (strings)\n\
- I (info), L (link order), G (group), x (unknown)\n\
- O (extra OS processing required) o (OS specific), p (processor specific)\n"));
-
- return 1;
-}
-
-static const char *
-get_group_flags (unsigned int flags)
-{
- static char buff[32];
- switch (flags)
- {
- case GRP_COMDAT:
- return "COMDAT";
-
- default:
- snprintf (buff, sizeof (buff), _("[<unknown>: 0x%x]"), flags);
- break;
- }
- return buff;
-}
-
-static int
-process_section_groups (FILE *file)
-{
- Elf_Internal_Shdr *section;
- unsigned int i;
- struct group *group;
- Elf_Internal_Shdr *symtab_sec, *strtab_sec;
- Elf_Internal_Sym *symtab;
- char *strtab;
- size_t strtab_size;
-
- /* Don't process section groups unless needed. */
- if (!do_unwind && !do_section_groups)
- return 1;
-
- if (elf_header.e_shnum == 0)
- {
- if (do_section_groups)
- printf (_("\nThere are no sections in this file.\n"));
-
- return 1;
- }
-
- if (section_headers == NULL)
- {
- error (_("Section headers are not available!\n"));
- abort ();
- }
-
- section_headers_groups = calloc (elf_header.e_shnum,
- sizeof (struct group *));
-
- if (section_headers_groups == NULL)
- {
- error (_("Out of memory\n"));
- return 0;
- }
-
- /* Scan the sections for the group section. */
- group_count = 0;
- for (i = 0, section = section_headers;
- i < elf_header.e_shnum;
- i++, section++)
- if (section->sh_type == SHT_GROUP)
- group_count++;
-
- if (group_count == 0)
- {
- if (do_section_groups)
- printf (_("\nThere are no section groups in this file.\n"));
-
- return 1;
- }
-
- section_groups = calloc (group_count, sizeof (struct group));
-
- if (section_groups == NULL)
- {
- error (_("Out of memory\n"));
- return 0;
- }
-
- symtab_sec = NULL;
- strtab_sec = NULL;
- symtab = NULL;
- strtab = NULL;
- strtab_size = 0;
- for (i = 0, section = section_headers, group = section_groups;
- i < elf_header.e_shnum;
- i++, section++)
- {
- if (section->sh_type == SHT_GROUP)
- {
- char *name = SECTION_NAME (section);
- char *group_name;
- unsigned char *start, *indices;
- unsigned int entry, j, size;
- Elf_Internal_Shdr *sec;
- Elf_Internal_Sym *sym;
-
- /* Get the symbol table. */
- if (section->sh_link >= elf_header.e_shnum
- || ((sec = section_headers + section->sh_link)->sh_type
- != SHT_SYMTAB))
- {
- error (_("Bad sh_link in group section `%s'\n"), name);
- continue;
- }
-
- if (symtab_sec != sec)
- {
- symtab_sec = sec;
- if (symtab)
- free (symtab);
- symtab = GET_ELF_SYMBOLS (file, symtab_sec);
- }
-
- sym = symtab + section->sh_info;
-
- if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
- {
- if (sym->st_shndx == 0
- || sym->st_shndx >= elf_header.e_shnum)
- {
- error (_("Bad sh_info in group section `%s'\n"), name);
- continue;
- }
-
- group_name = SECTION_NAME (section_headers + sym->st_shndx);
- strtab_sec = NULL;
- if (strtab)
- free (strtab);
- strtab = NULL;
- strtab_size = 0;
- }
- else
- {
- /* Get the string table. */
- if (symtab_sec->sh_link >= elf_header.e_shnum)
- {
- strtab_sec = NULL;
- if (strtab)
- free (strtab);
- strtab = NULL;
- strtab_size = 0;
- }
- else if (strtab_sec
- != (sec = section_headers + symtab_sec->sh_link))
- {
- strtab_sec = sec;
- if (strtab)
- free (strtab);
- strtab = get_data (NULL, file, strtab_sec->sh_offset,
- 1, strtab_sec->sh_size,
- _("string table"));
- strtab_size = strtab != NULL ? strtab_sec->sh_size : 0;
- }
- group_name = sym->st_name < strtab_size
- ? strtab + sym->st_name : "<corrupt>";
- }
-
- start = get_data (NULL, file, section->sh_offset,
- 1, section->sh_size, _("section data"));
-
- indices = start;
- size = (section->sh_size / section->sh_entsize) - 1;
- entry = byte_get (indices, 4);
- indices += 4;
-
- if (do_section_groups)
- {
- printf ("\n%s group section [%5u] `%s' [%s] contains %u sections:\n",
- get_group_flags (entry), i, name, group_name, size);
-
- printf (_(" [Index] Name\n"));
- }
-
- group->group_index = i;
-
- for (j = 0; j < size; j++)
- {
- struct group_list *g;
-
- entry = byte_get (indices, 4);
- indices += 4;
-
- if (entry >= elf_header.e_shnum)
- {
- error (_("section [%5u] in group section [%5u] > maximum section [%5u]\n"),
- entry, i, elf_header.e_shnum - 1);
- continue;
- }
-
- if (section_headers_groups [entry] != NULL)
- {
- if (entry)
- {
- error (_("section [%5u] in group section [%5u] already in group section [%5u]\n"),
- entry, i,
- section_headers_groups [entry]->group_index);
- continue;
- }
- else
- {
- /* Intel C/C++ compiler may put section 0 in a
- section group. We just warn it the first time
- and ignore it afterwards. */
- static int warned = 0;
- if (!warned)
- {
- error (_("section 0 in group section [%5u]\n"),
- section_headers_groups [entry]->group_index);
- warned++;
- }
- }
- }
-
- section_headers_groups [entry] = group;
-
- if (do_section_groups)
- {
- sec = section_headers + entry;
- printf (" [%5u] %s\n", entry, SECTION_NAME (sec));
- }
-
- g = xmalloc (sizeof (struct group_list));
- g->section_index = entry;
- g->next = group->root;
- group->root = g;
- }
-
- if (start)
- free (start);
-
- group++;
- }
- }
-
- if (symtab)
- free (symtab);
- if (strtab)
- free (strtab);
- return 1;
-}
-
-static struct
-{
- const char *name;
- int reloc;
- int size;
- int rela;
-} dynamic_relocations [] =
-{
- { "REL", DT_REL, DT_RELSZ, FALSE },
- { "RELA", DT_RELA, DT_RELASZ, TRUE },
- { "PLT", DT_JMPREL, DT_PLTRELSZ, UNKNOWN }
-};
-
-/* Process the reloc section. */
-
-static int
-process_relocs (FILE *file)
-{
- unsigned long rel_size;
- unsigned long rel_offset;
-
-
- if (!do_reloc)
- return 1;
-
- if (do_using_dynamic)
- {
- int is_rela;
- const char *name;
- int has_dynamic_reloc;
- unsigned int i;
-
- has_dynamic_reloc = 0;
-
- for (i = 0; i < ARRAY_SIZE (dynamic_relocations); i++)
- {
- is_rela = dynamic_relocations [i].rela;
- name = dynamic_relocations [i].name;
- rel_size = dynamic_info [dynamic_relocations [i].size];
- rel_offset = dynamic_info [dynamic_relocations [i].reloc];
-
- has_dynamic_reloc |= rel_size;
-
- if (is_rela == UNKNOWN)
- {
- if (dynamic_relocations [i].reloc == DT_JMPREL)
- switch (dynamic_info[DT_PLTREL])
- {
- case DT_REL:
- is_rela = FALSE;
- break;
- case DT_RELA:
- is_rela = TRUE;
- break;
- }
- }
-
- if (rel_size)
- {
- printf
- (_("\n'%s' relocation section at offset 0x%lx contains %ld bytes:\n"),
- name, rel_offset, rel_size);
-
- dump_relocations (file,
- offset_from_vma (file, rel_offset, rel_size),
- rel_size,
- dynamic_symbols, num_dynamic_syms,
- dynamic_strings, dynamic_strings_length, is_rela);
- }
- }
-
- if (! has_dynamic_reloc)
- printf (_("\nThere are no dynamic relocations in this file.\n"));
- }
- else
- {
- Elf_Internal_Shdr *section;
- unsigned long i;
- int found = 0;
-
- for (i = 0, section = section_headers;
- i < elf_header.e_shnum;
- i++, section++)
- {
- if ( section->sh_type != SHT_RELA
- && section->sh_type != SHT_REL)
- continue;
-
- rel_offset = section->sh_offset;
- rel_size = section->sh_size;
-
- if (rel_size)
- {
- Elf_Internal_Shdr *strsec;
- int is_rela;
-
- printf (_("\nRelocation section "));
-
- if (string_table == NULL)
- printf ("%d", section->sh_name);
- else
- printf (_("'%s'"), SECTION_NAME (section));
-
- printf (_(" at offset 0x%lx contains %lu entries:\n"),
- rel_offset, (unsigned long) (rel_size / section->sh_entsize));
-
- is_rela = section->sh_type == SHT_RELA;
-
- if (section->sh_link != 0
- && section->sh_link < elf_header.e_shnum)
- {
- Elf_Internal_Shdr *symsec;
- Elf_Internal_Sym *symtab;
- unsigned long nsyms;
- unsigned long strtablen = 0;
- char *strtab = NULL;
-
- symsec = section_headers + section->sh_link;
- if (symsec->sh_type != SHT_SYMTAB
- && symsec->sh_type != SHT_DYNSYM)
- continue;
-
- nsyms = symsec->sh_size / symsec->sh_entsize;
- symtab = GET_ELF_SYMBOLS (file, symsec);
-
- if (symtab == NULL)
- continue;
-
- if (symsec->sh_link != 0
- && symsec->sh_link < elf_header.e_shnum)
- {
- strsec = section_headers + symsec->sh_link;
-
- strtab = get_data (NULL, file, strsec->sh_offset,
- 1, strsec->sh_size,
- _("string table"));
- strtablen = strtab == NULL ? 0 : strsec->sh_size;
- }
-
- dump_relocations (file, rel_offset, rel_size,
- symtab, nsyms, strtab, strtablen, is_rela);
- if (strtab)
- free (strtab);
- free (symtab);
- }
- else
- dump_relocations (file, rel_offset, rel_size,
- NULL, 0, NULL, 0, is_rela);
-
- found = 1;
- }
- }
-
- if (! found)
- printf (_("\nThere are no relocations in this file.\n"));
- }
-
- return 1;
-}
-
-/* Process the unwind section. */
-
-#include "unwind-ia64.h"
-
-/* An absolute address consists of a section and an offset. If the
- section is NULL, the offset itself is the address, otherwise, the
- address equals to LOAD_ADDRESS(section) + offset. */
-
-struct absaddr
- {
- unsigned short section;
- bfd_vma offset;
- };
-
-#define ABSADDR(a) \
- ((a).section \
- ? section_headers [(a).section].sh_addr + (a).offset \
- : (a).offset)
-
-struct ia64_unw_aux_info
- {
- struct ia64_unw_table_entry
- {
- struct absaddr start;
- struct absaddr end;
- struct absaddr info;
- }
- *table; /* Unwind table. */
- unsigned long table_len; /* Length of unwind table. */
- unsigned char *info; /* Unwind info. */
- unsigned long info_size; /* Size of unwind info. */
- bfd_vma info_addr; /* starting address of unwind info. */
- bfd_vma seg_base; /* Starting address of segment. */
- Elf_Internal_Sym *symtab; /* The symbol table. */
- unsigned long nsyms; /* Number of symbols. */
- char *strtab; /* The string table. */
- unsigned long strtab_size; /* Size of string table. */
- };
-
-static void
-find_symbol_for_address (Elf_Internal_Sym *symtab,
- unsigned long nsyms,
- const char *strtab,
- unsigned long strtab_size,
- struct absaddr addr,
- const char **symname,
- bfd_vma *offset)
-{
- bfd_vma dist = 0x100000;
- Elf_Internal_Sym *sym, *best = NULL;
- unsigned long i;
-
- for (i = 0, sym = symtab; i < nsyms; ++i, ++sym)
- {
- if (ELF_ST_TYPE (sym->st_info) == STT_FUNC
- && sym->st_name != 0
- && (addr.section == SHN_UNDEF || addr.section == sym->st_shndx)
- && addr.offset >= sym->st_value
- && addr.offset - sym->st_value < dist)
- {
- best = sym;
- dist = addr.offset - sym->st_value;
- if (!dist)
- break;
- }
- }
- if (best)
- {
- *symname = (best->st_name >= strtab_size
- ? "<corrupt>" : strtab + best->st_name);
- *offset = dist;
- return;
- }
- *symname = NULL;
- *offset = addr.offset;
-}
-
-static void
-dump_ia64_unwind (struct ia64_unw_aux_info *aux)
-{
- struct ia64_unw_table_entry *tp;
- int in_body;
-
- for (tp = aux->table; tp < aux->table + aux->table_len; ++tp)
- {
- bfd_vma stamp;
- bfd_vma offset;
- const unsigned char *dp;
- const unsigned char *head;
- const char *procname;
-
- find_symbol_for_address (aux->symtab, aux->nsyms, aux->strtab,
- aux->strtab_size, tp->start, &procname, &offset);
-
- fputs ("\n<", stdout);
-
- if (procname)
- {
- fputs (procname, stdout);
-
- if (offset)
- printf ("+%lx", (unsigned long) offset);
- }
-
- fputs (">: [", stdout);
- print_vma (tp->start.offset, PREFIX_HEX);
- fputc ('-', stdout);
- print_vma (tp->end.offset, PREFIX_HEX);
- printf ("], info at +0x%lx\n",
- (unsigned long) (tp->info.offset - aux->seg_base));
-
- head = aux->info + (ABSADDR (tp->info) - aux->info_addr);
- stamp = byte_get ((unsigned char *) head, sizeof (stamp));
-
- printf (" v%u, flags=0x%lx (%s%s), len=%lu bytes\n",
- (unsigned) UNW_VER (stamp),
- (unsigned long) ((stamp & UNW_FLAG_MASK) >> 32),
- UNW_FLAG_EHANDLER (stamp) ? " ehandler" : "",
- UNW_FLAG_UHANDLER (stamp) ? " uhandler" : "",
- (unsigned long) (eh_addr_size * UNW_LENGTH (stamp)));
-
- if (UNW_VER (stamp) != 1)
- {
- printf ("\tUnknown version.\n");
- continue;
- }
-
- in_body = 0;
- for (dp = head + 8; dp < head + 8 + eh_addr_size * UNW_LENGTH (stamp);)
- dp = unw_decode (dp, in_body, & in_body);
- }
-}
-
-static int
-slurp_ia64_unwind_table (FILE *file,
- struct ia64_unw_aux_info *aux,
- Elf_Internal_Shdr *sec)
-{
- unsigned long size, nrelas, i;
- Elf_Internal_Phdr *seg;
- struct ia64_unw_table_entry *tep;
- Elf_Internal_Shdr *relsec;
- Elf_Internal_Rela *rela, *rp;
- unsigned char *table, *tp;
- Elf_Internal_Sym *sym;
- const char *relname;
-
- /* First, find the starting address of the segment that includes
- this section: */
-
- if (elf_header.e_phnum)
- {
- if (! get_program_headers (file))
- return 0;
-
- for (seg = program_headers;
- seg < program_headers + elf_header.e_phnum;
- ++seg)
- {
- if (seg->p_type != PT_LOAD)
- continue;
-
- if (sec->sh_addr >= seg->p_vaddr
- && (sec->sh_addr + sec->sh_size <= seg->p_vaddr + seg->p_memsz))
- {
- aux->seg_base = seg->p_vaddr;
- break;
- }
- }
- }
-
- /* Second, build the unwind table from the contents of the unwind section: */
- size = sec->sh_size;
- table = get_data (NULL, file, sec->sh_offset, 1, size, _("unwind table"));
- if (!table)
- return 0;
-
- aux->table = xcmalloc (size / (3 * eh_addr_size), sizeof (aux->table[0]));
- tep = aux->table;
- for (tp = table; tp < table + size; tp += 3 * eh_addr_size, ++tep)
- {
- tep->start.section = SHN_UNDEF;
- tep->end.section = SHN_UNDEF;
- tep->info.section = SHN_UNDEF;
- if (is_32bit_elf)
- {
- tep->start.offset = byte_get ((unsigned char *) tp + 0, 4);
- tep->end.offset = byte_get ((unsigned char *) tp + 4, 4);
- tep->info.offset = byte_get ((unsigned char *) tp + 8, 4);
- }
- else
- {
- tep->start.offset = BYTE_GET ((unsigned char *) tp + 0);
- tep->end.offset = BYTE_GET ((unsigned char *) tp + 8);
- tep->info.offset = BYTE_GET ((unsigned char *) tp + 16);
- }
- tep->start.offset += aux->seg_base;
- tep->end.offset += aux->seg_base;
- tep->info.offset += aux->seg_base;
- }
- free (table);
-
- /* Third, apply any relocations to the unwind table: */
- for (relsec = section_headers;
- relsec < section_headers + elf_header.e_shnum;
- ++relsec)
- {
- if (relsec->sh_type != SHT_RELA
- || relsec->sh_info >= elf_header.e_shnum
- || section_headers + relsec->sh_info != sec)
- continue;
-
- if (!slurp_rela_relocs (file, relsec->sh_offset, relsec->sh_size,
- & rela, & nrelas))
- return 0;
-
- for (rp = rela; rp < rela + nrelas; ++rp)
- {
- relname = elf_ia64_reloc_type (get_reloc_type (rp->r_info));
- sym = aux->symtab + get_reloc_symindex (rp->r_info);
-
- if (! const_strneq (relname, "R_IA64_SEGREL"))
- {
- warn (_("Skipping unexpected relocation type %s\n"), relname);
- continue;
- }
-
- i = rp->r_offset / (3 * eh_addr_size);
-
- switch (rp->r_offset/eh_addr_size % 3)
- {
- case 0:
- aux->table[i].start.section = sym->st_shndx;
- aux->table[i].start.offset += rp->r_addend + sym->st_value;
- break;
- case 1:
- aux->table[i].end.section = sym->st_shndx;
- aux->table[i].end.offset += rp->r_addend + sym->st_value;
- break;
- case 2:
- aux->table[i].info.section = sym->st_shndx;
- aux->table[i].info.offset += rp->r_addend + sym->st_value;
- break;
- default:
- break;
- }
- }
-
- free (rela);
- }
-
- aux->table_len = size / (3 * eh_addr_size);
- return 1;
-}
-
-static int
-ia64_process_unwind (FILE *file)
-{
- Elf_Internal_Shdr *sec, *unwsec = NULL, *strsec;
- unsigned long i, unwcount = 0, unwstart = 0;
- struct ia64_unw_aux_info aux;
-
- memset (& aux, 0, sizeof (aux));
-
- for (i = 0, sec = section_headers; i < elf_header.e_shnum; ++i, ++sec)
- {
- if (sec->sh_type == SHT_SYMTAB
- && sec->sh_link < elf_header.e_shnum)
- {
- aux.nsyms = sec->sh_size / sec->sh_entsize;
- aux.symtab = GET_ELF_SYMBOLS (file, sec);
-
- strsec = section_headers + sec->sh_link;
- aux.strtab = get_data (NULL, file, strsec->sh_offset,
- 1, strsec->sh_size, _("string table"));
- aux.strtab_size = aux.strtab != NULL ? strsec->sh_size : 0;
- }
- else if (sec->sh_type == SHT_IA_64_UNWIND)
- unwcount++;
- }
-
- if (!unwcount)
- printf (_("\nThere are no unwind sections in this file.\n"));
-
- while (unwcount-- > 0)
- {
- char *suffix;
- size_t len, len2;
-
- for (i = unwstart, sec = section_headers + unwstart;
- i < elf_header.e_shnum; ++i, ++sec)
- if (sec->sh_type == SHT_IA_64_UNWIND)
- {
- unwsec = sec;
- break;
- }
-
- unwstart = i + 1;
- len = sizeof (ELF_STRING_ia64_unwind_once) - 1;
-
- if ((unwsec->sh_flags & SHF_GROUP) != 0)
- {
- /* We need to find which section group it is in. */
- struct group_list *g = section_headers_groups [i]->root;
-
- for (; g != NULL; g = g->next)
- {
- sec = section_headers + g->section_index;
-
- if (streq (SECTION_NAME (sec), ELF_STRING_ia64_unwind_info))
- break;
- }
-
- if (g == NULL)
- i = elf_header.e_shnum;
- }
- else if (strneq (SECTION_NAME (unwsec), ELF_STRING_ia64_unwind_once, len))
- {
- /* .gnu.linkonce.ia64unw.FOO -> .gnu.linkonce.ia64unwi.FOO. */
- len2 = sizeof (ELF_STRING_ia64_unwind_info_once) - 1;
- suffix = SECTION_NAME (unwsec) + len;
- for (i = 0, sec = section_headers; i < elf_header.e_shnum;
- ++i, ++sec)
- if (strneq (SECTION_NAME (sec), ELF_STRING_ia64_unwind_info_once, len2)
- && streq (SECTION_NAME (sec) + len2, suffix))
- break;
- }
- else
- {
- /* .IA_64.unwindFOO -> .IA_64.unwind_infoFOO
- .IA_64.unwind or BAR -> .IA_64.unwind_info. */
- len = sizeof (ELF_STRING_ia64_unwind) - 1;
- len2 = sizeof (ELF_STRING_ia64_unwind_info) - 1;
- suffix = "";
- if (strneq (SECTION_NAME (unwsec), ELF_STRING_ia64_unwind, len))
- suffix = SECTION_NAME (unwsec) + len;
- for (i = 0, sec = section_headers; i < elf_header.e_shnum;
- ++i, ++sec)
- if (strneq (SECTION_NAME (sec), ELF_STRING_ia64_unwind_info, len2)
- && streq (SECTION_NAME (sec) + len2, suffix))
- break;
- }
-
- if (i == elf_header.e_shnum)
- {
- printf (_("\nCould not find unwind info section for "));
-
- if (string_table == NULL)
- printf ("%d", unwsec->sh_name);
- else
- printf (_("'%s'"), SECTION_NAME (unwsec));
- }
- else
- {
- aux.info_size = sec->sh_size;
- aux.info_addr = sec->sh_addr;
- aux.info = get_data (NULL, file, sec->sh_offset, 1, aux.info_size,
- _("unwind info"));
-
- printf (_("\nUnwind section "));
-
- if (string_table == NULL)
- printf ("%d", unwsec->sh_name);
- else
- printf (_("'%s'"), SECTION_NAME (unwsec));
-
- printf (_(" at offset 0x%lx contains %lu entries:\n"),
- (unsigned long) unwsec->sh_offset,
- (unsigned long) (unwsec->sh_size / (3 * eh_addr_size)));
-
- (void) slurp_ia64_unwind_table (file, & aux, unwsec);
-
- if (aux.table_len > 0)
- dump_ia64_unwind (& aux);
-
- if (aux.table)
- free ((char *) aux.table);
- if (aux.info)
- free ((char *) aux.info);
- aux.table = NULL;
- aux.info = NULL;
- }
- }
-
- if (aux.symtab)
- free (aux.symtab);
- if (aux.strtab)
- free ((char *) aux.strtab);
-
- return 1;
-}
-
-struct hppa_unw_aux_info
- {
- struct hppa_unw_table_entry
- {
- struct absaddr start;
- struct absaddr end;
- unsigned int Cannot_unwind:1; /* 0 */
- unsigned int Millicode:1; /* 1 */
- unsigned int Millicode_save_sr0:1; /* 2 */
- unsigned int Region_description:2; /* 3..4 */
- unsigned int reserved1:1; /* 5 */
- unsigned int Entry_SR:1; /* 6 */
- unsigned int Entry_FR:4; /* number saved */ /* 7..10 */
- unsigned int Entry_GR:5; /* number saved */ /* 11..15 */
- unsigned int Args_stored:1; /* 16 */
- unsigned int Variable_Frame:1; /* 17 */
- unsigned int Separate_Package_Body:1; /* 18 */
- unsigned int Frame_Extension_Millicode:1; /* 19 */
- unsigned int Stack_Overflow_Check:1; /* 20 */
- unsigned int Two_Instruction_SP_Increment:1; /* 21 */
- unsigned int Ada_Region:1; /* 22 */
- unsigned int cxx_info:1; /* 23 */
- unsigned int cxx_try_catch:1; /* 24 */
- unsigned int sched_entry_seq:1; /* 25 */
- unsigned int reserved2:1; /* 26 */
- unsigned int Save_SP:1; /* 27 */
- unsigned int Save_RP:1; /* 28 */
- unsigned int Save_MRP_in_frame:1; /* 29 */
- unsigned int extn_ptr_defined:1; /* 30 */
- unsigned int Cleanup_defined:1; /* 31 */
-
- unsigned int MPE_XL_interrupt_marker:1; /* 0 */
- unsigned int HP_UX_interrupt_marker:1; /* 1 */
- unsigned int Large_frame:1; /* 2 */
- unsigned int Pseudo_SP_Set:1; /* 3 */
- unsigned int reserved4:1; /* 4 */
- unsigned int Total_frame_size:27; /* 5..31 */
- }
- *table; /* Unwind table. */
- unsigned long table_len; /* Length of unwind table. */
- bfd_vma seg_base; /* Starting address of segment. */
- Elf_Internal_Sym *symtab; /* The symbol table. */
- unsigned long nsyms; /* Number of symbols. */
- char *strtab; /* The string table. */
- unsigned long strtab_size; /* Size of string table. */
- };
-
-static void
-dump_hppa_unwind (struct hppa_unw_aux_info *aux)
-{
- struct hppa_unw_table_entry *tp;
-
- for (tp = aux->table; tp < aux->table + aux->table_len; ++tp)
- {
- bfd_vma offset;
- const char *procname;
-
- find_symbol_for_address (aux->symtab, aux->nsyms, aux->strtab,
- aux->strtab_size, tp->start, &procname,
- &offset);
-
- fputs ("\n<", stdout);
-
- if (procname)
- {
- fputs (procname, stdout);
-
- if (offset)
- printf ("+%lx", (unsigned long) offset);
- }
-
- fputs (">: [", stdout);
- print_vma (tp->start.offset, PREFIX_HEX);
- fputc ('-', stdout);
- print_vma (tp->end.offset, PREFIX_HEX);
- printf ("]\n\t");
-
-#define PF(_m) if (tp->_m) printf (#_m " ");
-#define PV(_m) if (tp->_m) printf (#_m "=%d ", tp->_m);
- PF(Cannot_unwind);
- PF(Millicode);
- PF(Millicode_save_sr0);
- /* PV(Region_description); */
- PF(Entry_SR);
- PV(Entry_FR);
- PV(Entry_GR);
- PF(Args_stored);
- PF(Variable_Frame);
- PF(Separate_Package_Body);
- PF(Frame_Extension_Millicode);
- PF(Stack_Overflow_Check);
- PF(Two_Instruction_SP_Increment);
- PF(Ada_Region);
- PF(cxx_info);
- PF(cxx_try_catch);
- PF(sched_entry_seq);
- PF(Save_SP);
- PF(Save_RP);
- PF(Save_MRP_in_frame);
- PF(extn_ptr_defined);
- PF(Cleanup_defined);
- PF(MPE_XL_interrupt_marker);
- PF(HP_UX_interrupt_marker);
- PF(Large_frame);
- PF(Pseudo_SP_Set);
- PV(Total_frame_size);
-#undef PF
-#undef PV
- }
-
- printf ("\n");
-}
-
-static int
-slurp_hppa_unwind_table (FILE *file,
- struct hppa_unw_aux_info *aux,
- Elf_Internal_Shdr *sec)
-{
- unsigned long size, unw_ent_size, nentries, nrelas, i;
- Elf_Internal_Phdr *seg;
- struct hppa_unw_table_entry *tep;
- Elf_Internal_Shdr *relsec;
- Elf_Internal_Rela *rela, *rp;
- unsigned char *table, *tp;
- Elf_Internal_Sym *sym;
- const char *relname;
-
- /* First, find the starting address of the segment that includes
- this section. */
-
- if (elf_header.e_phnum)
- {
- if (! get_program_headers (file))
- return 0;
-
- for (seg = program_headers;
- seg < program_headers + elf_header.e_phnum;
- ++seg)
- {
- if (seg->p_type != PT_LOAD)
- continue;
-
- if (sec->sh_addr >= seg->p_vaddr
- && (sec->sh_addr + sec->sh_size <= seg->p_vaddr + seg->p_memsz))
- {
- aux->seg_base = seg->p_vaddr;
- break;
- }
- }
- }
-
- /* Second, build the unwind table from the contents of the unwind
- section. */
- size = sec->sh_size;
- table = get_data (NULL, file, sec->sh_offset, 1, size, _("unwind table"));
- if (!table)
- return 0;
-
- unw_ent_size = 16;
- nentries = size / unw_ent_size;
- size = unw_ent_size * nentries;
-
- tep = aux->table = xcmalloc (nentries, sizeof (aux->table[0]));
-
- for (tp = table; tp < table + size; tp += unw_ent_size, ++tep)
- {
- unsigned int tmp1, tmp2;
-
- tep->start.section = SHN_UNDEF;
- tep->end.section = SHN_UNDEF;
-
- tep->start.offset = byte_get ((unsigned char *) tp + 0, 4);
- tep->end.offset = byte_get ((unsigned char *) tp + 4, 4);
- tmp1 = byte_get ((unsigned char *) tp + 8, 4);
- tmp2 = byte_get ((unsigned char *) tp + 12, 4);
-
- tep->start.offset += aux->seg_base;
- tep->end.offset += aux->seg_base;
-
- tep->Cannot_unwind = (tmp1 >> 31) & 0x1;
- tep->Millicode = (tmp1 >> 30) & 0x1;
- tep->Millicode_save_sr0 = (tmp1 >> 29) & 0x1;
- tep->Region_description = (tmp1 >> 27) & 0x3;
- tep->reserved1 = (tmp1 >> 26) & 0x1;
- tep->Entry_SR = (tmp1 >> 25) & 0x1;
- tep->Entry_FR = (tmp1 >> 21) & 0xf;
- tep->Entry_GR = (tmp1 >> 16) & 0x1f;
- tep->Args_stored = (tmp1 >> 15) & 0x1;
- tep->Variable_Frame = (tmp1 >> 14) & 0x1;
- tep->Separate_Package_Body = (tmp1 >> 13) & 0x1;
- tep->Frame_Extension_Millicode = (tmp1 >> 12) & 0x1;
- tep->Stack_Overflow_Check = (tmp1 >> 11) & 0x1;
- tep->Two_Instruction_SP_Increment = (tmp1 >> 10) & 0x1;
- tep->Ada_Region = (tmp1 >> 9) & 0x1;
- tep->cxx_info = (tmp1 >> 8) & 0x1;
- tep->cxx_try_catch = (tmp1 >> 7) & 0x1;
- tep->sched_entry_seq = (tmp1 >> 6) & 0x1;
- tep->reserved2 = (tmp1 >> 5) & 0x1;
- tep->Save_SP = (tmp1 >> 4) & 0x1;
- tep->Save_RP = (tmp1 >> 3) & 0x1;
- tep->Save_MRP_in_frame = (tmp1 >> 2) & 0x1;
- tep->extn_ptr_defined = (tmp1 >> 1) & 0x1;
- tep->Cleanup_defined = tmp1 & 0x1;
-
- tep->MPE_XL_interrupt_marker = (tmp2 >> 31) & 0x1;
- tep->HP_UX_interrupt_marker = (tmp2 >> 30) & 0x1;
- tep->Large_frame = (tmp2 >> 29) & 0x1;
- tep->Pseudo_SP_Set = (tmp2 >> 28) & 0x1;
- tep->reserved4 = (tmp2 >> 27) & 0x1;
- tep->Total_frame_size = tmp2 & 0x7ffffff;
- }
- free (table);
-
- /* Third, apply any relocations to the unwind table. */
- for (relsec = section_headers;
- relsec < section_headers + elf_header.e_shnum;
- ++relsec)
- {
- if (relsec->sh_type != SHT_RELA
- || relsec->sh_info >= elf_header.e_shnum
- || section_headers + relsec->sh_info != sec)
- continue;
-
- if (!slurp_rela_relocs (file, relsec->sh_offset, relsec->sh_size,
- & rela, & nrelas))
- return 0;
-
- for (rp = rela; rp < rela + nrelas; ++rp)
- {
- relname = elf_hppa_reloc_type (get_reloc_type (rp->r_info));
- sym = aux->symtab + get_reloc_symindex (rp->r_info);
-
- /* R_PARISC_SEGREL32 or R_PARISC_SEGREL64. */
- if (! const_strneq (relname, "R_PARISC_SEGREL"))
- {
- warn (_("Skipping unexpected relocation type %s\n"), relname);
- continue;
- }
-
- i = rp->r_offset / unw_ent_size;
-
- switch ((rp->r_offset % unw_ent_size) / eh_addr_size)
- {
- case 0:
- aux->table[i].start.section = sym->st_shndx;
- aux->table[i].start.offset += sym->st_value + rp->r_addend;
- break;
- case 1:
- aux->table[i].end.section = sym->st_shndx;
- aux->table[i].end.offset += sym->st_value + rp->r_addend;
- break;
- default:
- break;
- }
- }
-
- free (rela);
- }
-
- aux->table_len = nentries;
-
- return 1;
-}
-
-static int
-hppa_process_unwind (FILE *file)
-{
- struct hppa_unw_aux_info aux;
- Elf_Internal_Shdr *unwsec = NULL;
- Elf_Internal_Shdr *strsec;
- Elf_Internal_Shdr *sec;
- unsigned long i;
-
- memset (& aux, 0, sizeof (aux));
-
- if (string_table == NULL)
- return 1;
-
- for (i = 0, sec = section_headers; i < elf_header.e_shnum; ++i, ++sec)
- {
- if (sec->sh_type == SHT_SYMTAB
- && sec->sh_link < elf_header.e_shnum)
- {
- aux.nsyms = sec->sh_size / sec->sh_entsize;
- aux.symtab = GET_ELF_SYMBOLS (file, sec);
-
- strsec = section_headers + sec->sh_link;
- aux.strtab = get_data (NULL, file, strsec->sh_offset,
- 1, strsec->sh_size, _("string table"));
- aux.strtab_size = aux.strtab != NULL ? strsec->sh_size : 0;
- }
- else if (streq (SECTION_NAME (sec), ".PARISC.unwind"))
- unwsec = sec;
- }
-
- if (!unwsec)
- printf (_("\nThere are no unwind sections in this file.\n"));
-
- for (i = 0, sec = section_headers; i < elf_header.e_shnum; ++i, ++sec)
- {
- if (streq (SECTION_NAME (sec), ".PARISC.unwind"))
- {
- printf (_("\nUnwind section "));
- printf (_("'%s'"), SECTION_NAME (sec));
-
- printf (_(" at offset 0x%lx contains %lu entries:\n"),
- (unsigned long) sec->sh_offset,
- (unsigned long) (sec->sh_size / (2 * eh_addr_size + 8)));
-
- slurp_hppa_unwind_table (file, &aux, sec);
- if (aux.table_len > 0)
- dump_hppa_unwind (&aux);
-
- if (aux.table)
- free ((char *) aux.table);
- aux.table = NULL;
- }
- }
-
- if (aux.symtab)
- free (aux.symtab);
- if (aux.strtab)
- free ((char *) aux.strtab);
-
- return 1;
-}
-
-static int
-process_unwind (FILE *file)
-{
- struct unwind_handler {
- int machtype;
- int (*handler)(FILE *file);
- } handlers[] = {
- { EM_IA_64, ia64_process_unwind },
- { EM_PARISC, hppa_process_unwind },
- { 0, 0 }
- };
- int i;
-
- if (!do_unwind)
- return 1;
-
- for (i = 0; handlers[i].handler != NULL; i++)
- if (elf_header.e_machine == handlers[i].machtype)
- return handlers[i].handler (file);
-
- printf (_("\nThere are no unwind sections in this file.\n"));
- return 1;
-}
-
-static void
-dynamic_section_mips_val (Elf_Internal_Dyn *entry)
-{
- switch (entry->d_tag)
- {
- case DT_MIPS_FLAGS:
- if (entry->d_un.d_val == 0)
- printf ("NONE\n");
- else
- {
- static const char * opts[] =
- {
- "QUICKSTART", "NOTPOT", "NO_LIBRARY_REPLACEMENT",
- "NO_MOVE", "SGI_ONLY", "GUARANTEE_INIT", "DELTA_C_PLUS_PLUS",
- "GUARANTEE_START_INIT", "PIXIE", "DEFAULT_DELAY_LOAD",
- "REQUICKSTART", "REQUICKSTARTED", "CORD", "NO_UNRES_UNDEF",
- "RLD_ORDER_SAFE"
- };
- unsigned int cnt;
- int first = 1;
- for (cnt = 0; cnt < ARRAY_SIZE (opts); ++cnt)
- if (entry->d_un.d_val & (1 << cnt))
- {
- printf ("%s%s", first ? "" : " ", opts[cnt]);
- first = 0;
- }
- puts ("");
- }
- break;
-
- case DT_MIPS_IVERSION:
- if (VALID_DYNAMIC_NAME (entry->d_un.d_val))
- printf ("Interface Version: %s\n", GET_DYNAMIC_NAME (entry->d_un.d_val));
- else
- printf ("<corrupt: %ld>\n", (long) entry->d_un.d_ptr);
- break;
-
- case DT_MIPS_TIME_STAMP:
- {
- char timebuf[20];
- struct tm *tmp;
-
- time_t time = entry->d_un.d_val;
- tmp = gmtime (&time);
- snprintf (timebuf, sizeof (timebuf), "%04u-%02u-%02uT%02u:%02u:%02u",
- tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
- tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
- printf ("Time Stamp: %s\n", timebuf);
- }
- break;
-
- case DT_MIPS_RLD_VERSION:
- case DT_MIPS_LOCAL_GOTNO:
- case DT_MIPS_CONFLICTNO:
- case DT_MIPS_LIBLISTNO:
- case DT_MIPS_SYMTABNO:
- case DT_MIPS_UNREFEXTNO:
- case DT_MIPS_HIPAGENO:
- case DT_MIPS_DELTA_CLASS_NO:
- case DT_MIPS_DELTA_INSTANCE_NO:
- case DT_MIPS_DELTA_RELOC_NO:
- case DT_MIPS_DELTA_SYM_NO:
- case DT_MIPS_DELTA_CLASSSYM_NO:
- case DT_MIPS_COMPACT_SIZE:
- printf ("%ld\n", (long) entry->d_un.d_ptr);
- break;
-
- default:
- printf ("%#lx\n", (unsigned long) entry->d_un.d_ptr);
- }
-}
-
-
-static void
-dynamic_section_parisc_val (Elf_Internal_Dyn *entry)
-{
- switch (entry->d_tag)
- {
- case DT_HP_DLD_FLAGS:
- {
- static struct
- {
- long int bit;
- const char *str;
- }
- flags[] =
- {
- { DT_HP_DEBUG_PRIVATE, "HP_DEBUG_PRIVATE" },
- { DT_HP_DEBUG_CALLBACK, "HP_DEBUG_CALLBACK" },
- { DT_HP_DEBUG_CALLBACK_BOR, "HP_DEBUG_CALLBACK_BOR" },
- { DT_HP_NO_ENVVAR, "HP_NO_ENVVAR" },
- { DT_HP_BIND_NOW, "HP_BIND_NOW" },
- { DT_HP_BIND_NONFATAL, "HP_BIND_NONFATAL" },
- { DT_HP_BIND_VERBOSE, "HP_BIND_VERBOSE" },
- { DT_HP_BIND_RESTRICTED, "HP_BIND_RESTRICTED" },
- { DT_HP_BIND_SYMBOLIC, "HP_BIND_SYMBOLIC" },
- { DT_HP_RPATH_FIRST, "HP_RPATH_FIRST" },
- { DT_HP_BIND_DEPTH_FIRST, "HP_BIND_DEPTH_FIRST" },
- { DT_HP_GST, "HP_GST" },
- { DT_HP_SHLIB_FIXED, "HP_SHLIB_FIXED" },
- { DT_HP_MERGE_SHLIB_SEG, "HP_MERGE_SHLIB_SEG" },
- { DT_HP_NODELETE, "HP_NODELETE" },
- { DT_HP_GROUP, "HP_GROUP" },
- { DT_HP_PROTECT_LINKAGE_TABLE, "HP_PROTECT_LINKAGE_TABLE" }
- };
- int first = 1;
- size_t cnt;
- bfd_vma val = entry->d_un.d_val;
-
- for (cnt = 0; cnt < ARRAY_SIZE (flags); ++cnt)
- if (val & flags[cnt].bit)
- {
- if (! first)
- putchar (' ');
- fputs (flags[cnt].str, stdout);
- first = 0;
- val ^= flags[cnt].bit;
- }
-
- if (val != 0 || first)
- {
- if (! first)
- putchar (' ');
- print_vma (val, HEX);
- }
- }
- break;
-
- default:
- print_vma (entry->d_un.d_ptr, PREFIX_HEX);
- break;
- }
- putchar ('\n');
-}
-
-static void
-dynamic_section_ia64_val (Elf_Internal_Dyn *entry)
-{
- switch (entry->d_tag)
- {
- case DT_IA_64_PLT_RESERVE:
- /* First 3 slots reserved. */
- print_vma (entry->d_un.d_ptr, PREFIX_HEX);
- printf (" -- ");
- print_vma (entry->d_un.d_ptr + (3 * 8), PREFIX_HEX);
- break;
-
- default:
- print_vma (entry->d_un.d_ptr, PREFIX_HEX);
- break;
- }
- putchar ('\n');
-}
-
-static int
-get_32bit_dynamic_section (FILE *file)
-{
- Elf32_External_Dyn *edyn, *ext;
- Elf_Internal_Dyn *entry;
-
- edyn = get_data (NULL, file, dynamic_addr, 1, dynamic_size,
- _("dynamic section"));
- if (!edyn)
- return 0;
-
-/* SGI's ELF has more than one section in the DYNAMIC segment, and we
- might not have the luxury of section headers. Look for the DT_NULL
- terminator to determine the number of entries. */
- for (ext = edyn, dynamic_nent = 0;
- (char *) ext < (char *) edyn + dynamic_size;
- ext++)
- {
- dynamic_nent++;
- if (BYTE_GET (ext->d_tag) == DT_NULL)
- break;
- }
-
- dynamic_section = cmalloc (dynamic_nent, sizeof (*entry));
- if (dynamic_section == NULL)
- {
- error (_("Out of memory\n"));
- free (edyn);
- return 0;
- }
-
- for (ext = edyn, entry = dynamic_section;
- entry < dynamic_section + dynamic_nent;
- ext++, entry++)
- {
- entry->d_tag = BYTE_GET (ext->d_tag);
- entry->d_un.d_val = BYTE_GET (ext->d_un.d_val);
- }
-
- free (edyn);
-
- return 1;
-}
-
-static int
-get_64bit_dynamic_section (FILE *file)
-{
- Elf64_External_Dyn *edyn, *ext;
- Elf_Internal_Dyn *entry;
-
- edyn = get_data (NULL, file, dynamic_addr, 1, dynamic_size,
- _("dynamic section"));
- if (!edyn)
- return 0;
-
-/* SGI's ELF has more than one section in the DYNAMIC segment, and we
- might not have the luxury of section headers. Look for the DT_NULL
- terminator to determine the number of entries. */
- for (ext = edyn, dynamic_nent = 0;
- (char *) ext < (char *) edyn + dynamic_size;
- ext++)
- {
- dynamic_nent++;
- if (BYTE_GET (ext->d_tag) == DT_NULL)
- break;
- }
-
- dynamic_section = cmalloc (dynamic_nent, sizeof (*entry));
- if (dynamic_section == NULL)
- {
- error (_("Out of memory\n"));
- free (edyn);
- return 0;
- }
-
- for (ext = edyn, entry = dynamic_section;
- entry < dynamic_section + dynamic_nent;
- ext++, entry++)
- {
- entry->d_tag = BYTE_GET (ext->d_tag);
- entry->d_un.d_val = BYTE_GET (ext->d_un.d_val);
- }
-
- free (edyn);
-
- return 1;
-}
-
-static void
-print_dynamic_flags (bfd_vma flags)
-{
- int first = 1;
-
- while (flags)
- {
- bfd_vma flag;
-
- flag = flags & - flags;
- flags &= ~ flag;
-
- if (first)
- first = 0;
- else
- putc (' ', stdout);
-
- switch (flag)
- {
- case DF_ORIGIN: fputs ("ORIGIN", stdout); break;
- case DF_SYMBOLIC: fputs ("SYMBOLIC", stdout); break;
- case DF_TEXTREL: fputs ("TEXTREL", stdout); break;
- case DF_BIND_NOW: fputs ("BIND_NOW", stdout); break;
- case DF_STATIC_TLS: fputs ("STATIC_TLS", stdout); break;
- default: fputs ("unknown", stdout); break;
- }
- }
- puts ("");
-}
-
-/* Parse and display the contents of the dynamic section. */
-
-static int
-process_dynamic_section (FILE *file)
-{
- Elf_Internal_Dyn *entry;
-
- if (dynamic_size == 0)
- {
- if (do_dynamic)
- printf (_("\nThere is no dynamic section in this file.\n"));
-
- return 1;
- }
-
- if (is_32bit_elf)
- {
- if (! get_32bit_dynamic_section (file))
- return 0;
- }
- else if (! get_64bit_dynamic_section (file))
- return 0;
-
- /* Find the appropriate symbol table. */
- if (dynamic_symbols == NULL)
- {
- for (entry = dynamic_section;
- entry < dynamic_section + dynamic_nent;
- ++entry)
- {
- Elf_Internal_Shdr section;
-
- if (entry->d_tag != DT_SYMTAB)
- continue;
-
- dynamic_info[DT_SYMTAB] = entry->d_un.d_val;
-
- /* Since we do not know how big the symbol table is,
- we default to reading in the entire file (!) and
- processing that. This is overkill, I know, but it
- should work. */
- section.sh_offset = offset_from_vma (file, entry->d_un.d_val, 0);
-
- if (archive_file_offset != 0)
- section.sh_size = archive_file_size - section.sh_offset;
- else
- {
- if (fseek (file, 0, SEEK_END))
- error (_("Unable to seek to end of file!\n"));
-
- section.sh_size = ftell (file) - section.sh_offset;
- }
-
- if (is_32bit_elf)
- section.sh_entsize = sizeof (Elf32_External_Sym);
- else
- section.sh_entsize = sizeof (Elf64_External_Sym);
-
- num_dynamic_syms = section.sh_size / section.sh_entsize;
- if (num_dynamic_syms < 1)
- {
- error (_("Unable to determine the number of symbols to load\n"));
- continue;
- }
-
- dynamic_symbols = GET_ELF_SYMBOLS (file, &section);
- }
- }
-
- /* Similarly find a string table. */
- if (dynamic_strings == NULL)
- {
- for (entry = dynamic_section;
- entry < dynamic_section + dynamic_nent;
- ++entry)
- {
- unsigned long offset;
- long str_tab_len;
-
- if (entry->d_tag != DT_STRTAB)
- continue;
-
- dynamic_info[DT_STRTAB] = entry->d_un.d_val;
-
- /* Since we do not know how big the string table is,
- we default to reading in the entire file (!) and
- processing that. This is overkill, I know, but it
- should work. */
-
- offset = offset_from_vma (file, entry->d_un.d_val, 0);
-
- if (archive_file_offset != 0)
- str_tab_len = archive_file_size - offset;
- else
- {
- if (fseek (file, 0, SEEK_END))
- error (_("Unable to seek to end of file\n"));
- str_tab_len = ftell (file) - offset;
- }
-
- if (str_tab_len < 1)
- {
- error
- (_("Unable to determine the length of the dynamic string table\n"));
- continue;
- }
-
- dynamic_strings = get_data (NULL, file, offset, 1, str_tab_len,
- _("dynamic string table"));
- dynamic_strings_length = str_tab_len;
- break;
- }
- }
-
- /* And find the syminfo section if available. */
- if (dynamic_syminfo == NULL)
- {
- unsigned long syminsz = 0;
-
- for (entry = dynamic_section;
- entry < dynamic_section + dynamic_nent;
- ++entry)
- {
- if (entry->d_tag == DT_SYMINENT)
- {
- /* Note: these braces are necessary to avoid a syntax
- error from the SunOS4 C compiler. */
- assert (sizeof (Elf_External_Syminfo) == entry->d_un.d_val);
- }
- else if (entry->d_tag == DT_SYMINSZ)
- syminsz = entry->d_un.d_val;
- else if (entry->d_tag == DT_SYMINFO)
- dynamic_syminfo_offset = offset_from_vma (file, entry->d_un.d_val,
- syminsz);
- }
-
- if (dynamic_syminfo_offset != 0 && syminsz != 0)
- {
- Elf_External_Syminfo *extsyminfo, *extsym;
- Elf_Internal_Syminfo *syminfo;
-
- /* There is a syminfo section. Read the data. */
- extsyminfo = get_data (NULL, file, dynamic_syminfo_offset, 1,
- syminsz, _("symbol information"));
- if (!extsyminfo)
- return 0;
-
- dynamic_syminfo = malloc (syminsz);
- if (dynamic_syminfo == NULL)
- {
- error (_("Out of memory\n"));
- return 0;
- }
-
- dynamic_syminfo_nent = syminsz / sizeof (Elf_External_Syminfo);
- for (syminfo = dynamic_syminfo, extsym = extsyminfo;
- syminfo < dynamic_syminfo + dynamic_syminfo_nent;
- ++syminfo, ++extsym)
- {
- syminfo->si_boundto = BYTE_GET (extsym->si_boundto);
- syminfo->si_flags = BYTE_GET (extsym->si_flags);
- }
-
- free (extsyminfo);
- }
- }
-
- if (do_dynamic && dynamic_addr)
- printf (_("\nDynamic section at offset 0x%lx contains %u entries:\n"),
- dynamic_addr, dynamic_nent);
- if (do_dynamic)
- printf (_(" Tag Type Name/Value\n"));
-
- for (entry = dynamic_section;
- entry < dynamic_section + dynamic_nent;
- entry++)
- {
- if (do_dynamic)
- {
- const char *dtype;
-
- putchar (' ');
- print_vma (entry->d_tag, FULL_HEX);
- dtype = get_dynamic_type (entry->d_tag);
- printf (" (%s)%*s", dtype,
- ((is_32bit_elf ? 27 : 19)
- - (int) strlen (dtype)),
- " ");
- }
-
- switch (entry->d_tag)
- {
- case DT_FLAGS:
- if (do_dynamic)
- print_dynamic_flags (entry->d_un.d_val);
- break;
-
- case DT_AUXILIARY:
- case DT_FILTER:
- case DT_CONFIG:
- case DT_DEPAUDIT:
- case DT_AUDIT:
- if (do_dynamic)
- {
- switch (entry->d_tag)
- {
- case DT_AUXILIARY:
- printf (_("Auxiliary library"));
- break;
-
- case DT_FILTER:
- printf (_("Filter library"));
- break;
-
- case DT_CONFIG:
- printf (_("Configuration file"));
- break;
-
- case DT_DEPAUDIT:
- printf (_("Dependency audit library"));
- break;
-
- case DT_AUDIT:
- printf (_("Audit library"));
- break;
- }
-
- if (VALID_DYNAMIC_NAME (entry->d_un.d_val))
- printf (": [%s]\n", GET_DYNAMIC_NAME (entry->d_un.d_val));
- else
- {
- printf (": ");
- print_vma (entry->d_un.d_val, PREFIX_HEX);
- putchar ('\n');
- }
- }
- break;
-
- case DT_FEATURE:
- if (do_dynamic)
- {
- printf (_("Flags:"));
-
- if (entry->d_un.d_val == 0)
- printf (_(" None\n"));
- else
- {
- unsigned long int val = entry->d_un.d_val;
-
- if (val & DTF_1_PARINIT)
- {
- printf (" PARINIT");
- val ^= DTF_1_PARINIT;
- }
- if (val & DTF_1_CONFEXP)
- {
- printf (" CONFEXP");
- val ^= DTF_1_CONFEXP;
- }
- if (val != 0)
- printf (" %lx", val);
- puts ("");
- }
- }
- break;
-
- case DT_POSFLAG_1:
- if (do_dynamic)
- {
- printf (_("Flags:"));
-
- if (entry->d_un.d_val == 0)
- printf (_(" None\n"));
- else
- {
- unsigned long int val = entry->d_un.d_val;
-
- if (val & DF_P1_LAZYLOAD)
- {
- printf (" LAZYLOAD");
- val ^= DF_P1_LAZYLOAD;
- }
- if (val & DF_P1_GROUPPERM)
- {
- printf (" GROUPPERM");
- val ^= DF_P1_GROUPPERM;
- }
- if (val != 0)
- printf (" %lx", val);
- puts ("");
- }
- }
- break;
-
- case DT_FLAGS_1:
- if (do_dynamic)
- {
- printf (_("Flags:"));
- if (entry->d_un.d_val == 0)
- printf (_(" None\n"));
- else
- {
- unsigned long int val = entry->d_un.d_val;
-
- if (val & DF_1_NOW)
- {
- printf (" NOW");
- val ^= DF_1_NOW;
- }
- if (val & DF_1_GLOBAL)
- {
- printf (" GLOBAL");
- val ^= DF_1_GLOBAL;
- }
- if (val & DF_1_GROUP)
- {
- printf (" GROUP");
- val ^= DF_1_GROUP;
- }
- if (val & DF_1_NODELETE)
- {
- printf (" NODELETE");
- val ^= DF_1_NODELETE;
- }
- if (val & DF_1_LOADFLTR)
- {
- printf (" LOADFLTR");
- val ^= DF_1_LOADFLTR;
- }
- if (val & DF_1_INITFIRST)
- {
- printf (" INITFIRST");
- val ^= DF_1_INITFIRST;
- }
- if (val & DF_1_NOOPEN)
- {
- printf (" NOOPEN");
- val ^= DF_1_NOOPEN;
- }
- if (val & DF_1_ORIGIN)
- {
- printf (" ORIGIN");
- val ^= DF_1_ORIGIN;
- }
- if (val & DF_1_DIRECT)
- {
- printf (" DIRECT");
- val ^= DF_1_DIRECT;
- }
- if (val & DF_1_TRANS)
- {
- printf (" TRANS");
- val ^= DF_1_TRANS;
- }
- if (val & DF_1_INTERPOSE)
- {
- printf (" INTERPOSE");
- val ^= DF_1_INTERPOSE;
- }
- if (val & DF_1_NODEFLIB)
- {
- printf (" NODEFLIB");
- val ^= DF_1_NODEFLIB;
- }
- if (val & DF_1_NODUMP)
- {
- printf (" NODUMP");
- val ^= DF_1_NODUMP;
- }
- if (val & DF_1_CONLFAT)
- {
- printf (" CONLFAT");
- val ^= DF_1_CONLFAT;
- }
- if (val != 0)
- printf (" %lx", val);
- puts ("");
- }
- }
- break;
-
- case DT_PLTREL:
- dynamic_info[entry->d_tag] = entry->d_un.d_val;
- if (do_dynamic)
- puts (get_dynamic_type (entry->d_un.d_val));
- break;
-
- case DT_NULL :
- case DT_NEEDED :
- case DT_PLTGOT :
- case DT_HASH :
- case DT_STRTAB :
- case DT_SYMTAB :
- case DT_RELA :
- case DT_INIT :
- case DT_FINI :
- case DT_SONAME :
- case DT_RPATH :
- case DT_SYMBOLIC:
- case DT_REL :
- case DT_DEBUG :
- case DT_TEXTREL :
- case DT_JMPREL :
- case DT_RUNPATH :
- dynamic_info[entry->d_tag] = entry->d_un.d_val;
-
- if (do_dynamic)
- {
- char *name;
-
- if (VALID_DYNAMIC_NAME (entry->d_un.d_val))
- name = GET_DYNAMIC_NAME (entry->d_un.d_val);
- else
- name = NULL;
-
- if (name)
- {
- switch (entry->d_tag)
- {
- case DT_NEEDED:
- printf (_("Shared library: [%s]"), name);
-
- if (streq (name, program_interpreter))
- printf (_(" program interpreter"));
- break;
-
- case DT_SONAME:
- printf (_("Library soname: [%s]"), name);
- break;
-
- case DT_RPATH:
- printf (_("Library rpath: [%s]"), name);
- break;
-
- case DT_RUNPATH:
- printf (_("Library runpath: [%s]"), name);
- break;
-
- default:
- print_vma (entry->d_un.d_val, PREFIX_HEX);
- break;
- }
- }
- else
- print_vma (entry->d_un.d_val, PREFIX_HEX);
-
- putchar ('\n');
- }
- break;
-
- case DT_PLTRELSZ:
- case DT_RELASZ :
- case DT_STRSZ :
- case DT_RELSZ :
- case DT_RELAENT :
- case DT_SYMENT :
- case DT_RELENT :
- dynamic_info[entry->d_tag] = entry->d_un.d_val;
- case DT_PLTPADSZ:
- case DT_MOVEENT :
- case DT_MOVESZ :
- case DT_INIT_ARRAYSZ:
- case DT_FINI_ARRAYSZ:
- case DT_GNU_CONFLICTSZ:
- case DT_GNU_LIBLISTSZ:
- if (do_dynamic)
- {
- print_vma (entry->d_un.d_val, UNSIGNED);
- printf (" (bytes)\n");
- }
- break;
-
- case DT_VERDEFNUM:
- case DT_VERNEEDNUM:
- case DT_RELACOUNT:
- case DT_RELCOUNT:
- if (do_dynamic)
- {
- print_vma (entry->d_un.d_val, UNSIGNED);
- putchar ('\n');
- }
- break;
-
- case DT_SYMINSZ:
- case DT_SYMINENT:
- case DT_SYMINFO:
- case DT_USED:
- case DT_INIT_ARRAY:
- case DT_FINI_ARRAY:
- if (do_dynamic)
- {
- if (entry->d_tag == DT_USED
- && VALID_DYNAMIC_NAME (entry->d_un.d_val))
- {
- char *name = GET_DYNAMIC_NAME (entry->d_un.d_val);
-
- if (*name)
- {
- printf (_("Not needed object: [%s]\n"), name);
- break;
- }
- }
-
- print_vma (entry->d_un.d_val, PREFIX_HEX);
- putchar ('\n');
- }
- break;
-
- case DT_BIND_NOW:
- /* The value of this entry is ignored. */
- if (do_dynamic)
- putchar ('\n');
- break;
-
- case DT_GNU_PRELINKED:
- if (do_dynamic)
- {
- struct tm *tmp;
- time_t time = entry->d_un.d_val;
-
- tmp = gmtime (&time);
- printf ("%04u-%02u-%02uT%02u:%02u:%02u\n",
- tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
- tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
-
- }
- break;
-
- case DT_GNU_HASH:
- dynamic_info_DT_GNU_HASH = entry->d_un.d_val;
- if (do_dynamic)
- {
- print_vma (entry->d_un.d_val, PREFIX_HEX);
- putchar ('\n');
- }
- break;
-
- default:
- if ((entry->d_tag >= DT_VERSYM) && (entry->d_tag <= DT_VERNEEDNUM))
- version_info[DT_VERSIONTAGIDX (entry->d_tag)] =
- entry->d_un.d_val;
-
- if (do_dynamic)
- {
- switch (elf_header.e_machine)
- {
- case EM_MIPS:
- case EM_MIPS_RS3_LE:
- dynamic_section_mips_val (entry);
- break;
- case EM_PARISC:
- dynamic_section_parisc_val (entry);
- break;
- case EM_IA_64:
- dynamic_section_ia64_val (entry);
- break;
- default:
- print_vma (entry->d_un.d_val, PREFIX_HEX);
- putchar ('\n');
- }
- }
- break;
- }
- }
-
- return 1;
-}
-
-static char *
-get_ver_flags (unsigned int flags)
-{
- static char buff[32];
-
- buff[0] = 0;
-
- if (flags == 0)
- return _("none");
-
- if (flags & VER_FLG_BASE)
- strcat (buff, "BASE ");
-
- if (flags & VER_FLG_WEAK)
- {
- if (flags & VER_FLG_BASE)
- strcat (buff, "| ");
-
- strcat (buff, "WEAK ");
- }
-
- if (flags & ~(VER_FLG_BASE | VER_FLG_WEAK))
- strcat (buff, "| <unknown>");
-
- return buff;
-}
-
-/* Display the contents of the version sections. */
-static int
-process_version_sections (FILE *file)
-{
- Elf_Internal_Shdr *section;
- unsigned i;
- int found = 0;
-
- if (! do_version)
- return 1;
-
- for (i = 0, section = section_headers;
- i < elf_header.e_shnum;
- i++, section++)
- {
- switch (section->sh_type)
- {
- case SHT_GNU_verdef:
- {
- Elf_External_Verdef *edefs;
- unsigned int idx;
- unsigned int cnt;
- char *endbuf;
-
- found = 1;
-
- printf
- (_("\nVersion definition section '%s' contains %u entries:\n"),
- SECTION_NAME (section), section->sh_info);
-
- printf (_(" Addr: 0x"));
- printf_vma (section->sh_addr);
- printf (_(" Offset: %#08lx Link: %u (%s)\n"),
- (unsigned long) section->sh_offset, section->sh_link,
- section->sh_link < elf_header.e_shnum
- ? SECTION_NAME (section_headers + section->sh_link)
- : "<corrupt>");
-
- edefs = get_data (NULL, file, section->sh_offset, 1,
- section->sh_size,
- _("version definition section"));
- endbuf = (char *) edefs + section->sh_size;
- if (!edefs)
- break;
-
- for (idx = cnt = 0; cnt < section->sh_info; ++cnt)
- {
- char *vstart;
- Elf_External_Verdef *edef;
- Elf_Internal_Verdef ent;
- Elf_External_Verdaux *eaux;
- Elf_Internal_Verdaux aux;
- int j;
- int isum;
-
- vstart = ((char *) edefs) + idx;
- if (vstart + sizeof (*edef) > endbuf)
- break;
-
- edef = (Elf_External_Verdef *) vstart;
-
- ent.vd_version = BYTE_GET (edef->vd_version);
- ent.vd_flags = BYTE_GET (edef->vd_flags);
- ent.vd_ndx = BYTE_GET (edef->vd_ndx);
- ent.vd_cnt = BYTE_GET (edef->vd_cnt);
- ent.vd_hash = BYTE_GET (edef->vd_hash);
- ent.vd_aux = BYTE_GET (edef->vd_aux);
- ent.vd_next = BYTE_GET (edef->vd_next);
-
- printf (_(" %#06x: Rev: %d Flags: %s"),
- idx, ent.vd_version, get_ver_flags (ent.vd_flags));
-
- printf (_(" Index: %d Cnt: %d "),
- ent.vd_ndx, ent.vd_cnt);
-
- vstart += ent.vd_aux;
-
- eaux = (Elf_External_Verdaux *) vstart;
-
- aux.vda_name = BYTE_GET (eaux->vda_name);
- aux.vda_next = BYTE_GET (eaux->vda_next);
-
- if (VALID_DYNAMIC_NAME (aux.vda_name))
- printf (_("Name: %s\n"), GET_DYNAMIC_NAME (aux.vda_name));
- else
- printf (_("Name index: %ld\n"), aux.vda_name);
-
- isum = idx + ent.vd_aux;
-
- for (j = 1; j < ent.vd_cnt; j++)
- {
- isum += aux.vda_next;
- vstart += aux.vda_next;
-
- eaux = (Elf_External_Verdaux *) vstart;
- if (vstart + sizeof (*eaux) > endbuf)
- break;
-
- aux.vda_name = BYTE_GET (eaux->vda_name);
- aux.vda_next = BYTE_GET (eaux->vda_next);
-
- if (VALID_DYNAMIC_NAME (aux.vda_name))
- printf (_(" %#06x: Parent %d: %s\n"),
- isum, j, GET_DYNAMIC_NAME (aux.vda_name));
- else
- printf (_(" %#06x: Parent %d, name index: %ld\n"),
- isum, j, aux.vda_name);
- }
- if (j < ent.vd_cnt)
- printf (_(" Version def aux past end of section\n"));
-
- idx += ent.vd_next;
- }
- if (cnt < section->sh_info)
- printf (_(" Version definition past end of section\n"));
-
- free (edefs);
- }
- break;
-
- case SHT_GNU_verneed:
- {
- Elf_External_Verneed *eneed;
- unsigned int idx;
- unsigned int cnt;
- char *endbuf;
-
- found = 1;
-
- printf (_("\nVersion needs section '%s' contains %u entries:\n"),
- SECTION_NAME (section), section->sh_info);
-
- printf (_(" Addr: 0x"));
- printf_vma (section->sh_addr);
- printf (_(" Offset: %#08lx Link: %u (%s)\n"),
- (unsigned long) section->sh_offset, section->sh_link,
- section->sh_link < elf_header.e_shnum
- ? SECTION_NAME (section_headers + section->sh_link)
- : "<corrupt>");
-
- eneed = get_data (NULL, file, section->sh_offset, 1,
- section->sh_size,
- _("version need section"));
- endbuf = (char *) eneed + section->sh_size;
- if (!eneed)
- break;
-
- for (idx = cnt = 0; cnt < section->sh_info; ++cnt)
- {
- Elf_External_Verneed *entry;
- Elf_Internal_Verneed ent;
- int j;
- int isum;
- char *vstart;
-
- vstart = ((char *) eneed) + idx;
- if (vstart + sizeof (*entry) > endbuf)
- break;
-
- entry = (Elf_External_Verneed *) vstart;
-
- ent.vn_version = BYTE_GET (entry->vn_version);
- ent.vn_cnt = BYTE_GET (entry->vn_cnt);
- ent.vn_file = BYTE_GET (entry->vn_file);
- ent.vn_aux = BYTE_GET (entry->vn_aux);
- ent.vn_next = BYTE_GET (entry->vn_next);
-
- printf (_(" %#06x: Version: %d"), idx, ent.vn_version);
-
- if (VALID_DYNAMIC_NAME (ent.vn_file))
- printf (_(" File: %s"), GET_DYNAMIC_NAME (ent.vn_file));
- else
- printf (_(" File: %lx"), ent.vn_file);
-
- printf (_(" Cnt: %d\n"), ent.vn_cnt);
-
- vstart += ent.vn_aux;
-
- for (j = 0, isum = idx + ent.vn_aux; j < ent.vn_cnt; ++j)
- {
- Elf_External_Vernaux *eaux;
- Elf_Internal_Vernaux aux;
-
- if (vstart + sizeof (*eaux) > endbuf)
- break;
- eaux = (Elf_External_Vernaux *) vstart;
-
- aux.vna_hash = BYTE_GET (eaux->vna_hash);
- aux.vna_flags = BYTE_GET (eaux->vna_flags);
- aux.vna_other = BYTE_GET (eaux->vna_other);
- aux.vna_name = BYTE_GET (eaux->vna_name);
- aux.vna_next = BYTE_GET (eaux->vna_next);
-
- if (VALID_DYNAMIC_NAME (aux.vna_name))
- printf (_(" %#06x: Name: %s"),
- isum, GET_DYNAMIC_NAME (aux.vna_name));
- else
- printf (_(" %#06x: Name index: %lx"),
- isum, aux.vna_name);
-
- printf (_(" Flags: %s Version: %d\n"),
- get_ver_flags (aux.vna_flags), aux.vna_other);
-
- isum += aux.vna_next;
- vstart += aux.vna_next;
- }
- if (j < ent.vn_cnt)
- printf (_(" Version need aux past end of section\n"));
-
- idx += ent.vn_next;
- }
- if (cnt < section->sh_info)
- printf (_(" Version need past end of section\n"));
-
- free (eneed);
- }
- break;
-
- case SHT_GNU_versym:
- {
- Elf_Internal_Shdr *link_section;
- int total;
- int cnt;
- unsigned char *edata;
- unsigned short *data;
- char *strtab;
- Elf_Internal_Sym *symbols;
- Elf_Internal_Shdr *string_sec;
- long off;
-
- if (section->sh_link >= elf_header.e_shnum)
- break;
-
- link_section = section_headers + section->sh_link;
- total = section->sh_size / sizeof (Elf_External_Versym);
-
- if (link_section->sh_link >= elf_header.e_shnum)
- break;
-
- found = 1;
-
- symbols = GET_ELF_SYMBOLS (file, link_section);
-
- string_sec = section_headers + link_section->sh_link;
-
- strtab = get_data (NULL, file, string_sec->sh_offset, 1,
- string_sec->sh_size, _("version string table"));
- if (!strtab)
- break;
-
- printf (_("\nVersion symbols section '%s' contains %d entries:\n"),
- SECTION_NAME (section), total);
-
- printf (_(" Addr: "));
- printf_vma (section->sh_addr);
- printf (_(" Offset: %#08lx Link: %u (%s)\n"),
- (unsigned long) section->sh_offset, section->sh_link,
- SECTION_NAME (link_section));
-
- off = offset_from_vma (file,
- version_info[DT_VERSIONTAGIDX (DT_VERSYM)],
- total * sizeof (short));
- edata = get_data (NULL, file, off, total, sizeof (short),
- _("version symbol data"));
- if (!edata)
- {
- free (strtab);
- break;
- }
-
- data = cmalloc (total, sizeof (short));
-
- for (cnt = total; cnt --;)
- data[cnt] = byte_get (edata + cnt * sizeof (short),
- sizeof (short));
-
- free (edata);
-
- for (cnt = 0; cnt < total; cnt += 4)
- {
- int j, nn;
- int check_def, check_need;
- char *name;
-
- printf (" %03x:", cnt);
-
- for (j = 0; (j < 4) && (cnt + j) < total; ++j)
- switch (data[cnt + j])
- {
- case 0:
- fputs (_(" 0 (*local*) "), stdout);
- break;
-
- case 1:
- fputs (_(" 1 (*global*) "), stdout);
- break;
-
- default:
- nn = printf ("%4x%c", data[cnt + j] & 0x7fff,
- data[cnt + j] & 0x8000 ? 'h' : ' ');
-
- check_def = 1;
- check_need = 1;
- if (symbols[cnt + j].st_shndx >= elf_header.e_shnum
- || section_headers[symbols[cnt + j].st_shndx].sh_type
- != SHT_NOBITS)
- {
- if (symbols[cnt + j].st_shndx == SHN_UNDEF)
- check_def = 0;
- else
- check_need = 0;
- }
-
- if (check_need
- && version_info[DT_VERSIONTAGIDX (DT_VERNEED)])
- {
- Elf_Internal_Verneed ivn;
- unsigned long offset;
-
- offset = offset_from_vma
- (file, version_info[DT_VERSIONTAGIDX (DT_VERNEED)],
- sizeof (Elf_External_Verneed));
-
- do
- {
- Elf_Internal_Vernaux ivna;
- Elf_External_Verneed evn;
- Elf_External_Vernaux evna;
- unsigned long a_off;
-
- get_data (&evn, file, offset, sizeof (evn), 1,
- _("version need"));
-
- ivn.vn_aux = BYTE_GET (evn.vn_aux);
- ivn.vn_next = BYTE_GET (evn.vn_next);
-
- a_off = offset + ivn.vn_aux;
-
- do
- {
- get_data (&evna, file, a_off, sizeof (evna),
- 1, _("version need aux (2)"));
-
- ivna.vna_next = BYTE_GET (evna.vna_next);
- ivna.vna_other = BYTE_GET (evna.vna_other);
-
- a_off += ivna.vna_next;
- }
- while (ivna.vna_other != data[cnt + j]
- && ivna.vna_next != 0);
-
- if (ivna.vna_other == data[cnt + j])
- {
- ivna.vna_name = BYTE_GET (evna.vna_name);
-
- if (ivna.vna_name >= string_sec->sh_size)
- name = _("*invalid*");
- else
- name = strtab + ivna.vna_name;
- nn += printf ("(%s%-*s",
- name,
- 12 - (int) strlen (name),
- ")");
- check_def = 0;
- break;
- }
-
- offset += ivn.vn_next;
- }
- while (ivn.vn_next);
- }
-
- if (check_def && data[cnt + j] != 0x8001
- && version_info[DT_VERSIONTAGIDX (DT_VERDEF)])
- {
- Elf_Internal_Verdef ivd;
- Elf_External_Verdef evd;
- unsigned long offset;
-
- offset = offset_from_vma
- (file, version_info[DT_VERSIONTAGIDX (DT_VERDEF)],
- sizeof evd);
-
- do
- {
- get_data (&evd, file, offset, sizeof (evd), 1,
- _("version def"));
-
- ivd.vd_next = BYTE_GET (evd.vd_next);
- ivd.vd_ndx = BYTE_GET (evd.vd_ndx);
-
- offset += ivd.vd_next;
- }
- while (ivd.vd_ndx != (data[cnt + j] & 0x7fff)
- && ivd.vd_next != 0);
-
- if (ivd.vd_ndx == (data[cnt + j] & 0x7fff))
- {
- Elf_External_Verdaux evda;
- Elf_Internal_Verdaux ivda;
-
- ivd.vd_aux = BYTE_GET (evd.vd_aux);
-
- get_data (&evda, file,
- offset - ivd.vd_next + ivd.vd_aux,
- sizeof (evda), 1,
- _("version def aux"));
-
- ivda.vda_name = BYTE_GET (evda.vda_name);
-
- if (ivda.vda_name >= string_sec->sh_size)
- name = _("*invalid*");
- else
- name = strtab + ivda.vda_name;
- nn += printf ("(%s%-*s",
- name,
- 12 - (int) strlen (name),
- ")");
- }
- }
-
- if (nn < 18)
- printf ("%*c", 18 - nn, ' ');
- }
-
- putchar ('\n');
- }
-
- free (data);
- free (strtab);
- free (symbols);
- }
- break;
-
- default:
- break;
- }
- }
-
- if (! found)
- printf (_("\nNo version information found in this file.\n"));
-
- return 1;
-}
-
-static const char *
-get_symbol_binding (unsigned int binding)
-{
- static char buff[32];
-
- switch (binding)
- {
- case STB_LOCAL: return "LOCAL";
- case STB_GLOBAL: return "GLOBAL";
- case STB_WEAK: return "WEAK";
- default:
- if (binding >= STB_LOPROC && binding <= STB_HIPROC)
- snprintf (buff, sizeof (buff), _("<processor specific>: %d"),
- binding);
- else if (binding >= STB_LOOS && binding <= STB_HIOS)
- snprintf (buff, sizeof (buff), _("<OS specific>: %d"), binding);
- else
- snprintf (buff, sizeof (buff), _("<unknown>: %d"), binding);
- return buff;
- }
-}
-
-static const char *
-get_symbol_type (unsigned int type)
-{
- static char buff[32];
-
- switch (type)
- {
- case STT_NOTYPE: return "NOTYPE";
- case STT_OBJECT: return "OBJECT";
- case STT_FUNC: return "FUNC";
- case STT_SECTION: return "SECTION";
- case STT_FILE: return "FILE";
- case STT_COMMON: return "COMMON";
- case STT_TLS: return "TLS";
- case STT_RELC: return "RELC";
- case STT_SRELC: return "SRELC";
- default:
- if (type >= STT_LOPROC && type <= STT_HIPROC)
- {
- if (elf_header.e_machine == EM_ARM && type == STT_ARM_TFUNC)
- return "THUMB_FUNC";
-
- if (elf_header.e_machine == EM_SPARCV9 && type == STT_REGISTER)
- return "REGISTER";
-
- if (elf_header.e_machine == EM_PARISC && type == STT_PARISC_MILLI)
- return "PARISC_MILLI";
-
- snprintf (buff, sizeof (buff), _("<processor specific>: %d"), type);
- }
- else if (type >= STT_LOOS && type <= STT_HIOS)
- {
- if (elf_header.e_machine == EM_PARISC)
- {
- if (type == STT_HP_OPAQUE)
- return "HP_OPAQUE";
- if (type == STT_HP_STUB)
- return "HP_STUB";
- }
-
- snprintf (buff, sizeof (buff), _("<OS specific>: %d"), type);
- }
- else
- snprintf (buff, sizeof (buff), _("<unknown>: %d"), type);
- return buff;
- }
-}
-
-static const char *
-get_symbol_visibility (unsigned int visibility)
-{
- switch (visibility)
- {
- case STV_DEFAULT: return "DEFAULT";
- case STV_INTERNAL: return "INTERNAL";
- case STV_HIDDEN: return "HIDDEN";
- case STV_PROTECTED: return "PROTECTED";
- default: abort ();
- }
-}
-
-static const char *
-get_mips_symbol_other (unsigned int other)
-{
- switch (other)
- {
- case STO_OPTIONAL: return "OPTIONAL";
- case STO_MIPS16: return "MIPS16";
- default: return NULL;
- }
-}
-
-static const char *
-get_symbol_other (unsigned int other)
-{
- const char * result = NULL;
- static char buff [32];
-
- if (other == 0)
- return "";
-
- switch (elf_header.e_machine)
- {
- case EM_MIPS:
- result = get_mips_symbol_other (other);
- default:
- break;
- }
-
- if (result)
- return result;
-
- snprintf (buff, sizeof buff, _("<other>: %x"), other);
- return buff;
-}
-
-static const char *
-get_symbol_index_type (unsigned int type)
-{
- static char buff[32];
-
- switch (type)
- {
- case SHN_UNDEF: return "UND";
- case SHN_ABS: return "ABS";
- case SHN_COMMON: return "COM";
- default:
- if (type == SHN_IA_64_ANSI_COMMON
- && elf_header.e_machine == EM_IA_64
- && elf_header.e_ident[EI_OSABI] == ELFOSABI_HPUX)
- return "ANSI_COM";
- else if (elf_header.e_machine == EM_X86_64
- && type == SHN_X86_64_LCOMMON)
- return "LARGE_COM";
- else if (type == SHN_MIPS_SCOMMON
- && elf_header.e_machine == EM_MIPS)
- return "SCOM";
- else if (type == SHN_MIPS_SUNDEFINED
- && elf_header.e_machine == EM_MIPS)
- return "SUND";
- else if (type >= SHN_LOPROC && type <= SHN_HIPROC)
- sprintf (buff, "PRC[0x%04x]", type & 0xffff);
- else if (type >= SHN_LOOS && type <= SHN_HIOS)
- sprintf (buff, "OS [0x%04x]", type & 0xffff);
- else if (type >= SHN_LORESERVE)
- sprintf (buff, "RSV[0x%04x]", type & 0xffff);
- else
- sprintf (buff, "%3d", type);
- break;
- }
-
- return buff;
-}
-
-static bfd_vma *
-get_dynamic_data (FILE *file, unsigned int number, unsigned int ent_size)
-{
- unsigned char *e_data;
- bfd_vma *i_data;
-
- e_data = cmalloc (number, ent_size);
-
- if (e_data == NULL)
- {
- error (_("Out of memory\n"));
- return NULL;
- }
-
- if (fread (e_data, ent_size, number, file) != number)
- {
- error (_("Unable to read in dynamic data\n"));
- return NULL;
- }
-
- i_data = cmalloc (number, sizeof (*i_data));
-
- if (i_data == NULL)
- {
- error (_("Out of memory\n"));
- free (e_data);
- return NULL;
- }
-
- while (number--)
- i_data[number] = byte_get (e_data + number * ent_size, ent_size);
-
- free (e_data);
-
- return i_data;
-}
-
-static void
-print_dynamic_symbol (bfd_vma si, unsigned long hn)
-{
- Elf_Internal_Sym *psym;
- int n;
-
- psym = dynamic_symbols + si;
-
- n = print_vma (si, DEC_5);
- if (n < 5)
- fputs (" " + n, stdout);
- printf (" %3lu: ", hn);
- print_vma (psym->st_value, LONG_HEX);
- putchar (' ');
- print_vma (psym->st_size, DEC_5);
-
- printf (" %6s", get_symbol_type (ELF_ST_TYPE (psym->st_info)));
- printf (" %6s", get_symbol_binding (ELF_ST_BIND (psym->st_info)));
- printf (" %3s", get_symbol_visibility (ELF_ST_VISIBILITY (psym->st_other)));
- /* Check to see if any other bits in the st_other field are set.
- Note - displaying this information disrupts the layout of the
- table being generated, but for the moment this case is very
- rare. */
- if (psym->st_other ^ ELF_ST_VISIBILITY (psym->st_other))
- printf (" [%s] ", get_symbol_other (psym->st_other ^ ELF_ST_VISIBILITY (psym->st_other)));
- printf (" %3.3s ", get_symbol_index_type (psym->st_shndx));
- if (VALID_DYNAMIC_NAME (psym->st_name))
- print_symbol (25, GET_DYNAMIC_NAME (psym->st_name));
- else
- printf (" <corrupt: %14ld>", psym->st_name);
- putchar ('\n');
-}
-
-/* Dump the symbol table. */
-static int
-process_symbol_table (FILE *file)
-{
- Elf_Internal_Shdr *section;
- bfd_vma nbuckets = 0;
- bfd_vma nchains = 0;
- bfd_vma *buckets = NULL;
- bfd_vma *chains = NULL;
- bfd_vma ngnubuckets = 0;
- bfd_vma *gnubuckets = NULL;
- bfd_vma *gnuchains = NULL;
- bfd_vma gnusymidx = 0;
-
- if (! do_syms && !do_histogram)
- return 1;
-
- if (dynamic_info[DT_HASH]
- && (do_histogram
- || (do_using_dynamic && dynamic_strings != NULL)))
- {
- unsigned char nb[8];
- unsigned char nc[8];
- int hash_ent_size = 4;
-
- if ((elf_header.e_machine == EM_ALPHA
- || elf_header.e_machine == EM_S390
- || elf_header.e_machine == EM_S390_OLD)
- && elf_header.e_ident[EI_CLASS] == ELFCLASS64)
- hash_ent_size = 8;
-
- if (fseek (file,
- (archive_file_offset
- + offset_from_vma (file, dynamic_info[DT_HASH],
- sizeof nb + sizeof nc)),
- SEEK_SET))
- {
- error (_("Unable to seek to start of dynamic information\n"));
- return 0;
- }
-
- if (fread (nb, hash_ent_size, 1, file) != 1)
- {
- error (_("Failed to read in number of buckets\n"));
- return 0;
- }
-
- if (fread (nc, hash_ent_size, 1, file) != 1)
- {
- error (_("Failed to read in number of chains\n"));
- return 0;
- }
-
- nbuckets = byte_get (nb, hash_ent_size);
- nchains = byte_get (nc, hash_ent_size);
-
- buckets = get_dynamic_data (file, nbuckets, hash_ent_size);
- chains = get_dynamic_data (file, nchains, hash_ent_size);
-
- if (buckets == NULL || chains == NULL)
- return 0;
- }
-
- if (dynamic_info_DT_GNU_HASH
- && (do_histogram
- || (do_using_dynamic && dynamic_strings != NULL)))
- {
- unsigned char nb[16];
- bfd_vma i, maxchain = 0xffffffff, bitmaskwords;
- bfd_vma buckets_vma;
-
- if (fseek (file,
- (archive_file_offset
- + offset_from_vma (file, dynamic_info_DT_GNU_HASH,
- sizeof nb)),
- SEEK_SET))
- {
- error (_("Unable to seek to start of dynamic information\n"));
- return 0;
- }
-
- if (fread (nb, 16, 1, file) != 1)
- {
- error (_("Failed to read in number of buckets\n"));
- return 0;
- }
-
- ngnubuckets = byte_get (nb, 4);
- gnusymidx = byte_get (nb + 4, 4);
- bitmaskwords = byte_get (nb + 8, 4);
- buckets_vma = dynamic_info_DT_GNU_HASH + 16;
- if (is_32bit_elf)
- buckets_vma += bitmaskwords * 4;
- else
- buckets_vma += bitmaskwords * 8;
-
- if (fseek (file,
- (archive_file_offset
- + offset_from_vma (file, buckets_vma, 4)),
- SEEK_SET))
- {
- error (_("Unable to seek to start of dynamic information\n"));
- return 0;
- }
-
- gnubuckets = get_dynamic_data (file, ngnubuckets, 4);
-
- if (gnubuckets == NULL)
- return 0;
-
- for (i = 0; i < ngnubuckets; i++)
- if (gnubuckets[i] != 0)
- {
- if (gnubuckets[i] < gnusymidx)
- return 0;
-
- if (maxchain == 0xffffffff || gnubuckets[i] > maxchain)
- maxchain = gnubuckets[i];
- }
-
- if (maxchain == 0xffffffff)
- return 0;
-
- maxchain -= gnusymidx;
-
- if (fseek (file,
- (archive_file_offset
- + offset_from_vma (file, buckets_vma
- + 4 * (ngnubuckets + maxchain), 4)),
- SEEK_SET))
- {
- error (_("Unable to seek to start of dynamic information\n"));
- return 0;
- }
-
- do
- {
- if (fread (nb, 4, 1, file) != 1)
- {
- error (_("Failed to determine last chain length\n"));
- return 0;
- }
-
- if (maxchain + 1 == 0)
- return 0;
-
- ++maxchain;
- }
- while ((byte_get (nb, 4) & 1) == 0);
-
- if (fseek (file,
- (archive_file_offset
- + offset_from_vma (file, buckets_vma + 4 * ngnubuckets, 4)),
- SEEK_SET))
- {
- error (_("Unable to seek to start of dynamic information\n"));
- return 0;
- }
-
- gnuchains = get_dynamic_data (file, maxchain, 4);
-
- if (gnuchains == NULL)
- return 0;
- }
-
- if ((dynamic_info[DT_HASH] || dynamic_info_DT_GNU_HASH)
- && do_syms
- && do_using_dynamic
- && dynamic_strings != NULL)
- {
- unsigned long hn;
-
- if (dynamic_info[DT_HASH])
- {
- bfd_vma si;
-
- printf (_("\nSymbol table for image:\n"));
- if (is_32bit_elf)
- printf (_(" Num Buc: Value Size Type Bind Vis Ndx Name\n"));
- else
- printf (_(" Num Buc: Value Size Type Bind Vis Ndx Name\n"));
-
- for (hn = 0; hn < nbuckets; hn++)
- {
- if (! buckets[hn])
- continue;
-
- for (si = buckets[hn]; si < nchains && si > 0; si = chains[si])
- print_dynamic_symbol (si, hn);
- }
- }
-
- if (dynamic_info_DT_GNU_HASH)
- {
- printf (_("\nSymbol table of `.gnu.hash' for image:\n"));
- if (is_32bit_elf)
- printf (_(" Num Buc: Value Size Type Bind Vis Ndx Name\n"));
- else
- printf (_(" Num Buc: Value Size Type Bind Vis Ndx Name\n"));
-
- for (hn = 0; hn < ngnubuckets; ++hn)
- if (gnubuckets[hn] != 0)
- {
- bfd_vma si = gnubuckets[hn];
- bfd_vma off = si - gnusymidx;
-
- do
- {
- print_dynamic_symbol (si, hn);
- si++;
- }
- while ((gnuchains[off++] & 1) == 0);
- }
- }
- }
- else if (do_syms && !do_using_dynamic)
- {
- unsigned int i;
-
- for (i = 0, section = section_headers;
- i < elf_header.e_shnum;
- i++, section++)
- {
- unsigned int si;
- char *strtab = NULL;
- unsigned long int strtab_size = 0;
- Elf_Internal_Sym *symtab;
- Elf_Internal_Sym *psym;
-
-
- if ( section->sh_type != SHT_SYMTAB
- && section->sh_type != SHT_DYNSYM)
- continue;
-
- printf (_("\nSymbol table '%s' contains %lu entries:\n"),
- SECTION_NAME (section),
- (unsigned long) (section->sh_size / section->sh_entsize));
- if (is_32bit_elf)
- printf (_(" Num: Value Size Type Bind Vis Ndx Name\n"));
- else
- printf (_(" Num: Value Size Type Bind Vis Ndx Name\n"));
-
- symtab = GET_ELF_SYMBOLS (file, section);
- if (symtab == NULL)
- continue;
-
- if (section->sh_link == elf_header.e_shstrndx)
- {
- strtab = string_table;
- strtab_size = string_table_length;
- }
- else if (section->sh_link < elf_header.e_shnum)
- {
- Elf_Internal_Shdr *string_sec;
-
- string_sec = section_headers + section->sh_link;
-
- strtab = get_data (NULL, file, string_sec->sh_offset,
- 1, string_sec->sh_size, _("string table"));
- strtab_size = strtab != NULL ? string_sec->sh_size : 0;
- }
-
- for (si = 0, psym = symtab;
- si < section->sh_size / section->sh_entsize;
- si++, psym++)
- {
- printf ("%6d: ", si);
- print_vma (psym->st_value, LONG_HEX);
- putchar (' ');
- print_vma (psym->st_size, DEC_5);
- printf (" %-7s", get_symbol_type (ELF_ST_TYPE (psym->st_info)));
- printf (" %-6s", get_symbol_binding (ELF_ST_BIND (psym->st_info)));
- printf (" %-3s", get_symbol_visibility (ELF_ST_VISIBILITY (psym->st_other)));
- /* Check to see if any other bits in the st_other field are set.
- Note - displaying this information disrupts the layout of the
- table being generated, but for the moment this case is very rare. */
- if (psym->st_other ^ ELF_ST_VISIBILITY (psym->st_other))
- printf (" [%s] ", get_symbol_other (psym->st_other ^ ELF_ST_VISIBILITY (psym->st_other)));
- printf (" %4s ", get_symbol_index_type (psym->st_shndx));
- print_symbol (25, psym->st_name < strtab_size
- ? strtab + psym->st_name : "<corrupt>");
-
- if (section->sh_type == SHT_DYNSYM &&
- version_info[DT_VERSIONTAGIDX (DT_VERSYM)] != 0)
- {
- unsigned char data[2];
- unsigned short vers_data;
- unsigned long offset;
- int is_nobits;
- int check_def;
-
- offset = offset_from_vma
- (file, version_info[DT_VERSIONTAGIDX (DT_VERSYM)],
- sizeof data + si * sizeof (vers_data));
-
- get_data (&data, file, offset + si * sizeof (vers_data),
- sizeof (data), 1, _("version data"));
-
- vers_data = byte_get (data, 2);
-
- is_nobits = (psym->st_shndx < elf_header.e_shnum
- && section_headers[psym->st_shndx].sh_type
- == SHT_NOBITS);
-
- check_def = (psym->st_shndx != SHN_UNDEF);
-
- if ((vers_data & 0x8000) || vers_data > 1)
- {
- if (version_info[DT_VERSIONTAGIDX (DT_VERNEED)]
- && (is_nobits || ! check_def))
- {
- Elf_External_Verneed evn;
- Elf_Internal_Verneed ivn;
- Elf_Internal_Vernaux ivna;
-
- /* We must test both. */
- offset = offset_from_vma
- (file, version_info[DT_VERSIONTAGIDX (DT_VERNEED)],
- sizeof evn);
-
- do
- {
- unsigned long vna_off;
-
- get_data (&evn, file, offset, sizeof (evn), 1,
- _("version need"));
-
- ivn.vn_aux = BYTE_GET (evn.vn_aux);
- ivn.vn_next = BYTE_GET (evn.vn_next);
-
- vna_off = offset + ivn.vn_aux;
-
- do
- {
- Elf_External_Vernaux evna;
-
- get_data (&evna, file, vna_off,
- sizeof (evna), 1,
- _("version need aux (3)"));
-
- ivna.vna_other = BYTE_GET (evna.vna_other);
- ivna.vna_next = BYTE_GET (evna.vna_next);
- ivna.vna_name = BYTE_GET (evna.vna_name);
-
- vna_off += ivna.vna_next;
- }
- while (ivna.vna_other != vers_data
- && ivna.vna_next != 0);
-
- if (ivna.vna_other == vers_data)
- break;
-
- offset += ivn.vn_next;
- }
- while (ivn.vn_next != 0);
-
- if (ivna.vna_other == vers_data)
- {
- printf ("@%s (%d)",
- ivna.vna_name < strtab_size
- ? strtab + ivna.vna_name : "<corrupt>",
- ivna.vna_other);
- check_def = 0;
- }
- else if (! is_nobits)
- error (_("bad dynamic symbol\n"));
- else
- check_def = 1;
- }
-
- if (check_def)
- {
- if (vers_data != 0x8001
- && version_info[DT_VERSIONTAGIDX (DT_VERDEF)])
- {
- Elf_Internal_Verdef ivd;
- Elf_Internal_Verdaux ivda;
- Elf_External_Verdaux evda;
- unsigned long offset;
-
- offset = offset_from_vma
- (file,
- version_info[DT_VERSIONTAGIDX (DT_VERDEF)],
- sizeof (Elf_External_Verdef));
-
- do
- {
- Elf_External_Verdef evd;
-
- get_data (&evd, file, offset, sizeof (evd),
- 1, _("version def"));
-
- ivd.vd_ndx = BYTE_GET (evd.vd_ndx);
- ivd.vd_aux = BYTE_GET (evd.vd_aux);
- ivd.vd_next = BYTE_GET (evd.vd_next);
-
- offset += ivd.vd_next;
- }
- while (ivd.vd_ndx != (vers_data & 0x7fff)
- && ivd.vd_next != 0);
-
- offset -= ivd.vd_next;
- offset += ivd.vd_aux;
-
- get_data (&evda, file, offset, sizeof (evda),
- 1, _("version def aux"));
-
- ivda.vda_name = BYTE_GET (evda.vda_name);
-
- if (psym->st_name != ivda.vda_name)
- printf ((vers_data & 0x8000)
- ? "@%s" : "@@%s",
- ivda.vda_name < strtab_size
- ? strtab + ivda.vda_name : "<corrupt>");
- }
- }
- }
- }
-
- putchar ('\n');
- }
-
- free (symtab);
- if (strtab != string_table)
- free (strtab);
- }
- }
- else if (do_syms)
- printf
- (_("\nDynamic symbol information is not available for displaying symbols.\n"));
-
- if (do_histogram && buckets != NULL)
- {
- unsigned long *lengths;
- unsigned long *counts;
- unsigned long hn;
- bfd_vma si;
- unsigned long maxlength = 0;
- unsigned long nzero_counts = 0;
- unsigned long nsyms = 0;
-
- printf (_("\nHistogram for bucket list length (total of %lu buckets):\n"),
- (unsigned long) nbuckets);
- printf (_(" Length Number %% of total Coverage\n"));
-
- lengths = calloc (nbuckets, sizeof (*lengths));
- if (lengths == NULL)
- {
- error (_("Out of memory\n"));
- return 0;
- }
- for (hn = 0; hn < nbuckets; ++hn)
- {
- for (si = buckets[hn]; si > 0 && si < nchains; si = chains[si])
- {
- ++nsyms;
- if (maxlength < ++lengths[hn])
- ++maxlength;
- }
- }
-
- counts = calloc (maxlength + 1, sizeof (*counts));
- if (counts == NULL)
- {
- error (_("Out of memory\n"));
- return 0;
- }
-
- for (hn = 0; hn < nbuckets; ++hn)
- ++counts[lengths[hn]];
-
- if (nbuckets > 0)
- {
- unsigned long i;
- printf (" 0 %-10lu (%5.1f%%)\n",
- counts[0], (counts[0] * 100.0) / nbuckets);
- for (i = 1; i <= maxlength; ++i)
- {
- nzero_counts += counts[i] * i;
- printf ("%7lu %-10lu (%5.1f%%) %5.1f%%\n",
- i, counts[i], (counts[i] * 100.0) / nbuckets,
- (nzero_counts * 100.0) / nsyms);
- }
- }
-
- free (counts);
- free (lengths);
- }
-
- if (buckets != NULL)
- {
- free (buckets);
- free (chains);
- }
-
- if (do_histogram && dynamic_info_DT_GNU_HASH)
- {
- unsigned long *lengths;
- unsigned long *counts;
- unsigned long hn;
- unsigned long maxlength = 0;
- unsigned long nzero_counts = 0;
- unsigned long nsyms = 0;
-
- lengths = calloc (ngnubuckets, sizeof (*lengths));
- if (lengths == NULL)
- {
- error (_("Out of memory\n"));
- return 0;
- }
-
- printf (_("\nHistogram for `.gnu.hash' bucket list length (total of %lu buckets):\n"),
- (unsigned long) ngnubuckets);
- printf (_(" Length Number %% of total Coverage\n"));
-
- for (hn = 0; hn < ngnubuckets; ++hn)
- if (gnubuckets[hn] != 0)
- {
- bfd_vma off, length = 1;
-
- for (off = gnubuckets[hn] - gnusymidx;
- (gnuchains[off] & 1) == 0; ++off)
- ++length;
- lengths[hn] = length;
- if (length > maxlength)
- maxlength = length;
- nsyms += length;
- }
-
- counts = calloc (maxlength + 1, sizeof (*counts));
- if (counts == NULL)
- {
- error (_("Out of memory\n"));
- return 0;
- }
-
- for (hn = 0; hn < ngnubuckets; ++hn)
- ++counts[lengths[hn]];
-
- if (ngnubuckets > 0)
- {
- unsigned long j;
- printf (" 0 %-10lu (%5.1f%%)\n",
- counts[0], (counts[0] * 100.0) / ngnubuckets);
- for (j = 1; j <= maxlength; ++j)
- {
- nzero_counts += counts[j] * j;
- printf ("%7lu %-10lu (%5.1f%%) %5.1f%%\n",
- j, counts[j], (counts[j] * 100.0) / ngnubuckets,
- (nzero_counts * 100.0) / nsyms);
- }
- }
-
- free (counts);
- free (lengths);
- free (gnubuckets);
- free (gnuchains);
- }
-
- return 1;
-}
-
-static int
-process_syminfo (FILE *file ATTRIBUTE_UNUSED)
-{
- unsigned int i;
-
- if (dynamic_syminfo == NULL
- || !do_dynamic)
- /* No syminfo, this is ok. */
- return 1;
-
- /* There better should be a dynamic symbol section. */
- if (dynamic_symbols == NULL || dynamic_strings == NULL)
- return 0;
-
- if (dynamic_addr)
- printf (_("\nDynamic info segment at offset 0x%lx contains %d entries:\n"),
- dynamic_syminfo_offset, dynamic_syminfo_nent);
-
- printf (_(" Num: Name BoundTo Flags\n"));
- for (i = 0; i < dynamic_syminfo_nent; ++i)
- {
- unsigned short int flags = dynamic_syminfo[i].si_flags;
-
- printf ("%4d: ", i);
- if (VALID_DYNAMIC_NAME (dynamic_symbols[i].st_name))
- print_symbol (30, GET_DYNAMIC_NAME (dynamic_symbols[i].st_name));
- else
- printf ("<corrupt: %19ld>", dynamic_symbols[i].st_name);
- putchar (' ');
-
- switch (dynamic_syminfo[i].si_boundto)
- {
- case SYMINFO_BT_SELF:
- fputs ("SELF ", stdout);
- break;
- case SYMINFO_BT_PARENT:
- fputs ("PARENT ", stdout);
- break;
- default:
- if (dynamic_syminfo[i].si_boundto > 0
- && dynamic_syminfo[i].si_boundto < dynamic_nent
- && VALID_DYNAMIC_NAME (dynamic_section[dynamic_syminfo[i].si_boundto].d_un.d_val))
- {
- print_symbol (10, GET_DYNAMIC_NAME (dynamic_section[dynamic_syminfo[i].si_boundto].d_un.d_val));
- putchar (' ' );
- }
- else
- printf ("%-10d ", dynamic_syminfo[i].si_boundto);
- break;
- }
-
- if (flags & SYMINFO_FLG_DIRECT)
- printf (" DIRECT");
- if (flags & SYMINFO_FLG_PASSTHRU)
- printf (" PASSTHRU");
- if (flags & SYMINFO_FLG_COPY)
- printf (" COPY");
- if (flags & SYMINFO_FLG_LAZYLOAD)
- printf (" LAZYLOAD");
-
- puts ("");
- }
-
- return 1;
-}
-
-#ifdef SUPPORT_DISASSEMBLY
-static int
-disassemble_section (Elf_Internal_Shdr *section, FILE *file)
-{
- printf (_("\nAssembly dump of section %s\n"),
- SECTION_NAME (section));
-
- /* XXX -- to be done --- XXX */
-
- return 1;
-}
-#endif
-
-static int
-dump_section_as_strings (Elf_Internal_Shdr *section, FILE *file)
-{
- Elf_Internal_Shdr *relsec;
- bfd_size_type num_bytes;
- bfd_vma addr;
- char *data;
- char *end;
- char *start;
- char *name = SECTION_NAME (section);
- bfd_boolean some_strings_shown;
-
- num_bytes = section->sh_size;
-
- if (num_bytes == 0 || section->sh_type == SHT_NOBITS)
- {
- printf (_("\nSection '%s' has no data to dump.\n"), name);
- return 0;
- }
-
- addr = section->sh_addr;
-
- start = get_data (NULL, file, section->sh_offset, 1, num_bytes,
- _("section data"));
- if (!start)
- return 0;
-
- printf (_("\nString dump of section '%s':\n"), name);
-
- /* If the section being dumped has relocations against it the user might
- be expecting these relocations to have been applied. Check for this
- case and issue a warning message in order to avoid confusion.
- FIXME: Maybe we ought to have an option that dumps a section with
- relocs applied ? */
- for (relsec = section_headers;
- relsec < section_headers + elf_header.e_shnum;
- ++relsec)
- {
- if ((relsec->sh_type != SHT_RELA && relsec->sh_type != SHT_REL)
- || relsec->sh_info >= elf_header.e_shnum
- || section_headers + relsec->sh_info != section
- || relsec->sh_size == 0
- || relsec->sh_link >= elf_header.e_shnum)
- continue;
-
- printf (_(" Note: This section has relocations against it, but these have NOT been applied to this dump.\n"));
- break;
- }
-
- data = start;
- end = start + num_bytes;
- some_strings_shown = FALSE;
-
- while (data < end)
- {
- while (!ISPRINT (* data))
- if (++ data >= end)
- break;
-
- if (data < end)
- {
-#ifndef __MSVCRT__
- printf (" [%6tx] %s\n", data - start, data);
-#else
- printf (" [%6Ix] %s\n", (size_t) (data - start), data);
-#endif
- data += strlen (data);
- some_strings_shown = TRUE;
- }
- }
-
- if (! some_strings_shown)
- printf (_(" No strings found in this section."));
-
- free (start);
-
- putchar ('\n');
- return 1;
-}
-
-
-static int
-dump_section_as_bytes (Elf_Internal_Shdr *section, FILE *file)
-{
- Elf_Internal_Shdr *relsec;
- bfd_size_type bytes;
- bfd_vma addr;
- unsigned char *data;
- unsigned char *start;
-
- bytes = section->sh_size;
-
- if (bytes == 0 || section->sh_type == SHT_NOBITS)
- {
- printf (_("\nSection '%s' has no data to dump.\n"),
- SECTION_NAME (section));
- return 0;
- }
- else
- printf (_("\nHex dump of section '%s':\n"), SECTION_NAME (section));
-
- addr = section->sh_addr;
-
- start = get_data (NULL, file, section->sh_offset, 1, bytes,
- _("section data"));
- if (!start)
- return 0;
-
- /* If the section being dumped has relocations against it the user might
- be expecting these relocations to have been applied. Check for this
- case and issue a warning message in order to avoid confusion.
- FIXME: Maybe we ought to have an option that dumps a section with
- relocs applied ? */
- for (relsec = section_headers;
- relsec < section_headers + elf_header.e_shnum;
- ++relsec)
- {
- if ((relsec->sh_type != SHT_RELA && relsec->sh_type != SHT_REL)
- || relsec->sh_info >= elf_header.e_shnum
- || section_headers + relsec->sh_info != section
- || relsec->sh_size == 0
- || relsec->sh_link >= elf_header.e_shnum)
- continue;
-
- printf (_(" NOTE: This section has relocations against it, but these have NOT been applied to this dump.\n"));
- break;
- }
-
- data = start;
-
- while (bytes)
- {
- int j;
- int k;
- int lbytes;
-
- lbytes = (bytes > 16 ? 16 : bytes);
-
- printf (" 0x%8.8lx ", (unsigned long) addr);
-
- for (j = 0; j < 16; j++)
- {
- if (j < lbytes)
- printf ("%2.2x", data[j]);
- else
- printf (" ");
-
- if ((j & 3) == 3)
- printf (" ");
- }
-
- for (j = 0; j < lbytes; j++)
- {
- k = data[j];
- if (k >= ' ' && k < 0x7f)
- printf ("%c", k);
- else
- printf (".");
- }
-
- putchar ('\n');
-
- data += lbytes;
- addr += lbytes;
- bytes -= lbytes;
- }
-
- free (start);
-
- putchar ('\n');
- return 1;
-}
-
-/* Returns TRUE iff RELOC_TYPE is a 32-bit absolute RELA relocation used in
- DWARF debug sections. This is a target specific test. Note - we do not
- go through the whole including-target-headers-multiple-times route, (as
- we have already done with <elf/h8.h>) because this would become very
- messy and even then this function would have to contain target specific
- information (the names of the relocs instead of their numeric values).
- FIXME: This is not the correct way to solve this problem. The proper way
- is to have target specific reloc sizing and typing functions created by
- the reloc-macros.h header, in the same way that it already creates the
- reloc naming functions. */
-
-static bfd_boolean
-is_32bit_abs_reloc (unsigned int reloc_type)
-{
- switch (elf_header.e_machine)
- {
- case EM_386:
- case EM_486:
- return reloc_type == 1; /* R_386_32. */
- case EM_68K:
- return reloc_type == 1; /* R_68K_32. */
- case EM_860:
- return reloc_type == 1; /* R_860_32. */
- case EM_ALPHA:
- return reloc_type == 1; /* XXX Is this right ? */
- case EM_ARC:
- return reloc_type == 1; /* R_ARC_32. */
- case EM_ARM:
- return reloc_type == 2; /* R_ARM_ABS32 */
- case EM_AVR_OLD:
- case EM_AVR:
- return reloc_type == 1;
- case EM_BLACKFIN:
- return reloc_type == 0x12; /* R_byte4_data. */
- case EM_CRIS:
- return reloc_type == 3; /* R_CRIS_32. */
- case EM_CR16:
- case EM_CR16_OLD:
- return reloc_type == 3; /* R_CR16_NUM32. */
- case EM_CRX:
- return reloc_type == 15; /* R_CRX_NUM32. */
- case EM_CYGNUS_FRV:
- return reloc_type == 1;
- case EM_CYGNUS_D10V:
- case EM_D10V:
- return reloc_type == 6; /* R_D10V_32. */
- case EM_CYGNUS_D30V:
- case EM_D30V:
- return reloc_type == 12; /* R_D30V_32_NORMAL. */
- case EM_DLX:
- return reloc_type == 3; /* R_DLX_RELOC_32. */
- case EM_CYGNUS_FR30:
- case EM_FR30:
- return reloc_type == 3; /* R_FR30_32. */
- case EM_H8S:
- case EM_H8_300:
- case EM_H8_300H:
- return reloc_type == 1; /* R_H8_DIR32. */
- case EM_IA_64:
- return reloc_type == 0x65; /* R_IA64_SECREL32LSB. */
- case EM_IP2K_OLD:
- case EM_IP2K:
- return reloc_type == 2; /* R_IP2K_32. */
- case EM_IQ2000:
- return reloc_type == 2; /* R_IQ2000_32. */
- case EM_M32C_OLD:
- case EM_M32C:
- return reloc_type == 3; /* R_M32C_32. */
- case EM_M32R:
- return reloc_type == 34; /* R_M32R_32_RELA. */
- case EM_MCORE:
- return reloc_type == 1; /* R_MCORE_ADDR32. */
- case EM_CYGNUS_MEP:
- return reloc_type == 4; /* R_MEP_32. */
- case EM_MIPS:
- return reloc_type == 2; /* R_MIPS_32. */
- case EM_MMIX:
- return reloc_type == 4; /* R_MMIX_32. */
- case EM_CYGNUS_MN10200:
- case EM_MN10200:
- return reloc_type == 1; /* R_MN10200_32. */
- case EM_CYGNUS_MN10300:
- case EM_MN10300:
- return reloc_type == 1; /* R_MN10300_32. */
- case EM_MSP430_OLD:
- case EM_MSP430:
- return reloc_type == 1; /* R_MSP43_32. */
- case EM_MT:
- return reloc_type == 2; /* R_MT_32. */
- case EM_ALTERA_NIOS2:
- case EM_NIOS32:
- return reloc_type == 1; /* R_NIOS_32. */
- case EM_OPENRISC:
- case EM_OR32:
- return reloc_type == 1; /* R_OR32_32. */
- case EM_PARISC:
- return reloc_type == 1; /* R_PARISC_DIR32. */
- case EM_PJ:
- case EM_PJ_OLD:
- return reloc_type == 1; /* R_PJ_DATA_DIR32. */
- case EM_PPC64:
- return reloc_type == 1; /* R_PPC64_ADDR32. */
- case EM_PPC:
- return reloc_type == 1; /* R_PPC_ADDR32. */
- case EM_S370:
- return reloc_type == 1; /* R_I370_ADDR31. */
- case EM_S390_OLD:
- case EM_S390:
- return reloc_type == 4; /* R_S390_32. */
- case EM_SCORE:
- return reloc_type == 8; /* R_SCORE_ABS32. */
- case EM_SH:
- return reloc_type == 1; /* R_SH_DIR32. */
- case EM_SPARC32PLUS:
- case EM_SPARCV9:
- case EM_SPARC:
- return reloc_type == 3 /* R_SPARC_32. */
- || reloc_type == 23; /* R_SPARC_UA32. */
- case EM_SPU:
- return reloc_type == 6; /* R_SPU_ADDR32 */
- case EM_CYGNUS_V850:
- case EM_V850:
- return reloc_type == 6; /* R_V850_ABS32. */
- case EM_VAX:
- return reloc_type == 1; /* R_VAX_32. */
- case EM_X86_64:
- return reloc_type == 10; /* R_X86_64_32. */
- case EM_XSTORMY16:
- return reloc_type == 1; /* R_XSTROMY16_32. */
- case EM_XTENSA_OLD:
- case EM_XTENSA:
- return reloc_type == 1; /* R_XTENSA_32. */
-
- default:
- error (_("Missing knowledge of 32-bit reloc types used in DWARF sections of machine number %d\n"),
- elf_header.e_machine);
- abort ();
- }
-}
-
-/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
- a 32-bit pc-relative RELA relocation used in DWARF debug sections. */
-
-static bfd_boolean
-is_32bit_pcrel_reloc (unsigned int reloc_type)
-{
- switch (elf_header.e_machine)
- {
- case EM_386:
- case EM_486:
- return reloc_type == 2; /* R_386_PC32. */
- case EM_68K:
- return reloc_type == 4; /* R_68K_PC32. */
- case EM_ALPHA:
- return reloc_type == 10; /* R_ALPHA_SREL32. */
- case EM_ARM:
- return reloc_type == 3; /* R_ARM_REL32 */
- case EM_PARISC:
- return reloc_type == 0; /* R_PARISC_NONE. *//* FIXME: This reloc is generated, but it may be a bug. */
- case EM_PPC:
- return reloc_type == 26; /* R_PPC_REL32. */
- case EM_PPC64:
- return reloc_type == 26; /* R_PPC64_REL32. */
- case EM_S390_OLD:
- case EM_S390:
- return reloc_type == 5; /* R_390_PC32. */
- case EM_SH:
- return reloc_type == 2; /* R_SH_REL32. */
- case EM_SPARC32PLUS:
- case EM_SPARCV9:
- case EM_SPARC:
- return reloc_type == 6; /* R_SPARC_DISP32. */
- case EM_SPU:
- return reloc_type == 13; /* R_SPU_REL32. */
- case EM_X86_64:
- return reloc_type == 2; /* R_X86_64_PC32. */
- case EM_XTENSA_OLD:
- case EM_XTENSA:
- return reloc_type == 14; /* R_XTENSA_32_PCREL. */
- default:
- /* Do not abort or issue an error message here. Not all targets use
- pc-relative 32-bit relocs in their DWARF debug information and we
- have already tested for target coverage in is_32bit_abs_reloc. A
- more helpful warning message will be generated by
- debug_apply_relocations anyway, so just return. */
- return FALSE;
- }
-}
-
-/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
- a 64-bit absolute RELA relocation used in DWARF debug sections. */
-
-static bfd_boolean
-is_64bit_abs_reloc (unsigned int reloc_type)
-{
- switch (elf_header.e_machine)
- {
- case EM_ALPHA:
- return reloc_type == 2; /* R_ALPHA_REFQUAD. */
- case EM_IA_64:
- return reloc_type == 0x27; /* R_IA64_DIR64LSB. */
- case EM_PARISC:
- return reloc_type == 80; /* R_PARISC_DIR64. */
- case EM_PPC64:
- return reloc_type == 38; /* R_PPC64_ADDR64. */
- case EM_SPARC32PLUS:
- case EM_SPARCV9:
- case EM_SPARC:
- return reloc_type == 54; /* R_SPARC_UA64. */
- case EM_X86_64:
- return reloc_type == 1; /* R_X86_64_64. */
- case EM_S390_OLD:
- case EM_S390:
- return reloc_type == 22; /* R_S390_64 */
- default:
- return FALSE;
- }
-}
-
-/* Like is_32bit_abs_reloc except that it returns TRUE iff RELOC_TYPE is
- a 16-bit absolute RELA relocation used in DWARF debug sections. */
-
-static bfd_boolean
-is_16bit_abs_reloc (unsigned int reloc_type)
-{
- switch (elf_header.e_machine)
- {
- case EM_AVR_OLD:
- case EM_AVR:
- return reloc_type == 4; /* R_AVR_16. */
- case EM_CYGNUS_D10V:
- case EM_D10V:
- return reloc_type == 3; /* R_D10V_16. */
- case EM_H8S:
- case EM_H8_300:
- case EM_H8_300H:
- return reloc_type == R_H8_DIR16;
- case EM_IP2K_OLD:
- case EM_IP2K:
- return reloc_type == 1; /* R_IP2K_16. */
- case EM_M32C_OLD:
- case EM_M32C:
- return reloc_type == 1; /* R_M32C_16 */
- case EM_MSP430_OLD:
- case EM_MSP430:
- return reloc_type == 5; /* R_MSP430_16_BYTE. */
- case EM_ALTERA_NIOS2:
- case EM_NIOS32:
- return reloc_type == 9; /* R_NIOS_16. */
- default:
- return FALSE;
- }
-}
-
-/* Uncompresses a section that was compressed using zlib, in place.
- * This is a copy of bfd_uncompress_section_contents, in bfd/compress.c */
-
-static int
-uncompress_section_contents (unsigned char **buffer, dwarf_size_type *size)
-{
-#ifndef HAVE_ZLIB_H
- /* These are just to quiet gcc. */
- buffer = 0;
- size = 0;
- return FALSE;
-#else
- dwarf_size_type compressed_size = *size;
- unsigned char* compressed_buffer = *buffer;
- dwarf_size_type uncompressed_size;
- unsigned char* uncompressed_buffer;
- z_stream strm;
- int rc;
- dwarf_size_type header_size = 12;
-
- /* Read the zlib header. In this case, it should be "ZLIB" followed
- by the uncompressed section size, 8 bytes in big-endian order. */
- if (compressed_size < header_size
- || ! streq ((char*) compressed_buffer, "ZLIB"))
- return 0;
- uncompressed_size = compressed_buffer[4]; uncompressed_size <<= 8;
- uncompressed_size += compressed_buffer[5]; uncompressed_size <<= 8;
- uncompressed_size += compressed_buffer[6]; uncompressed_size <<= 8;
- uncompressed_size += compressed_buffer[7]; uncompressed_size <<= 8;
- uncompressed_size += compressed_buffer[8]; uncompressed_size <<= 8;
- uncompressed_size += compressed_buffer[9]; uncompressed_size <<= 8;
- uncompressed_size += compressed_buffer[10]; uncompressed_size <<= 8;
- uncompressed_size += compressed_buffer[11];
-
- /* It is possible the section consists of several compressed
- buffers concatenated together, so we uncompress in a loop. */
- strm.zalloc = NULL;
- strm.zfree = NULL;
- strm.opaque = NULL;
- strm.avail_in = compressed_size - header_size;
- strm.next_in = (Bytef*) compressed_buffer + header_size;
- strm.avail_out = uncompressed_size;
- uncompressed_buffer = xmalloc (uncompressed_size);
-
- rc = inflateInit (&strm);
- while (strm.avail_in > 0)
- {
- if (rc != Z_OK)
- goto fail;
- strm.next_out = ((Bytef*) uncompressed_buffer
- + (uncompressed_size - strm.avail_out));
- rc = inflate (&strm, Z_FINISH);
- if (rc != Z_STREAM_END)
- goto fail;
- rc = inflateReset (&strm);
- }
- rc = inflateEnd (&strm);
- if (rc != Z_OK
- || strm.avail_out != 0)
- goto fail;
-
- free (compressed_buffer);
- *buffer = uncompressed_buffer;
- *size = uncompressed_size;
- return 1;
-
- fail:
- free (uncompressed_buffer);
- return 0;
-#endif /* HAVE_ZLIB_H */
-}
-
-/* Apply relocations to a debug section. */
-
-static void
-debug_apply_relocations (void *file,
- Elf_Internal_Shdr *section,
- unsigned char *start)
-{
- Elf_Internal_Shdr *relsec;
- unsigned char *end = start + section->sh_size;
-
- if (elf_header.e_type != ET_REL)
- return;
-
- /* Find the reloc section associated with the debug section. */
- for (relsec = section_headers;
- relsec < section_headers + elf_header.e_shnum;
- ++relsec)
- {
- bfd_boolean is_rela;
- unsigned long num_relocs;
- Elf_Internal_Rela *relocs, *rp;
- Elf_Internal_Shdr *symsec;
- Elf_Internal_Sym *symtab;
- Elf_Internal_Sym *sym;
-
- if ((relsec->sh_type != SHT_RELA && relsec->sh_type != SHT_REL)
- || relsec->sh_info >= elf_header.e_shnum
- || section_headers + relsec->sh_info != section
- || relsec->sh_size == 0
- || relsec->sh_link >= elf_header.e_shnum)
- continue;
-
- is_rela = relsec->sh_type == SHT_RELA;
-
- if (is_rela)
- {
- if (!slurp_rela_relocs (file, relsec->sh_offset, relsec->sh_size,
- & relocs, & num_relocs))
- return;
- }
- else
- {
- if (!slurp_rel_relocs (file, relsec->sh_offset, relsec->sh_size,
- & relocs, & num_relocs))
- return;
- }
-
- /* SH uses RELA but uses in place value instead of the addend field. */
- if (elf_header.e_machine == EM_SH)
- is_rela = FALSE;
-
- symsec = section_headers + relsec->sh_link;
- symtab = GET_ELF_SYMBOLS (file, symsec);
-
- for (rp = relocs; rp < relocs + num_relocs; ++rp)
- {
- bfd_vma addend;
- unsigned int reloc_type;
- unsigned int reloc_size;
- unsigned char * loc;
-
- /* In MIPS little-endian objects, r_info isn't really a
- 64-bit little-endian value: it has a 32-bit little-endian
- symbol index followed by four individual byte fields.
- Reorder INFO accordingly. */
- if (!is_32bit_elf
- && elf_header.e_machine == EM_MIPS
- && elf_header.e_ident[EI_DATA] != ELFDATA2MSB)
- rp->r_info = (((rp->r_info & 0xffffffff) << 32)
- | ((rp->r_info >> 56) & 0xff)
- | ((rp->r_info >> 40) & 0xff00)
- | ((rp->r_info >> 24) & 0xff0000)
- | ((rp->r_info >> 8) & 0xff000000));
-
- reloc_type = get_reloc_type (rp->r_info);
-
- if (is_32bit_abs_reloc (reloc_type)
- || is_32bit_pcrel_reloc (reloc_type))
- reloc_size = 4;
- else if (is_64bit_abs_reloc (reloc_type))
- reloc_size = 8;
- else if (is_16bit_abs_reloc (reloc_type))
- reloc_size = 2;
- else
- {
- warn (_("unable to apply unsupported reloc type %d to section %s\n"),
- reloc_type, SECTION_NAME (section));
- continue;
- }
-
- loc = start + rp->r_offset;
- if ((loc + reloc_size) > end)
- {
- warn (_("skipping invalid relocation offset 0x%lx in section %s\n"),
- (unsigned long) rp->r_offset,
- SECTION_NAME (section));
- continue;
- }
-
- sym = symtab + get_reloc_symindex (rp->r_info);
-
- /* If the reloc has a symbol associated with it,
- make sure that it is of an appropriate type. */
- if (sym != symtab
- && ELF_ST_TYPE (sym->st_info) != STT_SECTION
- /* Relocations against symbols without type can happen.
- Gcc -feliminate-dwarf2-dups may generate symbols
- without type for debug info. */
- && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
- /* Relocations against object symbols can happen,
- eg when referencing a global array. For an
- example of this see the _clz.o binary in libgcc.a. */
- && ELF_ST_TYPE (sym->st_info) != STT_OBJECT)
- {
- warn (_("skipping unexpected symbol type %s in %ld'th relocation in section %s\n"),
- get_symbol_type (ELF_ST_TYPE (sym->st_info)),
- (long int)(rp - relocs),
- SECTION_NAME (relsec));
- continue;
- }
-
- addend = is_rela ? rp->r_addend : byte_get (loc, reloc_size);
-
- if (is_32bit_pcrel_reloc (reloc_type))
- byte_put (loc, (addend + sym->st_value) - rp->r_offset,
- reloc_size);
- else
- byte_put (loc, addend + sym->st_value, reloc_size);
- }
-
- free (symtab);
- free (relocs);
- break;
- }
-}
-
-int
-load_debug_section (enum dwarf_section_display_enum debug, void *file)
-{
- struct dwarf_section *section = &debug_displays [debug].section;
- Elf_Internal_Shdr *sec;
- char buf [64];
- int section_is_compressed;
-
- /* If it is already loaded, do nothing. */
- if (section->start != NULL)
- return 1;
-
- /* Locate the debug section. */
- sec = find_section (section->uncompressed_name);
- if (sec != NULL)
- section->name = section->uncompressed_name;
- else
- {
- sec = find_section (section->compressed_name);
- if (sec != NULL)
- section->name = section->compressed_name;
- }
- if (sec == NULL)
- return 0;
- section_is_compressed = section->name == section->compressed_name;
-
- snprintf (buf, sizeof (buf), _("%s section data"), section->name);
- section->address = sec->sh_addr;
- section->size = sec->sh_size;
- section->start = get_data (NULL, file, sec->sh_offset, 1,
- sec->sh_size, buf);
- if (section->start == NULL)
- return 0;
-
- if (section_is_compressed)
- if (! uncompress_section_contents (&section->start, &section->size))
- return 0;
-
- if (debug_displays [debug].relocate)
- debug_apply_relocations (file, sec, section->start);
-
- return 1;
-}
-
-void
-free_debug_section (enum dwarf_section_display_enum debug)
-{
- struct dwarf_section *section = &debug_displays [debug].section;
-
- if (section->start == NULL)
- return;
-
- free ((char *) section->start);
- section->start = NULL;
- section->address = 0;
- section->size = 0;
-}
-
-static int
-display_debug_section (Elf_Internal_Shdr *section, FILE *file)
-{
- char *name = SECTION_NAME (section);
- bfd_size_type length;
- int result = 1;
- enum dwarf_section_display_enum i;
-
- length = section->sh_size;
- if (length == 0)
- {
- printf (_("\nSection '%s' has no debugging data.\n"), name);
- return 0;
- }
-
- if (const_strneq (name, ".gnu.linkonce.wi."))
- name = ".debug_info";
-
- /* See if we know how to display the contents of this section. */
- for (i = 0; i < max; i++)
- if (streq (debug_displays[i].section.uncompressed_name, name)
- || streq (debug_displays[i].section.compressed_name, name))
- {
- struct dwarf_section *sec = &debug_displays [i].section;
-
- if (load_debug_section (i, file))
- {
- result &= debug_displays[i].display (sec, file);
-
- if (i != info && i != abbrev)
- free_debug_section (i);
- }
-
- break;
- }
-
- if (i == max)
- {
- printf (_("Unrecognized debug section: %s\n"), name);
- result = 0;
- }
-
- return result;
-}
-
-/* Set DUMP_SECTS for all sections where dumps were requested
- based on section name. */
-
-static void
-initialise_dumps_byname (void)
-{
- struct dump_list_entry *cur;
-
- for (cur = dump_sects_byname; cur; cur = cur->next)
- {
- unsigned int i;
- int any;
-
- for (i = 0, any = 0; i < elf_header.e_shnum; i++)
- if (streq (SECTION_NAME (section_headers + i), cur->name))
- {
- request_dump_bynumber (i, cur->type);
- any = 1;
- }
-
- if (!any)
- warn (_("Section '%s' was not dumped because it does not exist!\n"),
- cur->name);
- }
-}
-
-static void
-process_section_contents (FILE *file)
-{
- Elf_Internal_Shdr *section;
- unsigned int i;
-
- if (! do_dump)
- return;
-
- initialise_dumps_byname ();
-
- for (i = 0, section = section_headers;
- i < elf_header.e_shnum && i < num_dump_sects;
- i++, section++)
- {
-#ifdef SUPPORT_DISASSEMBLY
- if (dump_sects[i] & DISASS_DUMP)
- disassemble_section (section, file);
-#endif
- if (dump_sects[i] & HEX_DUMP)
- dump_section_as_bytes (section, file);
-
- if (dump_sects[i] & DEBUG_DUMP)
- display_debug_section (section, file);
-
- if (dump_sects[i] & STRING_DUMP)
- dump_section_as_strings (section, file);
- }
-
- /* Check to see if the user requested a
- dump of a section that does not exist. */
- while (i++ < num_dump_sects)
- if (dump_sects[i])
- warn (_("Section %d was not dumped because it does not exist!\n"), i);
-}
-
-static void
-process_mips_fpe_exception (int mask)
-{
- if (mask)
- {
- int first = 1;
- if (mask & OEX_FPU_INEX)
- fputs ("INEX", stdout), first = 0;
- if (mask & OEX_FPU_UFLO)
- printf ("%sUFLO", first ? "" : "|"), first = 0;
- if (mask & OEX_FPU_OFLO)
- printf ("%sOFLO", first ? "" : "|"), first = 0;
- if (mask & OEX_FPU_DIV0)
- printf ("%sDIV0", first ? "" : "|"), first = 0;
- if (mask & OEX_FPU_INVAL)
- printf ("%sINVAL", first ? "" : "|");
- }
- else
- fputs ("0", stdout);
-}
-
-/* ARM EABI attributes section. */
-typedef struct
-{
- int tag;
- const char *name;
- /* 0 = special, 1 = string, 2 = uleb123, > 0x80 == table lookup. */
- int type;
- const char **table;
-} arm_attr_public_tag;
-
-static const char *arm_attr_tag_CPU_arch[] =
- {"Pre-v4", "v4", "v4T", "v5T", "v5TE", "v5TEJ", "v6", "v6KZ", "v6T2",
- "v6K", "v7"};
-static const char *arm_attr_tag_ARM_ISA_use[] = {"No", "Yes"};
-static const char *arm_attr_tag_THUMB_ISA_use[] =
- {"No", "Thumb-1", "Thumb-2"};
-static const char *arm_attr_tag_VFP_arch[] =
- {"No", "VFPv1", "VFPv2", "VFPv3", "VFPv3-D16"};
-static const char *arm_attr_tag_WMMX_arch[] = {"No", "WMMXv1"};
-static const char *arm_attr_tag_NEON_arch[] = {"No", "NEONv1"};
-static const char *arm_attr_tag_ABI_PCS_config[] =
- {"None", "Bare platform", "Linux application", "Linux DSO", "PalmOS 2004",
- "PalmOS (reserved)", "SymbianOS 2004", "SymbianOS (reserved)"};
-static const char *arm_attr_tag_ABI_PCS_R9_use[] =
- {"V6", "SB", "TLS", "Unused"};
-static const char *arm_attr_tag_ABI_PCS_RW_data[] =
- {"Absolute", "PC-relative", "SB-relative", "None"};
-static const char *arm_attr_tag_ABI_PCS_RO_DATA[] =
- {"Absolute", "PC-relative", "None"};
-static const char *arm_attr_tag_ABI_PCS_GOT_use[] =
- {"None", "direct", "GOT-indirect"};
-static const char *arm_attr_tag_ABI_PCS_wchar_t[] =
- {"None", "??? 1", "2", "??? 3", "4"};
-static const char *arm_attr_tag_ABI_FP_rounding[] = {"Unused", "Needed"};
-static const char *arm_attr_tag_ABI_FP_denormal[] = {"Unused", "Needed"};
-static const char *arm_attr_tag_ABI_FP_exceptions[] = {"Unused", "Needed"};
-static const char *arm_attr_tag_ABI_FP_user_exceptions[] = {"Unused", "Needed"};
-static const char *arm_attr_tag_ABI_FP_number_model[] =
- {"Unused", "Finite", "RTABI", "IEEE 754"};
-static const char *arm_attr_tag_ABI_align8_needed[] = {"No", "Yes", "4-byte"};
-static const char *arm_attr_tag_ABI_align8_preserved[] =
- {"No", "Yes, except leaf SP", "Yes"};
-static const char *arm_attr_tag_ABI_enum_size[] =
- {"Unused", "small", "int", "forced to int"};
-static const char *arm_attr_tag_ABI_HardFP_use[] =
- {"As Tag_VFP_arch", "SP only", "DP only", "SP and DP"};
-static const char *arm_attr_tag_ABI_VFP_args[] =
- {"AAPCS", "VFP registers", "custom"};
-static const char *arm_attr_tag_ABI_WMMX_args[] =
- {"AAPCS", "WMMX registers", "custom"};
-static const char *arm_attr_tag_ABI_optimization_goals[] =
- {"None", "Prefer Speed", "Aggressive Speed", "Prefer Size",
- "Aggressive Size", "Prefer Debug", "Aggressive Debug"};
-static const char *arm_attr_tag_ABI_FP_optimization_goals[] =
- {"None", "Prefer Speed", "Aggressive Speed", "Prefer Size",
- "Aggressive Size", "Prefer Accuracy", "Aggressive Accuracy"};
-
-#define LOOKUP(id, name) \
- {id, #name, 0x80 | ARRAY_SIZE(arm_attr_tag_##name), arm_attr_tag_##name}
-static arm_attr_public_tag arm_attr_public_tags[] =
-{
- {4, "CPU_raw_name", 1, NULL},
- {5, "CPU_name", 1, NULL},
- LOOKUP(6, CPU_arch),
- {7, "CPU_arch_profile", 0, NULL},
- LOOKUP(8, ARM_ISA_use),
- LOOKUP(9, THUMB_ISA_use),
- LOOKUP(10, VFP_arch),
- LOOKUP(11, WMMX_arch),
- LOOKUP(12, NEON_arch),
- LOOKUP(13, ABI_PCS_config),
- LOOKUP(14, ABI_PCS_R9_use),
- LOOKUP(15, ABI_PCS_RW_data),
- LOOKUP(16, ABI_PCS_RO_DATA),
- LOOKUP(17, ABI_PCS_GOT_use),
- LOOKUP(18, ABI_PCS_wchar_t),
- LOOKUP(19, ABI_FP_rounding),
- LOOKUP(20, ABI_FP_denormal),
- LOOKUP(21, ABI_FP_exceptions),
- LOOKUP(22, ABI_FP_user_exceptions),
- LOOKUP(23, ABI_FP_number_model),
- LOOKUP(24, ABI_align8_needed),
- LOOKUP(25, ABI_align8_preserved),
- LOOKUP(26, ABI_enum_size),
- LOOKUP(27, ABI_HardFP_use),
- LOOKUP(28, ABI_VFP_args),
- LOOKUP(29, ABI_WMMX_args),
- LOOKUP(30, ABI_optimization_goals),
- LOOKUP(31, ABI_FP_optimization_goals),
- {32, "compatibility", 0, NULL}
-};
-#undef LOOKUP
-
-/* Read an unsigned LEB128 encoded value from p. Set *PLEN to the number of
- bytes read. */
-static unsigned int
-read_uleb128 (unsigned char *p, unsigned int *plen)
-{
- unsigned char c;
- unsigned int val;
- int shift;
- int len;
-
- val = 0;
- shift = 0;
- len = 0;
- do
- {
- c = *(p++);
- len++;
- val |= ((unsigned int)c & 0x7f) << shift;
- shift += 7;
- }
- while (c & 0x80);
-
- *plen = len;
- return val;
-}
-
-static unsigned char *
-display_arm_attribute (unsigned char *p)
-{
- int tag;
- unsigned int len;
- int val;
- arm_attr_public_tag *attr;
- unsigned i;
- int type;
-
- tag = read_uleb128 (p, &len);
- p += len;
- attr = NULL;
- for (i = 0; i < ARRAY_SIZE(arm_attr_public_tags); i++)
- {
- if (arm_attr_public_tags[i].tag == tag)
- {
- attr = &arm_attr_public_tags[i];
- break;
- }
- }
-
- if (attr)
- {
- printf (" Tag_%s: ", attr->name);
- switch (attr->type)
- {
- case 0:
- switch (tag)
- {
- case 7: /* Tag_CPU_arch_profile. */
- val = read_uleb128 (p, &len);
- p += len;
- switch (val)
- {
- case 0: printf ("None\n"); break;
- case 'A': printf ("Application\n"); break;
- case 'R': printf ("Realtime\n"); break;
- case 'M': printf ("Microcontroller\n"); break;
- default: printf ("??? (%d)\n", val); break;
- }
- break;
-
- case 32: /* Tag_compatibility. */
- val = read_uleb128 (p, &len);
- p += len;
- printf ("flag = %d, vendor = %s\n", val, p);
- p += strlen((char *)p) + 1;
- break;
-
- default:
- abort();
- }
- return p;
-
- case 1:
- case 2:
- type = attr->type;
- break;
-
- default:
- assert (attr->type & 0x80);
- val = read_uleb128 (p, &len);
- p += len;
- type = attr->type & 0x7f;
- if (val >= type)
- printf ("??? (%d)\n", val);
- else
- printf ("%s\n", attr->table[val]);
- return p;
- }
- }
- else
- {
- if (tag & 1)
- type = 1; /* String. */
- else
- type = 2; /* uleb128. */
- printf (" Tag_unknown_%d: ", tag);
- }
-
- if (type == 1)
- {
- printf ("\"%s\"\n", p);
- p += strlen((char *)p) + 1;
- }
- else
- {
- val = read_uleb128 (p, &len);
- p += len;
- printf ("%d (0x%x)\n", val, val);
- }
-
- return p;
-}
-
-static unsigned char *
-display_gnu_attribute (unsigned char * p,
- unsigned char * (* display_proc_gnu_attribute) (unsigned char *, int))
-{
- int tag;
- unsigned int len;
- int val;
- int type;
-
- tag = read_uleb128 (p, &len);
- p += len;
-
- /* Tag_compatibility is the only generic GNU attribute defined at
- present. */
- if (tag == 32)
- {
- val = read_uleb128 (p, &len);
- p += len;
- printf ("flag = %d, vendor = %s\n", val, p);
- p += strlen ((char *) p) + 1;
- return p;
- }
-
- if ((tag & 2) == 0 && display_proc_gnu_attribute)
- return display_proc_gnu_attribute (p, tag);
-
- if (tag & 1)
- type = 1; /* String. */
- else
- type = 2; /* uleb128. */
- printf (" Tag_unknown_%d: ", tag);
-
- if (type == 1)
- {
- printf ("\"%s\"\n", p);
- p += strlen ((char *) p) + 1;
- }
- else
- {
- val = read_uleb128 (p, &len);
- p += len;
- printf ("%d (0x%x)\n", val, val);
- }
-
- return p;
-}
-
-static unsigned char *
-display_power_gnu_attribute (unsigned char *p, int tag)
-{
- int type;
- unsigned int len;
- int val;
-
- if (tag == Tag_GNU_Power_ABI_FP)
- {
- val = read_uleb128 (p, &len);
- p += len;
- printf (" Tag_GNU_Power_ABI_FP: ");
-
- switch (val)
- {
- case 0:
- printf ("Hard or soft float\n");
- break;
- case 1:
- printf ("Hard float\n");
- break;
- case 2:
- printf ("Soft float\n");
- break;
- case 3:
- printf ("Single-precision hard float\n");
- break;
- default:
- printf ("??? (%d)\n", val);
- break;
- }
- return p;
- }
-
- if (tag == Tag_GNU_Power_ABI_Vector)
- {
- val = read_uleb128 (p, &len);
- p += len;
- printf (" Tag_GNU_Power_ABI_Vector: ");
- switch (val)
- {
- case 0:
- printf ("Any\n");
- break;
- case 1:
- printf ("Generic\n");
- break;
- case 2:
- printf ("AltiVec\n");
- break;
- case 3:
- printf ("SPE\n");
- break;
- default:
- printf ("??? (%d)\n", val);
- break;
- }
- return p;
- }
-
- if (tag & 1)
- type = 1; /* String. */
- else
- type = 2; /* uleb128. */
- printf (" Tag_unknown_%d: ", tag);
-
- if (type == 1)
- {
- printf ("\"%s\"\n", p);
- p += strlen ((char *) p) + 1;
- }
- else
- {
- val = read_uleb128 (p, &len);
- p += len;
- printf ("%d (0x%x)\n", val, val);
- }
-
- return p;
-}
-
-static unsigned char *
-display_mips_gnu_attribute (unsigned char *p, int tag)
-{
- int type;
- unsigned int len;
- int val;
-
- if (tag == Tag_GNU_MIPS_ABI_FP)
- {
- val = read_uleb128 (p, &len);
- p += len;
- printf (" Tag_GNU_MIPS_ABI_FP: ");
-
- switch (val)
- {
- case 0:
- printf ("Hard or soft float\n");
- break;
- case 1:
- printf ("Hard float (-mdouble-float)\n");
- break;
- case 2:
- printf ("Hard float (-msingle-float)\n");
- break;
- case 3:
- printf ("Soft float\n");
- break;
- case 4:
- printf ("64-bit float (-mips32r2 -mfp64)\n");
- break;
- default:
- printf ("??? (%d)\n", val);
- break;
- }
- return p;
- }
-
- if (tag & 1)
- type = 1; /* String. */
- else
- type = 2; /* uleb128. */
- printf (" Tag_unknown_%d: ", tag);
-
- if (type == 1)
- {
- printf ("\"%s\"\n", p);
- p += strlen ((char *) p) + 1;
- }
- else
- {
- val = read_uleb128 (p, &len);
- p += len;
- printf ("%d (0x%x)\n", val, val);
- }
-
- return p;
-}
-
-static int
-process_attributes (FILE * file,
- const char * public_name,
- unsigned int proc_type,
- unsigned char * (* display_pub_attribute) (unsigned char *),
- unsigned char * (* display_proc_gnu_attribute) (unsigned char *, int))
-{
- Elf_Internal_Shdr *sect;
- unsigned char *contents;
- unsigned char *p;
- unsigned char *end;
- bfd_vma section_len;
- bfd_vma len;
- unsigned i;
-
- /* Find the section header so that we get the size. */
- for (i = 0, sect = section_headers;
- i < elf_header.e_shnum;
- i++, sect++)
- {
- if (sect->sh_type != proc_type && sect->sh_type != SHT_GNU_ATTRIBUTES)
- continue;
-
- contents = get_data (NULL, file, sect->sh_offset, 1, sect->sh_size,
- _("attributes"));
- if (contents == NULL)
- continue;
-
- p = contents;
- if (*p == 'A')
- {
- len = sect->sh_size - 1;
- p++;
-
- while (len > 0)
- {
- int namelen;
- bfd_boolean public_section;
- bfd_boolean gnu_section;
-
- section_len = byte_get (p, 4);
- p += 4;
-
- if (section_len > len)
- {
- printf (_("ERROR: Bad section length (%d > %d)\n"),
- (int) section_len, (int) len);
- section_len = len;
- }
-
- len -= section_len;
- printf ("Attribute Section: %s\n", p);
-
- if (public_name && streq ((char *) p, public_name))
- public_section = TRUE;
- else
- public_section = FALSE;
-
- if (streq ((char *) p, "gnu"))
- gnu_section = TRUE;
- else
- gnu_section = FALSE;
-
- namelen = strlen ((char *) p) + 1;
- p += namelen;
- section_len -= namelen + 4;
-
- while (section_len > 0)
- {
- int tag = *(p++);
- int val;
- bfd_vma size;
-
- size = byte_get (p, 4);
- if (size > section_len)
- {
- printf (_("ERROR: Bad subsection length (%d > %d)\n"),
- (int) size, (int) section_len);
- size = section_len;
- }
-
- section_len -= size;
- end = p + size - 1;
- p += 4;
-
- switch (tag)
- {
- case 1:
- printf ("File Attributes\n");
- break;
- case 2:
- printf ("Section Attributes:");
- goto do_numlist;
- case 3:
- printf ("Symbol Attributes:");
- do_numlist:
- for (;;)
- {
- unsigned int i;
-
- val = read_uleb128 (p, &i);
- p += i;
- if (val == 0)
- break;
- printf (" %d", val);
- }
- printf ("\n");
- break;
- default:
- printf ("Unknown tag: %d\n", tag);
- public_section = FALSE;
- break;
- }
-
- if (public_section)
- {
- while (p < end)
- p = display_pub_attribute (p);
- }
- else if (gnu_section)
- {
- while (p < end)
- p = display_gnu_attribute (p,
- display_proc_gnu_attribute);
- }
- else
- {
- /* ??? Do something sensible, like dump hex. */
- printf (" Unknown section contexts\n");
- p = end;
- }
- }
- }
- }
- else
- printf (_("Unknown format '%c'\n"), *p);
-
- free (contents);
- }
- return 1;
-}
-
-static int
-process_arm_specific (FILE *file)
-{
- return process_attributes (file, "aeabi", SHT_ARM_ATTRIBUTES,
- display_arm_attribute, NULL);
-}
-
-static int
-process_power_specific (FILE *file)
-{
- return process_attributes (file, NULL, SHT_GNU_ATTRIBUTES, NULL,
- display_power_gnu_attribute);
-}
-
-/* DATA points to the contents of a MIPS GOT that starts at VMA PLTGOT.
- Print the Address, Access and Initial fields of an entry at VMA ADDR
- and return the VMA of the next entry. */
-
-static bfd_vma
-print_mips_got_entry (unsigned char *data, bfd_vma pltgot, bfd_vma addr)
-{
- printf (" ");
- print_vma (addr, LONG_HEX);
- printf (" ");
- if (addr < pltgot + 0xfff0)
- printf ("%6d(gp)", (int) (addr - pltgot - 0x7ff0));
- else
- printf ("%10s", "");
- printf (" ");
- if (data == NULL)
- printf ("%*s", is_32bit_elf ? 8 : 16, "<unknown>");
- else
- {
- bfd_vma entry;
-
- entry = byte_get (data + addr - pltgot, is_32bit_elf ? 4 : 8);
- print_vma (entry, LONG_HEX);
- }
- return addr + (is_32bit_elf ? 4 : 8);
-}
-
-static int
-process_mips_specific (FILE *file)
-{
- Elf_Internal_Dyn *entry;
- size_t liblist_offset = 0;
- size_t liblistno = 0;
- size_t conflictsno = 0;
- size_t options_offset = 0;
- size_t conflicts_offset = 0;
- bfd_vma pltgot = 0;
- bfd_vma local_gotno = 0;
- bfd_vma gotsym = 0;
- bfd_vma symtabno = 0;
-
- process_attributes (file, NULL, SHT_GNU_ATTRIBUTES, NULL,
- display_mips_gnu_attribute);
-
- /* We have a lot of special sections. Thanks SGI! */
- if (dynamic_section == NULL)
- /* No information available. */
- return 0;
-
- for (entry = dynamic_section; entry->d_tag != DT_NULL; ++entry)
- switch (entry->d_tag)
- {
- case DT_MIPS_LIBLIST:
- liblist_offset
- = offset_from_vma (file, entry->d_un.d_val,
- liblistno * sizeof (Elf32_External_Lib));
- break;
- case DT_MIPS_LIBLISTNO:
- liblistno = entry->d_un.d_val;
- break;
- case DT_MIPS_OPTIONS:
- options_offset = offset_from_vma (file, entry->d_un.d_val, 0);
- break;
- case DT_MIPS_CONFLICT:
- conflicts_offset
- = offset_from_vma (file, entry->d_un.d_val,
- conflictsno * sizeof (Elf32_External_Conflict));
- break;
- case DT_MIPS_CONFLICTNO:
- conflictsno = entry->d_un.d_val;
- break;
- case DT_PLTGOT:
- pltgot = entry->d_un.d_val;
- case DT_MIPS_LOCAL_GOTNO:
- local_gotno = entry->d_un.d_val;
- break;
- case DT_MIPS_GOTSYM:
- gotsym = entry->d_un.d_val;
- break;
- case DT_MIPS_SYMTABNO:
- symtabno = entry->d_un.d_val;
- break;
- default:
- break;
- }
-
- if (liblist_offset != 0 && liblistno != 0 && do_dynamic)
- {
- Elf32_External_Lib *elib;
- size_t cnt;
-
- elib = get_data (NULL, file, liblist_offset,
- liblistno, sizeof (Elf32_External_Lib),
- _("liblist"));
- if (elib)
- {
- printf ("\nSection '.liblist' contains %lu entries:\n",
- (unsigned long) liblistno);
- fputs (" Library Time Stamp Checksum Version Flags\n",
- stdout);
-
- for (cnt = 0; cnt < liblistno; ++cnt)
- {
- Elf32_Lib liblist;
- time_t time;
- char timebuf[20];
- struct tm *tmp;
-
- liblist.l_name = BYTE_GET (elib[cnt].l_name);
- time = BYTE_GET (elib[cnt].l_time_stamp);
- liblist.l_checksum = BYTE_GET (elib[cnt].l_checksum);
- liblist.l_version = BYTE_GET (elib[cnt].l_version);
- liblist.l_flags = BYTE_GET (elib[cnt].l_flags);
-
- tmp = gmtime (&time);
- snprintf (timebuf, sizeof (timebuf),
- "%04u-%02u-%02uT%02u:%02u:%02u",
- tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
- tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
-
- printf ("%3lu: ", (unsigned long) cnt);
- if (VALID_DYNAMIC_NAME (liblist.l_name))
- print_symbol (20, GET_DYNAMIC_NAME (liblist.l_name));
- else
- printf ("<corrupt: %9ld>", liblist.l_name);
- printf (" %s %#10lx %-7ld", timebuf, liblist.l_checksum,
- liblist.l_version);
-
- if (liblist.l_flags == 0)
- puts (" NONE");
- else
- {
- static const struct
- {
- const char *name;
- int bit;
- }
- l_flags_vals[] =
- {
- { " EXACT_MATCH", LL_EXACT_MATCH },
- { " IGNORE_INT_VER", LL_IGNORE_INT_VER },
- { " REQUIRE_MINOR", LL_REQUIRE_MINOR },
- { " EXPORTS", LL_EXPORTS },
- { " DELAY_LOAD", LL_DELAY_LOAD },
- { " DELTA", LL_DELTA }
- };
- int flags = liblist.l_flags;
- size_t fcnt;
-
- for (fcnt = 0; fcnt < ARRAY_SIZE (l_flags_vals); ++fcnt)
- if ((flags & l_flags_vals[fcnt].bit) != 0)
- {
- fputs (l_flags_vals[fcnt].name, stdout);
- flags ^= l_flags_vals[fcnt].bit;
- }
- if (flags != 0)
- printf (" %#x", (unsigned int) flags);
-
- puts ("");
- }
- }
-
- free (elib);
- }
- }
-
- if (options_offset != 0)
- {
- Elf_External_Options *eopt;
- Elf_Internal_Shdr *sect = section_headers;
- Elf_Internal_Options *iopt;
- Elf_Internal_Options *option;
- size_t offset;
- int cnt;
-
- /* Find the section header so that we get the size. */
- while (sect->sh_type != SHT_MIPS_OPTIONS)
- ++sect;
-
- eopt = get_data (NULL, file, options_offset, 1, sect->sh_size,
- _("options"));
- if (eopt)
- {
- iopt = cmalloc ((sect->sh_size / sizeof (eopt)), sizeof (*iopt));
- if (iopt == NULL)
- {
- error (_("Out of memory\n"));
- return 0;
- }
-
- offset = cnt = 0;
- option = iopt;
-
- while (offset < sect->sh_size)
- {
- Elf_External_Options *eoption;
-
- eoption = (Elf_External_Options *) ((char *) eopt + offset);
-
- option->kind = BYTE_GET (eoption->kind);
- option->size = BYTE_GET (eoption->size);
- option->section = BYTE_GET (eoption->section);
- option->info = BYTE_GET (eoption->info);
-
- offset += option->size;
-
- ++option;
- ++cnt;
- }
-
- printf (_("\nSection '%s' contains %d entries:\n"),
- SECTION_NAME (sect), cnt);
-
- option = iopt;
-
- while (cnt-- > 0)
- {
- size_t len;
-
- switch (option->kind)
- {
- case ODK_NULL:
- /* This shouldn't happen. */
- printf (" NULL %d %lx", option->section, option->info);
- break;
- case ODK_REGINFO:
- printf (" REGINFO ");
- if (elf_header.e_machine == EM_MIPS)
- {
- /* 32bit form. */
- Elf32_External_RegInfo *ereg;
- Elf32_RegInfo reginfo;
-
- ereg = (Elf32_External_RegInfo *) (option + 1);
- reginfo.ri_gprmask = BYTE_GET (ereg->ri_gprmask);
- reginfo.ri_cprmask[0] = BYTE_GET (ereg->ri_cprmask[0]);
- reginfo.ri_cprmask[1] = BYTE_GET (ereg->ri_cprmask[1]);
- reginfo.ri_cprmask[2] = BYTE_GET (ereg->ri_cprmask[2]);
- reginfo.ri_cprmask[3] = BYTE_GET (ereg->ri_cprmask[3]);
- reginfo.ri_gp_value = BYTE_GET (ereg->ri_gp_value);
-
- printf ("GPR %08lx GP 0x%lx\n",
- reginfo.ri_gprmask,
- (unsigned long) reginfo.ri_gp_value);
- printf (" CPR0 %08lx CPR1 %08lx CPR2 %08lx CPR3 %08lx\n",
- reginfo.ri_cprmask[0], reginfo.ri_cprmask[1],
- reginfo.ri_cprmask[2], reginfo.ri_cprmask[3]);
- }
- else
- {
- /* 64 bit form. */
- Elf64_External_RegInfo *ereg;
- Elf64_Internal_RegInfo reginfo;
-
- ereg = (Elf64_External_RegInfo *) (option + 1);
- reginfo.ri_gprmask = BYTE_GET (ereg->ri_gprmask);
- reginfo.ri_cprmask[0] = BYTE_GET (ereg->ri_cprmask[0]);
- reginfo.ri_cprmask[1] = BYTE_GET (ereg->ri_cprmask[1]);
- reginfo.ri_cprmask[2] = BYTE_GET (ereg->ri_cprmask[2]);
- reginfo.ri_cprmask[3] = BYTE_GET (ereg->ri_cprmask[3]);
- reginfo.ri_gp_value = BYTE_GET (ereg->ri_gp_value);
-
- printf ("GPR %08lx GP 0x",
- reginfo.ri_gprmask);
- printf_vma (reginfo.ri_gp_value);
- printf ("\n");
-
- printf (" CPR0 %08lx CPR1 %08lx CPR2 %08lx CPR3 %08lx\n",
- reginfo.ri_cprmask[0], reginfo.ri_cprmask[1],
- reginfo.ri_cprmask[2], reginfo.ri_cprmask[3]);
- }
- ++option;
- continue;
- case ODK_EXCEPTIONS:
- fputs (" EXCEPTIONS fpe_min(", stdout);
- process_mips_fpe_exception (option->info & OEX_FPU_MIN);
- fputs (") fpe_max(", stdout);
- process_mips_fpe_exception ((option->info & OEX_FPU_MAX) >> 8);
- fputs (")", stdout);
-
- if (option->info & OEX_PAGE0)
- fputs (" PAGE0", stdout);
- if (option->info & OEX_SMM)
- fputs (" SMM", stdout);
- if (option->info & OEX_FPDBUG)
- fputs (" FPDBUG", stdout);
- if (option->info & OEX_DISMISS)
- fputs (" DISMISS", stdout);
- break;
- case ODK_PAD:
- fputs (" PAD ", stdout);
- if (option->info & OPAD_PREFIX)
- fputs (" PREFIX", stdout);
- if (option->info & OPAD_POSTFIX)
- fputs (" POSTFIX", stdout);
- if (option->info & OPAD_SYMBOL)
- fputs (" SYMBOL", stdout);
- break;
- case ODK_HWPATCH:
- fputs (" HWPATCH ", stdout);
- if (option->info & OHW_R4KEOP)
- fputs (" R4KEOP", stdout);
- if (option->info & OHW_R8KPFETCH)
- fputs (" R8KPFETCH", stdout);
- if (option->info & OHW_R5KEOP)
- fputs (" R5KEOP", stdout);
- if (option->info & OHW_R5KCVTL)
- fputs (" R5KCVTL", stdout);
- break;
- case ODK_FILL:
- fputs (" FILL ", stdout);
- /* XXX Print content of info word? */
- break;
- case ODK_TAGS:
- fputs (" TAGS ", stdout);
- /* XXX Print content of info word? */
- break;
- case ODK_HWAND:
- fputs (" HWAND ", stdout);
- if (option->info & OHWA0_R4KEOP_CHECKED)
- fputs (" R4KEOP_CHECKED", stdout);
- if (option->info & OHWA0_R4KEOP_CLEAN)
- fputs (" R4KEOP_CLEAN", stdout);
- break;
- case ODK_HWOR:
- fputs (" HWOR ", stdout);
- if (option->info & OHWA0_R4KEOP_CHECKED)
- fputs (" R4KEOP_CHECKED", stdout);
- if (option->info & OHWA0_R4KEOP_CLEAN)
- fputs (" R4KEOP_CLEAN", stdout);
- break;
- case ODK_GP_GROUP:
- printf (" GP_GROUP %#06lx self-contained %#06lx",
- option->info & OGP_GROUP,
- (option->info & OGP_SELF) >> 16);
- break;
- case ODK_IDENT:
- printf (" IDENT %#06lx self-contained %#06lx",
- option->info & OGP_GROUP,
- (option->info & OGP_SELF) >> 16);
- break;
- default:
- /* This shouldn't happen. */
- printf (" %3d ??? %d %lx",
- option->kind, option->section, option->info);
- break;
- }
-
- len = sizeof (*eopt);
- while (len < option->size)
- if (((char *) option)[len] >= ' '
- && ((char *) option)[len] < 0x7f)
- printf ("%c", ((char *) option)[len++]);
- else
- printf ("\\%03o", ((char *) option)[len++]);
-
- fputs ("\n", stdout);
- ++option;
- }
-
- free (eopt);
- }
- }
-
- if (conflicts_offset != 0 && conflictsno != 0)
- {
- Elf32_Conflict *iconf;
- size_t cnt;
-
- if (dynamic_symbols == NULL)
- {
- error (_("conflict list found without a dynamic symbol table\n"));
- return 0;
- }
-
- iconf = cmalloc (conflictsno, sizeof (*iconf));
- if (iconf == NULL)
- {
- error (_("Out of memory\n"));
- return 0;
- }
-
- if (is_32bit_elf)
- {
- Elf32_External_Conflict *econf32;
-
- econf32 = get_data (NULL, file, conflicts_offset,
- conflictsno, sizeof (*econf32), _("conflict"));
- if (!econf32)
- return 0;
-
- for (cnt = 0; cnt < conflictsno; ++cnt)
- iconf[cnt] = BYTE_GET (econf32[cnt]);
-
- free (econf32);
- }
- else
- {
- Elf64_External_Conflict *econf64;
-
- econf64 = get_data (NULL, file, conflicts_offset,
- conflictsno, sizeof (*econf64), _("conflict"));
- if (!econf64)
- return 0;
-
- for (cnt = 0; cnt < conflictsno; ++cnt)
- iconf[cnt] = BYTE_GET (econf64[cnt]);
-
- free (econf64);
- }
-
- printf (_("\nSection '.conflict' contains %lu entries:\n"),
- (unsigned long) conflictsno);
- puts (_(" Num: Index Value Name"));
-
- for (cnt = 0; cnt < conflictsno; ++cnt)
- {
- Elf_Internal_Sym *psym = & dynamic_symbols[iconf[cnt]];
-
- printf ("%5lu: %8lu ", (unsigned long) cnt, iconf[cnt]);
- print_vma (psym->st_value, FULL_HEX);
- putchar (' ');
- if (VALID_DYNAMIC_NAME (psym->st_name))
- print_symbol (25, GET_DYNAMIC_NAME (psym->st_name));
- else
- printf ("<corrupt: %14ld>", psym->st_name);
- putchar ('\n');
- }
-
- free (iconf);
- }
-
- if (pltgot != 0 && local_gotno != 0)
- {
- bfd_vma entry, local_end, global_end;
- size_t i, offset;
- unsigned char *data;
- int addr_size;
-
- entry = pltgot;
- addr_size = (is_32bit_elf ? 4 : 8);
- local_end = pltgot + local_gotno * addr_size;
- global_end = local_end + (symtabno - gotsym) * addr_size;
-
- offset = offset_from_vma (file, pltgot, global_end - pltgot);
- data = get_data (NULL, file, offset, global_end - pltgot, 1, _("GOT"));
- printf (_("\nPrimary GOT:\n"));
- printf (_(" Canonical gp value: "));
- print_vma (pltgot + 0x7ff0, LONG_HEX);
- printf ("\n\n");
-
- printf (_(" Reserved entries:\n"));
- printf (_(" %*s %10s %*s Purpose\n"),
- addr_size * 2, "Address", "Access",
- addr_size * 2, "Initial");
- entry = print_mips_got_entry (data, pltgot, entry);
- printf (" Lazy resolver\n");
- if (data
- && (byte_get (data + entry - pltgot, addr_size)
- >> (addr_size * 8 - 1)) != 0)
- {
- entry = print_mips_got_entry (data, pltgot, entry);
- printf (" Module pointer (GNU extension)\n");
- }
- printf ("\n");
-
- if (entry < local_end)
- {
- printf (_(" Local entries:\n"));
- printf (_(" %*s %10s %*s\n"),
- addr_size * 2, "Address", "Access",
- addr_size * 2, "Initial");
- while (entry < local_end)
- {
- entry = print_mips_got_entry (data, pltgot, entry);
- printf ("\n");
- }
- printf ("\n");
- }
-
- if (gotsym < symtabno)
- {
- int sym_width;
-
- printf (_(" Global entries:\n"));
- printf (_(" %*s %10s %*s %*s %-7s %3s %s\n"),
- addr_size * 2, "Address", "Access",
- addr_size * 2, "Initial",
- addr_size * 2, "Sym.Val.", "Type", "Ndx", "Name");
- sym_width = (is_32bit_elf ? 80 : 160) - 28 - addr_size * 6 - 1;
- for (i = gotsym; i < symtabno; i++)
- {
- Elf_Internal_Sym *psym;
-
- psym = dynamic_symbols + i;
- entry = print_mips_got_entry (data, pltgot, entry);
- printf (" ");
- print_vma (psym->st_value, LONG_HEX);
- printf (" %-7s %3s ",
- get_symbol_type (ELF_ST_TYPE (psym->st_info)),
- get_symbol_index_type (psym->st_shndx));
- if (VALID_DYNAMIC_NAME (psym->st_name))
- print_symbol (sym_width, GET_DYNAMIC_NAME (psym->st_name));
- else
- printf ("<corrupt: %14ld>", psym->st_name);
- printf ("\n");
- }
- printf ("\n");
- }
-
- if (data)
- free (data);
- }
-
- return 1;
-}
-
-static int
-process_gnu_liblist (FILE *file)
-{
- Elf_Internal_Shdr *section, *string_sec;
- Elf32_External_Lib *elib;
- char *strtab;
- size_t strtab_size;
- size_t cnt;
- unsigned i;
-
- if (! do_arch)
- return 0;
-
- for (i = 0, section = section_headers;
- i < elf_header.e_shnum;
- i++, section++)
- {
- switch (section->sh_type)
- {
- case SHT_GNU_LIBLIST:
- if (section->sh_link >= elf_header.e_shnum)
- break;
-
- elib = get_data (NULL, file, section->sh_offset, 1, section->sh_size,
- _("liblist"));
-
- if (elib == NULL)
- break;
- string_sec = section_headers + section->sh_link;
-
- strtab = get_data (NULL, file, string_sec->sh_offset, 1,
- string_sec->sh_size, _("liblist string table"));
- strtab_size = string_sec->sh_size;
-
- if (strtab == NULL
- || section->sh_entsize != sizeof (Elf32_External_Lib))
- {
- free (elib);
- break;
- }
-
- printf (_("\nLibrary list section '%s' contains %lu entries:\n"),
- SECTION_NAME (section),
- (unsigned long) (section->sh_size / sizeof (Elf32_External_Lib)));
-
- puts (" Library Time Stamp Checksum Version Flags");
-
- for (cnt = 0; cnt < section->sh_size / sizeof (Elf32_External_Lib);
- ++cnt)
- {
- Elf32_Lib liblist;
- time_t time;
- char timebuf[20];
- struct tm *tmp;
-
- liblist.l_name = BYTE_GET (elib[cnt].l_name);
- time = BYTE_GET (elib[cnt].l_time_stamp);
- liblist.l_checksum = BYTE_GET (elib[cnt].l_checksum);
- liblist.l_version = BYTE_GET (elib[cnt].l_version);
- liblist.l_flags = BYTE_GET (elib[cnt].l_flags);
-
- tmp = gmtime (&time);
- snprintf (timebuf, sizeof (timebuf),
- "%04u-%02u-%02uT%02u:%02u:%02u",
- tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
- tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
-
- printf ("%3lu: ", (unsigned long) cnt);
- if (do_wide)
- printf ("%-20s", liblist.l_name < strtab_size
- ? strtab + liblist.l_name : "<corrupt>");
- else
- printf ("%-20.20s", liblist.l_name < strtab_size
- ? strtab + liblist.l_name : "<corrupt>");
- printf (" %s %#010lx %-7ld %-7ld\n", timebuf, liblist.l_checksum,
- liblist.l_version, liblist.l_flags);
- }
-
- free (elib);
- }
- }
-
- return 1;
-}
-
-static const char *
-get_note_type (unsigned e_type)
-{
- static char buff[64];
-
- if (elf_header.e_type == ET_CORE)
- switch (e_type)
- {
- case NT_AUXV:
- return _("NT_AUXV (auxiliary vector)");
- case NT_PRSTATUS:
- return _("NT_PRSTATUS (prstatus structure)");
- case NT_FPREGSET:
- return _("NT_FPREGSET (floating point registers)");
- case NT_PRPSINFO:
- return _("NT_PRPSINFO (prpsinfo structure)");
- case NT_TASKSTRUCT:
- return _("NT_TASKSTRUCT (task structure)");
- case NT_PRXFPREG:
- return _("NT_PRXFPREG (user_xfpregs structure)");
- case NT_PPC_VMX:
- return _("NT_PPC_VMX (ppc Altivec registers)");
- case NT_PPC_VSX:
- return _("NT_PPC_VSX (ppc VSX registers)");
- case NT_PSTATUS:
- return _("NT_PSTATUS (pstatus structure)");
- case NT_FPREGS:
- return _("NT_FPREGS (floating point registers)");
- case NT_PSINFO:
- return _("NT_PSINFO (psinfo structure)");
- case NT_LWPSTATUS:
- return _("NT_LWPSTATUS (lwpstatus_t structure)");
- case NT_LWPSINFO:
- return _("NT_LWPSINFO (lwpsinfo_t structure)");
- case NT_WIN32PSTATUS:
- return _("NT_WIN32PSTATUS (win32_pstatus structure)");
- default:
- break;
- }
- else
- switch (e_type)
- {
- case NT_VERSION:
- return _("NT_VERSION (version)");
- case NT_ARCH:
- return _("NT_ARCH (architecture)");
- default:
- break;
- }
-
- snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), e_type);
- return buff;
-}
-
-static const char *
-get_gnu_elf_note_type (unsigned e_type)
-{
- static char buff[64];
-
- switch (e_type)
- {
- case NT_GNU_ABI_TAG:
- return _("NT_GNU_ABI_TAG (ABI version tag)");
- case NT_GNU_HWCAP:
- return _("NT_GNU_HWCAP (DSO-supplied software HWCAP info)");
- case NT_GNU_BUILD_ID:
- return _("NT_GNU_BUILD_ID (unique build ID bitstring)");
- case NT_GNU_GOLD_VERSION:
- return _("NT_GNU_GOLD_VERSION (gold version)");
- default:
- break;
- }
-
- snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), e_type);
- return buff;
-}
-
-static const char *
-get_netbsd_elfcore_note_type (unsigned e_type)
-{
- static char buff[64];
-
- if (e_type == NT_NETBSDCORE_PROCINFO)
- {
- /* NetBSD core "procinfo" structure. */
- return _("NetBSD procinfo structure");
- }
-
- /* As of Jan 2002 there are no other machine-independent notes
- defined for NetBSD core files. If the note type is less
- than the start of the machine-dependent note types, we don't
- understand it. */
-
- if (e_type < NT_NETBSDCORE_FIRSTMACH)
- {
- snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), e_type);
- return buff;
- }
-
- switch (elf_header.e_machine)
- {
- /* On the Alpha, SPARC (32-bit and 64-bit), PT_GETREGS == mach+0
- and PT_GETFPREGS == mach+2. */
-
- case EM_OLD_ALPHA:
- case EM_ALPHA:
- case EM_SPARC:
- case EM_SPARC32PLUS:
- case EM_SPARCV9:
- switch (e_type)
- {
- case NT_NETBSDCORE_FIRSTMACH+0:
- return _("PT_GETREGS (reg structure)");
- case NT_NETBSDCORE_FIRSTMACH+2:
- return _("PT_GETFPREGS (fpreg structure)");
- default:
- break;
- }
- break;
-
- /* On all other arch's, PT_GETREGS == mach+1 and
- PT_GETFPREGS == mach+3. */
- default:
- switch (e_type)
- {
- case NT_NETBSDCORE_FIRSTMACH+1:
- return _("PT_GETREGS (reg structure)");
- case NT_NETBSDCORE_FIRSTMACH+3:
- return _("PT_GETFPREGS (fpreg structure)");
- default:
- break;
- }
- }
-
- snprintf (buff, sizeof (buff), _("PT_FIRSTMACH+%d"),
- e_type - NT_NETBSDCORE_FIRSTMACH);
- return buff;
-}
-
-/* Note that by the ELF standard, the name field is already null byte
- terminated, and namesz includes the terminating null byte.
- I.E. the value of namesz for the name "FSF" is 4.
-
- If the value of namesz is zero, there is no name present. */
-static int
-process_note (Elf_Internal_Note *pnote)
-{
- const char *name = pnote->namesz ? pnote->namedata : "(NONE)";
- const char *nt;
-
- if (pnote->namesz == 0)
- /* If there is no note name, then use the default set of
- note type strings. */
- nt = get_note_type (pnote->type);
-
- else if (const_strneq (pnote->namedata, "GNU"))
- /* GNU-specific object file notes. */
- nt = get_gnu_elf_note_type (pnote->type);
-
- else if (const_strneq (pnote->namedata, "NetBSD-CORE"))
- /* NetBSD-specific core file notes. */
- nt = get_netbsd_elfcore_note_type (pnote->type);
-
- else if (strneq (pnote->namedata, "SPU/", 4))
- {
- /* SPU-specific core file notes. */
- nt = pnote->namedata + 4;
- name = "SPU";
- }
-
- else
- /* Don't recognize this note name; just use the default set of
- note type strings. */
- nt = get_note_type (pnote->type);
-
- printf (" %s\t\t0x%08lx\t%s\n", name, pnote->descsz, nt);
- return 1;
-}
-
-
-static int
-process_corefile_note_segment (FILE *file, bfd_vma offset, bfd_vma length)
-{
- Elf_External_Note *pnotes;
- Elf_External_Note *external;
- int res = 1;
-
- if (length <= 0)
- return 0;
-
- pnotes = get_data (NULL, file, offset, 1, length, _("notes"));
- if (!pnotes)
- return 0;
-
- external = pnotes;
-
- printf (_("\nNotes at offset 0x%08lx with length 0x%08lx:\n"),
- (unsigned long) offset, (unsigned long) length);
- printf (_(" Owner\t\tData size\tDescription\n"));
-
- while (external < (Elf_External_Note *)((char *) pnotes + length))
- {
- Elf_External_Note *next;
- Elf_Internal_Note inote;
- char *temp = NULL;
-
- inote.type = BYTE_GET (external->type);
- inote.namesz = BYTE_GET (external->namesz);
- inote.namedata = external->name;
- inote.descsz = BYTE_GET (external->descsz);
- inote.descdata = inote.namedata + align_power (inote.namesz, 2);
- inote.descpos = offset + (inote.descdata - (char *) pnotes);
-
- next = (Elf_External_Note *)(inote.descdata + align_power (inote.descsz, 2));
-
- if (((char *) next) > (((char *) pnotes) + length))
- {
- warn (_("corrupt note found at offset %lx into core notes\n"),
- (unsigned long) ((char *) external - (char *) pnotes));
- warn (_(" type: %lx, namesize: %08lx, descsize: %08lx\n"),
- inote.type, inote.namesz, inote.descsz);
- break;
- }
-
- external = next;
-
- /* Verify that name is null terminated. It appears that at least
- one version of Linux (RedHat 6.0) generates corefiles that don't
- comply with the ELF spec by failing to include the null byte in
- namesz. */
- if (inote.namedata[inote.namesz] != '\0')
- {
- temp = malloc (inote.namesz + 1);
-
- if (temp == NULL)
- {
- error (_("Out of memory\n"));
- res = 0;
- break;
- }
-
- strncpy (temp, inote.namedata, inote.namesz);
- temp[inote.namesz] = 0;
-
- /* warn (_("'%s' NOTE name not properly null terminated\n"), temp); */
- inote.namedata = temp;
- }
-
- res &= process_note (& inote);
-
- if (temp != NULL)
- {
- free (temp);
- temp = NULL;
- }
- }
-
- free (pnotes);
-
- return res;
-}
-
-static int
-process_corefile_note_segments (FILE *file)
-{
- Elf_Internal_Phdr *segment;
- unsigned int i;
- int res = 1;
-
- if (! get_program_headers (file))
- return 0;
-
- for (i = 0, segment = program_headers;
- i < elf_header.e_phnum;
- i++, segment++)
- {
- if (segment->p_type == PT_NOTE)
- res &= process_corefile_note_segment (file,
- (bfd_vma) segment->p_offset,
- (bfd_vma) segment->p_filesz);
- }
-
- return res;
-}
-
-static int
-process_note_sections (FILE *file)
-{
- Elf_Internal_Shdr *section;
- unsigned long i;
- int res = 1;
-
- for (i = 0, section = section_headers;
- i < elf_header.e_shnum;
- i++, section++)
- if (section->sh_type == SHT_NOTE)
- res &= process_corefile_note_segment (file,
- (bfd_vma) section->sh_offset,
- (bfd_vma) section->sh_size);
-
- return res;
-}
-
-static int
-process_notes (FILE *file)
-{
- /* If we have not been asked to display the notes then do nothing. */
- if (! do_notes)
- return 1;
-
- if (elf_header.e_type != ET_CORE)
- return process_note_sections (file);
-
- /* No program headers means no NOTE segment. */
- if (elf_header.e_phnum > 0)
- return process_corefile_note_segments (file);
-
- printf (_("No note segments present in the core file.\n"));
- return 1;
-}
-
-static int
-process_arch_specific (FILE *file)
-{
- if (! do_arch)
- return 1;
-
- switch (elf_header.e_machine)
- {
- case EM_ARM:
- return process_arm_specific (file);
- case EM_MIPS:
- case EM_MIPS_RS3_LE:
- return process_mips_specific (file);
- break;
- case EM_PPC:
- return process_power_specific (file);
- break;
- default:
- break;
- }
- return 1;
-}
-
-static int
-get_file_header (FILE *file)
-{
- /* Read in the identity array. */
- if (fread (elf_header.e_ident, EI_NIDENT, 1, file) != 1)
- return 0;
-
- /* Determine how to read the rest of the header. */
- switch (elf_header.e_ident[EI_DATA])
- {
- default: /* fall through */
- case ELFDATANONE: /* fall through */
- case ELFDATA2LSB:
- byte_get = byte_get_little_endian;
- byte_put = byte_put_little_endian;
- break;
- case ELFDATA2MSB:
- byte_get = byte_get_big_endian;
- byte_put = byte_put_big_endian;
- break;
- }
-
- /* For now we only support 32 bit and 64 bit ELF files. */
- is_32bit_elf = (elf_header.e_ident[EI_CLASS] != ELFCLASS64);
-
- /* Read in the rest of the header. */
- if (is_32bit_elf)
- {
- Elf32_External_Ehdr ehdr32;
-
- if (fread (ehdr32.e_type, sizeof (ehdr32) - EI_NIDENT, 1, file) != 1)
- return 0;
-
- elf_header.e_type = BYTE_GET (ehdr32.e_type);
- elf_header.e_machine = BYTE_GET (ehdr32.e_machine);
- elf_header.e_version = BYTE_GET (ehdr32.e_version);
- elf_header.e_entry = BYTE_GET (ehdr32.e_entry);
- elf_header.e_phoff = BYTE_GET (ehdr32.e_phoff);
- elf_header.e_shoff = BYTE_GET (ehdr32.e_shoff);
- elf_header.e_flags = BYTE_GET (ehdr32.e_flags);
- elf_header.e_ehsize = BYTE_GET (ehdr32.e_ehsize);
- elf_header.e_phentsize = BYTE_GET (ehdr32.e_phentsize);
- elf_header.e_phnum = BYTE_GET (ehdr32.e_phnum);
- elf_header.e_shentsize = BYTE_GET (ehdr32.e_shentsize);
- elf_header.e_shnum = BYTE_GET (ehdr32.e_shnum);
- elf_header.e_shstrndx = BYTE_GET (ehdr32.e_shstrndx);
- }
- else
- {
- Elf64_External_Ehdr ehdr64;
-
- /* If we have been compiled with sizeof (bfd_vma) == 4, then
- we will not be able to cope with the 64bit data found in
- 64 ELF files. Detect this now and abort before we start
- overwriting things. */
- if (sizeof (bfd_vma) < 8)
- {
- error (_("This instance of readelf has been built without support for a\n\
-64 bit data type and so it cannot read 64 bit ELF files.\n"));
- return 0;
- }
-
- if (fread (ehdr64.e_type, sizeof (ehdr64) - EI_NIDENT, 1, file) != 1)
- return 0;
-
- elf_header.e_type = BYTE_GET (ehdr64.e_type);
- elf_header.e_machine = BYTE_GET (ehdr64.e_machine);
- elf_header.e_version = BYTE_GET (ehdr64.e_version);
- elf_header.e_entry = BYTE_GET (ehdr64.e_entry);
- elf_header.e_phoff = BYTE_GET (ehdr64.e_phoff);
- elf_header.e_shoff = BYTE_GET (ehdr64.e_shoff);
- elf_header.e_flags = BYTE_GET (ehdr64.e_flags);
- elf_header.e_ehsize = BYTE_GET (ehdr64.e_ehsize);
- elf_header.e_phentsize = BYTE_GET (ehdr64.e_phentsize);
- elf_header.e_phnum = BYTE_GET (ehdr64.e_phnum);
- elf_header.e_shentsize = BYTE_GET (ehdr64.e_shentsize);
- elf_header.e_shnum = BYTE_GET (ehdr64.e_shnum);
- elf_header.e_shstrndx = BYTE_GET (ehdr64.e_shstrndx);
- }
-
- if (elf_header.e_shoff)
- {
- /* There may be some extensions in the first section header. Don't
- bomb if we can't read it. */
- if (is_32bit_elf)
- get_32bit_section_headers (file, 1);
- else
- get_64bit_section_headers (file, 1);
- }
-
- return 1;
-}
-
-/* Process one ELF object file according to the command line options.
- This file may actually be stored in an archive. The file is
- positioned at the start of the ELF object. */
-
-static int
-process_object (char *file_name, FILE *file)
-{
- unsigned int i;
-
- if (! get_file_header (file))
- {
- error (_("%s: Failed to read file header\n"), file_name);
- return 1;
- }
-
- /* Initialise per file variables. */
- for (i = ARRAY_SIZE (version_info); i--;)
- version_info[i] = 0;
-
- for (i = ARRAY_SIZE (dynamic_info); i--;)
- dynamic_info[i] = 0;
-
- /* Process the file. */
- if (show_name)
- printf (_("\nFile: %s\n"), file_name);
-
- /* Initialise the dump_sects array from the cmdline_dump_sects array.
- Note we do this even if cmdline_dump_sects is empty because we
- must make sure that the dump_sets array is zeroed out before each
- object file is processed. */
- if (num_dump_sects > num_cmdline_dump_sects)
- memset (dump_sects, 0, num_dump_sects * sizeof (* dump_sects));
-
- if (num_cmdline_dump_sects > 0)
- {
- if (num_dump_sects == 0)
- /* A sneaky way of allocating the dump_sects array. */
- request_dump_bynumber (num_cmdline_dump_sects, 0);
-
- assert (num_dump_sects >= num_cmdline_dump_sects);
- memcpy (dump_sects, cmdline_dump_sects,
- num_cmdline_dump_sects * sizeof (* dump_sects));
- }
-
- if (! process_file_header ())
- return 1;
-
- if (! process_section_headers (file))
- {
- /* Without loaded section headers we cannot process lots of
- things. */
- do_unwind = do_version = do_dump = do_arch = 0;
-
- if (! do_using_dynamic)
- do_syms = do_reloc = 0;
- }
-
- if (! process_section_groups (file))
- {
- /* Without loaded section groups we cannot process unwind. */
- do_unwind = 0;
- }
-
- if (process_program_headers (file))
- process_dynamic_section (file);
-
- process_relocs (file);
-
- process_unwind (file);
-
- process_symbol_table (file);
-
- process_syminfo (file);
-
- process_version_sections (file);
-
- process_section_contents (file);
-
- process_notes (file);
-
- process_gnu_liblist (file);
-
- process_arch_specific (file);
-
- if (program_headers)
- {
- free (program_headers);
- program_headers = NULL;
- }
-
- if (section_headers)
- {
- free (section_headers);
- section_headers = NULL;
- }
-
- if (string_table)
- {
- free (string_table);
- string_table = NULL;
- string_table_length = 0;
- }
-
- if (dynamic_strings)
- {
- free (dynamic_strings);
- dynamic_strings = NULL;
- dynamic_strings_length = 0;
- }
-
- if (dynamic_symbols)
- {
- free (dynamic_symbols);
- dynamic_symbols = NULL;
- num_dynamic_syms = 0;
- }
-
- if (dynamic_syminfo)
- {
- free (dynamic_syminfo);
- dynamic_syminfo = NULL;
- }
-
- if (section_headers_groups)
- {
- free (section_headers_groups);
- section_headers_groups = NULL;
- }
-
- if (section_groups)
- {
- struct group_list *g, *next;
-
- for (i = 0; i < group_count; i++)
- {
- for (g = section_groups [i].root; g != NULL; g = next)
- {
- next = g->next;
- free (g);
- }
- }
-
- free (section_groups);
- section_groups = NULL;
- }
-
- free_debug_memory ();
-
- return 0;
-}
-
-/* Process an ELF archive.
- On entry the file is positioned just after the ARMAG string. */
-
-static int
-process_archive (char *file_name, FILE *file)
-{
- struct ar_hdr arhdr;
- size_t got;
- unsigned long size;
- unsigned long index_num = 0;
- unsigned long *index_array = NULL;
- char *sym_table = NULL;
- unsigned long sym_size = 0;
- char *longnames = NULL;
- unsigned long longnames_size = 0;
- size_t file_name_size;
- int ret;
-
- show_name = 1;
-
- got = fread (&arhdr, 1, sizeof arhdr, file);
- if (got != sizeof arhdr)
- {
- if (got == 0)
- return 0;
-
- error (_("%s: failed to read archive header\n"), file_name);
- return 1;
- }
-
- /* See if this is the archive symbol table. */
- if (const_strneq (arhdr.ar_name, "/ ")
- || const_strneq (arhdr.ar_name, "/SYM64/ "))
- {
- size = strtoul (arhdr.ar_size, NULL, 10);
- size = size + (size & 1);
-
- if (do_archive_index)
- {
- unsigned long i;
- /* A buffer used to hold numbers read in from an archive index.
- These are always 4 bytes long and stored in big-endian format. */
-#define SIZEOF_AR_INDEX_NUMBERS 4
- unsigned char integer_buffer[SIZEOF_AR_INDEX_NUMBERS];
- unsigned char * index_buffer;
-
- /* Check the size of the archive index. */
- if (size < SIZEOF_AR_INDEX_NUMBERS)
- {
- error (_("%s: the archive index is empty\n"), file_name);
- return 1;
- }
-
- /* Read the numer of entries in the archive index. */
- got = fread (integer_buffer, 1, sizeof integer_buffer, file);
- if (got != sizeof (integer_buffer))
- {
- error (_("%s: failed to read archive index\n"), file_name);
- return 1;
- }
- index_num = byte_get_big_endian (integer_buffer, sizeof integer_buffer);
- size -= SIZEOF_AR_INDEX_NUMBERS;
-
- /* Read in the archive index. */
- if (size < index_num * SIZEOF_AR_INDEX_NUMBERS)
- {
- error (_("%s: the archive index is supposed to have %ld entries, but the size in the header is too small\n"),
- file_name, index_num);
- return 1;
- }
- index_buffer = malloc (index_num * SIZEOF_AR_INDEX_NUMBERS);
- if (index_buffer == NULL)
- {
- error (_("Out of memory whilst trying to read archive symbol index\n"));
- return 1;
- }
- got = fread (index_buffer, SIZEOF_AR_INDEX_NUMBERS, index_num, file);
- if (got != index_num)
- {
- free (index_buffer);
- error (_("%s: failed to read archive index\n"), file_name);
- ret = 1;
- goto out;
- }
- size -= index_num * SIZEOF_AR_INDEX_NUMBERS;
-
- /* Convert the index numbers into the host's numeric format. */
- index_array = malloc (index_num * sizeof (* index_array));
- if (index_array == NULL)
- {
- free (index_buffer);
- error (_("Out of memory whilst trying to convert the archive symbol index\n"));
- return 1;
- }
-
- for (i = 0; i < index_num; i++)
- index_array[i] = byte_get_big_endian ((unsigned char *)(index_buffer + (i * SIZEOF_AR_INDEX_NUMBERS)),
- SIZEOF_AR_INDEX_NUMBERS);
- free (index_buffer);
-
- /* The remaining space in the header is taken up by the symbol table. */
- if (size < 1)
- {
- error (_("%s: the archive has an index but no symbols\n"), file_name);
- ret = 1;
- goto out;
- }
- sym_table = malloc (size);
- sym_size = size;
- if (sym_table == NULL)
- {
- error (_("Out of memory whilst trying to read archive index symbol table\n"));
- ret = 1;
- goto out;
- }
- got = fread (sym_table, 1, size, file);
- if (got != size)
- {
- error (_("%s: failed to read archive index symbol table\n"), file_name);
- ret = 1;
- goto out;
- }
- }
- else
- {
- if (fseek (file, size, SEEK_CUR) != 0)
- {
- error (_("%s: failed to skip archive symbol table\n"), file_name);
- return 1;
- }
- }
-
- got = fread (& arhdr, 1, sizeof arhdr, file);
- if (got != sizeof arhdr)
- {
- if (got == 0)
- {
- ret = 0;
- goto out;
- }
-
- error (_("%s: failed to read archive header following archive index\n"), file_name);
- ret = 1;
- goto out;
- }
- }
- else if (do_archive_index)
- printf (_("%s has no archive index\n"), file_name);
-
- if (const_strneq (arhdr.ar_name, "// "))
- {
- /* This is the archive string table holding long member
- names. */
-
- longnames_size = strtoul (arhdr.ar_size, NULL, 10);
- longnames = malloc (longnames_size);
- if (longnames == NULL)
- {
- error (_("Out of memory reading long symbol names in archive\n"));
- ret = 1;
- goto out;
- }
-
- if (fread (longnames, longnames_size, 1, file) != 1)
- {
- free (longnames);
- error (_("%s: failed to read long symbol name string table\n"), file_name);
- ret = 1;
- goto out;
- }
-
- if ((longnames_size & 1) != 0)
- getc (file);
-
- got = fread (& arhdr, 1, sizeof arhdr, file);
- if (got != sizeof arhdr)
- {
- if (got == 0)
- ret = 0;
- else
- {
- error (_("%s: failed to read archive header following long symbol names\n"), file_name);
- ret = 1;
- }
- goto out;
- }
- }
-
- if (do_archive_index)
- {
- if (sym_table == NULL)
- error (_("%s: unable to dump the index as none was found\n"), file_name);
- else
- {
- unsigned int i, j, k, l;
- char elf_name[16];
- unsigned long current_pos;
-
- printf (_("Index of archive %s: (%ld entries, 0x%lx bytes in the symbol table)\n"),
- file_name, index_num, sym_size);
- current_pos = ftell (file);
-
- for (i = l = 0; i < index_num; i++)
- {
- if ((i == 0) || ((i > 0) && (index_array[i] != index_array[i - 1])))
- {
- if (fseek (file, index_array[i], SEEK_SET) != 0)
- {
- error (_("%s: failed to seek to next file name\n"), file_name);
- ret = 1;
- goto out;
- }
- got = fread (elf_name, 1, 16, file);
- if (got != 16)
- {
- error (_("%s: failed to read file name\n"), file_name);
- ret = 1;
- goto out;
- }
-
- if (elf_name[0] == '/')
- {
- /* We have a long name. */
- k = j = strtoul (elf_name + 1, NULL, 10);
- while ((j < longnames_size) && (longnames[j] != '/'))
- j++;
- longnames[j] = '\0';
- printf (_("Binary %s contains:\n"), longnames + k);
- longnames[j] = '/';
- }
- else
- {
- j = 0;
- while ((elf_name[j] != '/') && (j < 16))
- j++;
- elf_name[j] = '\0';
- printf(_("Binary %s contains:\n"), elf_name);
- }
- }
- if (l >= sym_size)
- {
- error (_("%s: end of the symbol table reached before the end of the index\n"),
- file_name);
- break;
- }
- printf ("\t%s\n", sym_table + l);
- l += strlen (sym_table + l) + 1;
- }
-
- if (l < sym_size)
- error (_("%s: symbols remain in the index symbol table, but without corresponding entries in the index table\n"),
- file_name);
-
- free (index_array);
- index_array = NULL;
- free (sym_table);
- sym_table = NULL;
- if (fseek (file, current_pos, SEEK_SET) != 0)
- {
- error (_("%s: failed to seek back to start of object files in the archive\n"), file_name);
- return 1;
- }
- }
-
- if (!do_dynamic && !do_syms && !do_reloc && !do_unwind && !do_sections
- && !do_segments && !do_header && !do_dump && !do_version
- && !do_histogram && !do_debugging && !do_arch && !do_notes
- && !do_section_groups)
- return 0; /* Archive index only. */
- }
-
- file_name_size = strlen (file_name);
- ret = 0;
-
- while (1)
- {
- char *name;
- char *nameend;
- char *namealc;
-
- if (arhdr.ar_name[0] == '/')
- {
- unsigned long off;
-
- off = strtoul (arhdr.ar_name + 1, NULL, 10);
- if (off >= longnames_size)
- {
- error (_("%s: invalid archive string table offset %lu\n"), file_name, off);
- ret = 1;
- break;
- }
-
- name = longnames + off;
- nameend = memchr (name, '/', longnames_size - off);
- }
- else
- {
- name = arhdr.ar_name;
- nameend = memchr (name, '/', 16);
- }
-
- if (nameend == NULL)
- {
- error (_("%s: bad archive file name\n"), file_name);
- ret = 1;
- break;
- }
-
- namealc = malloc (file_name_size + (nameend - name) + 3);
- if (namealc == NULL)
- {
- error (_("Out of memory\n"));
- ret = 1;
- break;
- }
-
- memcpy (namealc, file_name, file_name_size);
- namealc[file_name_size] = '(';
- memcpy (namealc + file_name_size + 1, name, nameend - name);
- namealc[file_name_size + 1 + (nameend - name)] = ')';
- namealc[file_name_size + 2 + (nameend - name)] = '\0';
-
- archive_file_offset = ftell (file);
- archive_file_size = strtoul (arhdr.ar_size, NULL, 10);
-
- ret |= process_object (namealc, file);
-
- free (namealc);
-
- if (fseek (file,
- (archive_file_offset
- + archive_file_size
- + (archive_file_size & 1)),
- SEEK_SET) != 0)
- {
- error (_("%s: failed to seek to next archive header\n"), file_name);
- ret = 1;
- break;
- }
-
- got = fread (&arhdr, 1, sizeof arhdr, file);
- if (got != sizeof arhdr)
- {
- if (got == 0)
- break;
-
- error (_("%s: failed to read archive header\n"), file_name);
- ret = 1;
- break;
- }
- }
-
- out:
- if (index_array != NULL)
- free (index_array);
- if (sym_table != NULL)
- free (sym_table);
- if (longnames != NULL)
- free (longnames);
-
- return ret;
-}
-
-static int
-process_file (char *file_name)
-{
- FILE *file;
- struct stat statbuf;
- char armag[SARMAG];
- int ret;
-
- if (stat (file_name, &statbuf) < 0)
- {
- if (errno == ENOENT)
- error (_("'%s': No such file\n"), file_name);
- else
- error (_("Could not locate '%s'. System error message: %s\n"),
- file_name, strerror (errno));
- return 1;
- }
-
- if (! S_ISREG (statbuf.st_mode))
- {
- error (_("'%s' is not an ordinary file\n"), file_name);
- return 1;
- }
-
- file = fopen (file_name, "rb");
- if (file == NULL)
- {
- error (_("Input file '%s' is not readable.\n"), file_name);
- return 1;
- }
-
- if (fread (armag, SARMAG, 1, file) != 1)
- {
- error (_("%s: Failed to read file's magic number\n"), file_name);
- fclose (file);
- return 1;
- }
-
- if (memcmp (armag, ARMAG, SARMAG) == 0)
- ret = process_archive (file_name, file);
- else
- {
- if (do_archive_index)
- error (_("File %s is not an archive so its index cannot be displayed.\n"),
- file_name);
-
- rewind (file);
- archive_file_size = archive_file_offset = 0;
- ret = process_object (file_name, file);
- }
-
- fclose (file);
-
- return ret;
-}
-
-#ifdef SUPPORT_DISASSEMBLY
-/* Needed by the i386 disassembler. For extra credit, someone could
- fix this so that we insert symbolic addresses here, esp for GOT/PLT
- symbols. */
-
-void
-print_address (unsigned int addr, FILE *outfile)
-{
- fprintf (outfile,"0x%8.8x", addr);
-}
-
-/* Needed by the i386 disassembler. */
-void
-db_task_printsym (unsigned int addr)
-{
- print_address (addr, stderr);
-}
-#endif
-
-int
-main (int argc, char **argv)
-{
- int err;
-
-#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
- setlocale (LC_MESSAGES, "");
-#endif
-#if defined (HAVE_SETLOCALE)
- setlocale (LC_CTYPE, "");
-#endif
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
-
- expandargv (&argc, &argv);
-
- parse_args (argc, argv);
-
- if (num_dump_sects > 0)
- {
- /* Make a copy of the dump_sects array. */
- cmdline_dump_sects = malloc (num_dump_sects * sizeof (* dump_sects));
- if (cmdline_dump_sects == NULL)
- error (_("Out of memory allocating dump request table.\n"));
- else
- {
- memcpy (cmdline_dump_sects, dump_sects,
- num_dump_sects * sizeof (* dump_sects));
- num_cmdline_dump_sects = num_dump_sects;
- }
- }
-
- if (optind < (argc - 1))
- show_name = 1;
-
- err = 0;
- while (optind < argc)
- err |= process_file (argv[optind++]);
-
- if (dump_sects != NULL)
- free (dump_sects);
- if (cmdline_dump_sects != NULL)
- free (cmdline_dump_sects);
-
- return err;
-}
diff --git a/binutils/resrc.c b/binutils/resrc.c
deleted file mode 100644
index fcd15c70f86..00000000000
--- a/binutils/resrc.c
+++ /dev/null
@@ -1,3345 +0,0 @@
-/* resrc.c -- read and write Windows rc files.
- Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008
- Free Software Foundation, Inc.
- Written by Ian Lance Taylor, Cygnus Support.
- Rewritten by Kai Tietz, Onevision.
-
- This file is part of GNU Binutils.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-/* This file contains functions that read and write Windows rc files.
- These are text files that represent resources. */
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "bucomm.h"
-#include "libiberty.h"
-#include "safe-ctype.h"
-#include "windres.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#else /* ! HAVE_SYS_WAIT_H */
-#if ! defined (_WIN32) || defined (__CYGWIN__)
-#ifndef WIFEXITED
-#define WIFEXITED(w) (((w)&0377) == 0)
-#endif
-#ifndef WIFSIGNALED
-#define WIFSIGNALED(w) (((w)&0377) != 0177 && ((w)&~0377) == 0)
-#endif
-#ifndef WTERMSIG
-#define WTERMSIG(w) ((w) & 0177)
-#endif
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(w) (((w) >> 8) & 0377)
-#endif
-#else /* defined (_WIN32) && ! defined (__CYGWIN__) */
-#ifndef WIFEXITED
-#define WIFEXITED(w) (((w) & 0xff) == 0)
-#endif
-#ifndef WIFSIGNALED
-#define WIFSIGNALED(w) (((w) & 0xff) != 0 && ((w) & 0xff) != 0x7f)
-#endif
-#ifndef WTERMSIG
-#define WTERMSIG(w) ((w) & 0x7f)
-#endif
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(w) (((w) & 0xff00) >> 8)
-#endif
-#endif /* defined (_WIN32) && ! defined (__CYGWIN__) */
-#endif /* ! HAVE_SYS_WAIT_H */
-
-#ifndef STDOUT_FILENO
-#define STDOUT_FILENO 1
-#endif
-
-#if defined (_WIN32) && ! defined (__CYGWIN__)
-#define popen _popen
-#define pclose _pclose
-#endif
-
-/* The default preprocessor. */
-
-#define DEFAULT_PREPROCESSOR "gcc -E -xc -DRC_INVOKED"
-
-/* We read the directory entries in a cursor or icon file into
- instances of this structure. */
-
-struct icondir
-{
- /* Width of image. */
- bfd_byte width;
- /* Height of image. */
- bfd_byte height;
- /* Number of colors in image. */
- bfd_byte colorcount;
- union
- {
- struct
- {
- /* Color planes. */
- unsigned short planes;
- /* Bits per pixel. */
- unsigned short bits;
- } icon;
- struct
- {
- /* X coordinate of hotspot. */
- unsigned short xhotspot;
- /* Y coordinate of hotspot. */
- unsigned short yhotspot;
- } cursor;
- } u;
- /* Bytes in image. */
- unsigned long bytes;
- /* File offset of image. */
- unsigned long offset;
-};
-
-/* The name of the rc file we are reading. */
-
-char *rc_filename;
-
-/* The line number in the rc file. */
-
-int rc_lineno;
-
-/* The pipe we are reading from, so that we can close it if we exit. */
-
-FILE *cpp_pipe;
-
-/* The temporary file used if we're not using popen, so we can delete it
- if we exit. */
-
-static char *cpp_temp_file;
-
-/* Input stream is either a file or a pipe. */
-
-static enum {ISTREAM_PIPE, ISTREAM_FILE} istream_type;
-
-/* As we read the rc file, we attach information to this structure. */
-
-static rc_res_directory *resources;
-
-/* The number of cursor resources we have written out. */
-
-static int cursors;
-
-/* The number of font resources we have written out. */
-
-static int fonts;
-
-/* Font directory information. */
-
-rc_fontdir *fontdirs;
-
-/* Resource info to use for fontdirs. */
-
-rc_res_res_info fontdirs_resinfo;
-
-/* The number of icon resources we have written out. */
-
-static int icons;
-
-/* The windres target bfd . */
-
-static windres_bfd wrtarget =
-{
- (bfd *) NULL, (asection *) NULL, WR_KIND_TARGET
-};
-
-/* Local functions for rcdata based resource definitions. */
-
-static void define_font_rcdata (rc_res_id, const rc_res_res_info *,
- rc_rcdata_item *);
-static void define_icon_rcdata (rc_res_id, const rc_res_res_info *,
- rc_rcdata_item *);
-static void define_bitmap_rcdata (rc_res_id, const rc_res_res_info *,
- rc_rcdata_item *);
-static void define_cursor_rcdata (rc_res_id, const rc_res_res_info *,
- rc_rcdata_item *);
-static void define_fontdir_rcdata (rc_res_id, const rc_res_res_info *,
- rc_rcdata_item *);
-static void define_messagetable_rcdata (rc_res_id, const rc_res_res_info *,
- rc_rcdata_item *);
-static rc_uint_type rcdata_copy (const rc_rcdata_item *, bfd_byte *);
-static bfd_byte *rcdata_render_as_buffer (const rc_rcdata_item *, rc_uint_type *);
-
-static int run_cmd (char *, const char *);
-static FILE *open_input_stream (char *);
-static FILE *look_for_default
- (char *, const char *, int, const char *, const char *);
-static void close_input_stream (void);
-static void unexpected_eof (const char *);
-static int get_word (FILE *, const char *);
-static unsigned long get_long (FILE *, const char *);
-static void get_data (FILE *, bfd_byte *, rc_uint_type, const char *);
-static void define_fontdirs (void);
-
-/* Run `cmd' and redirect the output to `redir'. */
-
-static int
-run_cmd (char *cmd, const char *redir)
-{
- char *s;
- int pid, wait_status, retcode;
- int i;
- const char **argv;
- char *errmsg_fmt, *errmsg_arg;
- char *temp_base = choose_temp_base ();
- int in_quote;
- char sep;
- int redir_handle = -1;
- int stdout_save = -1;
-
- /* Count the args. */
- i = 0;
-
- for (s = cmd; *s; s++)
- if (*s == ' ')
- i++;
-
- i++;
- argv = alloca (sizeof (char *) * (i + 3));
- i = 0;
- s = cmd;
-
- while (1)
- {
- while (*s == ' ' && *s != 0)
- s++;
-
- if (*s == 0)
- break;
-
- in_quote = (*s == '\'' || *s == '"');
- sep = (in_quote) ? *s++ : ' ';
- argv[i++] = s;
-
- while (*s != sep && *s != 0)
- s++;
-
- if (*s == 0)
- break;
-
- *s++ = 0;
-
- if (in_quote)
- s++;
- }
- argv[i++] = NULL;
-
- /* Setup the redirection. We can't use the usual fork/exec and redirect
- since we may be running on non-POSIX Windows host. */
-
- fflush (stdout);
- fflush (stderr);
-
- /* Open temporary output file. */
- redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, 0666);
- if (redir_handle == -1)
- fatal (_("can't open temporary file `%s': %s"), redir,
- strerror (errno));
-
- /* Duplicate the stdout file handle so it can be restored later. */
- stdout_save = dup (STDOUT_FILENO);
- if (stdout_save == -1)
- fatal (_("can't redirect stdout: `%s': %s"), redir, strerror (errno));
-
- /* Redirect stdout to our output file. */
- dup2 (redir_handle, STDOUT_FILENO);
-
- pid = pexecute (argv[0], (char * const *) argv, program_name, temp_base,
- &errmsg_fmt, &errmsg_arg, PEXECUTE_ONE | PEXECUTE_SEARCH);
-
- /* Restore stdout to its previous setting. */
- dup2 (stdout_save, STDOUT_FILENO);
-
- /* Close response file. */
- close (redir_handle);
-
- if (pid == -1)
- {
- fatal (_("%s %s: %s"), errmsg_fmt, errmsg_arg, strerror (errno));
- return 1;
- }
-
- retcode = 0;
- pid = pwait (pid, &wait_status, 0);
-
- if (pid == -1)
- {
- fatal (_("wait: %s"), strerror (errno));
- retcode = 1;
- }
- else if (WIFSIGNALED (wait_status))
- {
- fatal (_("subprocess got fatal signal %d"), WTERMSIG (wait_status));
- retcode = 1;
- }
- else if (WIFEXITED (wait_status))
- {
- if (WEXITSTATUS (wait_status) != 0)
- {
- fatal (_("%s exited with status %d"), cmd,
- WEXITSTATUS (wait_status));
- retcode = 1;
- }
- }
- else
- retcode = 1;
-
- return retcode;
-}
-
-static FILE *
-open_input_stream (char *cmd)
-{
- if (istream_type == ISTREAM_FILE)
- {
- char *fileprefix;
-
- fileprefix = choose_temp_base ();
- cpp_temp_file = (char *) xmalloc (strlen (fileprefix) + 5);
- sprintf (cpp_temp_file, "%s.irc", fileprefix);
- free (fileprefix);
-
- if (run_cmd (cmd, cpp_temp_file))
- fatal (_("can't execute `%s': %s"), cmd, strerror (errno));
-
- cpp_pipe = fopen (cpp_temp_file, FOPEN_RT);;
- if (cpp_pipe == NULL)
- fatal (_("can't open temporary file `%s': %s"),
- cpp_temp_file, strerror (errno));
-
- if (verbose)
- fprintf (stderr,
- _("Using temporary file `%s' to read preprocessor output\n"),
- cpp_temp_file);
- }
- else
- {
- cpp_pipe = popen (cmd, FOPEN_RT);
- if (cpp_pipe == NULL)
- fatal (_("can't popen `%s': %s"), cmd, strerror (errno));
- if (verbose)
- fprintf (stderr, _("Using popen to read preprocessor output\n"));
- }
-
- xatexit (close_input_stream);
- return cpp_pipe;
-}
-
-/* Determine if FILENAME contains special characters that
- can cause problems unless the entire filename is quoted. */
-
-static int
-filename_need_quotes (const char *filename)
-{
- if (filename == NULL || (filename[0] == '-' && filename[1] == 0))
- return 0;
-
- while (*filename != 0)
- {
- switch (*filename)
- {
- case '&':
- case ' ':
- case '<':
- case '>':
- case '|':
- case '%':
- return 1;
- }
- ++filename;
- }
- return 0;
-}
-
-/* Look for the preprocessor program. */
-
-static FILE *
-look_for_default (char *cmd, const char *prefix, int end_prefix,
- const char *preprocargs, const char *filename)
-{
- char *space;
- int found;
- struct stat s;
- const char *fnquotes = (filename_need_quotes (filename) ? "\"" : "");
-
- strcpy (cmd, prefix);
-
- sprintf (cmd + end_prefix, "%s", DEFAULT_PREPROCESSOR);
- space = strchr (cmd + end_prefix, ' ');
- if (space)
- *space = 0;
-
- if (
-#if defined (__DJGPP__) || defined (__CYGWIN__) || defined (_WIN32)
- strchr (cmd, '\\') ||
-#endif
- strchr (cmd, '/'))
- {
- found = (stat (cmd, &s) == 0
-#ifdef HAVE_EXECUTABLE_SUFFIX
- || stat (strcat (cmd, EXECUTABLE_SUFFIX), &s) == 0
-#endif
- );
-
- if (! found)
- {
- if (verbose)
- fprintf (stderr, _("Tried `%s'\n"), cmd);
- return NULL;
- }
- }
-
- strcpy (cmd, prefix);
-
- sprintf (cmd + end_prefix, "%s %s %s%s%s",
- DEFAULT_PREPROCESSOR, preprocargs, fnquotes, filename, fnquotes);
-
- if (verbose)
- fprintf (stderr, _("Using `%s'\n"), cmd);
-
- cpp_pipe = open_input_stream (cmd);
- return cpp_pipe;
-}
-
-/* Read an rc file. */
-
-rc_res_directory *
-read_rc_file (const char *filename, const char *preprocessor,
- const char *preprocargs, int language, int use_temp_file)
-{
- char *cmd;
- const char *fnquotes = (filename_need_quotes (filename) ? "\"" : "");
-
- if (filename == NULL)
- filename = "-";
- /* Setup the default resource import path taken from input file. */
- else if (strchr (filename, '/') != NULL || strchr (filename, '\\') != NULL)
- {
- char *edit, *dir;
-
- if (filename[0] == '/'
- || filename[0] == '\\'
- || filename[1] == ':')
- /* Absolute path. */
- edit = dir = xstrdup (filename);
- else
- {
- /* Relative path. */
- edit = dir = xmalloc (strlen (filename) + 3);
- sprintf (dir, "./%s", filename);
- }
-
- /* Walk dir backwards stopping at the first directory separator. */
- edit += strlen (dir);
- while (edit > dir && (edit[-1] != '\\' && edit[-1] != '/'))
- {
- --edit;
- edit[0] = 0;
- }
-
- /* Cut off trailing slash. */
- --edit;
- edit[0] = 0;
-
- /* Convert all back slashes to forward slashes. */
- while ((edit = strchr (dir, '\\')) != NULL)
- *edit = '/';
-
- windres_add_include_dir (dir);
- }
-
- istream_type = (use_temp_file) ? ISTREAM_FILE : ISTREAM_PIPE;
-
- if (preprocargs == NULL)
- preprocargs = "";
-
- if (preprocessor)
- {
- cmd = xmalloc (strlen (preprocessor)
- + strlen (preprocargs)
- + strlen (filename)
- + strlen (fnquotes) * 2
- + 10);
- sprintf (cmd, "%s %s %s%s%s", preprocessor, preprocargs,
- fnquotes, filename, fnquotes);
-
- cpp_pipe = open_input_stream (cmd);
- }
- else
- {
- char *dash, *slash, *cp;
-
- preprocessor = DEFAULT_PREPROCESSOR;
-
- cmd = xmalloc (strlen (program_name)
- + strlen (preprocessor)
- + strlen (preprocargs)
- + strlen (filename)
- + strlen (fnquotes) * 2
-#ifdef HAVE_EXECUTABLE_SUFFIX
- + strlen (EXECUTABLE_SUFFIX)
-#endif
- + 10);
-
-
- dash = slash = 0;
- for (cp = program_name; *cp; cp++)
- {
- if (*cp == '-')
- dash = cp;
- if (
-#if defined (__DJGPP__) || defined (__CYGWIN__) || defined(_WIN32)
- *cp == ':' || *cp == '\\' ||
-#endif
- *cp == '/')
- {
- slash = cp;
- dash = 0;
- }
- }
-
- cpp_pipe = 0;
-
- if (dash)
- {
- /* First, try looking for a prefixed gcc in the windres
- directory, with the same prefix as windres */
-
- cpp_pipe = look_for_default (cmd, program_name, dash - program_name + 1,
- preprocargs, filename);
- }
-
- if (slash && ! cpp_pipe)
- {
- /* Next, try looking for a gcc in the same directory as
- that windres */
-
- cpp_pipe = look_for_default (cmd, program_name, slash - program_name + 1,
- preprocargs, filename);
- }
-
- if (! cpp_pipe)
- {
- /* Sigh, try the default */
-
- cpp_pipe = look_for_default (cmd, "", 0, preprocargs, filename);
- }
-
- }
-
- free (cmd);
-
- rc_filename = xstrdup (filename);
- rc_lineno = 1;
- if (language != -1)
- rcparse_set_language (language);
- yyparse ();
- rcparse_discard_strings ();
-
- close_input_stream ();
-
- if (fontdirs != NULL)
- define_fontdirs ();
-
- free (rc_filename);
- rc_filename = NULL;
-
- return resources;
-}
-
-/* Close the input stream if it is open. */
-
-static void
-close_input_stream (void)
-{
- if (istream_type == ISTREAM_FILE)
- {
- if (cpp_pipe != NULL)
- fclose (cpp_pipe);
-
- if (cpp_temp_file != NULL)
- {
- int errno_save = errno;
-
- unlink (cpp_temp_file);
- errno = errno_save;
- free (cpp_temp_file);
- }
- }
- else
- {
- if (cpp_pipe != NULL)
- {
- int err;
- err = pclose (cpp_pipe);
- /* We are reading from a pipe, therefore we don't
- know if cpp failed or succeeded until pclose. */
- if (err != 0 || errno == ECHILD)
- {
- /* Since this is also run via xatexit, safeguard. */
- cpp_pipe = NULL;
- cpp_temp_file = NULL;
- fatal (_("preprocessing failed."));
- }
- }
- }
-
- /* Since this is also run via xatexit, safeguard. */
- cpp_pipe = NULL;
- cpp_temp_file = NULL;
-}
-
-/* Report an error while reading an rc file. */
-
-void
-yyerror (const char *msg)
-{
- fatal ("%s:%d: %s", rc_filename, rc_lineno, msg);
-}
-
-/* Issue a warning while reading an rc file. */
-
-void
-rcparse_warning (const char *msg)
-{
- fprintf (stderr, _("%s:%d: %s\n"), rc_filename, rc_lineno, msg);
-}
-
-/* Die if we get an unexpected end of file. */
-
-static void
-unexpected_eof (const char *msg)
-{
- fatal (_("%s: unexpected EOF"), msg);
-}
-
-/* Read a 16 bit word from a file. The data is assumed to be little
- endian. */
-
-static int
-get_word (FILE *e, const char *msg)
-{
- int b1, b2;
-
- b1 = getc (e);
- b2 = getc (e);
- if (feof (e))
- unexpected_eof (msg);
- return ((b2 & 0xff) << 8) | (b1 & 0xff);
-}
-
-/* Read a 32 bit word from a file. The data is assumed to be little
- endian. */
-
-static unsigned long
-get_long (FILE *e, const char *msg)
-{
- int b1, b2, b3, b4;
-
- b1 = getc (e);
- b2 = getc (e);
- b3 = getc (e);
- b4 = getc (e);
- if (feof (e))
- unexpected_eof (msg);
- return (((((((b4 & 0xff) << 8)
- | (b3 & 0xff)) << 8)
- | (b2 & 0xff)) << 8)
- | (b1 & 0xff));
-}
-
-/* Read data from a file. This is a wrapper to do error checking. */
-
-static void
-get_data (FILE *e, bfd_byte *p, rc_uint_type c, const char *msg)
-{
- rc_uint_type got; // $$$d
-
- got = (rc_uint_type) fread (p, 1, c, e);
- if (got == c)
- return;
-
- fatal (_("%s: read of %lu returned %lu"),
- msg, (unsigned long) c, (unsigned long) got);
-}
-
-/* Define an accelerator resource. */
-
-void
-define_accelerator (rc_res_id id, const rc_res_res_info *resinfo,
- rc_accelerator *data)
-{
- rc_res_resource *r;
-
- r = define_standard_resource (&resources, RT_ACCELERATOR, id,
- resinfo->language, 0);
- r->type = RES_TYPE_ACCELERATOR;
- r->u.acc = data;
- r->res_info = *resinfo;
-}
-
-/* Define a bitmap resource. Bitmap data is stored in a file. The
- first 14 bytes of the file are a standard header, which is not
- included in the resource data. */
-
-#define BITMAP_SKIP (14)
-
-void
-define_bitmap (rc_res_id id, const rc_res_res_info *resinfo,
- const char *filename)
-{
- FILE *e;
- char *real_filename;
- struct stat s;
- bfd_byte *data;
- rc_uint_type i;
- rc_res_resource *r;
-
- e = open_file_search (filename, FOPEN_RB, "bitmap file", &real_filename);
-
- if (stat (real_filename, &s) < 0)
- fatal (_("stat failed on bitmap file `%s': %s"), real_filename,
- strerror (errno));
-
- data = (bfd_byte *) res_alloc (s.st_size - BITMAP_SKIP);
-
- for (i = 0; i < BITMAP_SKIP; i++)
- getc (e);
-
- get_data (e, data, s.st_size - BITMAP_SKIP, real_filename);
-
- fclose (e);
- free (real_filename);
-
- r = define_standard_resource (&resources, RT_BITMAP, id,
- resinfo->language, 0);
-
- r->type = RES_TYPE_BITMAP;
- r->u.data.length = s.st_size - BITMAP_SKIP;
- r->u.data.data = data;
- r->res_info = *resinfo;
-}
-
-/* Define a cursor resource. A cursor file may contain a set of
- bitmaps, each representing the same cursor at various different
- resolutions. They each get written out with a different ID. The
- real cursor resource is then a group resource which can be used to
- select one of the actual cursors. */
-
-void
-define_cursor (rc_res_id id, const rc_res_res_info *resinfo,
- const char *filename)
-{
- FILE *e;
- char *real_filename;
- int type, count, i;
- struct icondir *icondirs;
- int first_cursor;
- rc_res_resource *r;
- rc_group_cursor *first, **pp;
-
- e = open_file_search (filename, FOPEN_RB, "cursor file", &real_filename);
-
- /* A cursor file is basically an icon file. The start of the file
- is a three word structure. The first word is ignored. The
- second word is the type of data. The third word is the number of
- entries. */
-
- get_word (e, real_filename);
- type = get_word (e, real_filename);
- count = get_word (e, real_filename);
- if (type != 2)
- fatal (_("cursor file `%s' does not contain cursor data"), real_filename);
-
- /* Read in the icon directory entries. */
-
- icondirs = (struct icondir *) xmalloc (count * sizeof *icondirs);
-
- for (i = 0; i < count; i++)
- {
- icondirs[i].width = getc (e);
- icondirs[i].height = getc (e);
- icondirs[i].colorcount = getc (e);
- getc (e);
- icondirs[i].u.cursor.xhotspot = get_word (e, real_filename);
- icondirs[i].u.cursor.yhotspot = get_word (e, real_filename);
- icondirs[i].bytes = get_long (e, real_filename);
- icondirs[i].offset = get_long (e, real_filename);
-
- if (feof (e))
- unexpected_eof (real_filename);
- }
-
- /* Define each cursor as a unique resource. */
-
- first_cursor = cursors;
-
- for (i = 0; i < count; i++)
- {
- bfd_byte *data;
- rc_res_id name;
- rc_cursor *c;
-
- if (fseek (e, icondirs[i].offset, SEEK_SET) != 0)
- fatal (_("%s: fseek to %lu failed: %s"), real_filename,
- icondirs[i].offset, strerror (errno));
-
- data = (bfd_byte *) res_alloc (icondirs[i].bytes);
-
- get_data (e, data, icondirs[i].bytes, real_filename);
-
- c = (rc_cursor *) res_alloc (sizeof (rc_cursor));
- c->xhotspot = icondirs[i].u.cursor.xhotspot;
- c->yhotspot = icondirs[i].u.cursor.yhotspot;
- c->length = icondirs[i].bytes;
- c->data = data;
-
- ++cursors;
-
- name.named = 0;
- name.u.id = cursors;
-
- r = define_standard_resource (&resources, RT_CURSOR, name,
- resinfo->language, 0);
- r->type = RES_TYPE_CURSOR;
- r->u.cursor = c;
- r->res_info = *resinfo;
- }
-
- fclose (e);
- free (real_filename);
-
- /* Define a cursor group resource. */
-
- first = NULL;
- pp = &first;
- for (i = 0; i < count; i++)
- {
- rc_group_cursor *cg;
-
- cg = (rc_group_cursor *) res_alloc (sizeof (rc_group_cursor));
- cg->next = NULL;
- cg->width = icondirs[i].width;
- cg->height = 2 * icondirs[i].height;
-
- /* FIXME: What should these be set to? */
- cg->planes = 1;
- cg->bits = 1;
-
- cg->bytes = icondirs[i].bytes + 4;
- cg->index = first_cursor + i + 1;
-
- *pp = cg;
- pp = &(*pp)->next;
- }
-
- free (icondirs);
-
- r = define_standard_resource (&resources, RT_GROUP_CURSOR, id,
- resinfo->language, 0);
- r->type = RES_TYPE_GROUP_CURSOR;
- r->u.group_cursor = first;
- r->res_info = *resinfo;
-}
-
-/* Define a dialog resource. */
-
-void
-define_dialog (rc_res_id id, const rc_res_res_info *resinfo,
- const rc_dialog *dialog)
-{
- rc_dialog *copy;
- rc_res_resource *r;
-
- copy = (rc_dialog *) res_alloc (sizeof *copy);
- *copy = *dialog;
-
- r = define_standard_resource (&resources, RT_DIALOG, id,
- resinfo->language, 0);
- r->type = RES_TYPE_DIALOG;
- r->u.dialog = copy;
- r->res_info = *resinfo;
-}
-
-/* Define a dialog control. This does not define a resource, but
- merely allocates and fills in a structure. */
-
-rc_dialog_control *
-define_control (const rc_res_id iid, rc_uint_type id, rc_uint_type x,
- rc_uint_type y, rc_uint_type width, rc_uint_type height,
- const rc_res_id class, rc_uint_type style,
- rc_uint_type exstyle)
-{
- rc_dialog_control *n;
-
- n = (rc_dialog_control *) res_alloc (sizeof (rc_dialog_control));
- n->next = NULL;
- n->id = id;
- n->style = style;
- n->exstyle = exstyle;
- n->x = x;
- n->y = y;
- n->width = width;
- n->height = height;
- n->class = class;
- n->text = iid;
- n->data = NULL;
- n->help = 0;
-
- return n;
-}
-
-rc_dialog_control *
-define_icon_control (rc_res_id iid, rc_uint_type id, rc_uint_type x,
- rc_uint_type y, rc_uint_type style,
- rc_uint_type exstyle, rc_uint_type help,
- rc_rcdata_item *data, rc_dialog_ex *ex)
-{
- rc_dialog_control *n;
- rc_res_id tid;
- rc_res_id cid;
-
- if (style == 0)
- style = SS_ICON | WS_CHILD | WS_VISIBLE;
- res_string_to_id (&tid, "");
- cid.named = 0;
- cid.u.id = CTL_STATIC;
- n = define_control (tid, id, x, y, 0, 0, cid, style, exstyle);
- n->text = iid;
- if (help && ! ex)
- rcparse_warning (_("help ID requires DIALOGEX"));
- if (data && ! ex)
- rcparse_warning (_("control data requires DIALOGEX"));
- n->help = help;
- n->data = data;
-
- return n;
-}
-
-/* Define a font resource. */
-
-void
-define_font (rc_res_id id, const rc_res_res_info *resinfo,
- const char *filename)
-{
- FILE *e;
- char *real_filename;
- struct stat s;
- bfd_byte *data;
- rc_res_resource *r;
- long offset;
- long fontdatalength;
- bfd_byte *fontdata;
- rc_fontdir *fd;
- const char *device, *face;
- rc_fontdir **pp;
-
- e = open_file_search (filename, FOPEN_RB, "font file", &real_filename);
-
- if (stat (real_filename, &s) < 0)
- fatal (_("stat failed on font file `%s': %s"), real_filename,
- strerror (errno));
-
- data = (bfd_byte *) res_alloc (s.st_size);
-
- get_data (e, data, s.st_size, real_filename);
-
- fclose (e);
- free (real_filename);
-
- r = define_standard_resource (&resources, RT_FONT, id,
- resinfo->language, 0);
-
- r->type = RES_TYPE_FONT;
- r->u.data.length = s.st_size;
- r->u.data.data = data;
- r->res_info = *resinfo;
-
- /* For each font resource, we must add an entry in the FONTDIR
- resource. The FONTDIR resource includes some strings in the font
- file. To find them, we have to do some magic on the data we have
- read. */
-
- offset = ((((((data[47] << 8)
- | data[46]) << 8)
- | data[45]) << 8)
- | data[44]);
- if (offset > 0 && offset < s.st_size)
- device = (char *) data + offset;
- else
- device = "";
-
- offset = ((((((data[51] << 8)
- | data[50]) << 8)
- | data[49]) << 8)
- | data[48]);
- if (offset > 0 && offset < s.st_size)
- face = (char *) data + offset;
- else
- face = "";
-
- ++fonts;
-
- fontdatalength = 58 + strlen (device) + strlen (face);
- fontdata = (bfd_byte *) res_alloc (fontdatalength);
- memcpy (fontdata, data, 56);
- strcpy ((char *) fontdata + 56, device);
- strcpy ((char *) fontdata + 57 + strlen (device), face);
-
- fd = (rc_fontdir *) res_alloc (sizeof (rc_fontdir));
- fd->next = NULL;
- fd->index = fonts;
- fd->length = fontdatalength;
- fd->data = fontdata;
-
- for (pp = &fontdirs; *pp != NULL; pp = &(*pp)->next)
- ;
- *pp = fd;
-
- /* For the single fontdirs resource, we always use the resource
- information of the last font. I don't know what else to do. */
- fontdirs_resinfo = *resinfo;
-}
-
-static void
-define_font_rcdata (rc_res_id id,const rc_res_res_info *resinfo,
- rc_rcdata_item *data)
-{
- rc_res_resource *r;
- rc_uint_type len_data;
- bfd_byte *pb_data;
-
- r = define_standard_resource (&resources, RT_FONT, id,
- resinfo->language, 0);
-
- pb_data = rcdata_render_as_buffer (data, &len_data);
-
- r->type = RES_TYPE_FONT;
- r->u.data.length = len_data;
- r->u.data.data = pb_data;
- r->res_info = *resinfo;
-}
-
-/* Define the fontdirs resource. This is called after the entire rc
- file has been parsed, if any font resources were seen. */
-
-static void
-define_fontdirs (void)
-{
- rc_res_resource *r;
- rc_res_id id;
-
- id.named = 0;
- id.u.id = 1;
-
- r = define_standard_resource (&resources, RT_FONTDIR, id, 0x409, 0);
-
- r->type = RES_TYPE_FONTDIR;
- r->u.fontdir = fontdirs;
- r->res_info = fontdirs_resinfo;
-}
-
-static bfd_byte *
-rcdata_render_as_buffer (const rc_rcdata_item *data, rc_uint_type *plen)
-{
- const rc_rcdata_item *d;
- bfd_byte *ret = NULL, *pret;
- rc_uint_type len = 0;
-
- for (d = data; d != NULL; d = d->next)
- len += rcdata_copy (d, NULL);
- if (len != 0)
- {
- ret = pret = (bfd_byte *) res_alloc (len);
- for (d = data; d != NULL; d = d->next)
- pret += rcdata_copy (d, pret);
- }
- if (plen)
- *plen = len;
- return ret;
-}
-
-static void
-define_fontdir_rcdata (rc_res_id id,const rc_res_res_info *resinfo,
- rc_rcdata_item *data)
-{
- rc_res_resource *r;
- rc_fontdir *fd, *fd_first, *fd_cur;
- rc_uint_type len_data;
- bfd_byte *pb_data;
- rc_uint_type c;
-
- fd_cur = fd_first = NULL;
- r = define_standard_resource (&resources, RT_FONTDIR, id, 0x409, 0);
-
- pb_data = rcdata_render_as_buffer (data, &len_data);
-
- if (pb_data)
- {
- rc_uint_type off = 2;
- c = windres_get_16 (&wrtarget, pb_data, len_data);
- for (; c > 0; c--)
- {
- size_t len;
- rc_uint_type safe_pos = off;
- const struct bin_fontdir_item *bfi;
-
- bfi = (const struct bin_fontdir_item *) pb_data + off;
- fd = (rc_fontdir *) res_alloc (sizeof (rc_fontdir));
- fd->index = windres_get_16 (&wrtarget, bfi->index, len_data - off);
- fd->data = pb_data + off;
- off += 56;
- len = strlen ((char *) bfi->device_name) + 1;
- off += (rc_uint_type) len;
- off += (rc_uint_type) strlen ((char *) bfi->device_name + len) + 1;
- fd->length = (off - safe_pos);
- fd->next = NULL;
- if (fd_first == NULL)
- fd_first = fd;
- else
- fd_cur->next = fd;
- fd_cur = fd;
- }
- }
- r->type = RES_TYPE_FONTDIR;
- r->u.fontdir = fd_first;
- r->res_info = *resinfo;
-}
-
-static void define_messagetable_rcdata (rc_res_id id, const rc_res_res_info *resinfo,
- rc_rcdata_item *data)
-{
- rc_res_resource *r;
- rc_uint_type len_data;
- bfd_byte *pb_data;
-
- r = define_standard_resource (&resources, RT_MESSAGETABLE, id, resinfo->language, 0);
-
- pb_data = rcdata_render_as_buffer (data, &len_data);
- r->type = RES_TYPE_MESSAGETABLE;
- r->u.data.length = len_data;
- r->u.data.data = pb_data;
- r->res_info = *resinfo;
-}
-
-/* Define an icon resource. An icon file may contain a set of
- bitmaps, each representing the same icon at various different
- resolutions. They each get written out with a different ID. The
- real icon resource is then a group resource which can be used to
- select one of the actual icon bitmaps. */
-
-void
-define_icon (rc_res_id id, const rc_res_res_info *resinfo,
- const char *filename)
-{
- FILE *e;
- char *real_filename;
- int type, count, i;
- struct icondir *icondirs;
- int first_icon;
- rc_res_resource *r;
- rc_group_icon *first, **pp;
-
- e = open_file_search (filename, FOPEN_RB, "icon file", &real_filename);
-
- /* The start of an icon file is a three word structure. The first
- word is ignored. The second word is the type of data. The third
- word is the number of entries. */
-
- get_word (e, real_filename);
- type = get_word (e, real_filename);
- count = get_word (e, real_filename);
- if (type != 1)
- fatal (_("icon file `%s' does not contain icon data"), real_filename);
-
- /* Read in the icon directory entries. */
-
- icondirs = (struct icondir *) xmalloc (count * sizeof *icondirs);
-
- for (i = 0; i < count; i++)
- {
- icondirs[i].width = getc (e);
- icondirs[i].height = getc (e);
- icondirs[i].colorcount = getc (e);
- getc (e);
- icondirs[i].u.icon.planes = get_word (e, real_filename);
- icondirs[i].u.icon.bits = get_word (e, real_filename);
- icondirs[i].bytes = get_long (e, real_filename);
- icondirs[i].offset = get_long (e, real_filename);
-
- if (feof (e))
- unexpected_eof (real_filename);
- }
-
- /* Define each icon as a unique resource. */
-
- first_icon = icons;
-
- for (i = 0; i < count; i++)
- {
- bfd_byte *data;
- rc_res_id name;
-
- if (fseek (e, icondirs[i].offset, SEEK_SET) != 0)
- fatal (_("%s: fseek to %lu failed: %s"), real_filename,
- icondirs[i].offset, strerror (errno));
-
- data = (bfd_byte *) res_alloc (icondirs[i].bytes);
-
- get_data (e, data, icondirs[i].bytes, real_filename);
-
- ++icons;
-
- name.named = 0;
- name.u.id = icons;
-
- r = define_standard_resource (&resources, RT_ICON, name,
- resinfo->language, 0);
- r->type = RES_TYPE_ICON;
- r->u.data.length = icondirs[i].bytes;
- r->u.data.data = data;
- r->res_info = *resinfo;
- }
-
- fclose (e);
- free (real_filename);
-
- /* Define an icon group resource. */
-
- first = NULL;
- pp = &first;
- for (i = 0; i < count; i++)
- {
- rc_group_icon *cg;
-
- /* For some reason, at least in some files the planes and bits
- are zero. We instead set them from the color. This is
- copied from rcl. */
-
- cg = (rc_group_icon *) res_alloc (sizeof (rc_group_icon));
- cg->next = NULL;
- cg->width = icondirs[i].width;
- cg->height = icondirs[i].height;
- cg->colors = icondirs[i].colorcount;
-
- if (icondirs[i].u.icon.planes)
- cg->planes = icondirs[i].u.icon.planes;
- else
- cg->planes = 1;
-
- if (icondirs[i].u.icon.bits)
- cg->bits = icondirs[i].u.icon.bits;
- else
- {
- cg->bits = 0;
-
- while ((1L << cg->bits) < cg->colors)
- ++cg->bits;
- }
-
- cg->bytes = icondirs[i].bytes;
- cg->index = first_icon + i + 1;
-
- *pp = cg;
- pp = &(*pp)->next;
- }
-
- free (icondirs);
-
- r = define_standard_resource (&resources, RT_GROUP_ICON, id,
- resinfo->language, 0);
- r->type = RES_TYPE_GROUP_ICON;
- r->u.group_icon = first;
- r->res_info = *resinfo;
-}
-
-static void
-define_group_icon_rcdata (rc_res_id id, const rc_res_res_info *resinfo,
- rc_rcdata_item *data)
-{
- rc_res_resource *r;
- rc_group_icon *cg, *first, *cur;
- rc_uint_type len_data;
- bfd_byte *pb_data;
-
- pb_data = rcdata_render_as_buffer (data, &len_data);
-
- cur = NULL;
- first = NULL;
-
- while (len_data >= 6)
- {
- int c, i;
- unsigned short type;
- type = windres_get_16 (&wrtarget, pb_data + 2, len_data - 2);
- if (type != 1)
- fatal (_("unexpected group icon type %d"), type);
- c = windres_get_16 (&wrtarget, pb_data + 4, len_data - 4);
- len_data -= 6;
- pb_data += 6;
-
- for (i = 0; i < c; i++)
- {
- if (len_data < 14)
- fatal ("too small group icon rcdata");
- cg = (rc_group_icon *) res_alloc (sizeof (rc_group_icon));
- cg->next = NULL;
- cg->width = pb_data[0];
- cg->height = pb_data[1];
- cg->colors = pb_data[2];
- cg->planes = windres_get_16 (&wrtarget, pb_data + 4, len_data - 4);
- cg->bits = windres_get_16 (&wrtarget, pb_data + 6, len_data - 6);
- cg->bytes = windres_get_32 (&wrtarget, pb_data + 8, len_data - 8);
- cg->index = windres_get_16 (&wrtarget, pb_data + 12, len_data - 12);
- if (! first)
- first = cg;
- else
- cur->next = cg;
- cur = cg;
- pb_data += 14;
- len_data -= 14;
- }
- }
- r = define_standard_resource (&resources, RT_GROUP_ICON, id,
- resinfo->language, 0);
- r->type = RES_TYPE_GROUP_ICON;
- r->u.group_icon = first;
- r->res_info = *resinfo;
-}
-
-static void
-define_group_cursor_rcdata (rc_res_id id, const rc_res_res_info *resinfo,
- rc_rcdata_item *data)
-{
- rc_res_resource *r;
- rc_group_cursor *cg, *first, *cur;
- rc_uint_type len_data;
- bfd_byte *pb_data;
-
- pb_data = rcdata_render_as_buffer (data, &len_data);
-
- first = cur = NULL;
-
- while (len_data >= 6)
- {
- int c, i;
- unsigned short type;
- type = windres_get_16 (&wrtarget, pb_data + 2, len_data - 2);
- if (type != 2)
- fatal (_("unexpected group cursor type %d"), type);
- c = windres_get_16 (&wrtarget, pb_data + 4, len_data - 4);
- len_data -= 6;
- pb_data += 6;
-
- for (i = 0; i < c; i++)
- {
- if (len_data < 14)
- fatal ("too small group icon rcdata");
- cg = (rc_group_cursor *) res_alloc (sizeof (rc_group_cursor));
- cg->next = NULL;
- cg->width = windres_get_16 (&wrtarget, pb_data, len_data);
- cg->height = windres_get_16 (&wrtarget, pb_data + 2, len_data - 2);
- cg->planes = windres_get_16 (&wrtarget, pb_data + 4, len_data - 4);
- cg->bits = windres_get_16 (&wrtarget, pb_data + 6, len_data - 6);
- cg->bytes = windres_get_32 (&wrtarget, pb_data + 8, len_data - 8);
- cg->index = windres_get_16 (&wrtarget, pb_data + 12, len_data - 12);
- if (! first)
- first = cg;
- else
- cur->next = cg;
- cur = cg;
- pb_data += 14;
- len_data -= 14;
- }
- }
-
- r = define_standard_resource (&resources, RT_GROUP_ICON, id,
- resinfo->language, 0);
- r->type = RES_TYPE_GROUP_CURSOR;
- r->u.group_cursor = first;
- r->res_info = *resinfo;
-}
-
-static void
-define_cursor_rcdata (rc_res_id id, const rc_res_res_info *resinfo,
- rc_rcdata_item *data)
-{
- rc_cursor *c;
- rc_res_resource *r;
- rc_uint_type len_data;
- bfd_byte *pb_data;
-
- pb_data = rcdata_render_as_buffer (data, &len_data);
-
- c = (rc_cursor *) res_alloc (sizeof (rc_cursor));
- c->xhotspot = windres_get_16 (&wrtarget, pb_data, len_data);
- c->yhotspot = windres_get_16 (&wrtarget, pb_data + 2, len_data - 2);
- c->length = len_data - BIN_CURSOR_SIZE;
- c->data = (const bfd_byte *) (data + BIN_CURSOR_SIZE);
-
- r = define_standard_resource (&resources, RT_CURSOR, id, resinfo->language, 0);
- r->type = RES_TYPE_CURSOR;
- r->u.cursor = c;
- r->res_info = *resinfo;
-}
-
-static void
-define_bitmap_rcdata (rc_res_id id, const rc_res_res_info *resinfo,
- rc_rcdata_item *data)
-{
- rc_res_resource *r;
- rc_uint_type len_data;
- bfd_byte *pb_data;
-
- pb_data = rcdata_render_as_buffer (data, &len_data);
-
- r = define_standard_resource (&resources, RT_BITMAP, id, resinfo->language, 0);
- r->type = RES_TYPE_BITMAP;
- r->u.data.length = len_data;
- r->u.data.data = pb_data;
- r->res_info = *resinfo;
-}
-
-static void
-define_icon_rcdata (rc_res_id id, const rc_res_res_info *resinfo,
- rc_rcdata_item *data)
-{
- rc_res_resource *r;
- rc_uint_type len_data;
- bfd_byte *pb_data;
-
- pb_data = rcdata_render_as_buffer (data, &len_data);
-
- r = define_standard_resource (&resources, RT_ICON, id, resinfo->language, 0);
- r->type = RES_TYPE_ICON;
- r->u.data.length = len_data;
- r->u.data.data = pb_data;
- r->res_info = *resinfo;
-}
-
-/* Define a menu resource. */
-
-void
-define_menu (rc_res_id id, const rc_res_res_info *resinfo,
- rc_menuitem *menuitems)
-{
- rc_menu *m;
- rc_res_resource *r;
-
- m = (rc_menu *) res_alloc (sizeof (rc_menu));
- m->items = menuitems;
- m->help = 0;
-
- r = define_standard_resource (&resources, RT_MENU, id, resinfo->language, 0);
- r->type = RES_TYPE_MENU;
- r->u.menu = m;
- r->res_info = *resinfo;
-}
-
-/* Define a menu item. This does not define a resource, but merely
- allocates and fills in a structure. */
-
-rc_menuitem *
-define_menuitem (const unichar *text, rc_uint_type menuid, rc_uint_type type,
- rc_uint_type state, rc_uint_type help,
- rc_menuitem *menuitems)
-{
- rc_menuitem *mi;
-
- mi = (rc_menuitem *) res_alloc (sizeof (rc_menuitem));
- mi->next = NULL;
- mi->type = type;
- mi->state = state;
- mi->id = menuid;
- mi->text = unichar_dup (text);
- mi->help = help;
- mi->popup = menuitems;
- return mi;
-}
-
-/* Define a messagetable resource. */
-
-void
-define_messagetable (rc_res_id id, const rc_res_res_info *resinfo,
- const char *filename)
-{
- FILE *e;
- char *real_filename;
- struct stat s;
- bfd_byte *data;
- rc_res_resource *r;
-
- e = open_file_search (filename, FOPEN_RB, "messagetable file",
- &real_filename);
-
- if (stat (real_filename, &s) < 0)
- fatal (_("stat failed on bitmap file `%s': %s"), real_filename,
- strerror (errno));
-
- data = (bfd_byte *) res_alloc (s.st_size);
-
- get_data (e, data, s.st_size, real_filename);
-
- fclose (e);
- free (real_filename);
-
- r = define_standard_resource (&resources, RT_MESSAGETABLE, id,
- resinfo->language, 0);
-
- r->type = RES_TYPE_MESSAGETABLE;
- r->u.data.length = s.st_size;
- r->u.data.data = data;
- r->res_info = *resinfo;
-}
-
-/* Define an rcdata resource. */
-
-void
-define_rcdata (rc_res_id id, const rc_res_res_info *resinfo,
- rc_rcdata_item *data)
-{
- rc_res_resource *r;
-
- r = define_standard_resource (&resources, RT_RCDATA, id,
- resinfo->language, 0);
- r->type = RES_TYPE_RCDATA;
- r->u.rcdata = data;
- r->res_info = *resinfo;
-}
-
-/* Create an rcdata item holding a string. */
-
-rc_rcdata_item *
-define_rcdata_string (const char *string, rc_uint_type len)
-{
- rc_rcdata_item *ri;
- char *s;
-
- ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item));
- ri->next = NULL;
- ri->type = RCDATA_STRING;
- ri->u.string.length = len;
- s = (char *) res_alloc (len);
- memcpy (s, string, len);
- ri->u.string.s = s;
-
- return ri;
-}
-
-/* Create an rcdata item holding a unicode string. */
-
-rc_rcdata_item *
-define_rcdata_unistring (const unichar *string, rc_uint_type len)
-{
- rc_rcdata_item *ri;
- unichar *s;
-
- ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item));
- ri->next = NULL;
- ri->type = RCDATA_WSTRING;
- ri->u.wstring.length = len;
- s = (unichar *) res_alloc (len * sizeof (unichar));
- memcpy (s, string, len * sizeof (unichar));
- ri->u.wstring.w = s;
-
- return ri;
-}
-
-/* Create an rcdata item holding a number. */
-
-rc_rcdata_item *
-define_rcdata_number (rc_uint_type val, int dword)
-{
- rc_rcdata_item *ri;
-
- ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item));
- ri->next = NULL;
- ri->type = dword ? RCDATA_DWORD : RCDATA_WORD;
- ri->u.word = val;
-
- return ri;
-}
-
-/* Define a stringtable resource. This is called for each string
- which appears in a STRINGTABLE statement. */
-
-void
-define_stringtable (const rc_res_res_info *resinfo,
- rc_uint_type stringid, const unichar *string)
-{
- rc_res_id id;
- rc_res_resource *r;
-
- id.named = 0;
- id.u.id = (stringid >> 4) + 1;
- r = define_standard_resource (&resources, RT_STRING, id,
- resinfo->language, 1);
-
- if (r->type == RES_TYPE_UNINITIALIZED)
- {
- int i;
-
- r->type = RES_TYPE_STRINGTABLE;
- r->u.stringtable = ((rc_stringtable *)
- res_alloc (sizeof (rc_stringtable)));
- for (i = 0; i < 16; i++)
- {
- r->u.stringtable->strings[i].length = 0;
- r->u.stringtable->strings[i].string = NULL;
- }
-
- r->res_info = *resinfo;
- }
-
- r->u.stringtable->strings[stringid & 0xf].length = unichar_len (string);
- r->u.stringtable->strings[stringid & 0xf].string = unichar_dup (string);
-}
-
-void
-define_toolbar (rc_res_id id, rc_res_res_info *resinfo, rc_uint_type width, rc_uint_type height,
- rc_toolbar_item *items)
-{
- rc_toolbar *t;
- rc_res_resource *r;
-
- t = (rc_toolbar *) res_alloc (sizeof (rc_toolbar));
- t->button_width = width;
- t->button_height = height;
- t->nitems = 0;
- t->items = items;
- while (items != NULL)
- {
- t->nitems+=1;
- items = items->next;
- }
- r = define_standard_resource (&resources, RT_TOOLBAR, id, resinfo->language, 0);
- r->type = RES_TYPE_TOOLBAR;
- r->u.toolbar = t;
- r->res_info = *resinfo;
-}
-
-/* Define a user data resource where the data is in the rc file. */
-
-void
-define_user_data (rc_res_id id, rc_res_id type,
- const rc_res_res_info *resinfo,
- rc_rcdata_item *data)
-{
- rc_res_id ids[3];
- rc_res_resource *r;
- bfd_byte *pb_data;
- rc_uint_type len_data;
-
- /* We have to check if the binary data is parsed specially. */
- if (type.named == 0)
- {
- switch (type.u.id)
- {
- case RT_FONTDIR:
- define_fontdir_rcdata (id, resinfo, data);
- return;
- case RT_FONT:
- define_font_rcdata (id, resinfo, data);
- return;
- case RT_ICON:
- define_icon_rcdata (id, resinfo, data);
- return;
- case RT_BITMAP:
- define_bitmap_rcdata (id, resinfo, data);
- return;
- case RT_CURSOR:
- define_cursor_rcdata (id, resinfo, data);
- return;
- case RT_GROUP_ICON:
- define_group_icon_rcdata (id, resinfo, data);
- return;
- case RT_GROUP_CURSOR:
- define_group_cursor_rcdata (id, resinfo, data);
- return;
- case RT_MESSAGETABLE:
- define_messagetable_rcdata (id, resinfo, data);
- return;
- default:
- /* Treat as normal user-data. */
- break;
- }
- }
- ids[0] = type;
- ids[1] = id;
- ids[2].named = 0;
- ids[2].u.id = resinfo->language;
-
- r = define_resource (& resources, 3, ids, 0);
- r->type = RES_TYPE_USERDATA;
- r->u.userdata = ((rc_rcdata_item *)
- res_alloc (sizeof (rc_rcdata_item)));
- r->u.userdata->next = NULL;
- r->u.userdata->type = RCDATA_BUFFER;
- pb_data = rcdata_render_as_buffer (data, &len_data);
- r->u.userdata->u.buffer.length = len_data;
- r->u.userdata->u.buffer.data = pb_data;
- r->res_info = *resinfo;
-}
-
-void
-define_rcdata_file (rc_res_id id, const rc_res_res_info *resinfo,
- const char *filename)
-{
- rc_rcdata_item *ri;
- FILE *e;
- char *real_filename;
- struct stat s;
- bfd_byte *data;
-
- e = open_file_search (filename, FOPEN_RB, "file", &real_filename);
-
-
- if (stat (real_filename, &s) < 0)
- fatal (_("stat failed on file `%s': %s"), real_filename,
- strerror (errno));
-
- data = (bfd_byte *) res_alloc (s.st_size);
-
- get_data (e, data, s.st_size, real_filename);
-
- fclose (e);
- free (real_filename);
-
- ri = (rc_rcdata_item *) res_alloc (sizeof (rc_rcdata_item));
- ri->next = NULL;
- ri->type = RCDATA_BUFFER;
- ri->u.buffer.length = s.st_size;
- ri->u.buffer.data = data;
-
- define_rcdata (id, resinfo, ri);
-}
-
-/* Define a user data resource where the data is in a file. */
-
-void
-define_user_file (rc_res_id id, rc_res_id type,
- const rc_res_res_info *resinfo, const char *filename)
-{
- FILE *e;
- char *real_filename;
- struct stat s;
- bfd_byte *data;
- rc_res_id ids[3];
- rc_res_resource *r;
-
- e = open_file_search (filename, FOPEN_RB, "file", &real_filename);
-
- if (stat (real_filename, &s) < 0)
- fatal (_("stat failed on file `%s': %s"), real_filename,
- strerror (errno));
-
- data = (bfd_byte *) res_alloc (s.st_size);
-
- get_data (e, data, s.st_size, real_filename);
-
- fclose (e);
- free (real_filename);
-
- ids[0] = type;
- ids[1] = id;
- ids[2].named = 0;
- ids[2].u.id = resinfo->language;
-
- r = define_resource (&resources, 3, ids, 0);
- r->type = RES_TYPE_USERDATA;
- r->u.userdata = ((rc_rcdata_item *)
- res_alloc (sizeof (rc_rcdata_item)));
- r->u.userdata->next = NULL;
- r->u.userdata->type = RCDATA_BUFFER;
- r->u.userdata->u.buffer.length = s.st_size;
- r->u.userdata->u.buffer.data = data;
- r->res_info = *resinfo;
-}
-
-/* Define a versioninfo resource. */
-
-void
-define_versioninfo (rc_res_id id, rc_uint_type language,
- rc_fixed_versioninfo *fixedverinfo,
- rc_ver_info *verinfo)
-{
- rc_res_resource *r;
-
- r = define_standard_resource (&resources, RT_VERSION, id, language, 0);
- r->type = RES_TYPE_VERSIONINFO;
- r->u.versioninfo = ((rc_versioninfo *)
- res_alloc (sizeof (rc_versioninfo)));
- r->u.versioninfo->fixed = fixedverinfo;
- r->u.versioninfo->var = verinfo;
- r->res_info.language = language;
-}
-
-/* Add string version info to a list of version information. */
-
-rc_ver_info *
-append_ver_stringfileinfo (rc_ver_info *verinfo, const char *language,
- rc_ver_stringinfo *strings)
-{
- rc_ver_info *vi, **pp;
-
- vi = (rc_ver_info *) res_alloc (sizeof (rc_ver_info));
- vi->next = NULL;
- vi->type = VERINFO_STRING;
- unicode_from_ascii ((rc_uint_type *) NULL, &vi->u.string.language, language);
- vi->u.string.strings = strings;
-
- for (pp = &verinfo; *pp != NULL; pp = &(*pp)->next)
- ;
- *pp = vi;
-
- return verinfo;
-}
-
-/* Add variable version info to a list of version information. */
-
-rc_ver_info *
-append_ver_varfileinfo (rc_ver_info *verinfo, const unichar *key,
- rc_ver_varinfo *var)
-{
- rc_ver_info *vi, **pp;
-
- vi = (rc_ver_info *) res_alloc (sizeof *vi);
- vi->next = NULL;
- vi->type = VERINFO_VAR;
- vi->u.var.key = unichar_dup (key);
- vi->u.var.var = var;
-
- for (pp = &verinfo; *pp != NULL; pp = &(*pp)->next)
- ;
- *pp = vi;
-
- return verinfo;
-}
-
-/* Append version string information to a list. */
-
-rc_ver_stringinfo *
-append_verval (rc_ver_stringinfo *strings, const unichar *key,
- const unichar *value)
-{
- rc_ver_stringinfo *vs, **pp;
-
- vs = (rc_ver_stringinfo *) res_alloc (sizeof (rc_ver_stringinfo));
- vs->next = NULL;
- vs->key = unichar_dup (key);
- vs->value = unichar_dup (value);
-
- for (pp = &strings; *pp != NULL; pp = &(*pp)->next)
- ;
- *pp = vs;
-
- return strings;
-}
-
-/* Append version variable information to a list. */
-
-rc_ver_varinfo *
-append_vertrans (rc_ver_varinfo *var, rc_uint_type language,
- rc_uint_type charset)
-{
- rc_ver_varinfo *vv, **pp;
-
- vv = (rc_ver_varinfo *) res_alloc (sizeof (rc_ver_varinfo));
- vv->next = NULL;
- vv->language = language;
- vv->charset = charset;
-
- for (pp = &var; *pp != NULL; pp = &(*pp)->next)
- ;
- *pp = vv;
-
- return var;
-}
-
-/* Local functions used to write out an rc file. */
-
-static void indent (FILE *, int);
-static void write_rc_directory (FILE *, const rc_res_directory *, const rc_res_id *,
- const rc_res_id *, rc_uint_type *, int);
-static void write_rc_subdir (FILE *, const rc_res_entry *, const rc_res_id *,
- const rc_res_id *, rc_uint_type *, int);
-static void write_rc_resource (FILE *, const rc_res_id *, const rc_res_id *,
- const rc_res_resource *, rc_uint_type *);
-static void write_rc_accelerators (FILE *, const rc_accelerator *);
-static void write_rc_cursor (FILE *, const rc_cursor *);
-static void write_rc_group_cursor (FILE *, const rc_group_cursor *);
-static void write_rc_dialog (FILE *, const rc_dialog *);
-static void write_rc_dialog_control (FILE *, const rc_dialog_control *);
-static void write_rc_fontdir (FILE *, const rc_fontdir *);
-static void write_rc_group_icon (FILE *, const rc_group_icon *);
-static void write_rc_menu (FILE *, const rc_menu *, int);
-static void write_rc_toolbar (FILE *, const rc_toolbar *);
-static void write_rc_menuitems (FILE *, const rc_menuitem *, int, int);
-static void write_rc_messagetable (FILE *, rc_uint_type , const bfd_byte *);
-
-static void write_rc_datablock (FILE *, rc_uint_type , const bfd_byte *, int, int, int);
-static void write_rc_rcdata (FILE *, const rc_rcdata_item *, int);
-static void write_rc_stringtable (FILE *, const rc_res_id *, const rc_stringtable *);
-static void write_rc_versioninfo (FILE *, const rc_versioninfo *);
-
-/* Indent a given number of spaces. */
-
-static void
-indent (FILE *e, int c)
-{
- int i;
-
- for (i = 0; i < c; i++)
- putc (' ', e);
-}
-
-/* Dump the resources we have read in the format of an rc file.
-
- Reasoned by the fact, that some resources need to be stored into file and
- refer to that file, we use the user-data model for that to express it binary
- without the need to store it somewhere externally. */
-
-void
-write_rc_file (const char *filename, const rc_res_directory *resources)
-{
- FILE *e;
- rc_uint_type language;
-
- if (filename == NULL)
- e = stdout;
- else
- {
- e = fopen (filename, FOPEN_WT);
- if (e == NULL)
- fatal (_("can't open `%s' for output: %s"), filename, strerror (errno));
- }
-
- language = (rc_uint_type) ((bfd_signed_vma) -1);
- write_rc_directory (e, resources, (const rc_res_id *) NULL,
- (const rc_res_id *) NULL, &language, 1);
-}
-
-/* Write out a directory. E is the file to write to. RD is the
- directory. TYPE is a pointer to the level 1 ID which serves as the
- resource type. NAME is a pointer to the level 2 ID which serves as
- an individual resource name. LANGUAGE is a pointer to the current
- language. LEVEL is the level in the tree. */
-
-static void
-write_rc_directory (FILE *e, const rc_res_directory *rd,
- const rc_res_id *type, const rc_res_id *name,
- rc_uint_type *language, int level)
-{
- const rc_res_entry *re;
-
- /* Print out some COFF information that rc files can't represent. */
- if (rd->time != 0 || rd->characteristics != 0 || rd->major != 0 || rd->minor != 0)
- {
- wr_printcomment (e, "COFF information not part of RC");
- if (rd->time != 0)
- wr_printcomment (e, "Time stamp: %u", rd->time);
- if (rd->characteristics != 0)
- wr_printcomment (e, "Characteristics: %u", rd->characteristics);
- if (rd->major != 0 || rd->minor != 0)
- wr_printcomment (e, "Version major:%d minor:%d", rd->major, rd->minor);
- }
-
- 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) (unsigned int) *language
- && (re->id.u.id & 0xffff) == re->id.u.id)
- {
- wr_print (e, "LANGUAGE %u, %u\n",
- re->id.u.id & ((1 << SUBLANG_SHIFT) - 1),
- (re->id.u.id >> SUBLANG_SHIFT) & 0xff);
- *language = re->id.u.id;
- }
- break;
-
- default:
- break;
- }
-
- if (re->subdir)
- write_rc_subdir (e, re, type, name, language, level);
- 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_rc_resource (e, type, name, re->u.res, language);
- }
- else
- {
- wr_printcomment (e, "Resource at unexpected level %d", level);
- write_rc_resource (e, type, (rc_res_id *) NULL, re->u.res,
- language);
- }
- }
- }
- if (rd->entries == NULL)
- {
- wr_print_flush (e);
- }
-}
-
-/* Write out a subdirectory entry. E is the file to write to. RE is
- the subdirectory entry. TYPE and NAME are pointers to higher level
- IDs, or NULL. LANGUAGE is a pointer to the current language.
- LEVEL is the level in the tree. */
-
-static void
-write_rc_subdir (FILE *e, const rc_res_entry *re,
- const rc_res_id *type, const rc_res_id *name,
- rc_uint_type *language, int level)
-{
- fprintf (e, "\n");
- switch (level)
- {
- case 1:
- wr_printcomment (e, "Type: ");
- if (re->id.named)
- res_id_print (e, re->id, 1);
- else
- {
- const char *s;
-
- switch (re->id.u.id)
- {
- case RT_CURSOR: s = "cursor"; break;
- case RT_BITMAP: s = "bitmap"; break;
- case RT_ICON: s = "icon"; break;
- case RT_MENU: s = "menu"; break;
- case RT_DIALOG: s = "dialog"; break;
- case RT_STRING: s = "stringtable"; break;
- case RT_FONTDIR: s = "fontdir"; break;
- case RT_FONT: s = "font"; break;
- case RT_ACCELERATOR: s = "accelerators"; break;
- case RT_RCDATA: s = "rcdata"; break;
- case RT_MESSAGETABLE: s = "messagetable"; break;
- case RT_GROUP_CURSOR: s = "group cursor"; break;
- case RT_GROUP_ICON: s = "group icon"; break;
- case RT_VERSION: s = "version"; break;
- case RT_DLGINCLUDE: s = "dlginclude"; break;
- case RT_PLUGPLAY: s = "plugplay"; break;
- case RT_VXD: s = "vxd"; break;
- case RT_ANICURSOR: s = "anicursor"; break;
- case RT_ANIICON: s = "aniicon"; break;
- case RT_TOOLBAR: s = "toolbar"; break;
- case RT_HTML: s = "html"; break;
- default: s = NULL; break;
- }
-
- if (s != NULL)
- fprintf (e, "%s", s);
- else
- res_id_print (e, re->id, 1);
- }
- break;
-
- case 2:
- wr_printcomment (e, "Name: ");
- res_id_print (e, re->id, 1);
- break;
-
- case 3:
- wr_printcomment (e, "Language: ");
- res_id_print (e, re->id, 1);
- break;
-
- default:
- wr_printcomment (e, "Level %d: ", level);
- res_id_print (e, re->id, 1);
- }
-
- write_rc_directory (e, re->u.dir, type, name, language, level + 1);
-}
-
-/* Write out a single resource. E is the file to write to. TYPE is a
- pointer to the type of the resource. NAME is a pointer to the name
- of the resource; it will be NULL if there is a level mismatch. RES
- is the resource data. LANGUAGE is a pointer to the current
- language. */
-
-static void
-write_rc_resource (FILE *e, const rc_res_id *type,
- const rc_res_id *name, const rc_res_resource *res,
- rc_uint_type *language)
-{
- const char *s;
- int rt;
- int menuex = 0;
-
- switch (res->type)
- {
- default:
- abort ();
-
- case RES_TYPE_ACCELERATOR:
- s = "ACCELERATORS";
- rt = RT_ACCELERATOR;
- break;
-
- case RES_TYPE_BITMAP:
- s = "2 /* RT_BITMAP */";
- rt = RT_BITMAP;
- break;
-
- case RES_TYPE_CURSOR:
- s = "1 /* RT_CURSOR */";
- rt = RT_CURSOR;
- break;
-
- case RES_TYPE_GROUP_CURSOR:
- s = "12 /* RT_GROUP_CURSOR */";
- rt = RT_GROUP_CURSOR;
- break;
-
- case RES_TYPE_DIALOG:
- if (extended_dialog (res->u.dialog))
- s = "DIALOGEX";
- else
- s = "DIALOG";
- rt = RT_DIALOG;
- break;
-
- case RES_TYPE_FONT:
- s = "8 /* RT_FONT */";
- rt = RT_FONT;
- break;
-
- case RES_TYPE_FONTDIR:
- s = "7 /* RT_FONTDIR */";
- rt = RT_FONTDIR;
- break;
-
- case RES_TYPE_ICON:
- s = "3 /* RT_ICON */";
- rt = RT_ICON;
- break;
-
- case RES_TYPE_GROUP_ICON:
- s = "14 /* RT_GROUP_ICON */";
- rt = RT_GROUP_ICON;
- break;
-
- case RES_TYPE_MENU:
- if (extended_menu (res->u.menu))
- {
- s = "MENUEX";
- menuex = 1;
- }
- else
- {
- s = "MENU";
- menuex = 0;
- }
- rt = RT_MENU;
- break;
-
- case RES_TYPE_MESSAGETABLE:
- s = "11 /* RT_MESSAGETABLE */";
- rt = RT_MESSAGETABLE;
- break;
-
- case RES_TYPE_RCDATA:
- s = "RCDATA";
- rt = RT_RCDATA;
- break;
-
- case RES_TYPE_STRINGTABLE:
- s = "STRINGTABLE";
- rt = RT_STRING;
- break;
-
- case RES_TYPE_USERDATA:
- s = NULL;
- rt = 0;
- break;
-
- case RES_TYPE_VERSIONINFO:
- s = "VERSIONINFO";
- rt = RT_VERSION;
- break;
-
- case RES_TYPE_TOOLBAR:
- s = "TOOLBAR";
- rt = RT_TOOLBAR;
- break;
- }
-
- if (rt != 0
- && type != NULL
- && (type->named || type->u.id != (unsigned long) rt))
- {
- wr_printcomment (e, "Unexpected resource type mismatch: ");
- res_id_print (e, *type, 1);
- fprintf (e, " != %d", rt);
- }
-
- if (res->coff_info.codepage != 0)
- wr_printcomment (e, "Code page: %u", res->coff_info.codepage);
- if (res->coff_info.reserved != 0)
- wr_printcomment (e, "COFF reserved value: %u", res->coff_info.reserved);
-
- wr_print (e, "\n");
- if (rt == RT_STRING)
- ;
- else
- {
- if (name != NULL)
- res_id_print (e, *name, 1);
- else
- fprintf (e, "??Unknown-Name??");
- fprintf (e, " ");
- }
-
- if (s != NULL)
- fprintf (e, "%s", s);
- else if (type != NULL)
- {
- if (type->named == 0)
- {
-#define PRINT_RT_NAME(NAME) case NAME: \
- fprintf (e, "%u /* %s */", (unsigned int) NAME, #NAME); \
- break
-
- switch (type->u.id)
- {
- default:
- res_id_print (e, *type, 0);
- break;
-
- PRINT_RT_NAME(RT_MANIFEST);
- PRINT_RT_NAME(RT_ANICURSOR);
- PRINT_RT_NAME(RT_ANIICON);
- PRINT_RT_NAME(RT_RCDATA);
- PRINT_RT_NAME(RT_ICON);
- PRINT_RT_NAME(RT_CURSOR);
- PRINT_RT_NAME(RT_BITMAP);
- PRINT_RT_NAME(RT_PLUGPLAY);
- PRINT_RT_NAME(RT_VXD);
- PRINT_RT_NAME(RT_FONT);
- PRINT_RT_NAME(RT_FONTDIR);
- PRINT_RT_NAME(RT_HTML);
- PRINT_RT_NAME(RT_MESSAGETABLE);
- PRINT_RT_NAME(RT_DLGINCLUDE);
- PRINT_RT_NAME(RT_DLGINIT);
- }
-#undef PRINT_RT_NAME
- }
- else
- res_id_print (e, *type, 1);
- }
- else
- fprintf (e, "??Unknown-Type??");
-
- if (res->res_info.memflags != 0)
- {
- if ((res->res_info.memflags & MEMFLAG_MOVEABLE) != 0)
- fprintf (e, " MOVEABLE");
- if ((res->res_info.memflags & MEMFLAG_PURE) != 0)
- fprintf (e, " PURE");
- if ((res->res_info.memflags & MEMFLAG_PRELOAD) != 0)
- fprintf (e, " PRELOAD");
- if ((res->res_info.memflags & MEMFLAG_DISCARDABLE) != 0)
- fprintf (e, " DISCARDABLE");
- }
-
- if (res->type == RES_TYPE_DIALOG)
- {
- fprintf (e, " %d, %d, %d, %d",
- (int) res->u.dialog->x, (int) res->u.dialog->y,
- (int) res->u.dialog->width, (int) res->u.dialog->height);
- if (res->u.dialog->ex != NULL
- && res->u.dialog->ex->help != 0)
- fprintf (e, ", %u", (unsigned int) res->u.dialog->ex->help);
- }
- else if (res->type == RES_TYPE_TOOLBAR)
- {
- fprintf (e, " %d, %d", (int) res->u.toolbar->button_width,
- (int) res->u.toolbar->button_height);
- }
-
- fprintf (e, "\n");
-
- if ((res->res_info.language != 0 && res->res_info.language != *language)
- || res->res_info.characteristics != 0
- || res->res_info.version != 0)
- {
- int modifiers;
-
- switch (res->type)
- {
- case RES_TYPE_ACCELERATOR:
- case RES_TYPE_DIALOG:
- case RES_TYPE_MENU:
- case RES_TYPE_RCDATA:
- case RES_TYPE_STRINGTABLE:
- modifiers = 1;
- break;
-
- default:
- modifiers = 0;
- break;
- }
-
- if (res->res_info.language != 0 && res->res_info.language != *language)
- fprintf (e, "%sLANGUAGE %d, %d\n",
- modifiers ? "// " : "",
- (int) res->res_info.language & ((1<<SUBLANG_SHIFT)-1),
- (int) (res->res_info.language >> SUBLANG_SHIFT) & 0xff);
- if (res->res_info.characteristics != 0)
- fprintf (e, "%sCHARACTERISTICS %u\n",
- modifiers ? "// " : "",
- (unsigned int) res->res_info.characteristics);
- if (res->res_info.version != 0)
- fprintf (e, "%sVERSION %u\n",
- modifiers ? "// " : "",
- (unsigned int) res->res_info.version);
- }
-
- switch (res->type)
- {
- default:
- abort ();
-
- case RES_TYPE_ACCELERATOR:
- write_rc_accelerators (e, res->u.acc);
- break;
-
- case RES_TYPE_CURSOR:
- write_rc_cursor (e, res->u.cursor);
- break;
-
- case RES_TYPE_GROUP_CURSOR:
- write_rc_group_cursor (e, res->u.group_cursor);
- break;
-
- case RES_TYPE_DIALOG:
- write_rc_dialog (e, res->u.dialog);
- break;
-
- case RES_TYPE_FONTDIR:
- write_rc_fontdir (e, res->u.fontdir);
- break;
-
- case RES_TYPE_GROUP_ICON:
- write_rc_group_icon (e, res->u.group_icon);
- break;
-
- case RES_TYPE_MENU:
- write_rc_menu (e, res->u.menu, menuex);
- break;
-
- case RES_TYPE_RCDATA:
- write_rc_rcdata (e, res->u.rcdata, 0);
- break;
-
- case RES_TYPE_STRINGTABLE:
- write_rc_stringtable (e, name, res->u.stringtable);
- break;
-
- case RES_TYPE_USERDATA:
- write_rc_rcdata (e, res->u.userdata, 0);
- break;
-
- case RES_TYPE_TOOLBAR:
- write_rc_toolbar (e, res->u.toolbar);
- break;
-
- case RES_TYPE_VERSIONINFO:
- write_rc_versioninfo (e, res->u.versioninfo);
- break;
-
- case RES_TYPE_BITMAP:
- case RES_TYPE_FONT:
- case RES_TYPE_ICON:
- write_rc_datablock (e, res->u.data.length, res->u.data.data, 0, 1, 0);
- break;
- case RES_TYPE_MESSAGETABLE:
- write_rc_messagetable (e, res->u.data.length, res->u.data.data);
- break;
- }
-}
-
-/* Write out accelerator information. */
-
-static void
-write_rc_accelerators (FILE *e, const rc_accelerator *accelerators)
-{
- const rc_accelerator *acc;
-
- fprintf (e, "BEGIN\n");
- for (acc = accelerators; acc != NULL; acc = acc->next)
- {
- int printable;
-
- fprintf (e, " ");
-
- if ((acc->key & 0x7f) == acc->key
- && ISPRINT (acc->key)
- && (acc->flags & ACC_VIRTKEY) == 0)
- {
- fprintf (e, "\"%c\"", (char) acc->key);
- printable = 1;
- }
- else
- {
- fprintf (e, "%d", (int) acc->key);
- printable = 0;
- }
-
- fprintf (e, ", %d", (int) acc->id);
-
- if (! printable)
- {
- if ((acc->flags & ACC_VIRTKEY) != 0)
- fprintf (e, ", VIRTKEY");
- else
- fprintf (e, ", ASCII");
- }
-
- if ((acc->flags & ACC_SHIFT) != 0)
- fprintf (e, ", SHIFT");
- if ((acc->flags & ACC_CONTROL) != 0)
- fprintf (e, ", CONTROL");
- if ((acc->flags & ACC_ALT) != 0)
- fprintf (e, ", ALT");
-
- fprintf (e, "\n");
- }
-
- fprintf (e, "END\n");
-}
-
-/* Write out cursor information. This would normally be in a separate
- file, which the rc file would include. */
-
-static void
-write_rc_cursor (FILE *e, const rc_cursor *cursor)
-{
- fprintf (e, "BEGIN\n");
- indent (e, 2);
- fprintf (e, " 0x%x, 0x%x,\t/* Hotspot x: %d, y: %d. */\n",
- (unsigned int) cursor->xhotspot, (unsigned int) cursor->yhotspot,
- (int) cursor->xhotspot, (int) cursor->yhotspot);
- write_rc_datablock (e, (rc_uint_type) cursor->length, (const bfd_byte *) cursor->data,
- 0, 0, 0);
- fprintf (e, "END\n");
-}
-
-/* Write out group cursor data. This would normally be built from the
- cursor data. */
-
-static void
-write_rc_group_cursor (FILE *e, const rc_group_cursor *group_cursor)
-{
- const rc_group_cursor *gc;
- int c;
-
- for (c = 0, gc = group_cursor; gc != NULL; gc = gc->next, c++)
- ;
- fprintf (e, "BEGIN\n");
-
- indent (e, 2);
- fprintf (e, "0, 2, %d%s\t /* Having %d items. */\n", c, (c != 0 ? "," : ""), c);
- indent (e, 4);
- fprintf (e, "/* width, height, planes, bits, bytes, index. */\n");
-
- for (c = 1, gc = group_cursor; gc != NULL; gc = gc->next, c++)
- {
- indent (e, 4);
- fprintf (e, "%d, %d, %d, %d, 0x%xL, %d%s /* Element %d. */\n",
- (int) gc->width, (int) gc->height, (int) gc->planes, (int) gc->bits,
- (unsigned int) gc->bytes, (int) gc->index, (gc->next != NULL ? "," : ""), c);
- fprintf (e, "/* width: %d; height %d; planes %d; bits %d. */\n",
- (int) gc->width, (int) gc->height, (int) gc->planes,
- (int) gc->bits);
- }
- fprintf (e, "END\n");
-}
-
-/* Write dialog data. */
-
-static void
-write_rc_dialog (FILE *e, const rc_dialog *dialog)
-{
- const rc_dialog_control *control;
-
- fprintf (e, "STYLE 0x%x\n", dialog->style);
-
- if (dialog->exstyle != 0)
- fprintf (e, "EXSTYLE 0x%x\n", (unsigned int) dialog->exstyle);
-
- if ((dialog->class.named && dialog->class.u.n.length > 0)
- || dialog->class.u.id != 0)
- {
- fprintf (e, "CLASS ");
- res_id_print (e, dialog->class, 1);
- fprintf (e, "\n");
- }
-
- if (dialog->caption != NULL)
- {
- fprintf (e, "CAPTION ");
- unicode_print_quoted (e, dialog->caption, -1);
- fprintf (e, "\n");
- }
-
- if ((dialog->menu.named && dialog->menu.u.n.length > 0)
- || dialog->menu.u.id != 0)
- {
- fprintf (e, "MENU ");
- res_id_print (e, dialog->menu, 0);
- fprintf (e, "\n");
- }
-
- if (dialog->font != NULL)
- {
- fprintf (e, "FONT %d, ", (int) dialog->pointsize);
- unicode_print_quoted (e, dialog->font, -1);
- if (dialog->ex != NULL
- && (dialog->ex->weight != 0
- || dialog->ex->italic != 0
- || dialog->ex->charset != 1))
- fprintf (e, ", %d, %d, %d",
- (int) dialog->ex->weight,
- (int) dialog->ex->italic,
- (int) dialog->ex->charset);
- fprintf (e, "\n");
- }
-
- fprintf (e, "BEGIN\n");
-
- for (control = dialog->controls; control != NULL; control = control->next)
- write_rc_dialog_control (e, control);
-
- fprintf (e, "END\n");
-}
-
-/* For each predefined control keyword, this table provides the class
- and the style. */
-
-struct control_info
-{
- const char *name;
- unsigned short class;
- unsigned long style;
-};
-
-static const struct control_info control_info[] =
-{
- { "AUTO3STATE", CTL_BUTTON, BS_AUTO3STATE },
- { "AUTOCHECKBOX", CTL_BUTTON, BS_AUTOCHECKBOX },
- { "AUTORADIOBUTTON", CTL_BUTTON, BS_AUTORADIOBUTTON },
- { "CHECKBOX", CTL_BUTTON, BS_CHECKBOX },
- { "COMBOBOX", CTL_COMBOBOX, (unsigned long) -1 },
- { "CTEXT", CTL_STATIC, SS_CENTER },
- { "DEFPUSHBUTTON", CTL_BUTTON, BS_DEFPUSHBUTTON },
- { "EDITTEXT", CTL_EDIT, (unsigned long) -1 },
- { "GROUPBOX", CTL_BUTTON, BS_GROUPBOX },
- { "ICON", CTL_STATIC, SS_ICON },
- { "LISTBOX", CTL_LISTBOX, (unsigned long) -1 },
- { "LTEXT", CTL_STATIC, SS_LEFT },
- { "PUSHBOX", CTL_BUTTON, BS_PUSHBOX },
- { "PUSHBUTTON", CTL_BUTTON, BS_PUSHBUTTON },
- { "RADIOBUTTON", CTL_BUTTON, BS_RADIOBUTTON },
- { "RTEXT", CTL_STATIC, SS_RIGHT },
- { "SCROLLBAR", CTL_SCROLLBAR, (unsigned long) -1 },
- { "STATE3", CTL_BUTTON, BS_3STATE },
- /* It's important that USERBUTTON come after all the other button
- types, so that it won't be matched too early. */
- { "USERBUTTON", CTL_BUTTON, (unsigned long) -1 },
- { NULL, 0, 0 }
-};
-
-/* Write a dialog control. */
-
-static void
-write_rc_dialog_control (FILE *e, const rc_dialog_control *control)
-{
- const struct control_info *ci;
-
- fprintf (e, " ");
-
- if (control->class.named)
- ci = NULL;
- else
- {
- for (ci = control_info; ci->name != NULL; ++ci)
- if (ci->class == control->class.u.id
- && (ci->style == (unsigned long) -1
- || ci->style == (control->style & 0xff)))
- break;
- }
- if (ci == NULL)
- fprintf (e, "CONTROL");
- else if (ci->name != NULL)
- fprintf (e, "%s", ci->name);
- else
- {
- fprintf (e, "CONTROL");
- ci = NULL;
- }
-
- if (control->text.named || control->text.u.id != 0)
- {
- fprintf (e, " ");
- res_id_print (e, control->text, 1);
- fprintf (e, ",");
- }
-
- fprintf (e, " %d, ", (int) control->id);
-
- if (ci == NULL)
- {
- if (control->class.named)
- fprintf (e, "\"");
- res_id_print (e, control->class, 0);
- if (control->class.named)
- fprintf (e, "\"");
- fprintf (e, ", 0x%x, ", (unsigned int) control->style);
- }
-
- fprintf (e, "%d, %d", (int) control->x, (int) control->y);
-
- if (control->style != SS_ICON
- || control->exstyle != 0
- || control->width != 0
- || control->height != 0
- || control->help != 0)
- {
- fprintf (e, ", %d, %d", (int) control->width, (int) control->height);
-
- /* FIXME: We don't need to print the style if it is the default.
- More importantly, in certain cases we actually need to turn
- off parts of the forced style, by using NOT. */
- if (ci != NULL)
- fprintf (e, ", 0x%x", (unsigned int) control->style);
-
- if (control->exstyle != 0 || control->help != 0)
- fprintf (e, ", 0x%x, %u", (unsigned int) control->exstyle,
- (unsigned int) control->help);
- }
-
- fprintf (e, "\n");
-
- if (control->data != NULL)
- write_rc_rcdata (e, control->data, 2);
-}
-
-/* Write out font directory data. This would normally be built from
- the font data. */
-
-static void
-write_rc_fontdir (FILE *e, const rc_fontdir *fontdir)
-{
- const rc_fontdir *fc;
- int c;
-
- for (c = 0, fc = fontdir; fc != NULL; fc = fc->next, c++)
- ;
- fprintf (e, "BEGIN\n");
- indent (e, 2);
- fprintf (e, "%d%s\t /* Has %d elements. */\n", c, (c != 0 ? "," : ""), c);
- for (c = 1, fc = fontdir; fc != NULL; fc = fc->next, c++)
- {
- indent (e, 4);
- fprintf (e, "%d,\t/* Font no %d with index %d. */\n",
- (int) fc->index, c, (int) fc->index);
- write_rc_datablock (e, (rc_uint_type) fc->length - 2,
- (const bfd_byte *) fc->data + 4,fc->next != NULL,
- 0, 0);
- }
- fprintf (e, "END\n");
-}
-
-/* Write out group icon data. This would normally be built from the
- icon data. */
-
-static void
-write_rc_group_icon (FILE *e, const rc_group_icon *group_icon)
-{
- const rc_group_icon *gi;
- int c;
-
- for (c = 0, gi = group_icon; gi != NULL; gi = gi->next, c++)
- ;
-
- fprintf (e, "BEGIN\n");
- indent (e, 2);
- fprintf (e, " 0, 1, %d%s\t /* Has %d elements. */\n", c, (c != 0 ? "," : ""), c);
-
- indent (e, 4);
- fprintf (e, "/* \"width height colors pad\", planes, bits, bytes, index. */\n");
- for (c = 1, gi = group_icon; gi != NULL; gi = gi->next, c++)
- {
- indent (e, 4);
- fprintf (e, "\"\\%03o\\%03o\\%03o\\%03o\", %d, %d, 0x%xL, %d%s\t/* Element no %d. */\n",
- gi->width, gi->height, gi->colors, 0, (int) gi->planes, (int) gi->bits,
- (unsigned int) gi->bytes, (int) gi->index, (gi->next != NULL ? "," : ""), c);
- }
- fprintf (e, "END\n");
-}
-
-/* Write out a menu resource. */
-
-static void
-write_rc_menu (FILE *e, const rc_menu *menu, int menuex)
-{
- if (menu->help != 0)
- fprintf (e, "// Help ID: %u\n", (unsigned int) menu->help);
- write_rc_menuitems (e, menu->items, menuex, 0);
-}
-
-static void
-write_rc_toolbar (FILE *e, const rc_toolbar *tb)
-{
- rc_toolbar_item *it;
- indent (e, 0);
- fprintf (e, "BEGIN\n");
- it = tb->items;
- while(it != NULL)
- {
- indent (e, 2);
- if (it->id.u.id == 0)
- fprintf (e, "SEPARATOR\n");
- else
- fprintf (e, "BUTTON %d\n", (int) it->id.u.id);
- it = it->next;
- }
- indent (e, 0);
- fprintf (e, "END\n");
-}
-
-/* Write out menuitems. */
-
-static void
-write_rc_menuitems (FILE *e, const rc_menuitem *menuitems, int menuex,
- int ind)
-{
- const rc_menuitem *mi;
-
- indent (e, ind);
- fprintf (e, "BEGIN\n");
-
- for (mi = menuitems; mi != NULL; mi = mi->next)
- {
- indent (e, ind + 2);
-
- if (mi->popup == NULL)
- fprintf (e, "MENUITEM");
- else
- fprintf (e, "POPUP");
-
- if (! menuex
- && mi->popup == NULL
- && mi->text == NULL
- && mi->type == 0
- && mi->id == 0)
- {
- fprintf (e, " SEPARATOR\n");
- continue;
- }
-
- if (mi->text == NULL)
- fprintf (e, " \"\"");
- else
- {
- fprintf (e, " ");
- unicode_print_quoted (e, mi->text, -1);
- }
-
- if (! menuex)
- {
- if (mi->popup == NULL)
- fprintf (e, ", %d", (int) mi->id);
-
- if ((mi->type & MENUITEM_CHECKED) != 0)
- fprintf (e, ", CHECKED");
- if ((mi->type & MENUITEM_GRAYED) != 0)
- fprintf (e, ", GRAYED");
- if ((mi->type & MENUITEM_HELP) != 0)
- fprintf (e, ", HELP");
- if ((mi->type & MENUITEM_INACTIVE) != 0)
- fprintf (e, ", INACTIVE");
- if ((mi->type & MENUITEM_MENUBARBREAK) != 0)
- fprintf (e, ", MENUBARBREAK");
- if ((mi->type & MENUITEM_MENUBREAK) != 0)
- fprintf (e, ", MENUBREAK");
- }
- else
- {
- if (mi->id != 0 || mi->type != 0 || mi->state != 0 || mi->help != 0)
- {
- fprintf (e, ", %d", (int) mi->id);
- if (mi->type != 0 || mi->state != 0 || mi->help != 0)
- {
- fprintf (e, ", %u", (unsigned int) mi->type);
- if (mi->state != 0 || mi->help != 0)
- {
- fprintf (e, ", %u", (unsigned int) mi->state);
- if (mi->help != 0)
- fprintf (e, ", %u", (unsigned int) mi->help);
- }
- }
- }
- }
-
- fprintf (e, "\n");
-
- if (mi->popup != NULL)
- write_rc_menuitems (e, mi->popup, menuex, ind + 2);
- }
-
- indent (e, ind);
- fprintf (e, "END\n");
-}
-
-static int
-test_rc_datablock_unicode (rc_uint_type length, const bfd_byte *data)
-{
- rc_uint_type i;
- if ((length & 1) != 0)
- return 0;
-
- for (i = 0; i < length; i += 2)
- {
- if (data[i] == 0 && data[i + 1] == 0 && (i + 2) < length)
- return 0;
- if (data[i] == 0xff && data[i + 1] == 0xff)
- return 0;
- }
- return 1;
-}
-
-static int
-test_rc_datablock_text (rc_uint_type length, const bfd_byte *data)
-{
- int has_nl;
- rc_uint_type c;
- rc_uint_type i;
-
- if (length <= 1)
- return 0;
-
- has_nl = 0;
- for (i = 0, c = 0; i < length; i++)
- {
- if (! ISPRINT (data[i]) && data[i] != '\n'
- && ! (data[i] == '\r' && (i + 1) < length && data[i + 1] == '\n')
- && data[i] != '\t'
- && ! (data[i] == 0 && (i + 1) != length))
- {
- if (data[i] <= 7)
- return 0;
- c++;
- }
- else if (data[i] == '\n') has_nl++;
- }
- if (length > 80 && ! has_nl)
- return 0;
- c = (((c * 10000) + (i / 100) - 1)) / i;
- if (c >= 150)
- return 0;
- return 1;
-}
-
-static void
-write_rc_messagetable (FILE *e, rc_uint_type length, const bfd_byte *data)
-{
- int has_error = 0;
- const struct bin_messagetable *mt;
- fprintf (e, "BEGIN\n");
-
- write_rc_datablock (e, length, data, 0, 0, 0);
-
- fprintf (e, "\n");
- wr_printcomment (e, "MC syntax dump");
- if (length < BIN_MESSAGETABLE_SIZE)
- has_error = 1;
- else
- do {
- rc_uint_type m, i;
- mt = (const struct bin_messagetable *) data;
- m = windres_get_32 (&wrtarget, mt->cblocks, length);
- if (length < (BIN_MESSAGETABLE_SIZE + m * BIN_MESSAGETABLE_BLOCK_SIZE))
- {
- has_error = 1;
- break;
- }
- for (i = 0; i < m; i++)
- {
- rc_uint_type low, high, offset;
- const struct bin_messagetable_item *mti;
-
- low = windres_get_32 (&wrtarget, mt->items[i].lowid, 4);
- high = windres_get_32 (&wrtarget, mt->items[i].highid, 4);
- offset = windres_get_32 (&wrtarget, mt->items[i].offset, 4);
- while (low <= high)
- {
- rc_uint_type elen, flags;
- if ((offset + BIN_MESSAGETABLE_ITEM_SIZE) > length)
- {
- has_error = 1;
- break;
- }
- mti = (const struct bin_messagetable_item *) &data[offset];
- elen = windres_get_16 (&wrtarget, mti->length, 2);
- flags = windres_get_16 (&wrtarget, mti->flags, 2);
- if ((offset + elen) > length)
- {
- has_error = 1;
- break;
- }
- wr_printcomment (e, "MessageId = 0x%x", low);
- wr_printcomment (e, "");
- if ((flags & MESSAGE_RESOURCE_UNICODE) == MESSAGE_RESOURCE_UNICODE)
- unicode_print (e, (const unichar *) mti->data,
- (elen - BIN_MESSAGETABLE_ITEM_SIZE) / 2);
- else
- ascii_print (e, (const char *) mti->data,
- (elen - BIN_MESSAGETABLE_ITEM_SIZE));
- wr_printcomment (e,"");
- ++low;
- offset += elen;
- }
- }
- } while (0);
- if (has_error)
- wr_printcomment (e, "Illegal data");
- wr_print_flush (e);
- fprintf (e, "END\n");
-}
-
-static void
-write_rc_datablock (FILE *e, rc_uint_type length, const bfd_byte *data, int has_next,
- int hasblock, int show_comment)
-{
- int plen;
-
- if (hasblock)
- fprintf (e, "BEGIN\n");
-
- if (show_comment == -1)
- {
- if (test_rc_datablock_text(length, data))
- {
- rc_uint_type i, c;
- for (i = 0; i < length;)
- {
- indent (e, 2);
- fprintf (e, "\"");
-
- for (c = 0; i < length && c < 160 && data[i] != '\n'; c++, i++)
- ;
- if (i < length && data[i] == '\n')
- ++i, ++c;
- ascii_print (e, (const char *) &data[i - c], c);
- fprintf (e, "\"");
- if (i < length)
- fprintf (e, "\n");
- }
-
- if (i == 0)
- {
- indent (e, 2);
- fprintf (e, "\"\"");
- }
- if (has_next)
- fprintf (e, ",");
- fprintf (e, "\n");
- if (hasblock)
- fprintf (e, "END\n");
- return;
- }
- if (test_rc_datablock_unicode (length, data))
- {
- rc_uint_type i, c;
- for (i = 0; i < length;)
- {
- const unichar *u;
-
- u = (const unichar *) &data[i];
- indent (e, 2);
- fprintf (e, "L\"");
-
- for (c = 0; i < length && c < 160 && u[c] != '\n'; c++, i += 2)
- ;
- if (i < length && u[c] == '\n')
- i += 2, ++c;
- unicode_print (e, u, c);
- fprintf (e, "\"");
- if (i < length)
- fprintf (e, "\n");
- }
-
- if (i == 0)
- {
- indent (e, 2);
- fprintf (e, "L\"\"");
- }
- if (has_next)
- fprintf (e, ",");
- fprintf (e, "\n");
- if (hasblock)
- fprintf (e, "END\n");
- return;
- }
-
- show_comment = 0;
- }
-
- if (length != 0)
- {
- rc_uint_type i, max_row;
- int first = 1;
-
- max_row = (show_comment ? 4 : 8);
- indent (e, 2);
- for (i = 0; i + 3 < length;)
- {
- rc_uint_type k;
- rc_uint_type comment_start;
-
- comment_start = i;
-
- if (! first)
- indent (e, 2);
-
- for (k = 0; k < max_row && i + 3 < length; k++, i += 4)
- {
- if (k == 0)
- plen = fprintf (e, "0x%lxL",
- (unsigned long) windres_get_32 (&wrtarget, data + i, length - i));
- else
- plen = fprintf (e, " 0x%lxL",
- (unsigned long) windres_get_32 (&wrtarget, data + i, length - i)) - 1;
- if (has_next || (i + 4) < length)
- {
- if (plen>0 && plen < 11)
- indent (e, 11 - plen);
- fprintf (e, ",");
- }
- }
- if (show_comment)
- {
- fprintf (e, "\t/* ");
- ascii_print (e, (const char *) &data[comment_start], i - comment_start);
- fprintf (e, ". */");
- }
- fprintf (e, "\n");
- first = 0;
- }
-
- if (i + 1 < length)
- {
- if (! first)
- indent (e, 2);
- plen = fprintf (e, "0x%x",
- (int) windres_get_16 (&wrtarget, data + i, length - i));
- if (has_next || i + 2 < length)
- {
- if (plen > 0 && plen < 11)
- indent (e, 11 - plen);
- fprintf (e, ",");
- }
- if (show_comment)
- {
- fprintf (e, "\t/* ");
- ascii_print (e, (const char *) &data[i], 2);
- fprintf (e, ". */");
- }
- fprintf (e, "\n");
- i += 2;
- first = 0;
- }
-
- if (i < length)
- {
- if (! first)
- indent (e, 2);
- fprintf (e, "\"");
- ascii_print (e, (const char *) &data[i], 1);
- fprintf (e, "\"");
- if (has_next)
- fprintf (e, ",");
- fprintf (e, "\n");
- first = 0;
- }
- }
- if (hasblock)
- fprintf (e, "END\n");
-}
-
-/* Write out an rcdata resource. This is also used for other types of
- resources that need to print arbitrary data. */
-
-static void
-write_rc_rcdata (FILE *e, const rc_rcdata_item *rcdata, int ind)
-{
- const rc_rcdata_item *ri;
-
- indent (e, ind);
- fprintf (e, "BEGIN\n");
-
- for (ri = rcdata; ri != NULL; ri = ri->next)
- {
- if (ri->type == RCDATA_BUFFER && ri->u.buffer.length == 0)
- continue;
-
- switch (ri->type)
- {
- default:
- abort ();
-
- case RCDATA_WORD:
- indent (e, ind + 2);
- fprintf (e, "%ld", (long) (ri->u.word & 0xffff));
- break;
-
- case RCDATA_DWORD:
- indent (e, ind + 2);
- fprintf (e, "%luL", (unsigned long) ri->u.dword);
- break;
-
- case RCDATA_STRING:
- indent (e, ind + 2);
- fprintf (e, "\"");
- ascii_print (e, ri->u.string.s, ri->u.string.length);
- fprintf (e, "\"");
- break;
-
- case RCDATA_WSTRING:
- indent (e, ind + 2);
- fprintf (e, "L\"");
- unicode_print (e, ri->u.wstring.w, ri->u.wstring.length);
- fprintf (e, "\"");
- break;
-
- case RCDATA_BUFFER:
- write_rc_datablock (e, (rc_uint_type) ri->u.buffer.length,
- (const bfd_byte *) ri->u.buffer.data,
- ri->next != NULL, 0, -1);
- break;
- }
-
- if (ri->type != RCDATA_BUFFER)
- {
- if (ri->next != NULL)
- fprintf (e, ",");
- fprintf (e, "\n");
- }
- }
-
- indent (e, ind);
- fprintf (e, "END\n");
-}
-
-/* Write out a stringtable resource. */
-
-static void
-write_rc_stringtable (FILE *e, const rc_res_id *name,
- const rc_stringtable *stringtable)
-{
- rc_uint_type offset;
- int i;
-
- if (name != NULL && ! name->named)
- offset = (name->u.id - 1) << 4;
- else
- {
- fprintf (e, "/* %s string table name. */\n",
- name == NULL ? "Missing" : "Invalid");
- offset = 0;
- }
-
- fprintf (e, "BEGIN\n");
-
- for (i = 0; i < 16; i++)
- {
- if (stringtable->strings[i].length != 0)
- {
- fprintf (e, " %lu, ", (unsigned long) offset + i);
- unicode_print_quoted (e, stringtable->strings[i].string,
- stringtable->strings[i].length);
- fprintf (e, "\n");
- }
- }
-
- fprintf (e, "END\n");
-}
-
-/* Write out a versioninfo resource. */
-
-static void
-write_rc_versioninfo (FILE *e, const rc_versioninfo *versioninfo)
-{
- const rc_fixed_versioninfo *f;
- const rc_ver_info *vi;
-
- f = versioninfo->fixed;
- if (f->file_version_ms != 0 || f->file_version_ls != 0)
- fprintf (e, " FILEVERSION %u, %u, %u, %u\n",
- (unsigned int) ((f->file_version_ms >> 16) & 0xffff),
- (unsigned int) (f->file_version_ms & 0xffff),
- (unsigned int) ((f->file_version_ls >> 16) & 0xffff),
- (unsigned int) (f->file_version_ls & 0xffff));
- if (f->product_version_ms != 0 || f->product_version_ls != 0)
- fprintf (e, " PRODUCTVERSION %u, %u, %u, %u\n",
- (unsigned int) ((f->product_version_ms >> 16) & 0xffff),
- (unsigned int) (f->product_version_ms & 0xffff),
- (unsigned int) ((f->product_version_ls >> 16) & 0xffff),
- (unsigned int) (f->product_version_ls & 0xffff));
- if (f->file_flags_mask != 0)
- fprintf (e, " FILEFLAGSMASK 0x%x\n", (unsigned int) f->file_flags_mask);
- if (f->file_flags != 0)
- fprintf (e, " FILEFLAGS 0x%x\n", (unsigned int) f->file_flags);
- if (f->file_os != 0)
- fprintf (e, " FILEOS 0x%x\n", (unsigned int) f->file_os);
- if (f->file_type != 0)
- fprintf (e, " FILETYPE 0x%x\n", (unsigned int) f->file_type);
- if (f->file_subtype != 0)
- fprintf (e, " FILESUBTYPE 0x%x\n", (unsigned int) f->file_subtype);
- if (f->file_date_ms != 0 || f->file_date_ls != 0)
- fprintf (e, "/* Date: %u, %u. */\n",
- (unsigned int) f->file_date_ms, (unsigned int) f->file_date_ls);
-
- fprintf (e, "BEGIN\n");
-
- for (vi = versioninfo->var; vi != NULL; vi = vi->next)
- {
- switch (vi->type)
- {
- case VERINFO_STRING:
- {
- const rc_ver_stringinfo *vs;
-
- fprintf (e, " BLOCK \"StringFileInfo\"\n");
- fprintf (e, " BEGIN\n");
- fprintf (e, " BLOCK ");
- unicode_print_quoted (e, vi->u.string.language, -1);
- fprintf (e, "\n");
- fprintf (e, " BEGIN\n");
-
- for (vs = vi->u.string.strings; vs != NULL; vs = vs->next)
- {
- fprintf (e, " VALUE ");
- unicode_print_quoted (e, vs->key, -1);
- fprintf (e, ", ");
- unicode_print_quoted (e, vs->value, -1);
- fprintf (e, "\n");
- }
-
- fprintf (e, " END\n");
- fprintf (e, " END\n");
- break;
- }
-
- case VERINFO_VAR:
- {
- const rc_ver_varinfo *vv;
-
- fprintf (e, " BLOCK \"VarFileInfo\"\n");
- fprintf (e, " BEGIN\n");
- fprintf (e, " VALUE ");
- unicode_print_quoted (e, vi->u.var.key, -1);
-
- for (vv = vi->u.var.var; vv != NULL; vv = vv->next)
- fprintf (e, ", 0x%x, %d", (unsigned int) vv->language,
- (int) vv->charset);
-
- fprintf (e, "\n END\n");
-
- break;
- }
- }
- }
-
- fprintf (e, "END\n");
-}
-
-static rc_uint_type
-rcdata_copy (const rc_rcdata_item *src, bfd_byte *dst)
-{
- if (! src)
- return 0;
- switch (src->type)
- {
- case RCDATA_WORD:
- if (dst)
- windres_put_16 (&wrtarget, dst, (rc_uint_type) src->u.word);
- return 2;
- case RCDATA_DWORD:
- if (dst)
- windres_put_32 (&wrtarget, dst, (rc_uint_type) src->u.dword);
- return 4;
- case RCDATA_STRING:
- if (dst && src->u.string.length)
- memcpy (dst, src->u.string.s, src->u.string.length);
- return (rc_uint_type) src->u.string.length;
- case RCDATA_WSTRING:
- if (dst && src->u.wstring.length)
- memcpy (dst, src->u.wstring.w, src->u.wstring.length * sizeof (unichar));
- return (rc_uint_type) (src->u.wstring.length * sizeof (unichar));
- case RCDATA_BUFFER:
- if (dst && src->u.buffer.length)
- memcpy (dst, src->u.buffer.data, src->u.buffer.length);
- return (rc_uint_type) src->u.buffer.length;
- default:
- abort ();
- }
- /* Never reached. */
- return 0;
-}
diff --git a/binutils/resres.c b/binutils/resres.c
deleted file mode 100644
index 2ad40b481a3..00000000000
--- a/binutils/resres.c
+++ /dev/null
@@ -1,737 +0,0 @@
-/* resres.c: read_res_file and write_res_file implementation for windres.
- Copyright 1998, 1999, 2001, 2002, 2007, 2008
- Free Software Foundation, Inc.
- Written by Anders Norlander <anorland@hem2.passagen.se>.
- Rewritten by Kai Tietz, Onevision.
-
- This file is part of GNU Binutils.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, 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 "sysdep.h"
-#include "bfd.h"
-#include "bucomm.h"
-#include "libiberty.h"
-#include "windres.h"
-
-#include <assert.h>
-#include <time.h>
-
-static rc_uint_type write_res_directory (windres_bfd *, rc_uint_type,
- const rc_res_directory *, const rc_res_id *,
- const rc_res_id *, rc_uint_type *, int);
-static rc_uint_type write_res_resource (windres_bfd *, rc_uint_type,const rc_res_id *,
- const rc_res_id *, const rc_res_resource *,
- rc_uint_type *);
-static rc_uint_type write_res_bin (windres_bfd *, rc_uint_type, const rc_res_resource *,
- const rc_res_id *, const rc_res_id *,
- const rc_res_res_info *);
-
-static rc_uint_type write_res_id (windres_bfd *, rc_uint_type, const rc_res_id *);
-static rc_uint_type write_res_info (windres_bfd *, rc_uint_type, const rc_res_res_info *);
-static rc_uint_type write_res_data_hdr (windres_bfd *, rc_uint_type, res_hdr *);
-
-static rc_uint_type write_res_header (windres_bfd *, rc_uint_type, rc_uint_type,
- const rc_res_id *, const rc_res_id *,
- const rc_res_res_info *);
-
-static int read_resource_entry (windres_bfd *, rc_uint_type *, rc_uint_type);
-static void read_res_data (windres_bfd *, rc_uint_type *, rc_uint_type, void *,
- rc_uint_type);
-static void read_res_data_hdr (windres_bfd *, rc_uint_type *, rc_uint_type, res_hdr *);
-static void read_res_id (windres_bfd *, rc_uint_type *, rc_uint_type, rc_res_id *);
-static unichar *read_unistring (windres_bfd *, rc_uint_type *, rc_uint_type, rc_uint_type *);
-static void skip_null_resource (windres_bfd *, rc_uint_type *, rc_uint_type);
-static int probe_binary (windres_bfd *wrbfd, rc_uint_type);
-
-static unsigned long get_id_size (const rc_res_id *);
-
-static void res_add_resource (rc_res_resource *, const rc_res_id *,
- const rc_res_id *, rc_uint_type, int);
-
-static void res_append_resource (rc_res_directory **, rc_res_resource *,
- int, const rc_res_id *, int);
-
-static rc_res_directory *resources = NULL;
-
-static const char *filename;
-
-extern char *program_name;
-
-/* Read resource file */
-rc_res_directory *
-read_res_file (const char *fn)
-{
- rc_uint_type off, flen;
- windres_bfd wrbfd;
- bfd *abfd;
- asection *sec;
- filename = fn;
-
- flen = (rc_uint_type) get_file_size (filename);
- if (! flen)
- fatal ("can't open '%s' for input.", filename);
- abfd = windres_open_as_binary (filename, 1);
- sec = bfd_get_section_by_name (abfd, ".data");
- if (sec == NULL)
- bfd_fatal ("bfd_get_section_by_name");
- set_windres_bfd (&wrbfd, abfd, sec,
- (target_is_bigendian ? WR_KIND_BFD_BIN_B
- : WR_KIND_BFD_BIN_L));
- off = 0;
-
- if (! probe_binary (&wrbfd, flen))
- set_windres_bfd_endianess (&wrbfd, ! target_is_bigendian);
-
- skip_null_resource (&wrbfd, &off, flen);
-
- while (read_resource_entry (&wrbfd, &off, flen))
- ;
-
- bfd_close (abfd);
-
- return resources;
-}
-
-/* Write resource file */
-void
-write_res_file (const char *fn,const rc_res_directory *resdir)
-{
- asection *sec;
- rc_uint_type language;
- bfd *abfd;
- windres_bfd wrbfd;
- unsigned long sec_length = 0,sec_length_wrote;
- static const bfd_byte 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};
-
- filename = fn;
-
- abfd = windres_open_as_binary (filename, 0);
- sec = bfd_make_section_with_flags (abfd, ".data",
- (SEC_HAS_CONTENTS | SEC_ALLOC
- | SEC_LOAD | SEC_DATA));
- if (sec == NULL)
- bfd_fatal ("bfd_make_section");
- /* Requiring this is probably a bug in BFD. */
- sec->output_section = sec;
-
- set_windres_bfd (&wrbfd, abfd, sec,
- (target_is_bigendian ? WR_KIND_BFD_BIN_B
- : WR_KIND_BFD_BIN_L));
-
- language = -1;
- sec_length = write_res_directory ((windres_bfd *) NULL, 0x20UL, resdir,
- (const rc_res_id *) NULL,
- (const rc_res_id *) NULL, &language, 1);
- if (! bfd_set_section_size (abfd, sec, (sec_length + 3) & ~3))
- bfd_fatal ("bfd_set_section_size");
- if ((sec_length & 3) != 0)
- set_windres_bfd_content (&wrbfd, sign, sec_length, 4-(sec_length & 3));
- set_windres_bfd_content (&wrbfd, sign, 0, sizeof (sign));
- language = -1;
- sec_length_wrote = write_res_directory (&wrbfd, 0x20UL, resdir,
- (const rc_res_id *) NULL,
- (const rc_res_id *) NULL,
- &language, 1);
- if (sec_length != sec_length_wrote)
- fatal ("res write failed with different sizes (%lu/%lu).",
- (unsigned long) sec_length, (unsigned long) sec_length_wrote);
-
- bfd_close (abfd);
- return;
-}
-
-/* Read a resource entry, returns 0 when all resources are read */
-static int
-read_resource_entry (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax)
-{
- rc_res_id type;
- rc_res_id name;
- rc_res_res_info resinfo;
- res_hdr reshdr;
- void *buff;
-
- rc_res_resource *r;
- struct bin_res_info l;
-
- off[0] = (off[0] + 3) & ~3;
-
- /* Read header */
- if ((off[0] + 8) > omax)
- return 0;
- read_res_data_hdr (wrbfd, off, omax, &reshdr);
-
- /* read resource type */
- read_res_id (wrbfd, off, omax, &type);
- /* read resource id */
- read_res_id (wrbfd, off, omax, &name);
-
- off[0] = (off[0] + 3) & ~3;
-
- /* Read additional resource header */
- read_res_data (wrbfd, off, omax, &l, BIN_RES_INFO_SIZE);
- resinfo.version = windres_get_32 (wrbfd, l.version, 4);
- resinfo.memflags = windres_get_16 (wrbfd, l.memflags, 2);
- resinfo.language = windres_get_16 (wrbfd, l.language, 2);
- /* resinfo.version2 = windres_get_32 (wrbfd, l.version2, 4); */
- resinfo.characteristics = windres_get_32 (wrbfd, l.characteristics, 4);
-
- off[0] = (off[0] + 3) & ~3;
-
- /* Allocate buffer for data */
- buff = res_alloc (reshdr.data_size);
- /* Read data */
- read_res_data (wrbfd, off, omax, buff, reshdr.data_size);
- /* Convert binary data to resource */
- r = bin_to_res (wrbfd, type, buff, reshdr.data_size);
- 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 rc_uint_type
-write_res_directory (windres_bfd *wrbfd, rc_uint_type off, const rc_res_directory *rd,
- const rc_res_id *type, const rc_res_id *name, rc_uint_type *language,
- int level)
-{
- const rc_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)
- off = write_res_directory (wrbfd, off, 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. */
- off = write_res_resource (wrbfd, off, type, name, re->u.res,
- language);
- }
- else
- {
- fprintf (stderr, "// Resource at unexpected level %d\n", level);
- off = write_res_resource (wrbfd, off, type, (rc_res_id *) NULL,
- re->u.res, language);
- }
- }
- }
-
- return off;
-}
-
-static rc_uint_type
-write_res_resource (windres_bfd *wrbfd, rc_uint_type off, const rc_res_id *type,
- const rc_res_id *name, const rc_res_resource *res,
- rc_uint_type *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;
-
- case RES_TYPE_TOOLBAR:
- rt = RT_TOOLBAR;
- 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 ();
- }
-
- return write_res_bin (wrbfd, off, res, type, name, &res->res_info);
-}
-
-/* Write a resource in binary resource format */
-static rc_uint_type
-write_res_bin (windres_bfd *wrbfd, rc_uint_type off, const rc_res_resource *res,
- const rc_res_id *type, const rc_res_id *name,
- const rc_res_res_info *resinfo)
-{
- rc_uint_type noff;
- rc_uint_type datasize = 0;
-
- noff = res_to_bin ((windres_bfd *) NULL, off, res);
- datasize = noff - off;
-
- off = write_res_header (wrbfd, off, datasize, type, name, resinfo);
- return res_to_bin (wrbfd, off, res);
-}
-
-/* Get number of bytes needed to store an id in binary format */
-static unsigned long
-get_id_size (id)
- const rc_res_id *id;
-{
- if (id->named)
- return sizeof (unichar) * (id->u.n.length + 1);
- else
- return sizeof (unichar) * 2;
-}
-
-/* Write a resource header */
-static rc_uint_type
-write_res_header (windres_bfd *wrbfd, rc_uint_type off, rc_uint_type datasize,
- const rc_res_id *type, const rc_res_id *name,
- const rc_res_res_info *resinfo)
-{
- 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;
-
- off = (off + 3) & ~3;
-
- off = write_res_data_hdr (wrbfd, off, &reshdr);
- off = write_res_id (wrbfd, off, type);
- off = write_res_id (wrbfd, off, name);
-
- off = (off + 3) & ~3;
-
- off = write_res_info (wrbfd, off, resinfo);
- off = (off + 3) & ~3;
- return off;
-}
-
-static rc_uint_type
-write_res_data_hdr (windres_bfd *wrbfd, rc_uint_type off, res_hdr *hdr)
-{
- if (wrbfd)
- {
- struct bin_res_hdr brh;
- windres_put_32 (wrbfd, brh.data_size, hdr->data_size);
- windres_put_32 (wrbfd, brh.header_size, hdr->header_size);
- set_windres_bfd_content (wrbfd, &brh, off, BIN_RES_HDR_SIZE);
- }
- return off + BIN_RES_HDR_SIZE;
-}
-
-static void
-read_res_data_hdr (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax,
- res_hdr *reshdr)
-{
- struct bin_res_hdr brh;
-
- if ((off[0] + BIN_RES_HDR_SIZE) > omax)
- fatal ("%s: unexpected end of file %ld/%ld", filename,(long) off[0], (long) omax);
-
- get_windres_bfd_content (wrbfd, &brh, off[0], BIN_RES_HDR_SIZE);
- reshdr->data_size = windres_get_32 (wrbfd, brh.data_size, 4);
- reshdr->header_size = windres_get_32 (wrbfd, brh.header_size, 4);
- off[0] += BIN_RES_HDR_SIZE;
-}
-
-/* Read data from file, abort on failure */
-static void
-read_res_data (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax, void *data,
- rc_uint_type size)
-{
- if ((off[0] + size) > omax)
- fatal ("%s: unexpected end of file %ld/%ld %ld", filename,(long) off[0],
- (long) omax, (long) size);
- get_windres_bfd_content (wrbfd, data, off[0], size);
- off[0] += size;
-}
-
-/* Write a resource id */
-static rc_uint_type
-write_res_id (windres_bfd *wrbfd, rc_uint_type off, const rc_res_id *id)
-{
- if (id->named)
- {
- rc_uint_type len = (((bfd_signed_vma) id->u.n.length < 0 ? 0 : id->u.n.length) + 1);
- if (wrbfd)
- {
- rc_uint_type i;
- bfd_byte *d = (bfd_byte *) xmalloc (len * sizeof (unichar));
- for (i = 0; i < (len - 1); i++)
- windres_put_16 (wrbfd, d + (i * sizeof (unichar)), id->u.n.name[i]);
- windres_put_16 (wrbfd, d + (i * sizeof (unichar)), 0);
- set_windres_bfd_content (wrbfd, d, off, (len * sizeof (unichar)));
- }
- off += (len * sizeof (unichar));
- }
- else
- {
- if (wrbfd)
- {
- struct bin_res_id bid;
- windres_put_16 (wrbfd, bid.sig, 0xffff);
- windres_put_16 (wrbfd, bid.id, id->u.id);
- set_windres_bfd_content (wrbfd, &bid, off, BIN_RES_ID);
- }
- off += BIN_RES_ID;
- }
- return off;
-}
-
-/* Write resource info */
-static rc_uint_type
-write_res_info (windres_bfd *wrbfd, rc_uint_type off, const rc_res_res_info *info)
-{
- if (wrbfd)
- {
- struct bin_res_info l;
-
- windres_put_32 (wrbfd, l.version, info->version);
- windres_put_16 (wrbfd, l.memflags, info->memflags);
- windres_put_16 (wrbfd, l.language, info->language);
- windres_put_32 (wrbfd, l.version2, info->version);
- windres_put_32 (wrbfd, l.characteristics, info->characteristics);
- set_windres_bfd_content (wrbfd, &l, off, BIN_RES_INFO_SIZE);
- }
- return off + BIN_RES_INFO_SIZE;
-}
-
-/* read a resource identifier */
-static void
-read_res_id (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax, rc_res_id *id)
-{
- struct bin_res_id bid;
- unsigned short ord;
- unichar *id_s = NULL;
- rc_uint_type len;
-
- read_res_data (wrbfd, off, omax, &bid, BIN_RES_ID - 2);
- ord = (unsigned short) windres_get_16 (wrbfd, bid.sig, 2);
- if (ord == 0xFFFF) /* an ordinal id */
- {
- read_res_data (wrbfd, off, omax, bid.id, BIN_RES_ID - 2);
- id->named = 0;
- id->u.id = windres_get_16 (wrbfd, bid.id, 2);
- }
- else
- /* named id */
- {
- off[0] -= 2;
- id_s = read_unistring (wrbfd, off, omax, &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 (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax,
- rc_uint_type *len)
-{
- unichar *s;
- bfd_byte d[2];
- unichar c;
- unichar *p;
- rc_uint_type l;
- rc_uint_type soff = off[0];
-
- do
- {
- read_res_data (wrbfd, &soff, omax, d, sizeof (unichar));
- c = windres_get_16 (wrbfd, d, 2);
- }
- while (c != 0);
- l = ((soff - off[0]) / sizeof (unichar));
-
- /* there are hardly any names longer than 256 characters, but anyway. */
- p = s = (unichar *) xmalloc (sizeof (unichar) * l);
- do
- {
- read_res_data (wrbfd, off, omax, d, sizeof (unichar));
- c = windres_get_16 (wrbfd, d, 2);
- *p++ = c;
- }
- while (c != 0);
- *len = l - 1;
- return s;
-}
-
-static int
-probe_binary (windres_bfd *wrbfd, rc_uint_type omax)
-{
- rc_uint_type off;
- res_hdr reshdr;
-
- off = 0;
- read_res_data_hdr (wrbfd, &off, omax, &reshdr);
- if (reshdr.data_size != 0)
- return 1;
- if ((reshdr.header_size != 0x20 && ! target_is_bigendian)
- || (reshdr.header_size != 0x20000000 && target_is_bigendian))
- return 1;
-
- /* Subtract size of HeaderSize. DataSize has to be zero. */
- off += 0x20 - BIN_RES_HDR_SIZE;
- if ((off + BIN_RES_HDR_SIZE) >= omax)
- return 1;
- read_res_data_hdr (wrbfd, &off, omax, &reshdr);
- /* off is advanced by BIN_RES_HDR_SIZE in read_res_data_hdr()
- which is part of reshdr.header_size. We shouldn't take it
- into account twice. */
- if ((off - BIN_RES_HDR_SIZE + reshdr.data_size + reshdr.header_size) > omax)
- return 0;
- return 1;
-}
-
-/* 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 (windres_bfd *wrbfd, rc_uint_type *off, rc_uint_type omax)
-{
- res_hdr reshdr;
- read_res_data_hdr (wrbfd, off, omax, &reshdr);
- if (reshdr.data_size != 0)
- goto skip_err;
- if ((reshdr.header_size != 0x20 && ! target_is_bigendian)
- || (reshdr.header_size != 0x20000000 && target_is_bigendian))
- goto skip_err;
-
- /* Subtract size of HeaderSize. DataSize has to be zero. */
- off[0] += 0x20 - BIN_RES_HDR_SIZE;
- if (off[0] >= omax)
- 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 */
-static void
-res_add_resource (rc_res_resource *r, const rc_res_id *type, const rc_res_id *id,
- rc_uint_type language, int dupok)
-{
- rc_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.
- */
-static void
-res_append_resource (rc_res_directory **resources, rc_res_resource *resource,
- int cids, const rc_res_id *ids, int dupok)
-{
- rc_res_entry *re = NULL;
- int i;
-
- assert (cids > 0);
- for (i = 0; i < cids; i++)
- {
- rc_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 = ((rc_res_directory *)
- res_alloc (sizeof (rc_res_directory)));
- (*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 = (rc_res_entry *) res_alloc (sizeof (rc_res_entry));
- 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;
-}
diff --git a/binutils/size.c b/binutils/size.c
deleted file mode 100644
index 415fee1011f..00000000000
--- a/binutils/size.c
+++ /dev/null
@@ -1,611 +0,0 @@
-/* size.c -- report size of various sections of an executable file.
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
-
- This file is part of GNU Binutils.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, 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 "sysdep.h"
-#include "bfd.h"
-#include "libiberty.h"
-#include "getopt.h"
-#include "bucomm.h"
-
-#ifndef BSD_DEFAULT
-#define BSD_DEFAULT 1
-#endif
-
-/* Program options. */
-
-static enum
- {
- decimal, octal, hex
- }
-radix = decimal;
-
-/* 0 means use AT&T-style output. */
-static int berkeley_format = BSD_DEFAULT;
-
-static int show_version = 0;
-static int show_help = 0;
-static int show_totals = 0;
-static int show_common = 0;
-
-static bfd_size_type common_size;
-static bfd_size_type total_bsssize;
-static bfd_size_type total_datasize;
-static bfd_size_type total_textsize;
-
-/* Program exit status. */
-static int return_code = 0;
-
-static char *target = NULL;
-
-/* Forward declarations. */
-
-static void display_file (char *);
-static void rprint_number (int, bfd_size_type);
-static void print_sizes (bfd * file);
-
-static void
-usage (FILE *stream, int status)
-{
- fprintf (stream, _("Usage: %s [option(s)] [file(s)]\n"), program_name);
- fprintf (stream, _(" Displays the sizes of sections inside binary files\n"));
- fprintf (stream, _(" If no input file(s) are specified, a.out is assumed\n"));
- fprintf (stream, _(" The options are:\n\
- -A|-B --format={sysv|berkeley} Select output style (default is %s)\n\
- -o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex\n\
- -t --totals Display the total sizes (Berkeley only)\n\
- --common Display total size for *COM* syms\n\
- --target=<bfdname> Set the binary file format\n\
- @<file> Read options from <file>\n\
- -h --help Display this information\n\
- -v --version Display the program's version\n\
-\n"),
-#if BSD_DEFAULT
- "berkeley"
-#else
- "sysv"
-#endif
-);
- list_supported_targets (program_name, stream);
- if (REPORT_BUGS_TO[0] && status == 0)
- fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO);
- exit (status);
-}
-
-#define OPTION_FORMAT (200)
-#define OPTION_RADIX (OPTION_FORMAT + 1)
-#define OPTION_TARGET (OPTION_RADIX + 1)
-
-static struct option long_options[] =
-{
- {"common", no_argument, &show_common, 1},
- {"format", required_argument, 0, OPTION_FORMAT},
- {"radix", required_argument, 0, OPTION_RADIX},
- {"target", required_argument, 0, OPTION_TARGET},
- {"totals", no_argument, &show_totals, 1},
- {"version", no_argument, &show_version, 1},
- {"help", no_argument, &show_help, 1},
- {0, no_argument, 0, 0}
-};
-
-int main (int, char **);
-
-int
-main (int argc, char **argv)
-{
- int temp;
- int c;
-
-#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
- setlocale (LC_MESSAGES, "");
-#endif
-#if defined (HAVE_SETLOCALE)
- setlocale (LC_CTYPE, "");
-#endif
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
-
- program_name = *argv;
- xmalloc_set_program_name (program_name);
-
- expandargv (&argc, &argv);
-
- bfd_init ();
- set_default_bfd_target ();
-
- while ((c = getopt_long (argc, argv, "ABHhVvdfotx", long_options,
- (int *) 0)) != EOF)
- switch (c)
- {
- case OPTION_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 OPTION_TARGET:
- target = optarg;
- break;
-
- case OPTION_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':
- case 'V':
- show_version = 1;
- break;
- case 'd':
- radix = decimal;
- break;
- case 'x':
- radix = hex;
- break;
- case 'o':
- radix = octal;
- break;
- case 't':
- show_totals = 1;
- 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 'h':
- case 'H':
- 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++]);
-
- if (show_totals && berkeley_format)
- {
- bfd_size_type total = total_textsize + total_datasize + total_bsssize;
-
- rprint_number (7, total_textsize);
- putchar('\t');
- rprint_number (7, total_datasize);
- putchar('\t');
- rprint_number (7, total_bsssize);
- printf (((radix == octal) ? "\t%7lo\t%7lx\t" : "\t%7lu\t%7lx\t"),
- (unsigned long) total, (unsigned long) total);
- fputs ("(TOTALS)\n", stdout);
- }
-
- return return_code;
-}
-
-/* Total size required for common symbols in ABFD. */
-
-static void
-calculate_common_size (bfd *abfd)
-{
- asymbol **syms = NULL;
- long storage, symcount;
-
- common_size = 0;
- if ((bfd_get_file_flags (abfd) & (EXEC_P | DYNAMIC | HAS_SYMS)) != HAS_SYMS)
- return;
-
- storage = bfd_get_symtab_upper_bound (abfd);
- if (storage < 0)
- bfd_fatal (bfd_get_filename (abfd));
- if (storage)
- syms = xmalloc (storage);
-
- symcount = bfd_canonicalize_symtab (abfd, syms);
- if (symcount < 0)
- bfd_fatal (bfd_get_filename (abfd));
-
- while (--symcount >= 0)
- {
- asymbol *sym = syms[symcount];
-
- if (bfd_is_com_section (sym->section)
- && (sym->flags & BSF_SECTION_SYM) == 0)
- common_size += sym->value;
- }
- free (syms);
-}
-
-/* Display stats on file or archive member ABFD. */
-
-static void
-display_bfd (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 (bfd *file)
-{
- bfd *arfile = (bfd *) NULL;
- bfd *last_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);
-
- if (last_arfile != NULL)
- bfd_close (last_arfile);
- last_arfile = arfile;
- }
-
- if (last_arfile != NULL)
- bfd_close (last_arfile);
-}
-
-static void
-display_file (char *filename)
-{
- bfd *file;
-
- if (get_file_size (filename) < 1)
- {
- return_code = 1;
- return;
- }
-
- file = bfd_openr (filename, target);
- if (file == NULL)
- {
- bfd_nonfatal (filename);
- return_code = 1;
- return;
- }
-
- if (bfd_check_format (file, bfd_archive))
- display_archive (file);
- else
- display_bfd (file);
-
- if (!bfd_close (file))
- {
- bfd_nonfatal (filename);
- return_code = 1;
- return;
- }
-}
-
-static int
-size_number (bfd_size_type num)
-{
- char buffer[40];
-
- sprintf (buffer,
- (radix == decimal ? "%" BFD_VMA_FMT "u" :
- ((radix == octal) ? "0%" BFD_VMA_FMT "o" : "0x%" BFD_VMA_FMT "x")),
- num);
-
- return strlen (buffer);
-}
-
-static void
-rprint_number (int width, bfd_size_type num)
-{
- char buffer[40];
-
- sprintf (buffer,
- (radix == decimal ? "%" BFD_VMA_FMT "u" :
- ((radix == octal) ? "0%" BFD_VMA_FMT "o" : "0x%" BFD_VMA_FMT "x")),
- num);
-
- printf ("%*s", width, buffer);
-}
-
-static bfd_size_type bsssize;
-static bfd_size_type datasize;
-static bfd_size_type textsize;
-
-static void
-berkeley_sum (bfd *abfd ATTRIBUTE_UNUSED, sec_ptr sec,
- void *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 (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 (bfd *abfd)
-{
- static int files_seen = 0;
- bfd_size_type total;
-
- bsssize = 0;
- datasize = 0;
- textsize = 0;
-
- bfd_map_over_sections (abfd, berkeley_sum, NULL);
-
- bsssize += common_size;
- if (files_seen++ == 0)
- puts ((radix == octal) ? " text\t data\t bss\t oct\t hex\tfilename" :
- " text\t data\t bss\t dec\t hex\tfilename");
-
- total = textsize + datasize + bsssize;
-
- if (show_totals)
- {
- total_textsize += textsize;
- total_datasize += datasize;
- total_bsssize += 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 (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec,
- void *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_one_line (const char *name, bfd_size_type size, bfd_vma vma)
-{
- printf ("%-*s ", svi_namelen, name);
- rprint_number (svi_sizelen, size);
- printf (" ");
- rprint_number (svi_vmalen, vma);
- printf ("\n");
-}
-
-static void
-sysv_internal_printer (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec,
- void *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;
-
- sysv_one_line (bfd_section_name (file, sec),
- size,
- bfd_section_vma (file, sec));
- }
-}
-
-static void
-print_sysv_format (bfd *file)
-{
- /* Size all of the columns. */
- svi_total = 0;
- svi_maxvma = 0;
- svi_namelen = 0;
- bfd_map_over_sections (file, sysv_internal_sizer, NULL);
- if (show_common)
- {
- if (svi_namelen < (int) sizeof ("*COM*") - 1)
- svi_namelen = sizeof ("*COM*") - 1;
- svi_total += common_size;
- }
-
- 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, NULL);
- if (show_common)
- {
- svi_total += common_size;
- sysv_one_line ("*COM*", common_size, 0);
- }
-
- printf ("%-*s ", svi_namelen, "Total");
- rprint_number (svi_sizelen, svi_total);
- printf ("\n\n");
-}
-
-static void
-print_sizes (bfd *file)
-{
- if (show_common)
- calculate_common_size (file);
- if (berkeley_format)
- print_berkeley_format (file);
- else
- print_sysv_format (file);
-}
diff --git a/binutils/windmc.c b/binutils/windmc.c
deleted file mode 100644
index 283c2657506..00000000000
--- a/binutils/windmc.c
+++ /dev/null
@@ -1,1206 +0,0 @@
-/* windmc.c -- a program to compile Windows message files.
- Copyright 2007, 2008
- Free Software Foundation, Inc.
- Written by Kai Tietz, Onevision.
-
- This file is part of GNU Binutils.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-
-/* This program can read and comile Windows message format.
-
- It is based on information taken from the following sources:
-
- * Microsoft documentation.
-
- * The wmc program, written by Bertho A. Stultiens (BS). */
-
-#include "sysdep.h"
-#include <assert.h>
-#include <time.h>
-#include "bfd.h"
-#include "getopt.h"
-#include "bucomm.h"
-#include "libiberty.h"
-#include "safe-ctype.h"
-#include "obstack.h"
-
-#include "windmc.h"
-#include "windint.h"
-
-/* Defines a message compiler element item with length and offset
- information. */
-typedef struct mc_msg_item
-{
- rc_uint_type res_len;
- rc_uint_type res_off;
- struct bin_messagetable_item *res;
-} mc_msg_item;
-
-/* Defined in bfd/binary.c. Used to set architecture and machine of input
- binary files. */
-extern enum bfd_architecture bfd_external_binary_architecture;
-extern unsigned long bfd_external_machine;
-
-int target_is_bigendian = 0;
-const char *def_target_arch;
-
-/* Globals and static variable definitions. */
-
-/* bfd global helper struct variable. */
-static struct
-{
- bfd *abfd;
- asection *sec;
-} mc_bfd;
-
-/* Memory list. */
-mc_node *mc_nodes = NULL;
-static mc_node_lang **mc_nodes_lang = NULL;
-static int mc_nodes_lang_count = 0;
-static mc_keyword **mc_severity_codes = NULL;
-static int mc_severity_codes_count = 0;
-static mc_keyword **mc_facility_codes = NULL;
-static int mc_facility_codes_count = 0;
-
-/* When we are building a resource tree, we allocate everything onto
- an obstack, so that we can free it all at once if we want. */
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
-
-/* The resource building obstack. */
-static struct obstack res_obstack;
-
-/* Flag variables. */
-/* Set by -C. Set the default code page to be used for input text file. */
-static rc_uint_type mcset_codepage_in = 0;
-
-/* Set by -O. Set the default code page to be used for output text files. */
-static rc_uint_type mcset_codepage_out = 0;
-
-/* Set by -b. .BIN filename should have .mc filename_ included for uniqueness. */
-static int mcset_prefix_bin = 0;
-
-/* The base name of the .mc file. */
-static const char *mcset_mc_basename = "unknown";
-
-/* Set by -e <ext>. Specify the extension for the header file. */
-static const char *mcset_header_ext = ".h";
-
-/* Set by -h <path>. Gives the path of where to create the C include file. */
-static const char *mcset_header_dir = "./";
-
-/* Set by -r <path>. Gives the path of where to create the RC include file
- and the binary message resource files it includes. */
-static const char *mcset_rc_dir = "./";
-
-/* Modified by -a & -u. By -u input file is unicode, by -a is ASCII (default). */
-static int mcset_text_in_is_unicode = 0;
-
-/* Modified by -A & -U. By -U bin file is unicode (default), by -A is ASCII. */
-static int mcset_bin_out_is_unicode = 1;
-
-/* Set by -c. Sets the Customer bit in all the message ID's. */
-int mcset_custom_bit = 0;
-
-/* Set by -o. Generate OLE2 header file. Use HRESULT definition instead of
- status code definition. */
-static int mcset_use_hresult = 0;
-
-/* Set by -m <msglen>. Generate a warning if the size of any message exceeds
- maxmsglen characters. */
-rc_uint_type mcset_max_message_length = 0;
-
-/* Set by -d. Sets message values in header to decimal initially. */
-int mcset_out_values_are_decimal = 0;
-
-/* Set by -n. terminates all strings with null's in the message tables. */
-static int mcset_automatic_null_termination = 0;
-
-/* The type used for message id output in header. */
-unichar *mcset_msg_id_typedef = NULL;
-
-/* Set by -x path. Geberated debug C file for mapping ID's to text. */
-static const char *mcset_dbg_dir = NULL;
-
-/* getopt long name definitions. */
-static const struct option long_options[] =
-{
- {"binprefix", no_argument, 0, 'b'},
- {"target", required_argument, 0, 'F'},
- {"extension", required_argument, 0, 'e'},
- {"headerdir", required_argument, 0, 'h'},
- {"rcdir", required_argument, 0, 'r'},
- {"verbose", no_argument, 0, 'v'},
- {"codepage_in", required_argument, 0, 'C'},
- {"codepage_out", required_argument, 0, 'O'},
- {"maxlength", required_argument, 0, 'm'},
- {"ascii_in", no_argument, 0, 'a'},
- {"ascii_out", no_argument, 0, 'A'},
- {"unicode_in", no_argument, 0, 'u'},
- {"unicode_out", no_argument, 0, 'U'},
- {"customflag", no_argument, 0, 'c'},
- {"decimal_values", no_argument, 0, 'd'},
- {"hresult_use", no_argument, 0, 'o'},
- {"nullterminate", no_argument, 0, 'n'},
- {"xdbg", required_argument, 0, 'x'},
- {"version", no_argument, 0, 'V'},
- {"help", no_argument, 0, 'H'},
- {0, no_argument, 0, 0}
-};
-
-
-/* Initialize the resource building obstack. */
-static void
-res_init (void)
-{
- obstack_init (&res_obstack);
-}
-
-/* Allocate space on the resource building obstack. */
-void *
-res_alloc (rc_uint_type bytes)
-{
- return (void *) obstack_alloc (&res_obstack, (size_t) bytes);
-}
-
-static FILE *
-mc_create_path_text_file (const char *path, const char *ext)
-{
- FILE *ret;
- size_t len = 1;
- char *hsz;
-
- len += (path != NULL ? strlen (path) : 0);
- len += strlen (mcset_mc_basename);
- len += (ext != NULL ? strlen (ext) : 0);
- hsz = xmalloc (len);
- sprintf (hsz, "%s%s%s", (path != NULL ? path : ""), mcset_mc_basename,
- (ext != NULL ? ext : ""));
- if ((ret = fopen (hsz, "wb")) == NULL)
- fatal (_("can't create %s file ,%s' for output.\n"), (ext ? ext : "text"), hsz);
- free (hsz);
- return ret;
-}
-
-static void
-usage (FILE *stream, int status)
-{
- fprintf (stream, _("Usage: %s [option(s)] [input-file]\n"),
- program_name);
- fprintf (stream, _(" The options are:\n\
- -a --ascii_in Read input file as ASCII file\n\
- -A --ascii_out Write binary messages as ASCII\n\
- -b --binprefix .bin filename is prefixed by .mc filename_ for uniqueness.\n\
- -c --customflag Set custom flags for messages\n\
- -C --codepage_in=<val> Set codepage when reading mc text file\n\
- -d --decimal_values Print values to text files decimal\n\
- -e --extension=<extension> Set header extension used on export header file\n\
- -F --target <target> Specify output target for endianess.\n\
- -h --headerdir=<directory> Set the export directory for headers\n\
- -u --unicode_in Read input file as UTF16 file\n\
- -U --unicode_out Write binary messages as UFT16\n\
- -m --maxlength=<val> Set the maximal allowed message length\n\
- -n --nullterminate Automatic add a zero termination to strings\n\
- -o --hresult_use Use HRESULT definition instead of status code definition\n\
- -O --codepage_out=<val> Set codepage used for writing text file\n\
- -r --rcdir=<directory> Set the export directory for rc files\n\
- -x --xdbg=<directory> Where to create the .dbg C include file\n\
- that maps message ID's to their symbolic name.\n\
-"));
- fprintf (stream, _("\
- -H --help Print this help message\n\
- -v --verbose Verbose - tells you what it's doing\n\
- -V --version Print version information\n"));
-
- list_supported_targets (program_name, stream);
-
- if (REPORT_BUGS_TO[0] && status == 0)
- fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO);
-
- exit (status);
-}
-
-static void
-set_endianess (bfd *abfd, const char *target)
-{
- const bfd_target *target_vec;
-
- def_target_arch = NULL;
- target_vec = bfd_find_target (target, abfd);
- if (! target_vec)
- fatal ("Can't detect target endianess and architecture.");
- target_is_bigendian = ((target_vec->byteorder == BFD_ENDIAN_BIG) ? 1 : 0);
-
- {
- const char * tname = target_vec->name;
- const char ** arches = bfd_arch_list ();
-
- if (arches && tname)
- {
- const char ** arch = arches;
-
- if (strchr (tname, '-') != NULL)
- tname = strchr (tname, '-') + 1;
-
- while (*arch != NULL)
- {
- const char *in_a = strstr (*arch, tname);
- char end_ch = (in_a ? in_a[strlen (tname)] : 0);
-
- if (in_a && (in_a == *arch || in_a[-1] == ':')
- && end_ch == 0)
- {
- def_target_arch = *arch;
- break;
- }
- arch++;
- }
- }
-
- free (arches);
-
- if (! def_target_arch)
- fatal ("Can't detect architecture.");
- }
-}
-
-static int
-probe_codepage (rc_uint_type *cp, int *is_uni, const char *pswitch, int defmode)
-{
- if (*is_uni == -1)
- {
- if (*cp != CP_UTF16)
- *is_uni = defmode;
- else
- *is_uni = 1;
- }
- if (*is_uni)
- {
- if (*cp != 0 && *cp != CP_UTF16)
- {
- fprintf (stderr, _("%s: warning: "), program_name);
- fprintf (stderr, _("A codepage was specified switch ,%s' and UTF16.\n"), pswitch);
- fprintf (stderr, _("\tcodepage settings are ignored.\n"));
- }
- *cp = CP_UTF16;
- return 1;
- }
- if (*cp == CP_UTF16)
- {
- *is_uni = 1;
- return 1;
- }
- if (*cp == 0)
- *cp = 1252;
- if (! unicode_is_valid_codepage (*cp))
- fatal ("Code page 0x%x is unknown.", (unsigned int) *cp);
- *is_uni = 0;
- return 1;
-}
-
-mc_node *
-mc_add_node (void)
-{
- mc_node *ret;
-
- ret = res_alloc (sizeof (mc_node));
- memset (ret, 0, sizeof (mc_node));
- if (! mc_nodes)
- mc_nodes = ret;
- else
- {
- mc_node *h = mc_nodes;
-
- while (h->next != NULL)
- h = h->next;
- h->next = ret;
- }
- return ret;
-}
-
-mc_node_lang *
-mc_add_node_lang (mc_node *root, const mc_keyword *lang, rc_uint_type vid)
-{
- mc_node_lang *ret, *h, *p;
-
- if (! lang || ! root)
- fatal (_("try to add a ill language."));
- ret = res_alloc (sizeof (mc_node_lang));
- memset (ret, 0, sizeof (mc_node_lang));
- ret->lang = lang;
- ret->vid = vid;
- if ((h = root->sub) == NULL)
- root->sub = ret;
- else
- {
- p = NULL;
- while (h != NULL)
- {
- if (h->lang->nval > lang->nval)
- break;
- if (h->lang->nval == lang->nval)
- {
- if (h->vid > vid)
- break;
- if (h->vid == vid)
- fatal ("double defined message id %ld.\n", (long) vid);
- }
- h = (p = h)->next;
- }
- ret->next = h;
- if (! p)
- root->sub = ret;
- else
- p->next = ret;
- }
- return ret;
-}
-
-static char *
-convert_unicode_to_ACP (const unichar *usz)
-{
- char *s;
- rc_uint_type l;
-
- if (! usz)
- return NULL;
- codepage_from_unicode (&l, usz, &s, mcset_codepage_out);
- if (! s)
- fatal ("unicode string not mappable to ASCII codepage 0x%lx.\n",
- (unsigned long) mcset_codepage_out);
- return s;
-}
-
-static void
-write_dbg_define (FILE *fp, const unichar *sym_name, const unichar *typecast)
-{
- char *sym;
-
- if (!sym_name || sym_name[0] == 0)
- return;
- sym = convert_unicode_to_ACP (sym_name);
- fprintf (fp, " {(");
- if (typecast)
- unicode_print (fp, typecast, unichar_len (typecast));
- else
- fprintf (fp, "DWORD");
- fprintf (fp, ") %s, \"%s\" },\n", sym, sym);
-}
-
-static void
-write_header_define (FILE *fp, const unichar *sym_name, rc_uint_type vid, const unichar *typecast, mc_node_lang *nl)
-{
- char *sym;
- char *tdef = NULL;
-
- if (!sym_name || sym_name[0] == 0)
- {
- if (nl != NULL)
- {
- if (mcset_out_values_are_decimal)
- fprintf (fp, "//\n// MessageId: 0x%lu\n//\n", (unsigned long) vid);
- else
- fprintf (fp, "//\n// MessageId: 0x%lx\n//\n", (unsigned long) vid);
- }
- return;
- }
- sym = convert_unicode_to_ACP (sym_name);
- if (typecast && typecast[0] != 0)
- tdef = convert_unicode_to_ACP (typecast);
- fprintf (fp, "//\n// MessageId: %s\n//\n", sym);
- if (! mcset_out_values_are_decimal)
- fprintf (fp, "#define %s %s%s%s 0x%lx\n\n", sym,
- (tdef ? "(" : ""), (tdef ? tdef : ""), (tdef ? ")" : ""),
- (unsigned long) vid);
- else
- fprintf (fp, "#define %s %s%s%s 0x%lu\n\n", sym,
- (tdef ? "(" : ""), (tdef ? tdef : ""), (tdef ? ")" : ""),
- (unsigned long) vid);
-}
-
-static int
-sort_mc_node_lang (const void *l, const void *r)
-{
- const mc_node_lang *l1 = *((const mc_node_lang **)l);
- const mc_node_lang *r1 = *((const mc_node_lang **)r);
-
- if (l == r)
- return 0;
- if (l1->lang != r1->lang)
- {
- if (l1->lang->nval < r1->lang->nval)
- return -1;
- return 1;
- }
- if (l1->vid == r1->vid)
- return 0;
- if (l1->vid < r1->vid)
- return -1;
- return 1;
-}
-
-static int
-sort_keyword_by_nval (const void *l, const void *r)
-{
- const mc_keyword *l1 = *((const mc_keyword **)l);
- const mc_keyword *r1 = *((const mc_keyword **)r);
- rc_uint_type len1, len2;
- int e;
-
- if (l == r)
- return 0;
- if (l1->nval != r1->nval)
- {
- if (l1->nval < r1->nval)
- return -1;
- return 1;
- }
- len1 = unichar_len (l1->usz);
- len2 = unichar_len (r1->usz);
- if (len1 <= len2)
- e = memcmp (l1->usz, r1->usz, sizeof (unichar) * len1);
- else
- e = memcmp (l1->usz, r1->usz, sizeof (unichar) * len2);
- if (e)
- return e;
- if (len1 < len2)
- return -1;
- else if (len1 > len2)
- return 1;
- return 0;
-}
-
-static void
-do_sorts (void)
-{
- mc_node *h;
- mc_node_lang *n;
- const mc_keyword *k;
- int i;
-
- /* Sort message by their language and id ascending. */
- mc_nodes_lang_count = 0;
-
- h = mc_nodes;
- while (h != NULL)
- {
- n = h->sub;
- while (n != NULL)
- {
- mc_nodes_lang_count +=1;
- n = n->next;
- }
- h = h->next;
- }
-
- if (mc_nodes_lang_count != 0)
- {
- h = mc_nodes;
- i = 0;
- mc_nodes_lang = xmalloc (sizeof (mc_node_lang *) * mc_nodes_lang_count);
-
- while (h != NULL)
- {
- n = h->sub;
- while (n != NULL)
- {
- mc_nodes_lang[i++] = n;
- n = n->next;
- }
- h = h->next;
- }
- qsort (mc_nodes_lang, (size_t) mc_nodes_lang_count, sizeof (mc_node_lang *), sort_mc_node_lang);
- }
- /* Sort facility code definitions by there id ascending. */
- i = 0;
- while ((k = enum_facility (i)) != NULL)
- ++i;
- mc_facility_codes_count = i;
- if (i != 0)
- {
- mc_facility_codes = xmalloc (sizeof (mc_keyword *) * i);
- i = 0;
- while ((k = enum_facility (i)) != NULL)
- mc_facility_codes[i++] = (mc_keyword *) k;
- qsort (mc_facility_codes, (size_t) mc_facility_codes_count, sizeof (mc_keyword *), sort_keyword_by_nval);
- }
-
- /* Sort severity code definitions by there id ascending. */
- i = 0;
- while ((k = enum_severity (i)) != NULL)
- ++i;
- mc_severity_codes_count = i;
- if (i != 0)
- {
- mc_severity_codes = xmalloc (sizeof (mc_keyword *) * i);
- i = 0;
- while ((k = enum_severity (i)) != NULL)
- mc_severity_codes[i++] = (mc_keyword *) k;
- qsort (mc_severity_codes, (size_t) mc_severity_codes_count, sizeof (mc_keyword *), sort_keyword_by_nval);
- }
-}
-
-static int
-mc_get_block_count (mc_node_lang **nl, int elems)
-{
- rc_uint_type exid;
- int i, ret;
-
- if (! nl)
- return 0;
- i = 0;
- ret = 0;
- while (i < elems)
- {
- ret++;
- exid = nl[i++]->vid;
- while (i < elems && nl[i]->vid == exid + 1)
- exid = nl[i++]->vid;
- }
- return ret;
-}
-
-static bfd *
-windmc_open_as_binary (const char *filename)
-{
- bfd *abfd;
-
- abfd = bfd_openw (filename, "binary");
- if (! abfd)
- fatal ("can't open `%s' for output", filename);
-
- return abfd;
-}
-
-static void
-target_put_16 (void *p, rc_uint_type value)
-{
- assert (!! p);
-
- if (target_is_bigendian)
- bfd_putb16 (value, p);
- else
- bfd_putl16 (value, p);
-}
-
-static void
-target_put_32 (void *p, rc_uint_type value)
-{
- assert (!! p);
-
- if (target_is_bigendian)
- bfd_putb32 (value, p);
- else
- bfd_putl32 (value, p);
-}
-
-static struct bin_messagetable_item *
-mc_generate_bin_item (mc_node_lang *n, rc_uint_type *res_len)
-{
- struct bin_messagetable_item *ret = NULL;
- rc_uint_type len;
-
- *res_len = 0;
- if (mcset_bin_out_is_unicode == 1)
- {
- unichar *ht = n->message;
- rc_uint_type txt_len;
-
- txt_len = unichar_len (n->message);
- if (mcset_automatic_null_termination && txt_len != 0)
- {
- while (txt_len > 0 && ht[txt_len - 1] > 0 && ht[txt_len - 1] < 0x20)
- ht[--txt_len] = 0;
- }
- txt_len *= sizeof (unichar);
- len = BIN_MESSAGETABLE_ITEM_SIZE + txt_len + sizeof (unichar);
- ret = res_alloc ((len + 3) & ~3);
- memset (ret, 0, (len + 3) & ~3);
- target_put_16 (ret->length, (len + 3) & ~3);
- target_put_16 (ret->flags, MESSAGE_RESOURCE_UNICODE);
- txt_len = 0;
- while (*ht != 0)
- {
- target_put_16 (ret->data + txt_len, *ht++);
- txt_len += 2;
- }
- }
- else
- {
- rc_uint_type txt_len, l;
- char *cvt_txt;
-
- codepage_from_unicode( &l, n->message, &cvt_txt, n->lang->lang_info.wincp);
- if (! cvt_txt)
- fatal ("Failed to convert message to language codepage.\n");
- txt_len = strlen (cvt_txt);
- if (mcset_automatic_null_termination && txt_len > 0)
- {
- while (txt_len > 0 && cvt_txt[txt_len - 1] > 0 && cvt_txt[txt_len - 1] < 0x20)
- cvt_txt[--txt_len] = 0;
- }
- len = BIN_MESSAGETABLE_ITEM_SIZE + txt_len + 1;
- ret = res_alloc ((len + 3) & ~3);
- memset (ret, 0, (len + 3) & ~3);
- target_put_16 (ret->length, (len + 3) & ~3);
- target_put_16 (ret->flags, 0);
- strcpy ((char *) ret->data, cvt_txt);
- }
- *res_len = (len + 3) & ~3;
- return ret;
-}
-
-static void
-mc_write_blocks (struct bin_messagetable *mtbl, mc_node_lang **nl, mc_msg_item *ml, int elems)
-{
- int i, idx = 0;
- rc_uint_type exid;
-
- if (! nl)
- return;
- i = 0;
- while (i < elems)
- {
- target_put_32 (mtbl->items[idx].lowid, nl[i]->vid);
- target_put_32 (mtbl->items[idx].highid, nl[i]->vid);
- target_put_32 (mtbl->items[idx].offset, ml[i].res_off);
- exid = nl[i++]->vid;
- while (i < elems && nl[i]->vid == exid + 1)
- {
- target_put_32 (mtbl->items[idx].highid, nl[i]->vid);
- exid = nl[i++]->vid;
- }
- ++idx;
- }
-}
-
-static void
-set_windmc_bfd_content (const void *data, rc_uint_type off, rc_uint_type length)
-{
- if (! bfd_set_section_contents (mc_bfd.abfd, mc_bfd.sec, data, off, length))
- bfd_fatal ("bfd_set_section_contents");
-}
-
-static void
-windmc_write_bin (const char *filename, mc_node_lang **nl, int elems)
-{
- unsigned long sec_length = 1;
- int block_count, i;
- mc_msg_item *mi;
- struct bin_messagetable *mtbl;
- rc_uint_type dta_off, dta_start;
-
- if (elems <= 0)
- return;
- mc_bfd.abfd = windmc_open_as_binary (filename);
- mc_bfd.sec = bfd_make_section_with_flags (mc_bfd.abfd, ".data",
- (SEC_HAS_CONTENTS | SEC_ALLOC
- | SEC_LOAD | SEC_DATA));
- if (mc_bfd.sec == NULL)
- bfd_fatal ("bfd_make_section");
- /* Requiring this is probably a bug in BFD. */
- mc_bfd.sec->output_section = mc_bfd.sec;
-
- block_count = mc_get_block_count (nl, elems);
-
- dta_off = (rc_uint_type) ((BIN_MESSAGETABLE_BLOCK_SIZE * block_count) + BIN_MESSAGETABLE_SIZE - 4);
- dta_start = dta_off = (dta_off + 3) & ~3;
- mi = xmalloc (sizeof (mc_msg_item) * elems);
- mtbl = xmalloc (dta_start);
-
- /* Clear header region. */
- memset (mtbl, 0, dta_start);
- target_put_32 (mtbl->cblocks, block_count);
- /* Prepare items section for output. */
- for (i = 0; i < elems; i++)
- {
- mi[i].res_off = dta_off;
- mi[i].res = mc_generate_bin_item (nl[i], &mi[i].res_len);
- dta_off += mi[i].res_len;
- }
- sec_length = (dta_off + 3) & ~3;
- if (! bfd_set_section_size (mc_bfd.abfd, mc_bfd.sec, sec_length))
- bfd_fatal ("bfd_set_section_size");
- /* Make sure we write the complete block. */
- set_windmc_bfd_content ("\0", sec_length - 1, 1);
-
- /* Write block information. */
- mc_write_blocks (mtbl, nl, mi, elems);
-
- set_windmc_bfd_content (mtbl, 0, dta_start);
-
- /* Write items. */
- for (i = 0; i < elems; i++)
- set_windmc_bfd_content (mi[i].res, mi[i].res_off, mi[i].res_len);
-
- free (mtbl);
- free (mi);
- bfd_close (mc_bfd.abfd);
- mc_bfd.abfd = NULL;
- mc_bfd.sec = NULL;
-}
-
-static void
-write_bin (void)
-{
- mc_node_lang *n = NULL;
- int i, c;
-
- if (! mc_nodes_lang_count)
- return;
-
- i = 0;
- while (i < mc_nodes_lang_count)
- {
- char *nd;
- char *filename;
-
- if (n && n->lang == mc_nodes_lang[i]->lang)
- {
- i++;
- continue;
- }
- n = mc_nodes_lang[i];
- c = i + 1;
- while (c < mc_nodes_lang_count && n->lang == mc_nodes_lang[c]->lang)
- c++;
- nd = convert_unicode_to_ACP (n->lang->sval);
-
- /* Prepare filename for binary output. */
- filename = xmalloc (strlen (nd) + 4 + 1 + strlen (mcset_mc_basename) + 1 + strlen (mcset_rc_dir));
- strcpy (filename, mcset_rc_dir);
- if (mcset_prefix_bin)
- sprintf (filename + strlen (filename), "%s_", mcset_mc_basename);
- strcat (filename, nd);
- strcat (filename, ".bin");
-
- /* Write message file. */
- windmc_write_bin (filename, &mc_nodes_lang[i], (c - i));
-
- free (filename);
- i = c;
- }
-}
-
-static void
-write_rc (FILE *fp)
-{
- mc_node_lang *n;
- int i, l;
-
- fprintf (fp,
- "/* Do not edit this file manually.\n"
- " This file is autogenerated by windmc. */\n\n");
- if (! mc_nodes_lang_count)
- return;
- n = NULL;
- i = 0;
- for (l = 0; l < mc_nodes_lang_count; l++)
- {
- if (n && n->lang == mc_nodes_lang[l]->lang)
- continue;
- ++i;
- n = mc_nodes_lang[l];
- fprintf (fp, "\n// Country: %s\n// Language: %s\n#pragma code_page(%u)\n",
- n->lang->lang_info.country, n->lang->lang_info.name,
- (unsigned) n->lang->lang_info.wincp);
- fprintf (fp, "LANGUAGE 0x%lx, 0x%lx\n",
- (unsigned long) (n->lang->nval & 0x3ff),
- (unsigned long) ((n->lang->nval & 0xffff) >> 10));
- fprintf (fp, "1 MESSAGETABLE \"");
- if (mcset_prefix_bin)
- fprintf (fp, "%s_", mcset_mc_basename);
- unicode_print (fp, n->lang->sval, unichar_len (n->lang->sval));
- fprintf (fp, ".bin\"\n");
- }
-}
-
-static void
-write_dbg (FILE *fp)
-{
- mc_node *h;
-
- fprintf (fp,
- "/* Do not edit this file manually.\n"
- " This file is autogenerated by windmc.\n\n"
- " This file maps each message ID value in to a text string that contains\n"
- " the symbolic name used for it. */\n\n");
-
- fprintf (fp,
- "struct %sSymbolicName\n"
- "{\n ", mcset_mc_basename);
- if (mcset_msg_id_typedef)
- unicode_print (fp, mcset_msg_id_typedef, unichar_len (mcset_msg_id_typedef));
- else
- fprintf (fp, "DWORD");
- fprintf (fp,
- " MessageId;\n"
- " char *SymbolicName;\n"
- "} %sSymbolicNames[] =\n"
- "{\n", mcset_mc_basename);
- h = mc_nodes;
- while (h != NULL)
- {
- if (h->symbol)
- write_dbg_define (fp, h->symbol, mcset_msg_id_typedef);
- h = h->next;
- }
- fprintf (fp, " { (");
- if (mcset_msg_id_typedef)
- unicode_print (fp, mcset_msg_id_typedef, unichar_len (mcset_msg_id_typedef));
- else
- fprintf (fp, "DWORD");
- fprintf (fp,
- ") 0xffffffff, NULL }\n"
- "};\n");
-}
-
-static void
-write_header (FILE *fp)
-{
- char *s;
- int i;
- const mc_keyword *key;
- mc_node *h;
-
- fprintf (fp,
- "/* Do not edit this file manually.\n"
- " This file is autogenerated by windmc. */\n\n"
- "//\n// The values are 32 bit layed out as follows:\n//\n"
- "// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1\n"
- "// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0\n"
- "// +---+-+-+-----------------------+-------------------------------+\n"
- "// |Sev|C|R| Facility | Code |\n"
- "// +---+-+-+-----------------------+-------------------------------+\n//\n"
- "// where\n//\n"
- "// C - is the Customer code flag\n//\n"
- "// R - is a reserved bit\n//\n"
- "// Code - is the facility's status code\n//\n");
-
- h = mc_nodes;
-
- fprintf (fp, "// Sev - is the severity code\n//\n");
- if (mc_severity_codes_count != 0)
- {
- for (i = 0; i < mc_severity_codes_count; i++)
- {
- key = mc_severity_codes[i];
- fprintf (fp, "// %s - %02lx\n", convert_unicode_to_ACP (key->usz),
- (unsigned long) key->nval);
- if (key->sval && key->sval[0] != 0)
- {
- if (! mcset_out_values_are_decimal)
- fprintf (fp, "#define %s 0x%lx\n", convert_unicode_to_ACP (key->sval),
- (unsigned long) key->nval);
- else
- fprintf (fp, "#define %s 0x%lu\n", convert_unicode_to_ACP (key->sval),
- (unsigned long) key->nval);
- }
- }
- fprintf (fp, "//\n");
- }
- fprintf (fp, "// Facility - is the facility code\n//\n");
- if (mc_facility_codes_count != 0)
- {
- for (i = 0; i < mc_facility_codes_count; i++)
- {
- key = mc_facility_codes[i];
- fprintf (fp, "// %s - %04lx\n", convert_unicode_to_ACP (key->usz),
- (unsigned long) key->nval);
- if (key->sval && key->sval[0] != 0)
- {
- if (! mcset_out_values_are_decimal)
- fprintf (fp, "#define %s 0x%lx\n", convert_unicode_to_ACP (key->sval),
- (unsigned long) key->nval);
- else
- fprintf (fp, "#define %s 0x%lu\n", convert_unicode_to_ACP (key->sval),
- (unsigned long) key->nval);
- }
- }
- fprintf (fp, "//\n");
- }
- fprintf (fp, "\n");
- while (h != NULL)
- {
- if (h->user_text)
- {
- s = convert_unicode_to_ACP (h->user_text);
- if (s)
- fprintf (fp, "%s", s);
- }
- if (h->symbol)
- write_header_define (fp, h->symbol, h->vid, mcset_msg_id_typedef, h->sub);
- h = h->next;
- }
-}
-
-static const char *
-mc_unify_path (const char *path)
-{
- char *end;
- char *hsz;
-
- if (! path || *path == 0)
- return "./";
- hsz = xmalloc (strlen (path) + 2);
- strcpy (hsz, path);
- end = hsz + strlen (hsz);
- if (hsz[-1] != '/' && hsz[-1] != '\\')
- strcpy (end, "/");
- while ((end = strchr (hsz, '\\')) != NULL)
- *end = '/';
- return hsz;
-}
-
-int main (int, char **);
-
-int
-main (int argc, char **argv)
-{
- FILE *h_fp;
- int c;
- char *target, *input_filename;
- int verbose;
-
-#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
- setlocale (LC_MESSAGES, "");
-#endif
-#if defined (HAVE_SETLOCALE)
- setlocale (LC_CTYPE, "");
-#endif
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
-
- program_name = argv[0];
- xmalloc_set_program_name (program_name);
-
- expandargv (&argc, &argv);
-
- bfd_init ();
- set_default_bfd_target ();
-
- target = NULL;
- verbose = 0;
- input_filename = NULL;
-
- res_init ();
-
- while ((c = getopt_long (argc, argv, "C:F:O:h:e:m:r:x:aAbcdHunoUvV", long_options,
- (int *) 0)) != EOF)
- {
- switch (c)
- {
- case 'b':
- mcset_prefix_bin = 1;
- break;
- case 'e':
- {
- mcset_header_ext = optarg;
- if (mcset_header_ext[0] != '.' && mcset_header_ext[0] != 0)
- {
- char *hsz = xmalloc (strlen (mcset_header_ext) + 2);
-
- sprintf (hsz, ".%s", mcset_header_ext);
- mcset_header_ext = hsz;
- }
- }
- break;
- case 'h':
- mcset_header_dir = mc_unify_path (optarg);
- break;
- case 'r':
- mcset_rc_dir = mc_unify_path (optarg);
- break;
- case 'a':
- mcset_text_in_is_unicode = 0;
- break;
- case 'x':
- if (*optarg != 0)
- mcset_dbg_dir = mc_unify_path (optarg);
- break;
- case 'A':
- mcset_bin_out_is_unicode = 0;
- break;
- case 'd':
- mcset_out_values_are_decimal = 1;
- break;
- case 'u':
- mcset_text_in_is_unicode = 1;
- break;
- case 'U':
- mcset_bin_out_is_unicode = 1;
- break;
- case 'c':
- mcset_custom_bit = 1;
- break;
- case 'n':
- mcset_automatic_null_termination = 1;
- break;
- case 'o':
- mcset_use_hresult = 1;
- fatal ("option -o is not implemented until yet.\n");
- break;
- case 'F':
- target = optarg;
- break;
- case 'v':
- verbose ++;
- break;
- case 'm':
- mcset_max_message_length = strtol (optarg, (char **) NULL, 10);
- break;
- case 'C':
- mcset_codepage_in = strtol (optarg, (char **) NULL, 10);
- break;
- case 'O':
- mcset_codepage_out = strtol (optarg, (char **) NULL, 10);
- break;
- case '?':
- case 'H':
- usage (stdout, 0);
- break;
- case 'V':
- print_version ("windmc");
- break;
-
- default:
- usage (stderr, 1);
- break;
- }
- }
- if (input_filename == NULL && optind < argc)
- {
- input_filename = argv[optind];
- ++optind;
- }
-
- set_endianess (NULL, target);
-
- if (input_filename == NULL)
- {
- fprintf (stderr, "Error: No input file was specified.\n");
- usage (stderr, 1);
- }
- mc_set_inputfile (input_filename);
-
- if (!probe_codepage (&mcset_codepage_in, &mcset_text_in_is_unicode, "codepage_in", 0))
- usage (stderr, 1);
- if (mcset_codepage_out == 0)
- mcset_codepage_out = 1252;
- if (! unicode_is_valid_codepage (mcset_codepage_out))
- fatal ("Code page 0x%x is unknown.", (unsigned int) mcset_codepage_out);
- if (mcset_codepage_out == CP_UTF16)
- fatal ("UTF16 is no valid text output code page.");
- if (verbose)
- {
- fprintf (stderr, "// Default target is %s and it is %s endian.\n",
- def_target_arch, (target_is_bigendian ? "big" : "little"));
- fprintf (stderr, "// Input codepage: 0x%x\n", (unsigned int) mcset_codepage_in);
- fprintf (stderr, "// Output codepage: 0x%x\n", (unsigned int) mcset_codepage_out);
- }
-
- if (argc != optind)
- usage (stderr, 1);
-
- /* Initialize mcset_mc_basename. */
- {
- const char *bn, *bn2;
- char *hsz;
-
- bn = strrchr (input_filename, '/');
- bn2 = strrchr (input_filename, '\\');
- if (! bn)
- bn = bn2;
- if (bn && bn2 && bn < bn2)
- bn = bn2;
- if (! bn)
- bn = input_filename;
- else
- bn++;
- mcset_mc_basename = hsz = xstrdup (bn);
-
- /* Cut of right-hand extension. */
- if ((hsz = strrchr (hsz, '.')) != NULL)
- *hsz = 0;
- }
-
- /* Load the input file and do code page transformations to UTF16. */
- {
- unichar *u;
- rc_uint_type ul;
- char *buff;
- long flen;
- FILE *fp = fopen (input_filename, "rb");
-
- if (!fp)
- fatal (_("unable to open file ,%s' for input.\n"), input_filename);
-
- fseek (fp, 0, SEEK_END);
- flen = ftell (fp);
- fseek (fp, 0, SEEK_SET);
- buff = malloc (flen + 3);
- memset (buff, 0, flen + 3);
- fread (buff, 1, flen, fp);
- fclose (fp);
- if (mcset_text_in_is_unicode != 1)
- {
- unicode_from_codepage (&ul, &u, buff, mcset_codepage_in);
- if (! u)
- fatal ("Failed to convert input to UFT16\n");
- mc_set_content (u);
- }
- else
- {
- if ((flen & 1) != 0)
- fatal (_("input file does not seems to be UFT16.\n"));
- mc_set_content ((unichar *) buff);
- }
- free (buff);
- }
-
- while (yyparse ())
- ;
-
- do_sorts ();
-
- h_fp = mc_create_path_text_file (mcset_header_dir, mcset_header_ext);
- write_header (h_fp);
- fclose (h_fp);
-
- h_fp = mc_create_path_text_file (mcset_rc_dir, ".rc");
- write_rc (h_fp);
- fclose (h_fp);
-
- if (mcset_dbg_dir != NULL)
- {
- h_fp = mc_create_path_text_file (mcset_dbg_dir, ".dbg");
- write_dbg (h_fp);
- fclose (h_fp);
- }
- write_bin ();
-
- if (mc_nodes_lang)
- free (mc_nodes_lang);
- if (mc_severity_codes)
- free (mc_severity_codes);
- if (mc_facility_codes)
- free (mc_facility_codes);
-
- xexit (0);
- return 0;
-}
diff --git a/gas/ChangeLog b/gas/ChangeLog
deleted file mode 100644
index 8cba2dbbb0c..00000000000
--- a/gas/ChangeLog
+++ /dev/null
@@ -1,1073 +0,0 @@
-2008-08-05 Alan Modra <amodra@bigpond.net.au>
-
- PR gas/6656
- * dwarf2dbg.c (dwarf2_directive_file): Disable gas generated
- debug info if we see compiler generated debug info.
- (dwarf2_directive_loc): Likewise. Remove redundant debug_type test.
-
-2008-08-04 Alan Modra <amodra@bigpond.net.au>
-
- * dwarf2dbg.c: Remove superfluous forward function declarations.
- (DWARF2_FORMAT): Add section arg.
- (out_header): New function, split out from..
- (out_debug_line): ..here.
- (out_debug_aranges): Use out_header.
- (out_debug_abbrev): Add info_seg and line_seg args. Use
- DW_FORM_data8 (for DW_AT_stmt_list) if line_seg is 64-bit.
- (out_debug_info): Use out_header. Output 8 byte DW_AT_stmt_list
- if line_seg is 64-bit.
- (dwarf2_finish): Adjust out_debug_abbrev call.
- * config/tc-mips.h (DWARF2_FORMAT, mips_dwarf2_format): Add sec arg.
- * config/tc-mips.c (mips_dwarf2_format): Likewise.
-
-2008-08-04 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am (POTFILES.in): Set LC_ALL=C.
- * Makefile.in: Regenerate.
- * po/POTFILES.in: Regenerate.
-
-2008-08-01 Peter Bergner <bergner@vnet.ibm.com>
-
- * config/tc-ppc.c (parse_cpu): Rename altivec_or_spe to retain_flags.
- Handle -mvsx and -mpower7.
- (md_show_usage): Document -mpower7 and -mvsx.
- * doc/as.texinfo (Target PowerPC): Document -mvsx.
- * doc/c-ppc.texi (PowerPC-Opts): Document -mvsx and -mpower7.
-
-2008-07-31 Peter Bergner <bergner@vnet.ibm.com>
-
- * config/tc-ppc.c (parse_cpu) <power6>: Accept Altivec instructions.
- <cell>: Likewise.
-
-2008-07-30 Michael J. Eager <eager@eagercon.com>
-
- * config/tc-ppc.c (parse_cpu): Separate handling of -m403/405.
- (md_show_usage): Likewise.
-
-2008-07-30 Alan Modra <amodra@bigpond.net.au>
-
- * messages.c, symbols.c, write.c: Silence gcc warnings.
-
-2008-07-28 Ineiev <ineiev@yahoo.co.uk>
-
- * config/tc-i386.c (operand_type_check): Warning fix.
-
-2008-07-26 Michael Eager <eager@eagercon.com>
-
- * doc/as.texinfo: Add description of single-precision attribute.
-
-2008-07-24 Jie Zhang <jie.zhang@analog.com>
-
- * config/bfin-parse.y (asm_1): Error if plain symbol is used
- as load/store offset.
-
-2008-07-22 Chao-ying Fu <fu@mips.com>
-
- * config/tc-mips.c (mips_ip): Reset s to argsStart.
-
-2008-07-22 Jie Zhang <jie.zhang@analog.com>
-
- * config/tc-bfin.c (bfin_gen_loop): Remove loop symbol.
-
-2008-07-21 DJ Delorie <dj@redhat.com>
-
- * config/tc-h8300.c (fix_operand_size): Use the default size
- specified by the .lbranch/.sbranch pseudos.
-
-2008-07-18 DJ Delorie <dj@redhat.com>
-
- * config/tc-m32c.h (H_TICK_HEX): Define.
- * config/tc-m32c.c (OPTION_H_TICK_HEX): Define.
- (md_longopts): Add support for it.
- (md_parse_option): Likewise.
- * doc/as.texinfo (Overview): Add new m32c options.
- * doc/c-m32c.texi (M32C-Modifiers): Likewise
-
- * as.h: (enable_h_tick_hex): New.
- * app.c (enable_h_tick_hex): New.
- (LEX_IS_H): New.
- (do_scrub_begin): Mark 'H' and 'h' as special if enable_h_tick_hex.
- (do_scrub_chars): If enable_h_tick_hex and 'h', check for H'00
- style hex constants and convert the input stream to 0x00 style.
- (do_scrub_chars): If a 'X style character constant is found after
- a symbol character (like you're or X'00), warn the user.
-
-2008-07-10 Richard Sandiford <rdsandiford@googlemail.com>
-
- * config/tc-mips.c (mips16_mark_labels): Use ELF_ST_SET_MIPS16.
- (mips_fix_adjustable): Likewise.
- (mips_frob_file_after_relocs): Likewise.
-
-2008-07-08 Nathan Sidwell <nathan@codesourcery.com>
-
- * config/tc-m68k.c (m68k_set_cpu, m68k_set_arch): Don't complain
- about overriding an earlier setting.
-
-2008-07-07 Adam Nemet <anemet@caviumnetworks.com>
-
- * config/tc-mips.c (NO_ISA_COP): New macro.
- (COP_INSN): New macro.
- (is_opcode_valid): Use them.
- (macro) <ld_st>: Use them. Don't accept coprocessor load store
- insns based on the ISA if CPU is NO_ISA_COP.
- <copz>: Likewise for coprocessor operations.
-
-2008-07-07 Paul Brook <paul@codesourcery.com>
-
- * config/tc-arm.c (arm_fix_adjustable): Don't adjust MOVW/MOVT
- relocations.
-
-2008-07-07 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * configure.tgt: Add bfin-*-rtems*.
-
-2008-07-04 Alan Modra <amodra@bigpond.net.au>
-
- * config/tc-spu.c (md_apply_fix): Handle fully resolved
- BFD_RELOC_32_PCREL, BFD_RELOC_SPU_HI16 and BFD_RELOC_SPU_LO16.
-
-2008-06-25 Peter Bergner <bergner@vnet.ibm.com>
-
- * config/tc-ppc.c (parse_cpu): Handle -m464.
- (md_show_usage): Likewise.
-
-2008-06-24 Eric B. Weddington <eric.weddington@atmel.com>
-
- Add support for ATtiny13A.
- * config/tc-avr.c (mcu_types): Add attiny13a.
- * doc/c-avr.texi: Likewise.
-
-2008-06-24 Bob Wilson <bob.wilson@acm.org>
- Alan Modra <amodra@bigpond.net.au>
-
- * write.c (relax_segment <rs_org>): Include current stretch
- value when calculating whether .org is backwards.
-
-2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * configure: Regenerate.
-
-2008-06-17 Nick Clifton <nickc@redhat.com>
-
- * app.c (do_scrub_chars): Do not UNGET an EOF value.
-
-2008-06-16 Hans-Peter Nilsson <hp@bitrange.com>
-
- PR gas/6607
- * config/tc-mmix.c (s_loc): Assume "negative" addresses belong to
- text_section. Do the "stepping backwards" test for text_section
- using unsigned operands.
-
-2008-06-13 Peter Bergner <bergner@vnet.ibm.com>
-
- * config/tc-ppc.c (ppc_cpu): Use ppc_cpu_t typedef.
- (ppc_insert_operand): Likewise.
- (ppc_machine): Likewise.
- * config/tc-ppc.h: #include "opcode/ppc.h"
- (struct _ppc_fix_extra <ppc_cpu>): Use ppc_cpu_t typedef.
- (ppc_cpu): Update extern decl.
-
-2008-06-12 Adam Nemet <anemet@caviumnetworks.com>
-
- * config/tc-mips.c (validate_mips_insn): Handle field descriptors
- +x, +X, +p, +P, +s, +S.
- (mips_ip): Likewise.
-
- * config/tc-mips.c (validate_mips_insn): Handle field descriptor +Q.
- (mips_ip): Likewise.
- (macro_build): Likewise.
- (CPU_HAS_SEQ): New macro.
- (macro2) <M_SEQ_I, M_SNE_I>: Use it. Emit seq/sne and seqi/snei.
-
-2008-06-09 Eric B. Weddington <eric.weddington@atmel.com>
-
- * config/tc-avr.c (mcu_types): Remove support for ATmega32HVB device.
- * doc/c-avr.texi: Likewise.
-
-2008-06-04 Nick Clifton <nickc@redhat.com>
-
- * app.c (do_scrub_chars): Do not UNGET an EOF value.
-
-2008-06-03 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (set_sse_check): New.
- (md_pseudo_table): Add "sse_check".
-
-2008-06-03 Paul Brook <paul@codesourcery.com>
-
- * config/tc-arm.c (do_t_rbit): Populate both rm fields.
-
-2008-05-30 Nick Clifton <nickc@redhat.com>
-
- PR 5523
- * config/tc-avr.c (avr_ldi_expression): Do not warn about unknown
- relocs here.
-
-2008-05-29 Maxim Kuvyrkov <maxim@codesourcery.com>
-
- * config/tc-mips.c (mips_cpu_info_table): Move records for
- ST Loongson-2E/2F processors to a better place.
-
-2008-05-23 H.J. Lu <hongjiu.lu@intel.com>
-
- PR gas/6518
- * config/tc-i386.c (match_template): Report ambiguous operand
- size, not invalid suffix when there is no match in Intel
- syntax.
-
-2008-05-22 Paul Brook <paul@codesourcery.com>
-
- * config/tc-arm.c (parse_cond): Covert to lowercase before matching.
-
-2008-05-21 I-Jui Sung <ijsung@gmail.com>
-
- * config/tc-arm.c (arm_cpus): Add Faraday ARMv4 and ARMv5TE
- compatible cores: fa526, fa626, fa626te, fa726te.
- * doc/c-arm.texi (ARM Opts): Add -mcpu={fa526, fa626, fa626te,
- fa726te} options.
-
-2008-05-14 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am: Run "make dep-am".
- * Makefile.in: Regenerate.
- * doc/Makefile.in: Regenerate.
- * po/POTFILES.in: Regenerate.
-
-2008-05-09 Catherine Moore <clm@codesourcery.com>
-
- * config/tc-mips.c (mips_frob_file): Don't match MIPS16 relocs
- with non-MIPS16 relocs.
-
-2008-05-09 Chao-ying Fu <fu@mips.com>
-
- * config/tc-mips.c (md_begin): Use strncmp to compare TARGET_OS, in
- case that some characters append at the end of the name.
- (mips_ip): Likewise.
- (s_change_sec): Likewise.
- (md_section_align): Likewise.
-
-2008-05-07 Bob Wilson <bob.wilson@acm.org>
-
- * config/tc-xtensa.c (xtensa_create_property_segments): Use
- xtensa_make_property_section instead of xtensa_get_property_section.
- (xtensa_create_xproperty_segments): Likewise.
-
-2008-05-02 H.J. Lu <hongjiu.lu@intel.com>
-
- * NEWS: Mention XSAVE, EPT and MOVBE.
-
- * config/tc-i386.c (cpu_arch): Add .movbe and .ept.
- (md_show_usage): Add .movbe and .ept.
-
- * doc/c-i386.texi: Add movbe and ept to -march=. Document
- .movbe and .ept.
-
-2008-04-29 David S. Miller <davem@davemloft.net>
-
- * config/tc-sparc.c (v9a_asr_table): Fix order of softint entries.
-
-2008-04-28 Adam Nemet <anemet@caviumnetworks.com>
-
- * config/tc-mips.c (file_mips_soft_float, file_mips_single_float):
- New statics.
- (OPTION_ELF_BASE): Make room for new option macros.
- (OPTION_SOFT_FLOAT, OPTION_HARD_FLOAT, OPTION_SINGLE_FLOAT,
- OPTION_DOUBLE_FLOAT): New option macros.
- (md_longopts): Add msoft-float, mhard-float, msingle-float and
- mdouble-float.
- (md_parse_option): Handle OPTION_SINGLE_FLOAT,
- OPTION_DOUBLE_FLOAT, OPTION_SOFT_FLOAT and OPTION_HARD_FLOAT.
- (md_show_usage): Add -msoft-float, -mhard-float, -msingle-float
- and -mdouble-float.
- (struct mips_set_options): New fields soft_float and single_float.
- (mips_opts): Initialized them. Add comment for each field
- initializer.
- (mips_after_parse_args): Set them based on file_mips_soft_float
- and file_mips_single_float.
- (s_mipsset): Add support for `.set softfloat', `.set hardfloat',
- `.set singlefloat' and `.set doublefloat'.
- (is_opcode_valid): New function to invoke OPCODE_IS_MEMBER.
- Handle single-float and soft-float instructions here.
- (macro_build, mips_ip): Use it instead of OPCODE_IS_MEMBER.
- (is_opcode_valid_16): New function.
- (mips16_ip): Use it instead of OPCODE_IS_MEMBER.
- (macro) <M_LDC1_AB, M_SDC1_AB, M_L_DOB, M_L_DAB, M_S_DAB,
- M_S_DOB>: Remove special-casing of r4650.
- * doc/c-mips.texi (-march=): Add Octeon.
- (MIPS Opts): Document -msoft-float and -mhard-float. Document
- -msingle-float and -mdouble-float.
- (MIPS floating-point): New section. Document `.set softfloat' and
- `.set hardfloat'. Document `.set singlefloat' and `.set
- doublefloat'.
-
-2008-04-25 David S. Miller <davem@davemloft.net>
-
- * config/tc-sparc.c: Accept 'softint_clear' and 'softint_set'
- %asr aliases.
-
- * doc/c-sparc.texi: Consistently refer to architecture 'versions',
- rather than occaisionally 'levels'. Consistently refer to Sun's
- UNIX variant as SunOS, every version of Solaris is also SunOS.
- Document new 'softint_clear' and 'softint_set' aliases. Clarify
- which architecture versions support '%dcr', '%cq', and '%gl'. Add
- section on 32-bit/64-bit opcode translations.
-
-2008-04-23 Mike Frysinger <vapier@gentoo.org>
-
- * Makefile.am (OBJ_FORMAT_CFILES): Add config/obj-fdpicelf.c.
- (OBJ_FORMAT_HFILES): Add config/obj-fdpicelf.h.
- (obj-fdpicelf.o): Define.
- * Makefile.in: Regenerate.
- * configure.tgt: Set bfd_gas to yes when fmt is fdpicelf.
- (bfin-*-*): Delete.
- (bfin-*-linux-uclibc): New; set fmt to fdpicelf and em to linux.
- (bfin-*-uclinux*): New; set fmt to elf and em to linux.
- * config/obj-fdpicelf.c: New.
- * config/obj-fdpicelf.h: Likewise.
- * config/tc-bfin.c (bfin_flags, bfin_pic_flag): Set default based on
- the OBJ_FDPIC_ELF define.
- (OPTION_NOPIC): Define.
- (md_longopts): Add mnopic and mno-fdpic.
- (md_parse_option): Handle OPTION_NOPIC.
-
-2008-04-23 Paolo Bonzini <bonzini@gnu.org>
-
- * aclocal.m4: Regenerate.
- * configure: Regenerate.
-
-2008-04-23 David S. Miller <davem@davemloft.net>
-
- * config/tc-sparc.c (v9a_asr_table): Add missing
- 'stick' and 'stick_cmpr', and document ordering rules
- of table.
- (tc_gen_reloc): Accept BFD_RELOC_SPARC_PC22 and
- BFD_RELOC_SPARC_PC10.
- * doc/c-sparc.texi: New section on Sparc constants.
- Add documentation for %stick and %stick_cmpr.
-
-2008-04-22 David S. Miller <davem@davemloft.net>
-
- * config/obj-elf.c (obj_elf_section_type): Add prototype
- before obj_elf_section_word and add 'warn' arg.
- (obj_elf_section_word): Add type pointer arg, and if no #SECTION
- is matched, try checking for #SECTION_TYPE.
- (obj_elf_section): Adjust for new args.
- (obj_elf_type_name): New function.
- (obj_elf_type): Call it, and accept STT_foo number strings
- in .type statements as output by SunPRO compiler.
-
-2008-04-22 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (md_assemble): Don't check SSE instructions
- if noavx is 0.
-
-2008-04-18 David S. Miller <davem@davemloft.net>
-
- * doc/c-sparc.texi: Add syntax section.
-
-2008-04-18 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (build_modrm_byte): Don't check FMA to swap
- REG and NDS for instructions with immediate operand.
-
-2008-04-18 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (build_modrm_byte): Swap REG and NDS for
- FMA.
-
-2008-04-16 David S. Miller <davem@davemloft.net>
-
- * config/tc-sparc.c (sparc_ip): Add support for gotdata mnemonics
- and relocation generation.
- (tc_gen_reloc): Likewise.
-
-2008-04-15 Andrew Stubbs <andrew.stubbs@st.com>
-
- * config/tc-sh.c (md_apply_fix): Make sure BFD_RELOC_SH_PCRELIMM8BY4
- relocations are properly aligned, and not negative.
-
-2008-04-15 Khem Raj <kraj@mvista.com>
-
- * doc/tc-arm.texi: Fix fnstart and fnend directive names.
-
-2008-04-14 Edmar Wienskoski <edmar@freescale.com>
-
- * config/tc-ppc.c (parse_cpu): Handle "e500mc". Extend "e500" to
- accept e500mc instructions.
- (md_show_usage): Document -me500mc.
-
-2008-04-11 Nick Clifton <nickc@redhat.com>
-
- * listing.c (print_timestamp): Use localtime rather than
- localtime_r since not all build environments provide the latter.
-
-2008-04-10 H.J. Lu <hongjiu.lu@intel.com>
-
- * NEWS: Mention -msse-check=[none|error|warning].
-
- * config/tc-i386.c (sse_check): New.
- (OPTION_MSSE_CHECK): Likewise.
- (md_assemble): Check SSE instructions if needed.
- (md_longopts): Add -msse-check.
- (md_parse_option): Handle OPTION_MSSE_CHECK.
- (md_show_usage): Show -msse-check=[none|error|warning].
-
- * doc/c-i386.texi: Document -msse-check=[none|error|warning].
-
-2008-04-10 Santiago Urueña <suruena@gmail.com>
-
- * listing.c: Add -ag listing flag to show general information in
- listings such as gas version, passed options, and time stamp.
- (listing_general_info): New function.
- (print_options): New function.
- (print_single_option): New function.
- (print_timestamp): New function.
- (MAX_DATELEN): Define.
- (listing_print): Add call to listing_general_info.
- * listing.h (LISTING_GENERAL): Define.
- (listing_print): Add new parameter.
- * as.c (show_usage): Print new switch.
- (parse_args): Parse new switch.
- (main): Pass command line on to listing_print.
- * NEWS: Mention this new feature.
- * doc/as.texinfo: Document the new sub-option.
-
-2008-04-08 Alan Modra <amodra@bigpond.net.au>
-
- * dwarf2dbg.c (dwarf2_emit_insn): Simplify test before dwarf2_where
- call. Delete out of date comment.
- (dwarf2_consume_line_info): Always clear dwarf2_loc_directive_seen.
- (dwarf2_emit_label): Don't emit unless there has been a previous
- .file or we are outputting assembler generated debug.
- dwarf2_consume_line_info after emitting line info, not before.
- (out_debug_info): Simplify files_in_use test.
-
-2008-04-07 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (parse_real_register): Return AVX register
- only if AVX is enabled.
-
-2008-04-07 Kaz Kojima <kkojima@rr.iij4u.or.jp>
-
- PR gas/6043
- * config/tc-sh64.c (shmedia_md_pcrel_from_section): Use
- md_pcrel_from_section for BFD_RELOC_64 and BFD_RELOC_64_PCREL.
-
-2008-04-04 Adrian Bunk <bunk@stusta.de>
- Bob Wilson <bob.wilson@acm.org>
-
- * config/tc-xtensa.c (xg_apply_fix_value): Check return code from
- call to decode_reloc.
-
-2008-04-04 H.J. Lu <hongjiu.lu@intel.com>
-
- * NEWS: Mention XSAVE. Change CLMUL to PCLMUL.
-
- * config/tc-i386.c (cpu_arch): Add .pclmul.
- (md_show_usage): Replace clmul with pclmul.
- * doc/c-i386.texi: Likewise.
-
-2008-04-03 H.J. Lu <hongjiu.lu@intel.com>
-
- * NEWS: Mention AES, CLMUL, AVX/FMA and -msse2avx.
-
- * doc/c-i386.texi: Add avx, aes, clmul and fma to -march=.
- Document -msse2avx, .avx, .aes, .clmul and .fma.
-
- * config/tc-i386.c (YMMWORD_MNEM_SUFFIX): New.
- (vex_prefix): Likewise.
- (sse2avx): Likewise.
- (CPU_FLAGS_ARCH_MATCH): Likewise.
- (CPU_FLAGS_64BIT_MATCH): Likewise.
- (CPU_FLAGS_32BIT_MATCH): Likewise.
- (CPU_FLAGS_PERFECT_MATCH): Likewise.
- (regymm): Likewise.
- (vex_imm4): Likewise.
- (fits_in_imm4): Likewise.
- (build_vex_prefix): Likewise.
- (VEX_check_operands): Likewise.
- (bad_implicit_operand): Likewise.
- (OPTION_MSSE2AVX): Likewise.
- (T_YMMWORD): Likewise.
- (_i386_insn): Add vex.
- (cpu_arch): Add .avx, .aes, .clmul and .fma.
- (cpu_flags_match): Changed to take a pointer to const template.
- Enable encoding SSE instructions with VEX prefix for -msse2avx.
- (match_mem_size): Also check ymmword.
- (operand_type_match): Clear ymmword.
- (md_begin): Allow '_' in mnemonic.
- (type_names): Add OPERAND_TYPE_VEX_IMM4.
- (process_immext): Update assert.
- (md_assemble): Don't call process_immext if sse2avx and immext
- are true. Call build_vex_prefix if vex is true.
- (parse_insn): Updated for cpu_flags_match.
- (swap_operands): Handle 5 operands.
- (match_template): Handle 5 operands. Updated for cpu_flags_match.
- Check regymm. Call VEX_check_operands. Handle YMMWORD_MNEM_SUFFIX.
- (process_suffix): Handle YMMWORD_MNEM_SUFFIX.
- (check_byte_reg): Check regymm.
- (process_operands): Duplicate the destination register for
- -msse2avx if needed.
- (build_modrm_byte): Updated for instructions with VEX encoding.
- (output_insn): Output VEX prefix if needed.
- (md_longopts): Add msse2avx.
- (md_parse_option): Handle OPTION_MSSE2AVX.
- (md_show_usage): Add avx, aes, clmul, fma and -msse2avx.
- (intel_e09): Support YMMWORD.
- (intel_e11): Likewise.
- (intel_get_token): Likewise.
-
-2008-03-28 Eric B. Weddington <eric.weddington@atmel.com>
-
- * config/tc-avr.c (mcu_types): Add attiny167.
- * doc/c-avr.texi: Likewise.
-
-2008-03-28 Eric B. Weddington <eric.weddington@atmel.com>
-
- * config/tc-avr.c (mcu_types): Add atmega32u4.
- * doc/c-avr.texi: Likewise.
-
-2008-03-28 Eric B. Weddington <eric.weddington@atmel.com>
-
- * config/tc-avr.c (mcu_types): Add atmega32c1.
- * doc/c-avr.texi: Likewise.
-
-2008-03-28 Paul Brook <paul@codesourcery.com>
-
- * config/tc-arm.c (parse_neon_mov): Parse register before immediate
- to avoid spurious symbols.
-
-2008-03-28 Nathan Sidwell <nathan@codesourcery.com>
-
- * config/tc-m68k.c (md_convert_frag_1): Replace as_fatal with
- as_bad_where.
-
-2008-03-27 Eric B. Weddington <eric.weddington@atmel.com>
-
- * config/tc-avr.c (mcu_types): Add atmega32m1.
- * doc/c-avr.texi: Likewise.
-
-2008-03-27 Ineiev <ineiev@yahoo.co.uk>
-
- * config/tc-arm.c (do_neon_cvt): Move variable declarations to
- start of block.
- (do_neon_ext): Fix sign of comparison.
-
-2008-03-26 Bernd Schmidt <bernd.schmidt@analog.com>
-
- From Jie Zhang <jie.zhang@analog.com>
- * config/bfin-parse.y (asm_1): Check AREGS in comparison
- instructions. And call yyerror when comparing PREG with
- DREG.
- (check_macfunc_option): New.
- (check_macfuncs): Check option by calling check_macfunc_option.
- Fix comparison always true warnings. Both scalar instructions
- of vector instruction must share the same mode option. Only allow
- option mode at the end of the second instruction of the vector.
- (asm_1): Check option by calling check_macfunc_option.
-
- * config/bfin-parse.y (check_macfunc_option): Allow (IU)
- option for multiply and multiply-accumulate to data register
- instruction.
- (check_macfuncs): Don't check if accumulator matches the data register
- here.
- (assign_macfunc): Check if accumulator matches the
- data register in each rule that moves to the data
- register.
-
- * config/tc-bfin.c (bfin_start_line_hook): Localize the labels
- generated for LOOP_BEGIN and LOOP_END instructions.
- (bfin_gen_loop): Likewise.
-
-2008-03-19 Andreas Krebbel <krebbel1@de.ibm.com>
-
- * config/tc-s390.c (md_parse_option): z10 option added.
-
-2008-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * aclocal.m4: Regenerate.
- * configure: Likewise.
- * Makefile.in: Likewise.
- * doc/Makefile.in: Likewise.
-
-2008-03-17 Adrian Bunk <bunk@stusta.de>
-
- PR 5946
- * config/tc-hppa.c (is_same_frag): Delete.
-
-2008-03-14 Sterling Augustine <sterling@tensilica.com>
-
- * config/tc-xtensa.h (xtensa_relax_statesE): Update comment for
- RELAX_LOOP_END_ADD_NOP.
-
-2008-03-13 Evandro Menezes <evandro@yahoo.com>
-
- PR gas/5895
- * read.c (s_mexit): Warn if attempting to exit a macro when not
- inside a macro definition.
-
-2008-03-13 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am: Run "make dep-am".
- * Makefile.in: Regenerate.
- * configure: Regenerate.
-
-2008-03-09 Paul Brook <paul@codesourcery.com>
-
- * config/tc-arm.c (arm_cpu_option_table): Add cortex-a9.
- * doc/c-arm.texi: Add cortex-a9.
-
-2008-03-09 Paul Brook <paul@codesourcery.com>
-
- * config/tc-arm.c (fpu_vfp_ext_d32): New vairable.
- (parse_vfp_reg_list, encode_arm_vfp_reg): Use it.
- (arm_option_cpu_value): Add vfpv3-d16, vfpv2 and vfpv3.
- (aeabi_set_public_attributes): Handle Tag_VFP_arch=VFPV3-D16.
- * doc/c-arm.texi: Document new ARM FPU variants.
-
-2008-03-07 Paul Brook <paul@codesourcery.com>
-
- * config/tc-arm.c (md_apply_fix): Use correct offset range.
-
-2008-03-07 Alan Modra <amodra@bigpond.net.au>
-
- * config/tc-ppc.c (ppc_setup_opcodes): Tidy. Add code to test
- for strict ordering of powerpc_opcodes, but disable for now.
-
-2008-03-04 Paul Brook <paul@codesourcery.com>
-
- * config/tc-arm.c (arm_ext_barrier, arm_ext_msr): New.
- (arm_ext_v7m): Rename...
- (arm_ext_m): ... to this. Include v6-M.
- (do_t_add_sub): Allow narrow low-reg non flag setting adds.
- (do_t_mrs, do_t_msr, aeabi_set_public_attributes): Use arm_ext_m.
- (md_assemble): Allow wide msr instructions.
- (insns): Add classifications for v6-m instructions.
- (arm_cpu_option_table): Add cortex-m1.
- (arm_arch_option_table): Add armv6-m.
- (cpu_arch): Add ARM_ARCH_V6M. Fix numbering of other v6 variants.
-
-2008-03-03 Sterling Augustine <sterling@tensilica.com>
- Bob Wilson <bob.wilson@acm.org>
-
- * config/tc-xtensa.c (xtensa_num_pipe_stages): New.
- (md_begin): Initialize it.
- (resources_conflict): Use it.
-
-2008-03-03 Sterling Augustine <sterling@tensilica.com>
-
- * config/tc-xtensa.h (RELAX_XTENSA_NONE): New.
-
-2008-03-03 Denys Vlasenko <vda.linux@googlemail.com>
- H.J. Lu <hongjiu.lu@intel.com>
-
- PR gas/5543
- * read.c (pseudo_set): Don't allow global register symbol.
-
- * symbols.c (S_SET_EXTERNAL): Don't allow register symbol
- global.
-
-2008-03-03 H.J. Lu <hongjiu.lu@intel.com>
-
- PR gas/5543
- * write.c (write_object_file): Don't allow symbols which were
- equated to register. Stop if there is an error.
-
-2008-03-01 Alan Modra <amodra@bigpond.net.au>
-
- * config/tc-ppc.h (struct _ppc_fix_extra): New.
- (ppc_cpu): Declare.
- (TC_FIX_TYPE, TC_INIT_FIX_DATA): Define.
- * config/tc-ppc.c (ppu_cpu): Make global.
- (ppc_insert_operand): Add ppu_cpu parameter.
- (md_assemble): Adjust for above change.
- (md_apply_fix): Pass tc_fix_data.ppc_cpu to ppc_insert_operand.
-
-2008-02-22 Nick Clifton <nickc@redhat.com>
-
- * config/tc-arm.c (do_bx): Only test EF_ARM_EABI_VERSION on ELF
- targeted ARM ports, otherwise just skip generating the reloc.
-
-2008-02-18 H.J. Lu <hongjiu.lu@intel.com>
-
- * doc/c-i386.texi: Update -march= and .arch.
-
-2008-02-18 Nick Clifton <nickc@redhat.com>
-
- * config/tc-mn10300.c (has_known_symbol_location): New function.
- Do not regard weak symbols as having a known location.
- (md_estimate_size_before_relax): Use new function.
- (md_pcrel_from): Do not compute a pcrel against a weak symbol.
-
-2008-02-18 Jan Beulich <jbeulich@novell.com>
-
- * config/tc-i386.c (match_template): Disallow 'l' suffix when
- currently selected CPU has no 32-bit support.
- (parse_real_register): Do not return registers not available on
- currently selected CPU.
-
-2008-02-16 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (process_immext): Fix format.
-
-2008-02-16 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (inoutportreg): New.
- (process_immext): New.
- (md_assemble): Use it.
- (update_imm): Use imm16 and imm32s.
- (i386_att_operand): Use inoutportreg.
-
-2008-02-14 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (operand_type_all_zero): New.
- (operand_type_set): Likewise.
- (operand_type_equal): Likewise.
- (cpu_flags_all_zero): Likewise.
- (cpu_flags_set): Likewise.
- (cpu_flags_equal): Likewise.
- (UINTS_ALL_ZERO): Removed.
- (UINTS_SET): Likewise.
- (UINTS_CLEAR): Likewise.
- (UINTS_EQUAL): Likewise.
- (cpu_flags_match): Updated.
- (smallest_imm_type): Likewise.
- (set_cpu_arch): Likewise.
- (md_assemble): Likewise.
- (optimize_imm): Likewise.
- (match_template): Likewise.
- (process_suffix): Likewise.
- (update_imm): Likewise.
- (process_drex): Likewise.
- (process_operands): Likewise.
- (build_modrm_byte): Likewise.
- (i386_immediate): Likewise.
- (i386_displacement): Likewise.
- (i386_att_operand): Likewise.
- (parse_real_register): Likewise.
- (md_parse_option): Likewise.
- (i386_target_format): Likewise.
-
-2008-02-14 Dimitry Andric <dimitry@andric.com>
-
- PR gas/5712
- * config/tc-arm.c (s_arm_unwind_save): Advance the input line
- pointer past the comma after parsing a floating point register
- name.
-
-2008-02-14 Hakan Ardo <hakan@debian.org>
-
- PR gas/2626
- * config/tc-avr.c (mcu_types): Change the ISA tyoe of the attiny26
- to AVR_ISA_2xxe.
- (avr_operand): Disallow post-increment addressing in the lpm
- instruction for the attiny26.
-
-2008-02-13 Jan Beulich <jbeulich@novell.com>
-
- * config/tc-i386.c (parse_real_register): Don't return 'FLAT'
- if not in Intel mode.
- (i386_intel_operand): Ignore segment overrides in immediate and
- offset operands.
- (intel_e11): Range-check i.mem_operands before use as array
- index. Filter out FLAT for uses other than as segment override.
- (intel_get_token): Remove broken promotion of "FLAT:" to mean
- "offset FLAT:".
-
-2008-02-13 Jan Beulich <jbeulich@novell.com>
-
- * config/tc-i386.c (intel_e09): Also special-case 'bound'.
-
-2008-02-13 Jan Beulich <jbeulich@novell.com>
-
- * config/tc-i386.c (allow_pseudo_reg): New.
- (parse_real_register): Check for NULL just once. Allow all
- register table entries when allow_pseudo_reg is non-zero.
- Don't allow any registers without type when allow_pseudo_reg
- is zero.
- (tc_x86_regname_to_dw2regnum): Replace with ...
- (tc_x86_parse_to_dw2regnum): ... this.
- (tc_x86_frame_initial_instructions): Adjust for above change.
- * config/tc-i386.h (tc_regname_to_dw2regnum): Remove.
- (tc_parse_to_dw2regnum): New.
- (tc_x86_regname_to_dw2regnum): Replace with ...
- (tc_x86_parse_to_dw2regnum): ... this.
- * dw2gencfi.c (tc_parse_to_dw2regnum): New, broken out of ...
- (cfi_parse_reg): ... this. Use tc_parse_to_dw2regnum. Adjust
- error handling.
-
-2008-02-12 Nick Clifton <nickc@redhat.com>
-
- * config/tc-tic4x.c (tic4x_insn_insert): Add const qualifier to
- argument.
- (tic4x_insn_add): Likewise.
- (md_begin): Drop cast that was discarding a const qualifier.
- * config/tc-d30v.c (get_reloc): Add const qualifier to op
- argument.
- (build_insn): Drop cast that was discarding a const qualifier.
-
-2008-02-11 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (cpu_arch): Add .xsave.
- (md_show_usage): Add .xsave.
-
- * doc/c-i386.texi: Add xsave to -march=.
-
-2008-02-07 Alan Modra <amodra@bigpond.net.au>
-
- * read.c (s_weakref): Don't pass unadorned NULL to concat.
- * config/tc-i386.c (set_cpu_arch, md_parse_option): Likewise.
-
-2008-02-05 Sterling Augustine <sterling@tensilica.com>
-
- * config/tc-xtensa.c (relax_frag_immed): Change internal consistency
- checks into assertions. When relaxation produces an operation that
- does not fit in the current FLIX instruction, make sure that the
- operation is relaxed as needed to account for being placed following
- the current instruction.
-
-2008-02-04 H.J. Lu <hongjiu.lu@intel.com>
-
- PR 5715
- * configure: Regenerated.
-
-2008-02-04 Adam Nemet <anemet@caviumnetworks.com>
-
- * config/tc-mips.c (mips_cpu_info_table): Add Octeon.
-
-2008-01-31 Marc Gauthier <marc@tensilica.com>
-
- * configure.tgt (xtensa*-*-*): Recognize processor variants.
-
-2008-01-25 Kai Tietz <kai.tietz@onevision.com>
-
- * read.c: (emit_expr): Correct for mingw use of printf size
- specifier.
-
-2008-01-24 Bob Wilson <bob.wilson@acm.org>
-
- * doc/c-xtensa.texi (Xtensa Syntax): Clarify handling of opcodes that
- can only be encoded in FLIX instructions but are not specified as such.
- (Xtensa Automatic Alignment): Remove obsolete comment about debugging
- labels.
-
-2008-01-24 H.J. Lu <hongjiu.lu@intel.com>
-
- * NEWS: Mention new command line options for x86 targets.
-
-2008-01-23 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (md_show_usage): Replace tabs with spaces.
-
-2008-01-23 Eric B. Weddington <eric.weddington@atmel.com>
-
- * config/tc-avr.c (mcu_types): Change opcode set for at86rf401.
-
-2008-01-23 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (md_show_usage): Show more processors for
- -march=/-mtune=.
-
-2008-01-22 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (i386_target_format): Remove cpummx2.
-
-2008-01-22 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (XXX_PREFIX): Moved from tc-i386.h.
- (XXX_MNEM_SUFFIX): Likewise.
- (END_OF_INSN): Likewise.
- (templates): Likewise.
- (modrm_byte): Likewise.
- (rex_byte): Likewise.
- (DREX_XXX): Likewise.
- (drex_byte): Likewise.
- (sib_byte): Likewise.
- (processor_type): Likewise.
- (arch_entry): Likewise.
- (cpu_sub_arch_name): Remove const.
- (cpu_arch): Add .vmx and .smx.
- (set_cpu_arch): Append cpu_sub_arch_name.
- (md_parse_option): Support -march=CPU[,+EXTENSION...].
- (md_show_usage): Updated.
-
- * config/tc-i386.h (XXX_PREFIX): Moved to tc-i386.c.
- (XXX_MNEM_SUFFIX): Likewise.
- (END_OF_INSN): Likewise.
- (templates): Likewise.
- (modrm_byte): Likewise.
- (rex_byte): Likewise.
- (DREX_XXX): Likewise.
- (drex_byte): Likewise.
- (sib_byte): Likewise.
- (processor_type): Likewise.
- (arch_entry): Likewise.
-
- * doc/as.texinfo: Update i386 -march option.
-
- * doc/c-i386.texi: Update -march= for ISA.
-
-2008-01-18 Bob Wilson <bob.wilson@acm.org>
-
- * config/tc-xtensa.c (xtensa_leb128): New function.
- (md_pseudo_table): Use it for sleb128 and uleb128.
- (is_leb128_expr): New internal flag.
- (xtensa_symbol_new_hook): Check new flag.
-
-2008-01-16 Eric B. Weddington <eric.weddington@atmel.com>
-
- * config/tc-avr.c (mcu_types): Change opcode set for avr3,
- at90usb82, at90usb162.
- * doc/c-avr.texi: Change architecture grouping for at90usb82,
- at90usb162.
- These changes support the new avr35 architecture group in gcc.
-
-2008-01-15 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (md_assemble): Also zap movzx and movsx
- suffix for AT&T syntax.
-
-2008-01-14 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (match_reg_size): New.
- (match_mem_size): Likewise.
- (operand_size_match): Likewise.
- (operand_type_match): Also clear all size fields.
- (match_template): Skip Intel syntax when in AT&T syntax.
- Call operand_size_match to check operand size.
- (i386_att_operand): Set the mem field to 1 for memory
- operand.
- (i386_intel_operand): Likewise.
-
-2008-01-12 H.J. Lu <hongjiu.lu@intel.com>
-
- PR gas/5534
- * config/tc-i386.c (_i386_insn): Update comment.
- (operand_type_match): Also clear unspecified.
- (operand_type_register_match): Likewise.
- (parse_operands): Initialize unspecified.
- (i386_intel_operand): Likewise.
- (match_template): Check memory and accumulator operand size.
- (i386_att_operand): Clear unspecified on register operand.
- (intel_e11): Likewise.
- (intel_e09): Set operand size and clean unspecified for
- "XXX PTR".
-
-2008-01-11 Andreas Schwab <schwab@suse.de>
-
- * read.c (s_space): Declare `repeat' as offsetT.
-
-2008-01-10 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (match_template): Check processor support
- first.
-
-2008-01-10 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (match_template): Continue if processor
- doesn't match.
-
-2008-01-09 Alexandre Oliva <aoliva@redhat.com>
-
- * config/tc-ia64.c (ia64_convert_frag): Zero-initialize room for
- unwind personality function address.
-
-2008-01-09 Bob Wilson <bob.wilson@acm.org>
-
- * dwarf2dbg.c (out_sleb128): Delete.
- (size_fixed_inc_line_addr, emit_fixed_inc_line_addr): New.
- (out_fixed_inc_line_addr): Delete.
- (relax_inc_line_addr, dwarf2dbg_estimate_size_before_relax): Call new
- size_fixed_inc_line_addr if DWARF2_USE_FIXED_ADVANCE_PC is set.
- (dwarf2dbg_convert_frag): Likewise for emit_fixed_inc_line_addr.
- (process_entries): Remove calls to out_fixed_inc_line_addr. When
- DWARF2_USE_FIXED_ADVANCE_PC is set, call relax_inc_line_addr.
- * read.h (emit_expr_fix): New prototype.
- * read.c (emit_expr): Move code to emit_expr_fix and use it here.
- (emit_expr_fix): New.
-
-2008-01-09 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (match_template): Check register size
- only when size of operands can be encoded the canonical way.
-
-2008-01-08 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (i386_operand): Renamed to ...
- (i386_att_operand): This.
- (parse_operands): Updated.
-
-2008-01-05 H.J. Lu <hongjiu.lu@intel.com>
-
- * doc/c-i386.texi: Update .att_mnemonic and .intel_mnemonic.
-
- * config/tc-i386.c (set_intel_mnemonic): Set intel_mnemonic
- only.
- (md_assemble): Remove Intel mode workaround.
- (match_template): Check support for old gcc, AT&T mnemonic
- and Intel Syntax.
- (md_parse_option): Don't set intel_mnemonic to 0 for
- OPTION_MOLD_GCC.
-
-2008-01-04 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.h: Update copyright to 2008.
-
-2008-01-04 Nick Clifton <nickc@redhat.com>
-
- * config/tc-ppc.c (parse_cpu): Preserve the settings of the
- PPC_OPCODE_ALTIVEC and PPC_OPCODE_SPE flags.
-
-2008-01-03 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (md_assemble): Use !intel_mnemonic instead
- of SYSV386_COMPAT.
-
-2008-01-03 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/config/tc-i386.c (cpu_arch_flags_not): Removed.
- (cpu_flags_not): Likewise.
- (cpu_flags_match): Updated to check 64bit and arch.
- (set_code_flag): Remove cpu_arch_flags_not.
- (set_16bit_gcc_code_flag): Likewise.
- (set_cpu_arch): Likewise.
- (md_begin): Likewise.
- (parse_insn): Call cpu_flags_match to check 64bit and arch.
- (match_template): Likewise.
-
-2008-01-03 Jakub Jelinek <jakub@redhat.com>
-
- * config/tc-i386.c (process_drex): Initialize modrm_reg and
- modrm_regmem to 0 instead of None.
-
-2008-01-03 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (match_template): Use the xmmword field
- instead of no_xsuf.
-
-2008-01-02 H.J. Lu <hongjiu.lu@intel.com>
-
- * config/tc-i386.c (process_suffix): Fix a typo.
-
-2008-01-02 H.J. Lu <hongjiu.lu@intel.com>
-
- PR gas/5534
- * config/tc-i386.c (match_template): Handle XMMWORD_MNEM_SUFFIX.
- Check memory size in Intel mode.
- (process_suffix): Handle XMMWORD_MNEM_SUFFIX.
- (intel_e09): Likewise.
-
- * config/tc-i386.h (XMMWORD_MNEM_SUFFIX): New.
-
-2008-01-02 Catherine Moore <clm@codesourcery.com>
-
- * config/tc-mips.c (mips_ip): Check operands on jalr instruction.
-
-For older changes see ChangeLog-2007
-
-Local Variables:
-mode: change-log
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
diff --git a/gas/Makefile.am b/gas/Makefile.am
deleted file mode 100644
index a8b61cfa8bc..00000000000
--- a/gas/Makefile.am
+++ /dev/null
@@ -1,2215 +0,0 @@
-## Process this file with automake to generate Makefile.in
-
-AUTOMAKE_OPTIONS = 1.8 cygnus dejagnu
-ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
-
-SUBDIRS = doc po
-# Automake should figure this out on its own. It doesn't, because
-# of the "cygnus" option. But distclean still wants it.
-DIST_SUBDIRS = $(SUBDIRS)
-
-tooldir = $(exec_prefix)/$(target_alias)
-
-YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi`
-LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi`
-
-# We have to set this, because autoconf 2.59 does not substitute YFLAGS.
-# Autoconf 2.61 does, so this can be removed when we upgrade.
-YFLAGS =
-
-WARN_CFLAGS = @WARN_CFLAGS@
-NO_WERROR = @NO_WERROR@
-AM_CFLAGS = $(WARN_CFLAGS)
-
-MKDEP = gcc -MM
-
-TARG_CPU = @target_cpu_type@
-TARG_CPU_C = $(srcdir)/config/tc-@target_cpu_type@.c
-TARG_CPU_O = tc-@target_cpu_type@.o
-TARG_CPU_H = $(srcdir)/config/tc-@target_cpu_type@.h
-OBJ_FORMAT_C = $(srcdir)/config/obj-@obj_format@.c
-OBJ_FORMAT_O = obj-@obj_format@.o
-OBJ_FORMAT_H = $(srcdir)/config/obj-@obj_format@.h
-TARG_ENV_H = $(srcdir)/config/te-@te_file@.h
-ATOF_TARG_C = $(srcdir)/config/atof-@atof@.c
-ATOF_TARG_O = atof-@atof@.o
-
-# use @target_cpu_type@ for refering to configured target name
-IT_HDRS=itbl-parse.h $(srcdir)/itbl-ops.h
-IT_SRCS=itbl-parse.c itbl-lex.c $(srcdir)/itbl-ops.c
-IT_DEPS=$(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@target_cpu_type@.h
-IT_OBJS=itbl-parse.o itbl-lex.o itbl-ops.o
-
-# CPU types. This is only used for dependency information.
-
-CPU_TYPES = \
- alpha \
- arc \
- arm \
- avr \
- bfin \
- cr16 \
- cris \
- crx \
- d10v \
- d30v \
- dlx \
- fr30 \
- frv \
- h8300 \
- hppa \
- i370 \
- i386 \
- i860 \
- i960 \
- ia64 \
- ip2k \
- m32c \
- m32r \
- m68hc11 \
- m68k \
- maxq \
- mcore \
- mep \
- mips \
- mmix \
- mn10200 \
- mn10300 \
- msp430 \
- mt \
- ns32k \
- openrisc \
- or32 \
- pdp11 \
- pj \
- ppc \
- s390 \
- score \
- sh \
- sh64 \
- sparc \
- spu \
- tic30 \
- tic4x \
- tic54x \
- v850 \
- vax \
- xc16x \
- xstormy16 \
- xtensa \
- z80 \
- z8k
-
-# Object format types. This is only used for dependency information.
-# We deliberately omit SOM, since it does not work as a cross assembler.
-
-OBJ_FORMATS = \
- aout \
- coff \
- ecoff \
- elf \
- evax
-
-# This is an sh case which sets valid according to whether the CPU
-# type in the shell variable c and the OS type in the shell variable o
-# are supported. This helps cuts down on the amount of dependency
-# information.
-
-CPU_OBJ_VALID = \
- valid= ; \
- case $$o in \
- aout) \
- case $$c in \
- arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \
- valid=yes ;; \
- esac ;; \
- coff) \
- case $$c in \
- arm | h8300 | i386 | i960 | m68k | maxq | mcore | mips | or32 \
- | ppc | sh | sparc | tic* | xscale | z80 | z8k) \
- valid=yes ;; \
- esac ;; \
- ecoff) \
- case $$c in \
- mips | alpha) valid=yes ;; \
- esac ;; \
- elf) valid=yes ; \
- case $$c in \
- maxq | ns32k | tic* | z80 | z8k) valid= ;; \
- esac ;; \
- evax) \
- case $$c in \
- alpha) valid=yes ;; \
- esac ;; \
- vms) \
- case $$c in \
- vax) valid=yes ;; \
- esac ;; \
- esac;
-
-# These are like CPU_TYPES and CPU_OBJ_VALID, for the obj=multi case.
-
-MULTI_CPU_TYPES = i386 mips cris
-
-MULTI_CPU_OBJ_VALID = \
- valid= ; \
- case $$o in \
- aout) \
- case $$c in \
- i386 | cris) valid=yes ;; \
- esac ;; \
- coff) \
- case $$c in \
- i386 | mips) valid=yes ;; \
- esac ;; \
- ecoff) \
- case $$c in \
- mips) valid=yes ;; \
- esac ;; \
- elf) valid=yes ;; \
- esac;
-
-# Regular source files.
-
-GAS_CFILES = \
- app.c \
- as.c \
- atof-generic.c \
- cond.c \
- depend.c \
- dwarf2dbg.c \
- dw2gencfi.c \
- ecoff.c \
- ehopt.c \
- expr.c \
- flonum-copy.c \
- flonum-konst.c \
- flonum-mult.c \
- frags.c \
- hash.c \
- input-file.c \
- input-scrub.c \
- listing.c \
- literal.c \
- macro.c \
- messages.c \
- output-file.c \
- read.c \
- remap.c \
- sb.c \
- stabs.c \
- subsegs.c \
- symbols.c \
- write.c
-
-CFILES = $(GAS_CFILES) itbl-ops.c cgen.c
-
-HFILES = \
- as.h \
- asintl.h \
- bignum.h \
- bit_fix.h \
- cgen.h \
- dwarf2dbg.h \
- dw2gencfi.h \
- ecoff.h \
- emul-target.h \
- emul.h \
- expr.h \
- flonum.h \
- frags.h \
- hash.h \
- input-file.h \
- itbl-lex.h \
- itbl-ops.h \
- listing.h \
- macro.h \
- obj.h \
- output-file.h \
- read.h \
- sb.h \
- struc-symbol.h \
- subsegs.h \
- symbols.h \
- tc.h \
- write.h
-
-# CPU files in config.
-
-TARGET_CPU_CFILES = \
- config/tc-alpha.c \
- config/tc-arc.c \
- config/tc-arm.c \
- config/tc-avr.c \
- config/tc-bfin.c \
- config/tc-cr16.c \
- config/tc-cris.c \
- config/tc-crx.c \
- config/tc-d10v.c \
- config/tc-d30v.c \
- config/tc-dlx.c \
- config/tc-fr30.c \
- config/tc-frv.c \
- config/tc-h8300.c \
- config/tc-hppa.c \
- config/tc-ia64.c \
- config/tc-i370.c \
- config/tc-i386.c \
- config/tc-i860.c \
- config/tc-i960.c \
- config/tc-ip2k.c \
- config/tc-iq2000.c \
- config/tc-m32c.c \
- config/tc-m32r.c \
- config/tc-m68hc11.c \
- config/tc-m68k.c \
- config/tc-maxq.c \
- config/tc-mcore.c \
- config/tc-mep.c \
- config/tc-mips.c \
- config/tc-mmix.c \
- config/tc-mn10200.c \
- config/tc-mn10300.c \
- config/tc-msp430.c \
- config/tc-mt.c \
- config/tc-ns32k.c \
- config/tc-openrisc.c \
- config/tc-or32.c \
- config/tc-pdp11.c \
- config/tc-pj.c \
- config/tc-ppc.c \
- config/tc-s390.c \
- config/tc-score.c \
- config/tc-sh.c \
- config/tc-sh64.c \
- config/tc-sparc.c \
- config/tc-spu.c \
- config/tc-tic30.c \
- config/tc-tic4x.c \
- config/tc-tic54x.c \
- config/tc-vax.c \
- config/tc-v850.c \
- config/tc-xstormy16.c \
- config/tc-xc16x.c \
- config/tc-xtensa.c \
- config/tc-z80.c \
- config/tc-z8k.c \
- config/xtensa-relax.c
-
-TARGET_CPU_HFILES = \
- config/tc-alpha.h \
- config/tc-arc.h \
- config/tc-arm.h \
- config/tc-avr.h \
- config/tc-bfin.h \
- config/tc-cr16.h \
- config/tc-cris.h \
- config/tc-crx.h \
- config/tc-d10v.h \
- config/tc-d30v.h \
- config/tc-dlx.h \
- config/tc-fr30.h \
- config/tc-frv.h \
- config/tc-h8300.h \
- config/tc-hppa.h \
- config/tc-ia64.h \
- config/tc-i370.h \
- config/tc-i386.h \
- config/tc-i860.h \
- config/tc-i960.h \
- config/tc-ip2k.h \
- config/tc-iq2000.h \
- config/tc-m32c.h \
- config/tc-m32r.h \
- config/tc-m68hc11.h \
- config/tc-m68k.h \
- config/tc-maxq.h \
- config/tc-mcore.h \
- config/tc-mep.h \
- config/tc-mips.h \
- config/tc-mmix.h \
- config/tc-mn10200.h \
- config/tc-mn10300.h \
- config/tc-msp430.h \
- config/tc-mt.h \
- config/tc-ns32k.h \
- config/tc-openrisc.h \
- config/tc-or32.h \
- config/tc-pdp11.h \
- config/tc-pj.h \
- config/tc-ppc.h \
- config/tc-s390.h \
- config/tc-score.h \
- config/tc-sh.h \
- config/tc-sh64.h \
- config/tc-sparc.h \
- config/tc-spu.h \
- config/tc-tic30.h \
- config/tc-tic4x.h \
- config/tc-tic54x.h \
- config/tc-vax.h \
- config/tc-v850.h \
- config/tc-xstormy16.h \
- config/tc-xc16x.h \
- config/tc-xtensa.h \
- config/tc-z80.h \
- config/tc-z8k.h \
- config/xtensa-relax.h
-
-# OBJ files in config
-
-OBJ_FORMAT_CFILES = \
- config/obj-aout.c \
- config/obj-coff.c \
- config/obj-ecoff.c \
- config/obj-elf.c \
- config/obj-evax.c \
- config/obj-fdpicelf.c \
- config/obj-som.c
-
-OBJ_FORMAT_HFILES = \
- config/obj-aout.h \
- config/obj-coff.h \
- config/obj-ecoff.h \
- config/obj-elf.h \
- config/obj-evax.h \
- config/obj-fdpicelf.h \
- config/obj-som.h
-
-# Emulation header files in config
-
-TARG_ENV_HFILES = \
- config/te-386bsd.h \
- config/te-aix5.h \
- config/te-armeabi.h \
- config/te-armlinuxeabi.h \
- config/te-dynix.h \
- config/te-epoc-pe.h \
- config/te-freebsd.h \
- config/te-generic.h \
- config/te-gnu.h \
- config/te-go32.h \
- config/te-hppa.h \
- config/te-hppa64.h \
- config/te-hppalinux64.h \
- config/te-i386aix.h \
- config/te-ia64aix.h \
- config/te-interix.h \
- config/te-lnews.h \
- config/te-lynx.h \
- config/te-mach.h \
- config/te-macos.h \
- config/te-nbsd.h \
- config/te-nbsd532.h \
- config/te-netware.h \
- config/te-pc532mach.h \
- config/te-pe.h \
- config/te-psos.h \
- config/te-riscix.h \
- config/te-sparcaout.h \
- config/te-sun3.h \
- config/te-svr4.h \
- config/te-symbian.h \
- config/te-tmips.h \
- config/te-vxworks.h \
- config/te-wince-pe.h
-
-# Multi files in config
-
-MULTI_CFILES = \
- config/e-crisaout.c \
- config/e-criself.c \
- config/e-i386aout.c \
- config/e-i386coff.c \
- config/e-i386elf.c \
- config/e-mipsecoff.c \
- config/e-mipself.c
-
-CONFIG_OBJS = \
- $(TARG_CPU_O) \
- $(OBJ_FORMAT_O) \
- $(ATOF_TARG_O) \
- $(extra_objects)
-
-GENERIC_OBJS = \
- app.o \
- as.o \
- atof-generic.o \
- cond.o \
- depend.o \
- dwarf2dbg.o \
- dw2gencfi.o \
- ehopt.o \
- expr.o \
- flonum-konst.o \
- flonum-copy.o \
- flonum-mult.o \
- frags.o \
- hash.o \
- input-file.o \
- input-scrub.o \
- literal.o \
- messages.o \
- output-file.o \
- read.o \
- remap.o \
- subsegs.o \
- symbols.o \
- write.o \
- listing.o \
- ecoff.o \
- stabs.o \
- sb.o \
- macro.o
-
-CONFIG_ATOF_CFILES = \
- config/atof-ieee.c \
- config/atof-vax.c
-
-OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
-
-POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) $(TARG_ENV_HFILES) $(OBJ_FORMAT_HFILES) \
- $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \
- $(HFILES) $(CFILES)
-po/POTFILES.in: @MAINT@ Makefile
- for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
- && mv tmp $(srcdir)/po/POTFILES.in
-
-# Note: GASP is now deprecated and has been removed. It is still
-# available in the CVS archive or older binutils releases if it is needed.
-noinst_PROGRAMS = as-new
-noinst_SCRIPTS = $(GDBINIT)
-EXTRA_SCRIPTS = .gdbinit
-
-EXTRA_DIST = m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c \
- bfin-parse.c bfin-parse.h bfin-lex.c
-
-diststuff: $(EXTRA_DIST) info
-all: info
-
-DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
-
-# Now figure out from those variables how to compile and link.
-
-BASEDIR = $(srcdir)/..
-BFDDIR = $(BASEDIR)/bfd
-INCDIR = $(BASEDIR)/include
-
-# This is the variable actually used when we compile.
-# Specify the directories to be searched for header files.
-# Both . and srcdir are used, in that order,
-# so that tm.h and config.h will be found in the compilation
-# subdirectory rather than in the source directory.
-INCLUDES = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \
- -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \
- -DLOCALEDIR="\"$(datadir)/locale\""
-
-# This should be parallel to INCLUDES, but should replace $(srcdir)
-# with $${srcdir}, and should work in a subdirectory. This is used
-# when building dependencies, because the dependency building is done
-# in a subdirectory.
-DEP_INCLUDES = -I.. -I$${srcdir} -I../../bfd \
- -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. \
- -I$${srcdir}/../bfd @INCINTL@ \
- -DLOCALEDIR="\"$(datadir)/locale\""
-
-DEP_FLAGS = -DOBJ_MAYBE_ELF \
- -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES)
-
-# How to link with both our special library facilities
-# and the system's installed libraries.
-
-GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a
-
-# Files to be copied away after each stage in building.
-STAGESTUFF = *.o $(noinst_PROGRAMS)
-
-as_new_SOURCES = $(GAS_CFILES)
-as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
- $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM)
-as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
- $(extra_objects) $(GASLIBS) $(LIBINTL_DEP)
-
-# Stuff that every object file depends upon. If anything is removed
-# from this list, remove it from dep-in.sed as well.
-$(OBJS): ../bfd/bfd.h $(INCDIR)/symcat.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/fopen-bin.h $(INCDIR)/fopen-vms.h \
- $(OBJ_FORMAT_H) $(TARG_CPU_H) $(TARG_ENV_H) \
- as.h asintl.h bignum.h bit_fix.h config.h emul.h expr.h flonum.h \
- frags.h hash.h listing.h obj.h read.h symbols.h tc.h write.h
-
-EXPECT = expect
-RUNTEST = runtest
-RUNTESTFLAGS=
-
-check-DEJAGNU: site.exp
- if [ -d testsuite ]; then \
- true; \
- else \
- mkdir testsuite; \
- fi
- rm -f testsuite/site.exp
- cp site.exp testsuite/site.exp
- rootme=`pwd`; export rootme; \
- srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
- EXPECT=${EXPECT} ; export EXPECT ; \
- runtest=$(RUNTEST); \
- cd testsuite; \
- if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
- $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
- $(RUNTESTFLAGS); \
- else echo "WARNING: could not find \`runtest'" 1>&2; :;\
- fi
-
-# The implicit .c.o rule doesn't work for these, perhaps because of
-# the variables, or perhaps because the sources are not on vpath.
-$(TARG_CPU_O): $(TARG_CPU_C)
- $(COMPILE) -c $(TARG_CPU_C)
-$(ATOF_TARG_O): $(ATOF_TARG_C)
- $(COMPILE) -c $(ATOF_TARG_C)
-
-# ecoff.c only has full dependencies when ECOFF_DEBUGGING is defined,
-# so the automatic dependency stuff doesn't work.
-ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \
- $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/symconst.h \
- $(INCDIR)/aout/stab_gnu.h
-
-# We need all these explicit rules for the multi stuff. Because of
-# these rules, we don't need one for OBJ_FORMAT_O.
-
-obj-aout.o : $(srcdir)/config/obj-aout.c $(DEP_@target_cpu_type@_aout)
- $(COMPILE) -c $(srcdir)/config/obj-aout.c
-obj-coff.o: $(srcdir)/config/obj-coff.c $(DEP_@target_cpu_type@_coff)
- $(COMPILE) -c $(srcdir)/config/obj-coff.c
-obj-ecoff.o : $(srcdir)/config/obj-ecoff.c $(DEP_@target_cpu_type@_ecoff)
- $(COMPILE) -c $(srcdir)/config/obj-ecoff.c
-obj-elf.o : $(srcdir)/config/obj-elf.c $(DEP_@target_cpu_type@_elf)
- $(COMPILE) -c $(srcdir)/config/obj-elf.c
-obj-evax.o : $(srcdir)/config/obj-evax.c
- $(COMPILE) -c $(srcdir)/config/obj-evax.c
-obj-fdpicelf.o : $(srcdir)/config/obj-fdpicelf.c
- $(COMPILE) -c $(srcdir)/config/obj-fdpicelf.c
-obj-multi.o : $(srcdir)/config/obj-multi.c
- $(COMPILE) -c $(srcdir)/config/obj-multi.c
-obj-som.o : $(srcdir)/config/obj-som.c
- $(COMPILE) -c $(srcdir)/config/obj-som.c
-
-e-mipself.o : $(srcdir)/config/e-mipself.c
- $(COMPILE) -c $(srcdir)/config/e-mipself.c
-e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c
- $(COMPILE) -c $(srcdir)/config/e-mipsecoff.c
-e-i386aout.o: $(srcdir)/config/e-i386aout.c
- $(COMPILE) -c $(srcdir)/config/e-i386aout.c
-e-i386coff.o: $(srcdir)/config/e-i386coff.c
- $(COMPILE) -c $(srcdir)/config/e-i386coff.c
-e-i386elf.o: $(srcdir)/config/e-i386elf.c
- $(COMPILE) -c $(srcdir)/config/e-i386elf.c
-e-crisaout.o: $(srcdir)/config/e-crisaout.c
- $(COMPILE) -c $(srcdir)/config/e-crisaout.c
-e-criself.o: $(srcdir)/config/e-criself.c
- $(COMPILE) -c $(srcdir)/config/e-criself.c
-
-xtensa-relax.o: $(srcdir)/config/xtensa-relax.c
- $(COMPILE) -c $(srcdir)/config/xtensa-relax.c
-
-# The m68k operand parser.
-
-EXTRA_as_new_SOURCES = config/m68k-parse.y config/bfin-parse.y
-
-# If m68k-parse.y is in a different directory, then ylwrap will use an
-# absolute path when it invokes yacc, which will cause yacc to put the
-# absolute path into the generated file. That's a pain when it comes
-# to generating snapshots, because it introduces spurious diffs.
-# Since when we make the snapshots $(srcdir) = ".", we check for that
-# case and handle it differently. This means that anybody who
-# configures with $(srcdir) = "." will have to set their path in the
-# debugger if they want to debug m68k-parse.y. This is bad, but on
-# the other hand it's good that people who use the prebuilt
-# m68k-parse.c don't get a spurious absolute path.
-m68k-parse.c: $(srcdir)/config/m68k-parse.y
- f=$(srcdir)/config/m68k-parse.y; \
- if [ $$f = "./config/m68k-parse.y" ]; then \
- ln -s config/m68k-parse.y . > /dev/null 2>/dev/null || \
- ln config/m68k-parse.y . > /dev/null 2>/dev/null || \
- cp config/m68k-parse.y . >/dev/null 2>/dev/null; \
- f=m68k-parse.y; \
- else true; fi; \
- $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \
- if [ $$f = "m68k-parse.y" ]; then \
- rm -f m68k-parse.y; \
- else true; fi
-# Disable -Werror, if it has been enabled, since old versions of bison/
-# yacc will produce working code which contain compile time warnings.
-m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h
- $(COMPILE) -c $< $(NO_WERROR)
-
-# Don't let the .y.h rule clobber m68k-parse.h.
-m68k-parse.h: ; @true
-$(srcdir)/config/m68k-parse.h: ; @true
-
-bfin-parse.c: $(srcdir)/config/bfin-parse.y
- $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
-bfin-parse.h: bfin-parse.c
-bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
-
-bfin-defs.h: ; @true
-$(srcdir)/config/bfin-defs.h: ; @true
-
-bfin-lex.c: $(srcdir)/config/bfin-lex.l
- $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
-bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
- $(COMPILE) -c $< $(NO_WERROR)
-
-# The instruction table specification lexical analyzer and parser.
-
-itbl-lex.c: $(srcdir)/itbl-lex.l
-
-# Disable -Werror, if it has been enabled, since old versions of bison/
-# yacc will produce working code which contain compile time warnings.
-itbl-lex.o: itbl-lex.c itbl-parse.h $(srcdir)/itbl-lex.h
- $(COMPILE) -c $< $(NO_WERROR)
-
-# Disable -Werror, if it has been enabled, since old versions of bison/
-# yacc will produce working code which contain compile time warnings.
-itbl-parse.o: itbl-parse.c itbl-parse.h $(srcdir)/itbl-ops.h $(srcdir)/itbl-lex.h
- $(COMPILE) -c $< $(NO_WERROR)
-
-itbl-ops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h
-
-itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y
- $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
-
-# stand-alone itbl assembler & disassembler
-
-EXTRA_PROGRAMS = itbl-test
-itbl_test_SOURCES = itbl-parse.y itbl-lex.l
-itbl_test_LDADD = itbl-tops.o itbl-test.o $(GASLIBS) @LEXLIB@
-
-itbl-tops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h
- $(COMPILE) -o itbl-tops.o -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
-
-itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c $(srcdir)/itbl-ops.h
- $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
-
-# CGEN interface.
-
-CGEN_CPU_PREFIX = @cgen_cpu_prefix@
-
-cgen.o: cgen.c cgen.h cgen-desc.h subsegs.h \
- $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
- $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-desc.h \
- $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-opc.h
-
-# Remake the info files.
-
-MOSTLYCLEANFILES = $(STAGESTUFF) core \
- testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \
- testsuite/site.exp site.bak site.exp stage stage1 stage2
-
-CLEANFILES = dep.sed DEPTC DEPTCA DEPOBJ DEPOBJA DEP2 DEP2A DEP1 DEPA DEP DEPDIR
-
-.PHONY: install-html install-html-am install-html-recursive
-
-install-html: install-html-recursive
-
-install-html-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-.PHONY: install-exec-local install-data-local
-.PHONY: install-exec-bindir install-exec-tooldir
-
-install-exec-local: install-exec-bindir @install_tooldir@
-
-install-exec-bindir: $(noinst_PROGRAMS)
- $(mkinstalldirs) $(DESTDIR)$(bindir)
- @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//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
- else :; fi; \
- done
-
-install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS)
- $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
- n=`echo as | sed '$(transform)'`; \
- if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
- rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
- ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
- || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
- else \
- true ; \
- fi
-
-# These exist for maintenance purposes.
-
-.PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
-
-bootstrap: as-new
- $(MAKE) stage1
- rm -f stage && ln -s stage1 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
- $(MAKE) stage2
- rm -f stage && ln -s stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
- $(MAKE) comparison against=stage2
-
-bootstrap2:
- rm -f stage && ln -s stage1 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
- $(MAKE) stage2
- rm -f stage && ln -s stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
- $(MAKE) comparison against=stage2
-
-bootstrap3:
- rm -f stage && ln -s stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
- $(MAKE) comparison against=stage2
-
-# Copy the object files from a particular stage into a subdirectory.
-stage1:
- -mkdir stage1
- -mv $(STAGESTUFF) stage1
- if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
-
-stage2:
- -mkdir stage2
- -mv $(STAGESTUFF) stage2
- if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
-
-stage3:
- -mkdir stage3
- -mv $(STAGESTUFF) stage3
- if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
-
-against=stage2
-
-# This rule is derived from corresponding code in the Makefile.in for gcc.
-# The "tail +16c" is to bypass headers which may include timestamps or
-# temporary assembly file names.
-comparison:
- x=0 ; \
- for file in *.o ; do \
- tail +16c ./$$file > tmp-foo1; \
- if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
- if cmp tmp-foo1 tmp-foo2 ; then \
- true ; \
- else \
- echo $$file differs ; \
- x=1 ; \
- fi ; \
- else true; fi ; \
- done ; \
- exit $$x
- -rm -f tmp-foo*
-
-.PHONY: de-stage1 de-stage2 de-stage3
-
-de-stage1:
- - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
- - rmdir stage1
-
-de-stage2:
- - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
- - rmdir stage2
-
-de-stage3:
- - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
- - rmdir stage3
-
-DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
- $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES)
-
-CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt
-
-# Automatic dependency computation. This is a real pain, because the
-# dependencies change based on target_cpu_type and obj_format.
-# Just to make things even more complicated, automake separates the
-# dependency variable assignments from the dependency rules, and tacks
-# on a .NOEXPORT at the end of Makefile.in.
-
-DEP: dep.sed $(DEP_FILE_DEPS) DEPTC DEPOBJ DEP2
- rm -f DEP1 # delete because we use $? in DEP1 rule
- srcdir=`cd $(srcdir); pwd`; \
- $(MAKE) MKDEP="$(MKDEP)" srcdir="$${srcdir}" VPATH="$${srcdir}" DEP1
- rm -rf DEPDIR
- echo 'AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW.' > DEPA
- sed -f dep.sed < DEPTC >> DEPA
- sed -f dep.sed < DEPOBJ >> DEPA
- sed -f dep.sed < DEP2 >> DEPA
- echo 'BMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE.' >> DEPA
- echo '#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW.' >> DEPA
- sed -f dep.sed < DEP1 >> DEPA
- echo '$$(OBJS): $$(DEP_@target''_cpu_type@_@obj''_format@)' >> DEPA
- echo '$$(TARG_CPU_O): $$(DEPTC_@target''_cpu_type@_@obj''_format@)' >> DEPA
- echo '$$(OBJ_FORMAT_O): $$(DEPOBJ_@target''_cpu_type@_@obj''_format@)' >> DEPA
- echo '#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE.' >> DEPA
- if grep ' /' DEPA > /dev/null 2> /dev/null; then \
- echo 'make DEP failed!'; exit 1; \
- else \
- mv -f DEPA $@; \
- fi
-
-DEP1: $(CFILES) $(MULTI_CFILES)
- if [ -d DEPDIR ]; then true; else mkdir DEPDIR; fi
- srcdir=`cd $(srcdir); pwd`; \
- cd DEPDIR; \
- echo '' > targ-cpu.h; \
- echo '' > obj-format.h; \
- echo '' > targ-env.h; \
- echo '' > itbl-cpu.h; \
- echo '' > itbl-parse.h; \
- $(MKDEP) $(DEP_FLAGS) $? > DEP
- mv -f DEPDIR/DEP $@
-
-# Work out the special dependencies for the tc-*.c files.
-DEPTC: $(TARGET_CPU_CFILES)
- rm -f DEPTCA
- if [ -d DEPDIR ]; then true; else mkdir DEPDIR; fi
- srcdir=`cd $(srcdir); pwd`; \
- cd DEPDIR; \
- for c in $(CPU_TYPES); do \
- for o in $(OBJ_FORMATS); do \
- $(CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
- echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
- echo '#include "te-generic.h"' > targ-env.h; \
- echo '' > itbl-cpu.h; \
- echo '' > itbl-parse.h; \
- if [ -f $${srcdir}/opcodes/$${c}-desc.h ]; then \
- echo '#include "opcodes/'"$${c}"'-desc.h"' > cgen-desc.h; \
- else \
- echo '' > cgen-desc.h; \
- fi ;\
- rm -f dummy.c; \
- cp $${srcdir}/config/tc-$${c}.c dummy.c; \
- $(MKDEP) $(DEP_FLAGS) dummy.c | \
- sed -e "s/dummy.o: dummy.c/DEPTC_$${c}_$${o} =/" >> ../DEPTCA; \
- rm -f dummy.c; \
- else true; fi; \
- done; \
- done
- echo 'DEPTC_hppa_som = $$(srcdir)/config/tc-hppa.h subsegs.h \' >> DEPTCA
- echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> DEPTCA
- echo ' $$(INCDIR)/opcode/hppa.h $$(BFDDIR)/som.h' >> DEPTCA
- for c in $(MULTI_CPU_TYPES); do \
- echo "DEPTC_$${c}"'_multi = \' >> DEPTCA; \
- for o in $(OBJ_FORMATS); do \
- $(MULTI_CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '$$(DEPTC_'"$${c}_$${o}"') \' >> DEPTCA; \
- else true; fi; \
- done; \
- echo '' >> DEPTCA; \
- done
- mv -f DEPTCA DEPTC
-
-# Work out the special dependencies for the obj-*.c files.
-DEPOBJ: $(OBJ_FORMAT_CFILES)
- rm -f DEPOBJA
- if [ -d DEPDIR ]; then true; else mkdir DEPDIR; fi
- srcdir=`cd $(srcdir); pwd`; \
- cd DEPDIR; \
- for c in $(CPU_TYPES); do \
- for o in $(OBJ_FORMATS); do \
- $(CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
- echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
- echo '#include "te-generic.h"' > targ-env.h; \
- echo '' > itbl-cpu.h; \
- echo '' > itbl-parse.h; \
- rm -f dummy.c; \
- cp $${srcdir}/config/obj-$${o}.c dummy.c; \
- $(MKDEP) $(DEP_FLAGS) dummy.c | \
- sed -e "s/dummy.o: dummy.c/DEPOBJ_$${c}_$${o} =/" >> ../DEPOBJA; \
- rm -f dummy.c; \
- else true; fi; \
- done; \
- done
- echo 'DEPOBJ_hppa_som = $$(srcdir)/config/obj-som.h subsegs.h \' >> DEPOBJA
- echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> DEPOBJA
- echo ' $$(BFDDIR)/som.h $$(INCDIR)/aout/stab_gnu.h \' >> DEPOBJA
- echo ' $$(INCDIR)/aout/stab.def' >> DEPOBJA
- for c in $(MULTI_CPU_TYPES); do \
- echo "DEPOBJ_$${c}"'_multi = \' >> DEPOBJA; \
- for o in $(OBJ_FORMATS); do \
- $(MULTI_CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '$$(DEPOBJ_'"$${c}_$${o}"') \' >> DEPOBJA; \
- else true; fi; \
- done; \
- echo '' >> DEPOBJA; \
- done
- mv -f DEPOBJA DEPOBJ
-
-# Work out the dependencies for each CPU/OBJ combination.
-# Note that SOM is a special case, because it only works native.
-DEP2: $(TARGET_CPU_HFILES) $(OBJ_FORMAT_HFILES)
- rm -f DEP2A
- if [ -d DEPDIR ]; then true; else mkdir DEPDIR; fi
- srcdir=`cd $(srcdir); pwd`; \
- cd DEPDIR; \
- for c in $(CPU_TYPES); do \
- for o in $(OBJ_FORMATS); do \
- $(CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
- echo '#include "obj-'"$${o}"'.h"' > dummy.c; \
- $(MKDEP) $(DEP_FLAGS) dummy.c | \
- sed -e "s/dummy.o: dummy.c/DEP_$${c}_$${o} =/" >> ../DEP2A; \
- else true; fi; \
- done; \
- done
- echo 'DEP_hppa_som = $$(BFDDIR)/som.h' >> DEP2A
- for c in $(MULTI_CPU_TYPES); do \
- echo "DEP_$${c}"'_multi = \' >> DEP2A; \
- for o in $(OBJ_FORMATS); do \
- $(MULTI_CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '$$(DEP_'"$${c}_$${o}"') \' >> DEP2A; \
- else true; fi; \
- done; \
- echo '' >> DEP2A; \
- done
- mv -f DEP2A DEP2
-
-dep.sed: dep-in.sed config.status
- srcdir=`cd $(srcdir); pwd`; \
- sed <$(srcdir)/dep-in.sed >dep.sed \
- -e "s!@INCDIR@!$${srcdir}/../include!" \
- -e "s!@BFDDIR@!$${srcdir}/../bfd!" \
- -e "s!@SRCDIR@!$${srcdir}!" \
- -e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/gas,,`'!'
-
-dep: DEP
- sed -e '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./d' \
- < Makefile > tmp-Makefile
- cat DEP >> tmp-Makefile
- $(SHELL) $(srcdir)/../move-if-change tmp-Makefile Makefile
-
-dep-in: DEP
- sed -e '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./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 '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./d' \
- < $(srcdir)/Makefile.am > tmp-Makefile.am
- cat DEP >> tmp-Makefile.am
- $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
-
-# HEED THE MKDEP WARNINGS.
-# ANYTHING CHANGED OR ADDED BETWEEN THE WARNING LINES MAY GO AWAY.
-.PHONY: dep dep-in dep-am
-
-AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW.
-DEPTC_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \
- $(INCDIR)/opcode/alpha.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c
-DEPTC_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h subsegs.h \
- $(INCDIR)/obstack.h struc-symbol.h ecoff.h $(INCDIR)/coff/sym.h \
- $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/elf/alpha.h \
- $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c
-DEPTC_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h \
- subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \
- $(INCDIR)/opcode/alpha.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c
-DEPTC_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \
- struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \
- $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h
-DEPTC_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \
- dwarf2dbg.h
-DEPTC_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \
- dwarf2dbg.h
-DEPTC_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \
- $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h dwarf2dbg.h
-DEPTC_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/avr.h
-DEPTC_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \
- struc-symbol.h $(srcdir)/config/bfin-defs.h $(INCDIR)/obstack.h \
- $(INCDIR)/safe-ctype.h dwarf2dbg.h $(BFDDIR)/libbfd.h \
- $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h \
- $(INCDIR)/elf/reloc-macros.h $(srcdir)/config/bfin-aux.h \
- $(srcdir)/config/bfin-defs.h $(INCDIR)/opcode/bfin.h
-DEPTC_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/opcode/cr16.h \
- $(INCDIR)/elf/cr16.h $(INCDIR)/elf/reloc-macros.h
-DEPTC_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/cris.h \
- dwarf2dbg.h
-DEPTC_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/cris.h dwarf2dbg.h
-DEPTC_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/opcode/crx.h \
- $(INCDIR)/elf/crx.h $(INCDIR)/elf/reloc-macros.h
-DEPTC_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d10v.h \
- $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h
-DEPTC_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d30v.h
-DEPTC_dlx_elf = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-elf.h \
- $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \
- dwarf2dbg.h $(srcdir)/config/tc-dlx.h $(INCDIR)/opcode/dlx.h
-DEPTC_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/../opcodes/fr30-desc.h $(INCDIR)/opcode/cgen-bitset.h \
- $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \
- $(srcdir)/../opcodes/fr30-opc.h cgen.h
-DEPTC_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h subsegs.h \
- $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/frv-opc.h \
- cgen.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h
-DEPTC_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
- dwarf2dbg.h $(INCDIR)/opcode/h8300.h $(INCDIR)/safe-ctype.h
-DEPTC_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/h8300.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h
-DEPTC_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \
- $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h dwarf2dbg.h
-DEPTC_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h \
- $(INCDIR)/elf/reloc-macros.h
-DEPTC_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
- $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \
- $(srcdir)/../opcodes/i386-init.h
-DEPTC_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
- $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \
- $(srcdir)/../opcodes/i386-init.h
-DEPTC_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \
- $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \
- $(srcdir)/../opcodes/i386-init.h
-DEPTC_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/i860.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h
-DEPTC_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/i960.h
-DEPTC_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h
-DEPTC_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \
- $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \
- dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/ia64.h \
- $(INCDIR)/elf/ia64.h
-DEPTC_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/ip2k-opc.h \
- cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/ip2k.h \
- $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h
-DEPTC_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32c-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/m32c-opc.h \
- $(srcdir)/../opcodes/cgen-types.h ../bfd/bfd_stdint.h \
- $(srcdir)/../opcodes/cgen-ops.h cgen.h $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/m32c.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h \
- $(INCDIR)/hashtab.h $(INCDIR)/safe-ctype.h
-DEPTC_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/../opcodes/m32r-desc.h $(INCDIR)/opcode/cgen-bitset.h \
- $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \
- $(srcdir)/../opcodes/m32r-opc.h cgen.h $(INCDIR)/elf/m32r.h \
- $(INCDIR)/elf/reloc-macros.h
-DEPTC_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h $(INCDIR)/elf/m68hc11.h \
- $(INCDIR)/elf/reloc-macros.h
-DEPTC_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \
- dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \
- $(srcdir)/config/m68k-parse.h
-DEPTC_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \
- dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \
- $(srcdir)/config/m68k-parse.h
-DEPTC_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \
- dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \
- $(srcdir)/config/m68k-parse.h $(INCDIR)/elf/m68k.h \
- $(INCDIR)/elf/reloc-macros.h
-DEPTC_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(srcdir)/config/tc-maxq.h \
- $(INCDIR)/opcode/maxq.h
-DEPTC_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/../opcodes/mcore-opc.h $(INCDIR)/safe-ctype.h
-DEPTC_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h
-DEPTC_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \
- dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mep-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/mep-opc.h \
- cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/mep.h $(INCDIR)/elf/reloc-macros.h \
- $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/xregex.h \
- $(INCDIR)/xregex2.h
-DEPTC_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h itbl-ops.h \
- dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h \
- $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
-DEPTC_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
- ecoff.h
-DEPTC_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h subsegs.h \
- $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h \
- itbl-ops.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(srcdir)/config/obj-elf.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
-DEPTC_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h \
- $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/obstack.h
-DEPTC_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/mn10200.h
-DEPTC_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/mn10300.h dwarf2dbg.h
-DEPTC_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h \
- $(INCDIR)/safe-ctype.h dwarf2dbg.h
-DEPTC_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \
- dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mt-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/mt-opc.h \
- cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/mt.h $(INCDIR)/elf/reloc-macros.h \
- $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h
-DEPTC_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ns32k.h \
- $(INCDIR)/obstack.h
-DEPTC_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \
- dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/openrisc-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/openrisc-opc.h \
- cgen.h
-DEPTC_or32_coff = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-coff.h \
- $(srcdir)/config/tc-or32.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h $(INCDIR)/elf/reloc-macros.h
-DEPTC_or32_elf = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-elf.h \
- $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \
- dwarf2dbg.h $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h \
- $(INCDIR)/elf/reloc-macros.h
-DEPTC_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/opcode/pdp11.h
-DEPTC_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h
-DEPTC_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pj.h
-DEPTC_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \
- $(INCDIR)/obstack.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(INCDIR)/opcode/ppc.h
-DEPTC_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h \
- $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h
-DEPTC_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(INCDIR)/opcode/s390.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h
-DEPTC_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/opcode/score-inst.h $(INCDIR)/opcode/score-datadep.h \
- struc-symbol.h $(INCDIR)/elf/score.h $(INCDIR)/elf/reloc-macros.h \
- dwarf2dbg.h
-DEPTC_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \
- struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h
-DEPTC_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h subsegs.h \
- $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \
- struc-symbol.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
- dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h
-DEPTC_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
- $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h \
- $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \
- $(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \
- struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h
-DEPTC_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \
- dw2gencfi.h $(INCDIR)/elf/dwarf2.h
-DEPTC_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \
- dw2gencfi.h $(INCDIR)/elf/dwarf2.h
-DEPTC_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \
- dwarf2dbg.h
-DEPTC_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \
- $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/spu-insns.h
-DEPTC_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/opcode/tic30.h
-DEPTC_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/opcode/tic30.h
-DEPTC_tic4x_coff = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-coff.h \
- $(srcdir)/config/tc-tic4x.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic4x.h subsegs.h \
- $(INCDIR)/obstack.h $(INCDIR)/obstack.h
-DEPTC_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- sb.h macro.h subsegs.h $(INCDIR)/obstack.h struc-symbol.h \
- $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h
-DEPTC_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \
- $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h \
- dwarf2dbg.h
-DEPTC_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(srcdir)/config/vax-inst.h \
- $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/opcode/vax.h
-DEPTC_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \
- $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \
- $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(INCDIR)/elf/vax.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/vax.h
-DEPTC_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/../opcodes/xc16x-desc.h $(INCDIR)/opcode/cgen-bitset.h \
- $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \
- $(srcdir)/../opcodes/xc16x-opc.h cgen.h dwarf2dbg.h \
- $(INCDIR)/elf/xc16x.h $(INCDIR)/elf/reloc-macros.h
-DEPTC_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \
- dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/xstormy16-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/xstormy16-opc.h \
- cgen.h
-DEPTC_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \
- $(INCDIR)/xtensa-config.h sb.h $(INCDIR)/safe-ctype.h \
- $(srcdir)/config/tc-xtensa.h subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/config/xtensa-relax.h dwarf2dbg.h $(srcdir)/config/xtensa-istack.h \
- struc-symbol.h $(INCDIR)/xtensa-config.h
-DEPTC_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPTC_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- $(srcdir)/../opcodes/z8k-opc.h
-DEPTC_hppa_som = $(srcdir)/config/tc-hppa.h subsegs.h \
- $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h \
- $(BFDDIR)/som.h
-DEPTC_i386_multi = $(DEPTC_i386_aout) $(DEPTC_i386_coff) \
- $(DEPTC_i386_elf)
-DEPTC_mips_multi = $(DEPTC_mips_coff) $(DEPTC_mips_ecoff) \
- $(DEPTC_mips_elf)
-DEPTC_cris_multi = $(DEPTC_cris_aout) $(DEPTC_cris_elf)
-DEPOBJ_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- $(BFDDIR)/libecoff.h
-DEPOBJ_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \
- $(INCDIR)/aout/aout64.h
-DEPOBJ_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h
-DEPOBJ_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-DEPOBJ_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-DEPOBJ_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_dlx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \
- $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/i370.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
-DEPOBJ_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
- $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-DEPOBJ_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
- $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \
- $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \
- $(INCDIR)/aout/aout64.h
-DEPOBJ_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \
- $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-DEPOBJ_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/mep.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
-DEPOBJ_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- $(BFDDIR)/libecoff.h
-DEPOBJ_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
-DEPOBJ_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-DEPOBJ_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \
- dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_or32_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_or32_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-DEPOBJ_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/ppc.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
-DEPOBJ_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
- $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-DEPOBJ_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \
- $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-DEPOBJ_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \
- $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-DEPOBJ_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \
- dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \
- $(INCDIR)/xtensa-config.h $(INCDIR)/safe-ctype.h subsegs.h \
- $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-DEPOBJ_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-DEPOBJ_hppa_som = $(srcdir)/config/obj-som.h subsegs.h \
- $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/som.h \
- $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
-DEPOBJ_i386_multi = $(DEPOBJ_i386_aout) $(DEPOBJ_i386_coff) \
- $(DEPOBJ_i386_elf)
-DEPOBJ_mips_multi = $(DEPOBJ_mips_coff) $(DEPOBJ_mips_ecoff) \
- $(DEPOBJ_mips_elf)
-DEPOBJ_cris_multi = $(DEPOBJ_cris_aout) $(DEPOBJ_cris_elf)
-DEP_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
-DEP_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h
-DEP_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h
-DEP_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-DEP_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h
-DEP_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-DEP_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h
-DEP_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h
-DEP_dlx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h
-DEP_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h
-DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \
- $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \
- $(INCDIR)/elf/reloc-macros.h
-DEP_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
- $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-DEP_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
- $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \
- $(INCDIR)/opcode/i386.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h
-DEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h
-DEP_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h
-DEP_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \
- $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h
-DEP_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h
-DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h
-DEP_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h
-DEP_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
-DEP_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h
-DEP_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \
- dwarf2dbg.h $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_or32_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h
-DEP_or32_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h
-DEP_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-DEP_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h
-DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h
-DEP_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h
-DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
- $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h
-DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-DEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h
-DEP_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \
- $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \
- $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h
-DEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-DEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \
- $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \
- $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h
-DEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-DEP_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \
- dwarf2dbg.h $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-DEP_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \
- $(INCDIR)/xtensa-config.h
-DEP_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-DEP_hppa_som = $(BFDDIR)/som.h
-DEP_i386_multi = $(DEP_i386_aout) $(DEP_i386_coff) \
- $(DEP_i386_elf)
-DEP_mips_multi = $(DEP_mips_coff) $(DEP_mips_ecoff) \
- $(DEP_mips_elf)
-DEP_cris_multi = $(DEP_cris_aout) $(DEP_cris_elf)
-BMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE.
-#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW.
-app.o: app.c
-as.o: as.c subsegs.h $(INCDIR)/obstack.h output-file.h \
- sb.h macro.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- ../bfd/bfdver.h
-atof-generic.o: atof-generic.c $(INCDIR)/safe-ctype.h
-cond.o: cond.c sb.h macro.h $(INCDIR)/obstack.h
-depend.o: depend.c
-dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/safe-ctype.h dwarf2dbg.h \
- $(INCDIR)/filenames.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/elf/dwarf2.h
-dw2gencfi.o: dw2gencfi.c dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- subsegs.h $(INCDIR)/obstack.h
-ecoff.o: ecoff.c ecoff.h
-ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h
-expr.o: expr.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h
-flonum-copy.o: flonum-copy.c
-flonum-konst.o: flonum-konst.c
-flonum-mult.o: flonum-mult.c
-frags.o: frags.c subsegs.h $(INCDIR)/obstack.h
-hash.o: hash.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h
-input-file.o: input-file.c input-file.h $(INCDIR)/safe-ctype.h
-input-scrub.o: input-scrub.c input-file.h sb.h
-listing.o: listing.c $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
- input-file.h subsegs.h ../bfd/bfdver.h
-literal.o: literal.c subsegs.h $(INCDIR)/obstack.h
-macro.o: macro.c $(INCDIR)/safe-ctype.h sb.h macro.h
-messages.o: messages.c
-output-file.o: output-file.c output-file.h
-read.o: read.c $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- sb.h macro.h ecoff.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h
-remap.o: remap.c
-sb.o: sb.c sb.h
-stabs.o: stabs.c $(INCDIR)/obstack.h subsegs.h ecoff.h \
- $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
-subsegs.o: subsegs.c subsegs.h $(INCDIR)/obstack.h
-symbols.o: symbols.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
- subsegs.h struc-symbol.h
-write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h \
- dwarf2dbg.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h
-itbl-ops.o: itbl-ops.c itbl-ops.h
-cgen.o: cgen.c cgen-desc.h subsegs.h $(INCDIR)/obstack.h \
- cgen.h dwarf2dbg.h struc-symbol.h
-e-crisaout.o: $(srcdir)/config/e-crisaout.c emul-target.h
-e-criself.o: $(srcdir)/config/e-criself.c emul-target.h
-e-i386aout.o: $(srcdir)/config/e-i386aout.c emul-target.h
-e-i386coff.o: $(srcdir)/config/e-i386coff.c emul-target.h
-e-i386elf.o: $(srcdir)/config/e-i386elf.c emul-target.h
-e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c emul-target.h
-e-mipself.o: $(srcdir)/config/e-mipself.c emul-target.h
-$(OBJS): $(DEP_@target_cpu_type@_@obj_format@)
-$(TARG_CPU_O): $(DEPTC_@target_cpu_type@_@obj_format@)
-$(OBJ_FORMAT_O): $(DEPOBJ_@target_cpu_type@_@obj_format@)
-#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE.
diff --git a/gas/Makefile.in b/gas/Makefile.in
deleted file mode 100644
index d827a57efc7..00000000000
--- a/gas/Makefile.in
+++ /dev/null
@@ -1,3060 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 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.
-
-@SET_MAKE@
-
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-noinst_PROGRAMS = as-new$(EXEEXT)
-EXTRA_PROGRAMS = itbl-test$(EXEEXT)
-DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \
- README ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/config.in $(srcdir)/../mkinstalldirs \
- $(srcdir)/gdbinit.in $(srcdir)/gdbinit.in \
- $(top_srcdir)/po/Make-in m68k-parse.c bfin-parse.c \
- itbl-parse.c itbl-lex.c $(srcdir)/../ylwrap \
- $(srcdir)/../ltmain.sh $(srcdir)/../config.guess \
- $(srcdir)/../config.sub
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \
- $(top_srcdir)/../bfd/warning.m4 \
- $(top_srcdir)/../config/depstand.m4 \
- $(top_srcdir)/../config/gettext-sister.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
- $(top_srcdir)/../config/nls.m4 \
- $(top_srcdir)/../config/override.m4 \
- $(top_srcdir)/../config/po.m4 \
- $(top_srcdir)/../config/proginstall.m4 \
- $(top_srcdir)/../config/progtest.m4 \
- $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
- $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = gdb.ini .gdbinit po/Makefile.in
-PROGRAMS = $(noinst_PROGRAMS)
-am__objects_1 = app.$(OBJEXT) as.$(OBJEXT) atof-generic.$(OBJEXT) \
- cond.$(OBJEXT) depend.$(OBJEXT) dwarf2dbg.$(OBJEXT) \
- dw2gencfi.$(OBJEXT) ecoff.$(OBJEXT) ehopt.$(OBJEXT) \
- expr.$(OBJEXT) flonum-copy.$(OBJEXT) flonum-konst.$(OBJEXT) \
- flonum-mult.$(OBJEXT) frags.$(OBJEXT) hash.$(OBJEXT) \
- input-file.$(OBJEXT) input-scrub.$(OBJEXT) listing.$(OBJEXT) \
- literal.$(OBJEXT) macro.$(OBJEXT) messages.$(OBJEXT) \
- output-file.$(OBJEXT) read.$(OBJEXT) remap.$(OBJEXT) \
- sb.$(OBJEXT) stabs.$(OBJEXT) subsegs.$(OBJEXT) \
- symbols.$(OBJEXT) write.$(OBJEXT)
-am_as_new_OBJECTS = $(am__objects_1)
-as_new_OBJECTS = $(am_as_new_OBJECTS)
-am__DEPENDENCIES_1 = tc-@target_cpu_type@.o
-am__DEPENDENCIES_2 = obj-@obj_format@.o
-am__DEPENDENCIES_3 = atof-@atof@.o
-am__DEPENDENCIES_4 =
-am__DEPENDENCIES_5 = ../bfd/libbfd.la ../libiberty/libiberty.a
-am_itbl_test_OBJECTS = itbl-parse.$(OBJEXT) itbl-lex.$(OBJEXT)
-itbl_test_OBJECTS = $(am_itbl_test_OBJECTS)
-itbl_test_DEPENDENCIES = itbl-tops.o itbl-test.o $(am__DEPENDENCIES_5)
-SCRIPTS = $(noinst_SCRIPTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
-LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
-YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
-LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \
- $(AM_YFLAGS)
-YLWRAP = $(top_srcdir)/../ylwrap
-SOURCES = $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) \
- $(itbl_test_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
-ETAGS = etags
-CTAGS = ctags
-DEJATOOL = $(PACKAGE)
-RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATADIRNAME = @DATADIRNAME@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GDBINIT = @GDBINIT@
-GENCAT = @GENCAT@
-GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@
-GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@
-GMSGFMT = @GMSGFMT@
-GREP = @GREP@
-INCINTL = @INCINTL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INSTOBJEXT = @INSTOBJEXT@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi`
-LEXLIB = @LEXLIB@
-LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-LIBINTL = @LIBINTL@
-LIBINTL_DEP = @LIBINTL_DEP@
-LIBM = @LIBM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-MSGMERGE = @MSGMERGE@
-NM = @NM@
-NO_WERROR = @NO_WERROR@
-OBJEXT = @OBJEXT@
-OPCODES_LIB = @OPCODES_LIB@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POSUB = @POSUB@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-WARN_CFLAGS = @WARN_CFLAGS@
-XGETTEXT = @XGETTEXT@
-YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi`
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-atof = @atof@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-cgen_cpu_prefix = @cgen_cpu_prefix@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-exec_prefix = @exec_prefix@
-extra_objects = @extra_objects@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-install_tooldir = @install_tooldir@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-obj_format = @obj_format@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_cpu_type = @target_cpu_type@
-target_os = @target_os@
-target_vendor = @target_vendor@
-te_file = @te_file@
-AUTOMAKE_OPTIONS = 1.8 cygnus dejagnu
-ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
-SUBDIRS = doc po
-# Automake should figure this out on its own. It doesn't, because
-# of the "cygnus" option. But distclean still wants it.
-DIST_SUBDIRS = $(SUBDIRS)
-tooldir = $(exec_prefix)/$(target_alias)
-
-# We have to set this, because autoconf 2.59 does not substitute YFLAGS.
-# Autoconf 2.61 does, so this can be removed when we upgrade.
-YFLAGS =
-AM_CFLAGS = $(WARN_CFLAGS)
-MKDEP = gcc -MM
-TARG_CPU = @target_cpu_type@
-TARG_CPU_C = $(srcdir)/config/tc-@target_cpu_type@.c
-TARG_CPU_O = tc-@target_cpu_type@.o
-TARG_CPU_H = $(srcdir)/config/tc-@target_cpu_type@.h
-OBJ_FORMAT_C = $(srcdir)/config/obj-@obj_format@.c
-OBJ_FORMAT_O = obj-@obj_format@.o
-OBJ_FORMAT_H = $(srcdir)/config/obj-@obj_format@.h
-TARG_ENV_H = $(srcdir)/config/te-@te_file@.h
-ATOF_TARG_C = $(srcdir)/config/atof-@atof@.c
-ATOF_TARG_O = atof-@atof@.o
-
-# use @target_cpu_type@ for refering to configured target name
-IT_HDRS = itbl-parse.h $(srcdir)/itbl-ops.h
-IT_SRCS = itbl-parse.c itbl-lex.c $(srcdir)/itbl-ops.c
-IT_DEPS = $(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@target_cpu_type@.h
-IT_OBJS = itbl-parse.o itbl-lex.o itbl-ops.o
-
-# CPU types. This is only used for dependency information.
-CPU_TYPES = \
- alpha \
- arc \
- arm \
- avr \
- bfin \
- cr16 \
- cris \
- crx \
- d10v \
- d30v \
- dlx \
- fr30 \
- frv \
- h8300 \
- hppa \
- i370 \
- i386 \
- i860 \
- i960 \
- ia64 \
- ip2k \
- m32c \
- m32r \
- m68hc11 \
- m68k \
- maxq \
- mcore \
- mep \
- mips \
- mmix \
- mn10200 \
- mn10300 \
- msp430 \
- mt \
- ns32k \
- openrisc \
- or32 \
- pdp11 \
- pj \
- ppc \
- s390 \
- score \
- sh \
- sh64 \
- sparc \
- spu \
- tic30 \
- tic4x \
- tic54x \
- v850 \
- vax \
- xc16x \
- xstormy16 \
- xtensa \
- z80 \
- z8k
-
-
-# Object format types. This is only used for dependency information.
-# We deliberately omit SOM, since it does not work as a cross assembler.
-OBJ_FORMATS = \
- aout \
- coff \
- ecoff \
- elf \
- evax
-
-
-# This is an sh case which sets valid according to whether the CPU
-# type in the shell variable c and the OS type in the shell variable o
-# are supported. This helps cuts down on the amount of dependency
-# information.
-CPU_OBJ_VALID = \
- valid= ; \
- case $$o in \
- aout) \
- case $$c in \
- arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tic30 | vax) \
- valid=yes ;; \
- esac ;; \
- coff) \
- case $$c in \
- arm | h8300 | i386 | i960 | m68k | maxq | mcore | mips | or32 \
- | ppc | sh | sparc | tic* | xscale | z80 | z8k) \
- valid=yes ;; \
- esac ;; \
- ecoff) \
- case $$c in \
- mips | alpha) valid=yes ;; \
- esac ;; \
- elf) valid=yes ; \
- case $$c in \
- maxq | ns32k | tic* | z80 | z8k) valid= ;; \
- esac ;; \
- evax) \
- case $$c in \
- alpha) valid=yes ;; \
- esac ;; \
- vms) \
- case $$c in \
- vax) valid=yes ;; \
- esac ;; \
- esac;
-
-
-# These are like CPU_TYPES and CPU_OBJ_VALID, for the obj=multi case.
-MULTI_CPU_TYPES = i386 mips cris
-MULTI_CPU_OBJ_VALID = \
- valid= ; \
- case $$o in \
- aout) \
- case $$c in \
- i386 | cris) valid=yes ;; \
- esac ;; \
- coff) \
- case $$c in \
- i386 | mips) valid=yes ;; \
- esac ;; \
- ecoff) \
- case $$c in \
- mips) valid=yes ;; \
- esac ;; \
- elf) valid=yes ;; \
- esac;
-
-
-# Regular source files.
-GAS_CFILES = \
- app.c \
- as.c \
- atof-generic.c \
- cond.c \
- depend.c \
- dwarf2dbg.c \
- dw2gencfi.c \
- ecoff.c \
- ehopt.c \
- expr.c \
- flonum-copy.c \
- flonum-konst.c \
- flonum-mult.c \
- frags.c \
- hash.c \
- input-file.c \
- input-scrub.c \
- listing.c \
- literal.c \
- macro.c \
- messages.c \
- output-file.c \
- read.c \
- remap.c \
- sb.c \
- stabs.c \
- subsegs.c \
- symbols.c \
- write.c
-
-CFILES = $(GAS_CFILES) itbl-ops.c cgen.c
-HFILES = \
- as.h \
- asintl.h \
- bignum.h \
- bit_fix.h \
- cgen.h \
- dwarf2dbg.h \
- dw2gencfi.h \
- ecoff.h \
- emul-target.h \
- emul.h \
- expr.h \
- flonum.h \
- frags.h \
- hash.h \
- input-file.h \
- itbl-lex.h \
- itbl-ops.h \
- listing.h \
- macro.h \
- obj.h \
- output-file.h \
- read.h \
- sb.h \
- struc-symbol.h \
- subsegs.h \
- symbols.h \
- tc.h \
- write.h
-
-
-# CPU files in config.
-TARGET_CPU_CFILES = \
- config/tc-alpha.c \
- config/tc-arc.c \
- config/tc-arm.c \
- config/tc-avr.c \
- config/tc-bfin.c \
- config/tc-cr16.c \
- config/tc-cris.c \
- config/tc-crx.c \
- config/tc-d10v.c \
- config/tc-d30v.c \
- config/tc-dlx.c \
- config/tc-fr30.c \
- config/tc-frv.c \
- config/tc-h8300.c \
- config/tc-hppa.c \
- config/tc-ia64.c \
- config/tc-i370.c \
- config/tc-i386.c \
- config/tc-i860.c \
- config/tc-i960.c \
- config/tc-ip2k.c \
- config/tc-iq2000.c \
- config/tc-m32c.c \
- config/tc-m32r.c \
- config/tc-m68hc11.c \
- config/tc-m68k.c \
- config/tc-maxq.c \
- config/tc-mcore.c \
- config/tc-mep.c \
- config/tc-mips.c \
- config/tc-mmix.c \
- config/tc-mn10200.c \
- config/tc-mn10300.c \
- config/tc-msp430.c \
- config/tc-mt.c \
- config/tc-ns32k.c \
- config/tc-openrisc.c \
- config/tc-or32.c \
- config/tc-pdp11.c \
- config/tc-pj.c \
- config/tc-ppc.c \
- config/tc-s390.c \
- config/tc-score.c \
- config/tc-sh.c \
- config/tc-sh64.c \
- config/tc-sparc.c \
- config/tc-spu.c \
- config/tc-tic30.c \
- config/tc-tic4x.c \
- config/tc-tic54x.c \
- config/tc-vax.c \
- config/tc-v850.c \
- config/tc-xstormy16.c \
- config/tc-xc16x.c \
- config/tc-xtensa.c \
- config/tc-z80.c \
- config/tc-z8k.c \
- config/xtensa-relax.c
-
-TARGET_CPU_HFILES = \
- config/tc-alpha.h \
- config/tc-arc.h \
- config/tc-arm.h \
- config/tc-avr.h \
- config/tc-bfin.h \
- config/tc-cr16.h \
- config/tc-cris.h \
- config/tc-crx.h \
- config/tc-d10v.h \
- config/tc-d30v.h \
- config/tc-dlx.h \
- config/tc-fr30.h \
- config/tc-frv.h \
- config/tc-h8300.h \
- config/tc-hppa.h \
- config/tc-ia64.h \
- config/tc-i370.h \
- config/tc-i386.h \
- config/tc-i860.h \
- config/tc-i960.h \
- config/tc-ip2k.h \
- config/tc-iq2000.h \
- config/tc-m32c.h \
- config/tc-m32r.h \
- config/tc-m68hc11.h \
- config/tc-m68k.h \
- config/tc-maxq.h \
- config/tc-mcore.h \
- config/tc-mep.h \
- config/tc-mips.h \
- config/tc-mmix.h \
- config/tc-mn10200.h \
- config/tc-mn10300.h \
- config/tc-msp430.h \
- config/tc-mt.h \
- config/tc-ns32k.h \
- config/tc-openrisc.h \
- config/tc-or32.h \
- config/tc-pdp11.h \
- config/tc-pj.h \
- config/tc-ppc.h \
- config/tc-s390.h \
- config/tc-score.h \
- config/tc-sh.h \
- config/tc-sh64.h \
- config/tc-sparc.h \
- config/tc-spu.h \
- config/tc-tic30.h \
- config/tc-tic4x.h \
- config/tc-tic54x.h \
- config/tc-vax.h \
- config/tc-v850.h \
- config/tc-xstormy16.h \
- config/tc-xc16x.h \
- config/tc-xtensa.h \
- config/tc-z80.h \
- config/tc-z8k.h \
- config/xtensa-relax.h
-
-
-# OBJ files in config
-OBJ_FORMAT_CFILES = \
- config/obj-aout.c \
- config/obj-coff.c \
- config/obj-ecoff.c \
- config/obj-elf.c \
- config/obj-evax.c \
- config/obj-fdpicelf.c \
- config/obj-som.c
-
-OBJ_FORMAT_HFILES = \
- config/obj-aout.h \
- config/obj-coff.h \
- config/obj-ecoff.h \
- config/obj-elf.h \
- config/obj-evax.h \
- config/obj-fdpicelf.h \
- config/obj-som.h
-
-
-# Emulation header files in config
-TARG_ENV_HFILES = \
- config/te-386bsd.h \
- config/te-aix5.h \
- config/te-armeabi.h \
- config/te-armlinuxeabi.h \
- config/te-dynix.h \
- config/te-epoc-pe.h \
- config/te-freebsd.h \
- config/te-generic.h \
- config/te-gnu.h \
- config/te-go32.h \
- config/te-hppa.h \
- config/te-hppa64.h \
- config/te-hppalinux64.h \
- config/te-i386aix.h \
- config/te-ia64aix.h \
- config/te-interix.h \
- config/te-lnews.h \
- config/te-lynx.h \
- config/te-mach.h \
- config/te-macos.h \
- config/te-nbsd.h \
- config/te-nbsd532.h \
- config/te-netware.h \
- config/te-pc532mach.h \
- config/te-pe.h \
- config/te-psos.h \
- config/te-riscix.h \
- config/te-sparcaout.h \
- config/te-sun3.h \
- config/te-svr4.h \
- config/te-symbian.h \
- config/te-tmips.h \
- config/te-vxworks.h \
- config/te-wince-pe.h
-
-
-# Multi files in config
-MULTI_CFILES = \
- config/e-crisaout.c \
- config/e-criself.c \
- config/e-i386aout.c \
- config/e-i386coff.c \
- config/e-i386elf.c \
- config/e-mipsecoff.c \
- config/e-mipself.c
-
-CONFIG_OBJS = \
- $(TARG_CPU_O) \
- $(OBJ_FORMAT_O) \
- $(ATOF_TARG_O) \
- $(extra_objects)
-
-GENERIC_OBJS = \
- app.o \
- as.o \
- atof-generic.o \
- cond.o \
- depend.o \
- dwarf2dbg.o \
- dw2gencfi.o \
- ehopt.o \
- expr.o \
- flonum-konst.o \
- flonum-copy.o \
- flonum-mult.o \
- frags.o \
- hash.o \
- input-file.o \
- input-scrub.o \
- literal.o \
- messages.o \
- output-file.o \
- read.o \
- remap.o \
- subsegs.o \
- symbols.o \
- write.o \
- listing.o \
- ecoff.o \
- stabs.o \
- sb.o \
- macro.o
-
-CONFIG_ATOF_CFILES = \
- config/atof-ieee.c \
- config/atof-vax.c
-
-OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS)
-POTFILES = $(MULTI_CFILES) $(CONFIG_ATOF_CFILES) $(TARG_ENV_HFILES) $(OBJ_FORMAT_HFILES) \
- $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \
- $(HFILES) $(CFILES)
-
-noinst_SCRIPTS = $(GDBINIT)
-EXTRA_SCRIPTS = .gdbinit
-EXTRA_DIST = m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c \
- bfin-parse.c bfin-parse.h bfin-lex.c
-
-DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h
-
-# Now figure out from those variables how to compile and link.
-BASEDIR = $(srcdir)/..
-BFDDIR = $(BASEDIR)/bfd
-INCDIR = $(BASEDIR)/include
-
-# This is the variable actually used when we compile.
-# Specify the directories to be searched for header files.
-# Both . and srcdir are used, in that order,
-# so that tm.h and config.h will be found in the compilation
-# subdirectory rather than in the source directory.
-INCLUDES = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config \
- -I$(INCDIR) -I$(srcdir)/.. -I$(BFDDIR) @INCINTL@ \
- -DLOCALEDIR="\"$(datadir)/locale\""
-
-
-# This should be parallel to INCLUDES, but should replace $(srcdir)
-# with $${srcdir}, and should work in a subdirectory. This is used
-# when building dependencies, because the dependency building is done
-# in a subdirectory.
-DEP_INCLUDES = -I.. -I$${srcdir} -I../../bfd \
- -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. \
- -I$${srcdir}/../bfd @INCINTL@ \
- -DLOCALEDIR="\"$(datadir)/locale\""
-
-DEP_FLAGS = -DOBJ_MAYBE_ELF \
- -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES)
-
-
-# How to link with both our special library facilities
-# and the system's installed libraries.
-GASLIBS = @OPCODES_LIB@ ../bfd/libbfd.la ../libiberty/libiberty.a
-
-# Files to be copied away after each stage in building.
-STAGESTUFF = *.o $(noinst_PROGRAMS)
-as_new_SOURCES = $(GAS_CFILES)
-as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
- $(extra_objects) $(GASLIBS) $(LIBINTL) $(LIBM)
-
-as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
- $(extra_objects) $(GASLIBS) $(LIBINTL_DEP)
-
-EXPECT = expect
-RUNTEST = runtest
-RUNTESTFLAGS =
-
-# The m68k operand parser.
-EXTRA_as_new_SOURCES = config/m68k-parse.y config/bfin-parse.y
-itbl_test_SOURCES = itbl-parse.y itbl-lex.l
-itbl_test_LDADD = itbl-tops.o itbl-test.o $(GASLIBS) @LEXLIB@
-
-# CGEN interface.
-CGEN_CPU_PREFIX = @cgen_cpu_prefix@
-
-# Remake the info files.
-MOSTLYCLEANFILES = $(STAGESTUFF) core \
- testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \
- testsuite/site.exp site.bak site.exp stage stage1 stage2
-
-CLEANFILES = dep.sed DEPTC DEPTCA DEPOBJ DEPOBJA DEP2 DEP2A DEP1 DEPA DEP DEPDIR
-against = stage2
-DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \
- $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES)
-
-CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in $(srcdir)/configure.tgt
-AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW.
-DEPTC_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \
- $(INCDIR)/opcode/alpha.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c
-
-DEPTC_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h subsegs.h \
- $(INCDIR)/obstack.h struc-symbol.h ecoff.h $(INCDIR)/coff/sym.h \
- $(INCDIR)/coff/ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/elf/alpha.h \
- $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c
-
-DEPTC_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h \
- subsegs.h $(INCDIR)/obstack.h struc-symbol.h ecoff.h \
- $(INCDIR)/opcode/alpha.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c
-
-DEPTC_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \
- struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/arc.h $(srcdir)/../opcodes/arc-ext.h \
- $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h
-
-DEPTC_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \
- dwarf2dbg.h
-
-DEPTC_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \
- dwarf2dbg.h
-
-DEPTC_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arm.h \
- $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h dwarf2dbg.h
-
-DEPTC_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/avr.h
-
-DEPTC_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \
- struc-symbol.h $(srcdir)/config/bfin-defs.h $(INCDIR)/obstack.h \
- $(INCDIR)/safe-ctype.h dwarf2dbg.h $(BFDDIR)/libbfd.h \
- $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h \
- $(INCDIR)/elf/reloc-macros.h $(srcdir)/config/bfin-aux.h \
- $(srcdir)/config/bfin-defs.h $(INCDIR)/opcode/bfin.h
-
-DEPTC_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/opcode/cr16.h \
- $(INCDIR)/elf/cr16.h $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/cris.h \
- dwarf2dbg.h
-
-DEPTC_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/cris.h dwarf2dbg.h
-
-DEPTC_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/opcode/crx.h \
- $(INCDIR)/elf/crx.h $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d10v.h \
- $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d30v.h
-
-DEPTC_dlx_elf = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-elf.h \
- $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \
- dwarf2dbg.h $(srcdir)/config/tc-dlx.h $(INCDIR)/opcode/dlx.h
-
-DEPTC_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/../opcodes/fr30-desc.h $(INCDIR)/opcode/cgen-bitset.h \
- $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \
- $(srcdir)/../opcodes/fr30-opc.h cgen.h
-
-DEPTC_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h subsegs.h \
- $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/frv-opc.h \
- cgen.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
- dwarf2dbg.h $(INCDIR)/opcode/h8300.h $(INCDIR)/safe-ctype.h
-
-DEPTC_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/h8300.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \
- $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h dwarf2dbg.h
-
-DEPTC_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h \
- $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
- $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \
- $(srcdir)/../opcodes/i386-init.h
-
-DEPTC_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
- $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \
- $(srcdir)/../opcodes/i386-init.h
-
-DEPTC_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \
- $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \
- $(srcdir)/../opcodes/i386-init.h
-
-DEPTC_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/i860.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/i960.h
-
-DEPTC_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h
-
-DEPTC_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \
- $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \
- dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/ia64.h \
- $(INCDIR)/elf/ia64.h
-
-DEPTC_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/ip2k-opc.h \
- cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/ip2k.h \
- $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h
-
-DEPTC_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/m32c-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/m32c-opc.h \
- $(srcdir)/../opcodes/cgen-types.h ../bfd/bfd_stdint.h \
- $(srcdir)/../opcodes/cgen-ops.h cgen.h $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/m32c.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h \
- $(INCDIR)/hashtab.h $(INCDIR)/safe-ctype.h
-
-DEPTC_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/../opcodes/m32r-desc.h $(INCDIR)/opcode/cgen-bitset.h \
- $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \
- $(srcdir)/../opcodes/m32r-opc.h cgen.h $(INCDIR)/elf/m32r.h \
- $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h $(INCDIR)/elf/m68hc11.h \
- $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \
- dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \
- $(srcdir)/config/m68k-parse.h
-
-DEPTC_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \
- dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \
- $(srcdir)/config/m68k-parse.h
-
-DEPTC_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \
- dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \
- $(srcdir)/config/m68k-parse.h $(INCDIR)/elf/m68k.h \
- $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(srcdir)/config/tc-maxq.h \
- $(INCDIR)/opcode/maxq.h
-
-DEPTC_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/../opcodes/mcore-opc.h $(INCDIR)/safe-ctype.h
-
-DEPTC_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \
- dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mep-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/mep-opc.h \
- cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/mep.h $(INCDIR)/elf/reloc-macros.h \
- $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h $(INCDIR)/xregex.h \
- $(INCDIR)/xregex2.h
-
-DEPTC_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h itbl-ops.h \
- dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h \
- $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
-
-DEPTC_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
- ecoff.h
-
-DEPTC_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h subsegs.h \
- $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/mips.h \
- itbl-ops.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(srcdir)/config/obj-elf.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
-
-DEPTC_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/mmix.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h \
- $(INCDIR)/safe-ctype.h dwarf2dbg.h $(INCDIR)/obstack.h
-
-DEPTC_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/mn10200.h
-
-DEPTC_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/mn10300.h dwarf2dbg.h
-
-DEPTC_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h \
- $(INCDIR)/safe-ctype.h dwarf2dbg.h
-
-DEPTC_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \
- dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mt-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/mt-opc.h \
- cgen.h $(INCDIR)/elf/common.h $(INCDIR)/elf/mt.h $(INCDIR)/elf/reloc-macros.h \
- $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h
-
-DEPTC_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ns32k.h \
- $(INCDIR)/obstack.h
-
-DEPTC_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \
- dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/openrisc-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/openrisc-opc.h \
- cgen.h
-
-DEPTC_or32_coff = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-coff.h \
- $(srcdir)/config/tc-or32.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_or32_elf = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-elf.h \
- $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \
- dwarf2dbg.h $(INCDIR)/opcode/or32.h $(INCDIR)/elf/or32.h \
- $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/opcode/pdp11.h
-
-DEPTC_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pdp11.h
-
-DEPTC_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/pj.h
-
-DEPTC_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \
- $(INCDIR)/obstack.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(INCDIR)/opcode/ppc.h
-
-DEPTC_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h \
- $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h
-
-DEPTC_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(INCDIR)/opcode/s390.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/opcode/score-inst.h $(INCDIR)/opcode/score-datadep.h \
- struc-symbol.h $(INCDIR)/elf/score.h $(INCDIR)/elf/reloc-macros.h \
- dwarf2dbg.h
-
-DEPTC_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \
- struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h
-
-DEPTC_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h subsegs.h \
- $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \
- struc-symbol.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
- dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h
-
-DEPTC_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
- $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h \
- $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \
- $(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/../opcodes/sh-opc.h $(INCDIR)/safe-ctype.h \
- struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h
-
-DEPTC_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \
- dw2gencfi.h $(INCDIR)/elf/dwarf2.h
-
-DEPTC_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \
- dw2gencfi.h $(INCDIR)/elf/dwarf2.h
-
-DEPTC_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \
- dwarf2dbg.h
-
-DEPTC_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \
- $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/spu-insns.h
-
-DEPTC_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/opcode/tic30.h
-
-DEPTC_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/opcode/tic30.h
-
-DEPTC_tic4x_coff = $(INCDIR)/safe-ctype.h $(srcdir)/config/obj-coff.h \
- $(srcdir)/config/tc-tic4x.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic4x.h subsegs.h \
- $(INCDIR)/obstack.h $(INCDIR)/obstack.h
-
-DEPTC_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- sb.h macro.h subsegs.h $(INCDIR)/obstack.h struc-symbol.h \
- $(INCDIR)/opcode/tic54x.h $(srcdir)/config/obj-coff.h
-
-DEPTC_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \
- $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h \
- dwarf2dbg.h
-
-DEPTC_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(srcdir)/config/vax-inst.h \
- $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/opcode/vax.h
-
-DEPTC_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \
- $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h subsegs.h \
- $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h $(INCDIR)/elf/vax.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/vax.h
-
-DEPTC_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/../opcodes/xc16x-desc.h $(INCDIR)/opcode/cgen-bitset.h \
- $(INCDIR)/opcode/cgen.h $(INCDIR)/opcode/cgen-bitset.h \
- $(srcdir)/../opcodes/xc16x-opc.h cgen.h dwarf2dbg.h \
- $(INCDIR)/elf/xc16x.h $(INCDIR)/elf/reloc-macros.h
-
-DEPTC_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \
- dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/xstormy16-desc.h \
- $(INCDIR)/opcode/cgen-bitset.h $(INCDIR)/opcode/cgen.h \
- $(INCDIR)/opcode/cgen-bitset.h $(srcdir)/../opcodes/xstormy16-opc.h \
- cgen.h
-
-DEPTC_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \
- $(INCDIR)/xtensa-config.h sb.h $(INCDIR)/safe-ctype.h \
- $(srcdir)/config/tc-xtensa.h subsegs.h $(INCDIR)/obstack.h \
- $(srcdir)/config/xtensa-relax.h dwarf2dbg.h $(srcdir)/config/xtensa-istack.h \
- struc-symbol.h $(INCDIR)/xtensa-config.h
-
-DEPTC_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPTC_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
- $(srcdir)/../opcodes/z8k-opc.h
-
-DEPTC_hppa_som = $(srcdir)/config/tc-hppa.h subsegs.h \
- $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h \
- $(BFDDIR)/som.h
-
-DEPTC_i386_multi = $(DEPTC_i386_aout) $(DEPTC_i386_coff) \
- $(DEPTC_i386_elf)
-
-DEPTC_mips_multi = $(DEPTC_mips_coff) $(DEPTC_mips_ecoff) \
- $(DEPTC_mips_elf)
-
-DEPTC_cris_multi = $(DEPTC_cris_aout) $(DEPTC_cris_elf)
-DEPOBJ_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- $(BFDDIR)/libecoff.h
-
-DEPOBJ_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \
- $(INCDIR)/aout/aout64.h
-
-DEPOBJ_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h
-DEPOBJ_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-
-DEPOBJ_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-
-DEPOBJ_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_dlx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \
- $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/i370.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
- $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-
-DEPOBJ_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
- $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \
- $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \
- $(INCDIR)/aout/aout64.h
-
-DEPOBJ_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \
- $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-
-DEPOBJ_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/mep.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- $(BFDDIR)/libecoff.h
-
-DEPOBJ_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \
- $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-
-DEPOBJ_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \
- dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_or32_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_or32_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-
-DEPOBJ_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/ppc.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
- $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-
-DEPOBJ_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \
- $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-
-DEPOBJ_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \
- $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
- subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
- $(INCDIR)/obstack.h
-
-DEPOBJ_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \
- dwarf2dbg.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \
- $(INCDIR)/xtensa-config.h $(INCDIR)/safe-ctype.h subsegs.h \
- $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
- dwarf2dbg.h $(INCDIR)/aout/aout64.h
-
-DEPOBJ_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
- subsegs.h $(INCDIR)/obstack.h
-
-DEPOBJ_hppa_som = $(srcdir)/config/obj-som.h subsegs.h \
- $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/som.h \
- $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
-
-DEPOBJ_i386_multi = $(DEPOBJ_i386_aout) $(DEPOBJ_i386_coff) \
- $(DEPOBJ_i386_elf)
-
-DEPOBJ_mips_multi = $(DEPOBJ_mips_coff) $(DEPOBJ_mips_ecoff) \
- $(DEPOBJ_mips_elf)
-
-DEPOBJ_cris_multi = $(DEPOBJ_cris_aout) $(DEPOBJ_cris_elf)
-DEP_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
-
-DEP_alpha_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h
-
-DEP_alpha_evax = $(srcdir)/config/obj-evax.h $(srcdir)/config/tc-alpha.h
-DEP_arc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_arm_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-arm.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-
-DEP_arm_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-arm.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_arm_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h
-
-DEP_avr_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_bfin_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-bfin.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_cr16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cr16.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_cris_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-cris.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-
-DEP_cris_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_crx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-crx.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_d10v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h
-
-DEP_d30v_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h
-
-DEP_dlx_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_fr30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_frv_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h
-
-DEP_h8300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-h8300.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_h8300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h
-
-DEP_hppa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h $(BFDDIR)/elf32-hppa.h \
- $(BFDDIR)/elf-bfd.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \
- $(INCDIR)/elf/reloc-macros.h
-
-DEP_i370_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
- $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-
-DEP_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
- $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \
- $(INCDIR)/opcode/i386.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h
-
-DEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h
-
-DEP_i960_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/i960.h $(BFDDIR)/libcoff.h
-
-DEP_ia64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \
- $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h
-
-DEP_ip2k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_m32c_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32c.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_m68hc11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h
-
-DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-
-DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_m68k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h
-
-DEP_maxq_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-maxq.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/maxq.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_mcore_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mcore.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_mcore_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h
-
-DEP_mep_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mep.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_mips_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mips.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_mips_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-mips.h \
- ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
-
-DEP_mips_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h
-
-DEP_mmix_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_mn10200_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_mt_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mt.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-
-DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \
- dwarf2dbg.h $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_or32_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-or32.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h
-
-DEP_or32_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h
-
-DEP_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-
-DEP_pdp11_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_pj_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_ppc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ppc.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h \
- $(INCDIR)/bfdlink.h
-
-DEP_ppc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h
-
-DEP_s390_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_score_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-score.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_sh_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h
-
-DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
- $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/elf32-sh64.h
-
-DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-
-DEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_sparc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h
-
-DEP_spu_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-spu.h $(INCDIR)/opcode/spu.h \
- $(INCDIR)/opcode/spu-insns.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \
- $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h
-
-DEP_tic30_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-tic30.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-
-DEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_v850_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h \
- $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \
- $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h
-
-DEP_vax_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-vax.h \
- $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
-
-DEP_vax_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_xc16x_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xc16x.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_xstormy16_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \
- dwarf2dbg.h $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h
-
-DEP_xtensa_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h $(INCDIR)/xtensa-isa.h \
- $(INCDIR)/xtensa-config.h
-
-DEP_z80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z80.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/z80.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \
- $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
-
-DEP_hppa_som = $(BFDDIR)/som.h
-DEP_i386_multi = $(DEP_i386_aout) $(DEP_i386_coff) \
- $(DEP_i386_elf)
-
-DEP_mips_multi = $(DEP_mips_coff) $(DEP_mips_ecoff) \
- $(DEP_mips_elf)
-
-DEP_cris_multi = $(DEP_cris_aout) $(DEP_cris_elf)
-BMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE.
-all: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .c .l .lo .o .obj .y
-am--refresh:
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
- cd $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-
-config.h: stamp-h1
- @if test ! -f $@; then \
- rm -f stamp-h1; \
- $(MAKE) stamp-h1; \
- else :; fi
-
-stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_srcdir) && $(AUTOHEADER)
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f config.h stamp-h1
-gdb.ini: $(top_builddir)/config.status $(srcdir)/gdbinit.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-.gdbinit: $(top_builddir)/config.status $(srcdir)/gdbinit.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-po/Makefile.in: $(top_builddir)/config.status $(top_srcdir)/po/Make-in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-
-clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-as-new$(EXEEXT): $(as_new_OBJECTS) $(as_new_DEPENDENCIES)
- @rm -f as-new$(EXEEXT)
- $(LINK) $(as_new_LDFLAGS) $(as_new_OBJECTS) $(as_new_LDADD) $(LIBS)
-itbl-test$(EXEEXT): $(itbl_test_OBJECTS) $(itbl_test_DEPENDENCIES)
- @rm -f itbl-test$(EXEEXT)
- $(LINK) $(itbl_test_LDFLAGS) $(itbl_test_OBJECTS) $(itbl_test_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c $<
-
-.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- $(LTCOMPILE) -c -o $@ $<
-
-.l.c:
- $(LEXCOMPILE) $<
- sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@
- rm -f $(LEX_OUTPUT_ROOT).c
-
-.y.c:
- $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-site.exp: Makefile
- @echo 'Making a new site.exp file...'
- @echo '## these variables are automatically generated by make ##' >site.tmp
- @echo '# Do not edit here. If you wish to override these values' >>site.tmp
- @echo '# edit the last section' >>site.tmp
- @echo 'set srcdir $(srcdir)' >>site.tmp
- @echo "set objdir `pwd`" >>site.tmp
- @echo 'set build_alias "$(build_alias)"' >>site.tmp
- @echo 'set build_triplet $(build_triplet)' >>site.tmp
- @echo 'set host_alias "$(host_alias)"' >>site.tmp
- @echo 'set host_triplet $(host_triplet)' >>site.tmp
- @echo 'set target_alias "$(target_alias)"' >>site.tmp
- @echo 'set target_triplet $(target_triplet)' >>site.tmp
- @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
- @test ! -f site.exp || \
- sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
- @-rm -f site.bak
- @test ! -f site.exp || mv site.exp site.bak
- @mv site.tmp site.exp
-
-distclean-DEJAGNU:
- -rm -f site.exp site.bak
- -l='$(DEJATOOL)'; for tool in $$l; do \
- rm -f $$tool.sum $$tool.log; \
- done
-check-am:
- $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
-check: check-recursive
-all-am: Makefile $(PROGRAMS) $(SCRIPTS) config.h
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -rm -f bfin-parse.c
- -rm -f itbl-lex.c
- -rm -f itbl-parse.c
- -rm -f m68k-parse.c
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
- mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-DEJAGNU distclean-compile \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-exec-am: install-exec-local
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
- check-DEJAGNU check-am clean clean-generic clean-libtool \
- clean-noinstPROGRAMS clean-recursive ctags ctags-recursive \
- distclean distclean-DEJAGNU distclean-compile \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-recursive distclean-tags dvi dvi-am html html-am \
- info info-am install install-am install-data install-data-am \
- install-exec install-exec-am install-exec-local install-info \
- install-info-am install-man install-strip installcheck \
- installcheck-am installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic maintainer-clean-recursive \
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
- tags tags-recursive uninstall uninstall-am uninstall-info-am
-
-po/POTFILES.in: @MAINT@ Makefile
- for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
- && mv tmp $(srcdir)/po/POTFILES.in
-
-diststuff: $(EXTRA_DIST) info
-all: info
-
-# Stuff that every object file depends upon. If anything is removed
-# from this list, remove it from dep-in.sed as well.
-$(OBJS): ../bfd/bfd.h $(INCDIR)/symcat.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/fopen-bin.h $(INCDIR)/fopen-vms.h \
- $(OBJ_FORMAT_H) $(TARG_CPU_H) $(TARG_ENV_H) \
- as.h asintl.h bignum.h bit_fix.h config.h emul.h expr.h flonum.h \
- frags.h hash.h listing.h obj.h read.h symbols.h tc.h write.h
-
-check-DEJAGNU: site.exp
- if [ -d testsuite ]; then \
- true; \
- else \
- mkdir testsuite; \
- fi
- rm -f testsuite/site.exp
- cp site.exp testsuite/site.exp
- rootme=`pwd`; export rootme; \
- srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
- EXPECT=${EXPECT} ; export EXPECT ; \
- runtest=$(RUNTEST); \
- cd testsuite; \
- if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
- $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
- $(RUNTESTFLAGS); \
- else echo "WARNING: could not find \`runtest'" 1>&2; :;\
- fi
-
-# The implicit .c.o rule doesn't work for these, perhaps because of
-# the variables, or perhaps because the sources are not on vpath.
-$(TARG_CPU_O): $(TARG_CPU_C)
- $(COMPILE) -c $(TARG_CPU_C)
-$(ATOF_TARG_O): $(ATOF_TARG_C)
- $(COMPILE) -c $(ATOF_TARG_C)
-
-# ecoff.c only has full dependencies when ECOFF_DEBUGGING is defined,
-# so the automatic dependency stuff doesn't work.
-ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \
- $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/symconst.h \
- $(INCDIR)/aout/stab_gnu.h
-
-# We need all these explicit rules for the multi stuff. Because of
-# these rules, we don't need one for OBJ_FORMAT_O.
-
-obj-aout.o : $(srcdir)/config/obj-aout.c $(DEP_@target_cpu_type@_aout)
- $(COMPILE) -c $(srcdir)/config/obj-aout.c
-obj-coff.o: $(srcdir)/config/obj-coff.c $(DEP_@target_cpu_type@_coff)
- $(COMPILE) -c $(srcdir)/config/obj-coff.c
-obj-ecoff.o : $(srcdir)/config/obj-ecoff.c $(DEP_@target_cpu_type@_ecoff)
- $(COMPILE) -c $(srcdir)/config/obj-ecoff.c
-obj-elf.o : $(srcdir)/config/obj-elf.c $(DEP_@target_cpu_type@_elf)
- $(COMPILE) -c $(srcdir)/config/obj-elf.c
-obj-evax.o : $(srcdir)/config/obj-evax.c
- $(COMPILE) -c $(srcdir)/config/obj-evax.c
-obj-fdpicelf.o : $(srcdir)/config/obj-fdpicelf.c
- $(COMPILE) -c $(srcdir)/config/obj-fdpicelf.c
-obj-multi.o : $(srcdir)/config/obj-multi.c
- $(COMPILE) -c $(srcdir)/config/obj-multi.c
-obj-som.o : $(srcdir)/config/obj-som.c
- $(COMPILE) -c $(srcdir)/config/obj-som.c
-
-e-mipself.o : $(srcdir)/config/e-mipself.c
- $(COMPILE) -c $(srcdir)/config/e-mipself.c
-e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c
- $(COMPILE) -c $(srcdir)/config/e-mipsecoff.c
-e-i386aout.o: $(srcdir)/config/e-i386aout.c
- $(COMPILE) -c $(srcdir)/config/e-i386aout.c
-e-i386coff.o: $(srcdir)/config/e-i386coff.c
- $(COMPILE) -c $(srcdir)/config/e-i386coff.c
-e-i386elf.o: $(srcdir)/config/e-i386elf.c
- $(COMPILE) -c $(srcdir)/config/e-i386elf.c
-e-crisaout.o: $(srcdir)/config/e-crisaout.c
- $(COMPILE) -c $(srcdir)/config/e-crisaout.c
-e-criself.o: $(srcdir)/config/e-criself.c
- $(COMPILE) -c $(srcdir)/config/e-criself.c
-
-xtensa-relax.o: $(srcdir)/config/xtensa-relax.c
- $(COMPILE) -c $(srcdir)/config/xtensa-relax.c
-
-# If m68k-parse.y is in a different directory, then ylwrap will use an
-# absolute path when it invokes yacc, which will cause yacc to put the
-# absolute path into the generated file. That's a pain when it comes
-# to generating snapshots, because it introduces spurious diffs.
-# Since when we make the snapshots $(srcdir) = ".", we check for that
-# case and handle it differently. This means that anybody who
-# configures with $(srcdir) = "." will have to set their path in the
-# debugger if they want to debug m68k-parse.y. This is bad, but on
-# the other hand it's good that people who use the prebuilt
-# m68k-parse.c don't get a spurious absolute path.
-m68k-parse.c: $(srcdir)/config/m68k-parse.y
- f=$(srcdir)/config/m68k-parse.y; \
- if [ $$f = "./config/m68k-parse.y" ]; then \
- ln -s config/m68k-parse.y . > /dev/null 2>/dev/null || \
- ln config/m68k-parse.y . > /dev/null 2>/dev/null || \
- cp config/m68k-parse.y . >/dev/null 2>/dev/null; \
- f=m68k-parse.y; \
- else true; fi; \
- $(SHELL) $(YLWRAP) $$f y.tab.c m68k-parse.c -- $(YACCCOMPILE); \
- if [ $$f = "m68k-parse.y" ]; then \
- rm -f m68k-parse.y; \
- else true; fi
-# Disable -Werror, if it has been enabled, since old versions of bison/
-# yacc will produce working code which contain compile time warnings.
-m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h
- $(COMPILE) -c $< $(NO_WERROR)
-
-# Don't let the .y.h rule clobber m68k-parse.h.
-m68k-parse.h: ; @true
-$(srcdir)/config/m68k-parse.h: ; @true
-
-bfin-parse.c: $(srcdir)/config/bfin-parse.y
- $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-parse.y y.tab.c bfin-parse.c y.tab.h bfin-parse.h -- $(YACCCOMPILE) -d ;
-bfin-parse.h: bfin-parse.c
-bfin-parse.o: bfin-parse.c bfin-parse.h $(srcdir)/config/bfin-defs.h \
- $(INCDIR)/elf/common.h $(INCDIR)/elf/bfin.h $(BFDDIR)/libbfd.h
-
-bfin-defs.h: ; @true
-$(srcdir)/config/bfin-defs.h: ; @true
-
-bfin-lex.c: $(srcdir)/config/bfin-lex.l
- $(SHELL) $(YLWRAP) $(srcdir)/config/bfin-lex.l lex.yy.c bfin-lex.c -- $(LEXCOMPILE)
-bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
- $(COMPILE) -c $< $(NO_WERROR)
-
-# The instruction table specification lexical analyzer and parser.
-
-itbl-lex.c: $(srcdir)/itbl-lex.l
-
-# Disable -Werror, if it has been enabled, since old versions of bison/
-# yacc will produce working code which contain compile time warnings.
-itbl-lex.o: itbl-lex.c itbl-parse.h $(srcdir)/itbl-lex.h
- $(COMPILE) -c $< $(NO_WERROR)
-
-# Disable -Werror, if it has been enabled, since old versions of bison/
-# yacc will produce working code which contain compile time warnings.
-itbl-parse.o: itbl-parse.c itbl-parse.h $(srcdir)/itbl-ops.h $(srcdir)/itbl-lex.h
- $(COMPILE) -c $< $(NO_WERROR)
-
-itbl-ops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h
-
-itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y
- $(SHELL) $(YLWRAP) $(srcdir)/itbl-parse.y y.tab.c itbl-parse.c y.tab.h itbl-parse.h -- $(YACCCOMPILE) -d
-
-itbl-tops.o: $(srcdir)/itbl-ops.c $(srcdir)/itbl-ops.h itbl-parse.h
- $(COMPILE) -o itbl-tops.o -DSTAND_ALONE -c $(srcdir)/itbl-ops.c
-
-itbl-test.o: $(srcdir)/testsuite/gas/all/itbl-test.c $(srcdir)/itbl-ops.h
- $(COMPILE) -c -DSTAND_ALONE $(srcdir)/testsuite/gas/all/itbl-test.c
-
-cgen.o: cgen.c cgen.h cgen-desc.h subsegs.h \
- $(INCDIR)/obstack.h $(INCDIR)/opcode/cgen.h \
- $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-desc.h \
- $(srcdir)/../opcodes/$(CGEN_CPU_PREFIX)-opc.h
-
-.PHONY: install-html install-html-am install-html-recursive
-
-install-html: install-html-recursive
-
-install-html-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-.PHONY: install-exec-local install-data-local
-.PHONY: install-exec-bindir install-exec-tooldir
-
-install-exec-local: install-exec-bindir @install_tooldir@
-
-install-exec-bindir: $(noinst_PROGRAMS)
- $(mkinstalldirs) $(DESTDIR)$(bindir)
- @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//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
- else :; fi; \
- done
-
-install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS)
- $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin
- n=`echo as | sed '$(transform)'`; \
- if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
- rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
- ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
- || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
- else \
- true ; \
- fi
-
-# These exist for maintenance purposes.
-
-.PHONY: bootstrap bootstrap2 bootstrap3 stage1 stage2 stage3 comparison
-
-bootstrap: as-new
- $(MAKE) stage1
- rm -f stage && ln -s stage1 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
- $(MAKE) stage2
- rm -f stage && ln -s stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
- $(MAKE) comparison against=stage2
-
-bootstrap2:
- rm -f stage && ln -s stage1 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
- $(MAKE) stage2
- rm -f stage && ln -s stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
- $(MAKE) comparison against=stage2
-
-bootstrap3:
- rm -f stage && ln -s stage2 stage
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(noinst_PROGRAMS)
- $(MAKE) comparison against=stage2
-
-# Copy the object files from a particular stage into a subdirectory.
-stage1:
- -mkdir stage1
- -mv $(STAGESTUFF) stage1
- if [ -f stage1/as-new$(EXEEXT) -a ! -f stage1/as$(EXEEXT) ] ; then (cd stage1 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
-
-stage2:
- -mkdir stage2
- -mv $(STAGESTUFF) stage2
- if [ -f stage2/as-new$(EXEEXT) -a ! -f stage2/as$(EXEEXT) ] ; then (cd stage2 ; ln -s as-new$(EXEEXT) as$(EXEEXT)) ; fi
-
-stage3:
- -mkdir stage3
- -mv $(STAGESTUFF) stage3
- if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
-
-# This rule is derived from corresponding code in the Makefile.in for gcc.
-# The "tail +16c" is to bypass headers which may include timestamps or
-# temporary assembly file names.
-comparison:
- x=0 ; \
- for file in *.o ; do \
- tail +16c ./$$file > tmp-foo1; \
- if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
- if cmp tmp-foo1 tmp-foo2 ; then \
- true ; \
- else \
- echo $$file differs ; \
- x=1 ; \
- fi ; \
- else true; fi ; \
- done ; \
- exit $$x
- -rm -f tmp-foo*
-
-.PHONY: de-stage1 de-stage2 de-stage3
-
-de-stage1:
- - (cd stage1 ; rm -f as$(EXEEXT) ; mv -f * ..)
- - rmdir stage1
-
-de-stage2:
- - (cd stage2 ; rm -f as$(EXEEXT) ; mv -f * ..)
- - rmdir stage2
-
-de-stage3:
- - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..)
- - rmdir stage3
-
-# Automatic dependency computation. This is a real pain, because the
-# dependencies change based on target_cpu_type and obj_format.
-# Just to make things even more complicated, automake separates the
-# dependency variable assignments from the dependency rules, and tacks
-# on a .NOEXPORT at the end of Makefile.in.
-
-DEP: dep.sed $(DEP_FILE_DEPS) DEPTC DEPOBJ DEP2
- rm -f DEP1 # delete because we use $? in DEP1 rule
- srcdir=`cd $(srcdir); pwd`; \
- $(MAKE) MKDEP="$(MKDEP)" srcdir="$${srcdir}" VPATH="$${srcdir}" DEP1
- rm -rf DEPDIR
- echo 'AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW.' > DEPA
- sed -f dep.sed < DEPTC >> DEPA
- sed -f dep.sed < DEPOBJ >> DEPA
- sed -f dep.sed < DEP2 >> DEPA
- echo 'BMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE.' >> DEPA
- echo '#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW.' >> DEPA
- sed -f dep.sed < DEP1 >> DEPA
- echo '$$(OBJS): $$(DEP_@target''_cpu_type@_@obj''_format@)' >> DEPA
- echo '$$(TARG_CPU_O): $$(DEPTC_@target''_cpu_type@_@obj''_format@)' >> DEPA
- echo '$$(OBJ_FORMAT_O): $$(DEPOBJ_@target''_cpu_type@_@obj''_format@)' >> DEPA
- echo '#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE.' >> DEPA
- if grep ' /' DEPA > /dev/null 2> /dev/null; then \
- echo 'make DEP failed!'; exit 1; \
- else \
- mv -f DEPA $@; \
- fi
-
-DEP1: $(CFILES) $(MULTI_CFILES)
- if [ -d DEPDIR ]; then true; else mkdir DEPDIR; fi
- srcdir=`cd $(srcdir); pwd`; \
- cd DEPDIR; \
- echo '' > targ-cpu.h; \
- echo '' > obj-format.h; \
- echo '' > targ-env.h; \
- echo '' > itbl-cpu.h; \
- echo '' > itbl-parse.h; \
- $(MKDEP) $(DEP_FLAGS) $? > DEP
- mv -f DEPDIR/DEP $@
-
-# Work out the special dependencies for the tc-*.c files.
-DEPTC: $(TARGET_CPU_CFILES)
- rm -f DEPTCA
- if [ -d DEPDIR ]; then true; else mkdir DEPDIR; fi
- srcdir=`cd $(srcdir); pwd`; \
- cd DEPDIR; \
- for c in $(CPU_TYPES); do \
- for o in $(OBJ_FORMATS); do \
- $(CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
- echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
- echo '#include "te-generic.h"' > targ-env.h; \
- echo '' > itbl-cpu.h; \
- echo '' > itbl-parse.h; \
- if [ -f $${srcdir}/opcodes/$${c}-desc.h ]; then \
- echo '#include "opcodes/'"$${c}"'-desc.h"' > cgen-desc.h; \
- else \
- echo '' > cgen-desc.h; \
- fi ;\
- rm -f dummy.c; \
- cp $${srcdir}/config/tc-$${c}.c dummy.c; \
- $(MKDEP) $(DEP_FLAGS) dummy.c | \
- sed -e "s/dummy.o: dummy.c/DEPTC_$${c}_$${o} =/" >> ../DEPTCA; \
- rm -f dummy.c; \
- else true; fi; \
- done; \
- done
- echo 'DEPTC_hppa_som = $$(srcdir)/config/tc-hppa.h subsegs.h \' >> DEPTCA
- echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> DEPTCA
- echo ' $$(INCDIR)/opcode/hppa.h $$(BFDDIR)/som.h' >> DEPTCA
- for c in $(MULTI_CPU_TYPES); do \
- echo "DEPTC_$${c}"'_multi = \' >> DEPTCA; \
- for o in $(OBJ_FORMATS); do \
- $(MULTI_CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '$$(DEPTC_'"$${c}_$${o}"') \' >> DEPTCA; \
- else true; fi; \
- done; \
- echo '' >> DEPTCA; \
- done
- mv -f DEPTCA DEPTC
-
-# Work out the special dependencies for the obj-*.c files.
-DEPOBJ: $(OBJ_FORMAT_CFILES)
- rm -f DEPOBJA
- if [ -d DEPDIR ]; then true; else mkdir DEPDIR; fi
- srcdir=`cd $(srcdir); pwd`; \
- cd DEPDIR; \
- for c in $(CPU_TYPES); do \
- for o in $(OBJ_FORMATS); do \
- $(CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
- echo '#include "obj-'"$${o}"'.h"' > obj-format.h; \
- echo '#include "te-generic.h"' > targ-env.h; \
- echo '' > itbl-cpu.h; \
- echo '' > itbl-parse.h; \
- rm -f dummy.c; \
- cp $${srcdir}/config/obj-$${o}.c dummy.c; \
- $(MKDEP) $(DEP_FLAGS) dummy.c | \
- sed -e "s/dummy.o: dummy.c/DEPOBJ_$${c}_$${o} =/" >> ../DEPOBJA; \
- rm -f dummy.c; \
- else true; fi; \
- done; \
- done
- echo 'DEPOBJ_hppa_som = $$(srcdir)/config/obj-som.h subsegs.h \' >> DEPOBJA
- echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> DEPOBJA
- echo ' $$(BFDDIR)/som.h $$(INCDIR)/aout/stab_gnu.h \' >> DEPOBJA
- echo ' $$(INCDIR)/aout/stab.def' >> DEPOBJA
- for c in $(MULTI_CPU_TYPES); do \
- echo "DEPOBJ_$${c}"'_multi = \' >> DEPOBJA; \
- for o in $(OBJ_FORMATS); do \
- $(MULTI_CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '$$(DEPOBJ_'"$${c}_$${o}"') \' >> DEPOBJA; \
- else true; fi; \
- done; \
- echo '' >> DEPOBJA; \
- done
- mv -f DEPOBJA DEPOBJ
-
-# Work out the dependencies for each CPU/OBJ combination.
-# Note that SOM is a special case, because it only works native.
-DEP2: $(TARGET_CPU_HFILES) $(OBJ_FORMAT_HFILES)
- rm -f DEP2A
- if [ -d DEPDIR ]; then true; else mkdir DEPDIR; fi
- srcdir=`cd $(srcdir); pwd`; \
- cd DEPDIR; \
- for c in $(CPU_TYPES); do \
- for o in $(OBJ_FORMATS); do \
- $(CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '#include "tc-'"$${c}"'.h"' > targ-cpu.h; \
- echo '#include "obj-'"$${o}"'.h"' > dummy.c; \
- $(MKDEP) $(DEP_FLAGS) dummy.c | \
- sed -e "s/dummy.o: dummy.c/DEP_$${c}_$${o} =/" >> ../DEP2A; \
- else true; fi; \
- done; \
- done
- echo 'DEP_hppa_som = $$(BFDDIR)/som.h' >> DEP2A
- for c in $(MULTI_CPU_TYPES); do \
- echo "DEP_$${c}"'_multi = \' >> DEP2A; \
- for o in $(OBJ_FORMATS); do \
- $(MULTI_CPU_OBJ_VALID) \
- if [ x$${valid} = xyes ]; then \
- echo '$$(DEP_'"$${c}_$${o}"') \' >> DEP2A; \
- else true; fi; \
- done; \
- echo '' >> DEP2A; \
- done
- mv -f DEP2A DEP2
-
-dep.sed: dep-in.sed config.status
- srcdir=`cd $(srcdir); pwd`; \
- sed <$(srcdir)/dep-in.sed >dep.sed \
- -e "s!@INCDIR@!$${srcdir}/../include!" \
- -e "s!@BFDDIR@!$${srcdir}/../bfd!" \
- -e "s!@SRCDIR@!$${srcdir}!" \
- -e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/gas,,`'!'
-
-dep: DEP
- sed -e '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./d' \
- < Makefile > tmp-Makefile
- cat DEP >> tmp-Makefile
- $(SHELL) $(srcdir)/../move-if-change tmp-Makefile Makefile
-
-dep-in: DEP
- sed -e '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./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 '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./d' \
- < $(srcdir)/Makefile.am > tmp-Makefile.am
- cat DEP >> tmp-Makefile.am
- $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
-
-# HEED THE MKDEP WARNINGS.
-# ANYTHING CHANGED OR ADDED BETWEEN THE WARNING LINES MAY GO AWAY.
-.PHONY: dep dep-in dep-am
-#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW.
-app.o: app.c
-as.o: as.c subsegs.h $(INCDIR)/obstack.h output-file.h \
- sb.h macro.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- ../bfd/bfdver.h
-atof-generic.o: atof-generic.c $(INCDIR)/safe-ctype.h
-cond.o: cond.c sb.h macro.h $(INCDIR)/obstack.h
-depend.o: depend.c
-dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/safe-ctype.h dwarf2dbg.h \
- $(INCDIR)/filenames.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/elf/dwarf2.h
-dw2gencfi.o: dw2gencfi.c dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
- subsegs.h $(INCDIR)/obstack.h
-ecoff.o: ecoff.c ecoff.h
-ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h
-expr.o: expr.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h
-flonum-copy.o: flonum-copy.c
-flonum-konst.o: flonum-konst.c
-flonum-mult.o: flonum-mult.c
-frags.o: frags.c subsegs.h $(INCDIR)/obstack.h
-hash.o: hash.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h
-input-file.o: input-file.c input-file.h $(INCDIR)/safe-ctype.h
-input-scrub.o: input-scrub.c input-file.h sb.h
-listing.o: listing.c $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
- input-file.h subsegs.h ../bfd/bfdver.h
-literal.o: literal.c subsegs.h $(INCDIR)/obstack.h
-macro.o: macro.c $(INCDIR)/safe-ctype.h sb.h macro.h
-messages.o: messages.c
-output-file.o: output-file.c output-file.h
-read.o: read.c $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- sb.h macro.h ecoff.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h
-remap.o: remap.c
-sb.o: sb.c sb.h
-stabs.o: stabs.c $(INCDIR)/obstack.h subsegs.h ecoff.h \
- $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
-subsegs.o: subsegs.c subsegs.h $(INCDIR)/obstack.h
-symbols.o: symbols.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
- subsegs.h struc-symbol.h
-write.o: write.c subsegs.h $(INCDIR)/obstack.h output-file.h \
- dwarf2dbg.h $(BFDDIR)/libbfd.h $(INCDIR)/hashtab.h
-itbl-ops.o: itbl-ops.c itbl-ops.h
-cgen.o: cgen.c cgen-desc.h subsegs.h $(INCDIR)/obstack.h \
- cgen.h dwarf2dbg.h struc-symbol.h
-e-crisaout.o: $(srcdir)/config/e-crisaout.c emul-target.h
-e-criself.o: $(srcdir)/config/e-criself.c emul-target.h
-e-i386aout.o: $(srcdir)/config/e-i386aout.c emul-target.h
-e-i386coff.o: $(srcdir)/config/e-i386coff.c emul-target.h
-e-i386elf.o: $(srcdir)/config/e-i386elf.c emul-target.h
-e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c emul-target.h
-e-mipself.o: $(srcdir)/config/e-mipself.c emul-target.h
-$(OBJS): $(DEP_@target_cpu_type@_@obj_format@)
-$(TARG_CPU_O): $(DEPTC_@target_cpu_type@_@obj_format@)
-$(OBJ_FORMAT_O): $(DEPOBJ_@target_cpu_type@_@obj_format@)
-#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE.
-# 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:
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
deleted file mode 100644
index ce3ce9bafcb..00000000000
--- a/gas/config/tc-i386.c
+++ /dev/null
@@ -1,10030 +0,0 @@
-/* tc-i386.c -- Assemble code for the Intel 80386
- Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
-
- This file is part of GAS, the GNU Assembler.
-
- GAS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GAS 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 GAS; see the file COPYING. If not, write to the Free
- Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-/* Intel 80386 machine specific gas.
- Written by Eliot Dresselhaus (eliot@mgm.mit.edu).
- x86_64 support by Jan Hubicka (jh@suse.cz)
- VIA PadLock support by Michal Ludvig (mludvig@suse.cz)
- Bugs & suggestions are completely welcome. This is free software.
- Please help us make it better. */
-
-#include "as.h"
-#include "safe-ctype.h"
-#include "subsegs.h"
-#include "dwarf2dbg.h"
-#include "dw2gencfi.h"
-#include "elf/x86-64.h"
-#include "opcodes/i386-init.h"
-
-#ifndef REGISTER_WARNINGS
-#define REGISTER_WARNINGS 1
-#endif
-
-#ifndef INFER_ADDR_PREFIX
-#define INFER_ADDR_PREFIX 1
-#endif
-
-#ifndef DEFAULT_ARCH
-#define DEFAULT_ARCH "i386"
-#endif
-
-#ifndef INLINE
-#if __GNUC__ >= 2
-#define INLINE __inline__
-#else
-#define INLINE
-#endif
-#endif
-
-/* Prefixes will be emitted in the order defined below.
- WAIT_PREFIX must be the first prefix since FWAIT is really is an
- instruction, and so must come before any prefixes.
- The preferred prefix order is SEG_PREFIX, ADDR_PREFIX, DATA_PREFIX,
- LOCKREP_PREFIX. */
-#define WAIT_PREFIX 0
-#define SEG_PREFIX 1
-#define ADDR_PREFIX 2
-#define DATA_PREFIX 3
-#define LOCKREP_PREFIX 4
-#define REX_PREFIX 5 /* must come last. */
-#define MAX_PREFIXES 6 /* max prefixes per opcode */
-
-/* we define the syntax here (modulo base,index,scale syntax) */
-#define REGISTER_PREFIX '%'
-#define IMMEDIATE_PREFIX '$'
-#define ABSOLUTE_PREFIX '*'
-
-/* these are the instruction mnemonic suffixes in AT&T syntax or
- memory operand size in Intel syntax. */
-#define WORD_MNEM_SUFFIX 'w'
-#define BYTE_MNEM_SUFFIX 'b'
-#define SHORT_MNEM_SUFFIX 's'
-#define LONG_MNEM_SUFFIX 'l'
-#define QWORD_MNEM_SUFFIX 'q'
-#define XMMWORD_MNEM_SUFFIX 'x'
-#define YMMWORD_MNEM_SUFFIX 'y'
-/* Intel Syntax. Use a non-ascii letter since since it never appears
- in instructions. */
-#define LONG_DOUBLE_MNEM_SUFFIX '\1'
-
-#define END_OF_INSN '\0'
-
-/*
- 'templates' is for grouping together 'template' structures for opcodes
- of the same name. This is only used for storing the insns in the grand
- ole hash table of insns.
- The templates themselves start at START and range up to (but not including)
- END.
- */
-typedef struct
-{
- const template *start;
- const template *end;
-}
-templates;
-
-/* 386 operand encoding bytes: see 386 book for details of this. */
-typedef struct
-{
- unsigned int regmem; /* codes register or memory operand */
- unsigned int reg; /* codes register operand (or extended opcode) */
- unsigned int mode; /* how to interpret regmem & reg */
-}
-modrm_byte;
-
-/* x86-64 extension prefix. */
-typedef int rex_byte;
-
-/* The SSE5 instructions have a two bit instruction modifier (OC) that
- is stored in two separate bytes in the instruction. Pick apart OC
- into the 2 separate bits for instruction. */
-#define DREX_OC0(x) (((x) & 1) != 0)
-#define DREX_OC1(x) (((x) & 2) != 0)
-
-#define DREX_OC0_MASK (1 << 3) /* set OC0 in byte 4 */
-#define DREX_OC1_MASK (1 << 2) /* set OC1 in byte 3 */
-
-/* OC mappings */
-#define DREX_XMEM_X1_X2_X2 0 /* 4 op insn, dest = src3, src1 = reg/mem */
-#define DREX_X1_XMEM_X2_X2 1 /* 4 op insn, dest = src3, src2 = reg/mem */
-#define DREX_X1_XMEM_X2_X1 2 /* 4 op insn, dest = src1, src2 = reg/mem */
-#define DREX_X1_X2_XMEM_X1 3 /* 4 op insn, dest = src1, src3 = reg/mem */
-
-#define DREX_XMEM_X1_X2 0 /* 3 op insn, src1 = reg/mem */
-#define DREX_X1_XMEM_X2 1 /* 3 op insn, src1 = reg/mem */
-
-/* Information needed to create the DREX byte in SSE5 instructions. */
-typedef struct
-{
- unsigned int reg; /* register */
- unsigned int rex; /* REX flags */
- unsigned int modrm_reg; /* which arg goes in the modrm.reg field */
- unsigned int modrm_regmem; /* which arg goes in the modrm.regmem field */
-} drex_byte;
-
-/* 386 opcode byte to code indirect addressing. */
-typedef struct
-{
- unsigned base;
- unsigned index;
- unsigned scale;
-}
-sib_byte;
-
-enum processor_type
-{
- PROCESSOR_UNKNOWN,
- PROCESSOR_I386,
- PROCESSOR_I486,
- PROCESSOR_PENTIUM,
- PROCESSOR_PENTIUMPRO,
- PROCESSOR_PENTIUM4,
- PROCESSOR_NOCONA,
- PROCESSOR_CORE,
- PROCESSOR_CORE2,
- PROCESSOR_K6,
- PROCESSOR_ATHLON,
- PROCESSOR_K8,
- PROCESSOR_GENERIC32,
- PROCESSOR_GENERIC64,
- PROCESSOR_AMDFAM10
-};
-
-/* x86 arch names, types and features */
-typedef struct
-{
- const char *name; /* arch name */
- enum processor_type type; /* arch type */
- i386_cpu_flags flags; /* cpu feature flags */
-}
-arch_entry;
-
-static void set_code_flag (int);
-static void set_16bit_gcc_code_flag (int);
-static void set_intel_syntax (int);
-static void set_intel_mnemonic (int);
-static void set_allow_index_reg (int);
-static void set_sse_check (int);
-static void set_cpu_arch (int);
-#ifdef TE_PE
-static void pe_directive_secrel (int);
-#endif
-static void signed_cons (int);
-static char *output_invalid (int c);
-static int i386_att_operand (char *);
-static int i386_intel_operand (char *, int);
-static const reg_entry *parse_register (char *, char **);
-static char *parse_insn (char *, char *);
-static char *parse_operands (char *, const char *);
-static void swap_operands (void);
-static void swap_2_operands (int, int);
-static void optimize_imm (void);
-static void optimize_disp (void);
-static int match_template (void);
-static int check_string (void);
-static int process_suffix (void);
-static int check_byte_reg (void);
-static int check_long_reg (void);
-static int check_qword_reg (void);
-static int check_word_reg (void);
-static int finalize_imm (void);
-static void process_drex (void);
-static int process_operands (void);
-static const seg_entry *build_modrm_byte (void);
-static void output_insn (void);
-static void output_imm (fragS *, offsetT);
-static void output_disp (fragS *, offsetT);
-#ifndef I386COFF
-static void s_bss (int);
-#endif
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-static void handle_large_common (int small ATTRIBUTE_UNUSED);
-#endif
-
-static const char *default_arch = DEFAULT_ARCH;
-
-/* VEX prefix. */
-typedef struct
-{
- /* VEX prefix is either 2 byte or 3 byte. */
- unsigned char bytes[3];
- unsigned int length;
- /* Destination or source register specifier. */
- const reg_entry *register_specifier;
-} vex_prefix;
-
-/* 'md_assemble ()' gathers together information and puts it into a
- i386_insn. */
-
-union i386_op
- {
- expressionS *disps;
- expressionS *imms;
- const reg_entry *regs;
- };
-
-struct _i386_insn
- {
- /* TM holds the template for the insn were currently assembling. */
- template tm;
-
- /* SUFFIX holds the instruction size suffix for byte, word, dword
- or qword, if given. */
- char suffix;
-
- /* OPERANDS gives the number of given operands. */
- unsigned int operands;
-
- /* REG_OPERANDS, DISP_OPERANDS, MEM_OPERANDS, IMM_OPERANDS give the number
- of given register, displacement, memory operands and immediate
- operands. */
- unsigned int reg_operands, disp_operands, mem_operands, imm_operands;
-
- /* TYPES [i] is the type (see above #defines) which tells us how to
- use OP[i] for the corresponding operand. */
- i386_operand_type types[MAX_OPERANDS];
-
- /* Displacement expression, immediate expression, or register for each
- operand. */
- union i386_op op[MAX_OPERANDS];
-
- /* Flags for operands. */
- unsigned int flags[MAX_OPERANDS];
-#define Operand_PCrel 1
-
- /* Relocation type for operand */
- enum bfd_reloc_code_real reloc[MAX_OPERANDS];
-
- /* BASE_REG, INDEX_REG, and LOG2_SCALE_FACTOR are used to encode
- the base index byte below. */
- const reg_entry *base_reg;
- const reg_entry *index_reg;
- unsigned int log2_scale_factor;
-
- /* SEG gives the seg_entries of this insn. They are zero unless
- explicit segment overrides are given. */
- const seg_entry *seg[2];
-
- /* PREFIX holds all the given prefix opcodes (usually null).
- PREFIXES is the number of prefix opcodes. */
- unsigned int prefixes;
- unsigned char prefix[MAX_PREFIXES];
-
- /* RM and SIB are the modrm byte and the sib byte where the
- addressing modes of this insn are encoded. DREX is the byte
- added by the SSE5 instructions. */
-
- modrm_byte rm;
- rex_byte rex;
- sib_byte sib;
- drex_byte drex;
- vex_prefix vex;
- };
-
-typedef struct _i386_insn i386_insn;
-
-/* List of chars besides those in app.c:symbol_chars that can start an
- operand. Used to prevent the scrubber eating vital white-space. */
-const char extra_symbol_chars[] = "*%-(["
-#ifdef LEX_AT
- "@"
-#endif
-#ifdef LEX_QM
- "?"
-#endif
- ;
-
-#if (defined (TE_I386AIX) \
- || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) \
- && !defined (TE_GNU) \
- && !defined (TE_LINUX) \
- && !defined (TE_NETWARE) \
- && !defined (TE_FreeBSD) \
- && !defined (TE_NetBSD)))
-/* This array holds the chars that always start a comment. If the
- pre-processor is disabled, these aren't very useful. The option
- --divide will remove '/' from this list. */
-const char *i386_comment_chars = "#/";
-#define SVR4_COMMENT_CHARS 1
-#define PREFIX_SEPARATOR '\\'
-
-#else
-const char *i386_comment_chars = "#";
-#define PREFIX_SEPARATOR '/'
-#endif
-
-/* This array holds the chars that only start a comment at the beginning of
- a line. If the line seems to have the form '# 123 filename'
- .line and .file directives will appear in the pre-processed output.
- Note that input_file.c hand checks for '#' at the beginning of the
- first line of the input file. This is because the compiler outputs
- #NO_APP at the beginning of its output.
- Also note that comments started like this one will always work if
- '/' isn't otherwise defined. */
-const char line_comment_chars[] = "#/";
-
-const char line_separator_chars[] = ";";
-
-/* Chars that can be used to separate mant from exp in floating point
- nums. */
-const char EXP_CHARS[] = "eE";
-
-/* Chars that mean this number is a floating point constant
- As in 0f12.456
- or 0d1.2345e12. */
-const char FLT_CHARS[] = "fFdDxX";
-
-/* Tables for lexical analysis. */
-static char mnemonic_chars[256];
-static char register_chars[256];
-static char operand_chars[256];
-static char identifier_chars[256];
-static char digit_chars[256];
-
-/* Lexical macros. */
-#define is_mnemonic_char(x) (mnemonic_chars[(unsigned char) x])
-#define is_operand_char(x) (operand_chars[(unsigned char) x])
-#define is_register_char(x) (register_chars[(unsigned char) x])
-#define is_space_char(x) ((x) == ' ')
-#define is_identifier_char(x) (identifier_chars[(unsigned char) x])
-#define is_digit_char(x) (digit_chars[(unsigned char) x])
-
-/* All non-digit non-letter characters that may occur in an operand. */
-static char operand_special_chars[] = "%$-+(,)*._~/<>|&^!:[@]";
-
-/* md_assemble() always leaves the strings it's passed unaltered. To
- effect this we maintain a stack of saved characters that we've smashed
- with '\0's (indicating end of strings for various sub-fields of the
- assembler instruction). */
-static char save_stack[32];
-static char *save_stack_p;
-#define END_STRING_AND_SAVE(s) \
- do { *save_stack_p++ = *(s); *(s) = '\0'; } while (0)
-#define RESTORE_END_STRING(s) \
- do { *(s) = *--save_stack_p; } while (0)
-
-/* The instruction we're assembling. */
-static i386_insn i;
-
-/* Possible templates for current insn. */
-static const templates *current_templates;
-
-/* Per instruction expressionS buffers: max displacements & immediates. */
-static expressionS disp_expressions[MAX_MEMORY_OPERANDS];
-static expressionS im_expressions[MAX_IMMEDIATE_OPERANDS];
-
-/* Current operand we are working on. */
-static int this_operand;
-
-/* We support four different modes. FLAG_CODE variable is used to distinguish
- these. */
-
-enum flag_code {
- CODE_32BIT,
- CODE_16BIT,
- CODE_64BIT };
-
-static enum flag_code flag_code;
-static unsigned int object_64bit;
-static int use_rela_relocations = 0;
-
-/* The names used to print error messages. */
-static const char *flag_code_names[] =
- {
- "32",
- "16",
- "64"
- };
-
-/* 1 for intel syntax,
- 0 if att syntax. */
-static int intel_syntax = 0;
-
-/* 1 for intel mnemonic,
- 0 if att mnemonic. */
-static int intel_mnemonic = !SYSV386_COMPAT;
-
-/* 1 if support old (<= 2.8.1) versions of gcc. */
-static int old_gcc = OLDGCC_COMPAT;
-
-/* 1 if pseudo registers are permitted. */
-static int allow_pseudo_reg = 0;
-
-/* 1 if register prefix % not required. */
-static int allow_naked_reg = 0;
-
-/* 1 if pseudo index register, eiz/riz, is allowed . */
-static int allow_index_reg = 0;
-
-static enum
- {
- sse_check_none = 0,
- sse_check_warning,
- sse_check_error
- }
-sse_check;
-
-/* Register prefix used for error message. */
-static const char *register_prefix = "%";
-
-/* Used in 16 bit gcc mode to add an l suffix to call, ret, enter,
- leave, push, and pop instructions so that gcc has the same stack
- frame as in 32 bit mode. */
-static char stackop_size = '\0';
-
-/* Non-zero to optimize code alignment. */
-int optimize_align_code = 1;
-
-/* Non-zero to quieten some warnings. */
-static int quiet_warnings = 0;
-
-/* CPU name. */
-static const char *cpu_arch_name = NULL;
-static char *cpu_sub_arch_name = NULL;
-
-/* CPU feature flags. */
-static i386_cpu_flags cpu_arch_flags = CPU_UNKNOWN_FLAGS;
-
-/* If we have selected a cpu we are generating instructions for. */
-static int cpu_arch_tune_set = 0;
-
-/* Cpu we are generating instructions for. */
-static enum processor_type cpu_arch_tune = PROCESSOR_UNKNOWN;
-
-/* CPU feature flags of cpu we are generating instructions for. */
-static i386_cpu_flags cpu_arch_tune_flags;
-
-/* CPU instruction set architecture used. */
-static enum processor_type cpu_arch_isa = PROCESSOR_UNKNOWN;
-
-/* CPU feature flags of instruction set architecture used. */
-static i386_cpu_flags cpu_arch_isa_flags;
-
-/* If set, conditional jumps are not automatically promoted to handle
- larger than a byte offset. */
-static unsigned int no_cond_jump_promotion = 0;
-
-/* Encode SSE instructions with VEX prefix. */
-static unsigned int sse2avx;
-
-/* Pre-defined "_GLOBAL_OFFSET_TABLE_". */
-static symbolS *GOT_symbol;
-
-/* The dwarf2 return column, adjusted for 32 or 64 bit. */
-unsigned int x86_dwarf2_return_column;
-
-/* The dwarf2 data alignment, adjusted for 32 or 64 bit. */
-int x86_cie_data_alignment;
-
-/* Interface to relax_segment.
- There are 3 major relax states for 386 jump insns because the
- different types of jumps add different sizes to frags when we're
- figuring out what sort of jump to choose to reach a given label. */
-
-/* Types. */
-#define UNCOND_JUMP 0
-#define COND_JUMP 1
-#define COND_JUMP86 2
-
-/* Sizes. */
-#define CODE16 1
-#define SMALL 0
-#define SMALL16 (SMALL | CODE16)
-#define BIG 2
-#define BIG16 (BIG | CODE16)
-
-#ifndef INLINE
-#ifdef __GNUC__
-#define INLINE __inline__
-#else
-#define INLINE
-#endif
-#endif
-
-#define ENCODE_RELAX_STATE(type, size) \
- ((relax_substateT) (((type) << 2) | (size)))
-#define TYPE_FROM_RELAX_STATE(s) \
- ((s) >> 2)
-#define DISP_SIZE_FROM_RELAX_STATE(s) \
- ((((s) & 3) == BIG ? 4 : (((s) & 3) == BIG16 ? 2 : 1)))
-
-/* This table is used by relax_frag to promote short jumps to long
- ones where necessary. SMALL (short) jumps may be promoted to BIG
- (32 bit long) ones, and SMALL16 jumps to BIG16 (16 bit long). We
- don't allow a short jump in a 32 bit code segment to be promoted to
- a 16 bit offset jump because it's slower (requires data size
- prefix), and doesn't work, unless the destination is in the bottom
- 64k of the code segment (The top 16 bits of eip are zeroed). */
-
-const relax_typeS md_relax_table[] =
-{
- /* The fields are:
- 1) most positive reach of this state,
- 2) most negative reach of this state,
- 3) how many bytes this mode will have in the variable part of the frag
- 4) which index into the table to try if we can't fit into this one. */
-
- /* UNCOND_JUMP states. */
- {127 + 1, -128 + 1, 1, ENCODE_RELAX_STATE (UNCOND_JUMP, BIG)},
- {127 + 1, -128 + 1, 1, ENCODE_RELAX_STATE (UNCOND_JUMP, BIG16)},
- /* dword jmp adds 4 bytes to frag:
- 0 extra opcode bytes, 4 displacement bytes. */
- {0, 0, 4, 0},
- /* word jmp adds 2 byte2 to frag:
- 0 extra opcode bytes, 2 displacement bytes. */
- {0, 0, 2, 0},
-
- /* COND_JUMP states. */
- {127 + 1, -128 + 1, 1, ENCODE_RELAX_STATE (COND_JUMP, BIG)},
- {127 + 1, -128 + 1, 1, ENCODE_RELAX_STATE (COND_JUMP, BIG16)},
- /* dword conditionals adds 5 bytes to frag:
- 1 extra opcode byte, 4 displacement bytes. */
- {0, 0, 5, 0},
- /* word conditionals add 3 bytes to frag:
- 1 extra opcode byte, 2 displacement bytes. */
- {0, 0, 3, 0},
-
- /* COND_JUMP86 states. */
- {127 + 1, -128 + 1, 1, ENCODE_RELAX_STATE (COND_JUMP86, BIG)},
- {127 + 1, -128 + 1, 1, ENCODE_RELAX_STATE (COND_JUMP86, BIG16)},
- /* dword conditionals adds 5 bytes to frag:
- 1 extra opcode byte, 4 displacement bytes. */
- {0, 0, 5, 0},
- /* word conditionals add 4 bytes to frag:
- 1 displacement byte and a 3 byte long branch insn. */
- {0, 0, 4, 0}
-};
-
-static const arch_entry cpu_arch[] =
-{
- { "generic32", PROCESSOR_GENERIC32,
- CPU_GENERIC32_FLAGS },
- { "generic64", PROCESSOR_GENERIC64,
- CPU_GENERIC64_FLAGS },
- { "i8086", PROCESSOR_UNKNOWN,
- CPU_NONE_FLAGS },
- { "i186", PROCESSOR_UNKNOWN,
- CPU_I186_FLAGS },
- { "i286", PROCESSOR_UNKNOWN,
- CPU_I286_FLAGS },
- { "i386", PROCESSOR_I386,
- CPU_I386_FLAGS },
- { "i486", PROCESSOR_I486,
- CPU_I486_FLAGS },
- { "i586", PROCESSOR_PENTIUM,
- CPU_I586_FLAGS },
- { "i686", PROCESSOR_PENTIUMPRO,
- CPU_I686_FLAGS },
- { "pentium", PROCESSOR_PENTIUM,
- CPU_I586_FLAGS },
- { "pentiumpro", PROCESSOR_PENTIUMPRO,
- CPU_I686_FLAGS },
- { "pentiumii", PROCESSOR_PENTIUMPRO,
- CPU_P2_FLAGS },
- { "pentiumiii",PROCESSOR_PENTIUMPRO,
- CPU_P3_FLAGS },
- { "pentium4", PROCESSOR_PENTIUM4,
- CPU_P4_FLAGS },
- { "prescott", PROCESSOR_NOCONA,
- CPU_CORE_FLAGS },
- { "nocona", PROCESSOR_NOCONA,
- CPU_NOCONA_FLAGS },
- { "yonah", PROCESSOR_CORE,
- CPU_CORE_FLAGS },
- { "core", PROCESSOR_CORE,
- CPU_CORE_FLAGS },
- { "merom", PROCESSOR_CORE2,
- CPU_CORE2_FLAGS },
- { "core2", PROCESSOR_CORE2,
- CPU_CORE2_FLAGS },
- { "k6", PROCESSOR_K6,
- CPU_K6_FLAGS },
- { "k6_2", PROCESSOR_K6,
- CPU_K6_2_FLAGS },
- { "athlon", PROCESSOR_ATHLON,
- CPU_ATHLON_FLAGS },
- { "sledgehammer", PROCESSOR_K8,
- CPU_K8_FLAGS },
- { "opteron", PROCESSOR_K8,
- CPU_K8_FLAGS },
- { "k8", PROCESSOR_K8,
- CPU_K8_FLAGS },
- { "amdfam10", PROCESSOR_AMDFAM10,
- CPU_AMDFAM10_FLAGS },
- { ".mmx", PROCESSOR_UNKNOWN,
- CPU_MMX_FLAGS },
- { ".sse", PROCESSOR_UNKNOWN,
- CPU_SSE_FLAGS },
- { ".sse2", PROCESSOR_UNKNOWN,
- CPU_SSE2_FLAGS },
- { ".sse3", PROCESSOR_UNKNOWN,
- CPU_SSE3_FLAGS },
- { ".ssse3", PROCESSOR_UNKNOWN,
- CPU_SSSE3_FLAGS },
- { ".sse4.1", PROCESSOR_UNKNOWN,
- CPU_SSE4_1_FLAGS },
- { ".sse4.2", PROCESSOR_UNKNOWN,
- CPU_SSE4_2_FLAGS },
- { ".sse4", PROCESSOR_UNKNOWN,
- CPU_SSE4_2_FLAGS },
- { ".avx", PROCESSOR_UNKNOWN,
- CPU_AVX_FLAGS },
- { ".vmx", PROCESSOR_UNKNOWN,
- CPU_VMX_FLAGS },
- { ".smx", PROCESSOR_UNKNOWN,
- CPU_SMX_FLAGS },
- { ".xsave", PROCESSOR_UNKNOWN,
- CPU_XSAVE_FLAGS },
- { ".aes", PROCESSOR_UNKNOWN,
- CPU_AES_FLAGS },
- { ".pclmul", PROCESSOR_UNKNOWN,
- CPU_PCLMUL_FLAGS },
- { ".clmul", PROCESSOR_UNKNOWN,
- CPU_PCLMUL_FLAGS },
- { ".fma", PROCESSOR_UNKNOWN,
- CPU_FMA_FLAGS },
- { ".movbe", PROCESSOR_UNKNOWN,
- CPU_MOVBE_FLAGS },
- { ".ept", PROCESSOR_UNKNOWN,
- CPU_EPT_FLAGS },
- { ".3dnow", PROCESSOR_UNKNOWN,
- CPU_3DNOW_FLAGS },
- { ".3dnowa", PROCESSOR_UNKNOWN,
- CPU_3DNOWA_FLAGS },
- { ".padlock", PROCESSOR_UNKNOWN,
- CPU_PADLOCK_FLAGS },
- { ".pacifica", PROCESSOR_UNKNOWN,
- CPU_SVME_FLAGS },
- { ".svme", PROCESSOR_UNKNOWN,
- CPU_SVME_FLAGS },
- { ".sse4a", PROCESSOR_UNKNOWN,
- CPU_SSE4A_FLAGS },
- { ".abm", PROCESSOR_UNKNOWN,
- CPU_ABM_FLAGS },
- { ".sse5", PROCESSOR_UNKNOWN,
- CPU_SSE5_FLAGS },
-};
-
-const pseudo_typeS md_pseudo_table[] =
-{
-#if !defined(OBJ_AOUT) && !defined(USE_ALIGN_PTWO)
- {"align", s_align_bytes, 0},
-#else
- {"align", s_align_ptwo, 0},
-#endif
- {"arch", set_cpu_arch, 0},
-#ifndef I386COFF
- {"bss", s_bss, 0},
-#endif
- {"ffloat", float_cons, 'f'},
- {"dfloat", float_cons, 'd'},
- {"tfloat", float_cons, 'x'},
- {"value", cons, 2},
- {"slong", signed_cons, 4},
- {"noopt", s_ignore, 0},
- {"optim", s_ignore, 0},
- {"code16gcc", set_16bit_gcc_code_flag, CODE_16BIT},
- {"code16", set_code_flag, CODE_16BIT},
- {"code32", set_code_flag, CODE_32BIT},
- {"code64", set_code_flag, CODE_64BIT},
- {"intel_syntax", set_intel_syntax, 1},
- {"att_syntax", set_intel_syntax, 0},
- {"intel_mnemonic", set_intel_mnemonic, 1},
- {"att_mnemonic", set_intel_mnemonic, 0},
- {"allow_index_reg", set_allow_index_reg, 1},
- {"disallow_index_reg", set_allow_index_reg, 0},
- {"sse_check", set_sse_check, 0},
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- {"largecomm", handle_large_common, 0},
-#else
- {"file", (void (*) (int)) dwarf2_directive_file, 0},
- {"loc", dwarf2_directive_loc, 0},
- {"loc_mark_labels", dwarf2_directive_loc_mark_labels, 0},
-#endif
-#ifdef TE_PE
- {"secrel32", pe_directive_secrel, 0},
-#endif
- {0, 0, 0}
-};
-
-/* For interface with expression (). */
-extern char *input_line_pointer;
-
-/* Hash table for instruction mnemonic lookup. */
-static struct hash_control *op_hash;
-
-/* Hash table for register lookup. */
-static struct hash_control *reg_hash;
-
-void
-i386_align_code (fragS *fragP, int count)
-{
- /* Various efficient no-op patterns for aligning code labels.
- Note: Don't try to assemble the instructions in the comments.
- 0L and 0w are not legal. */
- static const char f32_1[] =
- {0x90}; /* nop */
- static const char f32_2[] =
- {0x66,0x90}; /* xchg %ax,%ax */
- static const char f32_3[] =
- {0x8d,0x76,0x00}; /* leal 0(%esi),%esi */
- static const char f32_4[] =
- {0x8d,0x74,0x26,0x00}; /* leal 0(%esi,1),%esi */
- static const char f32_5[] =
- {0x90, /* nop */
- 0x8d,0x74,0x26,0x00}; /* leal 0(%esi,1),%esi */
- static const char f32_6[] =
- {0x8d,0xb6,0x00,0x00,0x00,0x00}; /* leal 0L(%esi),%esi */
- static const char f32_7[] =
- {0x8d,0xb4,0x26,0x00,0x00,0x00,0x00}; /* leal 0L(%esi,1),%esi */
- static const char f32_8[] =
- {0x90, /* nop */
- 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00}; /* leal 0L(%esi,1),%esi */
- static const char f32_9[] =
- {0x89,0xf6, /* movl %esi,%esi */
- 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */
- static const char f32_10[] =
- {0x8d,0x76,0x00, /* leal 0(%esi),%esi */
- 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */
- static const char f32_11[] =
- {0x8d,0x74,0x26,0x00, /* leal 0(%esi,1),%esi */
- 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */
- static const char f32_12[] =
- {0x8d,0xb6,0x00,0x00,0x00,0x00, /* leal 0L(%esi),%esi */
- 0x8d,0xbf,0x00,0x00,0x00,0x00}; /* leal 0L(%edi),%edi */
- static const char f32_13[] =
- {0x8d,0xb6,0x00,0x00,0x00,0x00, /* leal 0L(%esi),%esi */
- 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */
- static const char f32_14[] =
- {0x8d,0xb4,0x26,0x00,0x00,0x00,0x00, /* leal 0L(%esi,1),%esi */
- 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */
- static const char f16_3[] =
- {0x8d,0x74,0x00}; /* lea 0(%esi),%esi */
- static const char f16_4[] =
- {0x8d,0xb4,0x00,0x00}; /* lea 0w(%si),%si */
- static const char f16_5[] =
- {0x90, /* nop */
- 0x8d,0xb4,0x00,0x00}; /* lea 0w(%si),%si */
- static const char f16_6[] =
- {0x89,0xf6, /* mov %si,%si */
- 0x8d,0xbd,0x00,0x00}; /* lea 0w(%di),%di */
- static const char f16_7[] =
- {0x8d,0x74,0x00, /* lea 0(%si),%si */
- 0x8d,0xbd,0x00,0x00}; /* lea 0w(%di),%di */
- static const char f16_8[] =
- {0x8d,0xb4,0x00,0x00, /* lea 0w(%si),%si */
- 0x8d,0xbd,0x00,0x00}; /* lea 0w(%di),%di */
- static const char jump_31[] =
- {0xeb,0x1d,0x90,0x90,0x90,0x90,0x90, /* jmp .+31; lotsa nops */
- 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,
- 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,
- 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90};
- static const char *const f32_patt[] = {
- f32_1, f32_2, f32_3, f32_4, f32_5, f32_6, f32_7, f32_8,
- f32_9, f32_10, f32_11, f32_12, f32_13, f32_14
- };
- static const char *const f16_patt[] = {
- f32_1, f32_2, f16_3, f16_4, f16_5, f16_6, f16_7, f16_8
- };
- /* nopl (%[re]ax) */
- static const char alt_3[] =
- {0x0f,0x1f,0x00};
- /* nopl 0(%[re]ax) */
- static const char alt_4[] =
- {0x0f,0x1f,0x40,0x00};
- /* nopl 0(%[re]ax,%[re]ax,1) */
- static const char alt_5[] =
- {0x0f,0x1f,0x44,0x00,0x00};
- /* nopw 0(%[re]ax,%[re]ax,1) */
- static const char alt_6[] =
- {0x66,0x0f,0x1f,0x44,0x00,0x00};
- /* nopl 0L(%[re]ax) */
- static const char alt_7[] =
- {0x0f,0x1f,0x80,0x00,0x00,0x00,0x00};
- /* nopl 0L(%[re]ax,%[re]ax,1) */
- static const char alt_8[] =
- {0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00};
- /* nopw 0L(%[re]ax,%[re]ax,1) */
- static const char alt_9[] =
- {0x66,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00};
- /* nopw %cs:0L(%[re]ax,%[re]ax,1) */
- static const char alt_10[] =
- {0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00};
- /* data16
- nopw %cs:0L(%[re]ax,%[re]ax,1) */
- static const char alt_long_11[] =
- {0x66,
- 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00};
- /* data16
- data16
- nopw %cs:0L(%[re]ax,%[re]ax,1) */
- static const char alt_long_12[] =
- {0x66,
- 0x66,
- 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00};
- /* data16
- data16
- data16
- nopw %cs:0L(%[re]ax,%[re]ax,1) */
- static const char alt_long_13[] =
- {0x66,
- 0x66,
- 0x66,
- 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00};
- /* data16
- data16
- data16
- data16
- nopw %cs:0L(%[re]ax,%[re]ax,1) */
- static const char alt_long_14[] =
- {0x66,
- 0x66,
- 0x66,
- 0x66,
- 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00};
- /* data16
- data16
- data16
- data16
- data16
- nopw %cs:0L(%[re]ax,%[re]ax,1) */
- static const char alt_long_15[] =
- {0x66,
- 0x66,
- 0x66,
- 0x66,
- 0x66,
- 0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00};
- /* nopl 0(%[re]ax,%[re]ax,1)
- nopw 0(%[re]ax,%[re]ax,1) */
- static const char alt_short_11[] =
- {0x0f,0x1f,0x44,0x00,0x00,
- 0x66,0x0f,0x1f,0x44,0x00,0x00};
- /* nopw 0(%[re]ax,%[re]ax,1)
- nopw 0(%[re]ax,%[re]ax,1) */
- static const char alt_short_12[] =
- {0x66,0x0f,0x1f,0x44,0x00,0x00,
- 0x66,0x0f,0x1f,0x44,0x00,0x00};
- /* nopw 0(%[re]ax,%[re]ax,1)
- nopl 0L(%[re]ax) */
- static const char alt_short_13[] =
- {0x66,0x0f,0x1f,0x44,0x00,0x00,
- 0x0f,0x1f,0x80,0x00,0x00,0x00,0x00};
- /* nopl 0L(%[re]ax)
- nopl 0L(%[re]ax) */
- static const char alt_short_14[] =
- {0x0f,0x1f,0x80,0x00,0x00,0x00,0x00,
- 0x0f,0x1f,0x80,0x00,0x00,0x00,0x00};
- /* nopl 0L(%[re]ax)
- nopl 0L(%[re]ax,%[re]ax,1) */
- static const char alt_short_15[] =
- {0x0f,0x1f,0x80,0x00,0x00,0x00,0x00,
- 0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00};
- static const char *const alt_short_patt[] = {
- f32_1, f32_2, alt_3, alt_4, alt_5, alt_6, alt_7, alt_8,
- alt_9, alt_10, alt_short_11, alt_short_12, alt_short_13,
- alt_short_14, alt_short_15
- };
- static const char *const alt_long_patt[] = {
- f32_1, f32_2, alt_3, alt_4, alt_5, alt_6, alt_7, alt_8,
- alt_9, alt_10, alt_long_11, alt_long_12, alt_long_13,
- alt_long_14, alt_long_15
- };
-
- /* Only align for at least a positive non-zero boundary. */
- if (count <= 0 || count > MAX_MEM_FOR_RS_ALIGN_CODE)
- return;
-
- /* We need to decide which NOP sequence to use for 32bit and
- 64bit. When -mtune= is used:
-
- 1. For PROCESSOR_I386, PROCESSOR_I486, PROCESSOR_PENTIUM and
- PROCESSOR_GENERIC32, f32_patt will be used.
- 2. For PROCESSOR_PENTIUMPRO, PROCESSOR_PENTIUM4, PROCESSOR_NOCONA,
- PROCESSOR_CORE, PROCESSOR_CORE2, and PROCESSOR_GENERIC64,
- alt_long_patt will be used.
- 3. For PROCESSOR_ATHLON, PROCESSOR_K6, PROCESSOR_K8 and
- PROCESSOR_AMDFAM10, alt_short_patt will be used.
-
- When -mtune= isn't used, alt_long_patt will be used if
- cpu_arch_isa_flags has Cpu686. Otherwise, f32_patt will
- be used.
-
- When -march= or .arch is used, we can't use anything beyond
- cpu_arch_isa_flags. */
-
- if (flag_code == CODE_16BIT)
- {
- if (count > 8)
- {
- memcpy (fragP->fr_literal + fragP->fr_fix,
- jump_31, count);
- /* Adjust jump offset. */
- fragP->fr_literal[fragP->fr_fix + 1] = count - 2;
- }
- else
- memcpy (fragP->fr_literal + fragP->fr_fix,
- f16_patt[count - 1], count);
- }
- else
- {
- const char *const *patt = NULL;
-
- if (cpu_arch_isa == PROCESSOR_UNKNOWN)
- {
- /* PROCESSOR_UNKNOWN means that all ISAs may be used. */
- switch (cpu_arch_tune)
- {
- case PROCESSOR_UNKNOWN:
- /* We use cpu_arch_isa_flags to check if we SHOULD
- optimize for Cpu686. */
- if (cpu_arch_isa_flags.bitfield.cpui686)
- patt = alt_long_patt;
- else
- patt = f32_patt;
- break;
- case PROCESSOR_PENTIUMPRO:
- case PROCESSOR_PENTIUM4:
- case PROCESSOR_NOCONA:
- case PROCESSOR_CORE:
- case PROCESSOR_CORE2:
- case PROCESSOR_GENERIC64:
- patt = alt_long_patt;
- break;
- case PROCESSOR_K6:
- case PROCESSOR_ATHLON:
- case PROCESSOR_K8:
- case PROCESSOR_AMDFAM10:
- patt = alt_short_patt;
- break;
- case PROCESSOR_I386:
- case PROCESSOR_I486:
- case PROCESSOR_PENTIUM:
- case PROCESSOR_GENERIC32:
- patt = f32_patt;
- break;
- }
- }
- else
- {
- switch (cpu_arch_tune)
- {
- case PROCESSOR_UNKNOWN:
- /* When cpu_arch_isa is net, cpu_arch_tune shouldn't be
- PROCESSOR_UNKNOWN. */
- abort ();
- break;
-
- case PROCESSOR_I386:
- case PROCESSOR_I486:
- case PROCESSOR_PENTIUM:
- case PROCESSOR_K6:
- case PROCESSOR_ATHLON:
- case PROCESSOR_K8:
- case PROCESSOR_AMDFAM10:
- case PROCESSOR_GENERIC32:
- /* We use cpu_arch_isa_flags to check if we CAN optimize
- for Cpu686. */
- if (cpu_arch_isa_flags.bitfield.cpui686)
- patt = alt_short_patt;
- else
- patt = f32_patt;
- break;
- case PROCESSOR_PENTIUMPRO:
- case PROCESSOR_PENTIUM4:
- case PROCESSOR_NOCONA:
- case PROCESSOR_CORE:
- case PROCESSOR_CORE2:
- if (cpu_arch_isa_flags.bitfield.cpui686)
- patt = alt_long_patt;
- else
- patt = f32_patt;
- break;
- case PROCESSOR_GENERIC64:
- patt = alt_long_patt;
- break;
- }
- }
-
- if (patt == f32_patt)
- {
- /* If the padding is less than 15 bytes, we use the normal
- ones. Otherwise, we use a jump instruction and adjust
- its offset. */
- if (count < 15)
- memcpy (fragP->fr_literal + fragP->fr_fix,
- patt[count - 1], count);
- else
- {
- memcpy (fragP->fr_literal + fragP->fr_fix,
- jump_31, count);
- /* Adjust jump offset. */
- fragP->fr_literal[fragP->fr_fix + 1] = count - 2;
- }
- }
- else
- {
- /* Maximum length of an instruction is 15 byte. If the
- padding is greater than 15 bytes and we don't use jump,
- we have to break it into smaller pieces. */
- int padding = count;
- while (padding > 15)
- {
- padding -= 15;
- memcpy (fragP->fr_literal + fragP->fr_fix + padding,
- patt [14], 15);
- }
-
- if (padding)
- memcpy (fragP->fr_literal + fragP->fr_fix,
- patt [padding - 1], padding);
- }
- }
- fragP->fr_var = count;
-}
-
-static INLINE int
-operand_type_all_zero (const union i386_operand_type *x)
-{
- switch (ARRAY_SIZE(x->array))
- {
- case 3:
- if (x->array[2])
- return 0;
- case 2:
- if (x->array[1])
- return 0;
- case 1:
- return !x->array[0];
- default:
- abort ();
- }
-}
-
-static INLINE void
-operand_type_set (union i386_operand_type *x, unsigned int v)
-{
- switch (ARRAY_SIZE(x->array))
- {
- case 3:
- x->array[2] = v;
- case 2:
- x->array[1] = v;
- case 1:
- x->array[0] = v;
- break;
- default:
- abort ();
- }
-}
-
-static INLINE int
-operand_type_equal (const union i386_operand_type *x,
- const union i386_operand_type *y)
-{
- switch (ARRAY_SIZE(x->array))
- {
- case 3:
- if (x->array[2] != y->array[2])
- return 0;
- case 2:
- if (x->array[1] != y->array[1])
- return 0;
- case 1:
- return x->array[0] == y->array[0];
- break;
- default:
- abort ();
- }
-}
-
-static INLINE int
-cpu_flags_all_zero (const union i386_cpu_flags *x)
-{
- switch (ARRAY_SIZE(x->array))
- {
- case 3:
- if (x->array[2])
- return 0;
- case 2:
- if (x->array[1])
- return 0;
- case 1:
- return !x->array[0];
- default:
- abort ();
- }
-}
-
-static INLINE void
-cpu_flags_set (union i386_cpu_flags *x, unsigned int v)
-{
- switch (ARRAY_SIZE(x->array))
- {
- case 3:
- x->array[2] = v;
- case 2:
- x->array[1] = v;
- case 1:
- x->array[0] = v;
- break;
- default:
- abort ();
- }
-}
-
-static INLINE int
-cpu_flags_equal (const union i386_cpu_flags *x,
- const union i386_cpu_flags *y)
-{
- switch (ARRAY_SIZE(x->array))
- {
- case 3:
- if (x->array[2] != y->array[2])
- return 0;
- case 2:
- if (x->array[1] != y->array[1])
- return 0;
- case 1:
- return x->array[0] == y->array[0];
- break;
- default:
- abort ();
- }
-}
-
-static INLINE int
-cpu_flags_check_cpu64 (i386_cpu_flags f)
-{
- return !((flag_code == CODE_64BIT && f.bitfield.cpuno64)
- || (flag_code != CODE_64BIT && f.bitfield.cpu64));
-}
-
-static INLINE i386_cpu_flags
-cpu_flags_and (i386_cpu_flags x, i386_cpu_flags y)
-{
- switch (ARRAY_SIZE (x.array))
- {
- case 3:
- x.array [2] &= y.array [2];
- case 2:
- x.array [1] &= y.array [1];
- case 1:
- x.array [0] &= y.array [0];
- break;
- default:
- abort ();
- }
- return x;
-}
-
-static INLINE i386_cpu_flags
-cpu_flags_or (i386_cpu_flags x, i386_cpu_flags y)
-{
- switch (ARRAY_SIZE (x.array))
- {
- case 3:
- x.array [2] |= y.array [2];
- case 2:
- x.array [1] |= y.array [1];
- case 1:
- x.array [0] |= y.array [0];
- break;
- default:
- abort ();
- }
- return x;
-}
-
-#define CPU_FLAGS_ARCH_MATCH 0x1
-#define CPU_FLAGS_64BIT_MATCH 0x2
-
-#define CPU_FLAGS_32BIT_MATCH CPU_FLAGS_ARCH_MATCH
-#define CPU_FLAGS_PERFECT_MATCH \
- (CPU_FLAGS_32BIT_MATCH | CPU_FLAGS_64BIT_MATCH)
-
-/* Return CPU flags match bits. */
-
-static int
-cpu_flags_match (const template *t)
-{
- i386_cpu_flags x = t->cpu_flags;
- int match = cpu_flags_check_cpu64 (x) ? CPU_FLAGS_64BIT_MATCH : 0;
-
- x.bitfield.cpu64 = 0;
- x.bitfield.cpuno64 = 0;
-
- if (cpu_flags_all_zero (&x))
- {
- /* This instruction is available on all archs. */
- match |= CPU_FLAGS_32BIT_MATCH;
- }
- else
- {
- /* This instruction is available only on some archs. */
- i386_cpu_flags cpu = cpu_arch_flags;
-
- cpu.bitfield.cpu64 = 0;
- cpu.bitfield.cpuno64 = 0;
- cpu = cpu_flags_and (x, cpu);
- if (!cpu_flags_all_zero (&cpu))
- {
- /* Check SSE2AVX */
- if (!t->opcode_modifier.sse2avx || sse2avx)
- match |= CPU_FLAGS_32BIT_MATCH;
- }
- }
- return match;
-}
-
-static INLINE i386_operand_type
-operand_type_and (i386_operand_type x, i386_operand_type y)
-{
- switch (ARRAY_SIZE (x.array))
- {
- case 3:
- x.array [2] &= y.array [2];
- case 2:
- x.array [1] &= y.array [1];
- case 1:
- x.array [0] &= y.array [0];
- break;
- default:
- abort ();
- }
- return x;
-}
-
-static INLINE i386_operand_type
-operand_type_or (i386_operand_type x, i386_operand_type y)
-{
- switch (ARRAY_SIZE (x.array))
- {
- case 3:
- x.array [2] |= y.array [2];
- case 2:
- x.array [1] |= y.array [1];
- case 1:
- x.array [0] |= y.array [0];
- break;
- default:
- abort ();
- }
- return x;
-}
-
-static INLINE i386_operand_type
-operand_type_xor (i386_operand_type x, i386_operand_type y)
-{
- switch (ARRAY_SIZE (x.array))
- {
- case 3:
- x.array [2] ^= y.array [2];
- case 2:
- x.array [1] ^= y.array [1];
- case 1:
- x.array [0] ^= y.array [0];
- break;
- default:
- abort ();
- }
- return x;
-}
-
-static const i386_operand_type acc32 = OPERAND_TYPE_ACC32;
-static const i386_operand_type acc64 = OPERAND_TYPE_ACC64;
-static const i386_operand_type control = OPERAND_TYPE_CONTROL;
-static const i386_operand_type inoutportreg
- = OPERAND_TYPE_INOUTPORTREG;
-static const i386_operand_type reg16_inoutportreg
- = OPERAND_TYPE_REG16_INOUTPORTREG;
-static const i386_operand_type disp16 = OPERAND_TYPE_DISP16;
-static const i386_operand_type disp32 = OPERAND_TYPE_DISP32;
-static const i386_operand_type disp32s = OPERAND_TYPE_DISP32S;
-static const i386_operand_type disp16_32 = OPERAND_TYPE_DISP16_32;
-static const i386_operand_type anydisp
- = OPERAND_TYPE_ANYDISP;
-static const i386_operand_type regxmm = OPERAND_TYPE_REGXMM;
-static const i386_operand_type regymm = OPERAND_TYPE_REGYMM;
-static const i386_operand_type imm8 = OPERAND_TYPE_IMM8;
-static const i386_operand_type imm8s = OPERAND_TYPE_IMM8S;
-static const i386_operand_type imm16 = OPERAND_TYPE_IMM16;
-static const i386_operand_type imm32 = OPERAND_TYPE_IMM32;
-static const i386_operand_type imm32s = OPERAND_TYPE_IMM32S;
-static const i386_operand_type imm64 = OPERAND_TYPE_IMM64;
-static const i386_operand_type imm16_32 = OPERAND_TYPE_IMM16_32;
-static const i386_operand_type imm16_32s = OPERAND_TYPE_IMM16_32S;
-static const i386_operand_type imm16_32_32s = OPERAND_TYPE_IMM16_32_32S;
-static const i386_operand_type vex_imm4 = OPERAND_TYPE_VEX_IMM4;
-
-enum operand_type
-{
- reg,
- imm,
- disp,
- anymem
-};
-
-static INLINE int
-operand_type_check (i386_operand_type t, enum operand_type c)
-{
- switch (c)
- {
- case reg:
- return (t.bitfield.reg8
- || t.bitfield.reg16
- || t.bitfield.reg32
- || t.bitfield.reg64);
-
- case imm:
- return (t.bitfield.imm8
- || t.bitfield.imm8s
- || t.bitfield.imm16
- || t.bitfield.imm32
- || t.bitfield.imm32s
- || t.bitfield.imm64);
-
- case disp:
- return (t.bitfield.disp8
- || t.bitfield.disp16
- || t.bitfield.disp32
- || t.bitfield.disp32s
- || t.bitfield.disp64);
-
- case anymem:
- return (t.bitfield.disp8
- || t.bitfield.disp16
- || t.bitfield.disp32
- || t.bitfield.disp32s
- || t.bitfield.disp64
- || t.bitfield.baseindex);
-
- default:
- abort ();
- }
-
- return 0;
-}
-
-/* Return 1 if there is no conflict in 8bit/16bit/32bit/64bit on
- operand J for instruction template T. */
-
-static INLINE int
-match_reg_size (const template *t, unsigned int j)
-{
- return !((i.types[j].bitfield.byte
- && !t->operand_types[j].bitfield.byte)
- || (i.types[j].bitfield.word
- && !t->operand_types[j].bitfield.word)
- || (i.types[j].bitfield.dword
- && !t->operand_types[j].bitfield.dword)
- || (i.types[j].bitfield.qword
- && !t->operand_types[j].bitfield.qword));
-}
-
-/* Return 1 if there is no conflict in any size on operand J for
- instruction template T. */
-
-static INLINE int
-match_mem_size (const template *t, unsigned int j)
-{
- return (match_reg_size (t, j)
- && !((i.types[j].bitfield.unspecified
- && !t->operand_types[j].bitfield.unspecified)
- || (i.types[j].bitfield.fword
- && !t->operand_types[j].bitfield.fword)
- || (i.types[j].bitfield.tbyte
- && !t->operand_types[j].bitfield.tbyte)
- || (i.types[j].bitfield.xmmword
- && !t->operand_types[j].bitfield.xmmword)
- || (i.types[j].bitfield.ymmword
- && !t->operand_types[j].bitfield.ymmword)));
-}
-
-/* Return 1 if there is no size conflict on any operands for
- instruction template T. */
-
-static INLINE int
-operand_size_match (const template *t)
-{
- unsigned int j;
- int match = 1;
-
- /* Don't check jump instructions. */
- if (t->opcode_modifier.jump
- || t->opcode_modifier.jumpbyte
- || t->opcode_modifier.jumpdword
- || t->opcode_modifier.jumpintersegment)
- return match;
-
- /* Check memory and accumulator operand size. */
- for (j = 0; j < i.operands; j++)
- {
- if (t->operand_types[j].bitfield.anysize)
- continue;
-
- if (t->operand_types[j].bitfield.acc && !match_reg_size (t, j))
- {
- match = 0;
- break;
- }
-
- if (i.types[j].bitfield.mem && !match_mem_size (t, j))
- {
- match = 0;
- break;
- }
- }
-
- if (match
- || (!t->opcode_modifier.d && !t->opcode_modifier.floatd))
- return match;
-
- /* Check reverse. */
- assert (i.operands == 2);
-
- match = 1;
- for (j = 0; j < 2; j++)
- {
- if (t->operand_types[j].bitfield.acc
- && !match_reg_size (t, j ? 0 : 1))
- {
- match = 0;
- break;
- }
-
- if (i.types[j].bitfield.mem
- && !match_mem_size (t, j ? 0 : 1))
- {
- match = 0;
- break;
- }
- }
-
- return match;
-}
-
-static INLINE int
-operand_type_match (i386_operand_type overlap,
- i386_operand_type given)
-{
- i386_operand_type temp = overlap;
-
- temp.bitfield.jumpabsolute = 0;
- temp.bitfield.unspecified = 0;
- temp.bitfield.byte = 0;
- temp.bitfield.word = 0;
- temp.bitfield.dword = 0;
- temp.bitfield.fword = 0;
- temp.bitfield.qword = 0;
- temp.bitfield.tbyte = 0;
- temp.bitfield.xmmword = 0;
- temp.bitfield.ymmword = 0;
- if (operand_type_all_zero (&temp))
- return 0;
-
- return (given.bitfield.baseindex == overlap.bitfield.baseindex
- && given.bitfield.jumpabsolute == overlap.bitfield.jumpabsolute);
-}
-
-/* If given types g0 and g1 are registers they must be of the same type
- unless the expected operand type register overlap is null.
- Note that Acc in a template matches every size of reg. */
-
-static INLINE int
-operand_type_register_match (i386_operand_type m0,
- i386_operand_type g0,
- i386_operand_type t0,
- i386_operand_type m1,
- i386_operand_type g1,
- i386_operand_type t1)
-{
- if (!operand_type_check (g0, reg))
- return 1;
-
- if (!operand_type_check (g1, reg))
- return 1;
-
- if (g0.bitfield.reg8 == g1.bitfield.reg8
- && g0.bitfield.reg16 == g1.bitfield.reg16
- && g0.bitfield.reg32 == g1.bitfield.reg32
- && g0.bitfield.reg64 == g1.bitfield.reg64)
- return 1;
-
- if (m0.bitfield.acc)
- {
- t0.bitfield.reg8 = 1;
- t0.bitfield.reg16 = 1;
- t0.bitfield.reg32 = 1;
- t0.bitfield.reg64 = 1;
- }
-
- if (m1.bitfield.acc)
- {
- t1.bitfield.reg8 = 1;
- t1.bitfield.reg16 = 1;
- t1.bitfield.reg32 = 1;
- t1.bitfield.reg64 = 1;
- }
-
- return (!(t0.bitfield.reg8 & t1.bitfield.reg8)
- && !(t0.bitfield.reg16 & t1.bitfield.reg16)
- && !(t0.bitfield.reg32 & t1.bitfield.reg32)
- && !(t0.bitfield.reg64 & t1.bitfield.reg64));
-}
-
-static INLINE unsigned int
-mode_from_disp_size (i386_operand_type t)
-{
- if (t.bitfield.disp8)
- return 1;
- else if (t.bitfield.disp16
- || t.bitfield.disp32
- || t.bitfield.disp32s)
- return 2;
- else
- return 0;
-}
-
-static INLINE int
-fits_in_signed_byte (offsetT num)
-{
- return (num >= -128) && (num <= 127);
-}
-
-static INLINE int
-fits_in_unsigned_byte (offsetT num)
-{
- return (num & 0xff) == num;
-}
-
-static INLINE int
-fits_in_unsigned_word (offsetT num)
-{
- return (num & 0xffff) == num;
-}
-
-static INLINE int
-fits_in_signed_word (offsetT num)
-{
- return (-32768 <= num) && (num <= 32767);
-}
-
-static INLINE int
-fits_in_signed_long (offsetT num ATTRIBUTE_UNUSED)
-{
-#ifndef BFD64
- return 1;
-#else
- return (!(((offsetT) -1 << 31) & num)
- || (((offsetT) -1 << 31) & num) == ((offsetT) -1 << 31));
-#endif
-} /* fits_in_signed_long() */
-
-static INLINE int
-fits_in_unsigned_long (offsetT num ATTRIBUTE_UNUSED)
-{
-#ifndef BFD64
- return 1;
-#else
- return (num & (((offsetT) 2 << 31) - 1)) == num;
-#endif
-} /* fits_in_unsigned_long() */
-
-static INLINE int
-fits_in_imm4 (offsetT num)
-{
- return (num & 0xf) == num;
-}
-
-static i386_operand_type
-smallest_imm_type (offsetT num)
-{
- i386_operand_type t;
-
- operand_type_set (&t, 0);
- t.bitfield.imm64 = 1;
-
- if (cpu_arch_tune != PROCESSOR_I486 && num == 1)
- {
- /* This code is disabled on the 486 because all the Imm1 forms
- in the opcode table are slower on the i486. They're the
- versions with the implicitly specified single-position
- displacement, which has another syntax if you really want to
- use that form. */
- t.bitfield.imm1 = 1;
- t.bitfield.imm8 = 1;
- t.bitfield.imm8s = 1;
- t.bitfield.imm16 = 1;
- t.bitfield.imm32 = 1;
- t.bitfield.imm32s = 1;
- }
- else if (fits_in_signed_byte (num))
- {
- t.bitfield.imm8 = 1;
- t.bitfield.imm8s = 1;
- t.bitfield.imm16 = 1;
- t.bitfield.imm32 = 1;
- t.bitfield.imm32s = 1;
- }
- else if (fits_in_unsigned_byte (num))
- {
- t.bitfield.imm8 = 1;
- t.bitfield.imm16 = 1;
- t.bitfield.imm32 = 1;
- t.bitfield.imm32s = 1;
- }
- else if (fits_in_signed_word (num) || fits_in_unsigned_word (num))
- {
- t.bitfield.imm16 = 1;
- t.bitfield.imm32 = 1;
- t.bitfield.imm32s = 1;
- }
- else if (fits_in_signed_long (num))
- {
- t.bitfield.imm32 = 1;
- t.bitfield.imm32s = 1;
- }
- else if (fits_in_unsigned_long (num))
- t.bitfield.imm32 = 1;
-
- return t;
-}
-
-static offsetT
-offset_in_range (offsetT val, int size)
-{
- addressT mask;
-
- switch (size)
- {
- case 1: mask = ((addressT) 1 << 8) - 1; break;
- case 2: mask = ((addressT) 1 << 16) - 1; break;
- case 4: mask = ((addressT) 2 << 31) - 1; break;
-#ifdef BFD64
- case 8: mask = ((addressT) 2 << 63) - 1; break;
-#endif
- default: abort ();
- }
-
- /* If BFD64, sign extend val. */
- if (!use_rela_relocations)
- if ((val & ~(((addressT) 2 << 31) - 1)) == 0)
- val = (val ^ ((addressT) 1 << 31)) - ((addressT) 1 << 31);
-
- if ((val & ~mask) != 0 && (val & ~mask) != ~mask)
- {
- char buf1[40], buf2[40];
-
- sprint_value (buf1, val);
- sprint_value (buf2, val & mask);
- as_warn (_("%s shortened to %s"), buf1, buf2);
- }
- return val & mask;
-}
-
-/* Returns 0 if attempting to add a prefix where one from the same
- class already exists, 1 if non rep/repne added, 2 if rep/repne
- added. */
-static int
-add_prefix (unsigned int prefix)
-{
- int ret = 1;
- unsigned int q;
-
- if (prefix >= REX_OPCODE && prefix < REX_OPCODE + 16
- && flag_code == CODE_64BIT)
- {
- if ((i.prefix[REX_PREFIX] & prefix & REX_W)
- || ((i.prefix[REX_PREFIX] & (REX_R | REX_X | REX_B))
- && (prefix & (REX_R | REX_X | REX_B))))
- ret = 0;
- q = REX_PREFIX;
- }
- else
- {
- switch (prefix)
- {
- default:
- abort ();
-
- case CS_PREFIX_OPCODE:
- case DS_PREFIX_OPCODE:
- case ES_PREFIX_OPCODE:
- case FS_PREFIX_OPCODE:
- case GS_PREFIX_OPCODE:
- case SS_PREFIX_OPCODE:
- q = SEG_PREFIX;
- break;
-
- case REPNE_PREFIX_OPCODE:
- case REPE_PREFIX_OPCODE:
- ret = 2;
- /* fall thru */
- case LOCK_PREFIX_OPCODE:
- q = LOCKREP_PREFIX;
- break;
-
- case FWAIT_OPCODE:
- q = WAIT_PREFIX;
- break;
-
- case ADDR_PREFIX_OPCODE:
- q = ADDR_PREFIX;
- break;
-
- case DATA_PREFIX_OPCODE:
- q = DATA_PREFIX;
- break;
- }
- if (i.prefix[q] != 0)
- ret = 0;
- }
-
- if (ret)
- {
- if (!i.prefix[q])
- ++i.prefixes;
- i.prefix[q] |= prefix;
- }
- else
- as_bad (_("same type of prefix used twice"));
-
- return ret;
-}
-
-static void
-set_code_flag (int value)
-{
- flag_code = value;
- if (flag_code == CODE_64BIT)
- {
- cpu_arch_flags.bitfield.cpu64 = 1;
- cpu_arch_flags.bitfield.cpuno64 = 0;
- }
- else
- {
- cpu_arch_flags.bitfield.cpu64 = 0;
- cpu_arch_flags.bitfield.cpuno64 = 1;
- }
- if (value == CODE_64BIT && !cpu_arch_flags.bitfield.cpulm )
- {
- as_bad (_("64bit mode not supported on this CPU."));
- }
- if (value == CODE_32BIT && !cpu_arch_flags.bitfield.cpui386)
- {
- as_bad (_("32bit mode not supported on this CPU."));
- }
- stackop_size = '\0';
-}
-
-static void
-set_16bit_gcc_code_flag (int new_code_flag)
-{
- flag_code = new_code_flag;
- if (flag_code != CODE_16BIT)
- abort ();
- cpu_arch_flags.bitfield.cpu64 = 0;
- cpu_arch_flags.bitfield.cpuno64 = 1;
- stackop_size = LONG_MNEM_SUFFIX;
-}
-
-static void
-set_intel_syntax (int syntax_flag)
-{
- /* Find out if register prefixing is specified. */
- int ask_naked_reg = 0;
-
- SKIP_WHITESPACE ();
- if (!is_end_of_line[(unsigned char) *input_line_pointer])
- {
- char *string = input_line_pointer;
- int e = get_symbol_end ();
-
- if (strcmp (string, "prefix") == 0)
- ask_naked_reg = 1;
- else if (strcmp (string, "noprefix") == 0)
- ask_naked_reg = -1;
- else
- as_bad (_("bad argument to syntax directive."));
- *input_line_pointer = e;
- }
- demand_empty_rest_of_line ();
-
- intel_syntax = syntax_flag;
-
- if (ask_naked_reg == 0)
- allow_naked_reg = (intel_syntax
- && (bfd_get_symbol_leading_char (stdoutput) != '\0'));
- else
- allow_naked_reg = (ask_naked_reg < 0);
-
- identifier_chars['%'] = intel_syntax && allow_naked_reg ? '%' : 0;
- identifier_chars['$'] = intel_syntax ? '$' : 0;
- register_prefix = allow_naked_reg ? "" : "%";
-}
-
-static void
-set_intel_mnemonic (int mnemonic_flag)
-{
- intel_mnemonic = mnemonic_flag;
-}
-
-static void
-set_allow_index_reg (int flag)
-{
- allow_index_reg = flag;
-}
-
-static void
-set_sse_check (int dummy ATTRIBUTE_UNUSED)
-{
- SKIP_WHITESPACE ();
-
- if (!is_end_of_line[(unsigned char) *input_line_pointer])
- {
- char *string = input_line_pointer;
- int e = get_symbol_end ();
-
- if (strcmp (string, "none") == 0)
- sse_check = sse_check_none;
- else if (strcmp (string, "warning") == 0)
- sse_check = sse_check_warning;
- else if (strcmp (string, "error") == 0)
- sse_check = sse_check_error;
- else
- as_bad (_("bad argument to sse_check directive."));
- *input_line_pointer = e;
- }
- else
- as_bad (_("missing argument for sse_check directive"));
-
- demand_empty_rest_of_line ();
-}
-
-static void
-set_cpu_arch (int dummy ATTRIBUTE_UNUSED)
-{
- SKIP_WHITESPACE ();
-
- if (!is_end_of_line[(unsigned char) *input_line_pointer])
- {
- char *string = input_line_pointer;
- int e = get_symbol_end ();
- unsigned int i;
- i386_cpu_flags flags;
-
- for (i = 0; i < ARRAY_SIZE (cpu_arch); i++)
- {
- if (strcmp (string, cpu_arch[i].name) == 0)
- {
- if (*string != '.')
- {
- cpu_arch_name = cpu_arch[i].name;
- cpu_sub_arch_name = NULL;
- cpu_arch_flags = cpu_arch[i].flags;
- if (flag_code == CODE_64BIT)
- {
- cpu_arch_flags.bitfield.cpu64 = 1;
- cpu_arch_flags.bitfield.cpuno64 = 0;
- }
- else
- {
- cpu_arch_flags.bitfield.cpu64 = 0;
- cpu_arch_flags.bitfield.cpuno64 = 1;
- }
- cpu_arch_isa = cpu_arch[i].type;
- cpu_arch_isa_flags = cpu_arch[i].flags;
- if (!cpu_arch_tune_set)
- {
- cpu_arch_tune = cpu_arch_isa;
- cpu_arch_tune_flags = cpu_arch_isa_flags;
- }
- break;
- }
-
- flags = cpu_flags_or (cpu_arch_flags,
- cpu_arch[i].flags);
- if (!cpu_flags_equal (&flags, &cpu_arch_flags))
- {
- if (cpu_sub_arch_name)
- {
- char *name = cpu_sub_arch_name;
- cpu_sub_arch_name = concat (name,
- cpu_arch[i].name,
- (const char *) NULL);
- free (name);
- }
- else
- cpu_sub_arch_name = xstrdup (cpu_arch[i].name);
- cpu_arch_flags = flags;
- }
- *input_line_pointer = e;
- demand_empty_rest_of_line ();
- return;
- }
- }
- if (i >= ARRAY_SIZE (cpu_arch))
- as_bad (_("no such architecture: `%s'"), string);
-
- *input_line_pointer = e;
- }
- else
- as_bad (_("missing cpu architecture"));
-
- no_cond_jump_promotion = 0;
- if (*input_line_pointer == ','
- && !is_end_of_line[(unsigned char) input_line_pointer[1]])
- {
- char *string = ++input_line_pointer;
- int e = get_symbol_end ();
-
- if (strcmp (string, "nojumps") == 0)
- no_cond_jump_promotion = 1;
- else if (strcmp (string, "jumps") == 0)
- ;
- else
- as_bad (_("no such architecture modifier: `%s'"), string);
-
- *input_line_pointer = e;
- }
-
- demand_empty_rest_of_line ();
-}
-
-unsigned long
-i386_mach ()
-{
- if (!strcmp (default_arch, "x86_64"))
- return bfd_mach_x86_64;
- else if (!strcmp (default_arch, "i386"))
- return bfd_mach_i386_i386;
- else
- as_fatal (_("Unknown architecture"));
-}
-
-void
-md_begin ()
-{
- const char *hash_err;
-
- /* Initialize op_hash hash table. */
- op_hash = hash_new ();
-
- {
- const template *optab;
- templates *core_optab;
-
- /* Setup for loop. */
- optab = i386_optab;
- core_optab = (templates *) xmalloc (sizeof (templates));
- core_optab->start = optab;
-
- while (1)
- {
- ++optab;
- if (optab->name == NULL
- || strcmp (optab->name, (optab - 1)->name) != 0)
- {
- /* different name --> ship out current template list;
- add to hash table; & begin anew. */
- core_optab->end = optab;
- hash_err = hash_insert (op_hash,
- (optab - 1)->name,
- (PTR) core_optab);
- if (hash_err)
- {
- as_fatal (_("Internal Error: Can't hash %s: %s"),
- (optab - 1)->name,
- hash_err);
- }
- if (optab->name == NULL)
- break;
- core_optab = (templates *) xmalloc (sizeof (templates));
- core_optab->start = optab;
- }
- }
- }
-
- /* Initialize reg_hash hash table. */
- reg_hash = hash_new ();
- {
- const reg_entry *regtab;
- unsigned int regtab_size = i386_regtab_size;
-
- for (regtab = i386_regtab; regtab_size--; regtab++)
- {
- hash_err = hash_insert (reg_hash, regtab->reg_name, (PTR) regtab);
- if (hash_err)
- as_fatal (_("Internal Error: Can't hash %s: %s"),
- regtab->reg_name,
- hash_err);
- }
- }
-
- /* Fill in lexical tables: mnemonic_chars, operand_chars. */
- {
- int c;
- char *p;
-
- for (c = 0; c < 256; c++)
- {
- if (ISDIGIT (c))
- {
- digit_chars[c] = c;
- mnemonic_chars[c] = c;
- register_chars[c] = c;
- operand_chars[c] = c;
- }
- else if (ISLOWER (c))
- {
- mnemonic_chars[c] = c;
- register_chars[c] = c;
- operand_chars[c] = c;
- }
- else if (ISUPPER (c))
- {
- mnemonic_chars[c] = TOLOWER (c);
- register_chars[c] = mnemonic_chars[c];
- operand_chars[c] = c;
- }
-
- if (ISALPHA (c) || ISDIGIT (c))
- identifier_chars[c] = c;
- else if (c >= 128)
- {
- identifier_chars[c] = c;
- operand_chars[c] = c;
- }
- }
-
-#ifdef LEX_AT
- identifier_chars['@'] = '@';
-#endif
-#ifdef LEX_QM
- identifier_chars['?'] = '?';
- operand_chars['?'] = '?';
-#endif
- digit_chars['-'] = '-';
- mnemonic_chars['_'] = '_';
- mnemonic_chars['-'] = '-';
- mnemonic_chars['.'] = '.';
- identifier_chars['_'] = '_';
- identifier_chars['.'] = '.';
-
- for (p = operand_special_chars; *p != '\0'; p++)
- operand_chars[(unsigned char) *p] = *p;
- }
-
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- if (IS_ELF)
- {
- record_alignment (text_section, 2);
- record_alignment (data_section, 2);
- record_alignment (bss_section, 2);
- }
-#endif
-
- if (flag_code == CODE_64BIT)
- {
- x86_dwarf2_return_column = 16;
- x86_cie_data_alignment = -8;
- }
- else
- {
- x86_dwarf2_return_column = 8;
- x86_cie_data_alignment = -4;
- }
-}
-
-void
-i386_print_statistics (FILE *file)
-{
- hash_print_statistics (file, "i386 opcode", op_hash);
- hash_print_statistics (file, "i386 register", reg_hash);
-}
-
-#ifdef DEBUG386
-
-/* Debugging routines for md_assemble. */
-static void pte (template *);
-static void pt (i386_operand_type);
-static void pe (expressionS *);
-static void ps (symbolS *);
-
-static void
-pi (char *line, i386_insn *x)
-{
- unsigned int i;
-
- fprintf (stdout, "%s: template ", line);
- pte (&x->tm);
- fprintf (stdout, " address: base %s index %s scale %x\n",
- x->base_reg ? x->base_reg->reg_name : "none",
- x->index_reg ? x->index_reg->reg_name : "none",
- x->log2_scale_factor);
- fprintf (stdout, " modrm: mode %x reg %x reg/mem %x\n",
- x->rm.mode, x->rm.reg, x->rm.regmem);
- fprintf (stdout, " sib: base %x index %x scale %x\n",
- x->sib.base, x->sib.index, x->sib.scale);
- fprintf (stdout, " rex: 64bit %x extX %x extY %x extZ %x\n",
- (x->rex & REX_W) != 0,
- (x->rex & REX_R) != 0,
- (x->rex & REX_X) != 0,
- (x->rex & REX_B) != 0);
- fprintf (stdout, " drex: reg %d rex 0x%x\n",
- x->drex.reg, x->drex.rex);
- for (i = 0; i < x->operands; i++)
- {
- fprintf (stdout, " #%d: ", i + 1);
- pt (x->types[i]);
- fprintf (stdout, "\n");
- if (x->types[i].bitfield.reg8
- || x->types[i].bitfield.reg16
- || x->types[i].bitfield.reg32
- || x->types[i].bitfield.reg64
- || x->types[i].bitfield.regmmx
- || x->types[i].bitfield.regxmm
- || x->types[i].bitfield.regymm
- || x->types[i].bitfield.sreg2
- || x->types[i].bitfield.sreg3
- || x->types[i].bitfield.control
- || x->types[i].bitfield.debug
- || x->types[i].bitfield.test)
- fprintf (stdout, "%s\n", x->op[i].regs->reg_name);
- if (operand_type_check (x->types[i], imm))
- pe (x->op[i].imms);
- if (operand_type_check (x->types[i], disp))
- pe (x->op[i].disps);
- }
-}
-
-static void
-pte (template *t)
-{
- unsigned int i;
- fprintf (stdout, " %d operands ", t->operands);
- fprintf (stdout, "opcode %x ", t->base_opcode);
- if (t->extension_opcode != None)
- fprintf (stdout, "ext %x ", t->extension_opcode);
- if (t->opcode_modifier.d)
- fprintf (stdout, "D");
- if (t->opcode_modifier.w)
- fprintf (stdout, "W");
- fprintf (stdout, "\n");
- for (i = 0; i < t->operands; i++)
- {
- fprintf (stdout, " #%d type ", i + 1);
- pt (t->operand_types[i]);
- fprintf (stdout, "\n");
- }
-}
-
-static void
-pe (expressionS *e)
-{
- fprintf (stdout, " operation %d\n", e->X_op);
- fprintf (stdout, " add_number %ld (%lx)\n",
- (long) e->X_add_number, (long) e->X_add_number);
- if (e->X_add_symbol)
- {
- fprintf (stdout, " add_symbol ");
- ps (e->X_add_symbol);
- fprintf (stdout, "\n");
- }
- if (e->X_op_symbol)
- {
- fprintf (stdout, " op_symbol ");
- ps (e->X_op_symbol);
- fprintf (stdout, "\n");
- }
-}
-
-static void
-ps (symbolS *s)
-{
- fprintf (stdout, "%s type %s%s",
- S_GET_NAME (s),
- S_IS_EXTERNAL (s) ? "EXTERNAL " : "",
- segment_name (S_GET_SEGMENT (s)));
-}
-
-static struct type_name
- {
- i386_operand_type mask;
- const char *name;
- }
-const type_names[] =
-{
- { OPERAND_TYPE_REG8, "r8" },
- { OPERAND_TYPE_REG16, "r16" },
- { OPERAND_TYPE_REG32, "r32" },
- { OPERAND_TYPE_REG64, "r64" },
- { OPERAND_TYPE_IMM8, "i8" },
- { OPERAND_TYPE_IMM8, "i8s" },
- { OPERAND_TYPE_IMM16, "i16" },
- { OPERAND_TYPE_IMM32, "i32" },
- { OPERAND_TYPE_IMM32S, "i32s" },
- { OPERAND_TYPE_IMM64, "i64" },
- { OPERAND_TYPE_IMM1, "i1" },
- { OPERAND_TYPE_BASEINDEX, "BaseIndex" },
- { OPERAND_TYPE_DISP8, "d8" },
- { OPERAND_TYPE_DISP16, "d16" },
- { OPERAND_TYPE_DISP32, "d32" },
- { OPERAND_TYPE_DISP32S, "d32s" },
- { OPERAND_TYPE_DISP64, "d64" },
- { OPERAND_TYPE_INOUTPORTREG, "InOutPortReg" },
- { OPERAND_TYPE_SHIFTCOUNT, "ShiftCount" },
- { OPERAND_TYPE_CONTROL, "control reg" },
- { OPERAND_TYPE_TEST, "test reg" },
- { OPERAND_TYPE_DEBUG, "debug reg" },
- { OPERAND_TYPE_FLOATREG, "FReg" },
- { OPERAND_TYPE_FLOATACC, "FAcc" },
- { OPERAND_TYPE_SREG2, "SReg2" },
- { OPERAND_TYPE_SREG3, "SReg3" },
- { OPERAND_TYPE_ACC, "Acc" },
- { OPERAND_TYPE_JUMPABSOLUTE, "Jump Absolute" },
- { OPERAND_TYPE_REGMMX, "rMMX" },
- { OPERAND_TYPE_REGXMM, "rXMM" },
- { OPERAND_TYPE_ESSEG, "es" },
- { OPERAND_TYPE_VEX_IMM4, "VEX i4" },
-};
-
-static void
-pt (i386_operand_type t)
-{
- unsigned int j;
- i386_operand_type a;
-
- for (j = 0; j < ARRAY_SIZE (type_names); j++)
- {
- a = operand_type_and (t, type_names[j].mask);
- if (!UINTS_ALL_ZERO (a))
- fprintf (stdout, "%s, ", type_names[j].name);
- }
- fflush (stdout);
-}
-
-#endif /* DEBUG386 */
-
-static bfd_reloc_code_real_type
-reloc (unsigned int size,
- int pcrel,
- int sign,
- bfd_reloc_code_real_type other)
-{
- if (other != NO_RELOC)
- {
- reloc_howto_type *reloc;
-
- if (size == 8)
- switch (other)
- {
- case BFD_RELOC_X86_64_GOT32:
- return BFD_RELOC_X86_64_GOT64;
- break;
- case BFD_RELOC_X86_64_PLTOFF64:
- return BFD_RELOC_X86_64_PLTOFF64;
- break;
- case BFD_RELOC_X86_64_GOTPC32:
- other = BFD_RELOC_X86_64_GOTPC64;
- break;
- case BFD_RELOC_X86_64_GOTPCREL:
- other = BFD_RELOC_X86_64_GOTPCREL64;
- break;
- case BFD_RELOC_X86_64_TPOFF32:
- other = BFD_RELOC_X86_64_TPOFF64;
- break;
- case BFD_RELOC_X86_64_DTPOFF32:
- other = BFD_RELOC_X86_64_DTPOFF64;
- break;
- default:
- break;
- }
-
- /* Sign-checking 4-byte relocations in 16-/32-bit code is pointless. */
- if (size == 4 && flag_code != CODE_64BIT)
- sign = -1;
-
- reloc = bfd_reloc_type_lookup (stdoutput, other);
- if (!reloc)
- as_bad (_("unknown relocation (%u)"), other);
- else if (size != bfd_get_reloc_size (reloc))
- as_bad (_("%u-byte relocation cannot be applied to %u-byte field"),
- bfd_get_reloc_size (reloc),
- size);
- else if (pcrel && !reloc->pc_relative)
- as_bad (_("non-pc-relative relocation for pc-relative field"));
- else if ((reloc->complain_on_overflow == complain_overflow_signed
- && !sign)
- || (reloc->complain_on_overflow == complain_overflow_unsigned
- && sign > 0))
- as_bad (_("relocated field and relocation type differ in signedness"));
- else
- return other;
- return NO_RELOC;
- }
-
- if (pcrel)
- {
- if (!sign)
- as_bad (_("there are no unsigned pc-relative relocations"));
- switch (size)
- {
- case 1: return BFD_RELOC_8_PCREL;
- case 2: return BFD_RELOC_16_PCREL;
- case 4: return BFD_RELOC_32_PCREL;
- case 8: return BFD_RELOC_64_PCREL;
- }
- as_bad (_("cannot do %u byte pc-relative relocation"), size);
- }
- else
- {
- if (sign > 0)
- switch (size)
- {
- case 4: return BFD_RELOC_X86_64_32S;
- }
- else
- switch (size)
- {
- case 1: return BFD_RELOC_8;
- case 2: return BFD_RELOC_16;
- case 4: return BFD_RELOC_32;
- case 8: return BFD_RELOC_64;
- }
- as_bad (_("cannot do %s %u byte relocation"),
- sign > 0 ? "signed" : "unsigned", size);
- }
-
- abort ();
- return BFD_RELOC_NONE;
-}
-
-/* Here we decide which fixups can be adjusted to make them relative to
- the beginning of the section instead of the symbol. Basically we need
- to make sure that the dynamic relocations are done correctly, so in
- some cases we force the original symbol to be used. */
-
-int
-tc_i386_fix_adjustable (fixS *fixP ATTRIBUTE_UNUSED)
-{
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- if (!IS_ELF)
- return 1;
-
- /* Don't adjust pc-relative references to merge sections in 64-bit
- mode. */
- if (use_rela_relocations
- && (S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_MERGE) != 0
- && fixP->fx_pcrel)
- return 0;
-
- /* The x86_64 GOTPCREL are represented as 32bit PCrel relocations
- and changed later by validate_fix. */
- if (GOT_symbol && fixP->fx_subsy == GOT_symbol
- && fixP->fx_r_type == BFD_RELOC_32_PCREL)
- return 0;
-
- /* adjust_reloc_syms doesn't know about the GOT. */
- if (fixP->fx_r_type == BFD_RELOC_386_GOTOFF
- || fixP->fx_r_type == BFD_RELOC_386_PLT32
- || fixP->fx_r_type == BFD_RELOC_386_GOT32
- || fixP->fx_r_type == BFD_RELOC_386_TLS_GD
- || fixP->fx_r_type == BFD_RELOC_386_TLS_LDM
- || fixP->fx_r_type == BFD_RELOC_386_TLS_LDO_32
- || fixP->fx_r_type == BFD_RELOC_386_TLS_IE_32
- || fixP->fx_r_type == BFD_RELOC_386_TLS_IE
- || fixP->fx_r_type == BFD_RELOC_386_TLS_GOTIE
- || fixP->fx_r_type == BFD_RELOC_386_TLS_LE_32
- || fixP->fx_r_type == BFD_RELOC_386_TLS_LE
- || fixP->fx_r_type == BFD_RELOC_386_TLS_GOTDESC
- || fixP->fx_r_type == BFD_RELOC_386_TLS_DESC_CALL
- || fixP->fx_r_type == BFD_RELOC_X86_64_PLT32
- || fixP->fx_r_type == BFD_RELOC_X86_64_GOT32
- || fixP->fx_r_type == BFD_RELOC_X86_64_GOTPCREL
- || fixP->fx_r_type == BFD_RELOC_X86_64_TLSGD
- || fixP->fx_r_type == BFD_RELOC_X86_64_TLSLD
- || fixP->fx_r_type == BFD_RELOC_X86_64_DTPOFF32
- || fixP->fx_r_type == BFD_RELOC_X86_64_DTPOFF64
- || fixP->fx_r_type == BFD_RELOC_X86_64_GOTTPOFF
- || fixP->fx_r_type == BFD_RELOC_X86_64_TPOFF32
- || fixP->fx_r_type == BFD_RELOC_X86_64_TPOFF64
- || fixP->fx_r_type == BFD_RELOC_X86_64_GOTOFF64
- || fixP->fx_r_type == BFD_RELOC_X86_64_GOTPC32_TLSDESC
- || fixP->fx_r_type == BFD_RELOC_X86_64_TLSDESC_CALL
- || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
- || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
- return 0;
-#endif
- return 1;
-}
-
-static int
-intel_float_operand (const char *mnemonic)
-{
- /* Note that the value returned is meaningful only for opcodes with (memory)
- operands, hence the code here is free to improperly handle opcodes that
- have no operands (for better performance and smaller code). */
-
- if (mnemonic[0] != 'f')
- return 0; /* non-math */
-
- switch (mnemonic[1])
- {
- /* fclex, fdecstp, fdisi, femms, feni, fincstp, finit, fsetpm, and
- the fs segment override prefix not currently handled because no
- call path can make opcodes without operands get here */
- case 'i':
- return 2 /* integer op */;
- case 'l':
- if (mnemonic[2] == 'd' && (mnemonic[3] == 'c' || mnemonic[3] == 'e'))
- return 3; /* fldcw/fldenv */
- break;
- case 'n':
- if (mnemonic[2] != 'o' /* fnop */)
- return 3; /* non-waiting control op */
- break;
- case 'r':
- if (mnemonic[2] == 's')
- return 3; /* frstor/frstpm */
- break;
- case 's':
- if (mnemonic[2] == 'a')
- return 3; /* fsave */
- if (mnemonic[2] == 't')
- {
- switch (mnemonic[3])
- {
- case 'c': /* fstcw */
- case 'd': /* fstdw */
- case 'e': /* fstenv */
- case 's': /* fsts[gw] */
- return 3;
- }
- }
- break;
- case 'x':
- if (mnemonic[2] == 'r' || mnemonic[2] == 's')
- return 0; /* fxsave/fxrstor are not really math ops */
- break;
- }
-
- return 1;
-}
-
-/* Build the VEX prefix. */
-
-static void
-build_vex_prefix (void)
-{
- unsigned int register_specifier;
- unsigned int implied_prefix;
- unsigned int vector_length;
-
- /* Check register specifier. */
- if (i.vex.register_specifier)
- {
- register_specifier = i.vex.register_specifier->reg_num;
- if ((i.vex.register_specifier->reg_flags & RegRex))
- register_specifier += 8;
- register_specifier = ~register_specifier & 0xf;
- }
- else
- register_specifier = 0xf;
-
- vector_length = i.tm.opcode_modifier.vex256 ? 1 : 0;
-
- switch ((i.tm.base_opcode >> 8) & 0xff)
- {
- case 0:
- implied_prefix = 0;
- break;
- case DATA_PREFIX_OPCODE:
- implied_prefix = 1;
- break;
- case REPE_PREFIX_OPCODE:
- implied_prefix = 2;
- break;
- case REPNE_PREFIX_OPCODE:
- implied_prefix = 3;
- break;
- default:
- abort ();
- }
-
- /* Use 2-byte VEX prefix if possible. */
- if (i.tm.opcode_modifier.vex0f
- && (i.rex & (REX_W | REX_X | REX_B)) == 0)
- {
- /* 2-byte VEX prefix. */
- unsigned int r;
-
- i.vex.length = 2;
- i.vex.bytes[0] = 0xc5;
-
- /* Check the REX.R bit. */
- r = (i.rex & REX_R) ? 0 : 1;
- i.vex.bytes[1] = (r << 7
- | register_specifier << 3
- | vector_length << 2
- | implied_prefix);
- }
- else
- {
- /* 3-byte VEX prefix. */
- unsigned int m, w;
-
- if (i.tm.opcode_modifier.vex0f)
- m = 0x1;
- else if (i.tm.opcode_modifier.vex0f38)
- m = 0x2;
- else if (i.tm.opcode_modifier.vex0f3a)
- m = 0x3;
- else
- abort ();
-
- i.vex.length = 3;
- i.vex.bytes[0] = 0xc4;
-
- /* The high 3 bits of the second VEX byte are 1's compliment
- of RXB bits from REX. */
- i.vex.bytes[1] = (~i.rex & 0x7) << 5 | m;
-
- /* Check the REX.W bit. */
- w = (i.rex & REX_W) ? 1 : 0;
- if (i.tm.opcode_modifier.vexw0 || i.tm.opcode_modifier.vexw1)
- {
- if (w)
- abort ();
-
- if (i.tm.opcode_modifier.vexw1)
- w = 1;
- }
-
- i.vex.bytes[2] = (w << 7
- | register_specifier << 3
- | vector_length << 2
- | implied_prefix);
- }
-}
-
-static void
-process_immext (void)
-{
- expressionS *exp;
-
- if (i.tm.cpu_flags.bitfield.cpusse3 && i.operands > 0)
- {
- /* SSE3 Instructions have the fixed operands with an opcode
- suffix which is coded in the same place as an 8-bit immediate
- field would be. Here we check those operands and remove them
- afterwards. */
- unsigned int x;
-
- for (x = 0; x < i.operands; x++)
- if (i.op[x].regs->reg_num != x)
- as_bad (_("can't use register '%s%s' as operand %d in '%s'."),
- register_prefix, i.op[x].regs->reg_name, x + 1,
- i.tm.name);
-
- i.operands = 0;
- }
-
- /* These AMD 3DNow! and SSE2 instructions have an opcode suffix
- which is coded in the same place as an 8-bit immediate field
- would be. Here we fake an 8-bit immediate operand from the
- opcode suffix stored in tm.extension_opcode.
-
- SSE5 and AVX instructions also use this encoding, for some of
- 3 argument instructions. */
-
- assert (i.imm_operands == 0
- && (i.operands <= 2
- || (i.tm.cpu_flags.bitfield.cpusse5
- && i.operands <= 3)
- || (i.tm.opcode_modifier.vex
- && i.operands <= 4)));
-
- exp = &im_expressions[i.imm_operands++];
- i.op[i.operands].imms = exp;
- i.types[i.operands] = imm8;
- i.operands++;
- exp->X_op = O_constant;
- exp->X_add_number = i.tm.extension_opcode;
- i.tm.extension_opcode = None;
-}
-
-/* This is the guts of the machine-dependent assembler. LINE points to a
- machine dependent instruction. This function is supposed to emit
- the frags/bytes it assembles to. */
-
-void
-md_assemble (char *line)
-{
- unsigned int j;
- char mnemonic[MAX_MNEM_SIZE];
-
- /* Initialize globals. */
- memset (&i, '\0', sizeof (i));
- for (j = 0; j < MAX_OPERANDS; j++)
- i.reloc[j] = NO_RELOC;
- memset (disp_expressions, '\0', sizeof (disp_expressions));
- memset (im_expressions, '\0', sizeof (im_expressions));
- save_stack_p = save_stack;
-
- /* First parse an instruction mnemonic & call i386_operand for the operands.
- We assume that the scrubber has arranged it so that line[0] is the valid
- start of a (possibly prefixed) mnemonic. */
-
- line = parse_insn (line, mnemonic);
- if (line == NULL)
- return;
-
- line = parse_operands (line, mnemonic);
- if (line == NULL)
- return;
-
- /* Now we've parsed the mnemonic into a set of templates, and have the
- operands at hand. */
-
- /* All intel opcodes have reversed operands except for "bound" and
- "enter". We also don't reverse intersegment "jmp" and "call"
- instructions with 2 immediate operands so that the immediate segment
- precedes the offset, as it does when in AT&T mode. */
- if (intel_syntax
- && i.operands > 1
- && (strcmp (mnemonic, "bound") != 0)
- && (strcmp (mnemonic, "invlpga") != 0)
- && !(operand_type_check (i.types[0], imm)
- && operand_type_check (i.types[1], imm)))
- swap_operands ();
-
- /* The order of the immediates should be reversed
- for 2 immediates extrq and insertq instructions */
- if (i.imm_operands == 2
- && (strcmp (mnemonic, "extrq") == 0
- || strcmp (mnemonic, "insertq") == 0))
- swap_2_operands (0, 1);
-
- if (i.imm_operands)
- optimize_imm ();
-
- /* Don't optimize displacement for movabs since it only takes 64bit
- displacement. */
- if (i.disp_operands
- && (flag_code != CODE_64BIT
- || strcmp (mnemonic, "movabs") != 0))
- optimize_disp ();
-
- /* Next, we find a template that matches the given insn,
- making sure the overlap of the given operands types is consistent
- with the template operand types. */
-
- if (!match_template ())
- return;
-
- if (sse_check != sse_check_none
- && !i.tm.opcode_modifier.noavx
- && (i.tm.cpu_flags.bitfield.cpusse
- || i.tm.cpu_flags.bitfield.cpusse2
- || i.tm.cpu_flags.bitfield.cpusse3
- || i.tm.cpu_flags.bitfield.cpussse3
- || i.tm.cpu_flags.bitfield.cpusse4_1
- || i.tm.cpu_flags.bitfield.cpusse4_2))
- {
- (sse_check == sse_check_warning
- ? as_warn
- : as_bad) (_("SSE instruction `%s' is used"), i.tm.name);
- }
-
- /* Zap movzx and movsx suffix. The suffix has been set from
- "word ptr" or "byte ptr" on the source operand in Intel syntax
- or extracted from mnemonic in AT&T syntax. But we'll use
- the destination register to choose the suffix for encoding. */
- if ((i.tm.base_opcode & ~9) == 0x0fb6)
- {
- /* In Intel syntax, there must be a suffix. In AT&T syntax, if
- there is no suffix, the default will be byte extension. */
- if (i.reg_operands != 2
- && !i.suffix
- && intel_syntax)
- as_bad (_("ambiguous operand size for `%s'"), i.tm.name);
-
- i.suffix = 0;
- }
-
- if (i.tm.opcode_modifier.fwait)
- if (!add_prefix (FWAIT_OPCODE))
- return;
-
- /* Check string instruction segment overrides. */
- if (i.tm.opcode_modifier.isstring && i.mem_operands != 0)
- {
- if (!check_string ())
- return;
- }
-
- if (!process_suffix ())
- return;
-
- /* Make still unresolved immediate matches conform to size of immediate
- given in i.suffix. */
- if (!finalize_imm ())
- return;
-
- if (i.types[0].bitfield.imm1)
- i.imm_operands = 0; /* kludge for shift insns. */
-
- for (j = 0; j < 3; j++)
- if (i.types[j].bitfield.inoutportreg
- || i.types[j].bitfield.shiftcount
- || i.types[j].bitfield.acc
- || i.types[j].bitfield.floatacc)
- i.reg_operands--;
-
- /* ImmExt should be processed after SSE2AVX. */
- if (!i.tm.opcode_modifier.sse2avx
- && i.tm.opcode_modifier.immext)
- process_immext ();
-
- /* For insns with operands there are more diddles to do to the opcode. */
- if (i.operands)
- {
- if (!process_operands ())
- return;
- }
- else if (!quiet_warnings && i.tm.opcode_modifier.ugh)
- {
- /* UnixWare fsub no args is alias for fsubp, fadd -> faddp, etc. */
- as_warn (_("translating to `%sp'"), i.tm.name);
- }
-
- if (i.tm.opcode_modifier.vex)
- build_vex_prefix ();
-
- /* Handle conversion of 'int $3' --> special int3 insn. */
- if (i.tm.base_opcode == INT_OPCODE && i.op[0].imms->X_add_number == 3)
- {
- i.tm.base_opcode = INT3_OPCODE;
- i.imm_operands = 0;
- }
-
- if ((i.tm.opcode_modifier.jump
- || i.tm.opcode_modifier.jumpbyte
- || i.tm.opcode_modifier.jumpdword)
- && i.op[0].disps->X_op == O_constant)
- {
- /* Convert "jmp constant" (and "call constant") to a jump (call) to
- the absolute address given by the constant. Since ix86 jumps and
- calls are pc relative, we need to generate a reloc. */
- i.op[0].disps->X_add_symbol = &abs_symbol;
- i.op[0].disps->X_op = O_symbol;
- }
-
- if (i.tm.opcode_modifier.rex64)
- i.rex |= REX_W;
-
- /* For 8 bit registers we need an empty rex prefix. Also if the
- instruction already has a prefix, we need to convert old
- registers to new ones. */
-
- if ((i.types[0].bitfield.reg8
- && (i.op[0].regs->reg_flags & RegRex64) != 0)
- || (i.types[1].bitfield.reg8
- && (i.op[1].regs->reg_flags & RegRex64) != 0)
- || ((i.types[0].bitfield.reg8
- || i.types[1].bitfield.reg8)
- && i.rex != 0))
- {
- int x;
-
- i.rex |= REX_OPCODE;
- for (x = 0; x < 2; x++)
- {
- /* Look for 8 bit operand that uses old registers. */
- if (i.types[x].bitfield.reg8
- && (i.op[x].regs->reg_flags & RegRex64) == 0)
- {
- /* In case it is "hi" register, give up. */
- if (i.op[x].regs->reg_num > 3)
- as_bad (_("can't encode register '%s%s' in an "
- "instruction requiring REX prefix."),
- register_prefix, i.op[x].regs->reg_name);
-
- /* Otherwise it is equivalent to the extended register.
- Since the encoding doesn't change this is merely
- cosmetic cleanup for debug output. */
-
- i.op[x].regs = i.op[x].regs + 8;
- }
- }
- }
-
- /* If the instruction has the DREX attribute (aka SSE5), don't emit a
- REX prefix. */
- if (i.tm.opcode_modifier.drex || i.tm.opcode_modifier.drexc)
- {
- i.drex.rex = i.rex;
- i.rex = 0;
- }
- else if (i.rex != 0)
- add_prefix (REX_OPCODE | i.rex);
-
- /* We are ready to output the insn. */
- output_insn ();
-}
-
-static char *
-parse_insn (char *line, char *mnemonic)
-{
- char *l = line;
- char *token_start = l;
- char *mnem_p;
- int supported;
- const template *t;
-
- /* Non-zero if we found a prefix only acceptable with string insns. */
- const char *expecting_string_instruction = NULL;
-
- while (1)
- {
- mnem_p = mnemonic;
- while ((*mnem_p = mnemonic_chars[(unsigned char) *l]) != 0)
- {
- mnem_p++;
- if (mnem_p >= mnemonic + MAX_MNEM_SIZE)
- {
- as_bad (_("no such instruction: `%s'"), token_start);
- return NULL;
- }
- l++;
- }
- if (!is_space_char (*l)
- && *l != END_OF_INSN
- && (intel_syntax
- || (*l != PREFIX_SEPARATOR
- && *l != ',')))
- {
- as_bad (_("invalid character %s in mnemonic"),
- output_invalid (*l));
- return NULL;
- }
- if (token_start == l)
- {
- if (!intel_syntax && *l == PREFIX_SEPARATOR)
- as_bad (_("expecting prefix; got nothing"));
- else
- as_bad (_("expecting mnemonic; got nothing"));
- return NULL;
- }
-
- /* Look up instruction (or prefix) via hash table. */
- current_templates = hash_find (op_hash, mnemonic);
-
- if (*l != END_OF_INSN
- && (!is_space_char (*l) || l[1] != END_OF_INSN)
- && current_templates
- && current_templates->start->opcode_modifier.isprefix)
- {
- if (!cpu_flags_check_cpu64 (current_templates->start->cpu_flags))
- {
- as_bad ((flag_code != CODE_64BIT
- ? _("`%s' is only supported in 64-bit mode")
- : _("`%s' is not supported in 64-bit mode")),
- current_templates->start->name);
- return NULL;
- }
- /* If we are in 16-bit mode, do not allow addr16 or data16.
- Similarly, in 32-bit mode, do not allow addr32 or data32. */
- if ((current_templates->start->opcode_modifier.size16
- || current_templates->start->opcode_modifier.size32)
- && flag_code != CODE_64BIT
- && (current_templates->start->opcode_modifier.size32
- ^ (flag_code == CODE_16BIT)))
- {
- as_bad (_("redundant %s prefix"),
- current_templates->start->name);
- return NULL;
- }
- /* Add prefix, checking for repeated prefixes. */
- switch (add_prefix (current_templates->start->base_opcode))
- {
- case 0:
- return NULL;
- case 2:
- expecting_string_instruction = current_templates->start->name;
- break;
- }
- /* Skip past PREFIX_SEPARATOR and reset token_start. */
- token_start = ++l;
- }
- else
- break;
- }
-
- if (!current_templates)
- {
- /* See if we can get a match by trimming off a suffix. */
- switch (mnem_p[-1])
- {
- case WORD_MNEM_SUFFIX:
- if (intel_syntax && (intel_float_operand (mnemonic) & 2))
- i.suffix = SHORT_MNEM_SUFFIX;
- else
- case BYTE_MNEM_SUFFIX:
- case QWORD_MNEM_SUFFIX:
- i.suffix = mnem_p[-1];
- mnem_p[-1] = '\0';
- current_templates = hash_find (op_hash, mnemonic);
- break;
- case SHORT_MNEM_SUFFIX:
- case LONG_MNEM_SUFFIX:
- if (!intel_syntax)
- {
- i.suffix = mnem_p[-1];
- mnem_p[-1] = '\0';
- current_templates = hash_find (op_hash, mnemonic);
- }
- break;
-
- /* Intel Syntax. */
- case 'd':
- if (intel_syntax)
- {
- if (intel_float_operand (mnemonic) == 1)
- i.suffix = SHORT_MNEM_SUFFIX;
- else
- i.suffix = LONG_MNEM_SUFFIX;
- mnem_p[-1] = '\0';
- current_templates = hash_find (op_hash, mnemonic);
- }
- break;
- }
- if (!current_templates)
- {
- as_bad (_("no such instruction: `%s'"), token_start);
- return NULL;
- }
- }
-
- if (current_templates->start->opcode_modifier.jump
- || current_templates->start->opcode_modifier.jumpbyte)
- {
- /* Check for a branch hint. We allow ",pt" and ",pn" for
- predict taken and predict not taken respectively.
- I'm not sure that branch hints actually do anything on loop
- and jcxz insns (JumpByte) for current Pentium4 chips. They
- may work in the future and it doesn't hurt to accept them
- now. */
- if (l[0] == ',' && l[1] == 'p')
- {
- if (l[2] == 't')
- {
- if (!add_prefix (DS_PREFIX_OPCODE))
- return NULL;
- l += 3;
- }
- else if (l[2] == 'n')
- {
- if (!add_prefix (CS_PREFIX_OPCODE))
- return NULL;
- l += 3;
- }
- }
- }
- /* Any other comma loses. */
- if (*l == ',')
- {
- as_bad (_("invalid character %s in mnemonic"),
- output_invalid (*l));
- return NULL;
- }
-
- /* Check if instruction is supported on specified architecture. */
- supported = 0;
- for (t = current_templates->start; t < current_templates->end; ++t)
- {
- supported |= cpu_flags_match (t);
- if (supported == CPU_FLAGS_PERFECT_MATCH)
- goto skip;
- }
-
- if (!(supported & CPU_FLAGS_64BIT_MATCH))
- {
- as_bad (flag_code == CODE_64BIT
- ? _("`%s' is not supported in 64-bit mode")
- : _("`%s' is only supported in 64-bit mode"),
- current_templates->start->name);
- return NULL;
- }
- if (supported != CPU_FLAGS_PERFECT_MATCH)
- {
- as_bad (_("`%s' is not supported on `%s%s'"),
- current_templates->start->name, cpu_arch_name,
- cpu_sub_arch_name ? cpu_sub_arch_name : "");
- return NULL;
- }
-
-skip:
- if (!cpu_arch_flags.bitfield.cpui386
- && (flag_code != CODE_16BIT))
- {
- as_warn (_("use .code16 to ensure correct addressing mode"));
- }
-
- /* Check for rep/repne without a string instruction. */
- if (expecting_string_instruction)
- {
- static templates override;
-
- for (t = current_templates->start; t < current_templates->end; ++t)
- if (t->opcode_modifier.isstring)
- break;
- if (t >= current_templates->end)
- {
- as_bad (_("expecting string instruction after `%s'"),
- expecting_string_instruction);
- return NULL;
- }
- for (override.start = t; t < current_templates->end; ++t)
- if (!t->opcode_modifier.isstring)
- break;
- override.end = t;
- current_templates = &override;
- }
-
- return l;
-}
-
-static char *
-parse_operands (char *l, const char *mnemonic)
-{
- char *token_start;
-
- /* 1 if operand is pending after ','. */
- unsigned int expecting_operand = 0;
-
- /* Non-zero if operand parens not balanced. */
- unsigned int paren_not_balanced;
-
- while (*l != END_OF_INSN)
- {
- /* Skip optional white space before operand. */
- if (is_space_char (*l))
- ++l;
- if (!is_operand_char (*l) && *l != END_OF_INSN)
- {
- as_bad (_("invalid character %s before operand %d"),
- output_invalid (*l),
- i.operands + 1);
- return NULL;
- }
- token_start = l; /* after white space */
- paren_not_balanced = 0;
- while (paren_not_balanced || *l != ',')
- {
- if (*l == END_OF_INSN)
- {
- if (paren_not_balanced)
- {
- if (!intel_syntax)
- as_bad (_("unbalanced parenthesis in operand %d."),
- i.operands + 1);
- else
- as_bad (_("unbalanced brackets in operand %d."),
- i.operands + 1);
- return NULL;
- }
- else
- break; /* we are done */
- }
- else if (!is_operand_char (*l) && !is_space_char (*l))
- {
- as_bad (_("invalid character %s in operand %d"),
- output_invalid (*l),
- i.operands + 1);
- return NULL;
- }
- if (!intel_syntax)
- {
- if (*l == '(')
- ++paren_not_balanced;
- if (*l == ')')
- --paren_not_balanced;
- }
- else
- {
- if (*l == '[')
- ++paren_not_balanced;
- if (*l == ']')
- --paren_not_balanced;
- }
- l++;
- }
- if (l != token_start)
- { /* Yes, we've read in another operand. */
- unsigned int operand_ok;
- this_operand = i.operands++;
- i.types[this_operand].bitfield.unspecified = 1;
- if (i.operands > MAX_OPERANDS)
- {
- as_bad (_("spurious operands; (%d operands/instruction max)"),
- MAX_OPERANDS);
- return NULL;
- }
- /* Now parse operand adding info to 'i' as we go along. */
- END_STRING_AND_SAVE (l);
-
- if (intel_syntax)
- operand_ok =
- i386_intel_operand (token_start,
- intel_float_operand (mnemonic));
- else
- operand_ok = i386_att_operand (token_start);
-
- RESTORE_END_STRING (l);
- if (!operand_ok)
- return NULL;
- }
- else
- {
- if (expecting_operand)
- {
- expecting_operand_after_comma:
- as_bad (_("expecting operand after ','; got nothing"));
- return NULL;
- }
- if (*l == ',')
- {
- as_bad (_("expecting operand before ','; got nothing"));
- return NULL;
- }
- }
-
- /* Now *l must be either ',' or END_OF_INSN. */
- if (*l == ',')
- {
- if (*++l == END_OF_INSN)
- {
- /* Just skip it, if it's \n complain. */
- goto expecting_operand_after_comma;
- }
- expecting_operand = 1;
- }
- }
- return l;
-}
-
-static void
-swap_2_operands (int xchg1, int xchg2)
-{
- union i386_op temp_op;
- i386_operand_type temp_type;
- enum bfd_reloc_code_real temp_reloc;
-
- temp_type = i.types[xchg2];
- i.types[xchg2] = i.types[xchg1];
- i.types[xchg1] = temp_type;
- temp_op = i.op[xchg2];
- i.op[xchg2] = i.op[xchg1];
- i.op[xchg1] = temp_op;
- temp_reloc = i.reloc[xchg2];
- i.reloc[xchg2] = i.reloc[xchg1];
- i.reloc[xchg1] = temp_reloc;
-}
-
-static void
-swap_operands (void)
-{
- switch (i.operands)
- {
- case 5:
- case 4:
- swap_2_operands (1, i.operands - 2);
- case 3:
- case 2:
- swap_2_operands (0, i.operands - 1);
- break;
- default:
- abort ();
- }
-
- if (i.mem_operands == 2)
- {
- const seg_entry *temp_seg;
- temp_seg = i.seg[0];
- i.seg[0] = i.seg[1];
- i.seg[1] = temp_seg;
- }
-}
-
-/* Try to ensure constant immediates are represented in the smallest
- opcode possible. */
-static void
-optimize_imm (void)
-{
- char guess_suffix = 0;
- int op;
-
- if (i.suffix)
- guess_suffix = i.suffix;
- else if (i.reg_operands)
- {
- /* Figure out a suffix from the last register operand specified.
- We can't do this properly yet, ie. excluding InOutPortReg,
- but the following works for instructions with immediates.
- In any case, we can't set i.suffix yet. */
- for (op = i.operands; --op >= 0;)
- if (i.types[op].bitfield.reg8)
- {
- guess_suffix = BYTE_MNEM_SUFFIX;
- break;
- }
- else if (i.types[op].bitfield.reg16)
- {
- guess_suffix = WORD_MNEM_SUFFIX;
- break;
- }
- else if (i.types[op].bitfield.reg32)
- {
- guess_suffix = LONG_MNEM_SUFFIX;
- break;
- }
- else if (i.types[op].bitfield.reg64)
- {
- guess_suffix = QWORD_MNEM_SUFFIX;
- break;
- }
- }
- else if ((flag_code == CODE_16BIT) ^ (i.prefix[DATA_PREFIX] != 0))
- guess_suffix = WORD_MNEM_SUFFIX;
-
- for (op = i.operands; --op >= 0;)
- if (operand_type_check (i.types[op], imm))
- {
- switch (i.op[op].imms->X_op)
- {
- case O_constant:
- /* If a suffix is given, this operand may be shortened. */
- switch (guess_suffix)
- {
- case LONG_MNEM_SUFFIX:
- i.types[op].bitfield.imm32 = 1;
- i.types[op].bitfield.imm64 = 1;
- break;
- case WORD_MNEM_SUFFIX:
- i.types[op].bitfield.imm16 = 1;
- i.types[op].bitfield.imm32 = 1;
- i.types[op].bitfield.imm32s = 1;
- i.types[op].bitfield.imm64 = 1;
- break;
- case BYTE_MNEM_SUFFIX:
- i.types[op].bitfield.imm8 = 1;
- i.types[op].bitfield.imm8s = 1;
- i.types[op].bitfield.imm16 = 1;
- i.types[op].bitfield.imm32 = 1;
- i.types[op].bitfield.imm32s = 1;
- i.types[op].bitfield.imm64 = 1;
- break;
- }
-
- /* If this operand is at most 16 bits, convert it
- to a signed 16 bit number before trying to see
- whether it will fit in an even smaller size.
- This allows a 16-bit operand such as $0xffe0 to
- be recognised as within Imm8S range. */
- if ((i.types[op].bitfield.imm16)
- && (i.op[op].imms->X_add_number & ~(offsetT) 0xffff) == 0)
- {
- i.op[op].imms->X_add_number =
- (((i.op[op].imms->X_add_number & 0xffff) ^ 0x8000) - 0x8000);
- }
- if ((i.types[op].bitfield.imm32)
- && ((i.op[op].imms->X_add_number & ~(((offsetT) 2 << 31) - 1))
- == 0))
- {
- i.op[op].imms->X_add_number = ((i.op[op].imms->X_add_number
- ^ ((offsetT) 1 << 31))
- - ((offsetT) 1 << 31));
- }
- i.types[op]
- = operand_type_or (i.types[op],
- smallest_imm_type (i.op[op].imms->X_add_number));
-
- /* We must avoid matching of Imm32 templates when 64bit
- only immediate is available. */
- if (guess_suffix == QWORD_MNEM_SUFFIX)
- i.types[op].bitfield.imm32 = 0;
- break;
-
- case O_absent:
- case O_register:
- abort ();
-
- /* Symbols and expressions. */
- default:
- /* Convert symbolic operand to proper sizes for matching, but don't
- prevent matching a set of insns that only supports sizes other
- than those matching the insn suffix. */
- {
- i386_operand_type mask, allowed;
- const template *t;
-
- operand_type_set (&mask, 0);
- operand_type_set (&allowed, 0);
-
- for (t = current_templates->start;
- t < current_templates->end;
- ++t)
- allowed = operand_type_or (allowed,
- t->operand_types[op]);
- switch (guess_suffix)
- {
- case QWORD_MNEM_SUFFIX:
- mask.bitfield.imm64 = 1;
- mask.bitfield.imm32s = 1;
- break;
- case LONG_MNEM_SUFFIX:
- mask.bitfield.imm32 = 1;
- break;
- case WORD_MNEM_SUFFIX:
- mask.bitfield.imm16 = 1;
- break;
- case BYTE_MNEM_SUFFIX:
- mask.bitfield.imm8 = 1;
- break;
- default:
- break;
- }
- allowed = operand_type_and (mask, allowed);
- if (!operand_type_all_zero (&allowed))
- i.types[op] = operand_type_and (i.types[op], mask);
- }
- break;
- }
- }
-}
-
-/* Try to use the smallest displacement type too. */
-static void
-optimize_disp (void)
-{
- int op;
-
- for (op = i.operands; --op >= 0;)
- if (operand_type_check (i.types[op], disp))
- {
- if (i.op[op].disps->X_op == O_constant)
- {
- offsetT disp = i.op[op].disps->X_add_number;
-
- if (i.types[op].bitfield.disp16
- && (disp & ~(offsetT) 0xffff) == 0)
- {
- /* If this operand is at most 16 bits, convert
- to a signed 16 bit number and don't use 64bit
- displacement. */
- disp = (((disp & 0xffff) ^ 0x8000) - 0x8000);
- i.types[op].bitfield.disp64 = 0;
- }
- if (i.types[op].bitfield.disp32
- && (disp & ~(((offsetT) 2 << 31) - 1)) == 0)
- {
- /* If this operand is at most 32 bits, convert
- to a signed 32 bit number and don't use 64bit
- displacement. */
- disp &= (((offsetT) 2 << 31) - 1);
- disp = (disp ^ ((offsetT) 1 << 31)) - ((addressT) 1 << 31);
- i.types[op].bitfield.disp64 = 0;
- }
- if (!disp && i.types[op].bitfield.baseindex)
- {
- i.types[op].bitfield.disp8 = 0;
- i.types[op].bitfield.disp16 = 0;
- i.types[op].bitfield.disp32 = 0;
- i.types[op].bitfield.disp32s = 0;
- i.types[op].bitfield.disp64 = 0;
- i.op[op].disps = 0;
- i.disp_operands--;
- }
- else if (flag_code == CODE_64BIT)
- {
- if (fits_in_signed_long (disp))
- {
- i.types[op].bitfield.disp64 = 0;
- i.types[op].bitfield.disp32s = 1;
- }
- if (fits_in_unsigned_long (disp))
- i.types[op].bitfield.disp32 = 1;
- }
- if ((i.types[op].bitfield.disp32
- || i.types[op].bitfield.disp32s
- || i.types[op].bitfield.disp16)
- && fits_in_signed_byte (disp))
- i.types[op].bitfield.disp8 = 1;
- }
- else if (i.reloc[op] == BFD_RELOC_386_TLS_DESC_CALL
- || i.reloc[op] == BFD_RELOC_X86_64_TLSDESC_CALL)
- {
- fix_new_exp (frag_now, frag_more (0) - frag_now->fr_literal, 0,
- i.op[op].disps, 0, i.reloc[op]);
- i.types[op].bitfield.disp8 = 0;
- i.types[op].bitfield.disp16 = 0;
- i.types[op].bitfield.disp32 = 0;
- i.types[op].bitfield.disp32s = 0;
- i.types[op].bitfield.disp64 = 0;
- }
- else
- /* We only support 64bit displacement on constants. */
- i.types[op].bitfield.disp64 = 0;
- }
-}
-
-/* Check if operands are valid for the instrucrtion. Update VEX
- operand types. */
-
-static int
-VEX_check_operands (const template *t)
-{
- if (!t->opcode_modifier.vex)
- return 0;
-
- /* Only check VEX_Imm4, which must be the first operand. */
- if (t->operand_types[0].bitfield.vex_imm4)
- {
- if (i.op[0].imms->X_op != O_constant
- || !fits_in_imm4 (i.op[0].imms->X_add_number))
- return 1;
-
- /* Turn off Imm8 so that update_imm won't complain. */
- i.types[0] = vex_imm4;
- }
-
- return 0;
-}
-
-static int
-match_template (void)
-{
- /* Points to template once we've found it. */
- const template *t;
- i386_operand_type overlap0, overlap1, overlap2, overlap3;
- i386_operand_type overlap4;
- unsigned int found_reverse_match;
- i386_opcode_modifier suffix_check;
- i386_operand_type operand_types [MAX_OPERANDS];
- int addr_prefix_disp;
- unsigned int j;
- unsigned int found_cpu_match;
- unsigned int check_register;
-
-#if MAX_OPERANDS != 5
-# error "MAX_OPERANDS must be 5."
-#endif
-
- found_reverse_match = 0;
- addr_prefix_disp = -1;
-
- memset (&suffix_check, 0, sizeof (suffix_check));
- if (i.suffix == BYTE_MNEM_SUFFIX)
- suffix_check.no_bsuf = 1;
- else if (i.suffix == WORD_MNEM_SUFFIX)
- suffix_check.no_wsuf = 1;
- else if (i.suffix == SHORT_MNEM_SUFFIX)
- suffix_check.no_ssuf = 1;
- else if (i.suffix == LONG_MNEM_SUFFIX)
- suffix_check.no_lsuf = 1;
- else if (i.suffix == QWORD_MNEM_SUFFIX)
- suffix_check.no_qsuf = 1;
- else if (i.suffix == LONG_DOUBLE_MNEM_SUFFIX)
- suffix_check.no_ldsuf = 1;
-
- for (t = current_templates->start; t < current_templates->end; t++)
- {
- addr_prefix_disp = -1;
-
- /* Must have right number of operands. */
- if (i.operands != t->operands)
- continue;
-
- /* Check processor support. */
- found_cpu_match = (cpu_flags_match (t)
- == CPU_FLAGS_PERFECT_MATCH);
- if (!found_cpu_match)
- continue;
-
- /* Check old gcc support. */
- if (!old_gcc && t->opcode_modifier.oldgcc)
- continue;
-
- /* Check AT&T mnemonic. */
- if (intel_mnemonic && t->opcode_modifier.attmnemonic)
- continue;
-
- /* Check AT&T syntax Intel syntax. */
- if ((intel_syntax && t->opcode_modifier.attsyntax)
- || (!intel_syntax && t->opcode_modifier.intelsyntax))
- continue;
-
- /* Check the suffix, except for some instructions in intel mode. */
- if ((!intel_syntax || !t->opcode_modifier.ignoresize)
- && ((t->opcode_modifier.no_bsuf && suffix_check.no_bsuf)
- || (t->opcode_modifier.no_wsuf && suffix_check.no_wsuf)
- || (t->opcode_modifier.no_lsuf && suffix_check.no_lsuf)
- || (t->opcode_modifier.no_ssuf && suffix_check.no_ssuf)
- || (t->opcode_modifier.no_qsuf && suffix_check.no_qsuf)
- || (t->opcode_modifier.no_ldsuf && suffix_check.no_ldsuf)))
- continue;
-
- if (!operand_size_match (t))
- continue;
-
- for (j = 0; j < MAX_OPERANDS; j++)
- operand_types[j] = t->operand_types[j];
-
- /* In general, don't allow 64-bit operands in 32-bit mode. */
- if (i.suffix == QWORD_MNEM_SUFFIX
- && flag_code != CODE_64BIT
- && (intel_syntax
- ? (!t->opcode_modifier.ignoresize
- && !intel_float_operand (t->name))
- : intel_float_operand (t->name) != 2)
- && ((!operand_types[0].bitfield.regmmx
- && !operand_types[0].bitfield.regxmm
- && !operand_types[0].bitfield.regymm)
- || (!operand_types[t->operands > 1].bitfield.regmmx
- && !!operand_types[t->operands > 1].bitfield.regxmm
- && !!operand_types[t->operands > 1].bitfield.regymm))
- && (t->base_opcode != 0x0fc7
- || t->extension_opcode != 1 /* cmpxchg8b */))
- continue;
-
- /* In general, don't allow 32-bit operands on pre-386. */
- else if (i.suffix == LONG_MNEM_SUFFIX
- && !cpu_arch_flags.bitfield.cpui386
- && (intel_syntax
- ? (!t->opcode_modifier.ignoresize
- && !intel_float_operand (t->name))
- : intel_float_operand (t->name) != 2)
- && ((!operand_types[0].bitfield.regmmx
- && !operand_types[0].bitfield.regxmm)
- || (!operand_types[t->operands > 1].bitfield.regmmx
- && !!operand_types[t->operands > 1].bitfield.regxmm)))
- continue;
-
- /* Do not verify operands when there are none. */
- else
- {
- if (!t->operands)
- /* We've found a match; break out of loop. */
- break;
- }
-
- /* Address size prefix will turn Disp64/Disp32/Disp16 operand
- into Disp32/Disp16/Disp32 operand. */
- if (i.prefix[ADDR_PREFIX] != 0)
- {
- /* There should be only one Disp operand. */
- switch (flag_code)
- {
- case CODE_16BIT:
- for (j = 0; j < MAX_OPERANDS; j++)
- {
- if (operand_types[j].bitfield.disp16)
- {
- addr_prefix_disp = j;
- operand_types[j].bitfield.disp32 = 1;
- operand_types[j].bitfield.disp16 = 0;
- break;
- }
- }
- break;
- case CODE_32BIT:
- for (j = 0; j < MAX_OPERANDS; j++)
- {
- if (operand_types[j].bitfield.disp32)
- {
- addr_prefix_disp = j;
- operand_types[j].bitfield.disp32 = 0;
- operand_types[j].bitfield.disp16 = 1;
- break;
- }
- }
- break;
- case CODE_64BIT:
- for (j = 0; j < MAX_OPERANDS; j++)
- {
- if (operand_types[j].bitfield.disp64)
- {
- addr_prefix_disp = j;
- operand_types[j].bitfield.disp64 = 0;
- operand_types[j].bitfield.disp32 = 1;
- break;
- }
- }
- break;
- }
- }
-
- /* We check register size only if size of operands can be
- encoded the canonical way. */
- check_register = t->opcode_modifier.w;
- overlap0 = operand_type_and (i.types[0], operand_types[0]);
- switch (t->operands)
- {
- case 1:
- if (!operand_type_match (overlap0, i.types[0]))
- continue;
- break;
- case 2:
- /* xchg %eax, %eax is a special case. It is an aliase for nop
- only in 32bit mode and we can use opcode 0x90. In 64bit
- mode, we can't use 0x90 for xchg %eax, %eax since it should
- zero-extend %eax to %rax. */
- if (flag_code == CODE_64BIT
- && t->base_opcode == 0x90
- && operand_type_equal (&i.types [0], &acc32)
- && operand_type_equal (&i.types [1], &acc32))
- continue;
- case 3:
- case 4:
- case 5:
- overlap1 = operand_type_and (i.types[1], operand_types[1]);
- if (!operand_type_match (overlap0, i.types[0])
- || !operand_type_match (overlap1, i.types[1])
- || (check_register
- && !operand_type_register_match (overlap0, i.types[0],
- operand_types[0],
- overlap1, i.types[1],
- operand_types[1])))
- {
- /* Check if other direction is valid ... */
- if (!t->opcode_modifier.d && !t->opcode_modifier.floatd)
- continue;
-
- /* Try reversing direction of operands. */
- overlap0 = operand_type_and (i.types[0], operand_types[1]);
- overlap1 = operand_type_and (i.types[1], operand_types[0]);
- if (!operand_type_match (overlap0, i.types[0])
- || !operand_type_match (overlap1, i.types[1])
- || (check_register
- && !operand_type_register_match (overlap0,
- i.types[0],
- operand_types[1],
- overlap1,
- i.types[1],
- operand_types[0])))
- {
- /* Does not match either direction. */
- continue;
- }
- /* found_reverse_match holds which of D or FloatDR
- we've found. */
- if (t->opcode_modifier.d)
- found_reverse_match = Opcode_D;
- else if (t->opcode_modifier.floatd)
- found_reverse_match = Opcode_FloatD;
- else
- found_reverse_match = 0;
- if (t->opcode_modifier.floatr)
- found_reverse_match |= Opcode_FloatR;
- }
- else
- {
- /* Found a forward 2 operand match here. */
- switch (t->operands)
- {
- case 5:
- overlap4 = operand_type_and (i.types[4],
- operand_types[4]);
- case 4:
- overlap3 = operand_type_and (i.types[3],
- operand_types[3]);
- case 3:
- overlap2 = operand_type_and (i.types[2],
- operand_types[2]);
- break;
- }
-
- switch (t->operands)
- {
- case 5:
- if (!operand_type_match (overlap4, i.types[4])
- || !operand_type_register_match (overlap3,
- i.types[3],
- operand_types[3],
- overlap4,
- i.types[4],
- operand_types[4]))
- continue;
- case 4:
- if (!operand_type_match (overlap3, i.types[3])
- || (check_register
- && !operand_type_register_match (overlap2,
- i.types[2],
- operand_types[2],
- overlap3,
- i.types[3],
- operand_types[3])))
- continue;
- case 3:
- /* Here we make use of the fact that there are no
- reverse match 3 operand instructions, and all 3
- operand instructions only need to be checked for
- register consistency between operands 2 and 3. */
- if (!operand_type_match (overlap2, i.types[2])
- || (check_register
- && !operand_type_register_match (overlap1,
- i.types[1],
- operand_types[1],
- overlap2,
- i.types[2],
- operand_types[2])))
- continue;
- break;
- }
- }
- /* Found either forward/reverse 2, 3 or 4 operand match here:
- slip through to break. */
- }
- if (!found_cpu_match)
- {
- found_reverse_match = 0;
- continue;
- }
-
- /* Check if VEX operands are valid. */
- if (VEX_check_operands (t))
- continue;
-
- /* We've found a match; break out of loop. */
- break;
- }
-
- if (t == current_templates->end)
- {
- /* We found no match. */
- if (intel_syntax)
- as_bad (_("ambiguous operand size or operands invalid for `%s'"),
- current_templates->start->name);
- else
- as_bad (_("suffix or operands invalid for `%s'"),
- current_templates->start->name);
- return 0;
- }
-
- if (!quiet_warnings)
- {
- if (!intel_syntax
- && (i.types[0].bitfield.jumpabsolute
- != operand_types[0].bitfield.jumpabsolute))
- {
- as_warn (_("indirect %s without `*'"), t->name);
- }
-
- if (t->opcode_modifier.isprefix
- && t->opcode_modifier.ignoresize)
- {
- /* Warn them that a data or address size prefix doesn't
- affect assembly of the next line of code. */
- as_warn (_("stand-alone `%s' prefix"), t->name);
- }
- }
-
- /* Copy the template we found. */
- i.tm = *t;
-
- if (addr_prefix_disp != -1)
- i.tm.operand_types[addr_prefix_disp]
- = operand_types[addr_prefix_disp];
-
- if (found_reverse_match)
- {
- /* If we found a reverse match we must alter the opcode
- direction bit. found_reverse_match holds bits to change
- (different for int & float insns). */
-
- i.tm.base_opcode ^= found_reverse_match;
-
- i.tm.operand_types[0] = operand_types[1];
- i.tm.operand_types[1] = operand_types[0];
- }
-
- return 1;
-}
-
-static int
-check_string (void)
-{
- int mem_op = operand_type_check (i.types[0], anymem) ? 0 : 1;
- if (i.tm.operand_types[mem_op].bitfield.esseg)
- {
- if (i.seg[0] != NULL && i.seg[0] != &es)
- {
- as_bad (_("`%s' operand %d must use `%%es' segment"),
- i.tm.name,
- mem_op + 1);
- return 0;
- }
- /* There's only ever one segment override allowed per instruction.
- This instruction possibly has a legal segment override on the
- second operand, so copy the segment to where non-string
- instructions store it, allowing common code. */
- i.seg[0] = i.seg[1];
- }
- else if (i.tm.operand_types[mem_op + 1].bitfield.esseg)
- {
- if (i.seg[1] != NULL && i.seg[1] != &es)
- {
- as_bad (_("`%s' operand %d must use `%%es' segment"),
- i.tm.name,
- mem_op + 2);
- return 0;
- }
- }
- return 1;
-}
-
-static int
-process_suffix (void)
-{
- /* If matched instruction specifies an explicit instruction mnemonic
- suffix, use it. */
- if (i.tm.opcode_modifier.size16)
- i.suffix = WORD_MNEM_SUFFIX;
- else if (i.tm.opcode_modifier.size32)
- i.suffix = LONG_MNEM_SUFFIX;
- else if (i.tm.opcode_modifier.size64)
- i.suffix = QWORD_MNEM_SUFFIX;
- else if (i.reg_operands)
- {
- /* If there's no instruction mnemonic suffix we try to invent one
- based on register operands. */
- if (!i.suffix)
- {
- /* We take i.suffix from the last register operand specified,
- Destination register type is more significant than source
- register type. crc32 in SSE4.2 prefers source register
- type. */
- if (i.tm.base_opcode == 0xf20f38f1)
- {
- if (i.types[0].bitfield.reg16)
- i.suffix = WORD_MNEM_SUFFIX;
- else if (i.types[0].bitfield.reg32)
- i.suffix = LONG_MNEM_SUFFIX;
- else if (i.types[0].bitfield.reg64)
- i.suffix = QWORD_MNEM_SUFFIX;
- }
- else if (i.tm.base_opcode == 0xf20f38f0)
- {
- if (i.types[0].bitfield.reg8)
- i.suffix = BYTE_MNEM_SUFFIX;
- }
-
- if (!i.suffix)
- {
- int op;
-
- if (i.tm.base_opcode == 0xf20f38f1
- || i.tm.base_opcode == 0xf20f38f0)
- {
- /* We have to know the operand size for crc32. */
- as_bad (_("ambiguous memory operand size for `%s`"),
- i.tm.name);
- return 0;
- }
-
- for (op = i.operands; --op >= 0;)
- if (!i.tm.operand_types[op].bitfield.inoutportreg)
- {
- if (i.types[op].bitfield.reg8)
- {
- i.suffix = BYTE_MNEM_SUFFIX;
- break;
- }
- else if (i.types[op].bitfield.reg16)
- {
- i.suffix = WORD_MNEM_SUFFIX;
- break;
- }
- else if (i.types[op].bitfield.reg32)
- {
- i.suffix = LONG_MNEM_SUFFIX;
- break;
- }
- else if (i.types[op].bitfield.reg64)
- {
- i.suffix = QWORD_MNEM_SUFFIX;
- break;
- }
- }
- }
- }
- else if (i.suffix == BYTE_MNEM_SUFFIX)
- {
- if (!check_byte_reg ())
- return 0;
- }
- else if (i.suffix == LONG_MNEM_SUFFIX)
- {
- if (!check_long_reg ())
- return 0;
- }
- else if (i.suffix == QWORD_MNEM_SUFFIX)
- {
- if (intel_syntax
- && i.tm.opcode_modifier.ignoresize
- && i.tm.opcode_modifier.no_qsuf)
- i.suffix = 0;
- else if (!check_qword_reg ())
- return 0;
- }
- else if (i.suffix == WORD_MNEM_SUFFIX)
- {
- if (!check_word_reg ())
- return 0;
- }
- else if (i.suffix == XMMWORD_MNEM_SUFFIX
- || i.suffix == YMMWORD_MNEM_SUFFIX)
- {
- /* Skip if the instruction has x/y suffix. match_template
- should check if it is a valid suffix. */
- }
- else if (intel_syntax && i.tm.opcode_modifier.ignoresize)
- /* Do nothing if the instruction is going to ignore the prefix. */
- ;
- else
- abort ();
- }
- else if (i.tm.opcode_modifier.defaultsize
- && !i.suffix
- /* exclude fldenv/frstor/fsave/fstenv */
- && i.tm.opcode_modifier.no_ssuf)
- {
- i.suffix = stackop_size;
- }
- else if (intel_syntax
- && !i.suffix
- && (i.tm.operand_types[0].bitfield.jumpabsolute
- || i.tm.opcode_modifier.jumpbyte
- || i.tm.opcode_modifier.jumpintersegment
- || (i.tm.base_opcode == 0x0f01 /* [ls][gi]dt */
- && i.tm.extension_opcode <= 3)))
- {
- switch (flag_code)
- {
- case CODE_64BIT:
- if (!i.tm.opcode_modifier.no_qsuf)
- {
- i.suffix = QWORD_MNEM_SUFFIX;
- break;
- }
- case CODE_32BIT:
- if (!i.tm.opcode_modifier.no_lsuf)
- i.suffix = LONG_MNEM_SUFFIX;
- break;
- case CODE_16BIT:
- if (!i.tm.opcode_modifier.no_wsuf)
- i.suffix = WORD_MNEM_SUFFIX;
- break;
- }
- }
-
- if (!i.suffix)
- {
- if (!intel_syntax)
- {
- if (i.tm.opcode_modifier.w)
- {
- as_bad (_("no instruction mnemonic suffix given and "
- "no register operands; can't size instruction"));
- return 0;
- }
- }
- else
- {
- unsigned int suffixes;
-
- suffixes = !i.tm.opcode_modifier.no_bsuf;
- if (!i.tm.opcode_modifier.no_wsuf)
- suffixes |= 1 << 1;
- if (!i.tm.opcode_modifier.no_lsuf)
- suffixes |= 1 << 2;
- if (!i.tm.opcode_modifier.no_ldsuf)
- suffixes |= 1 << 3;
- if (!i.tm.opcode_modifier.no_ssuf)
- suffixes |= 1 << 4;
- if (!i.tm.opcode_modifier.no_qsuf)
- suffixes |= 1 << 5;
-
- /* There are more than suffix matches. */
- if (i.tm.opcode_modifier.w
- || ((suffixes & (suffixes - 1))
- && !i.tm.opcode_modifier.defaultsize
- && !i.tm.opcode_modifier.ignoresize))
- {
- as_bad (_("ambiguous operand size for `%s'"), i.tm.name);
- return 0;
- }
- }
- }
-
- /* Change the opcode based on the operand size given by i.suffix;
- We don't need to change things for byte insns. */
-
- if (i.suffix
- && i.suffix != BYTE_MNEM_SUFFIX
- && i.suffix != XMMWORD_MNEM_SUFFIX
- && i.suffix != YMMWORD_MNEM_SUFFIX)
- {
- /* It's not a byte, select word/dword operation. */
- if (i.tm.opcode_modifier.w)
- {
- if (i.tm.opcode_modifier.shortform)
- i.tm.base_opcode |= 8;
- else
- i.tm.base_opcode |= 1;
- }
-
- /* Now select between word & dword operations via the operand
- size prefix, except for instructions that will ignore this
- prefix anyway. */
- if (i.tm.opcode_modifier.addrprefixop0)
- {
- /* The address size override prefix changes the size of the
- first operand. */
- if ((flag_code == CODE_32BIT
- && i.op->regs[0].reg_type.bitfield.reg16)
- || (flag_code != CODE_32BIT
- && i.op->regs[0].reg_type.bitfield.reg32))
- if (!add_prefix (ADDR_PREFIX_OPCODE))
- return 0;
- }
- else if (i.suffix != QWORD_MNEM_SUFFIX
- && i.suffix != LONG_DOUBLE_MNEM_SUFFIX
- && !i.tm.opcode_modifier.ignoresize
- && !i.tm.opcode_modifier.floatmf
- && ((i.suffix == LONG_MNEM_SUFFIX) == (flag_code == CODE_16BIT)
- || (flag_code == CODE_64BIT
- && i.tm.opcode_modifier.jumpbyte)))
- {
- unsigned int prefix = DATA_PREFIX_OPCODE;
-
- if (i.tm.opcode_modifier.jumpbyte) /* jcxz, loop */
- prefix = ADDR_PREFIX_OPCODE;
-
- if (!add_prefix (prefix))
- return 0;
- }
-
- /* Set mode64 for an operand. */
- if (i.suffix == QWORD_MNEM_SUFFIX
- && flag_code == CODE_64BIT
- && !i.tm.opcode_modifier.norex64)
- {
- /* Special case for xchg %rax,%rax. It is NOP and doesn't
- need rex64. cmpxchg8b is also a special case. */
- if (! (i.operands == 2
- && i.tm.base_opcode == 0x90
- && i.tm.extension_opcode == None
- && operand_type_equal (&i.types [0], &acc64)
- && operand_type_equal (&i.types [1], &acc64))
- && ! (i.operands == 1
- && i.tm.base_opcode == 0xfc7
- && i.tm.extension_opcode == 1
- && !operand_type_check (i.types [0], reg)
- && operand_type_check (i.types [0], anymem)))
- i.rex |= REX_W;
- }
-
- /* Size floating point instruction. */
- if (i.suffix == LONG_MNEM_SUFFIX)
- if (i.tm.opcode_modifier.floatmf)
- i.tm.base_opcode ^= 4;
- }
-
- return 1;
-}
-
-static int
-check_byte_reg (void)
-{
- int op;
-
- for (op = i.operands; --op >= 0;)
- {
- /* If this is an eight bit register, it's OK. If it's the 16 or
- 32 bit version of an eight bit register, we will just use the
- low portion, and that's OK too. */
- if (i.types[op].bitfield.reg8)
- continue;
-
- /* Don't generate this warning if not needed. */
- if (intel_syntax && i.tm.opcode_modifier.byteokintel)
- continue;
-
- /* crc32 doesn't generate this warning. */
- if (i.tm.base_opcode == 0xf20f38f0)
- continue;
-
- if ((i.types[op].bitfield.reg16
- || i.types[op].bitfield.reg32
- || i.types[op].bitfield.reg64)
- && i.op[op].regs->reg_num < 4)
- {
- /* Prohibit these changes in the 64bit mode, since the
- lowering is more complicated. */
- if (flag_code == CODE_64BIT
- && !i.tm.operand_types[op].bitfield.inoutportreg)
- {
- as_bad (_("Incorrect register `%s%s' used with `%c' suffix"),
- register_prefix, i.op[op].regs->reg_name,
- i.suffix);
- return 0;
- }
-#if REGISTER_WARNINGS
- if (!quiet_warnings
- && !i.tm.operand_types[op].bitfield.inoutportreg)
- as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"),
- register_prefix,
- (i.op[op].regs + (i.types[op].bitfield.reg16
- ? REGNAM_AL - REGNAM_AX
- : REGNAM_AL - REGNAM_EAX))->reg_name,
- register_prefix,
- i.op[op].regs->reg_name,
- i.suffix);
-#endif
- continue;
- }
- /* Any other register is bad. */
- if (i.types[op].bitfield.reg16
- || i.types[op].bitfield.reg32
- || i.types[op].bitfield.reg64
- || i.types[op].bitfield.regmmx
- || i.types[op].bitfield.regxmm
- || i.types[op].bitfield.regymm
- || i.types[op].bitfield.sreg2
- || i.types[op].bitfield.sreg3
- || i.types[op].bitfield.control
- || i.types[op].bitfield.debug
- || i.types[op].bitfield.test
- || i.types[op].bitfield.floatreg
- || i.types[op].bitfield.floatacc)
- {
- as_bad (_("`%s%s' not allowed with `%s%c'"),
- register_prefix,
- i.op[op].regs->reg_name,
- i.tm.name,
- i.suffix);
- return 0;
- }
- }
- return 1;
-}
-
-static int
-check_long_reg (void)
-{
- int op;
-
- for (op = i.operands; --op >= 0;)
- /* Reject eight bit registers, except where the template requires
- them. (eg. movzb) */
- if (i.types[op].bitfield.reg8
- && (i.tm.operand_types[op].bitfield.reg16
- || i.tm.operand_types[op].bitfield.reg32
- || i.tm.operand_types[op].bitfield.acc))
- {
- as_bad (_("`%s%s' not allowed with `%s%c'"),
- register_prefix,
- i.op[op].regs->reg_name,
- i.tm.name,
- i.suffix);
- return 0;
- }
- /* Warn if the e prefix on a general reg is missing. */
- else if ((!quiet_warnings || flag_code == CODE_64BIT)
- && i.types[op].bitfield.reg16
- && (i.tm.operand_types[op].bitfield.reg32
- || i.tm.operand_types[op].bitfield.acc))
- {
- /* Prohibit these changes in the 64bit mode, since the
- lowering is more complicated. */
- if (flag_code == CODE_64BIT)
- {
- as_bad (_("Incorrect register `%s%s' used with `%c' suffix"),
- register_prefix, i.op[op].regs->reg_name,
- i.suffix);
- return 0;
- }
-#if REGISTER_WARNINGS
- else
- as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"),
- register_prefix,
- (i.op[op].regs + REGNAM_EAX - REGNAM_AX)->reg_name,
- register_prefix,
- i.op[op].regs->reg_name,
- i.suffix);
-#endif
- }
- /* Warn if the r prefix on a general reg is missing. */
- else if (i.types[op].bitfield.reg64
- && (i.tm.operand_types[op].bitfield.reg32
- || i.tm.operand_types[op].bitfield.acc))
- {
- if (intel_syntax
- && i.tm.opcode_modifier.toqword
- && !i.types[0].bitfield.regxmm)
- {
- /* Convert to QWORD. We want REX byte. */
- i.suffix = QWORD_MNEM_SUFFIX;
- }
- else
- {
- as_bad (_("Incorrect register `%s%s' used with `%c' suffix"),
- register_prefix, i.op[op].regs->reg_name,
- i.suffix);
- return 0;
- }
- }
- return 1;
-}
-
-static int
-check_qword_reg (void)
-{
- int op;
-
- for (op = i.operands; --op >= 0; )
- /* Reject eight bit registers, except where the template requires
- them. (eg. movzb) */
- if (i.types[op].bitfield.reg8
- && (i.tm.operand_types[op].bitfield.reg16
- || i.tm.operand_types[op].bitfield.reg32
- || i.tm.operand_types[op].bitfield.acc))
- {
- as_bad (_("`%s%s' not allowed with `%s%c'"),
- register_prefix,
- i.op[op].regs->reg_name,
- i.tm.name,
- i.suffix);
- return 0;
- }
- /* Warn if the e prefix on a general reg is missing. */
- else if ((i.types[op].bitfield.reg16
- || i.types[op].bitfield.reg32)
- && (i.tm.operand_types[op].bitfield.reg32
- || i.tm.operand_types[op].bitfield.acc))
- {
- /* Prohibit these changes in the 64bit mode, since the
- lowering is more complicated. */
- if (intel_syntax
- && i.tm.opcode_modifier.todword
- && !i.types[0].bitfield.regxmm)
- {
- /* Convert to DWORD. We don't want REX byte. */
- i.suffix = LONG_MNEM_SUFFIX;
- }
- else
- {
- as_bad (_("Incorrect register `%s%s' used with `%c' suffix"),
- register_prefix, i.op[op].regs->reg_name,
- i.suffix);
- return 0;
- }
- }
- return 1;
-}
-
-static int
-check_word_reg (void)
-{
- int op;
- for (op = i.operands; --op >= 0;)
- /* Reject eight bit registers, except where the template requires
- them. (eg. movzb) */
- if (i.types[op].bitfield.reg8
- && (i.tm.operand_types[op].bitfield.reg16
- || i.tm.operand_types[op].bitfield.reg32
- || i.tm.operand_types[op].bitfield.acc))
- {
- as_bad (_("`%s%s' not allowed with `%s%c'"),
- register_prefix,
- i.op[op].regs->reg_name,
- i.tm.name,
- i.suffix);
- return 0;
- }
- /* Warn if the e prefix on a general reg is present. */
- else if ((!quiet_warnings || flag_code == CODE_64BIT)
- && i.types[op].bitfield.reg32
- && (i.tm.operand_types[op].bitfield.reg16
- || i.tm.operand_types[op].bitfield.acc))
- {
- /* Prohibit these changes in the 64bit mode, since the
- lowering is more complicated. */
- if (flag_code == CODE_64BIT)
- {
- as_bad (_("Incorrect register `%s%s' used with `%c' suffix"),
- register_prefix, i.op[op].regs->reg_name,
- i.suffix);
- return 0;
- }
- else
-#if REGISTER_WARNINGS
- as_warn (_("using `%s%s' instead of `%s%s' due to `%c' suffix"),
- register_prefix,
- (i.op[op].regs + REGNAM_AX - REGNAM_EAX)->reg_name,
- register_prefix,
- i.op[op].regs->reg_name,
- i.suffix);
-#endif
- }
- return 1;
-}
-
-static int
-update_imm (unsigned int j)
-{
- i386_operand_type overlap;
-
- overlap = operand_type_and (i.types[j], i.tm.operand_types[j]);
- if ((overlap.bitfield.imm8
- || overlap.bitfield.imm8s
- || overlap.bitfield.imm16
- || overlap.bitfield.imm32
- || overlap.bitfield.imm32s
- || overlap.bitfield.imm64)
- && !operand_type_equal (&overlap, &imm8)
- && !operand_type_equal (&overlap, &imm8s)
- && !operand_type_equal (&overlap, &imm16)
- && !operand_type_equal (&overlap, &imm32)
- && !operand_type_equal (&overlap, &imm32s)
- && !operand_type_equal (&overlap, &imm64))
- {
- if (i.suffix)
- {
- i386_operand_type temp;
-
- operand_type_set (&temp, 0);
- if (i.suffix == BYTE_MNEM_SUFFIX)
- {
- temp.bitfield.imm8 = overlap.bitfield.imm8;
- temp.bitfield.imm8s = overlap.bitfield.imm8s;
- }
- else if (i.suffix == WORD_MNEM_SUFFIX)
- temp.bitfield.imm16 = overlap.bitfield.imm16;
- else if (i.suffix == QWORD_MNEM_SUFFIX)
- {
- temp.bitfield.imm64 = overlap.bitfield.imm64;
- temp.bitfield.imm32s = overlap.bitfield.imm32s;
- }
- else
- temp.bitfield.imm32 = overlap.bitfield.imm32;
- overlap = temp;
- }
- else if (operand_type_equal (&overlap, &imm16_32_32s)
- || operand_type_equal (&overlap, &imm16_32)
- || operand_type_equal (&overlap, &imm16_32s))
- {
- if ((flag_code == CODE_16BIT) ^ (i.prefix[DATA_PREFIX] != 0))
- overlap = imm16;
- else
- overlap = imm32s;
- }
- if (!operand_type_equal (&overlap, &imm8)
- && !operand_type_equal (&overlap, &imm8s)
- && !operand_type_equal (&overlap, &imm16)
- && !operand_type_equal (&overlap, &imm32)
- && !operand_type_equal (&overlap, &imm32s)
- && !operand_type_equal (&overlap, &imm64))
- {
- as_bad (_("no instruction mnemonic suffix given; "
- "can't determine immediate size"));
- return 0;
- }
- }
- i.types[j] = overlap;
-
- return 1;
-}
-
-static int
-finalize_imm (void)
-{
- unsigned int j;
-
- for (j = 0; j < 2; j++)
- if (update_imm (j) == 0)
- return 0;
-
- i.types[2] = operand_type_and (i.types[2], i.tm.operand_types[2]);
- assert (operand_type_check (i.types[2], imm) == 0);
-
- return 1;
-}
-
-static void
-process_drex (void)
-{
- i.drex.modrm_reg = 0;
- i.drex.modrm_regmem = 0;
-
- /* SSE5 4 operand instructions must have the destination the same as
- one of the inputs. Figure out the destination register and cache
- it away in the drex field, and remember which fields to use for
- the modrm byte. */
- if (i.tm.opcode_modifier.drex
- && i.tm.opcode_modifier.drexv
- && i.operands == 4)
- {
- i.tm.extension_opcode = None;
-
- /* Case 1: 4 operand insn, dest = src1, src3 = register. */
- if (i.types[0].bitfield.regxmm != 0
- && i.types[1].bitfield.regxmm != 0
- && i.types[2].bitfield.regxmm != 0
- && i.types[3].bitfield.regxmm != 0
- && i.op[0].regs->reg_num == i.op[3].regs->reg_num
- && i.op[0].regs->reg_flags == i.op[3].regs->reg_flags)
- {
- /* Clear the arguments that are stored in drex. */
- operand_type_set (&i.types[0], 0);
- operand_type_set (&i.types[3], 0);
- i.reg_operands -= 2;
-
- /* There are two different ways to encode a 4 operand
- instruction with all registers that uses OC1 set to
- 0 or 1. Favor setting OC1 to 0 since this mimics the
- actions of other SSE5 assemblers. Use modrm encoding 2
- for register/register. Include the high order bit that
- is normally stored in the REX byte in the register
- field. */
- i.tm.extension_opcode = DREX_X1_XMEM_X2_X1;
- i.drex.modrm_reg = 2;
- i.drex.modrm_regmem = 1;
- i.drex.reg = (i.op[3].regs->reg_num
- + ((i.op[3].regs->reg_flags & RegRex) ? 8 : 0));
- }
-
- /* Case 2: 4 operand insn, dest = src1, src3 = memory. */
- else if (i.types[0].bitfield.regxmm != 0
- && i.types[1].bitfield.regxmm != 0
- && (i.types[2].bitfield.regxmm
- || operand_type_check (i.types[2], anymem))
- && i.types[3].bitfield.regxmm != 0
- && i.op[0].regs->reg_num == i.op[3].regs->reg_num
- && i.op[0].regs->reg_flags == i.op[3].regs->reg_flags)
- {
- /* clear the arguments that are stored in drex */
- operand_type_set (&i.types[0], 0);
- operand_type_set (&i.types[3], 0);
- i.reg_operands -= 2;
-
- /* Specify the modrm encoding for memory addressing. Include
- the high order bit that is normally stored in the REX byte
- in the register field. */
- i.tm.extension_opcode = DREX_X1_X2_XMEM_X1;
- i.drex.modrm_reg = 1;
- i.drex.modrm_regmem = 2;
- i.drex.reg = (i.op[3].regs->reg_num
- + ((i.op[3].regs->reg_flags & RegRex) ? 8 : 0));
- }
-
- /* Case 3: 4 operand insn, dest = src1, src2 = memory. */
- else if (i.types[0].bitfield.regxmm != 0
- && operand_type_check (i.types[1], anymem) != 0
- && i.types[2].bitfield.regxmm != 0
- && i.types[3].bitfield.regxmm != 0
- && i.op[0].regs->reg_num == i.op[3].regs->reg_num
- && i.op[0].regs->reg_flags == i.op[3].regs->reg_flags)
- {
- /* Clear the arguments that are stored in drex. */
- operand_type_set (&i.types[0], 0);
- operand_type_set (&i.types[3], 0);
- i.reg_operands -= 2;
-
- /* Specify the modrm encoding for memory addressing. Include
- the high order bit that is normally stored in the REX byte
- in the register field. */
- i.tm.extension_opcode = DREX_X1_XMEM_X2_X1;
- i.drex.modrm_reg = 2;
- i.drex.modrm_regmem = 1;
- i.drex.reg = (i.op[3].regs->reg_num
- + ((i.op[3].regs->reg_flags & RegRex) ? 8 : 0));
- }
-
- /* Case 4: 4 operand insn, dest = src3, src2 = register. */
- else if (i.types[0].bitfield.regxmm != 0
- && i.types[1].bitfield.regxmm != 0
- && i.types[2].bitfield.regxmm != 0
- && i.types[3].bitfield.regxmm != 0
- && i.op[2].regs->reg_num == i.op[3].regs->reg_num
- && i.op[2].regs->reg_flags == i.op[3].regs->reg_flags)
- {
- /* clear the arguments that are stored in drex */
- operand_type_set (&i.types[2], 0);
- operand_type_set (&i.types[3], 0);
- i.reg_operands -= 2;
-
- /* There are two different ways to encode a 4 operand
- instruction with all registers that uses OC1 set to
- 0 or 1. Favor setting OC1 to 0 since this mimics the
- actions of other SSE5 assemblers. Use modrm encoding
- 2 for register/register. Include the high order bit that
- is normally stored in the REX byte in the register
- field. */
- i.tm.extension_opcode = DREX_XMEM_X1_X2_X2;
- i.drex.modrm_reg = 1;
- i.drex.modrm_regmem = 0;
-
- /* Remember the register, including the upper bits */
- i.drex.reg = (i.op[3].regs->reg_num
- + ((i.op[3].regs->reg_flags & RegRex) ? 8 : 0));
- }
-
- /* Case 5: 4 operand insn, dest = src3, src2 = memory. */
- else if (i.types[0].bitfield.regxmm != 0
- && (i.types[1].bitfield.regxmm
- || operand_type_check (i.types[1], anymem))
- && i.types[2].bitfield.regxmm != 0
- && i.types[3].bitfield.regxmm != 0
- && i.op[2].regs->reg_num == i.op[3].regs->reg_num
- && i.op[2].regs->reg_flags == i.op[3].regs->reg_flags)
- {
- /* Clear the arguments that are stored in drex. */
- operand_type_set (&i.types[2], 0);
- operand_type_set (&i.types[3], 0);
- i.reg_operands -= 2;
-
- /* Specify the modrm encoding and remember the register
- including the bits normally stored in the REX byte. */
- i.tm.extension_opcode = DREX_X1_XMEM_X2_X2;
- i.drex.modrm_reg = 0;
- i.drex.modrm_regmem = 1;
- i.drex.reg = (i.op[3].regs->reg_num
- + ((i.op[3].regs->reg_flags & RegRex) ? 8 : 0));
- }
-
- /* Case 6: 4 operand insn, dest = src3, src1 = memory. */
- else if (operand_type_check (i.types[0], anymem) != 0
- && i.types[1].bitfield.regxmm != 0
- && i.types[2].bitfield.regxmm != 0
- && i.types[3].bitfield.regxmm != 0
- && i.op[2].regs->reg_num == i.op[3].regs->reg_num
- && i.op[2].regs->reg_flags == i.op[3].regs->reg_flags)
- {
- /* clear the arguments that are stored in drex */
- operand_type_set (&i.types[2], 0);
- operand_type_set (&i.types[3], 0);
- i.reg_operands -= 2;
-
- /* Specify the modrm encoding and remember the register
- including the bits normally stored in the REX byte. */
- i.tm.extension_opcode = DREX_XMEM_X1_X2_X2;
- i.drex.modrm_reg = 1;
- i.drex.modrm_regmem = 0;
- i.drex.reg = (i.op[3].regs->reg_num
- + ((i.op[3].regs->reg_flags & RegRex) ? 8 : 0));
- }
-
- else
- as_bad (_("Incorrect operands for the '%s' instruction"),
- i.tm.name);
- }
-
- /* SSE5 instructions with the DREX byte where the only memory operand
- is in the 2nd argument, and the first and last xmm register must
- match, and is encoded in the DREX byte. */
- else if (i.tm.opcode_modifier.drex
- && !i.tm.opcode_modifier.drexv
- && i.operands == 4)
- {
- /* Case 1: 4 operand insn, dest = src1, src3 = reg/mem. */
- if (i.types[0].bitfield.regxmm != 0
- && (i.types[1].bitfield.regxmm
- || operand_type_check(i.types[1], anymem))
- && i.types[2].bitfield.regxmm != 0
- && i.types[3].bitfield.regxmm != 0
- && i.op[0].regs->reg_num == i.op[3].regs->reg_num
- && i.op[0].regs->reg_flags == i.op[3].regs->reg_flags)
- {
- /* clear the arguments that are stored in drex */
- operand_type_set (&i.types[0], 0);
- operand_type_set (&i.types[3], 0);
- i.reg_operands -= 2;
-
- /* Specify the modrm encoding and remember the register
- including the high bit normally stored in the REX
- byte. */
- i.drex.modrm_reg = 2;
- i.drex.modrm_regmem = 1;
- i.drex.reg = (i.op[3].regs->reg_num
- + ((i.op[3].regs->reg_flags & RegRex) ? 8 : 0));
- }
-
- else
- as_bad (_("Incorrect operands for the '%s' instruction"),
- i.tm.name);
- }
-
- /* SSE5 3 operand instructions that the result is a register, being
- either operand can be a memory operand, using OC0 to note which
- one is the memory. */
- else if (i.tm.opcode_modifier.drex
- && i.tm.opcode_modifier.drexv
- && i.operands == 3)
- {
- i.tm.extension_opcode = None;
-
- /* Case 1: 3 operand insn, src1 = register. */
- if (i.types[0].bitfield.regxmm != 0
- && i.types[1].bitfield.regxmm != 0
- && i.types[2].bitfield.regxmm != 0)
- {
- /* Clear the arguments that are stored in drex. */
- operand_type_set (&i.types[2], 0);
- i.reg_operands--;
-
- /* Specify the modrm encoding and remember the register
- including the high bit normally stored in the REX byte. */
- i.tm.extension_opcode = DREX_XMEM_X1_X2;
- i.drex.modrm_reg = 1;
- i.drex.modrm_regmem = 0;
- i.drex.reg = (i.op[2].regs->reg_num
- + ((i.op[2].regs->reg_flags & RegRex) ? 8 : 0));
- }
-
- /* Case 2: 3 operand insn, src1 = memory. */
- else if (operand_type_check (i.types[0], anymem) != 0
- && i.types[1].bitfield.regxmm != 0
- && i.types[2].bitfield.regxmm != 0)
- {
- /* Clear the arguments that are stored in drex. */
- operand_type_set (&i.types[2], 0);
- i.reg_operands--;
-
- /* Specify the modrm encoding and remember the register
- including the high bit normally stored in the REX
- byte. */
- i.tm.extension_opcode = DREX_XMEM_X1_X2;
- i.drex.modrm_reg = 1;
- i.drex.modrm_regmem = 0;
- i.drex.reg = (i.op[2].regs->reg_num
- + ((i.op[2].regs->reg_flags & RegRex) ? 8 : 0));
- }
-
- /* Case 3: 3 operand insn, src2 = memory. */
- else if (i.types[0].bitfield.regxmm != 0
- && operand_type_check (i.types[1], anymem) != 0
- && i.types[2].bitfield.regxmm != 0)
- {
- /* Clear the arguments that are stored in drex. */
- operand_type_set (&i.types[2], 0);
- i.reg_operands--;
-
- /* Specify the modrm encoding and remember the register
- including the high bit normally stored in the REX byte. */
- i.tm.extension_opcode = DREX_X1_XMEM_X2;
- i.drex.modrm_reg = 0;
- i.drex.modrm_regmem = 1;
- i.drex.reg = (i.op[2].regs->reg_num
- + ((i.op[2].regs->reg_flags & RegRex) ? 8 : 0));
- }
-
- else
- as_bad (_("Incorrect operands for the '%s' instruction"),
- i.tm.name);
- }
-
- /* SSE5 4 operand instructions that are the comparison instructions
- where the first operand is the immediate value of the comparison
- to be done. */
- else if (i.tm.opcode_modifier.drexc != 0 && i.operands == 4)
- {
- /* Case 1: 4 operand insn, src1 = reg/memory. */
- if (operand_type_check (i.types[0], imm) != 0
- && (i.types[1].bitfield.regxmm
- || operand_type_check (i.types[1], anymem))
- && i.types[2].bitfield.regxmm != 0
- && i.types[3].bitfield.regxmm != 0)
- {
- /* clear the arguments that are stored in drex */
- operand_type_set (&i.types[3], 0);
- i.reg_operands--;
-
- /* Specify the modrm encoding and remember the register
- including the high bit normally stored in the REX byte. */
- i.drex.modrm_reg = 2;
- i.drex.modrm_regmem = 1;
- i.drex.reg = (i.op[3].regs->reg_num
- + ((i.op[3].regs->reg_flags & RegRex) ? 8 : 0));
- }
-
- /* Case 2: 3 operand insn with ImmExt that places the
- opcode_extension as an immediate argument. This is used for
- all of the varients of comparison that supplies the appropriate
- value as part of the instruction. */
- else if ((i.types[0].bitfield.regxmm
- || operand_type_check (i.types[0], anymem))
- && i.types[1].bitfield.regxmm != 0
- && i.types[2].bitfield.regxmm != 0
- && operand_type_check (i.types[3], imm) != 0)
- {
- /* clear the arguments that are stored in drex */
- operand_type_set (&i.types[2], 0);
- i.reg_operands--;
-
- /* Specify the modrm encoding and remember the register
- including the high bit normally stored in the REX byte. */
- i.drex.modrm_reg = 1;
- i.drex.modrm_regmem = 0;
- i.drex.reg = (i.op[2].regs->reg_num
- + ((i.op[2].regs->reg_flags & RegRex) ? 8 : 0));
- }
-
- else
- as_bad (_("Incorrect operands for the '%s' instruction"),
- i.tm.name);
- }
-
- else if (i.tm.opcode_modifier.drex
- || i.tm.opcode_modifier.drexv
- || i.tm.opcode_modifier.drexc)
- as_bad (_("Internal error for the '%s' instruction"), i.tm.name);
-}
-
-static int
-bad_implicit_operand (int xmm)
-{
- const char *reg = xmm ? "xmm0" : "ymm0";
- if (intel_syntax)
- as_bad (_("the last operand of `%s' must be `%s%s'"),
- i.tm.name, register_prefix, reg);
- else
- as_bad (_("the first operand of `%s' must be `%s%s'"),
- i.tm.name, register_prefix, reg);
- return 0;
-}
-
-static int
-process_operands (void)
-{
- /* Default segment register this instruction will use for memory
- accesses. 0 means unknown. This is only for optimizing out
- unnecessary segment overrides. */
- const seg_entry *default_seg = 0;
-
- /* Handle all of the DREX munging that SSE5 needs. */
- if (i.tm.opcode_modifier.drex
- || i.tm.opcode_modifier.drexv
- || i.tm.opcode_modifier.drexc)
- process_drex ();
-
- if (i.tm.opcode_modifier.sse2avx
- && (i.tm.opcode_modifier.vexnds
- || i.tm.opcode_modifier.vexndd))
- {
- unsigned int dup = i.operands;
- unsigned int dest = dup - 1;
- unsigned int j;
-
- /* The destination must be an xmm register. */
- assert (i.reg_operands
- && MAX_OPERANDS > dup
- && operand_type_equal (&i.types[dest], &regxmm));
-
- if (i.tm.opcode_modifier.firstxmm0)
- {
- /* The first operand is implicit and must be xmm0. */
- assert (operand_type_equal (&i.types[0], &regxmm));
- if (i.op[0].regs->reg_num != 0)
- return bad_implicit_operand (1);
-
- if (i.tm.opcode_modifier.vex3sources)
- {
- /* Keep xmm0 for instructions with VEX prefix and 3
- sources. */
- goto duplicate;
- }
- else
- {
- /* We remove the first xmm0 and keep the number of
- operands unchanged, which in fact duplicates the
- destination. */
- for (j = 1; j < i.operands; j++)
- {
- i.op[j - 1] = i.op[j];
- i.types[j - 1] = i.types[j];
- i.tm.operand_types[j - 1] = i.tm.operand_types[j];
- }
- }
- }
- else if (i.tm.opcode_modifier.implicit1stxmm0)
- {
- assert ((MAX_OPERANDS - 1) > dup
- && i.tm.opcode_modifier.vex3sources);
-
- /* Add the implicit xmm0 for instructions with VEX prefix
- and 3 sources. */
- for (j = i.operands; j > 0; j--)
- {
- i.op[j] = i.op[j - 1];
- i.types[j] = i.types[j - 1];
- i.tm.operand_types[j] = i.tm.operand_types[j - 1];
- }
- i.op[0].regs
- = (const reg_entry *) hash_find (reg_hash, "xmm0");
- i.types[0] = regxmm;
- i.tm.operand_types[0] = regxmm;
-
- i.operands += 2;
- i.reg_operands += 2;
- i.tm.operands += 2;
-
- dup++;
- dest++;
- i.op[dup] = i.op[dest];
- i.types[dup] = i.types[dest];
- i.tm.operand_types[dup] = i.tm.operand_types[dest];
- }
- else
- {
-duplicate:
- i.operands++;
- i.reg_operands++;
- i.tm.operands++;
-
- i.op[dup] = i.op[dest];
- i.types[dup] = i.types[dest];
- i.tm.operand_types[dup] = i.tm.operand_types[dest];
- }
-
- if (i.tm.opcode_modifier.immext)
- process_immext ();
- }
- else if (i.tm.opcode_modifier.firstxmm0)
- {
- unsigned int j;
-
- /* The first operand is implicit and must be xmm0/ymm0. */
- assert (i.reg_operands
- && (operand_type_equal (&i.types[0], &regxmm)
- || operand_type_equal (&i.types[0], &regymm)));
- if (i.op[0].regs->reg_num != 0)
- return bad_implicit_operand (i.types[0].bitfield.regxmm);
-
- for (j = 1; j < i.operands; j++)
- {
- i.op[j - 1] = i.op[j];
- i.types[j - 1] = i.types[j];
-
- /* We need to adjust fields in i.tm since they are used by
- build_modrm_byte. */
- i.tm.operand_types [j - 1] = i.tm.operand_types [j];
- }
-
- i.operands--;
- i.reg_operands--;
- i.tm.operands--;
- }
- else if (i.tm.opcode_modifier.regkludge)
- {
- /* The imul $imm, %reg instruction is converted into
- imul $imm, %reg, %reg, and the clr %reg instruction
- is converted into xor %reg, %reg. */
-
- unsigned int first_reg_op;
-
- if (operand_type_check (i.types[0], reg))
- first_reg_op = 0;
- else
- first_reg_op = 1;
- /* Pretend we saw the extra register operand. */
- assert (i.reg_operands == 1
- && i.op[first_reg_op + 1].regs == 0);
- i.op[first_reg_op + 1].regs = i.op[first_reg_op].regs;
- i.types[first_reg_op + 1] = i.types[first_reg_op];
- i.operands++;
- i.reg_operands++;
- }
-
- if (i.tm.opcode_modifier.shortform)
- {
- if (i.types[0].bitfield.sreg2
- || i.types[0].bitfield.sreg3)
- {
- if (i.tm.base_opcode == POP_SEG_SHORT
- && i.op[0].regs->reg_num == 1)
- {
- as_bad (_("you can't `pop %%cs'"));
- return 0;
- }
- i.tm.base_opcode |= (i.op[0].regs->reg_num << 3);
- if ((i.op[0].regs->reg_flags & RegRex) != 0)
- i.rex |= REX_B;
- }
- else
- {
- /* The register or float register operand is in operand
- 0 or 1. */
- unsigned int op;
-
- if (i.types[0].bitfield.floatreg
- || operand_type_check (i.types[0], reg))
- op = 0;
- else
- op = 1;
- /* Register goes in low 3 bits of opcode. */
- i.tm.base_opcode |= i.op[op].regs->reg_num;
- if ((i.op[op].regs->reg_flags & RegRex) != 0)
- i.rex |= REX_B;
- if (!quiet_warnings && i.tm.opcode_modifier.ugh)
- {
- /* Warn about some common errors, but press on regardless.
- The first case can be generated by gcc (<= 2.8.1). */
- if (i.operands == 2)
- {
- /* Reversed arguments on faddp, fsubp, etc. */
- as_warn (_("translating to `%s %s%s,%s%s'"), i.tm.name,
- register_prefix, i.op[1].regs->reg_name,
- register_prefix, i.op[0].regs->reg_name);
- }
- else
- {
- /* Extraneous `l' suffix on fp insn. */
- as_warn (_("translating to `%s %s%s'"), i.tm.name,
- register_prefix, i.op[0].regs->reg_name);
- }
- }
- }
- }
- else if (i.tm.opcode_modifier.modrm)
- {
- /* The opcode is completed (modulo i.tm.extension_opcode which
- must be put into the modrm byte). Now, we make the modrm and
- index base bytes based on all the info we've collected. */
-
- default_seg = build_modrm_byte ();
- }
- else if ((i.tm.base_opcode & ~0x3) == MOV_AX_DISP32)
- {
- default_seg = &ds;
- }
- else if (i.tm.opcode_modifier.isstring)
- {
- /* For the string instructions that allow a segment override
- on one of their operands, the default segment is ds. */
- default_seg = &ds;
- }
-
- if (i.tm.base_opcode == 0x8d /* lea */
- && i.seg[0]
- && !quiet_warnings)
- as_warn (_("segment override on `%s' is ineffectual"), i.tm.name);
-
- /* If a segment was explicitly specified, and the specified segment
- is not the default, use an opcode prefix to select it. If we
- never figured out what the default segment is, then default_seg
- will be zero at this point, and the specified segment prefix will
- always be used. */
- if ((i.seg[0]) && (i.seg[0] != default_seg))
- {
- if (!add_prefix (i.seg[0]->seg_prefix))
- return 0;
- }
- return 1;
-}
-
-static const seg_entry *
-build_modrm_byte (void)
-{
- const seg_entry *default_seg = 0;
- unsigned int source, dest;
- int vex_3_sources;
-
- /* The first operand of instructions with VEX prefix and 3 sources
- must be VEX_Imm4. */
- vex_3_sources = i.tm.opcode_modifier.vex3sources;
- if (vex_3_sources)
- {
- unsigned int nds, reg;
-
- if (i.tm.opcode_modifier.veximmext
- && i.tm.opcode_modifier.immext)
- {
- dest = i.operands - 2;
- assert (dest == 3);
- }
- else
- dest = i.operands - 1;
- nds = dest - 1;
-
- /* There are 2 kinds of instructions:
- 1. 5 operands: one immediate operand and 4 register
- operands or 3 register operands plus 1 memory operand.
- It must have VexNDS and VexW0 or VexW1. The destination
- must be either XMM or YMM register.
- 2. 4 operands: 4 register operands or 3 register operands
- plus 1 memory operand. It must have VexNDS and VexImmExt. */
- if (!((i.reg_operands == 4
- || (i.reg_operands == 3 && i.mem_operands == 1))
- && i.tm.opcode_modifier.vexnds
- && (operand_type_equal (&i.tm.operand_types[dest], &regxmm)
- || operand_type_equal (&i.tm.operand_types[dest], &regymm))
- && ((dest == 4
- && i.imm_operands == 1
- && i.types[0].bitfield.vex_imm4
- && (i.tm.opcode_modifier.vexw0
- || i.tm.opcode_modifier.vexw1))
- || (dest == 3
- && (i.imm_operands == 0
- || (i.imm_operands == 1
- && i.tm.opcode_modifier.immext))
- && i.tm.opcode_modifier.veximmext))))
- abort ();
-
- if (i.imm_operands == 0)
- {
- /* When there is no immediate operand, generate an 8bit
- immediate operand to encode the first operand. */
- expressionS *exp = &im_expressions[i.imm_operands++];
- i.op[i.operands].imms = exp;
- i.types[i.operands] = imm8;
- i.operands++;
- /* If VexW1 is set, the first operand is the source and
- the second operand is encoded in the immediate operand. */
- if (i.tm.opcode_modifier.vexw1)
- {
- source = 0;
- reg = 1;
- }
- else
- {
- source = 1;
- reg = 0;
- }
-
- /* FMA swaps REG and NDS. */
- if (i.tm.cpu_flags.bitfield.cpufma)
- {
- unsigned int tmp;
- tmp = reg;
- reg = nds;
- nds = tmp;
- }
-
- assert (operand_type_equal (&i.tm.operand_types[reg], &regxmm)
- || operand_type_equal (&i.tm.operand_types[reg],
- &regymm));
- exp->X_op = O_constant;
- exp->X_add_number
- = ((i.op[reg].regs->reg_num
- + ((i.op[reg].regs->reg_flags & RegRex) ? 8 : 0)) << 4);
- }
- else
- {
- unsigned int imm;
-
- if (i.tm.opcode_modifier.vexw0)
- {
- /* If VexW0 is set, the third operand is the source and
- the second operand is encoded in the immediate
- operand. */
- source = 2;
- reg = 1;
- }
- else
- {
- /* VexW1 is set, the second operand is the source and
- the third operand is encoded in the immediate
- operand. */
- source = 1;
- reg = 2;
- }
-
- if (i.tm.opcode_modifier.immext)
- {
- /* When ImmExt is set, the immdiate byte is the last
- operand. */
- imm = i.operands - 1;
- source--;
- reg--;
- }
- else
- {
- imm = 0;
-
- /* Turn on Imm8 so that output_imm will generate it. */
- i.types[imm].bitfield.imm8 = 1;
- }
-
- assert (operand_type_equal (&i.tm.operand_types[reg], &regxmm)
- || operand_type_equal (&i.tm.operand_types[reg],
- &regymm));
- i.op[imm].imms->X_add_number
- |= ((i.op[reg].regs->reg_num
- + ((i.op[reg].regs->reg_flags & RegRex) ? 8 : 0)) << 4);
- }
-
- assert (operand_type_equal (&i.tm.operand_types[nds], &regxmm)
- || operand_type_equal (&i.tm.operand_types[nds], &regymm));
- i.vex.register_specifier = i.op[nds].regs;
-
- }
- else
- source = dest = 0;
-
- /* SSE5 4 operand instructions are encoded in such a way that one of
- the inputs must match the destination register. Process_drex hides
- the 3rd argument in the drex field, so that by the time we get
- here, it looks to GAS as if this is a 2 operand instruction. */
- if ((i.tm.opcode_modifier.drex
- || i.tm.opcode_modifier.drexv
- || i.tm.opcode_modifier.drexc)
- && i.reg_operands == 2)
- {
- const reg_entry *reg = i.op[i.drex.modrm_reg].regs;
- const reg_entry *regmem = i.op[i.drex.modrm_regmem].regs;
-
- i.rm.reg = reg->reg_num;
- i.rm.regmem = regmem->reg_num;
- i.rm.mode = 3;
- if ((reg->reg_flags & RegRex) != 0)
- i.rex |= REX_R;
- if ((regmem->reg_flags & RegRex) != 0)
- i.rex |= REX_B;
- }
-
- /* i.reg_operands MUST be the number of real register operands;
- implicit registers do not count. If there are 3 register
- operands, it must be a instruction with VexNDS. For a
- instruction with VexNDD, the destination register is encoded
- in VEX prefix. If there are 4 register operands, it must be
- a instruction with VEX prefix and 3 sources. */
- else if (i.mem_operands == 0
- && ((i.reg_operands == 2
- && !i.tm.opcode_modifier.vexndd)
- || (i.reg_operands == 3
- && i.tm.opcode_modifier.vexnds)
- || (i.reg_operands == 4 && vex_3_sources)))
- {
- switch (i.operands)
- {
- case 2:
- source = 0;
- break;
- case 3:
- /* When there are 3 operands, one of them may be immediate,
- which may be the first or the last operand. Otherwise,
- the first operand must be shift count register (cl) or it
- is an instruction with VexNDS. */
- assert (i.imm_operands == 1
- || (i.imm_operands == 0
- && (i.tm.opcode_modifier.vexnds
- || i.types[0].bitfield.shiftcount)));
- if (operand_type_check (i.types[0], imm)
- || i.types[0].bitfield.shiftcount)
- source = 1;
- else
- source = 0;
- break;
- case 4:
- /* When there are 4 operands, the first two must be 8bit
- immediate operands. The source operand will be the 3rd
- one.
-
- For instructions with VexNDS, if the first operand
- an imm8, the source operand is the 2nd one. If the last
- operand is imm8, the source operand is the first one. */
- assert ((i.imm_operands == 2
- && i.types[0].bitfield.imm8
- && i.types[1].bitfield.imm8)
- || (i.tm.opcode_modifier.vexnds
- && i.imm_operands == 1
- && (i.types[0].bitfield.imm8
- || i.types[i.operands - 1].bitfield.imm8)));
- if (i.tm.opcode_modifier.vexnds)
- {
- if (i.types[0].bitfield.imm8)
- source = 1;
- else
- source = 0;
- }
- else
- source = 2;
- break;
- case 5:
- break;
- default:
- abort ();
- }
-
- if (!vex_3_sources)
- {
- dest = source + 1;
-
- if (i.tm.opcode_modifier.vexnds)
- {
- /* For instructions with VexNDS, the register-only
- source operand must be XMM or YMM register. It is
- encoded in VEX prefix. */
- if ((dest + 1) >= i.operands
- || (!operand_type_equal (&i.tm.operand_types[dest],
- &regxmm)
- && !operand_type_equal (&i.tm.operand_types[dest],
- &regymm)))
- abort ();
- i.vex.register_specifier = i.op[dest].regs;
- dest++;
- }
- }
-
- i.rm.mode = 3;
- /* One of the register operands will be encoded in the i.tm.reg
- field, the other in the combined i.tm.mode and i.tm.regmem
- fields. If no form of this instruction supports a memory
- destination operand, then we assume the source operand may
- sometimes be a memory operand and so we need to store the
- destination in the i.rm.reg field. */
- if (!i.tm.operand_types[dest].bitfield.regmem
- && operand_type_check (i.tm.operand_types[dest], anymem) == 0)
- {
- i.rm.reg = i.op[dest].regs->reg_num;
- i.rm.regmem = i.op[source].regs->reg_num;
- if ((i.op[dest].regs->reg_flags & RegRex) != 0)
- i.rex |= REX_R;
- if ((i.op[source].regs->reg_flags & RegRex) != 0)
- i.rex |= REX_B;
- }
- else
- {
- i.rm.reg = i.op[source].regs->reg_num;
- i.rm.regmem = i.op[dest].regs->reg_num;
- if ((i.op[dest].regs->reg_flags & RegRex) != 0)
- i.rex |= REX_B;
- if ((i.op[source].regs->reg_flags & RegRex) != 0)
- i.rex |= REX_R;
- }
- if (flag_code != CODE_64BIT && (i.rex & (REX_R | REX_B)))
- {
- if (!i.types[0].bitfield.control
- && !i.types[1].bitfield.control)
- abort ();
- i.rex &= ~(REX_R | REX_B);
- add_prefix (LOCK_PREFIX_OPCODE);
- }
- }
- else
- { /* If it's not 2 reg operands... */
- unsigned int mem;
-
- if (i.mem_operands)
- {
- unsigned int fake_zero_displacement = 0;
- unsigned int op;
-
- /* This has been precalculated for SSE5 instructions
- that have a DREX field earlier in process_drex. */
- if (i.tm.opcode_modifier.drex
- || i.tm.opcode_modifier.drexv
- || i.tm.opcode_modifier.drexc)
- op = i.drex.modrm_regmem;
- else
- {
- for (op = 0; op < i.operands; op++)
- if (operand_type_check (i.types[op], anymem))
- break;
- assert (op < i.operands);
- }
-
- default_seg = &ds;
-
- if (i.base_reg == 0)
- {
- i.rm.mode = 0;
- if (!i.disp_operands)
- fake_zero_displacement = 1;
- if (i.index_reg == 0)
- {
- /* Operand is just <disp> */
- if (flag_code == CODE_64BIT)
- {
- /* 64bit mode overwrites the 32bit absolute
- addressing by RIP relative addressing and
- absolute addressing is encoded by one of the
- redundant SIB forms. */
- i.rm.regmem = ESCAPE_TO_TWO_BYTE_ADDRESSING;
- i.sib.base = NO_BASE_REGISTER;
- i.sib.index = NO_INDEX_REGISTER;
- i.types[op] = ((i.prefix[ADDR_PREFIX] == 0)
- ? disp32s : disp32);
- }
- else if ((flag_code == CODE_16BIT)
- ^ (i.prefix[ADDR_PREFIX] != 0))
- {
- i.rm.regmem = NO_BASE_REGISTER_16;
- i.types[op] = disp16;
- }
- else
- {
- i.rm.regmem = NO_BASE_REGISTER;
- i.types[op] = disp32;
- }
- }
- else /* !i.base_reg && i.index_reg */
- {
- if (i.index_reg->reg_num == RegEiz
- || i.index_reg->reg_num == RegRiz)
- i.sib.index = NO_INDEX_REGISTER;
- else
- i.sib.index = i.index_reg->reg_num;
- i.sib.base = NO_BASE_REGISTER;
- i.sib.scale = i.log2_scale_factor;
- i.rm.regmem = ESCAPE_TO_TWO_BYTE_ADDRESSING;
- i.types[op].bitfield.disp8 = 0;
- i.types[op].bitfield.disp16 = 0;
- i.types[op].bitfield.disp64 = 0;
- if (flag_code != CODE_64BIT)
- {
- /* Must be 32 bit */
- i.types[op].bitfield.disp32 = 1;
- i.types[op].bitfield.disp32s = 0;
- }
- else
- {
- i.types[op].bitfield.disp32 = 0;
- i.types[op].bitfield.disp32s = 1;
- }
- if ((i.index_reg->reg_flags & RegRex) != 0)
- i.rex |= REX_X;
- }
- }
- /* RIP addressing for 64bit mode. */
- else if (i.base_reg->reg_num == RegRip ||
- i.base_reg->reg_num == RegEip)
- {
- i.rm.regmem = NO_BASE_REGISTER;
- i.types[op].bitfield.disp8 = 0;
- i.types[op].bitfield.disp16 = 0;
- i.types[op].bitfield.disp32 = 0;
- i.types[op].bitfield.disp32s = 1;
- i.types[op].bitfield.disp64 = 0;
- i.flags[op] |= Operand_PCrel;
- if (! i.disp_operands)
- fake_zero_displacement = 1;
- }
- else if (i.base_reg->reg_type.bitfield.reg16)
- {
- switch (i.base_reg->reg_num)
- {
- case 3: /* (%bx) */
- if (i.index_reg == 0)
- i.rm.regmem = 7;
- else /* (%bx,%si) -> 0, or (%bx,%di) -> 1 */
- i.rm.regmem = i.index_reg->reg_num - 6;
- break;
- case 5: /* (%bp) */
- default_seg = &ss;
- if (i.index_reg == 0)
- {
- i.rm.regmem = 6;
- if (operand_type_check (i.types[op], disp) == 0)
- {
- /* fake (%bp) into 0(%bp) */
- i.types[op].bitfield.disp8 = 1;
- fake_zero_displacement = 1;
- }
- }
- else /* (%bp,%si) -> 2, or (%bp,%di) -> 3 */
- i.rm.regmem = i.index_reg->reg_num - 6 + 2;
- break;
- default: /* (%si) -> 4 or (%di) -> 5 */
- i.rm.regmem = i.base_reg->reg_num - 6 + 4;
- }
- i.rm.mode = mode_from_disp_size (i.types[op]);
- }
- else /* i.base_reg and 32/64 bit mode */
- {
- if (flag_code == CODE_64BIT
- && operand_type_check (i.types[op], disp))
- {
- i386_operand_type temp;
- operand_type_set (&temp, 0);
- temp.bitfield.disp8 = i.types[op].bitfield.disp8;
- i.types[op] = temp;
- if (i.prefix[ADDR_PREFIX] == 0)
- i.types[op].bitfield.disp32s = 1;
- else
- i.types[op].bitfield.disp32 = 1;
- }
-
- i.rm.regmem = i.base_reg->reg_num;
- if ((i.base_reg->reg_flags & RegRex) != 0)
- i.rex |= REX_B;
- i.sib.base = i.base_reg->reg_num;
- /* x86-64 ignores REX prefix bit here to avoid decoder
- complications. */
- if ((i.base_reg->reg_num & 7) == EBP_REG_NUM)
- {
- default_seg = &ss;
- if (i.disp_operands == 0)
- {
- fake_zero_displacement = 1;
- i.types[op].bitfield.disp8 = 1;
- }
- }
- else if (i.base_reg->reg_num == ESP_REG_NUM)
- {
- default_seg = &ss;
- }
- i.sib.scale = i.log2_scale_factor;
- if (i.index_reg == 0)
- {
- /* <disp>(%esp) becomes two byte modrm with no index
- register. We've already stored the code for esp
- in i.rm.regmem ie. ESCAPE_TO_TWO_BYTE_ADDRESSING.
- Any base register besides %esp will not use the
- extra modrm byte. */
- i.sib.index = NO_INDEX_REGISTER;
- }
- else
- {
- if (i.index_reg->reg_num == RegEiz
- || i.index_reg->reg_num == RegRiz)
- i.sib.index = NO_INDEX_REGISTER;
- else
- i.sib.index = i.index_reg->reg_num;
- i.rm.regmem = ESCAPE_TO_TWO_BYTE_ADDRESSING;
- if ((i.index_reg->reg_flags & RegRex) != 0)
- i.rex |= REX_X;
- }
-
- if (i.disp_operands
- && (i.reloc[op] == BFD_RELOC_386_TLS_DESC_CALL
- || i.reloc[op] == BFD_RELOC_X86_64_TLSDESC_CALL))
- i.rm.mode = 0;
- else
- i.rm.mode = mode_from_disp_size (i.types[op]);
- }
-
- if (fake_zero_displacement)
- {
- /* Fakes a zero displacement assuming that i.types[op]
- holds the correct displacement size. */
- expressionS *exp;
-
- assert (i.op[op].disps == 0);
- exp = &disp_expressions[i.disp_operands++];
- i.op[op].disps = exp;
- exp->X_op = O_constant;
- exp->X_add_number = 0;
- exp->X_add_symbol = (symbolS *) 0;
- exp->X_op_symbol = (symbolS *) 0;
- }
-
- mem = op;
- }
- else
- mem = ~0;
-
- /* Fill in i.rm.reg or i.rm.regmem field with register operand
- (if any) based on i.tm.extension_opcode. Again, we must be
- careful to make sure that segment/control/debug/test/MMX
- registers are coded into the i.rm.reg field. */
- if (i.reg_operands)
- {
- unsigned int op;
-
- /* This has been precalculated for SSE5 instructions
- that have a DREX field earlier in process_drex. */
- if (i.tm.opcode_modifier.drex
- || i.tm.opcode_modifier.drexv
- || i.tm.opcode_modifier.drexc)
- {
- op = i.drex.modrm_reg;
- i.rm.reg = i.op[op].regs->reg_num;
- if ((i.op[op].regs->reg_flags & RegRex) != 0)
- i.rex |= REX_R;
- }
- else
- {
- unsigned int vex_reg = ~0;
-
- for (op = 0; op < i.operands; op++)
- if (i.types[op].bitfield.reg8
- || i.types[op].bitfield.reg16
- || i.types[op].bitfield.reg32
- || i.types[op].bitfield.reg64
- || i.types[op].bitfield.regmmx
- || i.types[op].bitfield.regxmm
- || i.types[op].bitfield.regymm
- || i.types[op].bitfield.sreg2
- || i.types[op].bitfield.sreg3
- || i.types[op].bitfield.control
- || i.types[op].bitfield.debug
- || i.types[op].bitfield.test)
- break;
-
- if (vex_3_sources)
- op = dest;
- else if (i.tm.opcode_modifier.vexnds)
- {
- /* For instructions with VexNDS, the register-only
- source operand is encoded in VEX prefix. */
- assert (mem != (unsigned int) ~0);
-
- if (op > mem)
- {
- vex_reg = op++;
- assert (op < i.operands);
- }
- else
- {
- vex_reg = op + 1;
- assert (vex_reg < i.operands);
- }
- }
- else if (i.tm.opcode_modifier.vexndd)
- {
- /* For instructions with VexNDD, there should be
- no memory operand and the register destination
- is encoded in VEX prefix. */
- assert (i.mem_operands == 0
- && (op + 2) == i.operands);
- vex_reg = op + 1;
- }
- else
- assert (op < i.operands);
-
- if (vex_reg != (unsigned int) ~0)
- {
- assert (i.reg_operands == 2);
-
- if (!operand_type_equal (&i.tm.operand_types[vex_reg],
- & regxmm)
- && !operand_type_equal (&i.tm.operand_types[vex_reg],
- &regymm))
- abort ();
- i.vex.register_specifier = i.op[vex_reg].regs;
- }
-
- /* If there is an extension opcode to put here, the
- register number must be put into the regmem field. */
- if (i.tm.extension_opcode != None)
- {
- i.rm.regmem = i.op[op].regs->reg_num;
- if ((i.op[op].regs->reg_flags & RegRex) != 0)
- i.rex |= REX_B;
- }
- else
- {
- i.rm.reg = i.op[op].regs->reg_num;
- if ((i.op[op].regs->reg_flags & RegRex) != 0)
- i.rex |= REX_R;
- }
- }
-
- /* Now, if no memory operand has set i.rm.mode = 0, 1, 2 we
- must set it to 3 to indicate this is a register operand
- in the regmem field. */
- if (!i.mem_operands)
- i.rm.mode = 3;
- }
-
- /* Fill in i.rm.reg field with extension opcode (if any). */
- if (i.tm.extension_opcode != None
- && !(i.tm.opcode_modifier.drex
- || i.tm.opcode_modifier.drexv
- || i.tm.opcode_modifier.drexc))
- i.rm.reg = i.tm.extension_opcode;
- }
- return default_seg;
-}
-
-static void
-output_branch (void)
-{
- char *p;
- int code16;
- int prefix;
- relax_substateT subtype;
- symbolS *sym;
- offsetT off;
-
- code16 = 0;
- if (flag_code == CODE_16BIT)
- code16 = CODE16;
-
- prefix = 0;
- if (i.prefix[DATA_PREFIX] != 0)
- {
- prefix = 1;
- i.prefixes -= 1;
- code16 ^= CODE16;
- }
- /* Pentium4 branch hints. */
- if (i.prefix[SEG_PREFIX] == CS_PREFIX_OPCODE /* not taken */
- || i.prefix[SEG_PREFIX] == DS_PREFIX_OPCODE /* taken */)
- {
- prefix++;
- i.prefixes--;
- }
- if (i.prefix[REX_PREFIX] != 0)
- {
- prefix++;
- i.prefixes--;
- }
-
- if (i.prefixes != 0 && !intel_syntax)
- as_warn (_("skipping prefixes on this instruction"));
-
- /* It's always a symbol; End frag & setup for relax.
- Make sure there is enough room in this frag for the largest
- instruction we may generate in md_convert_frag. This is 2
- bytes for the opcode and room for the prefix and largest
- displacement. */
- frag_grow (prefix + 2 + 4);
- /* Prefix and 1 opcode byte go in fr_fix. */
- p = frag_more (prefix + 1);
- if (i.prefix[DATA_PREFIX] != 0)
- *p++ = DATA_PREFIX_OPCODE;
- if (i.prefix[SEG_PREFIX] == CS_PREFIX_OPCODE
- || i.prefix[SEG_PREFIX] == DS_PREFIX_OPCODE)
- *p++ = i.prefix[SEG_PREFIX];
- if (i.prefix[REX_PREFIX] != 0)
- *p++ = i.prefix[REX_PREFIX];
- *p = i.tm.base_opcode;
-
- if ((unsigned char) *p == JUMP_PC_RELATIVE)
- subtype = ENCODE_RELAX_STATE (UNCOND_JUMP, SMALL);
- else if (cpu_arch_flags.bitfield.cpui386)
- subtype = ENCODE_RELAX_STATE (COND_JUMP, SMALL);
- else
- subtype = ENCODE_RELAX_STATE (COND_JUMP86, SMALL);
- subtype |= code16;
-
- sym = i.op[0].disps->X_add_symbol;
- off = i.op[0].disps->X_add_number;
-
- if (i.op[0].disps->X_op != O_constant
- && i.op[0].disps->X_op != O_symbol)
- {
- /* Handle complex expressions. */
- sym = make_expr_symbol (i.op[0].disps);
- off = 0;
- }
-
- /* 1 possible extra opcode + 4 byte displacement go in var part.
- Pass reloc in fr_var. */
- frag_var (rs_machine_dependent, 5, i.reloc[0], subtype, sym, off, p);
-}
-
-static void
-output_jump (void)
-{
- char *p;
- int size;
- fixS *fixP;
-
- if (i.tm.opcode_modifier.jumpbyte)
- {
- /* This is a loop or jecxz type instruction. */
- size = 1;
- if (i.prefix[ADDR_PREFIX] != 0)
- {
- FRAG_APPEND_1_CHAR (ADDR_PREFIX_OPCODE);
- i.prefixes -= 1;
- }
- /* Pentium4 branch hints. */
- if (i.prefix[SEG_PREFIX] == CS_PREFIX_OPCODE /* not taken */
- || i.prefix[SEG_PREFIX] == DS_PREFIX_OPCODE /* taken */)
- {
- FRAG_APPEND_1_CHAR (i.prefix[SEG_PREFIX]);
- i.prefixes--;
- }
- }
- else
- {
- int code16;
-
- code16 = 0;
- if (flag_code == CODE_16BIT)
- code16 = CODE16;
-
- if (i.prefix[DATA_PREFIX] != 0)
- {
- FRAG_APPEND_1_CHAR (DATA_PREFIX_OPCODE);
- i.prefixes -= 1;
- code16 ^= CODE16;
- }
-
- size = 4;
- if (code16)
- size = 2;
- }
-
- if (i.prefix[REX_PREFIX] != 0)
- {
- FRAG_APPEND_1_CHAR (i.prefix[REX_PREFIX]);
- i.prefixes -= 1;
- }
-
- if (i.prefixes != 0 && !intel_syntax)
- as_warn (_("skipping prefixes on this instruction"));
-
- p = frag_more (1 + size);
- *p++ = i.tm.base_opcode;
-
- fixP = fix_new_exp (frag_now, p - frag_now->fr_literal, size,
- i.op[0].disps, 1, reloc (size, 1, 1, i.reloc[0]));
-
- /* All jumps handled here are signed, but don't use a signed limit
- check for 32 and 16 bit jumps as we want to allow wrap around at
- 4G and 64k respectively. */
- if (size == 1)
- fixP->fx_signed = 1;
-}
-
-static void
-output_interseg_jump (void)
-{
- char *p;
- int size;
- int prefix;
- int code16;
-
- code16 = 0;
- if (flag_code == CODE_16BIT)
- code16 = CODE16;
-
- prefix = 0;
- if (i.prefix[DATA_PREFIX] != 0)
- {
- prefix = 1;
- i.prefixes -= 1;
- code16 ^= CODE16;
- }
- if (i.prefix[REX_PREFIX] != 0)
- {
- prefix++;
- i.prefixes -= 1;
- }
-
- size = 4;
- if (code16)
- size = 2;
-
- if (i.prefixes != 0 && !intel_syntax)
- as_warn (_("skipping prefixes on this instruction"));
-
- /* 1 opcode; 2 segment; offset */
- p = frag_more (prefix + 1 + 2 + size);
-
- if (i.prefix[DATA_PREFIX] != 0)
- *p++ = DATA_PREFIX_OPCODE;
-
- if (i.prefix[REX_PREFIX] != 0)
- *p++ = i.prefix[REX_PREFIX];
-
- *p++ = i.tm.base_opcode;
- if (i.op[1].imms->X_op == O_constant)
- {
- offsetT n = i.op[1].imms->X_add_number;
-
- if (size == 2
- && !fits_in_unsigned_word (n)
- && !fits_in_signed_word (n))
- {
- as_bad (_("16-bit jump out of range"));
- return;
- }
- md_number_to_chars (p, n, size);
- }
- else
- fix_new_exp (frag_now, p - frag_now->fr_literal, size,
- i.op[1].imms, 0, reloc (size, 0, 0, i.reloc[1]));
- if (i.op[0].imms->X_op != O_constant)
- as_bad (_("can't handle non absolute segment in `%s'"),
- i.tm.name);
- md_number_to_chars (p + size, (valueT) i.op[0].imms->X_add_number, 2);
-}
-
-static void
-output_insn (void)
-{
- fragS *insn_start_frag;
- offsetT insn_start_off;
-
- /* Tie dwarf2 debug info to the address at the start of the insn.
- We can't do this after the insn has been output as the current
- frag may have been closed off. eg. by frag_var. */
- dwarf2_emit_insn (0);
-
- insn_start_frag = frag_now;
- insn_start_off = frag_now_fix ();
-
- /* Output jumps. */
- if (i.tm.opcode_modifier.jump)
- output_branch ();
- else if (i.tm.opcode_modifier.jumpbyte
- || i.tm.opcode_modifier.jumpdword)
- output_jump ();
- else if (i.tm.opcode_modifier.jumpintersegment)
- output_interseg_jump ();
- else
- {
- /* Output normal instructions here. */
- char *p;
- unsigned char *q;
- unsigned int j;
- unsigned int prefix;
-
- /* Since the VEX prefix contains the implicit prefix, we don't
- need the explicit prefix. */
- if (!i.tm.opcode_modifier.vex)
- {
- switch (i.tm.opcode_length)
- {
- case 3:
- if (i.tm.base_opcode & 0xff000000)
- {
- prefix = (i.tm.base_opcode >> 24) & 0xff;
- goto check_prefix;
- }
- break;
- case 2:
- if ((i.tm.base_opcode & 0xff0000) != 0)
- {
- prefix = (i.tm.base_opcode >> 16) & 0xff;
- if (i.tm.cpu_flags.bitfield.cpupadlock)
- {
-check_prefix:
- if (prefix != REPE_PREFIX_OPCODE
- || (i.prefix[LOCKREP_PREFIX]
- != REPE_PREFIX_OPCODE))
- add_prefix (prefix);
- }
- else
- add_prefix (prefix);
- }
- break;
- case 1:
- break;
- default:
- abort ();
- }
-
- /* The prefix bytes. */
- for (j = ARRAY_SIZE (i.prefix), q = i.prefix; j > 0; j--, q++)
- if (*q)
- FRAG_APPEND_1_CHAR (*q);
- }
-
- if (i.tm.opcode_modifier.vex)
- {
- for (j = 0, q = i.prefix; j < ARRAY_SIZE (i.prefix); j++, q++)
- if (*q)
- switch (j)
- {
- case REX_PREFIX:
- /* REX byte is encoded in VEX prefix. */
- break;
- case SEG_PREFIX:
- case ADDR_PREFIX:
- FRAG_APPEND_1_CHAR (*q);
- break;
- default:
- /* There should be no other prefixes for instructions
- with VEX prefix. */
- abort ();
- }
-
- /* Now the VEX prefix. */
- p = frag_more (i.vex.length);
- for (j = 0; j < i.vex.length; j++)
- p[j] = i.vex.bytes[j];
- }
-
- /* Now the opcode; be careful about word order here! */
- if (i.tm.opcode_length == 1)
- {
- FRAG_APPEND_1_CHAR (i.tm.base_opcode);
- }
- else
- {
- switch (i.tm.opcode_length)
- {
- case 3:
- p = frag_more (3);
- *p++ = (i.tm.base_opcode >> 16) & 0xff;
- break;
- case 2:
- p = frag_more (2);
- break;
- default:
- abort ();
- break;
- }
-
- /* Put out high byte first: can't use md_number_to_chars! */
- *p++ = (i.tm.base_opcode >> 8) & 0xff;
- *p = i.tm.base_opcode & 0xff;
-
- /* On SSE5, encode the OC1 bit in the DREX field if this
- encoding has multiple formats. */
- if (i.tm.opcode_modifier.drex
- && i.tm.opcode_modifier.drexv
- && DREX_OC1 (i.tm.extension_opcode))
- *p |= DREX_OC1_MASK;
- }
-
- /* Now the modrm byte and sib byte (if present). */
- if (i.tm.opcode_modifier.modrm)
- {
- FRAG_APPEND_1_CHAR ((i.rm.regmem << 0
- | i.rm.reg << 3
- | i.rm.mode << 6));
- /* If i.rm.regmem == ESP (4)
- && i.rm.mode != (Register mode)
- && not 16 bit
- ==> need second modrm byte. */
- if (i.rm.regmem == ESCAPE_TO_TWO_BYTE_ADDRESSING
- && i.rm.mode != 3
- && !(i.base_reg && i.base_reg->reg_type.bitfield.reg16))
- FRAG_APPEND_1_CHAR ((i.sib.base << 0
- | i.sib.index << 3
- | i.sib.scale << 6));
- }
-
- /* Write the DREX byte if needed. */
- if (i.tm.opcode_modifier.drex || i.tm.opcode_modifier.drexc)
- {
- p = frag_more (1);
- *p = (((i.drex.reg & 0xf) << 4) | (i.drex.rex & 0x7));
-
- /* Encode the OC0 bit if this encoding has multiple
- formats. */
- if ((i.tm.opcode_modifier.drex
- || i.tm.opcode_modifier.drexv)
- && DREX_OC0 (i.tm.extension_opcode))
- *p |= DREX_OC0_MASK;
- }
-
- if (i.disp_operands)
- output_disp (insn_start_frag, insn_start_off);
-
- if (i.imm_operands)
- output_imm (insn_start_frag, insn_start_off);
- }
-
-#ifdef DEBUG386
- if (flag_debug)
- {
- pi ("" /*line*/, &i);
- }
-#endif /* DEBUG386 */
-}
-
-/* Return the size of the displacement operand N. */
-
-static int
-disp_size (unsigned int n)
-{
- int size = 4;
- if (i.types[n].bitfield.disp64)
- size = 8;
- else if (i.types[n].bitfield.disp8)
- size = 1;
- else if (i.types[n].bitfield.disp16)
- size = 2;
- return size;
-}
-
-/* Return the size of the immediate operand N. */
-
-static int
-imm_size (unsigned int n)
-{
- int size = 4;
- if (i.types[n].bitfield.imm64)
- size = 8;
- else if (i.types[n].bitfield.imm8 || i.types[n].bitfield.imm8s)
- size = 1;
- else if (i.types[n].bitfield.imm16)
- size = 2;
- return size;
-}
-
-static void
-output_disp (fragS *insn_start_frag, offsetT insn_start_off)
-{
- char *p;
- unsigned int n;
-
- for (n = 0; n < i.operands; n++)
- {
- if (operand_type_check (i.types[n], disp))
- {
- if (i.op[n].disps->X_op == O_constant)
- {
- int size = disp_size (n);
- offsetT val;
-
- val = offset_in_range (i.op[n].disps->X_add_number,
- size);
- p = frag_more (size);
- md_number_to_chars (p, val, size);
- }
- else
- {
- enum bfd_reloc_code_real reloc_type;
- int size = disp_size (n);
- int sign = i.types[n].bitfield.disp32s;
- int pcrel = (i.flags[n] & Operand_PCrel) != 0;
-
- /* We can't have 8 bit displacement here. */
- assert (!i.types[n].bitfield.disp8);
-
- /* The PC relative address is computed relative
- to the instruction boundary, so in case immediate
- fields follows, we need to adjust the value. */
- if (pcrel && i.imm_operands)
- {
- unsigned int n1;
- int sz = 0;
-
- for (n1 = 0; n1 < i.operands; n1++)
- if (operand_type_check (i.types[n1], imm))
- {
- /* Only one immediate is allowed for PC
- relative address. */
- assert (sz == 0);
- sz = imm_size (n1);
- i.op[n].disps->X_add_number -= sz;
- }
- /* We should find the immediate. */
- assert (sz != 0);
- }
-
- p = frag_more (size);
- reloc_type = reloc (size, pcrel, sign, i.reloc[n]);
- if (GOT_symbol
- && GOT_symbol == i.op[n].disps->X_add_symbol
- && (((reloc_type == BFD_RELOC_32
- || reloc_type == BFD_RELOC_X86_64_32S
- || (reloc_type == BFD_RELOC_64
- && object_64bit))
- && (i.op[n].disps->X_op == O_symbol
- || (i.op[n].disps->X_op == O_add
- && ((symbol_get_value_expression
- (i.op[n].disps->X_op_symbol)->X_op)
- == O_subtract))))
- || reloc_type == BFD_RELOC_32_PCREL))
- {
- offsetT add;
-
- if (insn_start_frag == frag_now)
- add = (p - frag_now->fr_literal) - insn_start_off;
- else
- {
- fragS *fr;
-
- add = insn_start_frag->fr_fix - insn_start_off;
- for (fr = insn_start_frag->fr_next;
- fr && fr != frag_now; fr = fr->fr_next)
- add += fr->fr_fix;
- add += p - frag_now->fr_literal;
- }
-
- if (!object_64bit)
- {
- reloc_type = BFD_RELOC_386_GOTPC;
- i.op[n].imms->X_add_number += add;
- }
- else if (reloc_type == BFD_RELOC_64)
- reloc_type = BFD_RELOC_X86_64_GOTPC64;
- else
- /* Don't do the adjustment for x86-64, as there
- the pcrel addressing is relative to the _next_
- insn, and that is taken care of in other code. */
- reloc_type = BFD_RELOC_X86_64_GOTPC32;
- }
- fix_new_exp (frag_now, p - frag_now->fr_literal, size,
- i.op[n].disps, pcrel, reloc_type);
- }
- }
- }
-}
-
-static void
-output_imm (fragS *insn_start_frag, offsetT insn_start_off)
-{
- char *p;
- unsigned int n;
-
- for (n = 0; n < i.operands; n++)
- {
- if (operand_type_check (i.types[n], imm))
- {
- if (i.op[n].imms->X_op == O_constant)
- {
- int size = imm_size (n);
- offsetT val;
-
- val = offset_in_range (i.op[n].imms->X_add_number,
- size);
- p = frag_more (size);
- md_number_to_chars (p, val, size);
- }
- else
- {
- /* Not absolute_section.
- Need a 32-bit fixup (don't support 8bit
- non-absolute imms). Try to support other
- sizes ... */
- enum bfd_reloc_code_real reloc_type;
- int size = imm_size (n);
- int sign;
-
- if (i.types[n].bitfield.imm32s
- && (i.suffix == QWORD_MNEM_SUFFIX
- || (!i.suffix && i.tm.opcode_modifier.no_lsuf)))
- sign = 1;
- else
- sign = 0;
-
- p = frag_more (size);
- reloc_type = reloc (size, 0, sign, i.reloc[n]);
-
- /* This is tough to explain. We end up with this one if we
- * have operands that look like
- * "_GLOBAL_OFFSET_TABLE_+[.-.L284]". The goal here is to
- * obtain the absolute address of the GOT, and it is strongly
- * preferable from a performance point of view to avoid using
- * a runtime relocation for this. The actual sequence of
- * instructions often look something like:
- *
- * call .L66
- * .L66:
- * popl %ebx
- * addl $_GLOBAL_OFFSET_TABLE_+[.-.L66],%ebx
- *
- * The call and pop essentially return the absolute address
- * of the label .L66 and store it in %ebx. The linker itself
- * will ultimately change the first operand of the addl so
- * that %ebx points to the GOT, but to keep things simple, the
- * .o file must have this operand set so that it generates not
- * the absolute address of .L66, but the absolute address of
- * itself. This allows the linker itself simply treat a GOTPC
- * relocation as asking for a pcrel offset to the GOT to be
- * added in, and the addend of the relocation is stored in the
- * operand field for the instruction itself.
- *
- * Our job here is to fix the operand so that it would add
- * the correct offset so that %ebx would point to itself. The
- * thing that is tricky is that .-.L66 will point to the
- * beginning of the instruction, so we need to further modify
- * the operand so that it will point to itself. There are
- * other cases where you have something like:
- *
- * .long $_GLOBAL_OFFSET_TABLE_+[.-.L66]
- *
- * and here no correction would be required. Internally in
- * the assembler we treat operands of this form as not being
- * pcrel since the '.' is explicitly mentioned, and I wonder
- * whether it would simplify matters to do it this way. Who
- * knows. In earlier versions of the PIC patches, the
- * pcrel_adjust field was used to store the correction, but
- * since the expression is not pcrel, I felt it would be
- * confusing to do it this way. */
-
- if ((reloc_type == BFD_RELOC_32
- || reloc_type == BFD_RELOC_X86_64_32S
- || reloc_type == BFD_RELOC_64)
- && GOT_symbol
- && GOT_symbol == i.op[n].imms->X_add_symbol
- && (i.op[n].imms->X_op == O_symbol
- || (i.op[n].imms->X_op == O_add
- && ((symbol_get_value_expression
- (i.op[n].imms->X_op_symbol)->X_op)
- == O_subtract))))
- {
- offsetT add;
-
- if (insn_start_frag == frag_now)
- add = (p - frag_now->fr_literal) - insn_start_off;
- else
- {
- fragS *fr;
-
- add = insn_start_frag->fr_fix - insn_start_off;
- for (fr = insn_start_frag->fr_next;
- fr && fr != frag_now; fr = fr->fr_next)
- add += fr->fr_fix;
- add += p - frag_now->fr_literal;
- }
-
- if (!object_64bit)
- reloc_type = BFD_RELOC_386_GOTPC;
- else if (size == 4)
- reloc_type = BFD_RELOC_X86_64_GOTPC32;
- else if (size == 8)
- reloc_type = BFD_RELOC_X86_64_GOTPC64;
- i.op[n].imms->X_add_number += add;
- }
- fix_new_exp (frag_now, p - frag_now->fr_literal, size,
- i.op[n].imms, 0, reloc_type);
- }
- }
- }
-}
-
-/* x86_cons_fix_new is called via the expression parsing code when a
- reloc is needed. We use this hook to get the correct .got reloc. */
-static enum bfd_reloc_code_real got_reloc = NO_RELOC;
-static int cons_sign = -1;
-
-void
-x86_cons_fix_new (fragS *frag, unsigned int off, unsigned int len,
- expressionS *exp)
-{
- enum bfd_reloc_code_real r = reloc (len, 0, cons_sign, got_reloc);
-
- got_reloc = NO_RELOC;
-
-#ifdef TE_PE
- if (exp->X_op == O_secrel)
- {
- exp->X_op = O_symbol;
- r = BFD_RELOC_32_SECREL;
- }
-#endif
-
- fix_new_exp (frag, off, len, exp, 0, r);
-}
-
-#if (!defined (OBJ_ELF) && !defined (OBJ_MAYBE_ELF)) || defined (LEX_AT)
-# define lex_got(reloc, adjust, types) NULL
-#else
-/* Parse operands of the form
- <symbol>@GOTOFF+<nnn>
- and similar .plt or .got references.
-
- If we find one, set up the correct relocation in RELOC and copy the
- input string, minus the `@GOTOFF' into a malloc'd buffer for
- parsing by the calling routine. Return this buffer, and if ADJUST
- is non-null set it to the length of the string we removed from the
- input line. Otherwise return NULL. */
-static char *
-lex_got (enum bfd_reloc_code_real *reloc,
- int *adjust,
- i386_operand_type *types)
-{
- /* Some of the relocations depend on the size of what field is to
- be relocated. But in our callers i386_immediate and i386_displacement
- we don't yet know the operand size (this will be set by insn
- matching). Hence we record the word32 relocation here,
- and adjust the reloc according to the real size in reloc(). */
- static const struct {
- const char *str;
- const enum bfd_reloc_code_real rel[2];
- const i386_operand_type types64;
- } gotrel[] = {
- { "PLTOFF", { 0,
- BFD_RELOC_X86_64_PLTOFF64 },
- OPERAND_TYPE_IMM64 },
- { "PLT", { BFD_RELOC_386_PLT32,
- BFD_RELOC_X86_64_PLT32 },
- OPERAND_TYPE_IMM32_32S_DISP32 },
- { "GOTPLT", { 0,
- BFD_RELOC_X86_64_GOTPLT64 },
- OPERAND_TYPE_IMM64_DISP64 },
- { "GOTOFF", { BFD_RELOC_386_GOTOFF,
- BFD_RELOC_X86_64_GOTOFF64 },
- OPERAND_TYPE_IMM64_DISP64 },
- { "GOTPCREL", { 0,
- BFD_RELOC_X86_64_GOTPCREL },
- OPERAND_TYPE_IMM32_32S_DISP32 },
- { "TLSGD", { BFD_RELOC_386_TLS_GD,
- BFD_RELOC_X86_64_TLSGD },
- OPERAND_TYPE_IMM32_32S_DISP32 },
- { "TLSLDM", { BFD_RELOC_386_TLS_LDM,
- 0 },
- OPERAND_TYPE_NONE },
- { "TLSLD", { 0,
- BFD_RELOC_X86_64_TLSLD },
- OPERAND_TYPE_IMM32_32S_DISP32 },
- { "GOTTPOFF", { BFD_RELOC_386_TLS_IE_32,
- BFD_RELOC_X86_64_GOTTPOFF },
- OPERAND_TYPE_IMM32_32S_DISP32 },
- { "TPOFF", { BFD_RELOC_386_TLS_LE_32,
- BFD_RELOC_X86_64_TPOFF32 },
- OPERAND_TYPE_IMM32_32S_64_DISP32_64 },
- { "NTPOFF", { BFD_RELOC_386_TLS_LE,
- 0 },
- OPERAND_TYPE_NONE },
- { "DTPOFF", { BFD_RELOC_386_TLS_LDO_32,
- BFD_RELOC_X86_64_DTPOFF32 },
-
- OPERAND_TYPE_IMM32_32S_64_DISP32_64 },
- { "GOTNTPOFF",{ BFD_RELOC_386_TLS_GOTIE,
- 0 },
- OPERAND_TYPE_NONE },
- { "INDNTPOFF",{ BFD_RELOC_386_TLS_IE,
- 0 },
- OPERAND_TYPE_NONE },
- { "GOT", { BFD_RELOC_386_GOT32,
- BFD_RELOC_X86_64_GOT32 },
- OPERAND_TYPE_IMM32_32S_64_DISP32 },
- { "TLSDESC", { BFD_RELOC_386_TLS_GOTDESC,
- BFD_RELOC_X86_64_GOTPC32_TLSDESC },
- OPERAND_TYPE_IMM32_32S_DISP32 },
- { "TLSCALL", { BFD_RELOC_386_TLS_DESC_CALL,
- BFD_RELOC_X86_64_TLSDESC_CALL },
- OPERAND_TYPE_IMM32_32S_DISP32 },
- };
- char *cp;
- unsigned int j;
-
- if (!IS_ELF)
- return NULL;
-
- for (cp = input_line_pointer; *cp != '@'; cp++)
- if (is_end_of_line[(unsigned char) *cp] || *cp == ',')
- return NULL;
-
- for (j = 0; j < ARRAY_SIZE (gotrel); j++)
- {
- int len;
-
- len = strlen (gotrel[j].str);
- if (strncasecmp (cp + 1, gotrel[j].str, len) == 0)
- {
- if (gotrel[j].rel[object_64bit] != 0)
- {
- int first, second;
- char *tmpbuf, *past_reloc;
-
- *reloc = gotrel[j].rel[object_64bit];
- if (adjust)
- *adjust = len;
-
- if (types)
- {
- if (flag_code != CODE_64BIT)
- {
- types->bitfield.imm32 = 1;
- types->bitfield.disp32 = 1;
- }
- else
- *types = gotrel[j].types64;
- }
-
- if (GOT_symbol == NULL)
- GOT_symbol = symbol_find_or_make (GLOBAL_OFFSET_TABLE_NAME);
-
- /* The length of the first part of our input line. */
- first = cp - input_line_pointer;
-
- /* The second part goes from after the reloc token until
- (and including) an end_of_line char or comma. */
- past_reloc = cp + 1 + len;
- cp = past_reloc;
- while (!is_end_of_line[(unsigned char) *cp] && *cp != ',')
- ++cp;
- second = cp + 1 - past_reloc;
-
- /* Allocate and copy string. The trailing NUL shouldn't
- be necessary, but be safe. */
- tmpbuf = xmalloc (first + second + 2);
- memcpy (tmpbuf, input_line_pointer, first);
- if (second != 0 && *past_reloc != ' ')
- /* Replace the relocation token with ' ', so that
- errors like foo@GOTOFF1 will be detected. */
- tmpbuf[first++] = ' ';
- memcpy (tmpbuf + first, past_reloc, second);
- tmpbuf[first + second] = '\0';
- return tmpbuf;
- }
-
- as_bad (_("@%s reloc is not supported with %d-bit output format"),
- gotrel[j].str, 1 << (5 + object_64bit));
- return NULL;
- }
- }
-
- /* Might be a symbol version string. Don't as_bad here. */
- return NULL;
-}
-
-void
-x86_cons (expressionS *exp, int size)
-{
- if (size == 4 || (object_64bit && size == 8))
- {
- /* Handle @GOTOFF and the like in an expression. */
- char *save;
- char *gotfree_input_line;
- int adjust;
-
- save = input_line_pointer;
- gotfree_input_line = lex_got (&got_reloc, &adjust, NULL);
- if (gotfree_input_line)
- input_line_pointer = gotfree_input_line;
-
- expression (exp);
-
- if (gotfree_input_line)
- {
- /* expression () has merrily parsed up to the end of line,
- or a comma - in the wrong buffer. Transfer how far
- input_line_pointer has moved to the right buffer. */
- input_line_pointer = (save
- + (input_line_pointer - gotfree_input_line)
- + adjust);
- free (gotfree_input_line);
- if (exp->X_op == O_constant
- || exp->X_op == O_absent
- || exp->X_op == O_illegal
- || exp->X_op == O_register
- || exp->X_op == O_big)
- {
- char c = *input_line_pointer;
- *input_line_pointer = 0;
- as_bad (_("missing or invalid expression `%s'"), save);
- *input_line_pointer = c;
- }
- }
- }
- else
- expression (exp);
-}
-#endif
-
-static void signed_cons (int size)
-{
- if (flag_code == CODE_64BIT)
- cons_sign = 1;
- cons (size);
- cons_sign = -1;
-}
-
-#ifdef TE_PE
-static void
-pe_directive_secrel (dummy)
- int dummy ATTRIBUTE_UNUSED;
-{
- expressionS exp;
-
- do
- {
- expression (&exp);
- if (exp.X_op == O_symbol)
- exp.X_op = O_secrel;
-
- emit_expr (&exp, 4);
- }
- while (*input_line_pointer++ == ',');
-
- input_line_pointer--;
- demand_empty_rest_of_line ();
-}
-#endif
-
-static int
-i386_immediate (char *imm_start)
-{
- char *save_input_line_pointer;
- char *gotfree_input_line;
- segT exp_seg = 0;
- expressionS *exp;
- i386_operand_type types;
-
- operand_type_set (&types, ~0);
-
- if (i.imm_operands == MAX_IMMEDIATE_OPERANDS)
- {
- as_bad (_("at most %d immediate operands are allowed"),
- MAX_IMMEDIATE_OPERANDS);
- return 0;
- }
-
- exp = &im_expressions[i.imm_operands++];
- i.op[this_operand].imms = exp;
-
- if (is_space_char (*imm_start))
- ++imm_start;
-
- save_input_line_pointer = input_line_pointer;
- input_line_pointer = imm_start;
-
- gotfree_input_line = lex_got (&i.reloc[this_operand], NULL, &types);
- if (gotfree_input_line)
- input_line_pointer = gotfree_input_line;
-
- exp_seg = expression (exp);
-
- SKIP_WHITESPACE ();
- if (*input_line_pointer)
- as_bad (_("junk `%s' after expression"), input_line_pointer);
-
- input_line_pointer = save_input_line_pointer;
- if (gotfree_input_line)
- free (gotfree_input_line);
-
- if (exp->X_op == O_absent
- || exp->X_op == O_illegal
- || exp->X_op == O_big
- || (gotfree_input_line
- && (exp->X_op == O_constant
- || exp->X_op == O_register)))
- {
- as_bad (_("missing or invalid immediate expression `%s'"),
- imm_start);
- return 0;
- }
- else if (exp->X_op == O_constant)
- {
- /* Size it properly later. */
- i.types[this_operand].bitfield.imm64 = 1;
- /* If BFD64, sign extend val. */
- if (!use_rela_relocations
- && (exp->X_add_number & ~(((addressT) 2 << 31) - 1)) == 0)
- exp->X_add_number
- = (exp->X_add_number ^ ((addressT) 1 << 31)) - ((addressT) 1 << 31);
- }
-#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT))
- else if (OUTPUT_FLAVOR == bfd_target_aout_flavour
- && exp_seg != absolute_section
- && exp_seg != text_section
- && exp_seg != data_section
- && exp_seg != bss_section
- && exp_seg != undefined_section
- && !bfd_is_com_section (exp_seg))
- {
- as_bad (_("unimplemented segment %s in operand"), exp_seg->name);
- return 0;
- }
-#endif
- else if (!intel_syntax && exp->X_op == O_register)
- {
- as_bad (_("illegal immediate register operand %s"), imm_start);
- return 0;
- }
- else
- {
- /* This is an address. The size of the address will be
- determined later, depending on destination register,
- suffix, or the default for the section. */
- i.types[this_operand].bitfield.imm8 = 1;
- i.types[this_operand].bitfield.imm16 = 1;
- i.types[this_operand].bitfield.imm32 = 1;
- i.types[this_operand].bitfield.imm32s = 1;
- i.types[this_operand].bitfield.imm64 = 1;
- i.types[this_operand] = operand_type_and (i.types[this_operand],
- types);
- }
-
- return 1;
-}
-
-static char *
-i386_scale (char *scale)
-{
- offsetT val;
- char *save = input_line_pointer;
-
- input_line_pointer = scale;
- val = get_absolute_expression ();
-
- switch (val)
- {
- case 1:
- i.log2_scale_factor = 0;
- break;
- case 2:
- i.log2_scale_factor = 1;
- break;
- case 4:
- i.log2_scale_factor = 2;
- break;
- case 8:
- i.log2_scale_factor = 3;
- break;
- default:
- {
- char sep = *input_line_pointer;
-
- *input_line_pointer = '\0';
- as_bad (_("expecting scale factor of 1, 2, 4, or 8: got `%s'"),
- scale);
- *input_line_pointer = sep;
- input_line_pointer = save;
- return NULL;
- }
- }
- if (i.log2_scale_factor != 0 && i.index_reg == 0)
- {
- as_warn (_("scale factor of %d without an index register"),
- 1 << i.log2_scale_factor);
- i.log2_scale_factor = 0;
- }
- scale = input_line_pointer;
- input_line_pointer = save;
- return scale;
-}
-
-static int
-i386_displacement (char *disp_start, char *disp_end)
-{
- expressionS *exp;
- segT exp_seg = 0;
- char *save_input_line_pointer;
- char *gotfree_input_line;
- int override;
- i386_operand_type bigdisp, types = anydisp;
- int ret;
-
- if (i.disp_operands == MAX_MEMORY_OPERANDS)
- {
- as_bad (_("at most %d displacement operands are allowed"),
- MAX_MEMORY_OPERANDS);
- return 0;
- }
-
- operand_type_set (&bigdisp, 0);
- if ((i.types[this_operand].bitfield.jumpabsolute)
- || (!current_templates->start->opcode_modifier.jump
- && !current_templates->start->opcode_modifier.jumpdword))
- {
- bigdisp.bitfield.disp32 = 1;
- override = (i.prefix[ADDR_PREFIX] != 0);
- if (flag_code == CODE_64BIT)
- {
- if (!override)
- {
- bigdisp.bitfield.disp32s = 1;
- bigdisp.bitfield.disp64 = 1;
- }
- }
- else if ((flag_code == CODE_16BIT) ^ override)
- {
- bigdisp.bitfield.disp32 = 0;
- bigdisp.bitfield.disp16 = 1;
- }
- }
- else
- {
- /* For PC-relative branches, the width of the displacement
- is dependent upon data size, not address size. */
- override = (i.prefix[DATA_PREFIX] != 0);
- if (flag_code == CODE_64BIT)
- {
- if (override || i.suffix == WORD_MNEM_SUFFIX)
- bigdisp.bitfield.disp16 = 1;
- else
- {
- bigdisp.bitfield.disp32 = 1;
- bigdisp.bitfield.disp32s = 1;
- }
- }
- else
- {
- if (!override)
- override = (i.suffix == (flag_code != CODE_16BIT
- ? WORD_MNEM_SUFFIX
- : LONG_MNEM_SUFFIX));
- bigdisp.bitfield.disp32 = 1;
- if ((flag_code == CODE_16BIT) ^ override)
- {
- bigdisp.bitfield.disp32 = 0;
- bigdisp.bitfield.disp16 = 1;
- }
- }
- }
- i.types[this_operand] = operand_type_or (i.types[this_operand],
- bigdisp);
-
- exp = &disp_expressions[i.disp_operands];
- i.op[this_operand].disps = exp;
- i.disp_operands++;
- save_input_line_pointer = input_line_pointer;
- input_line_pointer = disp_start;
- END_STRING_AND_SAVE (disp_end);
-
-#ifndef GCC_ASM_O_HACK
-#define GCC_ASM_O_HACK 0
-#endif
-#if GCC_ASM_O_HACK
- END_STRING_AND_SAVE (disp_end + 1);
- if (i.types[this_operand].bitfield.baseIndex
- && displacement_string_end[-1] == '+')
- {
- /* This hack is to avoid a warning when using the "o"
- constraint within gcc asm statements.
- For instance:
-
- #define _set_tssldt_desc(n,addr,limit,type) \
- __asm__ __volatile__ ( \
- "movw %w2,%0\n\t" \
- "movw %w1,2+%0\n\t" \
- "rorl $16,%1\n\t" \
- "movb %b1,4+%0\n\t" \
- "movb %4,5+%0\n\t" \
- "movb $0,6+%0\n\t" \
- "movb %h1,7+%0\n\t" \
- "rorl $16,%1" \
- : "=o"(*(n)) : "q" (addr), "ri"(limit), "i"(type))
-
- This works great except that the output assembler ends
- up looking a bit weird if it turns out that there is
- no offset. You end up producing code that looks like:
-
- #APP
- movw $235,(%eax)
- movw %dx,2+(%eax)
- rorl $16,%edx
- movb %dl,4+(%eax)
- movb $137,5+(%eax)
- movb $0,6+(%eax)
- movb %dh,7+(%eax)
- rorl $16,%edx
- #NO_APP
-
- So here we provide the missing zero. */
-
- *displacement_string_end = '0';
- }
-#endif
- gotfree_input_line = lex_got (&i.reloc[this_operand], NULL, &types);
- if (gotfree_input_line)
- input_line_pointer = gotfree_input_line;
-
- exp_seg = expression (exp);
-
- SKIP_WHITESPACE ();
- if (*input_line_pointer)
- as_bad (_("junk `%s' after expression"), input_line_pointer);
-#if GCC_ASM_O_HACK
- RESTORE_END_STRING (disp_end + 1);
-#endif
- input_line_pointer = save_input_line_pointer;
- if (gotfree_input_line)
- free (gotfree_input_line);
- ret = 1;
-
- /* We do this to make sure that the section symbol is in
- the symbol table. We will ultimately change the relocation
- to be relative to the beginning of the section. */
- if (i.reloc[this_operand] == BFD_RELOC_386_GOTOFF
- || i.reloc[this_operand] == BFD_RELOC_X86_64_GOTPCREL
- || i.reloc[this_operand] == BFD_RELOC_X86_64_GOTOFF64)
- {
- if (exp->X_op != O_symbol)
- goto inv_disp;
-
- if (S_IS_LOCAL (exp->X_add_symbol)
- && S_GET_SEGMENT (exp->X_add_symbol) != undefined_section)
- section_symbol (S_GET_SEGMENT (exp->X_add_symbol));
- exp->X_op = O_subtract;
- exp->X_op_symbol = GOT_symbol;
- if (i.reloc[this_operand] == BFD_RELOC_X86_64_GOTPCREL)
- i.reloc[this_operand] = BFD_RELOC_32_PCREL;
- else if (i.reloc[this_operand] == BFD_RELOC_X86_64_GOTOFF64)
- i.reloc[this_operand] = BFD_RELOC_64;
- else
- i.reloc[this_operand] = BFD_RELOC_32;
- }
-
- else if (exp->X_op == O_absent
- || exp->X_op == O_illegal
- || exp->X_op == O_big
- || (gotfree_input_line
- && (exp->X_op == O_constant
- || exp->X_op == O_register)))
- {
- inv_disp:
- as_bad (_("missing or invalid displacement expression `%s'"),
- disp_start);
- ret = 0;
- }
-
-#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT))
- else if (exp->X_op != O_constant
- && OUTPUT_FLAVOR == bfd_target_aout_flavour
- && exp_seg != absolute_section
- && exp_seg != text_section
- && exp_seg != data_section
- && exp_seg != bss_section
- && exp_seg != undefined_section
- && !bfd_is_com_section (exp_seg))
- {
- as_bad (_("unimplemented segment %s in operand"), exp_seg->name);
- ret = 0;
- }
-#endif
-
- RESTORE_END_STRING (disp_end);
-
- /* Check if this is a displacement only operand. */
- bigdisp = i.types[this_operand];
- bigdisp.bitfield.disp8 = 0;
- bigdisp.bitfield.disp16 = 0;
- bigdisp.bitfield.disp32 = 0;
- bigdisp.bitfield.disp32s = 0;
- bigdisp.bitfield.disp64 = 0;
- if (operand_type_all_zero (&bigdisp))
- i.types[this_operand] = operand_type_and (i.types[this_operand],
- types);
-
- return ret;
-}
-
-/* Make sure the memory operand we've been dealt is valid.
- Return 1 on success, 0 on a failure. */
-
-static int
-i386_index_check (const char *operand_string)
-{
- int ok;
-#if INFER_ADDR_PREFIX
- int fudged = 0;
-
- tryprefix:
-#endif
- ok = 1;
- if (flag_code == CODE_64BIT)
- {
- if ((i.base_reg
- && ((i.prefix[ADDR_PREFIX] == 0
- && !i.base_reg->reg_type.bitfield.reg64)
- || (i.prefix[ADDR_PREFIX]
- && !i.base_reg->reg_type.bitfield.reg32))
- && (i.index_reg
- || i.base_reg->reg_num !=
- (i.prefix[ADDR_PREFIX] == 0 ? RegRip : RegEip)))
- || (i.index_reg
- && (!i.index_reg->reg_type.bitfield.baseindex
- || (i.prefix[ADDR_PREFIX] == 0
- && i.index_reg->reg_num != RegRiz
- && !i.index_reg->reg_type.bitfield.reg64
- )
- || (i.prefix[ADDR_PREFIX]
- && i.index_reg->reg_num != RegEiz
- && !i.index_reg->reg_type.bitfield.reg32))))
- ok = 0;
- }
- else
- {
- if ((flag_code == CODE_16BIT) ^ (i.prefix[ADDR_PREFIX] != 0))
- {
- /* 16bit checks. */
- if ((i.base_reg
- && (!i.base_reg->reg_type.bitfield.reg16
- || !i.base_reg->reg_type.bitfield.baseindex))
- || (i.index_reg
- && (!i.index_reg->reg_type.bitfield.reg16
- || !i.index_reg->reg_type.bitfield.baseindex
- || !(i.base_reg
- && i.base_reg->reg_num < 6
- && i.index_reg->reg_num >= 6
- && i.log2_scale_factor == 0))))
- ok = 0;
- }
- else
- {
- /* 32bit checks. */
- if ((i.base_reg
- && !i.base_reg->reg_type.bitfield.reg32)
- || (i.index_reg
- && ((!i.index_reg->reg_type.bitfield.reg32
- && i.index_reg->reg_num != RegEiz)
- || !i.index_reg->reg_type.bitfield.baseindex)))
- ok = 0;
- }
- }
- if (!ok)
- {
-#if INFER_ADDR_PREFIX
- if (i.prefix[ADDR_PREFIX] == 0)
- {
- i.prefix[ADDR_PREFIX] = ADDR_PREFIX_OPCODE;
- i.prefixes += 1;
- /* Change the size of any displacement too. At most one of
- Disp16 or Disp32 is set.
- FIXME. There doesn't seem to be any real need for separate
- Disp16 and Disp32 flags. The same goes for Imm16 and Imm32.
- Removing them would probably clean up the code quite a lot. */
- if (flag_code != CODE_64BIT
- && (i.types[this_operand].bitfield.disp16
- || i.types[this_operand].bitfield.disp32))
- i.types[this_operand]
- = operand_type_xor (i.types[this_operand], disp16_32);
- fudged = 1;
- goto tryprefix;
- }
- if (fudged)
- as_bad (_("`%s' is not a valid base/index expression"),
- operand_string);
- else
-#endif
- as_bad (_("`%s' is not a valid %s bit base/index expression"),
- operand_string,
- flag_code_names[flag_code]);
- }
- return ok;
-}
-
-/* Parse OPERAND_STRING into the i386_insn structure I. Returns non-zero
- on error. */
-
-static int
-i386_att_operand (char *operand_string)
-{
- const reg_entry *r;
- char *end_op;
- char *op_string = operand_string;
-
- if (is_space_char (*op_string))
- ++op_string;
-
- /* We check for an absolute prefix (differentiating,
- for example, 'jmp pc_relative_label' from 'jmp *absolute_label'. */
- if (*op_string == ABSOLUTE_PREFIX)
- {
- ++op_string;
- if (is_space_char (*op_string))
- ++op_string;
- i.types[this_operand].bitfield.jumpabsolute = 1;
- }
-
- /* Check if operand is a register. */
- if ((r = parse_register (op_string, &end_op)) != NULL)
- {
- i386_operand_type temp;
-
- /* Check for a segment override by searching for ':' after a
- segment register. */
- op_string = end_op;
- if (is_space_char (*op_string))
- ++op_string;
- if (*op_string == ':'
- && (r->reg_type.bitfield.sreg2
- || r->reg_type.bitfield.sreg3))
- {
- switch (r->reg_num)
- {
- case 0:
- i.seg[i.mem_operands] = &es;
- break;
- case 1:
- i.seg[i.mem_operands] = &cs;
- break;
- case 2:
- i.seg[i.mem_operands] = &ss;
- break;
- case 3:
- i.seg[i.mem_operands] = &ds;
- break;
- case 4:
- i.seg[i.mem_operands] = &fs;
- break;
- case 5:
- i.seg[i.mem_operands] = &gs;
- break;
- }
-
- /* Skip the ':' and whitespace. */
- ++op_string;
- if (is_space_char (*op_string))
- ++op_string;
-
- if (!is_digit_char (*op_string)
- && !is_identifier_char (*op_string)
- && *op_string != '('
- && *op_string != ABSOLUTE_PREFIX)
- {
- as_bad (_("bad memory operand `%s'"), op_string);
- return 0;
- }
- /* Handle case of %es:*foo. */
- if (*op_string == ABSOLUTE_PREFIX)
- {
- ++op_string;
- if (is_space_char (*op_string))
- ++op_string;
- i.types[this_operand].bitfield.jumpabsolute = 1;
- }
- goto do_memory_reference;
- }
- if (*op_string)
- {
- as_bad (_("junk `%s' after register"), op_string);
- return 0;
- }
- temp = r->reg_type;
- temp.bitfield.baseindex = 0;
- i.types[this_operand] = operand_type_or (i.types[this_operand],
- temp);
- i.types[this_operand].bitfield.unspecified = 0;
- i.op[this_operand].regs = r;
- i.reg_operands++;
- }
- else if (*op_string == REGISTER_PREFIX)
- {
- as_bad (_("bad register name `%s'"), op_string);
- return 0;
- }
- else if (*op_string == IMMEDIATE_PREFIX)
- {
- ++op_string;
- if (i.types[this_operand].bitfield.jumpabsolute)
- {
- as_bad (_("immediate operand illegal with absolute jump"));
- return 0;
- }
- if (!i386_immediate (op_string))
- return 0;
- }
- else if (is_digit_char (*op_string)
- || is_identifier_char (*op_string)
- || *op_string == '(')
- {
- /* This is a memory reference of some sort. */
- char *base_string;
-
- /* Start and end of displacement string expression (if found). */
- char *displacement_string_start;
- char *displacement_string_end;
-
- do_memory_reference:
- if ((i.mem_operands == 1
- && !current_templates->start->opcode_modifier.isstring)
- || i.mem_operands == 2)
- {
- as_bad (_("too many memory references for `%s'"),
- current_templates->start->name);
- return 0;
- }
-
- /* Check for base index form. We detect the base index form by
- looking for an ')' at the end of the operand, searching
- for the '(' matching it, and finding a REGISTER_PREFIX or ','
- after the '('. */
- base_string = op_string + strlen (op_string);
-
- --base_string;
- if (is_space_char (*base_string))
- --base_string;
-
- /* If we only have a displacement, set-up for it to be parsed later. */
- displacement_string_start = op_string;
- displacement_string_end = base_string + 1;
-
- if (*base_string == ')')
- {
- char *temp_string;
- unsigned int parens_balanced = 1;
- /* We've already checked that the number of left & right ()'s are
- equal, so this loop will not be infinite. */
- do
- {
- base_string--;
- if (*base_string == ')')
- parens_balanced++;
- if (*base_string == '(')
- parens_balanced--;
- }
- while (parens_balanced);
-
- temp_string = base_string;
-
- /* Skip past '(' and whitespace. */
- ++base_string;
- if (is_space_char (*base_string))
- ++base_string;
-
- if (*base_string == ','
- || ((i.base_reg = parse_register (base_string, &end_op))
- != NULL))
- {
- displacement_string_end = temp_string;
-
- i.types[this_operand].bitfield.baseindex = 1;
-
- if (i.base_reg)
- {
- base_string = end_op;
- if (is_space_char (*base_string))
- ++base_string;
- }
-
- /* There may be an index reg or scale factor here. */
- if (*base_string == ',')
- {
- ++base_string;
- if (is_space_char (*base_string))
- ++base_string;
-
- if ((i.index_reg = parse_register (base_string, &end_op))
- != NULL)
- {
- base_string = end_op;
- if (is_space_char (*base_string))
- ++base_string;
- if (*base_string == ',')
- {
- ++base_string;
- if (is_space_char (*base_string))
- ++base_string;
- }
- else if (*base_string != ')')
- {
- as_bad (_("expecting `,' or `)' "
- "after index register in `%s'"),
- operand_string);
- return 0;
- }
- }
- else if (*base_string == REGISTER_PREFIX)
- {
- as_bad (_("bad register name `%s'"), base_string);
- return 0;
- }
-
- /* Check for scale factor. */
- if (*base_string != ')')
- {
- char *end_scale = i386_scale (base_string);
-
- if (!end_scale)
- return 0;
-
- base_string = end_scale;
- if (is_space_char (*base_string))
- ++base_string;
- if (*base_string != ')')
- {
- as_bad (_("expecting `)' "
- "after scale factor in `%s'"),
- operand_string);
- return 0;
- }
- }
- else if (!i.index_reg)
- {
- as_bad (_("expecting index register or scale factor "
- "after `,'; got '%c'"),
- *base_string);
- return 0;
- }
- }
- else if (*base_string != ')')
- {
- as_bad (_("expecting `,' or `)' "
- "after base register in `%s'"),
- operand_string);
- return 0;
- }
- }
- else if (*base_string == REGISTER_PREFIX)
- {
- as_bad (_("bad register name `%s'"), base_string);
- return 0;
- }
- }
-
- /* If there's an expression beginning the operand, parse it,
- assuming displacement_string_start and
- displacement_string_end are meaningful. */
- if (displacement_string_start != displacement_string_end)
- {
- if (!i386_displacement (displacement_string_start,
- displacement_string_end))
- return 0;
- }
-
- /* Special case for (%dx) while doing input/output op. */
- if (i.base_reg
- && operand_type_equal (&i.base_reg->reg_type,
- &reg16_inoutportreg)
- && i.index_reg == 0
- && i.log2_scale_factor == 0
- && i.seg[i.mem_operands] == 0
- && !operand_type_check (i.types[this_operand], disp))
- {
- i.types[this_operand] = inoutportreg;
- return 1;
- }
-
- if (i386_index_check (operand_string) == 0)
- return 0;
- i.types[this_operand].bitfield.mem = 1;
- i.mem_operands++;
- }
- else
- {
- /* It's not a memory operand; argh! */
- as_bad (_("invalid char %s beginning operand %d `%s'"),
- output_invalid (*op_string),
- this_operand + 1,
- op_string);
- return 0;
- }
- return 1; /* Normal return. */
-}
-
-/* md_estimate_size_before_relax()
-
- Called just before relax() for rs_machine_dependent frags. The x86
- assembler uses these frags to handle variable size jump
- instructions.
-
- Any symbol that is now undefined will not become defined.
- Return the correct fr_subtype in the frag.
- Return the initial "guess for variable size of frag" to caller.
- The guess is actually the growth beyond the fixed part. Whatever
- we do to grow the fixed or variable part contributes to our
- returned value. */
-
-int
-md_estimate_size_before_relax (fragP, segment)
- fragS *fragP;
- segT segment;
-{
- /* We've already got fragP->fr_subtype right; all we have to do is
- check for un-relaxable symbols. On an ELF system, we can't relax
- an externally visible symbol, because it may be overridden by a
- shared library. */
- if (S_GET_SEGMENT (fragP->fr_symbol) != segment
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- || (IS_ELF
- && (S_IS_EXTERNAL (fragP->fr_symbol)
- || S_IS_WEAK (fragP->fr_symbol)))
-#endif
- )
- {
- /* Symbol is undefined in this segment, or we need to keep a
- reloc so that weak symbols can be overridden. */
- int size = (fragP->fr_subtype & CODE16) ? 2 : 4;
- enum bfd_reloc_code_real reloc_type;
- unsigned char *opcode;
- int old_fr_fix;
-
- if (fragP->fr_var != NO_RELOC)
- reloc_type = fragP->fr_var;
- else if (size == 2)
- reloc_type = BFD_RELOC_16_PCREL;
- else
- reloc_type = BFD_RELOC_32_PCREL;
-
- old_fr_fix = fragP->fr_fix;
- opcode = (unsigned char *) fragP->fr_opcode;
-
- switch (TYPE_FROM_RELAX_STATE (fragP->fr_subtype))
- {
- case UNCOND_JUMP:
- /* Make jmp (0xeb) a (d)word displacement jump. */
- opcode[0] = 0xe9;
- fragP->fr_fix += size;
- fix_new (fragP, old_fr_fix, size,
- fragP->fr_symbol,
- fragP->fr_offset, 1,
- reloc_type);
- break;
-
- case COND_JUMP86:
- if (size == 2
- && (!no_cond_jump_promotion || fragP->fr_var != NO_RELOC))
- {
- /* Negate the condition, and branch past an
- unconditional jump. */
- opcode[0] ^= 1;
- opcode[1] = 3;
- /* Insert an unconditional jump. */
- opcode[2] = 0xe9;
- /* We added two extra opcode bytes, and have a two byte
- offset. */
- fragP->fr_fix += 2 + 2;
- fix_new (fragP, old_fr_fix + 2, 2,
- fragP->fr_symbol,
- fragP->fr_offset, 1,
- reloc_type);
- break;
- }
- /* Fall through. */
-
- case COND_JUMP:
- if (no_cond_jump_promotion && fragP->fr_var == NO_RELOC)
- {
- fixS *fixP;
-
- fragP->fr_fix += 1;
- fixP = fix_new (fragP, old_fr_fix, 1,
- fragP->fr_symbol,
- fragP->fr_offset, 1,
- BFD_RELOC_8_PCREL);
- fixP->fx_signed = 1;
- break;
- }
-
- /* This changes the byte-displacement jump 0x7N
- to the (d)word-displacement jump 0x0f,0x8N. */
- opcode[1] = opcode[0] + 0x10;
- opcode[0] = TWO_BYTE_OPCODE_ESCAPE;
- /* We've added an opcode byte. */
- fragP->fr_fix += 1 + size;
- fix_new (fragP, old_fr_fix + 1, size,
- fragP->fr_symbol,
- fragP->fr_offset, 1,
- reloc_type);
- break;
-
- default:
- BAD_CASE (fragP->fr_subtype);
- break;
- }
- frag_wane (fragP);
- return fragP->fr_fix - old_fr_fix;
- }
-
- /* Guess size depending on current relax state. Initially the relax
- state will correspond to a short jump and we return 1, because
- the variable part of the frag (the branch offset) is one byte
- long. However, we can relax a section more than once and in that
- case we must either set fr_subtype back to the unrelaxed state,
- or return the value for the appropriate branch. */
- return md_relax_table[fragP->fr_subtype].rlx_length;
-}
-
-/* Called after relax() is finished.
-
- In: Address of frag.
- fr_type == rs_machine_dependent.
- fr_subtype is what the address relaxed to.
-
- Out: Any fixSs and constants are set up.
- Caller will turn frag into a ".space 0". */
-
-void
-md_convert_frag (abfd, sec, fragP)
- bfd *abfd ATTRIBUTE_UNUSED;
- segT sec ATTRIBUTE_UNUSED;
- fragS *fragP;
-{
- unsigned char *opcode;
- unsigned char *where_to_put_displacement = NULL;
- offsetT target_address;
- offsetT opcode_address;
- unsigned int extension = 0;
- offsetT displacement_from_opcode_start;
-
- opcode = (unsigned char *) fragP->fr_opcode;
-
- /* Address we want to reach in file space. */
- target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset;
-
- /* Address opcode resides at in file space. */
- opcode_address = fragP->fr_address + fragP->fr_fix;
-
- /* Displacement from opcode start to fill into instruction. */
- displacement_from_opcode_start = target_address - opcode_address;
-
- if ((fragP->fr_subtype & BIG) == 0)
- {
- /* Don't have to change opcode. */
- extension = 1; /* 1 opcode + 1 displacement */
- where_to_put_displacement = &opcode[1];
- }
- else
- {
- if (no_cond_jump_promotion
- && TYPE_FROM_RELAX_STATE (fragP->fr_subtype) != UNCOND_JUMP)
- as_warn_where (fragP->fr_file, fragP->fr_line,
- _("long jump required"));
-
- switch (fragP->fr_subtype)
- {
- case ENCODE_RELAX_STATE (UNCOND_JUMP, BIG):
- extension = 4; /* 1 opcode + 4 displacement */
- opcode[0] = 0xe9;
- where_to_put_displacement = &opcode[1];
- break;
-
- case ENCODE_RELAX_STATE (UNCOND_JUMP, BIG16):
- extension = 2; /* 1 opcode + 2 displacement */
- opcode[0] = 0xe9;
- where_to_put_displacement = &opcode[1];
- break;
-
- case ENCODE_RELAX_STATE (COND_JUMP, BIG):
- case ENCODE_RELAX_STATE (COND_JUMP86, BIG):
- extension = 5; /* 2 opcode + 4 displacement */
- opcode[1] = opcode[0] + 0x10;
- opcode[0] = TWO_BYTE_OPCODE_ESCAPE;
- where_to_put_displacement = &opcode[2];
- break;
-
- case ENCODE_RELAX_STATE (COND_JUMP, BIG16):
- extension = 3; /* 2 opcode + 2 displacement */
- opcode[1] = opcode[0] + 0x10;
- opcode[0] = TWO_BYTE_OPCODE_ESCAPE;
- where_to_put_displacement = &opcode[2];
- break;
-
- case ENCODE_RELAX_STATE (COND_JUMP86, BIG16):
- extension = 4;
- opcode[0] ^= 1;
- opcode[1] = 3;
- opcode[2] = 0xe9;
- where_to_put_displacement = &opcode[3];
- break;
-
- default:
- BAD_CASE (fragP->fr_subtype);
- break;
- }
- }
-
- /* If size if less then four we are sure that the operand fits,
- but if it's 4, then it could be that the displacement is larger
- then -/+ 2GB. */
- if (DISP_SIZE_FROM_RELAX_STATE (fragP->fr_subtype) == 4
- && object_64bit
- && ((addressT) (displacement_from_opcode_start - extension
- + ((addressT) 1 << 31))
- > (((addressT) 2 << 31) - 1)))
- {
- as_bad_where (fragP->fr_file, fragP->fr_line,
- _("jump target out of range"));
- /* Make us emit 0. */
- displacement_from_opcode_start = extension;
- }
- /* Now put displacement after opcode. */
- md_number_to_chars ((char *) where_to_put_displacement,
- (valueT) (displacement_from_opcode_start - extension),
- DISP_SIZE_FROM_RELAX_STATE (fragP->fr_subtype));
- fragP->fr_fix += extension;
-}
-
-/* Apply a fixup (fixS) to segment data, once it has been determined
- by our caller that we have all the info we need to fix it up.
-
- On the 386, immediates, displacements, and data pointers are all in
- the same (little-endian) format, so we don't need to care about which
- we are handling. */
-
-void
-md_apply_fix (fixP, valP, seg)
- /* The fix we're to put in. */
- fixS *fixP;
- /* Pointer to the value of the bits. */
- valueT *valP;
- /* Segment fix is from. */
- segT seg ATTRIBUTE_UNUSED;
-{
- char *p = fixP->fx_where + fixP->fx_frag->fr_literal;
- valueT value = *valP;
-
-#if !defined (TE_Mach)
- if (fixP->fx_pcrel)
- {
- switch (fixP->fx_r_type)
- {
- default:
- break;
-
- case BFD_RELOC_64:
- fixP->fx_r_type = BFD_RELOC_64_PCREL;
- break;
- case BFD_RELOC_32:
- case BFD_RELOC_X86_64_32S:
- fixP->fx_r_type = BFD_RELOC_32_PCREL;
- break;
- case BFD_RELOC_16:
- fixP->fx_r_type = BFD_RELOC_16_PCREL;
- break;
- case BFD_RELOC_8:
- fixP->fx_r_type = BFD_RELOC_8_PCREL;
- break;
- }
- }
-
- if (fixP->fx_addsy != NULL
- && (fixP->fx_r_type == BFD_RELOC_32_PCREL
- || fixP->fx_r_type == BFD_RELOC_64_PCREL
- || fixP->fx_r_type == BFD_RELOC_16_PCREL
- || fixP->fx_r_type == BFD_RELOC_8_PCREL)
- && !use_rela_relocations)
- {
- /* This is a hack. There should be a better way to handle this.
- This covers for the fact that bfd_install_relocation will
- subtract the current location (for partial_inplace, PC relative
- relocations); see more below. */
-#ifndef OBJ_AOUT
- if (IS_ELF
-#ifdef TE_PE
- || OUTPUT_FLAVOR == bfd_target_coff_flavour
-#endif
- )
- value += fixP->fx_where + fixP->fx_frag->fr_address;
-#endif
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- if (IS_ELF)
- {
- segT sym_seg = S_GET_SEGMENT (fixP->fx_addsy);
-
- if ((sym_seg == seg
- || (symbol_section_p (fixP->fx_addsy)
- && sym_seg != absolute_section))
- && !generic_force_reloc (fixP))
- {
- /* Yes, we add the values in twice. This is because
- bfd_install_relocation subtracts them out again. I think
- bfd_install_relocation is broken, but I don't dare change
- it. FIXME. */
- value += fixP->fx_where + fixP->fx_frag->fr_address;
- }
- }
-#endif
-#if defined (OBJ_COFF) && defined (TE_PE)
- /* For some reason, the PE format does not store a
- section address offset for a PC relative symbol. */
- if (S_GET_SEGMENT (fixP->fx_addsy) != seg
- || S_IS_WEAK (fixP->fx_addsy))
- value += md_pcrel_from (fixP);
-#endif
- }
-
- /* Fix a few things - the dynamic linker expects certain values here,
- and we must not disappoint it. */
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- if (IS_ELF && fixP->fx_addsy)
- switch (fixP->fx_r_type)
- {
- case BFD_RELOC_386_PLT32:
- case BFD_RELOC_X86_64_PLT32:
- /* Make the jump instruction point to the address of the operand. At
- runtime we merely add the offset to the actual PLT entry. */
- value = -4;
- break;
-
- case BFD_RELOC_386_TLS_GD:
- case BFD_RELOC_386_TLS_LDM:
- case BFD_RELOC_386_TLS_IE_32:
- case BFD_RELOC_386_TLS_IE:
- case BFD_RELOC_386_TLS_GOTIE:
- case BFD_RELOC_386_TLS_GOTDESC:
- case BFD_RELOC_X86_64_TLSGD:
- case BFD_RELOC_X86_64_TLSLD:
- case BFD_RELOC_X86_64_GOTTPOFF:
- case BFD_RELOC_X86_64_GOTPC32_TLSDESC:
- value = 0; /* Fully resolved at runtime. No addend. */
- /* Fallthrough */
- case BFD_RELOC_386_TLS_LE:
- case BFD_RELOC_386_TLS_LDO_32:
- case BFD_RELOC_386_TLS_LE_32:
- case BFD_RELOC_X86_64_DTPOFF32:
- case BFD_RELOC_X86_64_DTPOFF64:
- case BFD_RELOC_X86_64_TPOFF32:
- case BFD_RELOC_X86_64_TPOFF64:
- S_SET_THREAD_LOCAL (fixP->fx_addsy);
- break;
-
- case BFD_RELOC_386_TLS_DESC_CALL:
- case BFD_RELOC_X86_64_TLSDESC_CALL:
- value = 0; /* Fully resolved at runtime. No addend. */
- S_SET_THREAD_LOCAL (fixP->fx_addsy);
- fixP->fx_done = 0;
- return;
-
- case BFD_RELOC_386_GOT32:
- case BFD_RELOC_X86_64_GOT32:
- value = 0; /* Fully resolved at runtime. No addend. */
- break;
-
- case BFD_RELOC_VTABLE_INHERIT:
- case BFD_RELOC_VTABLE_ENTRY:
- fixP->fx_done = 0;
- return;
-
- default:
- break;
- }
-#endif /* defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) */
- *valP = value;
-#endif /* !defined (TE_Mach) */
-
- /* Are we finished with this relocation now? */
- if (fixP->fx_addsy == NULL)
- fixP->fx_done = 1;
- else if (use_rela_relocations)
- {
- fixP->fx_no_overflow = 1;
- /* Remember value for tc_gen_reloc. */
- fixP->fx_addnumber = value;
- value = 0;
- }
-
- md_number_to_chars (p, value, fixP->fx_size);
-}
-
-char *
-md_atof (int type, char *litP, int *sizeP)
-{
- /* This outputs the LITTLENUMs in REVERSE order;
- in accord with the bigendian 386. */
- return ieee_md_atof (type, litP, sizeP, FALSE);
-}
-
-static char output_invalid_buf[sizeof (unsigned char) * 2 + 6];
-
-static char *
-output_invalid (int c)
-{
- if (ISPRINT (c))
- snprintf (output_invalid_buf, sizeof (output_invalid_buf),
- "'%c'", c);
- else
- snprintf (output_invalid_buf, sizeof (output_invalid_buf),
- "(0x%x)", (unsigned char) c);
- return output_invalid_buf;
-}
-
-/* REG_STRING starts *before* REGISTER_PREFIX. */
-
-static const reg_entry *
-parse_real_register (char *reg_string, char **end_op)
-{
- char *s = reg_string;
- char *p;
- char reg_name_given[MAX_REG_NAME_SIZE + 1];
- const reg_entry *r;
-
- /* Skip possible REGISTER_PREFIX and possible whitespace. */
- if (*s == REGISTER_PREFIX)
- ++s;
-
- if (is_space_char (*s))
- ++s;
-
- p = reg_name_given;
- while ((*p++ = register_chars[(unsigned char) *s]) != '\0')
- {
- if (p >= reg_name_given + MAX_REG_NAME_SIZE)
- return (const reg_entry *) NULL;
- s++;
- }
-
- /* For naked regs, make sure that we are not dealing with an identifier.
- This prevents confusing an identifier like `eax_var' with register
- `eax'. */
- if (allow_naked_reg && identifier_chars[(unsigned char) *s])
- return (const reg_entry *) NULL;
-
- *end_op = s;
-
- r = (const reg_entry *) hash_find (reg_hash, reg_name_given);
-
- /* Handle floating point regs, allowing spaces in the (i) part. */
- if (r == i386_regtab /* %st is first entry of table */)
- {
- if (is_space_char (*s))
- ++s;
- if (*s == '(')
- {
- ++s;
- if (is_space_char (*s))
- ++s;
- if (*s >= '0' && *s <= '7')
- {
- int fpr = *s - '0';
- ++s;
- if (is_space_char (*s))
- ++s;
- if (*s == ')')
- {
- *end_op = s + 1;
- r = hash_find (reg_hash, "st(0)");
- know (r);
- return r + fpr;
- }
- }
- /* We have "%st(" then garbage. */
- return (const reg_entry *) NULL;
- }
- }
-
- if (r == NULL || allow_pseudo_reg)
- return r;
-
- if (operand_type_all_zero (&r->reg_type))
- return (const reg_entry *) NULL;
-
- if ((r->reg_type.bitfield.reg32
- || r->reg_type.bitfield.sreg3
- || r->reg_type.bitfield.control
- || r->reg_type.bitfield.debug
- || r->reg_type.bitfield.test)
- && !cpu_arch_flags.bitfield.cpui386)
- return (const reg_entry *) NULL;
-
- if (r->reg_type.bitfield.regmmx && !cpu_arch_flags.bitfield.cpummx)
- return (const reg_entry *) NULL;
-
- if (r->reg_type.bitfield.regxmm && !cpu_arch_flags.bitfield.cpusse)
- return (const reg_entry *) NULL;
-
- if (r->reg_type.bitfield.regymm && !cpu_arch_flags.bitfield.cpuavx)
- return (const reg_entry *) NULL;
-
- /* Don't allow fake index register unless allow_index_reg isn't 0. */
- if (!allow_index_reg
- && (r->reg_num == RegEiz || r->reg_num == RegRiz))
- return (const reg_entry *) NULL;
-
- if (((r->reg_flags & (RegRex64 | RegRex))
- || r->reg_type.bitfield.reg64)
- && (!cpu_arch_flags.bitfield.cpulm
- || !operand_type_equal (&r->reg_type, &control))
- && flag_code != CODE_64BIT)
- return (const reg_entry *) NULL;
-
- if (r->reg_type.bitfield.sreg3 && r->reg_num == RegFlat && !intel_syntax)
- return (const reg_entry *) NULL;
-
- return r;
-}
-
-/* REG_STRING starts *before* REGISTER_PREFIX. */
-
-static const reg_entry *
-parse_register (char *reg_string, char **end_op)
-{
- const reg_entry *r;
-
- if (*reg_string == REGISTER_PREFIX || allow_naked_reg)
- r = parse_real_register (reg_string, end_op);
- else
- r = NULL;
- if (!r)
- {
- char *save = input_line_pointer;
- char c;
- symbolS *symbolP;
-
- input_line_pointer = reg_string;
- c = get_symbol_end ();
- symbolP = symbol_find (reg_string);
- if (symbolP && S_GET_SEGMENT (symbolP) == reg_section)
- {
- const expressionS *e = symbol_get_value_expression (symbolP);
-
- know (e->X_op == O_register);
- know (e->X_add_number >= 0
- && (valueT) e->X_add_number < i386_regtab_size);
- r = i386_regtab + e->X_add_number;
- *end_op = input_line_pointer;
- }
- *input_line_pointer = c;
- input_line_pointer = save;
- }
- return r;
-}
-
-int
-i386_parse_name (char *name, expressionS *e, char *nextcharP)
-{
- const reg_entry *r;
- char *end = input_line_pointer;
-
- *end = *nextcharP;
- r = parse_register (name, &input_line_pointer);
- if (r && end <= input_line_pointer)
- {
- *nextcharP = *input_line_pointer;
- *input_line_pointer = 0;
- e->X_op = O_register;
- e->X_add_number = r - i386_regtab;
- return 1;
- }
- input_line_pointer = end;
- *end = 0;
- return 0;
-}
-
-void
-md_operand (expressionS *e)
-{
- if (*input_line_pointer == REGISTER_PREFIX)
- {
- char *end;
- const reg_entry *r = parse_real_register (input_line_pointer, &end);
-
- if (r)
- {
- e->X_op = O_register;
- e->X_add_number = r - i386_regtab;
- input_line_pointer = end;
- }
- }
-}
-
-
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-const char *md_shortopts = "kVQ:sqn";
-#else
-const char *md_shortopts = "qn";
-#endif
-
-#define OPTION_32 (OPTION_MD_BASE + 0)
-#define OPTION_64 (OPTION_MD_BASE + 1)
-#define OPTION_DIVIDE (OPTION_MD_BASE + 2)
-#define OPTION_MARCH (OPTION_MD_BASE + 3)
-#define OPTION_MTUNE (OPTION_MD_BASE + 4)
-#define OPTION_MMNEMONIC (OPTION_MD_BASE + 5)
-#define OPTION_MSYNTAX (OPTION_MD_BASE + 6)
-#define OPTION_MINDEX_REG (OPTION_MD_BASE + 7)
-#define OPTION_MNAKED_REG (OPTION_MD_BASE + 8)
-#define OPTION_MOLD_GCC (OPTION_MD_BASE + 9)
-#define OPTION_MSSE2AVX (OPTION_MD_BASE + 10)
-#define OPTION_MSSE_CHECK (OPTION_MD_BASE + 11)
-
-struct option md_longopts[] =
-{
- {"32", no_argument, NULL, OPTION_32},
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP)
- {"64", no_argument, NULL, OPTION_64},
-#endif
- {"divide", no_argument, NULL, OPTION_DIVIDE},
- {"march", required_argument, NULL, OPTION_MARCH},
- {"mtune", required_argument, NULL, OPTION_MTUNE},
- {"mmnemonic", required_argument, NULL, OPTION_MMNEMONIC},
- {"msyntax", required_argument, NULL, OPTION_MSYNTAX},
- {"mindex-reg", no_argument, NULL, OPTION_MINDEX_REG},
- {"mnaked-reg", no_argument, NULL, OPTION_MNAKED_REG},
- {"mold-gcc", no_argument, NULL, OPTION_MOLD_GCC},
- {"msse2avx", no_argument, NULL, OPTION_MSSE2AVX},
- {"msse-check", required_argument, NULL, OPTION_MSSE_CHECK},
- {NULL, no_argument, NULL, 0}
-};
-size_t md_longopts_size = sizeof (md_longopts);
-
-int
-md_parse_option (int c, char *arg)
-{
- unsigned int i;
- char *arch, *next;
-
- switch (c)
- {
- case 'n':
- optimize_align_code = 0;
- break;
-
- case 'q':
- quiet_warnings = 1;
- break;
-
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- /* -Qy, -Qn: SVR4 arguments controlling whether a .comment section
- should be emitted or not. FIXME: Not implemented. */
- case 'Q':
- break;
-
- /* -V: SVR4 argument to print version ID. */
- case 'V':
- print_version_id ();
- break;
-
- /* -k: Ignore for FreeBSD compatibility. */
- case 'k':
- break;
-
- case 's':
- /* -s: On i386 Solaris, this tells the native assembler to use
- .stab instead of .stab.excl. We always use .stab anyhow. */
- break;
-#endif
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP)
- case OPTION_64:
- {
- const char **list, **l;
-
- list = bfd_target_list ();
- for (l = list; *l != NULL; l++)
- if (CONST_STRNEQ (*l, "elf64-x86-64")
- || strcmp (*l, "coff-x86-64") == 0
- || strcmp (*l, "pe-x86-64") == 0
- || strcmp (*l, "pei-x86-64") == 0)
- {
- default_arch = "x86_64";
- break;
- }
- if (*l == NULL)
- as_fatal (_("No compiled in support for x86_64"));
- free (list);
- }
- break;
-#endif
-
- case OPTION_32:
- default_arch = "i386";
- break;
-
- case OPTION_DIVIDE:
-#ifdef SVR4_COMMENT_CHARS
- {
- char *n, *t;
- const char *s;
-
- n = (char *) xmalloc (strlen (i386_comment_chars) + 1);
- t = n;
- for (s = i386_comment_chars; *s != '\0'; s++)
- if (*s != '/')
- *t++ = *s;
- *t = '\0';
- i386_comment_chars = n;
- }
-#endif
- break;
-
- case OPTION_MARCH:
- arch = xstrdup (arg);
- do
- {
- if (*arch == '.')
- as_fatal (_("Invalid -march= option: `%s'"), arg);
- next = strchr (arch, '+');
- if (next)
- *next++ = '\0';
- for (i = 0; i < ARRAY_SIZE (cpu_arch); i++)
- {
- if (strcmp (arch, cpu_arch [i].name) == 0)
- {
- /* Processor. */
- cpu_arch_name = cpu_arch[i].name;
- cpu_sub_arch_name = NULL;
- cpu_arch_flags = cpu_arch[i].flags;
- cpu_arch_isa = cpu_arch[i].type;
- cpu_arch_isa_flags = cpu_arch[i].flags;
- if (!cpu_arch_tune_set)
- {
- cpu_arch_tune = cpu_arch_isa;
- cpu_arch_tune_flags = cpu_arch_isa_flags;
- }
- break;
- }
- else if (*cpu_arch [i].name == '.'
- && strcmp (arch, cpu_arch [i].name + 1) == 0)
- {
- /* ISA entension. */
- i386_cpu_flags flags;
- flags = cpu_flags_or (cpu_arch_flags,
- cpu_arch[i].flags);
- if (!cpu_flags_equal (&flags, &cpu_arch_flags))
- {
- if (cpu_sub_arch_name)
- {
- char *name = cpu_sub_arch_name;
- cpu_sub_arch_name = concat (name,
- cpu_arch[i].name,
- (const char *) NULL);
- free (name);
- }
- else
- cpu_sub_arch_name = xstrdup (cpu_arch[i].name);
- cpu_arch_flags = flags;
- }
- break;
- }
- }
-
- if (i >= ARRAY_SIZE (cpu_arch))
- as_fatal (_("Invalid -march= option: `%s'"), arg);
-
- arch = next;
- }
- while (next != NULL );
- break;
-
- case OPTION_MTUNE:
- if (*arg == '.')
- as_fatal (_("Invalid -mtune= option: `%s'"), arg);
- for (i = 0; i < ARRAY_SIZE (cpu_arch); i++)
- {
- if (strcmp (arg, cpu_arch [i].name) == 0)
- {
- cpu_arch_tune_set = 1;
- cpu_arch_tune = cpu_arch [i].type;
- cpu_arch_tune_flags = cpu_arch[i].flags;
- break;
- }
- }
- if (i >= ARRAY_SIZE (cpu_arch))
- as_fatal (_("Invalid -mtune= option: `%s'"), arg);
- break;
-
- case OPTION_MMNEMONIC:
- if (strcasecmp (arg, "att") == 0)
- intel_mnemonic = 0;
- else if (strcasecmp (arg, "intel") == 0)
- intel_mnemonic = 1;
- else
- as_fatal (_("Invalid -mmnemonic= option: `%s'"), arg);
- break;
-
- case OPTION_MSYNTAX:
- if (strcasecmp (arg, "att") == 0)
- intel_syntax = 0;
- else if (strcasecmp (arg, "intel") == 0)
- intel_syntax = 1;
- else
- as_fatal (_("Invalid -msyntax= option: `%s'"), arg);
- break;
-
- case OPTION_MINDEX_REG:
- allow_index_reg = 1;
- break;
-
- case OPTION_MNAKED_REG:
- allow_naked_reg = 1;
- break;
-
- case OPTION_MOLD_GCC:
- old_gcc = 1;
- break;
-
- case OPTION_MSSE2AVX:
- sse2avx = 1;
- break;
-
- case OPTION_MSSE_CHECK:
- if (strcasecmp (arg, "error") == 0)
- sse_check = sse_check_error;
- else if (strcasecmp (arg, "warning") == 0)
- sse_check = sse_check_warning;
- else if (strcasecmp (arg, "none") == 0)
- sse_check = sse_check_none;
- else
- as_fatal (_("Invalid -msse-check= option: `%s'"), arg);
- break;
-
- default:
- return 0;
- }
- return 1;
-}
-
-void
-md_show_usage (stream)
- FILE *stream;
-{
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- fprintf (stream, _("\
- -Q ignored\n\
- -V print assembler version number\n\
- -k ignored\n"));
-#endif
- fprintf (stream, _("\
- -n Do not optimize code alignment\n\
- -q quieten some warnings\n"));
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- fprintf (stream, _("\
- -s ignored\n"));
-#endif
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined(TE_PEP)
- fprintf (stream, _("\
- --32/--64 generate 32bit/64bit code\n"));
-#endif
-#ifdef SVR4_COMMENT_CHARS
- fprintf (stream, _("\
- --divide do not treat `/' as a comment character\n"));
-#else
- fprintf (stream, _("\
- --divide ignored\n"));
-#endif
- fprintf (stream, _("\
- -march=CPU[,+EXTENSION...]\n\
- generate code for CPU and EXTENSION, CPU is one of:\n\
- i8086, i186, i286, i386, i486, pentium, pentiumpro,\n\
- pentiumii, pentiumiii, pentium4, prescott, nocona,\n\
- core, core2, k6, k6_2, athlon, k8, amdfam10,\n\
- generic32, generic64\n\
- EXTENSION is combination of:\n\
- mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, sse4,\n\
- avx, vmx, smx, xsave, movbe, ept, aes, pclmul, fma,\n\
- 3dnow, 3dnowa, sse4a, sse5, svme, abm, padlock\n"));
- fprintf (stream, _("\
- -mtune=CPU optimize for CPU, CPU is one of:\n\
- i8086, i186, i286, i386, i486, pentium, pentiumpro,\n\
- pentiumii, pentiumiii, pentium4, prescott, nocona,\n\
- core, core2, k6, k6_2, athlon, k8, amdfam10,\n\
- generic32, generic64\n"));
- fprintf (stream, _("\
- -msse2avx encode SSE instructions with VEX prefix\n"));
- fprintf (stream, _("\
- -msse-check=[none|error|warning]\n\
- check SSE instructions\n"));
- fprintf (stream, _("\
- -mmnemonic=[att|intel] use AT&T/Intel mnemonic\n"));
- fprintf (stream, _("\
- -msyntax=[att|intel] use AT&T/Intel syntax\n"));
- fprintf (stream, _("\
- -mindex-reg support pseudo index registers\n"));
- fprintf (stream, _("\
- -mnaked-reg don't require `%%' prefix for registers\n"));
- fprintf (stream, _("\
- -mold-gcc support old (<= 2.8.1) versions of gcc\n"));
-}
-
-#if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \
- || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined (TE_PEP))
-
-/* Pick the target format to use. */
-
-const char *
-i386_target_format (void)
-{
- if (!strcmp (default_arch, "x86_64"))
- {
- set_code_flag (CODE_64BIT);
- if (cpu_flags_all_zero (&cpu_arch_isa_flags))
- {
- cpu_arch_isa_flags.bitfield.cpui186 = 1;
- cpu_arch_isa_flags.bitfield.cpui286 = 1;
- cpu_arch_isa_flags.bitfield.cpui386 = 1;
- cpu_arch_isa_flags.bitfield.cpui486 = 1;
- cpu_arch_isa_flags.bitfield.cpui586 = 1;
- cpu_arch_isa_flags.bitfield.cpui686 = 1;
- cpu_arch_isa_flags.bitfield.cpup4 = 1;
- cpu_arch_isa_flags.bitfield.cpummx= 1;
- cpu_arch_isa_flags.bitfield.cpusse = 1;
- cpu_arch_isa_flags.bitfield.cpusse2 = 1;
- }
- if (cpu_flags_all_zero (&cpu_arch_tune_flags))
- {
- cpu_arch_tune_flags.bitfield.cpui186 = 1;
- cpu_arch_tune_flags.bitfield.cpui286 = 1;
- cpu_arch_tune_flags.bitfield.cpui386 = 1;
- cpu_arch_tune_flags.bitfield.cpui486 = 1;
- cpu_arch_tune_flags.bitfield.cpui586 = 1;
- cpu_arch_tune_flags.bitfield.cpui686 = 1;
- cpu_arch_tune_flags.bitfield.cpup4 = 1;
- cpu_arch_tune_flags.bitfield.cpummx= 1;
- cpu_arch_tune_flags.bitfield.cpusse = 1;
- cpu_arch_tune_flags.bitfield.cpusse2 = 1;
- }
- }
- else if (!strcmp (default_arch, "i386"))
- {
- set_code_flag (CODE_32BIT);
- if (cpu_flags_all_zero (&cpu_arch_isa_flags))
- {
- cpu_arch_isa_flags.bitfield.cpui186 = 1;
- cpu_arch_isa_flags.bitfield.cpui286 = 1;
- cpu_arch_isa_flags.bitfield.cpui386 = 1;
- }
- if (cpu_flags_all_zero (&cpu_arch_tune_flags))
- {
- cpu_arch_tune_flags.bitfield.cpui186 = 1;
- cpu_arch_tune_flags.bitfield.cpui286 = 1;
- cpu_arch_tune_flags.bitfield.cpui386 = 1;
- }
- }
- else
- as_fatal (_("Unknown architecture"));
- switch (OUTPUT_FLAVOR)
- {
-#ifdef TE_PEP
- case bfd_target_coff_flavour:
- return flag_code == CODE_64BIT ? COFF_TARGET_FORMAT : "coff-i386";
- break;
-#endif
-#ifdef OBJ_MAYBE_AOUT
- case bfd_target_aout_flavour:
- return AOUT_TARGET_FORMAT;
-#endif
-#ifdef OBJ_MAYBE_COFF
- case bfd_target_coff_flavour:
- return "coff-i386";
-#endif
-#if defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF)
- case bfd_target_elf_flavour:
- {
- if (flag_code == CODE_64BIT)
- {
- object_64bit = 1;
- use_rela_relocations = 1;
- }
- return flag_code == CODE_64BIT ? ELF_TARGET_FORMAT64 : ELF_TARGET_FORMAT;
- }
-#endif
- default:
- abort ();
- return NULL;
- }
-}
-
-#endif /* OBJ_MAYBE_ more than one */
-
-#if (defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF))
-void
-i386_elf_emit_arch_note (void)
-{
- if (IS_ELF && cpu_arch_name != NULL)
- {
- char *p;
- asection *seg = now_seg;
- subsegT subseg = now_subseg;
- Elf_Internal_Note i_note;
- Elf_External_Note e_note;
- asection *note_secp;
- int len;
-
- /* Create the .note section. */
- note_secp = subseg_new (".note", 0);
- bfd_set_section_flags (stdoutput,
- note_secp,
- SEC_HAS_CONTENTS | SEC_READONLY);
-
- /* Process the arch string. */
- len = strlen (cpu_arch_name);
-
- i_note.namesz = len + 1;
- i_note.descsz = 0;
- i_note.type = NT_ARCH;
- p = frag_more (sizeof (e_note.namesz));
- md_number_to_chars (p, (valueT) i_note.namesz, sizeof (e_note.namesz));
- p = frag_more (sizeof (e_note.descsz));
- md_number_to_chars (p, (valueT) i_note.descsz, sizeof (e_note.descsz));
- p = frag_more (sizeof (e_note.type));
- md_number_to_chars (p, (valueT) i_note.type, sizeof (e_note.type));
- p = frag_more (len + 1);
- strcpy (p, cpu_arch_name);
-
- frag_align (2, 0, 0);
-
- subseg_set (seg, subseg);
- }
-}
-#endif
-
-symbolS *
-md_undefined_symbol (name)
- char *name;
-{
- if (name[0] == GLOBAL_OFFSET_TABLE_NAME[0]
- && name[1] == GLOBAL_OFFSET_TABLE_NAME[1]
- && name[2] == GLOBAL_OFFSET_TABLE_NAME[2]
- && strcmp (name, GLOBAL_OFFSET_TABLE_NAME) == 0)
- {
- if (!GOT_symbol)
- {
- if (symbol_find (name))
- as_bad (_("GOT already in symbol table"));
- GOT_symbol = symbol_new (name, undefined_section,
- (valueT) 0, &zero_address_frag);
- };
- return GOT_symbol;
- }
- return 0;
-}
-
-/* Round up a section size to the appropriate boundary. */
-
-valueT
-md_section_align (segment, size)
- segT segment ATTRIBUTE_UNUSED;
- valueT size;
-{
-#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT))
- if (OUTPUT_FLAVOR == bfd_target_aout_flavour)
- {
- /* For a.out, force the section size to be aligned. If we don't do
- this, BFD will align it for us, but it will not write out the
- final bytes of the section. This may be a bug in BFD, but it is
- easier to fix it here since that is how the other a.out targets
- work. */
- int align;
-
- align = bfd_get_section_alignment (stdoutput, segment);
- size = ((size + (1 << align) - 1) & ((valueT) -1 << align));
- }
-#endif
-
- return size;
-}
-
-/* On the i386, PC-relative offsets are relative to the start of the
- next instruction. That is, the address of the offset, plus its
- size, since the offset is always the last part of the insn. */
-
-long
-md_pcrel_from (fixS *fixP)
-{
- return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address;
-}
-
-#ifndef I386COFF
-
-static void
-s_bss (int ignore ATTRIBUTE_UNUSED)
-{
- int temp;
-
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- if (IS_ELF)
- obj_elf_section_change_hook ();
-#endif
- temp = get_absolute_expression ();
- subseg_set (bss_section, (subsegT) temp);
- demand_empty_rest_of_line ();
-}
-
-#endif
-
-void
-i386_validate_fix (fixS *fixp)
-{
- if (fixp->fx_subsy && fixp->fx_subsy == GOT_symbol)
- {
- if (fixp->fx_r_type == BFD_RELOC_32_PCREL)
- {
- if (!object_64bit)
- abort ();
- fixp->fx_r_type = BFD_RELOC_X86_64_GOTPCREL;
- }
- else
- {
- if (!object_64bit)
- fixp->fx_r_type = BFD_RELOC_386_GOTOFF;
- else
- fixp->fx_r_type = BFD_RELOC_X86_64_GOTOFF64;
- }
- fixp->fx_subsy = 0;
- }
-}
-
-arelent *
-tc_gen_reloc (section, fixp)
- asection *section ATTRIBUTE_UNUSED;
- fixS *fixp;
-{
- arelent *rel;
- bfd_reloc_code_real_type code;
-
- switch (fixp->fx_r_type)
- {
- case BFD_RELOC_X86_64_PLT32:
- case BFD_RELOC_X86_64_GOT32:
- case BFD_RELOC_X86_64_GOTPCREL:
- case BFD_RELOC_386_PLT32:
- case BFD_RELOC_386_GOT32:
- case BFD_RELOC_386_GOTOFF:
- case BFD_RELOC_386_GOTPC:
- case BFD_RELOC_386_TLS_GD:
- case BFD_RELOC_386_TLS_LDM:
- case BFD_RELOC_386_TLS_LDO_32:
- case BFD_RELOC_386_TLS_IE_32:
- case BFD_RELOC_386_TLS_IE:
- case BFD_RELOC_386_TLS_GOTIE:
- case BFD_RELOC_386_TLS_LE_32:
- case BFD_RELOC_386_TLS_LE:
- case BFD_RELOC_386_TLS_GOTDESC:
- case BFD_RELOC_386_TLS_DESC_CALL:
- case BFD_RELOC_X86_64_TLSGD:
- case BFD_RELOC_X86_64_TLSLD:
- case BFD_RELOC_X86_64_DTPOFF32:
- case BFD_RELOC_X86_64_DTPOFF64:
- case BFD_RELOC_X86_64_GOTTPOFF:
- case BFD_RELOC_X86_64_TPOFF32:
- case BFD_RELOC_X86_64_TPOFF64:
- case BFD_RELOC_X86_64_GOTOFF64:
- case BFD_RELOC_X86_64_GOTPC32:
- case BFD_RELOC_X86_64_GOT64:
- case BFD_RELOC_X86_64_GOTPCREL64:
- case BFD_RELOC_X86_64_GOTPC64:
- case BFD_RELOC_X86_64_GOTPLT64:
- case BFD_RELOC_X86_64_PLTOFF64:
- case BFD_RELOC_X86_64_GOTPC32_TLSDESC:
- case BFD_RELOC_X86_64_TLSDESC_CALL:
- case BFD_RELOC_RVA:
- case BFD_RELOC_VTABLE_ENTRY:
- case BFD_RELOC_VTABLE_INHERIT:
-#ifdef TE_PE
- case BFD_RELOC_32_SECREL:
-#endif
- code = fixp->fx_r_type;
- break;
- case BFD_RELOC_X86_64_32S:
- if (!fixp->fx_pcrel)
- {
- /* Don't turn BFD_RELOC_X86_64_32S into BFD_RELOC_32. */
- code = fixp->fx_r_type;
- break;
- }
- default:
- if (fixp->fx_pcrel)
- {
- switch (fixp->fx_size)
- {
- default:
- as_bad_where (fixp->fx_file, fixp->fx_line,
- _("can not do %d byte pc-relative relocation"),
- fixp->fx_size);
- code = BFD_RELOC_32_PCREL;
- break;
- case 1: code = BFD_RELOC_8_PCREL; break;
- case 2: code = BFD_RELOC_16_PCREL; break;
- case 4: code = BFD_RELOC_32_PCREL; break;
-#ifdef BFD64
- case 8: code = BFD_RELOC_64_PCREL; break;
-#endif
- }
- }
- else
- {
- switch (fixp->fx_size)
- {
- default:
- as_bad_where (fixp->fx_file, fixp->fx_line,
- _("can not do %d byte relocation"),
- fixp->fx_size);
- code = BFD_RELOC_32;
- break;
- case 1: code = BFD_RELOC_8; break;
- case 2: code = BFD_RELOC_16; break;
- case 4: code = BFD_RELOC_32; break;
-#ifdef BFD64
- case 8: code = BFD_RELOC_64; break;
-#endif
- }
- }
- break;
- }
-
- if ((code == BFD_RELOC_32
- || code == BFD_RELOC_32_PCREL
- || code == BFD_RELOC_X86_64_32S)
- && GOT_symbol
- && fixp->fx_addsy == GOT_symbol)
- {
- if (!object_64bit)
- code = BFD_RELOC_386_GOTPC;
- else
- code = BFD_RELOC_X86_64_GOTPC32;
- }
- if ((code == BFD_RELOC_64 || code == BFD_RELOC_64_PCREL)
- && GOT_symbol
- && fixp->fx_addsy == GOT_symbol)
- {
- code = BFD_RELOC_X86_64_GOTPC64;
- }
-
- rel = (arelent *) xmalloc (sizeof (arelent));
- rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
- *rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
-
- rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
-
- if (!use_rela_relocations)
- {
- /* HACK: Since i386 ELF uses Rel instead of Rela, encode the
- vtable entry to be used in the relocation's section offset. */
- if (fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
- rel->address = fixp->fx_offset;
-
- rel->addend = 0;
- }
- /* Use the rela in 64bit mode. */
- else
- {
- if (!fixp->fx_pcrel)
- rel->addend = fixp->fx_offset;
- else
- switch (code)
- {
- case BFD_RELOC_X86_64_PLT32:
- case BFD_RELOC_X86_64_GOT32:
- case BFD_RELOC_X86_64_GOTPCREL:
- case BFD_RELOC_X86_64_TLSGD:
- case BFD_RELOC_X86_64_TLSLD:
- case BFD_RELOC_X86_64_GOTTPOFF:
- case BFD_RELOC_X86_64_GOTPC32_TLSDESC:
- case BFD_RELOC_X86_64_TLSDESC_CALL:
- rel->addend = fixp->fx_offset - fixp->fx_size;
- break;
- default:
- rel->addend = (section->vma
- - fixp->fx_size
- + fixp->fx_addnumber
- + md_pcrel_from (fixp));
- break;
- }
- }
-
- rel->howto = bfd_reloc_type_lookup (stdoutput, code);
- if (rel->howto == NULL)
- {
- as_bad_where (fixp->fx_file, fixp->fx_line,
- _("cannot represent relocation type %s"),
- bfd_get_reloc_code_name (code));
- /* Set howto to a garbage value so that we can keep going. */
- rel->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
- assert (rel->howto != NULL);
- }
-
- return rel;
-}
-
-
-/* Parse operands using Intel syntax. This implements a recursive descent
- parser based on the BNF grammar published in Appendix B of the MASM 6.1
- Programmer's Guide.
-
- FIXME: We do not recognize the full operand grammar defined in the MASM
- documentation. In particular, all the structure/union and
- high-level macro operands are missing.
-
- Uppercase words are terminals, lower case words are non-terminals.
- Objects surrounded by double brackets '[[' ']]' are optional. Vertical
- bars '|' denote choices. Most grammar productions are implemented in
- functions called 'intel_<production>'.
-
- Initial production is 'expr'.
-
- addOp + | -
-
- alpha [a-zA-Z]
-
- binOp & | AND | \| | OR | ^ | XOR
-
- byteRegister AL | AH | BL | BH | CL | CH | DL | DH
-
- constant digits [[ radixOverride ]]
-
- dataType BYTE | WORD | DWORD | FWORD | QWORD | TBYTE | OWORD | XMMWORD | YMMWORD
-
- digits decdigit
- | digits decdigit
- | digits hexdigit
-
- decdigit [0-9]
-
- e04 e04 addOp e05
- | e05
-
- e05 e05 binOp e06
- | e06
-
- e06 e06 mulOp e09
- | e09
-
- e09 OFFSET e10
- | SHORT e10
- | + e10
- | - e10
- | ~ e10
- | NOT e10
- | e09 PTR e10
- | e09 : e10
- | e10
-
- e10 e10 [ expr ]
- | e11
-
- e11 ( expr )
- | [ expr ]
- | constant
- | dataType
- | id
- | $
- | register
-
- => expr expr cmpOp e04
- | e04
-
- gpRegister AX | EAX | BX | EBX | CX | ECX | DX | EDX
- | BP | EBP | SP | ESP | DI | EDI | SI | ESI
-
- hexdigit a | b | c | d | e | f
- | A | B | C | D | E | F
-
- id alpha
- | id alpha
- | id decdigit
-
- mulOp * | / | % | MOD | << | SHL | >> | SHR
-
- quote " | '
-
- register specialRegister
- | gpRegister
- | byteRegister
-
- segmentRegister CS | DS | ES | FS | GS | SS
-
- specialRegister CR0 | CR2 | CR3 | CR4
- | DR0 | DR1 | DR2 | DR3 | DR6 | DR7
- | TR3 | TR4 | TR5 | TR6 | TR7
-
- We simplify the grammar in obvious places (e.g., register parsing is
- done by calling parse_register) and eliminate immediate left recursion
- to implement a recursive-descent parser.
-
- expr e04 expr'
-
- expr' cmpOp e04 expr'
- | Empty
-
- e04 e05 e04'
-
- e04' addOp e05 e04'
- | Empty
-
- e05 e06 e05'
-
- e05' binOp e06 e05'
- | Empty
-
- e06 e09 e06'
-
- e06' mulOp e09 e06'
- | Empty
-
- e09 OFFSET e10 e09'
- | SHORT e10'
- | + e10'
- | - e10'
- | ~ e10'
- | NOT e10'
- | e10 e09'
-
- e09' PTR e10 e09'
- | : e10 e09'
- | Empty
-
- e10 e11 e10'
-
- e10' [ expr ] e10'
- | Empty
-
- e11 ( expr )
- | [ expr ]
- | BYTE
- | WORD
- | DWORD
- | FWORD
- | QWORD
- | TBYTE
- | OWORD
- | XMMWORD
- | YMMWORD
- | .
- | $
- | register
- | id
- | constant */
-
-/* Parsing structure for the intel syntax parser. Used to implement the
- semantic actions for the operand grammar. */
-struct intel_parser_s
- {
- char *op_string; /* The string being parsed. */
- int got_a_float; /* Whether the operand is a float. */
- int op_modifier; /* Operand modifier. */
- int is_mem; /* 1 if operand is memory reference. */
- int in_offset; /* >=1 if parsing operand of offset. */
- int in_bracket; /* >=1 if parsing operand in brackets. */
- const reg_entry *reg; /* Last register reference found. */
- char *disp; /* Displacement string being built. */
- char *next_operand; /* Resume point when splitting operands. */
- };
-
-static struct intel_parser_s intel_parser;
-
-/* Token structure for parsing intel syntax. */
-struct intel_token
- {
- int code; /* Token code. */
- const reg_entry *reg; /* Register entry for register tokens. */
- char *str; /* String representation. */
- };
-
-static struct intel_token cur_token, prev_token;
-
-/* Token codes for the intel parser. Since T_SHORT is already used
- by COFF, undefine it first to prevent a warning. */
-#define T_NIL -1
-#define T_CONST 1
-#define T_REG 2
-#define T_BYTE 3
-#define T_WORD 4
-#define T_DWORD 5
-#define T_FWORD 6
-#define T_QWORD 7
-#define T_TBYTE 8
-#define T_XMMWORD 9
-#undef T_SHORT
-#define T_SHORT 10
-#define T_OFFSET 11
-#define T_PTR 12
-#define T_ID 13
-#define T_SHL 14
-#define T_SHR 15
-#define T_YMMWORD 16
-
-/* Prototypes for intel parser functions. */
-static int intel_match_token (int);
-static void intel_putback_token (void);
-static void intel_get_token (void);
-static int intel_expr (void);
-static int intel_e04 (void);
-static int intel_e05 (void);
-static int intel_e06 (void);
-static int intel_e09 (void);
-static int intel_e10 (void);
-static int intel_e11 (void);
-
-static int
-i386_intel_operand (char *operand_string, int got_a_float)
-{
- int ret;
- char *p;
-
- p = intel_parser.op_string = xstrdup (operand_string);
- intel_parser.disp = (char *) xmalloc (strlen (operand_string) + 1);
-
- for (;;)
- {
- /* Initialize token holders. */
- cur_token.code = prev_token.code = T_NIL;
- cur_token.reg = prev_token.reg = NULL;
- cur_token.str = prev_token.str = NULL;
-
- /* Initialize parser structure. */
- intel_parser.got_a_float = got_a_float;
- intel_parser.op_modifier = 0;
- intel_parser.is_mem = 0;
- intel_parser.in_offset = 0;
- intel_parser.in_bracket = 0;
- intel_parser.reg = NULL;
- intel_parser.disp[0] = '\0';
- intel_parser.next_operand = NULL;
-
- /* Read the first token and start the parser. */
- intel_get_token ();
- ret = intel_expr ();
-
- if (!ret)
- break;
-
- if (cur_token.code != T_NIL)
- {
- as_bad (_("invalid operand for '%s' ('%s' unexpected)"),
- current_templates->start->name, cur_token.str);
- ret = 0;
- }
- /* If we found a memory reference, hand it over to i386_displacement
- to fill in the rest of the operand fields. */
- else if (intel_parser.is_mem)
- {
- if ((i.mem_operands == 1
- && !current_templates->start->opcode_modifier.isstring)
- || i.mem_operands == 2)
- {
- as_bad (_("too many memory references for '%s'"),
- current_templates->start->name);
- ret = 0;
- }
- else
- {
- char *s = intel_parser.disp;
- i.types[this_operand].bitfield.mem = 1;
- i.mem_operands++;
-
- if (!quiet_warnings && intel_parser.is_mem < 0)
- /* See the comments in intel_bracket_expr. */
- as_warn (_("Treating `%s' as memory reference"), operand_string);
-
- /* Add the displacement expression. */
- if (*s != '\0')
- ret = i386_displacement (s, s + strlen (s));
- if (ret)
- {
- /* Swap base and index in 16-bit memory operands like
- [si+bx]. Since i386_index_check is also used in AT&T
- mode we have to do that here. */
- if (i.base_reg
- && i.index_reg
- && i.base_reg->reg_type.bitfield.reg16
- && i.index_reg->reg_type.bitfield.reg16
- && i.base_reg->reg_num >= 6
- && i.index_reg->reg_num < 6)
- {
- const reg_entry *base = i.index_reg;
-
- i.index_reg = i.base_reg;
- i.base_reg = base;
- }
- ret = i386_index_check (operand_string);
- }
- }
- }
-
- /* Constant and OFFSET expressions are handled by i386_immediate. */
- else if ((intel_parser.op_modifier & (1 << T_OFFSET))
- || intel_parser.reg == NULL)
- {
- if (i.mem_operands < 2 && i.seg[i.mem_operands])
- {
- if (!(intel_parser.op_modifier & (1 << T_OFFSET)))
- as_warn (_("Segment override ignored"));
- i.seg[i.mem_operands] = NULL;
- }
- ret = i386_immediate (intel_parser.disp);
- }
-
- if (intel_parser.next_operand && this_operand >= MAX_OPERANDS - 1)
- ret = 0;
- if (!ret || !intel_parser.next_operand)
- break;
- intel_parser.op_string = intel_parser.next_operand;
- this_operand = i.operands++;
- i.types[this_operand].bitfield.unspecified = 1;
- }
-
- free (p);
- free (intel_parser.disp);
-
- return ret;
-}
-
-#define NUM_ADDRESS_REGS (!!i.base_reg + !!i.index_reg)
-
-/* expr e04 expr'
-
- expr' cmpOp e04 expr'
- | Empty */
-static int
-intel_expr (void)
-{
- /* XXX Implement the comparison operators. */
- return intel_e04 ();
-}
-
-/* e04 e05 e04'
-
- e04' addOp e05 e04'
- | Empty */
-static int
-intel_e04 (void)
-{
- int nregs = -1;
-
- for (;;)
- {
- if (!intel_e05())
- return 0;
-
- if (nregs >= 0 && NUM_ADDRESS_REGS > nregs)
- i.base_reg = i386_regtab + REGNAM_AL; /* al is invalid as base */
-
- if (cur_token.code == '+')
- nregs = -1;
- else if (cur_token.code == '-')
- nregs = NUM_ADDRESS_REGS;
- else
- return 1;
-
- strcat (intel_parser.disp, cur_token.str);
- intel_match_token (cur_token.code);
- }
-}
-
-/* e05 e06 e05'
-
- e05' binOp e06 e05'
- | Empty */
-static int
-intel_e05 (void)
-{
- int nregs = ~NUM_ADDRESS_REGS;
-
- for (;;)
- {
- if (!intel_e06())
- return 0;
-
- if (cur_token.code == '&'
- || cur_token.code == '|'
- || cur_token.code == '^')
- {
- char str[2];
-
- str[0] = cur_token.code;
- str[1] = 0;
- strcat (intel_parser.disp, str);
- }
- else
- break;
-
- intel_match_token (cur_token.code);
-
- if (nregs < 0)
- nregs = ~nregs;
- }
- if (nregs >= 0 && NUM_ADDRESS_REGS > nregs)
- i.base_reg = i386_regtab + REGNAM_AL + 1; /* cl is invalid as base */
- return 1;
-}
-
-/* e06 e09 e06'
-
- e06' mulOp e09 e06'
- | Empty */
-static int
-intel_e06 (void)
-{
- int nregs = ~NUM_ADDRESS_REGS;
-
- for (;;)
- {
- if (!intel_e09())
- return 0;
-
- if (cur_token.code == '*'
- || cur_token.code == '/'
- || cur_token.code == '%')
- {
- char str[2];
-
- str[0] = cur_token.code;
- str[1] = 0;
- strcat (intel_parser.disp, str);
- }
- else if (cur_token.code == T_SHL)
- strcat (intel_parser.disp, "<<");
- else if (cur_token.code == T_SHR)
- strcat (intel_parser.disp, ">>");
- else
- break;
-
- intel_match_token (cur_token.code);
-
- if (nregs < 0)
- nregs = ~nregs;
- }
- if (nregs >= 0 && NUM_ADDRESS_REGS > nregs)
- i.base_reg = i386_regtab + REGNAM_AL + 2; /* dl is invalid as base */
- return 1;
-}
-
-/* e09 OFFSET e09
- | SHORT e09
- | + e09
- | - e09
- | ~ e09
- | NOT e09
- | e10 e09'
-
- e09' PTR e10 e09'
- | : e10 e09'
- | Empty */
-static int
-intel_e09 (void)
-{
- int nregs = ~NUM_ADDRESS_REGS;
- int in_offset = 0;
-
- for (;;)
- {
- /* Don't consume constants here. */
- if (cur_token.code == '+' || cur_token.code == '-')
- {
- /* Need to look one token ahead - if the next token
- is a constant, the current token is its sign. */
- int next_code;
-
- intel_match_token (cur_token.code);
- next_code = cur_token.code;
- intel_putback_token ();
- if (next_code == T_CONST)
- break;
- }
-
- /* e09 OFFSET e09 */
- if (cur_token.code == T_OFFSET)
- {
- if (!in_offset++)
- ++intel_parser.in_offset;
- }
-
- /* e09 SHORT e09 */
- else if (cur_token.code == T_SHORT)
- intel_parser.op_modifier |= 1 << T_SHORT;
-
- /* e09 + e09 */
- else if (cur_token.code == '+')
- strcat (intel_parser.disp, "+");
-
- /* e09 - e09
- | ~ e09
- | NOT e09 */
- else if (cur_token.code == '-' || cur_token.code == '~')
- {
- char str[2];
-
- if (nregs < 0)
- nregs = ~nregs;
- str[0] = cur_token.code;
- str[1] = 0;
- strcat (intel_parser.disp, str);
- }
-
- /* e09 e10 e09' */
- else
- break;
-
- intel_match_token (cur_token.code);
- }
-
- for (;;)
- {
- if (!intel_e10 ())
- return 0;
-
- /* e09' PTR e10 e09' */
- if (cur_token.code == T_PTR)
- {
- char suffix;
-
- if (prev_token.code == T_BYTE)
- {
- suffix = BYTE_MNEM_SUFFIX;
- i.types[this_operand].bitfield.byte = 1;
- }
-
- else if (prev_token.code == T_WORD)
- {
- if ((current_templates->start->name[0] == 'l'
- && current_templates->start->name[2] == 's'
- && current_templates->start->name[3] == 0)
- || current_templates->start->base_opcode == 0x62 /* bound */)
- suffix = BYTE_MNEM_SUFFIX; /* so it will cause an error */
- else if (intel_parser.got_a_float == 2) /* "fi..." */
- suffix = SHORT_MNEM_SUFFIX;
- else
- suffix = WORD_MNEM_SUFFIX;
- i.types[this_operand].bitfield.word = 1;
- }
-
- else if (prev_token.code == T_DWORD)
- {
- if ((current_templates->start->name[0] == 'l'
- && current_templates->start->name[2] == 's'
- && current_templates->start->name[3] == 0)
- || current_templates->start->base_opcode == 0x62 /* bound */)
- suffix = WORD_MNEM_SUFFIX;
- else if (flag_code == CODE_16BIT
- && (current_templates->start->opcode_modifier.jump
- || current_templates->start->opcode_modifier.jumpdword))
- suffix = LONG_DOUBLE_MNEM_SUFFIX;
- else if (intel_parser.got_a_float == 1) /* "f..." */
- suffix = SHORT_MNEM_SUFFIX;
- else
- suffix = LONG_MNEM_SUFFIX;
- i.types[this_operand].bitfield.dword = 1;
- }
-
- else if (prev_token.code == T_FWORD)
- {
- if (current_templates->start->name[0] == 'l'
- && current_templates->start->name[2] == 's'
- && current_templates->start->name[3] == 0)
- suffix = LONG_MNEM_SUFFIX;
- else if (!intel_parser.got_a_float)
- {
- if (flag_code == CODE_16BIT)
- add_prefix (DATA_PREFIX_OPCODE);
- suffix = LONG_DOUBLE_MNEM_SUFFIX;
- }
- else
- suffix = BYTE_MNEM_SUFFIX; /* so it will cause an error */
- i.types[this_operand].bitfield.fword = 1;
- }
-
- else if (prev_token.code == T_QWORD)
- {
- if (current_templates->start->base_opcode == 0x62 /* bound */
- || intel_parser.got_a_float == 1) /* "f..." */
- suffix = LONG_MNEM_SUFFIX;
- else
- suffix = QWORD_MNEM_SUFFIX;
- i.types[this_operand].bitfield.qword = 1;
- }
-
- else if (prev_token.code == T_TBYTE)
- {
- if (intel_parser.got_a_float == 1)
- suffix = LONG_DOUBLE_MNEM_SUFFIX;
- else
- suffix = BYTE_MNEM_SUFFIX; /* so it will cause an error */
- }
-
- else if (prev_token.code == T_XMMWORD)
- {
- suffix = XMMWORD_MNEM_SUFFIX;
- i.types[this_operand].bitfield.xmmword = 1;
- }
-
- else if (prev_token.code == T_YMMWORD)
- {
- suffix = YMMWORD_MNEM_SUFFIX;
- i.types[this_operand].bitfield.ymmword = 1;
- }
-
- else
- {
- as_bad (_("Unknown operand modifier `%s'"), prev_token.str);
- return 0;
- }
-
- i.types[this_operand].bitfield.unspecified = 0;
-
- /* Operands for jump/call using 'ptr' notation denote absolute
- addresses. */
- if (current_templates->start->opcode_modifier.jump
- || current_templates->start->opcode_modifier.jumpdword)
- i.types[this_operand].bitfield.jumpabsolute = 1;
-
- if (current_templates->start->base_opcode == 0x8d /* lea */)
- ;
- else if (!i.suffix)
- i.suffix = suffix;
- else if (i.suffix != suffix)
- {
- as_bad (_("Conflicting operand modifiers"));
- return 0;
- }
-
- }
-
- /* e09' : e10 e09' */
- else if (cur_token.code == ':')
- {
- if (prev_token.code != T_REG)
- {
- /* While {call,jmp} SSSS:OOOO is MASM syntax only when SSSS is a
- segment/group identifier (which we don't have), using comma
- as the operand separator there is even less consistent, since
- there all branches only have a single operand. */
- if (this_operand != 0
- || intel_parser.in_offset
- || intel_parser.in_bracket
- || (!current_templates->start->opcode_modifier.jump
- && !current_templates->start->opcode_modifier.jumpdword
- && !current_templates->start->opcode_modifier.jumpintersegment
- && !current_templates->start->operand_types[0].bitfield.jumpabsolute))
- return intel_match_token (T_NIL);
- /* Remember the start of the 2nd operand and terminate 1st
- operand here.
- XXX This isn't right, yet (when SSSS:OOOO is right operand of
- another expression), but it gets at least the simplest case
- (a plain number or symbol on the left side) right. */
- intel_parser.next_operand = intel_parser.op_string;
- *--intel_parser.op_string = '\0';
- return intel_match_token (':');
- }
- }
-
- /* e09' Empty */
- else
- break;
-
- intel_match_token (cur_token.code);
-
- }
-
- if (in_offset)
- {
- --intel_parser.in_offset;
- if (nregs < 0)
- nregs = ~nregs;
- if (NUM_ADDRESS_REGS > nregs)
- {
- as_bad (_("Invalid operand to `OFFSET'"));
- return 0;
- }
- intel_parser.op_modifier |= 1 << T_OFFSET;
- }
-
- if (nregs >= 0 && NUM_ADDRESS_REGS > nregs)
- i.base_reg = i386_regtab + REGNAM_AL + 3; /* bl is invalid as base */
- return 1;
-}
-
-static int
-intel_bracket_expr (void)
-{
- int was_offset = intel_parser.op_modifier & (1 << T_OFFSET);
- const char *start = intel_parser.op_string;
- int len;
-
- if (i.op[this_operand].regs)
- return intel_match_token (T_NIL);
-
- intel_match_token ('[');
-
- /* Mark as a memory operand only if it's not already known to be an
- offset expression. If it's an offset expression, we need to keep
- the brace in. */
- if (!intel_parser.in_offset)
- {
- ++intel_parser.in_bracket;
-
- /* Operands for jump/call inside brackets denote absolute addresses. */
- if (current_templates->start->opcode_modifier.jump
- || current_templates->start->opcode_modifier.jumpdword)
- i.types[this_operand].bitfield.jumpabsolute = 1;
-
- /* Unfortunately gas always diverged from MASM in a respect that can't
- be easily fixed without risking to break code sequences likely to be
- encountered (the testsuite even check for this): MASM doesn't consider
- an expression inside brackets unconditionally as a memory reference.
- When that is e.g. a constant, an offset expression, or the sum of the
- two, this is still taken as a constant load. gas, however, always
- treated these as memory references. As a compromise, we'll try to make
- offset expressions inside brackets work the MASM way (since that's
- less likely to be found in real world code), but make constants alone
- continue to work the traditional gas way. In either case, issue a
- warning. */
- intel_parser.op_modifier &= ~was_offset;
- }
- else
- strcat (intel_parser.disp, "[");
-
- /* Add a '+' to the displacement string if necessary. */
- if (*intel_parser.disp != '\0'
- && *(intel_parser.disp + strlen (intel_parser.disp) - 1) != '+')
- strcat (intel_parser.disp, "+");
-
- if (intel_expr ()
- && (len = intel_parser.op_string - start - 1,
- intel_match_token (']')))
- {
- /* Preserve brackets when the operand is an offset expression. */
- if (intel_parser.in_offset)
- strcat (intel_parser.disp, "]");
- else
- {
- --intel_parser.in_bracket;
- if (i.base_reg || i.index_reg)
- intel_parser.is_mem = 1;
- if (!intel_parser.is_mem)
- {
- if (!(intel_parser.op_modifier & (1 << T_OFFSET)))
- /* Defer the warning until all of the operand was parsed. */
- intel_parser.is_mem = -1;
- else if (!quiet_warnings)
- as_warn (_("`[%.*s]' taken to mean just `%.*s'"),
- len, start, len, start);
- }
- }
- intel_parser.op_modifier |= was_offset;
-
- return 1;
- }
- return 0;
-}
-
-/* e10 e11 e10'
-
- e10' [ expr ] e10'
- | Empty */
-static int
-intel_e10 (void)
-{
- if (!intel_e11 ())
- return 0;
-
- while (cur_token.code == '[')
- {
- if (!intel_bracket_expr ())
- return 0;
- }
-
- return 1;
-}
-
-/* e11 ( expr )
- | [ expr ]
- | BYTE
- | WORD
- | DWORD
- | FWORD
- | QWORD
- | TBYTE
- | OWORD
- | XMMWORD
- | YMMWORD
- | $
- | .
- | register
- | id
- | constant */
-static int
-intel_e11 (void)
-{
- switch (cur_token.code)
- {
- /* e11 ( expr ) */
- case '(':
- intel_match_token ('(');
- strcat (intel_parser.disp, "(");
-
- if (intel_expr () && intel_match_token (')'))
- {
- strcat (intel_parser.disp, ")");
- return 1;
- }
- return 0;
-
- /* e11 [ expr ] */
- case '[':
- return intel_bracket_expr ();
-
- /* e11 $
- | . */
- case '.':
- strcat (intel_parser.disp, cur_token.str);
- intel_match_token (cur_token.code);
-
- /* Mark as a memory operand only if it's not already known to be an
- offset expression. */
- if (!intel_parser.in_offset)
- intel_parser.is_mem = 1;
-
- return 1;
-
- /* e11 register */
- case T_REG:
- {
- const reg_entry *reg = intel_parser.reg = cur_token.reg;
-
- intel_match_token (T_REG);
-
- /* Check for segment change. */
- if (cur_token.code == ':')
- {
- if (!reg->reg_type.bitfield.sreg2
- && !reg->reg_type.bitfield.sreg3)
- {
- as_bad (_("`%s' is not a valid segment register"),
- reg->reg_name);
- return 0;
- }
- else if (i.mem_operands >= 2)
- as_warn (_("Segment override ignored"));
- else if (i.seg[i.mem_operands])
- as_warn (_("Extra segment override ignored"));
- else
- {
- if (!intel_parser.in_offset)
- intel_parser.is_mem = 1;
- switch (reg->reg_num)
- {
- case 0:
- i.seg[i.mem_operands] = &es;
- break;
- case 1:
- i.seg[i.mem_operands] = &cs;
- break;
- case 2:
- i.seg[i.mem_operands] = &ss;
- break;
- case 3:
- i.seg[i.mem_operands] = &ds;
- break;
- case 4:
- i.seg[i.mem_operands] = &fs;
- break;
- case 5:
- i.seg[i.mem_operands] = &gs;
- break;
- }
- }
- }
-
- else if (reg->reg_type.bitfield.sreg3 && reg->reg_num == RegFlat)
- {
- as_bad (_("cannot use `FLAT' here"));
- return 0;
- }
-
- /* Not a segment register. Check for register scaling. */
- else if (cur_token.code == '*')
- {
- if (!intel_parser.in_bracket)
- {
- as_bad (_("Register scaling only allowed in memory operands"));
- return 0;
- }
-
- if (reg->reg_type.bitfield.reg16) /* Disallow things like [si*1]. */
- reg = i386_regtab + REGNAM_AX + 4; /* sp is invalid as index */
- else if (i.index_reg)
- reg = i386_regtab + REGNAM_EAX + 4; /* esp is invalid as index */
-
- /* What follows must be a valid scale. */
- intel_match_token ('*');
- i.index_reg = reg;
- i.types[this_operand].bitfield.baseindex = 1;
-
- /* Set the scale after setting the register (otherwise,
- i386_scale will complain) */
- if (cur_token.code == '+' || cur_token.code == '-')
- {
- char *str, sign = cur_token.code;
- intel_match_token (cur_token.code);
- if (cur_token.code != T_CONST)
- {
- as_bad (_("Syntax error: Expecting a constant, got `%s'"),
- cur_token.str);
- return 0;
- }
- str = (char *) xmalloc (strlen (cur_token.str) + 2);
- strcpy (str + 1, cur_token.str);
- *str = sign;
- if (!i386_scale (str))
- return 0;
- free (str);
- }
- else if (!i386_scale (cur_token.str))
- return 0;
- intel_match_token (cur_token.code);
- }
-
- /* No scaling. If this is a memory operand, the register is either a
- base register (first occurrence) or an index register (second
- occurrence). */
- else if (intel_parser.in_bracket)
- {
-
- if (!i.base_reg)
- i.base_reg = reg;
- else if (!i.index_reg)
- i.index_reg = reg;
- else
- {
- as_bad (_("Too many register references in memory operand"));
- return 0;
- }
-
- i.types[this_operand].bitfield.baseindex = 1;
- }
-
- /* It's neither base nor index. */
- else if (!intel_parser.in_offset && !intel_parser.is_mem)
- {
- i386_operand_type temp = reg->reg_type;
- temp.bitfield.baseindex = 0;
- i.types[this_operand] = operand_type_or (i.types[this_operand],
- temp);
- i.types[this_operand].bitfield.unspecified = 0;
- i.op[this_operand].regs = reg;
- i.reg_operands++;
- }
- else
- {
- as_bad (_("Invalid use of register"));
- return 0;
- }
-
- /* Since registers are not part of the displacement string (except
- when we're parsing offset operands), we may need to remove any
- preceding '+' from the displacement string. */
- if (*intel_parser.disp != '\0'
- && !intel_parser.in_offset)
- {
- char *s = intel_parser.disp;
- s += strlen (s) - 1;
- if (*s == '+')
- *s = '\0';
- }
-
- return 1;
- }
-
- /* e11 BYTE
- | WORD
- | DWORD
- | FWORD
- | QWORD
- | TBYTE
- | OWORD
- | XMMWORD
- | YMMWORD */
- case T_BYTE:
- case T_WORD:
- case T_DWORD:
- case T_FWORD:
- case T_QWORD:
- case T_TBYTE:
- case T_XMMWORD:
- case T_YMMWORD:
- intel_match_token (cur_token.code);
-
- if (cur_token.code == T_PTR)
- return 1;
-
- /* It must have been an identifier. */
- intel_putback_token ();
- cur_token.code = T_ID;
- /* FALLTHRU */
-
- /* e11 id
- | constant */
- case T_ID:
- if (!intel_parser.in_offset && intel_parser.is_mem <= 0)
- {
- symbolS *symbolP;
-
- /* The identifier represents a memory reference only if it's not
- preceded by an offset modifier and if it's not an equate. */
- symbolP = symbol_find(cur_token.str);
- if (!symbolP || S_GET_SEGMENT(symbolP) != absolute_section)
- intel_parser.is_mem = 1;
- }
- /* FALLTHRU */
-
- case T_CONST:
- case '-':
- case '+':
- {
- char *save_str, sign = 0;
-
- /* Allow constants that start with `+' or `-'. */
- if (cur_token.code == '-' || cur_token.code == '+')
- {
- sign = cur_token.code;
- intel_match_token (cur_token.code);
- if (cur_token.code != T_CONST)
- {
- as_bad (_("Syntax error: Expecting a constant, got `%s'"),
- cur_token.str);
- return 0;
- }
- }
-
- save_str = (char *) xmalloc (strlen (cur_token.str) + 2);
- strcpy (save_str + !!sign, cur_token.str);
- if (sign)
- *save_str = sign;
-
- /* Get the next token to check for register scaling. */
- intel_match_token (cur_token.code);
-
- /* Check if this constant is a scaling factor for an
- index register. */
- if (cur_token.code == '*')
- {
- if (intel_match_token ('*') && cur_token.code == T_REG)
- {
- const reg_entry *reg = cur_token.reg;
-
- if (!intel_parser.in_bracket)
- {
- as_bad (_("Register scaling only allowed "
- "in memory operands"));
- return 0;
- }
-
- /* Disallow things like [1*si].
- sp and esp are invalid as index. */
- if (reg->reg_type.bitfield.reg16)
- reg = i386_regtab + REGNAM_AX + 4;
- else if (i.index_reg)
- reg = i386_regtab + REGNAM_EAX + 4;
-
- /* The constant is followed by `* reg', so it must be
- a valid scale. */
- i.index_reg = reg;
- i.types[this_operand].bitfield.baseindex = 1;
-
- /* Set the scale after setting the register (otherwise,
- i386_scale will complain) */
- if (!i386_scale (save_str))
- return 0;
- intel_match_token (T_REG);
-
- /* Since registers are not part of the displacement
- string, we may need to remove any preceding '+' from
- the displacement string. */
- if (*intel_parser.disp != '\0')
- {
- char *s = intel_parser.disp;
- s += strlen (s) - 1;
- if (*s == '+')
- *s = '\0';
- }
-
- free (save_str);
-
- return 1;
- }
-
- /* The constant was not used for register scaling. Since we have
- already consumed the token following `*' we now need to put it
- back in the stream. */
- intel_putback_token ();
- }
-
- /* Add the constant to the displacement string. */
- strcat (intel_parser.disp, save_str);
- free (save_str);
-
- return 1;
- }
- }
-
- as_bad (_("Unrecognized token '%s'"), cur_token.str);
- return 0;
-}
-
-/* Match the given token against cur_token. If they match, read the next
- token from the operand string. */
-static int
-intel_match_token (int code)
-{
- if (cur_token.code == code)
- {
- intel_get_token ();
- return 1;
- }
- else
- {
- as_bad (_("Unexpected token `%s'"), cur_token.str);
- return 0;
- }
-}
-
-/* Read a new token from intel_parser.op_string and store it in cur_token. */
-static void
-intel_get_token (void)
-{
- char *end_op;
- const reg_entry *reg;
- struct intel_token new_token;
-
- new_token.code = T_NIL;
- new_token.reg = NULL;
- new_token.str = NULL;
-
- /* Free the memory allocated to the previous token and move
- cur_token to prev_token. */
- if (prev_token.str)
- free (prev_token.str);
-
- prev_token = cur_token;
-
- /* Skip whitespace. */
- while (is_space_char (*intel_parser.op_string))
- intel_parser.op_string++;
-
- /* Return an empty token if we find nothing else on the line. */
- if (*intel_parser.op_string == '\0')
- {
- cur_token = new_token;
- return;
- }
-
- /* The new token cannot be larger than the remainder of the operand
- string. */
- new_token.str = (char *) xmalloc (strlen (intel_parser.op_string) + 1);
- new_token.str[0] = '\0';
-
- if (strchr ("0123456789", *intel_parser.op_string))
- {
- char *p = new_token.str;
- char *q = intel_parser.op_string;
- new_token.code = T_CONST;
-
- /* Allow any kind of identifier char to encompass floating point and
- hexadecimal numbers. */
- while (is_identifier_char (*q))
- *p++ = *q++;
- *p = '\0';
-
- /* Recognize special symbol names [0-9][bf]. */
- if (strlen (intel_parser.op_string) == 2
- && (intel_parser.op_string[1] == 'b'
- || intel_parser.op_string[1] == 'f'))
- new_token.code = T_ID;
- }
-
- else if ((reg = parse_register (intel_parser.op_string, &end_op)) != NULL)
- {
- size_t len = end_op - intel_parser.op_string;
-
- new_token.code = T_REG;
- new_token.reg = reg;
-
- memcpy (new_token.str, intel_parser.op_string, len);
- new_token.str[len] = '\0';
- }
-
- else if (is_identifier_char (*intel_parser.op_string))
- {
- char *p = new_token.str;
- char *q = intel_parser.op_string;
-
- /* A '.' or '$' followed by an identifier char is an identifier.
- Otherwise, it's operator '.' followed by an expression. */
- if ((*q == '.' || *q == '$') && !is_identifier_char (*(q + 1)))
- {
- new_token.code = '.';
- new_token.str[0] = '.';
- new_token.str[1] = '\0';
- }
- else
- {
- while (is_identifier_char (*q) || *q == '@')
- *p++ = *q++;
- *p = '\0';
-
- if (strcasecmp (new_token.str, "NOT") == 0)
- new_token.code = '~';
-
- else if (strcasecmp (new_token.str, "MOD") == 0)
- new_token.code = '%';
-
- else if (strcasecmp (new_token.str, "AND") == 0)
- new_token.code = '&';
-
- else if (strcasecmp (new_token.str, "OR") == 0)
- new_token.code = '|';
-
- else if (strcasecmp (new_token.str, "XOR") == 0)
- new_token.code = '^';
-
- else if (strcasecmp (new_token.str, "SHL") == 0)
- new_token.code = T_SHL;
-
- else if (strcasecmp (new_token.str, "SHR") == 0)
- new_token.code = T_SHR;
-
- else if (strcasecmp (new_token.str, "BYTE") == 0)
- new_token.code = T_BYTE;
-
- else if (strcasecmp (new_token.str, "WORD") == 0)
- new_token.code = T_WORD;
-
- else if (strcasecmp (new_token.str, "DWORD") == 0)
- new_token.code = T_DWORD;
-
- else if (strcasecmp (new_token.str, "FWORD") == 0)
- new_token.code = T_FWORD;
-
- else if (strcasecmp (new_token.str, "QWORD") == 0)
- new_token.code = T_QWORD;
-
- else if (strcasecmp (new_token.str, "TBYTE") == 0
- /* XXX remove (gcc still uses it) */
- || strcasecmp (new_token.str, "XWORD") == 0)
- new_token.code = T_TBYTE;
-
- else if (strcasecmp (new_token.str, "XMMWORD") == 0
- || strcasecmp (new_token.str, "OWORD") == 0)
- new_token.code = T_XMMWORD;
-
- else if (strcasecmp (new_token.str, "YMMWORD") == 0)
- new_token.code = T_YMMWORD;
-
- else if (strcasecmp (new_token.str, "PTR") == 0)
- new_token.code = T_PTR;
-
- else if (strcasecmp (new_token.str, "SHORT") == 0)
- new_token.code = T_SHORT;
-
- else if (strcasecmp (new_token.str, "OFFSET") == 0)
- {
- new_token.code = T_OFFSET;
-
- /* ??? This is not mentioned in the MASM grammar but gcc
- makes use of it with -mintel-syntax. OFFSET may be
- followed by FLAT: */
- if (strncasecmp (q, " FLAT:", 6) == 0)
- strcat (new_token.str, " FLAT:");
- }
-
- else
- new_token.code = T_ID;
- }
- }
-
- else if (strchr ("+-/*%|&^:[]()~", *intel_parser.op_string))
- {
- new_token.code = *intel_parser.op_string;
- new_token.str[0] = *intel_parser.op_string;
- new_token.str[1] = '\0';
- }
-
- else if (strchr ("<>", *intel_parser.op_string)
- && *intel_parser.op_string == *(intel_parser.op_string + 1))
- {
- new_token.code = *intel_parser.op_string == '<' ? T_SHL : T_SHR;
- new_token.str[0] = *intel_parser.op_string;
- new_token.str[1] = *intel_parser.op_string;
- new_token.str[2] = '\0';
- }
-
- else
- as_bad (_("Unrecognized token `%s'"), intel_parser.op_string);
-
- intel_parser.op_string += strlen (new_token.str);
- cur_token = new_token;
-}
-
-/* Put cur_token back into the token stream and make cur_token point to
- prev_token. */
-static void
-intel_putback_token (void)
-{
- if (cur_token.code != T_NIL)
- {
- intel_parser.op_string -= strlen (cur_token.str);
- free (cur_token.str);
- }
- cur_token = prev_token;
-
- /* Forget prev_token. */
- prev_token.code = T_NIL;
- prev_token.reg = NULL;
- prev_token.str = NULL;
-}
-
-void
-tc_x86_parse_to_dw2regnum (expressionS *exp)
-{
- int saved_naked_reg;
- char saved_register_dot;
-
- saved_naked_reg = allow_naked_reg;
- allow_naked_reg = 1;
- saved_register_dot = register_chars['.'];
- register_chars['.'] = '.';
- allow_pseudo_reg = 1;
- expression_and_evaluate (exp);
- allow_pseudo_reg = 0;
- register_chars['.'] = saved_register_dot;
- allow_naked_reg = saved_naked_reg;
-
- if (exp->X_op == O_register && exp->X_add_number >= 0)
- {
- if ((addressT) exp->X_add_number < i386_regtab_size)
- {
- exp->X_op = O_constant;
- exp->X_add_number = i386_regtab[exp->X_add_number]
- .dw2_regnum[flag_code >> 1];
- }
- else
- exp->X_op = O_illegal;
- }
-}
-
-void
-tc_x86_frame_initial_instructions (void)
-{
- static unsigned int sp_regno[2];
-
- if (!sp_regno[flag_code >> 1])
- {
- char *saved_input = input_line_pointer;
- char sp[][4] = {"esp", "rsp"};
- expressionS exp;
-
- input_line_pointer = sp[flag_code >> 1];
- tc_x86_parse_to_dw2regnum (&exp);
- assert (exp.X_op == O_constant);
- sp_regno[flag_code >> 1] = exp.X_add_number;
- input_line_pointer = saved_input;
- }
-
- cfi_add_CFA_def_cfa (sp_regno[flag_code >> 1], -x86_cie_data_alignment);
- cfi_add_CFA_offset (x86_dwarf2_return_column, x86_cie_data_alignment);
-}
-
-int
-i386_elf_section_type (const char *str, size_t len)
-{
- if (flag_code == CODE_64BIT
- && len == sizeof ("unwind") - 1
- && strncmp (str, "unwind", 6) == 0)
- return SHT_X86_64_UNWIND;
-
- return -1;
-}
-
-#ifdef TE_PE
-void
-tc_pe_dwarf2_emit_offset (symbolS *symbol, unsigned int size)
-{
- expressionS expr;
-
- expr.X_op = O_secrel;
- expr.X_add_symbol = symbol;
- expr.X_add_number = 0;
- emit_expr (&expr, size);
-}
-#endif
-
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-/* For ELF on x86-64, add support for SHF_X86_64_LARGE. */
-
-int
-x86_64_section_letter (int letter, char **ptr_msg)
-{
- if (flag_code == CODE_64BIT)
- {
- if (letter == 'l')
- return SHF_X86_64_LARGE;
-
- *ptr_msg = _("Bad .section directive: want a,l,w,x,M,S,G,T in string");
- }
- else
- *ptr_msg = _("Bad .section directive: want a,w,x,M,S,G,T in string");
- return -1;
-}
-
-int
-x86_64_section_word (char *str, size_t len)
-{
- if (len == 5 && flag_code == CODE_64BIT && CONST_STRNEQ (str, "large"))
- return SHF_X86_64_LARGE;
-
- return -1;
-}
-
-static void
-handle_large_common (int small ATTRIBUTE_UNUSED)
-{
- if (flag_code != CODE_64BIT)
- {
- s_comm_internal (0, elf_common_parse);
- as_warn (_(".largecomm supported only in 64bit mode, producing .comm"));
- }
- else
- {
- static segT lbss_section;
- asection *saved_com_section_ptr = elf_com_section_ptr;
- asection *saved_bss_section = bss_section;
-
- if (lbss_section == NULL)
- {
- flagword applicable;
- segT seg = now_seg;
- subsegT subseg = now_subseg;
-
- /* The .lbss section is for local .largecomm symbols. */
- lbss_section = subseg_new (".lbss", 0);
- applicable = bfd_applicable_section_flags (stdoutput);
- bfd_set_section_flags (stdoutput, lbss_section,
- applicable & SEC_ALLOC);
- seg_info (lbss_section)->bss = 1;
-
- subseg_set (seg, subseg);
- }
-
- elf_com_section_ptr = &_bfd_elf_large_com_section;
- bss_section = lbss_section;
-
- s_comm_internal (0, elf_common_parse);
-
- elf_com_section_ptr = saved_com_section_ptr;
- bss_section = saved_bss_section;
- }
-}
-#endif /* OBJ_ELF || OBJ_MAYBE_ELF */
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
deleted file mode 100644
index 1e2adc39ae0..00000000000
--- a/gas/config/tc-mips.c
+++ /dev/null
@@ -1,15425 +0,0 @@
-/* tc-mips.c -- assemble code for a MIPS chip.
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
- Contributed by the OSF and Ralph Campbell.
- Written by Keith Knowles and Ralph Campbell, working independently.
- Modified for ECOFF and R4000 support by Ian Lance Taylor of Cygnus
- Support.
-
- This file is part of GAS.
-
- GAS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GAS 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 GAS; see the file COPYING. If not, write to the Free
- Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-#include "as.h"
-#include "config.h"
-#include "subsegs.h"
-#include "safe-ctype.h"
-
-#include "opcode/mips.h"
-#include "itbl-ops.h"
-#include "dwarf2dbg.h"
-#include "dw2gencfi.h"
-
-#ifdef DEBUG
-#define DBG(x) printf x
-#else
-#define DBG(x)
-#endif
-
-#ifdef OBJ_MAYBE_ELF
-/* Clean up namespace so we can include obj-elf.h too. */
-static int mips_output_flavor (void);
-static int mips_output_flavor (void) { return OUTPUT_FLAVOR; }
-#undef OBJ_PROCESS_STAB
-#undef OUTPUT_FLAVOR
-#undef S_GET_ALIGN
-#undef S_GET_SIZE
-#undef S_SET_ALIGN
-#undef S_SET_SIZE
-#undef obj_frob_file
-#undef obj_frob_file_after_relocs
-#undef obj_frob_symbol
-#undef obj_pop_insert
-#undef obj_sec_sym_ok_for_reloc
-#undef OBJ_COPY_SYMBOL_ATTRIBUTES
-
-#include "obj-elf.h"
-/* Fix any of them that we actually care about. */
-#undef OUTPUT_FLAVOR
-#define OUTPUT_FLAVOR mips_output_flavor()
-#endif
-
-#if defined (OBJ_ELF)
-#include "elf/mips.h"
-#endif
-
-#ifndef ECOFF_DEBUGGING
-#define NO_ECOFF_DEBUGGING
-#define ECOFF_DEBUGGING 0
-#endif
-
-int mips_flag_mdebug = -1;
-
-/* Control generation of .pdr sections. Off by default on IRIX: the native
- linker doesn't know about and discards them, but relocations against them
- remain, leading to rld crashes. */
-#ifdef TE_IRIX
-int mips_flag_pdr = FALSE;
-#else
-int mips_flag_pdr = TRUE;
-#endif
-
-#include "ecoff.h"
-
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-static char *mips_regmask_frag;
-#endif
-
-#define ZERO 0
-#define ATREG 1
-#define TREG 24
-#define PIC_CALL_REG 25
-#define KT0 26
-#define KT1 27
-#define GP 28
-#define SP 29
-#define FP 30
-#define RA 31
-
-#define ILLEGAL_REG (32)
-
-#define AT mips_opts.at
-
-/* Allow override of standard little-endian ECOFF format. */
-
-#ifndef ECOFF_LITTLE_FORMAT
-#define ECOFF_LITTLE_FORMAT "ecoff-littlemips"
-#endif
-
-extern int target_big_endian;
-
-/* The name of the readonly data section. */
-#define RDATA_SECTION_NAME (OUTPUT_FLAVOR == bfd_target_ecoff_flavour \
- ? ".rdata" \
- : OUTPUT_FLAVOR == bfd_target_coff_flavour \
- ? ".rdata" \
- : OUTPUT_FLAVOR == bfd_target_elf_flavour \
- ? ".rodata" \
- : (abort (), ""))
-
-/* Information about an instruction, including its format, operands
- and fixups. */
-struct mips_cl_insn
-{
- /* The opcode's entry in mips_opcodes or mips16_opcodes. */
- const struct mips_opcode *insn_mo;
-
- /* True if this is a mips16 instruction and if we want the extended
- form of INSN_MO. */
- bfd_boolean use_extend;
-
- /* The 16-bit extension instruction to use when USE_EXTEND is true. */
- unsigned short extend;
-
- /* The 16-bit or 32-bit bitstring of the instruction itself. This is
- a copy of INSN_MO->match with the operands filled in. */
- unsigned long insn_opcode;
-
- /* The frag that contains the instruction. */
- struct frag *frag;
-
- /* The offset into FRAG of the first instruction byte. */
- long where;
-
- /* The relocs associated with the instruction, if any. */
- fixS *fixp[3];
-
- /* True if this entry cannot be moved from its current position. */
- unsigned int fixed_p : 1;
-
- /* True if this instruction occurred in a .set noreorder block. */
- unsigned int noreorder_p : 1;
-
- /* True for mips16 instructions that jump to an absolute address. */
- unsigned int mips16_absolute_jump_p : 1;
-};
-
-/* The ABI to use. */
-enum mips_abi_level
-{
- NO_ABI = 0,
- O32_ABI,
- O64_ABI,
- N32_ABI,
- N64_ABI,
- EABI_ABI
-};
-
-/* MIPS ABI we are using for this output file. */
-static enum mips_abi_level mips_abi = NO_ABI;
-
-/* Whether or not we have code that can call pic code. */
-int mips_abicalls = FALSE;
-
-/* Whether or not we have code which can be put into a shared
- library. */
-static bfd_boolean mips_in_shared = TRUE;
-
-/* This is the set of options which may be modified by the .set
- pseudo-op. We use a struct so that .set push and .set pop are more
- reliable. */
-
-struct mips_set_options
-{
- /* MIPS ISA (Instruction Set Architecture) level. This is set to -1
- if it has not been initialized. Changed by `.set mipsN', and the
- -mipsN command line option, and the default CPU. */
- int isa;
- /* Enabled Application Specific Extensions (ASEs). These are set to -1
- if they have not been initialized. Changed by `.set <asename>', by
- command line options, and based on the default architecture. */
- int ase_mips3d;
- int ase_mdmx;
- int ase_smartmips;
- int ase_dsp;
- int ase_dspr2;
- int ase_mt;
- /* Whether we are assembling for the mips16 processor. 0 if we are
- not, 1 if we are, and -1 if the value has not been initialized.
- Changed by `.set mips16' and `.set nomips16', and the -mips16 and
- -nomips16 command line options, and the default CPU. */
- int mips16;
- /* Non-zero if we should not reorder instructions. Changed by `.set
- reorder' and `.set noreorder'. */
- int noreorder;
- /* Non-zero if we should not permit the register designated "assembler
- temporary" to be used in instructions. The value is the register
- number, normally $at ($1). Changed by `.set at=REG', `.set noat'
- (same as `.set at=$0') and `.set at' (same as `.set at=$1'). */
- unsigned int at;
- /* Non-zero if we should warn when a macro instruction expands into
- more than one machine instruction. Changed by `.set nomacro' and
- `.set macro'. */
- int warn_about_macros;
- /* Non-zero if we should not move instructions. Changed by `.set
- move', `.set volatile', `.set nomove', and `.set novolatile'. */
- int nomove;
- /* Non-zero if we should not optimize branches by moving the target
- of the branch into the delay slot. Actually, we don't perform
- this optimization anyhow. Changed by `.set bopt' and `.set
- nobopt'. */
- int nobopt;
- /* Non-zero if we should not autoextend mips16 instructions.
- Changed by `.set autoextend' and `.set noautoextend'. */
- int noautoextend;
- /* Restrict general purpose registers and floating point registers
- to 32 bit. This is initially determined when -mgp32 or -mfp32
- is passed but can changed if the assembler code uses .set mipsN. */
- int gp32;
- int fp32;
- /* MIPS architecture (CPU) type. Changed by .set arch=FOO, the -march
- command line option, and the default CPU. */
- int arch;
- /* True if ".set sym32" is in effect. */
- bfd_boolean sym32;
- /* True if floating-point operations are not allowed. Changed by .set
- softfloat or .set hardfloat, by command line options -msoft-float or
- -mhard-float. The default is false. */
- bfd_boolean soft_float;
-
- /* True if only single-precision floating-point operations are allowed.
- Changed by .set singlefloat or .set doublefloat, command-line options
- -msingle-float or -mdouble-float. The default is false. */
- bfd_boolean single_float;
-};
-
-/* This is the struct we use to hold the current set of options. Note
- that we must set the isa field to ISA_UNKNOWN and the ASE fields to
- -1 to indicate that they have not been initialized. */
-
-/* True if -mgp32 was passed. */
-static int file_mips_gp32 = -1;
-
-/* True if -mfp32 was passed. */
-static int file_mips_fp32 = -1;
-
-/* 1 if -msoft-float, 0 if -mhard-float. The default is 0. */
-static int file_mips_soft_float = 0;
-
-/* 1 if -msingle-float, 0 if -mdouble-float. The default is 0. */
-static int file_mips_single_float = 0;
-
-static struct mips_set_options mips_opts =
-{
- /* isa */ ISA_UNKNOWN, /* ase_mips3d */ -1, /* ase_mdmx */ -1,
- /* ase_smartmips */ 0, /* ase_dsp */ -1, /* ase_dspr2 */ -1, /* ase_mt */ -1,
- /* mips16 */ -1, /* noreorder */ 0, /* at */ ATREG,
- /* warn_about_macros */ 0, /* nomove */ 0, /* nobopt */ 0,
- /* noautoextend */ 0, /* gp32 */ 0, /* fp32 */ 0, /* arch */ CPU_UNKNOWN,
- /* sym32 */ FALSE, /* soft_float */ FALSE, /* single_float */ FALSE
-};
-
-/* These variables are filled in with the masks of registers used.
- The object format code reads them and puts them in the appropriate
- place. */
-unsigned long mips_gprmask;
-unsigned long mips_cprmask[4];
-
-/* MIPS ISA we are using for this output file. */
-static int file_mips_isa = ISA_UNKNOWN;
-
-/* True if -mips16 was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_mips16;
-
-#define ISA_SUPPORTS_MIPS16E (mips_opts.isa == ISA_MIPS32 \
- || mips_opts.isa == ISA_MIPS32R2 \
- || mips_opts.isa == ISA_MIPS64 \
- || mips_opts.isa == ISA_MIPS64R2)
-
-/* True if -mips3d was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_mips3d;
-
-/* True if -mdmx was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_mdmx;
-
-/* True if -msmartmips was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_smartmips;
-
-#define ISA_SUPPORTS_SMARTMIPS (mips_opts.isa == ISA_MIPS32 \
- || mips_opts.isa == ISA_MIPS32R2)
-
-/* True if -mdsp was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_dsp;
-
-#define ISA_SUPPORTS_DSP_ASE (mips_opts.isa == ISA_MIPS32R2 \
- || mips_opts.isa == ISA_MIPS64R2)
-
-#define ISA_SUPPORTS_DSP64_ASE (mips_opts.isa == ISA_MIPS64R2)
-
-/* True if -mdspr2 was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_dspr2;
-
-#define ISA_SUPPORTS_DSPR2_ASE (mips_opts.isa == ISA_MIPS32R2 \
- || mips_opts.isa == ISA_MIPS64R2)
-
-/* True if -mmt was passed or implied by arguments passed on the
- command line (e.g., by -march). */
-static int file_ase_mt;
-
-#define ISA_SUPPORTS_MT_ASE (mips_opts.isa == ISA_MIPS32R2 \
- || mips_opts.isa == ISA_MIPS64R2)
-
-/* The argument of the -march= flag. The architecture we are assembling. */
-static int file_mips_arch = CPU_UNKNOWN;
-static const char *mips_arch_string;
-
-/* The argument of the -mtune= flag. The architecture for which we
- are optimizing. */
-static int mips_tune = CPU_UNKNOWN;
-static const char *mips_tune_string;
-
-/* True when generating 32-bit code for a 64-bit processor. */
-static int mips_32bitmode = 0;
-
-/* True if the given ABI requires 32-bit registers. */
-#define ABI_NEEDS_32BIT_REGS(ABI) ((ABI) == O32_ABI)
-
-/* Likewise 64-bit registers. */
-#define ABI_NEEDS_64BIT_REGS(ABI) \
- ((ABI) == N32_ABI \
- || (ABI) == N64_ABI \
- || (ABI) == O64_ABI)
-
-/* Return true if ISA supports 64 bit wide gp registers. */
-#define ISA_HAS_64BIT_REGS(ISA) \
- ((ISA) == ISA_MIPS3 \
- || (ISA) == ISA_MIPS4 \
- || (ISA) == ISA_MIPS5 \
- || (ISA) == ISA_MIPS64 \
- || (ISA) == ISA_MIPS64R2)
-
-/* Return true if ISA supports 64 bit wide float registers. */
-#define ISA_HAS_64BIT_FPRS(ISA) \
- ((ISA) == ISA_MIPS3 \
- || (ISA) == ISA_MIPS4 \
- || (ISA) == ISA_MIPS5 \
- || (ISA) == ISA_MIPS32R2 \
- || (ISA) == ISA_MIPS64 \
- || (ISA) == ISA_MIPS64R2)
-
-/* Return true if ISA supports 64-bit right rotate (dror et al.)
- instructions. */
-#define ISA_HAS_DROR(ISA) \
- ((ISA) == ISA_MIPS64R2)
-
-/* Return true if ISA supports 32-bit right rotate (ror et al.)
- instructions. */
-#define ISA_HAS_ROR(ISA) \
- ((ISA) == ISA_MIPS32R2 \
- || (ISA) == ISA_MIPS64R2 \
- || mips_opts.ase_smartmips)
-
-/* Return true if ISA supports single-precision floats in odd registers. */
-#define ISA_HAS_ODD_SINGLE_FPR(ISA) \
- ((ISA) == ISA_MIPS32 \
- || (ISA) == ISA_MIPS32R2 \
- || (ISA) == ISA_MIPS64 \
- || (ISA) == ISA_MIPS64R2)
-
-/* Return true if ISA supports move to/from high part of a 64-bit
- floating-point register. */
-#define ISA_HAS_MXHC1(ISA) \
- ((ISA) == ISA_MIPS32R2 \
- || (ISA) == ISA_MIPS64R2)
-
-#define HAVE_32BIT_GPRS \
- (mips_opts.gp32 || !ISA_HAS_64BIT_REGS (mips_opts.isa))
-
-#define HAVE_32BIT_FPRS \
- (mips_opts.fp32 || !ISA_HAS_64BIT_FPRS (mips_opts.isa))
-
-#define HAVE_64BIT_GPRS (!HAVE_32BIT_GPRS)
-#define HAVE_64BIT_FPRS (!HAVE_32BIT_FPRS)
-
-#define HAVE_NEWABI (mips_abi == N32_ABI || mips_abi == N64_ABI)
-
-#define HAVE_64BIT_OBJECTS (mips_abi == N64_ABI)
-
-/* True if relocations are stored in-place. */
-#define HAVE_IN_PLACE_ADDENDS (!HAVE_NEWABI)
-
-/* The ABI-derived address size. */
-#define HAVE_64BIT_ADDRESSES \
- (HAVE_64BIT_GPRS && (mips_abi == EABI_ABI || mips_abi == N64_ABI))
-#define HAVE_32BIT_ADDRESSES (!HAVE_64BIT_ADDRESSES)
-
-/* The size of symbolic constants (i.e., expressions of the form
- "SYMBOL" or "SYMBOL + OFFSET"). */
-#define HAVE_32BIT_SYMBOLS \
- (HAVE_32BIT_ADDRESSES || !HAVE_64BIT_OBJECTS || mips_opts.sym32)
-#define HAVE_64BIT_SYMBOLS (!HAVE_32BIT_SYMBOLS)
-
-/* Addresses are loaded in different ways, depending on the address size
- in use. The n32 ABI Documentation also mandates the use of additions
- with overflow checking, but existing implementations don't follow it. */
-#define ADDRESS_ADD_INSN \
- (HAVE_32BIT_ADDRESSES ? "addu" : "daddu")
-
-#define ADDRESS_ADDI_INSN \
- (HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu")
-
-#define ADDRESS_LOAD_INSN \
- (HAVE_32BIT_ADDRESSES ? "lw" : "ld")
-
-#define ADDRESS_STORE_INSN \
- (HAVE_32BIT_ADDRESSES ? "sw" : "sd")
-
-/* Return true if the given CPU supports the MIPS16 ASE. */
-#define CPU_HAS_MIPS16(cpu) \
- (strncmp (TARGET_CPU, "mips16", sizeof ("mips16") - 1) == 0 \
- || strncmp (TARGET_CANONICAL, "mips-lsi-elf", sizeof ("mips-lsi-elf") - 1) == 0)
-
-/* True if CPU has a dror instruction. */
-#define CPU_HAS_DROR(CPU) ((CPU) == CPU_VR5400 || (CPU) == CPU_VR5500)
-
-/* True if CPU has a ror instruction. */
-#define CPU_HAS_ROR(CPU) CPU_HAS_DROR (CPU)
-
-/* True if CPU has seq/sne and seqi/snei instructions. */
-#define CPU_HAS_SEQ(CPU) ((CPU) == CPU_OCTEON)
-
-/* True if CPU does not implement the all the coprocessor insns. For these
- CPUs only those COP insns are accepted that are explicitly marked to be
- available on the CPU. ISA membership for COP insns is ignored. */
-#define NO_ISA_COP(CPU) ((CPU) == CPU_OCTEON)
-
-/* True if mflo and mfhi can be immediately followed by instructions
- which write to the HI and LO registers.
-
- According to MIPS specifications, MIPS ISAs I, II, and III need
- (at least) two instructions between the reads of HI/LO and
- instructions which write them, and later ISAs do not. Contradicting
- the MIPS specifications, some MIPS IV processor user manuals (e.g.
- the UM for the NEC Vr5000) document needing the instructions between
- HI/LO reads and writes, as well. Therefore, we declare only MIPS32,
- MIPS64 and later ISAs to have the interlocks, plus any specific
- earlier-ISA CPUs for which CPU documentation declares that the
- instructions are really interlocked. */
-#define hilo_interlocks \
- (mips_opts.isa == ISA_MIPS32 \
- || mips_opts.isa == ISA_MIPS32R2 \
- || mips_opts.isa == ISA_MIPS64 \
- || mips_opts.isa == ISA_MIPS64R2 \
- || mips_opts.arch == CPU_R4010 \
- || mips_opts.arch == CPU_R10000 \
- || mips_opts.arch == CPU_R12000 \
- || mips_opts.arch == CPU_RM7000 \
- || mips_opts.arch == CPU_VR5500 \
- )
-
-/* Whether the processor uses hardware interlocks to protect reads
- from the GPRs after they are loaded from memory, and thus does not
- require nops to be inserted. This applies to instructions marked
- INSN_LOAD_MEMORY_DELAY. These nops are only required at MIPS ISA
- level I. */
-#define gpr_interlocks \
- (mips_opts.isa != ISA_MIPS1 \
- || mips_opts.arch == CPU_R3900)
-
-/* Whether the processor uses hardware interlocks to avoid delays
- required by coprocessor instructions, and thus does not require
- nops to be inserted. This applies to instructions marked
- INSN_LOAD_COPROC_DELAY, INSN_COPROC_MOVE_DELAY, and to delays
- between instructions marked INSN_WRITE_COND_CODE and ones marked
- INSN_READ_COND_CODE. These nops are only required at MIPS ISA
- levels I, II, and III. */
-/* Itbl support may require additional care here. */
-#define cop_interlocks \
- ((mips_opts.isa != ISA_MIPS1 \
- && mips_opts.isa != ISA_MIPS2 \
- && mips_opts.isa != ISA_MIPS3) \
- || mips_opts.arch == CPU_R4300 \
- )
-
-/* Whether the processor uses hardware interlocks to protect reads
- from coprocessor registers after they are loaded from memory, and
- thus does not require nops to be inserted. This applies to
- instructions marked INSN_COPROC_MEMORY_DELAY. These nops are only
- requires at MIPS ISA level I. */
-#define cop_mem_interlocks (mips_opts.isa != ISA_MIPS1)
-
-/* Is this a mfhi or mflo instruction? */
-#define MF_HILO_INSN(PINFO) \
- ((PINFO & INSN_READ_HI) || (PINFO & INSN_READ_LO))
-
-/* Returns true for a (non floating-point) coprocessor instruction. Reading
- or writing the condition code is only possible on the coprocessors and
- these insns are not marked with INSN_COP. Thus for these insns use the
- condition-code flags unless this is the floating-point coprocessor. */
-#define COP_INSN(PINFO) \
- (PINFO != INSN_MACRO \
- && (((PINFO) & INSN_COP) \
- || ((PINFO) & (INSN_READ_COND_CODE | INSN_WRITE_COND_CODE) \
- && ((PINFO) & (FP_S | FP_D)) == 0)))
-
-/* MIPS PIC level. */
-
-enum mips_pic_level mips_pic;
-
-/* 1 if we should generate 32 bit offsets from the $gp register in
- SVR4_PIC mode. Currently has no meaning in other modes. */
-static int mips_big_got = 0;
-
-/* 1 if trap instructions should used for overflow rather than break
- instructions. */
-static int mips_trap = 0;
-
-/* 1 if double width floating point constants should not be constructed
- by assembling two single width halves into two single width floating
- point registers which just happen to alias the double width destination
- register. On some architectures this aliasing can be disabled by a bit
- in the status register, and the setting of this bit cannot be determined
- automatically at assemble time. */
-static int mips_disable_float_construction;
-
-/* Non-zero if any .set noreorder directives were used. */
-
-static int mips_any_noreorder;
-
-/* Non-zero if nops should be inserted when the register referenced in
- an mfhi/mflo instruction is read in the next two instructions. */
-static int mips_7000_hilo_fix;
-
-/* The size of objects in the small data section. */
-static unsigned int g_switch_value = 8;
-/* Whether the -G option was used. */
-static int g_switch_seen = 0;
-
-#define N_RMASK 0xc4
-#define N_VFP 0xd4
-
-/* If we can determine in advance that GP optimization won't be
- possible, we can skip the relaxation stuff that tries to produce
- GP-relative references. This makes delay slot optimization work
- better.
-
- This function can only provide a guess, but it seems to work for
- gcc output. It needs to guess right for gcc, otherwise gcc
- will put what it thinks is a GP-relative instruction in a branch
- delay slot.
-
- I don't know if a fix is needed for the SVR4_PIC mode. I've only
- fixed it for the non-PIC mode. KR 95/04/07 */
-static int nopic_need_relax (symbolS *, int);
-
-/* handle of the OPCODE hash table */
-static struct hash_control *op_hash = NULL;
-
-/* The opcode hash table we use for the mips16. */
-static struct hash_control *mips16_op_hash = NULL;
-
-/* This array holds the chars that always start a comment. If the
- pre-processor is disabled, these aren't very useful */
-const char comment_chars[] = "#";
-
-/* This array holds the chars that only start a comment at the beginning of
- a line. If the line seems to have the form '# 123 filename'
- .line and .file directives will appear in the pre-processed output */
-/* Note that input_file.c hand checks for '#' at the beginning of the
- first line of the input file. This is because the compiler outputs
- #NO_APP at the beginning of its output. */
-/* Also note that C style comments are always supported. */
-const char line_comment_chars[] = "#";
-
-/* This array holds machine specific line separator characters. */
-const char line_separator_chars[] = ";";
-
-/* Chars that can be used to separate mant from exp in floating point nums */
-const char EXP_CHARS[] = "eE";
-
-/* Chars that mean this number is a floating point constant */
-/* As in 0f12.456 */
-/* or 0d1.2345e12 */
-const char FLT_CHARS[] = "rRsSfFdDxXpP";
-
-/* Also be aware that MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT may have to be
- changed in read.c . Ideally it shouldn't have to know about it at all,
- but nothing is ideal around here.
- */
-
-static char *insn_error;
-
-static int auto_align = 1;
-
-/* When outputting SVR4 PIC code, the assembler needs to know the
- offset in the stack frame from which to restore the $gp register.
- This is set by the .cprestore pseudo-op, and saved in this
- variable. */
-static offsetT mips_cprestore_offset = -1;
-
-/* Similar for NewABI PIC code, where $gp is callee-saved. NewABI has some
- more optimizations, it can use a register value instead of a memory-saved
- offset and even an other register than $gp as global pointer. */
-static offsetT mips_cpreturn_offset = -1;
-static int mips_cpreturn_register = -1;
-static int mips_gp_register = GP;
-static int mips_gprel_offset = 0;
-
-/* Whether mips_cprestore_offset has been set in the current function
- (or whether it has already been warned about, if not). */
-static int mips_cprestore_valid = 0;
-
-/* This is the register which holds the stack frame, as set by the
- .frame pseudo-op. This is needed to implement .cprestore. */
-static int mips_frame_reg = SP;
-
-/* Whether mips_frame_reg has been set in the current function
- (or whether it has already been warned about, if not). */
-static int mips_frame_reg_valid = 0;
-
-/* To output NOP instructions correctly, we need to keep information
- about the previous two instructions. */
-
-/* Whether we are optimizing. The default value of 2 means to remove
- unneeded NOPs and swap branch instructions when possible. A value
- of 1 means to not swap branches. A value of 0 means to always
- insert NOPs. */
-static int mips_optimize = 2;
-
-/* Debugging level. -g sets this to 2. -gN sets this to N. -g0 is
- equivalent to seeing no -g option at all. */
-static int mips_debug = 0;
-
-/* The maximum number of NOPs needed to avoid the VR4130 mflo/mfhi errata. */
-#define MAX_VR4130_NOPS 4
-
-/* The maximum number of NOPs needed to fill delay slots. */
-#define MAX_DELAY_NOPS 2
-
-/* The maximum number of NOPs needed for any purpose. */
-#define MAX_NOPS 4
-
-/* A list of previous instructions, with index 0 being the most recent.
- We need to look back MAX_NOPS instructions when filling delay slots
- or working around processor errata. We need to look back one
- instruction further if we're thinking about using history[0] to
- fill a branch delay slot. */
-static struct mips_cl_insn history[1 + MAX_NOPS];
-
-/* Nop instructions used by emit_nop. */
-static struct mips_cl_insn nop_insn, mips16_nop_insn;
-
-/* The appropriate nop for the current mode. */
-#define NOP_INSN (mips_opts.mips16 ? &mips16_nop_insn : &nop_insn)
-
-/* If this is set, it points to a frag holding nop instructions which
- were inserted before the start of a noreorder section. If those
- nops turn out to be unnecessary, the size of the frag can be
- decreased. */
-static fragS *prev_nop_frag;
-
-/* The number of nop instructions we created in prev_nop_frag. */
-static int prev_nop_frag_holds;
-
-/* The number of nop instructions that we know we need in
- prev_nop_frag. */
-static int prev_nop_frag_required;
-
-/* The number of instructions we've seen since prev_nop_frag. */
-static int prev_nop_frag_since;
-
-/* For ECOFF and ELF, relocations against symbols are done in two
- parts, with a HI relocation and a LO relocation. Each relocation
- has only 16 bits of space to store an addend. This means that in
- order for the linker to handle carries correctly, it must be able
- to locate both the HI and the LO relocation. This means that the
- relocations must appear in order in the relocation table.
-
- In order to implement this, we keep track of each unmatched HI
- relocation. We then sort them so that they immediately precede the
- corresponding LO relocation. */
-
-struct mips_hi_fixup
-{
- /* Next HI fixup. */
- struct mips_hi_fixup *next;
- /* This fixup. */
- fixS *fixp;
- /* The section this fixup is in. */
- segT seg;
-};
-
-/* The list of unmatched HI relocs. */
-
-static struct mips_hi_fixup *mips_hi_fixup_list;
-
-/* The frag containing the last explicit relocation operator.
- Null if explicit relocations have not been used. */
-
-static fragS *prev_reloc_op_frag;
-
-/* Map normal MIPS register numbers to mips16 register numbers. */
-
-#define X ILLEGAL_REG
-static const int mips32_to_16_reg_map[] =
-{
- X, X, 2, 3, 4, 5, 6, 7,
- X, X, X, X, X, X, X, X,
- 0, 1, X, X, X, X, X, X,
- X, X, X, X, X, X, X, X
-};
-#undef X
-
-/* Map mips16 register numbers to normal MIPS register numbers. */
-
-static const unsigned int mips16_to_32_reg_map[] =
-{
- 16, 17, 2, 3, 4, 5, 6, 7
-};
-
-/* Classifies the kind of instructions we're interested in when
- implementing -mfix-vr4120. */
-enum fix_vr4120_class {
- FIX_VR4120_MACC,
- FIX_VR4120_DMACC,
- FIX_VR4120_MULT,
- FIX_VR4120_DMULT,
- FIX_VR4120_DIV,
- FIX_VR4120_MTHILO,
- NUM_FIX_VR4120_CLASSES
-};
-
-/* Given two FIX_VR4120_* values X and Y, bit Y of element X is set if
- there must be at least one other instruction between an instruction
- of type X and an instruction of type Y. */
-static unsigned int vr4120_conflicts[NUM_FIX_VR4120_CLASSES];
-
-/* True if -mfix-vr4120 is in force. */
-static int mips_fix_vr4120;
-
-/* ...likewise -mfix-vr4130. */
-static int mips_fix_vr4130;
-
-/* We don't relax branches by default, since this causes us to expand
- `la .l2 - .l1' if there's a branch between .l1 and .l2, because we
- fail to compute the offset before expanding the macro to the most
- efficient expansion. */
-
-static int mips_relax_branch;
-
-/* The expansion of many macros depends on the type of symbol that
- they refer to. For example, when generating position-dependent code,
- a macro that refers to a symbol may have two different expansions,
- one which uses GP-relative addresses and one which uses absolute
- addresses. When generating SVR4-style PIC, a macro may have
- different expansions for local and global symbols.
-
- We handle these situations by generating both sequences and putting
- them in variant frags. In position-dependent code, the first sequence
- will be the GP-relative one and the second sequence will be the
- absolute one. In SVR4 PIC, the first sequence will be for global
- symbols and the second will be for local symbols.
-
- The frag's "subtype" is RELAX_ENCODE (FIRST, SECOND), where FIRST and
- SECOND are the lengths of the two sequences in bytes. These fields
- can be extracted using RELAX_FIRST() and RELAX_SECOND(). In addition,
- the subtype has the following flags:
-
- RELAX_USE_SECOND
- Set if it has been decided that we should use the second
- sequence instead of the first.
-
- RELAX_SECOND_LONGER
- Set in the first variant frag if the macro's second implementation
- is longer than its first. This refers to the macro as a whole,
- not an individual relaxation.
-
- RELAX_NOMACRO
- Set in the first variant frag if the macro appeared in a .set nomacro
- block and if one alternative requires a warning but the other does not.
-
- RELAX_DELAY_SLOT
- Like RELAX_NOMACRO, but indicates that the macro appears in a branch
- delay slot.
-
- The frag's "opcode" points to the first fixup for relaxable code.
-
- Relaxable macros are generated using a sequence such as:
-
- relax_start (SYMBOL);
- ... generate first expansion ...
- relax_switch ();
- ... generate second expansion ...
- relax_end ();
-
- The code and fixups for the unwanted alternative are discarded
- by md_convert_frag. */
-#define RELAX_ENCODE(FIRST, SECOND) (((FIRST) << 8) | (SECOND))
-
-#define RELAX_FIRST(X) (((X) >> 8) & 0xff)
-#define RELAX_SECOND(X) ((X) & 0xff)
-#define RELAX_USE_SECOND 0x10000
-#define RELAX_SECOND_LONGER 0x20000
-#define RELAX_NOMACRO 0x40000
-#define RELAX_DELAY_SLOT 0x80000
-
-/* Branch without likely bit. If label is out of range, we turn:
-
- beq reg1, reg2, label
- delay slot
-
- into
-
- bne reg1, reg2, 0f
- nop
- j label
- 0: delay slot
-
- with the following opcode replacements:
-
- beq <-> bne
- blez <-> bgtz
- bltz <-> bgez
- bc1f <-> bc1t
-
- bltzal <-> bgezal (with jal label instead of j label)
-
- Even though keeping the delay slot instruction in the delay slot of
- the branch would be more efficient, it would be very tricky to do
- correctly, because we'd have to introduce a variable frag *after*
- the delay slot instruction, and expand that instead. Let's do it
- the easy way for now, even if the branch-not-taken case now costs
- one additional instruction. Out-of-range branches are not supposed
- to be common, anyway.
-
- Branch likely. If label is out of range, we turn:
-
- beql reg1, reg2, label
- delay slot (annulled if branch not taken)
-
- into
-
- beql reg1, reg2, 1f
- nop
- beql $0, $0, 2f
- nop
- 1: j[al] label
- delay slot (executed only if branch taken)
- 2:
-
- It would be possible to generate a shorter sequence by losing the
- likely bit, generating something like:
-
- bne reg1, reg2, 0f
- nop
- j[al] label
- delay slot (executed only if branch taken)
- 0:
-
- beql -> bne
- bnel -> beq
- blezl -> bgtz
- bgtzl -> blez
- bltzl -> bgez
- bgezl -> bltz
- bc1fl -> bc1t
- bc1tl -> bc1f
-
- bltzall -> bgezal (with jal label instead of j label)
- bgezall -> bltzal (ditto)
-
-
- but it's not clear that it would actually improve performance. */
-#define RELAX_BRANCH_ENCODE(uncond, likely, link, toofar) \
- ((relax_substateT) \
- (0xc0000000 \
- | ((toofar) ? 1 : 0) \
- | ((link) ? 2 : 0) \
- | ((likely) ? 4 : 0) \
- | ((uncond) ? 8 : 0)))
-#define RELAX_BRANCH_P(i) (((i) & 0xf0000000) == 0xc0000000)
-#define RELAX_BRANCH_UNCOND(i) (((i) & 8) != 0)
-#define RELAX_BRANCH_LIKELY(i) (((i) & 4) != 0)
-#define RELAX_BRANCH_LINK(i) (((i) & 2) != 0)
-#define RELAX_BRANCH_TOOFAR(i) (((i) & 1) != 0)
-
-/* For mips16 code, we use an entirely different form of relaxation.
- mips16 supports two versions of most instructions which take
- immediate values: a small one which takes some small value, and a
- larger one which takes a 16 bit value. Since branches also follow
- this pattern, relaxing these values is required.
-
- We can assemble both mips16 and normal MIPS code in a single
- object. Therefore, we need to support this type of relaxation at
- the same time that we support the relaxation described above. We
- use the high bit of the subtype field to distinguish these cases.
-
- The information we store for this type of relaxation is the
- argument code found in the opcode file for this relocation, whether
- the user explicitly requested a small or extended form, and whether
- the relocation is in a jump or jal delay slot. That tells us the
- size of the value, and how it should be stored. We also store
- whether the fragment is considered to be extended or not. We also
- store whether this is known to be a branch to a different section,
- whether we have tried to relax this frag yet, and whether we have
- ever extended a PC relative fragment because of a shift count. */
-#define RELAX_MIPS16_ENCODE(type, small, ext, dslot, jal_dslot) \
- (0x80000000 \
- | ((type) & 0xff) \
- | ((small) ? 0x100 : 0) \
- | ((ext) ? 0x200 : 0) \
- | ((dslot) ? 0x400 : 0) \
- | ((jal_dslot) ? 0x800 : 0))
-#define RELAX_MIPS16_P(i) (((i) & 0xc0000000) == 0x80000000)
-#define RELAX_MIPS16_TYPE(i) ((i) & 0xff)
-#define RELAX_MIPS16_USER_SMALL(i) (((i) & 0x100) != 0)
-#define RELAX_MIPS16_USER_EXT(i) (((i) & 0x200) != 0)
-#define RELAX_MIPS16_DSLOT(i) (((i) & 0x400) != 0)
-#define RELAX_MIPS16_JAL_DSLOT(i) (((i) & 0x800) != 0)
-#define RELAX_MIPS16_EXTENDED(i) (((i) & 0x1000) != 0)
-#define RELAX_MIPS16_MARK_EXTENDED(i) ((i) | 0x1000)
-#define RELAX_MIPS16_CLEAR_EXTENDED(i) ((i) &~ 0x1000)
-#define RELAX_MIPS16_LONG_BRANCH(i) (((i) & 0x2000) != 0)
-#define RELAX_MIPS16_MARK_LONG_BRANCH(i) ((i) | 0x2000)
-#define RELAX_MIPS16_CLEAR_LONG_BRANCH(i) ((i) &~ 0x2000)
-
-/* Is the given value a sign-extended 32-bit value? */
-#define IS_SEXT_32BIT_NUM(x) \
- (((x) &~ (offsetT) 0x7fffffff) == 0 \
- || (((x) &~ (offsetT) 0x7fffffff) == ~ (offsetT) 0x7fffffff))
-
-/* Is the given value a sign-extended 16-bit value? */
-#define IS_SEXT_16BIT_NUM(x) \
- (((x) &~ (offsetT) 0x7fff) == 0 \
- || (((x) &~ (offsetT) 0x7fff) == ~ (offsetT) 0x7fff))
-
-/* Is the given value a zero-extended 32-bit value? Or a negated one? */
-#define IS_ZEXT_32BIT_NUM(x) \
- (((x) &~ (offsetT) 0xffffffff) == 0 \
- || (((x) &~ (offsetT) 0xffffffff) == ~ (offsetT) 0xffffffff))
-
-/* Replace bits MASK << SHIFT of STRUCT with the equivalent bits in
- VALUE << SHIFT. VALUE is evaluated exactly once. */
-#define INSERT_BITS(STRUCT, VALUE, MASK, SHIFT) \
- (STRUCT) = (((STRUCT) & ~((MASK) << (SHIFT))) \
- | (((VALUE) & (MASK)) << (SHIFT)))
-
-/* Extract bits MASK << SHIFT from STRUCT and shift them right
- SHIFT places. */
-#define EXTRACT_BITS(STRUCT, MASK, SHIFT) \
- (((STRUCT) >> (SHIFT)) & (MASK))
-
-/* Change INSN's opcode so that the operand given by FIELD has value VALUE.
- INSN is a mips_cl_insn structure and VALUE is evaluated exactly once.
-
- include/opcode/mips.h specifies operand fields using the macros
- OP_MASK_<FIELD> and OP_SH_<FIELD>. The MIPS16 equivalents start
- with "MIPS16OP" instead of "OP". */
-#define INSERT_OPERAND(FIELD, INSN, VALUE) \
- INSERT_BITS ((INSN).insn_opcode, VALUE, OP_MASK_##FIELD, OP_SH_##FIELD)
-#define MIPS16_INSERT_OPERAND(FIELD, INSN, VALUE) \
- INSERT_BITS ((INSN).insn_opcode, VALUE, \
- MIPS16OP_MASK_##FIELD, MIPS16OP_SH_##FIELD)
-
-/* Extract the operand given by FIELD from mips_cl_insn INSN. */
-#define EXTRACT_OPERAND(FIELD, INSN) \
- EXTRACT_BITS ((INSN).insn_opcode, OP_MASK_##FIELD, OP_SH_##FIELD)
-#define MIPS16_EXTRACT_OPERAND(FIELD, INSN) \
- EXTRACT_BITS ((INSN).insn_opcode, \
- MIPS16OP_MASK_##FIELD, \
- MIPS16OP_SH_##FIELD)
-
-/* Global variables used when generating relaxable macros. See the
- comment above RELAX_ENCODE for more details about how relaxation
- is used. */
-static struct {
- /* 0 if we're not emitting a relaxable macro.
- 1 if we're emitting the first of the two relaxation alternatives.
- 2 if we're emitting the second alternative. */
- int sequence;
-
- /* The first relaxable fixup in the current frag. (In other words,
- the first fixup that refers to relaxable code.) */
- fixS *first_fixup;
-
- /* sizes[0] says how many bytes of the first alternative are stored in
- the current frag. Likewise sizes[1] for the second alternative. */
- unsigned int sizes[2];
-
- /* The symbol on which the choice of sequence depends. */
- symbolS *symbol;
-} mips_relax;
-
-/* Global variables used to decide whether a macro needs a warning. */
-static struct {
- /* True if the macro is in a branch delay slot. */
- bfd_boolean delay_slot_p;
-
- /* For relaxable macros, sizes[0] is the length of the first alternative
- in bytes and sizes[1] is the length of the second alternative.
- For non-relaxable macros, both elements give the length of the
- macro in bytes. */
- unsigned int sizes[2];
-
- /* The first variant frag for this macro. */
- fragS *first_frag;
-} mips_macro_warning;
-
-/* Prototypes for static functions. */
-
-#define internalError() \
- as_fatal (_("internal Error, line %d, %s"), __LINE__, __FILE__)
-
-enum mips_regclass { MIPS_GR_REG, MIPS_FP_REG, MIPS16_REG };
-
-static void append_insn
- (struct mips_cl_insn *ip, expressionS *p, bfd_reloc_code_real_type *r);
-static void mips_no_prev_insn (void);
-static void mips16_macro_build
- (expressionS *, const char *, const char *, va_list);
-static void load_register (int, expressionS *, int);
-static void macro_start (void);
-static void macro_end (void);
-static void macro (struct mips_cl_insn * ip);
-static void mips16_macro (struct mips_cl_insn * ip);
-#ifdef LOSING_COMPILER
-static void macro2 (struct mips_cl_insn * ip);
-#endif
-static void mips_ip (char *str, struct mips_cl_insn * ip);
-static void mips16_ip (char *str, struct mips_cl_insn * ip);
-static void mips16_immed
- (char *, unsigned int, int, offsetT, bfd_boolean, bfd_boolean, bfd_boolean,
- unsigned long *, bfd_boolean *, unsigned short *);
-static size_t my_getSmallExpression
- (expressionS *, bfd_reloc_code_real_type *, char *);
-static void my_getExpression (expressionS *, char *);
-static void s_align (int);
-static void s_change_sec (int);
-static void s_change_section (int);
-static void s_cons (int);
-static void s_float_cons (int);
-static void s_mips_globl (int);
-static void s_option (int);
-static void s_mipsset (int);
-static void s_abicalls (int);
-static void s_cpload (int);
-static void s_cpsetup (int);
-static void s_cplocal (int);
-static void s_cprestore (int);
-static void s_cpreturn (int);
-static void s_dtprelword (int);
-static void s_dtpreldword (int);
-static void s_gpvalue (int);
-static void s_gpword (int);
-static void s_gpdword (int);
-static void s_cpadd (int);
-static void s_insn (int);
-static void md_obj_begin (void);
-static void md_obj_end (void);
-static void s_mips_ent (int);
-static void s_mips_end (int);
-static void s_mips_frame (int);
-static void s_mips_mask (int reg_type);
-static void s_mips_stab (int);
-static void s_mips_weakext (int);
-static void s_mips_file (int);
-static void s_mips_loc (int);
-static bfd_boolean pic_need_relax (symbolS *, asection *);
-static int relaxed_branch_length (fragS *, asection *, int);
-static int validate_mips_insn (const struct mips_opcode *);
-
-/* Table and functions used to map between CPU/ISA names, and
- ISA levels, and CPU numbers. */
-
-struct mips_cpu_info
-{
- const char *name; /* CPU or ISA name. */
- int flags; /* ASEs available, or ISA flag. */
- int isa; /* ISA level. */
- int cpu; /* CPU number (default CPU if ISA). */
-};
-
-#define MIPS_CPU_IS_ISA 0x0001 /* Is this an ISA? (If 0, a CPU.) */
-#define MIPS_CPU_ASE_SMARTMIPS 0x0002 /* CPU implements SmartMIPS ASE */
-#define MIPS_CPU_ASE_DSP 0x0004 /* CPU implements DSP ASE */
-#define MIPS_CPU_ASE_MT 0x0008 /* CPU implements MT ASE */
-#define MIPS_CPU_ASE_MIPS3D 0x0010 /* CPU implements MIPS-3D ASE */
-#define MIPS_CPU_ASE_MDMX 0x0020 /* CPU implements MDMX ASE */
-#define MIPS_CPU_ASE_DSPR2 0x0040 /* CPU implements DSP R2 ASE */
-
-static const struct mips_cpu_info *mips_parse_cpu (const char *, const char *);
-static const struct mips_cpu_info *mips_cpu_info_from_isa (int);
-static const struct mips_cpu_info *mips_cpu_info_from_arch (int);
-
-/* Pseudo-op table.
-
- The following pseudo-ops from the Kane and Heinrich MIPS book
- should be defined here, but are currently unsupported: .alias,
- .galive, .gjaldef, .gjrlive, .livereg, .noalias.
-
- The following pseudo-ops from the Kane and Heinrich MIPS book are
- specific to the type of debugging information being generated, and
- should be defined by the object format: .aent, .begin, .bend,
- .bgnb, .end, .endb, .ent, .fmask, .frame, .loc, .mask, .verstamp,
- .vreg.
-
- The following pseudo-ops from the Kane and Heinrich MIPS book are
- not MIPS CPU specific, but are also not specific to the object file
- format. This file is probably the best place to define them, but
- they are not currently supported: .asm0, .endr, .lab, .struct. */
-
-static const pseudo_typeS mips_pseudo_table[] =
-{
- /* MIPS specific pseudo-ops. */
- {"option", s_option, 0},
- {"set", s_mipsset, 0},
- {"rdata", s_change_sec, 'r'},
- {"sdata", s_change_sec, 's'},
- {"livereg", s_ignore, 0},
- {"abicalls", s_abicalls, 0},
- {"cpload", s_cpload, 0},
- {"cpsetup", s_cpsetup, 0},
- {"cplocal", s_cplocal, 0},
- {"cprestore", s_cprestore, 0},
- {"cpreturn", s_cpreturn, 0},
- {"dtprelword", s_dtprelword, 0},
- {"dtpreldword", s_dtpreldword, 0},
- {"gpvalue", s_gpvalue, 0},
- {"gpword", s_gpword, 0},
- {"gpdword", s_gpdword, 0},
- {"cpadd", s_cpadd, 0},
- {"insn", s_insn, 0},
-
- /* Relatively generic pseudo-ops that happen to be used on MIPS
- chips. */
- {"asciiz", stringer, 8 + 1},
- {"bss", s_change_sec, 'b'},
- {"err", s_err, 0},
- {"half", s_cons, 1},
- {"dword", s_cons, 3},
- {"weakext", s_mips_weakext, 0},
- {"origin", s_org, 0},
- {"repeat", s_rept, 0},
-
- /* These pseudo-ops are defined in read.c, but must be overridden
- here for one reason or another. */
- {"align", s_align, 0},
- {"byte", s_cons, 0},
- {"data", s_change_sec, 'd'},
- {"double", s_float_cons, 'd'},
- {"float", s_float_cons, 'f'},
- {"globl", s_mips_globl, 0},
- {"global", s_mips_globl, 0},
- {"hword", s_cons, 1},
- {"int", s_cons, 2},
- {"long", s_cons, 2},
- {"octa", s_cons, 4},
- {"quad", s_cons, 3},
- {"section", s_change_section, 0},
- {"short", s_cons, 1},
- {"single", s_float_cons, 'f'},
- {"stabn", s_mips_stab, 'n'},
- {"text", s_change_sec, 't'},
- {"word", s_cons, 2},
-
- { "extern", ecoff_directive_extern, 0},
-
- { NULL, NULL, 0 },
-};
-
-static const pseudo_typeS mips_nonecoff_pseudo_table[] =
-{
- /* These pseudo-ops should be defined by the object file format.
- However, a.out doesn't support them, so we have versions here. */
- {"aent", s_mips_ent, 1},
- {"bgnb", s_ignore, 0},
- {"end", s_mips_end, 0},
- {"endb", s_ignore, 0},
- {"ent", s_mips_ent, 0},
- {"file", s_mips_file, 0},
- {"fmask", s_mips_mask, 'F'},
- {"frame", s_mips_frame, 0},
- {"loc", s_mips_loc, 0},
- {"mask", s_mips_mask, 'R'},
- {"verstamp", s_ignore, 0},
- { NULL, NULL, 0 },
-};
-
-extern void pop_insert (const pseudo_typeS *);
-
-void
-mips_pop_insert (void)
-{
- pop_insert (mips_pseudo_table);
- if (! ECOFF_DEBUGGING)
- pop_insert (mips_nonecoff_pseudo_table);
-}
-
-/* Symbols labelling the current insn. */
-
-struct insn_label_list
-{
- struct insn_label_list *next;
- symbolS *label;
-};
-
-static struct insn_label_list *free_insn_labels;
-#define label_list tc_segment_info_data.labels
-
-static void mips_clear_insn_labels (void);
-
-static inline void
-mips_clear_insn_labels (void)
-{
- register struct insn_label_list **pl;
- segment_info_type *si;
-
- if (now_seg)
- {
- for (pl = &free_insn_labels; *pl != NULL; pl = &(*pl)->next)
- ;
-
- si = seg_info (now_seg);
- *pl = si->label_list;
- si->label_list = NULL;
- }
-}
-
-
-static char *expr_end;
-
-/* Expressions which appear in instructions. These are set by
- mips_ip. */
-
-static expressionS imm_expr;
-static expressionS imm2_expr;
-static expressionS offset_expr;
-
-/* Relocs associated with imm_expr and offset_expr. */
-
-static bfd_reloc_code_real_type imm_reloc[3]
- = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
-static bfd_reloc_code_real_type offset_reloc[3]
- = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
-
-/* These are set by mips16_ip if an explicit extension is used. */
-
-static bfd_boolean mips16_small, mips16_ext;
-
-#ifdef OBJ_ELF
-/* The pdr segment for per procedure frame/regmask info. Not used for
- ECOFF debugging. */
-
-static segT pdr_seg;
-#endif
-
-/* The default target format to use. */
-
-const char *
-mips_target_format (void)
-{
- switch (OUTPUT_FLAVOR)
- {
- case bfd_target_ecoff_flavour:
- return target_big_endian ? "ecoff-bigmips" : ECOFF_LITTLE_FORMAT;
- case bfd_target_coff_flavour:
- return "pe-mips";
- case bfd_target_elf_flavour:
-#ifdef TE_VXWORKS
- if (!HAVE_64BIT_OBJECTS && !HAVE_NEWABI)
- return (target_big_endian
- ? "elf32-bigmips-vxworks"
- : "elf32-littlemips-vxworks");
-#endif
-#ifdef TE_TMIPS
- /* This is traditional mips. */
- return (target_big_endian
- ? (HAVE_64BIT_OBJECTS
- ? "elf64-tradbigmips"
- : (HAVE_NEWABI
- ? "elf32-ntradbigmips" : "elf32-tradbigmips"))
- : (HAVE_64BIT_OBJECTS
- ? "elf64-tradlittlemips"
- : (HAVE_NEWABI
- ? "elf32-ntradlittlemips" : "elf32-tradlittlemips")));
-#else
- return (target_big_endian
- ? (HAVE_64BIT_OBJECTS
- ? "elf64-bigmips"
- : (HAVE_NEWABI
- ? "elf32-nbigmips" : "elf32-bigmips"))
- : (HAVE_64BIT_OBJECTS
- ? "elf64-littlemips"
- : (HAVE_NEWABI
- ? "elf32-nlittlemips" : "elf32-littlemips")));
-#endif
- default:
- abort ();
- return NULL;
- }
-}
-
-/* Return the length of instruction INSN. */
-
-static inline unsigned int
-insn_length (const struct mips_cl_insn *insn)
-{
- if (!mips_opts.mips16)
- return 4;
- return insn->mips16_absolute_jump_p || insn->use_extend ? 4 : 2;
-}
-
-/* Initialise INSN from opcode entry MO. Leave its position unspecified. */
-
-static void
-create_insn (struct mips_cl_insn *insn, const struct mips_opcode *mo)
-{
- size_t i;
-
- insn->insn_mo = mo;
- insn->use_extend = FALSE;
- insn->extend = 0;
- insn->insn_opcode = mo->match;
- insn->frag = NULL;
- insn->where = 0;
- for (i = 0; i < ARRAY_SIZE (insn->fixp); i++)
- insn->fixp[i] = NULL;
- insn->fixed_p = (mips_opts.noreorder > 0);
- insn->noreorder_p = (mips_opts.noreorder > 0);
- insn->mips16_absolute_jump_p = 0;
-}
-
-/* Record the current MIPS16 mode in now_seg. */
-
-static void
-mips_record_mips16_mode (void)
-{
- segment_info_type *si;
-
- si = seg_info (now_seg);
- if (si->tc_segment_info_data.mips16 != mips_opts.mips16)
- si->tc_segment_info_data.mips16 = mips_opts.mips16;
-}
-
-/* Install INSN at the location specified by its "frag" and "where" fields. */
-
-static void
-install_insn (const struct mips_cl_insn *insn)
-{
- char *f = insn->frag->fr_literal + insn->where;
- if (!mips_opts.mips16)
- md_number_to_chars (f, insn->insn_opcode, 4);
- else if (insn->mips16_absolute_jump_p)
- {
- md_number_to_chars (f, insn->insn_opcode >> 16, 2);
- md_number_to_chars (f + 2, insn->insn_opcode & 0xffff, 2);
- }
- else
- {
- if (insn->use_extend)
- {
- md_number_to_chars (f, 0xf000 | insn->extend, 2);
- f += 2;
- }
- md_number_to_chars (f, insn->insn_opcode, 2);
- }
- mips_record_mips16_mode ();
-}
-
-/* Move INSN to offset WHERE in FRAG. Adjust the fixups accordingly
- and install the opcode in the new location. */
-
-static void
-move_insn (struct mips_cl_insn *insn, fragS *frag, long where)
-{
- size_t i;
-
- insn->frag = frag;
- insn->where = where;
- for (i = 0; i < ARRAY_SIZE (insn->fixp); i++)
- if (insn->fixp[i] != NULL)
- {
- insn->fixp[i]->fx_frag = frag;
- insn->fixp[i]->fx_where = where;
- }
- install_insn (insn);
-}
-
-/* Add INSN to the end of the output. */
-
-static void
-add_fixed_insn (struct mips_cl_insn *insn)
-{
- char *f = frag_more (insn_length (insn));
- move_insn (insn, frag_now, f - frag_now->fr_literal);
-}
-
-/* Start a variant frag and move INSN to the start of the variant part,
- marking it as fixed. The other arguments are as for frag_var. */
-
-static void
-add_relaxed_insn (struct mips_cl_insn *insn, int max_chars, int var,
- relax_substateT subtype, symbolS *symbol, offsetT offset)
-{
- frag_grow (max_chars);
- move_insn (insn, frag_now, frag_more (0) - frag_now->fr_literal);
- insn->fixed_p = 1;
- frag_var (rs_machine_dependent, max_chars, var,
- subtype, symbol, offset, NULL);
-}
-
-/* Insert N copies of INSN into the history buffer, starting at
- position FIRST. Neither FIRST nor N need to be clipped. */
-
-static void
-insert_into_history (unsigned int first, unsigned int n,
- const struct mips_cl_insn *insn)
-{
- if (mips_relax.sequence != 2)
- {
- unsigned int i;
-
- for (i = ARRAY_SIZE (history); i-- > first;)
- if (i >= first + n)
- history[i] = history[i - n];
- else
- history[i] = *insn;
- }
-}
-
-/* Emit a nop instruction, recording it in the history buffer. */
-
-static void
-emit_nop (void)
-{
- add_fixed_insn (NOP_INSN);
- insert_into_history (0, 1, NOP_INSN);
-}
-
-/* Initialize vr4120_conflicts. There is a bit of duplication here:
- the idea is to make it obvious at a glance that each errata is
- included. */
-
-static void
-init_vr4120_conflicts (void)
-{
-#define CONFLICT(FIRST, SECOND) \
- vr4120_conflicts[FIX_VR4120_##FIRST] |= 1 << FIX_VR4120_##SECOND
-
- /* Errata 21 - [D]DIV[U] after [D]MACC */
- CONFLICT (MACC, DIV);
- CONFLICT (DMACC, DIV);
-
- /* Errata 23 - Continuous DMULT[U]/DMACC instructions. */
- CONFLICT (DMULT, DMULT);
- CONFLICT (DMULT, DMACC);
- CONFLICT (DMACC, DMULT);
- CONFLICT (DMACC, DMACC);
-
- /* Errata 24 - MT{LO,HI} after [D]MACC */
- CONFLICT (MACC, MTHILO);
- CONFLICT (DMACC, MTHILO);
-
- /* VR4181A errata MD(1): "If a MULT, MULTU, DMULT or DMULTU
- instruction is executed immediately after a MACC or DMACC
- instruction, the result of [either instruction] is incorrect." */
- CONFLICT (MACC, MULT);
- CONFLICT (MACC, DMULT);
- CONFLICT (DMACC, MULT);
- CONFLICT (DMACC, DMULT);
-
- /* VR4181A errata MD(4): "If a MACC or DMACC instruction is
- executed immediately after a DMULT, DMULTU, DIV, DIVU,
- DDIV or DDIVU instruction, the result of the MACC or
- DMACC instruction is incorrect.". */
- CONFLICT (DMULT, MACC);
- CONFLICT (DMULT, DMACC);
- CONFLICT (DIV, MACC);
- CONFLICT (DIV, DMACC);
-
-#undef CONFLICT
-}
-
-struct regname {
- const char *name;
- unsigned int num;
-};
-
-#define RTYPE_MASK 0x1ff00
-#define RTYPE_NUM 0x00100
-#define RTYPE_FPU 0x00200
-#define RTYPE_FCC 0x00400
-#define RTYPE_VEC 0x00800
-#define RTYPE_GP 0x01000
-#define RTYPE_CP0 0x02000
-#define RTYPE_PC 0x04000
-#define RTYPE_ACC 0x08000
-#define RTYPE_CCC 0x10000
-#define RNUM_MASK 0x000ff
-#define RWARN 0x80000
-
-#define GENERIC_REGISTER_NUMBERS \
- {"$0", RTYPE_NUM | 0}, \
- {"$1", RTYPE_NUM | 1}, \
- {"$2", RTYPE_NUM | 2}, \
- {"$3", RTYPE_NUM | 3}, \
- {"$4", RTYPE_NUM | 4}, \
- {"$5", RTYPE_NUM | 5}, \
- {"$6", RTYPE_NUM | 6}, \
- {"$7", RTYPE_NUM | 7}, \
- {"$8", RTYPE_NUM | 8}, \
- {"$9", RTYPE_NUM | 9}, \
- {"$10", RTYPE_NUM | 10}, \
- {"$11", RTYPE_NUM | 11}, \
- {"$12", RTYPE_NUM | 12}, \
- {"$13", RTYPE_NUM | 13}, \
- {"$14", RTYPE_NUM | 14}, \
- {"$15", RTYPE_NUM | 15}, \
- {"$16", RTYPE_NUM | 16}, \
- {"$17", RTYPE_NUM | 17}, \
- {"$18", RTYPE_NUM | 18}, \
- {"$19", RTYPE_NUM | 19}, \
- {"$20", RTYPE_NUM | 20}, \
- {"$21", RTYPE_NUM | 21}, \
- {"$22", RTYPE_NUM | 22}, \
- {"$23", RTYPE_NUM | 23}, \
- {"$24", RTYPE_NUM | 24}, \
- {"$25", RTYPE_NUM | 25}, \
- {"$26", RTYPE_NUM | 26}, \
- {"$27", RTYPE_NUM | 27}, \
- {"$28", RTYPE_NUM | 28}, \
- {"$29", RTYPE_NUM | 29}, \
- {"$30", RTYPE_NUM | 30}, \
- {"$31", RTYPE_NUM | 31}
-
-#define FPU_REGISTER_NAMES \
- {"$f0", RTYPE_FPU | 0}, \
- {"$f1", RTYPE_FPU | 1}, \
- {"$f2", RTYPE_FPU | 2}, \
- {"$f3", RTYPE_FPU | 3}, \
- {"$f4", RTYPE_FPU | 4}, \
- {"$f5", RTYPE_FPU | 5}, \
- {"$f6", RTYPE_FPU | 6}, \
- {"$f7", RTYPE_FPU | 7}, \
- {"$f8", RTYPE_FPU | 8}, \
- {"$f9", RTYPE_FPU | 9}, \
- {"$f10", RTYPE_FPU | 10}, \
- {"$f11", RTYPE_FPU | 11}, \
- {"$f12", RTYPE_FPU | 12}, \
- {"$f13", RTYPE_FPU | 13}, \
- {"$f14", RTYPE_FPU | 14}, \
- {"$f15", RTYPE_FPU | 15}, \
- {"$f16", RTYPE_FPU | 16}, \
- {"$f17", RTYPE_FPU | 17}, \
- {"$f18", RTYPE_FPU | 18}, \
- {"$f19", RTYPE_FPU | 19}, \
- {"$f20", RTYPE_FPU | 20}, \
- {"$f21", RTYPE_FPU | 21}, \
- {"$f22", RTYPE_FPU | 22}, \
- {"$f23", RTYPE_FPU | 23}, \
- {"$f24", RTYPE_FPU | 24}, \
- {"$f25", RTYPE_FPU | 25}, \
- {"$f26", RTYPE_FPU | 26}, \
- {"$f27", RTYPE_FPU | 27}, \
- {"$f28", RTYPE_FPU | 28}, \
- {"$f29", RTYPE_FPU | 29}, \
- {"$f30", RTYPE_FPU | 30}, \
- {"$f31", RTYPE_FPU | 31}
-
-#define FPU_CONDITION_CODE_NAMES \
- {"$fcc0", RTYPE_FCC | 0}, \
- {"$fcc1", RTYPE_FCC | 1}, \
- {"$fcc2", RTYPE_FCC | 2}, \
- {"$fcc3", RTYPE_FCC | 3}, \
- {"$fcc4", RTYPE_FCC | 4}, \
- {"$fcc5", RTYPE_FCC | 5}, \
- {"$fcc6", RTYPE_FCC | 6}, \
- {"$fcc7", RTYPE_FCC | 7}
-
-#define COPROC_CONDITION_CODE_NAMES \
- {"$cc0", RTYPE_FCC | RTYPE_CCC | 0}, \
- {"$cc1", RTYPE_FCC | RTYPE_CCC | 1}, \
- {"$cc2", RTYPE_FCC | RTYPE_CCC | 2}, \
- {"$cc3", RTYPE_FCC | RTYPE_CCC | 3}, \
- {"$cc4", RTYPE_FCC | RTYPE_CCC | 4}, \
- {"$cc5", RTYPE_FCC | RTYPE_CCC | 5}, \
- {"$cc6", RTYPE_FCC | RTYPE_CCC | 6}, \
- {"$cc7", RTYPE_FCC | RTYPE_CCC | 7}
-
-#define N32N64_SYMBOLIC_REGISTER_NAMES \
- {"$a4", RTYPE_GP | 8}, \
- {"$a5", RTYPE_GP | 9}, \
- {"$a6", RTYPE_GP | 10}, \
- {"$a7", RTYPE_GP | 11}, \
- {"$ta0", RTYPE_GP | 8}, /* alias for $a4 */ \
- {"$ta1", RTYPE_GP | 9}, /* alias for $a5 */ \
- {"$ta2", RTYPE_GP | 10}, /* alias for $a6 */ \
- {"$ta3", RTYPE_GP | 11}, /* alias for $a7 */ \
- {"$t0", RTYPE_GP | 12}, \
- {"$t1", RTYPE_GP | 13}, \
- {"$t2", RTYPE_GP | 14}, \
- {"$t3", RTYPE_GP | 15}
-
-#define O32_SYMBOLIC_REGISTER_NAMES \
- {"$t0", RTYPE_GP | 8}, \
- {"$t1", RTYPE_GP | 9}, \
- {"$t2", RTYPE_GP | 10}, \
- {"$t3", RTYPE_GP | 11}, \
- {"$t4", RTYPE_GP | 12}, \
- {"$t5", RTYPE_GP | 13}, \
- {"$t6", RTYPE_GP | 14}, \
- {"$t7", RTYPE_GP | 15}, \
- {"$ta0", RTYPE_GP | 12}, /* alias for $t4 */ \
- {"$ta1", RTYPE_GP | 13}, /* alias for $t5 */ \
- {"$ta2", RTYPE_GP | 14}, /* alias for $t6 */ \
- {"$ta3", RTYPE_GP | 15} /* alias for $t7 */
-
-/* Remaining symbolic register names */
-#define SYMBOLIC_REGISTER_NAMES \
- {"$zero", RTYPE_GP | 0}, \
- {"$at", RTYPE_GP | 1}, \
- {"$AT", RTYPE_GP | 1}, \
- {"$v0", RTYPE_GP | 2}, \
- {"$v1", RTYPE_GP | 3}, \
- {"$a0", RTYPE_GP | 4}, \
- {"$a1", RTYPE_GP | 5}, \
- {"$a2", RTYPE_GP | 6}, \
- {"$a3", RTYPE_GP | 7}, \
- {"$s0", RTYPE_GP | 16}, \
- {"$s1", RTYPE_GP | 17}, \
- {"$s2", RTYPE_GP | 18}, \
- {"$s3", RTYPE_GP | 19}, \
- {"$s4", RTYPE_GP | 20}, \
- {"$s5", RTYPE_GP | 21}, \
- {"$s6", RTYPE_GP | 22}, \
- {"$s7", RTYPE_GP | 23}, \
- {"$t8", RTYPE_GP | 24}, \
- {"$t9", RTYPE_GP | 25}, \
- {"$k0", RTYPE_GP | 26}, \
- {"$kt0", RTYPE_GP | 26}, \
- {"$k1", RTYPE_GP | 27}, \
- {"$kt1", RTYPE_GP | 27}, \
- {"$gp", RTYPE_GP | 28}, \
- {"$sp", RTYPE_GP | 29}, \
- {"$s8", RTYPE_GP | 30}, \
- {"$fp", RTYPE_GP | 30}, \
- {"$ra", RTYPE_GP | 31}
-
-#define MIPS16_SPECIAL_REGISTER_NAMES \
- {"$pc", RTYPE_PC | 0}
-
-#define MDMX_VECTOR_REGISTER_NAMES \
- /* {"$v0", RTYPE_VEC | 0}, clash with REG 2 above */ \
- /* {"$v1", RTYPE_VEC | 1}, clash with REG 3 above */ \
- {"$v2", RTYPE_VEC | 2}, \
- {"$v3", RTYPE_VEC | 3}, \
- {"$v4", RTYPE_VEC | 4}, \
- {"$v5", RTYPE_VEC | 5}, \
- {"$v6", RTYPE_VEC | 6}, \
- {"$v7", RTYPE_VEC | 7}, \
- {"$v8", RTYPE_VEC | 8}, \
- {"$v9", RTYPE_VEC | 9}, \
- {"$v10", RTYPE_VEC | 10}, \
- {"$v11", RTYPE_VEC | 11}, \
- {"$v12", RTYPE_VEC | 12}, \
- {"$v13", RTYPE_VEC | 13}, \
- {"$v14", RTYPE_VEC | 14}, \
- {"$v15", RTYPE_VEC | 15}, \
- {"$v16", RTYPE_VEC | 16}, \
- {"$v17", RTYPE_VEC | 17}, \
- {"$v18", RTYPE_VEC | 18}, \
- {"$v19", RTYPE_VEC | 19}, \
- {"$v20", RTYPE_VEC | 20}, \
- {"$v21", RTYPE_VEC | 21}, \
- {"$v22", RTYPE_VEC | 22}, \
- {"$v23", RTYPE_VEC | 23}, \
- {"$v24", RTYPE_VEC | 24}, \
- {"$v25", RTYPE_VEC | 25}, \
- {"$v26", RTYPE_VEC | 26}, \
- {"$v27", RTYPE_VEC | 27}, \
- {"$v28", RTYPE_VEC | 28}, \
- {"$v29", RTYPE_VEC | 29}, \
- {"$v30", RTYPE_VEC | 30}, \
- {"$v31", RTYPE_VEC | 31}
-
-#define MIPS_DSP_ACCUMULATOR_NAMES \
- {"$ac0", RTYPE_ACC | 0}, \
- {"$ac1", RTYPE_ACC | 1}, \
- {"$ac2", RTYPE_ACC | 2}, \
- {"$ac3", RTYPE_ACC | 3}
-
-static const struct regname reg_names[] = {
- GENERIC_REGISTER_NUMBERS,
- FPU_REGISTER_NAMES,
- FPU_CONDITION_CODE_NAMES,
- COPROC_CONDITION_CODE_NAMES,
-
- /* The $txx registers depends on the abi,
- these will be added later into the symbol table from
- one of the tables below once mips_abi is set after
- parsing of arguments from the command line. */
- SYMBOLIC_REGISTER_NAMES,
-
- MIPS16_SPECIAL_REGISTER_NAMES,
- MDMX_VECTOR_REGISTER_NAMES,
- MIPS_DSP_ACCUMULATOR_NAMES,
- {0, 0}
-};
-
-static const struct regname reg_names_o32[] = {
- O32_SYMBOLIC_REGISTER_NAMES,
- {0, 0}
-};
-
-static const struct regname reg_names_n32n64[] = {
- N32N64_SYMBOLIC_REGISTER_NAMES,
- {0, 0}
-};
-
-static int
-reg_lookup (char **s, unsigned int types, unsigned int *regnop)
-{
- symbolS *symbolP;
- char *e;
- char save_c;
- int reg = -1;
-
- /* Find end of name. */
- e = *s;
- if (is_name_beginner (*e))
- ++e;
- while (is_part_of_name (*e))
- ++e;
-
- /* Terminate name. */
- save_c = *e;
- *e = '\0';
-
- /* Look for a register symbol. */
- if ((symbolP = symbol_find (*s)) && S_GET_SEGMENT (symbolP) == reg_section)
- {
- int r = S_GET_VALUE (symbolP);
- if (r & types)
- reg = r & RNUM_MASK;
- else if ((types & RTYPE_VEC) && (r & ~1) == (RTYPE_GP | 2))
- /* Convert GP reg $v0/1 to MDMX reg $v0/1! */
- reg = (r & RNUM_MASK) - 2;
- }
- /* Else see if this is a register defined in an itbl entry. */
- else if ((types & RTYPE_GP) && itbl_have_entries)
- {
- char *n = *s;
- unsigned long r;
-
- if (*n == '$')
- ++n;
- if (itbl_get_reg_val (n, &r))
- reg = r & RNUM_MASK;
- }
-
- /* Advance to next token if a register was recognised. */
- if (reg >= 0)
- *s = e;
- else if (types & RWARN)
- as_warn ("Unrecognized register name `%s'", *s);
-
- *e = save_c;
- if (regnop)
- *regnop = reg;
- return reg >= 0;
-}
-
-/* Return TRUE if opcode MO is valid on the currently selected ISA and
- architecture. If EXPANSIONP is TRUE then this check is done while
- expanding a macro. Use is_opcode_valid_16 for MIPS16 opcodes. */
-
-static bfd_boolean
-is_opcode_valid (const struct mips_opcode *mo, bfd_boolean expansionp)
-{
- int isa = mips_opts.isa;
- int fp_s, fp_d;
-
- if (mips_opts.ase_mdmx)
- isa |= INSN_MDMX;
- if (mips_opts.ase_dsp)
- isa |= INSN_DSP;
- if (mips_opts.ase_dsp && ISA_SUPPORTS_DSP64_ASE)
- isa |= INSN_DSP64;
- if (mips_opts.ase_dspr2)
- isa |= INSN_DSPR2;
- if (mips_opts.ase_mt)
- isa |= INSN_MT;
- if (mips_opts.ase_mips3d)
- isa |= INSN_MIPS3D;
- if (mips_opts.ase_smartmips)
- isa |= INSN_SMARTMIPS;
-
- /* For user code we don't check for mips_opts.mips16 since we want
- to allow jalx if -mips16 was specified on the command line. */
- if (expansionp ? mips_opts.mips16 : file_ase_mips16)
- isa |= INSN_MIPS16;
-
- /* Don't accept instructions based on the ISA if the CPU does not implement
- all the coprocessor insns. */
- if (NO_ISA_COP (mips_opts.arch)
- && COP_INSN (mo->pinfo))
- isa = 0;
-
- if (!OPCODE_IS_MEMBER (mo, isa, mips_opts.arch))
- return FALSE;
-
- /* Check whether the instruction or macro requires single-precision or
- double-precision floating-point support. Note that this information is
- stored differently in the opcode table for insns and macros. */
- if (mo->pinfo == INSN_MACRO)
- {
- fp_s = mo->pinfo2 & INSN2_M_FP_S;
- fp_d = mo->pinfo2 & INSN2_M_FP_D;
- }
- else
- {
- fp_s = mo->pinfo & FP_S;
- fp_d = mo->pinfo & FP_D;
- }
-
- if (fp_d && (mips_opts.soft_float || mips_opts.single_float))
- return FALSE;
-
- if (fp_s && mips_opts.soft_float)
- return FALSE;
-
- return TRUE;
-}
-
-/* Return TRUE if the MIPS16 opcode MO is valid on the currently
- selected ISA and architecture. */
-
-static bfd_boolean
-is_opcode_valid_16 (const struct mips_opcode *mo)
-{
- return OPCODE_IS_MEMBER (mo, mips_opts.isa, mips_opts.arch) ? TRUE : FALSE;
-}
-
-/* This function is called once, at assembler startup time. It should set up
- all the tables, etc. that the MD part of the assembler will need. */
-
-void
-md_begin (void)
-{
- const char *retval = NULL;
- int i = 0;
- int broken = 0;
-
- if (mips_pic != NO_PIC)
- {
- if (g_switch_seen && g_switch_value != 0)
- as_bad (_("-G may not be used in position-independent code"));
- g_switch_value = 0;
- }
-
- if (! bfd_set_arch_mach (stdoutput, bfd_arch_mips, file_mips_arch))
- as_warn (_("Could not set architecture and machine"));
-
- op_hash = hash_new ();
-
- for (i = 0; i < NUMOPCODES;)
- {
- const char *name = mips_opcodes[i].name;
-
- retval = hash_insert (op_hash, name, (void *) &mips_opcodes[i]);
- if (retval != NULL)
- {
- fprintf (stderr, _("internal error: can't hash `%s': %s\n"),
- mips_opcodes[i].name, retval);
- /* Probably a memory allocation problem? Give up now. */
- as_fatal (_("Broken assembler. No assembly attempted."));
- }
- do
- {
- if (mips_opcodes[i].pinfo != INSN_MACRO)
- {
- if (!validate_mips_insn (&mips_opcodes[i]))
- broken = 1;
- if (nop_insn.insn_mo == NULL && strcmp (name, "nop") == 0)
- {
- create_insn (&nop_insn, mips_opcodes + i);
- nop_insn.fixed_p = 1;
- }
- }
- ++i;
- }
- while ((i < NUMOPCODES) && !strcmp (mips_opcodes[i].name, name));
- }
-
- mips16_op_hash = hash_new ();
-
- i = 0;
- while (i < bfd_mips16_num_opcodes)
- {
- const char *name = mips16_opcodes[i].name;
-
- retval = hash_insert (mips16_op_hash, name, (void *) &mips16_opcodes[i]);
- if (retval != NULL)
- as_fatal (_("internal: can't hash `%s': %s"),
- mips16_opcodes[i].name, retval);
- do
- {
- if (mips16_opcodes[i].pinfo != INSN_MACRO
- && ((mips16_opcodes[i].match & mips16_opcodes[i].mask)
- != mips16_opcodes[i].match))
- {
- fprintf (stderr, _("internal error: bad mips16 opcode: %s %s\n"),
- mips16_opcodes[i].name, mips16_opcodes[i].args);
- broken = 1;
- }
- if (mips16_nop_insn.insn_mo == NULL && strcmp (name, "nop") == 0)
- {
- create_insn (&mips16_nop_insn, mips16_opcodes + i);
- mips16_nop_insn.fixed_p = 1;
- }
- ++i;
- }
- while (i < bfd_mips16_num_opcodes
- && strcmp (mips16_opcodes[i].name, name) == 0);
- }
-
- if (broken)
- as_fatal (_("Broken assembler. No assembly attempted."));
-
- /* We add all the general register names to the symbol table. This
- helps us detect invalid uses of them. */
- for (i = 0; reg_names[i].name; i++)
- symbol_table_insert (symbol_new (reg_names[i].name, reg_section,
- reg_names[i].num, // & RNUM_MASK,
- &zero_address_frag));
- if (HAVE_NEWABI)
- for (i = 0; reg_names_n32n64[i].name; i++)
- symbol_table_insert (symbol_new (reg_names_n32n64[i].name, reg_section,
- reg_names_n32n64[i].num, // & RNUM_MASK,
- &zero_address_frag));
- else
- for (i = 0; reg_names_o32[i].name; i++)
- symbol_table_insert (symbol_new (reg_names_o32[i].name, reg_section,
- reg_names_o32[i].num, // & RNUM_MASK,
- &zero_address_frag));
-
- mips_no_prev_insn ();
-
- mips_gprmask = 0;
- mips_cprmask[0] = 0;
- mips_cprmask[1] = 0;
- mips_cprmask[2] = 0;
- mips_cprmask[3] = 0;
-
- /* set the default alignment for the text section (2**2) */
- record_alignment (text_section, 2);
-
- bfd_set_gp_size (stdoutput, g_switch_value);
-
-#ifdef OBJ_ELF
- if (IS_ELF)
- {
- /* On a native system other than VxWorks, sections must be aligned
- to 16 byte boundaries. When configured for an embedded ELF
- target, we don't bother. */
- if (strncmp (TARGET_OS, "elf", 3) != 0
- && strncmp (TARGET_OS, "vxworks", 7) != 0)
- {
- (void) bfd_set_section_alignment (stdoutput, text_section, 4);
- (void) bfd_set_section_alignment (stdoutput, data_section, 4);
- (void) bfd_set_section_alignment (stdoutput, bss_section, 4);
- }
-
- /* Create a .reginfo section for register masks and a .mdebug
- section for debugging information. */
- {
- segT seg;
- subsegT subseg;
- flagword flags;
- segT sec;
-
- seg = now_seg;
- subseg = now_subseg;
-
- /* The ABI says this section should be loaded so that the
- running program can access it. However, we don't load it
- if we are configured for an embedded target */
- flags = SEC_READONLY | SEC_DATA;
- if (strncmp (TARGET_OS, "elf", 3) != 0)
- flags |= SEC_ALLOC | SEC_LOAD;
-
- if (mips_abi != N64_ABI)
- {
- sec = subseg_new (".reginfo", (subsegT) 0);
-
- bfd_set_section_flags (stdoutput, sec, flags);
- bfd_set_section_alignment (stdoutput, sec, HAVE_NEWABI ? 3 : 2);
-
- mips_regmask_frag = frag_more (sizeof (Elf32_External_RegInfo));
- }
- else
- {
- /* The 64-bit ABI uses a .MIPS.options section rather than
- .reginfo section. */
- sec = subseg_new (".MIPS.options", (subsegT) 0);
- bfd_set_section_flags (stdoutput, sec, flags);
- bfd_set_section_alignment (stdoutput, sec, 3);
-
- /* Set up the option header. */
- {
- Elf_Internal_Options opthdr;
- char *f;
-
- opthdr.kind = ODK_REGINFO;
- opthdr.size = (sizeof (Elf_External_Options)
- + sizeof (Elf64_External_RegInfo));
- opthdr.section = 0;
- opthdr.info = 0;
- f = frag_more (sizeof (Elf_External_Options));
- bfd_mips_elf_swap_options_out (stdoutput, &opthdr,
- (Elf_External_Options *) f);
-
- mips_regmask_frag = frag_more (sizeof (Elf64_External_RegInfo));
- }
- }
-
- if (ECOFF_DEBUGGING)
- {
- sec = subseg_new (".mdebug", (subsegT) 0);
- (void) bfd_set_section_flags (stdoutput, sec,
- SEC_HAS_CONTENTS | SEC_READONLY);
- (void) bfd_set_section_alignment (stdoutput, sec, 2);
- }
- else if (mips_flag_pdr)
- {
- pdr_seg = subseg_new (".pdr", (subsegT) 0);
- (void) bfd_set_section_flags (stdoutput, pdr_seg,
- SEC_READONLY | SEC_RELOC
- | SEC_DEBUGGING);
- (void) bfd_set_section_alignment (stdoutput, pdr_seg, 2);
- }
-
- subseg_set (seg, subseg);
- }
- }
-#endif /* OBJ_ELF */
-
- if (! ECOFF_DEBUGGING)
- md_obj_begin ();
-
- if (mips_fix_vr4120)
- init_vr4120_conflicts ();
-}
-
-void
-md_mips_end (void)
-{
- if (! ECOFF_DEBUGGING)
- md_obj_end ();
-}
-
-void
-md_assemble (char *str)
-{
- struct mips_cl_insn insn;
- bfd_reloc_code_real_type unused_reloc[3]
- = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
-
- imm_expr.X_op = O_absent;
- imm2_expr.X_op = O_absent;
- offset_expr.X_op = O_absent;
- imm_reloc[0] = BFD_RELOC_UNUSED;
- imm_reloc[1] = BFD_RELOC_UNUSED;
- imm_reloc[2] = BFD_RELOC_UNUSED;
- offset_reloc[0] = BFD_RELOC_UNUSED;
- offset_reloc[1] = BFD_RELOC_UNUSED;
- offset_reloc[2] = BFD_RELOC_UNUSED;
-
- if (mips_opts.mips16)
- mips16_ip (str, &insn);
- else
- {
- mips_ip (str, &insn);
- DBG ((_("returned from mips_ip(%s) insn_opcode = 0x%x\n"),
- str, insn.insn_opcode));
- }
-
- if (insn_error)
- {
- as_bad ("%s `%s'", insn_error, str);
- return;
- }
-
- if (insn.insn_mo->pinfo == INSN_MACRO)
- {
- macro_start ();
- if (mips_opts.mips16)
- mips16_macro (&insn);
- else
- macro (&insn);
- macro_end ();
- }
- else
- {
- if (imm_expr.X_op != O_absent)
- append_insn (&insn, &imm_expr, imm_reloc);
- else if (offset_expr.X_op != O_absent)
- append_insn (&insn, &offset_expr, offset_reloc);
- else
- append_insn (&insn, NULL, unused_reloc);
- }
-}
-
-/* Return true if the given relocation might need a matching %lo().
- This is only "might" because SVR4 R_MIPS_GOT16 relocations only
- need a matching %lo() when applied to local symbols. */
-
-static inline bfd_boolean
-reloc_needs_lo_p (bfd_reloc_code_real_type reloc)
-{
- return (HAVE_IN_PLACE_ADDENDS
- && (reloc == BFD_RELOC_HI16_S
- || reloc == BFD_RELOC_MIPS16_HI16_S
- /* VxWorks R_MIPS_GOT16 relocs never need a matching %lo();
- all GOT16 relocations evaluate to "G". */
- || (reloc == BFD_RELOC_MIPS_GOT16 && mips_pic != VXWORKS_PIC)));
-}
-
-/* Return true if the given fixup is followed by a matching R_MIPS_LO16
- relocation. */
-
-static inline bfd_boolean
-fixup_has_matching_lo_p (fixS *fixp)
-{
- return (fixp->fx_next != NULL
- && (fixp->fx_next->fx_r_type == BFD_RELOC_LO16
- || fixp->fx_next->fx_r_type == BFD_RELOC_MIPS16_LO16)
- && fixp->fx_addsy == fixp->fx_next->fx_addsy
- && fixp->fx_offset == fixp->fx_next->fx_offset);
-}
-
-/* See whether instruction IP reads register REG. CLASS is the type
- of register. */
-
-static int
-insn_uses_reg (const struct mips_cl_insn *ip, unsigned int reg,
- enum mips_regclass class)
-{
- if (class == MIPS16_REG)
- {
- assert (mips_opts.mips16);
- reg = mips16_to_32_reg_map[reg];
- class = MIPS_GR_REG;
- }
-
- /* Don't report on general register ZERO, since it never changes. */
- if (class == MIPS_GR_REG && reg == ZERO)
- return 0;
-
- if (class == MIPS_FP_REG)
- {
- assert (! mips_opts.mips16);
- /* If we are called with either $f0 or $f1, we must check $f0.
- This is not optimal, because it will introduce an unnecessary
- NOP between "lwc1 $f0" and "swc1 $f1". To fix this we would
- need to distinguish reading both $f0 and $f1 or just one of
- them. Note that we don't have to check the other way,
- because there is no instruction that sets both $f0 and $f1
- and requires a delay. */
- if ((ip->insn_mo->pinfo & INSN_READ_FPR_S)
- && ((EXTRACT_OPERAND (FS, *ip) & ~(unsigned) 1)
- == (reg &~ (unsigned) 1)))
- return 1;
- if ((ip->insn_mo->pinfo & INSN_READ_FPR_T)
- && ((EXTRACT_OPERAND (FT, *ip) & ~(unsigned) 1)
- == (reg &~ (unsigned) 1)))
- return 1;
- }
- else if (! mips_opts.mips16)
- {
- if ((ip->insn_mo->pinfo & INSN_READ_GPR_S)
- && EXTRACT_OPERAND (RS, *ip) == reg)
- return 1;
- if ((ip->insn_mo->pinfo & INSN_READ_GPR_T)
- && EXTRACT_OPERAND (RT, *ip) == reg)
- return 1;
- }
- else
- {
- if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_X)
- && mips16_to_32_reg_map[MIPS16_EXTRACT_OPERAND (RX, *ip)] == reg)
- return 1;
- if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_Y)
- && mips16_to_32_reg_map[MIPS16_EXTRACT_OPERAND (RY, *ip)] == reg)
- return 1;
- if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_Z)
- && (mips16_to_32_reg_map[MIPS16_EXTRACT_OPERAND (MOVE32Z, *ip)]
- == reg))
- return 1;
- if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_T) && reg == TREG)
- return 1;
- if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_SP) && reg == SP)
- return 1;
- if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_31) && reg == RA)
- return 1;
- if ((ip->insn_mo->pinfo & MIPS16_INSN_READ_GPR_X)
- && MIPS16_EXTRACT_OPERAND (REGR32, *ip) == reg)
- return 1;
- }
-
- return 0;
-}
-
-/* This function returns true if modifying a register requires a
- delay. */
-
-static int
-reg_needs_delay (unsigned int reg)
-{
- unsigned long prev_pinfo;
-
- prev_pinfo = history[0].insn_mo->pinfo;
- if (! mips_opts.noreorder
- && (((prev_pinfo & INSN_LOAD_MEMORY_DELAY)
- && ! gpr_interlocks)
- || ((prev_pinfo & INSN_LOAD_COPROC_DELAY)
- && ! cop_interlocks)))
- {
- /* A load from a coprocessor or from memory. All load delays
- delay the use of general register rt for one instruction. */
- /* Itbl support may require additional care here. */
- know (prev_pinfo & INSN_WRITE_GPR_T);
- if (reg == EXTRACT_OPERAND (RT, history[0]))
- return 1;
- }
-
- return 0;
-}
-
-/* Move all labels in insn_labels to the current insertion point. */
-
-static void
-mips_move_labels (void)
-{
- segment_info_type *si = seg_info (now_seg);
- struct insn_label_list *l;
- valueT val;
-
- for (l = si->label_list; l != NULL; l = l->next)
- {
- assert (S_GET_SEGMENT (l->label) == now_seg);
- symbol_set_frag (l->label, frag_now);
- val = (valueT) frag_now_fix ();
- /* mips16 text labels are stored as odd. */
- if (mips_opts.mips16)
- ++val;
- S_SET_VALUE (l->label, val);
- }
-}
-
-static bfd_boolean
-s_is_linkonce (symbolS *sym, segT from_seg)
-{
- bfd_boolean linkonce = FALSE;
- segT symseg = S_GET_SEGMENT (sym);
-
- if (symseg != from_seg && !S_IS_LOCAL (sym))
- {
- if ((bfd_get_section_flags (stdoutput, symseg) & SEC_LINK_ONCE))
- linkonce = TRUE;
-#ifdef OBJ_ELF
- /* The GNU toolchain uses an extension for ELF: a section
- beginning with the magic string .gnu.linkonce is a
- linkonce section. */
- if (strncmp (segment_name (symseg), ".gnu.linkonce",
- sizeof ".gnu.linkonce" - 1) == 0)
- linkonce = TRUE;
-#endif
- }
- return linkonce;
-}
-
-/* Mark instruction labels in mips16 mode. This permits the linker to
- handle them specially, such as generating jalx instructions when
- needed. We also make them odd for the duration of the assembly, in
- order to generate the right sort of code. We will make them even
- in the adjust_symtab routine, while leaving them marked. This is
- convenient for the debugger and the disassembler. The linker knows
- to make them odd again. */
-
-static void
-mips16_mark_labels (void)
-{
- segment_info_type *si = seg_info (now_seg);
- struct insn_label_list *l;
-
- if (!mips_opts.mips16)
- return;
-
- for (l = si->label_list; l != NULL; l = l->next)
- {
- symbolS *label = l->label;
-
-#if defined(OBJ_ELF) || defined(OBJ_MAYBE_ELF)
- if (IS_ELF)
- S_SET_OTHER (label, ELF_ST_SET_MIPS16 (S_GET_OTHER (label)));
-#endif
- if ((S_GET_VALUE (label) & 1) == 0
- /* Don't adjust the address if the label is global or weak, or
- in a link-once section, since we'll be emitting symbol reloc
- references to it which will be patched up by the linker, and
- the final value of the symbol may or may not be MIPS16. */
- && ! S_IS_WEAK (label)
- && ! S_IS_EXTERNAL (label)
- && ! s_is_linkonce (label, now_seg))
- S_SET_VALUE (label, S_GET_VALUE (label) | 1);
- }
-}
-
-/* End the current frag. Make it a variant frag and record the
- relaxation info. */
-
-static void
-relax_close_frag (void)
-{
- mips_macro_warning.first_frag = frag_now;
- frag_var (rs_machine_dependent, 0, 0,
- RELAX_ENCODE (mips_relax.sizes[0], mips_relax.sizes[1]),
- mips_relax.symbol, 0, (char *) mips_relax.first_fixup);
-
- memset (&mips_relax.sizes, 0, sizeof (mips_relax.sizes));
- mips_relax.first_fixup = 0;
-}
-
-/* Start a new relaxation sequence whose expansion depends on SYMBOL.
- See the comment above RELAX_ENCODE for more details. */
-
-static void
-relax_start (symbolS *symbol)
-{
- assert (mips_relax.sequence == 0);
- mips_relax.sequence = 1;
- mips_relax.symbol = symbol;
-}
-
-/* Start generating the second version of a relaxable sequence.
- See the comment above RELAX_ENCODE for more details. */
-
-static void
-relax_switch (void)
-{
- assert (mips_relax.sequence == 1);
- mips_relax.sequence = 2;
-}
-
-/* End the current relaxable sequence. */
-
-static void
-relax_end (void)
-{
- assert (mips_relax.sequence == 2);
- relax_close_frag ();
- mips_relax.sequence = 0;
-}
-
-/* Classify an instruction according to the FIX_VR4120_* enumeration.
- Return NUM_FIX_VR4120_CLASSES if the instruction isn't affected
- by VR4120 errata. */
-
-static unsigned int
-classify_vr4120_insn (const char *name)
-{
- if (strncmp (name, "macc", 4) == 0)
- return FIX_VR4120_MACC;
- if (strncmp (name, "dmacc", 5) == 0)
- return FIX_VR4120_DMACC;
- if (strncmp (name, "mult", 4) == 0)
- return FIX_VR4120_MULT;
- if (strncmp (name, "dmult", 5) == 0)
- return FIX_VR4120_DMULT;
- if (strstr (name, "div"))
- return FIX_VR4120_DIV;
- if (strcmp (name, "mtlo") == 0 || strcmp (name, "mthi") == 0)
- return FIX_VR4120_MTHILO;
- return NUM_FIX_VR4120_CLASSES;
-}
-
-/* Return the number of instructions that must separate INSN1 and INSN2,
- where INSN1 is the earlier instruction. Return the worst-case value
- for any INSN2 if INSN2 is null. */
-
-static unsigned int
-insns_between (const struct mips_cl_insn *insn1,
- const struct mips_cl_insn *insn2)
-{
- unsigned long pinfo1, pinfo2;
-
- /* This function needs to know which pinfo flags are set for INSN2
- and which registers INSN2 uses. The former is stored in PINFO2 and
- the latter is tested via INSN2_USES_REG. If INSN2 is null, PINFO2
- will have every flag set and INSN2_USES_REG will always return true. */
- pinfo1 = insn1->insn_mo->pinfo;
- pinfo2 = insn2 ? insn2->insn_mo->pinfo : ~0U;
-
-#define INSN2_USES_REG(REG, CLASS) \
- (insn2 == NULL || insn_uses_reg (insn2, REG, CLASS))
-
- /* For most targets, write-after-read dependencies on the HI and LO
- registers must be separated by at least two instructions. */
- if (!hilo_interlocks)
- {
- if ((pinfo1 & INSN_READ_LO) && (pinfo2 & INSN_WRITE_LO))
- return 2;
- if ((pinfo1 & INSN_READ_HI) && (pinfo2 & INSN_WRITE_HI))
- return 2;
- }
-
- /* If we're working around r7000 errata, there must be two instructions
- between an mfhi or mflo and any instruction that uses the result. */
- if (mips_7000_hilo_fix
- && MF_HILO_INSN (pinfo1)
- && INSN2_USES_REG (EXTRACT_OPERAND (RD, *insn1), MIPS_GR_REG))
- return 2;
-
- /* If working around VR4120 errata, check for combinations that need
- a single intervening instruction. */
- if (mips_fix_vr4120)
- {
- unsigned int class1, class2;
-
- class1 = classify_vr4120_insn (insn1->insn_mo->name);
- if (class1 != NUM_FIX_VR4120_CLASSES && vr4120_conflicts[class1] != 0)
- {
- if (insn2 == NULL)
- return 1;
- class2 = classify_vr4120_insn (insn2->insn_mo->name);
- if (vr4120_conflicts[class1] & (1 << class2))
- return 1;
- }
- }
-
- if (!mips_opts.mips16)
- {
- /* Check for GPR or coprocessor load delays. All such delays
- are on the RT register. */
- /* Itbl support may require additional care here. */
- if ((!gpr_interlocks && (pinfo1 & INSN_LOAD_MEMORY_DELAY))
- || (!cop_interlocks && (pinfo1 & INSN_LOAD_COPROC_DELAY)))
- {
- know (pinfo1 & INSN_WRITE_GPR_T);
- if (INSN2_USES_REG (EXTRACT_OPERAND (RT, *insn1), MIPS_GR_REG))
- return 1;
- }
-
- /* Check for generic coprocessor hazards.
-
- This case is not handled very well. There is no special
- knowledge of CP0 handling, and the coprocessors other than
- the floating point unit are not distinguished at all. */
- /* Itbl support may require additional care here. FIXME!
- Need to modify this to include knowledge about
- user specified delays! */
- else if ((!cop_interlocks && (pinfo1 & INSN_COPROC_MOVE_DELAY))
- || (!cop_mem_interlocks && (pinfo1 & INSN_COPROC_MEMORY_DELAY)))
- {
- /* Handle cases where INSN1 writes to a known general coprocessor
- register. There must be a one instruction delay before INSN2
- if INSN2 reads that register, otherwise no delay is needed. */
- if (pinfo1 & INSN_WRITE_FPR_T)
- {
- if (INSN2_USES_REG (EXTRACT_OPERAND (FT, *insn1), MIPS_FP_REG))
- return 1;
- }
- else if (pinfo1 & INSN_WRITE_FPR_S)
- {
- if (INSN2_USES_REG (EXTRACT_OPERAND (FS, *insn1), MIPS_FP_REG))
- return 1;
- }
- else
- {
- /* Read-after-write dependencies on the control registers
- require a two-instruction gap. */
- if ((pinfo1 & INSN_WRITE_COND_CODE)
- && (pinfo2 & INSN_READ_COND_CODE))
- return 2;
-
- /* We don't know exactly what INSN1 does. If INSN2 is
- also a coprocessor instruction, assume there must be
- a one instruction gap. */
- if (pinfo2 & INSN_COP)
- return 1;
- }
- }
-
- /* Check for read-after-write dependencies on the coprocessor
- control registers in cases where INSN1 does not need a general
- coprocessor delay. This means that INSN1 is a floating point
- comparison instruction. */
- /* Itbl support may require additional care here. */
- else if (!cop_interlocks
- && (pinfo1 & INSN_WRITE_COND_CODE)
- && (pinfo2 & INSN_READ_COND_CODE))
- return 1;
- }
-
-#undef INSN2_USES_REG
-
- return 0;
-}
-
-/* Return the number of nops that would be needed to work around the
- VR4130 mflo/mfhi errata if instruction INSN immediately followed
- the MAX_VR4130_NOPS instructions described by HISTORY. */
-
-static int
-nops_for_vr4130 (const struct mips_cl_insn *history,
- const struct mips_cl_insn *insn)
-{
- int i, j, reg;
-
- /* Check if the instruction writes to HI or LO. MTHI and MTLO
- are not affected by the errata. */
- if (insn != 0
- && ((insn->insn_mo->pinfo & (INSN_WRITE_HI | INSN_WRITE_LO)) == 0
- || strcmp (insn->insn_mo->name, "mtlo") == 0
- || strcmp (insn->insn_mo->name, "mthi") == 0))
- return 0;
-
- /* Search for the first MFLO or MFHI. */
- for (i = 0; i < MAX_VR4130_NOPS; i++)
- if (!history[i].noreorder_p && MF_HILO_INSN (history[i].insn_mo->pinfo))
- {
- /* Extract the destination register. */
- if (mips_opts.mips16)
- reg = mips16_to_32_reg_map[MIPS16_EXTRACT_OPERAND (RX, history[i])];
- else
- reg = EXTRACT_OPERAND (RD, history[i]);
-
- /* No nops are needed if INSN reads that register. */
- if (insn != NULL && insn_uses_reg (insn, reg, MIPS_GR_REG))
- return 0;
-
- /* ...or if any of the intervening instructions do. */
- for (j = 0; j < i; j++)
- if (insn_uses_reg (&history[j], reg, MIPS_GR_REG))
- return 0;
-
- return MAX_VR4130_NOPS - i;
- }
- return 0;
-}
-
-/* Return the number of nops that would be needed if instruction INSN
- immediately followed the MAX_NOPS instructions given by HISTORY,
- where HISTORY[0] is the most recent instruction. If INSN is null,
- return the worse-case number of nops for any instruction. */
-
-static int
-nops_for_insn (const struct mips_cl_insn *history,
- const struct mips_cl_insn *insn)
-{
- int i, nops, tmp_nops;
-
- nops = 0;
- for (i = 0; i < MAX_DELAY_NOPS; i++)
- if (!history[i].noreorder_p)
- {
- tmp_nops = insns_between (history + i, insn) - i;
- if (tmp_nops > nops)
- nops = tmp_nops;
- }
-
- if (mips_fix_vr4130)
- {
- tmp_nops = nops_for_vr4130 (history, insn);
- if (tmp_nops > nops)
- nops = tmp_nops;
- }
-
- return nops;
-}
-
-/* The variable arguments provide NUM_INSNS extra instructions that
- might be added to HISTORY. Return the largest number of nops that
- would be needed after the extended sequence. */
-
-static int
-nops_for_sequence (int num_insns, const struct mips_cl_insn *history, ...)
-{
- va_list args;
- struct mips_cl_insn buffer[MAX_NOPS];
- struct mips_cl_insn *cursor;
- int nops;
-
- va_start (args, history);
- cursor = buffer + num_insns;
- memcpy (cursor, history, (MAX_NOPS - num_insns) * sizeof (*cursor));
- while (cursor > buffer)
- *--cursor = *va_arg (args, const struct mips_cl_insn *);
-
- nops = nops_for_insn (buffer, NULL);
- va_end (args);
- return nops;
-}
-
-/* Like nops_for_insn, but if INSN is a branch, take into account the
- worst-case delay for the branch target. */
-
-static int
-nops_for_insn_or_target (const struct mips_cl_insn *history,
- const struct mips_cl_insn *insn)
-{
- int nops, tmp_nops;
-
- nops = nops_for_insn (history, insn);
- if (insn->insn_mo->pinfo & (INSN_UNCOND_BRANCH_DELAY
- | INSN_COND_BRANCH_DELAY
- | INSN_COND_BRANCH_LIKELY))
- {
- tmp_nops = nops_for_sequence (2, history, insn, NOP_INSN);
- if (tmp_nops > nops)
- nops = tmp_nops;
- }
- else if (mips_opts.mips16 && (insn->insn_mo->pinfo & MIPS16_INSN_BRANCH))
- {
- tmp_nops = nops_for_sequence (1, history, insn);
- if (tmp_nops > nops)
- nops = tmp_nops;
- }
- return nops;
-}
-
-/* Output an instruction. IP is the instruction information.
- ADDRESS_EXPR is an operand of the instruction to be used with
- RELOC_TYPE. */
-
-static void
-append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
- bfd_reloc_code_real_type *reloc_type)
-{
- unsigned long prev_pinfo, pinfo;
- relax_stateT prev_insn_frag_type = 0;
- bfd_boolean relaxed_branch = FALSE;
- segment_info_type *si = seg_info (now_seg);
-
- /* Mark instruction labels in mips16 mode. */
- mips16_mark_labels ();
-
- prev_pinfo = history[0].insn_mo->pinfo;
- pinfo = ip->insn_mo->pinfo;
-
- if (mips_relax.sequence != 2 && !mips_opts.noreorder)
- {
- /* There are a lot of optimizations we could do that we don't.
- In particular, we do not, in general, reorder instructions.
- If you use gcc with optimization, it will reorder
- instructions and generally do much more optimization then we
- do here; repeating all that work in the assembler would only
- benefit hand written assembly code, and does not seem worth
- it. */
- int nops = (mips_optimize == 0
- ? nops_for_insn (history, NULL)
- : nops_for_insn_or_target (history, ip));
- if (nops > 0)
- {
- fragS *old_frag;
- unsigned long old_frag_offset;
- int i;
-
- old_frag = frag_now;
- old_frag_offset = frag_now_fix ();
-
- for (i = 0; i < nops; i++)
- emit_nop ();
-
- if (listing)
- {
- listing_prev_line ();
- /* We may be at the start of a variant frag. In case we
- are, make sure there is enough space for the frag
- after the frags created by listing_prev_line. The
- argument to frag_grow here must be at least as large
- as the argument to all other calls to frag_grow in
- this file. We don't have to worry about being in the
- middle of a variant frag, because the variants insert
- all needed nop instructions themselves. */
- frag_grow (40);
- }
-
- mips_move_labels ();
-
-#ifndef NO_ECOFF_DEBUGGING
- if (ECOFF_DEBUGGING)
- ecoff_fix_loc (old_frag, old_frag_offset);
-#endif
- }
- }
- else if (mips_relax.sequence != 2 && prev_nop_frag != NULL)
- {
- /* Work out how many nops in prev_nop_frag are needed by IP. */
- int nops = nops_for_insn_or_target (history, ip);
- assert (nops <= prev_nop_frag_holds);
-
- /* Enforce NOPS as a minimum. */
- if (nops > prev_nop_frag_required)
- prev_nop_frag_required = nops;
-
- if (prev_nop_frag_holds == prev_nop_frag_required)
- {
- /* Settle for the current number of nops. Update the history
- accordingly (for the benefit of any future .set reorder code). */
- prev_nop_frag = NULL;
- insert_into_history (prev_nop_frag_since,
- prev_nop_frag_holds, NOP_INSN);
- }
- else
- {
- /* Allow this instruction to replace one of the nops that was
- tentatively added to prev_nop_frag. */
- prev_nop_frag->fr_fix -= mips_opts.mips16 ? 2 : 4;
- prev_nop_frag_holds--;
- prev_nop_frag_since++;
- }
- }
-
-#ifdef OBJ_ELF
- /* The value passed to dwarf2_emit_insn is the distance between
- the beginning of the current instruction and the address that
- should be recorded in the debug tables. For MIPS16 debug info
- we want to use ISA-encoded addresses, so we pass -1 for an
- address higher by one than the current. */
- dwarf2_emit_insn (mips_opts.mips16 ? -1 : 0);
-#endif
-
- /* Record the frag type before frag_var. */
- if (history[0].frag)
- prev_insn_frag_type = history[0].frag->fr_type;
-
- if (address_expr
- && *reloc_type == BFD_RELOC_16_PCREL_S2
- && (pinfo & INSN_UNCOND_BRANCH_DELAY || pinfo & INSN_COND_BRANCH_DELAY
- || pinfo & INSN_COND_BRANCH_LIKELY)
- && mips_relax_branch
- /* Don't try branch relaxation within .set nomacro, or within
- .set noat if we use $at for PIC computations. If it turns
- out that the branch was out-of-range, we'll get an error. */
- && !mips_opts.warn_about_macros
- && (mips_opts.at || mips_pic == NO_PIC)
- && !mips_opts.mips16)
- {
- relaxed_branch = TRUE;
- add_relaxed_insn (ip, (relaxed_branch_length
- (NULL, NULL,
- (pinfo & INSN_UNCOND_BRANCH_DELAY) ? -1
- : (pinfo & INSN_COND_BRANCH_LIKELY) ? 1
- : 0)), 4,
- RELAX_BRANCH_ENCODE
- (pinfo & INSN_UNCOND_BRANCH_DELAY,
- pinfo & INSN_COND_BRANCH_LIKELY,
- pinfo & INSN_WRITE_GPR_31,
- 0),
- address_expr->X_add_symbol,
- address_expr->X_add_number);
- *reloc_type = BFD_RELOC_UNUSED;
- }
- else if (*reloc_type > BFD_RELOC_UNUSED)
- {
- /* We need to set up a variant frag. */
- assert (mips_opts.mips16 && address_expr != NULL);
- add_relaxed_insn (ip, 4, 0,
- RELAX_MIPS16_ENCODE
- (*reloc_type - BFD_RELOC_UNUSED,
- mips16_small, mips16_ext,
- prev_pinfo & INSN_UNCOND_BRANCH_DELAY,
- history[0].mips16_absolute_jump_p),
- make_expr_symbol (address_expr), 0);
- }
- else if (mips_opts.mips16
- && ! ip->use_extend
- && *reloc_type != BFD_RELOC_MIPS16_JMP)
- {
- if ((pinfo & INSN_UNCOND_BRANCH_DELAY) == 0)
- /* Make sure there is enough room to swap this instruction with
- a following jump instruction. */
- frag_grow (6);
- add_fixed_insn (ip);
- }
- else
- {
- if (mips_opts.mips16
- && mips_opts.noreorder
- && (prev_pinfo & INSN_UNCOND_BRANCH_DELAY) != 0)
- as_warn (_("extended instruction in delay slot"));
-
- if (mips_relax.sequence)
- {
- /* If we've reached the end of this frag, turn it into a variant
- frag and record the information for the instructions we've
- written so far. */
- if (frag_room () < 4)
- relax_close_frag ();
- mips_relax.sizes[mips_relax.sequence - 1] += 4;
- }
-
- if (mips_relax.sequence != 2)
- mips_macro_warning.sizes[0] += 4;
- if (mips_relax.sequence != 1)
- mips_macro_warning.sizes[1] += 4;
-
- if (mips_opts.mips16)
- {
- ip->fixed_p = 1;
- ip->mips16_absolute_jump_p = (*reloc_type == BFD_RELOC_MIPS16_JMP);
- }
- add_fixed_insn (ip);
- }
-
- if (address_expr != NULL && *reloc_type <= BFD_RELOC_UNUSED)
- {
- if (address_expr->X_op == O_constant)
- {
- unsigned int tmp;
-
- switch (*reloc_type)
- {
- case BFD_RELOC_32:
- ip->insn_opcode |= address_expr->X_add_number;
- break;
-
- case BFD_RELOC_MIPS_HIGHEST:
- tmp = (address_expr->X_add_number + 0x800080008000ull) >> 48;
- ip->insn_opcode |= tmp & 0xffff;
- break;
-
- case BFD_RELOC_MIPS_HIGHER:
- tmp = (address_expr->X_add_number + 0x80008000ull) >> 32;
- ip->insn_opcode |= tmp & 0xffff;
- break;
-
- case BFD_RELOC_HI16_S:
- tmp = (address_expr->X_add_number + 0x8000) >> 16;
- ip->insn_opcode |= tmp & 0xffff;
- break;
-
- case BFD_RELOC_HI16:
- ip->insn_opcode |= (address_expr->X_add_number >> 16) & 0xffff;
- break;
-
- case BFD_RELOC_UNUSED:
- case BFD_RELOC_LO16:
- case BFD_RELOC_MIPS_GOT_DISP:
- ip->insn_opcode |= address_expr->X_add_number & 0xffff;
- break;
-
- case BFD_RELOC_MIPS_JMP:
- if ((address_expr->X_add_number & 3) != 0)
- as_bad (_("jump to misaligned address (0x%lx)"),
- (unsigned long) address_expr->X_add_number);
- ip->insn_opcode |= (address_expr->X_add_number >> 2) & 0x3ffffff;
- break;
-
- case BFD_RELOC_MIPS16_JMP:
- if ((address_expr->X_add_number & 3) != 0)
- as_bad (_("jump to misaligned address (0x%lx)"),
- (unsigned long) address_expr->X_add_number);
- ip->insn_opcode |=
- (((address_expr->X_add_number & 0x7c0000) << 3)
- | ((address_expr->X_add_number & 0xf800000) >> 7)
- | ((address_expr->X_add_number & 0x3fffc) >> 2));
- break;
-
- case BFD_RELOC_16_PCREL_S2:
- if ((address_expr->X_add_number & 3) != 0)
- as_bad (_("branch to misaligned address (0x%lx)"),
- (unsigned long) address_expr->X_add_number);
- if (mips_relax_branch)
- goto need_reloc;
- if ((address_expr->X_add_number + 0x20000) & ~0x3ffff)
- as_bad (_("branch address range overflow (0x%lx)"),
- (unsigned long) address_expr->X_add_number);
- ip->insn_opcode |= (address_expr->X_add_number >> 2) & 0xffff;
- break;
-
- default:
- internalError ();
- }
- }
- else if (*reloc_type < BFD_RELOC_UNUSED)
- need_reloc:
- {
- reloc_howto_type *howto;
- int i;
-
- /* In a compound relocation, it is the final (outermost)
- operator that determines the relocated field. */
- for (i = 1; i < 3; i++)
- if (reloc_type[i] == BFD_RELOC_UNUSED)
- break;
-
- howto = bfd_reloc_type_lookup (stdoutput, reloc_type[i - 1]);
- ip->fixp[0] = fix_new_exp (ip->frag, ip->where,
- bfd_get_reloc_size (howto),
- address_expr,
- reloc_type[0] == BFD_RELOC_16_PCREL_S2,
- reloc_type[0]);
-
- /* Tag symbols that have a R_MIPS16_26 relocation against them. */
- if (reloc_type[0] == BFD_RELOC_MIPS16_JMP
- && ip->fixp[0]->fx_addsy)
- *symbol_get_tc (ip->fixp[0]->fx_addsy) = 1;
-
- /* These relocations can have an addend that won't fit in
- 4 octets for 64bit assembly. */
- if (HAVE_64BIT_GPRS
- && ! howto->partial_inplace
- && (reloc_type[0] == BFD_RELOC_16
- || reloc_type[0] == BFD_RELOC_32
- || reloc_type[0] == BFD_RELOC_MIPS_JMP
- || reloc_type[0] == BFD_RELOC_HI16_S
- || reloc_type[0] == BFD_RELOC_LO16
- || reloc_type[0] == BFD_RELOC_GPREL16
- || reloc_type[0] == BFD_RELOC_MIPS_LITERAL
- || reloc_type[0] == BFD_RELOC_GPREL32
- || reloc_type[0] == BFD_RELOC_64
- || reloc_type[0] == BFD_RELOC_CTOR
- || reloc_type[0] == BFD_RELOC_MIPS_SUB
- || reloc_type[0] == BFD_RELOC_MIPS_HIGHEST
- || reloc_type[0] == BFD_RELOC_MIPS_HIGHER
- || reloc_type[0] == BFD_RELOC_MIPS_SCN_DISP
- || reloc_type[0] == BFD_RELOC_MIPS_REL16
- || reloc_type[0] == BFD_RELOC_MIPS_RELGOT
- || reloc_type[0] == BFD_RELOC_MIPS16_GPREL
- || reloc_type[0] == BFD_RELOC_MIPS16_HI16_S
- || reloc_type[0] == BFD_RELOC_MIPS16_LO16))
- ip->fixp[0]->fx_no_overflow = 1;
-
- if (mips_relax.sequence)
- {
- if (mips_relax.first_fixup == 0)
- mips_relax.first_fixup = ip->fixp[0];
- }
- else if (reloc_needs_lo_p (*reloc_type))
- {
- struct mips_hi_fixup *hi_fixup;
-
- /* Reuse the last entry if it already has a matching %lo. */
- hi_fixup = mips_hi_fixup_list;
- if (hi_fixup == 0
- || !fixup_has_matching_lo_p (hi_fixup->fixp))
- {
- hi_fixup = ((struct mips_hi_fixup *)
- xmalloc (sizeof (struct mips_hi_fixup)));
- hi_fixup->next = mips_hi_fixup_list;
- mips_hi_fixup_list = hi_fixup;
- }
- hi_fixup->fixp = ip->fixp[0];
- hi_fixup->seg = now_seg;
- }
-
- /* Add fixups for the second and third relocations, if given.
- Note that the ABI allows the second relocation to be
- against RSS_UNDEF, RSS_GP, RSS_GP0 or RSS_LOC. At the
- moment we only use RSS_UNDEF, but we could add support
- for the others if it ever becomes necessary. */
- for (i = 1; i < 3; i++)
- if (reloc_type[i] != BFD_RELOC_UNUSED)
- {
- ip->fixp[i] = fix_new (ip->frag, ip->where,
- ip->fixp[0]->fx_size, NULL, 0,
- FALSE, reloc_type[i]);
-
- /* Use fx_tcbit to mark compound relocs. */
- ip->fixp[0]->fx_tcbit = 1;
- ip->fixp[i]->fx_tcbit = 1;
- }
- }
- }
- install_insn (ip);
-
- /* Update the register mask information. */
- if (! mips_opts.mips16)
- {
- if (pinfo & INSN_WRITE_GPR_D)
- mips_gprmask |= 1 << EXTRACT_OPERAND (RD, *ip);
- if ((pinfo & (INSN_WRITE_GPR_T | INSN_READ_GPR_T)) != 0)
- mips_gprmask |= 1 << EXTRACT_OPERAND (RT, *ip);
- if (pinfo & INSN_READ_GPR_S)
- mips_gprmask |= 1 << EXTRACT_OPERAND (RS, *ip);
- if (pinfo & INSN_WRITE_GPR_31)
- mips_gprmask |= 1 << RA;
- if (pinfo & INSN_WRITE_FPR_D)
- mips_cprmask[1] |= 1 << EXTRACT_OPERAND (FD, *ip);
- if ((pinfo & (INSN_WRITE_FPR_S | INSN_READ_FPR_S)) != 0)
- mips_cprmask[1] |= 1 << EXTRACT_OPERAND (FS, *ip);
- if ((pinfo & (INSN_WRITE_FPR_T | INSN_READ_FPR_T)) != 0)
- mips_cprmask[1] |= 1 << EXTRACT_OPERAND (FT, *ip);
- if ((pinfo & INSN_READ_FPR_R) != 0)
- mips_cprmask[1] |= 1 << EXTRACT_OPERAND (FR, *ip);
- if (pinfo & INSN_COP)
- {
- /* We don't keep enough information to sort these cases out.
- The itbl support does keep this information however, although
- we currently don't support itbl fprmats as part of the cop
- instruction. May want to add this support in the future. */
- }
- /* Never set the bit for $0, which is always zero. */
- mips_gprmask &= ~1 << 0;
- }
- else
- {
- if (pinfo & (MIPS16_INSN_WRITE_X | MIPS16_INSN_READ_X))
- mips_gprmask |= 1 << MIPS16_EXTRACT_OPERAND (RX, *ip);
- if (pinfo & (MIPS16_INSN_WRITE_Y | MIPS16_INSN_READ_Y))
- mips_gprmask |= 1 << MIPS16_EXTRACT_OPERAND (RY, *ip);
- if (pinfo & MIPS16_INSN_WRITE_Z)
- mips_gprmask |= 1 << MIPS16_EXTRACT_OPERAND (RZ, *ip);
- if (pinfo & (MIPS16_INSN_WRITE_T | MIPS16_INSN_READ_T))
- mips_gprmask |= 1 << TREG;
- if (pinfo & (MIPS16_INSN_WRITE_SP | MIPS16_INSN_READ_SP))
- mips_gprmask |= 1 << SP;
- if (pinfo & (MIPS16_INSN_WRITE_31 | MIPS16_INSN_READ_31))
- mips_gprmask |= 1 << RA;
- if (pinfo & MIPS16_INSN_WRITE_GPR_Y)
- mips_gprmask |= 1 << MIPS16OP_EXTRACT_REG32R (ip->insn_opcode);
- if (pinfo & MIPS16_INSN_READ_Z)
- mips_gprmask |= 1 << MIPS16_EXTRACT_OPERAND (MOVE32Z, *ip);
- if (pinfo & MIPS16_INSN_READ_GPR_X)
- mips_gprmask |= 1 << MIPS16_EXTRACT_OPERAND (REGR32, *ip);
- }
-
- if (mips_relax.sequence != 2 && !mips_opts.noreorder)
- {
- /* Filling the branch delay slot is more complex. We try to
- switch the branch with the previous instruction, which we can
- do if the previous instruction does not set up a condition
- that the branch tests and if the branch is not itself the
- target of any branch. */
- if ((pinfo & INSN_UNCOND_BRANCH_DELAY)
- || (pinfo & INSN_COND_BRANCH_DELAY))
- {
- if (mips_optimize < 2
- /* If we have seen .set volatile or .set nomove, don't
- optimize. */
- || mips_opts.nomove != 0
- /* We can't swap if the previous instruction's position
- is fixed. */
- || history[0].fixed_p
- /* If the previous previous insn was in a .set
- noreorder, we can't swap. Actually, the MIPS
- assembler will swap in this situation. However, gcc
- configured -with-gnu-as will generate code like
- .set noreorder
- lw $4,XXX
- .set reorder
- INSN
- bne $4,$0,foo
- in which we can not swap the bne and INSN. If gcc is
- not configured -with-gnu-as, it does not output the
- .set pseudo-ops. */
- || history[1].noreorder_p
- /* If the branch is itself the target of a branch, we
- can not swap. We cheat on this; all we check for is
- whether there is a label on this instruction. If
- there are any branches to anything other than a
- label, users must use .set noreorder. */
- || si->label_list != NULL
- /* If the previous instruction is in a variant frag
- other than this branch's one, we cannot do the swap.
- This does not apply to the mips16, which uses variant
- frags for different purposes. */
- || (! mips_opts.mips16
- && prev_insn_frag_type == rs_machine_dependent)
- /* Check for conflicts between the branch and the instructions
- before the candidate delay slot. */
- || nops_for_insn (history + 1, ip) > 0
- /* Check for conflicts between the swapped sequence and the
- target of the branch. */
- || nops_for_sequence (2, history + 1, ip, history) > 0
- /* We do not swap with a trap instruction, since it
- complicates trap handlers to have the trap
- instruction be in a delay slot. */
- || (prev_pinfo & INSN_TRAP)
- /* If the branch reads a register that the previous
- instruction sets, we can not swap. */
- || (! mips_opts.mips16
- && (prev_pinfo & INSN_WRITE_GPR_T)
- && insn_uses_reg (ip, EXTRACT_OPERAND (RT, history[0]),
- MIPS_GR_REG))
- || (! mips_opts.mips16
- && (prev_pinfo & INSN_WRITE_GPR_D)
- && insn_uses_reg (ip, EXTRACT_OPERAND (RD, history[0]),
- MIPS_GR_REG))
- || (mips_opts.mips16
- && (((prev_pinfo & MIPS16_INSN_WRITE_X)
- && (insn_uses_reg
- (ip, MIPS16_EXTRACT_OPERAND (RX, history[0]),
- MIPS16_REG)))
- || ((prev_pinfo & MIPS16_INSN_WRITE_Y)
- && (insn_uses_reg
- (ip, MIPS16_EXTRACT_OPERAND (RY, history[0]),
- MIPS16_REG)))
- || ((prev_pinfo & MIPS16_INSN_WRITE_Z)
- && (insn_uses_reg
- (ip, MIPS16_EXTRACT_OPERAND (RZ, history[0]),
- MIPS16_REG)))
- || ((prev_pinfo & MIPS16_INSN_WRITE_T)
- && insn_uses_reg (ip, TREG, MIPS_GR_REG))
- || ((prev_pinfo & MIPS16_INSN_WRITE_31)
- && insn_uses_reg (ip, RA, MIPS_GR_REG))
- || ((prev_pinfo & MIPS16_INSN_WRITE_GPR_Y)
- && insn_uses_reg (ip,
- MIPS16OP_EXTRACT_REG32R
- (history[0].insn_opcode),
- MIPS_GR_REG))))
- /* If the branch writes a register that the previous
- instruction sets, we can not swap (we know that
- branches write only to RD or to $31). */
- || (! mips_opts.mips16
- && (prev_pinfo & INSN_WRITE_GPR_T)
- && (((pinfo & INSN_WRITE_GPR_D)
- && (EXTRACT_OPERAND (RT, history[0])
- == EXTRACT_OPERAND (RD, *ip)))
- || ((pinfo & INSN_WRITE_GPR_31)
- && EXTRACT_OPERAND (RT, history[0]) == RA)))
- || (! mips_opts.mips16
- && (prev_pinfo & INSN_WRITE_GPR_D)
- && (((pinfo & INSN_WRITE_GPR_D)
- && (EXTRACT_OPERAND (RD, history[0])
- == EXTRACT_OPERAND (RD, *ip)))
- || ((pinfo & INSN_WRITE_GPR_31)
- && EXTRACT_OPERAND (RD, history[0]) == RA)))
- || (mips_opts.mips16
- && (pinfo & MIPS16_INSN_WRITE_31)
- && ((prev_pinfo & MIPS16_INSN_WRITE_31)
- || ((prev_pinfo & MIPS16_INSN_WRITE_GPR_Y)
- && (MIPS16OP_EXTRACT_REG32R (history[0].insn_opcode)
- == RA))))
- /* If the branch writes a register that the previous
- instruction reads, we can not swap (we know that
- branches only write to RD or to $31). */
- || (! mips_opts.mips16
- && (pinfo & INSN_WRITE_GPR_D)
- && insn_uses_reg (&history[0],
- EXTRACT_OPERAND (RD, *ip),
- MIPS_GR_REG))
- || (! mips_opts.mips16
- && (pinfo & INSN_WRITE_GPR_31)
- && insn_uses_reg (&history[0], RA, MIPS_GR_REG))
- || (mips_opts.mips16
- && (pinfo & MIPS16_INSN_WRITE_31)
- && insn_uses_reg (&history[0], RA, MIPS_GR_REG))
- /* If one instruction sets a condition code and the
- other one uses a condition code, we can not swap. */
- || ((pinfo & INSN_READ_COND_CODE)
- && (prev_pinfo & INSN_WRITE_COND_CODE))
- || ((pinfo & INSN_WRITE_COND_CODE)
- && (prev_pinfo & INSN_READ_COND_CODE))
- /* If the previous instruction uses the PC, we can not
- swap. */
- || (mips_opts.mips16
- && (prev_pinfo & MIPS16_INSN_READ_PC))
- /* If the previous instruction had a fixup in mips16
- mode, we can not swap. This normally means that the
- previous instruction was a 4 byte branch anyhow. */
- || (mips_opts.mips16 && history[0].fixp[0])
- /* If the previous instruction is a sync, sync.l, or
- sync.p, we can not swap. */
- || (prev_pinfo & INSN_SYNC))
- {
- if (mips_opts.mips16
- && (pinfo & INSN_UNCOND_BRANCH_DELAY)
- && (pinfo & (MIPS16_INSN_READ_X | MIPS16_INSN_READ_31))
- && ISA_SUPPORTS_MIPS16E)
- {
- /* Convert MIPS16 jr/jalr into a "compact" jump. */
- ip->insn_opcode |= 0x0080;
- install_insn (ip);
- insert_into_history (0, 1, ip);
- }
- else
- {
- /* We could do even better for unconditional branches to
- portions of this object file; we could pick up the
- instruction at the destination, put it in the delay
- slot, and bump the destination address. */
- insert_into_history (0, 1, ip);
- emit_nop ();
- }
-
- if (mips_relax.sequence)
- mips_relax.sizes[mips_relax.sequence - 1] += 4;
- }
- else
- {
- /* It looks like we can actually do the swap. */
- struct mips_cl_insn delay = history[0];
- if (mips_opts.mips16)
- {
- know (delay.frag == ip->frag);
- move_insn (ip, delay.frag, delay.where);
- move_insn (&delay, ip->frag, ip->where + insn_length (ip));
- }
- else if (relaxed_branch)
- {
- /* Add the delay slot instruction to the end of the
- current frag and shrink the fixed part of the
- original frag. If the branch occupies the tail of
- the latter, move it backwards to cover the gap. */
- delay.frag->fr_fix -= 4;
- if (delay.frag == ip->frag)
- move_insn (ip, ip->frag, ip->where - 4);
- add_fixed_insn (&delay);
- }
- else
- {
- move_insn (&delay, ip->frag, ip->where);
- move_insn (ip, history[0].frag, history[0].where);
- }
- history[0] = *ip;
- delay.fixed_p = 1;
- insert_into_history (0, 1, &delay);
- }
-
- /* If that was an unconditional branch, forget the previous
- insn information. */
- if (pinfo & INSN_UNCOND_BRANCH_DELAY)
- mips_no_prev_insn ();
- }
- else if (pinfo & INSN_COND_BRANCH_LIKELY)
- {
- /* We don't yet optimize a branch likely. What we should do
- is look at the target, copy the instruction found there
- into the delay slot, and increment the branch to jump to
- the next instruction. */
- insert_into_history (0, 1, ip);
- emit_nop ();
- }
- else
- insert_into_history (0, 1, ip);
- }
- else
- insert_into_history (0, 1, ip);
-
- /* We just output an insn, so the next one doesn't have a label. */
- mips_clear_insn_labels ();
-}
-
-/* Forget that there was any previous instruction or label. */
-
-static void
-mips_no_prev_insn (void)
-{
- prev_nop_frag = NULL;
- insert_into_history (0, ARRAY_SIZE (history), NOP_INSN);
- mips_clear_insn_labels ();
-}
-
-/* This function must be called before we emit something other than
- instructions. It is like mips_no_prev_insn except that it inserts
- any NOPS that might be needed by previous instructions. */
-
-void
-mips_emit_delays (void)
-{
- if (! mips_opts.noreorder)
- {
- int nops = nops_for_insn (history, NULL);
- if (nops > 0)
- {
- while (nops-- > 0)
- add_fixed_insn (NOP_INSN);
- mips_move_labels ();
- }
- }
- mips_no_prev_insn ();
-}
-
-/* Start a (possibly nested) noreorder block. */
-
-static void
-start_noreorder (void)
-{
- if (mips_opts.noreorder == 0)
- {
- unsigned int i;
- int nops;
-
- /* None of the instructions before the .set noreorder can be moved. */
- for (i = 0; i < ARRAY_SIZE (history); i++)
- history[i].fixed_p = 1;
-
- /* Insert any nops that might be needed between the .set noreorder
- block and the previous instructions. We will later remove any
- nops that turn out not to be needed. */
- nops = nops_for_insn (history, NULL);
- if (nops > 0)
- {
- if (mips_optimize != 0)
- {
- /* Record the frag which holds the nop instructions, so
- that we can remove them if we don't need them. */
- frag_grow (mips_opts.mips16 ? nops * 2 : nops * 4);
- prev_nop_frag = frag_now;
- prev_nop_frag_holds = nops;
- prev_nop_frag_required = 0;
- prev_nop_frag_since = 0;
- }
-
- for (; nops > 0; --nops)
- add_fixed_insn (NOP_INSN);
-
- /* Move on to a new frag, so that it is safe to simply
- decrease the size of prev_nop_frag. */
- frag_wane (frag_now);
- frag_new (0);
- mips_move_labels ();
- }
- mips16_mark_labels ();
- mips_clear_insn_labels ();
- }
- mips_opts.noreorder++;
- mips_any_noreorder = 1;
-}
-
-/* End a nested noreorder block. */
-
-static void
-end_noreorder (void)
-{
- mips_opts.noreorder--;
- if (mips_opts.noreorder == 0 && prev_nop_frag != NULL)
- {
- /* Commit to inserting prev_nop_frag_required nops and go back to
- handling nop insertion the .set reorder way. */
- prev_nop_frag->fr_fix -= ((prev_nop_frag_holds - prev_nop_frag_required)
- * (mips_opts.mips16 ? 2 : 4));
- insert_into_history (prev_nop_frag_since,
- prev_nop_frag_required, NOP_INSN);
- prev_nop_frag = NULL;
- }
-}
-
-/* Set up global variables for the start of a new macro. */
-
-static void
-macro_start (void)
-{
- memset (&mips_macro_warning.sizes, 0, sizeof (mips_macro_warning.sizes));
- mips_macro_warning.delay_slot_p = (mips_opts.noreorder
- && (history[0].insn_mo->pinfo
- & (INSN_UNCOND_BRANCH_DELAY
- | INSN_COND_BRANCH_DELAY
- | INSN_COND_BRANCH_LIKELY)) != 0);
-}
-
-/* Given that a macro is longer than 4 bytes, return the appropriate warning
- for it. Return null if no warning is needed. SUBTYPE is a bitmask of
- RELAX_DELAY_SLOT and RELAX_NOMACRO. */
-
-static const char *
-macro_warning (relax_substateT subtype)
-{
- if (subtype & RELAX_DELAY_SLOT)
- return _("Macro instruction expanded into multiple instructions"
- " in a branch delay slot");
- else if (subtype & RELAX_NOMACRO)
- return _("Macro instruction expanded into multiple instructions");
- else
- return 0;
-}
-
-/* Finish up a macro. Emit warnings as appropriate. */
-
-static void
-macro_end (void)
-{
- if (mips_macro_warning.sizes[0] > 4 || mips_macro_warning.sizes[1] > 4)
- {
- relax_substateT subtype;
-
- /* Set up the relaxation warning flags. */
- subtype = 0;
- if (mips_macro_warning.sizes[1] > mips_macro_warning.sizes[0])
- subtype |= RELAX_SECOND_LONGER;
- if (mips_opts.warn_about_macros)
- subtype |= RELAX_NOMACRO;
- if (mips_macro_warning.delay_slot_p)
- subtype |= RELAX_DELAY_SLOT;
-
- if (mips_macro_warning.sizes[0] > 4 && mips_macro_warning.sizes[1] > 4)
- {
- /* Either the macro has a single implementation or both
- implementations are longer than 4 bytes. Emit the
- warning now. */
- const char *msg = macro_warning (subtype);
- if (msg != 0)
- as_warn (msg);
- }
- else
- {
- /* One implementation might need a warning but the other
- definitely doesn't. */
- mips_macro_warning.first_frag->fr_subtype |= subtype;
- }
- }
-}
-
-/* Read a macro's relocation codes from *ARGS and store them in *R.
- The first argument in *ARGS will be either the code for a single
- relocation or -1 followed by the three codes that make up a
- composite relocation. */
-
-static void
-macro_read_relocs (va_list *args, bfd_reloc_code_real_type *r)
-{
- int i, next;
-
- next = va_arg (*args, int);
- if (next >= 0)
- r[0] = (bfd_reloc_code_real_type) next;
- else
- for (i = 0; i < 3; i++)
- r[i] = (bfd_reloc_code_real_type) va_arg (*args, int);
-}
-
-/* Build an instruction created by a macro expansion. This is passed
- a pointer to the count of instructions created so far, an
- expression, the name of the instruction to build, an operand format
- string, and corresponding arguments. */
-
-static void
-macro_build (expressionS *ep, const char *name, const char *fmt, ...)
-{
- const struct mips_opcode *mo;
- struct mips_cl_insn insn;
- bfd_reloc_code_real_type r[3];
- va_list args;
-
- va_start (args, fmt);
-
- if (mips_opts.mips16)
- {
- mips16_macro_build (ep, name, fmt, args);
- va_end (args);
- return;
- }
-
- r[0] = BFD_RELOC_UNUSED;
- r[1] = BFD_RELOC_UNUSED;
- r[2] = BFD_RELOC_UNUSED;
- mo = (struct mips_opcode *) hash_find (op_hash, name);
- assert (mo);
- assert (strcmp (name, mo->name) == 0);
-
- while (1)
- {
- /* Search until we get a match for NAME. It is assumed here that
- macros will never generate MDMX, MIPS-3D, or MT instructions. */
- if (strcmp (fmt, mo->args) == 0
- && mo->pinfo != INSN_MACRO
- && is_opcode_valid (mo, TRUE))
- break;
-
- ++mo;
- assert (mo->name);
- assert (strcmp (name, mo->name) == 0);
- }
-
- create_insn (&insn, mo);
- for (;;)
- {
- switch (*fmt++)
- {
- case '\0':
- break;
-
- case ',':
- case '(':
- case ')':
- continue;
-
- case '+':
- switch (*fmt++)
- {
- case 'A':
- case 'E':
- INSERT_OPERAND (SHAMT, insn, va_arg (args, int));
- continue;
-
- case 'B':
- case 'F':
- /* Note that in the macro case, these arguments are already
- in MSB form. (When handling the instruction in the
- non-macro case, these arguments are sizes from which
- MSB values must be calculated.) */
- INSERT_OPERAND (INSMSB, insn, va_arg (args, int));
- continue;
-
- case 'C':
- case 'G':
- case 'H':
- /* Note that in the macro case, these arguments are already
- in MSBD form. (When handling the instruction in the
- non-macro case, these arguments are sizes from which
- MSBD values must be calculated.) */
- INSERT_OPERAND (EXTMSBD, insn, va_arg (args, int));
- continue;
-
- case 'Q':
- INSERT_OPERAND (SEQI, insn, va_arg (args, int));
- continue;
-
- default:
- internalError ();
- }
- continue;
-
- case '2':
- INSERT_OPERAND (BP, insn, va_arg (args, int));
- continue;
-
- case 't':
- case 'w':
- case 'E':
- INSERT_OPERAND (RT, insn, va_arg (args, int));
- continue;
-
- case 'c':
- INSERT_OPERAND (CODE, insn, va_arg (args, int));
- continue;
-
- case 'T':
- case 'W':
- INSERT_OPERAND (FT, insn, va_arg (args, int));
- continue;
-
- case 'd':
- case 'G':
- case 'K':
- INSERT_OPERAND (RD, insn, va_arg (args, int));
- continue;
-
- case 'U':
- {
- int tmp = va_arg (args, int);
-
- INSERT_OPERAND (RT, insn, tmp);
- INSERT_OPERAND (RD, insn, tmp);
- continue;
- }
-
- case 'V':
- case 'S':
- INSERT_OPERAND (FS, insn, va_arg (args, int));
- continue;
-
- case 'z':
- continue;
-
- case '<':
- INSERT_OPERAND (SHAMT, insn, va_arg (args, int));
- continue;
-
- case 'D':
- INSERT_OPERAND (FD, insn, va_arg (args, int));
- continue;
-
- case 'B':
- INSERT_OPERAND (CODE20, insn, va_arg (args, int));
- continue;
-
- case 'J':
- INSERT_OPERAND (CODE19, insn, va_arg (args, int));
- continue;
-
- case 'q':
- INSERT_OPERAND (CODE2, insn, va_arg (args, int));
- continue;
-
- case 'b':
- case 's':
- case 'r':
- case 'v':
- INSERT_OPERAND (RS, insn, va_arg (args, int));
- continue;
-
- case 'i':
- case 'j':
- case 'o':
- macro_read_relocs (&args, r);
- assert (*r == BFD_RELOC_GPREL16
- || *r == BFD_RELOC_MIPS_LITERAL
- || *r == BFD_RELOC_MIPS_HIGHER
- || *r == BFD_RELOC_HI16_S
- || *r == BFD_RELOC_LO16
- || *r == BFD_RELOC_MIPS_GOT16
- || *r == BFD_RELOC_MIPS_CALL16
- || *r == BFD_RELOC_MIPS_GOT_DISP
- || *r == BFD_RELOC_MIPS_GOT_PAGE
- || *r == BFD_RELOC_MIPS_GOT_OFST
- || *r == BFD_RELOC_MIPS_GOT_LO16
- || *r == BFD_RELOC_MIPS_CALL_LO16);
- continue;
-
- case 'u':
- macro_read_relocs (&args, r);
- assert (ep != NULL
- && (ep->X_op == O_constant
- || (ep->X_op == O_symbol
- && (*r == BFD_RELOC_MIPS_HIGHEST
- || *r == BFD_RELOC_HI16_S
- || *r == BFD_RELOC_HI16
- || *r == BFD_RELOC_GPREL16
- || *r == BFD_RELOC_MIPS_GOT_HI16
- || *r == BFD_RELOC_MIPS_CALL_HI16))));
- continue;
-
- case 'p':
- assert (ep != NULL);
-
- /*
- * This allows macro() to pass an immediate expression for
- * creating short branches without creating a symbol.
- *
- * We don't allow branch relaxation for these branches, as
- * they should only appear in ".set nomacro" anyway.
- */
- if (ep->X_op == O_constant)
- {
- if ((ep->X_add_number & 3) != 0)
- as_bad (_("branch to misaligned address (0x%lx)"),
- (unsigned long) ep->X_add_number);
- if ((ep->X_add_number + 0x20000) & ~0x3ffff)
- as_bad (_("branch address range overflow (0x%lx)"),
- (unsigned long) ep->X_add_number);
- insn.insn_opcode |= (ep->X_add_number >> 2) & 0xffff;
- ep = NULL;
- }
- else
- *r = BFD_RELOC_16_PCREL_S2;
- continue;
-
- case 'a':
- assert (ep != NULL);
- *r = BFD_RELOC_MIPS_JMP;
- continue;
-
- case 'C':
- INSERT_OPERAND (COPZ, insn, va_arg (args, unsigned long));
- continue;
-
- case 'k':
- INSERT_OPERAND (CACHE, insn, va_arg (args, unsigned long));
- continue;
-
- default:
- internalError ();
- }
- break;
- }
- va_end (args);
- assert (*r == BFD_RELOC_UNUSED ? ep == NULL : ep != NULL);
-
- append_insn (&insn, ep, r);
-}
-
-static void
-mips16_macro_build (expressionS *ep, const char *name, const char *fmt,
- va_list args)
-{
- struct mips_opcode *mo;
- struct mips_cl_insn insn;
- bfd_reloc_code_real_type r[3]
- = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
-
- mo = (struct mips_opcode *) hash_find (mips16_op_hash, name);
- assert (mo);
- assert (strcmp (name, mo->name) == 0);
-
- while (strcmp (fmt, mo->args) != 0 || mo->pinfo == INSN_MACRO)
- {
- ++mo;
- assert (mo->name);
- assert (strcmp (name, mo->name) == 0);
- }
-
- create_insn (&insn, mo);
- for (;;)
- {
- int c;
-
- c = *fmt++;
- switch (c)
- {
- case '\0':
- break;
-
- case ',':
- case '(':
- case ')':
- continue;
-
- case 'y':
- case 'w':
- MIPS16_INSERT_OPERAND (RY, insn, va_arg (args, int));
- continue;
-
- case 'x':
- case 'v':
- MIPS16_INSERT_OPERAND (RX, insn, va_arg (args, int));
- continue;
-
- case 'z':
- MIPS16_INSERT_OPERAND (RZ, insn, va_arg (args, int));
- continue;
-
- case 'Z':
- MIPS16_INSERT_OPERAND (MOVE32Z, insn, va_arg (args, int));
- continue;
-
- case '0':
- case 'S':
- case 'P':
- case 'R':
- continue;
-
- case 'X':
- MIPS16_INSERT_OPERAND (REGR32, insn, va_arg (args, int));
- continue;
-
- case 'Y':
- {
- int regno;
-
- regno = va_arg (args, int);
- regno = ((regno & 7) << 2) | ((regno & 0x18) >> 3);
- MIPS16_INSERT_OPERAND (REG32R, insn, regno);
- }
- continue;
-
- case '<':
- case '>':
- case '4':
- case '5':
- case 'H':
- case 'W':
- case 'D':
- case 'j':
- case '8':
- case 'V':
- case 'C':
- case 'U':
- case 'k':
- case 'K':
- case 'p':
- case 'q':
- {
- assert (ep != NULL);
-
- if (ep->X_op != O_constant)
- *r = (int) BFD_RELOC_UNUSED + c;
- else
- {
- mips16_immed (NULL, 0, c, ep->X_add_number, FALSE, FALSE,
- FALSE, &insn.insn_opcode, &insn.use_extend,
- &insn.extend);
- ep = NULL;
- *r = BFD_RELOC_UNUSED;
- }
- }
- continue;
-
- case '6':
- MIPS16_INSERT_OPERAND (IMM6, insn, va_arg (args, int));
- continue;
- }
-
- break;
- }
-
- assert (*r == BFD_RELOC_UNUSED ? ep == NULL : ep != NULL);
-
- append_insn (&insn, ep, r);
-}
-
-/*
- * Sign-extend 32-bit mode constants that have bit 31 set and all
- * higher bits unset.
- */
-static void
-normalize_constant_expr (expressionS *ex)
-{
- if (ex->X_op == O_constant
- && IS_ZEXT_32BIT_NUM (ex->X_add_number))
- ex->X_add_number = (((ex->X_add_number & 0xffffffff) ^ 0x80000000)
- - 0x80000000);
-}
-
-/*
- * Sign-extend 32-bit mode address offsets that have bit 31 set and
- * all higher bits unset.
- */
-static void
-normalize_address_expr (expressionS *ex)
-{
- if (((ex->X_op == O_constant && HAVE_32BIT_ADDRESSES)
- || (ex->X_op == O_symbol && HAVE_32BIT_SYMBOLS))
- && IS_ZEXT_32BIT_NUM (ex->X_add_number))
- ex->X_add_number = (((ex->X_add_number & 0xffffffff) ^ 0x80000000)
- - 0x80000000);
-}
-
-/*
- * Generate a "jalr" instruction with a relocation hint to the called
- * function. This occurs in NewABI PIC code.
- */
-static void
-macro_build_jalr (expressionS *ep)
-{
- char *f = NULL;
-
- if (HAVE_NEWABI)
- {
- frag_grow (8);
- f = frag_more (0);
- }
- macro_build (NULL, "jalr", "d,s", RA, PIC_CALL_REG);
- if (HAVE_NEWABI)
- fix_new_exp (frag_now, f - frag_now->fr_literal,
- 4, ep, FALSE, BFD_RELOC_MIPS_JALR);
-}
-
-/*
- * Generate a "lui" instruction.
- */
-static void
-macro_build_lui (expressionS *ep, int regnum)
-{
- expressionS high_expr;
- const struct mips_opcode *mo;
- struct mips_cl_insn insn;
- bfd_reloc_code_real_type r[3]
- = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
- const char *name = "lui";
- const char *fmt = "t,u";
-
- assert (! mips_opts.mips16);
-
- high_expr = *ep;
-
- if (high_expr.X_op == O_constant)
- {
- /* We can compute the instruction now without a relocation entry. */
- high_expr.X_add_number = ((high_expr.X_add_number + 0x8000)
- >> 16) & 0xffff;
- *r = BFD_RELOC_UNUSED;
- }
- else
- {
- assert (ep->X_op == O_symbol);
- /* _gp_disp is a special case, used from s_cpload.
- __gnu_local_gp is used if mips_no_shared. */
- assert (mips_pic == NO_PIC
- || (! HAVE_NEWABI
- && strcmp (S_GET_NAME (ep->X_add_symbol), "_gp_disp") == 0)
- || (! mips_in_shared
- && strcmp (S_GET_NAME (ep->X_add_symbol),
- "__gnu_local_gp") == 0));
- *r = BFD_RELOC_HI16_S;
- }
-
- mo = hash_find (op_hash, name);
- assert (strcmp (name, mo->name) == 0);
- assert (strcmp (fmt, mo->args) == 0);
- create_insn (&insn, mo);
-
- insn.insn_opcode = insn.insn_mo->match;
- INSERT_OPERAND (RT, insn, regnum);
- if (*r == BFD_RELOC_UNUSED)
- {
- insn.insn_opcode |= high_expr.X_add_number;
- append_insn (&insn, NULL, r);
- }
- else
- append_insn (&insn, &high_expr, r);
-}
-
-/* Generate a sequence of instructions to do a load or store from a constant
- offset off of a base register (breg) into/from a target register (treg),
- using AT if necessary. */
-static void
-macro_build_ldst_constoffset (expressionS *ep, const char *op,
- int treg, int breg, int dbl)
-{
- assert (ep->X_op == O_constant);
-
- /* Sign-extending 32-bit constants makes their handling easier. */
- if (!dbl)
- normalize_constant_expr (ep);
-
- /* Right now, this routine can only handle signed 32-bit constants. */
- if (! IS_SEXT_32BIT_NUM(ep->X_add_number + 0x8000))
- as_warn (_("operand overflow"));
-
- if (IS_SEXT_16BIT_NUM(ep->X_add_number))
- {
- /* Signed 16-bit offset will fit in the op. Easy! */
- macro_build (ep, op, "t,o(b)", treg, BFD_RELOC_LO16, breg);
- }
- else
- {
- /* 32-bit offset, need multiple instructions and AT, like:
- lui $tempreg,const_hi (BFD_RELOC_HI16_S)
- addu $tempreg,$tempreg,$breg
- <op> $treg,const_lo($tempreg) (BFD_RELOC_LO16)
- to handle the complete offset. */
- macro_build_lui (ep, AT);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, AT, breg);
- macro_build (ep, op, "t,o(b)", treg, BFD_RELOC_LO16, AT);
-
- if (!mips_opts.at)
- as_bad (_("Macro used $at after \".set noat\""));
- }
-}
-
-/* set_at()
- * Generates code to set the $at register to true (one)
- * if reg is less than the immediate expression.
- */
-static void
-set_at (int reg, int unsignedp)
-{
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number >= -0x8000
- && imm_expr.X_add_number < 0x8000)
- macro_build (&imm_expr, unsignedp ? "sltiu" : "slti", "t,r,j",
- AT, reg, BFD_RELOC_LO16);
- else
- {
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (NULL, unsignedp ? "sltu" : "slt", "d,v,t", AT, reg, AT);
- }
-}
-
-/* Warn if an expression is not a constant. */
-
-static void
-check_absolute_expr (struct mips_cl_insn *ip, expressionS *ex)
-{
- if (ex->X_op == O_big)
- as_bad (_("unsupported large constant"));
- else if (ex->X_op != O_constant)
- as_bad (_("Instruction %s requires absolute expression"),
- ip->insn_mo->name);
-
- if (HAVE_32BIT_GPRS)
- normalize_constant_expr (ex);
-}
-
-/* Count the leading zeroes by performing a binary chop. This is a
- bulky bit of source, but performance is a LOT better for the
- majority of values than a simple loop to count the bits:
- for (lcnt = 0; (lcnt < 32); lcnt++)
- if ((v) & (1 << (31 - lcnt)))
- break;
- However it is not code size friendly, and the gain will drop a bit
- on certain cached systems.
-*/
-#define COUNT_TOP_ZEROES(v) \
- (((v) & ~0xffff) == 0 \
- ? ((v) & ~0xff) == 0 \
- ? ((v) & ~0xf) == 0 \
- ? ((v) & ~0x3) == 0 \
- ? ((v) & ~0x1) == 0 \
- ? !(v) \
- ? 32 \
- : 31 \
- : 30 \
- : ((v) & ~0x7) == 0 \
- ? 29 \
- : 28 \
- : ((v) & ~0x3f) == 0 \
- ? ((v) & ~0x1f) == 0 \
- ? 27 \
- : 26 \
- : ((v) & ~0x7f) == 0 \
- ? 25 \
- : 24 \
- : ((v) & ~0xfff) == 0 \
- ? ((v) & ~0x3ff) == 0 \
- ? ((v) & ~0x1ff) == 0 \
- ? 23 \
- : 22 \
- : ((v) & ~0x7ff) == 0 \
- ? 21 \
- : 20 \
- : ((v) & ~0x3fff) == 0 \
- ? ((v) & ~0x1fff) == 0 \
- ? 19 \
- : 18 \
- : ((v) & ~0x7fff) == 0 \
- ? 17 \
- : 16 \
- : ((v) & ~0xffffff) == 0 \
- ? ((v) & ~0xfffff) == 0 \
- ? ((v) & ~0x3ffff) == 0 \
- ? ((v) & ~0x1ffff) == 0 \
- ? 15 \
- : 14 \
- : ((v) & ~0x7ffff) == 0 \
- ? 13 \
- : 12 \
- : ((v) & ~0x3fffff) == 0 \
- ? ((v) & ~0x1fffff) == 0 \
- ? 11 \
- : 10 \
- : ((v) & ~0x7fffff) == 0 \
- ? 9 \
- : 8 \
- : ((v) & ~0xfffffff) == 0 \
- ? ((v) & ~0x3ffffff) == 0 \
- ? ((v) & ~0x1ffffff) == 0 \
- ? 7 \
- : 6 \
- : ((v) & ~0x7ffffff) == 0 \
- ? 5 \
- : 4 \
- : ((v) & ~0x3fffffff) == 0 \
- ? ((v) & ~0x1fffffff) == 0 \
- ? 3 \
- : 2 \
- : ((v) & ~0x7fffffff) == 0 \
- ? 1 \
- : 0)
-
-/* load_register()
- * This routine generates the least number of instructions necessary to load
- * an absolute expression value into a register.
- */
-static void
-load_register (int reg, expressionS *ep, int dbl)
-{
- int freg;
- expressionS hi32, lo32;
-
- if (ep->X_op != O_big)
- {
- assert (ep->X_op == O_constant);
-
- /* Sign-extending 32-bit constants makes their handling easier. */
- if (!dbl)
- normalize_constant_expr (ep);
-
- if (IS_SEXT_16BIT_NUM (ep->X_add_number))
- {
- /* We can handle 16 bit signed values with an addiu to
- $zero. No need to ever use daddiu here, since $zero and
- the result are always correct in 32 bit mode. */
- macro_build (ep, "addiu", "t,r,j", reg, 0, BFD_RELOC_LO16);
- return;
- }
- else if (ep->X_add_number >= 0 && ep->X_add_number < 0x10000)
- {
- /* We can handle 16 bit unsigned values with an ori to
- $zero. */
- macro_build (ep, "ori", "t,r,i", reg, 0, BFD_RELOC_LO16);
- return;
- }
- else if ((IS_SEXT_32BIT_NUM (ep->X_add_number)))
- {
- /* 32 bit values require an lui. */
- macro_build (ep, "lui", "t,u", reg, BFD_RELOC_HI16);
- if ((ep->X_add_number & 0xffff) != 0)
- macro_build (ep, "ori", "t,r,i", reg, reg, BFD_RELOC_LO16);
- return;
- }
- }
-
- /* The value is larger than 32 bits. */
-
- if (!dbl || HAVE_32BIT_GPRS)
- {
- char value[32];
-
- sprintf_vma (value, ep->X_add_number);
- as_bad (_("Number (0x%s) larger than 32 bits"), value);
- macro_build (ep, "addiu", "t,r,j", reg, 0, BFD_RELOC_LO16);
- return;
- }
-
- if (ep->X_op != O_big)
- {
- hi32 = *ep;
- hi32.X_add_number = (valueT) hi32.X_add_number >> 16;
- hi32.X_add_number = (valueT) hi32.X_add_number >> 16;
- hi32.X_add_number &= 0xffffffff;
- lo32 = *ep;
- lo32.X_add_number &= 0xffffffff;
- }
- else
- {
- assert (ep->X_add_number > 2);
- if (ep->X_add_number == 3)
- generic_bignum[3] = 0;
- else if (ep->X_add_number > 4)
- as_bad (_("Number larger than 64 bits"));
- lo32.X_op = O_constant;
- lo32.X_add_number = generic_bignum[0] + (generic_bignum[1] << 16);
- hi32.X_op = O_constant;
- hi32.X_add_number = generic_bignum[2] + (generic_bignum[3] << 16);
- }
-
- if (hi32.X_add_number == 0)
- freg = 0;
- else
- {
- int shift, bit;
- unsigned long hi, lo;
-
- if (hi32.X_add_number == (offsetT) 0xffffffff)
- {
- if ((lo32.X_add_number & 0xffff8000) == 0xffff8000)
- {
- macro_build (&lo32, "addiu", "t,r,j", reg, 0, BFD_RELOC_LO16);
- return;
- }
- if (lo32.X_add_number & 0x80000000)
- {
- macro_build (&lo32, "lui", "t,u", reg, BFD_RELOC_HI16);
- if (lo32.X_add_number & 0xffff)
- macro_build (&lo32, "ori", "t,r,i", reg, reg, BFD_RELOC_LO16);
- return;
- }
- }
-
- /* Check for 16bit shifted constant. We know that hi32 is
- non-zero, so start the mask on the first bit of the hi32
- value. */
- shift = 17;
- do
- {
- unsigned long himask, lomask;
-
- if (shift < 32)
- {
- himask = 0xffff >> (32 - shift);
- lomask = (0xffff << shift) & 0xffffffff;
- }
- else
- {
- himask = 0xffff << (shift - 32);
- lomask = 0;
- }
- if ((hi32.X_add_number & ~(offsetT) himask) == 0
- && (lo32.X_add_number & ~(offsetT) lomask) == 0)
- {
- expressionS tmp;
-
- tmp.X_op = O_constant;
- if (shift < 32)
- tmp.X_add_number = ((hi32.X_add_number << (32 - shift))
- | (lo32.X_add_number >> shift));
- else
- tmp.X_add_number = hi32.X_add_number >> (shift - 32);
- macro_build (&tmp, "ori", "t,r,i", reg, 0, BFD_RELOC_LO16);
- macro_build (NULL, (shift >= 32) ? "dsll32" : "dsll", "d,w,<",
- reg, reg, (shift >= 32) ? shift - 32 : shift);
- return;
- }
- ++shift;
- }
- while (shift <= (64 - 16));
-
- /* Find the bit number of the lowest one bit, and store the
- shifted value in hi/lo. */
- hi = (unsigned long) (hi32.X_add_number & 0xffffffff);
- lo = (unsigned long) (lo32.X_add_number & 0xffffffff);
- if (lo != 0)
- {
- bit = 0;
- while ((lo & 1) == 0)
- {
- lo >>= 1;
- ++bit;
- }
- lo |= (hi & (((unsigned long) 1 << bit) - 1)) << (32 - bit);
- hi >>= bit;
- }
- else
- {
- bit = 32;
- while ((hi & 1) == 0)
- {
- hi >>= 1;
- ++bit;
- }
- lo = hi;
- hi = 0;
- }
-
- /* Optimize if the shifted value is a (power of 2) - 1. */
- if ((hi == 0 && ((lo + 1) & lo) == 0)
- || (lo == 0xffffffff && ((hi + 1) & hi) == 0))
- {
- shift = COUNT_TOP_ZEROES ((unsigned int) hi32.X_add_number);
- if (shift != 0)
- {
- expressionS tmp;
-
- /* This instruction will set the register to be all
- ones. */
- tmp.X_op = O_constant;
- tmp.X_add_number = (offsetT) -1;
- macro_build (&tmp, "addiu", "t,r,j", reg, 0, BFD_RELOC_LO16);
- if (bit != 0)
- {
- bit += shift;
- macro_build (NULL, (bit >= 32) ? "dsll32" : "dsll", "d,w,<",
- reg, reg, (bit >= 32) ? bit - 32 : bit);
- }
- macro_build (NULL, (shift >= 32) ? "dsrl32" : "dsrl", "d,w,<",
- reg, reg, (shift >= 32) ? shift - 32 : shift);
- return;
- }
- }
-
- /* Sign extend hi32 before calling load_register, because we can
- generally get better code when we load a sign extended value. */
- if ((hi32.X_add_number & 0x80000000) != 0)
- hi32.X_add_number |= ~(offsetT) 0xffffffff;
- load_register (reg, &hi32, 0);
- freg = reg;
- }
- if ((lo32.X_add_number & 0xffff0000) == 0)
- {
- if (freg != 0)
- {
- macro_build (NULL, "dsll32", "d,w,<", reg, freg, 0);
- freg = reg;
- }
- }
- else
- {
- expressionS mid16;
-
- if ((freg == 0) && (lo32.X_add_number == (offsetT) 0xffffffff))
- {
- macro_build (&lo32, "lui", "t,u", reg, BFD_RELOC_HI16);
- macro_build (NULL, "dsrl32", "d,w,<", reg, reg, 0);
- return;
- }
-
- if (freg != 0)
- {
- macro_build (NULL, "dsll", "d,w,<", reg, freg, 16);
- freg = reg;
- }
- mid16 = lo32;
- mid16.X_add_number >>= 16;
- macro_build (&mid16, "ori", "t,r,i", reg, freg, BFD_RELOC_LO16);
- macro_build (NULL, "dsll", "d,w,<", reg, reg, 16);
- freg = reg;
- }
- if ((lo32.X_add_number & 0xffff) != 0)
- macro_build (&lo32, "ori", "t,r,i", reg, freg, BFD_RELOC_LO16);
-}
-
-static inline void
-load_delay_nop (void)
-{
- if (!gpr_interlocks)
- macro_build (NULL, "nop", "");
-}
-
-/* Load an address into a register. */
-
-static void
-load_address (int reg, expressionS *ep, int *used_at)
-{
- if (ep->X_op != O_constant
- && ep->X_op != O_symbol)
- {
- as_bad (_("expression too complex"));
- ep->X_op = O_constant;
- }
-
- if (ep->X_op == O_constant)
- {
- load_register (reg, ep, HAVE_64BIT_ADDRESSES);
- return;
- }
-
- if (mips_pic == NO_PIC)
- {
- /* If this is a reference to a GP relative symbol, we want
- addiu $reg,$gp,<sym> (BFD_RELOC_GPREL16)
- Otherwise we want
- lui $reg,<sym> (BFD_RELOC_HI16_S)
- addiu $reg,$reg,<sym> (BFD_RELOC_LO16)
- If we have an addend, we always use the latter form.
-
- With 64bit address space and a usable $at we want
- lui $reg,<sym> (BFD_RELOC_MIPS_HIGHEST)
- lui $at,<sym> (BFD_RELOC_HI16_S)
- daddiu $reg,<sym> (BFD_RELOC_MIPS_HIGHER)
- daddiu $at,<sym> (BFD_RELOC_LO16)
- dsll32 $reg,0
- daddu $reg,$reg,$at
-
- If $at is already in use, we use a path which is suboptimal
- on superscalar processors.
- lui $reg,<sym> (BFD_RELOC_MIPS_HIGHEST)
- daddiu $reg,<sym> (BFD_RELOC_MIPS_HIGHER)
- dsll $reg,16
- daddiu $reg,<sym> (BFD_RELOC_HI16_S)
- dsll $reg,16
- daddiu $reg,<sym> (BFD_RELOC_LO16)
-
- For GP relative symbols in 64bit address space we can use
- the same sequence as in 32bit address space. */
- if (HAVE_64BIT_SYMBOLS)
- {
- if ((valueT) ep->X_add_number <= MAX_GPREL_OFFSET
- && !nopic_need_relax (ep->X_add_symbol, 1))
- {
- relax_start (ep->X_add_symbol);
- macro_build (ep, ADDRESS_ADDI_INSN, "t,r,j", reg,
- mips_gp_register, BFD_RELOC_GPREL16);
- relax_switch ();
- }
-
- if (*used_at == 0 && mips_opts.at)
- {
- macro_build (ep, "lui", "t,u", reg, BFD_RELOC_MIPS_HIGHEST);
- macro_build (ep, "lui", "t,u", AT, BFD_RELOC_HI16_S);
- macro_build (ep, "daddiu", "t,r,j", reg, reg,
- BFD_RELOC_MIPS_HIGHER);
- macro_build (ep, "daddiu", "t,r,j", AT, AT, BFD_RELOC_LO16);
- macro_build (NULL, "dsll32", "d,w,<", reg, reg, 0);
- macro_build (NULL, "daddu", "d,v,t", reg, reg, AT);
- *used_at = 1;
- }
- else
- {
- macro_build (ep, "lui", "t,u", reg, BFD_RELOC_MIPS_HIGHEST);
- macro_build (ep, "daddiu", "t,r,j", reg, reg,
- BFD_RELOC_MIPS_HIGHER);
- macro_build (NULL, "dsll", "d,w,<", reg, reg, 16);
- macro_build (ep, "daddiu", "t,r,j", reg, reg, BFD_RELOC_HI16_S);
- macro_build (NULL, "dsll", "d,w,<", reg, reg, 16);
- macro_build (ep, "daddiu", "t,r,j", reg, reg, BFD_RELOC_LO16);
- }
-
- if (mips_relax.sequence)
- relax_end ();
- }
- else
- {
- if ((valueT) ep->X_add_number <= MAX_GPREL_OFFSET
- && !nopic_need_relax (ep->X_add_symbol, 1))
- {
- relax_start (ep->X_add_symbol);
- macro_build (ep, ADDRESS_ADDI_INSN, "t,r,j", reg,
- mips_gp_register, BFD_RELOC_GPREL16);
- relax_switch ();
- }
- macro_build_lui (ep, reg);
- macro_build (ep, ADDRESS_ADDI_INSN, "t,r,j",
- reg, reg, BFD_RELOC_LO16);
- if (mips_relax.sequence)
- relax_end ();
- }
- }
- else if (!mips_big_got)
- {
- expressionS ex;
-
- /* If this is a reference to an external symbol, we want
- lw $reg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- Otherwise we want
- lw $reg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- addiu $reg,$reg,<sym> (BFD_RELOC_LO16)
- If there is a constant, it must be added in after.
-
- If we have NewABI, we want
- lw $reg,<sym+cst>($gp) (BFD_RELOC_MIPS_GOT_DISP)
- unless we're referencing a global symbol with a non-zero
- offset, in which case cst must be added separately. */
- if (HAVE_NEWABI)
- {
- if (ep->X_add_number)
- {
- ex.X_add_number = ep->X_add_number;
- ep->X_add_number = 0;
- relax_start (ep->X_add_symbol);
- macro_build (ep, ADDRESS_LOAD_INSN, "t,o(b)", reg,
- BFD_RELOC_MIPS_GOT_DISP, mips_gp_register);
- if (ex.X_add_number < -0x8000 || ex.X_add_number >= 0x8000)
- as_bad (_("PIC code offset overflow (max 16 signed bits)"));
- ex.X_op = O_constant;
- macro_build (&ex, ADDRESS_ADDI_INSN, "t,r,j",
- reg, reg, BFD_RELOC_LO16);
- ep->X_add_number = ex.X_add_number;
- relax_switch ();
- }
- macro_build (ep, ADDRESS_LOAD_INSN, "t,o(b)", reg,
- BFD_RELOC_MIPS_GOT_DISP, mips_gp_register);
- if (mips_relax.sequence)
- relax_end ();
- }
- else
- {
- ex.X_add_number = ep->X_add_number;
- ep->X_add_number = 0;
- macro_build (ep, ADDRESS_LOAD_INSN, "t,o(b)", reg,
- BFD_RELOC_MIPS_GOT16, mips_gp_register);
- load_delay_nop ();
- relax_start (ep->X_add_symbol);
- relax_switch ();
- macro_build (ep, ADDRESS_ADDI_INSN, "t,r,j", reg, reg,
- BFD_RELOC_LO16);
- relax_end ();
-
- if (ex.X_add_number != 0)
- {
- if (ex.X_add_number < -0x8000 || ex.X_add_number >= 0x8000)
- as_bad (_("PIC code offset overflow (max 16 signed bits)"));
- ex.X_op = O_constant;
- macro_build (&ex, ADDRESS_ADDI_INSN, "t,r,j",
- reg, reg, BFD_RELOC_LO16);
- }
- }
- }
- else if (mips_big_got)
- {
- expressionS ex;
-
- /* This is the large GOT case. If this is a reference to an
- external symbol, we want
- lui $reg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
- addu $reg,$reg,$gp
- lw $reg,<sym>($reg) (BFD_RELOC_MIPS_GOT_LO16)
-
- Otherwise, for a reference to a local symbol in old ABI, we want
- lw $reg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- addiu $reg,$reg,<sym> (BFD_RELOC_LO16)
- If there is a constant, it must be added in after.
-
- In the NewABI, for local symbols, with or without offsets, we want:
- lw $reg,<sym>($gp) (BFD_RELOC_MIPS_GOT_PAGE)
- addiu $reg,$reg,<sym> (BFD_RELOC_MIPS_GOT_OFST)
- */
- if (HAVE_NEWABI)
- {
- ex.X_add_number = ep->X_add_number;
- ep->X_add_number = 0;
- relax_start (ep->X_add_symbol);
- macro_build (ep, "lui", "t,u", reg, BFD_RELOC_MIPS_GOT_HI16);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- reg, reg, mips_gp_register);
- macro_build (ep, ADDRESS_LOAD_INSN, "t,o(b)",
- reg, BFD_RELOC_MIPS_GOT_LO16, reg);
- if (ex.X_add_number < -0x8000 || ex.X_add_number >= 0x8000)
- as_bad (_("PIC code offset overflow (max 16 signed bits)"));
- else if (ex.X_add_number)
- {
- ex.X_op = O_constant;
- macro_build (&ex, ADDRESS_ADDI_INSN, "t,r,j", reg, reg,
- BFD_RELOC_LO16);
- }
-
- ep->X_add_number = ex.X_add_number;
- relax_switch ();
- macro_build (ep, ADDRESS_LOAD_INSN, "t,o(b)", reg,
- BFD_RELOC_MIPS_GOT_PAGE, mips_gp_register);
- macro_build (ep, ADDRESS_ADDI_INSN, "t,r,j", reg, reg,
- BFD_RELOC_MIPS_GOT_OFST);
- relax_end ();
- }
- else
- {
- ex.X_add_number = ep->X_add_number;
- ep->X_add_number = 0;
- relax_start (ep->X_add_symbol);
- macro_build (ep, "lui", "t,u", reg, BFD_RELOC_MIPS_GOT_HI16);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- reg, reg, mips_gp_register);
- macro_build (ep, ADDRESS_LOAD_INSN, "t,o(b)",
- reg, BFD_RELOC_MIPS_GOT_LO16, reg);
- relax_switch ();
- if (reg_needs_delay (mips_gp_register))
- {
- /* We need a nop before loading from $gp. This special
- check is required because the lui which starts the main
- instruction stream does not refer to $gp, and so will not
- insert the nop which may be required. */
- macro_build (NULL, "nop", "");
- }
- macro_build (ep, ADDRESS_LOAD_INSN, "t,o(b)", reg,
- BFD_RELOC_MIPS_GOT16, mips_gp_register);
- load_delay_nop ();
- macro_build (ep, ADDRESS_ADDI_INSN, "t,r,j", reg, reg,
- BFD_RELOC_LO16);
- relax_end ();
-
- if (ex.X_add_number != 0)
- {
- if (ex.X_add_number < -0x8000 || ex.X_add_number >= 0x8000)
- as_bad (_("PIC code offset overflow (max 16 signed bits)"));
- ex.X_op = O_constant;
- macro_build (&ex, ADDRESS_ADDI_INSN, "t,r,j", reg, reg,
- BFD_RELOC_LO16);
- }
- }
- }
- else
- abort ();
-
- if (!mips_opts.at && *used_at == 1)
- as_bad (_("Macro used $at after \".set noat\""));
-}
-
-/* Move the contents of register SOURCE into register DEST. */
-
-static void
-move_register (int dest, int source)
-{
- macro_build (NULL, HAVE_32BIT_GPRS ? "addu" : "daddu", "d,v,t",
- dest, source, 0);
-}
-
-/* Emit an SVR4 PIC sequence to load address LOCAL into DEST, where
- LOCAL is the sum of a symbol and a 16-bit or 32-bit displacement.
- The two alternatives are:
-
- Global symbol Local sybmol
- ------------- ------------
- lw DEST,%got(SYMBOL) lw DEST,%got(SYMBOL + OFFSET)
- ... ...
- addiu DEST,DEST,OFFSET addiu DEST,DEST,%lo(SYMBOL + OFFSET)
-
- load_got_offset emits the first instruction and add_got_offset
- emits the second for a 16-bit offset or add_got_offset_hilo emits
- a sequence to add a 32-bit offset using a scratch register. */
-
-static void
-load_got_offset (int dest, expressionS *local)
-{
- expressionS global;
-
- global = *local;
- global.X_add_number = 0;
-
- relax_start (local->X_add_symbol);
- macro_build (&global, ADDRESS_LOAD_INSN, "t,o(b)", dest,
- BFD_RELOC_MIPS_GOT16, mips_gp_register);
- relax_switch ();
- macro_build (local, ADDRESS_LOAD_INSN, "t,o(b)", dest,
- BFD_RELOC_MIPS_GOT16, mips_gp_register);
- relax_end ();
-}
-
-static void
-add_got_offset (int dest, expressionS *local)
-{
- expressionS global;
-
- global.X_op = O_constant;
- global.X_op_symbol = NULL;
- global.X_add_symbol = NULL;
- global.X_add_number = local->X_add_number;
-
- relax_start (local->X_add_symbol);
- macro_build (&global, ADDRESS_ADDI_INSN, "t,r,j",
- dest, dest, BFD_RELOC_LO16);
- relax_switch ();
- macro_build (local, ADDRESS_ADDI_INSN, "t,r,j", dest, dest, BFD_RELOC_LO16);
- relax_end ();
-}
-
-static void
-add_got_offset_hilo (int dest, expressionS *local, int tmp)
-{
- expressionS global;
- int hold_mips_optimize;
-
- global.X_op = O_constant;
- global.X_op_symbol = NULL;
- global.X_add_symbol = NULL;
- global.X_add_number = local->X_add_number;
-
- relax_start (local->X_add_symbol);
- load_register (tmp, &global, HAVE_64BIT_ADDRESSES);
- relax_switch ();
- /* Set mips_optimize around the lui instruction to avoid
- inserting an unnecessary nop after the lw. */
- hold_mips_optimize = mips_optimize;
- mips_optimize = 2;
- macro_build_lui (&global, tmp);
- mips_optimize = hold_mips_optimize;
- macro_build (local, ADDRESS_ADDI_INSN, "t,r,j", tmp, tmp, BFD_RELOC_LO16);
- relax_end ();
-
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", dest, dest, tmp);
-}
-
-/*
- * Build macros
- * This routine implements the seemingly endless macro or synthesized
- * instructions and addressing modes in the mips assembly language. Many
- * of these macros are simple and are similar to each other. These could
- * probably be handled by some kind of table or grammar approach instead of
- * this verbose method. Others are not simple macros but are more like
- * optimizing code generation.
- * One interesting optimization is when several store macros appear
- * consecutively that would load AT with the upper half of the same address.
- * The ensuing load upper instructions are ommited. This implies some kind
- * of global optimization. We currently only optimize within a single macro.
- * For many of the load and store macros if the address is specified as a
- * constant expression in the first 64k of memory (ie ld $2,0x4000c) we
- * first load register 'at' with zero and use it as the base register. The
- * mips assembler simply uses register $zero. Just one tiny optimization
- * we're missing.
- */
-static void
-macro (struct mips_cl_insn *ip)
-{
- unsigned int treg, sreg, dreg, breg;
- unsigned int tempreg;
- int mask;
- int used_at = 0;
- expressionS expr1;
- const char *s;
- const char *s2;
- const char *fmt;
- int likely = 0;
- int dbl = 0;
- int coproc = 0;
- int lr = 0;
- int imm = 0;
- int call = 0;
- int off;
- offsetT maxnum;
- bfd_reloc_code_real_type r;
- int hold_mips_optimize;
-
- assert (! mips_opts.mips16);
-
- treg = (ip->insn_opcode >> 16) & 0x1f;
- dreg = (ip->insn_opcode >> 11) & 0x1f;
- sreg = breg = (ip->insn_opcode >> 21) & 0x1f;
- mask = ip->insn_mo->mask;
-
- expr1.X_op = O_constant;
- expr1.X_op_symbol = NULL;
- expr1.X_add_symbol = NULL;
- expr1.X_add_number = 1;
-
- switch (mask)
- {
- case M_DABS:
- dbl = 1;
- case M_ABS:
- /* bgez $a0,.+12
- move v0,$a0
- sub v0,$zero,$a0
- */
-
- start_noreorder ();
-
- expr1.X_add_number = 8;
- macro_build (&expr1, "bgez", "s,p", sreg);
- if (dreg == sreg)
- macro_build (NULL, "nop", "", 0);
- else
- move_register (dreg, sreg);
- macro_build (NULL, dbl ? "dsub" : "sub", "d,v,t", dreg, 0, sreg);
-
- end_noreorder ();
- break;
-
- case M_ADD_I:
- s = "addi";
- s2 = "add";
- goto do_addi;
- case M_ADDU_I:
- s = "addiu";
- s2 = "addu";
- goto do_addi;
- case M_DADD_I:
- dbl = 1;
- s = "daddi";
- s2 = "dadd";
- goto do_addi;
- case M_DADDU_I:
- dbl = 1;
- s = "daddiu";
- s2 = "daddu";
- do_addi:
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number >= -0x8000
- && imm_expr.X_add_number < 0x8000)
- {
- macro_build (&imm_expr, s, "t,r,j", treg, sreg, BFD_RELOC_LO16);
- break;
- }
- used_at = 1;
- load_register (AT, &imm_expr, dbl);
- macro_build (NULL, s2, "d,v,t", treg, sreg, AT);
- break;
-
- case M_AND_I:
- s = "andi";
- s2 = "and";
- goto do_bit;
- case M_OR_I:
- s = "ori";
- s2 = "or";
- goto do_bit;
- case M_NOR_I:
- s = "";
- s2 = "nor";
- goto do_bit;
- case M_XOR_I:
- s = "xori";
- s2 = "xor";
- do_bit:
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number >= 0
- && imm_expr.X_add_number < 0x10000)
- {
- if (mask != M_NOR_I)
- macro_build (&imm_expr, s, "t,r,i", treg, sreg, BFD_RELOC_LO16);
- else
- {
- macro_build (&imm_expr, "ori", "t,r,i",
- treg, sreg, BFD_RELOC_LO16);
- macro_build (NULL, "nor", "d,v,t", treg, treg, 0);
- }
- break;
- }
-
- used_at = 1;
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (NULL, s2, "d,v,t", treg, sreg, AT);
- break;
-
- case M_BALIGN:
- switch (imm_expr.X_add_number)
- {
- case 0:
- macro_build (NULL, "nop", "");
- break;
- case 2:
- macro_build (NULL, "packrl.ph", "d,s,t", treg, treg, sreg);
- break;
- default:
- macro_build (NULL, "balign", "t,s,2", treg, sreg,
- (int)imm_expr.X_add_number);
- break;
- }
- break;
-
- case M_BEQ_I:
- s = "beq";
- goto beq_i;
- case M_BEQL_I:
- s = "beql";
- likely = 1;
- goto beq_i;
- case M_BNE_I:
- s = "bne";
- goto beq_i;
- case M_BNEL_I:
- s = "bnel";
- likely = 1;
- beq_i:
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 0)
- {
- macro_build (&offset_expr, s, "s,t,p", sreg, 0);
- break;
- }
- used_at = 1;
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (&offset_expr, s, "s,t,p", sreg, AT);
- break;
-
- case M_BGEL:
- likely = 1;
- case M_BGE:
- if (treg == 0)
- {
- macro_build (&offset_expr, likely ? "bgezl" : "bgez", "s,p", sreg);
- break;
- }
- if (sreg == 0)
- {
- macro_build (&offset_expr, likely ? "blezl" : "blez", "s,p", treg);
- break;
- }
- used_at = 1;
- macro_build (NULL, "slt", "d,v,t", AT, sreg, treg);
- macro_build (&offset_expr, likely ? "beql" : "beq", "s,t,p", AT, 0);
- break;
-
- case M_BGTL_I:
- likely = 1;
- case M_BGT_I:
- /* check for > max integer */
- maxnum = 0x7fffffff;
- if (HAVE_64BIT_GPRS && sizeof (maxnum) > 4)
- {
- maxnum <<= 16;
- maxnum |= 0xffff;
- maxnum <<= 16;
- maxnum |= 0xffff;
- }
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number >= maxnum
- && (HAVE_32BIT_GPRS || sizeof (maxnum) > 4))
- {
- do_false:
- /* result is always false */
- if (! likely)
- macro_build (NULL, "nop", "", 0);
- else
- macro_build (&offset_expr, "bnel", "s,t,p", 0, 0);
- break;
- }
- if (imm_expr.X_op != O_constant)
- as_bad (_("Unsupported large constant"));
- ++imm_expr.X_add_number;
- /* FALLTHROUGH */
- case M_BGE_I:
- case M_BGEL_I:
- if (mask == M_BGEL_I)
- likely = 1;
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 0)
- {
- macro_build (&offset_expr, likely ? "bgezl" : "bgez", "s,p", sreg);
- break;
- }
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 1)
- {
- macro_build (&offset_expr, likely ? "bgtzl" : "bgtz", "s,p", sreg);
- break;
- }
- maxnum = 0x7fffffff;
- if (HAVE_64BIT_GPRS && sizeof (maxnum) > 4)
- {
- maxnum <<= 16;
- maxnum |= 0xffff;
- maxnum <<= 16;
- maxnum |= 0xffff;
- }
- maxnum = - maxnum - 1;
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number <= maxnum
- && (HAVE_32BIT_GPRS || sizeof (maxnum) > 4))
- {
- do_true:
- /* result is always true */
- as_warn (_("Branch %s is always true"), ip->insn_mo->name);
- macro_build (&offset_expr, "b", "p");
- break;
- }
- used_at = 1;
- set_at (sreg, 0);
- macro_build (&offset_expr, likely ? "beql" : "beq", "s,t,p", AT, 0);
- break;
-
- case M_BGEUL:
- likely = 1;
- case M_BGEU:
- if (treg == 0)
- goto do_true;
- if (sreg == 0)
- {
- macro_build (&offset_expr, likely ? "beql" : "beq",
- "s,t,p", 0, treg);
- break;
- }
- used_at = 1;
- macro_build (NULL, "sltu", "d,v,t", AT, sreg, treg);
- macro_build (&offset_expr, likely ? "beql" : "beq", "s,t,p", AT, 0);
- break;
-
- case M_BGTUL_I:
- likely = 1;
- case M_BGTU_I:
- if (sreg == 0
- || (HAVE_32BIT_GPRS
- && imm_expr.X_op == O_constant
- && imm_expr.X_add_number == (offsetT) 0xffffffff))
- goto do_false;
- if (imm_expr.X_op != O_constant)
- as_bad (_("Unsupported large constant"));
- ++imm_expr.X_add_number;
- /* FALLTHROUGH */
- case M_BGEU_I:
- case M_BGEUL_I:
- if (mask == M_BGEUL_I)
- likely = 1;
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 0)
- goto do_true;
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 1)
- {
- macro_build (&offset_expr, likely ? "bnel" : "bne",
- "s,t,p", sreg, 0);
- break;
- }
- used_at = 1;
- set_at (sreg, 1);
- macro_build (&offset_expr, likely ? "beql" : "beq", "s,t,p", AT, 0);
- break;
-
- case M_BGTL:
- likely = 1;
- case M_BGT:
- if (treg == 0)
- {
- macro_build (&offset_expr, likely ? "bgtzl" : "bgtz", "s,p", sreg);
- break;
- }
- if (sreg == 0)
- {
- macro_build (&offset_expr, likely ? "bltzl" : "bltz", "s,p", treg);
- break;
- }
- used_at = 1;
- macro_build (NULL, "slt", "d,v,t", AT, treg, sreg);
- macro_build (&offset_expr, likely ? "bnel" : "bne", "s,t,p", AT, 0);
- break;
-
- case M_BGTUL:
- likely = 1;
- case M_BGTU:
- if (treg == 0)
- {
- macro_build (&offset_expr, likely ? "bnel" : "bne",
- "s,t,p", sreg, 0);
- break;
- }
- if (sreg == 0)
- goto do_false;
- used_at = 1;
- macro_build (NULL, "sltu", "d,v,t", AT, treg, sreg);
- macro_build (&offset_expr, likely ? "bnel" : "bne", "s,t,p", AT, 0);
- break;
-
- case M_BLEL:
- likely = 1;
- case M_BLE:
- if (treg == 0)
- {
- macro_build (&offset_expr, likely ? "blezl" : "blez", "s,p", sreg);
- break;
- }
- if (sreg == 0)
- {
- macro_build (&offset_expr, likely ? "bgezl" : "bgez", "s,p", treg);
- break;
- }
- used_at = 1;
- macro_build (NULL, "slt", "d,v,t", AT, treg, sreg);
- macro_build (&offset_expr, likely ? "beql" : "beq", "s,t,p", AT, 0);
- break;
-
- case M_BLEL_I:
- likely = 1;
- case M_BLE_I:
- maxnum = 0x7fffffff;
- if (HAVE_64BIT_GPRS && sizeof (maxnum) > 4)
- {
- maxnum <<= 16;
- maxnum |= 0xffff;
- maxnum <<= 16;
- maxnum |= 0xffff;
- }
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number >= maxnum
- && (HAVE_32BIT_GPRS || sizeof (maxnum) > 4))
- goto do_true;
- if (imm_expr.X_op != O_constant)
- as_bad (_("Unsupported large constant"));
- ++imm_expr.X_add_number;
- /* FALLTHROUGH */
- case M_BLT_I:
- case M_BLTL_I:
- if (mask == M_BLTL_I)
- likely = 1;
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 0)
- {
- macro_build (&offset_expr, likely ? "bltzl" : "bltz", "s,p", sreg);
- break;
- }
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 1)
- {
- macro_build (&offset_expr, likely ? "blezl" : "blez", "s,p", sreg);
- break;
- }
- used_at = 1;
- set_at (sreg, 0);
- macro_build (&offset_expr, likely ? "bnel" : "bne", "s,t,p", AT, 0);
- break;
-
- case M_BLEUL:
- likely = 1;
- case M_BLEU:
- if (treg == 0)
- {
- macro_build (&offset_expr, likely ? "beql" : "beq",
- "s,t,p", sreg, 0);
- break;
- }
- if (sreg == 0)
- goto do_true;
- used_at = 1;
- macro_build (NULL, "sltu", "d,v,t", AT, treg, sreg);
- macro_build (&offset_expr, likely ? "beql" : "beq", "s,t,p", AT, 0);
- break;
-
- case M_BLEUL_I:
- likely = 1;
- case M_BLEU_I:
- if (sreg == 0
- || (HAVE_32BIT_GPRS
- && imm_expr.X_op == O_constant
- && imm_expr.X_add_number == (offsetT) 0xffffffff))
- goto do_true;
- if (imm_expr.X_op != O_constant)
- as_bad (_("Unsupported large constant"));
- ++imm_expr.X_add_number;
- /* FALLTHROUGH */
- case M_BLTU_I:
- case M_BLTUL_I:
- if (mask == M_BLTUL_I)
- likely = 1;
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 0)
- goto do_false;
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 1)
- {
- macro_build (&offset_expr, likely ? "beql" : "beq",
- "s,t,p", sreg, 0);
- break;
- }
- used_at = 1;
- set_at (sreg, 1);
- macro_build (&offset_expr, likely ? "bnel" : "bne", "s,t,p", AT, 0);
- break;
-
- case M_BLTL:
- likely = 1;
- case M_BLT:
- if (treg == 0)
- {
- macro_build (&offset_expr, likely ? "bltzl" : "bltz", "s,p", sreg);
- break;
- }
- if (sreg == 0)
- {
- macro_build (&offset_expr, likely ? "bgtzl" : "bgtz", "s,p", treg);
- break;
- }
- used_at = 1;
- macro_build (NULL, "slt", "d,v,t", AT, sreg, treg);
- macro_build (&offset_expr, likely ? "bnel" : "bne", "s,t,p", AT, 0);
- break;
-
- case M_BLTUL:
- likely = 1;
- case M_BLTU:
- if (treg == 0)
- goto do_false;
- if (sreg == 0)
- {
- macro_build (&offset_expr, likely ? "bnel" : "bne",
- "s,t,p", 0, treg);
- break;
- }
- used_at = 1;
- macro_build (NULL, "sltu", "d,v,t", AT, sreg, treg);
- macro_build (&offset_expr, likely ? "bnel" : "bne", "s,t,p", AT, 0);
- break;
-
- case M_DEXT:
- {
- unsigned long pos;
- unsigned long size;
-
- if (imm_expr.X_op != O_constant || imm2_expr.X_op != O_constant)
- {
- as_bad (_("Unsupported large constant"));
- pos = size = 1;
- }
- else
- {
- pos = (unsigned long) imm_expr.X_add_number;
- size = (unsigned long) imm2_expr.X_add_number;
- }
-
- if (pos > 63)
- {
- as_bad (_("Improper position (%lu)"), pos);
- pos = 1;
- }
- if (size == 0 || size > 64
- || (pos + size - 1) > 63)
- {
- as_bad (_("Improper extract size (%lu, position %lu)"),
- size, pos);
- size = 1;
- }
-
- if (size <= 32 && pos < 32)
- {
- s = "dext";
- fmt = "t,r,+A,+C";
- }
- else if (size <= 32)
- {
- s = "dextu";
- fmt = "t,r,+E,+H";
- }
- else
- {
- s = "dextm";
- fmt = "t,r,+A,+G";
- }
- macro_build ((expressionS *) NULL, s, fmt, treg, sreg, pos, size - 1);
- }
- break;
-
- case M_DINS:
- {
- unsigned long pos;
- unsigned long size;
-
- if (imm_expr.X_op != O_constant || imm2_expr.X_op != O_constant)
- {
- as_bad (_("Unsupported large constant"));
- pos = size = 1;
- }
- else
- {
- pos = (unsigned long) imm_expr.X_add_number;
- size = (unsigned long) imm2_expr.X_add_number;
- }
-
- if (pos > 63)
- {
- as_bad (_("Improper position (%lu)"), pos);
- pos = 1;
- }
- if (size == 0 || size > 64
- || (pos + size - 1) > 63)
- {
- as_bad (_("Improper insert size (%lu, position %lu)"),
- size, pos);
- size = 1;
- }
-
- if (pos < 32 && (pos + size - 1) < 32)
- {
- s = "dins";
- fmt = "t,r,+A,+B";
- }
- else if (pos >= 32)
- {
- s = "dinsu";
- fmt = "t,r,+E,+F";
- }
- else
- {
- s = "dinsm";
- fmt = "t,r,+A,+F";
- }
- macro_build ((expressionS *) NULL, s, fmt, treg, sreg, pos,
- pos + size - 1);
- }
- break;
-
- case M_DDIV_3:
- dbl = 1;
- case M_DIV_3:
- s = "mflo";
- goto do_div3;
- case M_DREM_3:
- dbl = 1;
- case M_REM_3:
- s = "mfhi";
- do_div3:
- if (treg == 0)
- {
- as_warn (_("Divide by zero."));
- if (mips_trap)
- macro_build (NULL, "teq", "s,t,q", 0, 0, 7);
- else
- macro_build (NULL, "break", "c", 7);
- break;
- }
-
- start_noreorder ();
- if (mips_trap)
- {
- macro_build (NULL, "teq", "s,t,q", treg, 0, 7);
- macro_build (NULL, dbl ? "ddiv" : "div", "z,s,t", sreg, treg);
- }
- else
- {
- expr1.X_add_number = 8;
- macro_build (&expr1, "bne", "s,t,p", treg, 0);
- macro_build (NULL, dbl ? "ddiv" : "div", "z,s,t", sreg, treg);
- macro_build (NULL, "break", "c", 7);
- }
- expr1.X_add_number = -1;
- used_at = 1;
- load_register (AT, &expr1, dbl);
- expr1.X_add_number = mips_trap ? (dbl ? 12 : 8) : (dbl ? 20 : 16);
- macro_build (&expr1, "bne", "s,t,p", treg, AT);
- if (dbl)
- {
- expr1.X_add_number = 1;
- load_register (AT, &expr1, dbl);
- macro_build (NULL, "dsll32", "d,w,<", AT, AT, 31);
- }
- else
- {
- expr1.X_add_number = 0x80000000;
- macro_build (&expr1, "lui", "t,u", AT, BFD_RELOC_HI16);
- }
- if (mips_trap)
- {
- macro_build (NULL, "teq", "s,t,q", sreg, AT, 6);
- /* We want to close the noreorder block as soon as possible, so
- that later insns are available for delay slot filling. */
- end_noreorder ();
- }
- else
- {
- expr1.X_add_number = 8;
- macro_build (&expr1, "bne", "s,t,p", sreg, AT);
- macro_build (NULL, "nop", "", 0);
-
- /* We want to close the noreorder block as soon as possible, so
- that later insns are available for delay slot filling. */
- end_noreorder ();
-
- macro_build (NULL, "break", "c", 6);
- }
- macro_build (NULL, s, "d", dreg);
- break;
-
- case M_DIV_3I:
- s = "div";
- s2 = "mflo";
- goto do_divi;
- case M_DIVU_3I:
- s = "divu";
- s2 = "mflo";
- goto do_divi;
- case M_REM_3I:
- s = "div";
- s2 = "mfhi";
- goto do_divi;
- case M_REMU_3I:
- s = "divu";
- s2 = "mfhi";
- goto do_divi;
- case M_DDIV_3I:
- dbl = 1;
- s = "ddiv";
- s2 = "mflo";
- goto do_divi;
- case M_DDIVU_3I:
- dbl = 1;
- s = "ddivu";
- s2 = "mflo";
- goto do_divi;
- case M_DREM_3I:
- dbl = 1;
- s = "ddiv";
- s2 = "mfhi";
- goto do_divi;
- case M_DREMU_3I:
- dbl = 1;
- s = "ddivu";
- s2 = "mfhi";
- do_divi:
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 0)
- {
- as_warn (_("Divide by zero."));
- if (mips_trap)
- macro_build (NULL, "teq", "s,t,q", 0, 0, 7);
- else
- macro_build (NULL, "break", "c", 7);
- break;
- }
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 1)
- {
- if (strcmp (s2, "mflo") == 0)
- move_register (dreg, sreg);
- else
- move_register (dreg, 0);
- break;
- }
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number == -1
- && s[strlen (s) - 1] != 'u')
- {
- if (strcmp (s2, "mflo") == 0)
- {
- macro_build (NULL, dbl ? "dneg" : "neg", "d,w", dreg, sreg);
- }
- else
- move_register (dreg, 0);
- break;
- }
-
- used_at = 1;
- load_register (AT, &imm_expr, dbl);
- macro_build (NULL, s, "z,s,t", sreg, AT);
- macro_build (NULL, s2, "d", dreg);
- break;
-
- case M_DIVU_3:
- s = "divu";
- s2 = "mflo";
- goto do_divu3;
- case M_REMU_3:
- s = "divu";
- s2 = "mfhi";
- goto do_divu3;
- case M_DDIVU_3:
- s = "ddivu";
- s2 = "mflo";
- goto do_divu3;
- case M_DREMU_3:
- s = "ddivu";
- s2 = "mfhi";
- do_divu3:
- start_noreorder ();
- if (mips_trap)
- {
- macro_build (NULL, "teq", "s,t,q", treg, 0, 7);
- macro_build (NULL, s, "z,s,t", sreg, treg);
- /* We want to close the noreorder block as soon as possible, so
- that later insns are available for delay slot filling. */
- end_noreorder ();
- }
- else
- {
- expr1.X_add_number = 8;
- macro_build (&expr1, "bne", "s,t,p", treg, 0);
- macro_build (NULL, s, "z,s,t", sreg, treg);
-
- /* We want to close the noreorder block as soon as possible, so
- that later insns are available for delay slot filling. */
- end_noreorder ();
- macro_build (NULL, "break", "c", 7);
- }
- macro_build (NULL, s2, "d", dreg);
- break;
-
- case M_DLCA_AB:
- dbl = 1;
- case M_LCA_AB:
- call = 1;
- goto do_la;
- case M_DLA_AB:
- dbl = 1;
- case M_LA_AB:
- do_la:
- /* Load the address of a symbol into a register. If breg is not
- zero, we then add a base register to it. */
-
- if (dbl && HAVE_32BIT_GPRS)
- as_warn (_("dla used to load 32-bit register"));
-
- if (! dbl && HAVE_64BIT_OBJECTS)
- as_warn (_("la used to load 64-bit address"));
-
- if (offset_expr.X_op == O_constant
- && offset_expr.X_add_number >= -0x8000
- && offset_expr.X_add_number < 0x8000)
- {
- macro_build (&offset_expr, ADDRESS_ADDI_INSN,
- "t,r,j", treg, sreg, BFD_RELOC_LO16);
- break;
- }
-
- if (mips_opts.at && (treg == breg))
- {
- tempreg = AT;
- used_at = 1;
- }
- else
- {
- tempreg = treg;
- }
-
- if (offset_expr.X_op != O_symbol
- && offset_expr.X_op != O_constant)
- {
- as_bad (_("expression too complex"));
- offset_expr.X_op = O_constant;
- }
-
- if (offset_expr.X_op == O_constant)
- load_register (tempreg, &offset_expr, HAVE_64BIT_ADDRESSES);
- else if (mips_pic == NO_PIC)
- {
- /* If this is a reference to a GP relative symbol, we want
- addiu $tempreg,$gp,<sym> (BFD_RELOC_GPREL16)
- Otherwise we want
- lui $tempreg,<sym> (BFD_RELOC_HI16_S)
- addiu $tempreg,$tempreg,<sym> (BFD_RELOC_LO16)
- If we have a constant, we need two instructions anyhow,
- so we may as well always use the latter form.
-
- With 64bit address space and a usable $at we want
- lui $tempreg,<sym> (BFD_RELOC_MIPS_HIGHEST)
- lui $at,<sym> (BFD_RELOC_HI16_S)
- daddiu $tempreg,<sym> (BFD_RELOC_MIPS_HIGHER)
- daddiu $at,<sym> (BFD_RELOC_LO16)
- dsll32 $tempreg,0
- daddu $tempreg,$tempreg,$at
-
- If $at is already in use, we use a path which is suboptimal
- on superscalar processors.
- lui $tempreg,<sym> (BFD_RELOC_MIPS_HIGHEST)
- daddiu $tempreg,<sym> (BFD_RELOC_MIPS_HIGHER)
- dsll $tempreg,16
- daddiu $tempreg,<sym> (BFD_RELOC_HI16_S)
- dsll $tempreg,16
- daddiu $tempreg,<sym> (BFD_RELOC_LO16)
-
- For GP relative symbols in 64bit address space we can use
- the same sequence as in 32bit address space. */
- if (HAVE_64BIT_SYMBOLS)
- {
- if ((valueT) offset_expr.X_add_number <= MAX_GPREL_OFFSET
- && !nopic_need_relax (offset_expr.X_add_symbol, 1))
- {
- relax_start (offset_expr.X_add_symbol);
- macro_build (&offset_expr, ADDRESS_ADDI_INSN, "t,r,j",
- tempreg, mips_gp_register, BFD_RELOC_GPREL16);
- relax_switch ();
- }
-
- if (used_at == 0 && mips_opts.at)
- {
- macro_build (&offset_expr, "lui", "t,u",
- tempreg, BFD_RELOC_MIPS_HIGHEST);
- macro_build (&offset_expr, "lui", "t,u",
- AT, BFD_RELOC_HI16_S);
- macro_build (&offset_expr, "daddiu", "t,r,j",
- tempreg, tempreg, BFD_RELOC_MIPS_HIGHER);
- macro_build (&offset_expr, "daddiu", "t,r,j",
- AT, AT, BFD_RELOC_LO16);
- macro_build (NULL, "dsll32", "d,w,<", tempreg, tempreg, 0);
- macro_build (NULL, "daddu", "d,v,t", tempreg, tempreg, AT);
- used_at = 1;
- }
- else
- {
- macro_build (&offset_expr, "lui", "t,u",
- tempreg, BFD_RELOC_MIPS_HIGHEST);
- macro_build (&offset_expr, "daddiu", "t,r,j",
- tempreg, tempreg, BFD_RELOC_MIPS_HIGHER);
- macro_build (NULL, "dsll", "d,w,<", tempreg, tempreg, 16);
- macro_build (&offset_expr, "daddiu", "t,r,j",
- tempreg, tempreg, BFD_RELOC_HI16_S);
- macro_build (NULL, "dsll", "d,w,<", tempreg, tempreg, 16);
- macro_build (&offset_expr, "daddiu", "t,r,j",
- tempreg, tempreg, BFD_RELOC_LO16);
- }
-
- if (mips_relax.sequence)
- relax_end ();
- }
- else
- {
- if ((valueT) offset_expr.X_add_number <= MAX_GPREL_OFFSET
- && !nopic_need_relax (offset_expr.X_add_symbol, 1))
- {
- relax_start (offset_expr.X_add_symbol);
- macro_build (&offset_expr, ADDRESS_ADDI_INSN, "t,r,j",
- tempreg, mips_gp_register, BFD_RELOC_GPREL16);
- relax_switch ();
- }
- if (!IS_SEXT_32BIT_NUM (offset_expr.X_add_number))
- as_bad (_("offset too large"));
- macro_build_lui (&offset_expr, tempreg);
- macro_build (&offset_expr, ADDRESS_ADDI_INSN, "t,r,j",
- tempreg, tempreg, BFD_RELOC_LO16);
- if (mips_relax.sequence)
- relax_end ();
- }
- }
- else if (!mips_big_got && !HAVE_NEWABI)
- {
- int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT16;
-
- /* If this is a reference to an external symbol, and there
- is no constant, we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- or for lca or if tempreg is PIC_CALL_REG
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_CALL16)
- For a local symbol, we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- addiu $tempreg,$tempreg,<sym> (BFD_RELOC_LO16)
-
- If we have a small constant, and this is a reference to
- an external symbol, we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- addiu $tempreg,$tempreg,<constant>
- For a local symbol, we want the same instruction
- sequence, but we output a BFD_RELOC_LO16 reloc on the
- addiu instruction.
-
- If we have a large constant, and this is a reference to
- an external symbol, we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- lui $at,<hiconstant>
- addiu $at,$at,<loconstant>
- addu $tempreg,$tempreg,$at
- For a local symbol, we want the same instruction
- sequence, but we output a BFD_RELOC_LO16 reloc on the
- addiu instruction.
- */
-
- if (offset_expr.X_add_number == 0)
- {
- if (mips_pic == SVR4_PIC
- && breg == 0
- && (call || tempreg == PIC_CALL_REG))
- lw_reloc_type = (int) BFD_RELOC_MIPS_CALL16;
-
- relax_start (offset_expr.X_add_symbol);
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- lw_reloc_type, mips_gp_register);
- if (breg != 0)
- {
- /* We're going to put in an addu instruction using
- tempreg, so we may as well insert the nop right
- now. */
- load_delay_nop ();
- }
- relax_switch ();
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)",
- tempreg, BFD_RELOC_MIPS_GOT16, mips_gp_register);
- load_delay_nop ();
- macro_build (&offset_expr, ADDRESS_ADDI_INSN, "t,r,j",
- tempreg, tempreg, BFD_RELOC_LO16);
- relax_end ();
- /* FIXME: If breg == 0, and the next instruction uses
- $tempreg, then if this variant case is used an extra
- nop will be generated. */
- }
- else if (offset_expr.X_add_number >= -0x8000
- && offset_expr.X_add_number < 0x8000)
- {
- load_got_offset (tempreg, &offset_expr);
- load_delay_nop ();
- add_got_offset (tempreg, &offset_expr);
- }
- else
- {
- expr1.X_add_number = offset_expr.X_add_number;
- offset_expr.X_add_number =
- ((offset_expr.X_add_number + 0x8000) & 0xffff) - 0x8000;
- load_got_offset (tempreg, &offset_expr);
- offset_expr.X_add_number = expr1.X_add_number;
- /* If we are going to add in a base register, and the
- target register and the base register are the same,
- then we are using AT as a temporary register. Since
- we want to load the constant into AT, we add our
- current AT (from the global offset table) and the
- register into the register now, and pretend we were
- not using a base register. */
- if (breg == treg)
- {
- load_delay_nop ();
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- treg, AT, breg);
- breg = 0;
- tempreg = treg;
- }
- add_got_offset_hilo (tempreg, &offset_expr, AT);
- used_at = 1;
- }
- }
- else if (!mips_big_got && HAVE_NEWABI)
- {
- int add_breg_early = 0;
-
- /* If this is a reference to an external, and there is no
- constant, or local symbol (*), with or without a
- constant, we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT_DISP)
- or for lca or if tempreg is PIC_CALL_REG
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_CALL16)
-
- If we have a small constant, and this is a reference to
- an external symbol, we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT_DISP)
- addiu $tempreg,$tempreg,<constant>
-
- If we have a large constant, and this is a reference to
- an external symbol, we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT_DISP)
- lui $at,<hiconstant>
- addiu $at,$at,<loconstant>
- addu $tempreg,$tempreg,$at
-
- (*) Other assemblers seem to prefer GOT_PAGE/GOT_OFST for
- local symbols, even though it introduces an additional
- instruction. */
-
- if (offset_expr.X_add_number)
- {
- expr1.X_add_number = offset_expr.X_add_number;
- offset_expr.X_add_number = 0;
-
- relax_start (offset_expr.X_add_symbol);
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- BFD_RELOC_MIPS_GOT_DISP, mips_gp_register);
-
- if (expr1.X_add_number >= -0x8000
- && expr1.X_add_number < 0x8000)
- {
- macro_build (&expr1, ADDRESS_ADDI_INSN, "t,r,j",
- tempreg, tempreg, BFD_RELOC_LO16);
- }
- else if (IS_SEXT_32BIT_NUM (expr1.X_add_number + 0x8000))
- {
- int dreg;
-
- /* If we are going to add in a base register, and the
- target register and the base register are the same,
- then we are using AT as a temporary register. Since
- we want to load the constant into AT, we add our
- current AT (from the global offset table) and the
- register into the register now, and pretend we were
- not using a base register. */
- if (breg != treg)
- dreg = tempreg;
- else
- {
- assert (tempreg == AT);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- treg, AT, breg);
- dreg = treg;
- add_breg_early = 1;
- }
-
- load_register (AT, &expr1, HAVE_64BIT_ADDRESSES);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- dreg, dreg, AT);
-
- used_at = 1;
- }
- else
- as_bad (_("PIC code offset overflow (max 32 signed bits)"));
-
- relax_switch ();
- offset_expr.X_add_number = expr1.X_add_number;
-
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- BFD_RELOC_MIPS_GOT_DISP, mips_gp_register);
- if (add_breg_early)
- {
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- treg, tempreg, breg);
- breg = 0;
- tempreg = treg;
- }
- relax_end ();
- }
- else if (breg == 0 && (call || tempreg == PIC_CALL_REG))
- {
- relax_start (offset_expr.X_add_symbol);
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- BFD_RELOC_MIPS_CALL16, mips_gp_register);
- relax_switch ();
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- BFD_RELOC_MIPS_GOT_DISP, mips_gp_register);
- relax_end ();
- }
- else
- {
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- BFD_RELOC_MIPS_GOT_DISP, mips_gp_register);
- }
- }
- else if (mips_big_got && !HAVE_NEWABI)
- {
- int gpdelay;
- int lui_reloc_type = (int) BFD_RELOC_MIPS_GOT_HI16;
- int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT_LO16;
- int local_reloc_type = (int) BFD_RELOC_MIPS_GOT16;
-
- /* This is the large GOT case. If this is a reference to an
- external symbol, and there is no constant, we want
- lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
- addu $tempreg,$tempreg,$gp
- lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_LO16)
- or for lca or if tempreg is PIC_CALL_REG
- lui $tempreg,<sym> (BFD_RELOC_MIPS_CALL_HI16)
- addu $tempreg,$tempreg,$gp
- lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_CALL_LO16)
- For a local symbol, we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- addiu $tempreg,$tempreg,<sym> (BFD_RELOC_LO16)
-
- If we have a small constant, and this is a reference to
- an external symbol, we want
- lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
- addu $tempreg,$tempreg,$gp
- lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_LO16)
- nop
- addiu $tempreg,$tempreg,<constant>
- For a local symbol, we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- addiu $tempreg,$tempreg,<constant> (BFD_RELOC_LO16)
-
- If we have a large constant, and this is a reference to
- an external symbol, we want
- lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
- addu $tempreg,$tempreg,$gp
- lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_LO16)
- lui $at,<hiconstant>
- addiu $at,$at,<loconstant>
- addu $tempreg,$tempreg,$at
- For a local symbol, we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- lui $at,<hiconstant>
- addiu $at,$at,<loconstant> (BFD_RELOC_LO16)
- addu $tempreg,$tempreg,$at
- */
-
- expr1.X_add_number = offset_expr.X_add_number;
- offset_expr.X_add_number = 0;
- relax_start (offset_expr.X_add_symbol);
- gpdelay = reg_needs_delay (mips_gp_register);
- if (expr1.X_add_number == 0 && breg == 0
- && (call || tempreg == PIC_CALL_REG))
- {
- lui_reloc_type = (int) BFD_RELOC_MIPS_CALL_HI16;
- lw_reloc_type = (int) BFD_RELOC_MIPS_CALL_LO16;
- }
- macro_build (&offset_expr, "lui", "t,u", tempreg, lui_reloc_type);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- tempreg, tempreg, mips_gp_register);
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)",
- tempreg, lw_reloc_type, tempreg);
- if (expr1.X_add_number == 0)
- {
- if (breg != 0)
- {
- /* We're going to put in an addu instruction using
- tempreg, so we may as well insert the nop right
- now. */
- load_delay_nop ();
- }
- }
- else if (expr1.X_add_number >= -0x8000
- && expr1.X_add_number < 0x8000)
- {
- load_delay_nop ();
- macro_build (&expr1, ADDRESS_ADDI_INSN, "t,r,j",
- tempreg, tempreg, BFD_RELOC_LO16);
- }
- else
- {
- int dreg;
-
- /* If we are going to add in a base register, and the
- target register and the base register are the same,
- then we are using AT as a temporary register. Since
- we want to load the constant into AT, we add our
- current AT (from the global offset table) and the
- register into the register now, and pretend we were
- not using a base register. */
- if (breg != treg)
- dreg = tempreg;
- else
- {
- assert (tempreg == AT);
- load_delay_nop ();
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- treg, AT, breg);
- dreg = treg;
- }
-
- load_register (AT, &expr1, HAVE_64BIT_ADDRESSES);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", dreg, dreg, AT);
-
- used_at = 1;
- }
- offset_expr.X_add_number =
- ((expr1.X_add_number + 0x8000) & 0xffff) - 0x8000;
- relax_switch ();
-
- if (gpdelay)
- {
- /* This is needed because this instruction uses $gp, but
- the first instruction on the main stream does not. */
- macro_build (NULL, "nop", "");
- }
-
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- local_reloc_type, mips_gp_register);
- if (expr1.X_add_number >= -0x8000
- && expr1.X_add_number < 0x8000)
- {
- load_delay_nop ();
- macro_build (&offset_expr, ADDRESS_ADDI_INSN, "t,r,j",
- tempreg, tempreg, BFD_RELOC_LO16);
- /* FIXME: If add_number is 0, and there was no base
- register, the external symbol case ended with a load,
- so if the symbol turns out to not be external, and
- the next instruction uses tempreg, an unnecessary nop
- will be inserted. */
- }
- else
- {
- if (breg == treg)
- {
- /* We must add in the base register now, as in the
- external symbol case. */
- assert (tempreg == AT);
- load_delay_nop ();
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- treg, AT, breg);
- tempreg = treg;
- /* We set breg to 0 because we have arranged to add
- it in in both cases. */
- breg = 0;
- }
-
- macro_build_lui (&expr1, AT);
- macro_build (&offset_expr, ADDRESS_ADDI_INSN, "t,r,j",
- AT, AT, BFD_RELOC_LO16);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- tempreg, tempreg, AT);
- used_at = 1;
- }
- relax_end ();
- }
- else if (mips_big_got && HAVE_NEWABI)
- {
- int lui_reloc_type = (int) BFD_RELOC_MIPS_GOT_HI16;
- int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT_LO16;
- int add_breg_early = 0;
-
- /* This is the large GOT case. If this is a reference to an
- external symbol, and there is no constant, we want
- lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
- add $tempreg,$tempreg,$gp
- lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_LO16)
- or for lca or if tempreg is PIC_CALL_REG
- lui $tempreg,<sym> (BFD_RELOC_MIPS_CALL_HI16)
- add $tempreg,$tempreg,$gp
- lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_CALL_LO16)
-
- If we have a small constant, and this is a reference to
- an external symbol, we want
- lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
- add $tempreg,$tempreg,$gp
- lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_LO16)
- addi $tempreg,$tempreg,<constant>
-
- If we have a large constant, and this is a reference to
- an external symbol, we want
- lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
- addu $tempreg,$tempreg,$gp
- lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_LO16)
- lui $at,<hiconstant>
- addi $at,$at,<loconstant>
- add $tempreg,$tempreg,$at
-
- If we have NewABI, and we know it's a local symbol, we want
- lw $reg,<sym>($gp) (BFD_RELOC_MIPS_GOT_PAGE)
- addiu $reg,$reg,<sym> (BFD_RELOC_MIPS_GOT_OFST)
- otherwise we have to resort to GOT_HI16/GOT_LO16. */
-
- relax_start (offset_expr.X_add_symbol);
-
- expr1.X_add_number = offset_expr.X_add_number;
- offset_expr.X_add_number = 0;
-
- if (expr1.X_add_number == 0 && breg == 0
- && (call || tempreg == PIC_CALL_REG))
- {
- lui_reloc_type = (int) BFD_RELOC_MIPS_CALL_HI16;
- lw_reloc_type = (int) BFD_RELOC_MIPS_CALL_LO16;
- }
- macro_build (&offset_expr, "lui", "t,u", tempreg, lui_reloc_type);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- tempreg, tempreg, mips_gp_register);
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)",
- tempreg, lw_reloc_type, tempreg);
-
- if (expr1.X_add_number == 0)
- ;
- else if (expr1.X_add_number >= -0x8000
- && expr1.X_add_number < 0x8000)
- {
- macro_build (&expr1, ADDRESS_ADDI_INSN, "t,r,j",
- tempreg, tempreg, BFD_RELOC_LO16);
- }
- else if (IS_SEXT_32BIT_NUM (expr1.X_add_number + 0x8000))
- {
- int dreg;
-
- /* If we are going to add in a base register, and the
- target register and the base register are the same,
- then we are using AT as a temporary register. Since
- we want to load the constant into AT, we add our
- current AT (from the global offset table) and the
- register into the register now, and pretend we were
- not using a base register. */
- if (breg != treg)
- dreg = tempreg;
- else
- {
- assert (tempreg == AT);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- treg, AT, breg);
- dreg = treg;
- add_breg_early = 1;
- }
-
- load_register (AT, &expr1, HAVE_64BIT_ADDRESSES);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", dreg, dreg, AT);
-
- used_at = 1;
- }
- else
- as_bad (_("PIC code offset overflow (max 32 signed bits)"));
-
- relax_switch ();
- offset_expr.X_add_number = expr1.X_add_number;
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- BFD_RELOC_MIPS_GOT_PAGE, mips_gp_register);
- macro_build (&offset_expr, ADDRESS_ADDI_INSN, "t,r,j", tempreg,
- tempreg, BFD_RELOC_MIPS_GOT_OFST);
- if (add_breg_early)
- {
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- treg, tempreg, breg);
- breg = 0;
- tempreg = treg;
- }
- relax_end ();
- }
- else
- abort ();
-
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", treg, tempreg, breg);
- break;
-
- case M_J_A:
- /* The j instruction may not be used in PIC code, since it
- requires an absolute address. We convert it to a b
- instruction. */
- if (mips_pic == NO_PIC)
- macro_build (&offset_expr, "j", "a");
- else
- macro_build (&offset_expr, "b", "p");
- break;
-
- /* The jal instructions must be handled as macros because when
- generating PIC code they expand to multi-instruction
- sequences. Normally they are simple instructions. */
- case M_JAL_1:
- dreg = RA;
- /* Fall through. */
- case M_JAL_2:
- if (mips_pic == NO_PIC)
- macro_build (NULL, "jalr", "d,s", dreg, sreg);
- else
- {
- if (sreg != PIC_CALL_REG)
- as_warn (_("MIPS PIC call to register other than $25"));
-
- macro_build (NULL, "jalr", "d,s", dreg, sreg);
- if (mips_pic == SVR4_PIC && !HAVE_NEWABI)
- {
- if (mips_cprestore_offset < 0)
- as_warn (_("No .cprestore pseudo-op used in PIC code"));
- else
- {
- if (! mips_frame_reg_valid)
- {
- as_warn (_("No .frame pseudo-op used in PIC code"));
- /* Quiet this warning. */
- mips_frame_reg_valid = 1;
- }
- if (! mips_cprestore_valid)
- {
- as_warn (_("No .cprestore pseudo-op used in PIC code"));
- /* Quiet this warning. */
- mips_cprestore_valid = 1;
- }
- expr1.X_add_number = mips_cprestore_offset;
- macro_build_ldst_constoffset (&expr1, ADDRESS_LOAD_INSN,
- mips_gp_register,
- mips_frame_reg,
- HAVE_64BIT_ADDRESSES);
- }
- }
- }
-
- break;
-
- case M_JAL_A:
- if (mips_pic == NO_PIC)
- macro_build (&offset_expr, "jal", "a");
- else if (mips_pic == SVR4_PIC)
- {
- /* If this is a reference to an external symbol, and we are
- using a small GOT, we want
- lw $25,<sym>($gp) (BFD_RELOC_MIPS_CALL16)
- nop
- jalr $ra,$25
- nop
- lw $gp,cprestore($sp)
- The cprestore value is set using the .cprestore
- pseudo-op. If we are using a big GOT, we want
- lui $25,<sym> (BFD_RELOC_MIPS_CALL_HI16)
- addu $25,$25,$gp
- lw $25,<sym>($25) (BFD_RELOC_MIPS_CALL_LO16)
- nop
- jalr $ra,$25
- nop
- lw $gp,cprestore($sp)
- If the symbol is not external, we want
- lw $25,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- addiu $25,$25,<sym> (BFD_RELOC_LO16)
- jalr $ra,$25
- nop
- lw $gp,cprestore($sp)
-
- For NewABI, we use the same CALL16 or CALL_HI16/CALL_LO16
- sequences above, minus nops, unless the symbol is local,
- which enables us to use GOT_PAGE/GOT_OFST (big got) or
- GOT_DISP. */
- if (HAVE_NEWABI)
- {
- if (! mips_big_got)
- {
- relax_start (offset_expr.X_add_symbol);
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)",
- PIC_CALL_REG, BFD_RELOC_MIPS_CALL16,
- mips_gp_register);
- relax_switch ();
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)",
- PIC_CALL_REG, BFD_RELOC_MIPS_GOT_DISP,
- mips_gp_register);
- relax_end ();
- }
- else
- {
- relax_start (offset_expr.X_add_symbol);
- macro_build (&offset_expr, "lui", "t,u", PIC_CALL_REG,
- BFD_RELOC_MIPS_CALL_HI16);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", PIC_CALL_REG,
- PIC_CALL_REG, mips_gp_register);
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)",
- PIC_CALL_REG, BFD_RELOC_MIPS_CALL_LO16,
- PIC_CALL_REG);
- relax_switch ();
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)",
- PIC_CALL_REG, BFD_RELOC_MIPS_GOT_PAGE,
- mips_gp_register);
- macro_build (&offset_expr, ADDRESS_ADDI_INSN, "t,r,j",
- PIC_CALL_REG, PIC_CALL_REG,
- BFD_RELOC_MIPS_GOT_OFST);
- relax_end ();
- }
-
- macro_build_jalr (&offset_expr);
- }
- else
- {
- relax_start (offset_expr.X_add_symbol);
- if (! mips_big_got)
- {
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)",
- PIC_CALL_REG, BFD_RELOC_MIPS_CALL16,
- mips_gp_register);
- load_delay_nop ();
- relax_switch ();
- }
- else
- {
- int gpdelay;
-
- gpdelay = reg_needs_delay (mips_gp_register);
- macro_build (&offset_expr, "lui", "t,u", PIC_CALL_REG,
- BFD_RELOC_MIPS_CALL_HI16);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", PIC_CALL_REG,
- PIC_CALL_REG, mips_gp_register);
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)",
- PIC_CALL_REG, BFD_RELOC_MIPS_CALL_LO16,
- PIC_CALL_REG);
- load_delay_nop ();
- relax_switch ();
- if (gpdelay)
- macro_build (NULL, "nop", "");
- }
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)",
- PIC_CALL_REG, BFD_RELOC_MIPS_GOT16,
- mips_gp_register);
- load_delay_nop ();
- macro_build (&offset_expr, ADDRESS_ADDI_INSN, "t,r,j",
- PIC_CALL_REG, PIC_CALL_REG, BFD_RELOC_LO16);
- relax_end ();
- macro_build_jalr (&offset_expr);
-
- if (mips_cprestore_offset < 0)
- as_warn (_("No .cprestore pseudo-op used in PIC code"));
- else
- {
- if (! mips_frame_reg_valid)
- {
- as_warn (_("No .frame pseudo-op used in PIC code"));
- /* Quiet this warning. */
- mips_frame_reg_valid = 1;
- }
- if (! mips_cprestore_valid)
- {
- as_warn (_("No .cprestore pseudo-op used in PIC code"));
- /* Quiet this warning. */
- mips_cprestore_valid = 1;
- }
- if (mips_opts.noreorder)
- macro_build (NULL, "nop", "");
- expr1.X_add_number = mips_cprestore_offset;
- macro_build_ldst_constoffset (&expr1, ADDRESS_LOAD_INSN,
- mips_gp_register,
- mips_frame_reg,
- HAVE_64BIT_ADDRESSES);
- }
- }
- }
- else if (mips_pic == VXWORKS_PIC)
- as_bad (_("Non-PIC jump used in PIC library"));
- else
- abort ();
-
- break;
-
- case M_LB_AB:
- s = "lb";
- goto ld;
- case M_LBU_AB:
- s = "lbu";
- goto ld;
- case M_LH_AB:
- s = "lh";
- goto ld;
- case M_LHU_AB:
- s = "lhu";
- goto ld;
- case M_LW_AB:
- s = "lw";
- goto ld;
- case M_LWC0_AB:
- s = "lwc0";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto ld;
- case M_LWC1_AB:
- s = "lwc1";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto ld;
- case M_LWC2_AB:
- s = "lwc2";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto ld;
- case M_LWC3_AB:
- s = "lwc3";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto ld;
- case M_LWL_AB:
- s = "lwl";
- lr = 1;
- goto ld;
- case M_LWR_AB:
- s = "lwr";
- lr = 1;
- goto ld;
- case M_LDC1_AB:
- s = "ldc1";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto ld;
- case M_LDC2_AB:
- s = "ldc2";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto ld;
- case M_LDC3_AB:
- s = "ldc3";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto ld;
- case M_LDL_AB:
- s = "ldl";
- lr = 1;
- goto ld;
- case M_LDR_AB:
- s = "ldr";
- lr = 1;
- goto ld;
- case M_LL_AB:
- s = "ll";
- goto ld;
- case M_LLD_AB:
- s = "lld";
- goto ld;
- case M_LWU_AB:
- s = "lwu";
- ld:
- if (breg == treg || coproc || lr)
- {
- tempreg = AT;
- used_at = 1;
- }
- else
- {
- tempreg = treg;
- }
- goto ld_st;
- case M_SB_AB:
- s = "sb";
- goto st;
- case M_SH_AB:
- s = "sh";
- goto st;
- case M_SW_AB:
- s = "sw";
- goto st;
- case M_SWC0_AB:
- s = "swc0";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto st;
- case M_SWC1_AB:
- s = "swc1";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto st;
- case M_SWC2_AB:
- s = "swc2";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto st;
- case M_SWC3_AB:
- s = "swc3";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto st;
- case M_SWL_AB:
- s = "swl";
- goto st;
- case M_SWR_AB:
- s = "swr";
- goto st;
- case M_SC_AB:
- s = "sc";
- goto st;
- case M_SCD_AB:
- s = "scd";
- goto st;
- case M_CACHE_AB:
- s = "cache";
- goto st;
- case M_SDC1_AB:
- s = "sdc1";
- coproc = 1;
- /* Itbl support may require additional care here. */
- goto st;
- case M_SDC2_AB:
- s = "sdc2";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto st;
- case M_SDC3_AB:
- s = "sdc3";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto st;
- case M_SDL_AB:
- s = "sdl";
- goto st;
- case M_SDR_AB:
- s = "sdr";
- st:
- tempreg = AT;
- used_at = 1;
- ld_st:
- if (coproc
- && NO_ISA_COP (mips_opts.arch)
- && (ip->insn_mo->pinfo2 & (INSN2_M_FP_S | INSN2_M_FP_D)) == 0)
- {
- as_bad (_("opcode not supported on this processor: %s"),
- mips_cpu_info_from_arch (mips_opts.arch)->name);
- break;
- }
-
- /* Itbl support may require additional care here. */
- if (mask == M_LWC1_AB
- || mask == M_SWC1_AB
- || mask == M_LDC1_AB
- || mask == M_SDC1_AB
- || mask == M_L_DAB
- || mask == M_S_DAB)
- fmt = "T,o(b)";
- else if (mask == M_CACHE_AB)
- fmt = "k,o(b)";
- else if (coproc)
- fmt = "E,o(b)";
- else
- fmt = "t,o(b)";
-
- if (offset_expr.X_op != O_constant
- && offset_expr.X_op != O_symbol)
- {
- as_bad (_("expression too complex"));
- offset_expr.X_op = O_constant;
- }
-
- if (HAVE_32BIT_ADDRESSES
- && !IS_SEXT_32BIT_NUM (offset_expr.X_add_number))
- {
- char value [32];
-
- sprintf_vma (value, offset_expr.X_add_number);
- as_bad (_("Number (0x%s) larger than 32 bits"), value);
- }
-
- /* A constant expression in PIC code can be handled just as it
- is in non PIC code. */
- if (offset_expr.X_op == O_constant)
- {
- expr1.X_add_number = ((offset_expr.X_add_number + 0x8000)
- & ~(bfd_vma) 0xffff);
- normalize_address_expr (&expr1);
- load_register (tempreg, &expr1, HAVE_64BIT_ADDRESSES);
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- tempreg, tempreg, breg);
- macro_build (&offset_expr, s, fmt, treg, BFD_RELOC_LO16, tempreg);
- }
- else if (mips_pic == NO_PIC)
- {
- /* If this is a reference to a GP relative symbol, and there
- is no base register, we want
- <op> $treg,<sym>($gp) (BFD_RELOC_GPREL16)
- Otherwise, if there is no base register, we want
- lui $tempreg,<sym> (BFD_RELOC_HI16_S)
- <op> $treg,<sym>($tempreg) (BFD_RELOC_LO16)
- If we have a constant, we need two instructions anyhow,
- so we always use the latter form.
-
- If we have a base register, and this is a reference to a
- GP relative symbol, we want
- addu $tempreg,$breg,$gp
- <op> $treg,<sym>($tempreg) (BFD_RELOC_GPREL16)
- Otherwise we want
- lui $tempreg,<sym> (BFD_RELOC_HI16_S)
- addu $tempreg,$tempreg,$breg
- <op> $treg,<sym>($tempreg) (BFD_RELOC_LO16)
- With a constant we always use the latter case.
-
- With 64bit address space and no base register and $at usable,
- we want
- lui $tempreg,<sym> (BFD_RELOC_MIPS_HIGHEST)
- lui $at,<sym> (BFD_RELOC_HI16_S)
- daddiu $tempreg,<sym> (BFD_RELOC_MIPS_HIGHER)
- dsll32 $tempreg,0
- daddu $tempreg,$at
- <op> $treg,<sym>($tempreg) (BFD_RELOC_LO16)
- If we have a base register, we want
- lui $tempreg,<sym> (BFD_RELOC_MIPS_HIGHEST)
- lui $at,<sym> (BFD_RELOC_HI16_S)
- daddiu $tempreg,<sym> (BFD_RELOC_MIPS_HIGHER)
- daddu $at,$breg
- dsll32 $tempreg,0
- daddu $tempreg,$at
- <op> $treg,<sym>($tempreg) (BFD_RELOC_LO16)
-
- Without $at we can't generate the optimal path for superscalar
- processors here since this would require two temporary registers.
- lui $tempreg,<sym> (BFD_RELOC_MIPS_HIGHEST)
- daddiu $tempreg,<sym> (BFD_RELOC_MIPS_HIGHER)
- dsll $tempreg,16
- daddiu $tempreg,<sym> (BFD_RELOC_HI16_S)
- dsll $tempreg,16
- <op> $treg,<sym>($tempreg) (BFD_RELOC_LO16)
- If we have a base register, we want
- lui $tempreg,<sym> (BFD_RELOC_MIPS_HIGHEST)
- daddiu $tempreg,<sym> (BFD_RELOC_MIPS_HIGHER)
- dsll $tempreg,16
- daddiu $tempreg,<sym> (BFD_RELOC_HI16_S)
- dsll $tempreg,16
- daddu $tempreg,$tempreg,$breg
- <op> $treg,<sym>($tempreg) (BFD_RELOC_LO16)
-
- For GP relative symbols in 64bit address space we can use
- the same sequence as in 32bit address space. */
- if (HAVE_64BIT_SYMBOLS)
- {
- if ((valueT) offset_expr.X_add_number <= MAX_GPREL_OFFSET
- && !nopic_need_relax (offset_expr.X_add_symbol, 1))
- {
- relax_start (offset_expr.X_add_symbol);
- if (breg == 0)
- {
- macro_build (&offset_expr, s, fmt, treg,
- BFD_RELOC_GPREL16, mips_gp_register);
- }
- else
- {
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- tempreg, breg, mips_gp_register);
- macro_build (&offset_expr, s, fmt, treg,
- BFD_RELOC_GPREL16, tempreg);
- }
- relax_switch ();
- }
-
- if (used_at == 0 && mips_opts.at)
- {
- macro_build (&offset_expr, "lui", "t,u", tempreg,
- BFD_RELOC_MIPS_HIGHEST);
- macro_build (&offset_expr, "lui", "t,u", AT,
- BFD_RELOC_HI16_S);
- macro_build (&offset_expr, "daddiu", "t,r,j", tempreg,
- tempreg, BFD_RELOC_MIPS_HIGHER);
- if (breg != 0)
- macro_build (NULL, "daddu", "d,v,t", AT, AT, breg);
- macro_build (NULL, "dsll32", "d,w,<", tempreg, tempreg, 0);
- macro_build (NULL, "daddu", "d,v,t", tempreg, tempreg, AT);
- macro_build (&offset_expr, s, fmt, treg, BFD_RELOC_LO16,
- tempreg);
- used_at = 1;
- }
- else
- {
- macro_build (&offset_expr, "lui", "t,u", tempreg,
- BFD_RELOC_MIPS_HIGHEST);
- macro_build (&offset_expr, "daddiu", "t,r,j", tempreg,
- tempreg, BFD_RELOC_MIPS_HIGHER);
- macro_build (NULL, "dsll", "d,w,<", tempreg, tempreg, 16);
- macro_build (&offset_expr, "daddiu", "t,r,j", tempreg,
- tempreg, BFD_RELOC_HI16_S);
- macro_build (NULL, "dsll", "d,w,<", tempreg, tempreg, 16);
- if (breg != 0)
- macro_build (NULL, "daddu", "d,v,t",
- tempreg, tempreg, breg);
- macro_build (&offset_expr, s, fmt, treg,
- BFD_RELOC_LO16, tempreg);
- }
-
- if (mips_relax.sequence)
- relax_end ();
- break;
- }
-
- if (breg == 0)
- {
- if ((valueT) offset_expr.X_add_number <= MAX_GPREL_OFFSET
- && !nopic_need_relax (offset_expr.X_add_symbol, 1))
- {
- relax_start (offset_expr.X_add_symbol);
- macro_build (&offset_expr, s, fmt, treg, BFD_RELOC_GPREL16,
- mips_gp_register);
- relax_switch ();
- }
- macro_build_lui (&offset_expr, tempreg);
- macro_build (&offset_expr, s, fmt, treg,
- BFD_RELOC_LO16, tempreg);
- if (mips_relax.sequence)
- relax_end ();
- }
- else
- {
- if ((valueT) offset_expr.X_add_number <= MAX_GPREL_OFFSET
- && !nopic_need_relax (offset_expr.X_add_symbol, 1))
- {
- relax_start (offset_expr.X_add_symbol);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- tempreg, breg, mips_gp_register);
- macro_build (&offset_expr, s, fmt, treg,
- BFD_RELOC_GPREL16, tempreg);
- relax_switch ();
- }
- macro_build_lui (&offset_expr, tempreg);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- tempreg, tempreg, breg);
- macro_build (&offset_expr, s, fmt, treg,
- BFD_RELOC_LO16, tempreg);
- if (mips_relax.sequence)
- relax_end ();
- }
- }
- else if (!mips_big_got)
- {
- int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT16;
-
- /* If this is a reference to an external symbol, we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- <op> $treg,0($tempreg)
- Otherwise we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- addiu $tempreg,$tempreg,<sym> (BFD_RELOC_LO16)
- <op> $treg,0($tempreg)
-
- For NewABI, we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT_PAGE)
- <op> $treg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_OFST)
-
- If there is a base register, we add it to $tempreg before
- the <op>. If there is a constant, we stick it in the
- <op> instruction. We don't handle constants larger than
- 16 bits, because we have no way to load the upper 16 bits
- (actually, we could handle them for the subset of cases
- in which we are not using $at). */
- assert (offset_expr.X_op == O_symbol);
- if (HAVE_NEWABI)
- {
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- BFD_RELOC_MIPS_GOT_PAGE, mips_gp_register);
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- tempreg, tempreg, breg);
- macro_build (&offset_expr, s, fmt, treg,
- BFD_RELOC_MIPS_GOT_OFST, tempreg);
- break;
- }
- expr1.X_add_number = offset_expr.X_add_number;
- offset_expr.X_add_number = 0;
- if (expr1.X_add_number < -0x8000
- || expr1.X_add_number >= 0x8000)
- as_bad (_("PIC code offset overflow (max 16 signed bits)"));
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- lw_reloc_type, mips_gp_register);
- load_delay_nop ();
- relax_start (offset_expr.X_add_symbol);
- relax_switch ();
- macro_build (&offset_expr, ADDRESS_ADDI_INSN, "t,r,j", tempreg,
- tempreg, BFD_RELOC_LO16);
- relax_end ();
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- tempreg, tempreg, breg);
- macro_build (&expr1, s, fmt, treg, BFD_RELOC_LO16, tempreg);
- }
- else if (mips_big_got && !HAVE_NEWABI)
- {
- int gpdelay;
-
- /* If this is a reference to an external symbol, we want
- lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
- addu $tempreg,$tempreg,$gp
- lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_LO16)
- <op> $treg,0($tempreg)
- Otherwise we want
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- addiu $tempreg,$tempreg,<sym> (BFD_RELOC_LO16)
- <op> $treg,0($tempreg)
- If there is a base register, we add it to $tempreg before
- the <op>. If there is a constant, we stick it in the
- <op> instruction. We don't handle constants larger than
- 16 bits, because we have no way to load the upper 16 bits
- (actually, we could handle them for the subset of cases
- in which we are not using $at). */
- assert (offset_expr.X_op == O_symbol);
- expr1.X_add_number = offset_expr.X_add_number;
- offset_expr.X_add_number = 0;
- if (expr1.X_add_number < -0x8000
- || expr1.X_add_number >= 0x8000)
- as_bad (_("PIC code offset overflow (max 16 signed bits)"));
- gpdelay = reg_needs_delay (mips_gp_register);
- relax_start (offset_expr.X_add_symbol);
- macro_build (&offset_expr, "lui", "t,u", tempreg,
- BFD_RELOC_MIPS_GOT_HI16);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", tempreg, tempreg,
- mips_gp_register);
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- BFD_RELOC_MIPS_GOT_LO16, tempreg);
- relax_switch ();
- if (gpdelay)
- macro_build (NULL, "nop", "");
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- BFD_RELOC_MIPS_GOT16, mips_gp_register);
- load_delay_nop ();
- macro_build (&offset_expr, ADDRESS_ADDI_INSN, "t,r,j", tempreg,
- tempreg, BFD_RELOC_LO16);
- relax_end ();
-
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- tempreg, tempreg, breg);
- macro_build (&expr1, s, fmt, treg, BFD_RELOC_LO16, tempreg);
- }
- else if (mips_big_got && HAVE_NEWABI)
- {
- /* If this is a reference to an external symbol, we want
- lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
- add $tempreg,$tempreg,$gp
- lw $tempreg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_LO16)
- <op> $treg,<ofst>($tempreg)
- Otherwise, for local symbols, we want:
- lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT_PAGE)
- <op> $treg,<sym>($tempreg) (BFD_RELOC_MIPS_GOT_OFST) */
- assert (offset_expr.X_op == O_symbol);
- expr1.X_add_number = offset_expr.X_add_number;
- offset_expr.X_add_number = 0;
- if (expr1.X_add_number < -0x8000
- || expr1.X_add_number >= 0x8000)
- as_bad (_("PIC code offset overflow (max 16 signed bits)"));
- relax_start (offset_expr.X_add_symbol);
- macro_build (&offset_expr, "lui", "t,u", tempreg,
- BFD_RELOC_MIPS_GOT_HI16);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", tempreg, tempreg,
- mips_gp_register);
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- BFD_RELOC_MIPS_GOT_LO16, tempreg);
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- tempreg, tempreg, breg);
- macro_build (&expr1, s, fmt, treg, BFD_RELOC_LO16, tempreg);
-
- relax_switch ();
- offset_expr.X_add_number = expr1.X_add_number;
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
- BFD_RELOC_MIPS_GOT_PAGE, mips_gp_register);
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- tempreg, tempreg, breg);
- macro_build (&offset_expr, s, fmt, treg,
- BFD_RELOC_MIPS_GOT_OFST, tempreg);
- relax_end ();
- }
- else
- abort ();
-
- break;
-
- case M_LI:
- case M_LI_S:
- load_register (treg, &imm_expr, 0);
- break;
-
- case M_DLI:
- load_register (treg, &imm_expr, 1);
- break;
-
- case M_LI_SS:
- if (imm_expr.X_op == O_constant)
- {
- used_at = 1;
- load_register (AT, &imm_expr, 0);
- macro_build (NULL, "mtc1", "t,G", AT, treg);
- break;
- }
- else
- {
- assert (offset_expr.X_op == O_symbol
- && strcmp (segment_name (S_GET_SEGMENT
- (offset_expr.X_add_symbol)),
- ".lit4") == 0
- && offset_expr.X_add_number == 0);
- macro_build (&offset_expr, "lwc1", "T,o(b)", treg,
- BFD_RELOC_MIPS_LITERAL, mips_gp_register);
- break;
- }
-
- case M_LI_D:
- /* Check if we have a constant in IMM_EXPR. If the GPRs are 64 bits
- wide, IMM_EXPR is the entire value. Otherwise IMM_EXPR is the high
- order 32 bits of the value and the low order 32 bits are either
- zero or in OFFSET_EXPR. */
- if (imm_expr.X_op == O_constant || imm_expr.X_op == O_big)
- {
- if (HAVE_64BIT_GPRS)
- load_register (treg, &imm_expr, 1);
- else
- {
- int hreg, lreg;
-
- if (target_big_endian)
- {
- hreg = treg;
- lreg = treg + 1;
- }
- else
- {
- hreg = treg + 1;
- lreg = treg;
- }
-
- if (hreg <= 31)
- load_register (hreg, &imm_expr, 0);
- if (lreg <= 31)
- {
- if (offset_expr.X_op == O_absent)
- move_register (lreg, 0);
- else
- {
- assert (offset_expr.X_op == O_constant);
- load_register (lreg, &offset_expr, 0);
- }
- }
- }
- break;
- }
-
- /* We know that sym is in the .rdata section. First we get the
- upper 16 bits of the address. */
- if (mips_pic == NO_PIC)
- {
- macro_build_lui (&offset_expr, AT);
- used_at = 1;
- }
- else
- {
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", AT,
- BFD_RELOC_MIPS_GOT16, mips_gp_register);
- used_at = 1;
- }
-
- /* Now we load the register(s). */
- if (HAVE_64BIT_GPRS)
- {
- used_at = 1;
- macro_build (&offset_expr, "ld", "t,o(b)", treg, BFD_RELOC_LO16, AT);
- }
- else
- {
- used_at = 1;
- macro_build (&offset_expr, "lw", "t,o(b)", treg, BFD_RELOC_LO16, AT);
- if (treg != RA)
- {
- /* FIXME: How in the world do we deal with the possible
- overflow here? */
- offset_expr.X_add_number += 4;
- macro_build (&offset_expr, "lw", "t,o(b)",
- treg + 1, BFD_RELOC_LO16, AT);
- }
- }
- break;
-
- case M_LI_DD:
- /* Check if we have a constant in IMM_EXPR. If the FPRs are 64 bits
- wide, IMM_EXPR is the entire value and the GPRs are known to be 64
- bits wide as well. Otherwise IMM_EXPR is the high order 32 bits of
- the value and the low order 32 bits are either zero or in
- OFFSET_EXPR. */
- if (imm_expr.X_op == O_constant || imm_expr.X_op == O_big)
- {
- used_at = 1;
- load_register (AT, &imm_expr, HAVE_64BIT_FPRS);
- if (HAVE_64BIT_FPRS)
- {
- assert (HAVE_64BIT_GPRS);
- macro_build (NULL, "dmtc1", "t,S", AT, treg);
- }
- else
- {
- macro_build (NULL, "mtc1", "t,G", AT, treg + 1);
- if (offset_expr.X_op == O_absent)
- macro_build (NULL, "mtc1", "t,G", 0, treg);
- else
- {
- assert (offset_expr.X_op == O_constant);
- load_register (AT, &offset_expr, 0);
- macro_build (NULL, "mtc1", "t,G", AT, treg);
- }
- }
- break;
- }
-
- assert (offset_expr.X_op == O_symbol
- && offset_expr.X_add_number == 0);
- s = segment_name (S_GET_SEGMENT (offset_expr.X_add_symbol));
- if (strcmp (s, ".lit8") == 0)
- {
- if (mips_opts.isa != ISA_MIPS1)
- {
- macro_build (&offset_expr, "ldc1", "T,o(b)", treg,
- BFD_RELOC_MIPS_LITERAL, mips_gp_register);
- break;
- }
- breg = mips_gp_register;
- r = BFD_RELOC_MIPS_LITERAL;
- goto dob;
- }
- else
- {
- assert (strcmp (s, RDATA_SECTION_NAME) == 0);
- used_at = 1;
- if (mips_pic != NO_PIC)
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", AT,
- BFD_RELOC_MIPS_GOT16, mips_gp_register);
- else
- {
- /* FIXME: This won't work for a 64 bit address. */
- macro_build_lui (&offset_expr, AT);
- }
-
- if (mips_opts.isa != ISA_MIPS1)
- {
- macro_build (&offset_expr, "ldc1", "T,o(b)",
- treg, BFD_RELOC_LO16, AT);
- break;
- }
- breg = AT;
- r = BFD_RELOC_LO16;
- goto dob;
- }
-
- case M_L_DOB:
- /* Even on a big endian machine $fn comes before $fn+1. We have
- to adjust when loading from memory. */
- r = BFD_RELOC_LO16;
- dob:
- assert (mips_opts.isa == ISA_MIPS1);
- macro_build (&offset_expr, "lwc1", "T,o(b)",
- target_big_endian ? treg + 1 : treg, r, breg);
- /* FIXME: A possible overflow which I don't know how to deal
- with. */
- offset_expr.X_add_number += 4;
- macro_build (&offset_expr, "lwc1", "T,o(b)",
- target_big_endian ? treg : treg + 1, r, breg);
- break;
-
- case M_L_DAB:
- /*
- * The MIPS assembler seems to check for X_add_number not
- * being double aligned and generating:
- * lui at,%hi(foo+1)
- * addu at,at,v1
- * addiu at,at,%lo(foo+1)
- * lwc1 f2,0(at)
- * lwc1 f3,4(at)
- * But, the resulting address is the same after relocation so why
- * generate the extra instruction?
- */
- /* Itbl support may require additional care here. */
- coproc = 1;
- if (mips_opts.isa != ISA_MIPS1)
- {
- s = "ldc1";
- goto ld;
- }
-
- s = "lwc1";
- fmt = "T,o(b)";
- goto ldd_std;
-
- case M_S_DAB:
- if (mips_opts.isa != ISA_MIPS1)
- {
- s = "sdc1";
- goto st;
- }
-
- s = "swc1";
- fmt = "T,o(b)";
- /* Itbl support may require additional care here. */
- coproc = 1;
- goto ldd_std;
-
- case M_LD_AB:
- if (HAVE_64BIT_GPRS)
- {
- s = "ld";
- goto ld;
- }
-
- s = "lw";
- fmt = "t,o(b)";
- goto ldd_std;
-
- case M_SD_AB:
- if (HAVE_64BIT_GPRS)
- {
- s = "sd";
- goto st;
- }
-
- s = "sw";
- fmt = "t,o(b)";
-
- ldd_std:
- if (offset_expr.X_op != O_symbol
- && offset_expr.X_op != O_constant)
- {
- as_bad (_("expression too complex"));
- offset_expr.X_op = O_constant;
- }
-
- if (HAVE_32BIT_ADDRESSES
- && !IS_SEXT_32BIT_NUM (offset_expr.X_add_number))
- {
- char value [32];
-
- sprintf_vma (value, offset_expr.X_add_number);
- as_bad (_("Number (0x%s) larger than 32 bits"), value);
- }
-
- /* Even on a big endian machine $fn comes before $fn+1. We have
- to adjust when loading from memory. We set coproc if we must
- load $fn+1 first. */
- /* Itbl support may require additional care here. */
- if (! target_big_endian)
- coproc = 0;
-
- if (mips_pic == NO_PIC
- || offset_expr.X_op == O_constant)
- {
- /* If this is a reference to a GP relative symbol, we want
- <op> $treg,<sym>($gp) (BFD_RELOC_GPREL16)
- <op> $treg+1,<sym>+4($gp) (BFD_RELOC_GPREL16)
- If we have a base register, we use this
- addu $at,$breg,$gp
- <op> $treg,<sym>($at) (BFD_RELOC_GPREL16)
- <op> $treg+1,<sym>+4($at) (BFD_RELOC_GPREL16)
- If this is not a GP relative symbol, we want
- lui $at,<sym> (BFD_RELOC_HI16_S)
- <op> $treg,<sym>($at) (BFD_RELOC_LO16)
- <op> $treg+1,<sym>+4($at) (BFD_RELOC_LO16)
- If there is a base register, we add it to $at after the
- lui instruction. If there is a constant, we always use
- the last case. */
- if (offset_expr.X_op == O_symbol
- && (valueT) offset_expr.X_add_number <= MAX_GPREL_OFFSET
- && !nopic_need_relax (offset_expr.X_add_symbol, 1))
- {
- relax_start (offset_expr.X_add_symbol);
- if (breg == 0)
- {
- tempreg = mips_gp_register;
- }
- else
- {
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- AT, breg, mips_gp_register);
- tempreg = AT;
- used_at = 1;
- }
-
- /* Itbl support may require additional care here. */
- macro_build (&offset_expr, s, fmt, coproc ? treg + 1 : treg,
- BFD_RELOC_GPREL16, tempreg);
- offset_expr.X_add_number += 4;
-
- /* Set mips_optimize to 2 to avoid inserting an
- undesired nop. */
- hold_mips_optimize = mips_optimize;
- mips_optimize = 2;
- /* Itbl support may require additional care here. */
- macro_build (&offset_expr, s, fmt, coproc ? treg : treg + 1,
- BFD_RELOC_GPREL16, tempreg);
- mips_optimize = hold_mips_optimize;
-
- relax_switch ();
-
- /* We just generated two relocs. When tc_gen_reloc
- handles this case, it will skip the first reloc and
- handle the second. The second reloc already has an
- extra addend of 4, which we added above. We must
- subtract it out, and then subtract another 4 to make
- the first reloc come out right. The second reloc
- will come out right because we are going to add 4 to
- offset_expr when we build its instruction below.
-
- If we have a symbol, then we don't want to include
- the offset, because it will wind up being included
- when we generate the reloc. */
-
- if (offset_expr.X_op == O_constant)
- offset_expr.X_add_number -= 8;
- else
- {
- offset_expr.X_add_number = -4;
- offset_expr.X_op = O_constant;
- }
- }
- used_at = 1;
- macro_build_lui (&offset_expr, AT);
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, breg, AT);
- /* Itbl support may require additional care here. */
- macro_build (&offset_expr, s, fmt, coproc ? treg + 1 : treg,
- BFD_RELOC_LO16, AT);
- /* FIXME: How do we handle overflow here? */
- offset_expr.X_add_number += 4;
- /* Itbl support may require additional care here. */
- macro_build (&offset_expr, s, fmt, coproc ? treg : treg + 1,
- BFD_RELOC_LO16, AT);
- if (mips_relax.sequence)
- relax_end ();
- }
- else if (!mips_big_got)
- {
- /* If this is a reference to an external symbol, we want
- lw $at,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- <op> $treg,0($at)
- <op> $treg+1,4($at)
- Otherwise we want
- lw $at,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- <op> $treg,<sym>($at) (BFD_RELOC_LO16)
- <op> $treg+1,<sym>+4($at) (BFD_RELOC_LO16)
- If there is a base register we add it to $at before the
- lwc1 instructions. If there is a constant we include it
- in the lwc1 instructions. */
- used_at = 1;
- expr1.X_add_number = offset_expr.X_add_number;
- if (expr1.X_add_number < -0x8000
- || expr1.X_add_number >= 0x8000 - 4)
- as_bad (_("PIC code offset overflow (max 16 signed bits)"));
- load_got_offset (AT, &offset_expr);
- load_delay_nop ();
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, breg, AT);
-
- /* Set mips_optimize to 2 to avoid inserting an undesired
- nop. */
- hold_mips_optimize = mips_optimize;
- mips_optimize = 2;
-
- /* Itbl support may require additional care here. */
- relax_start (offset_expr.X_add_symbol);
- macro_build (&expr1, s, fmt, coproc ? treg + 1 : treg,
- BFD_RELOC_LO16, AT);
- expr1.X_add_number += 4;
- macro_build (&expr1, s, fmt, coproc ? treg : treg + 1,
- BFD_RELOC_LO16, AT);
- relax_switch ();
- macro_build (&offset_expr, s, fmt, coproc ? treg + 1 : treg,
- BFD_RELOC_LO16, AT);
- offset_expr.X_add_number += 4;
- macro_build (&offset_expr, s, fmt, coproc ? treg : treg + 1,
- BFD_RELOC_LO16, AT);
- relax_end ();
-
- mips_optimize = hold_mips_optimize;
- }
- else if (mips_big_got)
- {
- int gpdelay;
-
- /* If this is a reference to an external symbol, we want
- lui $at,<sym> (BFD_RELOC_MIPS_GOT_HI16)
- addu $at,$at,$gp
- lw $at,<sym>($at) (BFD_RELOC_MIPS_GOT_LO16)
- nop
- <op> $treg,0($at)
- <op> $treg+1,4($at)
- Otherwise we want
- lw $at,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
- nop
- <op> $treg,<sym>($at) (BFD_RELOC_LO16)
- <op> $treg+1,<sym>+4($at) (BFD_RELOC_LO16)
- If there is a base register we add it to $at before the
- lwc1 instructions. If there is a constant we include it
- in the lwc1 instructions. */
- used_at = 1;
- expr1.X_add_number = offset_expr.X_add_number;
- offset_expr.X_add_number = 0;
- if (expr1.X_add_number < -0x8000
- || expr1.X_add_number >= 0x8000 - 4)
- as_bad (_("PIC code offset overflow (max 16 signed bits)"));
- gpdelay = reg_needs_delay (mips_gp_register);
- relax_start (offset_expr.X_add_symbol);
- macro_build (&offset_expr, "lui", "t,u",
- AT, BFD_RELOC_MIPS_GOT_HI16);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
- AT, AT, mips_gp_register);
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)",
- AT, BFD_RELOC_MIPS_GOT_LO16, AT);
- load_delay_nop ();
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, breg, AT);
- /* Itbl support may require additional care here. */
- macro_build (&expr1, s, fmt, coproc ? treg + 1 : treg,
- BFD_RELOC_LO16, AT);
- expr1.X_add_number += 4;
-
- /* Set mips_optimize to 2 to avoid inserting an undesired
- nop. */
- hold_mips_optimize = mips_optimize;
- mips_optimize = 2;
- /* Itbl support may require additional care here. */
- macro_build (&expr1, s, fmt, coproc ? treg : treg + 1,
- BFD_RELOC_LO16, AT);
- mips_optimize = hold_mips_optimize;
- expr1.X_add_number -= 4;
-
- relax_switch ();
- offset_expr.X_add_number = expr1.X_add_number;
- if (gpdelay)
- macro_build (NULL, "nop", "");
- macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", AT,
- BFD_RELOC_MIPS_GOT16, mips_gp_register);
- load_delay_nop ();
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, breg, AT);
- /* Itbl support may require additional care here. */
- macro_build (&offset_expr, s, fmt, coproc ? treg + 1 : treg,
- BFD_RELOC_LO16, AT);
- offset_expr.X_add_number += 4;
-
- /* Set mips_optimize to 2 to avoid inserting an undesired
- nop. */
- hold_mips_optimize = mips_optimize;
- mips_optimize = 2;
- /* Itbl support may require additional care here. */
- macro_build (&offset_expr, s, fmt, coproc ? treg : treg + 1,
- BFD_RELOC_LO16, AT);
- mips_optimize = hold_mips_optimize;
- relax_end ();
- }
- else
- abort ();
-
- break;
-
- case M_LD_OB:
- s = "lw";
- goto sd_ob;
- case M_SD_OB:
- s = "sw";
- sd_ob:
- assert (HAVE_32BIT_ADDRESSES);
- macro_build (&offset_expr, s, "t,o(b)", treg, BFD_RELOC_LO16, breg);
- offset_expr.X_add_number += 4;
- macro_build (&offset_expr, s, "t,o(b)", treg + 1, BFD_RELOC_LO16, breg);
- break;
-
- /* New code added to support COPZ instructions.
- This code builds table entries out of the macros in mip_opcodes.
- R4000 uses interlocks to handle coproc delays.
- Other chips (like the R3000) require nops to be inserted for delays.
-
- FIXME: Currently, we require that the user handle delays.
- In order to fill delay slots for non-interlocked chips,
- we must have a way to specify delays based on the coprocessor.
- Eg. 4 cycles if load coproc reg from memory, 1 if in cache, etc.
- What are the side-effects of the cop instruction?
- What cache support might we have and what are its effects?
- Both coprocessor & memory require delays. how long???
- What registers are read/set/modified?
-
- If an itbl is provided to interpret cop instructions,
- this knowledge can be encoded in the itbl spec. */
-
- case M_COP0:
- s = "c0";
- goto copz;
- case M_COP1:
- s = "c1";
- goto copz;
- case M_COP2:
- s = "c2";
- goto copz;
- case M_COP3:
- s = "c3";
- copz:
- if (NO_ISA_COP (mips_opts.arch)
- && (ip->insn_mo->pinfo2 & INSN2_M_FP_S) == 0)
- {
- as_bad (_("opcode not supported on this processor: %s"),
- mips_cpu_info_from_arch (mips_opts.arch)->name);
- break;
- }
-
- /* For now we just do C (same as Cz). The parameter will be
- stored in insn_opcode by mips_ip. */
- macro_build (NULL, s, "C", ip->insn_opcode);
- break;
-
- case M_MOVE:
- move_register (dreg, sreg);
- break;
-
-#ifdef LOSING_COMPILER
- default:
- /* Try and see if this is a new itbl instruction.
- This code builds table entries out of the macros in mip_opcodes.
- FIXME: For now we just assemble the expression and pass it's
- value along as a 32-bit immediate.
- We may want to have the assembler assemble this value,
- so that we gain the assembler's knowledge of delay slots,
- symbols, etc.
- Would it be more efficient to use mask (id) here? */
- if (itbl_have_entries
- && (immed_expr = itbl_assemble (ip->insn_mo->name, "")))
- {
- s = ip->insn_mo->name;
- s2 = "cop3";
- coproc = ITBL_DECODE_PNUM (immed_expr);;
- macro_build (&immed_expr, s, "C");
- break;
- }
- macro2 (ip);
- break;
- }
- if (!mips_opts.at && used_at)
- as_bad (_("Macro used $at after \".set noat\""));
-}
-
-static void
-macro2 (struct mips_cl_insn *ip)
-{
- unsigned int treg, sreg, dreg, breg;
- unsigned int tempreg;
- int mask;
- int used_at;
- expressionS expr1;
- const char *s;
- const char *s2;
- const char *fmt;
- int likely = 0;
- int dbl = 0;
- int coproc = 0;
- int lr = 0;
- int imm = 0;
- int off;
- offsetT maxnum;
- bfd_reloc_code_real_type r;
-
- treg = (ip->insn_opcode >> 16) & 0x1f;
- dreg = (ip->insn_opcode >> 11) & 0x1f;
- sreg = breg = (ip->insn_opcode >> 21) & 0x1f;
- mask = ip->insn_mo->mask;
-
- expr1.X_op = O_constant;
- expr1.X_op_symbol = NULL;
- expr1.X_add_symbol = NULL;
- expr1.X_add_number = 1;
-
- switch (mask)
- {
-#endif /* LOSING_COMPILER */
-
- case M_DMUL:
- dbl = 1;
- case M_MUL:
- macro_build (NULL, dbl ? "dmultu" : "multu", "s,t", sreg, treg);
- macro_build (NULL, "mflo", "d", dreg);
- break;
-
- case M_DMUL_I:
- dbl = 1;
- case M_MUL_I:
- /* The MIPS assembler some times generates shifts and adds. I'm
- not trying to be that fancy. GCC should do this for us
- anyway. */
- used_at = 1;
- load_register (AT, &imm_expr, dbl);
- macro_build (NULL, dbl ? "dmult" : "mult", "s,t", sreg, AT);
- macro_build (NULL, "mflo", "d", dreg);
- break;
-
- case M_DMULO_I:
- dbl = 1;
- case M_MULO_I:
- imm = 1;
- goto do_mulo;
-
- case M_DMULO:
- dbl = 1;
- case M_MULO:
- do_mulo:
- start_noreorder ();
- used_at = 1;
- if (imm)
- load_register (AT, &imm_expr, dbl);
- macro_build (NULL, dbl ? "dmult" : "mult", "s,t", sreg, imm ? AT : treg);
- macro_build (NULL, "mflo", "d", dreg);
- macro_build (NULL, dbl ? "dsra32" : "sra", "d,w,<", dreg, dreg, RA);
- macro_build (NULL, "mfhi", "d", AT);
- if (mips_trap)
- macro_build (NULL, "tne", "s,t,q", dreg, AT, 6);
- else
- {
- expr1.X_add_number = 8;
- macro_build (&expr1, "beq", "s,t,p", dreg, AT);
- macro_build (NULL, "nop", "", 0);
- macro_build (NULL, "break", "c", 6);
- }
- end_noreorder ();
- macro_build (NULL, "mflo", "d", dreg);
- break;
-
- case M_DMULOU_I:
- dbl = 1;
- case M_MULOU_I:
- imm = 1;
- goto do_mulou;
-
- case M_DMULOU:
- dbl = 1;
- case M_MULOU:
- do_mulou:
- start_noreorder ();
- used_at = 1;
- if (imm)
- load_register (AT, &imm_expr, dbl);
- macro_build (NULL, dbl ? "dmultu" : "multu", "s,t",
- sreg, imm ? AT : treg);
- macro_build (NULL, "mfhi", "d", AT);
- macro_build (NULL, "mflo", "d", dreg);
- if (mips_trap)
- macro_build (NULL, "tne", "s,t,q", AT, 0, 6);
- else
- {
- expr1.X_add_number = 8;
- macro_build (&expr1, "beq", "s,t,p", AT, 0);
- macro_build (NULL, "nop", "", 0);
- macro_build (NULL, "break", "c", 6);
- }
- end_noreorder ();
- break;
-
- case M_DROL:
- if (ISA_HAS_DROR (mips_opts.isa) || CPU_HAS_DROR (mips_opts.arch))
- {
- if (dreg == sreg)
- {
- tempreg = AT;
- used_at = 1;
- }
- else
- {
- tempreg = dreg;
- }
- macro_build (NULL, "dnegu", "d,w", tempreg, treg);
- macro_build (NULL, "drorv", "d,t,s", dreg, sreg, tempreg);
- break;
- }
- used_at = 1;
- macro_build (NULL, "dsubu", "d,v,t", AT, 0, treg);
- macro_build (NULL, "dsrlv", "d,t,s", AT, sreg, AT);
- macro_build (NULL, "dsllv", "d,t,s", dreg, sreg, treg);
- macro_build (NULL, "or", "d,v,t", dreg, dreg, AT);
- break;
-
- case M_ROL:
- if (ISA_HAS_ROR (mips_opts.isa) || CPU_HAS_ROR (mips_opts.arch))
- {
- if (dreg == sreg)
- {
- tempreg = AT;
- used_at = 1;
- }
- else
- {
- tempreg = dreg;
- }
- macro_build (NULL, "negu", "d,w", tempreg, treg);
- macro_build (NULL, "rorv", "d,t,s", dreg, sreg, tempreg);
- break;
- }
- used_at = 1;
- macro_build (NULL, "subu", "d,v,t", AT, 0, treg);
- macro_build (NULL, "srlv", "d,t,s", AT, sreg, AT);
- macro_build (NULL, "sllv", "d,t,s", dreg, sreg, treg);
- macro_build (NULL, "or", "d,v,t", dreg, dreg, AT);
- break;
-
- case M_DROL_I:
- {
- unsigned int rot;
- char *l, *r;
-
- if (imm_expr.X_op != O_constant)
- as_bad (_("Improper rotate count"));
- rot = imm_expr.X_add_number & 0x3f;
- if (ISA_HAS_DROR (mips_opts.isa) || CPU_HAS_DROR (mips_opts.arch))
- {
- rot = (64 - rot) & 0x3f;
- if (rot >= 32)
- macro_build (NULL, "dror32", "d,w,<", dreg, sreg, rot - 32);
- else
- macro_build (NULL, "dror", "d,w,<", dreg, sreg, rot);
- break;
- }
- if (rot == 0)
- {
- macro_build (NULL, "dsrl", "d,w,<", dreg, sreg, 0);
- break;
- }
- l = (rot < 0x20) ? "dsll" : "dsll32";
- r = ((0x40 - rot) < 0x20) ? "dsrl" : "dsrl32";
- rot &= 0x1f;
- used_at = 1;
- macro_build (NULL, l, "d,w,<", AT, sreg, rot);
- macro_build (NULL, r, "d,w,<", dreg, sreg, (0x20 - rot) & 0x1f);
- macro_build (NULL, "or", "d,v,t", dreg, dreg, AT);
- }
- break;
-
- case M_ROL_I:
- {
- unsigned int rot;
-
- if (imm_expr.X_op != O_constant)
- as_bad (_("Improper rotate count"));
- rot = imm_expr.X_add_number & 0x1f;
- if (ISA_HAS_ROR (mips_opts.isa) || CPU_HAS_ROR (mips_opts.arch))
- {
- macro_build (NULL, "ror", "d,w,<", dreg, sreg, (32 - rot) & 0x1f);
- break;
- }
- if (rot == 0)
- {
- macro_build (NULL, "srl", "d,w,<", dreg, sreg, 0);
- break;
- }
- used_at = 1;
- macro_build (NULL, "sll", "d,w,<", AT, sreg, rot);
- macro_build (NULL, "srl", "d,w,<", dreg, sreg, (0x20 - rot) & 0x1f);
- macro_build (NULL, "or", "d,v,t", dreg, dreg, AT);
- }
- break;
-
- case M_DROR:
- if (ISA_HAS_DROR (mips_opts.isa) || CPU_HAS_DROR (mips_opts.arch))
- {
- macro_build (NULL, "drorv", "d,t,s", dreg, sreg, treg);
- break;
- }
- used_at = 1;
- macro_build (NULL, "dsubu", "d,v,t", AT, 0, treg);
- macro_build (NULL, "dsllv", "d,t,s", AT, sreg, AT);
- macro_build (NULL, "dsrlv", "d,t,s", dreg, sreg, treg);
- macro_build (NULL, "or", "d,v,t", dreg, dreg, AT);
- break;
-
- case M_ROR:
- if (ISA_HAS_ROR (mips_opts.isa) || CPU_HAS_ROR (mips_opts.arch))
- {
- macro_build (NULL, "rorv", "d,t,s", dreg, sreg, treg);
- break;
- }
- used_at = 1;
- macro_build (NULL, "subu", "d,v,t", AT, 0, treg);
- macro_build (NULL, "sllv", "d,t,s", AT, sreg, AT);
- macro_build (NULL, "srlv", "d,t,s", dreg, sreg, treg);
- macro_build (NULL, "or", "d,v,t", dreg, dreg, AT);
- break;
-
- case M_DROR_I:
- {
- unsigned int rot;
- char *l, *r;
-
- if (imm_expr.X_op != O_constant)
- as_bad (_("Improper rotate count"));
- rot = imm_expr.X_add_number & 0x3f;
- if (ISA_HAS_DROR (mips_opts.isa) || CPU_HAS_DROR (mips_opts.arch))
- {
- if (rot >= 32)
- macro_build (NULL, "dror32", "d,w,<", dreg, sreg, rot - 32);
- else
- macro_build (NULL, "dror", "d,w,<", dreg, sreg, rot);
- break;
- }
- if (rot == 0)
- {
- macro_build (NULL, "dsrl", "d,w,<", dreg, sreg, 0);
- break;
- }
- r = (rot < 0x20) ? "dsrl" : "dsrl32";
- l = ((0x40 - rot) < 0x20) ? "dsll" : "dsll32";
- rot &= 0x1f;
- used_at = 1;
- macro_build (NULL, r, "d,w,<", AT, sreg, rot);
- macro_build (NULL, l, "d,w,<", dreg, sreg, (0x20 - rot) & 0x1f);
- macro_build (NULL, "or", "d,v,t", dreg, dreg, AT);
- }
- break;
-
- case M_ROR_I:
- {
- unsigned int rot;
-
- if (imm_expr.X_op != O_constant)
- as_bad (_("Improper rotate count"));
- rot = imm_expr.X_add_number & 0x1f;
- if (ISA_HAS_ROR (mips_opts.isa) || CPU_HAS_ROR (mips_opts.arch))
- {
- macro_build (NULL, "ror", "d,w,<", dreg, sreg, rot);
- break;
- }
- if (rot == 0)
- {
- macro_build (NULL, "srl", "d,w,<", dreg, sreg, 0);
- break;
- }
- used_at = 1;
- macro_build (NULL, "srl", "d,w,<", AT, sreg, rot);
- macro_build (NULL, "sll", "d,w,<", dreg, sreg, (0x20 - rot) & 0x1f);
- macro_build (NULL, "or", "d,v,t", dreg, dreg, AT);
- }
- break;
-
- case M_S_DOB:
- assert (mips_opts.isa == ISA_MIPS1);
- /* Even on a big endian machine $fn comes before $fn+1. We have
- to adjust when storing to memory. */
- macro_build (&offset_expr, "swc1", "T,o(b)",
- target_big_endian ? treg + 1 : treg, BFD_RELOC_LO16, breg);
- offset_expr.X_add_number += 4;
- macro_build (&offset_expr, "swc1", "T,o(b)",
- target_big_endian ? treg : treg + 1, BFD_RELOC_LO16, breg);
- break;
-
- case M_SEQ:
- if (sreg == 0)
- macro_build (&expr1, "sltiu", "t,r,j", dreg, treg, BFD_RELOC_LO16);
- else if (treg == 0)
- macro_build (&expr1, "sltiu", "t,r,j", dreg, sreg, BFD_RELOC_LO16);
- else
- {
- macro_build (NULL, "xor", "d,v,t", dreg, sreg, treg);
- macro_build (&expr1, "sltiu", "t,r,j", dreg, dreg, BFD_RELOC_LO16);
- }
- break;
-
- case M_SEQ_I:
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 0)
- {
- macro_build (&expr1, "sltiu", "t,r,j", dreg, sreg, BFD_RELOC_LO16);
- break;
- }
- if (sreg == 0)
- {
- as_warn (_("Instruction %s: result is always false"),
- ip->insn_mo->name);
- move_register (dreg, 0);
- break;
- }
- if (CPU_HAS_SEQ (mips_opts.arch)
- && -512 <= imm_expr.X_add_number
- && imm_expr.X_add_number < 512)
- {
- macro_build (NULL, "seqi", "t,r,+Q", dreg, sreg,
- imm_expr.X_add_number);
- break;
- }
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number >= 0
- && imm_expr.X_add_number < 0x10000)
- {
- macro_build (&imm_expr, "xori", "t,r,i", dreg, sreg, BFD_RELOC_LO16);
- }
- else if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number > -0x8000
- && imm_expr.X_add_number < 0)
- {
- imm_expr.X_add_number = -imm_expr.X_add_number;
- macro_build (&imm_expr, HAVE_32BIT_GPRS ? "addiu" : "daddiu",
- "t,r,j", dreg, sreg, BFD_RELOC_LO16);
- }
- else if (CPU_HAS_SEQ (mips_opts.arch))
- {
- used_at = 1;
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (NULL, "seq", "d,v,t", dreg, sreg, AT);
- break;
- }
- else
- {
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (NULL, "xor", "d,v,t", dreg, sreg, AT);
- used_at = 1;
- }
- macro_build (&expr1, "sltiu", "t,r,j", dreg, dreg, BFD_RELOC_LO16);
- break;
-
- case M_SGE: /* sreg >= treg <==> not (sreg < treg) */
- s = "slt";
- goto sge;
- case M_SGEU:
- s = "sltu";
- sge:
- macro_build (NULL, s, "d,v,t", dreg, sreg, treg);
- macro_build (&expr1, "xori", "t,r,i", dreg, dreg, BFD_RELOC_LO16);
- break;
-
- case M_SGE_I: /* sreg >= I <==> not (sreg < I) */
- case M_SGEU_I:
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number >= -0x8000
- && imm_expr.X_add_number < 0x8000)
- {
- macro_build (&imm_expr, mask == M_SGE_I ? "slti" : "sltiu", "t,r,j",
- dreg, sreg, BFD_RELOC_LO16);
- }
- else
- {
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (NULL, mask == M_SGE_I ? "slt" : "sltu", "d,v,t",
- dreg, sreg, AT);
- used_at = 1;
- }
- macro_build (&expr1, "xori", "t,r,i", dreg, dreg, BFD_RELOC_LO16);
- break;
-
- case M_SGT: /* sreg > treg <==> treg < sreg */
- s = "slt";
- goto sgt;
- case M_SGTU:
- s = "sltu";
- sgt:
- macro_build (NULL, s, "d,v,t", dreg, treg, sreg);
- break;
-
- case M_SGT_I: /* sreg > I <==> I < sreg */
- s = "slt";
- goto sgti;
- case M_SGTU_I:
- s = "sltu";
- sgti:
- used_at = 1;
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (NULL, s, "d,v,t", dreg, AT, sreg);
- break;
-
- case M_SLE: /* sreg <= treg <==> treg >= sreg <==> not (treg < sreg) */
- s = "slt";
- goto sle;
- case M_SLEU:
- s = "sltu";
- sle:
- macro_build (NULL, s, "d,v,t", dreg, treg, sreg);
- macro_build (&expr1, "xori", "t,r,i", dreg, dreg, BFD_RELOC_LO16);
- break;
-
- case M_SLE_I: /* sreg <= I <==> I >= sreg <==> not (I < sreg) */
- s = "slt";
- goto slei;
- case M_SLEU_I:
- s = "sltu";
- slei:
- used_at = 1;
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (NULL, s, "d,v,t", dreg, AT, sreg);
- macro_build (&expr1, "xori", "t,r,i", dreg, dreg, BFD_RELOC_LO16);
- break;
-
- case M_SLT_I:
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number >= -0x8000
- && imm_expr.X_add_number < 0x8000)
- {
- macro_build (&imm_expr, "slti", "t,r,j", dreg, sreg, BFD_RELOC_LO16);
- break;
- }
- used_at = 1;
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (NULL, "slt", "d,v,t", dreg, sreg, AT);
- break;
-
- case M_SLTU_I:
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number >= -0x8000
- && imm_expr.X_add_number < 0x8000)
- {
- macro_build (&imm_expr, "sltiu", "t,r,j", dreg, sreg,
- BFD_RELOC_LO16);
- break;
- }
- used_at = 1;
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (NULL, "sltu", "d,v,t", dreg, sreg, AT);
- break;
-
- case M_SNE:
- if (sreg == 0)
- macro_build (NULL, "sltu", "d,v,t", dreg, 0, treg);
- else if (treg == 0)
- macro_build (NULL, "sltu", "d,v,t", dreg, 0, sreg);
- else
- {
- macro_build (NULL, "xor", "d,v,t", dreg, sreg, treg);
- macro_build (NULL, "sltu", "d,v,t", dreg, 0, dreg);
- }
- break;
-
- case M_SNE_I:
- if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 0)
- {
- macro_build (NULL, "sltu", "d,v,t", dreg, 0, sreg);
- break;
- }
- if (sreg == 0)
- {
- as_warn (_("Instruction %s: result is always true"),
- ip->insn_mo->name);
- macro_build (&expr1, HAVE_32BIT_GPRS ? "addiu" : "daddiu", "t,r,j",
- dreg, 0, BFD_RELOC_LO16);
- break;
- }
- if (CPU_HAS_SEQ (mips_opts.arch)
- && -512 <= imm_expr.X_add_number
- && imm_expr.X_add_number < 512)
- {
- macro_build (NULL, "snei", "t,r,+Q", dreg, sreg,
- imm_expr.X_add_number);
- break;
- }
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number >= 0
- && imm_expr.X_add_number < 0x10000)
- {
- macro_build (&imm_expr, "xori", "t,r,i", dreg, sreg, BFD_RELOC_LO16);
- }
- else if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number > -0x8000
- && imm_expr.X_add_number < 0)
- {
- imm_expr.X_add_number = -imm_expr.X_add_number;
- macro_build (&imm_expr, HAVE_32BIT_GPRS ? "addiu" : "daddiu",
- "t,r,j", dreg, sreg, BFD_RELOC_LO16);
- }
- else if (CPU_HAS_SEQ (mips_opts.arch))
- {
- used_at = 1;
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (NULL, "sne", "d,v,t", dreg, sreg, AT);
- break;
- }
- else
- {
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (NULL, "xor", "d,v,t", dreg, sreg, AT);
- used_at = 1;
- }
- macro_build (NULL, "sltu", "d,v,t", dreg, 0, dreg);
- break;
-
- case M_DSUB_I:
- dbl = 1;
- case M_SUB_I:
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number > -0x8000
- && imm_expr.X_add_number <= 0x8000)
- {
- imm_expr.X_add_number = -imm_expr.X_add_number;
- macro_build (&imm_expr, dbl ? "daddi" : "addi", "t,r,j",
- dreg, sreg, BFD_RELOC_LO16);
- break;
- }
- used_at = 1;
- load_register (AT, &imm_expr, dbl);
- macro_build (NULL, dbl ? "dsub" : "sub", "d,v,t", dreg, sreg, AT);
- break;
-
- case M_DSUBU_I:
- dbl = 1;
- case M_SUBU_I:
- if (imm_expr.X_op == O_constant
- && imm_expr.X_add_number > -0x8000
- && imm_expr.X_add_number <= 0x8000)
- {
- imm_expr.X_add_number = -imm_expr.X_add_number;
- macro_build (&imm_expr, dbl ? "daddiu" : "addiu", "t,r,j",
- dreg, sreg, BFD_RELOC_LO16);
- break;
- }
- used_at = 1;
- load_register (AT, &imm_expr, dbl);
- macro_build (NULL, dbl ? "dsubu" : "subu", "d,v,t", dreg, sreg, AT);
- break;
-
- case M_TEQ_I:
- s = "teq";
- goto trap;
- case M_TGE_I:
- s = "tge";
- goto trap;
- case M_TGEU_I:
- s = "tgeu";
- goto trap;
- case M_TLT_I:
- s = "tlt";
- goto trap;
- case M_TLTU_I:
- s = "tltu";
- goto trap;
- case M_TNE_I:
- s = "tne";
- trap:
- used_at = 1;
- load_register (AT, &imm_expr, HAVE_64BIT_GPRS);
- macro_build (NULL, s, "s,t", sreg, AT);
- break;
-
- case M_TRUNCWS:
- case M_TRUNCWD:
- assert (mips_opts.isa == ISA_MIPS1);
- used_at = 1;
- sreg = (ip->insn_opcode >> 11) & 0x1f; /* floating reg */
- dreg = (ip->insn_opcode >> 06) & 0x1f; /* floating reg */
-
- /*
- * Is the double cfc1 instruction a bug in the mips assembler;
- * or is there a reason for it?
- */
- start_noreorder ();
- macro_build (NULL, "cfc1", "t,G", treg, RA);
- macro_build (NULL, "cfc1", "t,G", treg, RA);
- macro_build (NULL, "nop", "");
- expr1.X_add_number = 3;
- macro_build (&expr1, "ori", "t,r,i", AT, treg, BFD_RELOC_LO16);
- expr1.X_add_number = 2;
- macro_build (&expr1, "xori", "t,r,i", AT, AT, BFD_RELOC_LO16);
- macro_build (NULL, "ctc1", "t,G", AT, RA);
- macro_build (NULL, "nop", "");
- macro_build (NULL, mask == M_TRUNCWD ? "cvt.w.d" : "cvt.w.s", "D,S",
- dreg, sreg);
- macro_build (NULL, "ctc1", "t,G", treg, RA);
- macro_build (NULL, "nop", "");
- end_noreorder ();
- break;
-
- case M_ULH:
- s = "lb";
- goto ulh;
- case M_ULHU:
- s = "lbu";
- ulh:
- used_at = 1;
- if (offset_expr.X_add_number >= 0x7fff)
- as_bad (_("operand overflow"));
- if (! target_big_endian)
- ++offset_expr.X_add_number;
- macro_build (&offset_expr, s, "t,o(b)", AT, BFD_RELOC_LO16, breg);
- if (! target_big_endian)
- --offset_expr.X_add_number;
- else
- ++offset_expr.X_add_number;
- macro_build (&offset_expr, "lbu", "t,o(b)", treg, BFD_RELOC_LO16, breg);
- macro_build (NULL, "sll", "d,w,<", AT, AT, 8);
- macro_build (NULL, "or", "d,v,t", treg, treg, AT);
- break;
-
- case M_ULD:
- s = "ldl";
- s2 = "ldr";
- off = 7;
- goto ulw;
- case M_ULW:
- s = "lwl";
- s2 = "lwr";
- off = 3;
- ulw:
- if (offset_expr.X_add_number >= 0x8000 - off)
- as_bad (_("operand overflow"));
- if (treg != breg)
- tempreg = treg;
- else
- {
- used_at = 1;
- tempreg = AT;
- }
- if (! target_big_endian)
- offset_expr.X_add_number += off;
- macro_build (&offset_expr, s, "t,o(b)", tempreg, BFD_RELOC_LO16, breg);
- if (! target_big_endian)
- offset_expr.X_add_number -= off;
- else
- offset_expr.X_add_number += off;
- macro_build (&offset_expr, s2, "t,o(b)", tempreg, BFD_RELOC_LO16, breg);
-
- /* If necessary, move the result in tempreg the final destination. */
- if (treg == tempreg)
- break;
- /* Protect second load's delay slot. */
- load_delay_nop ();
- move_register (treg, tempreg);
- break;
-
- case M_ULD_A:
- s = "ldl";
- s2 = "ldr";
- off = 7;
- goto ulwa;
- case M_ULW_A:
- s = "lwl";
- s2 = "lwr";
- off = 3;
- ulwa:
- used_at = 1;
- load_address (AT, &offset_expr, &used_at);
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, AT, breg);
- if (! target_big_endian)
- expr1.X_add_number = off;
- else
- expr1.X_add_number = 0;
- macro_build (&expr1, s, "t,o(b)", treg, BFD_RELOC_LO16, AT);
- if (! target_big_endian)
- expr1.X_add_number = 0;
- else
- expr1.X_add_number = off;
- macro_build (&expr1, s2, "t,o(b)", treg, BFD_RELOC_LO16, AT);
- break;
-
- case M_ULH_A:
- case M_ULHU_A:
- used_at = 1;
- load_address (AT, &offset_expr, &used_at);
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, AT, breg);
- if (target_big_endian)
- expr1.X_add_number = 0;
- macro_build (&expr1, mask == M_ULH_A ? "lb" : "lbu", "t,o(b)",
- treg, BFD_RELOC_LO16, AT);
- if (target_big_endian)
- expr1.X_add_number = 1;
- else
- expr1.X_add_number = 0;
- macro_build (&expr1, "lbu", "t,o(b)", AT, BFD_RELOC_LO16, AT);
- macro_build (NULL, "sll", "d,w,<", treg, treg, 8);
- macro_build (NULL, "or", "d,v,t", treg, treg, AT);
- break;
-
- case M_USH:
- used_at = 1;
- if (offset_expr.X_add_number >= 0x7fff)
- as_bad (_("operand overflow"));
- if (target_big_endian)
- ++offset_expr.X_add_number;
- macro_build (&offset_expr, "sb", "t,o(b)", treg, BFD_RELOC_LO16, breg);
- macro_build (NULL, "srl", "d,w,<", AT, treg, 8);
- if (target_big_endian)
- --offset_expr.X_add_number;
- else
- ++offset_expr.X_add_number;
- macro_build (&offset_expr, "sb", "t,o(b)", AT, BFD_RELOC_LO16, breg);
- break;
-
- case M_USD:
- s = "sdl";
- s2 = "sdr";
- off = 7;
- goto usw;
- case M_USW:
- s = "swl";
- s2 = "swr";
- off = 3;
- usw:
- if (offset_expr.X_add_number >= 0x8000 - off)
- as_bad (_("operand overflow"));
- if (! target_big_endian)
- offset_expr.X_add_number += off;
- macro_build (&offset_expr, s, "t,o(b)", treg, BFD_RELOC_LO16, breg);
- if (! target_big_endian)
- offset_expr.X_add_number -= off;
- else
- offset_expr.X_add_number += off;
- macro_build (&offset_expr, s2, "t,o(b)", treg, BFD_RELOC_LO16, breg);
- break;
-
- case M_USD_A:
- s = "sdl";
- s2 = "sdr";
- off = 7;
- goto uswa;
- case M_USW_A:
- s = "swl";
- s2 = "swr";
- off = 3;
- uswa:
- used_at = 1;
- load_address (AT, &offset_expr, &used_at);
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, AT, breg);
- if (! target_big_endian)
- expr1.X_add_number = off;
- else
- expr1.X_add_number = 0;
- macro_build (&expr1, s, "t,o(b)", treg, BFD_RELOC_LO16, AT);
- if (! target_big_endian)
- expr1.X_add_number = 0;
- else
- expr1.X_add_number = off;
- macro_build (&expr1, s2, "t,o(b)", treg, BFD_RELOC_LO16, AT);
- break;
-
- case M_USH_A:
- used_at = 1;
- load_address (AT, &offset_expr, &used_at);
- if (breg != 0)
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, AT, breg);
- if (! target_big_endian)
- expr1.X_add_number = 0;
- macro_build (&expr1, "sb", "t,o(b)", treg, BFD_RELOC_LO16, AT);
- macro_build (NULL, "srl", "d,w,<", treg, treg, 8);
- if (! target_big_endian)
- expr1.X_add_number = 1;
- else
- expr1.X_add_number = 0;
- macro_build (&expr1, "sb", "t,o(b)", treg, BFD_RELOC_LO16, AT);
- if (! target_big_endian)
- expr1.X_add_number = 0;
- else
- expr1.X_add_number = 1;
- macro_build (&expr1, "lbu", "t,o(b)", AT, BFD_RELOC_LO16, AT);
- macro_build (NULL, "sll", "d,w,<", treg, treg, 8);
- macro_build (NULL, "or", "d,v,t", treg, treg, AT);
- break;
-
- default:
- /* FIXME: Check if this is one of the itbl macros, since they
- are added dynamically. */
- as_bad (_("Macro %s not implemented yet"), ip->insn_mo->name);
- break;
- }
- if (!mips_opts.at && used_at)
- as_bad (_("Macro used $at after \".set noat\""));
-}
-
-/* Implement macros in mips16 mode. */
-
-static void
-mips16_macro (struct mips_cl_insn *ip)
-{
- int mask;
- int xreg, yreg, zreg, tmp;
- expressionS expr1;
- int dbl;
- const char *s, *s2, *s3;
-
- mask = ip->insn_mo->mask;
-
- xreg = MIPS16_EXTRACT_OPERAND (RX, *ip);
- yreg = MIPS16_EXTRACT_OPERAND (RY, *ip);
- zreg = MIPS16_EXTRACT_OPERAND (RZ, *ip);
-
- expr1.X_op = O_constant;
- expr1.X_op_symbol = NULL;
- expr1.X_add_symbol = NULL;
- expr1.X_add_number = 1;
-
- dbl = 0;
-
- switch (mask)
- {
- default:
- internalError ();
-
- case M_DDIV_3:
- dbl = 1;
- case M_DIV_3:
- s = "mflo";
- goto do_div3;
- case M_DREM_3:
- dbl = 1;
- case M_REM_3:
- s = "mfhi";
- do_div3:
- start_noreorder ();
- macro_build (NULL, dbl ? "ddiv" : "div", "0,x,y", xreg, yreg);
- expr1.X_add_number = 2;
- macro_build (&expr1, "bnez", "x,p", yreg);
- macro_build (NULL, "break", "6", 7);
-
- /* FIXME: The normal code checks for of -1 / -0x80000000 here,
- since that causes an overflow. We should do that as well,
- but I don't see how to do the comparisons without a temporary
- register. */
- end_noreorder ();
- macro_build (NULL, s, "x", zreg);
- break;
-
- case M_DIVU_3:
- s = "divu";
- s2 = "mflo";
- goto do_divu3;
- case M_REMU_3:
- s = "divu";
- s2 = "mfhi";
- goto do_divu3;
- case M_DDIVU_3:
- s = "ddivu";
- s2 = "mflo";
- goto do_divu3;
- case M_DREMU_3:
- s = "ddivu";
- s2 = "mfhi";
- do_divu3:
- start_noreorder ();
- macro_build (NULL, s, "0,x,y", xreg, yreg);
- expr1.X_add_number = 2;
- macro_build (&expr1, "bnez", "x,p", yreg);
- macro_build (NULL, "break", "6", 7);
- end_noreorder ();
- macro_build (NULL, s2, "x", zreg);
- break;
-
- case M_DMUL:
- dbl = 1;
- case M_MUL:
- macro_build (NULL, dbl ? "dmultu" : "multu", "x,y", xreg, yreg);
- macro_build (NULL, "mflo", "x", zreg);
- break;
-
- case M_DSUBU_I:
- dbl = 1;
- goto do_subu;
- case M_SUBU_I:
- do_subu:
- if (imm_expr.X_op != O_constant)
- as_bad (_("Unsupported large constant"));
- imm_expr.X_add_number = -imm_expr.X_add_number;
- macro_build (&imm_expr, dbl ? "daddiu" : "addiu", "y,x,4", yreg, xreg);
- break;
-
- case M_SUBU_I_2:
- if (imm_expr.X_op != O_constant)
- as_bad (_("Unsupported large constant"));
- imm_expr.X_add_number = -imm_expr.X_add_number;
- macro_build (&imm_expr, "addiu", "x,k", xreg);
- break;
-
- case M_DSUBU_I_2:
- if (imm_expr.X_op != O_constant)
- as_bad (_("Unsupported large constant"));
- imm_expr.X_add_number = -imm_expr.X_add_number;
- macro_build (&imm_expr, "daddiu", "y,j", yreg);
- break;
-
- case M_BEQ:
- s = "cmp";
- s2 = "bteqz";
- goto do_branch;
- case M_BNE:
- s = "cmp";
- s2 = "btnez";
- goto do_branch;
- case M_BLT:
- s = "slt";
- s2 = "btnez";
- goto do_branch;
- case M_BLTU:
- s = "sltu";
- s2 = "btnez";
- goto do_branch;
- case M_BLE:
- s = "slt";
- s2 = "bteqz";
- goto do_reverse_branch;
- case M_BLEU:
- s = "sltu";
- s2 = "bteqz";
- goto do_reverse_branch;
- case M_BGE:
- s = "slt";
- s2 = "bteqz";
- goto do_branch;
- case M_BGEU:
- s = "sltu";
- s2 = "bteqz";
- goto do_branch;
- case M_BGT:
- s = "slt";
- s2 = "btnez";
- goto do_reverse_branch;
- case M_BGTU:
- s = "sltu";
- s2 = "btnez";
-
- do_reverse_branch:
- tmp = xreg;
- xreg = yreg;
- yreg = tmp;
-
- do_branch:
- macro_build (NULL, s, "x,y", xreg, yreg);
- macro_build (&offset_expr, s2, "p");
- break;
-
- case M_BEQ_I:
- s = "cmpi";
- s2 = "bteqz";
- s3 = "x,U";
- goto do_branch_i;
- case M_BNE_I:
- s = "cmpi";
- s2 = "btnez";
- s3 = "x,U";
- goto do_branch_i;
- case M_BLT_I:
- s = "slti";
- s2 = "btnez";
- s3 = "x,8";
- goto do_branch_i;
- case M_BLTU_I:
- s = "sltiu";
- s2 = "btnez";
- s3 = "x,8";
- goto do_branch_i;
- case M_BLE_I:
- s = "slti";
- s2 = "btnez";
- s3 = "x,8";
- goto do_addone_branch_i;
- case M_BLEU_I:
- s = "sltiu";
- s2 = "btnez";
- s3 = "x,8";
- goto do_addone_branch_i;
- case M_BGE_I:
- s = "slti";
- s2 = "bteqz";
- s3 = "x,8";
- goto do_branch_i;
- case M_BGEU_I:
- s = "sltiu";
- s2 = "bteqz";
- s3 = "x,8";
- goto do_branch_i;
- case M_BGT_I:
- s = "slti";
- s2 = "bteqz";
- s3 = "x,8";
- goto do_addone_branch_i;
- case M_BGTU_I:
- s = "sltiu";
- s2 = "bteqz";
- s3 = "x,8";
-
- do_addone_branch_i:
- if (imm_expr.X_op != O_constant)
- as_bad (_("Unsupported large constant"));
- ++imm_expr.X_add_number;
-
- do_branch_i:
- macro_build (&imm_expr, s, s3, xreg);
- macro_build (&offset_expr, s2, "p");
- break;
-
- case M_ABS:
- expr1.X_add_number = 0;
- macro_build (&expr1, "slti", "x,8", yreg);
- if (xreg != yreg)
- move_register (xreg, yreg);
- expr1.X_add_number = 2;
- macro_build (&expr1, "bteqz", "p");
- macro_build (NULL, "neg", "x,w", xreg, xreg);
- }
-}
-
-/* For consistency checking, verify that all bits are specified either
- by the match/mask part of the instruction definition, or by the
- operand list. */
-static int
-validate_mips_insn (const struct mips_opcode *opc)
-{
- const char *p = opc->args;
- char c;
- unsigned long used_bits = opc->mask;
-
- if ((used_bits & opc->match) != opc->match)
- {
- as_bad (_("internal: bad mips opcode (mask error): %s %s"),
- opc->name, opc->args);
- return 0;
- }
-#define USE_BITS(mask,shift) (used_bits |= ((mask) << (shift)))
- while (*p)
- switch (c = *p++)
- {
- case ',': break;
- case '(': break;
- case ')': break;
- case '+':
- switch (c = *p++)
- {
- case '1': USE_BITS (OP_MASK_UDI1, OP_SH_UDI1); break;
- case '2': USE_BITS (OP_MASK_UDI2, OP_SH_UDI2); break;
- case '3': USE_BITS (OP_MASK_UDI3, OP_SH_UDI3); break;
- case '4': USE_BITS (OP_MASK_UDI4, OP_SH_UDI4); break;
- case 'A': USE_BITS (OP_MASK_SHAMT, OP_SH_SHAMT); break;
- case 'B': USE_BITS (OP_MASK_INSMSB, OP_SH_INSMSB); break;
- case 'C': USE_BITS (OP_MASK_EXTMSBD, OP_SH_EXTMSBD); break;
- case 'D': USE_BITS (OP_MASK_RD, OP_SH_RD);
- USE_BITS (OP_MASK_SEL, OP_SH_SEL); break;
- case 'E': USE_BITS (OP_MASK_SHAMT, OP_SH_SHAMT); break;
- case 'F': USE_BITS (OP_MASK_INSMSB, OP_SH_INSMSB); break;
- case 'G': USE_BITS (OP_MASK_EXTMSBD, OP_SH_EXTMSBD); break;
- case 'H': USE_BITS (OP_MASK_EXTMSBD, OP_SH_EXTMSBD); break;
- case 'I': break;
- case 't': USE_BITS (OP_MASK_RT, OP_SH_RT); break;
- case 'T': USE_BITS (OP_MASK_RT, OP_SH_RT);
- USE_BITS (OP_MASK_SEL, OP_SH_SEL); break;
- case 'x': USE_BITS (OP_MASK_BBITIND, OP_SH_BBITIND); break;
- case 'X': USE_BITS (OP_MASK_BBITIND, OP_SH_BBITIND); break;
- case 'p': USE_BITS (OP_MASK_CINSPOS, OP_SH_CINSPOS); break;
- case 'P': USE_BITS (OP_MASK_CINSPOS, OP_SH_CINSPOS); break;
- case 'Q': USE_BITS (OP_MASK_SEQI, OP_SH_SEQI); break;
- case 's': USE_BITS (OP_MASK_CINSLM1, OP_SH_CINSLM1); break;
- case 'S': USE_BITS (OP_MASK_CINSLM1, OP_SH_CINSLM1); break;
-
- default:
- as_bad (_("internal: bad mips opcode (unknown extension operand type `+%c'): %s %s"),
- c, opc->name, opc->args);
- return 0;
- }
- break;
- case '<': USE_BITS (OP_MASK_SHAMT, OP_SH_SHAMT); break;
- case '>': USE_BITS (OP_MASK_SHAMT, OP_SH_SHAMT); break;
- case 'A': break;
- case 'B': USE_BITS (OP_MASK_CODE20, OP_SH_CODE20); break;
- case 'C': USE_BITS (OP_MASK_COPZ, OP_SH_COPZ); break;
- case 'D': USE_BITS (OP_MASK_FD, OP_SH_FD); break;
- case 'E': USE_BITS (OP_MASK_RT, OP_SH_RT); break;
- case 'F': break;
- case 'G': USE_BITS (OP_MASK_RD, OP_SH_RD); break;
- case 'H': USE_BITS (OP_MASK_SEL, OP_SH_SEL); break;
- case 'I': break;
- case 'J': USE_BITS (OP_MASK_CODE19, OP_SH_CODE19); break;
- case 'K': USE_BITS (OP_MASK_RD, OP_SH_RD); break;
- case 'L': break;
- case 'M': USE_BITS (OP_MASK_CCC, OP_SH_CCC); break;
- case 'N': USE_BITS (OP_MASK_BCC, OP_SH_BCC); break;
- case 'O': USE_BITS (OP_MASK_ALN, OP_SH_ALN); break;
- case 'Q': USE_BITS (OP_MASK_VSEL, OP_SH_VSEL);
- USE_BITS (OP_MASK_FT, OP_SH_FT); break;
- case 'R': USE_BITS (OP_MASK_FR, OP_SH_FR); break;
- case 'S': USE_BITS (OP_MASK_FS, OP_SH_FS); break;
- case 'T': USE_BITS (OP_MASK_FT, OP_SH_FT); break;
- case 'V': USE_BITS (OP_MASK_FS, OP_SH_FS); break;
- case 'W': USE_BITS (OP_MASK_FT, OP_SH_FT); break;
- case 'X': USE_BITS (OP_MASK_FD, OP_SH_FD); break;
- case 'Y': USE_BITS (OP_MASK_FS, OP_SH_FS); break;
- case 'Z': USE_BITS (OP_MASK_FT, OP_SH_FT); break;
- case 'a': USE_BITS (OP_MASK_TARGET, OP_SH_TARGET); break;
- case 'b': USE_BITS (OP_MASK_RS, OP_SH_RS); break;
- case 'c': USE_BITS (OP_MASK_CODE, OP_SH_CODE); break;
- case 'd': USE_BITS (OP_MASK_RD, OP_SH_RD); break;
- case 'f': break;
- case 'h': USE_BITS (OP_MASK_PREFX, OP_SH_PREFX); break;
- case 'i': USE_BITS (OP_MASK_IMMEDIATE, OP_SH_IMMEDIATE); break;
- case 'j': USE_BITS (OP_MASK_DELTA, OP_SH_DELTA); break;
- case 'k': USE_BITS (OP_MASK_CACHE, OP_SH_CACHE); break;
- case 'l': break;
- case 'o': USE_BITS (OP_MASK_DELTA, OP_SH_DELTA); break;
- case 'p': USE_BITS (OP_MASK_DELTA, OP_SH_DELTA); break;
- case 'q': USE_BITS (OP_MASK_CODE2, OP_SH_CODE2); break;
- case 'r': USE_BITS (OP_MASK_RS, OP_SH_RS); break;
- case 's': USE_BITS (OP_MASK_RS, OP_SH_RS); break;
- case 't': USE_BITS (OP_MASK_RT, OP_SH_RT); break;
- case 'u': USE_BITS (OP_MASK_IMMEDIATE, OP_SH_IMMEDIATE); break;
- case 'v': USE_BITS (OP_MASK_RS, OP_SH_RS); break;
- case 'w': USE_BITS (OP_MASK_RT, OP_SH_RT); break;
- case 'x': break;
- case 'z': break;
- case 'P': USE_BITS (OP_MASK_PERFREG, OP_SH_PERFREG); break;
- case 'U': USE_BITS (OP_MASK_RD, OP_SH_RD);
- USE_BITS (OP_MASK_RT, OP_SH_RT); break;
- case 'e': USE_BITS (OP_MASK_VECBYTE, OP_SH_VECBYTE); break;
- case '%': USE_BITS (OP_MASK_VECALIGN, OP_SH_VECALIGN); break;
- case '[': break;
- case ']': break;
- case '2': USE_BITS (OP_MASK_BP, OP_SH_BP); break;
- case '3': USE_BITS (OP_MASK_SA3, OP_SH_SA3); break;
- case '4': USE_BITS (OP_MASK_SA4, OP_SH_SA4); break;
- case '5': USE_BITS (OP_MASK_IMM8, OP_SH_IMM8); break;
- case '6': USE_BITS (OP_MASK_RS, OP_SH_RS); break;
- case '7': USE_BITS (OP_MASK_DSPACC, OP_SH_DSPACC); break;
- case '8': USE_BITS (OP_MASK_WRDSP, OP_SH_WRDSP); break;
- case '9': USE_BITS (OP_MASK_DSPACC_S, OP_SH_DSPACC_S);break;
- case '0': USE_BITS (OP_MASK_DSPSFT, OP_SH_DSPSFT); break;
- case '\'': USE_BITS (OP_MASK_RDDSP, OP_SH_RDDSP); break;
- case ':': USE_BITS (OP_MASK_DSPSFT_7, OP_SH_DSPSFT_7);break;
- case '@': USE_BITS (OP_MASK_IMM10, OP_SH_IMM10); break;
- case '!': USE_BITS (OP_MASK_MT_U, OP_SH_MT_U); break;
- case '$': USE_BITS (OP_MASK_MT_H, OP_SH_MT_H); break;
- case '*': USE_BITS (OP_MASK_MTACC_T, OP_SH_MTACC_T); break;
- case '&': USE_BITS (OP_MASK_MTACC_D, OP_SH_MTACC_D); break;
- case 'g': USE_BITS (OP_MASK_RD, OP_SH_RD); break;
- default:
- as_bad (_("internal: bad mips opcode (unknown operand type `%c'): %s %s"),
- c, opc->name, opc->args);
- return 0;
- }
-#undef USE_BITS
- if (used_bits != 0xffffffff)
- {
- as_bad (_("internal: bad mips opcode (bits 0x%lx undefined): %s %s"),
- ~used_bits & 0xffffffff, opc->name, opc->args);
- return 0;
- }
- return 1;
-}
-
-/* UDI immediates. */
-struct mips_immed {
- char type;
- unsigned int shift;
- unsigned long mask;
- const char * desc;
-};
-
-static const struct mips_immed mips_immed[] = {
- { '1', OP_SH_UDI1, OP_MASK_UDI1, 0},
- { '2', OP_SH_UDI2, OP_MASK_UDI2, 0},
- { '3', OP_SH_UDI3, OP_MASK_UDI3, 0},
- { '4', OP_SH_UDI4, OP_MASK_UDI4, 0},
- { 0,0,0,0 }
-};
-
-/* Check whether an odd floating-point register is allowed. */
-static int
-mips_oddfpreg_ok (const struct mips_opcode *insn, int argnum)
-{
- const char *s = insn->name;
-
- if (insn->pinfo == INSN_MACRO)
- /* Let a macro pass, we'll catch it later when it is expanded. */
- return 1;
-
- if (ISA_HAS_ODD_SINGLE_FPR (mips_opts.isa))
- {
- /* Allow odd registers for single-precision ops. */
- switch (insn->pinfo & (FP_S | FP_D))
- {
- case FP_S:
- case 0:
- return 1; /* both single precision - ok */
- case FP_D:
- return 0; /* both double precision - fail */
- default:
- break;
- }
-
- /* Cvt.w.x and cvt.x.w allow an odd register for a 'w' or 's' operand. */
- s = strchr (insn->name, '.');
- if (argnum == 2)
- s = s != NULL ? strchr (s + 1, '.') : NULL;
- return (s != NULL && (s[1] == 'w' || s[1] == 's'));
- }
-
- /* Single-precision coprocessor loads and moves are OK too. */
- if ((insn->pinfo & FP_S)
- && (insn->pinfo & (INSN_COPROC_MEMORY_DELAY | INSN_STORE_MEMORY
- | INSN_LOAD_COPROC_DELAY | INSN_COPROC_MOVE_DELAY)))
- return 1;
-
- return 0;
-}
-
-/* This routine assembles an instruction into its binary format. As a
- side effect, it sets one of the global variables imm_reloc or
- offset_reloc to the type of relocation to do if one of the operands
- is an address expression. */
-
-static void
-mips_ip (char *str, struct mips_cl_insn *ip)
-{
- char *s;
- const char *args;
- char c = 0;
- struct mips_opcode *insn;
- char *argsStart;
- unsigned int regno;
- unsigned int lastregno = 0;
- unsigned int lastpos = 0;
- unsigned int limlo, limhi;
- char *s_reset;
- char save_c = 0;
- offsetT min_range, max_range;
- int argnum;
- unsigned int rtype;
-
- insn_error = NULL;
-
- /* If the instruction contains a '.', we first try to match an instruction
- including the '.'. Then we try again without the '.'. */
- insn = NULL;
- for (s = str; *s != '\0' && !ISSPACE (*s); ++s)
- continue;
-
- /* If we stopped on whitespace, then replace the whitespace with null for
- the call to hash_find. Save the character we replaced just in case we
- have to re-parse the instruction. */
- if (ISSPACE (*s))
- {
- save_c = *s;
- *s++ = '\0';
- }
-
- insn = (struct mips_opcode *) hash_find (op_hash, str);
-
- /* If we didn't find the instruction in the opcode table, try again, but
- this time with just the instruction up to, but not including the
- first '.'. */
- if (insn == NULL)
- {
- /* Restore the character we overwrite above (if any). */
- if (save_c)
- *(--s) = save_c;
-
- /* Scan up to the first '.' or whitespace. */
- for (s = str;
- *s != '\0' && *s != '.' && !ISSPACE (*s);
- ++s)
- continue;
-
- /* If we did not find a '.', then we can quit now. */
- if (*s != '.')
- {
- insn_error = "unrecognized opcode";
- return;
- }
-
- /* Lookup the instruction in the hash table. */
- *s++ = '\0';
- if ((insn = (struct mips_opcode *) hash_find (op_hash, str)) == NULL)
- {
- insn_error = "unrecognized opcode";
- return;
- }
- }
-
- argsStart = s;
- for (;;)
- {
- bfd_boolean ok;
-
- assert (strcmp (insn->name, str) == 0);
-
- ok = is_opcode_valid (insn, FALSE);
- if (! ok)
- {
- if (insn + 1 < &mips_opcodes[NUMOPCODES]
- && strcmp (insn->name, insn[1].name) == 0)
- {
- ++insn;
- continue;
- }
- else
- {
- if (!insn_error)
- {
- static char buf[100];
- sprintf (buf,
- _("opcode not supported on this processor: %s (%s)"),
- mips_cpu_info_from_arch (mips_opts.arch)->name,
- mips_cpu_info_from_isa (mips_opts.isa)->name);
- insn_error = buf;
- }
- if (save_c)
- *(--s) = save_c;
- return;
- }
- }
-
- create_insn (ip, insn);
- insn_error = NULL;
- argnum = 1;
- for (args = insn->args;; ++args)
- {
- int is_mdmx;
-
- s += strspn (s, " \t");
- is_mdmx = 0;
- switch (*args)
- {
- case '\0': /* end of args */
- if (*s == '\0')
- return;
- break;
-
- case '2': /* dsp 2-bit unsigned immediate in bit 11 */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number != 1
- && (unsigned long) imm_expr.X_add_number != 3)
- {
- as_bad (_("BALIGN immediate not 1 or 3 (%lu)"),
- (unsigned long) imm_expr.X_add_number);
- }
- INSERT_OPERAND (BP, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '3': /* dsp 3-bit unsigned immediate in bit 21 */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if (imm_expr.X_add_number & ~OP_MASK_SA3)
- {
- as_bad (_("DSP immediate not in range 0..%d (%lu)"),
- OP_MASK_SA3, (unsigned long) imm_expr.X_add_number);
- }
- INSERT_OPERAND (SA3, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '4': /* dsp 4-bit unsigned immediate in bit 21 */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if (imm_expr.X_add_number & ~OP_MASK_SA4)
- {
- as_bad (_("DSP immediate not in range 0..%d (%lu)"),
- OP_MASK_SA4, (unsigned long) imm_expr.X_add_number);
- }
- INSERT_OPERAND (SA4, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '5': /* dsp 8-bit unsigned immediate in bit 16 */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if (imm_expr.X_add_number & ~OP_MASK_IMM8)
- {
- as_bad (_("DSP immediate not in range 0..%d (%lu)"),
- OP_MASK_IMM8, (unsigned long) imm_expr.X_add_number);
- }
- INSERT_OPERAND (IMM8, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '6': /* dsp 5-bit unsigned immediate in bit 21 */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if (imm_expr.X_add_number & ~OP_MASK_RS)
- {
- as_bad (_("DSP immediate not in range 0..%d (%lu)"),
- OP_MASK_RS, (unsigned long) imm_expr.X_add_number);
- }
- INSERT_OPERAND (RS, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '7': /* four dsp accumulators in bits 11,12 */
- if (s[0] == '$' && s[1] == 'a' && s[2] == 'c' &&
- s[3] >= '0' && s[3] <= '3')
- {
- regno = s[3] - '0';
- s += 4;
- INSERT_OPERAND (DSPACC, *ip, regno);
- continue;
- }
- else
- as_bad (_("Invalid dsp acc register"));
- break;
-
- case '8': /* dsp 6-bit unsigned immediate in bit 11 */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if (imm_expr.X_add_number & ~OP_MASK_WRDSP)
- {
- as_bad (_("DSP immediate not in range 0..%d (%lu)"),
- OP_MASK_WRDSP,
- (unsigned long) imm_expr.X_add_number);
- }
- INSERT_OPERAND (WRDSP, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '9': /* four dsp accumulators in bits 21,22 */
- if (s[0] == '$' && s[1] == 'a' && s[2] == 'c' &&
- s[3] >= '0' && s[3] <= '3')
- {
- regno = s[3] - '0';
- s += 4;
- INSERT_OPERAND (DSPACC_S, *ip, regno);
- continue;
- }
- else
- as_bad (_("Invalid dsp acc register"));
- break;
-
- case '0': /* dsp 6-bit signed immediate in bit 20 */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- min_range = -((OP_MASK_DSPSFT + 1) >> 1);
- max_range = ((OP_MASK_DSPSFT + 1) >> 1) - 1;
- if (imm_expr.X_add_number < min_range ||
- imm_expr.X_add_number > max_range)
- {
- as_bad (_("DSP immediate not in range %ld..%ld (%ld)"),
- (long) min_range, (long) max_range,
- (long) imm_expr.X_add_number);
- }
- INSERT_OPERAND (DSPSFT, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '\'': /* dsp 6-bit unsigned immediate in bit 16 */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if (imm_expr.X_add_number & ~OP_MASK_RDDSP)
- {
- as_bad (_("DSP immediate not in range 0..%d (%lu)"),
- OP_MASK_RDDSP,
- (unsigned long) imm_expr.X_add_number);
- }
- INSERT_OPERAND (RDDSP, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case ':': /* dsp 7-bit signed immediate in bit 19 */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- min_range = -((OP_MASK_DSPSFT_7 + 1) >> 1);
- max_range = ((OP_MASK_DSPSFT_7 + 1) >> 1) - 1;
- if (imm_expr.X_add_number < min_range ||
- imm_expr.X_add_number > max_range)
- {
- as_bad (_("DSP immediate not in range %ld..%ld (%ld)"),
- (long) min_range, (long) max_range,
- (long) imm_expr.X_add_number);
- }
- INSERT_OPERAND (DSPSFT_7, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '@': /* dsp 10-bit signed immediate in bit 16 */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- min_range = -((OP_MASK_IMM10 + 1) >> 1);
- max_range = ((OP_MASK_IMM10 + 1) >> 1) - 1;
- if (imm_expr.X_add_number < min_range ||
- imm_expr.X_add_number > max_range)
- {
- as_bad (_("DSP immediate not in range %ld..%ld (%ld)"),
- (long) min_range, (long) max_range,
- (long) imm_expr.X_add_number);
- }
- INSERT_OPERAND (IMM10, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '!': /* MT usermode flag bit. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if (imm_expr.X_add_number & ~OP_MASK_MT_U)
- as_bad (_("MT usermode bit not 0 or 1 (%lu)"),
- (unsigned long) imm_expr.X_add_number);
- INSERT_OPERAND (MT_U, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '$': /* MT load high flag bit. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if (imm_expr.X_add_number & ~OP_MASK_MT_H)
- as_bad (_("MT load high bit not 0 or 1 (%lu)"),
- (unsigned long) imm_expr.X_add_number);
- INSERT_OPERAND (MT_H, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '*': /* four dsp accumulators in bits 18,19 */
- if (s[0] == '$' && s[1] == 'a' && s[2] == 'c' &&
- s[3] >= '0' && s[3] <= '3')
- {
- regno = s[3] - '0';
- s += 4;
- INSERT_OPERAND (MTACC_T, *ip, regno);
- continue;
- }
- else
- as_bad (_("Invalid dsp/smartmips acc register"));
- break;
-
- case '&': /* four dsp accumulators in bits 13,14 */
- if (s[0] == '$' && s[1] == 'a' && s[2] == 'c' &&
- s[3] >= '0' && s[3] <= '3')
- {
- regno = s[3] - '0';
- s += 4;
- INSERT_OPERAND (MTACC_D, *ip, regno);
- continue;
- }
- else
- as_bad (_("Invalid dsp/smartmips acc register"));
- break;
-
- case ',':
- ++argnum;
- if (*s++ == *args)
- continue;
- s--;
- switch (*++args)
- {
- case 'r':
- case 'v':
- INSERT_OPERAND (RS, *ip, lastregno);
- continue;
-
- case 'w':
- INSERT_OPERAND (RT, *ip, lastregno);
- continue;
-
- case 'W':
- INSERT_OPERAND (FT, *ip, lastregno);
- continue;
-
- case 'V':
- INSERT_OPERAND (FS, *ip, lastregno);
- continue;
- }
- break;
-
- case '(':
- /* Handle optional base register.
- Either the base register is omitted or
- we must have a left paren. */
- /* This is dependent on the next operand specifier
- is a base register specification. */
- assert (args[1] == 'b' || args[1] == '5'
- || args[1] == '-' || args[1] == '4');
- if (*s == '\0')
- return;
-
- case ')': /* these must match exactly */
- case '[':
- case ']':
- if (*s++ == *args)
- continue;
- break;
-
- case '+': /* Opcode extension character. */
- switch (*++args)
- {
- case '1': /* UDI immediates. */
- case '2':
- case '3':
- case '4':
- {
- const struct mips_immed *imm = mips_immed;
-
- while (imm->type && imm->type != *args)
- ++imm;
- if (! imm->type)
- internalError ();
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number & ~imm->mask)
- {
- as_warn (_("Illegal %s number (%lu, 0x%lx)"),
- imm->desc ? imm->desc : ip->insn_mo->name,
- (unsigned long) imm_expr.X_add_number,
- (unsigned long) imm_expr.X_add_number);
- imm_expr.X_add_number &= imm->mask;
- }
- ip->insn_opcode |= ((unsigned long) imm_expr.X_add_number
- << imm->shift);
- imm_expr.X_op = O_absent;
- s = expr_end;
- }
- continue;
-
- case 'A': /* ins/ext position, becomes LSB. */
- limlo = 0;
- limhi = 31;
- goto do_lsb;
- case 'E':
- limlo = 32;
- limhi = 63;
- goto do_lsb;
-do_lsb:
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number < limlo
- || (unsigned long) imm_expr.X_add_number > limhi)
- {
- as_bad (_("Improper position (%lu)"),
- (unsigned long) imm_expr.X_add_number);
- imm_expr.X_add_number = limlo;
- }
- lastpos = imm_expr.X_add_number;
- INSERT_OPERAND (SHAMT, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'B': /* ins size, becomes MSB. */
- limlo = 1;
- limhi = 32;
- goto do_msb;
- case 'F':
- limlo = 33;
- limhi = 64;
- goto do_msb;
-do_msb:
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- /* Check for negative input so that small negative numbers
- will not succeed incorrectly. The checks against
- (pos+size) transitively check "size" itself,
- assuming that "pos" is reasonable. */
- if ((long) imm_expr.X_add_number < 0
- || ((unsigned long) imm_expr.X_add_number
- + lastpos) < limlo
- || ((unsigned long) imm_expr.X_add_number
- + lastpos) > limhi)
- {
- as_bad (_("Improper insert size (%lu, position %lu)"),
- (unsigned long) imm_expr.X_add_number,
- (unsigned long) lastpos);
- imm_expr.X_add_number = limlo - lastpos;
- }
- INSERT_OPERAND (INSMSB, *ip,
- lastpos + imm_expr.X_add_number - 1);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'C': /* ext size, becomes MSBD. */
- limlo = 1;
- limhi = 32;
- goto do_msbd;
- case 'G':
- limlo = 33;
- limhi = 64;
- goto do_msbd;
- case 'H':
- limlo = 33;
- limhi = 64;
- goto do_msbd;
-do_msbd:
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- /* Check for negative input so that small negative numbers
- will not succeed incorrectly. The checks against
- (pos+size) transitively check "size" itself,
- assuming that "pos" is reasonable. */
- if ((long) imm_expr.X_add_number < 0
- || ((unsigned long) imm_expr.X_add_number
- + lastpos) < limlo
- || ((unsigned long) imm_expr.X_add_number
- + lastpos) > limhi)
- {
- as_bad (_("Improper extract size (%lu, position %lu)"),
- (unsigned long) imm_expr.X_add_number,
- (unsigned long) lastpos);
- imm_expr.X_add_number = limlo - lastpos;
- }
- INSERT_OPERAND (EXTMSBD, *ip, imm_expr.X_add_number - 1);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'D':
- /* +D is for disassembly only; never match. */
- break;
-
- case 'I':
- /* "+I" is like "I", except that imm2_expr is used. */
- my_getExpression (&imm2_expr, s);
- if (imm2_expr.X_op != O_big
- && imm2_expr.X_op != O_constant)
- insn_error = _("absolute expression required");
- if (HAVE_32BIT_GPRS)
- normalize_constant_expr (&imm2_expr);
- s = expr_end;
- continue;
-
- case 'T': /* Coprocessor register. */
- /* +T is for disassembly only; never match. */
- break;
-
- case 't': /* Coprocessor register number. */
- if (s[0] == '$' && ISDIGIT (s[1]))
- {
- ++s;
- regno = 0;
- do
- {
- regno *= 10;
- regno += *s - '0';
- ++s;
- }
- while (ISDIGIT (*s));
- if (regno > 31)
- as_bad (_("Invalid register number (%d)"), regno);
- else
- {
- INSERT_OPERAND (RT, *ip, regno);
- continue;
- }
- }
- else
- as_bad (_("Invalid coprocessor 0 register number"));
- break;
-
- case 'x':
- /* bbit[01] and bbit[01]32 bit index. Give error if index
- is not in the valid range. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned) imm_expr.X_add_number > 31)
- {
- as_bad (_("Improper bit index (%lu)"),
- (unsigned long) imm_expr.X_add_number);
- imm_expr.X_add_number = 0;
- }
- INSERT_OPERAND (BBITIND, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'X':
- /* bbit[01] bit index when bbit is used but we generate
- bbit[01]32 because the index is over 32. Move to the
- next candidate if index is not in the valid range. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned) imm_expr.X_add_number < 32
- || (unsigned) imm_expr.X_add_number > 63)
- break;
- INSERT_OPERAND (BBITIND, *ip, imm_expr.X_add_number - 32);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'p':
- /* cins, cins32, exts and exts32 position field. Give error
- if it's not in the valid range. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned) imm_expr.X_add_number > 31)
- {
- as_bad (_("Improper position (%lu)"),
- (unsigned long) imm_expr.X_add_number);
- imm_expr.X_add_number = 0;
- }
- /* Make the pos explicit to simplify +S. */
- lastpos = imm_expr.X_add_number + 32;
- INSERT_OPERAND (CINSPOS, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'P':
- /* cins, cins32, exts and exts32 position field. Move to
- the next candidate if it's not in the valid range. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned) imm_expr.X_add_number < 32
- || (unsigned) imm_expr.X_add_number > 63)
- break;
- lastpos = imm_expr.X_add_number;
- INSERT_OPERAND (CINSPOS, *ip, imm_expr.X_add_number - 32);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 's':
- /* cins and exts length-minus-one field. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > 31)
- {
- as_bad (_("Improper size (%lu)"),
- (unsigned long) imm_expr.X_add_number);
- imm_expr.X_add_number = 0;
- }
- INSERT_OPERAND (CINSLM1, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'S':
- /* cins32/exts32 and cins/exts aliasing cint32/exts32
- length-minus-one field. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((long) imm_expr.X_add_number < 0
- || (unsigned long) imm_expr.X_add_number + lastpos > 63)
- {
- as_bad (_("Improper size (%lu)"),
- (unsigned long) imm_expr.X_add_number);
- imm_expr.X_add_number = 0;
- }
- INSERT_OPERAND (CINSLM1, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'Q':
- /* seqi/snei immediate field. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((long) imm_expr.X_add_number < -512
- || (long) imm_expr.X_add_number >= 512)
- {
- as_bad (_("Improper immediate (%ld)"),
- (long) imm_expr.X_add_number);
- imm_expr.X_add_number = 0;
- }
- INSERT_OPERAND (SEQI, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- default:
- as_bad (_("internal: bad mips opcode (unknown extension operand type `+%c'): %s %s"),
- *args, insn->name, insn->args);
- /* Further processing is fruitless. */
- return;
- }
- break;
-
- case '<': /* must be at least one digit */
- /*
- * According to the manual, if the shift amount is greater
- * than 31 or less than 0, then the shift amount should be
- * mod 32. In reality the mips assembler issues an error.
- * We issue a warning and mask out all but the low 5 bits.
- */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > 31)
- as_warn (_("Improper shift amount (%lu)"),
- (unsigned long) imm_expr.X_add_number);
- INSERT_OPERAND (SHAMT, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '>': /* shift amount minus 32 */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number < 32
- || (unsigned long) imm_expr.X_add_number > 63)
- break;
- INSERT_OPERAND (SHAMT, *ip, imm_expr.X_add_number - 32);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'k': /* cache code */
- case 'h': /* prefx code */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > 31)
- as_warn (_("Invalid value for `%s' (%lu)"),
- ip->insn_mo->name,
- (unsigned long) imm_expr.X_add_number);
- if (*args == 'k')
- INSERT_OPERAND (CACHE, *ip, imm_expr.X_add_number);
- else
- INSERT_OPERAND (PREFX, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'c': /* break code */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > OP_MASK_CODE)
- as_warn (_("Code for %s not in range 0..1023 (%lu)"),
- ip->insn_mo->name,
- (unsigned long) imm_expr.X_add_number);
- INSERT_OPERAND (CODE, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'q': /* lower break code */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > OP_MASK_CODE2)
- as_warn (_("Lower code for %s not in range 0..1023 (%lu)"),
- ip->insn_mo->name,
- (unsigned long) imm_expr.X_add_number);
- INSERT_OPERAND (CODE2, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'B': /* 20-bit syscall/break code. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > OP_MASK_CODE20)
- as_warn (_("Code for %s not in range 0..1048575 (%lu)"),
- ip->insn_mo->name,
- (unsigned long) imm_expr.X_add_number);
- INSERT_OPERAND (CODE20, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'C': /* Coprocessor code */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > OP_MASK_COPZ)
- {
- as_warn (_("Coproccesor code > 25 bits (%lu)"),
- (unsigned long) imm_expr.X_add_number);
- imm_expr.X_add_number &= OP_MASK_COPZ;
- }
- INSERT_OPERAND (COPZ, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'J': /* 19-bit wait code. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > OP_MASK_CODE19)
- {
- as_warn (_("Illegal 19-bit code (%lu)"),
- (unsigned long) imm_expr.X_add_number);
- imm_expr.X_add_number &= OP_MASK_CODE19;
- }
- INSERT_OPERAND (CODE19, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'P': /* Performance register. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if (imm_expr.X_add_number != 0 && imm_expr.X_add_number != 1)
- as_warn (_("Invalid performance register (%lu)"),
- (unsigned long) imm_expr.X_add_number);
- INSERT_OPERAND (PERFREG, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'G': /* Coprocessor destination register. */
- if (((ip->insn_opcode >> OP_SH_OP) & OP_MASK_OP) == OP_OP_COP0)
- ok = reg_lookup (&s, RTYPE_NUM | RTYPE_CP0, &regno);
- else
- ok = reg_lookup (&s, RTYPE_NUM | RTYPE_GP, &regno);
- INSERT_OPERAND (RD, *ip, regno);
- if (ok)
- {
- lastregno = regno;
- continue;
- }
- else
- break;
-
- case 'b': /* base register */
- case 'd': /* destination register */
- case 's': /* source register */
- case 't': /* target register */
- case 'r': /* both target and source */
- case 'v': /* both dest and source */
- case 'w': /* both dest and target */
- case 'E': /* coprocessor target register */
- case 'K': /* 'rdhwr' destination register */
- case 'x': /* ignore register name */
- case 'z': /* must be zero register */
- case 'U': /* destination register (clo/clz). */
- case 'g': /* coprocessor destination register */
- s_reset = s;
- if (*args == 'E' || *args == 'K')
- ok = reg_lookup (&s, RTYPE_NUM, &regno);
- else
- {
- ok = reg_lookup (&s, RTYPE_NUM | RTYPE_GP, &regno);
- if (regno == AT && mips_opts.at)
- {
- if (mips_opts.at == ATREG)
- as_warn (_("used $at without \".set noat\""));
- else
- as_warn (_("used $%u with \".set at=$%u\""),
- regno, mips_opts.at);
- }
- }
- if (ok)
- {
- c = *args;
- if (*s == ' ')
- ++s;
- if (args[1] != *s)
- {
- if (c == 'r' || c == 'v' || c == 'w')
- {
- regno = lastregno;
- s = s_reset;
- ++args;
- }
- }
- /* 'z' only matches $0. */
- if (c == 'z' && regno != 0)
- break;
-
- if (c == 's' && !strcmp (ip->insn_mo->name, "jalr"))
- {
- if (regno == lastregno)
- {
- insn_error = _("source and destinationations must be different");
- continue;
- }
- if (regno == 31 && lastregno == 0)
- {
- insn_error = _("a destination register must be supplied");
- continue;
- }
- }
- /* Now that we have assembled one operand, we use the args string
- * to figure out where it goes in the instruction. */
- switch (c)
- {
- case 'r':
- case 's':
- case 'v':
- case 'b':
- INSERT_OPERAND (RS, *ip, regno);
- break;
- case 'd':
- case 'G':
- case 'K':
- case 'g':
- INSERT_OPERAND (RD, *ip, regno);
- break;
- case 'U':
- INSERT_OPERAND (RD, *ip, regno);
- INSERT_OPERAND (RT, *ip, regno);
- break;
- case 'w':
- case 't':
- case 'E':
- INSERT_OPERAND (RT, *ip, regno);
- break;
- case 'x':
- /* This case exists because on the r3000 trunc
- expands into a macro which requires a gp
- register. On the r6000 or r4000 it is
- assembled into a single instruction which
- ignores the register. Thus the insn version
- is MIPS_ISA2 and uses 'x', and the macro
- version is MIPS_ISA1 and uses 't'. */
- break;
- case 'z':
- /* This case is for the div instruction, which
- acts differently if the destination argument
- is $0. This only matches $0, and is checked
- outside the switch. */
- break;
- case 'D':
- /* Itbl operand; not yet implemented. FIXME ?? */
- break;
- /* What about all other operands like 'i', which
- can be specified in the opcode table? */
- }
- lastregno = regno;
- continue;
- }
- switch (*args++)
- {
- case 'r':
- case 'v':
- INSERT_OPERAND (RS, *ip, lastregno);
- continue;
- case 'w':
- INSERT_OPERAND (RT, *ip, lastregno);
- continue;
- }
- break;
-
- case 'O': /* MDMX alignment immediate constant. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > OP_MASK_ALN)
- as_warn ("Improper align amount (%ld), using low bits",
- (long) imm_expr.X_add_number);
- INSERT_OPERAND (ALN, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'Q': /* MDMX vector, element sel, or const. */
- if (s[0] != '$')
- {
- /* MDMX Immediate. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > OP_MASK_FT)
- as_warn (_("Invalid MDMX Immediate (%ld)"),
- (long) imm_expr.X_add_number);
- INSERT_OPERAND (FT, *ip, imm_expr.X_add_number);
- if (ip->insn_opcode & (OP_MASK_VSEL << OP_SH_VSEL))
- ip->insn_opcode |= MDMX_FMTSEL_IMM_QH << OP_SH_VSEL;
- else
- ip->insn_opcode |= MDMX_FMTSEL_IMM_OB << OP_SH_VSEL;
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
- }
- /* Not MDMX Immediate. Fall through. */
- case 'X': /* MDMX destination register. */
- case 'Y': /* MDMX source register. */
- case 'Z': /* MDMX target register. */
- is_mdmx = 1;
- case 'D': /* floating point destination register */
- case 'S': /* floating point source register */
- case 'T': /* floating point target register */
- case 'R': /* floating point source register */
- case 'V':
- case 'W':
- rtype = RTYPE_FPU;
- if (is_mdmx
- || (mips_opts.ase_mdmx
- && (ip->insn_mo->pinfo & FP_D)
- && (ip->insn_mo->pinfo & (INSN_COPROC_MOVE_DELAY
- | INSN_COPROC_MEMORY_DELAY
- | INSN_LOAD_COPROC_DELAY
- | INSN_LOAD_MEMORY_DELAY
- | INSN_STORE_MEMORY))))
- rtype |= RTYPE_VEC;
- s_reset = s;
- if (reg_lookup (&s, rtype, &regno))
- {
- if ((regno & 1) != 0
- && HAVE_32BIT_FPRS
- && ! mips_oddfpreg_ok (ip->insn_mo, argnum))
- as_warn (_("Float register should be even, was %d"),
- regno);
-
- c = *args;
- if (*s == ' ')
- ++s;
- if (args[1] != *s)
- {
- if (c == 'V' || c == 'W')
- {
- regno = lastregno;
- s = s_reset;
- ++args;
- }
- }
- switch (c)
- {
- case 'D':
- case 'X':
- INSERT_OPERAND (FD, *ip, regno);
- break;
- case 'V':
- case 'S':
- case 'Y':
- INSERT_OPERAND (FS, *ip, regno);
- break;
- case 'Q':
- /* This is like 'Z', but also needs to fix the MDMX
- vector/scalar select bits. Note that the
- scalar immediate case is handled above. */
- if (*s == '[')
- {
- int is_qh = (ip->insn_opcode & (1 << OP_SH_VSEL));
- int max_el = (is_qh ? 3 : 7);
- s++;
- my_getExpression(&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- s = expr_end;
- if (imm_expr.X_add_number > max_el)
- as_bad(_("Bad element selector %ld"),
- (long) imm_expr.X_add_number);
- imm_expr.X_add_number &= max_el;
- ip->insn_opcode |= (imm_expr.X_add_number
- << (OP_SH_VSEL +
- (is_qh ? 2 : 1)));
- imm_expr.X_op = O_absent;
- if (*s != ']')
- as_warn(_("Expecting ']' found '%s'"), s);
- else
- s++;
- }
- else
- {
- if (ip->insn_opcode & (OP_MASK_VSEL << OP_SH_VSEL))
- ip->insn_opcode |= (MDMX_FMTSEL_VEC_QH
- << OP_SH_VSEL);
- else
- ip->insn_opcode |= (MDMX_FMTSEL_VEC_OB <<
- OP_SH_VSEL);
- }
- /* Fall through */
- case 'W':
- case 'T':
- case 'Z':
- INSERT_OPERAND (FT, *ip, regno);
- break;
- case 'R':
- INSERT_OPERAND (FR, *ip, regno);
- break;
- }
- lastregno = regno;
- continue;
- }
-
- switch (*args++)
- {
- case 'V':
- INSERT_OPERAND (FS, *ip, lastregno);
- continue;
- case 'W':
- INSERT_OPERAND (FT, *ip, lastregno);
- continue;
- }
- break;
-
- case 'I':
- my_getExpression (&imm_expr, s);
- if (imm_expr.X_op != O_big
- && imm_expr.X_op != O_constant)
- insn_error = _("absolute expression required");
- if (HAVE_32BIT_GPRS)
- normalize_constant_expr (&imm_expr);
- s = expr_end;
- continue;
-
- case 'A':
- my_getExpression (&offset_expr, s);
- normalize_address_expr (&offset_expr);
- *imm_reloc = BFD_RELOC_32;
- s = expr_end;
- continue;
-
- case 'F':
- case 'L':
- case 'f':
- case 'l':
- {
- int f64;
- int using_gprs;
- char *save_in;
- char *err;
- unsigned char temp[8];
- int len;
- unsigned int length;
- segT seg;
- subsegT subseg;
- char *p;
-
- /* These only appear as the last operand in an
- instruction, and every instruction that accepts
- them in any variant accepts them in all variants.
- This means we don't have to worry about backing out
- any changes if the instruction does not match.
-
- The difference between them is the size of the
- floating point constant and where it goes. For 'F'
- and 'L' the constant is 64 bits; for 'f' and 'l' it
- is 32 bits. Where the constant is placed is based
- on how the MIPS assembler does things:
- F -- .rdata
- L -- .lit8
- f -- immediate value
- l -- .lit4
-
- The .lit4 and .lit8 sections are only used if
- permitted by the -G argument.
-
- The code below needs to know whether the target register
- is 32 or 64 bits wide. It relies on the fact 'f' and
- 'F' are used with GPR-based instructions and 'l' and
- 'L' are used with FPR-based instructions. */
-
- f64 = *args == 'F' || *args == 'L';
- using_gprs = *args == 'F' || *args == 'f';
-
- save_in = input_line_pointer;
- input_line_pointer = s;
- err = md_atof (f64 ? 'd' : 'f', (char *) temp, &len);
- length = len;
- s = input_line_pointer;
- input_line_pointer = save_in;
- if (err != NULL && *err != '\0')
- {
- as_bad (_("Bad floating point constant: %s"), err);
- memset (temp, '\0', sizeof temp);
- length = f64 ? 8 : 4;
- }
-
- assert (length == (unsigned) (f64 ? 8 : 4));
-
- if (*args == 'f'
- || (*args == 'l'
- && (g_switch_value < 4
- || (temp[0] == 0 && temp[1] == 0)
- || (temp[2] == 0 && temp[3] == 0))))
- {
- imm_expr.X_op = O_constant;
- if (! target_big_endian)
- imm_expr.X_add_number = bfd_getl32 (temp);
- else
- imm_expr.X_add_number = bfd_getb32 (temp);
- }
- else if (length > 4
- && ! mips_disable_float_construction
- /* Constants can only be constructed in GPRs and
- copied to FPRs if the GPRs are at least as wide
- as the FPRs. Force the constant into memory if
- we are using 64-bit FPRs but the GPRs are only
- 32 bits wide. */
- && (using_gprs
- || ! (HAVE_64BIT_FPRS && HAVE_32BIT_GPRS))
- && ((temp[0] == 0 && temp[1] == 0)
- || (temp[2] == 0 && temp[3] == 0))
- && ((temp[4] == 0 && temp[5] == 0)
- || (temp[6] == 0 && temp[7] == 0)))
- {
- /* The value is simple enough to load with a couple of
- instructions. If using 32-bit registers, set
- imm_expr to the high order 32 bits and offset_expr to
- the low order 32 bits. Otherwise, set imm_expr to
- the entire 64 bit constant. */
- if (using_gprs ? HAVE_32BIT_GPRS : HAVE_32BIT_FPRS)
- {
- imm_expr.X_op = O_constant;
- offset_expr.X_op = O_constant;
- if (! target_big_endian)
- {
- imm_expr.X_add_number = bfd_getl32 (temp + 4);
- offset_expr.X_add_number = bfd_getl32 (temp);
- }
- else
- {
- imm_expr.X_add_number = bfd_getb32 (temp);
- offset_expr.X_add_number = bfd_getb32 (temp + 4);
- }
- if (offset_expr.X_add_number == 0)
- offset_expr.X_op = O_absent;
- }
- else if (sizeof (imm_expr.X_add_number) > 4)
- {
- imm_expr.X_op = O_constant;
- if (! target_big_endian)
- imm_expr.X_add_number = bfd_getl64 (temp);
- else
- imm_expr.X_add_number = bfd_getb64 (temp);
- }
- else
- {
- imm_expr.X_op = O_big;
- imm_expr.X_add_number = 4;
- if (! target_big_endian)
- {
- generic_bignum[0] = bfd_getl16 (temp);
- generic_bignum[1] = bfd_getl16 (temp + 2);
- generic_bignum[2] = bfd_getl16 (temp + 4);
- generic_bignum[3] = bfd_getl16 (temp + 6);
- }
- else
- {
- generic_bignum[0] = bfd_getb16 (temp + 6);
- generic_bignum[1] = bfd_getb16 (temp + 4);
- generic_bignum[2] = bfd_getb16 (temp + 2);
- generic_bignum[3] = bfd_getb16 (temp);
- }
- }
- }
- else
- {
- const char *newname;
- segT new_seg;
-
- /* Switch to the right section. */
- seg = now_seg;
- subseg = now_subseg;
- switch (*args)
- {
- default: /* unused default case avoids warnings. */
- case 'L':
- newname = RDATA_SECTION_NAME;
- if (g_switch_value >= 8)
- newname = ".lit8";
- break;
- case 'F':
- newname = RDATA_SECTION_NAME;
- break;
- case 'l':
- assert (g_switch_value >= 4);
- newname = ".lit4";
- break;
- }
- new_seg = subseg_new (newname, (subsegT) 0);
- if (IS_ELF)
- bfd_set_section_flags (stdoutput, new_seg,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_READONLY
- | SEC_DATA));
- frag_align (*args == 'l' ? 2 : 3, 0, 0);
- if (IS_ELF && strncmp (TARGET_OS, "elf", 3) != 0)
- record_alignment (new_seg, 4);
- else
- record_alignment (new_seg, *args == 'l' ? 2 : 3);
- if (seg == now_seg)
- as_bad (_("Can't use floating point insn in this section"));
-
- /* Set the argument to the current address in the
- section. */
- offset_expr.X_op = O_symbol;
- offset_expr.X_add_symbol =
- symbol_new ("L0\001", now_seg,
- (valueT) frag_now_fix (), frag_now);
- offset_expr.X_add_number = 0;
-
- /* Put the floating point number into the section. */
- p = frag_more ((int) length);
- memcpy (p, temp, length);
-
- /* Switch back to the original section. */
- subseg_set (seg, subseg);
- }
- }
- continue;
-
- case 'i': /* 16 bit unsigned immediate */
- case 'j': /* 16 bit signed immediate */
- *imm_reloc = BFD_RELOC_LO16;
- if (my_getSmallExpression (&imm_expr, imm_reloc, s) == 0)
- {
- int more;
- offsetT minval, maxval;
-
- more = (insn + 1 < &mips_opcodes[NUMOPCODES]
- && strcmp (insn->name, insn[1].name) == 0);
-
- /* If the expression was written as an unsigned number,
- only treat it as signed if there are no more
- alternatives. */
- if (more
- && *args == 'j'
- && sizeof (imm_expr.X_add_number) <= 4
- && imm_expr.X_op == O_constant
- && imm_expr.X_add_number < 0
- && imm_expr.X_unsigned
- && HAVE_64BIT_GPRS)
- break;
-
- /* For compatibility with older assemblers, we accept
- 0x8000-0xffff as signed 16-bit numbers when only
- signed numbers are allowed. */
- if (*args == 'i')
- minval = 0, maxval = 0xffff;
- else if (more)
- minval = -0x8000, maxval = 0x7fff;
- else
- minval = -0x8000, maxval = 0xffff;
-
- if (imm_expr.X_op != O_constant
- || imm_expr.X_add_number < minval
- || imm_expr.X_add_number > maxval)
- {
- if (more)
- break;
- if (imm_expr.X_op == O_constant
- || imm_expr.X_op == O_big)
- as_bad (_("expression out of range"));
- }
- }
- s = expr_end;
- continue;
-
- case 'o': /* 16 bit offset */
- /* Check whether there is only a single bracketed expression
- left. If so, it must be the base register and the
- constant must be zero. */
- if (*s == '(' && strchr (s + 1, '(') == 0)
- {
- offset_expr.X_op = O_constant;
- offset_expr.X_add_number = 0;
- continue;
- }
-
- /* If this value won't fit into a 16 bit offset, then go
- find a macro that will generate the 32 bit offset
- code pattern. */
- if (my_getSmallExpression (&offset_expr, offset_reloc, s) == 0
- && (offset_expr.X_op != O_constant
- || offset_expr.X_add_number >= 0x8000
- || offset_expr.X_add_number < -0x8000))
- break;
-
- s = expr_end;
- continue;
-
- case 'p': /* pc relative offset */
- *offset_reloc = BFD_RELOC_16_PCREL_S2;
- my_getExpression (&offset_expr, s);
- s = expr_end;
- continue;
-
- case 'u': /* upper 16 bits */
- if (my_getSmallExpression (&imm_expr, imm_reloc, s) == 0
- && imm_expr.X_op == O_constant
- && (imm_expr.X_add_number < 0
- || imm_expr.X_add_number >= 0x10000))
- as_bad (_("lui expression not in range 0..65535"));
- s = expr_end;
- continue;
-
- case 'a': /* 26 bit address */
- my_getExpression (&offset_expr, s);
- s = expr_end;
- *offset_reloc = BFD_RELOC_MIPS_JMP;
- continue;
-
- case 'N': /* 3 bit branch condition code */
- case 'M': /* 3 bit compare condition code */
- rtype = RTYPE_CCC;
- if (ip->insn_mo->pinfo & (FP_D| FP_S))
- rtype |= RTYPE_FCC;
- if (!reg_lookup (&s, rtype, &regno))
- break;
- if ((strcmp(str + strlen(str) - 3, ".ps") == 0
- || strcmp(str + strlen(str) - 5, "any2f") == 0
- || strcmp(str + strlen(str) - 5, "any2t") == 0)
- && (regno & 1) != 0)
- as_warn(_("Condition code register should be even for %s, was %d"),
- str, regno);
- if ((strcmp(str + strlen(str) - 5, "any4f") == 0
- || strcmp(str + strlen(str) - 5, "any4t") == 0)
- && (regno & 3) != 0)
- as_warn(_("Condition code register should be 0 or 4 for %s, was %d"),
- str, regno);
- if (*args == 'N')
- INSERT_OPERAND (BCC, *ip, regno);
- else
- INSERT_OPERAND (CCC, *ip, regno);
- continue;
-
- case 'H':
- if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X'))
- s += 2;
- if (ISDIGIT (*s))
- {
- c = 0;
- do
- {
- c *= 10;
- c += *s - '0';
- ++s;
- }
- while (ISDIGIT (*s));
- }
- else
- c = 8; /* Invalid sel value. */
-
- if (c > 7)
- as_bad (_("invalid coprocessor sub-selection value (0-7)"));
- ip->insn_opcode |= c;
- continue;
-
- case 'e':
- /* Must be at least one digit. */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
-
- if ((unsigned long) imm_expr.X_add_number
- > (unsigned long) OP_MASK_VECBYTE)
- {
- as_bad (_("bad byte vector index (%ld)"),
- (long) imm_expr.X_add_number);
- imm_expr.X_add_number = 0;
- }
-
- INSERT_OPERAND (VECBYTE, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case '%':
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
-
- if ((unsigned long) imm_expr.X_add_number
- > (unsigned long) OP_MASK_VECALIGN)
- {
- as_bad (_("bad byte vector index (%ld)"),
- (long) imm_expr.X_add_number);
- imm_expr.X_add_number = 0;
- }
-
- INSERT_OPERAND (VECALIGN, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- default:
- as_bad (_("bad char = '%c'\n"), *args);
- internalError ();
- }
- break;
- }
- /* Args don't match. */
- if (insn + 1 < &mips_opcodes[NUMOPCODES] &&
- !strcmp (insn->name, insn[1].name))
- {
- ++insn;
- s = argsStart;
- insn_error = _("illegal operands");
- continue;
- }
- if (save_c)
- *(--argsStart) = save_c;
- insn_error = _("illegal operands");
- return;
- }
-}
-
-#define SKIP_SPACE_TABS(S) { while (*(S) == ' ' || *(S) == '\t') ++(S); }
-
-/* This routine assembles an instruction into its binary format when
- assembling for the mips16. As a side effect, it sets one of the
- global variables imm_reloc or offset_reloc to the type of
- relocation to do if one of the operands is an address expression.
- It also sets mips16_small and mips16_ext if the user explicitly
- requested a small or extended instruction. */
-
-static void
-mips16_ip (char *str, struct mips_cl_insn *ip)
-{
- char *s;
- const char *args;
- struct mips_opcode *insn;
- char *argsstart;
- unsigned int regno;
- unsigned int lastregno = 0;
- char *s_reset;
- size_t i;
-
- insn_error = NULL;
-
- mips16_small = FALSE;
- mips16_ext = FALSE;
-
- for (s = str; ISLOWER (*s); ++s)
- ;
- switch (*s)
- {
- case '\0':
- break;
-
- case ' ':
- *s++ = '\0';
- break;
-
- case '.':
- if (s[1] == 't' && s[2] == ' ')
- {
- *s = '\0';
- mips16_small = TRUE;
- s += 3;
- break;
- }
- else if (s[1] == 'e' && s[2] == ' ')
- {
- *s = '\0';
- mips16_ext = TRUE;
- s += 3;
- break;
- }
- /* Fall through. */
- default:
- insn_error = _("unknown opcode");
- return;
- }
-
- if (mips_opts.noautoextend && ! mips16_ext)
- mips16_small = TRUE;
-
- if ((insn = (struct mips_opcode *) hash_find (mips16_op_hash, str)) == NULL)
- {
- insn_error = _("unrecognized opcode");
- return;
- }
-
- argsstart = s;
- for (;;)
- {
- bfd_boolean ok;
-
- assert (strcmp (insn->name, str) == 0);
-
- ok = is_opcode_valid_16 (insn);
- if (! ok)
- {
- if (insn + 1 < &mips16_opcodes[bfd_mips16_num_opcodes]
- && strcmp (insn->name, insn[1].name) == 0)
- {
- ++insn;
- continue;
- }
- else
- {
- if (!insn_error)
- {
- static char buf[100];
- sprintf (buf,
- _("opcode not supported on this processor: %s (%s)"),
- mips_cpu_info_from_arch (mips_opts.arch)->name,
- mips_cpu_info_from_isa (mips_opts.isa)->name);
- insn_error = buf;
- }
- return;
- }
- }
-
- create_insn (ip, insn);
- imm_expr.X_op = O_absent;
- imm_reloc[0] = BFD_RELOC_UNUSED;
- imm_reloc[1] = BFD_RELOC_UNUSED;
- imm_reloc[2] = BFD_RELOC_UNUSED;
- imm2_expr.X_op = O_absent;
- offset_expr.X_op = O_absent;
- offset_reloc[0] = BFD_RELOC_UNUSED;
- offset_reloc[1] = BFD_RELOC_UNUSED;
- offset_reloc[2] = BFD_RELOC_UNUSED;
- for (args = insn->args; 1; ++args)
- {
- int c;
-
- if (*s == ' ')
- ++s;
-
- /* In this switch statement we call break if we did not find
- a match, continue if we did find a match, or return if we
- are done. */
-
- c = *args;
- switch (c)
- {
- case '\0':
- if (*s == '\0')
- {
- /* Stuff the immediate value in now, if we can. */
- if (imm_expr.X_op == O_constant
- && *imm_reloc > BFD_RELOC_UNUSED
- && insn->pinfo != INSN_MACRO)
- {
- valueT tmp;
-
- switch (*offset_reloc)
- {
- case BFD_RELOC_MIPS16_HI16_S:
- tmp = (imm_expr.X_add_number + 0x8000) >> 16;
- break;
-
- case BFD_RELOC_MIPS16_HI16:
- tmp = imm_expr.X_add_number >> 16;
- break;
-
- case BFD_RELOC_MIPS16_LO16:
- tmp = ((imm_expr.X_add_number + 0x8000) & 0xffff)
- - 0x8000;
- break;
-
- case BFD_RELOC_UNUSED:
- tmp = imm_expr.X_add_number;
- break;
-
- default:
- internalError ();
- }
- *offset_reloc = BFD_RELOC_UNUSED;
-
- mips16_immed (NULL, 0, *imm_reloc - BFD_RELOC_UNUSED,
- tmp, TRUE, mips16_small,
- mips16_ext, &ip->insn_opcode,
- &ip->use_extend, &ip->extend);
- imm_expr.X_op = O_absent;
- *imm_reloc = BFD_RELOC_UNUSED;
- }
-
- return;
- }
- break;
-
- case ',':
- if (*s++ == c)
- continue;
- s--;
- switch (*++args)
- {
- case 'v':
- MIPS16_INSERT_OPERAND (RX, *ip, lastregno);
- continue;
- case 'w':
- MIPS16_INSERT_OPERAND (RY, *ip, lastregno);
- continue;
- }
- break;
-
- case '(':
- case ')':
- if (*s++ == c)
- continue;
- break;
-
- case 'v':
- case 'w':
- if (s[0] != '$')
- {
- if (c == 'v')
- MIPS16_INSERT_OPERAND (RX, *ip, lastregno);
- else
- MIPS16_INSERT_OPERAND (RY, *ip, lastregno);
- ++args;
- continue;
- }
- /* Fall through. */
- case 'x':
- case 'y':
- case 'z':
- case 'Z':
- case '0':
- case 'S':
- case 'R':
- case 'X':
- case 'Y':
- s_reset = s;
- if (!reg_lookup (&s, RTYPE_NUM | RTYPE_GP, &regno))
- {
- if (c == 'v' || c == 'w')
- {
- if (c == 'v')
- MIPS16_INSERT_OPERAND (RX, *ip, lastregno);
- else
- MIPS16_INSERT_OPERAND (RY, *ip, lastregno);
- ++args;
- continue;
- }
- break;
- }
-
- if (*s == ' ')
- ++s;
- if (args[1] != *s)
- {
- if (c == 'v' || c == 'w')
- {
- regno = mips16_to_32_reg_map[lastregno];
- s = s_reset;
- ++args;
- }
- }
-
- switch (c)
- {
- case 'x':
- case 'y':
- case 'z':
- case 'v':
- case 'w':
- case 'Z':
- regno = mips32_to_16_reg_map[regno];
- break;
-
- case '0':
- if (regno != 0)
- regno = ILLEGAL_REG;
- break;
-
- case 'S':
- if (regno != SP)
- regno = ILLEGAL_REG;
- break;
-
- case 'R':
- if (regno != RA)
- regno = ILLEGAL_REG;
- break;
-
- case 'X':
- case 'Y':
- if (regno == AT && mips_opts.at)
- {
- if (mips_opts.at == ATREG)
- as_warn (_("used $at without \".set noat\""));
- else
- as_warn (_("used $%u with \".set at=$%u\""),
- regno, mips_opts.at);
- }
- break;
-
- default:
- internalError ();
- }
-
- if (regno == ILLEGAL_REG)
- break;
-
- switch (c)
- {
- case 'x':
- case 'v':
- MIPS16_INSERT_OPERAND (RX, *ip, regno);
- break;
- case 'y':
- case 'w':
- MIPS16_INSERT_OPERAND (RY, *ip, regno);
- break;
- case 'z':
- MIPS16_INSERT_OPERAND (RZ, *ip, regno);
- break;
- case 'Z':
- MIPS16_INSERT_OPERAND (MOVE32Z, *ip, regno);
- case '0':
- case 'S':
- case 'R':
- break;
- case 'X':
- MIPS16_INSERT_OPERAND (REGR32, *ip, regno);
- break;
- case 'Y':
- regno = ((regno & 7) << 2) | ((regno & 0x18) >> 3);
- MIPS16_INSERT_OPERAND (REG32R, *ip, regno);
- break;
- default:
- internalError ();
- }
-
- lastregno = regno;
- continue;
-
- case 'P':
- if (strncmp (s, "$pc", 3) == 0)
- {
- s += 3;
- continue;
- }
- break;
-
- case '5':
- case 'H':
- case 'W':
- case 'D':
- case 'j':
- case 'V':
- case 'C':
- case 'U':
- case 'k':
- case 'K':
- i = my_getSmallExpression (&imm_expr, imm_reloc, s);
- if (i > 0)
- {
- if (imm_expr.X_op != O_constant)
- {
- mips16_ext = TRUE;
- ip->use_extend = TRUE;
- ip->extend = 0;
- }
- else
- {
- /* We need to relax this instruction. */
- *offset_reloc = *imm_reloc;
- *imm_reloc = (int) BFD_RELOC_UNUSED + c;
- }
- s = expr_end;
- continue;
- }
- *imm_reloc = BFD_RELOC_UNUSED;
- /* Fall through. */
- case '<':
- case '>':
- case '[':
- case ']':
- case '4':
- case '8':
- my_getExpression (&imm_expr, s);
- if (imm_expr.X_op == O_register)
- {
- /* What we thought was an expression turned out to
- be a register. */
-
- if (s[0] == '(' && args[1] == '(')
- {
- /* It looks like the expression was omitted
- before a register indirection, which means
- that the expression is implicitly zero. We
- still set up imm_expr, so that we handle
- explicit extensions correctly. */
- imm_expr.X_op = O_constant;
- imm_expr.X_add_number = 0;
- *imm_reloc = (int) BFD_RELOC_UNUSED + c;
- continue;
- }
-
- break;
- }
-
- /* We need to relax this instruction. */
- *imm_reloc = (int) BFD_RELOC_UNUSED + c;
- s = expr_end;
- continue;
-
- case 'p':
- case 'q':
- case 'A':
- case 'B':
- case 'E':
- /* We use offset_reloc rather than imm_reloc for the PC
- relative operands. This lets macros with both
- immediate and address operands work correctly. */
- my_getExpression (&offset_expr, s);
-
- if (offset_expr.X_op == O_register)
- break;
-
- /* We need to relax this instruction. */
- *offset_reloc = (int) BFD_RELOC_UNUSED + c;
- s = expr_end;
- continue;
-
- case '6': /* break code */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > 63)
- as_warn (_("Invalid value for `%s' (%lu)"),
- ip->insn_mo->name,
- (unsigned long) imm_expr.X_add_number);
- MIPS16_INSERT_OPERAND (IMM6, *ip, imm_expr.X_add_number);
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- case 'a': /* 26 bit address */
- my_getExpression (&offset_expr, s);
- s = expr_end;
- *offset_reloc = BFD_RELOC_MIPS16_JMP;
- ip->insn_opcode <<= 16;
- continue;
-
- case 'l': /* register list for entry macro */
- case 'L': /* register list for exit macro */
- {
- int mask;
-
- if (c == 'l')
- mask = 0;
- else
- mask = 7 << 3;
- while (*s != '\0')
- {
- unsigned int freg, reg1, reg2;
-
- while (*s == ' ' || *s == ',')
- ++s;
- if (reg_lookup (&s, RTYPE_GP | RTYPE_NUM, &reg1))
- freg = 0;
- else if (reg_lookup (&s, RTYPE_FPU, &reg1))
- freg = 1;
- else
- {
- as_bad (_("can't parse register list"));
- break;
- }
- if (*s == ' ')
- ++s;
- if (*s != '-')
- reg2 = reg1;
- else
- {
- ++s;
- if (!reg_lookup (&s, freg ? RTYPE_FPU
- : (RTYPE_GP | RTYPE_NUM), &reg2))
- {
- as_bad (_("invalid register list"));
- break;
- }
- }
- if (freg && reg1 == 0 && reg2 == 0 && c == 'L')
- {
- mask &= ~ (7 << 3);
- mask |= 5 << 3;
- }
- else if (freg && reg1 == 0 && reg2 == 1 && c == 'L')
- {
- mask &= ~ (7 << 3);
- mask |= 6 << 3;
- }
- else if (reg1 == 4 && reg2 >= 4 && reg2 <= 7 && c != 'L')
- mask |= (reg2 - 3) << 3;
- else if (reg1 == 16 && reg2 >= 16 && reg2 <= 17)
- mask |= (reg2 - 15) << 1;
- else if (reg1 == RA && reg2 == RA)
- mask |= 1;
- else
- {
- as_bad (_("invalid register list"));
- break;
- }
- }
- /* The mask is filled in in the opcode table for the
- benefit of the disassembler. We remove it before
- applying the actual mask. */
- ip->insn_opcode &= ~ ((7 << 3) << MIPS16OP_SH_IMM6);
- ip->insn_opcode |= mask << MIPS16OP_SH_IMM6;
- }
- continue;
-
- case 'm': /* Register list for save insn. */
- case 'M': /* Register list for restore insn. */
- {
- int opcode = 0;
- int framesz = 0, seen_framesz = 0;
- int args = 0, statics = 0, sregs = 0;
-
- while (*s != '\0')
- {
- unsigned int reg1, reg2;
-
- SKIP_SPACE_TABS (s);
- while (*s == ',')
- ++s;
- SKIP_SPACE_TABS (s);
-
- my_getExpression (&imm_expr, s);
- if (imm_expr.X_op == O_constant)
- {
- /* Handle the frame size. */
- if (seen_framesz)
- {
- as_bad (_("more than one frame size in list"));
- break;
- }
- seen_framesz = 1;
- framesz = imm_expr.X_add_number;
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
- }
-
- if (! reg_lookup (&s, RTYPE_GP | RTYPE_NUM, &reg1))
- {
- as_bad (_("can't parse register list"));
- break;
- }
-
- while (*s == ' ')
- ++s;
-
- if (*s != '-')
- reg2 = reg1;
- else
- {
- ++s;
- if (! reg_lookup (&s, RTYPE_GP | RTYPE_NUM, &reg2)
- || reg2 < reg1)
- {
- as_bad (_("can't parse register list"));
- break;
- }
- }
-
- while (reg1 <= reg2)
- {
- if (reg1 >= 4 && reg1 <= 7)
- {
- if (!seen_framesz)
- /* args $a0-$a3 */
- args |= 1 << (reg1 - 4);
- else
- /* statics $a0-$a3 */
- statics |= 1 << (reg1 - 4);
- }
- else if ((reg1 >= 16 && reg1 <= 23) || reg1 == 30)
- {
- /* $s0-$s8 */
- sregs |= 1 << ((reg1 == 30) ? 8 : (reg1 - 16));
- }
- else if (reg1 == 31)
- {
- /* Add $ra to insn. */
- opcode |= 0x40;
- }
- else
- {
- as_bad (_("unexpected register in list"));
- break;
- }
- if (++reg1 == 24)
- reg1 = 30;
- }
- }
-
- /* Encode args/statics combination. */
- if (args & statics)
- as_bad (_("arg/static registers overlap"));
- else if (args == 0xf)
- /* All $a0-$a3 are args. */
- opcode |= MIPS16_ALL_ARGS << 16;
- else if (statics == 0xf)
- /* All $a0-$a3 are statics. */
- opcode |= MIPS16_ALL_STATICS << 16;
- else
- {
- int narg = 0, nstat = 0;
-
- /* Count arg registers. */
- while (args & 0x1)
- {
- args >>= 1;
- narg++;
- }
- if (args != 0)
- as_bad (_("invalid arg register list"));
-
- /* Count static registers. */
- while (statics & 0x8)
- {
- statics = (statics << 1) & 0xf;
- nstat++;
- }
- if (statics != 0)
- as_bad (_("invalid static register list"));
-
- /* Encode args/statics. */
- opcode |= ((narg << 2) | nstat) << 16;
- }
-
- /* Encode $s0/$s1. */
- if (sregs & (1 << 0)) /* $s0 */
- opcode |= 0x20;
- if (sregs & (1 << 1)) /* $s1 */
- opcode |= 0x10;
- sregs >>= 2;
-
- if (sregs != 0)
- {
- /* Count regs $s2-$s8. */
- int nsreg = 0;
- while (sregs & 1)
- {
- sregs >>= 1;
- nsreg++;
- }
- if (sregs != 0)
- as_bad (_("invalid static register list"));
- /* Encode $s2-$s8. */
- opcode |= nsreg << 24;
- }
-
- /* Encode frame size. */
- if (!seen_framesz)
- as_bad (_("missing frame size"));
- else if ((framesz & 7) != 0 || framesz < 0
- || framesz > 0xff * 8)
- as_bad (_("invalid frame size"));
- else if (framesz != 128 || (opcode >> 16) != 0)
- {
- framesz /= 8;
- opcode |= (((framesz & 0xf0) << 16)
- | (framesz & 0x0f));
- }
-
- /* Finally build the instruction. */
- if ((opcode >> 16) != 0 || framesz == 0)
- {
- ip->use_extend = TRUE;
- ip->extend = opcode >> 16;
- }
- ip->insn_opcode |= opcode & 0x7f;
- }
- continue;
-
- case 'e': /* extend code */
- my_getExpression (&imm_expr, s);
- check_absolute_expr (ip, &imm_expr);
- if ((unsigned long) imm_expr.X_add_number > 0x7ff)
- {
- as_warn (_("Invalid value for `%s' (%lu)"),
- ip->insn_mo->name,
- (unsigned long) imm_expr.X_add_number);
- imm_expr.X_add_number &= 0x7ff;
- }
- ip->insn_opcode |= imm_expr.X_add_number;
- imm_expr.X_op = O_absent;
- s = expr_end;
- continue;
-
- default:
- internalError ();
- }
- break;
- }
-
- /* Args don't match. */
- if (insn + 1 < &mips16_opcodes[bfd_mips16_num_opcodes] &&
- strcmp (insn->name, insn[1].name) == 0)
- {
- ++insn;
- s = argsstart;
- continue;
- }
-
- insn_error = _("illegal operands");
-
- return;
- }
-}
-
-/* This structure holds information we know about a mips16 immediate
- argument type. */
-
-struct mips16_immed_operand
-{
- /* The type code used in the argument string in the opcode table. */
- int type;
- /* The number of bits in the short form of the opcode. */
- int nbits;
- /* The number of bits in the extended form of the opcode. */
- int extbits;
- /* The amount by which the short form is shifted when it is used;
- for example, the sw instruction has a shift count of 2. */
- int shift;
- /* The amount by which the short form is shifted when it is stored
- into the instruction code. */
- int op_shift;
- /* Non-zero if the short form is unsigned. */
- int unsp;
- /* Non-zero if the extended form is unsigned. */
- int extu;
- /* Non-zero if the value is PC relative. */
- int pcrel;
-};
-
-/* The mips16 immediate operand types. */
-
-static const struct mips16_immed_operand mips16_immed_operands[] =
-{
- { '<', 3, 5, 0, MIPS16OP_SH_RZ, 1, 1, 0 },
- { '>', 3, 5, 0, MIPS16OP_SH_RX, 1, 1, 0 },
- { '[', 3, 6, 0, MIPS16OP_SH_RZ, 1, 1, 0 },
- { ']', 3, 6, 0, MIPS16OP_SH_RX, 1, 1, 0 },
- { '4', 4, 15, 0, MIPS16OP_SH_IMM4, 0, 0, 0 },
- { '5', 5, 16, 0, MIPS16OP_SH_IMM5, 1, 0, 0 },
- { 'H', 5, 16, 1, MIPS16OP_SH_IMM5, 1, 0, 0 },
- { 'W', 5, 16, 2, MIPS16OP_SH_IMM5, 1, 0, 0 },
- { 'D', 5, 16, 3, MIPS16OP_SH_IMM5, 1, 0, 0 },
- { 'j', 5, 16, 0, MIPS16OP_SH_IMM5, 0, 0, 0 },
- { '8', 8, 16, 0, MIPS16OP_SH_IMM8, 1, 0, 0 },
- { 'V', 8, 16, 2, MIPS16OP_SH_IMM8, 1, 0, 0 },
- { 'C', 8, 16, 3, MIPS16OP_SH_IMM8, 1, 0, 0 },
- { 'U', 8, 16, 0, MIPS16OP_SH_IMM8, 1, 1, 0 },
- { 'k', 8, 16, 0, MIPS16OP_SH_IMM8, 0, 0, 0 },
- { 'K', 8, 16, 3, MIPS16OP_SH_IMM8, 0, 0, 0 },
- { 'p', 8, 16, 0, MIPS16OP_SH_IMM8, 0, 0, 1 },
- { 'q', 11, 16, 0, MIPS16OP_SH_IMM8, 0, 0, 1 },
- { 'A', 8, 16, 2, MIPS16OP_SH_IMM8, 1, 0, 1 },
- { 'B', 5, 16, 3, MIPS16OP_SH_IMM5, 1, 0, 1 },
- { 'E', 5, 16, 2, MIPS16OP_SH_IMM5, 1, 0, 1 }
-};
-
-#define MIPS16_NUM_IMMED \
- (sizeof mips16_immed_operands / sizeof mips16_immed_operands[0])
-
-/* Handle a mips16 instruction with an immediate value. This or's the
- small immediate value into *INSN. It sets *USE_EXTEND to indicate
- whether an extended value is needed; if one is needed, it sets
- *EXTEND to the value. The argument type is TYPE. The value is VAL.
- If SMALL is true, an unextended opcode was explicitly requested.
- If EXT is true, an extended opcode was explicitly requested. If
- WARN is true, warn if EXT does not match reality. */
-
-static void
-mips16_immed (char *file, unsigned int line, int type, offsetT val,
- bfd_boolean warn, bfd_boolean small, bfd_boolean ext,
- unsigned long *insn, bfd_boolean *use_extend,
- unsigned short *extend)
-{
- const struct mips16_immed_operand *op;
- int mintiny, maxtiny;
- bfd_boolean needext;
-
- op = mips16_immed_operands;
- while (op->type != type)
- {
- ++op;
- assert (op < mips16_immed_operands + MIPS16_NUM_IMMED);
- }
-
- if (op->unsp)
- {
- if (type == '<' || type == '>' || type == '[' || type == ']')
- {
- mintiny = 1;
- maxtiny = 1 << op->nbits;
- }
- else
- {
- mintiny = 0;
- maxtiny = (1 << op->nbits) - 1;
- }
- }
- else
- {
- mintiny = - (1 << (op->nbits - 1));
- maxtiny = (1 << (op->nbits - 1)) - 1;
- }
-
- /* Branch offsets have an implicit 0 in the lowest bit. */
- if (type == 'p' || type == 'q')
- val /= 2;
-
- if ((val & ((1 << op->shift) - 1)) != 0
- || val < (mintiny << op->shift)
- || val > (maxtiny << op->shift))
- needext = TRUE;
- else
- needext = FALSE;
-
- if (warn && ext && ! needext)
- as_warn_where (file, line,
- _("extended operand requested but not required"));
- if (small && needext)
- as_bad_where (file, line, _("invalid unextended operand value"));
-
- if (small || (! ext && ! needext))
- {
- int insnval;
-
- *use_extend = FALSE;
- insnval = ((val >> op->shift) & ((1 << op->nbits) - 1));
- insnval <<= op->op_shift;
- *insn |= insnval;
- }
- else
- {
- long minext, maxext;
- int extval;
-
- if (op->extu)
- {
- minext = 0;
- maxext = (1 << op->extbits) - 1;
- }
- else
- {
- minext = - (1 << (op->extbits - 1));
- maxext = (1 << (op->extbits - 1)) - 1;
- }
- if (val < minext || val > maxext)
- as_bad_where (file, line,
- _("operand value out of range for instruction"));
-
- *use_extend = TRUE;
- if (op->extbits == 16)
- {
- extval = ((val >> 11) & 0x1f) | (val & 0x7e0);
- val &= 0x1f;
- }
- else if (op->extbits == 15)
- {
- extval = ((val >> 11) & 0xf) | (val & 0x7f0);
- val &= 0xf;
- }
- else
- {
- extval = ((val & 0x1f) << 6) | (val & 0x20);
- val = 0;
- }
-
- *extend = (unsigned short) extval;
- *insn |= val;
- }
-}
-
-struct percent_op_match
-{
- const char *str;
- bfd_reloc_code_real_type reloc;
-};
-
-static const struct percent_op_match mips_percent_op[] =
-{
- {"%lo", BFD_RELOC_LO16},
-#ifdef OBJ_ELF
- {"%call_hi", BFD_RELOC_MIPS_CALL_HI16},
- {"%call_lo", BFD_RELOC_MIPS_CALL_LO16},
- {"%call16", BFD_RELOC_MIPS_CALL16},
- {"%got_disp", BFD_RELOC_MIPS_GOT_DISP},
- {"%got_page", BFD_RELOC_MIPS_GOT_PAGE},
- {"%got_ofst", BFD_RELOC_MIPS_GOT_OFST},
- {"%got_hi", BFD_RELOC_MIPS_GOT_HI16},
- {"%got_lo", BFD_RELOC_MIPS_GOT_LO16},
- {"%got", BFD_RELOC_MIPS_GOT16},
- {"%gp_rel", BFD_RELOC_GPREL16},
- {"%half", BFD_RELOC_16},
- {"%highest", BFD_RELOC_MIPS_HIGHEST},
- {"%higher", BFD_RELOC_MIPS_HIGHER},
- {"%neg", BFD_RELOC_MIPS_SUB},
- {"%tlsgd", BFD_RELOC_MIPS_TLS_GD},
- {"%tlsldm", BFD_RELOC_MIPS_TLS_LDM},
- {"%dtprel_hi", BFD_RELOC_MIPS_TLS_DTPREL_HI16},
- {"%dtprel_lo", BFD_RELOC_MIPS_TLS_DTPREL_LO16},
- {"%tprel_hi", BFD_RELOC_MIPS_TLS_TPREL_HI16},
- {"%tprel_lo", BFD_RELOC_MIPS_TLS_TPREL_LO16},
- {"%gottprel", BFD_RELOC_MIPS_TLS_GOTTPREL},
-#endif
- {"%hi", BFD_RELOC_HI16_S}
-};
-
-static const struct percent_op_match mips16_percent_op[] =
-{
- {"%lo", BFD_RELOC_MIPS16_LO16},
- {"%gprel", BFD_RELOC_MIPS16_GPREL},
- {"%hi", BFD_RELOC_MIPS16_HI16_S}
-};
-
-
-/* Return true if *STR points to a relocation operator. When returning true,
- move *STR over the operator and store its relocation code in *RELOC.
- Leave both *STR and *RELOC alone when returning false. */
-
-static bfd_boolean
-parse_relocation (char **str, bfd_reloc_code_real_type *reloc)
-{
- const struct percent_op_match *percent_op;
- size_t limit, i;
-
- if (mips_opts.mips16)
- {
- percent_op = mips16_percent_op;
- limit = ARRAY_SIZE (mips16_percent_op);
- }
- else
- {
- percent_op = mips_percent_op;
- limit = ARRAY_SIZE (mips_percent_op);
- }
-
- for (i = 0; i < limit; i++)
- if (strncasecmp (*str, percent_op[i].str, strlen (percent_op[i].str)) == 0)
- {
- int len = strlen (percent_op[i].str);
-
- if (!ISSPACE ((*str)[len]) && (*str)[len] != '(')
- continue;
-
- *str += strlen (percent_op[i].str);
- *reloc = percent_op[i].reloc;
-
- /* Check whether the output BFD supports this relocation.
- If not, issue an error and fall back on something safe. */
- if (!bfd_reloc_type_lookup (stdoutput, percent_op[i].reloc))
- {
- as_bad ("relocation %s isn't supported by the current ABI",
- percent_op[i].str);
- *reloc = BFD_RELOC_UNUSED;
- }
- return TRUE;
- }
- return FALSE;
-}
-
-
-/* Parse string STR as a 16-bit relocatable operand. Store the
- expression in *EP and the relocations in the array starting
- at RELOC. Return the number of relocation operators used.
-
- On exit, EXPR_END points to the first character after the expression. */
-
-static size_t
-my_getSmallExpression (expressionS *ep, bfd_reloc_code_real_type *reloc,
- char *str)
-{
- bfd_reloc_code_real_type reversed_reloc[3];
- size_t reloc_index, i;
- int crux_depth, str_depth;
- char *crux;
-
- /* Search for the start of the main expression, recoding relocations
- in REVERSED_RELOC. End the loop with CRUX pointing to the start
- of the main expression and with CRUX_DEPTH containing the number
- of open brackets at that point. */
- reloc_index = -1;
- str_depth = 0;
- do
- {
- reloc_index++;
- crux = str;
- crux_depth = str_depth;
-
- /* Skip over whitespace and brackets, keeping count of the number
- of brackets. */
- while (*str == ' ' || *str == '\t' || *str == '(')
- if (*str++ == '(')
- str_depth++;
- }
- while (*str == '%'
- && reloc_index < (HAVE_NEWABI ? 3 : 1)
- && parse_relocation (&str, &reversed_reloc[reloc_index]));
-
- my_getExpression (ep, crux);
- str = expr_end;
-
- /* Match every open bracket. */
- while (crux_depth > 0 && (*str == ')' || *str == ' ' || *str == '\t'))
- if (*str++ == ')')
- crux_depth--;
-
- if (crux_depth > 0)
- as_bad ("unclosed '('");
-
- expr_end = str;
-
- if (reloc_index != 0)
- {
- prev_reloc_op_frag = frag_now;
- for (i = 0; i < reloc_index; i++)
- reloc[i] = reversed_reloc[reloc_index - 1 - i];
- }
-
- return reloc_index;
-}
-
-static void
-my_getExpression (expressionS *ep, char *str)
-{
- char *save_in;
- valueT val;
-
- save_in = input_line_pointer;
- input_line_pointer = str;
- expression (ep);
- expr_end = input_line_pointer;
- input_line_pointer = save_in;
-
- /* If we are in mips16 mode, and this is an expression based on `.',
- then we bump the value of the symbol by 1 since that is how other
- text symbols are handled. We don't bother to handle complex
- expressions, just `.' plus or minus a constant. */
- if (mips_opts.mips16
- && ep->X_op == O_symbol
- && strcmp (S_GET_NAME (ep->X_add_symbol), FAKE_LABEL_NAME) == 0
- && S_GET_SEGMENT (ep->X_add_symbol) == now_seg
- && symbol_get_frag (ep->X_add_symbol) == frag_now
- && symbol_constant_p (ep->X_add_symbol)
- && (val = S_GET_VALUE (ep->X_add_symbol)) == frag_now_fix ())
- S_SET_VALUE (ep->X_add_symbol, val + 1);
-}
-
-char *
-md_atof (int type, char *litP, int *sizeP)
-{
- return ieee_md_atof (type, litP, sizeP, target_big_endian);
-}
-
-void
-md_number_to_chars (char *buf, valueT val, int n)
-{
- if (target_big_endian)
- number_to_chars_bigendian (buf, val, n);
- else
- number_to_chars_littleendian (buf, val, n);
-}
-
-#ifdef OBJ_ELF
-static int support_64bit_objects(void)
-{
- const char **list, **l;
- int yes;
-
- list = bfd_target_list ();
- for (l = list; *l != NULL; l++)
-#ifdef TE_TMIPS
- /* This is traditional mips */
- if (strcmp (*l, "elf64-tradbigmips") == 0
- || strcmp (*l, "elf64-tradlittlemips") == 0)
-#else
- if (strcmp (*l, "elf64-bigmips") == 0
- || strcmp (*l, "elf64-littlemips") == 0)
-#endif
- break;
- yes = (*l != NULL);
- free (list);
- return yes;
-}
-#endif /* OBJ_ELF */
-
-const char *md_shortopts = "O::g::G:";
-
-struct option md_longopts[] =
-{
- /* Options which specify architecture. */
-#define OPTION_ARCH_BASE (OPTION_MD_BASE)
-#define OPTION_MARCH (OPTION_ARCH_BASE + 0)
- {"march", required_argument, NULL, OPTION_MARCH},
-#define OPTION_MTUNE (OPTION_ARCH_BASE + 1)
- {"mtune", required_argument, NULL, OPTION_MTUNE},
-#define OPTION_MIPS1 (OPTION_ARCH_BASE + 2)
- {"mips0", no_argument, NULL, OPTION_MIPS1},
- {"mips1", no_argument, NULL, OPTION_MIPS1},
-#define OPTION_MIPS2 (OPTION_ARCH_BASE + 3)
- {"mips2", no_argument, NULL, OPTION_MIPS2},
-#define OPTION_MIPS3 (OPTION_ARCH_BASE + 4)
- {"mips3", no_argument, NULL, OPTION_MIPS3},
-#define OPTION_MIPS4 (OPTION_ARCH_BASE + 5)
- {"mips4", no_argument, NULL, OPTION_MIPS4},
-#define OPTION_MIPS5 (OPTION_ARCH_BASE + 6)
- {"mips5", no_argument, NULL, OPTION_MIPS5},
-#define OPTION_MIPS32 (OPTION_ARCH_BASE + 7)
- {"mips32", no_argument, NULL, OPTION_MIPS32},
-#define OPTION_MIPS64 (OPTION_ARCH_BASE + 8)
- {"mips64", no_argument, NULL, OPTION_MIPS64},
-#define OPTION_MIPS32R2 (OPTION_ARCH_BASE + 9)
- {"mips32r2", no_argument, NULL, OPTION_MIPS32R2},
-#define OPTION_MIPS64R2 (OPTION_ARCH_BASE + 10)
- {"mips64r2", no_argument, NULL, OPTION_MIPS64R2},
-
- /* Options which specify Application Specific Extensions (ASEs). */
-#define OPTION_ASE_BASE (OPTION_ARCH_BASE + 11)
-#define OPTION_MIPS16 (OPTION_ASE_BASE + 0)
- {"mips16", no_argument, NULL, OPTION_MIPS16},
-#define OPTION_NO_MIPS16 (OPTION_ASE_BASE + 1)
- {"no-mips16", no_argument, NULL, OPTION_NO_MIPS16},
-#define OPTION_MIPS3D (OPTION_ASE_BASE + 2)
- {"mips3d", no_argument, NULL, OPTION_MIPS3D},
-#define OPTION_NO_MIPS3D (OPTION_ASE_BASE + 3)
- {"no-mips3d", no_argument, NULL, OPTION_NO_MIPS3D},
-#define OPTION_MDMX (OPTION_ASE_BASE + 4)
- {"mdmx", no_argument, NULL, OPTION_MDMX},
-#define OPTION_NO_MDMX (OPTION_ASE_BASE + 5)
- {"no-mdmx", no_argument, NULL, OPTION_NO_MDMX},
-#define OPTION_DSP (OPTION_ASE_BASE + 6)
- {"mdsp", no_argument, NULL, OPTION_DSP},
-#define OPTION_NO_DSP (OPTION_ASE_BASE + 7)
- {"mno-dsp", no_argument, NULL, OPTION_NO_DSP},
-#define OPTION_MT (OPTION_ASE_BASE + 8)
- {"mmt", no_argument, NULL, OPTION_MT},
-#define OPTION_NO_MT (OPTION_ASE_BASE + 9)
- {"mno-mt", no_argument, NULL, OPTION_NO_MT},
-#define OPTION_SMARTMIPS (OPTION_ASE_BASE + 10)
- {"msmartmips", no_argument, NULL, OPTION_SMARTMIPS},
-#define OPTION_NO_SMARTMIPS (OPTION_ASE_BASE + 11)
- {"mno-smartmips", no_argument, NULL, OPTION_NO_SMARTMIPS},
-#define OPTION_DSPR2 (OPTION_ASE_BASE + 12)
- {"mdspr2", no_argument, NULL, OPTION_DSPR2},
-#define OPTION_NO_DSPR2 (OPTION_ASE_BASE + 13)
- {"mno-dspr2", no_argument, NULL, OPTION_NO_DSPR2},
-
- /* Old-style architecture options. Don't add more of these. */
-#define OPTION_COMPAT_ARCH_BASE (OPTION_ASE_BASE + 14)
-#define OPTION_M4650 (OPTION_COMPAT_ARCH_BASE + 0)
- {"m4650", no_argument, NULL, OPTION_M4650},
-#define OPTION_NO_M4650 (OPTION_COMPAT_ARCH_BASE + 1)
- {"no-m4650", no_argument, NULL, OPTION_NO_M4650},
-#define OPTION_M4010 (OPTION_COMPAT_ARCH_BASE + 2)
- {"m4010", no_argument, NULL, OPTION_M4010},
-#define OPTION_NO_M4010 (OPTION_COMPAT_ARCH_BASE + 3)
- {"no-m4010", no_argument, NULL, OPTION_NO_M4010},
-#define OPTION_M4100 (OPTION_COMPAT_ARCH_BASE + 4)
- {"m4100", no_argument, NULL, OPTION_M4100},
-#define OPTION_NO_M4100 (OPTION_COMPAT_ARCH_BASE + 5)
- {"no-m4100", no_argument, NULL, OPTION_NO_M4100},
-#define OPTION_M3900 (OPTION_COMPAT_ARCH_BASE + 6)
- {"m3900", no_argument, NULL, OPTION_M3900},
-#define OPTION_NO_M3900 (OPTION_COMPAT_ARCH_BASE + 7)
- {"no-m3900", no_argument, NULL, OPTION_NO_M3900},
-
- /* Options which enable bug fixes. */
-#define OPTION_FIX_BASE (OPTION_COMPAT_ARCH_BASE + 8)
-#define OPTION_M7000_HILO_FIX (OPTION_FIX_BASE + 0)
- {"mfix7000", no_argument, NULL, OPTION_M7000_HILO_FIX},
-#define OPTION_MNO_7000_HILO_FIX (OPTION_FIX_BASE + 1)
- {"no-fix-7000", no_argument, NULL, OPTION_MNO_7000_HILO_FIX},
- {"mno-fix7000", no_argument, NULL, OPTION_MNO_7000_HILO_FIX},
-#define OPTION_FIX_VR4120 (OPTION_FIX_BASE + 2)
-#define OPTION_NO_FIX_VR4120 (OPTION_FIX_BASE + 3)
- {"mfix-vr4120", no_argument, NULL, OPTION_FIX_VR4120},
- {"mno-fix-vr4120", no_argument, NULL, OPTION_NO_FIX_VR4120},
-#define OPTION_FIX_VR4130 (OPTION_FIX_BASE + 4)
-#define OPTION_NO_FIX_VR4130 (OPTION_FIX_BASE + 5)
- {"mfix-vr4130", no_argument, NULL, OPTION_FIX_VR4130},
- {"mno-fix-vr4130", no_argument, NULL, OPTION_NO_FIX_VR4130},
-
- /* Miscellaneous options. */
-#define OPTION_MISC_BASE (OPTION_FIX_BASE + 6)
-#define OPTION_TRAP (OPTION_MISC_BASE + 0)
- {"trap", no_argument, NULL, OPTION_TRAP},
- {"no-break", no_argument, NULL, OPTION_TRAP},
-#define OPTION_BREAK (OPTION_MISC_BASE + 1)
- {"break", no_argument, NULL, OPTION_BREAK},
- {"no-trap", no_argument, NULL, OPTION_BREAK},
-#define OPTION_EB (OPTION_MISC_BASE + 2)
- {"EB", no_argument, NULL, OPTION_EB},
-#define OPTION_EL (OPTION_MISC_BASE + 3)
- {"EL", no_argument, NULL, OPTION_EL},
-#define OPTION_FP32 (OPTION_MISC_BASE + 4)
- {"mfp32", no_argument, NULL, OPTION_FP32},
-#define OPTION_GP32 (OPTION_MISC_BASE + 5)
- {"mgp32", no_argument, NULL, OPTION_GP32},
-#define OPTION_CONSTRUCT_FLOATS (OPTION_MISC_BASE + 6)
- {"construct-floats", no_argument, NULL, OPTION_CONSTRUCT_FLOATS},
-#define OPTION_NO_CONSTRUCT_FLOATS (OPTION_MISC_BASE + 7)
- {"no-construct-floats", no_argument, NULL, OPTION_NO_CONSTRUCT_FLOATS},
-#define OPTION_FP64 (OPTION_MISC_BASE + 8)
- {"mfp64", no_argument, NULL, OPTION_FP64},
-#define OPTION_GP64 (OPTION_MISC_BASE + 9)
- {"mgp64", no_argument, NULL, OPTION_GP64},
-#define OPTION_RELAX_BRANCH (OPTION_MISC_BASE + 10)
-#define OPTION_NO_RELAX_BRANCH (OPTION_MISC_BASE + 11)
- {"relax-branch", no_argument, NULL, OPTION_RELAX_BRANCH},
- {"no-relax-branch", no_argument, NULL, OPTION_NO_RELAX_BRANCH},
-#define OPTION_MSHARED (OPTION_MISC_BASE + 12)
-#define OPTION_MNO_SHARED (OPTION_MISC_BASE + 13)
- {"mshared", no_argument, NULL, OPTION_MSHARED},
- {"mno-shared", no_argument, NULL, OPTION_MNO_SHARED},
-#define OPTION_MSYM32 (OPTION_MISC_BASE + 14)
-#define OPTION_MNO_SYM32 (OPTION_MISC_BASE + 15)
- {"msym32", no_argument, NULL, OPTION_MSYM32},
- {"mno-sym32", no_argument, NULL, OPTION_MNO_SYM32},
-#define OPTION_SOFT_FLOAT (OPTION_MISC_BASE + 16)
-#define OPTION_HARD_FLOAT (OPTION_MISC_BASE + 17)
- {"msoft-float", no_argument, NULL, OPTION_SOFT_FLOAT},
- {"mhard-float", no_argument, NULL, OPTION_HARD_FLOAT},
-#define OPTION_SINGLE_FLOAT (OPTION_MISC_BASE + 18)
-#define OPTION_DOUBLE_FLOAT (OPTION_MISC_BASE + 19)
- {"msingle-float", no_argument, NULL, OPTION_SINGLE_FLOAT},
- {"mdouble-float", no_argument, NULL, OPTION_DOUBLE_FLOAT},
-
- /* ELF-specific options. */
-#ifdef OBJ_ELF
-#define OPTION_ELF_BASE (OPTION_MISC_BASE + 20)
-#define OPTION_CALL_SHARED (OPTION_ELF_BASE + 0)
- {"KPIC", no_argument, NULL, OPTION_CALL_SHARED},
- {"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
-#define OPTION_NON_SHARED (OPTION_ELF_BASE + 1)
- {"non_shared", no_argument, NULL, OPTION_NON_SHARED},
-#define OPTION_XGOT (OPTION_ELF_BASE + 2)
- {"xgot", no_argument, NULL, OPTION_XGOT},
-#define OPTION_MABI (OPTION_ELF_BASE + 3)
- {"mabi", required_argument, NULL, OPTION_MABI},
-#define OPTION_32 (OPTION_ELF_BASE + 4)
- {"32", no_argument, NULL, OPTION_32},
-#define OPTION_N32 (OPTION_ELF_BASE + 5)
- {"n32", no_argument, NULL, OPTION_N32},
-#define OPTION_64 (OPTION_ELF_BASE + 6)
- {"64", no_argument, NULL, OPTION_64},
-#define OPTION_MDEBUG (OPTION_ELF_BASE + 7)
- {"mdebug", no_argument, NULL, OPTION_MDEBUG},
-#define OPTION_NO_MDEBUG (OPTION_ELF_BASE + 8)
- {"no-mdebug", no_argument, NULL, OPTION_NO_MDEBUG},
-#define OPTION_PDR (OPTION_ELF_BASE + 9)
- {"mpdr", no_argument, NULL, OPTION_PDR},
-#define OPTION_NO_PDR (OPTION_ELF_BASE + 10)
- {"mno-pdr", no_argument, NULL, OPTION_NO_PDR},
-#define OPTION_MVXWORKS_PIC (OPTION_ELF_BASE + 11)
- {"mvxworks-pic", no_argument, NULL, OPTION_MVXWORKS_PIC},
-#endif /* OBJ_ELF */
-
- {NULL, no_argument, NULL, 0}
-};
-size_t md_longopts_size = sizeof (md_longopts);
-
-/* Set STRING_PTR (either &mips_arch_string or &mips_tune_string) to
- NEW_VALUE. Warn if another value was already specified. Note:
- we have to defer parsing the -march and -mtune arguments in order
- to handle 'from-abi' correctly, since the ABI might be specified
- in a later argument. */
-
-static void
-mips_set_option_string (const char **string_ptr, const char *new_value)
-{
- if (*string_ptr != 0 && strcasecmp (*string_ptr, new_value) != 0)
- as_warn (_("A different %s was already specified, is now %s"),
- string_ptr == &mips_arch_string ? "-march" : "-mtune",
- new_value);
-
- *string_ptr = new_value;
-}
-
-int
-md_parse_option (int c, char *arg)
-{
- switch (c)
- {
- case OPTION_CONSTRUCT_FLOATS:
- mips_disable_float_construction = 0;
- break;
-
- case OPTION_NO_CONSTRUCT_FLOATS:
- mips_disable_float_construction = 1;
- break;
-
- case OPTION_TRAP:
- mips_trap = 1;
- break;
-
- case OPTION_BREAK:
- mips_trap = 0;
- break;
-
- case OPTION_EB:
- target_big_endian = 1;
- break;
-
- case OPTION_EL:
- target_big_endian = 0;
- break;
-
- case 'O':
- if (arg == NULL)
- mips_optimize = 1;
- else if (arg[0] == '0')
- mips_optimize = 0;
- else if (arg[0] == '1')
- mips_optimize = 1;
- else
- mips_optimize = 2;
- break;
-
- case 'g':
- if (arg == NULL)
- mips_debug = 2;
- else
- mips_debug = atoi (arg);
- break;
-
- case OPTION_MIPS1:
- file_mips_isa = ISA_MIPS1;
- break;
-
- case OPTION_MIPS2:
- file_mips_isa = ISA_MIPS2;
- break;
-
- case OPTION_MIPS3:
- file_mips_isa = ISA_MIPS3;
- break;
-
- case OPTION_MIPS4:
- file_mips_isa = ISA_MIPS4;
- break;
-
- case OPTION_MIPS5:
- file_mips_isa = ISA_MIPS5;
- break;
-
- case OPTION_MIPS32:
- file_mips_isa = ISA_MIPS32;
- break;
-
- case OPTION_MIPS32R2:
- file_mips_isa = ISA_MIPS32R2;
- break;
-
- case OPTION_MIPS64R2:
- file_mips_isa = ISA_MIPS64R2;
- break;
-
- case OPTION_MIPS64:
- file_mips_isa = ISA_MIPS64;
- break;
-
- case OPTION_MTUNE:
- mips_set_option_string (&mips_tune_string, arg);
- break;
-
- case OPTION_MARCH:
- mips_set_option_string (&mips_arch_string, arg);
- break;
-
- case OPTION_M4650:
- mips_set_option_string (&mips_arch_string, "4650");
- mips_set_option_string (&mips_tune_string, "4650");
- break;
-
- case OPTION_NO_M4650:
- break;
-
- case OPTION_M4010:
- mips_set_option_string (&mips_arch_string, "4010");
- mips_set_option_string (&mips_tune_string, "4010");
- break;
-
- case OPTION_NO_M4010:
- break;
-
- case OPTION_M4100:
- mips_set_option_string (&mips_arch_string, "4100");
- mips_set_option_string (&mips_tune_string, "4100");
- break;
-
- case OPTION_NO_M4100:
- break;
-
- case OPTION_M3900:
- mips_set_option_string (&mips_arch_string, "3900");
- mips_set_option_string (&mips_tune_string, "3900");
- break;
-
- case OPTION_NO_M3900:
- break;
-
- case OPTION_MDMX:
- mips_opts.ase_mdmx = 1;
- break;
-
- case OPTION_NO_MDMX:
- mips_opts.ase_mdmx = 0;
- break;
-
- case OPTION_DSP:
- mips_opts.ase_dsp = 1;
- mips_opts.ase_dspr2 = 0;
- break;
-
- case OPTION_NO_DSP:
- mips_opts.ase_dsp = 0;
- mips_opts.ase_dspr2 = 0;
- break;
-
- case OPTION_DSPR2:
- mips_opts.ase_dspr2 = 1;
- mips_opts.ase_dsp = 1;
- break;
-
- case OPTION_NO_DSPR2:
- mips_opts.ase_dspr2 = 0;
- mips_opts.ase_dsp = 0;
- break;
-
- case OPTION_MT:
- mips_opts.ase_mt = 1;
- break;
-
- case OPTION_NO_MT:
- mips_opts.ase_mt = 0;
- break;
-
- case OPTION_MIPS16:
- mips_opts.mips16 = 1;
- mips_no_prev_insn ();
- break;
-
- case OPTION_NO_MIPS16:
- mips_opts.mips16 = 0;
- mips_no_prev_insn ();
- break;
-
- case OPTION_MIPS3D:
- mips_opts.ase_mips3d = 1;
- break;
-
- case OPTION_NO_MIPS3D:
- mips_opts.ase_mips3d = 0;
- break;
-
- case OPTION_SMARTMIPS:
- mips_opts.ase_smartmips = 1;
- break;
-
- case OPTION_NO_SMARTMIPS:
- mips_opts.ase_smartmips = 0;
- break;
-
- case OPTION_FIX_VR4120:
- mips_fix_vr4120 = 1;
- break;
-
- case OPTION_NO_FIX_VR4120:
- mips_fix_vr4120 = 0;
- break;
-
- case OPTION_FIX_VR4130:
- mips_fix_vr4130 = 1;
- break;
-
- case OPTION_NO_FIX_VR4130:
- mips_fix_vr4130 = 0;
- break;
-
- case OPTION_RELAX_BRANCH:
- mips_relax_branch = 1;
- break;
-
- case OPTION_NO_RELAX_BRANCH:
- mips_relax_branch = 0;
- break;
-
- case OPTION_MSHARED:
- mips_in_shared = TRUE;
- break;
-
- case OPTION_MNO_SHARED:
- mips_in_shared = FALSE;
- break;
-
- case OPTION_MSYM32:
- mips_opts.sym32 = TRUE;
- break;
-
- case OPTION_MNO_SYM32:
- mips_opts.sym32 = FALSE;
- break;
-
-#ifdef OBJ_ELF
- /* When generating ELF code, we permit -KPIC and -call_shared to
- select SVR4_PIC, and -non_shared to select no PIC. This is
- intended to be compatible with Irix 5. */
- case OPTION_CALL_SHARED:
- if (!IS_ELF)
- {
- as_bad (_("-call_shared is supported only for ELF format"));
- return 0;
- }
- mips_pic = SVR4_PIC;
- mips_abicalls = TRUE;
- break;
-
- case OPTION_NON_SHARED:
- if (!IS_ELF)
- {
- as_bad (_("-non_shared is supported only for ELF format"));
- return 0;
- }
- mips_pic = NO_PIC;
- mips_abicalls = FALSE;
- break;
-
- /* The -xgot option tells the assembler to use 32 bit offsets
- when accessing the got in SVR4_PIC mode. It is for Irix
- compatibility. */
- case OPTION_XGOT:
- mips_big_got = 1;
- break;
-#endif /* OBJ_ELF */
-
- case 'G':
- g_switch_value = atoi (arg);
- g_switch_seen = 1;
- break;
-
-#ifdef OBJ_ELF
- /* The -32, -n32 and -64 options are shortcuts for -mabi=32, -mabi=n32
- and -mabi=64. */
- case OPTION_32:
- if (!IS_ELF)
- {
- as_bad (_("-32 is supported for ELF format only"));
- return 0;
- }
- mips_abi = O32_ABI;
- break;
-
- case OPTION_N32:
- if (!IS_ELF)
- {
- as_bad (_("-n32 is supported for ELF format only"));
- return 0;
- }
- mips_abi = N32_ABI;
- break;
-
- case OPTION_64:
- if (!IS_ELF)
- {
- as_bad (_("-64 is supported for ELF format only"));
- return 0;
- }
- mips_abi = N64_ABI;
- if (!support_64bit_objects())
- as_fatal (_("No compiled in support for 64 bit object file format"));
- break;
-#endif /* OBJ_ELF */
-
- case OPTION_GP32:
- file_mips_gp32 = 1;
- break;
-
- case OPTION_GP64:
- file_mips_gp32 = 0;
- break;
-
- case OPTION_FP32:
- file_mips_fp32 = 1;
- break;
-
- case OPTION_FP64:
- file_mips_fp32 = 0;
- break;
-
- case OPTION_SINGLE_FLOAT:
- file_mips_single_float = 1;
- break;
-
- case OPTION_DOUBLE_FLOAT:
- file_mips_single_float = 0;
- break;
-
- case OPTION_SOFT_FLOAT:
- file_mips_soft_float = 1;
- break;
-
- case OPTION_HARD_FLOAT:
- file_mips_soft_float = 0;
- break;
-
-#ifdef OBJ_ELF
- case OPTION_MABI:
- if (!IS_ELF)
- {
- as_bad (_("-mabi is supported for ELF format only"));
- return 0;
- }
- if (strcmp (arg, "32") == 0)
- mips_abi = O32_ABI;
- else if (strcmp (arg, "o64") == 0)
- mips_abi = O64_ABI;
- else if (strcmp (arg, "n32") == 0)
- mips_abi = N32_ABI;
- else if (strcmp (arg, "64") == 0)
- {
- mips_abi = N64_ABI;
- if (! support_64bit_objects())
- as_fatal (_("No compiled in support for 64 bit object file "
- "format"));
- }
- else if (strcmp (arg, "eabi") == 0)
- mips_abi = EABI_ABI;
- else
- {
- as_fatal (_("invalid abi -mabi=%s"), arg);
- return 0;
- }
- break;
-#endif /* OBJ_ELF */
-
- case OPTION_M7000_HILO_FIX:
- mips_7000_hilo_fix = TRUE;
- break;
-
- case OPTION_MNO_7000_HILO_FIX:
- mips_7000_hilo_fix = FALSE;
- break;
-
-#ifdef OBJ_ELF
- case OPTION_MDEBUG:
- mips_flag_mdebug = TRUE;
- break;
-
- case OPTION_NO_MDEBUG:
- mips_flag_mdebug = FALSE;
- break;
-
- case OPTION_PDR:
- mips_flag_pdr = TRUE;
- break;
-
- case OPTION_NO_PDR:
- mips_flag_pdr = FALSE;
- break;
-
- case OPTION_MVXWORKS_PIC:
- mips_pic = VXWORKS_PIC;
- break;
-#endif /* OBJ_ELF */
-
- default:
- return 0;
- }
-
- return 1;
-}
-
-/* Set up globals to generate code for the ISA or processor
- described by INFO. */
-
-static void
-mips_set_architecture (const struct mips_cpu_info *info)
-{
- if (info != 0)
- {
- file_mips_arch = info->cpu;
- mips_opts.arch = info->cpu;
- mips_opts.isa = info->isa;
- }
-}
-
-
-/* Likewise for tuning. */
-
-static void
-mips_set_tune (const struct mips_cpu_info *info)
-{
- if (info != 0)
- mips_tune = info->cpu;
-}
-
-
-void
-mips_after_parse_args (void)
-{
- const struct mips_cpu_info *arch_info = 0;
- const struct mips_cpu_info *tune_info = 0;
-
- /* GP relative stuff not working for PE */
- if (strncmp (TARGET_OS, "pe", 2) == 0)
- {
- if (g_switch_seen && g_switch_value != 0)
- as_bad (_("-G not supported in this configuration."));
- g_switch_value = 0;
- }
-
- if (mips_abi == NO_ABI)
- mips_abi = MIPS_DEFAULT_ABI;
-
- /* The following code determines the architecture and register size.
- Similar code was added to GCC 3.3 (see override_options() in
- config/mips/mips.c). The GAS and GCC code should be kept in sync
- as much as possible. */
-
- if (mips_arch_string != 0)
- arch_info = mips_parse_cpu ("-march", mips_arch_string);
-
- if (file_mips_isa != ISA_UNKNOWN)
- {
- /* Handle -mipsN. At this point, file_mips_isa contains the
- ISA level specified by -mipsN, while arch_info->isa contains
- the -march selection (if any). */
- if (arch_info != 0)
- {
- /* -march takes precedence over -mipsN, since it is more descriptive.
- There's no harm in specifying both as long as the ISA levels
- are the same. */
- if (file_mips_isa != arch_info->isa)
- as_bad (_("-%s conflicts with the other architecture options, which imply -%s"),
- mips_cpu_info_from_isa (file_mips_isa)->name,
- mips_cpu_info_from_isa (arch_info->isa)->name);
- }
- else
- arch_info = mips_cpu_info_from_isa (file_mips_isa);
- }
-
- if (arch_info == 0)
- arch_info = mips_parse_cpu ("default CPU", MIPS_CPU_STRING_DEFAULT);
-
- if (ABI_NEEDS_64BIT_REGS (mips_abi) && !ISA_HAS_64BIT_REGS (arch_info->isa))
- as_bad ("-march=%s is not compatible with the selected ABI",
- arch_info->name);
-
- mips_set_architecture (arch_info);
-
- /* Optimize for file_mips_arch, unless -mtune selects a different processor. */
- if (mips_tune_string != 0)
- tune_info = mips_parse_cpu ("-mtune", mips_tune_string);
-
- if (tune_info == 0)
- mips_set_tune (arch_info);
- else
- mips_set_tune (tune_info);
-
- if (file_mips_gp32 >= 0)
- {
- /* The user specified the size of the integer registers. Make sure
- it agrees with the ABI and ISA. */
- if (file_mips_gp32 == 0 && !ISA_HAS_64BIT_REGS (mips_opts.isa))
- as_bad (_("-mgp64 used with a 32-bit processor"));
- else if (file_mips_gp32 == 1 && ABI_NEEDS_64BIT_REGS (mips_abi))
- as_bad (_("-mgp32 used with a 64-bit ABI"));
- else if (file_mips_gp32 == 0 && ABI_NEEDS_32BIT_REGS (mips_abi))
- as_bad (_("-mgp64 used with a 32-bit ABI"));
- }
- else
- {
- /* Infer the integer register size from the ABI and processor.
- Restrict ourselves to 32-bit registers if that's all the
- processor has, or if the ABI cannot handle 64-bit registers. */
- file_mips_gp32 = (ABI_NEEDS_32BIT_REGS (mips_abi)
- || !ISA_HAS_64BIT_REGS (mips_opts.isa));
- }
-
- switch (file_mips_fp32)
- {
- default:
- case -1:
- /* No user specified float register size.
- ??? GAS treats single-float processors as though they had 64-bit
- float registers (although it complains when double-precision
- instructions are used). As things stand, saying they have 32-bit
- registers would lead to spurious "register must be even" messages.
- So here we assume float registers are never smaller than the
- integer ones. */
- if (file_mips_gp32 == 0)
- /* 64-bit integer registers implies 64-bit float registers. */
- file_mips_fp32 = 0;
- else if ((mips_opts.ase_mips3d > 0 || mips_opts.ase_mdmx > 0)
- && ISA_HAS_64BIT_FPRS (mips_opts.isa))
- /* -mips3d and -mdmx imply 64-bit float registers, if possible. */
- file_mips_fp32 = 0;
- else
- /* 32-bit float registers. */
- file_mips_fp32 = 1;
- break;
-
- /* The user specified the size of the float registers. Check if it
- agrees with the ABI and ISA. */
- case 0:
- if (!ISA_HAS_64BIT_FPRS (mips_opts.isa))
- as_bad (_("-mfp64 used with a 32-bit fpu"));
- else if (ABI_NEEDS_32BIT_REGS (mips_abi)
- && !ISA_HAS_MXHC1 (mips_opts.isa))
- as_warn (_("-mfp64 used with a 32-bit ABI"));
- break;
- case 1:
- if (ABI_NEEDS_64BIT_REGS (mips_abi))
- as_warn (_("-mfp32 used with a 64-bit ABI"));
- break;
- }
-
- /* End of GCC-shared inference code. */
-
- /* This flag is set when we have a 64-bit capable CPU but use only
- 32-bit wide registers. Note that EABI does not use it. */
- if (ISA_HAS_64BIT_REGS (mips_opts.isa)
- && ((mips_abi == NO_ABI && file_mips_gp32 == 1)
- || mips_abi == O32_ABI))
- mips_32bitmode = 1;
-
- if (mips_opts.isa == ISA_MIPS1 && mips_trap)
- as_bad (_("trap exception not supported at ISA 1"));
-
- /* If the selected architecture includes support for ASEs, enable
- generation of code for them. */
- if (mips_opts.mips16 == -1)
- mips_opts.mips16 = (CPU_HAS_MIPS16 (file_mips_arch)) ? 1 : 0;
- if (mips_opts.ase_mips3d == -1)
- mips_opts.ase_mips3d = ((arch_info->flags & MIPS_CPU_ASE_MIPS3D)
- && file_mips_fp32 == 0) ? 1 : 0;
- if (mips_opts.ase_mips3d && file_mips_fp32 == 1)
- as_bad (_("-mfp32 used with -mips3d"));
-
- if (mips_opts.ase_mdmx == -1)
- mips_opts.ase_mdmx = ((arch_info->flags & MIPS_CPU_ASE_MDMX)
- && file_mips_fp32 == 0) ? 1 : 0;
- if (mips_opts.ase_mdmx && file_mips_fp32 == 1)
- as_bad (_("-mfp32 used with -mdmx"));
-
- if (mips_opts.ase_smartmips == -1)
- mips_opts.ase_smartmips = (arch_info->flags & MIPS_CPU_ASE_SMARTMIPS) ? 1 : 0;
- if (mips_opts.ase_smartmips && !ISA_SUPPORTS_SMARTMIPS)
- as_warn ("%s ISA does not support SmartMIPS",
- mips_cpu_info_from_isa (mips_opts.isa)->name);
-
- if (mips_opts.ase_dsp == -1)
- mips_opts.ase_dsp = (arch_info->flags & MIPS_CPU_ASE_DSP) ? 1 : 0;
- if (mips_opts.ase_dsp && !ISA_SUPPORTS_DSP_ASE)
- as_warn ("%s ISA does not support DSP ASE",
- mips_cpu_info_from_isa (mips_opts.isa)->name);
-
- if (mips_opts.ase_dspr2 == -1)
- {
- mips_opts.ase_dspr2 = (arch_info->flags & MIPS_CPU_ASE_DSPR2) ? 1 : 0;
- mips_opts.ase_dsp = (arch_info->flags & MIPS_CPU_ASE_DSP) ? 1 : 0;
- }
- if (mips_opts.ase_dspr2 && !ISA_SUPPORTS_DSPR2_ASE)
- as_warn ("%s ISA does not support DSP R2 ASE",
- mips_cpu_info_from_isa (mips_opts.isa)->name);
-
- if (mips_opts.ase_mt == -1)
- mips_opts.ase_mt = (arch_info->flags & MIPS_CPU_ASE_MT) ? 1 : 0;
- if (mips_opts.ase_mt && !ISA_SUPPORTS_MT_ASE)
- as_warn ("%s ISA does not support MT ASE",
- mips_cpu_info_from_isa (mips_opts.isa)->name);
-
- file_mips_isa = mips_opts.isa;
- file_ase_mips16 = mips_opts.mips16;
- file_ase_mips3d = mips_opts.ase_mips3d;
- file_ase_mdmx = mips_opts.ase_mdmx;
- file_ase_smartmips = mips_opts.ase_smartmips;
- file_ase_dsp = mips_opts.ase_dsp;
- file_ase_dspr2 = mips_opts.ase_dspr2;
- file_ase_mt = mips_opts.ase_mt;
- mips_opts.gp32 = file_mips_gp32;
- mips_opts.fp32 = file_mips_fp32;
- mips_opts.soft_float = file_mips_soft_float;
- mips_opts.single_float = file_mips_single_float;
-
- if (mips_flag_mdebug < 0)
- {
-#ifdef OBJ_MAYBE_ECOFF
- if (OUTPUT_FLAVOR == bfd_target_ecoff_flavour)
- mips_flag_mdebug = 1;
- else
-#endif /* OBJ_MAYBE_ECOFF */
- mips_flag_mdebug = 0;
- }
-}
-
-void
-mips_init_after_args (void)
-{
- /* initialize opcodes */
- bfd_mips_num_opcodes = bfd_mips_num_builtin_opcodes;
- mips_opcodes = (struct mips_opcode *) mips_builtin_opcodes;
-}
-
-long
-md_pcrel_from (fixS *fixP)
-{
- valueT addr = fixP->fx_where + fixP->fx_frag->fr_address;
- switch (fixP->fx_r_type)
- {
- case BFD_RELOC_16_PCREL_S2:
- case BFD_RELOC_MIPS_JMP:
- /* Return the address of the delay slot. */
- return addr + 4;
- default:
- /* We have no relocation type for PC relative MIPS16 instructions. */
- if (fixP->fx_addsy && S_GET_SEGMENT (fixP->fx_addsy) != now_seg)
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("PC relative MIPS16 instruction references a different section"));
- return addr;
- }
-}
-
-/* This is called before the symbol table is processed. In order to
- work with gcc when using mips-tfile, we must keep all local labels.
- However, in other cases, we want to discard them. If we were
- called with -g, but we didn't see any debugging information, it may
- mean that gcc is smuggling debugging information through to
- mips-tfile, in which case we must generate all local labels. */
-
-void
-mips_frob_file_before_adjust (void)
-{
-#ifndef NO_ECOFF_DEBUGGING
- if (ECOFF_DEBUGGING
- && mips_debug != 0
- && ! ecoff_debugging_seen)
- flag_keep_locals = 1;
-#endif
-}
-
-/* Sort any unmatched HI16 and GOT16 relocs so that they immediately precede
- the corresponding LO16 reloc. This is called before md_apply_fix and
- tc_gen_reloc. Unmatched relocs can only be generated by use of explicit
- relocation operators.
-
- For our purposes, a %lo() expression matches a %got() or %hi()
- expression if:
-
- (a) it refers to the same symbol; and
- (b) the offset applied in the %lo() expression is no lower than
- the offset applied in the %got() or %hi().
-
- (b) allows us to cope with code like:
-
- lui $4,%hi(foo)
- lh $4,%lo(foo+2)($4)
-
- ...which is legal on RELA targets, and has a well-defined behaviour
- if the user knows that adding 2 to "foo" will not induce a carry to
- the high 16 bits.
-
- When several %lo()s match a particular %got() or %hi(), we use the
- following rules to distinguish them:
-
- (1) %lo()s with smaller offsets are a better match than %lo()s with
- higher offsets.
-
- (2) %lo()s with no matching %got() or %hi() are better than those
- that already have a matching %got() or %hi().
-
- (3) later %lo()s are better than earlier %lo()s.
-
- These rules are applied in order.
-
- (1) means, among other things, that %lo()s with identical offsets are
- chosen if they exist.
-
- (2) means that we won't associate several high-part relocations with
- the same low-part relocation unless there's no alternative. Having
- several high parts for the same low part is a GNU extension; this rule
- allows careful users to avoid it.
-
- (3) is purely cosmetic. mips_hi_fixup_list is is in reverse order,
- with the last high-part relocation being at the front of the list.
- It therefore makes sense to choose the last matching low-part
- relocation, all other things being equal. It's also easier
- to code that way. */
-
-void
-mips_frob_file (void)
-{
- struct mips_hi_fixup *l;
- bfd_reloc_code_real_type looking_for_rtype = BFD_RELOC_UNUSED;
-
- for (l = mips_hi_fixup_list; l != NULL; l = l->next)
- {
- segment_info_type *seginfo;
- bfd_boolean matched_lo_p;
- fixS **hi_pos, **lo_pos, **pos;
-
- assert (reloc_needs_lo_p (l->fixp->fx_r_type));
-
- /* If a GOT16 relocation turns out to be against a global symbol,
- there isn't supposed to be a matching LO. */
- if (l->fixp->fx_r_type == BFD_RELOC_MIPS_GOT16
- && !pic_need_relax (l->fixp->fx_addsy, l->seg))
- continue;
-
- /* Check quickly whether the next fixup happens to be a matching %lo. */
- if (fixup_has_matching_lo_p (l->fixp))
- continue;
-
- seginfo = seg_info (l->seg);
-
- /* Set HI_POS to the position of this relocation in the chain.
- Set LO_POS to the position of the chosen low-part relocation.
- MATCHED_LO_P is true on entry to the loop if *POS is a low-part
- relocation that matches an immediately-preceding high-part
- relocation. */
- hi_pos = NULL;
- lo_pos = NULL;
- matched_lo_p = FALSE;
-
- if (l->fixp->fx_r_type == BFD_RELOC_MIPS16_HI16
- || l->fixp->fx_r_type == BFD_RELOC_MIPS16_HI16_S)
- looking_for_rtype = BFD_RELOC_MIPS16_LO16;
- else
- looking_for_rtype = BFD_RELOC_LO16;
-
- for (pos = &seginfo->fix_root; *pos != NULL; pos = &(*pos)->fx_next)
- {
- if (*pos == l->fixp)
- hi_pos = pos;
-
- if ((*pos)->fx_r_type == looking_for_rtype
- && (*pos)->fx_addsy == l->fixp->fx_addsy
- && (*pos)->fx_offset >= l->fixp->fx_offset
- && (lo_pos == NULL
- || (*pos)->fx_offset < (*lo_pos)->fx_offset
- || (!matched_lo_p
- && (*pos)->fx_offset == (*lo_pos)->fx_offset)))
- lo_pos = pos;
-
- matched_lo_p = (reloc_needs_lo_p ((*pos)->fx_r_type)
- && fixup_has_matching_lo_p (*pos));
- }
-
- /* If we found a match, remove the high-part relocation from its
- current position and insert it before the low-part relocation.
- Make the offsets match so that fixup_has_matching_lo_p()
- will return true.
-
- We don't warn about unmatched high-part relocations since some
- versions of gcc have been known to emit dead "lui ...%hi(...)"
- instructions. */
- if (lo_pos != NULL)
- {
- l->fixp->fx_offset = (*lo_pos)->fx_offset;
- if (l->fixp->fx_next != *lo_pos)
- {
- *hi_pos = l->fixp->fx_next;
- l->fixp->fx_next = *lo_pos;
- *lo_pos = l->fixp;
- }
- }
- }
-}
-
-/* We may have combined relocations without symbols in the N32/N64 ABI.
- We have to prevent gas from dropping them. */
-
-int
-mips_force_relocation (fixS *fixp)
-{
- if (generic_force_reloc (fixp))
- return 1;
-
- if (HAVE_NEWABI
- && S_GET_SEGMENT (fixp->fx_addsy) == bfd_abs_section_ptr
- && (fixp->fx_r_type == BFD_RELOC_MIPS_SUB
- || fixp->fx_r_type == BFD_RELOC_HI16_S
- || fixp->fx_r_type == BFD_RELOC_LO16))
- return 1;
-
- return 0;
-}
-
-/* Apply a fixup to the object file. */
-
-void
-md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
-{
- bfd_byte *buf;
- long insn;
- reloc_howto_type *howto;
-
- /* We ignore generic BFD relocations we don't know about. */
- howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
- if (! howto)
- return;
-
- assert (fixP->fx_size == 4
- || fixP->fx_r_type == BFD_RELOC_16
- || fixP->fx_r_type == BFD_RELOC_64
- || fixP->fx_r_type == BFD_RELOC_CTOR
- || fixP->fx_r_type == BFD_RELOC_MIPS_SUB
- || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
- || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY
- || fixP->fx_r_type == BFD_RELOC_MIPS_TLS_DTPREL64);
-
- buf = (bfd_byte *) (fixP->fx_frag->fr_literal + fixP->fx_where);
-
- assert (!fixP->fx_pcrel || fixP->fx_r_type == BFD_RELOC_16_PCREL_S2);
-
- /* Don't treat parts of a composite relocation as done. There are two
- reasons for this:
-
- (1) The second and third parts will be against 0 (RSS_UNDEF) but
- should nevertheless be emitted if the first part is.
-
- (2) In normal usage, composite relocations are never assembly-time
- constants. The easiest way of dealing with the pathological
- exceptions is to generate a relocation against STN_UNDEF and
- leave everything up to the linker. */
- if (fixP->fx_addsy == NULL && !fixP->fx_pcrel && fixP->fx_tcbit == 0)
- fixP->fx_done = 1;
-
- switch (fixP->fx_r_type)
- {
- case BFD_RELOC_MIPS_TLS_GD:
- case BFD_RELOC_MIPS_TLS_LDM:
- case BFD_RELOC_MIPS_TLS_DTPREL32:
- case BFD_RELOC_MIPS_TLS_DTPREL64:
- case BFD_RELOC_MIPS_TLS_DTPREL_HI16:
- case BFD_RELOC_MIPS_TLS_DTPREL_LO16:
- case BFD_RELOC_MIPS_TLS_GOTTPREL:
- case BFD_RELOC_MIPS_TLS_TPREL_HI16:
- case BFD_RELOC_MIPS_TLS_TPREL_LO16:
- S_SET_THREAD_LOCAL (fixP->fx_addsy);
- /* fall through */
-
- case BFD_RELOC_MIPS_JMP:
- case BFD_RELOC_MIPS_SHIFT5:
- case BFD_RELOC_MIPS_SHIFT6:
- case BFD_RELOC_MIPS_GOT_DISP:
- case BFD_RELOC_MIPS_GOT_PAGE:
- case BFD_RELOC_MIPS_GOT_OFST:
- case BFD_RELOC_MIPS_SUB:
- case BFD_RELOC_MIPS_INSERT_A:
- case BFD_RELOC_MIPS_INSERT_B:
- case BFD_RELOC_MIPS_DELETE:
- case BFD_RELOC_MIPS_HIGHEST:
- case BFD_RELOC_MIPS_HIGHER:
- case BFD_RELOC_MIPS_SCN_DISP:
- case BFD_RELOC_MIPS_REL16:
- case BFD_RELOC_MIPS_RELGOT:
- case BFD_RELOC_MIPS_JALR:
- case BFD_RELOC_HI16:
- case BFD_RELOC_HI16_S:
- case BFD_RELOC_GPREL16:
- case BFD_RELOC_MIPS_LITERAL:
- case BFD_RELOC_MIPS_CALL16:
- case BFD_RELOC_MIPS_GOT16:
- case BFD_RELOC_GPREL32:
- case BFD_RELOC_MIPS_GOT_HI16:
- case BFD_RELOC_MIPS_GOT_LO16:
- case BFD_RELOC_MIPS_CALL_HI16:
- case BFD_RELOC_MIPS_CALL_LO16:
- case BFD_RELOC_MIPS16_GPREL:
- case BFD_RELOC_MIPS16_HI16:
- case BFD_RELOC_MIPS16_HI16_S:
- case BFD_RELOC_MIPS16_JMP:
- /* Nothing needed to do. The value comes from the reloc entry. */
- break;
-
- case BFD_RELOC_64:
- /* This is handled like BFD_RELOC_32, but we output a sign
- extended value if we are only 32 bits. */
- if (fixP->fx_done)
- {
- if (8 <= sizeof (valueT))
- md_number_to_chars ((char *) buf, *valP, 8);
- else
- {
- valueT hiv;
-
- if ((*valP & 0x80000000) != 0)
- hiv = 0xffffffff;
- else
- hiv = 0;
- md_number_to_chars ((char *)(buf + (target_big_endian ? 4 : 0)),
- *valP, 4);
- md_number_to_chars ((char *)(buf + (target_big_endian ? 0 : 4)),
- hiv, 4);
- }
- }
- break;
-
- case BFD_RELOC_RVA:
- case BFD_RELOC_32:
- case BFD_RELOC_16:
- /* If we are deleting this reloc entry, we must fill in the
- value now. This can happen if we have a .word which is not
- resolved when it appears but is later defined. */
- if (fixP->fx_done)
- md_number_to_chars ((char *) buf, *valP, fixP->fx_size);
- break;
-
- case BFD_RELOC_LO16:
- case BFD_RELOC_MIPS16_LO16:
- /* FIXME: Now that embedded-PIC is gone, some of this code/comment
- may be safe to remove, but if so it's not obvious. */
- /* When handling an embedded PIC switch statement, we can wind
- up deleting a LO16 reloc. See the 'o' case in mips_ip. */
- if (fixP->fx_done)
- {
- if (*valP + 0x8000 > 0xffff)
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("relocation overflow"));
- if (target_big_endian)
- buf += 2;
- md_number_to_chars ((char *) buf, *valP, 2);
- }
- break;
-
- case BFD_RELOC_16_PCREL_S2:
- if ((*valP & 0x3) != 0)
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("Branch to misaligned address (%lx)"), (long) *valP);
-
- /* We need to save the bits in the instruction since fixup_segment()
- might be deleting the relocation entry (i.e., a branch within
- the current segment). */
- if (! fixP->fx_done)
- break;
-
- /* Update old instruction data. */
- if (target_big_endian)
- insn = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
- else
- insn = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
-
- if (*valP + 0x20000 <= 0x3ffff)
- {
- insn |= (*valP >> 2) & 0xffff;
- md_number_to_chars ((char *) buf, insn, 4);
- }
- else if (mips_pic == NO_PIC
- && fixP->fx_done
- && fixP->fx_frag->fr_address >= text_section->vma
- && (fixP->fx_frag->fr_address
- < text_section->vma + bfd_get_section_size (text_section))
- && ((insn & 0xffff0000) == 0x10000000 /* beq $0,$0 */
- || (insn & 0xffff0000) == 0x04010000 /* bgez $0 */
- || (insn & 0xffff0000) == 0x04110000)) /* bgezal $0 */
- {
- /* The branch offset is too large. If this is an
- unconditional branch, and we are not generating PIC code,
- we can convert it to an absolute jump instruction. */
- if ((insn & 0xffff0000) == 0x04110000) /* bgezal $0 */
- insn = 0x0c000000; /* jal */
- else
- insn = 0x08000000; /* j */
- fixP->fx_r_type = BFD_RELOC_MIPS_JMP;
- fixP->fx_done = 0;
- fixP->fx_addsy = section_symbol (text_section);
- *valP += md_pcrel_from (fixP);
- md_number_to_chars ((char *) buf, insn, 4);
- }
- else
- {
- /* If we got here, we have branch-relaxation disabled,
- and there's nothing we can do to fix this instruction
- without turning it into a longer sequence. */
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("Branch out of range"));
- }
- break;
-
- case BFD_RELOC_VTABLE_INHERIT:
- fixP->fx_done = 0;
- if (fixP->fx_addsy
- && !S_IS_DEFINED (fixP->fx_addsy)
- && !S_IS_WEAK (fixP->fx_addsy))
- S_SET_WEAK (fixP->fx_addsy);
- break;
-
- case BFD_RELOC_VTABLE_ENTRY:
- fixP->fx_done = 0;
- break;
-
- default:
- internalError ();
- }
-
- /* Remember value for tc_gen_reloc. */
- fixP->fx_addnumber = *valP;
-}
-
-static symbolS *
-get_symbol (void)
-{
- int c;
- char *name;
- symbolS *p;
-
- name = input_line_pointer;
- c = get_symbol_end ();
- p = (symbolS *) symbol_find_or_make (name);
- *input_line_pointer = c;
- return p;
-}
-
-/* Align the current frag to a given power of two. If a particular
- fill byte should be used, FILL points to an integer that contains
- that byte, otherwise FILL is null.
-
- The MIPS assembler also automatically adjusts any preceding
- label. */
-
-static void
-mips_align (int to, int *fill, symbolS *label)
-{
- mips_emit_delays ();
- mips_record_mips16_mode ();
- if (fill == NULL && subseg_text_p (now_seg))
- frag_align_code (to, 0);
- else
- frag_align (to, fill ? *fill : 0, 0);
- record_alignment (now_seg, to);
- if (label != NULL)
- {
- assert (S_GET_SEGMENT (label) == now_seg);
- symbol_set_frag (label, frag_now);
- S_SET_VALUE (label, (valueT) frag_now_fix ());
- }
-}
-
-/* Align to a given power of two. .align 0 turns off the automatic
- alignment used by the data creating pseudo-ops. */
-
-static void
-s_align (int x ATTRIBUTE_UNUSED)
-{
- int temp, fill_value, *fill_ptr;
- long max_alignment = 28;
-
- /* o Note that the assembler pulls down any immediately preceding label
- to the aligned address.
- o It's not documented but auto alignment is reinstated by
- a .align pseudo instruction.
- o Note also that after auto alignment is turned off the mips assembler
- issues an error on attempt to assemble an improperly aligned data item.
- We don't. */
-
- temp = get_absolute_expression ();
- if (temp > max_alignment)
- as_bad (_("Alignment too large: %d. assumed."), temp = max_alignment);
- else if (temp < 0)
- {
- as_warn (_("Alignment negative: 0 assumed."));
- temp = 0;
- }
- if (*input_line_pointer == ',')
- {
- ++input_line_pointer;
- fill_value = get_absolute_expression ();
- fill_ptr = &fill_value;
- }
- else
- fill_ptr = 0;
- if (temp)
- {
- segment_info_type *si = seg_info (now_seg);
- struct insn_label_list *l = si->label_list;
- /* Auto alignment should be switched on by next section change. */
- auto_align = 1;
- mips_align (temp, fill_ptr, l != NULL ? l->label : NULL);
- }
- else
- {
- auto_align = 0;
- }
-
- demand_empty_rest_of_line ();
-}
-
-static void
-s_change_sec (int sec)
-{
- segT seg;
-
-#ifdef OBJ_ELF
- /* The ELF backend needs to know that we are changing sections, so
- that .previous works correctly. We could do something like check
- for an obj_section_change_hook macro, but that might be confusing
- as it would not be appropriate to use it in the section changing
- functions in read.c, since obj-elf.c intercepts those. FIXME:
- This should be cleaner, somehow. */
- if (IS_ELF)
- obj_elf_section_change_hook ();
-#endif
-
- mips_emit_delays ();
- switch (sec)
- {
- case 't':
- s_text (0);
- break;
- case 'd':
- s_data (0);
- break;
- case 'b':
- subseg_set (bss_section, (subsegT) get_absolute_expression ());
- demand_empty_rest_of_line ();
- break;
-
- case 'r':
- seg = subseg_new (RDATA_SECTION_NAME,
- (subsegT) get_absolute_expression ());
- if (IS_ELF)
- {
- bfd_set_section_flags (stdoutput, seg, (SEC_ALLOC | SEC_LOAD
- | SEC_READONLY | SEC_RELOC
- | SEC_DATA));
- if (strncmp (TARGET_OS, "elf", 3) != 0)
- record_alignment (seg, 4);
- }
- demand_empty_rest_of_line ();
- break;
-
- case 's':
- seg = subseg_new (".sdata", (subsegT) get_absolute_expression ());
- if (IS_ELF)
- {
- bfd_set_section_flags (stdoutput, seg,
- SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
- if (strncmp (TARGET_OS, "elf", 3) != 0)
- record_alignment (seg, 4);
- }
- demand_empty_rest_of_line ();
- break;
- }
-
- auto_align = 1;
-}
-
-void
-s_change_section (int ignore ATTRIBUTE_UNUSED)
-{
-#ifdef OBJ_ELF
- char *section_name;
- char c;
- char next_c = 0;
- int section_type;
- int section_flag;
- int section_entry_size;
- int section_alignment;
-
- if (!IS_ELF)
- return;
-
- section_name = input_line_pointer;
- c = get_symbol_end ();
- if (c)
- next_c = *(input_line_pointer + 1);
-
- /* Do we have .section Name<,"flags">? */
- if (c != ',' || (c == ',' && next_c == '"'))
- {
- /* just after name is now '\0'. */
- *input_line_pointer = c;
- input_line_pointer = section_name;
- obj_elf_section (ignore);
- return;
- }
- input_line_pointer++;
-
- /* Do we have .section Name<,type><,flag><,entry_size><,alignment> */
- if (c == ',')
- section_type = get_absolute_expression ();
- else
- section_type = 0;
- if (*input_line_pointer++ == ',')
- section_flag = get_absolute_expression ();
- else
- section_flag = 0;
- if (*input_line_pointer++ == ',')
- section_entry_size = get_absolute_expression ();
- else
- section_entry_size = 0;
- if (*input_line_pointer++ == ',')
- section_alignment = get_absolute_expression ();
- else
- section_alignment = 0;
-
- section_name = xstrdup (section_name);
-
- /* When using the generic form of .section (as implemented by obj-elf.c),
- there's no way to set the section type to SHT_MIPS_DWARF. Users have
- traditionally had to fall back on the more common @progbits instead.
-
- There's nothing really harmful in this, since bfd will correct
- SHT_PROGBITS to SHT_MIPS_DWARF before writing out the file. But it
- means that, for backwards compatibility, the special_section entries
- for dwarf sections must use SHT_PROGBITS rather than SHT_MIPS_DWARF.
-
- Even so, we shouldn't force users of the MIPS .section syntax to
- incorrectly label the sections as SHT_PROGBITS. The best compromise
- seems to be to map SHT_MIPS_DWARF to SHT_PROGBITS before calling the
- generic type-checking code. */
- if (section_type == SHT_MIPS_DWARF)
- section_type = SHT_PROGBITS;
-
- obj_elf_change_section (section_name, section_type, section_flag,
- section_entry_size, 0, 0, 0);
-
- if (now_seg->name != section_name)
- free (section_name);
-#endif /* OBJ_ELF */
-}
-
-void
-mips_enable_auto_align (void)
-{
- auto_align = 1;
-}
-
-static void
-s_cons (int log_size)
-{
- segment_info_type *si = seg_info (now_seg);
- struct insn_label_list *l = si->label_list;
- symbolS *label;
-
- label = l != NULL ? l->label : NULL;
- mips_emit_delays ();
- if (log_size > 0 && auto_align)
- mips_align (log_size, 0, label);
- mips_clear_insn_labels ();
- cons (1 << log_size);
-}
-
-static void
-s_float_cons (int type)
-{
- segment_info_type *si = seg_info (now_seg);
- struct insn_label_list *l = si->label_list;
- symbolS *label;
-
- label = l != NULL ? l->label : NULL;
-
- mips_emit_delays ();
-
- if (auto_align)
- {
- if (type == 'd')
- mips_align (3, 0, label);
- else
- mips_align (2, 0, label);
- }
-
- mips_clear_insn_labels ();
-
- float_cons (type);
-}
-
-/* Handle .globl. We need to override it because on Irix 5 you are
- permitted to say
- .globl foo .text
- where foo is an undefined symbol, to mean that foo should be
- considered to be the address of a function. */
-
-static void
-s_mips_globl (int x ATTRIBUTE_UNUSED)
-{
- char *name;
- int c;
- symbolS *symbolP;
- flagword flag;
-
- do
- {
- name = input_line_pointer;
- c = get_symbol_end ();
- symbolP = symbol_find_or_make (name);
- S_SET_EXTERNAL (symbolP);
-
- *input_line_pointer = c;
- SKIP_WHITESPACE ();
-
- /* On Irix 5, every global symbol that is not explicitly labelled as
- being a function is apparently labelled as being an object. */
- flag = BSF_OBJECT;
-
- if (!is_end_of_line[(unsigned char) *input_line_pointer]
- && (*input_line_pointer != ','))
- {
- char *secname;
- asection *sec;
-
- secname = input_line_pointer;
- c = get_symbol_end ();
- sec = bfd_get_section_by_name (stdoutput, secname);
- if (sec == NULL)
- as_bad (_("%s: no such section"), secname);
- *input_line_pointer = c;
-
- if (sec != NULL && (sec->flags & SEC_CODE) != 0)
- flag = BSF_FUNCTION;
- }
-
- symbol_get_bfdsym (symbolP)->flags |= flag;
-
- c = *input_line_pointer;
- if (c == ',')
- {
- input_line_pointer++;
- SKIP_WHITESPACE ();
- if (is_end_of_line[(unsigned char) *input_line_pointer])
- c = '\n';
- }
- }
- while (c == ',');
-
- demand_empty_rest_of_line ();
-}
-
-static void
-s_option (int x ATTRIBUTE_UNUSED)
-{
- char *opt;
- char c;
-
- opt = input_line_pointer;
- c = get_symbol_end ();
-
- if (*opt == 'O')
- {
- /* FIXME: What does this mean? */
- }
- else if (strncmp (opt, "pic", 3) == 0)
- {
- int i;
-
- i = atoi (opt + 3);
- if (i == 0)
- mips_pic = NO_PIC;
- else if (i == 2)
- {
- mips_pic = SVR4_PIC;
- mips_abicalls = TRUE;
- }
- else
- as_bad (_(".option pic%d not supported"), i);
-
- if (mips_pic == SVR4_PIC)
- {
- if (g_switch_seen && g_switch_value != 0)
- as_warn (_("-G may not be used with SVR4 PIC code"));
- g_switch_value = 0;
- bfd_set_gp_size (stdoutput, 0);
- }
- }
- else
- as_warn (_("Unrecognized option \"%s\""), opt);
-
- *input_line_pointer = c;
- demand_empty_rest_of_line ();
-}
-
-/* This structure is used to hold a stack of .set values. */
-
-struct mips_option_stack
-{
- struct mips_option_stack *next;
- struct mips_set_options options;
-};
-
-static struct mips_option_stack *mips_opts_stack;
-
-/* Handle the .set pseudo-op. */
-
-static void
-s_mipsset (int x ATTRIBUTE_UNUSED)
-{
- char *name = input_line_pointer, ch;
-
- while (!is_end_of_line[(unsigned char) *input_line_pointer])
- ++input_line_pointer;
- ch = *input_line_pointer;
- *input_line_pointer = '\0';
-
- if (strcmp (name, "reorder") == 0)
- {
- if (mips_opts.noreorder)
- end_noreorder ();
- }
- else if (strcmp (name, "noreorder") == 0)
- {
- if (!mips_opts.noreorder)
- start_noreorder ();
- }
- else if (strncmp (name, "at=", 3) == 0)
- {
- char *s = name + 3;
-
- if (!reg_lookup (&s, RTYPE_NUM | RTYPE_GP, &mips_opts.at))
- as_bad (_("Unrecognized register name `%s'"), s);
- }
- else if (strcmp (name, "at") == 0)
- {
- mips_opts.at = ATREG;
- }
- else if (strcmp (name, "noat") == 0)
- {
- mips_opts.at = ZERO;
- }
- else if (strcmp (name, "macro") == 0)
- {
- mips_opts.warn_about_macros = 0;
- }
- else if (strcmp (name, "nomacro") == 0)
- {
- if (mips_opts.noreorder == 0)
- as_bad (_("`noreorder' must be set before `nomacro'"));
- mips_opts.warn_about_macros = 1;
- }
- else if (strcmp (name, "move") == 0 || strcmp (name, "novolatile") == 0)
- {
- mips_opts.nomove = 0;
- }
- else if (strcmp (name, "nomove") == 0 || strcmp (name, "volatile") == 0)
- {
- mips_opts.nomove = 1;
- }
- else if (strcmp (name, "bopt") == 0)
- {
- mips_opts.nobopt = 0;
- }
- else if (strcmp (name, "nobopt") == 0)
- {
- mips_opts.nobopt = 1;
- }
- else if (strcmp (name, "gp=default") == 0)
- mips_opts.gp32 = file_mips_gp32;
- else if (strcmp (name, "gp=32") == 0)
- mips_opts.gp32 = 1;
- else if (strcmp (name, "gp=64") == 0)
- {
- if (!ISA_HAS_64BIT_REGS (mips_opts.isa))
- as_warn ("%s isa does not support 64-bit registers",
- mips_cpu_info_from_isa (mips_opts.isa)->name);
- mips_opts.gp32 = 0;
- }
- else if (strcmp (name, "fp=default") == 0)
- mips_opts.fp32 = file_mips_fp32;
- else if (strcmp (name, "fp=32") == 0)
- mips_opts.fp32 = 1;
- else if (strcmp (name, "fp=64") == 0)
- {
- if (!ISA_HAS_64BIT_FPRS (mips_opts.isa))
- as_warn ("%s isa does not support 64-bit floating point registers",
- mips_cpu_info_from_isa (mips_opts.isa)->name);
- mips_opts.fp32 = 0;
- }
- else if (strcmp (name, "softfloat") == 0)
- mips_opts.soft_float = 1;
- else if (strcmp (name, "hardfloat") == 0)
- mips_opts.soft_float = 0;
- else if (strcmp (name, "singlefloat") == 0)
- mips_opts.single_float = 1;
- else if (strcmp (name, "doublefloat") == 0)
- mips_opts.single_float = 0;
- else if (strcmp (name, "mips16") == 0
- || strcmp (name, "MIPS-16") == 0)
- mips_opts.mips16 = 1;
- else if (strcmp (name, "nomips16") == 0
- || strcmp (name, "noMIPS-16") == 0)
- mips_opts.mips16 = 0;
- else if (strcmp (name, "smartmips") == 0)
- {
- if (!ISA_SUPPORTS_SMARTMIPS)
- as_warn ("%s ISA does not support SmartMIPS ASE",
- mips_cpu_info_from_isa (mips_opts.isa)->name);
- mips_opts.ase_smartmips = 1;
- }
- else if (strcmp (name, "nosmartmips") == 0)
- mips_opts.ase_smartmips = 0;
- else if (strcmp (name, "mips3d") == 0)
- mips_opts.ase_mips3d = 1;
- else if (strcmp (name, "nomips3d") == 0)
- mips_opts.ase_mips3d = 0;
- else if (strcmp (name, "mdmx") == 0)
- mips_opts.ase_mdmx = 1;
- else if (strcmp (name, "nomdmx") == 0)
- mips_opts.ase_mdmx = 0;
- else if (strcmp (name, "dsp") == 0)
- {
- if (!ISA_SUPPORTS_DSP_ASE)
- as_warn ("%s ISA does not support DSP ASE",
- mips_cpu_info_from_isa (mips_opts.isa)->name);
- mips_opts.ase_dsp = 1;
- mips_opts.ase_dspr2 = 0;
- }
- else if (strcmp (name, "nodsp") == 0)
- {
- mips_opts.ase_dsp = 0;
- mips_opts.ase_dspr2 = 0;
- }
- else if (strcmp (name, "dspr2") == 0)
- {
- if (!ISA_SUPPORTS_DSPR2_ASE)
- as_warn ("%s ISA does not support DSP R2 ASE",
- mips_cpu_info_from_isa (mips_opts.isa)->name);
- mips_opts.ase_dspr2 = 1;
- mips_opts.ase_dsp = 1;
- }
- else if (strcmp (name, "nodspr2") == 0)
- {
- mips_opts.ase_dspr2 = 0;
- mips_opts.ase_dsp = 0;
- }
- else if (strcmp (name, "mt") == 0)
- {
- if (!ISA_SUPPORTS_MT_ASE)
- as_warn ("%s ISA does not support MT ASE",
- mips_cpu_info_from_isa (mips_opts.isa)->name);
- mips_opts.ase_mt = 1;
- }
- else if (strcmp (name, "nomt") == 0)
- mips_opts.ase_mt = 0;
- else if (strncmp (name, "mips", 4) == 0 || strncmp (name, "arch=", 5) == 0)
- {
- int reset = 0;
-
- /* Permit the user to change the ISA and architecture on the fly.
- Needless to say, misuse can cause serious problems. */
- if (strcmp (name, "mips0") == 0 || strcmp (name, "arch=default") == 0)
- {
- reset = 1;
- mips_opts.isa = file_mips_isa;
- mips_opts.arch = file_mips_arch;
- }
- else if (strncmp (name, "arch=", 5) == 0)
- {
- const struct mips_cpu_info *p;
-
- p = mips_parse_cpu("internal use", name + 5);
- if (!p)
- as_bad (_("unknown architecture %s"), name + 5);
- else
- {
- mips_opts.arch = p->cpu;
- mips_opts.isa = p->isa;
- }
- }
- else if (strncmp (name, "mips", 4) == 0)
- {
- const struct mips_cpu_info *p;
-
- p = mips_parse_cpu("internal use", name);
- if (!p)
- as_bad (_("unknown ISA level %s"), name + 4);
- else
- {
- mips_opts.arch = p->cpu;
- mips_opts.isa = p->isa;
- }
- }
- else
- as_bad (_("unknown ISA or architecture %s"), name);
-
- switch (mips_opts.isa)
- {
- case 0:
- break;
- case ISA_MIPS1:
- case ISA_MIPS2:
- case ISA_MIPS32:
- case ISA_MIPS32R2:
- mips_opts.gp32 = 1;
- mips_opts.fp32 = 1;
- break;
- case ISA_MIPS3:
- case ISA_MIPS4:
- case ISA_MIPS5:
- case ISA_MIPS64:
- case ISA_MIPS64R2:
- mips_opts.gp32 = 0;
- mips_opts.fp32 = 0;
- break;
- default:
- as_bad (_("unknown ISA level %s"), name + 4);
- break;
- }
- if (reset)
- {
- mips_opts.gp32 = file_mips_gp32;
- mips_opts.fp32 = file_mips_fp32;
- }
- }
- else if (strcmp (name, "autoextend") == 0)
- mips_opts.noautoextend = 0;
- else if (strcmp (name, "noautoextend") == 0)
- mips_opts.noautoextend = 1;
- else if (strcmp (name, "push") == 0)
- {
- struct mips_option_stack *s;
-
- s = (struct mips_option_stack *) xmalloc (sizeof *s);
- s->next = mips_opts_stack;
- s->options = mips_opts;
- mips_opts_stack = s;
- }
- else if (strcmp (name, "pop") == 0)
- {
- struct mips_option_stack *s;
-
- s = mips_opts_stack;
- if (s == NULL)
- as_bad (_(".set pop with no .set push"));
- else
- {
- /* If we're changing the reorder mode we need to handle
- delay slots correctly. */
- if (s->options.noreorder && ! mips_opts.noreorder)
- start_noreorder ();
- else if (! s->options.noreorder && mips_opts.noreorder)
- end_noreorder ();
-
- mips_opts = s->options;
- mips_opts_stack = s->next;
- free (s);
- }
- }
- else if (strcmp (name, "sym32") == 0)
- mips_opts.sym32 = TRUE;
- else if (strcmp (name, "nosym32") == 0)
- mips_opts.sym32 = FALSE;
- else if (strchr (name, ','))
- {
- /* Generic ".set" directive; use the generic handler. */
- *input_line_pointer = ch;
- input_line_pointer = name;
- s_set (0);
- return;
- }
- else
- {
- as_warn (_("Tried to set unrecognized symbol: %s\n"), name);
- }
- *input_line_pointer = ch;
- demand_empty_rest_of_line ();
-}
-
-/* Handle the .abicalls pseudo-op. I believe this is equivalent to
- .option pic2. It means to generate SVR4 PIC calls. */
-
-static void
-s_abicalls (int ignore ATTRIBUTE_UNUSED)
-{
- mips_pic = SVR4_PIC;
- mips_abicalls = TRUE;
-
- if (g_switch_seen && g_switch_value != 0)
- as_warn (_("-G may not be used with SVR4 PIC code"));
- g_switch_value = 0;
-
- bfd_set_gp_size (stdoutput, 0);
- demand_empty_rest_of_line ();
-}
-
-/* Handle the .cpload pseudo-op. This is used when generating SVR4
- PIC code. It sets the $gp register for the function based on the
- function address, which is in the register named in the argument.
- This uses a relocation against _gp_disp, which is handled specially
- by the linker. The result is:
- lui $gp,%hi(_gp_disp)
- addiu $gp,$gp,%lo(_gp_disp)
- addu $gp,$gp,.cpload argument
- The .cpload argument is normally $25 == $t9.
-
- The -mno-shared option changes this to:
- lui $gp,%hi(__gnu_local_gp)
- addiu $gp,$gp,%lo(__gnu_local_gp)
- and the argument is ignored. This saves an instruction, but the
- resulting code is not position independent; it uses an absolute
- address for __gnu_local_gp. Thus code assembled with -mno-shared
- can go into an ordinary executable, but not into a shared library. */
-
-static void
-s_cpload (int ignore ATTRIBUTE_UNUSED)
-{
- expressionS ex;
- int reg;
- int in_shared;
-
- /* If we are not generating SVR4 PIC code, or if this is NewABI code,
- .cpload is ignored. */
- if (mips_pic != SVR4_PIC || HAVE_NEWABI)
- {
- s_ignore (0);
- return;
- }
-
- /* .cpload should be in a .set noreorder section. */
- if (mips_opts.noreorder == 0)
- as_warn (_(".cpload not in noreorder section"));
-
- reg = tc_get_register (0);
-
- /* If we need to produce a 64-bit address, we are better off using
- the default instruction sequence. */
- in_shared = mips_in_shared || HAVE_64BIT_SYMBOLS;
-
- ex.X_op = O_symbol;
- ex.X_add_symbol = symbol_find_or_make (in_shared ? "_gp_disp" :
- "__gnu_local_gp");
- ex.X_op_symbol = NULL;
- ex.X_add_number = 0;
-
- /* In ELF, this symbol is implicitly an STT_OBJECT symbol. */
- symbol_get_bfdsym (ex.X_add_symbol)->flags |= BSF_OBJECT;
-
- macro_start ();
- macro_build_lui (&ex, mips_gp_register);
- macro_build (&ex, "addiu", "t,r,j", mips_gp_register,
- mips_gp_register, BFD_RELOC_LO16);
- if (in_shared)
- macro_build (NULL, "addu", "d,v,t", mips_gp_register,
- mips_gp_register, reg);
- macro_end ();
-
- demand_empty_rest_of_line ();
-}
-
-/* Handle the .cpsetup pseudo-op defined for NewABI PIC code. The syntax is:
- .cpsetup $reg1, offset|$reg2, label
-
- If offset is given, this results in:
- sd $gp, offset($sp)
- lui $gp, %hi(%neg(%gp_rel(label)))
- addiu $gp, $gp, %lo(%neg(%gp_rel(label)))
- daddu $gp, $gp, $reg1
-
- If $reg2 is given, this results in:
- daddu $reg2, $gp, $0
- lui $gp, %hi(%neg(%gp_rel(label)))
- addiu $gp, $gp, %lo(%neg(%gp_rel(label)))
- daddu $gp, $gp, $reg1
- $reg1 is normally $25 == $t9.
-
- The -mno-shared option replaces the last three instructions with
- lui $gp,%hi(_gp)
- addiu $gp,$gp,%lo(_gp) */
-
-static void
-s_cpsetup (int ignore ATTRIBUTE_UNUSED)
-{
- expressionS ex_off;
- expressionS ex_sym;
- int reg1;
-
- /* If we are not generating SVR4 PIC code, .cpsetup is ignored.
- We also need NewABI support. */
- if (mips_pic != SVR4_PIC || ! HAVE_NEWABI)
- {
- s_ignore (0);
- return;
- }
-
- reg1 = tc_get_register (0);
- SKIP_WHITESPACE ();
- if (*input_line_pointer != ',')
- {
- as_bad (_("missing argument separator ',' for .cpsetup"));
- return;
- }
- else
- ++input_line_pointer;
- SKIP_WHITESPACE ();
- if (*input_line_pointer == '$')
- {
- mips_cpreturn_register = tc_get_register (0);
- mips_cpreturn_offset = -1;
- }
- else
- {
- mips_cpreturn_offset = get_absolute_expression ();
- mips_cpreturn_register = -1;
- }
- SKIP_WHITESPACE ();
- if (*input_line_pointer != ',')
- {
- as_bad (_("missing argument separator ',' for .cpsetup"));
- return;
- }
- else
- ++input_line_pointer;
- SKIP_WHITESPACE ();
- expression (&ex_sym);
-
- macro_start ();
- if (mips_cpreturn_register == -1)
- {
- ex_off.X_op = O_constant;
- ex_off.X_add_symbol = NULL;
- ex_off.X_op_symbol = NULL;
- ex_off.X_add_number = mips_cpreturn_offset;
-
- macro_build (&ex_off, "sd", "t,o(b)", mips_gp_register,
- BFD_RELOC_LO16, SP);
- }
- else
- macro_build (NULL, "daddu", "d,v,t", mips_cpreturn_register,
- mips_gp_register, 0);
-
- if (mips_in_shared || HAVE_64BIT_SYMBOLS)
- {
- macro_build (&ex_sym, "lui", "t,u", mips_gp_register,
- -1, BFD_RELOC_GPREL16, BFD_RELOC_MIPS_SUB,
- BFD_RELOC_HI16_S);
-
- macro_build (&ex_sym, "addiu", "t,r,j", mips_gp_register,
- mips_gp_register, -1, BFD_RELOC_GPREL16,
- BFD_RELOC_MIPS_SUB, BFD_RELOC_LO16);
-
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", mips_gp_register,
- mips_gp_register, reg1);
- }
- else
- {
- expressionS ex;
-
- ex.X_op = O_symbol;
- ex.X_add_symbol = symbol_find_or_make ("__gnu_local_gp");
- ex.X_op_symbol = NULL;
- ex.X_add_number = 0;
-
- /* In ELF, this symbol is implicitly an STT_OBJECT symbol. */
- symbol_get_bfdsym (ex.X_add_symbol)->flags |= BSF_OBJECT;
-
- macro_build_lui (&ex, mips_gp_register);
- macro_build (&ex, "addiu", "t,r,j", mips_gp_register,
- mips_gp_register, BFD_RELOC_LO16);
- }
-
- macro_end ();
-
- demand_empty_rest_of_line ();
-}
-
-static void
-s_cplocal (int ignore ATTRIBUTE_UNUSED)
-{
- /* If we are not generating SVR4 PIC code, or if this is not NewABI code,
- .cplocal is ignored. */
- if (mips_pic != SVR4_PIC || ! HAVE_NEWABI)
- {
- s_ignore (0);
- return;
- }
-
- mips_gp_register = tc_get_register (0);
- demand_empty_rest_of_line ();
-}
-
-/* Handle the .cprestore pseudo-op. This stores $gp into a given
- offset from $sp. The offset is remembered, and after making a PIC
- call $gp is restored from that location. */
-
-static void
-s_cprestore (int ignore ATTRIBUTE_UNUSED)
-{
- expressionS ex;
-
- /* If we are not generating SVR4 PIC code, or if this is NewABI code,
- .cprestore is ignored. */
- if (mips_pic != SVR4_PIC || HAVE_NEWABI)
- {
- s_ignore (0);
- return;
- }
-
- mips_cprestore_offset = get_absolute_expression ();
- mips_cprestore_valid = 1;
-
- ex.X_op = O_constant;
- ex.X_add_symbol = NULL;
- ex.X_op_symbol = NULL;
- ex.X_add_number = mips_cprestore_offset;
-
- macro_start ();
- macro_build_ldst_constoffset (&ex, ADDRESS_STORE_INSN, mips_gp_register,
- SP, HAVE_64BIT_ADDRESSES);
- macro_end ();
-
- demand_empty_rest_of_line ();
-}
-
-/* Handle the .cpreturn pseudo-op defined for NewABI PIC code. If an offset
- was given in the preceding .cpsetup, it results in:
- ld $gp, offset($sp)
-
- If a register $reg2 was given there, it results in:
- daddu $gp, $reg2, $0 */
-
-static void
-s_cpreturn (int ignore ATTRIBUTE_UNUSED)
-{
- expressionS ex;
-
- /* If we are not generating SVR4 PIC code, .cpreturn is ignored.
- We also need NewABI support. */
- if (mips_pic != SVR4_PIC || ! HAVE_NEWABI)
- {
- s_ignore (0);
- return;
- }
-
- macro_start ();
- if (mips_cpreturn_register == -1)
- {
- ex.X_op = O_constant;
- ex.X_add_symbol = NULL;
- ex.X_op_symbol = NULL;
- ex.X_add_number = mips_cpreturn_offset;
-
- macro_build (&ex, "ld", "t,o(b)", mips_gp_register, BFD_RELOC_LO16, SP);
- }
- else
- macro_build (NULL, "daddu", "d,v,t", mips_gp_register,
- mips_cpreturn_register, 0);
- macro_end ();
-
- demand_empty_rest_of_line ();
-}
-
-/* Handle the .dtprelword and .dtpreldword pseudo-ops. They generate
- a 32-bit or 64-bit DTP-relative relocation (BYTES says which) for
- use in DWARF debug information. */
-
-static void
-s_dtprel_internal (size_t bytes)
-{
- expressionS ex;
- char *p;
-
- expression (&ex);
-
- if (ex.X_op != O_symbol)
- {
- as_bad (_("Unsupported use of %s"), (bytes == 8
- ? ".dtpreldword"
- : ".dtprelword"));
- ignore_rest_of_line ();
- }
-
- p = frag_more (bytes);
- md_number_to_chars (p, 0, bytes);
- fix_new_exp (frag_now, p - frag_now->fr_literal, bytes, &ex, FALSE,
- (bytes == 8
- ? BFD_RELOC_MIPS_TLS_DTPREL64
- : BFD_RELOC_MIPS_TLS_DTPREL32));
-
- demand_empty_rest_of_line ();
-}
-
-/* Handle .dtprelword. */
-
-static void
-s_dtprelword (int ignore ATTRIBUTE_UNUSED)
-{
- s_dtprel_internal (4);
-}
-
-/* Handle .dtpreldword. */
-
-static void
-s_dtpreldword (int ignore ATTRIBUTE_UNUSED)
-{
- s_dtprel_internal (8);
-}
-
-/* Handle the .gpvalue pseudo-op. This is used when generating NewABI PIC
- code. It sets the offset to use in gp_rel relocations. */
-
-static void
-s_gpvalue (int ignore ATTRIBUTE_UNUSED)
-{
- /* If we are not generating SVR4 PIC code, .gpvalue is ignored.
- We also need NewABI support. */
- if (mips_pic != SVR4_PIC || ! HAVE_NEWABI)
- {
- s_ignore (0);
- return;
- }
-
- mips_gprel_offset = get_absolute_expression ();
-
- demand_empty_rest_of_line ();
-}
-
-/* Handle the .gpword pseudo-op. This is used when generating PIC
- code. It generates a 32 bit GP relative reloc. */
-
-static void
-s_gpword (int ignore ATTRIBUTE_UNUSED)
-{
- segment_info_type *si;
- struct insn_label_list *l;
- symbolS *label;
- expressionS ex;
- char *p;
-
- /* When not generating PIC code, this is treated as .word. */
- if (mips_pic != SVR4_PIC)
- {
- s_cons (2);
- return;
- }
-
- si = seg_info (now_seg);
- l = si->label_list;
- label = l != NULL ? l->label : NULL;
- mips_emit_delays ();
- if (auto_align)
- mips_align (2, 0, label);
- mips_clear_insn_labels ();
-
- expression (&ex);
-
- if (ex.X_op != O_symbol || ex.X_add_number != 0)
- {
- as_bad (_("Unsupported use of .gpword"));
- ignore_rest_of_line ();
- }
-
- p = frag_more (4);
- md_number_to_chars (p, 0, 4);
- fix_new_exp (frag_now, p - frag_now->fr_literal, 4, &ex, FALSE,
- BFD_RELOC_GPREL32);
-
- demand_empty_rest_of_line ();
-}
-
-static void
-s_gpdword (int ignore ATTRIBUTE_UNUSED)
-{
- segment_info_type *si;
- struct insn_label_list *l;
- symbolS *label;
- expressionS ex;
- char *p;
-
- /* When not generating PIC code, this is treated as .dword. */
- if (mips_pic != SVR4_PIC)
- {
- s_cons (3);
- return;
- }
-
- si = seg_info (now_seg);
- l = si->label_list;
- label = l != NULL ? l->label : NULL;
- mips_emit_delays ();
- if (auto_align)
- mips_align (3, 0, label);
- mips_clear_insn_labels ();
-
- expression (&ex);
-
- if (ex.X_op != O_symbol || ex.X_add_number != 0)
- {
- as_bad (_("Unsupported use of .gpdword"));
- ignore_rest_of_line ();
- }
-
- p = frag_more (8);
- md_number_to_chars (p, 0, 8);
- fix_new_exp (frag_now, p - frag_now->fr_literal, 4, &ex, FALSE,
- BFD_RELOC_GPREL32)->fx_tcbit = 1;
-
- /* GPREL32 composed with 64 gives a 64-bit GP offset. */
- fix_new (frag_now, p - frag_now->fr_literal, 8, NULL, 0,
- FALSE, BFD_RELOC_64)->fx_tcbit = 1;
-
- demand_empty_rest_of_line ();
-}
-
-/* Handle the .cpadd pseudo-op. This is used when dealing with switch
- tables in SVR4 PIC code. */
-
-static void
-s_cpadd (int ignore ATTRIBUTE_UNUSED)
-{
- int reg;
-
- /* This is ignored when not generating SVR4 PIC code. */
- if (mips_pic != SVR4_PIC)
- {
- s_ignore (0);
- return;
- }
-
- /* Add $gp to the register named as an argument. */
- macro_start ();
- reg = tc_get_register (0);
- macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", reg, reg, mips_gp_register);
- macro_end ();
-
- demand_empty_rest_of_line ();
-}
-
-/* Handle the .insn pseudo-op. This marks instruction labels in
- mips16 mode. This permits the linker to handle them specially,
- such as generating jalx instructions when needed. We also make
- them odd for the duration of the assembly, in order to generate the
- right sort of code. We will make them even in the adjust_symtab
- routine, while leaving them marked. This is convenient for the
- debugger and the disassembler. The linker knows to make them odd
- again. */
-
-static void
-s_insn (int ignore ATTRIBUTE_UNUSED)
-{
- mips16_mark_labels ();
-
- demand_empty_rest_of_line ();
-}
-
-/* Handle a .stabn directive. We need these in order to mark a label
- as being a mips16 text label correctly. Sometimes the compiler
- will emit a label, followed by a .stabn, and then switch sections.
- If the label and .stabn are in mips16 mode, then the label is
- really a mips16 text label. */
-
-static void
-s_mips_stab (int type)
-{
- if (type == 'n')
- mips16_mark_labels ();
-
- s_stab (type);
-}
-
-/* Handle the .weakext pseudo-op as defined in Kane and Heinrich. */
-
-static void
-s_mips_weakext (int ignore ATTRIBUTE_UNUSED)
-{
- char *name;
- int c;
- symbolS *symbolP;
- expressionS exp;
-
- name = input_line_pointer;
- c = get_symbol_end ();
- symbolP = symbol_find_or_make (name);
- S_SET_WEAK (symbolP);
- *input_line_pointer = c;
-
- SKIP_WHITESPACE ();
-
- if (! is_end_of_line[(unsigned char) *input_line_pointer])
- {
- if (S_IS_DEFINED (symbolP))
- {
- as_bad ("ignoring attempt to redefine symbol %s",
- S_GET_NAME (symbolP));
- ignore_rest_of_line ();
- return;
- }
-
- if (*input_line_pointer == ',')
- {
- ++input_line_pointer;
- SKIP_WHITESPACE ();
- }
-
- expression (&exp);
- if (exp.X_op != O_symbol)
- {
- as_bad ("bad .weakext directive");
- ignore_rest_of_line ();
- return;
- }
- symbol_set_value_expression (symbolP, &exp);
- }
-
- demand_empty_rest_of_line ();
-}
-
-/* Parse a register string into a number. Called from the ECOFF code
- to parse .frame. The argument is non-zero if this is the frame
- register, so that we can record it in mips_frame_reg. */
-
-int
-tc_get_register (int frame)
-{
- unsigned int reg;
-
- SKIP_WHITESPACE ();
- if (! reg_lookup (&input_line_pointer, RWARN | RTYPE_NUM | RTYPE_GP, &reg))
- reg = 0;
- if (frame)
- {
- mips_frame_reg = reg != 0 ? reg : SP;
- mips_frame_reg_valid = 1;
- mips_cprestore_valid = 0;
- }
- return reg;
-}
-
-valueT
-md_section_align (asection *seg, valueT addr)
-{
- int align = bfd_get_section_alignment (stdoutput, seg);
-
- if (IS_ELF)
- {
- /* We don't need to align ELF sections to the full alignment.
- However, Irix 5 may prefer that we align them at least to a 16
- byte boundary. We don't bother to align the sections if we
- are targeted for an embedded system. */
- if (strncmp (TARGET_OS, "elf", 3) == 0)
- return addr;
- if (align > 4)
- align = 4;
- }
-
- return ((addr + (1 << align) - 1) & (-1 << align));
-}
-
-/* Utility routine, called from above as well. If called while the
- input file is still being read, it's only an approximation. (For
- example, a symbol may later become defined which appeared to be
- undefined earlier.) */
-
-static int
-nopic_need_relax (symbolS *sym, int before_relaxing)
-{
- if (sym == 0)
- return 0;
-
- if (g_switch_value > 0)
- {
- const char *symname;
- int change;
-
- /* Find out whether this symbol can be referenced off the $gp
- register. It can be if it is smaller than the -G size or if
- it is in the .sdata or .sbss section. Certain symbols can
- not be referenced off the $gp, although it appears as though
- they can. */
- symname = S_GET_NAME (sym);
- if (symname != (const char *) NULL
- && (strcmp (symname, "eprol") == 0
- || strcmp (symname, "etext") == 0
- || strcmp (symname, "_gp") == 0
- || strcmp (symname, "edata") == 0
- || strcmp (symname, "_fbss") == 0
- || strcmp (symname, "_fdata") == 0
- || strcmp (symname, "_ftext") == 0
- || strcmp (symname, "end") == 0
- || strcmp (symname, "_gp_disp") == 0))
- change = 1;
- else if ((! S_IS_DEFINED (sym) || S_IS_COMMON (sym))
- && (0
-#ifndef NO_ECOFF_DEBUGGING
- || (symbol_get_obj (sym)->ecoff_extern_size != 0
- && (symbol_get_obj (sym)->ecoff_extern_size
- <= g_switch_value))
-#endif
- /* We must defer this decision until after the whole
- file has been read, since there might be a .extern
- after the first use of this symbol. */
- || (before_relaxing
-#ifndef NO_ECOFF_DEBUGGING
- && symbol_get_obj (sym)->ecoff_extern_size == 0
-#endif
- && S_GET_VALUE (sym) == 0)
- || (S_GET_VALUE (sym) != 0
- && S_GET_VALUE (sym) <= g_switch_value)))
- change = 0;
- else
- {
- const char *segname;
-
- segname = segment_name (S_GET_SEGMENT (sym));
- assert (strcmp (segname, ".lit8") != 0
- && strcmp (segname, ".lit4") != 0);
- change = (strcmp (segname, ".sdata") != 0
- && strcmp (segname, ".sbss") != 0
- && strncmp (segname, ".sdata.", 7) != 0
- && strncmp (segname, ".sbss.", 6) != 0
- && strncmp (segname, ".gnu.linkonce.sb.", 17) != 0
- && strncmp (segname, ".gnu.linkonce.s.", 16) != 0);
- }
- return change;
- }
- else
- /* We are not optimizing for the $gp register. */
- return 1;
-}
-
-
-/* Return true if the given symbol should be considered local for SVR4 PIC. */
-
-static bfd_boolean
-pic_need_relax (symbolS *sym, asection *segtype)
-{
- asection *symsec;
-
- /* Handle the case of a symbol equated to another symbol. */
- while (symbol_equated_reloc_p (sym))
- {
- symbolS *n;
-
- /* It's possible to get a loop here in a badly written program. */
- n = symbol_get_value_expression (sym)->X_add_symbol;
- if (n == sym)
- break;
- sym = n;
- }
-
- if (symbol_section_p (sym))
- return TRUE;
-
- symsec = S_GET_SEGMENT (sym);
-
- /* This must duplicate the test in adjust_reloc_syms. */
- return (symsec != &bfd_und_section
- && symsec != &bfd_abs_section
- && !bfd_is_com_section (symsec)
- && !s_is_linkonce (sym, segtype)
-#ifdef OBJ_ELF
- /* A global or weak symbol is treated as external. */
- && (!IS_ELF || (! S_IS_WEAK (sym) && ! S_IS_EXTERNAL (sym)))
-#endif
- );
-}
-
-
-/* Given a mips16 variant frag FRAGP, return non-zero if it needs an
- extended opcode. SEC is the section the frag is in. */
-
-static int
-mips16_extended_frag (fragS *fragp, asection *sec, long stretch)
-{
- int type;
- const struct mips16_immed_operand *op;
- offsetT val;
- int mintiny, maxtiny;
- segT symsec;
- fragS *sym_frag;
-
- if (RELAX_MIPS16_USER_SMALL (fragp->fr_subtype))
- return 0;
- if (RELAX_MIPS16_USER_EXT (fragp->fr_subtype))
- return 1;
-
- type = RELAX_MIPS16_TYPE (fragp->fr_subtype);
- op = mips16_immed_operands;
- while (op->type != type)
- {
- ++op;
- assert (op < mips16_immed_operands + MIPS16_NUM_IMMED);
- }
-
- if (op->unsp)
- {
- if (type == '<' || type == '>' || type == '[' || type == ']')
- {
- mintiny = 1;
- maxtiny = 1 << op->nbits;
- }
- else
- {
- mintiny = 0;
- maxtiny = (1 << op->nbits) - 1;
- }
- }
- else
- {
- mintiny = - (1 << (op->nbits - 1));
- maxtiny = (1 << (op->nbits - 1)) - 1;
- }
-
- sym_frag = symbol_get_frag (fragp->fr_symbol);
- val = S_GET_VALUE (fragp->fr_symbol);
- symsec = S_GET_SEGMENT (fragp->fr_symbol);
-
- if (op->pcrel)
- {
- addressT addr;
-
- /* We won't have the section when we are called from
- mips_relax_frag. However, we will always have been called
- from md_estimate_size_before_relax first. If this is a
- branch to a different section, we mark it as such. If SEC is
- NULL, and the frag is not marked, then it must be a branch to
- the same section. */
- if (sec == NULL)
- {
- if (RELAX_MIPS16_LONG_BRANCH (fragp->fr_subtype))
- return 1;
- }
- else
- {
- /* Must have been called from md_estimate_size_before_relax. */
- if (symsec != sec)
- {
- fragp->fr_subtype =
- RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype);
-
- /* FIXME: We should support this, and let the linker
- catch branches and loads that are out of range. */
- as_bad_where (fragp->fr_file, fragp->fr_line,
- _("unsupported PC relative reference to different section"));
-
- return 1;
- }
- if (fragp != sym_frag && sym_frag->fr_address == 0)
- /* Assume non-extended on the first relaxation pass.
- The address we have calculated will be bogus if this is
- a forward branch to another frag, as the forward frag
- will have fr_address == 0. */
- return 0;
- }
-
- /* In this case, we know for sure that the symbol fragment is in
- the same section. If the relax_marker of the symbol fragment
- differs from the relax_marker of this fragment, we have not
- yet adjusted the symbol fragment fr_address. We want to add
- in STRETCH in order to get a better estimate of the address.
- This particularly matters because of the shift bits. */
- if (stretch != 0
- && sym_frag->relax_marker != fragp->relax_marker)
- {
- fragS *f;
-
- /* Adjust stretch for any alignment frag. Note that if have
- been expanding the earlier code, the symbol may be
- defined in what appears to be an earlier frag. FIXME:
- This doesn't handle the fr_subtype field, which specifies
- a maximum number of bytes to skip when doing an
- alignment. */
- for (f = fragp; f != NULL && f != sym_frag; f = f->fr_next)
- {
- if (f->fr_type == rs_align || f->fr_type == rs_align_code)
- {
- if (stretch < 0)
- stretch = - ((- stretch)
- & ~ ((1 << (int) f->fr_offset) - 1));
- else
- stretch &= ~ ((1 << (int) f->fr_offset) - 1);
- if (stretch == 0)
- break;
- }
- }
- if (f != NULL)
- val += stretch;
- }
-
- addr = fragp->fr_address + fragp->fr_fix;
-
- /* The base address rules are complicated. The base address of
- a branch is the following instruction. The base address of a
- PC relative load or add is the instruction itself, but if it
- is in a delay slot (in which case it can not be extended) use
- the address of the instruction whose delay slot it is in. */
- if (type == 'p' || type == 'q')
- {
- addr += 2;
-
- /* If we are currently assuming that this frag should be
- extended, then, the current address is two bytes
- higher. */
- if (RELAX_MIPS16_EXTENDED (fragp->fr_subtype))
- addr += 2;
-
- /* Ignore the low bit in the target, since it will be set
- for a text label. */
- if ((val & 1) != 0)
- --val;
- }
- else if (RELAX_MIPS16_JAL_DSLOT (fragp->fr_subtype))
- addr -= 4;
- else if (RELAX_MIPS16_DSLOT (fragp->fr_subtype))
- addr -= 2;
-
- val -= addr & ~ ((1 << op->shift) - 1);
-
- /* Branch offsets have an implicit 0 in the lowest bit. */
- if (type == 'p' || type == 'q')
- val /= 2;
-
- /* If any of the shifted bits are set, we must use an extended
- opcode. If the address depends on the size of this
- instruction, this can lead to a loop, so we arrange to always
- use an extended opcode. We only check this when we are in
- the main relaxation loop, when SEC is NULL. */
- if ((val & ((1 << op->shift) - 1)) != 0 && sec == NULL)
- {
- fragp->fr_subtype =
- RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype);
- return 1;
- }
-
- /* If we are about to mark a frag as extended because the value
- is precisely maxtiny + 1, then there is a chance of an
- infinite loop as in the following code:
- la $4,foo
- .skip 1020
- .align 2
- foo:
- In this case when the la is extended, foo is 0x3fc bytes
- away, so the la can be shrunk, but then foo is 0x400 away, so
- the la must be extended. To avoid this loop, we mark the
- frag as extended if it was small, and is about to become
- extended with a value of maxtiny + 1. */
- if (val == ((maxtiny + 1) << op->shift)
- && ! RELAX_MIPS16_EXTENDED (fragp->fr_subtype)
- && sec == NULL)
- {
- fragp->fr_subtype =
- RELAX_MIPS16_MARK_LONG_BRANCH (fragp->fr_subtype);
- return 1;
- }
- }
- else if (symsec != absolute_section && sec != NULL)
- as_bad_where (fragp->fr_file, fragp->fr_line, _("unsupported relocation"));
-
- if ((val & ((1 << op->shift) - 1)) != 0
- || val < (mintiny << op->shift)
- || val > (maxtiny << op->shift))
- return 1;
- else
- return 0;
-}
-
-/* Compute the length of a branch sequence, and adjust the
- RELAX_BRANCH_TOOFAR bit accordingly. If FRAGP is NULL, the
- worst-case length is computed, with UPDATE being used to indicate
- whether an unconditional (-1), branch-likely (+1) or regular (0)
- branch is to be computed. */
-static int
-relaxed_branch_length (fragS *fragp, asection *sec, int update)
-{
- bfd_boolean toofar;
- int length;
-
- if (fragp
- && S_IS_DEFINED (fragp->fr_symbol)
- && sec == S_GET_SEGMENT (fragp->fr_symbol))
- {
- addressT addr;
- offsetT val;
-
- val = S_GET_VALUE (fragp->fr_symbol) + fragp->fr_offset;
-
- addr = fragp->fr_address + fragp->fr_fix + 4;
-
- val -= addr;
-
- toofar = val < - (0x8000 << 2) || val >= (0x8000 << 2);
- }
- else if (fragp)
- /* If the symbol is not defined or it's in a different segment,
- assume the user knows what's going on and emit a short
- branch. */
- toofar = FALSE;
- else
- toofar = TRUE;
-
- if (fragp && update && toofar != RELAX_BRANCH_TOOFAR (fragp->fr_subtype))
- fragp->fr_subtype
- = RELAX_BRANCH_ENCODE (RELAX_BRANCH_UNCOND (fragp->fr_subtype),
- RELAX_BRANCH_LIKELY (fragp->fr_subtype),
- RELAX_BRANCH_LINK (fragp->fr_subtype),
- toofar);
-
- length = 4;
- if (toofar)
- {
- if (fragp ? RELAX_BRANCH_LIKELY (fragp->fr_subtype) : (update > 0))
- length += 8;
-
- if (mips_pic != NO_PIC)
- {
- /* Additional space for PIC loading of target address. */
- length += 8;
- if (mips_opts.isa == ISA_MIPS1)
- /* Additional space for $at-stabilizing nop. */
- length += 4;
- }
-
- /* If branch is conditional. */
- if (fragp ? !RELAX_BRANCH_UNCOND (fragp->fr_subtype) : (update >= 0))
- length += 8;
- }
-
- return length;
-}
-
-/* Estimate the size of a frag before relaxing. Unless this is the
- mips16, we are not really relaxing here, and the final size is
- encoded in the subtype information. For the mips16, we have to
- decide whether we are using an extended opcode or not. */
-
-int
-md_estimate_size_before_relax (fragS *fragp, asection *segtype)
-{
- int change;
-
- if (RELAX_BRANCH_P (fragp->fr_subtype))
- {
-
- fragp->fr_var = relaxed_branch_length (fragp, segtype, FALSE);
-
- return fragp->fr_var;
- }
-
- if (RELAX_MIPS16_P (fragp->fr_subtype))
- /* We don't want to modify the EXTENDED bit here; it might get us
- into infinite loops. We change it only in mips_relax_frag(). */
- return (RELAX_MIPS16_EXTENDED (fragp->fr_subtype) ? 4 : 2);
-
- if (mips_pic == NO_PIC)
- change = nopic_need_relax (fragp->fr_symbol, 0);
- else if (mips_pic == SVR4_PIC)
- change = pic_need_relax (fragp->fr_symbol, segtype);
- else if (mips_pic == VXWORKS_PIC)
- /* For vxworks, GOT16 relocations never have a corresponding LO16. */
- change = 0;
- else
- abort ();
-
- if (change)
- {
- fragp->fr_subtype |= RELAX_USE_SECOND;
- return -RELAX_FIRST (fragp->fr_subtype);
- }
- else
- return -RELAX_SECOND (fragp->fr_subtype);
-}
-
-/* This is called to see whether a reloc against a defined symbol
- should be converted into a reloc against a section. */
-
-int
-mips_fix_adjustable (fixS *fixp)
-{
- if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
- || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
- return 0;
-
- if (fixp->fx_addsy == NULL)
- return 1;
-
- /* If symbol SYM is in a mergeable section, relocations of the form
- SYM + 0 can usually be made section-relative. The mergeable data
- is then identified by the section offset rather than by the symbol.
-
- However, if we're generating REL LO16 relocations, the offset is split
- between the LO16 and parterning high part relocation. The linker will
- need to recalculate the complete offset in order to correctly identify
- the merge data.
-
- The linker has traditionally not looked for the parterning high part
- relocation, and has thus allowed orphaned R_MIPS_LO16 relocations to be
- placed anywhere. Rather than break backwards compatibility by changing
- this, it seems better not to force the issue, and instead keep the
- original symbol. This will work with either linker behavior. */
- if ((fixp->fx_r_type == BFD_RELOC_LO16
- || fixp->fx_r_type == BFD_RELOC_MIPS16_LO16
- || reloc_needs_lo_p (fixp->fx_r_type))
- && HAVE_IN_PLACE_ADDENDS
- && (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_MERGE) != 0)
- return 0;
-
-#ifdef OBJ_ELF
- /* R_MIPS16_26 relocations against non-MIPS16 functions might resolve
- to a floating-point stub. The same is true for non-R_MIPS16_26
- relocations against MIPS16 functions; in this case, the stub becomes
- the function's canonical address.
-
- Floating-point stubs are stored in unique .mips16.call.* or
- .mips16.fn.* sections. If a stub T for function F is in section S,
- the first relocation in section S must be against F; this is how the
- linker determines the target function. All relocations that might
- resolve to T must also be against F. We therefore have the following
- restrictions, which are given in an intentionally-redundant way:
-
- 1. We cannot reduce R_MIPS16_26 relocations against non-MIPS16
- symbols.
-
- 2. We cannot reduce a stub's relocations against non-MIPS16 symbols
- if that stub might be used.
-
- 3. We cannot reduce non-R_MIPS16_26 relocations against MIPS16
- symbols.
-
- 4. We cannot reduce a stub's relocations against MIPS16 symbols if
- that stub might be used.
-
- There is a further restriction:
-
- 5. We cannot reduce R_MIPS16_26 relocations against MIPS16 symbols
- on targets with in-place addends; the relocation field cannot
- encode the low bit.
-
- For simplicity, we deal with (3)-(5) by not reducing _any_ relocation
- against a MIPS16 symbol.
-
- We deal with (1)-(2) by saying that, if there's a R_MIPS16_26
- relocation against some symbol R, no relocation against R may be
- reduced. (Note that this deals with (2) as well as (1) because
- relocations against global symbols will never be reduced on ELF
- targets.) This approach is a little simpler than trying to detect
- stub sections, and gives the "all or nothing" per-symbol consistency
- that we have for MIPS16 symbols. */
- if (IS_ELF
- && fixp->fx_subsy == NULL
- && (ELF_ST_IS_MIPS16 (S_GET_OTHER (fixp->fx_addsy))
- || *symbol_get_tc (fixp->fx_addsy)))
- return 0;
-#endif
-
- return 1;
-}
-
-/* Translate internal representation of relocation info to BFD target
- format. */
-
-arelent **
-tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
-{
- static arelent *retval[4];
- arelent *reloc;
- bfd_reloc_code_real_type code;
-
- memset (retval, 0, sizeof(retval));
- reloc = retval[0] = (arelent *) xcalloc (1, sizeof (arelent));
- reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
- *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
- reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
-
- if (fixp->fx_pcrel)
- {
- assert (fixp->fx_r_type == BFD_RELOC_16_PCREL_S2);
-
- /* At this point, fx_addnumber is "symbol offset - pcrel address".
- Relocations want only the symbol offset. */
- reloc->addend = fixp->fx_addnumber + reloc->address;
- if (!IS_ELF)
- {
- /* A gruesome hack which is a result of the gruesome gas
- reloc handling. What's worse, for COFF (as opposed to
- ECOFF), we might need yet another copy of reloc->address.
- See bfd_install_relocation. */
- reloc->addend += reloc->address;
- }
- }
- else
- reloc->addend = fixp->fx_addnumber;
-
- /* Since the old MIPS ELF ABI uses Rel instead of Rela, encode the vtable
- entry to be used in the relocation's section offset. */
- if (! HAVE_NEWABI && fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
- {
- reloc->address = reloc->addend;
- reloc->addend = 0;
- }
-
- code = fixp->fx_r_type;
-
- reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
- if (reloc->howto == NULL)
- {
- as_bad_where (fixp->fx_file, fixp->fx_line,
- _("Can not represent %s relocation in this object file format"),
- bfd_get_reloc_code_name (code));
- retval[0] = NULL;
- }
-
- return retval;
-}
-
-/* Relax a machine dependent frag. This returns the amount by which
- the current size of the frag should change. */
-
-int
-mips_relax_frag (asection *sec, fragS *fragp, long stretch)
-{
- if (RELAX_BRANCH_P (fragp->fr_subtype))
- {
- offsetT old_var = fragp->fr_var;
-
- fragp->fr_var = relaxed_branch_length (fragp, sec, TRUE);
-
- return fragp->fr_var - old_var;
- }
-
- if (! RELAX_MIPS16_P (fragp->fr_subtype))
- return 0;
-
- if (mips16_extended_frag (fragp, NULL, stretch))
- {
- if (RELAX_MIPS16_EXTENDED (fragp->fr_subtype))
- return 0;
- fragp->fr_subtype = RELAX_MIPS16_MARK_EXTENDED (fragp->fr_subtype);
- return 2;
- }
- else
- {
- if (! RELAX_MIPS16_EXTENDED (fragp->fr_subtype))
- return 0;
- fragp->fr_subtype = RELAX_MIPS16_CLEAR_EXTENDED (fragp->fr_subtype);
- return -2;
- }
-
- return 0;
-}
-
-/* Convert a machine dependent frag. */
-
-void
-md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp)
-{
- if (RELAX_BRANCH_P (fragp->fr_subtype))
- {
- bfd_byte *buf;
- unsigned long insn;
- expressionS exp;
- fixS *fixp;
-
- buf = (bfd_byte *)fragp->fr_literal + fragp->fr_fix;
-
- if (target_big_endian)
- insn = bfd_getb32 (buf);
- else
- insn = bfd_getl32 (buf);
-
- if (!RELAX_BRANCH_TOOFAR (fragp->fr_subtype))
- {
- /* We generate a fixup instead of applying it right now
- because, if there are linker relaxations, we're going to
- need the relocations. */
- exp.X_op = O_symbol;
- exp.X_add_symbol = fragp->fr_symbol;
- exp.X_add_number = fragp->fr_offset;
-
- fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal,
- 4, &exp, TRUE, BFD_RELOC_16_PCREL_S2);
- fixp->fx_file = fragp->fr_file;
- fixp->fx_line = fragp->fr_line;
-
- md_number_to_chars ((char *) buf, insn, 4);
- buf += 4;
- }
- else
- {
- int i;
-
- as_warn_where (fragp->fr_file, fragp->fr_line,
- _("relaxed out-of-range branch into a jump"));
-
- if (RELAX_BRANCH_UNCOND (fragp->fr_subtype))
- goto uncond;
-
- if (!RELAX_BRANCH_LIKELY (fragp->fr_subtype))
- {
- /* Reverse the branch. */
- switch ((insn >> 28) & 0xf)
- {
- case 4:
- /* bc[0-3][tf]l? and bc1any[24][ft] instructions can
- have the condition reversed by tweaking a single
- bit, and their opcodes all have 0x4???????. */
- assert ((insn & 0xf1000000) == 0x41000000);
- insn ^= 0x00010000;
- break;
-
- case 0:
- /* bltz 0x04000000 bgez 0x04010000
- bltzal 0x04100000 bgezal 0x04110000 */
- assert ((insn & 0xfc0e0000) == 0x04000000);
- insn ^= 0x00010000;
- break;
-
- case 1:
- /* beq 0x10000000 bne 0x14000000
- blez 0x18000000 bgtz 0x1c000000 */
- insn ^= 0x04000000;
- break;
-
- default:
- abort ();
- }
- }
-
- if (RELAX_BRANCH_LINK (fragp->fr_subtype))
- {
- /* Clear the and-link bit. */
- assert ((insn & 0xfc1c0000) == 0x04100000);
-
- /* bltzal 0x04100000 bgezal 0x04110000
- bltzall 0x04120000 bgezall 0x04130000 */
- insn &= ~0x00100000;
- }
-
- /* Branch over the branch (if the branch was likely) or the
- full jump (not likely case). Compute the offset from the
- current instruction to branch to. */
- if (RELAX_BRANCH_LIKELY (fragp->fr_subtype))
- i = 16;
- else
- {
- /* How many bytes in instructions we've already emitted? */
- i = buf - (bfd_byte *)fragp->fr_literal - fragp->fr_fix;
- /* How many bytes in instructions from here to the end? */
- i = fragp->fr_var - i;
- }
- /* Convert to instruction count. */
- i >>= 2;
- /* Branch counts from the next instruction. */
- i--;
- insn |= i;
- /* Branch over the jump. */
- md_number_to_chars ((char *) buf, insn, 4);
- buf += 4;
-
- /* nop */
- md_number_to_chars ((char *) buf, 0, 4);
- buf += 4;
-
- if (RELAX_BRANCH_LIKELY (fragp->fr_subtype))
- {
- /* beql $0, $0, 2f */
- insn = 0x50000000;
- /* Compute the PC offset from the current instruction to
- the end of the variable frag. */
- /* How many bytes in instructions we've already emitted? */
- i = buf - (bfd_byte *)fragp->fr_literal - fragp->fr_fix;
- /* How many bytes in instructions from here to the end? */
- i = fragp->fr_var - i;
- /* Convert to instruction count. */
- i >>= 2;
- /* Don't decrement i, because we want to branch over the
- delay slot. */
-
- insn |= i;
- md_number_to_chars ((char *) buf, insn, 4);
- buf += 4;
-
- md_number_to_chars ((char *) buf, 0, 4);
- buf += 4;
- }
-
- uncond:
- if (mips_pic == NO_PIC)
- {
- /* j or jal. */
- insn = (RELAX_BRANCH_LINK (fragp->fr_subtype)
- ? 0x0c000000 : 0x08000000);
- exp.X_op = O_symbol;
- exp.X_add_symbol = fragp->fr_symbol;
- exp.X_add_number = fragp->fr_offset;
-
- fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal,
- 4, &exp, FALSE, BFD_RELOC_MIPS_JMP);
- fixp->fx_file = fragp->fr_file;
- fixp->fx_line = fragp->fr_line;
-
- md_number_to_chars ((char *) buf, insn, 4);
- buf += 4;
- }
- else
- {
- /* lw/ld $at, <sym>($gp) R_MIPS_GOT16 */
- insn = HAVE_64BIT_ADDRESSES ? 0xdf810000 : 0x8f810000;
- exp.X_op = O_symbol;
- exp.X_add_symbol = fragp->fr_symbol;
- exp.X_add_number = fragp->fr_offset;
-
- if (fragp->fr_offset)
- {
- exp.X_add_symbol = make_expr_symbol (&exp);
- exp.X_add_number = 0;
- }
-
- fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal,
- 4, &exp, FALSE, BFD_RELOC_MIPS_GOT16);
- fixp->fx_file = fragp->fr_file;
- fixp->fx_line = fragp->fr_line;
-
- md_number_to_chars ((char *) buf, insn, 4);
- buf += 4;
-
- if (mips_opts.isa == ISA_MIPS1)
- {
- /* nop */
- md_number_to_chars ((char *) buf, 0, 4);
- buf += 4;
- }
-
- /* d/addiu $at, $at, <sym> R_MIPS_LO16 */
- insn = HAVE_64BIT_ADDRESSES ? 0x64210000 : 0x24210000;
-
- fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal,
- 4, &exp, FALSE, BFD_RELOC_LO16);
- fixp->fx_file = fragp->fr_file;
- fixp->fx_line = fragp->fr_line;
-
- md_number_to_chars ((char *) buf, insn, 4);
- buf += 4;
-
- /* j(al)r $at. */
- if (RELAX_BRANCH_LINK (fragp->fr_subtype))
- insn = 0x0020f809;
- else
- insn = 0x00200008;
-
- md_number_to_chars ((char *) buf, insn, 4);
- buf += 4;
- }
- }
-
- assert (buf == (bfd_byte *)fragp->fr_literal
- + fragp->fr_fix + fragp->fr_var);
-
- fragp->fr_fix += fragp->fr_var;
-
- return;
- }
-
- if (RELAX_MIPS16_P (fragp->fr_subtype))
- {
- int type;
- const struct mips16_immed_operand *op;
- bfd_boolean small, ext;
- offsetT val;
- bfd_byte *buf;
- unsigned long insn;
- bfd_boolean use_extend;
- unsigned short extend;
-
- type = RELAX_MIPS16_TYPE (fragp->fr_subtype);
- op = mips16_immed_operands;
- while (op->type != type)
- ++op;
-
- if (RELAX_MIPS16_EXTENDED (fragp->fr_subtype))
- {
- small = FALSE;
- ext = TRUE;
- }
- else
- {
- small = TRUE;
- ext = FALSE;
- }
-
- resolve_symbol_value (fragp->fr_symbol);
- val = S_GET_VALUE (fragp->fr_symbol);
- if (op->pcrel)
- {
- addressT addr;
-
- addr = fragp->fr_address + fragp->fr_fix;
-
- /* The rules for the base address of a PC relative reloc are
- complicated; see mips16_extended_frag. */
- if (type == 'p' || type == 'q')
- {
- addr += 2;
- if (ext)
- addr += 2;
- /* Ignore the low bit in the target, since it will be
- set for a text label. */
- if ((val & 1) != 0)
- --val;
- }
- else if (RELAX_MIPS16_JAL_DSLOT (fragp->fr_subtype))
- addr -= 4;
- else if (RELAX_MIPS16_DSLOT (fragp->fr_subtype))
- addr -= 2;
-
- addr &= ~ (addressT) ((1 << op->shift) - 1);
- val -= addr;
-
- /* Make sure the section winds up with the alignment we have
- assumed. */
- if (op->shift > 0)
- record_alignment (asec, op->shift);
- }
-
- if (ext
- && (RELAX_MIPS16_JAL_DSLOT (fragp->fr_subtype)
- || RELAX_MIPS16_DSLOT (fragp->fr_subtype)))
- as_warn_where (fragp->fr_file, fragp->fr_line,
- _("extended instruction in delay slot"));
-
- buf = (bfd_byte *) (fragp->fr_literal + fragp->fr_fix);
-
- if (target_big_endian)
- insn = bfd_getb16 (buf);
- else
- insn = bfd_getl16 (buf);
-
- mips16_immed (fragp->fr_file, fragp->fr_line, type, val,
- RELAX_MIPS16_USER_EXT (fragp->fr_subtype),
- small, ext, &insn, &use_extend, &extend);
-
- if (use_extend)
- {
- md_number_to_chars ((char *) buf, 0xf000 | extend, 2);
- fragp->fr_fix += 2;
- buf += 2;
- }
-
- md_number_to_chars ((char *) buf, insn, 2);
- fragp->fr_fix += 2;
- buf += 2;
- }
- else
- {
- int first, second;
- fixS *fixp;
-
- first = RELAX_FIRST (fragp->fr_subtype);
- second = RELAX_SECOND (fragp->fr_subtype);
- fixp = (fixS *) fragp->fr_opcode;
-
- /* Possibly emit a warning if we've chosen the longer option. */
- if (((fragp->fr_subtype & RELAX_USE_SECOND) != 0)
- == ((fragp->fr_subtype & RELAX_SECOND_LONGER) != 0))
- {
- const char *msg = macro_warning (fragp->fr_subtype);
- if (msg != 0)
- as_warn_where (fragp->fr_file, fragp->fr_line, msg);
- }
-
- /* Go through all the fixups for the first sequence. Disable them
- (by marking them as done) if we're going to use the second
- sequence instead. */
- while (fixp
- && fixp->fx_frag == fragp
- && fixp->fx_where < fragp->fr_fix - second)
- {
- if (fragp->fr_subtype & RELAX_USE_SECOND)
- fixp->fx_done = 1;
- fixp = fixp->fx_next;
- }
-
- /* Go through the fixups for the second sequence. Disable them if
- we're going to use the first sequence, otherwise adjust their
- addresses to account for the relaxation. */
- while (fixp && fixp->fx_frag == fragp)
- {
- if (fragp->fr_subtype & RELAX_USE_SECOND)
- fixp->fx_where -= first;
- else
- fixp->fx_done = 1;
- fixp = fixp->fx_next;
- }
-
- /* Now modify the frag contents. */
- if (fragp->fr_subtype & RELAX_USE_SECOND)
- {
- char *start;
-
- start = fragp->fr_literal + fragp->fr_fix - first - second;
- memmove (start, start + first, second);
- fragp->fr_fix -= first;
- }
- else
- fragp->fr_fix -= second;
- }
-}
-
-#ifdef OBJ_ELF
-
-/* This function is called after the relocs have been generated.
- We've been storing mips16 text labels as odd. Here we convert them
- back to even for the convenience of the debugger. */
-
-void
-mips_frob_file_after_relocs (void)
-{
- asymbol **syms;
- unsigned int count, i;
-
- if (!IS_ELF)
- return;
-
- syms = bfd_get_outsymbols (stdoutput);
- count = bfd_get_symcount (stdoutput);
- for (i = 0; i < count; i++, syms++)
- {
- if (ELF_ST_IS_MIPS16 (elf_symbol (*syms)->internal_elf_sym.st_other)
- && ((*syms)->value & 1) != 0)
- {
- (*syms)->value &= ~1;
- /* If the symbol has an odd size, it was probably computed
- incorrectly, so adjust that as well. */
- if ((elf_symbol (*syms)->internal_elf_sym.st_size & 1) != 0)
- ++elf_symbol (*syms)->internal_elf_sym.st_size;
- }
- }
-}
-
-#endif
-
-/* This function is called whenever a label is defined. It is used
- when handling branch delays; if a branch has a label, we assume we
- can not move it. */
-
-void
-mips_define_label (symbolS *sym)
-{
- segment_info_type *si = seg_info (now_seg);
- struct insn_label_list *l;
-
- if (free_insn_labels == NULL)
- l = (struct insn_label_list *) xmalloc (sizeof *l);
- else
- {
- l = free_insn_labels;
- free_insn_labels = l->next;
- }
-
- l->label = sym;
- l->next = si->label_list;
- si->label_list = l;
-
-#ifdef OBJ_ELF
- dwarf2_emit_label (sym);
-#endif
-}
-
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-
-/* Some special processing for a MIPS ELF file. */
-
-void
-mips_elf_final_processing (void)
-{
- /* Write out the register information. */
- if (mips_abi != N64_ABI)
- {
- Elf32_RegInfo s;
-
- s.ri_gprmask = mips_gprmask;
- s.ri_cprmask[0] = mips_cprmask[0];
- s.ri_cprmask[1] = mips_cprmask[1];
- s.ri_cprmask[2] = mips_cprmask[2];
- s.ri_cprmask[3] = mips_cprmask[3];
- /* The gp_value field is set by the MIPS ELF backend. */
-
- bfd_mips_elf32_swap_reginfo_out (stdoutput, &s,
- ((Elf32_External_RegInfo *)
- mips_regmask_frag));
- }
- else
- {
- Elf64_Internal_RegInfo s;
-
- s.ri_gprmask = mips_gprmask;
- s.ri_pad = 0;
- s.ri_cprmask[0] = mips_cprmask[0];
- s.ri_cprmask[1] = mips_cprmask[1];
- s.ri_cprmask[2] = mips_cprmask[2];
- s.ri_cprmask[3] = mips_cprmask[3];
- /* The gp_value field is set by the MIPS ELF backend. */
-
- bfd_mips_elf64_swap_reginfo_out (stdoutput, &s,
- ((Elf64_External_RegInfo *)
- mips_regmask_frag));
- }
-
- /* Set the MIPS ELF flag bits. FIXME: There should probably be some
- sort of BFD interface for this. */
- if (mips_any_noreorder)
- elf_elfheader (stdoutput)->e_flags |= EF_MIPS_NOREORDER;
- if (mips_pic != NO_PIC)
- {
- elf_elfheader (stdoutput)->e_flags |= EF_MIPS_PIC;
- elf_elfheader (stdoutput)->e_flags |= EF_MIPS_CPIC;
- }
- if (mips_abicalls)
- elf_elfheader (stdoutput)->e_flags |= EF_MIPS_CPIC;
-
- /* Set MIPS ELF flags for ASEs. */
- /* We may need to define a new flag for DSP ASE, and set this flag when
- file_ase_dsp is true. */
- /* Same for DSP R2. */
- /* We may need to define a new flag for MT ASE, and set this flag when
- file_ase_mt is true. */
- if (file_ase_mips16)
- elf_elfheader (stdoutput)->e_flags |= EF_MIPS_ARCH_ASE_M16;
-#if 0 /* XXX FIXME */
- if (file_ase_mips3d)
- elf_elfheader (stdoutput)->e_flags |= ???;
-#endif
- if (file_ase_mdmx)
- elf_elfheader (stdoutput)->e_flags |= EF_MIPS_ARCH_ASE_MDMX;
-
- /* Set the MIPS ELF ABI flags. */
- if (mips_abi == O32_ABI && USE_E_MIPS_ABI_O32)
- elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_O32;
- else if (mips_abi == O64_ABI)
- elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_O64;
- else if (mips_abi == EABI_ABI)
- {
- if (!file_mips_gp32)
- elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_EABI64;
- else
- elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_EABI32;
- }
- else if (mips_abi == N32_ABI)
- elf_elfheader (stdoutput)->e_flags |= EF_MIPS_ABI2;
-
- /* Nothing to do for N64_ABI. */
-
- if (mips_32bitmode)
- elf_elfheader (stdoutput)->e_flags |= EF_MIPS_32BITMODE;
-
-#if 0 /* XXX FIXME */
- /* 32 bit code with 64 bit FP registers. */
- if (!file_mips_fp32 && ABI_NEEDS_32BIT_REGS (mips_abi))
- elf_elfheader (stdoutput)->e_flags |= ???;
-#endif
-}
-
-#endif /* OBJ_ELF || OBJ_MAYBE_ELF */
-
-typedef struct proc {
- symbolS *func_sym;
- symbolS *func_end_sym;
- unsigned long reg_mask;
- unsigned long reg_offset;
- unsigned long fpreg_mask;
- unsigned long fpreg_offset;
- unsigned long frame_offset;
- unsigned long frame_reg;
- unsigned long pc_reg;
-} procS;
-
-static procS cur_proc;
-static procS *cur_proc_ptr;
-static int numprocs;
-
-/* Implement NOP_OPCODE. We encode a MIPS16 nop as "1" and a normal
- nop as "0". */
-
-char
-mips_nop_opcode (void)
-{
- return seg_info (now_seg)->tc_segment_info_data.mips16;
-}
-
-/* Fill in an rs_align_code fragment. This only needs to do something
- for MIPS16 code, where 0 is not a nop. */
-
-void
-mips_handle_align (fragS *fragp)
-{
- char *p;
-
- if (fragp->fr_type != rs_align_code)
- return;
-
- p = fragp->fr_literal + fragp->fr_fix;
- if (*p)
- {
- int bytes;
-
- bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix;
- if (bytes & 1)
- {
- *p++ = 0;
- fragp->fr_fix++;
- }
- md_number_to_chars (p, mips16_nop_insn.insn_opcode, 2);
- fragp->fr_var = 2;
- }
-}
-
-static void
-md_obj_begin (void)
-{
-}
-
-static void
-md_obj_end (void)
-{
- /* Check for premature end, nesting errors, etc. */
- if (cur_proc_ptr)
- as_warn (_("missing .end at end of assembly"));
-}
-
-static long
-get_number (void)
-{
- int negative = 0;
- long val = 0;
-
- if (*input_line_pointer == '-')
- {
- ++input_line_pointer;
- negative = 1;
- }
- if (!ISDIGIT (*input_line_pointer))
- as_bad (_("expected simple number"));
- if (input_line_pointer[0] == '0')
- {
- if (input_line_pointer[1] == 'x')
- {
- input_line_pointer += 2;
- while (ISXDIGIT (*input_line_pointer))
- {
- val <<= 4;
- val |= hex_value (*input_line_pointer++);
- }
- return negative ? -val : val;
- }
- else
- {
- ++input_line_pointer;
- while (ISDIGIT (*input_line_pointer))
- {
- val <<= 3;
- val |= *input_line_pointer++ - '0';
- }
- return negative ? -val : val;
- }
- }
- if (!ISDIGIT (*input_line_pointer))
- {
- printf (_(" *input_line_pointer == '%c' 0x%02x\n"),
- *input_line_pointer, *input_line_pointer);
- as_warn (_("invalid number"));
- return -1;
- }
- while (ISDIGIT (*input_line_pointer))
- {
- val *= 10;
- val += *input_line_pointer++ - '0';
- }
- return negative ? -val : val;
-}
-
-/* The .file directive; just like the usual .file directive, but there
- is an initial number which is the ECOFF file index. In the non-ECOFF
- case .file implies DWARF-2. */
-
-static void
-s_mips_file (int x ATTRIBUTE_UNUSED)
-{
- static int first_file_directive = 0;
-
- if (ECOFF_DEBUGGING)
- {
- get_number ();
- s_app_file (0);
- }
- else
- {
- char *filename;
-
- filename = dwarf2_directive_file (0);
-
- /* Versions of GCC up to 3.1 start files with a ".file"
- directive even for stabs output. Make sure that this
- ".file" is handled. Note that you need a version of GCC
- after 3.1 in order to support DWARF-2 on MIPS. */
- if (filename != NULL && ! first_file_directive)
- {
- (void) new_logical_line (filename, -1);
- s_app_file_string (filename, 0);
- }
- first_file_directive = 1;
- }
-}
-
-/* The .loc directive, implying DWARF-2. */
-
-static void
-s_mips_loc (int x ATTRIBUTE_UNUSED)
-{
- if (!ECOFF_DEBUGGING)
- dwarf2_directive_loc (0);
-}
-
-/* The .end directive. */
-
-static void
-s_mips_end (int x ATTRIBUTE_UNUSED)
-{
- symbolS *p;
-
- /* Following functions need their own .frame and .cprestore directives. */
- mips_frame_reg_valid = 0;
- mips_cprestore_valid = 0;
-
- if (!is_end_of_line[(unsigned char) *input_line_pointer])
- {
- p = get_symbol ();
- demand_empty_rest_of_line ();
- }
- else
- p = NULL;
-
- if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) == 0)
- as_warn (_(".end not in text section"));
-
- if (!cur_proc_ptr)
- {
- as_warn (_(".end directive without a preceding .ent directive."));
- demand_empty_rest_of_line ();
- return;
- }
-
- if (p != NULL)
- {
- assert (S_GET_NAME (p));
- if (strcmp (S_GET_NAME (p), S_GET_NAME (cur_proc_ptr->func_sym)))
- as_warn (_(".end symbol does not match .ent symbol."));
-
- if (debug_type == DEBUG_STABS)
- stabs_generate_asm_endfunc (S_GET_NAME (p),
- S_GET_NAME (p));
- }
- else
- as_warn (_(".end directive missing or unknown symbol"));
-
-#ifdef OBJ_ELF
- /* Create an expression to calculate the size of the function. */
- if (p && cur_proc_ptr)
- {
- OBJ_SYMFIELD_TYPE *obj = symbol_get_obj (p);
- expressionS *exp = xmalloc (sizeof (expressionS));
-
- obj->size = exp;
- exp->X_op = O_subtract;
- exp->X_add_symbol = symbol_temp_new_now ();
- exp->X_op_symbol = p;
- exp->X_add_number = 0;
-
- cur_proc_ptr->func_end_sym = exp->X_add_symbol;
- }
-
- /* Generate a .pdr section. */
- if (IS_ELF && !ECOFF_DEBUGGING && mips_flag_pdr)
- {
- segT saved_seg = now_seg;
- subsegT saved_subseg = now_subseg;
- valueT dot;
- expressionS exp;
- char *fragp;
-
- dot = frag_now_fix ();
-
-#ifdef md_flush_pending_output
- md_flush_pending_output ();
-#endif
-
- assert (pdr_seg);
- subseg_set (pdr_seg, 0);
-
- /* Write the symbol. */
- exp.X_op = O_symbol;
- exp.X_add_symbol = p;
- exp.X_add_number = 0;
- emit_expr (&exp, 4);
-
- fragp = frag_more (7 * 4);
-
- md_number_to_chars (fragp, cur_proc_ptr->reg_mask, 4);
- md_number_to_chars (fragp + 4, cur_proc_ptr->reg_offset, 4);
- md_number_to_chars (fragp + 8, cur_proc_ptr->fpreg_mask, 4);
- md_number_to_chars (fragp + 12, cur_proc_ptr->fpreg_offset, 4);
- md_number_to_chars (fragp + 16, cur_proc_ptr->frame_offset, 4);
- md_number_to_chars (fragp + 20, cur_proc_ptr->frame_reg, 4);
- md_number_to_chars (fragp + 24, cur_proc_ptr->pc_reg, 4);
-
- subseg_set (saved_seg, saved_subseg);
- }
-#endif /* OBJ_ELF */
-
- cur_proc_ptr = NULL;
-}
-
-/* The .aent and .ent directives. */
-
-static void
-s_mips_ent (int aent)
-{
- symbolS *symbolP;
-
- symbolP = get_symbol ();
- if (*input_line_pointer == ',')
- ++input_line_pointer;
- SKIP_WHITESPACE ();
- if (ISDIGIT (*input_line_pointer)
- || *input_line_pointer == '-')
- get_number ();
-
- if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) == 0)
- as_warn (_(".ent or .aent not in text section."));
-
- if (!aent && cur_proc_ptr)
- as_warn (_("missing .end"));
-
- if (!aent)
- {
- /* This function needs its own .frame and .cprestore directives. */
- mips_frame_reg_valid = 0;
- mips_cprestore_valid = 0;
-
- cur_proc_ptr = &cur_proc;
- memset (cur_proc_ptr, '\0', sizeof (procS));
-
- cur_proc_ptr->func_sym = symbolP;
-
- symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION;
-
- ++numprocs;
-
- if (debug_type == DEBUG_STABS)
- stabs_generate_asm_func (S_GET_NAME (symbolP),
- S_GET_NAME (symbolP));
- }
-
- demand_empty_rest_of_line ();
-}
-
-/* The .frame directive. If the mdebug section is present (IRIX 5 native)
- then ecoff.c (ecoff_directive_frame) is used. For embedded targets,
- s_mips_frame is used so that we can set the PDR information correctly.
- We can't use the ecoff routines because they make reference to the ecoff
- symbol table (in the mdebug section). */
-
-static void
-s_mips_frame (int ignore ATTRIBUTE_UNUSED)
-{
-#ifdef OBJ_ELF
- if (IS_ELF && !ECOFF_DEBUGGING)
- {
- long val;
-
- if (cur_proc_ptr == (procS *) NULL)
- {
- as_warn (_(".frame outside of .ent"));
- demand_empty_rest_of_line ();
- return;
- }
-
- cur_proc_ptr->frame_reg = tc_get_register (1);
-
- SKIP_WHITESPACE ();
- if (*input_line_pointer++ != ','
- || get_absolute_expression_and_terminator (&val) != ',')
- {
- as_warn (_("Bad .frame directive"));
- --input_line_pointer;
- demand_empty_rest_of_line ();
- return;
- }
-
- cur_proc_ptr->frame_offset = val;
- cur_proc_ptr->pc_reg = tc_get_register (0);
-
- demand_empty_rest_of_line ();
- }
- else
-#endif /* OBJ_ELF */
- s_ignore (ignore);
-}
-
-/* The .fmask and .mask directives. If the mdebug section is present
- (IRIX 5 native) then ecoff.c (ecoff_directive_mask) is used. For
- embedded targets, s_mips_mask is used so that we can set the PDR
- information correctly. We can't use the ecoff routines because they
- make reference to the ecoff symbol table (in the mdebug section). */
-
-static void
-s_mips_mask (int reg_type)
-{
-#ifdef OBJ_ELF
- if (IS_ELF && !ECOFF_DEBUGGING)
- {
- long mask, off;
-
- if (cur_proc_ptr == (procS *) NULL)
- {
- as_warn (_(".mask/.fmask outside of .ent"));
- demand_empty_rest_of_line ();
- return;
- }
-
- if (get_absolute_expression_and_terminator (&mask) != ',')
- {
- as_warn (_("Bad .mask/.fmask directive"));
- --input_line_pointer;
- demand_empty_rest_of_line ();
- return;
- }
-
- off = get_absolute_expression ();
-
- if (reg_type == 'F')
- {
- cur_proc_ptr->fpreg_mask = mask;
- cur_proc_ptr->fpreg_offset = off;
- }
- else
- {
- cur_proc_ptr->reg_mask = mask;
- cur_proc_ptr->reg_offset = off;
- }
-
- demand_empty_rest_of_line ();
- }
- else
-#endif /* OBJ_ELF */
- s_ignore (reg_type);
-}
-
-/* A table describing all the processors gas knows about. Names are
- matched in the order listed.
-
- To ease comparison, please keep this table in the same order as
- gcc's mips_cpu_info_table[]. */
-static const struct mips_cpu_info mips_cpu_info_table[] =
-{
- /* Entries for generic ISAs */
- { "mips1", MIPS_CPU_IS_ISA, ISA_MIPS1, CPU_R3000 },
- { "mips2", MIPS_CPU_IS_ISA, ISA_MIPS2, CPU_R6000 },
- { "mips3", MIPS_CPU_IS_ISA, ISA_MIPS3, CPU_R4000 },
- { "mips4", MIPS_CPU_IS_ISA, ISA_MIPS4, CPU_R8000 },
- { "mips5", MIPS_CPU_IS_ISA, ISA_MIPS5, CPU_MIPS5 },
- { "mips32", MIPS_CPU_IS_ISA, ISA_MIPS32, CPU_MIPS32 },
- { "mips32r2", MIPS_CPU_IS_ISA, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "mips64", MIPS_CPU_IS_ISA, ISA_MIPS64, CPU_MIPS64 },
- { "mips64r2", MIPS_CPU_IS_ISA, ISA_MIPS64R2, CPU_MIPS64R2 },
-
- /* MIPS I */
- { "r3000", 0, ISA_MIPS1, CPU_R3000 },
- { "r2000", 0, ISA_MIPS1, CPU_R3000 },
- { "r3900", 0, ISA_MIPS1, CPU_R3900 },
-
- /* MIPS II */
- { "r6000", 0, ISA_MIPS2, CPU_R6000 },
-
- /* MIPS III */
- { "r4000", 0, ISA_MIPS3, CPU_R4000 },
- { "r4010", 0, ISA_MIPS2, CPU_R4010 },
- { "vr4100", 0, ISA_MIPS3, CPU_VR4100 },
- { "vr4111", 0, ISA_MIPS3, CPU_R4111 },
- { "vr4120", 0, ISA_MIPS3, CPU_VR4120 },
- { "vr4130", 0, ISA_MIPS3, CPU_VR4120 },
- { "vr4181", 0, ISA_MIPS3, CPU_R4111 },
- { "vr4300", 0, ISA_MIPS3, CPU_R4300 },
- { "r4400", 0, ISA_MIPS3, CPU_R4400 },
- { "r4600", 0, ISA_MIPS3, CPU_R4600 },
- { "orion", 0, ISA_MIPS3, CPU_R4600 },
- { "r4650", 0, ISA_MIPS3, CPU_R4650 },
- /* ST Microelectronics Loongson 2E and 2F cores */
- { "loongson2e", 0, ISA_MIPS3, CPU_LOONGSON_2E },
- { "loongson2f", 0, ISA_MIPS3, CPU_LOONGSON_2F },
-
- /* MIPS IV */
- { "r8000", 0, ISA_MIPS4, CPU_R8000 },
- { "r10000", 0, ISA_MIPS4, CPU_R10000 },
- { "r12000", 0, ISA_MIPS4, CPU_R12000 },
- { "vr5000", 0, ISA_MIPS4, CPU_R5000 },
- { "vr5400", 0, ISA_MIPS4, CPU_VR5400 },
- { "vr5500", 0, ISA_MIPS4, CPU_VR5500 },
- { "rm5200", 0, ISA_MIPS4, CPU_R5000 },
- { "rm5230", 0, ISA_MIPS4, CPU_R5000 },
- { "rm5231", 0, ISA_MIPS4, CPU_R5000 },
- { "rm5261", 0, ISA_MIPS4, CPU_R5000 },
- { "rm5721", 0, ISA_MIPS4, CPU_R5000 },
- { "rm7000", 0, ISA_MIPS4, CPU_RM7000 },
- { "rm9000", 0, ISA_MIPS4, CPU_RM9000 },
-
- /* MIPS 32 */
- { "4kc", 0, ISA_MIPS32, CPU_MIPS32 },
- { "4km", 0, ISA_MIPS32, CPU_MIPS32 },
- { "4kp", 0, ISA_MIPS32, CPU_MIPS32 },
- { "4ksc", MIPS_CPU_ASE_SMARTMIPS, ISA_MIPS32, CPU_MIPS32 },
-
- /* MIPS 32 Release 2 */
- { "4kec", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "4kem", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "4kep", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "4ksd", MIPS_CPU_ASE_SMARTMIPS, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "m4k", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "m4kp", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kc", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kf2_1", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kf", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kf1_1", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- /* Deprecated forms of the above. */
- { "24kfx", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kx", 0, ISA_MIPS32R2, CPU_MIPS32R2 },
- /* 24KE is a 24K with DSP ASE, other ASEs are optional. */
- { "24kec", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kef2_1", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kef", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kef1_1", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
- /* Deprecated forms of the above. */
- { "24kefx", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
- { "24kex", MIPS_CPU_ASE_DSP, ISA_MIPS32R2, CPU_MIPS32R2 },
- /* 34K is a 24K with DSP and MT ASE, other ASEs are optional. */
- { "34kc", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "34kf2_1", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "34kf", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "34kf1_1", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- /* Deprecated forms of the above. */
- { "34kfx", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "34kx", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_MT,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- /* 74K with DSP and DSPR2 ASE, other ASEs are optional. */
- { "74kc", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "74kf2_1", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "74kf", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "74kf1_1", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "74kf3_2", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- /* Deprecated forms of the above. */
- { "74kfx", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
- { "74kx", MIPS_CPU_ASE_DSP | MIPS_CPU_ASE_DSPR2,
- ISA_MIPS32R2, CPU_MIPS32R2 },
-
- /* MIPS 64 */
- { "5kc", 0, ISA_MIPS64, CPU_MIPS64 },
- { "5kf", 0, ISA_MIPS64, CPU_MIPS64 },
- { "20kc", MIPS_CPU_ASE_MIPS3D, ISA_MIPS64, CPU_MIPS64 },
- { "25kf", MIPS_CPU_ASE_MIPS3D, ISA_MIPS64, CPU_MIPS64 },
-
- /* MIPS 64 Release 2 */
-
- /* Broadcom SB-1 CPU core */
- { "sb1", MIPS_CPU_ASE_MIPS3D | MIPS_CPU_ASE_MDMX,
- ISA_MIPS64, CPU_SB1 },
- /* Broadcom SB-1A CPU core */
- { "sb1a", MIPS_CPU_ASE_MIPS3D | MIPS_CPU_ASE_MDMX,
- ISA_MIPS64, CPU_SB1 },
-
- /* Cavium Networks Octeon CPU core */
- { "octeon", 0, ISA_MIPS64R2, CPU_OCTEON },
-
- /* End marker */
- { NULL, 0, 0, 0 }
-};
-
-
-/* Return true if GIVEN is the same as CANONICAL, or if it is CANONICAL
- with a final "000" replaced by "k". Ignore case.
-
- Note: this function is shared between GCC and GAS. */
-
-static bfd_boolean
-mips_strict_matching_cpu_name_p (const char *canonical, const char *given)
-{
- while (*given != 0 && TOLOWER (*given) == TOLOWER (*canonical))
- given++, canonical++;
-
- return ((*given == 0 && *canonical == 0)
- || (strcmp (canonical, "000") == 0 && strcasecmp (given, "k") == 0));
-}
-
-
-/* Return true if GIVEN matches CANONICAL, where GIVEN is a user-supplied
- CPU name. We've traditionally allowed a lot of variation here.
-
- Note: this function is shared between GCC and GAS. */
-
-static bfd_boolean
-mips_matching_cpu_name_p (const char *canonical, const char *given)
-{
- /* First see if the name matches exactly, or with a final "000"
- turned into "k". */
- if (mips_strict_matching_cpu_name_p (canonical, given))
- return TRUE;
-
- /* If not, try comparing based on numerical designation alone.
- See if GIVEN is an unadorned number, or 'r' followed by a number. */
- if (TOLOWER (*given) == 'r')
- given++;
- if (!ISDIGIT (*given))
- return FALSE;
-
- /* Skip over some well-known prefixes in the canonical name,
- hoping to find a number there too. */
- if (TOLOWER (canonical[0]) == 'v' && TOLOWER (canonical[1]) == 'r')
- canonical += 2;
- else if (TOLOWER (canonical[0]) == 'r' && TOLOWER (canonical[1]) == 'm')
- canonical += 2;
- else if (TOLOWER (canonical[0]) == 'r')
- canonical += 1;
-
- return mips_strict_matching_cpu_name_p (canonical, given);
-}
-
-
-/* Parse an option that takes the name of a processor as its argument.
- OPTION is the name of the option and CPU_STRING is the argument.
- Return the corresponding processor enumeration if the CPU_STRING is
- recognized, otherwise report an error and return null.
-
- A similar function exists in GCC. */
-
-static const struct mips_cpu_info *
-mips_parse_cpu (const char *option, const char *cpu_string)
-{
- const struct mips_cpu_info *p;
-
- /* 'from-abi' selects the most compatible architecture for the given
- ABI: MIPS I for 32-bit ABIs and MIPS III for 64-bit ABIs. For the
- EABIs, we have to decide whether we're using the 32-bit or 64-bit
- version. Look first at the -mgp options, if given, otherwise base
- the choice on MIPS_DEFAULT_64BIT.
-
- Treat NO_ABI like the EABIs. One reason to do this is that the
- plain 'mips' and 'mips64' configs have 'from-abi' as their default
- architecture. This code picks MIPS I for 'mips' and MIPS III for
- 'mips64', just as we did in the days before 'from-abi'. */
- if (strcasecmp (cpu_string, "from-abi") == 0)
- {
- if (ABI_NEEDS_32BIT_REGS (mips_abi))
- return mips_cpu_info_from_isa (ISA_MIPS1);
-
- if (ABI_NEEDS_64BIT_REGS (mips_abi))
- return mips_cpu_info_from_isa (ISA_MIPS3);
-
- if (file_mips_gp32 >= 0)
- return mips_cpu_info_from_isa (file_mips_gp32 ? ISA_MIPS1 : ISA_MIPS3);
-
- return mips_cpu_info_from_isa (MIPS_DEFAULT_64BIT
- ? ISA_MIPS3
- : ISA_MIPS1);
- }
-
- /* 'default' has traditionally been a no-op. Probably not very useful. */
- if (strcasecmp (cpu_string, "default") == 0)
- return 0;
-
- for (p = mips_cpu_info_table; p->name != 0; p++)
- if (mips_matching_cpu_name_p (p->name, cpu_string))
- return p;
-
- as_bad ("Bad value (%s) for %s", cpu_string, option);
- return 0;
-}
-
-/* Return the canonical processor information for ISA (a member of the
- ISA_MIPS* enumeration). */
-
-static const struct mips_cpu_info *
-mips_cpu_info_from_isa (int isa)
-{
- int i;
-
- for (i = 0; mips_cpu_info_table[i].name != NULL; i++)
- if ((mips_cpu_info_table[i].flags & MIPS_CPU_IS_ISA)
- && isa == mips_cpu_info_table[i].isa)
- return (&mips_cpu_info_table[i]);
-
- return NULL;
-}
-
-static const struct mips_cpu_info *
-mips_cpu_info_from_arch (int arch)
-{
- int i;
-
- for (i = 0; mips_cpu_info_table[i].name != NULL; i++)
- if (arch == mips_cpu_info_table[i].cpu)
- return (&mips_cpu_info_table[i]);
-
- return NULL;
-}
-
-static void
-show (FILE *stream, const char *string, int *col_p, int *first_p)
-{
- if (*first_p)
- {
- fprintf (stream, "%24s", "");
- *col_p = 24;
- }
- else
- {
- fprintf (stream, ", ");
- *col_p += 2;
- }
-
- if (*col_p + strlen (string) > 72)
- {
- fprintf (stream, "\n%24s", "");
- *col_p = 24;
- }
-
- fprintf (stream, "%s", string);
- *col_p += strlen (string);
-
- *first_p = 0;
-}
-
-void
-md_show_usage (FILE *stream)
-{
- int column, first;
- size_t i;
-
- fprintf (stream, _("\
-MIPS options:\n\
--EB generate big endian output\n\
--EL generate little endian output\n\
--g, -g2 do not remove unneeded NOPs or swap branches\n\
--G NUM allow referencing objects up to NUM bytes\n\
- implicitly with the gp register [default 8]\n"));
- fprintf (stream, _("\
--mips1 generate MIPS ISA I instructions\n\
--mips2 generate MIPS ISA II instructions\n\
--mips3 generate MIPS ISA III instructions\n\
--mips4 generate MIPS ISA IV instructions\n\
--mips5 generate MIPS ISA V instructions\n\
--mips32 generate MIPS32 ISA instructions\n\
--mips32r2 generate MIPS32 release 2 ISA instructions\n\
--mips64 generate MIPS64 ISA instructions\n\
--mips64r2 generate MIPS64 release 2 ISA instructions\n\
--march=CPU/-mtune=CPU generate code/schedule for CPU, where CPU is one of:\n"));
-
- first = 1;
-
- for (i = 0; mips_cpu_info_table[i].name != NULL; i++)
- show (stream, mips_cpu_info_table[i].name, &column, &first);
- show (stream, "from-abi", &column, &first);
- fputc ('\n', stream);
-
- fprintf (stream, _("\
--mCPU equivalent to -march=CPU -mtune=CPU. Deprecated.\n\
--no-mCPU don't generate code specific to CPU.\n\
- For -mCPU and -no-mCPU, CPU must be one of:\n"));
-
- first = 1;
-
- show (stream, "3900", &column, &first);
- show (stream, "4010", &column, &first);
- show (stream, "4100", &column, &first);
- show (stream, "4650", &column, &first);
- fputc ('\n', stream);
-
- fprintf (stream, _("\
--mips16 generate mips16 instructions\n\
--no-mips16 do not generate mips16 instructions\n"));
- fprintf (stream, _("\
--msmartmips generate smartmips instructions\n\
--mno-smartmips do not generate smartmips instructions\n"));
- fprintf (stream, _("\
--mdsp generate DSP instructions\n\
--mno-dsp do not generate DSP instructions\n"));
- fprintf (stream, _("\
--mdspr2 generate DSP R2 instructions\n\
--mno-dspr2 do not generate DSP R2 instructions\n"));
- fprintf (stream, _("\
--mmt generate MT instructions\n\
--mno-mt do not generate MT instructions\n"));
- fprintf (stream, _("\
--mfix-vr4120 work around certain VR4120 errata\n\
--mfix-vr4130 work around VR4130 mflo/mfhi errata\n\
--mgp32 use 32-bit GPRs, regardless of the chosen ISA\n\
--mfp32 use 32-bit FPRs, regardless of the chosen ISA\n\
--msym32 assume all symbols have 32-bit values\n\
--O0 remove unneeded NOPs, do not swap branches\n\
--O remove unneeded NOPs and swap branches\n\
---trap, --no-break trap exception on div by 0 and mult overflow\n\
---break, --no-trap break exception on div by 0 and mult overflow\n"));
- fprintf (stream, _("\
--mhard-float allow floating-point instructions\n\
--msoft-float do not allow floating-point instructions\n\
--msingle-float only allow 32-bit floating-point operations\n\
--mdouble-float allow 32-bit and 64-bit floating-point operations\n\
---[no-]construct-floats [dis]allow floating point values to be constructed\n"
- ));
-#ifdef OBJ_ELF
- fprintf (stream, _("\
--KPIC, -call_shared generate SVR4 position independent code\n\
--mvxworks-pic generate VxWorks position independent code\n\
--non_shared do not generate position independent code\n\
--xgot assume a 32 bit GOT\n\
--mpdr, -mno-pdr enable/disable creation of .pdr sections\n\
--mshared, -mno-shared disable/enable .cpload optimization for\n\
- position dependent (non shared) code\n\
--mabi=ABI create ABI conformant object file for:\n"));
-
- first = 1;
-
- show (stream, "32", &column, &first);
- show (stream, "o64", &column, &first);
- show (stream, "n32", &column, &first);
- show (stream, "64", &column, &first);
- show (stream, "eabi", &column, &first);
-
- fputc ('\n', stream);
-
- fprintf (stream, _("\
--32 create o32 ABI object file (default)\n\
--n32 create n32 ABI object file\n\
--64 create 64 ABI object file\n"));
-#endif
-}
-
-enum dwarf2_format
-mips_dwarf2_format (asection *sec ATTRIBUTE_UNUSED)
-{
- if (HAVE_64BIT_SYMBOLS)
- {
-#ifdef TE_IRIX
- return dwarf2_format_64bit_irix;
-#else
- return dwarf2_format_64bit;
-#endif
- }
- else
- return dwarf2_format_32bit;
-}
-
-int
-mips_dwarf2_addr_size (void)
-{
- if (HAVE_64BIT_SYMBOLS)
- return 8;
- else
- return 4;
-}
-
-/* Standard calling conventions leave the CFA at SP on entry. */
-void
-mips_cfi_frame_initial_instructions (void)
-{
- cfi_add_CFA_def_cfa_register (SP);
-}
-
-int
-tc_mips_regname_to_dw2regnum (char *regname)
-{
- unsigned int regnum = -1;
- unsigned int reg;
-
- if (reg_lookup (&regname, RTYPE_GP | RTYPE_NUM, &reg))
- regnum = reg;
-
- return regnum;
-}
diff --git a/gas/config/tc-mips.h b/gas/config/tc-mips.h
deleted file mode 100644
index ee88f47b7e7..00000000000
--- a/gas/config/tc-mips.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/* tc-mips.h -- header file for tc-mips.c.
- Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
- Contributed by the OSF and Ralph Campbell.
- Written by Keith Knowles and Ralph Campbell, working independently.
- Modified for ECOFF support by Ian Lance Taylor of Cygnus Support.
-
- This file is part of GAS.
-
- GAS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GAS 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 GAS; see the file COPYING. If not, write to the Free
- Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-#ifndef TC_MIPS
-#define TC_MIPS
-
-struct frag;
-struct expressionS;
-
-/* Default to big endian. */
-#ifndef TARGET_BYTES_BIG_ENDIAN
-#define TARGET_BYTES_BIG_ENDIAN 1
-#endif
-
-#define TARGET_ARCH bfd_arch_mips
-
-#define WORKING_DOT_WORD 1
-#define OLD_FLOAT_READS
-#define REPEAT_CONS_EXPRESSIONS
-#define RELOC_EXPANSION_POSSIBLE
-#define MAX_RELOC_EXPANSION 3
-#define LOCAL_LABELS_FB 1
-
-/* Maximum symbol offset that can be encoded in a BFD_RELOC_GPREL16
- relocation. */
-#define MAX_GPREL_OFFSET (0x7FF0)
-
-#define md_relax_frag(segment, fragp, stretch) \
- mips_relax_frag(segment, fragp, stretch)
-extern int mips_relax_frag (asection *, struct frag *, long);
-
-#define md_undefined_symbol(name) (0)
-#define md_operand(x)
-
-extern char mips_nop_opcode (void);
-#define NOP_OPCODE (mips_nop_opcode ())
-
-extern void mips_handle_align (struct frag *);
-#define HANDLE_ALIGN(fragp) mips_handle_align (fragp)
-
-#define MAX_MEM_FOR_RS_ALIGN_CODE (1 + 2)
-
-struct insn_label_list;
-struct mips_segment_info {
- struct insn_label_list *labels;
- unsigned int mips16 : 1;
-};
-#define TC_SEGMENT_INFO_TYPE struct mips_segment_info
-
-/* This field is nonzero if the symbol is the target of a MIPS16 jump. */
-#define TC_SYMFIELD_TYPE int
-
-/* Tell assembler that we have an itbl_mips.h header file to include. */
-#define HAVE_ITBL_CPU
-
-/* The endianness of the target format may change based on command
- line arguments. */
-#define TARGET_FORMAT mips_target_format()
-extern const char *mips_target_format (void);
-
-/* MIPS PIC level. */
-
-enum mips_pic_level
-{
- /* Do not generate PIC code. */
- NO_PIC,
-
- /* Generate PIC code as in the SVR4 MIPS ABI. */
- SVR4_PIC,
-
- /* VxWorks's PIC model. */
- VXWORKS_PIC
-};
-
-extern enum mips_pic_level mips_pic;
-
-extern int tc_get_register (int frame);
-
-#define md_after_parse_args() mips_after_parse_args()
-extern void mips_after_parse_args (void);
-
-#define tc_init_after_args() mips_init_after_args()
-extern void mips_init_after_args (void);
-
-#define md_parse_long_option(arg) mips_parse_long_option (arg)
-extern int mips_parse_long_option (const char *);
-
-#define tc_frob_label(sym) mips_define_label (sym)
-extern void mips_define_label (symbolS *);
-
-#define tc_frob_file_before_adjust() mips_frob_file_before_adjust ()
-extern void mips_frob_file_before_adjust (void);
-
-#define tc_frob_file_before_fix() mips_frob_file ()
-extern void mips_frob_file (void);
-
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-#define tc_frob_file_after_relocs mips_frob_file_after_relocs
-extern void mips_frob_file_after_relocs (void);
-#endif
-
-#define tc_fix_adjustable(fixp) mips_fix_adjustable (fixp)
-extern int mips_fix_adjustable (struct fix *);
-
-/* Values passed to md_apply_fix don't include symbol values. */
-#define MD_APPLY_SYM_VALUE(FIX) 0
-
-/* Global syms must not be resolved, to support ELF shared libraries. */
-#define EXTERN_FORCE_RELOC \
- (OUTPUT_FLAVOR == bfd_target_elf_flavour)
-
-/* When generating NEWABI code, we may need to have to keep combined
- relocations which don't have symbols. */
-#define TC_FORCE_RELOCATION(FIX) mips_force_relocation (FIX)
-extern int mips_force_relocation (struct fix *);
-
-#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
- (! SEG_NORMAL (SEG) || mips_force_relocation (FIX))
-
-/* Register mask variables. These are set by the MIPS assembly code
- and used by ECOFF and possibly other object file formats. */
-extern unsigned long mips_gprmask;
-extern unsigned long mips_cprmask[4];
-
-#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
-
-#define elf_tc_final_processing mips_elf_final_processing
-extern void mips_elf_final_processing (void);
-
-#endif
-
-extern void md_mips_end (void);
-#define md_end() md_mips_end()
-
-extern void mips_pop_insert (void);
-#define md_pop_insert() mips_pop_insert()
-
-extern void mips_emit_delays (void);
-#define md_flush_pending_output mips_emit_delays
-
-extern void mips_enable_auto_align (void);
-#define md_elf_section_change_hook() mips_enable_auto_align()
-
-enum dwarf2_format;
-extern enum dwarf2_format mips_dwarf2_format (asection *);
-#define DWARF2_FORMAT(SEC) mips_dwarf2_format (SEC)
-
-extern int mips_dwarf2_addr_size (void);
-#define DWARF2_ADDR_SIZE(bfd) mips_dwarf2_addr_size ()
-
-#define TARGET_USE_CFIPOP 1
-
-#define tc_cfi_frame_initial_instructions mips_cfi_frame_initial_instructions
-extern void mips_cfi_frame_initial_instructions (void);
-
-#define tc_regname_to_dw2regnum tc_mips_regname_to_dw2regnum
-extern int tc_mips_regname_to_dw2regnum (char *regname);
-
-#define DWARF2_DEFAULT_RETURN_COLUMN 31
-#define DWARF2_CIE_DATA_ALIGNMENT (-4)
-
-#endif /* TC_MIPS */
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
deleted file mode 100644
index 76a9e8ec4d3..00000000000
--- a/gas/config/tc-ppc.c
+++ /dev/null
@@ -1,6216 +0,0 @@
-/* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000)
- Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
- Written by Ian Lance Taylor, Cygnus Support.
-
- This file is part of GAS, the GNU Assembler.
-
- GAS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GAS 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 GAS; see the file COPYING. If not, write to the Free
- Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-#include "as.h"
-#include "safe-ctype.h"
-#include "subsegs.h"
-#include "dw2gencfi.h"
-#include "opcode/ppc.h"
-
-#ifdef OBJ_ELF
-#include "elf/ppc.h"
-#include "dwarf2dbg.h"
-#endif
-
-#ifdef TE_PE
-#include "coff/pe.h"
-#endif
-
-/* This is the assembler for the PowerPC or POWER (RS/6000) chips. */
-
-/* Tell the main code what the endianness is. */
-extern int target_big_endian;
-
-/* Whether or not, we've set target_big_endian. */
-static int set_target_endian = 0;
-
-/* Whether to use user friendly register names. */
-#ifndef TARGET_REG_NAMES_P
-#ifdef TE_PE
-#define TARGET_REG_NAMES_P TRUE
-#else
-#define TARGET_REG_NAMES_P FALSE
-#endif
-#endif
-
-/* Macros for calculating LO, HI, HA, HIGHER, HIGHERA, HIGHEST,
- HIGHESTA. */
-
-/* #lo(value) denotes the least significant 16 bits of the indicated. */
-#define PPC_LO(v) ((v) & 0xffff)
-
-/* #hi(value) denotes bits 16 through 31 of the indicated value. */
-#define PPC_HI(v) (((v) >> 16) & 0xffff)
-
-/* #ha(value) denotes the high adjusted value: bits 16 through 31 of
- the indicated value, compensating for #lo() being treated as a
- signed number. */
-#define PPC_HA(v) PPC_HI ((v) + 0x8000)
-
-/* #higher(value) denotes bits 32 through 47 of the indicated value. */
-#define PPC_HIGHER(v) (((v) >> 16 >> 16) & 0xffff)
-
-/* #highera(value) denotes bits 32 through 47 of the indicated value,
- compensating for #lo() being treated as a signed number. */
-#define PPC_HIGHERA(v) PPC_HIGHER ((v) + 0x8000)
-
-/* #highest(value) denotes bits 48 through 63 of the indicated value. */
-#define PPC_HIGHEST(v) (((v) >> 24 >> 24) & 0xffff)
-
-/* #highesta(value) denotes bits 48 through 63 of the indicated value,
- compensating for #lo being treated as a signed number. */
-#define PPC_HIGHESTA(v) PPC_HIGHEST ((v) + 0x8000)
-
-#define SEX16(val) ((((val) & 0xffff) ^ 0x8000) - 0x8000)
-
-static bfd_boolean reg_names_p = TARGET_REG_NAMES_P;
-
-static void ppc_macro (char *, const struct powerpc_macro *);
-static void ppc_byte (int);
-
-#if defined (OBJ_XCOFF) || defined (OBJ_ELF)
-static void ppc_tc (int);
-static void ppc_machine (int);
-#endif
-
-#ifdef OBJ_XCOFF
-static void ppc_comm (int);
-static void ppc_bb (int);
-static void ppc_bc (int);
-static void ppc_bf (int);
-static void ppc_biei (int);
-static void ppc_bs (int);
-static void ppc_eb (int);
-static void ppc_ec (int);
-static void ppc_ef (int);
-static void ppc_es (int);
-static void ppc_csect (int);
-static void ppc_change_csect (symbolS *, offsetT);
-static void ppc_function (int);
-static void ppc_extern (int);
-static void ppc_lglobl (int);
-static void ppc_section (int);
-static void ppc_named_section (int);
-static void ppc_stabx (int);
-static void ppc_rename (int);
-static void ppc_toc (int);
-static void ppc_xcoff_cons (int);
-static void ppc_vbyte (int);
-#endif
-
-#ifdef OBJ_ELF
-static void ppc_elf_cons (int);
-static void ppc_elf_rdata (int);
-static void ppc_elf_lcomm (int);
-#endif
-
-#ifdef TE_PE
-static void ppc_previous (int);
-static void ppc_pdata (int);
-static void ppc_ydata (int);
-static void ppc_reldata (int);
-static void ppc_rdata (int);
-static void ppc_ualong (int);
-static void ppc_znop (int);
-static void ppc_pe_comm (int);
-static void ppc_pe_section (int);
-static void ppc_pe_function (int);
-static void ppc_pe_tocd (int);
-#endif
-
-/* Generic assembler global variables which must be defined by all
- targets. */
-
-#ifdef OBJ_ELF
-/* This string holds the chars that always start a comment. If the
- pre-processor is disabled, these aren't very useful. The macro
- tc_comment_chars points to this. We use this, rather than the
- usual comment_chars, so that we can switch for Solaris conventions. */
-static const char ppc_solaris_comment_chars[] = "#!";
-static const char ppc_eabi_comment_chars[] = "#";
-
-#ifdef TARGET_SOLARIS_COMMENT
-const char *ppc_comment_chars = ppc_solaris_comment_chars;
-#else
-const char *ppc_comment_chars = ppc_eabi_comment_chars;
-#endif
-#else
-const char comment_chars[] = "#";
-#endif
-
-/* Characters which start a comment at the beginning of a line. */
-const char line_comment_chars[] = "#";
-
-/* Characters which may be used to separate multiple commands on a
- single line. */
-const char line_separator_chars[] = ";";
-
-/* Characters which are used to indicate an exponent in a floating
- point number. */
-const char EXP_CHARS[] = "eE";
-
-/* Characters which mean that a number is a floating point constant,
- as in 0d1.0. */
-const char FLT_CHARS[] = "dD";
-
-/* Anything that can start an operand needs to be mentioned here,
- to stop the input scrubber eating whitespace. */
-const char ppc_symbol_chars[] = "%[";
-
-/* The dwarf2 data alignment, adjusted for 32 or 64 bit. */
-int ppc_cie_data_alignment;
-
-/* The type of processor we are assembling for. This is one or more
- of the PPC_OPCODE flags defined in opcode/ppc.h. */
-ppc_cpu_t ppc_cpu = 0;
-
-/* The target specific pseudo-ops which we support. */
-
-const pseudo_typeS md_pseudo_table[] =
-{
- /* Pseudo-ops which must be overridden. */
- { "byte", ppc_byte, 0 },
-
-#ifdef OBJ_XCOFF
- /* Pseudo-ops specific to the RS/6000 XCOFF format. Some of these
- legitimately belong in the obj-*.c file. However, XCOFF is based
- on COFF, and is only implemented for the RS/6000. We just use
- obj-coff.c, and add what we need here. */
- { "comm", ppc_comm, 0 },
- { "lcomm", ppc_comm, 1 },
- { "bb", ppc_bb, 0 },
- { "bc", ppc_bc, 0 },
- { "bf", ppc_bf, 0 },
- { "bi", ppc_biei, 0 },
- { "bs", ppc_bs, 0 },
- { "csect", ppc_csect, 0 },
- { "data", ppc_section, 'd' },
- { "eb", ppc_eb, 0 },
- { "ec", ppc_ec, 0 },
- { "ef", ppc_ef, 0 },
- { "ei", ppc_biei, 1 },
- { "es", ppc_es, 0 },
- { "extern", ppc_extern, 0 },
- { "function", ppc_function, 0 },
- { "lglobl", ppc_lglobl, 0 },
- { "rename", ppc_rename, 0 },
- { "section", ppc_named_section, 0 },
- { "stabx", ppc_stabx, 0 },
- { "text", ppc_section, 't' },
- { "toc", ppc_toc, 0 },
- { "long", ppc_xcoff_cons, 2 },
- { "llong", ppc_xcoff_cons, 3 },
- { "word", ppc_xcoff_cons, 1 },
- { "short", ppc_xcoff_cons, 1 },
- { "vbyte", ppc_vbyte, 0 },
-#endif
-
-#ifdef OBJ_ELF
- { "llong", ppc_elf_cons, 8 },
- { "quad", ppc_elf_cons, 8 },
- { "long", ppc_elf_cons, 4 },
- { "word", ppc_elf_cons, 2 },
- { "short", ppc_elf_cons, 2 },
- { "rdata", ppc_elf_rdata, 0 },
- { "rodata", ppc_elf_rdata, 0 },
- { "lcomm", ppc_elf_lcomm, 0 },
-#endif
-
-#ifdef TE_PE
- /* Pseudo-ops specific to the Windows NT PowerPC PE (coff) format. */
- { "previous", ppc_previous, 0 },
- { "pdata", ppc_pdata, 0 },
- { "ydata", ppc_ydata, 0 },
- { "reldata", ppc_reldata, 0 },
- { "rdata", ppc_rdata, 0 },
- { "ualong", ppc_ualong, 0 },
- { "znop", ppc_znop, 0 },
- { "comm", ppc_pe_comm, 0 },
- { "lcomm", ppc_pe_comm, 1 },
- { "section", ppc_pe_section, 0 },
- { "function", ppc_pe_function,0 },
- { "tocd", ppc_pe_tocd, 0 },
-#endif
-
-#if defined (OBJ_XCOFF) || defined (OBJ_ELF)
- { "tc", ppc_tc, 0 },
- { "machine", ppc_machine, 0 },
-#endif
-
- { NULL, NULL, 0 }
-};
-
-
-/* Predefined register names if -mregnames (or default for Windows NT).
- In general, there are lots of them, in an attempt to be compatible
- with a number of other Windows NT assemblers. */
-
-/* Structure to hold information about predefined registers. */
-struct pd_reg
- {
- char *name;
- int value;
- };
-
-/* List of registers that are pre-defined:
-
- Each general register has predefined names of the form:
- 1. r<reg_num> which has the value <reg_num>.
- 2. r.<reg_num> which has the value <reg_num>.
-
- Each floating point register has predefined names of the form:
- 1. f<reg_num> which has the value <reg_num>.
- 2. f.<reg_num> which has the value <reg_num>.
-
- Each vector unit register has predefined names of the form:
- 1. v<reg_num> which has the value <reg_num>.
- 2. v.<reg_num> which has the value <reg_num>.
-
- Each condition register has predefined names of the form:
- 1. cr<reg_num> which has the value <reg_num>.
- 2. cr.<reg_num> which has the value <reg_num>.
-
- There are individual registers as well:
- sp or r.sp has the value 1
- rtoc or r.toc has the value 2
- fpscr has the value 0
- xer has the value 1
- lr has the value 8
- ctr has the value 9
- pmr has the value 0
- dar has the value 19
- dsisr has the value 18
- dec has the value 22
- sdr1 has the value 25
- srr0 has the value 26
- srr1 has the value 27
-
- The table is sorted. Suitable for searching by a binary search. */
-
-static const struct pd_reg pre_defined_registers[] =
-{
- { "cr.0", 0 }, /* Condition Registers */
- { "cr.1", 1 },
- { "cr.2", 2 },
- { "cr.3", 3 },
- { "cr.4", 4 },
- { "cr.5", 5 },
- { "cr.6", 6 },
- { "cr.7", 7 },
-
- { "cr0", 0 },
- { "cr1", 1 },
- { "cr2", 2 },
- { "cr3", 3 },
- { "cr4", 4 },
- { "cr5", 5 },
- { "cr6", 6 },
- { "cr7", 7 },
-
- { "ctr", 9 },
-
- { "dar", 19 }, /* Data Access Register */
- { "dec", 22 }, /* Decrementer */
- { "dsisr", 18 }, /* Data Storage Interrupt Status Register */
-
- { "f.0", 0 }, /* Floating point registers */
- { "f.1", 1 },
- { "f.10", 10 },
- { "f.11", 11 },
- { "f.12", 12 },
- { "f.13", 13 },
- { "f.14", 14 },
- { "f.15", 15 },
- { "f.16", 16 },
- { "f.17", 17 },
- { "f.18", 18 },
- { "f.19", 19 },
- { "f.2", 2 },
- { "f.20", 20 },
- { "f.21", 21 },
- { "f.22", 22 },
- { "f.23", 23 },
- { "f.24", 24 },
- { "f.25", 25 },
- { "f.26", 26 },
- { "f.27", 27 },
- { "f.28", 28 },
- { "f.29", 29 },
- { "f.3", 3 },
- { "f.30", 30 },
- { "f.31", 31 },
- { "f.4", 4 },
- { "f.5", 5 },
- { "f.6", 6 },
- { "f.7", 7 },
- { "f.8", 8 },
- { "f.9", 9 },
-
- { "f0", 0 },
- { "f1", 1 },
- { "f10", 10 },
- { "f11", 11 },
- { "f12", 12 },
- { "f13", 13 },
- { "f14", 14 },
- { "f15", 15 },
- { "f16", 16 },
- { "f17", 17 },
- { "f18", 18 },
- { "f19", 19 },
- { "f2", 2 },
- { "f20", 20 },
- { "f21", 21 },
- { "f22", 22 },
- { "f23", 23 },
- { "f24", 24 },
- { "f25", 25 },
- { "f26", 26 },
- { "f27", 27 },
- { "f28", 28 },
- { "f29", 29 },
- { "f3", 3 },
- { "f30", 30 },
- { "f31", 31 },
- { "f4", 4 },
- { "f5", 5 },
- { "f6", 6 },
- { "f7", 7 },
- { "f8", 8 },
- { "f9", 9 },
-
- { "fpscr", 0 },
-
- /* Quantization registers used with pair single instructions. */
- { "gqr.0", 0 },
- { "gqr.1", 1 },
- { "gqr.2", 2 },
- { "gqr.3", 3 },
- { "gqr.4", 4 },
- { "gqr.5", 5 },
- { "gqr.6", 6 },
- { "gqr.7", 7 },
- { "gqr0", 0 },
- { "gqr1", 1 },
- { "gqr2", 2 },
- { "gqr3", 3 },
- { "gqr4", 4 },
- { "gqr5", 5 },
- { "gqr6", 6 },
- { "gqr7", 7 },
-
- { "lr", 8 }, /* Link Register */
-
- { "pmr", 0 },
-
- { "r.0", 0 }, /* General Purpose Registers */
- { "r.1", 1 },
- { "r.10", 10 },
- { "r.11", 11 },
- { "r.12", 12 },
- { "r.13", 13 },
- { "r.14", 14 },
- { "r.15", 15 },
- { "r.16", 16 },
- { "r.17", 17 },
- { "r.18", 18 },
- { "r.19", 19 },
- { "r.2", 2 },
- { "r.20", 20 },
- { "r.21", 21 },
- { "r.22", 22 },
- { "r.23", 23 },
- { "r.24", 24 },
- { "r.25", 25 },
- { "r.26", 26 },
- { "r.27", 27 },
- { "r.28", 28 },
- { "r.29", 29 },
- { "r.3", 3 },
- { "r.30", 30 },
- { "r.31", 31 },
- { "r.4", 4 },
- { "r.5", 5 },
- { "r.6", 6 },
- { "r.7", 7 },
- { "r.8", 8 },
- { "r.9", 9 },
-
- { "r.sp", 1 }, /* Stack Pointer */
-
- { "r.toc", 2 }, /* Pointer to the table of contents */
-
- { "r0", 0 }, /* More general purpose registers */
- { "r1", 1 },
- { "r10", 10 },
- { "r11", 11 },
- { "r12", 12 },
- { "r13", 13 },
- { "r14", 14 },
- { "r15", 15 },
- { "r16", 16 },
- { "r17", 17 },
- { "r18", 18 },
- { "r19", 19 },
- { "r2", 2 },
- { "r20", 20 },
- { "r21", 21 },
- { "r22", 22 },
- { "r23", 23 },
- { "r24", 24 },
- { "r25", 25 },
- { "r26", 26 },
- { "r27", 27 },
- { "r28", 28 },
- { "r29", 29 },
- { "r3", 3 },
- { "r30", 30 },
- { "r31", 31 },
- { "r4", 4 },
- { "r5", 5 },
- { "r6", 6 },
- { "r7", 7 },
- { "r8", 8 },
- { "r9", 9 },
-
- { "rtoc", 2 }, /* Table of contents */
-
- { "sdr1", 25 }, /* Storage Description Register 1 */
-
- { "sp", 1 },
-
- { "srr0", 26 }, /* Machine Status Save/Restore Register 0 */
- { "srr1", 27 }, /* Machine Status Save/Restore Register 1 */
-
- { "v.0", 0 }, /* Vector registers */
- { "v.1", 1 },
- { "v.10", 10 },
- { "v.11", 11 },
- { "v.12", 12 },
- { "v.13", 13 },
- { "v.14", 14 },
- { "v.15", 15 },
- { "v.16", 16 },
- { "v.17", 17 },
- { "v.18", 18 },
- { "v.19", 19 },
- { "v.2", 2 },
- { "v.20", 20 },
- { "v.21", 21 },
- { "v.22", 22 },
- { "v.23", 23 },
- { "v.24", 24 },
- { "v.25", 25 },
- { "v.26", 26 },
- { "v.27", 27 },
- { "v.28", 28 },
- { "v.29", 29 },
- { "v.3", 3 },
- { "v.30", 30 },
- { "v.31", 31 },
- { "v.4", 4 },
- { "v.5", 5 },
- { "v.6", 6 },
- { "v.7", 7 },
- { "v.8", 8 },
- { "v.9", 9 },
-
- { "v0", 0 },
- { "v1", 1 },
- { "v10", 10 },
- { "v11", 11 },
- { "v12", 12 },
- { "v13", 13 },
- { "v14", 14 },
- { "v15", 15 },
- { "v16", 16 },
- { "v17", 17 },
- { "v18", 18 },
- { "v19", 19 },
- { "v2", 2 },
- { "v20", 20 },
- { "v21", 21 },
- { "v22", 22 },
- { "v23", 23 },
- { "v24", 24 },
- { "v25", 25 },
- { "v26", 26 },
- { "v27", 27 },
- { "v28", 28 },
- { "v29", 29 },
- { "v3", 3 },
- { "v30", 30 },
- { "v31", 31 },
- { "v4", 4 },
- { "v5", 5 },
- { "v6", 6 },
- { "v7", 7 },
- { "v8", 8 },
- { "v9", 9 },
-
- { "xer", 1 },
-
-};
-
-#define REG_NAME_CNT (sizeof (pre_defined_registers) / sizeof (struct pd_reg))
-
-/* Given NAME, find the register number associated with that name, return
- the integer value associated with the given name or -1 on failure. */
-
-static int
-reg_name_search (const struct pd_reg *regs, int regcount, const char *name)
-{
- int middle, low, high;
- int cmp;
-
- low = 0;
- high = regcount - 1;
-
- do
- {
- middle = (low + high) / 2;
- cmp = strcasecmp (name, regs[middle].name);
- if (cmp < 0)
- high = middle - 1;
- else if (cmp > 0)
- low = middle + 1;
- else
- return regs[middle].value;
- }
- while (low <= high);
-
- return -1;
-}
-
-/*
- * Summary of register_name.
- *
- * in: Input_line_pointer points to 1st char of operand.
- *
- * out: A expressionS.
- * The operand may have been a register: in this case, X_op == O_register,
- * X_add_number is set to the register number, and truth is returned.
- * Input_line_pointer->(next non-blank) char after operand, or is in its
- * original state.
- */
-
-static bfd_boolean
-register_name (expressionS *expressionP)
-{
- int reg_number;
- char *name;
- char *start;
- char c;
-
- /* Find the spelling of the operand. */
- start = name = input_line_pointer;
- if (name[0] == '%' && ISALPHA (name[1]))
- name = ++input_line_pointer;
-
- else if (!reg_names_p || !ISALPHA (name[0]))
- return FALSE;
-
- c = get_symbol_end ();
- reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, name);
-
- /* Put back the delimiting char. */
- *input_line_pointer = c;
-
- /* Look to see if it's in the register table. */
- if (reg_number >= 0)
- {
- expressionP->X_op = O_register;
- expressionP->X_add_number = reg_number;
-
- /* Make the rest nice. */
- expressionP->X_add_symbol = NULL;
- expressionP->X_op_symbol = NULL;
- return TRUE;
- }
-
- /* Reset the line as if we had not done anything. */
- input_line_pointer = start;
- return FALSE;
-}
-
-/* This function is called for each symbol seen in an expression. It
- handles the special parsing which PowerPC assemblers are supposed
- to use for condition codes. */
-
-/* Whether to do the special parsing. */
-static bfd_boolean cr_operand;
-
-/* Names to recognize in a condition code. This table is sorted. */
-static const struct pd_reg cr_names[] =
-{
- { "cr0", 0 },
- { "cr1", 1 },
- { "cr2", 2 },
- { "cr3", 3 },
- { "cr4", 4 },
- { "cr5", 5 },
- { "cr6", 6 },
- { "cr7", 7 },
- { "eq", 2 },
- { "gt", 1 },
- { "lt", 0 },
- { "so", 3 },
- { "un", 3 }
-};
-
-/* Parsing function. This returns non-zero if it recognized an
- expression. */
-
-int
-ppc_parse_name (const char *name, expressionS *expr)
-{
- int val;
-
- if (! cr_operand)
- return 0;
-
- if (*name == '%')
- ++name;
- val = reg_name_search (cr_names, sizeof cr_names / sizeof cr_names[0],
- name);
- if (val < 0)
- return 0;
-
- expr->X_op = O_constant;
- expr->X_add_number = val;
-
- return 1;
-}
-
-/* Local variables. */
-
-/* Whether to target xcoff64/elf64. */
-static unsigned int ppc_obj64 = BFD_DEFAULT_TARGET_SIZE == 64;
-
-/* Opcode hash table. */
-static struct hash_control *ppc_hash;
-
-/* Macro hash table. */
-static struct hash_control *ppc_macro_hash;
-
-#ifdef OBJ_ELF
-/* What type of shared library support to use. */
-static enum { SHLIB_NONE, SHLIB_PIC, SHLIB_MRELOCATABLE } shlib = SHLIB_NONE;
-
-/* Flags to set in the elf header. */
-static flagword ppc_flags = 0;
-
-/* Whether this is Solaris or not. */
-#ifdef TARGET_SOLARIS_COMMENT
-#define SOLARIS_P TRUE
-#else
-#define SOLARIS_P FALSE
-#endif
-
-static bfd_boolean msolaris = SOLARIS_P;
-#endif
-
-#ifdef OBJ_XCOFF
-
-/* The RS/6000 assembler uses the .csect pseudo-op to generate code
- using a bunch of different sections. These assembler sections,
- however, are all encompassed within the .text or .data sections of
- the final output file. We handle this by using different
- subsegments within these main segments. */
-
-/* Next subsegment to allocate within the .text segment. */
-static subsegT ppc_text_subsegment = 2;
-
-/* Linked list of csects in the text section. */
-static symbolS *ppc_text_csects;
-
-/* Next subsegment to allocate within the .data segment. */
-static subsegT ppc_data_subsegment = 2;
-
-/* Linked list of csects in the data section. */
-static symbolS *ppc_data_csects;
-
-/* The current csect. */
-static symbolS *ppc_current_csect;
-
-/* The RS/6000 assembler uses a TOC which holds addresses of functions
- and variables. Symbols are put in the TOC with the .tc pseudo-op.
- A special relocation is used when accessing TOC entries. We handle
- the TOC as a subsegment within the .data segment. We set it up if
- we see a .toc pseudo-op, and save the csect symbol here. */
-static symbolS *ppc_toc_csect;
-
-/* The first frag in the TOC subsegment. */
-static fragS *ppc_toc_frag;
-
-/* The first frag in the first subsegment after the TOC in the .data
- segment. NULL if there are no subsegments after the TOC. */
-static fragS *ppc_after_toc_frag;
-
-/* The current static block. */
-static symbolS *ppc_current_block;
-
-/* The COFF debugging section; set by md_begin. This is not the
- .debug section, but is instead the secret BFD section which will
- cause BFD to set the section number of a symbol to N_DEBUG. */
-static asection *ppc_coff_debug_section;
-
-#endif /* OBJ_XCOFF */
-
-#ifdef TE_PE
-
-/* Various sections that we need for PE coff support. */
-static segT ydata_section;
-static segT pdata_section;
-static segT reldata_section;
-static segT rdata_section;
-static segT tocdata_section;
-
-/* The current section and the previous section. See ppc_previous. */
-static segT ppc_previous_section;
-static segT ppc_current_section;
-
-#endif /* TE_PE */
-
-#ifdef OBJ_ELF
-symbolS *GOT_symbol; /* Pre-defined "_GLOBAL_OFFSET_TABLE" */
-#define PPC_APUINFO_ISEL 0x40
-#define PPC_APUINFO_PMR 0x41
-#define PPC_APUINFO_RFMCI 0x42
-#define PPC_APUINFO_CACHELCK 0x43
-#define PPC_APUINFO_SPE 0x100
-#define PPC_APUINFO_EFS 0x101
-#define PPC_APUINFO_BRLOCK 0x102
-
-/*
- * We keep a list of APUinfo
- */
-unsigned long *ppc_apuinfo_list;
-unsigned int ppc_apuinfo_num;
-unsigned int ppc_apuinfo_num_alloc;
-#endif /* OBJ_ELF */
-
-#ifdef OBJ_ELF
-const char *const md_shortopts = "b:l:usm:K:VQ:";
-#else
-const char *const md_shortopts = "um:";
-#endif
-const struct option md_longopts[] = {
- {NULL, no_argument, NULL, 0}
-};
-const size_t md_longopts_size = sizeof (md_longopts);
-
-
-/* Handle -m options that set cpu type, and .machine arg. */
-
-static int
-parse_cpu (const char *arg)
-{
- ppc_cpu_t retain_flags =
- ppc_cpu & (PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX | PPC_OPCODE_SPE);
-
- /* -mpwrx and -mpwr2 mean to assemble for the IBM POWER/2
- (RIOS2). */
- if (strcmp (arg, "pwrx") == 0 || strcmp (arg, "pwr2") == 0)
- ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_POWER2 | PPC_OPCODE_32;
- /* -mpwr means to assemble for the IBM POWER (RIOS1). */
- else if (strcmp (arg, "pwr") == 0)
- ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_32;
- /* -m601 means to assemble for the PowerPC 601, which includes
- instructions that are holdovers from the Power. */
- else if (strcmp (arg, "601") == 0)
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC
- | PPC_OPCODE_601 | PPC_OPCODE_32);
- /* -mppc, -mppc32, -m603, and -m604 mean to assemble for the
- PowerPC 603/604. */
- else if (strcmp (arg, "ppc") == 0
- || strcmp (arg, "ppc32") == 0
- || strcmp (arg, "603") == 0
- || strcmp (arg, "604") == 0)
- ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32;
- /* Do all PPC750s have paired single ops? */
- else if (strcmp (arg, "750cl") == 0)
- ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_PPCPS;
- else if (strcmp (arg, "403") == 0)
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC
- | PPC_OPCODE_403 | PPC_OPCODE_32);
- else if (strcmp (arg, "405") == 0)
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC
- | PPC_OPCODE_403 | PPC_OPCODE_405 | PPC_OPCODE_32);
- else if (strcmp (arg, "440") == 0
- || strcmp (arg, "464") == 0)
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_32
- | PPC_OPCODE_440 | PPC_OPCODE_ISEL | PPC_OPCODE_RFMCI);
- else if (strcmp (arg, "7400") == 0
- || strcmp (arg, "7410") == 0
- || strcmp (arg, "7450") == 0
- || strcmp (arg, "7455") == 0)
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC
- | PPC_OPCODE_ALTIVEC | PPC_OPCODE_32);
- else if (strcmp (arg, "e300") == 0)
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32
- | PPC_OPCODE_E300);
- else if (strcmp (arg, "altivec") == 0)
- {
- if (ppc_cpu == 0)
- ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC;
-
- retain_flags |= PPC_OPCODE_ALTIVEC;
- }
- else if (strcmp (arg, "vsx") == 0)
- {
- if (ppc_cpu == 0)
- ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC;
-
- retain_flags |= PPC_OPCODE_VSX;
- }
- else if (strcmp (arg, "e500") == 0 || strcmp (arg, "e500x2") == 0)
- {
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_SPE
- | PPC_OPCODE_ISEL | PPC_OPCODE_EFS | PPC_OPCODE_BRLOCK
- | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK
- | PPC_OPCODE_RFMCI | PPC_OPCODE_E500MC);
- }
- else if (strcmp (arg, "e500mc") == 0)
- {
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_ISEL
- | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK
- | PPC_OPCODE_RFMCI | PPC_OPCODE_E500MC);
- }
- else if (strcmp (arg, "spe") == 0)
- {
- if (ppc_cpu == 0)
- ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_EFS;
-
- retain_flags |= PPC_OPCODE_SPE;
- }
- /* -mppc64 and -m620 mean to assemble for the 64-bit PowerPC
- 620. */
- else if (strcmp (arg, "ppc64") == 0 || strcmp (arg, "620") == 0)
- {
- ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_64;
- }
- else if (strcmp (arg, "ppc64bridge") == 0)
- {
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC
- | PPC_OPCODE_64_BRIDGE | PPC_OPCODE_64);
- }
- /* -mbooke/-mbooke32 mean enable 32-bit BookE support. */
- else if (strcmp (arg, "booke") == 0 || strcmp (arg, "booke32") == 0)
- {
- ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_32;
- }
- /* -mbooke64 means enable 64-bit BookE support. */
- else if (strcmp (arg, "booke64") == 0)
- {
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE
- | PPC_OPCODE_BOOKE64 | PPC_OPCODE_64);
- }
- else if (strcmp (arg, "power4") == 0)
- {
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC
- | PPC_OPCODE_64 | PPC_OPCODE_POWER4);
- }
- else if (strcmp (arg, "power5") == 0)
- {
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC
- | PPC_OPCODE_64 | PPC_OPCODE_POWER4
- | PPC_OPCODE_POWER5);
- }
- else if (strcmp (arg, "power6") == 0)
- {
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC
- | PPC_OPCODE_64 | PPC_OPCODE_POWER4
- | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
- | PPC_OPCODE_ALTIVEC);
- }
- else if (strcmp (arg, "power7") == 0)
- {
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC
- | PPC_OPCODE_64 | PPC_OPCODE_POWER4
- | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
- | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX);
- }
- else if (strcmp (arg, "cell") == 0)
- {
- ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC
- | PPC_OPCODE_64 | PPC_OPCODE_POWER4
- | PPC_OPCODE_CELL | PPC_OPCODE_ALTIVEC);
- }
- /* -mcom means assemble for the common intersection between Power
- and PowerPC. At present, we just allow the union, rather
- than the intersection. */
- else if (strcmp (arg, "com") == 0)
- ppc_cpu = PPC_OPCODE_COMMON | PPC_OPCODE_32;
- /* -many means to assemble for any architecture (PWR/PWRX/PPC). */
- else if (strcmp (arg, "any") == 0)
- ppc_cpu |= PPC_OPCODE_ANY;
- else
- return 0;
-
- /* Make sure the the Altivec, VSX and SPE bits are not lost. */
- ppc_cpu |= retain_flags;
- return 1;
-}
-
-int
-md_parse_option (int c, char *arg)
-{
- switch (c)
- {
- case 'u':
- /* -u means that any undefined symbols should be treated as
- external, which is the default for gas anyhow. */
- break;
-
-#ifdef OBJ_ELF
- case 'l':
- /* Solaris as takes -le (presumably for little endian). For completeness
- sake, recognize -be also. */
- if (strcmp (arg, "e") == 0)
- {
- target_big_endian = 0;
- set_target_endian = 1;
- }
- else
- return 0;
-
- break;
-
- case 'b':
- if (strcmp (arg, "e") == 0)
- {
- target_big_endian = 1;
- set_target_endian = 1;
- }
- else
- return 0;
-
- break;
-
- case 'K':
- /* Recognize -K PIC. */
- if (strcmp (arg, "PIC") == 0 || strcmp (arg, "pic") == 0)
- {
- shlib = SHLIB_PIC;
- ppc_flags |= EF_PPC_RELOCATABLE_LIB;
- }
- else
- return 0;
-
- break;
-#endif
-
- /* a64 and a32 determine whether to use XCOFF64 or XCOFF32. */
- case 'a':
- if (strcmp (arg, "64") == 0)
- {
-#ifdef BFD64
- ppc_obj64 = 1;
-#else
- as_fatal (_("%s unsupported"), "-a64");
-#endif
- }
- else if (strcmp (arg, "32") == 0)
- ppc_obj64 = 0;
- else
- return 0;
- break;
-
- case 'm':
- if (parse_cpu (arg))
- ;
-
- else if (strcmp (arg, "regnames") == 0)
- reg_names_p = TRUE;
-
- else if (strcmp (arg, "no-regnames") == 0)
- reg_names_p = FALSE;
-
-#ifdef OBJ_ELF
- /* -mrelocatable/-mrelocatable-lib -- warn about initializations
- that require relocation. */
- else if (strcmp (arg, "relocatable") == 0)
- {
- shlib = SHLIB_MRELOCATABLE;
- ppc_flags |= EF_PPC_RELOCATABLE;
- }
-
- else if (strcmp (arg, "relocatable-lib") == 0)
- {
- shlib = SHLIB_MRELOCATABLE;
- ppc_flags |= EF_PPC_RELOCATABLE_LIB;
- }
-
- /* -memb, set embedded bit. */
- else if (strcmp (arg, "emb") == 0)
- ppc_flags |= EF_PPC_EMB;
-
- /* -mlittle/-mbig set the endianess. */
- else if (strcmp (arg, "little") == 0
- || strcmp (arg, "little-endian") == 0)
- {
- target_big_endian = 0;
- set_target_endian = 1;
- }
-
- else if (strcmp (arg, "big") == 0 || strcmp (arg, "big-endian") == 0)
- {
- target_big_endian = 1;
- set_target_endian = 1;
- }
-
- else if (strcmp (arg, "solaris") == 0)
- {
- msolaris = TRUE;
- ppc_comment_chars = ppc_solaris_comment_chars;
- }
-
- else if (strcmp (arg, "no-solaris") == 0)
- {
- msolaris = FALSE;
- ppc_comment_chars = ppc_eabi_comment_chars;
- }
-#endif
- else
- {
- as_bad (_("invalid switch -m%s"), arg);
- return 0;
- }
- break;
-
-#ifdef OBJ_ELF
- /* -V: SVR4 argument to print version ID. */
- case 'V':
- print_version_id ();
- break;
-
- /* -Qy, -Qn: SVR4 arguments controlling whether a .comment section
- should be emitted or not. FIXME: Not implemented. */
- case 'Q':
- break;
-
- /* Solaris takes -s to specify that .stabs go in a .stabs section,
- rather than .stabs.excl, which is ignored by the linker.
- FIXME: Not implemented. */
- case 's':
- if (arg)
- return 0;
-
- break;
-#endif
-
- default:
- return 0;
- }
-
- return 1;
-}
-
-void
-md_show_usage (FILE *stream)
-{
- fprintf (stream, _("\
-PowerPC options:\n\
--a32 generate ELF32/XCOFF32\n\
--a64 generate ELF64/XCOFF64\n\
--u ignored\n\
--mpwrx, -mpwr2 generate code for POWER/2 (RIOS2)\n\
--mpwr generate code for POWER (RIOS1)\n\
--m601 generate code for PowerPC 601\n\
--mppc, -mppc32, -m603, -m604\n\
- generate code for PowerPC 603/604\n\
--m403 generate code for PowerPC 403\n\
--m405 generate code for PowerPC 405\n\
--m440 generate code for PowerPC 440\n\
--m464 generate code for PowerPC 464\n\
--m7400, -m7410, -m7450, -m7455\n\
- generate code for PowerPC 7400/7410/7450/7455\n\
--m750cl generate code for PowerPC 750cl\n"));
- fprintf (stream, _("\
--mppc64, -m620 generate code for PowerPC 620/625/630\n\
--mppc64bridge generate code for PowerPC 64, including bridge insns\n\
--mbooke64 generate code for 64-bit PowerPC BookE\n\
--mbooke, mbooke32 generate code for 32-bit PowerPC BookE\n\
--mpower4 generate code for Power4 architecture\n\
--mpower5 generate code for Power5 architecture\n\
--mpower6 generate code for Power6 architecture\n\
--mpower7 generate code for Power7 architecture\n\
--mcell generate code for Cell Broadband Engine architecture\n\
--mcom generate code Power/PowerPC common instructions\n\
--many generate code for any architecture (PWR/PWRX/PPC)\n"));
- fprintf (stream, _("\
--maltivec generate code for AltiVec\n\
--mvsx generate code for Vector-Scalar (VSX) instructions\n\
--me300 generate code for PowerPC e300 family\n\
--me500, -me500x2 generate code for Motorola e500 core complex\n\
--me500mc, generate code for Freescale e500mc core complex\n\
--mspe generate code for Motorola SPE instructions\n\
--mregnames Allow symbolic names for registers\n\
--mno-regnames Do not allow symbolic names for registers\n"));
-#ifdef OBJ_ELF
- fprintf (stream, _("\
--mrelocatable support for GCC's -mrelocatble option\n\
--mrelocatable-lib support for GCC's -mrelocatble-lib option\n\
--memb set PPC_EMB bit in ELF flags\n\
--mlittle, -mlittle-endian, -l, -le\n\
- generate code for a little endian machine\n\
--mbig, -mbig-endian, -b, -be\n\
- generate code for a big endian machine\n\
--msolaris generate code for Solaris\n\
--mno-solaris do not generate code for Solaris\n\
--V print assembler version number\n\
--Qy, -Qn ignored\n"));
-#endif
-}
-
-/* Set ppc_cpu if it is not already set. */
-
-static void
-ppc_set_cpu (void)
-{
- const char *default_os = TARGET_OS;
- const char *default_cpu = TARGET_CPU;
-
- if ((ppc_cpu & ~PPC_OPCODE_ANY) == 0)
- {
- if (ppc_obj64)
- ppc_cpu |= PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_64;
- else if (strncmp (default_os, "aix", 3) == 0
- && default_os[3] >= '4' && default_os[3] <= '9')
- ppc_cpu |= PPC_OPCODE_COMMON | PPC_OPCODE_32;
- else if (strncmp (default_os, "aix3", 4) == 0)
- ppc_cpu |= PPC_OPCODE_POWER | PPC_OPCODE_32;
- else if (strcmp (default_cpu, "rs6000") == 0)
- ppc_cpu |= PPC_OPCODE_POWER | PPC_OPCODE_32;
- else if (strncmp (default_cpu, "powerpc", 7) == 0)
- ppc_cpu |= PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32;
- else
- as_fatal (_("Unknown default cpu = %s, os = %s"),
- default_cpu, default_os);
- }
-}
-
-/* Figure out the BFD architecture to use. This function and ppc_mach
- are called well before md_begin, when the output file is opened. */
-
-enum bfd_architecture
-ppc_arch (void)
-{
- const char *default_cpu = TARGET_CPU;
- ppc_set_cpu ();
-
- if ((ppc_cpu & PPC_OPCODE_PPC) != 0)
- return bfd_arch_powerpc;
- else if ((ppc_cpu & PPC_OPCODE_POWER) != 0)
- return bfd_arch_rs6000;
- else if ((ppc_cpu & (PPC_OPCODE_COMMON | PPC_OPCODE_ANY)) != 0)
- {
- if (strcmp (default_cpu, "rs6000") == 0)
- return bfd_arch_rs6000;
- else if (strncmp (default_cpu, "powerpc", 7) == 0)
- return bfd_arch_powerpc;
- }
-
- as_fatal (_("Neither Power nor PowerPC opcodes were selected."));
- return bfd_arch_unknown;
-}
-
-unsigned long
-ppc_mach (void)
-{
- if (ppc_obj64)
- return bfd_mach_ppc64;
- else if (ppc_arch () == bfd_arch_rs6000)
- return bfd_mach_rs6k;
- else
- return bfd_mach_ppc;
-}
-
-extern char*
-ppc_target_format (void)
-{
-#ifdef OBJ_COFF
-#ifdef TE_PE
- return target_big_endian ? "pe-powerpc" : "pe-powerpcle";
-#elif TE_POWERMAC
- return "xcoff-powermac";
-#else
-# ifdef TE_AIX5
- return (ppc_obj64 ? "aix5coff64-rs6000" : "aixcoff-rs6000");
-# else
- return (ppc_obj64 ? "aixcoff64-rs6000" : "aixcoff-rs6000");
-# endif
-#endif
-#endif
-#ifdef OBJ_ELF
-# ifdef TE_VXWORKS
- return "elf32-powerpc-vxworks";
-# else
- return (target_big_endian
- ? (ppc_obj64 ? "elf64-powerpc" : "elf32-powerpc")
- : (ppc_obj64 ? "elf64-powerpcle" : "elf32-powerpcle"));
-# endif
-#endif
-}
-
-/* Insert opcodes and macros into hash tables. Called at startup and
- for .cpu pseudo. */
-
-static void
-ppc_setup_opcodes (void)
-{
- const struct powerpc_opcode *op;
- const struct powerpc_opcode *op_end;
- const struct powerpc_macro *macro;
- const struct powerpc_macro *macro_end;
- bfd_boolean bad_insn = FALSE;
-
- if (ppc_hash != NULL)
- hash_die (ppc_hash);
- if (ppc_macro_hash != NULL)
- hash_die (ppc_macro_hash);
-
- /* Insert the opcodes into a hash table. */
- ppc_hash = hash_new ();
-
- if (ENABLE_CHECKING)
- {
- unsigned int i;
-
- /* Check operand masks. Code here and in the disassembler assumes
- all the 1's in the mask are contiguous. */
- for (i = 0; i < num_powerpc_operands; ++i)
- {
- unsigned long mask = powerpc_operands[i].bitm;
- unsigned long right_bit;
- unsigned int j;
-
- right_bit = mask & -mask;
- mask += right_bit;
- right_bit = mask & -mask;
- if (mask != right_bit)
- {
- as_bad (_("powerpc_operands[%d].bitm invalid"), i);
- bad_insn = TRUE;
- }
- for (j = i + 1; j < num_powerpc_operands; ++j)
- if (memcmp (&powerpc_operands[i], &powerpc_operands[j],
- sizeof (powerpc_operands[0])) == 0)
- {
- as_bad (_("powerpc_operands[%d] duplicates powerpc_operands[%d]"),
- j, i);
- bad_insn = TRUE;
- }
- }
- }
-
- op_end = powerpc_opcodes + powerpc_num_opcodes;
- for (op = powerpc_opcodes; op < op_end; op++)
- {
- if (ENABLE_CHECKING)
- {
- const unsigned char *o;
- unsigned long omask = op->mask;
-
- if (op != powerpc_opcodes)
- {
- /* The major opcodes had better be sorted. Code in the
- disassembler assumes the insns are sorted according to
- major opcode. */
- if (PPC_OP (op[0].opcode) < PPC_OP (op[-1].opcode))
- {
- as_bad (_("major opcode is not sorted for %s"),
- op->name);
- bad_insn = TRUE;
- }
-
- /* Warn if the table isn't more strictly ordered.
- Unfortunately it doesn't seem possible to order the
- table on much more than the major opcode, which makes
- it difficult to implement a binary search in the
- disassembler. The problem is that we have multiple
- ways to disassemble instructions, and we usually want
- to choose a more specific form (with more bits set in
- the opcode) than a more general form. eg. all of the
- following are equivalent:
- bne label # opcode = 0x40820000, mask = 0xff830003
- bf 2,label # opcode = 0x40800000, mask = 0xff800003
- bc 4,2,label # opcode = 0x40000000, mask = 0xfc000003
-
- There are also cases where the table needs to be out
- of order to disassemble the correct instruction for
- processor variants. eg. "lhae" booke64 insn must be
- found before "ld" ppc64 insn. */
- else if (0)
- {
- unsigned long t1 = op[0].opcode;
- unsigned long t2 = op[-1].opcode;
-
- if (((t1 ^ t2) & 0xfc0007ff) == 0
- && (t1 & 0xfc0006df) == 0x7c000286)
- {
- /* spr field is split. */
- t1 = ((t1 & ~0x1ff800)
- | ((t1 & 0xf800) << 5) | ((t1 & 0x1f0000) >> 5));
- t2 = ((t2 & ~0x1ff800)
- | ((t2 & 0xf800) << 5) | ((t2 & 0x1f0000) >> 5));
- }
- if (t1 < t2)
- as_warn (_("%s (%08lx %08lx) after %s (%08lx %08lx)"),
- op[0].name, op[0].opcode, op[0].mask,
- op[-1].name, op[-1].opcode, op[-1].mask);
- }
- }
-
- /* The mask had better not trim off opcode bits. */
- if ((op->opcode & omask) != op->opcode)
- {
- as_bad (_("mask trims opcode bits for %s"),
- op->name);
- bad_insn = TRUE;
- }
-
- /* The operands must not overlap the opcode or each other. */
- for (o = op->operands; *o; ++o)
- if (*o >= num_powerpc_operands)
- {
- as_bad (_("operand index error for %s"),
- op->name);
- bad_insn = TRUE;
- }
- else
- {
- const struct powerpc_operand *operand = &powerpc_operands[*o];
- if (operand->shift >= 0)
- {
- unsigned long mask = operand->bitm << operand->shift;
- if (omask & mask)
- {
- as_bad (_("operand %d overlap in %s"),
- (int) (o - op->operands), op->name);
- bad_insn = TRUE;
- }
- omask |= mask;
- }
- }
- }
-
- if ((op->flags & ppc_cpu & ~(PPC_OPCODE_32 | PPC_OPCODE_64)) != 0
- && ((op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64)) == 0
- || ((op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64))
- == (ppc_cpu & (PPC_OPCODE_32 | PPC_OPCODE_64)))
- || (ppc_cpu & PPC_OPCODE_64_BRIDGE) != 0)
- /* Certain instructions (eg: extsw) do not exist in the
- 32-bit BookE instruction set, but they do exist in the
- 64-bit BookE instruction set, and other PPC instruction
- sets. Check to see if the opcode has the BOOKE64 flag set.
- If it does make sure that the target CPU is not the BookE32. */
- && ((op->flags & PPC_OPCODE_BOOKE64) == 0
- || (ppc_cpu & PPC_OPCODE_BOOKE64) == PPC_OPCODE_BOOKE64
- || (ppc_cpu & PPC_OPCODE_BOOKE) == 0)
- && ((op->flags & (PPC_OPCODE_POWER4 | PPC_OPCODE_NOPOWER4)) == 0
- || ((op->flags & PPC_OPCODE_POWER4)
- == (ppc_cpu & PPC_OPCODE_POWER4)))
- && ((op->flags & PPC_OPCODE_POWER5) == 0
- || ((op->flags & PPC_OPCODE_POWER5)
- == (ppc_cpu & PPC_OPCODE_POWER5)))
- && ((op->flags & PPC_OPCODE_POWER6) == 0
- || ((op->flags & PPC_OPCODE_POWER6)
- == (ppc_cpu & PPC_OPCODE_POWER6))))
- {
- const char *retval;
-
- retval = hash_insert (ppc_hash, op->name, (void *) op);
- if (retval != NULL)
- {
- /* Ignore Power duplicates for -m601. */
- if ((ppc_cpu & PPC_OPCODE_601) != 0
- && (op->flags & PPC_OPCODE_POWER) != 0)
- continue;
-
- as_bad (_("duplicate instruction %s"),
- op->name);
- bad_insn = TRUE;
- }
- }
- }
-
- if ((ppc_cpu & PPC_OPCODE_ANY) != 0)
- for (op = powerpc_opcodes; op < op_end; op++)
- hash_insert (ppc_hash, op->name, (void *) op);
-
- /* Insert the macros into a hash table. */
- ppc_macro_hash = hash_new ();
-
- macro_end = powerpc_macros + powerpc_num_macros;
- for (macro = powerpc_macros; macro < macro_end; macro++)
- {
- if ((macro->flags & ppc_cpu) != 0)
- {
- const char *retval;
-
- retval = hash_insert (ppc_macro_hash, macro->name, (void *) macro);
- if (retval != (const char *) NULL)
- {
- as_bad (_("duplicate macro %s"), macro->name);
- bad_insn = TRUE;
- }
- }
- }
-
- if (bad_insn)
- abort ();
-}
-
-/* This function is called when the assembler starts up. It is called
- after the options have been parsed and the output file has been
- opened. */
-
-void
-md_begin (void)
-{
- ppc_set_cpu ();
-
- ppc_cie_data_alignment = ppc_obj64 ? -8 : -4;
-
-#ifdef OBJ_ELF
- /* Set the ELF flags if desired. */
- if (ppc_flags && !msolaris)
- bfd_set_private_flags (stdoutput, ppc_flags);
-#endif
-
- ppc_setup_opcodes ();
-
- /* Tell the main code what the endianness is if it is not overridden
- by the user. */
- if (!set_target_endian)
- {
- set_target_endian = 1;
- target_big_endian = PPC_BIG_ENDIAN;
- }
-
-#ifdef OBJ_XCOFF
- ppc_coff_debug_section = coff_section_from_bfd_index (stdoutput, N_DEBUG);
-
- /* Create dummy symbols to serve as initial csects. This forces the
- text csects to precede the data csects. These symbols will not
- be output. */
- ppc_text_csects = symbol_make ("dummy\001");
- symbol_get_tc (ppc_text_csects)->within = ppc_text_csects;
- ppc_data_csects = symbol_make ("dummy\001");
- symbol_get_tc (ppc_data_csects)->within = ppc_data_csects;
-#endif
-
-#ifdef TE_PE
-
- ppc_current_section = text_section;
- ppc_previous_section = 0;
-
-#endif
-}
-
-void
-ppc_cleanup (void)
-{
-#ifdef OBJ_ELF
- if (ppc_apuinfo_list == NULL)
- return;
-
- /* Ok, so write the section info out. We have this layout:
-
- byte data what
- ---- ---- ----
- 0 8 length of "APUinfo\0"
- 4 (n*4) number of APU's (4 bytes each)
- 8 2 note type 2
- 12 "APUinfo\0" name
- 20 APU#1 first APU's info
- 24 APU#2 second APU's info
- ... ...
- */
- {
- char *p;
- asection *seg = now_seg;
- subsegT subseg = now_subseg;
- asection *apuinfo_secp = (asection *) NULL;
- unsigned int i;
-
- /* Create the .PPC.EMB.apuinfo section. */
- apuinfo_secp = subseg_new (".PPC.EMB.apuinfo", 0);
- bfd_set_section_flags (stdoutput,
- apuinfo_secp,
- SEC_HAS_CONTENTS | SEC_READONLY);
-
- p = frag_more (4);
- md_number_to_chars (p, (valueT) 8, 4);
-
- p = frag_more (4);
- md_number_to_chars (p, (valueT) ppc_apuinfo_num * 4, 4);
-
- p = frag_more (4);
- md_number_to_chars (p, (valueT) 2, 4);
-
- p = frag_more (8);
- strcpy (p, "APUinfo");
-
- for (i = 0; i < ppc_apuinfo_num; i++)
- {
- p = frag_more (4);
- md_number_to_chars (p, (valueT) ppc_apuinfo_list[i], 4);
- }
-
- frag_align (2, 0, 0);
-
- /* We probably can't restore the current segment, for there likely
- isn't one yet... */
- if (seg && subseg)
- subseg_set (seg, subseg);
- }
-#endif
-}
-
-/* Insert an operand value into an instruction. */
-
-static unsigned long
-ppc_insert_operand (unsigned long insn,
- const struct powerpc_operand *operand,
- offsetT val,
- ppc_cpu_t ppc_cpu,
- char *file,
- unsigned int line)
-{
- long min, max, right;
-
- max = operand->bitm;
- right = max & -max;
- min = 0;
-
- if ((operand->flags & PPC_OPERAND_SIGNED) != 0)
- {
- if ((operand->flags & PPC_OPERAND_SIGNOPT) == 0)
- max = (max >> 1) & -right;
- min = ~max & -right;
- }
-
- if ((operand->flags & PPC_OPERAND_PLUS1) != 0)
- max++;
-
- if ((operand->flags & PPC_OPERAND_NEGATIVE) != 0)
- {
- long tmp = min;
- min = -max;
- max = -tmp;
- }
-
- if (min <= max)
- {
- /* Some people write constants with the sign extension done by
- hand but only up to 32 bits. This shouldn't really be valid,
- but, to permit this code to assemble on a 64-bit host, we
- sign extend the 32-bit value to 64 bits if so doing makes the
- value valid. */
- if (val > max
- && (offsetT) (val - 0x80000000 - 0x80000000) >= min
- && (offsetT) (val - 0x80000000 - 0x80000000) <= max
- && ((val - 0x80000000 - 0x80000000) & (right - 1)) == 0)
- val = val - 0x80000000 - 0x80000000;
-
- /* Similarly, people write expressions like ~(1<<15), and expect
- this to be OK for a 32-bit unsigned value. */
- else if (val < min
- && (offsetT) (val + 0x80000000 + 0x80000000) >= min
- && (offsetT) (val + 0x80000000 + 0x80000000) <= max
- && ((val + 0x80000000 + 0x80000000) & (right - 1)) == 0)
- val = val + 0x80000000 + 0x80000000;
-
- else if (val < min
- || val > max
- || (val & (right - 1)) != 0)
- as_bad_value_out_of_range (_("operand"), val, min, max, file, line);
- }
-
- if (operand->insert)
- {
- const char *errmsg;
-
- errmsg = NULL;
- insn = (*operand->insert) (insn, (long) val, ppc_cpu, &errmsg);
- if (errmsg != (const char *) NULL)
- as_bad_where (file, line, errmsg);
- }
- else
- insn |= ((long) val & operand->bitm) << operand->shift;
-
- return insn;
-}
-
-
-#ifdef OBJ_ELF
-/* Parse @got, etc. and return the desired relocation. */
-static bfd_reloc_code_real_type
-ppc_elf_suffix (char **str_p, expressionS *exp_p)
-{
- struct map_bfd {
- char *string;
- unsigned int length : 8;
- unsigned int valid32 : 1;
- unsigned int valid64 : 1;
- unsigned int reloc;
- };
-
- char ident[20];
- char *str = *str_p;
- char *str2;
- int ch;
- int len;
- const struct map_bfd *ptr;
-
-#define MAP(str, reloc) { str, sizeof (str) - 1, 1, 1, reloc }
-#define MAP32(str, reloc) { str, sizeof (str) - 1, 1, 0, reloc }
-#define MAP64(str, reloc) { str, sizeof (str) - 1, 0, 1, reloc }
-
- static const struct map_bfd mapping[] = {
- MAP ("l", BFD_RELOC_LO16),
- MAP ("h", BFD_RELOC_HI16),
- MAP ("ha", BFD_RELOC_HI16_S),
- MAP ("brtaken", BFD_RELOC_PPC_B16_BRTAKEN),
- MAP ("brntaken", BFD_RELOC_PPC_B16_BRNTAKEN),
- MAP ("got", BFD_RELOC_16_GOTOFF),
- MAP ("got@l", BFD_RELOC_LO16_GOTOFF),
- MAP ("got@h", BFD_RELOC_HI16_GOTOFF),
- MAP ("got@ha", BFD_RELOC_HI16_S_GOTOFF),
- MAP ("plt@l", BFD_RELOC_LO16_PLTOFF),
- MAP ("plt@h", BFD_RELOC_HI16_PLTOFF),
- MAP ("plt@ha", BFD_RELOC_HI16_S_PLTOFF),
- MAP ("copy", BFD_RELOC_PPC_COPY),
- MAP ("globdat", BFD_RELOC_PPC_GLOB_DAT),
- MAP ("sectoff", BFD_RELOC_16_BASEREL),
- MAP ("sectoff@l", BFD_RELOC_LO16_BASEREL),
- MAP ("sectoff@h", BFD_RELOC_HI16_BASEREL),
- MAP ("sectoff@ha", BFD_RELOC_HI16_S_BASEREL),
- MAP ("tls", BFD_RELOC_PPC_TLS),
- MAP ("dtpmod", BFD_RELOC_PPC_DTPMOD),
- MAP ("dtprel", BFD_RELOC_PPC_DTPREL),
- MAP ("dtprel@l", BFD_RELOC_PPC_DTPREL16_LO),
- MAP ("dtprel@h", BFD_RELOC_PPC_DTPREL16_HI),
- MAP ("dtprel@ha", BFD_RELOC_PPC_DTPREL16_HA),
- MAP ("tprel", BFD_RELOC_PPC_TPREL),
- MAP ("tprel@l", BFD_RELOC_PPC_TPREL16_LO),
- MAP ("tprel@h", BFD_RELOC_PPC_TPREL16_HI),
- MAP ("tprel@ha", BFD_RELOC_PPC_TPREL16_HA),
- MAP ("got@tlsgd", BFD_RELOC_PPC_GOT_TLSGD16),
- MAP ("got@tlsgd@l", BFD_RELOC_PPC_GOT_TLSGD16_LO),
- MAP ("got@tlsgd@h", BFD_RELOC_PPC_GOT_TLSGD16_HI),
- MAP ("got@tlsgd@ha", BFD_RELOC_PPC_GOT_TLSGD16_HA),
- MAP ("got@tlsld", BFD_RELOC_PPC_GOT_TLSLD16),
- MAP ("got@tlsld@l", BFD_RELOC_PPC_GOT_TLSLD16_LO),
- MAP ("got@tlsld@h", BFD_RELOC_PPC_GOT_TLSLD16_HI),
- MAP ("got@tlsld@ha", BFD_RELOC_PPC_GOT_TLSLD16_HA),
- MAP ("got@dtprel", BFD_RELOC_PPC_GOT_DTPREL16),
- MAP ("got@dtprel@l", BFD_RELOC_PPC_GOT_DTPREL16_LO),
- MAP ("got@dtprel@h", BFD_RELOC_PPC_GOT_DTPREL16_HI),
- MAP ("got@dtprel@ha", BFD_RELOC_PPC_GOT_DTPREL16_HA),
- MAP ("got@tprel", BFD_RELOC_PPC_GOT_TPREL16),
- MAP ("got@tprel@l", BFD_RELOC_PPC_GOT_TPREL16_LO),
- MAP ("got@tprel@h", BFD_RELOC_PPC_GOT_TPREL16_HI),
- MAP ("got@tprel@ha", BFD_RELOC_PPC_GOT_TPREL16_HA),
- MAP32 ("fixup", BFD_RELOC_CTOR),
- MAP32 ("plt", BFD_RELOC_24_PLT_PCREL),
- MAP32 ("pltrel24", BFD_RELOC_24_PLT_PCREL),
- MAP32 ("local24pc", BFD_RELOC_PPC_LOCAL24PC),
- MAP32 ("local", BFD_RELOC_PPC_LOCAL24PC),
- MAP32 ("pltrel", BFD_RELOC_32_PLT_PCREL),
- MAP32 ("sdarel", BFD_RELOC_GPREL16),
- MAP32 ("naddr", BFD_RELOC_PPC_EMB_NADDR32),
- MAP32 ("naddr16", BFD_RELOC_PPC_EMB_NADDR16),
- MAP32 ("naddr@l", BFD_RELOC_PPC_EMB_NADDR16_LO),
- MAP32 ("naddr@h", BFD_RELOC_PPC_EMB_NADDR16_HI),
- MAP32 ("naddr@ha", BFD_RELOC_PPC_EMB_NADDR16_HA),
- MAP32 ("sdai16", BFD_RELOC_PPC_EMB_SDAI16),
- MAP32 ("sda2rel", BFD_RELOC_PPC_EMB_SDA2REL),
- MAP32 ("sda2i16", BFD_RELOC_PPC_EMB_SDA2I16),
- MAP32 ("sda21", BFD_RELOC_PPC_EMB_SDA21),
- MAP32 ("mrkref", BFD_RELOC_PPC_EMB_MRKREF),
- MAP32 ("relsect", BFD_RELOC_PPC_EMB_RELSEC16),
- MAP32 ("relsect@l", BFD_RELOC_PPC_EMB_RELST_LO),
- MAP32 ("relsect@h", BFD_RELOC_PPC_EMB_RELST_HI),
- MAP32 ("relsect@ha", BFD_RELOC_PPC_EMB_RELST_HA),
- MAP32 ("bitfld", BFD_RELOC_PPC_EMB_BIT_FLD),
- MAP32 ("relsda", BFD_RELOC_PPC_EMB_RELSDA),
- MAP32 ("xgot", BFD_RELOC_PPC_TOC16),
- MAP64 ("higher", BFD_RELOC_PPC64_HIGHER),
- MAP64 ("highera", BFD_RELOC_PPC64_HIGHER_S),
- MAP64 ("highest", BFD_RELOC_PPC64_HIGHEST),
- MAP64 ("highesta", BFD_RELOC_PPC64_HIGHEST_S),
- MAP64 ("tocbase", BFD_RELOC_PPC64_TOC),
- MAP64 ("toc", BFD_RELOC_PPC_TOC16),
- MAP64 ("toc@l", BFD_RELOC_PPC64_TOC16_LO),
- MAP64 ("toc@h", BFD_RELOC_PPC64_TOC16_HI),
- MAP64 ("toc@ha", BFD_RELOC_PPC64_TOC16_HA),
- MAP64 ("dtprel@higher", BFD_RELOC_PPC64_DTPREL16_HIGHER),
- MAP64 ("dtprel@highera", BFD_RELOC_PPC64_DTPREL16_HIGHERA),
- MAP64 ("dtprel@highest", BFD_RELOC_PPC64_DTPREL16_HIGHEST),
- MAP64 ("dtprel@highesta", BFD_RELOC_PPC64_DTPREL16_HIGHESTA),
- MAP64 ("tprel@higher", BFD_RELOC_PPC64_TPREL16_HIGHER),
- MAP64 ("tprel@highera", BFD_RELOC_PPC64_TPREL16_HIGHERA),
- MAP64 ("tprel@highest", BFD_RELOC_PPC64_TPREL16_HIGHEST),
- MAP64 ("tprel@highesta", BFD_RELOC_PPC64_TPREL16_HIGHESTA),
- { (char *) 0, 0, 0, 0, BFD_RELOC_UNUSED }
- };
-
- if (*str++ != '@')
- return BFD_RELOC_UNUSED;
-
- for (ch = *str, str2 = ident;
- (str2 < ident + sizeof (ident) - 1
- && (ISALNUM (ch) || ch == '@'));
- ch = *++str)
- {
- *str2++ = TOLOWER (ch);
- }
-
- *str2 = '\0';
- len = str2 - ident;
-
- ch = ident[0];
- for (ptr = &mapping[0]; ptr->length > 0; ptr++)
- if (ch == ptr->string[0]
- && len == ptr->length
- && memcmp (ident, ptr->string, ptr->length) == 0
- && (ppc_obj64 ? ptr->valid64 : ptr->valid32))
- {
- int reloc = ptr->reloc;
-
- if (!ppc_obj64)
- if (exp_p->X_add_number != 0
- && (reloc == (int) BFD_RELOC_16_GOTOFF
- || reloc == (int) BFD_RELOC_LO16_GOTOFF
- || reloc == (int) BFD_RELOC_HI16_GOTOFF
- || reloc == (int) BFD_RELOC_HI16_S_GOTOFF))
- as_warn (_("identifier+constant@got means identifier@got+constant"));
-
- /* Now check for identifier@suffix+constant. */
- if (*str == '-' || *str == '+')
- {
- char *orig_line = input_line_pointer;
- expressionS new_exp;
-
- input_line_pointer = str;
- expression (&new_exp);
- if (new_exp.X_op == O_constant)
- {
- exp_p->X_add_number += new_exp.X_add_number;
- str = input_line_pointer;
- }
-
- if (&input_line_pointer != str_p)
- input_line_pointer = orig_line;
- }
- *str_p = str;
-
- if (reloc == (int) BFD_RELOC_PPC64_TOC
- && exp_p->X_op == O_symbol
- && strcmp (S_GET_NAME (exp_p->X_add_symbol), ".TOC.") == 0)
- {
- /* Change the symbol so that the dummy .TOC. symbol can be
- omitted from the object file. */
- exp_p->X_add_symbol = &abs_symbol;
- }
-
- return (bfd_reloc_code_real_type) reloc;
- }
-
- return BFD_RELOC_UNUSED;
-}
-
-/* Like normal .long/.short/.word, except support @got, etc.
- Clobbers input_line_pointer, checks end-of-line. */
-static void
-ppc_elf_cons (int nbytes /* 1=.byte, 2=.word, 4=.long, 8=.llong */)
-{
- expressionS exp;
- bfd_reloc_code_real_type reloc;
-
- if (is_it_end_of_statement ())
- {
- demand_empty_rest_of_line ();
- return;
- }
-
- do
- {
- expression (&exp);
- if (exp.X_op == O_symbol
- && *input_line_pointer == '@'
- && (reloc = ppc_elf_suffix (&input_line_pointer,
- &exp)) != BFD_RELOC_UNUSED)
- {
- reloc_howto_type *reloc_howto;
- int size;
-
- reloc_howto = bfd_reloc_type_lookup (stdoutput, reloc);
- size = bfd_get_reloc_size (reloc_howto);
-
- if (size > nbytes)
- {
- as_bad (_("%s relocations do not fit in %d bytes\n"),
- reloc_howto->name, nbytes);
- }
- else
- {
- char *p;
- int offset;
-
- p = frag_more (nbytes);
- offset = 0;
- if (target_big_endian)
- offset = nbytes - size;
- fix_new_exp (frag_now, p - frag_now->fr_literal + offset, size,
- &exp, 0, reloc);
- }
- }
- else
- emit_expr (&exp, (unsigned int) nbytes);
- }
- while (*input_line_pointer++ == ',');
-
- /* Put terminator back into stream. */
- input_line_pointer--;
- demand_empty_rest_of_line ();
-}
-
-/* Solaris pseduo op to change to the .rodata section. */
-static void
-ppc_elf_rdata (int xxx)
-{
- char *save_line = input_line_pointer;
- static char section[] = ".rodata\n";
-
- /* Just pretend this is .section .rodata */
- input_line_pointer = section;
- obj_elf_section (xxx);
-
- input_line_pointer = save_line;
-}
-
-/* Pseudo op to make file scope bss items. */
-static void
-ppc_elf_lcomm (int xxx ATTRIBUTE_UNUSED)
-{
- char *name;
- char c;
- char *p;
- offsetT size;
- symbolS *symbolP;
- offsetT align;
- segT old_sec;
- int old_subsec;
- char *pfrag;
- int align2;
-
- name = input_line_pointer;
- c = get_symbol_end ();
-
- /* just after name is now '\0'. */
- p = input_line_pointer;
- *p = c;
- SKIP_WHITESPACE ();
- if (*input_line_pointer != ',')
- {
- as_bad (_("Expected comma after symbol-name: rest of line ignored."));
- ignore_rest_of_line ();
- return;
- }
-
- input_line_pointer++; /* skip ',' */
- if ((size = get_absolute_expression ()) < 0)
- {
- as_warn (_(".COMMon length (%ld.) <0! Ignored."), (long) size);
- ignore_rest_of_line ();
- return;
- }
-
- /* The third argument to .lcomm is the alignment. */
- if (*input_line_pointer != ',')
- align = 8;
- else
- {
- ++input_line_pointer;
- align = get_absolute_expression ();
- if (align <= 0)
- {
- as_warn (_("ignoring bad alignment"));
- align = 8;
- }
- }
-
- *p = 0;
- symbolP = symbol_find_or_make (name);
- *p = c;
-
- if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP))
- {
- as_bad (_("Ignoring attempt to re-define symbol `%s'."),
- S_GET_NAME (symbolP));
- ignore_rest_of_line ();
- return;
- }
-
- if (S_GET_VALUE (symbolP) && S_GET_VALUE (symbolP) != (valueT) size)
- {
- as_bad (_("Length of .lcomm \"%s\" is already %ld. Not changed to %ld."),
- S_GET_NAME (symbolP),
- (long) S_GET_VALUE (symbolP),
- (long) size);
-
- ignore_rest_of_line ();
- return;
- }
-
- /* Allocate_bss. */
- old_sec = now_seg;
- old_subsec = now_subseg;
- if (align)
- {
- /* Convert to a power of 2 alignment. */
- for (align2 = 0; (align & 1) == 0; align >>= 1, ++align2);
- if (align != 1)
- {
- as_bad (_("Common alignment not a power of 2"));
- ignore_rest_of_line ();
- return;
- }
- }
- else
- align2 = 0;
-
- record_alignment (bss_section, align2);
- subseg_set (bss_section, 0);
- if (align2)
- frag_align (align2, 0, 0);
- if (S_GET_SEGMENT (symbolP) == bss_section)
- symbol_get_frag (symbolP)->fr_symbol = 0;
- symbol_set_frag (symbolP, frag_now);
- pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, size,
- (char *) 0);
- *pfrag = 0;
- S_SET_SIZE (symbolP, size);
- S_SET_SEGMENT (symbolP, bss_section);
- subseg_set (old_sec, old_subsec);
- demand_empty_rest_of_line ();
-}
-
-/* Validate any relocations emitted for -mrelocatable, possibly adding
- fixups for word relocations in writable segments, so we can adjust
- them at runtime. */
-static void
-ppc_elf_validate_fix (fixS *fixp, segT seg)
-{
- if (fixp->fx_done || fixp->fx_pcrel)
- return;
-
- switch (shlib)
- {
- case SHLIB_NONE:
- case SHLIB_PIC:
- return;
-
- case SHLIB_MRELOCATABLE:
- if (fixp->fx_r_type <= BFD_RELOC_UNUSED
- && fixp->fx_r_type != BFD_RELOC_16_GOTOFF
- && fixp->fx_r_type != BFD_RELOC_HI16_GOTOFF
- && fixp->fx_r_type != BFD_RELOC_LO16_GOTOFF
- && fixp->fx_r_type != BFD_RELOC_HI16_S_GOTOFF
- && fixp->fx_r_type != BFD_RELOC_16_BASEREL
- && fixp->fx_r_type != BFD_RELOC_LO16_BASEREL
- && fixp->fx_r_type != BFD_RELOC_HI16_BASEREL
- && fixp->fx_r_type != BFD_RELOC_HI16_S_BASEREL
- && (seg->flags & SEC_LOAD) != 0
- && strcmp (segment_name (seg), ".got2") != 0
- && strcmp (segment_name (seg), ".dtors") != 0
- && strcmp (segment_name (seg), ".ctors") != 0
- && strcmp (segment_name (seg), ".fixup") != 0
- && strcmp (segment_name (seg), ".gcc_except_table") != 0
- && strcmp (segment_name (seg), ".eh_frame") != 0
- && strcmp (segment_name (seg), ".ex_shared") != 0)
- {
- if ((seg->flags & (SEC_READONLY | SEC_CODE)) != 0
- || fixp->fx_r_type != BFD_RELOC_CTOR)
- {
- as_bad_where (fixp->fx_file, fixp->fx_line,
- _("Relocation cannot be done when using -mrelocatable"));
- }
- }
- return;
- }
-}
-
-/* Prevent elf_frob_file_before_adjust removing a weak undefined
- function descriptor sym if the corresponding code sym is used. */
-
-void
-ppc_frob_file_before_adjust (void)
-{
- symbolS *symp;
- asection *toc;
-
- if (!ppc_obj64)
- return;
-
- for (symp = symbol_rootP; symp; symp = symbol_next (symp))
- {
- const char *name;
- char *dotname;
- symbolS *dotsym;
- size_t len;
-
- name = S_GET_NAME (symp);
- if (name[0] == '.')
- continue;
-
- if (! S_IS_WEAK (symp)
- || S_IS_DEFINED (symp))
- continue;
-
- len = strlen (name) + 1;
- dotname = xmalloc (len + 1);
- dotname[0] = '.';
- memcpy (dotname + 1, name, len);
- dotsym = symbol_find_noref (dotname, 1);
- free (dotname);
- if (dotsym != NULL && (symbol_used_p (dotsym)
- || symbol_used_in_reloc_p (dotsym)))
- symbol_mark_used (symp);
-
- }
-
- toc = bfd_get_section_by_name (stdoutput, ".toc");
- if (toc != NULL
- && bfd_section_size (stdoutput, toc) > 0x10000)
- as_warn (_("TOC section size exceeds 64k"));
-
- /* Don't emit .TOC. symbol. */
- symp = symbol_find (".TOC.");
- if (symp != NULL)
- symbol_remove (symp, &symbol_rootP, &symbol_lastP);
-}
-#endif /* OBJ_ELF */
-
-#ifdef TE_PE
-
-/*
- * Summary of parse_toc_entry.
- *
- * in: Input_line_pointer points to the '[' in one of:
- *
- * [toc] [tocv] [toc32] [toc64]
- *
- * Anything else is an error of one kind or another.
- *
- * out:
- * return value: success or failure
- * toc_kind: kind of toc reference
- * input_line_pointer:
- * success: first char after the ']'
- * failure: unchanged
- *
- * settings:
- *
- * [toc] - rv == success, toc_kind = default_toc
- * [tocv] - rv == success, toc_kind = data_in_toc
- * [toc32] - rv == success, toc_kind = must_be_32
- * [toc64] - rv == success, toc_kind = must_be_64
- *
- */
-
-enum toc_size_qualifier
-{
- default_toc, /* The toc cell constructed should be the system default size */
- data_in_toc, /* This is a direct reference to a toc cell */
- must_be_32, /* The toc cell constructed must be 32 bits wide */
- must_be_64 /* The toc cell constructed must be 64 bits wide */
-};
-
-static int
-parse_toc_entry (enum toc_size_qualifier *toc_kind)
-{
- char *start;
- char *toc_spec;
- char c;
- enum toc_size_qualifier t;
-
- /* Save the input_line_pointer. */
- start = input_line_pointer;
-
- /* Skip over the '[' , and whitespace. */
- ++input_line_pointer;
- SKIP_WHITESPACE ();
-
- /* Find the spelling of the operand. */
- toc_spec = input_line_pointer;
- c = get_symbol_end ();
-
- if (strcmp (toc_spec, "toc") == 0)
- {
- t = default_toc;
- }
- else if (strcmp (toc_spec, "tocv") == 0)
- {
- t = data_in_toc;
- }
- else if (strcmp (toc_spec, "toc32") == 0)
- {
- t = must_be_32;
- }
- else if (strcmp (toc_spec, "toc64") == 0)
- {
- t = must_be_64;
- }
- else
- {
- as_bad (_("syntax error: invalid toc specifier `%s'"), toc_spec);
- *input_line_pointer = c;
- input_line_pointer = start;
- return 0;
- }
-
- /* Now find the ']'. */
- *input_line_pointer = c;
-
- SKIP_WHITESPACE (); /* leading whitespace could be there. */
- c = *input_line_pointer++; /* input_line_pointer->past char in c. */
-
- if (c != ']')
- {
- as_bad (_("syntax error: expected `]', found `%c'"), c);
- input_line_pointer = start;
- return 0;
- }
-
- *toc_kind = t;
- return 1;
-}
-#endif
-
-
-#ifdef OBJ_ELF
-#define APUID(a,v) ((((a) & 0xffff) << 16) | ((v) & 0xffff))
-static void
-ppc_apuinfo_section_add (unsigned int apu, unsigned int version)
-{
- unsigned int i;
-
- /* Check we don't already exist. */
- for (i = 0; i < ppc_apuinfo_num; i++)
- if (ppc_apuinfo_list[i] == APUID (apu, version))
- return;
-
- if (ppc_apuinfo_num == ppc_apuinfo_num_alloc)
- {
- if (ppc_apuinfo_num_alloc == 0)
- {
- ppc_apuinfo_num_alloc = 4;
- ppc_apuinfo_list = (unsigned long *)
- xmalloc (sizeof (unsigned long) * ppc_apuinfo_num_alloc);
- }
- else
- {
- ppc_apuinfo_num_alloc += 4;
- ppc_apuinfo_list = (unsigned long *) xrealloc (ppc_apuinfo_list,
- sizeof (unsigned long) * ppc_apuinfo_num_alloc);
- }
- }
- ppc_apuinfo_list[ppc_apuinfo_num++] = APUID (apu, version);
-}
-#undef APUID
-#endif
-
-
-/* We need to keep a list of fixups. We can't simply generate them as
- we go, because that would require us to first create the frag, and
- that would screw up references to ``.''. */
-
-struct ppc_fixup
-{
- expressionS exp;
- int opindex;
- bfd_reloc_code_real_type reloc;
-};
-
-#define MAX_INSN_FIXUPS (5)
-
-/* This routine is called for each instruction to be assembled. */
-
-void
-md_assemble (char *str)
-{
- char *s;
- const struct powerpc_opcode *opcode;
- unsigned long insn;
- const unsigned char *opindex_ptr;
- int skip_optional;
- int need_paren;
- int next_opindex;
- struct ppc_fixup fixups[MAX_INSN_FIXUPS];
- int fc;
- char *f;
- int addr_mod;
- int i;
-#ifdef OBJ_ELF
- bfd_reloc_code_real_type reloc;
-#endif
-
- /* Get the opcode. */
- for (s = str; *s != '\0' && ! ISSPACE (*s); s++)
- ;
- if (*s != '\0')
- *s++ = '\0';
-
- /* Look up the opcode in the hash table. */
- opcode = (const struct powerpc_opcode *) hash_find (ppc_hash, str);
- if (opcode == (const struct powerpc_opcode *) NULL)
- {
- const struct powerpc_macro *macro;
-
- macro = (const struct powerpc_macro *) hash_find (ppc_macro_hash, str);
- if (macro == (const struct powerpc_macro *) NULL)
- as_bad (_("Unrecognized opcode: `%s'"), str);
- else
- ppc_macro (s, macro);
-
- return;
- }
-
- insn = opcode->opcode;
-
- str = s;
- while (ISSPACE (*str))
- ++str;
-
- /* PowerPC operands are just expressions. The only real issue is
- that a few operand types are optional. All cases which might use
- an optional operand separate the operands only with commas (in some
- cases parentheses are used, as in ``lwz 1,0(1)'' but such cases never
- have optional operands). Most instructions with optional operands
- have only one. Those that have more than one optional operand can
- take either all their operands or none. So, before we start seriously
- parsing the operands, we check to see if we have optional operands,
- and if we do, we count the number of commas to see which operands
- have been omitted. */
- skip_optional = 0;
- for (opindex_ptr = opcode->operands; *opindex_ptr != 0; opindex_ptr++)
- {
- const struct powerpc_operand *operand;
-
- operand = &powerpc_operands[*opindex_ptr];
- if ((operand->flags & PPC_OPERAND_OPTIONAL) != 0)
- {
- unsigned int opcount;
- unsigned int num_operands_expected;
- unsigned int i;
-
- /* There is an optional operand. Count the number of
- commas in the input line. */
- if (*str == '\0')
- opcount = 0;
- else
- {
- opcount = 1;
- s = str;
- while ((s = strchr (s, ',')) != (char *) NULL)
- {
- ++opcount;
- ++s;
- }
- }
-
- /* Compute the number of expected operands.
- Do not count fake operands. */
- for (num_operands_expected = 0, i = 0; opcode->operands[i]; i ++)
- if ((powerpc_operands [opcode->operands[i]].flags & PPC_OPERAND_FAKE) == 0)
- ++ num_operands_expected;
-
- /* If there are fewer operands in the line then are called
- for by the instruction, we want to skip the optional
- operands. */
- if (opcount < num_operands_expected)
- skip_optional = 1;
-
- break;
- }
- }
-
- /* Gather the operands. */
- need_paren = 0;
- next_opindex = 0;
- fc = 0;
- for (opindex_ptr = opcode->operands; *opindex_ptr != 0; opindex_ptr++)
- {
- const struct powerpc_operand *operand;
- const char *errmsg;
- char *hold;
- expressionS ex;
- char endc;
-
- if (next_opindex == 0)
- operand = &powerpc_operands[*opindex_ptr];
- else
- {
- operand = &powerpc_operands[next_opindex];
- next_opindex = 0;
- }
- errmsg = NULL;
-
- /* If this is a fake operand, then we do not expect anything
- from the input. */
- if ((operand->flags & PPC_OPERAND_FAKE) != 0)
- {
- insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg);
- if (errmsg != (const char *) NULL)
- as_bad (errmsg);
- continue;
- }
-
- /* If this is an optional operand, and we are skipping it, just
- insert a zero. */
- if ((operand->flags & PPC_OPERAND_OPTIONAL) != 0
- && skip_optional)
- {
- if (operand->insert)
- {
- insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg);
- if (errmsg != (const char *) NULL)
- as_bad (errmsg);
- }
- if ((operand->flags & PPC_OPERAND_NEXT) != 0)
- next_opindex = *opindex_ptr + 1;
- continue;
- }
-
- /* Gather the operand. */
- hold = input_line_pointer;
- input_line_pointer = str;
-
-#ifdef TE_PE
- if (*input_line_pointer == '[')
- {
- /* We are expecting something like the second argument here:
- *
- * lwz r4,[toc].GS.0.static_int(rtoc)
- * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- * The argument following the `]' must be a symbol name, and the
- * register must be the toc register: 'rtoc' or '2'
- *
- * The effect is to 0 as the displacement field
- * in the instruction, and issue an IMAGE_REL_PPC_TOCREL16 (or
- * the appropriate variation) reloc against it based on the symbol.
- * The linker will build the toc, and insert the resolved toc offset.
- *
- * Note:
- * o The size of the toc entry is currently assumed to be
- * 32 bits. This should not be assumed to be a hard coded
- * number.
- * o In an effort to cope with a change from 32 to 64 bits,
- * there are also toc entries that are specified to be
- * either 32 or 64 bits:
- * lwz r4,[toc32].GS.0.static_int(rtoc)
- * lwz r4,[toc64].GS.0.static_int(rtoc)
- * These demand toc entries of the specified size, and the
- * instruction probably requires it.
- */
-
- int valid_toc;
- enum toc_size_qualifier toc_kind;
- bfd_reloc_code_real_type toc_reloc;
-
- /* Go parse off the [tocXX] part. */
- valid_toc = parse_toc_entry (&toc_kind);
-
- if (!valid_toc)
- {
- /* Note: message has already been issued.
- FIXME: what sort of recovery should we do?
- demand_rest_of_line (); return; ? */
- }
-
- /* Now get the symbol following the ']'. */
- expression (&ex);
-
- switch (toc_kind)
- {
- case default_toc:
- /* In this case, we may not have seen the symbol yet,
- since it is allowed to appear on a .extern or .globl
- or just be a label in the .data section. */
- toc_reloc = BFD_RELOC_PPC_TOC16;
- break;
- case data_in_toc:
- /* 1. The symbol must be defined and either in the toc
- section, or a global.
- 2. The reloc generated must have the TOCDEFN flag set
- in upper bit mess of the reloc type.
- FIXME: It's a little confusing what the tocv
- qualifier can be used for. At the very least, I've
- seen three uses, only one of which I'm sure I can
- explain. */
- if (ex.X_op == O_symbol)
- {
- assert (ex.X_add_symbol != NULL);
- if (symbol_get_bfdsym (ex.X_add_symbol)->section
- != tocdata_section)
- {
- as_bad (_("[tocv] symbol is not a toc symbol"));
- }
- }
-
- toc_reloc = BFD_RELOC_PPC_TOC16;
- break;
- case must_be_32:
- /* FIXME: these next two specifically specify 32/64 bit
- toc entries. We don't support them today. Is this
- the right way to say that? */
- toc_reloc = BFD_RELOC_UNUSED;
- as_bad (_("Unimplemented toc32 expression modifier"));
- break;
- case must_be_64:
- /* FIXME: see above. */
- toc_reloc = BFD_RELOC_UNUSED;
- as_bad (_("Unimplemented toc64 expression modifier"));
- break;
- default:
- fprintf (stderr,
- _("Unexpected return value [%d] from parse_toc_entry!\n"),
- toc_kind);
- abort ();
- break;
- }
-
- /* We need to generate a fixup for this expression. */
- if (fc >= MAX_INSN_FIXUPS)
- as_fatal (_("too many fixups"));
-
- fixups[fc].reloc = toc_reloc;
- fixups[fc].exp = ex;
- fixups[fc].opindex = *opindex_ptr;
- ++fc;
-
- /* Ok. We've set up the fixup for the instruction. Now make it
- look like the constant 0 was found here. */
- ex.X_unsigned = 1;
- ex.X_op = O_constant;
- ex.X_add_number = 0;
- ex.X_add_symbol = NULL;
- ex.X_op_symbol = NULL;
- }
-
- else
-#endif /* TE_PE */
- {
- if ((reg_names_p && (operand->flags & PPC_OPERAND_CR) != 0)
- || !register_name (&ex))
- {
- char save_lex = lex_type['%'];
-
- if ((operand->flags & PPC_OPERAND_CR) != 0)
- {
- cr_operand = TRUE;
- lex_type['%'] |= LEX_BEGIN_NAME;
- }
- expression (&ex);
- cr_operand = FALSE;
- lex_type['%'] = save_lex;
- }
- }
-
- str = input_line_pointer;
- input_line_pointer = hold;
-
- if (ex.X_op == O_illegal)
- as_bad (_("illegal operand"));
- else if (ex.X_op == O_absent)
- as_bad (_("missing operand"));
- else if (ex.X_op == O_register)
- {
- insn = ppc_insert_operand (insn, operand, ex.X_add_number,
- ppc_cpu, (char *) NULL, 0);
- }
- else if (ex.X_op == O_constant)
- {
-#ifdef OBJ_ELF
- /* Allow @HA, @L, @H on constants. */
- char *orig_str = str;
-
- if ((reloc = ppc_elf_suffix (&str, &ex)) != BFD_RELOC_UNUSED)
- switch (reloc)
- {
- default:
- str = orig_str;
- break;
-
- case BFD_RELOC_LO16:
- /* X_unsigned is the default, so if the user has done
- something which cleared it, we always produce a
- signed value. */
- if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED))
- ex.X_add_number &= 0xffff;
- else
- ex.X_add_number = SEX16 (ex.X_add_number);
- break;
-
- case BFD_RELOC_HI16:
- if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED))
- ex.X_add_number = PPC_HI (ex.X_add_number);
- else
- ex.X_add_number = SEX16 (PPC_HI (ex.X_add_number));
- break;
-
- case BFD_RELOC_HI16_S:
- if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED))
- ex.X_add_number = PPC_HA (ex.X_add_number);
- else
- ex.X_add_number = SEX16 (PPC_HA (ex.X_add_number));
- break;
-
- case BFD_RELOC_PPC64_HIGHER:
- if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED))
- ex.X_add_number = PPC_HIGHER (ex.X_add_number);
- else
- ex.X_add_number = SEX16 (PPC_HIGHER (ex.X_add_number));
- break;
-
- case BFD_RELOC_PPC64_HIGHER_S:
- if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED))
- ex.X_add_number = PPC_HIGHERA (ex.X_add_number);
- else
- ex.X_add_number = SEX16 (PPC_HIGHERA (ex.X_add_number));
- break;
-
- case BFD_RELOC_PPC64_HIGHEST:
- if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED))
- ex.X_add_number = PPC_HIGHEST (ex.X_add_number);
- else
- ex.X_add_number = SEX16 (PPC_HIGHEST (ex.X_add_number));
- break;
-
- case BFD_RELOC_PPC64_HIGHEST_S:
- if (ex.X_unsigned && ! (operand->flags & PPC_OPERAND_SIGNED))
- ex.X_add_number = PPC_HIGHESTA (ex.X_add_number);
- else
- ex.X_add_number = SEX16 (PPC_HIGHESTA (ex.X_add_number));
- break;
- }
-#endif /* OBJ_ELF */
- insn = ppc_insert_operand (insn, operand, ex.X_add_number,
- ppc_cpu, (char *) NULL, 0);
- }
-#ifdef OBJ_ELF
- else if ((reloc = ppc_elf_suffix (&str, &ex)) != BFD_RELOC_UNUSED)
- {
- /* Some TLS tweaks. */
- switch (reloc)
- {
- default:
- break;
- case BFD_RELOC_PPC_TLS:
- insn = ppc_insert_operand (insn, operand, ppc_obj64 ? 13 : 2,
- ppc_cpu, (char *) NULL, 0);
- break;
- /* We'll only use the 32 (or 64) bit form of these relocations
- in constants. Instructions get the 16 bit form. */
- case BFD_RELOC_PPC_DTPREL:
- reloc = BFD_RELOC_PPC_DTPREL16;
- break;
- case BFD_RELOC_PPC_TPREL:
- reloc = BFD_RELOC_PPC_TPREL16;
- break;
- }
-
- /* For the absolute forms of branches, convert the PC
- relative form back into the absolute. */
- if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0)
- {
- switch (reloc)
- {
- case BFD_RELOC_PPC_B26:
- reloc = BFD_RELOC_PPC_BA26;
- break;
- case BFD_RELOC_PPC_B16:
- reloc = BFD_RELOC_PPC_BA16;
- break;
- case BFD_RELOC_PPC_B16_BRTAKEN:
- reloc = BFD_RELOC_PPC_BA16_BRTAKEN;
- break;
- case BFD_RELOC_PPC_B16_BRNTAKEN:
- reloc = BFD_RELOC_PPC_BA16_BRNTAKEN;
- break;
- default:
- break;
- }
- }
-
- if (ppc_obj64
- && (operand->flags & (PPC_OPERAND_DS | PPC_OPERAND_DQ)) != 0)
- {
- switch (reloc)
- {
- case BFD_RELOC_16:
- reloc = BFD_RELOC_PPC64_ADDR16_DS;
- break;
- case BFD_RELOC_LO16:
- reloc = BFD_RELOC_PPC64_ADDR16_LO_DS;
- break;
- case BFD_RELOC_16_GOTOFF:
- reloc = BFD_RELOC_PPC64_GOT16_DS;
- break;
- case BFD_RELOC_LO16_GOTOFF:
- reloc = BFD_RELOC_PPC64_GOT16_LO_DS;
- break;
- case BFD_RELOC_LO16_PLTOFF:
- reloc = BFD_RELOC_PPC64_PLT16_LO_DS;
- break;
- case BFD_RELOC_16_BASEREL:
- reloc = BFD_RELOC_PPC64_SECTOFF_DS;
- break;
- case BFD_RELOC_LO16_BASEREL:
- reloc = BFD_RELOC_PPC64_SECTOFF_LO_DS;
- break;
- case BFD_RELOC_PPC_TOC16:
- reloc = BFD_RELOC_PPC64_TOC16_DS;
- break;
- case BFD_RELOC_PPC64_TOC16_LO:
- reloc = BFD_RELOC_PPC64_TOC16_LO_DS;
- break;
- case BFD_RELOC_PPC64_PLTGOT16:
- reloc = BFD_RELOC_PPC64_PLTGOT16_DS;
- break;
- case BFD_RELOC_PPC64_PLTGOT16_LO:
- reloc = BFD_RELOC_PPC64_PLTGOT16_LO_DS;
- break;
- case BFD_RELOC_PPC_DTPREL16:
- reloc = BFD_RELOC_PPC64_DTPREL16_DS;
- break;
- case BFD_RELOC_PPC_DTPREL16_LO:
- reloc = BFD_RELOC_PPC64_DTPREL16_LO_DS;
- break;
- case BFD_RELOC_PPC_TPREL16:
- reloc = BFD_RELOC_PPC64_TPREL16_DS;
- break;
- case BFD_RELOC_PPC_TPREL16_LO:
- reloc = BFD_RELOC_PPC64_TPREL16_LO_DS;
- break;
- case BFD_RELOC_PPC_GOT_DTPREL16:
- case BFD_RELOC_PPC_GOT_DTPREL16_LO:
- case BFD_RELOC_PPC_GOT_TPREL16:
- case BFD_RELOC_PPC_GOT_TPREL16_LO:
- break;
- default:
- as_bad (_("unsupported relocation for DS offset field"));
- break;
- }
- }
-
- /* We need to generate a fixup for this expression. */
- if (fc >= MAX_INSN_FIXUPS)
- as_fatal (_("too many fixups"));
- fixups[fc].exp = ex;
- fixups[fc].opindex = 0;
- fixups[fc].reloc = reloc;
- ++fc;
- }
-#endif /* OBJ_ELF */
-
- else
- {
- /* We need to generate a fixup for this expression. */
- if (fc >= MAX_INSN_FIXUPS)
- as_fatal (_("too many fixups"));
- fixups[fc].exp = ex;
- fixups[fc].opindex = *opindex_ptr;
- fixups[fc].reloc = BFD_RELOC_UNUSED;
- ++fc;
- }
-
- if (need_paren)
- {
- endc = ')';
- need_paren = 0;
- /* If expecting more operands, then we want to see "),". */
- if (*str == endc && opindex_ptr[1] != 0)
- {
- do
- ++str;
- while (ISSPACE (*str));
- endc = ',';
- }
- }
- else if ((operand->flags & PPC_OPERAND_PARENS) != 0)
- {
- endc = '(';
- need_paren = 1;
- }
- else
- endc = ',';
-
- /* The call to expression should have advanced str past any
- whitespace. */
- if (*str != endc
- && (endc != ',' || *str != '\0'))
- {
- as_bad (_("syntax error; found `%c' but expected `%c'"), *str, endc);
- break;
- }
-
- if (*str != '\0')
- ++str;
- }
-
- while (ISSPACE (*str))
- ++str;
-
- if (*str != '\0')
- as_bad (_("junk at end of line: `%s'"), str);
-
-#ifdef OBJ_ELF
- /* Do we need/want a APUinfo section? */
- if (ppc_cpu & (PPC_OPCODE_SPE
- | PPC_OPCODE_ISEL | PPC_OPCODE_EFS
- | PPC_OPCODE_BRLOCK | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK
- | PPC_OPCODE_RFMCI))
- {
- /* These are all version "1". */
- if (opcode->flags & PPC_OPCODE_SPE)
- ppc_apuinfo_section_add (PPC_APUINFO_SPE, 1);
- if (opcode->flags & PPC_OPCODE_ISEL)
- ppc_apuinfo_section_add (PPC_APUINFO_ISEL, 1);
- if (opcode->flags & PPC_OPCODE_EFS)
- ppc_apuinfo_section_add (PPC_APUINFO_EFS, 1);
- if (opcode->flags & PPC_OPCODE_BRLOCK)
- ppc_apuinfo_section_add (PPC_APUINFO_BRLOCK, 1);
- if (opcode->flags & PPC_OPCODE_PMR)
- ppc_apuinfo_section_add (PPC_APUINFO_PMR, 1);
- if (opcode->flags & PPC_OPCODE_CACHELCK)
- ppc_apuinfo_section_add (PPC_APUINFO_CACHELCK, 1);
- if (opcode->flags & PPC_OPCODE_RFMCI)
- ppc_apuinfo_section_add (PPC_APUINFO_RFMCI, 1);
- }
-#endif
-
- /* Write out the instruction. */
- f = frag_more (4);
- addr_mod = frag_now_fix () & 3;
- if (frag_now->has_code && frag_now->insn_addr != addr_mod)
- as_bad (_("instruction address is not a multiple of 4"));
- frag_now->insn_addr = addr_mod;
- frag_now->has_code = 1;
- md_number_to_chars (f, insn, 4);
-
-#ifdef OBJ_ELF
- dwarf2_emit_insn (4);
-#endif
-
- /* Create any fixups. At this point we do not use a
- bfd_reloc_code_real_type, but instead just use the
- BFD_RELOC_UNUSED plus the operand index. This lets us easily
- handle fixups for any operand type, although that is admittedly
- not a very exciting feature. We pick a BFD reloc type in
- md_apply_fix. */
- for (i = 0; i < fc; i++)
- {
- const struct powerpc_operand *operand;
-
- operand = &powerpc_operands[fixups[i].opindex];
- if (fixups[i].reloc != BFD_RELOC_UNUSED)
- {
- reloc_howto_type *reloc_howto;
- int size;
- int offset;
- fixS *fixP;
-
- reloc_howto = bfd_reloc_type_lookup (stdoutput, fixups[i].reloc);
- if (!reloc_howto)
- abort ();
-
- size = bfd_get_reloc_size (reloc_howto);
- offset = target_big_endian ? (4 - size) : 0;
-
- if (size < 1 || size > 4)
- abort ();
-
- fixP = fix_new_exp (frag_now,
- f - frag_now->fr_literal + offset,
- size,
- &fixups[i].exp,
- reloc_howto->pc_relative,
- fixups[i].reloc);
-
- /* Turn off complaints that the addend is too large for things like
- foo+100000@ha. */
- switch (fixups[i].reloc)
- {
- case BFD_RELOC_16_GOTOFF:
- case BFD_RELOC_PPC_TOC16:
- case BFD_RELOC_LO16:
- case BFD_RELOC_HI16:
- case BFD_RELOC_HI16_S:
-#ifdef OBJ_ELF
- case BFD_RELOC_PPC64_HIGHER:
- case BFD_RELOC_PPC64_HIGHER_S:
- case BFD_RELOC_PPC64_HIGHEST:
- case BFD_RELOC_PPC64_HIGHEST_S:
-#endif
- fixP->fx_no_overflow = 1;
- break;
- default:
- break;
- }
- }
- else
- fix_new_exp (frag_now,
- f - frag_now->fr_literal,
- 4,
- &fixups[i].exp,
- (operand->flags & PPC_OPERAND_RELATIVE) != 0,
- ((bfd_reloc_code_real_type)
- (fixups[i].opindex + (int) BFD_RELOC_UNUSED)));
- }
-}
-
-/* Handle a macro. Gather all the operands, transform them as
- described by the macro, and call md_assemble recursively. All the
- operands are separated by commas; we don't accept parentheses
- around operands here. */
-
-static void
-ppc_macro (char *str, const struct powerpc_macro *macro)
-{
- char *operands[10];
- unsigned int count;
- char *s;
- unsigned int len;
- const char *format;
- unsigned int arg;
- char *send;
- char *complete;
-
- /* Gather the users operands into the operands array. */
- count = 0;
- s = str;
- while (1)
- {
- if (count >= sizeof operands / sizeof operands[0])
- break;
- operands[count++] = s;
- s = strchr (s, ',');
- if (s == (char *) NULL)
- break;
- *s++ = '\0';
- }
-
- if (count != macro->operands)
- {
- as_bad (_("wrong number of operands"));
- return;
- }
-
- /* Work out how large the string must be (the size is unbounded
- because it includes user input). */
- len = 0;
- format = macro->format;
- while (*format != '\0')
- {
- if (*format != '%')
- {
- ++len;
- ++format;
- }
- else
- {
- arg = strtol (format + 1, &send, 10);
- know (send != format && arg < count);
- len += strlen (operands[arg]);
- format = send;
- }
- }
-
- /* Put the string together. */
- complete = s = (char *) alloca (len + 1);
- format = macro->format;
- while (*format != '\0')
- {
- if (*format != '%')
- *s++ = *format++;
- else
- {
- arg = strtol (format + 1, &send, 10);
- strcpy (s, operands[arg]);
- s += strlen (s);
- format = send;
- }
- }
- *s = '\0';
-
- /* Assemble the constructed instruction. */
- md_assemble (complete);
-}
-
-#ifdef OBJ_ELF
-/* For ELF, add support for SHF_EXCLUDE and SHT_ORDERED. */
-
-int
-ppc_section_letter (int letter, char **ptr_msg)
-{
- if (letter == 'e')
- return SHF_EXCLUDE;
-
- *ptr_msg = _("Bad .section directive: want a,e,w,x,M,S,G,T in string");
- return -1;
-}
-
-int
-ppc_section_word (char *str, size_t len)
-{
- if (len == 7 && strncmp (str, "exclude", 7) == 0)
- return SHF_EXCLUDE;
-
- return -1;
-}
-
-int
-ppc_section_type (char *str, size_t len)
-{
- if (len == 7 && strncmp (str, "ordered", 7) == 0)
- return SHT_ORDERED;
-
- return -1;
-}
-
-int
-ppc_section_flags (int flags, int attr, int type)
-{
- if (type == SHT_ORDERED)
- flags |= SEC_ALLOC | SEC_LOAD | SEC_SORT_ENTRIES;
-
- if (attr & SHF_EXCLUDE)
- flags |= SEC_EXCLUDE;
-
- return flags;
-}
-#endif /* OBJ_ELF */
-
-
-/* Pseudo-op handling. */
-
-/* The .byte pseudo-op. This is similar to the normal .byte
- pseudo-op, but it can also take a single ASCII string. */
-
-static void
-ppc_byte (int ignore ATTRIBUTE_UNUSED)
-{
- if (*input_line_pointer != '\"')
- {
- cons (1);
- return;
- }
-
- /* Gather characters. A real double quote is doubled. Unusual
- characters are not permitted. */
- ++input_line_pointer;
- while (1)
- {
- char c;
-
- c = *input_line_pointer++;
-
- if (c == '\"')
- {
- if (*input_line_pointer != '\"')
- break;
- ++input_line_pointer;
- }
-
- FRAG_APPEND_1_CHAR (c);
- }
-
- demand_empty_rest_of_line ();
-}
-
-#ifdef OBJ_XCOFF
-
-/* XCOFF specific pseudo-op handling. */
-
-/* This is set if we are creating a .stabx symbol, since we don't want
- to handle symbol suffixes for such symbols. */
-static bfd_boolean ppc_stab_symbol;
-
-/* The .comm and .lcomm pseudo-ops for XCOFF. XCOFF puts common
- symbols in the .bss segment as though they were local common
- symbols, and uses a different smclas. The native Aix 4.3.3 assembler
- aligns .comm and .lcomm to 4 bytes. */
-
-static void
-ppc_comm (int lcomm)
-{
- asection *current_seg = now_seg;
- subsegT current_subseg = now_subseg;
- char *name;
- char endc;
- char *end_name;
- offsetT size;
- offsetT align;
- symbolS *lcomm_sym = NULL;
- symbolS *sym;
- char *pfrag;
-
- name = input_line_pointer;
- endc = get_symbol_end ();
- end_name = input_line_pointer;
- *end_name = endc;
-
- if (*input_line_pointer != ',')
- {
- as_bad (_("missing size"));
- ignore_rest_of_line ();
- return;
- }
- ++input_line_pointer;
-
- size = get_absolute_expression ();
- if (size < 0)
- {
- as_bad (_("negative size"));
- ignore_rest_of_line ();
- return;
- }
-
- if (! lcomm)
- {
- /* The third argument to .comm is the alignment. */
- if (*input_line_pointer != ',')
- align = 2;
- else
- {
- ++input_line_pointer;
- align = get_absolute_expression ();
- if (align <= 0)
- {
- as_warn (_("ignoring bad alignment"));
- align = 2;
- }
- }
- }
- else
- {
- char *lcomm_name;
- char lcomm_endc;
-
- if (size <= 4)
- align = 2;
- else
- align = 3;
-
- /* The third argument to .lcomm appears to be the real local
- common symbol to create. References to the symbol named in
- the first argument are turned into references to the third
- argument. */
- if (*input_line_pointer != ',')
- {
- as_bad (_("missing real symbol name"));
- ignore_rest_of_line ();
- return;
- }
- ++input_line_pointer;
-
- lcomm_name = input_line_pointer;
- lcomm_endc = get_symbol_end ();
-
- lcomm_sym = symbol_find_or_make (lcomm_name);
-
- *input_line_pointer = lcomm_endc;
- }
-
- *end_name = '\0';
- sym = symbol_find_or_make (name);
- *end_name = endc;
-
- if (S_IS_DEFINED (sym)
- || S_GET_VALUE (sym) != 0)
- {
- as_bad (_("attempt to redefine symbol"));
- ignore_rest_of_line ();
- return;
- }
-
- record_alignment (bss_section, align);
-
- if (! lcomm
- || ! S_IS_DEFINED (lcomm_sym))
- {
- symbolS *def_sym;
- offsetT def_size;
-
- if (! lcomm)
- {
- def_sym = sym;
- def_size = size;
- S_SET_EXTERNAL (sym);
- }
- else
- {
- symbol_get_tc (lcomm_sym)->output = 1;
- def_sym = lcomm_sym;
- def_size = 0;
- }
-
- subseg_set (bss_section, 1);
- frag_align (align, 0, 0);
-
- symbol_set_frag (def_sym, frag_now);
- pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, def_sym,
- def_size, (char *) NULL);
- *pfrag = 0;
- S_SET_SEGMENT (def_sym, bss_section);
- symbol_get_tc (def_sym)->align = align;
- }
- else if (lcomm)
- {
- /* Align the size of lcomm_sym. */
- symbol_get_frag (lcomm_sym)->fr_offset =
- ((symbol_get_frag (lcomm_sym)->fr_offset + (1 << align) - 1)
- &~ ((1 << align) - 1));
- if (align > symbol_get_tc (lcomm_sym)->align)
- symbol_get_tc (lcomm_sym)->align = align;
- }
-
- if (lcomm)
- {
- /* Make sym an offset from lcomm_sym. */
- S_SET_SEGMENT (sym, bss_section);
- symbol_set_frag (sym, symbol_get_frag (lcomm_sym));
- S_SET_VALUE (sym, symbol_get_frag (lcomm_sym)->fr_offset);
- symbol_get_frag (lcomm_sym)->fr_offset += size;
- }
-
- subseg_set (current_seg, current_subseg);
-
- demand_empty_rest_of_line ();
-}
-
-/* The .csect pseudo-op. This switches us into a different
- subsegment. The first argument is a symbol whose value is the
- start of the .csect. In COFF, csect symbols get special aux
- entries defined by the x_csect field of union internal_auxent. The
- optional second argument is the alignment (the default is 2). */
-
-static void
-ppc_csect (int ignore ATTRIBUTE_UNUSED)
-{
- char *name;
- char endc;
- symbolS *sym;
- offsetT align;
-
- name = input_line_pointer;
- endc = get_symbol_end ();
-
- sym = symbol_find_or_make (name);
-
- *input_line_pointer = endc;
-
- if (S_GET_NAME (sym)[0] == '\0')
- {
- /* An unnamed csect is assumed to be [PR]. */
- symbol_get_tc (sym)->class = XMC_PR;
- }
-
- align = 2;
- if (*input_line_pointer == ',')
- {
- ++input_line_pointer;
- align = get_absolute_expression ();
- }
-
- ppc_change_csect (sym, align);
-
- demand_empty_rest_of_line ();
-}
-
-/* Change to a different csect. */
-
-static void
-ppc_change_csect (symbolS *sym, offsetT align)
-{
- if (S_IS_DEFINED (sym))
- subseg_set (S_GET_SEGMENT (sym), symbol_get_tc (sym)->subseg);
- else
- {
- symbolS **list_ptr;
- int after_toc;
- int hold_chunksize;
- symbolS *list;
- int is_code;
- segT sec;
-
- /* This is a new csect. We need to look at the symbol class to
- figure out whether it should go in the text section or the
- data section. */
- after_toc = 0;
- is_code = 0;
- switch (symbol_get_tc (sym)->class)
- {
- case XMC_PR:
- case XMC_RO:
- case XMC_DB:
- case XMC_GL:
- case XMC_XO:
- case XMC_SV:
- case XMC_TI:
- case XMC_TB:
- S_SET_SEGMENT (sym, text_section);
- symbol_get_tc (sym)->subseg = ppc_text_subsegment;
- ++ppc_text_subsegment;
- list_ptr = &ppc_text_csects;
- is_code = 1;
- break;
- case XMC_RW:
- case XMC_TC0:
- case XMC_TC:
- case XMC_DS:
- case XMC_UA:
- case XMC_BS:
- case XMC_UC:
- if (ppc_toc_csect != NULL
- && (symbol_get_tc (ppc_toc_csect)->subseg + 1
- == ppc_data_subsegment))
- after_toc = 1;
- S_SET_SEGMENT (sym, data_section);
- symbol_get_tc (sym)->subseg = ppc_data_subsegment;
- ++ppc_data_subsegment;
- list_ptr = &ppc_data_csects;
- break;
- default:
- abort ();
- }
-
- /* We set the obstack chunk size to a small value before
- changing subsegments, so that we don't use a lot of memory
- space for what may be a small section. */
- hold_chunksize = chunksize;
- chunksize = 64;
-
- sec = subseg_new (segment_name (S_GET_SEGMENT (sym)),
- symbol_get_tc (sym)->subseg);
-
- chunksize = hold_chunksize;
-
- if (after_toc)
- ppc_after_toc_frag = frag_now;
-
- record_alignment (sec, align);
- if (is_code)
- frag_align_code (align, 0);
- else
- frag_align (align, 0, 0);
-
- symbol_set_frag (sym, frag_now);
- S_SET_VALUE (sym, (valueT) frag_now_fix ());
-
- symbol_get_tc (sym)->align = align;
- symbol_get_tc (sym)->output = 1;
- symbol_get_tc (sym)->within = sym;
-
- for (list = *list_ptr;
- symbol_get_tc (list)->next != (symbolS *) NULL;
- list = symbol_get_tc (list)->next)
- ;
- symbol_get_tc (list)->next = sym;
-
- symbol_remove (sym, &symbol_rootP, &symbol_lastP);
- symbol_append (sym, symbol_get_tc (list)->within, &symbol_rootP,
- &symbol_lastP);
- }
-
- ppc_current_csect = sym;
-}
-
-/* This function handles the .text and .data pseudo-ops. These
- pseudo-ops aren't really used by XCOFF; we implement them for the
- convenience of people who aren't used to XCOFF. */
-
-static void
-ppc_section (int type)
-{
- const char *name;
- symbolS *sym;
-
- if (type == 't')
- name = ".text[PR]";
- else if (type == 'd')
- name = ".data[RW]";
- else
- abort ();
-
- sym = symbol_find_or_make (name);
-
- ppc_change_csect (sym, 2);
-
- demand_empty_rest_of_line ();
-}
-
-/* This function handles the .section pseudo-op. This is mostly to
- give an error, since XCOFF only supports .text, .data and .bss, but
- we do permit the user to name the text or data section. */
-
-static void
-ppc_named_section (int ignore ATTRIBUTE_UNUSED)
-{
- char *user_name;
- const char *real_name;
- char c;
- symbolS *sym;
-
- user_name = input_line_pointer;
- c = get_symbol_end ();
-
- if (strcmp (user_name, ".text") == 0)
- real_name = ".text[PR]";
- else if (strcmp (user_name, ".data") == 0)
- real_name = ".data[RW]";
- else
- {
- as_bad (_("The XCOFF file format does not support arbitrary sections"));
- *input_line_pointer = c;
- ignore_rest_of_line ();
- return;
- }
-
- *input_line_pointer = c;
-
- sym = symbol_find_or_make (real_name);
-
- ppc_change_csect (sym, 2);
-
- demand_empty_rest_of_line ();
-}
-
-/* The .extern pseudo-op. We create an undefined symbol. */
-
-static void
-ppc_extern (int ignore ATTRIBUTE_UNUSED)
-{
- char *name;
- char endc;
-
- name = input_line_pointer;
- endc = get_symbol_end ();
-
- (void) symbol_find_or_make (name);
-
- *input_line_pointer = endc;
-
- demand_empty_rest_of_line ();
-}
-
-/* The .lglobl pseudo-op. Keep the symbol in the symbol table. */
-
-static void
-ppc_lglobl (int ignore ATTRIBUTE_UNUSED)
-{
- char *name;
- char endc;
- symbolS *sym;
-
- name = input_line_pointer;
- endc = get_symbol_end ();
-
- sym = symbol_find_or_make (name);
-
- *input_line_pointer = endc;
-
- symbol_get_tc (sym)->output = 1;
-
- demand_empty_rest_of_line ();
-}
-
-/* The .rename pseudo-op. The RS/6000 assembler can rename symbols,
- although I don't know why it bothers. */
-
-static void
-ppc_rename (int ignore ATTRIBUTE_UNUSED)
-{
- char *name;
- char endc;
- symbolS *sym;
- int len;
-
- name = input_line_pointer;
- endc = get_symbol_end ();
-
- sym = symbol_find_or_make (name);
-
- *input_line_pointer = endc;
-
- if (*input_line_pointer != ',')
- {
- as_bad (_("missing rename string"));
- ignore_rest_of_line ();
- return;
- }
- ++input_line_pointer;
-
- symbol_get_tc (sym)->real_name = demand_copy_C_string (&len);
-
- demand_empty_rest_of_line ();
-}
-
-/* The .stabx pseudo-op. This is similar to a normal .stabs
- pseudo-op, but slightly different. A sample is
- .stabx "main:F-1",.main,142,0
- The first argument is the symbol name to create. The second is the
- value, and the third is the storage class. The fourth seems to be
- always zero, and I am assuming it is the type. */
-
-static void
-ppc_stabx (int ignore ATTRIBUTE_UNUSED)
-{
- char *name;
- int len;
- symbolS *sym;
- expressionS exp;
-
- name = demand_copy_C_string (&len);
-
- if (*input_line_pointer != ',')
- {
- as_bad (_("missing value"));
- return;
- }
- ++input_line_pointer;
-
- ppc_stab_symbol = TRUE;
- sym = symbol_make (name);
- ppc_stab_symbol = FALSE;
-
- symbol_get_tc (sym)->real_name = name;
-
- (void) expression (&exp);
-
- switch (exp.X_op)
- {
- case O_illegal:
- case O_absent:
- case O_big:
- as_bad (_("illegal .stabx expression; zero assumed"));
- exp.X_add_number = 0;
- /* Fall through. */
- case O_constant:
- S_SET_VALUE (sym, (valueT) exp.X_add_number);
- symbol_set_frag (sym, &zero_address_frag);
- break;
-
- case O_symbol:
- if (S_GET_SEGMENT (exp.X_add_symbol) == undefined_section)
- symbol_set_value_expression (sym, &exp);
- else
- {
- S_SET_VALUE (sym,
- exp.X_add_number + S_GET_VALUE (exp.X_add_symbol));
- symbol_set_frag (sym, symbol_get_frag (exp.X_add_symbol));
- }
- break;
-
- default:
- /* The value is some complex expression. This will probably
- fail at some later point, but this is probably the right
- thing to do here. */
- symbol_set_value_expression (sym, &exp);
- break;
- }
-
- S_SET_SEGMENT (sym, ppc_coff_debug_section);
- symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
-
- if (*input_line_pointer != ',')
- {
- as_bad (_("missing class"));
- return;
- }
- ++input_line_pointer;
-
- S_SET_STORAGE_CLASS (sym, get_absolute_expression ());
-
- if (*input_line_pointer != ',')
- {
- as_bad (_("missing type"));
- return;
- }
- ++input_line_pointer;
-
- S_SET_DATA_TYPE (sym, get_absolute_expression ());
-
- symbol_get_tc (sym)->output = 1;
-
- if (S_GET_STORAGE_CLASS (sym) == C_STSYM) {
-
- symbol_get_tc (sym)->within = ppc_current_block;
-
- /* In this case :
-
- .bs name
- .stabx "z",arrays_,133,0
- .es
-
- .comm arrays_,13768,3
-
- resolve_symbol_value will copy the exp's "within" into sym's when the
- offset is 0. Since this seems to be corner case problem,
- only do the correction for storage class C_STSYM. A better solution
- would be to have the tc field updated in ppc_symbol_new_hook. */
-
- if (exp.X_op == O_symbol)
- {
- symbol_get_tc (exp.X_add_symbol)->within = ppc_current_block;
- }
- }
-
- if (exp.X_op != O_symbol
- || ! S_IS_EXTERNAL (exp.X_add_symbol)
- || S_GET_SEGMENT (exp.X_add_symbol) != bss_section)
- ppc_frob_label (sym);
- else
- {
- symbol_remove (sym, &symbol_rootP, &symbol_lastP);
- symbol_append (sym, exp.X_add_symbol, &symbol_rootP, &symbol_lastP);
- if (symbol_get_tc (ppc_current_csect)->within == exp.X_add_symbol)
- symbol_get_tc (ppc_current_csect)->within = sym;
- }
-
- demand_empty_rest_of_line ();
-}
-
-/* The .function pseudo-op. This takes several arguments. The first
- argument seems to be the external name of the symbol. The second
- argument seems to be the label for the start of the function. gcc
- uses the same name for both. I have no idea what the third and
- fourth arguments are meant to be. The optional fifth argument is
- an expression for the size of the function. In COFF this symbol
- gets an aux entry like that used for a csect. */
-
-static void
-ppc_function (int ignore ATTRIBUTE_UNUSED)
-{
- char *name;
- char endc;
- char *s;
- symbolS *ext_sym;
- symbolS *lab_sym;
-
- name = input_line_pointer;
- endc = get_symbol_end ();
-
- /* Ignore any [PR] suffix. */
- name = ppc_canonicalize_symbol_name (name);
- s = strchr (name, '[');
- if (s != (char *) NULL
- && strcmp (s + 1, "PR]") == 0)
- *s = '\0';
-
- ext_sym = symbol_find_or_make (name);
-
- *input_line_pointer = endc;
-
- if (*input_line_pointer != ',')
- {
- as_bad (_("missing symbol name"));
- ignore_rest_of_line ();
- return;
- }
- ++input_line_pointer;
-
- name = input_line_pointer;
- endc = get_symbol_end ();
-
- lab_sym = symbol_find_or_make (name);
-
- *input_line_pointer = endc;
-
- if (ext_sym != lab_sym)
- {
- expressionS exp;
-
- exp.X_op = O_symbol;
- exp.X_add_symbol = lab_sym;
- exp.X_op_symbol = NULL;
- exp.X_add_number = 0;
- exp.X_unsigned = 0;
- symbol_set_value_expression (ext_sym, &exp);
- }
-
- if (symbol_get_tc (ext_sym)->class == -1)
- symbol_get_tc (ext_sym)->class = XMC_PR;
- symbol_get_tc (ext_sym)->output = 1;
-
- if (*input_line_pointer == ',')
- {
- expressionS ignore;
-
- /* Ignore the third argument. */
- ++input_line_pointer;
- expression (&ignore);
- if (*input_line_pointer == ',')
- {
- /* Ignore the fourth argument. */
- ++input_line_pointer;
- expression (&ignore);
- if (*input_line_pointer == ',')
- {
- /* The fifth argument is the function size. */
- ++input_line_pointer;
- symbol_get_tc (ext_sym)->size = symbol_new ("L0\001",
- absolute_section,
- (valueT) 0,
- &zero_address_frag);
- pseudo_set (symbol_get_tc (ext_sym)->size);
- }
- }
- }
-
- S_SET_DATA_TYPE (ext_sym, DT_FCN << N_BTSHFT);
- SF_SET_FUNCTION (ext_sym);
- SF_SET_PROCESS (ext_sym);
- coff_add_linesym (ext_sym);
-
- demand_empty_rest_of_line ();
-}
-
-/* The .bf pseudo-op. This is just like a COFF C_FCN symbol named
- ".bf". If the pseudo op .bi was seen before .bf, patch the .bi sym
- with the correct line number */
-
-static symbolS *saved_bi_sym = 0;
-
-static void
-ppc_bf (int ignore ATTRIBUTE_UNUSED)
-{
- symbolS *sym;
-
- sym = symbol_make (".bf");
- S_SET_SEGMENT (sym, text_section);
- symbol_set_frag (sym, frag_now);
- S_SET_VALUE (sym, frag_now_fix ());
- S_SET_STORAGE_CLASS (sym, C_FCN);
-
- coff_line_base = get_absolute_expression ();
-
- S_SET_NUMBER_AUXILIARY (sym, 1);
- SA_SET_SYM_LNNO (sym, coff_line_base);
-
- /* Line number for bi. */
- if (saved_bi_sym)
- {
- S_SET_VALUE (saved_bi_sym, coff_n_line_nos);
- saved_bi_sym = 0;
- }
-
-
- symbol_get_tc (sym)->output = 1;
-
- ppc_frob_label (sym);
-
- demand_empty_rest_of_line ();
-}
-
-/* The .ef pseudo-op. This is just like a COFF C_FCN symbol named
- ".ef", except that the line number is absolute, not relative to the
- most recent ".bf" symbol. */
-
-static void
-ppc_ef (int ignore ATTRIBUTE_UNUSED)
-{
- symbolS *sym;
-
- sym = symbol_make (".ef");
- S_SET_SEGMENT (sym, text_section);
- symbol_set_frag (sym, frag_now);
- S_SET_VALUE (sym, frag_now_fix ());
- S_SET_STORAGE_CLASS (sym, C_FCN);
- S_SET_NUMBER_AUXILIARY (sym, 1);
- SA_SET_SYM_LNNO (sym, get_absolute_expression ());
- symbol_get_tc (sym)->output = 1;
-
- ppc_frob_label (sym);
-
- demand_empty_rest_of_line ();
-}
-
-/* The .bi and .ei pseudo-ops. These take a string argument and
- generates a C_BINCL or C_EINCL symbol, which goes at the start of
- the symbol list. The value of .bi will be know when the next .bf
- is encountered. */
-
-static void
-ppc_biei (int ei)
-{
- static symbolS *last_biei;
-
- char *name;
- int len;
- symbolS *sym;
- symbolS *look;
-
- name = demand_copy_C_string (&len);
-
- /* The value of these symbols is actually file offset. Here we set
- the value to the index into the line number entries. In
- ppc_frob_symbols we set the fix_line field, which will cause BFD
- to do the right thing. */
-
- sym = symbol_make (name);
- /* obj-coff.c currently only handles line numbers correctly in the
- .text section. */
- S_SET_SEGMENT (sym, text_section);
- S_SET_VALUE (sym, coff_n_line_nos);
- symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
-
- S_SET_STORAGE_CLASS (sym, ei ? C_EINCL : C_BINCL);
- symbol_get_tc (sym)->output = 1;
-
- /* Save bi. */
- if (ei)
- saved_bi_sym = 0;
- else
- saved_bi_sym = sym;
-
- for (look = last_biei ? last_biei : symbol_rootP;
- (look != (symbolS *) NULL
- && (S_GET_STORAGE_CLASS (look) == C_FILE
- || S_GET_STORAGE_CLASS (look) == C_BINCL
- || S_GET_STORAGE_CLASS (look) == C_EINCL));
- look = symbol_next (look))
- ;
- if (look != (symbolS *) NULL)
- {
- symbol_remove (sym, &symbol_rootP, &symbol_lastP);
- symbol_insert (sym, look, &symbol_rootP, &symbol_lastP);
- last_biei = sym;
- }
-
- demand_empty_rest_of_line ();
-}
-
-/* The .bs pseudo-op. This generates a C_BSTAT symbol named ".bs".
- There is one argument, which is a csect symbol. The value of the
- .bs symbol is the index of this csect symbol. */
-
-static void
-ppc_bs (int ignore ATTRIBUTE_UNUSED)
-{
- char *name;
- char endc;
- symbolS *csect;
- symbolS *sym;
-
- if (ppc_current_block != NULL)
- as_bad (_("nested .bs blocks"));
-
- name = input_line_pointer;
- endc = get_symbol_end ();
-
- csect = symbol_find_or_make (name);
-
- *input_line_pointer = endc;
-
- sym = symbol_make (".bs");
- S_SET_SEGMENT (sym, now_seg);
- S_SET_STORAGE_CLASS (sym, C_BSTAT);
- symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
- symbol_get_tc (sym)->output = 1;
-
- symbol_get_tc (sym)->within = csect;
-
- ppc_frob_label (sym);
-
- ppc_current_block = sym;
-
- demand_empty_rest_of_line ();
-}
-
-/* The .es pseudo-op. Generate a C_ESTART symbol named .es. */
-
-static void
-ppc_es (int ignore ATTRIBUTE_UNUSED)
-{
- symbolS *sym;
-
- if (ppc_current_block == NULL)
- as_bad (_(".es without preceding .bs"));
-
- sym = symbol_make (".es");
- S_SET_SEGMENT (sym, now_seg);
- S_SET_STORAGE_CLASS (sym, C_ESTAT);
- symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
- symbol_get_tc (sym)->output = 1;
-
- ppc_frob_label (sym);
-
- ppc_current_block = NULL;
-
- demand_empty_rest_of_line ();
-}
-
-/* The .bb pseudo-op. Generate a C_BLOCK symbol named .bb, with a
- line number. */
-
-static void
-ppc_bb (int ignore ATTRIBUTE_UNUSED)
-{
- symbolS *sym;
-
- sym = symbol_make (".bb");
- S_SET_SEGMENT (sym, text_section);
- symbol_set_frag (sym, frag_now);
- S_SET_VALUE (sym, frag_now_fix ());
- S_SET_STORAGE_CLASS (sym, C_BLOCK);
-
- S_SET_NUMBER_AUXILIARY (sym, 1);
- SA_SET_SYM_LNNO (sym, get_absolute_expression ());
-
- symbol_get_tc (sym)->output = 1;
-
- SF_SET_PROCESS (sym);
-
- ppc_frob_label (sym);
-
- demand_empty_rest_of_line ();
-}
-
-/* The .eb pseudo-op. Generate a C_BLOCK symbol named .eb, with a
- line number. */
-
-static void
-ppc_eb (int ignore ATTRIBUTE_UNUSED)
-{
- symbolS *sym;
-
- sym = symbol_make (".eb");
- S_SET_SEGMENT (sym, text_section);
- symbol_set_frag (sym, frag_now);
- S_SET_VALUE (sym, frag_now_fix ());
- S_SET_STORAGE_CLASS (sym, C_BLOCK);
- S_SET_NUMBER_AUXILIARY (sym, 1);
- SA_SET_SYM_LNNO (sym, get_absolute_expression ());
- symbol_get_tc (sym)->output = 1;
-
- SF_SET_PROCESS (sym);
-
- ppc_frob_label (sym);
-
- demand_empty_rest_of_line ();
-}
-
-/* The .bc pseudo-op. This just creates a C_BCOMM symbol with a
- specified name. */
-
-static void
-ppc_bc (int ignore ATTRIBUTE_UNUSED)
-{
- char *name;
- int len;
- symbolS *sym;
-
- name = demand_copy_C_string (&len);
- sym = symbol_make (name);
- S_SET_SEGMENT (sym, ppc_coff_debug_section);
- symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
- S_SET_STORAGE_CLASS (sym, C_BCOMM);
- S_SET_VALUE (sym, 0);
- symbol_get_tc (sym)->output = 1;
-
- ppc_frob_label (sym);
-
- demand_empty_rest_of_line ();
-}
-
-/* The .ec pseudo-op. This just creates a C_ECOMM symbol. */
-
-static void
-ppc_ec (int ignore ATTRIBUTE_UNUSED)
-{
- symbolS *sym;
-
- sym = symbol_make (".ec");
- S_SET_SEGMENT (sym, ppc_coff_debug_section);
- symbol_get_bfdsym (sym)->flags |= BSF_DEBUGGING;
- S_SET_STORAGE_CLASS (sym, C_ECOMM);
- S_SET_VALUE (sym, 0);
- symbol_get_tc (sym)->output = 1;
-
- ppc_frob_label (sym);
-
- demand_empty_rest_of_line ();
-}
-
-/* The .toc pseudo-op. Switch to the .toc subsegment. */
-
-static void
-ppc_toc (int ignore ATTRIBUTE_UNUSED)
-{
- if (ppc_toc_csect != (symbolS *) NULL)
- subseg_set (data_section, symbol_get_tc (ppc_toc_csect)->subseg);
- else
- {
- subsegT subseg;
- symbolS *sym;
- symbolS *list;
-
- subseg = ppc_data_subsegment;
- ++ppc_data_subsegment;
-
- subseg_new (segment_name (data_section), subseg);
- ppc_toc_frag = frag_now;
-
- sym = symbol_find_or_make ("TOC[TC0]");
- symbol_set_frag (sym, frag_now);
- S_SET_SEGMENT (sym, data_section);
- S_SET_VALUE (sym, (valueT) frag_now_fix ());
- symbol_get_tc (sym)->subseg = subseg;
- symbol_get_tc (sym)->output = 1;
- symbol_get_tc (sym)->within = sym;
-
- ppc_toc_csect = sym;
-
- for (list = ppc_data_csects;
- symbol_get_tc (list)->next != (symbolS *) NULL;
- list = symbol_get_tc (list)->next)
- ;
- symbol_get_tc (list)->next = sym;
-
- symbol_remove (sym, &symbol_rootP, &symbol_lastP);
- symbol_append (sym, symbol_get_tc (list)->within, &symbol_rootP,
- &symbol_lastP);
- }
-
- ppc_current_csect = ppc_toc_csect;
-
- demand_empty_rest_of_line ();
-}
-
-/* The AIX assembler automatically aligns the operands of a .long or
- .short pseudo-op, and we want to be compatible. */
-
-static void
-ppc_xcoff_cons (int log_size)
-{
- frag_align (log_size, 0, 0);
- record_alignment (now_seg, log_size);
- cons (1 << log_size);
-}
-
-static void
-ppc_vbyte (int dummy ATTRIBUTE_UNUSED)
-{
- expressionS exp;
- int byte_count;
-
- (void) expression (&exp);
-
- if (exp.X_op != O_constant)
- {
- as_bad (_("non-constant byte count"));
- return;
- }
-
- byte_count = exp.X_add_number;
-
- if (*input_line_pointer != ',')
- {
- as_bad (_("missing value"));
- return;
- }
-
- ++input_line_pointer;
- cons (byte_count);
-}
-
-#endif /* OBJ_XCOFF */
-#if defined (OBJ_XCOFF) || defined (OBJ_ELF)
-
-/* The .tc pseudo-op. This is used when generating either XCOFF or
- ELF. This takes two or more arguments.
-
- When generating XCOFF output, the first argument is the name to
- give to this location in the toc; this will be a symbol with class
- TC. The rest of the arguments are N-byte values to actually put at
- this location in the TOC; often there is just one more argument, a
- relocatable symbol reference. The size of the value to store
- depends on target word size. A 32-bit target uses 4-byte values, a
- 64-bit target uses 8-byte values.
-
- When not generating XCOFF output, the arguments are the same, but
- the first argument is simply ignored. */
-
-static void
-ppc_tc (int ignore ATTRIBUTE_UNUSED)
-{
-#ifdef OBJ_XCOFF
-
- /* Define the TOC symbol name. */
- {
- char *name;
- char endc;
- symbolS *sym;
-
- if (ppc_toc_csect == (symbolS *) NULL
- || ppc_toc_csect != ppc_current_csect)
- {
- as_bad (_(".tc not in .toc section"));
- ignore_rest_of_line ();
- return;
- }
-
- name = input_line_pointer;
- endc = get_symbol_end ();
-
- sym = symbol_find_or_make (name);
-
- *input_line_pointer = endc;
-
- if (S_IS_DEFINED (sym))
- {
- symbolS *label;
-
- label = symbol_get_tc (ppc_current_csect)->within;
- if (symbol_get_tc (label)->class != XMC_TC0)
- {
- as_bad (_(".tc with no label"));
- ignore_rest_of_line ();
- return;
- }
-
- S_SET_SEGMENT (label, S_GET_SEGMENT (sym));
- symbol_set_frag (label, symbol_get_frag (sym));
- S_SET_VALUE (label, S_GET_VALUE (sym));
-
- while (! is_end_of_line[(unsigned char) *input_line_pointer])
- ++input_line_pointer;
-
- return;
- }
-
- S_SET_SEGMENT (sym, now_seg);
- symbol_set_frag (sym, frag_now);
- S_SET_VALUE (sym, (valueT) frag_now_fix ());
- symbol_get_tc (sym)->class = XMC_TC;
- symbol_get_tc (sym)->output = 1;
-
- ppc_frob_label (sym);
- }
-
-#endif /* OBJ_XCOFF */
-#ifdef OBJ_ELF
- int align;
-
- /* Skip the TOC symbol name. */
- while (is_part_of_name (*input_line_pointer)
- || *input_line_pointer == ' '
- || *input_line_pointer == '['
- || *input_line_pointer == ']'
- || *input_line_pointer == '{'
- || *input_line_pointer == '}')
- ++input_line_pointer;
-
- /* Align to a four/eight byte boundary. */
- align = ppc_obj64 ? 3 : 2;
- frag_align (align, 0, 0);
- record_alignment (now_seg, align);
-#endif /* OBJ_ELF */
-
- if (*input_line_pointer != ',')
- demand_empty_rest_of_line ();
- else
- {
- ++input_line_pointer;
- cons (ppc_obj64 ? 8 : 4);
- }
-}
-
-/* Pseudo-op .machine. */
-
-static void
-ppc_machine (int ignore ATTRIBUTE_UNUSED)
-{
- char *cpu_string;
-#define MAX_HISTORY 100
- static ppc_cpu_t *cpu_history;
- static int curr_hist;
-
- SKIP_WHITESPACE ();
-
- if (*input_line_pointer == '"')
- {
- int len;
- cpu_string = demand_copy_C_string (&len);
- }
- else
- {
- char c;
- cpu_string = input_line_pointer;
- c = get_symbol_end ();
- cpu_string = xstrdup (cpu_string);
- *input_line_pointer = c;
- }
-
- if (cpu_string != NULL)
- {
- ppc_cpu_t old_cpu = ppc_cpu;
- char *p;
-
- for (p = cpu_string; *p != 0; p++)
- *p = TOLOWER (*p);
-
- if (strcmp (cpu_string, "push") == 0)
- {
- if (cpu_history == NULL)
- cpu_history = xmalloc (MAX_HISTORY * sizeof (*cpu_history));
-
- if (curr_hist >= MAX_HISTORY)
- as_bad (_(".machine stack overflow"));
- else
- cpu_history[curr_hist++] = ppc_cpu;
- }
- else if (strcmp (cpu_string, "pop") == 0)
- {
- if (curr_hist <= 0)
- as_bad (_(".machine stack underflow"));
- else
- ppc_cpu = cpu_history[--curr_hist];
- }
- else if (parse_cpu (cpu_string))
- ;
- else
- as_bad (_("invalid machine `%s'"), cpu_string);
-
- if (ppc_cpu != old_cpu)
- ppc_setup_opcodes ();
- }
-
- demand_empty_rest_of_line ();
-}
-
-/* See whether a symbol is in the TOC section. */
-
-static int
-ppc_is_toc_sym (symbolS *sym)
-{
-#ifdef OBJ_XCOFF
- return symbol_get_tc (sym)->class == XMC_TC;
-#endif
-#ifdef OBJ_ELF
- const char *sname = segment_name (S_GET_SEGMENT (sym));
- if (ppc_obj64)
- return strcmp (sname, ".toc") == 0;
- else
- return strcmp (sname, ".got") == 0;
-#endif
-}
-#endif /* defined (OBJ_XCOFF) || defined (OBJ_ELF) */
-
-#ifdef TE_PE
-
-/* Pseudo-ops specific to the Windows NT PowerPC PE (coff) format. */
-
-/* Set the current section. */
-static void
-ppc_set_current_section (segT new)
-{
- ppc_previous_section = ppc_current_section;
- ppc_current_section = new;
-}
-
-/* pseudo-op: .previous
- behaviour: toggles the current section with the previous section.
- errors: None
- warnings: "No previous section" */
-
-static void
-ppc_previous (int ignore ATTRIBUTE_UNUSED)
-{
- symbolS *tmp;
-
- if (ppc_previous_section == NULL)
- {
- as_warn (_("No previous section to return to. Directive ignored."));
- return;
- }
-
- subseg_set (ppc_previous_section, 0);
-
- ppc_set_current_section (ppc_previous_section);
-}
-
-/* pseudo-op: .pdata
- behaviour: predefined read only data section
- double word aligned
- errors: None
- warnings: None
- initial: .section .pdata "adr3"
- a - don't know -- maybe a misprint
- d - initialized data
- r - readable
- 3 - double word aligned (that would be 4 byte boundary)
-
- commentary:
- Tag index tables (also known as the function table) for exception
- handling, debugging, etc. */
-
-static void
-ppc_pdata (int ignore ATTRIBUTE_UNUSED)
-{
- if (pdata_section == 0)
- {
- pdata_section = subseg_new (".pdata", 0);
-
- bfd_set_section_flags (stdoutput, pdata_section,
- (SEC_ALLOC | SEC_LOAD | SEC_RELOC
- | SEC_READONLY | SEC_DATA ));
-
- bfd_set_section_alignment (stdoutput, pdata_section, 2);
- }
- else
- {
- pdata_section = subseg_new (".pdata", 0);
- }
- ppc_set_current_section (pdata_section);
-}
-
-/* pseudo-op: .ydata
- behaviour: predefined read only data section
- double word aligned
- errors: None
- warnings: None
- initial: .section .ydata "drw3"
- a - don't know -- maybe a misprint
- d - initialized data
- r - readable
- 3 - double word aligned (that would be 4 byte boundary)
- commentary:
- Tag tables (also known as the scope table) for exception handling,
- debugging, etc. */
-
-static void
-ppc_ydata (int ignore ATTRIBUTE_UNUSED)
-{
- if (ydata_section == 0)
- {
- ydata_section = subseg_new (".ydata", 0);
- bfd_set_section_flags (stdoutput, ydata_section,
- (SEC_ALLOC | SEC_LOAD | SEC_RELOC
- | SEC_READONLY | SEC_DATA ));
-
- bfd_set_section_alignment (stdoutput, ydata_section, 3);
- }
- else
- {
- ydata_section = subseg_new (".ydata", 0);
- }
- ppc_set_current_section (ydata_section);
-}
-
-/* pseudo-op: .reldata
- behaviour: predefined read write data section
- double word aligned (4-byte)
- FIXME: relocation is applied to it
- FIXME: what's the difference between this and .data?
- errors: None
- warnings: None
- initial: .section .reldata "drw3"
- d - initialized data
- r - readable
- w - writeable
- 3 - double word aligned (that would be 8 byte boundary)
-
- commentary:
- Like .data, but intended to hold data subject to relocation, such as
- function descriptors, etc. */
-
-static void
-ppc_reldata (int ignore ATTRIBUTE_UNUSED)
-{
- if (reldata_section == 0)
- {
- reldata_section = subseg_new (".reldata", 0);
-
- bfd_set_section_flags (stdoutput, reldata_section,
- (SEC_ALLOC | SEC_LOAD | SEC_RELOC
- | SEC_DATA));
-
- bfd_set_section_alignment (stdoutput, reldata_section, 2);
- }
- else
- {
- reldata_section = subseg_new (".reldata", 0);
- }
- ppc_set_current_section (reldata_section);
-}
-
-/* pseudo-op: .rdata
- behaviour: predefined read only data section
- double word aligned
- errors: None
- warnings: None
- initial: .section .rdata "dr3"
- d - initialized data
- r - readable
- 3 - double word aligned (that would be 4 byte boundary) */
-
-static void
-ppc_rdata (int ignore ATTRIBUTE_UNUSED)
-{
- if (rdata_section == 0)
- {
- rdata_section = subseg_new (".rdata", 0);
- bfd_set_section_flags (stdoutput, rdata_section,
- (SEC_ALLOC | SEC_LOAD | SEC_RELOC
- | SEC_READONLY | SEC_DATA ));
-
- bfd_set_section_alignment (stdoutput, rdata_section, 2);
- }
- else
- {
- rdata_section = subseg_new (".rdata", 0);
- }
- ppc_set_current_section (rdata_section);
-}
-
-/* pseudo-op: .ualong
- behaviour: much like .int, with the exception that no alignment is
- performed.
- FIXME: test the alignment statement
- errors: None
- warnings: None */
-
-static void
-ppc_ualong (int ignore ATTRIBUTE_UNUSED)
-{
- /* Try for long. */
- cons (4);
-}
-
-/* pseudo-op: .znop <symbol name>
- behaviour: Issue a nop instruction
- Issue a IMAGE_REL_PPC_IFGLUE relocation against it, using
- the supplied symbol name.
- errors: None
- warnings: Missing symbol name */
-
-static void
-ppc_znop (int ignore ATTRIBUTE_UNUSED)
-{
- unsigned long insn;
- const struct powerpc_opcode *opcode;
- expressionS ex;
- char *f;
- symbolS *sym;
- char *symbol_name;
- char c;
- char *name;
- unsigned int exp;
- flagword flags;
- asection *sec;
-
- /* Strip out the symbol name. */
- symbol_name = input_line_pointer;
- c = get_symbol_end ();
-
- name = xmalloc (input_line_pointer - symbol_name + 1);
- strcpy (name, symbol_name);
-
- sym = symbol_find_or_make (name);
-
- *input_line_pointer = c;
-
- SKIP_WHITESPACE ();
-
- /* Look up the opcode in the hash table. */
- opcode = (const struct powerpc_opcode *) hash_find (ppc_hash, "nop");
-
- /* Stick in the nop. */
- insn = opcode->opcode;
-
- /* Write out the instruction. */
- f = frag_more (4);
- md_number_to_chars (f, insn, 4);
- fix_new (frag_now,
- f - frag_now->fr_literal,
- 4,
- sym,
- 0,
- 0,
- BFD_RELOC_16_GOT_PCREL);
-
-}
-
-/* pseudo-op:
- behaviour:
- errors:
- warnings: */
-
-static void
-ppc_pe_comm (int lcomm)
-{
- char *name;
- char c;
- char *p;
- offsetT temp;
- symbolS *symbolP;
- offsetT align;
-
- name = input_line_pointer;
- c = get_symbol_end ();
-
- /* just after name is now '\0'. */
- p = input_line_pointer;
- *p = c;
- SKIP_WHITESPACE ();
- if (*input_line_pointer != ',')
- {
- as_bad (_("Expected comma after symbol-name: rest of line ignored."));
- ignore_rest_of_line ();
- return;
- }
-
- input_line_pointer++; /* skip ',' */
- if ((temp = get_absolute_expression ()) < 0)
- {
- as_warn (_(".COMMon length (%ld.) <0! Ignored."), (long) temp);
- ignore_rest_of_line ();
- return;
- }
-
- if (! lcomm)
- {
- /* The third argument to .comm is the alignment. */
- if (*input_line_pointer != ',')
- align = 3;
- else
- {
- ++input_line_pointer;
- align = get_absolute_expression ();
- if (align <= 0)
- {
- as_warn (_("ignoring bad alignment"));
- align = 3;
- }
- }
- }
-
- *p = 0;
- symbolP = symbol_find_or_make (name);
-
- *p = c;
- if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP))
- {
- as_bad (_("Ignoring attempt to re-define symbol `%s'."),
- S_GET_NAME (symbolP));
- ignore_rest_of_line ();
- return;
- }
-
- if (S_GET_VALUE (symbolP))
- {
- if (S_GET_VALUE (symbolP) != (valueT) temp)
- as_bad (_("Length of .comm \"%s\" is already %ld. Not changed to %ld."),
- S_GET_NAME (symbolP),
- (long) S_GET_VALUE (symbolP),
- (long) temp);
- }
- else
- {
- S_SET_VALUE (symbolP, (valueT) temp);
- S_SET_EXTERNAL (symbolP);
- S_SET_SEGMENT (symbolP, bfd_com_section_ptr);
- }
-
- demand_empty_rest_of_line ();
-}
-
-/*
- * implement the .section pseudo op:
- * .section name {, "flags"}
- * ^ ^
- * | +--- optional flags: 'b' for bss
- * | 'i' for info
- * +-- section name 'l' for lib
- * 'n' for noload
- * 'o' for over
- * 'w' for data
- * 'd' (apparently m88k for data)
- * 'x' for text
- * But if the argument is not a quoted string, treat it as a
- * subsegment number.
- *
- * FIXME: this is a copy of the section processing from obj-coff.c, with
- * additions/changes for the moto-pas assembler support. There are three
- * categories:
- *
- * FIXME: I just noticed this. This doesn't work at all really. It it
- * setting bits that bfd probably neither understands or uses. The
- * correct approach (?) will have to incorporate extra fields attached
- * to the section to hold the system specific stuff. (krk)
- *
- * Section Contents:
- * 'a' - unknown - referred to in documentation, but no definition supplied
- * 'c' - section has code
- * 'd' - section has initialized data
- * 'u' - section has uninitialized data
- * 'i' - section contains directives (info)
- * 'n' - section can be discarded
- * 'R' - remove section at link time
- *
- * Section Protection:
- * 'r' - section is readable
- * 'w' - section is writeable
- * 'x' - section is executable
- * 's' - section is sharable
- *
- * Section Alignment:
- * '0' - align to byte boundary
- * '1' - align to halfword undary
- * '2' - align to word boundary
- * '3' - align to doubleword boundary
- * '4' - align to quadword boundary
- * '5' - align to 32 byte boundary
- * '6' - align to 64 byte boundary
- *
- */
-
-void
-ppc_pe_section (int ignore ATTRIBUTE_UNUSED)
-{
- /* Strip out the section name. */
- char *section_name;
- char c;
- char *name;
- unsigned int exp;
- flagword flags;
- segT sec;
- int align;
-
- section_name = input_line_pointer;
- c = get_symbol_end ();
-
- name = xmalloc (input_line_pointer - section_name + 1);
- strcpy (name, section_name);
-
- *input_line_pointer = c;
-
- SKIP_WHITESPACE ();
-
- exp = 0;
- flags = SEC_NO_FLAGS;
-
- if (strcmp (name, ".idata$2") == 0)
- {
- align = 0;
- }
- else if (strcmp (name, ".idata$3") == 0)
- {
- align = 0;
- }
- else if (strcmp (name, ".idata$4") == 0)
- {
- align = 2;
- }
- else if (strcmp (name, ".idata$5") == 0)
- {
- align = 2;
- }
- else if (strcmp (name, ".idata$6") == 0)
- {
- align = 1;
- }
- else
- /* Default alignment to 16 byte boundary. */
- align = 4;
-
- if (*input_line_pointer == ',')
- {
- ++input_line_pointer;
- SKIP_WHITESPACE ();
- if (*input_line_pointer != '"')
- exp = get_absolute_expression ();
- else
- {
- ++input_line_pointer;
- while (*input_line_pointer != '"'
- && ! is_end_of_line[(unsigned char) *input_line_pointer])
- {
- switch (*input_line_pointer)
- {
- /* Section Contents */
- case 'a': /* unknown */
- as_bad (_("Unsupported section attribute -- 'a'"));
- break;
- case 'c': /* code section */
- flags |= SEC_CODE;
- break;
- case 'd': /* section has initialized data */
- flags |= SEC_DATA;
- break;
- case 'u': /* section has uninitialized data */
- /* FIXME: This is IMAGE_SCN_CNT_UNINITIALIZED_DATA
- in winnt.h */
- flags |= SEC_ROM;
- break;
- case 'i': /* section contains directives (info) */
- /* FIXME: This is IMAGE_SCN_LNK_INFO
- in winnt.h */
- flags |= SEC_HAS_CONTENTS;
- break;
- case 'n': /* section can be discarded */
- flags &=~ SEC_LOAD;
- break;
- case 'R': /* Remove section at link time */
- flags |= SEC_NEVER_LOAD;
- break;
-#if IFLICT_BRAIN_DAMAGE
- /* Section Protection */
- case 'r': /* section is readable */
- flags |= IMAGE_SCN_MEM_READ;
- break;
- case 'w': /* section is writeable */
- flags |= IMAGE_SCN_MEM_WRITE;
- break;
- case 'x': /* section is executable */
- flags |= IMAGE_SCN_MEM_EXECUTE;
- break;
- case 's': /* section is sharable */
- flags |= IMAGE_SCN_MEM_SHARED;
- break;
-
- /* Section Alignment */
- case '0': /* align to byte boundary */
- flags |= IMAGE_SCN_ALIGN_1BYTES;
- align = 0;
- break;
- case '1': /* align to halfword boundary */
- flags |= IMAGE_SCN_ALIGN_2BYTES;
- align = 1;
- break;
- case '2': /* align to word boundary */
- flags |= IMAGE_SCN_ALIGN_4BYTES;
- align = 2;
- break;
- case '3': /* align to doubleword boundary */
- flags |= IMAGE_SCN_ALIGN_8BYTES;
- align = 3;
- break;
- case '4': /* align to quadword boundary */
- flags |= IMAGE_SCN_ALIGN_16BYTES;
- align = 4;
- break;
- case '5': /* align to 32 byte boundary */
- flags |= IMAGE_SCN_ALIGN_32BYTES;
- align = 5;
- break;
- case '6': /* align to 64 byte boundary */
- flags |= IMAGE_SCN_ALIGN_64BYTES;
- align = 6;
- break;
-#endif
- default:
- as_bad (_("unknown section attribute '%c'"),
- *input_line_pointer);
- break;
- }
- ++input_line_pointer;
- }
- if (*input_line_pointer == '"')
- ++input_line_pointer;
- }
- }
-
- sec = subseg_new (name, (subsegT) exp);
-
- ppc_set_current_section (sec);
-
- if (flags != SEC_NO_FLAGS)
- {
- if (! bfd_set_section_flags (stdoutput, sec, flags))
- as_bad (_("error setting flags for \"%s\": %s"),
- bfd_section_name (stdoutput, sec),
- bfd_errmsg (bfd_get_error ()));
- }
-
- bfd_set_section_alignment (stdoutput, sec, align);
-}
-
-static void
-ppc_pe_function (int ignore ATTRIBUTE_UNUSED)
-{
- char *name;
- char endc;
- symbolS *ext_sym;
-
- name = input_line_pointer;
- endc = get_symbol_end ();
-
- ext_sym = symbol_find_or_make (name);
-
- *input_line_pointer = endc;
-
- S_SET_DATA_TYPE (ext_sym, DT_FCN << N_BTSHFT);
- SF_SET_FUNCTION (ext_sym);
- SF_SET_PROCESS (ext_sym);
- coff_add_linesym (ext_sym);
-
- demand_empty_rest_of_line ();
-}
-
-static void
-ppc_pe_tocd (int ignore ATTRIBUTE_UNUSED)
-{
- if (tocdata_section == 0)
- {
- tocdata_section = subseg_new (".tocd", 0);
- /* FIXME: section flags won't work. */
- bfd_set_section_flags (stdoutput, tocdata_section,
- (SEC_ALLOC | SEC_LOAD | SEC_RELOC
- | SEC_READONLY | SEC_DATA));
-
- bfd_set_section_alignment (stdoutput, tocdata_section, 2);
- }
- else
- {
- rdata_section = subseg_new (".tocd", 0);
- }
-
- ppc_set_current_section (tocdata_section);
-
- demand_empty_rest_of_line ();
-}
-
-/* Don't adjust TOC relocs to use the section symbol. */
-
-int
-ppc_pe_fix_adjustable (fixS *fix)
-{
- return fix->fx_r_type != BFD_RELOC_PPC_TOC16;
-}
-
-#endif
-
-#ifdef OBJ_XCOFF
-
-/* XCOFF specific symbol and file handling. */
-
-/* Canonicalize the symbol name. We use the to force the suffix, if
- any, to use square brackets, and to be in upper case. */
-
-char *
-ppc_canonicalize_symbol_name (char *name)
-{
- char *s;
-
- if (ppc_stab_symbol)
- return name;
-
- for (s = name; *s != '\0' && *s != '{' && *s != '['; s++)
- ;
- if (*s != '\0')
- {
- char brac;
-
- if (*s == '[')
- brac = ']';
- else
- {
- *s = '[';
- brac = '}';
- }
-
- for (s++; *s != '\0' && *s != brac; s++)
- *s = TOUPPER (*s);
-
- if (*s == '\0' || s[1] != '\0')
- as_bad (_("bad symbol suffix"));
-
- *s = ']';
- }
-
- return name;
-}
-
-/* Set the class of a symbol based on the suffix, if any. This is
- called whenever a new symbol is created. */
-
-void
-ppc_symbol_new_hook (symbolS *sym)
-{
- struct ppc_tc_sy *tc;
- const char *s;
-
- tc = symbol_get_tc (sym);
- tc->next = NULL;
- tc->output = 0;
- tc->class = -1;
- tc->real_name = NULL;
- tc->subseg = 0;
- tc->align = 0;
- tc->size = NULL;
- tc->within = NULL;
-
- if (ppc_stab_symbol)
- return;
-
- s = strchr (S_GET_NAME (sym), '[');
- if (s == (const char *) NULL)
- {
- /* There is no suffix. */
- return;
- }
-
- ++s;
-
- switch (s[0])
- {
- case 'B':
- if (strcmp (s, "BS]") == 0)
- tc->class = XMC_BS;
- break;
- case 'D':
- if (strcmp (s, "DB]") == 0)
- tc->class = XMC_DB;
- else if (strcmp (s, "DS]") == 0)
- tc->class = XMC_DS;
- break;
- case 'G':
- if (strcmp (s, "GL]") == 0)
- tc->class = XMC_GL;
- break;
- case 'P':
- if (strcmp (s, "PR]") == 0)
- tc->class = XMC_PR;
- break;
- case 'R':
- if (strcmp (s, "RO]") == 0)
- tc->class = XMC_RO;
- else if (strcmp (s, "RW]") == 0)
- tc->class = XMC_RW;
- break;
- case 'S':
- if (strcmp (s, "SV]") == 0)
- tc->class = XMC_SV;
- break;
- case 'T':
- if (strcmp (s, "TC]") == 0)
- tc->class = XMC_TC;
- else if (strcmp (s, "TI]") == 0)
- tc->class = XMC_TI;
- else if (strcmp (s, "TB]") == 0)
- tc->class = XMC_TB;
- else if (strcmp (s, "TC0]") == 0 || strcmp (s, "T0]") == 0)
- tc->class = XMC_TC0;
- break;
- case 'U':
- if (strcmp (s, "UA]") == 0)
- tc->class = XMC_UA;
- else if (strcmp (s, "UC]") == 0)
- tc->class = XMC_UC;
- break;
- case 'X':
- if (strcmp (s, "XO]") == 0)
- tc->class = XMC_XO;
- break;
- }
-
- if (tc->class == -1)
- as_bad (_("Unrecognized symbol suffix"));
-}
-
-/* Set the class of a label based on where it is defined. This
- handles symbols without suffixes. Also, move the symbol so that it
- follows the csect symbol. */
-
-void
-ppc_frob_label (symbolS *sym)
-{
- if (ppc_current_csect != (symbolS *) NULL)
- {
- if (symbol_get_tc (sym)->class == -1)
- symbol_get_tc (sym)->class = symbol_get_tc (ppc_current_csect)->class;
-
- symbol_remove (sym, &symbol_rootP, &symbol_lastP);
- symbol_append (sym, symbol_get_tc (ppc_current_csect)->within,
- &symbol_rootP, &symbol_lastP);
- symbol_get_tc (ppc_current_csect)->within = sym;
- }
-
-#ifdef OBJ_ELF
- dwarf2_emit_label (sym);
-#endif
-}
-
-/* This variable is set by ppc_frob_symbol if any absolute symbols are
- seen. It tells ppc_adjust_symtab whether it needs to look through
- the symbols. */
-
-static bfd_boolean ppc_saw_abs;
-
-/* Change the name of a symbol just before writing it out. Set the
- real name if the .rename pseudo-op was used. Otherwise, remove any
- class suffix. Return 1 if the symbol should not be included in the
- symbol table. */
-
-int
-ppc_frob_symbol (symbolS *sym)
-{
- static symbolS *ppc_last_function;
- static symbolS *set_end;
-
- /* Discard symbols that should not be included in the output symbol
- table. */
- if (! symbol_used_in_reloc_p (sym)
- && ((symbol_get_bfdsym (sym)->flags & BSF_SECTION_SYM) != 0
- || (! (S_IS_EXTERNAL (sym) || S_IS_WEAK (sym))
- && ! symbol_get_tc (sym)->output
- && S_GET_STORAGE_CLASS (sym) != C_FILE)))
- return 1;
-
- /* This one will disappear anyway. Don't make a csect sym for it. */
- if (sym == abs_section_sym)
- return 1;
-
- if (symbol_get_tc (sym)->real_name != (char *) NULL)
- S_SET_NAME (sym, symbol_get_tc (sym)->real_name);
- else
- {
- const char *name;
- const char *s;
-
- name = S_GET_NAME (sym);
- s = strchr (name, '[');
- if (s != (char *) NULL)
- {
- unsigned int len;
- char *snew;
-
- len = s - name;
- snew = xmalloc (len + 1);
- memcpy (snew, name, len);
- snew[len] = '\0';
-
- S_SET_NAME (sym, snew);
- }
- }
-
- if (set_end != (symbolS *) NULL)
- {
- SA_SET_SYM_ENDNDX (set_end, sym);
- set_end = NULL;
- }
-
- if (SF_GET_FUNCTION (sym))
- {
- if (ppc_last_function != (symbolS *) NULL)
- as_bad (_("two .function pseudo-ops with no intervening .ef"));
- ppc_last_function = sym;
- if (symbol_get_tc (sym)->size != (symbolS *) NULL)
- {
- resolve_symbol_value (symbol_get_tc (sym)->size);
- SA_SET_SYM_FSIZE (sym,
- (long) S_GET_VALUE (symbol_get_tc (sym)->size));
- }
- }
- else if (S_GET_STORAGE_CLASS (sym) == C_FCN
- && strcmp (S_GET_NAME (sym), ".ef") == 0)
- {
- if (ppc_last_function == (symbolS *) NULL)
- as_bad (_(".ef with no preceding .function"));
- else
- {
- set_end = ppc_last_function;
- ppc_last_function = NULL;
-
- /* We don't have a C_EFCN symbol, but we need to force the
- COFF backend to believe that it has seen one. */
- coff_last_function = NULL;
- }
- }
-
- if (! (S_IS_EXTERNAL (sym) || S_IS_WEAK (sym))
- && (symbol_get_bfdsym (sym)->flags & BSF_SECTION_SYM) == 0
- && S_GET_STORAGE_CLASS (sym) != C_FILE
- && S_GET_STORAGE_CLASS (sym) != C_FCN
- && S_GET_STORAGE_CLASS (sym) != C_BLOCK
- && S_GET_STORAGE_CLASS (sym) != C_BSTAT
- && S_GET_STORAGE_CLASS (sym) != C_ESTAT
- && S_GET_STORAGE_CLASS (sym) != C_BINCL
- && S_GET_STORAGE_CLASS (sym) != C_EINCL
- && S_GET_SEGMENT (sym) != ppc_coff_debug_section)
- S_SET_STORAGE_CLASS (sym, C_HIDEXT);
-
- if (S_GET_STORAGE_CLASS (sym) == C_EXT
- || S_GET_STORAGE_CLASS (sym) == C_HIDEXT)
- {
- int i;
- union internal_auxent *a;
-
- /* Create a csect aux. */
- i = S_GET_NUMBER_AUXILIARY (sym);
- S_SET_NUMBER_AUXILIARY (sym, i + 1);
- a = &coffsymbol (symbol_get_bfdsym (sym))->native[i + 1].u.auxent;
- if (symbol_get_tc (sym)->class == XMC_TC0)
- {
- /* This is the TOC table. */
- know (strcmp (S_GET_NAME (sym), "TOC") == 0);
- a->x_csect.x_scnlen.l = 0;
- a->x_csect.x_smtyp = (2 << 3) | XTY_SD;
- }
- else if (symbol_get_tc (sym)->subseg != 0)
- {
- /* This is a csect symbol. x_scnlen is the size of the
- csect. */
- if (symbol_get_tc (sym)->next == (symbolS *) NULL)
- a->x_csect.x_scnlen.l = (bfd_section_size (stdoutput,
- S_GET_SEGMENT (sym))
- - S_GET_VALUE (sym));
- else
- {
- resolve_symbol_value (symbol_get_tc (sym)->next);
- a->x_csect.x_scnlen.l = (S_GET_VALUE (symbol_get_tc (sym)->next)
- - S_GET_VALUE (sym));
- }
- a->x_csect.x_smtyp = (symbol_get_tc (sym)->align << 3) | XTY_SD;
- }
- else if (S_GET_SEGMENT (sym) == bss_section)
- {
- /* This is a common symbol. */
- a->x_csect.x_scnlen.l = symbol_get_frag (sym)->fr_offset;
- a->x_csect.x_smtyp = (symbol_get_tc (sym)->align << 3) | XTY_CM;
- if (S_IS_EXTERNAL (sym))
- symbol_get_tc (sym)->class = XMC_RW;
- else
- symbol_get_tc (sym)->class = XMC_BS;
- }
- else if (S_GET_SEGMENT (sym) == absolute_section)
- {
- /* This is an absolute symbol. The csect will be created by
- ppc_adjust_symtab. */
- ppc_saw_abs = TRUE;
- a->x_csect.x_smtyp = XTY_LD;
- if (symbol_get_tc (sym)->class == -1)
- symbol_get_tc (sym)->class = XMC_XO;
- }
- else if (! S_IS_DEFINED (sym))
- {
- /* This is an external symbol. */
- a->x_csect.x_scnlen.l = 0;
- a->x_csect.x_smtyp = XTY_ER;
- }
- else if (symbol_get_tc (sym)->class == XMC_TC)
- {
- symbolS *next;
-
- /* This is a TOC definition. x_scnlen is the size of the
- TOC entry. */
- next = symbol_next (sym);
- while (symbol_get_tc (next)->class == XMC_TC0)
- next = symbol_next (next);
- if (next == (symbolS *) NULL
- || symbol_get_tc (next)->class != XMC_TC)
- {
- if (ppc_after_toc_frag == (fragS *) NULL)
- a->x_csect.x_scnlen.l = (bfd_section_size (stdoutput,
- data_section)
- - S_GET_VALUE (sym));
- else
- a->x_csect.x_scnlen.l = (ppc_after_toc_frag->fr_address
- - S_GET_VALUE (sym));
- }
- else
- {
- resolve_symbol_value (next);
- a->x_csect.x_scnlen.l = (S_GET_VALUE (next)
- - S_GET_VALUE (sym));
- }
- a->x_csect.x_smtyp = (2 << 3) | XTY_SD;
- }
- else
- {
- symbolS *csect;
-
- /* This is a normal symbol definition. x_scnlen is the
- symbol index of the containing csect. */
- if (S_GET_SEGMENT (sym) == text_section)
- csect = ppc_text_csects;
- else if (S_GET_SEGMENT (sym) == data_section)
- csect = ppc_data_csects;
- else
- abort ();
-
- /* Skip the initial dummy symbol. */
- csect = symbol_get_tc (csect)->next;
-
- if (csect == (symbolS *) NULL)
- {
- as_warn (_("warning: symbol %s has no csect"), S_GET_NAME (sym));
- a->x_csect.x_scnlen.l = 0;
- }
- else
- {
- while (symbol_get_tc (csect)->next != (symbolS *) NULL)
- {
- resolve_symbol_value (symbol_get_tc (csect)->next);
- if (S_GET_VALUE (symbol_get_tc (csect)->next)
- > S_GET_VALUE (sym))
- break;
- csect = symbol_get_tc (csect)->next;
- }
-
- a->x_csect.x_scnlen.p =
- coffsymbol (symbol_get_bfdsym (csect))->native;
- coffsymbol (symbol_get_bfdsym (sym))->native[i + 1].fix_scnlen =
- 1;
- }
- a->x_csect.x_smtyp = XTY_LD;
- }
-
- a->x_csect.x_parmhash = 0;
- a->x_csect.x_snhash = 0;
- if (symbol_get_tc (sym)->class == -1)
- a->x_csect.x_smclas = XMC_PR;
- else
- a->x_csect.x_smclas = symbol_get_tc (sym)->class;
- a->x_csect.x_stab = 0;
- a->x_csect.x_snstab = 0;
-
- /* Don't let the COFF backend resort these symbols. */
- symbol_get_bfdsym (sym)->flags |= BSF_NOT_AT_END;
- }
- else if (S_GET_STORAGE_CLASS (sym) == C_BSTAT)
- {
- /* We want the value to be the symbol index of the referenced
- csect symbol. BFD will do that for us if we set the right
- flags. */
- asymbol *bsym = symbol_get_bfdsym (symbol_get_tc (sym)->within);
- combined_entry_type *c = coffsymbol (bsym)->native;
-
- S_SET_VALUE (sym, (valueT) (size_t) c);
- coffsymbol (symbol_get_bfdsym (sym))->native->fix_value = 1;
- }
- else if (S_GET_STORAGE_CLASS (sym) == C_STSYM)
- {
- symbolS *block;
- symbolS *csect;
-
- /* The value is the offset from the enclosing csect. */
- block = symbol_get_tc (sym)->within;
- csect = symbol_get_tc (block)->within;
- resolve_symbol_value (csect);
- S_SET_VALUE (sym, S_GET_VALUE (sym) - S_GET_VALUE (csect));
- }
- else if (S_GET_STORAGE_CLASS (sym) == C_BINCL
- || S_GET_STORAGE_CLASS (sym) == C_EINCL)
- {
- /* We want the value to be a file offset into the line numbers.
- BFD will do that for us if we set the right flags. We have
- already set the value correctly. */
- coffsymbol (symbol_get_bfdsym (sym))->native->fix_line = 1;
- }
-
- return 0;
-}
-
-/* Adjust the symbol table. This creates csect symbols for all
- absolute symbols. */
-
-void
-ppc_adjust_symtab (void)
-{
- symbolS *sym;
-
- if (! ppc_saw_abs)
- return;
-
- for (sym = symbol_rootP; sym != NULL; sym = symbol_next (sym))
- {
- symbolS *csect;
- int i;
- union internal_auxent *a;
-
- if (S_GET_SEGMENT (sym) != absolute_section)
- continue;
-
- csect = symbol_create (".abs[XO]", absolute_section,
- S_GET_VALUE (sym), &zero_address_frag);
- symbol_get_bfdsym (csect)->value = S_GET_VALUE (sym);
- S_SET_STORAGE_CLASS (csect, C_HIDEXT);
- i = S_GET_NUMBER_AUXILIARY (csect);
- S_SET_NUMBER_AUXILIARY (csect, i + 1);
- a = &coffsymbol (symbol_get_bfdsym (csect))->native[i + 1].u.auxent;
- a->x_csect.x_scnlen.l = 0;
- a->x_csect.x_smtyp = XTY_SD;
- a->x_csect.x_parmhash = 0;
- a->x_csect.x_snhash = 0;
- a->x_csect.x_smclas = XMC_XO;
- a->x_csect.x_stab = 0;
- a->x_csect.x_snstab = 0;
-
- symbol_insert (csect, sym, &symbol_rootP, &symbol_lastP);
-
- i = S_GET_NUMBER_AUXILIARY (sym);
- a = &coffsymbol (symbol_get_bfdsym (sym))->native[i].u.auxent;
- a->x_csect.x_scnlen.p = coffsymbol (symbol_get_bfdsym (csect))->native;
- coffsymbol (symbol_get_bfdsym (sym))->native[i].fix_scnlen = 1;
- }
-
- ppc_saw_abs = FALSE;
-}
-
-/* Set the VMA for a section. This is called on all the sections in
- turn. */
-
-void
-ppc_frob_section (asection *sec)
-{
- static bfd_vma vma = 0;
-
- vma = md_section_align (sec, vma);
- bfd_set_section_vma (stdoutput, sec, vma);
- vma += bfd_section_size (stdoutput, sec);
-}
-
-#endif /* OBJ_XCOFF */
-
-char *
-md_atof (int type, char *litp, int *sizep)
-{
- return ieee_md_atof (type, litp, sizep, target_big_endian);
-}
-
-/* Write a value out to the object file, using the appropriate
- endianness. */
-
-void
-md_number_to_chars (char *buf, valueT val, int n)
-{
- if (target_big_endian)
- number_to_chars_bigendian (buf, val, n);
- else
- number_to_chars_littleendian (buf, val, n);
-}
-
-/* Align a section (I don't know why this is machine dependent). */
-
-valueT
-md_section_align (asection *seg ATTRIBUTE_UNUSED, valueT addr)
-{
-#ifdef OBJ_ELF
- return addr;
-#else
- int align = bfd_get_section_alignment (stdoutput, seg);
-
- return ((addr + (1 << align) - 1) & (-1 << align));
-#endif
-}
-
-/* We don't have any form of relaxing. */
-
-int
-md_estimate_size_before_relax (fragS *fragp ATTRIBUTE_UNUSED,
- asection *seg ATTRIBUTE_UNUSED)
-{
- abort ();
- return 0;
-}
-
-/* Convert a machine dependent frag. We never generate these. */
-
-void
-md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
- asection *sec ATTRIBUTE_UNUSED,
- fragS *fragp ATTRIBUTE_UNUSED)
-{
- abort ();
-}
-
-/* We have no need to default values of symbols. */
-
-symbolS *
-md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
-{
- return 0;
-}
-
-/* Functions concerning relocs. */
-
-/* The location from which a PC relative jump should be calculated,
- given a PC relative reloc. */
-
-long
-md_pcrel_from_section (fixS *fixp, segT sec ATTRIBUTE_UNUSED)
-{
- return fixp->fx_frag->fr_address + fixp->fx_where;
-}
-
-#ifdef OBJ_XCOFF
-
-/* This is called to see whether a fixup should be adjusted to use a
- section symbol. We take the opportunity to change a fixup against
- a symbol in the TOC subsegment into a reloc against the
- corresponding .tc symbol. */
-
-int
-ppc_fix_adjustable (fixS *fix)
-{
- valueT val = resolve_symbol_value (fix->fx_addsy);
- segT symseg = S_GET_SEGMENT (fix->fx_addsy);
- TC_SYMFIELD_TYPE *tc;
-
- if (symseg == absolute_section)
- return 0;
-
- if (ppc_toc_csect != (symbolS *) NULL
- && fix->fx_addsy != ppc_toc_csect
- && symseg == data_section
- && val >= ppc_toc_frag->fr_address
- && (ppc_after_toc_frag == (fragS *) NULL
- || val < ppc_after_toc_frag->fr_address))
- {
- symbolS *sy;
-
- for (sy = symbol_next (ppc_toc_csect);
- sy != (symbolS *) NULL;
- sy = symbol_next (sy))
- {
- TC_SYMFIELD_TYPE *sy_tc = symbol_get_tc (sy);
-
- if (sy_tc->class == XMC_TC0)
- continue;
- if (sy_tc->class != XMC_TC)
- break;
- if (val == resolve_symbol_value (sy))
- {
- fix->fx_addsy = sy;
- fix->fx_addnumber = val - ppc_toc_frag->fr_address;
- return 0;
- }
- }
-
- as_bad_where (fix->fx_file, fix->fx_line,
- _("symbol in .toc does not match any .tc"));
- }
-
- /* Possibly adjust the reloc to be against the csect. */
- tc = symbol_get_tc (fix->fx_addsy);
- if (tc->subseg == 0
- && tc->class != XMC_TC0
- && tc->class != XMC_TC
- && symseg != bss_section
- /* Don't adjust if this is a reloc in the toc section. */
- && (symseg != data_section
- || ppc_toc_csect == NULL
- || val < ppc_toc_frag->fr_address
- || (ppc_after_toc_frag != NULL
- && val >= ppc_after_toc_frag->fr_address)))
- {
- symbolS *csect;
- symbolS *next_csect;
-
- if (symseg == text_section)
- csect = ppc_text_csects;
- else if (symseg == data_section)
- csect = ppc_data_csects;
- else
- abort ();
-
- /* Skip the initial dummy symbol. */
- csect = symbol_get_tc (csect)->next;
-
- if (csect != (symbolS *) NULL)
- {
- while ((next_csect = symbol_get_tc (csect)->next) != (symbolS *) NULL
- && (symbol_get_frag (next_csect)->fr_address <= val))
- {
- /* If the csect address equals the symbol value, then we
- have to look through the full symbol table to see
- whether this is the csect we want. Note that we will
- only get here if the csect has zero length. */
- if (symbol_get_frag (csect)->fr_address == val
- && S_GET_VALUE (csect) == val)
- {
- symbolS *scan;
-
- for (scan = symbol_next (csect);
- scan != NULL;
- scan = symbol_next (scan))
- {
- if (symbol_get_tc (scan)->subseg != 0)
- break;
- if (scan == fix->fx_addsy)
- break;
- }
-
- /* If we found the symbol before the next csect
- symbol, then this is the csect we want. */
- if (scan == fix->fx_addsy)
- break;
- }
-
- csect = next_csect;
- }
-
- fix->fx_offset += val - symbol_get_frag (csect)->fr_address;
- fix->fx_addsy = csect;
- }
- return 0;
- }
-
- /* Adjust a reloc against a .lcomm symbol to be against the base
- .lcomm. */
- if (symseg == bss_section
- && ! S_IS_EXTERNAL (fix->fx_addsy))
- {
- symbolS *sy = symbol_get_frag (fix->fx_addsy)->fr_symbol;
-
- fix->fx_offset += val - resolve_symbol_value (sy);
- fix->fx_addsy = sy;
- }
-
- return 0;
-}
-
-/* A reloc from one csect to another must be kept. The assembler
- will, of course, keep relocs between sections, and it will keep
- absolute relocs, but we need to force it to keep PC relative relocs
- between two csects in the same section. */
-
-int
-ppc_force_relocation (fixS *fix)
-{
- /* At this point fix->fx_addsy should already have been converted to
- a csect symbol. If the csect does not include the fragment, then
- we need to force the relocation. */
- if (fix->fx_pcrel
- && fix->fx_addsy != NULL
- && symbol_get_tc (fix->fx_addsy)->subseg != 0
- && ((symbol_get_frag (fix->fx_addsy)->fr_address
- > fix->fx_frag->fr_address)
- || (symbol_get_tc (fix->fx_addsy)->next != NULL
- && (symbol_get_frag (symbol_get_tc (fix->fx_addsy)->next)->fr_address
- <= fix->fx_frag->fr_address))))
- return 1;
-
- return generic_force_reloc (fix);
-}
-
-#endif /* OBJ_XCOFF */
-
-#ifdef OBJ_ELF
-/* If this function returns non-zero, it guarantees that a relocation
- will be emitted for a fixup. */
-
-int
-ppc_force_relocation (fixS *fix)
-{
- /* Branch prediction relocations must force a relocation, as must
- the vtable description relocs. */
- switch (fix->fx_r_type)
- {
- case BFD_RELOC_PPC_B16_BRTAKEN:
- case BFD_RELOC_PPC_B16_BRNTAKEN:
- case BFD_RELOC_PPC_BA16_BRTAKEN:
- case BFD_RELOC_PPC_BA16_BRNTAKEN:
- case BFD_RELOC_24_PLT_PCREL:
- case BFD_RELOC_PPC64_TOC:
- return 1;
- default:
- break;
- }
-
- if (fix->fx_r_type >= BFD_RELOC_PPC_TLS
- && fix->fx_r_type <= BFD_RELOC_PPC64_DTPREL16_HIGHESTA)
- return 1;
-
- return generic_force_reloc (fix);
-}
-
-int
-ppc_fix_adjustable (fixS *fix)
-{
- return (fix->fx_r_type != BFD_RELOC_16_GOTOFF
- && fix->fx_r_type != BFD_RELOC_LO16_GOTOFF
- && fix->fx_r_type != BFD_RELOC_HI16_GOTOFF
- && fix->fx_r_type != BFD_RELOC_HI16_S_GOTOFF
- && fix->fx_r_type != BFD_RELOC_GPREL16
- && fix->fx_r_type != BFD_RELOC_VTABLE_INHERIT
- && fix->fx_r_type != BFD_RELOC_VTABLE_ENTRY
- && !(fix->fx_r_type >= BFD_RELOC_PPC_TLS
- && fix->fx_r_type <= BFD_RELOC_PPC64_DTPREL16_HIGHESTA));
-}
-#endif
-
-/* Implement HANDLE_ALIGN. This writes the NOP pattern into an
- rs_align_code frag. */
-
-void
-ppc_handle_align (struct frag *fragP)
-{
- valueT count = (fragP->fr_next->fr_address
- - (fragP->fr_address + fragP->fr_fix));
-
- if (count != 0 && (count & 3) == 0)
- {
- char *dest = fragP->fr_literal + fragP->fr_fix;
-
- fragP->fr_var = 4;
- md_number_to_chars (dest, 0x60000000, 4);
-
- if ((ppc_cpu & PPC_OPCODE_POWER6) != 0)
- {
- /* For power6, we want the last nop to be a group terminating
- one, "ori 1,1,0". Do this by inserting an rs_fill frag
- immediately after this one, with its address set to the last
- nop location. This will automatically reduce the number of
- nops in the current frag by one. */
- if (count > 4)
- {
- struct frag *group_nop = xmalloc (SIZEOF_STRUCT_FRAG + 4);
-
- memcpy (group_nop, fragP, SIZEOF_STRUCT_FRAG);
- group_nop->fr_address = group_nop->fr_next->fr_address - 4;
- group_nop->fr_fix = 0;
- group_nop->fr_offset = 1;
- group_nop->fr_type = rs_fill;
- fragP->fr_next = group_nop;
- dest = group_nop->fr_literal;
- }
-
- md_number_to_chars (dest, 0x60210000, 4);
- }
- }
-}
-
-/* Apply a fixup to the object code. This is called for all the
- fixups we generated by the call to fix_new_exp, above. In the call
- above we used a reloc code which was the largest legal reloc code
- plus the operand index. Here we undo that to recover the operand
- index. At this point all symbol values should be fully resolved,
- and we attempt to completely resolve the reloc. If we can not do
- that, we determine the correct reloc code and put it back in the
- fixup. */
-
-void
-md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
-{
- valueT value = * valP;
-
-#ifdef OBJ_ELF
- if (fixP->fx_addsy != NULL)
- {
- /* Hack around bfd_install_relocation brain damage. */
- if (fixP->fx_pcrel)
- value += fixP->fx_frag->fr_address + fixP->fx_where;
- }
- else
- fixP->fx_done = 1;
-#else
- /* FIXME FIXME FIXME: The value we are passed in *valP includes
- the symbol values. If we are doing this relocation the code in
- write.c is going to call bfd_install_relocation, which is also
- going to use the symbol value. That means that if the reloc is
- fully resolved we want to use *valP since bfd_install_relocation is
- not being used.
- However, if the reloc is not fully resolved we do not want to use
- *valP, and must use fx_offset instead. However, if the reloc
- is PC relative, we do want to use *valP since it includes the
- result of md_pcrel_from. This is confusing. */
- if (fixP->fx_addsy == (symbolS *) NULL)
- fixP->fx_done = 1;
-
- else if (fixP->fx_pcrel)
- ;
-
- else
- value = fixP->fx_offset;
-#endif
-
- if (fixP->fx_subsy != (symbolS *) NULL)
- {
- /* We can't actually support subtracting a symbol. */
- as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex"));
- }
-
- if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
- {
- int opindex;
- const struct powerpc_operand *operand;
- char *where;
- unsigned long insn;
-
- opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
-
- operand = &powerpc_operands[opindex];
-
-#ifdef OBJ_XCOFF
- /* An instruction like `lwz 9,sym(30)' when `sym' is not a TOC symbol
- does not generate a reloc. It uses the offset of `sym' within its
- csect. Other usages, such as `.long sym', generate relocs. This
- is the documented behaviour of non-TOC symbols. */
- if ((operand->flags & PPC_OPERAND_PARENS) != 0
- && (operand->bitm & 0xfff0) == 0xfff0
- && operand->shift == 0
- && (operand->insert == NULL || ppc_obj64)
- && fixP->fx_addsy != NULL
- && symbol_get_tc (fixP->fx_addsy)->subseg != 0
- && symbol_get_tc (fixP->fx_addsy)->class != XMC_TC
- && symbol_get_tc (fixP->fx_addsy)->class != XMC_TC0
- && S_GET_SEGMENT (fixP->fx_addsy) != bss_section)
- {
- value = fixP->fx_offset;
- fixP->fx_done = 1;
- }
-#endif
-
- /* Fetch the instruction, insert the fully resolved operand
- value, and stuff the instruction back again. */
- where = fixP->fx_frag->fr_literal + fixP->fx_where;
- if (target_big_endian)
- insn = bfd_getb32 ((unsigned char *) where);
- else
- insn = bfd_getl32 ((unsigned char *) where);
- insn = ppc_insert_operand (insn, operand, (offsetT) value,
- fixP->tc_fix_data.ppc_cpu,
- fixP->fx_file, fixP->fx_line);
- if (target_big_endian)
- bfd_putb32 ((bfd_vma) insn, (unsigned char *) where);
- else
- bfd_putl32 ((bfd_vma) insn, (unsigned char *) where);
-
- if (fixP->fx_done)
- /* Nothing else to do here. */
- return;
-
- assert (fixP->fx_addsy != NULL);
-
- /* Determine a BFD reloc value based on the operand information.
- We are only prepared to turn a few of the operands into
- relocs. */
- if ((operand->flags & PPC_OPERAND_RELATIVE) != 0
- && operand->bitm == 0x3fffffc
- && operand->shift == 0)
- fixP->fx_r_type = BFD_RELOC_PPC_B26;
- else if ((operand->flags & PPC_OPERAND_RELATIVE) != 0
- && operand->bitm == 0xfffc
- && operand->shift == 0)
- {
- fixP->fx_r_type = BFD_RELOC_PPC_B16;
-#ifdef OBJ_XCOFF
- fixP->fx_size = 2;
- if (target_big_endian)
- fixP->fx_where += 2;
-#endif
- }
- else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0
- && operand->bitm == 0x3fffffc
- && operand->shift == 0)
- fixP->fx_r_type = BFD_RELOC_PPC_BA26;
- else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0
- && operand->bitm == 0xfffc
- && operand->shift == 0)
- {
- fixP->fx_r_type = BFD_RELOC_PPC_BA16;
-#ifdef OBJ_XCOFF
- fixP->fx_size = 2;
- if (target_big_endian)
- fixP->fx_where += 2;
-#endif
- }
-#if defined (OBJ_XCOFF) || defined (OBJ_ELF)
- else if ((operand->flags & PPC_OPERAND_PARENS) != 0
- && (operand->bitm & 0xfff0) == 0xfff0
- && operand->shift == 0)
- {
- if (ppc_is_toc_sym (fixP->fx_addsy))
- {
- fixP->fx_r_type = BFD_RELOC_PPC_TOC16;
-#ifdef OBJ_ELF
- if (ppc_obj64
- && (operand->flags & PPC_OPERAND_DS) != 0)
- fixP->fx_r_type = BFD_RELOC_PPC64_TOC16_DS;
-#endif
- }
- else
- {
- fixP->fx_r_type = BFD_RELOC_16;
-#ifdef OBJ_ELF
- if (ppc_obj64
- && (operand->flags & PPC_OPERAND_DS) != 0)
- fixP->fx_r_type = BFD_RELOC_PPC64_ADDR16_DS;
-#endif
- }
- fixP->fx_size = 2;
- if (target_big_endian)
- fixP->fx_where += 2;
- }
-#endif /* defined (OBJ_XCOFF) || defined (OBJ_ELF) */
- else
- {
- char *sfile;
- unsigned int sline;
-
- /* Use expr_symbol_where to see if this is an expression
- symbol. */
- if (expr_symbol_where (fixP->fx_addsy, &sfile, &sline))
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("unresolved expression that must be resolved"));
- else
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("unsupported relocation against %s"),
- S_GET_NAME (fixP->fx_addsy));
- fixP->fx_done = 1;
- return;
- }
- }
- else
- {
-#ifdef OBJ_ELF
- ppc_elf_validate_fix (fixP, seg);
-#endif
- switch (fixP->fx_r_type)
- {
- case BFD_RELOC_CTOR:
- if (ppc_obj64)
- goto ctor64;
- /* fall through */
-
- case BFD_RELOC_32:
- if (fixP->fx_pcrel)
- fixP->fx_r_type = BFD_RELOC_32_PCREL;
- /* fall through */
-
- case BFD_RELOC_RVA:
- case BFD_RELOC_32_PCREL:
- case BFD_RELOC_PPC_EMB_NADDR32:
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
- value, 4);
- break;
-
- case BFD_RELOC_64:
- ctor64:
- if (fixP->fx_pcrel)
- fixP->fx_r_type = BFD_RELOC_64_PCREL;
- /* fall through */
-
- case BFD_RELOC_64_PCREL:
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
- value, 8);
- break;
-
- case BFD_RELOC_GPREL16:
- case BFD_RELOC_16_GOT_PCREL:
- case BFD_RELOC_16_GOTOFF:
- case BFD_RELOC_LO16_GOTOFF:
- case BFD_RELOC_HI16_GOTOFF:
- case BFD_RELOC_HI16_S_GOTOFF:
- case BFD_RELOC_16_BASEREL:
- case BFD_RELOC_LO16_BASEREL:
- case BFD_RELOC_HI16_BASEREL:
- case BFD_RELOC_HI16_S_BASEREL:
- case BFD_RELOC_PPC_EMB_NADDR16:
- case BFD_RELOC_PPC_EMB_NADDR16_LO:
- case BFD_RELOC_PPC_EMB_NADDR16_HI:
- case BFD_RELOC_PPC_EMB_NADDR16_HA:
- case BFD_RELOC_PPC_EMB_SDAI16:
- case BFD_RELOC_PPC_EMB_SDA2REL:
- case BFD_RELOC_PPC_EMB_SDA2I16:
- case BFD_RELOC_PPC_EMB_RELSEC16:
- case BFD_RELOC_PPC_EMB_RELST_LO:
- case BFD_RELOC_PPC_EMB_RELST_HI:
- case BFD_RELOC_PPC_EMB_RELST_HA:
- case BFD_RELOC_PPC_EMB_RELSDA:
- case BFD_RELOC_PPC_TOC16:
-#ifdef OBJ_ELF
- case BFD_RELOC_PPC64_TOC16_LO:
- case BFD_RELOC_PPC64_TOC16_HI:
- case BFD_RELOC_PPC64_TOC16_HA:
-#endif
- if (fixP->fx_pcrel)
- {
- if (fixP->fx_addsy != NULL)
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("cannot emit PC relative %s relocation against %s"),
- bfd_get_reloc_code_name (fixP->fx_r_type),
- S_GET_NAME (fixP->fx_addsy));
- else
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("cannot emit PC relative %s relocation"),
- bfd_get_reloc_code_name (fixP->fx_r_type));
- }
-
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
- value, 2);
- break;
-
- case BFD_RELOC_16:
- if (fixP->fx_pcrel)
- fixP->fx_r_type = BFD_RELOC_16_PCREL;
- /* fall through */
-
- case BFD_RELOC_16_PCREL:
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
- value, 2);
- break;
-
- case BFD_RELOC_LO16:
- if (fixP->fx_pcrel)
- fixP->fx_r_type = BFD_RELOC_LO16_PCREL;
- /* fall through */
-
- case BFD_RELOC_LO16_PCREL:
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
- value, 2);
- break;
-
- /* This case happens when you write, for example,
- lis %r3,(L1-L2)@ha
- where L1 and L2 are defined later. */
- case BFD_RELOC_HI16:
- if (fixP->fx_pcrel)
- fixP->fx_r_type = BFD_RELOC_HI16_PCREL;
- /* fall through */
-
- case BFD_RELOC_HI16_PCREL:
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
- PPC_HI (value), 2);
- break;
-
- case BFD_RELOC_HI16_S:
- if (fixP->fx_pcrel)
- fixP->fx_r_type = BFD_RELOC_HI16_S_PCREL;
- /* fall through */
-
- case BFD_RELOC_HI16_S_PCREL:
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
- PPC_HA (value), 2);
- break;
-
-#ifdef OBJ_ELF
- case BFD_RELOC_PPC64_HIGHER:
- if (fixP->fx_pcrel)
- abort ();
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
- PPC_HIGHER (value), 2);
- break;
-
- case BFD_RELOC_PPC64_HIGHER_S:
- if (fixP->fx_pcrel)
- abort ();
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
- PPC_HIGHERA (value), 2);
- break;
-
- case BFD_RELOC_PPC64_HIGHEST:
- if (fixP->fx_pcrel)
- abort ();
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
- PPC_HIGHEST (value), 2);
- break;
-
- case BFD_RELOC_PPC64_HIGHEST_S:
- if (fixP->fx_pcrel)
- abort ();
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
- PPC_HIGHESTA (value), 2);
- break;
-
- case BFD_RELOC_PPC64_ADDR16_DS:
- case BFD_RELOC_PPC64_ADDR16_LO_DS:
- case BFD_RELOC_PPC64_GOT16_DS:
- case BFD_RELOC_PPC64_GOT16_LO_DS:
- case BFD_RELOC_PPC64_PLT16_LO_DS:
- case BFD_RELOC_PPC64_SECTOFF_DS:
- case BFD_RELOC_PPC64_SECTOFF_LO_DS:
- case BFD_RELOC_PPC64_TOC16_DS:
- case BFD_RELOC_PPC64_TOC16_LO_DS:
- case BFD_RELOC_PPC64_PLTGOT16_DS:
- case BFD_RELOC_PPC64_PLTGOT16_LO_DS:
- if (fixP->fx_pcrel)
- abort ();
- {
- char *where = fixP->fx_frag->fr_literal + fixP->fx_where;
- unsigned long val, mask;
-
- if (target_big_endian)
- val = bfd_getb32 (where - 2);
- else
- val = bfd_getl32 (where);
- mask = 0xfffc;
- /* lq insns reserve the four lsbs. */
- if ((ppc_cpu & PPC_OPCODE_POWER4) != 0
- && (val & (0x3f << 26)) == (56u << 26))
- mask = 0xfff0;
- val |= value & mask;
- if (target_big_endian)
- bfd_putb16 ((bfd_vma) val, where);
- else
- bfd_putl16 ((bfd_vma) val, where);
- }
- break;
-
- case BFD_RELOC_PPC_B16_BRTAKEN:
- case BFD_RELOC_PPC_B16_BRNTAKEN:
- case BFD_RELOC_PPC_BA16_BRTAKEN:
- case BFD_RELOC_PPC_BA16_BRNTAKEN:
- break;
-
- case BFD_RELOC_PPC_TLS:
- break;
-
- case BFD_RELOC_PPC_DTPMOD:
- case BFD_RELOC_PPC_TPREL16:
- case BFD_RELOC_PPC_TPREL16_LO:
- case BFD_RELOC_PPC_TPREL16_HI:
- case BFD_RELOC_PPC_TPREL16_HA:
- case BFD_RELOC_PPC_TPREL:
- case BFD_RELOC_PPC_DTPREL16:
- case BFD_RELOC_PPC_DTPREL16_LO:
- case BFD_RELOC_PPC_DTPREL16_HI:
- case BFD_RELOC_PPC_DTPREL16_HA:
- case BFD_RELOC_PPC_DTPREL:
- case BFD_RELOC_PPC_GOT_TLSGD16:
- case BFD_RELOC_PPC_GOT_TLSGD16_LO:
- case BFD_RELOC_PPC_GOT_TLSGD16_HI:
- case BFD_RELOC_PPC_GOT_TLSGD16_HA:
- case BFD_RELOC_PPC_GOT_TLSLD16:
- case BFD_RELOC_PPC_GOT_TLSLD16_LO:
- case BFD_RELOC_PPC_GOT_TLSLD16_HI:
- case BFD_RELOC_PPC_GOT_TLSLD16_HA:
- case BFD_RELOC_PPC_GOT_TPREL16:
- case BFD_RELOC_PPC_GOT_TPREL16_LO:
- case BFD_RELOC_PPC_GOT_TPREL16_HI:
- case BFD_RELOC_PPC_GOT_TPREL16_HA:
- case BFD_RELOC_PPC_GOT_DTPREL16:
- case BFD_RELOC_PPC_GOT_DTPREL16_LO:
- case BFD_RELOC_PPC_GOT_DTPREL16_HI:
- case BFD_RELOC_PPC_GOT_DTPREL16_HA:
- case BFD_RELOC_PPC64_TPREL16_DS:
- case BFD_RELOC_PPC64_TPREL16_LO_DS:
- case BFD_RELOC_PPC64_TPREL16_HIGHER:
- case BFD_RELOC_PPC64_TPREL16_HIGHERA:
- case BFD_RELOC_PPC64_TPREL16_HIGHEST:
- case BFD_RELOC_PPC64_TPREL16_HIGHESTA:
- case BFD_RELOC_PPC64_DTPREL16_DS:
- case BFD_RELOC_PPC64_DTPREL16_LO_DS:
- case BFD_RELOC_PPC64_DTPREL16_HIGHER:
- case BFD_RELOC_PPC64_DTPREL16_HIGHERA:
- case BFD_RELOC_PPC64_DTPREL16_HIGHEST:
- case BFD_RELOC_PPC64_DTPREL16_HIGHESTA:
- S_SET_THREAD_LOCAL (fixP->fx_addsy);
- break;
-#endif
- /* Because SDA21 modifies the register field, the size is set to 4
- bytes, rather than 2, so offset it here appropriately. */
- case BFD_RELOC_PPC_EMB_SDA21:
- if (fixP->fx_pcrel)
- abort ();
-
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where
- + ((target_big_endian) ? 2 : 0),
- value, 2);
- break;
-
- case BFD_RELOC_8:
- if (fixP->fx_pcrel)
- {
- /* This can occur if there is a bug in the input assembler, eg:
- ".byte <undefined_symbol> - ." */
- if (fixP->fx_addsy)
- as_bad (_("Unable to handle reference to symbol %s"),
- S_GET_NAME (fixP->fx_addsy));
- else
- as_bad (_("Unable to resolve expression"));
- fixP->fx_done = 1;
- }
- else
- md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
- value, 1);
- break;
-
- case BFD_RELOC_24_PLT_PCREL:
- case BFD_RELOC_PPC_LOCAL24PC:
- if (!fixP->fx_pcrel && !fixP->fx_done)
- abort ();
-
- if (fixP->fx_done)
- {
- char *where;
- unsigned long insn;
-
- /* Fetch the instruction, insert the fully resolved operand
- value, and stuff the instruction back again. */
- where = fixP->fx_frag->fr_literal + fixP->fx_where;
- if (target_big_endian)
- insn = bfd_getb32 ((unsigned char *) where);
- else
- insn = bfd_getl32 ((unsigned char *) where);
- if ((value & 3) != 0)
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("must branch to an address a multiple of 4"));
- if ((offsetT) value < -0x40000000
- || (offsetT) value >= 0x40000000)
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("@local or @plt branch destination is too far away, %ld bytes"),
- (long) value);
- insn = insn | (value & 0x03fffffc);
- if (target_big_endian)
- bfd_putb32 ((bfd_vma) insn, (unsigned char *) where);
- else
- bfd_putl32 ((bfd_vma) insn, (unsigned char *) where);
- }
- break;
-
- case BFD_RELOC_VTABLE_INHERIT:
- fixP->fx_done = 0;
- if (fixP->fx_addsy
- && !S_IS_DEFINED (fixP->fx_addsy)
- && !S_IS_WEAK (fixP->fx_addsy))
- S_SET_WEAK (fixP->fx_addsy);
- break;
-
- case BFD_RELOC_VTABLE_ENTRY:
- fixP->fx_done = 0;
- break;
-
-#ifdef OBJ_ELF
- /* Generated by reference to `sym@tocbase'. The sym is
- ignored by the linker. */
- case BFD_RELOC_PPC64_TOC:
- fixP->fx_done = 0;
- break;
-#endif
- default:
- fprintf (stderr,
- _("Gas failure, reloc value %d\n"), fixP->fx_r_type);
- fflush (stderr);
- abort ();
- }
- }
-
-#ifdef OBJ_ELF
- fixP->fx_addnumber = value;
-
- /* PowerPC uses RELA relocs, ie. the reloc addend is stored separately
- from the section contents. If we are going to be emitting a reloc
- then the section contents are immaterial, so don't warn if they
- happen to overflow. Leave such warnings to ld. */
- if (!fixP->fx_done)
- fixP->fx_no_overflow = 1;
-#else
- if (fixP->fx_r_type != BFD_RELOC_PPC_TOC16)
- fixP->fx_addnumber = 0;
- else
- {
-#ifdef TE_PE
- fixP->fx_addnumber = 0;
-#else
- /* We want to use the offset within the toc, not the actual VMA
- of the symbol. */
- fixP->fx_addnumber =
- - bfd_get_section_vma (stdoutput, S_GET_SEGMENT (fixP->fx_addsy))
- - S_GET_VALUE (ppc_toc_csect);
-#endif
- }
-#endif
-}
-
-/* Generate a reloc for a fixup. */
-
-arelent *
-tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
-{
- arelent *reloc;
-
- reloc = (arelent *) xmalloc (sizeof (arelent));
-
- reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
- *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
- reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
- {
- as_bad_where (fixp->fx_file, fixp->fx_line,
- _("reloc %d not supported by object file format"),
- (int) fixp->fx_r_type);
- return NULL;
- }
- reloc->addend = fixp->fx_addnumber;
-
- return reloc;
-}
-
-void
-ppc_cfi_frame_initial_instructions (void)
-{
- cfi_add_CFA_def_cfa (1, 0);
-}
-
-int
-tc_ppc_regname_to_dw2regnum (char *regname)
-{
- unsigned int regnum = -1;
- unsigned int i;
- const char *p;
- char *q;
- static struct { char *name; int dw2regnum; } regnames[] =
- {
- { "sp", 1 }, { "r.sp", 1 }, { "rtoc", 2 }, { "r.toc", 2 },
- { "mq", 64 }, { "lr", 65 }, { "ctr", 66 }, { "ap", 67 },
- { "cr", 70 }, { "xer", 76 }, { "vrsave", 109 }, { "vscr", 110 },
- { "spe_acc", 111 }, { "spefscr", 112 }
- };
-
- for (i = 0; i < ARRAY_SIZE (regnames); ++i)
- if (strcmp (regnames[i].name, regname) == 0)
- return regnames[i].dw2regnum;
-
- if (regname[0] == 'r' || regname[0] == 'f' || regname[0] == 'v')
- {
- p = regname + 1 + (regname[1] == '.');
- regnum = strtoul (p, &q, 10);
- if (p == q || *q || regnum >= 32)
- return -1;
- if (regname[0] == 'f')
- regnum += 32;
- else if (regname[0] == 'v')
- regnum += 77;
- }
- else if (regname[0] == 'c' && regname[1] == 'r')
- {
- p = regname + 2 + (regname[2] == '.');
- if (p[0] < '0' || p[0] > '7' || p[1])
- return -1;
- regnum = p[0] - '0' + 68;
- }
- return regnum;
-}
diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo
deleted file mode 100644
index 2a373da383f..00000000000
--- a/gas/doc/as.texinfo
+++ /dev/null
@@ -1,7180 +0,0 @@
-\input texinfo @c -*-Texinfo-*-
-@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-@c 2001, 2002, 2003, 2004, 2005, 2006, 2007
-@c Free Software Foundation, Inc.
-@c UPDATE!! On future updates--
-@c (1) check for new machine-dep cmdline options in
-@c md_parse_option definitions in config/tc-*.c
-@c (2) for platform-specific directives, examine md_pseudo_op
-@c in config/tc-*.c
-@c (3) for object-format specific directives, examine obj_pseudo_op
-@c in config/obj-*.c
-@c (4) portable directives in potable[] in read.c
-@c %**start of header
-@setfilename as.info
-@c ---config---
-@macro gcctabopt{body}
-@code{\body\}
-@end macro
-@c defaults, config file may override:
-@set have-stabs
-@c ---
-@c man begin NAME
-@c ---
-@include asconfig.texi
-@include bfdver.texi
-@c ---
-@c man end
-@c ---
-@c common OR combinations of conditions
-@ifset COFF
-@set COFF-ELF
-@end ifset
-@ifset ELF
-@set COFF-ELF
-@end ifset
-@ifset AOUT
-@set aout-bout
-@end ifset
-@ifset ARM/Thumb
-@set ARM
-@end ifset
-@ifset BOUT
-@set aout-bout
-@end ifset
-@ifset H8/300
-@set H8
-@end ifset
-@ifset SH
-@set H8
-@end ifset
-@ifset HPPA
-@set abnormal-separator
-@end ifset
-@c ------------
-@ifset GENERIC
-@settitle Using @value{AS}
-@end ifset
-@ifclear GENERIC
-@settitle Using @value{AS} (@value{TARGET})
-@end ifclear
-@setchapternewpage odd
-@c %**end of header
-
-@c @smallbook
-@c @set SMALL
-@c WARE! Some of the machine-dependent sections contain tables of machine
-@c instructions. Except in multi-column format, these tables look silly.
-@c Unfortunately, Texinfo doesn't have a general-purpose multi-col format, so
-@c the multi-col format is faked within @example sections.
-@c
-@c Again unfortunately, the natural size that fits on a page, for these tables,
-@c is different depending on whether or not smallbook is turned on.
-@c This matters, because of order: text flow switches columns at each page
-@c break.
-@c
-@c The format faked in this source works reasonably well for smallbook,
-@c not well for the default large-page format. This manual expects that if you
-@c turn on @smallbook, you will also uncomment the "@set SMALL" to enable the
-@c tables in question. You can turn on one without the other at your
-@c discretion, of course.
-@ifinfo
-@set SMALL
-@c the insn tables look just as silly in info files regardless of smallbook,
-@c might as well show 'em anyways.
-@end ifinfo
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* As: (as). The GNU assembler.
-* Gas: (as). The GNU assembler.
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
-
-@finalout
-@syncodeindex ky cp
-
-@copying
-This file documents the GNU Assembler "@value{AS}".
-
-@c man begin COPYRIGHT
-Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002,
-2006, 2007 Free Software Foundation, Inc.
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1
-or any later version published by the Free Software Foundation;
-with no Invariant Sections, with no Front-Cover Texts, and with no
-Back-Cover Texts. A copy of the license is included in the
-section entitled ``GNU Free Documentation License''.
-
-@c man end
-@end copying
-
-@titlepage
-@title Using @value{AS}
-@subtitle The @sc{gnu} Assembler
-@ifclear GENERIC
-@subtitle for the @value{TARGET} family
-@end ifclear
-@ifset VERSION_PACKAGE
-@sp 1
-@subtitle @value{VERSION_PACKAGE}
-@end ifset
-@sp 1
-@subtitle Version @value{VERSION}
-@sp 1
-@sp 13
-The Free Software Foundation Inc.@: thanks The Nice Computer
-Company of Australia for loaning Dean Elsner to write the
-first (Vax) version of @command{as} for Project @sc{gnu}.
-The proprietors, management and staff of TNCCA thank FSF for
-distracting the boss while they got some work
-done.
-@sp 3
-@author Dean Elsner, Jay Fenlason & friends
-@page
-@tex
-{\parskip=0pt
-\hfill {\it Using {\tt @value{AS}}}\par
-\hfill Edited by Cygnus Support\par
-}
-%"boxit" macro for figures:
-%Modified from Knuth's ``boxit'' macro from TeXbook (answer to exercise 21.3)
-\gdef\boxit#1#2{\vbox{\hrule\hbox{\vrule\kern3pt
- \vbox{\parindent=0pt\parskip=0pt\hsize=#1\kern3pt\strut\hfil
-#2\hfil\strut\kern3pt}\kern3pt\vrule}\hrule}}%box with visible outline
-\gdef\ibox#1#2{\hbox to #1{#2\hfil}\kern8pt}% invisible box
-@end tex
-
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002,
-2006, 2007 Free Software Foundation, Inc.
-
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.1
- or any later version published by the Free Software Foundation;
- with no Invariant Sections, with no Front-Cover Texts, and with no
- Back-Cover Texts. A copy of the license is included in the
- section entitled ``GNU Free Documentation License''.
-
-@end titlepage
-@contents
-
-@ifnottex
-@node Top
-@top Using @value{AS}
-
-This file is a user guide to the @sc{gnu} assembler @command{@value{AS}}
-@ifset VERSION_PACKAGE
-@value{VERSION_PACKAGE}
-@end ifset
-version @value{VERSION}.
-@ifclear GENERIC
-This version of the file describes @command{@value{AS}} configured to generate
-code for @value{TARGET} architectures.
-@end ifclear
-
-This document is distributed under the terms of the GNU Free
-Documentation License. A copy of the license is included in the
-section entitled ``GNU Free Documentation License''.
-
-@menu
-* Overview:: Overview
-* Invoking:: Command-Line Options
-* Syntax:: Syntax
-* Sections:: Sections and Relocation
-* Symbols:: Symbols
-* Expressions:: Expressions
-* Pseudo Ops:: Assembler Directives
-@ifset ELF
-* Object Attributes:: Object Attributes
-@end ifset
-* Machine Dependencies:: Machine Dependent Features
-* Reporting Bugs:: Reporting Bugs
-* Acknowledgements:: Who Did What
-* GNU Free Documentation License:: GNU Free Documentation License
-* AS Index:: AS Index
-@end menu
-@end ifnottex
-
-@node Overview
-@chapter Overview
-@iftex
-This manual is a user guide to the @sc{gnu} assembler @command{@value{AS}}.
-@ifclear GENERIC
-This version of the manual describes @command{@value{AS}} configured to generate
-code for @value{TARGET} architectures.
-@end ifclear
-@end iftex
-
-@cindex invocation summary
-@cindex option summary
-@cindex summary of options
-Here is a brief summary of how to invoke @command{@value{AS}}. For details,
-see @ref{Invoking,,Command-Line Options}.
-
-@c man title AS the portable GNU assembler.
-
-@ignore
-@c man begin SEEALSO
-gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
-@c man end
-@end ignore
-
-@c We don't use deffn and friends for the following because they seem
-@c to be limited to one line for the header.
-@smallexample
-@c man begin SYNOPSIS
-@value{AS} [@b{-a}[@b{cdghlns}][=@var{file}]] [@b{--alternate}] [@b{-D}]
- [@b{--debug-prefix-map} @var{old}=@var{new}]
- [@b{--defsym} @var{sym}=@var{val}] [@b{-f}] [@b{-g}] [@b{--gstabs}]
- [@b{--gstabs+}] [@b{--gdwarf-2}] [@b{--help}] [@b{-I} @var{dir}] [@b{-J}]
- [@b{-K}] [@b{-L}] [@b{--listing-lhs-width}=@var{NUM}]
- [@b{--listing-lhs-width2}=@var{NUM}] [@b{--listing-rhs-width}=@var{NUM}]
- [@b{--listing-cont-lines}=@var{NUM}] [@b{--keep-locals}] [@b{-o}
- @var{objfile}] [@b{-R}] [@b{--reduce-memory-overheads}] [@b{--statistics}]
- [@b{-v}] [@b{-version}] [@b{--version}] [@b{-W}] [@b{--warn}]
- [@b{--fatal-warnings}] [@b{-w}] [@b{-x}] [@b{-Z}] [@b{@@@var{FILE}}]
- [@b{--target-help}] [@var{target-options}]
- [@b{--}|@var{files} @dots{}]
-@c
-@c Target dependent options are listed below. Keep the list sorted.
-@c Add an empty line for separation.
-@ifset ALPHA
-
-@emph{Target Alpha options:}
- [@b{-m@var{cpu}}]
- [@b{-mdebug} | @b{-no-mdebug}]
- [@b{-relax}] [@b{-g}] [@b{-G@var{size}}]
- [@b{-F}] [@b{-32addr}]
-@end ifset
-@ifset ARC
-
-@emph{Target ARC options:}
- [@b{-marc[5|6|7|8]}]
- [@b{-EB}|@b{-EL}]
-@end ifset
-@ifset ARM
-
-@emph{Target ARM options:}
-@c Don't document the deprecated options
- [@b{-mcpu}=@var{processor}[+@var{extension}@dots{}]]
- [@b{-march}=@var{architecture}[+@var{extension}@dots{}]]
- [@b{-mfpu}=@var{floating-point-format}]
- [@b{-mfloat-abi}=@var{abi}]
- [@b{-meabi}=@var{ver}]
- [@b{-mthumb}]
- [@b{-EB}|@b{-EL}]
- [@b{-mapcs-32}|@b{-mapcs-26}|@b{-mapcs-float}|
- @b{-mapcs-reentrant}]
- [@b{-mthumb-interwork}] [@b{-k}]
-@end ifset
-@ifset CRIS
-
-@emph{Target CRIS options:}
- [@b{--underscore} | @b{--no-underscore}]
- [@b{--pic}] [@b{-N}]
- [@b{--emulation=criself} | @b{--emulation=crisaout}]
- [@b{--march=v0_v10} | @b{--march=v10} | @b{--march=v32} | @b{--march=common_v10_v32}]
-@c Deprecated -- deliberately not documented.
-@c [@b{-h}] [@b{-H}]
-@end ifset
-@ifset D10V
-
-@emph{Target D10V options:}
- [@b{-O}]
-@end ifset
-@ifset D30V
-
-@emph{Target D30V options:}
- [@b{-O}|@b{-n}|@b{-N}]
-@end ifset
-@ifset H8
-@c Renesas family chips have no machine-dependent assembler options
-@end ifset
-@ifset HPPA
-@c HPPA has no machine-dependent assembler options (yet).
-@end ifset
-@ifset I80386
-
-@emph{Target i386 options:}
- [@b{--32}|@b{--64}] [@b{-n}]
- [@b{-march}=@var{CPU}[+@var{EXTENSION}@dots{}]] [@b{-mtune}=@var{CPU}]
-@end ifset
-@ifset I960
-
-@emph{Target i960 options:}
-@c see md_parse_option in tc-i960.c
- [@b{-ACA}|@b{-ACA_A}|@b{-ACB}|@b{-ACC}|@b{-AKA}|@b{-AKB}|
- @b{-AKC}|@b{-AMC}]
- [@b{-b}] [@b{-no-relax}]
-@end ifset
-@ifset IA64
-
-@emph{Target IA-64 options:}
- [@b{-mconstant-gp}|@b{-mauto-pic}]
- [@b{-milp32}|@b{-milp64}|@b{-mlp64}|@b{-mp64}]
- [@b{-mle}|@b{mbe}]
- [@b{-mtune=itanium1}|@b{-mtune=itanium2}]
- [@b{-munwind-check=warning}|@b{-munwind-check=error}]
- [@b{-mhint.b=ok}|@b{-mhint.b=warning}|@b{-mhint.b=error}]
- [@b{-x}|@b{-xexplicit}] [@b{-xauto}] [@b{-xdebug}]
-@end ifset
-@ifset IP2K
-
-@emph{Target IP2K options:}
- [@b{-mip2022}|@b{-mip2022ext}]
-@end ifset
-@ifset M32C
-
-@emph{Target M32C options:}
- [@b{-m32c}|@b{-m16c}] [-relax] [-h-tick-hex]
-@end ifset
-@ifset M32R
-
-@emph{Target M32R options:}
- [@b{--m32rx}|@b{--[no-]warn-explicit-parallel-conflicts}|
- @b{--W[n]p}]
-@end ifset
-@ifset M680X0
-
-@emph{Target M680X0 options:}
- [@b{-l}] [@b{-m68000}|@b{-m68010}|@b{-m68020}|@dots{}]
-@end ifset
-@ifset M68HC11
-
-@emph{Target M68HC11 options:}
- [@b{-m68hc11}|@b{-m68hc12}|@b{-m68hcs12}]
- [@b{-mshort}|@b{-mlong}]
- [@b{-mshort-double}|@b{-mlong-double}]
- [@b{--force-long-branches}] [@b{--short-branches}]
- [@b{--strict-direct-mode}] [@b{--print-insn-syntax}]
- [@b{--print-opcodes}] [@b{--generate-example}]
-@end ifset
-@ifset MCORE
-
-@emph{Target MCORE options:}
- [@b{-jsri2bsr}] [@b{-sifilter}] [@b{-relax}]
- [@b{-mcpu=[210|340]}]
-@end ifset
-@ifset MIPS
-
-@emph{Target MIPS options:}
- [@b{-nocpp}] [@b{-EL}] [@b{-EB}] [@b{-O}[@var{optimization level}]]
- [@b{-g}[@var{debug level}]] [@b{-G} @var{num}] [@b{-KPIC}] [@b{-call_shared}]
- [@b{-non_shared}] [@b{-xgot} [@b{-mvxworks-pic}]
- [@b{-mabi}=@var{ABI}] [@b{-32}] [@b{-n32}] [@b{-64}] [@b{-mfp32}] [@b{-mgp32}]
- [@b{-march}=@var{CPU}] [@b{-mtune}=@var{CPU}] [@b{-mips1}] [@b{-mips2}]
- [@b{-mips3}] [@b{-mips4}] [@b{-mips5}] [@b{-mips32}] [@b{-mips32r2}]
- [@b{-mips64}] [@b{-mips64r2}]
- [@b{-construct-floats}] [@b{-no-construct-floats}]
- [@b{-trap}] [@b{-no-break}] [@b{-break}] [@b{-no-trap}]
- [@b{-mfix7000}] [@b{-mno-fix7000}]
- [@b{-mips16}] [@b{-no-mips16}]
- [@b{-msmartmips}] [@b{-mno-smartmips}]
- [@b{-mips3d}] [@b{-no-mips3d}]
- [@b{-mdmx}] [@b{-no-mdmx}]
- [@b{-mdsp}] [@b{-mno-dsp}]
- [@b{-mdspr2}] [@b{-mno-dspr2}]
- [@b{-mmt}] [@b{-mno-mt}]
- [@b{-mdebug}] [@b{-no-mdebug}]
- [@b{-mpdr}] [@b{-mno-pdr}]
-@end ifset
-@ifset MMIX
-
-@emph{Target MMIX options:}
- [@b{--fixed-special-register-names}] [@b{--globalize-symbols}]
- [@b{--gnu-syntax}] [@b{--relax}] [@b{--no-predefined-symbols}]
- [@b{--no-expand}] [@b{--no-merge-gregs}] [@b{-x}]
- [@b{--linker-allocated-gregs}]
-@end ifset
-@ifset PDP11
-
-@emph{Target PDP11 options:}
- [@b{-mpic}|@b{-mno-pic}] [@b{-mall}] [@b{-mno-extensions}]
- [@b{-m}@var{extension}|@b{-mno-}@var{extension}]
- [@b{-m}@var{cpu}] [@b{-m}@var{machine}]
-@end ifset
-@ifset PJ
-
-@emph{Target picoJava options:}
- [@b{-mb}|@b{-me}]
-@end ifset
-@ifset PPC
-
-@emph{Target PowerPC options:}
- [@b{-mpwrx}|@b{-mpwr2}|@b{-mpwr}|@b{-m601}|@b{-mppc}|@b{-mppc32}|@b{-m603}|@b{-m604}|
- @b{-m403}|@b{-m405}|@b{-mppc64}|@b{-m620}|@b{-mppc64bridge}|@b{-mbooke}|
- @b{-mbooke32}|@b{-mbooke64}]
- [@b{-mcom}|@b{-many}|@b{-maltivec}|@b{-mvsx}] [@b{-memb}]
- [@b{-mregnames}|@b{-mno-regnames}]
- [@b{-mrelocatable}|@b{-mrelocatable-lib}]
- [@b{-mlittle}|@b{-mlittle-endian}|@b{-mbig}|@b{-mbig-endian}]
- [@b{-msolaris}|@b{-mno-solaris}]
-@end ifset
-@ifset SPARC
-
-@emph{Target SPARC options:}
-@c The order here is important. See c-sparc.texi.
- [@b{-Av6}|@b{-Av7}|@b{-Av8}|@b{-Asparclet}|@b{-Asparclite}
- @b{-Av8plus}|@b{-Av8plusa}|@b{-Av9}|@b{-Av9a}]
- [@b{-xarch=v8plus}|@b{-xarch=v8plusa}] [@b{-bump}]
- [@b{-32}|@b{-64}]
-@end ifset
-@ifset TIC54X
-
-@emph{Target TIC54X options:}
- [@b{-mcpu=54[123589]}|@b{-mcpu=54[56]lp}] [@b{-mfar-mode}|@b{-mf}]
- [@b{-merrors-to-file} @var{<filename>}|@b{-me} @var{<filename>}]
-@end ifset
-
-@ifset Z80
-
-@emph{Target Z80 options:}
- [@b{-z80}] [@b{-r800}]
- [@b{ -ignore-undocumented-instructions}] [@b{-Wnud}]
- [@b{ -ignore-unportable-instructions}] [@b{-Wnup}]
- [@b{ -warn-undocumented-instructions}] [@b{-Wud}]
- [@b{ -warn-unportable-instructions}] [@b{-Wup}]
- [@b{ -forbid-undocumented-instructions}] [@b{-Fud}]
- [@b{ -forbid-unportable-instructions}] [@b{-Fup}]
-@end ifset
-
-@ifset Z8000
-@c Z8000 has no machine-dependent assembler options
-@end ifset
-@ifset XTENSA
-
-@emph{Target Xtensa options:}
- [@b{--[no-]text-section-literals}] [@b{--[no-]absolute-literals}]
- [@b{--[no-]target-align}] [@b{--[no-]longcalls}]
- [@b{--[no-]transform}]
- [@b{--rename-section} @var{oldname}=@var{newname}]
-@end ifset
-@c man end
-@end smallexample
-
-@c man begin OPTIONS
-
-@table @gcctabopt
-@include at-file.texi
-
-@item -a[cdghlmns]
-Turn on listings, in any of a variety of ways:
-
-@table @gcctabopt
-@item -ac
-omit false conditionals
-
-@item -ad
-omit debugging directives
-
-@item -ag
-include general information, like @value{AS} version and options passed
-
-@item -ah
-include high-level source
-
-@item -al
-include assembly
-
-@item -am
-include macro expansions
-
-@item -an
-omit forms processing
-
-@item -as
-include symbols
-
-@item =file
-set the name of the listing file
-@end table
-
-You may combine these options; for example, use @samp{-aln} for assembly
-listing without forms processing. The @samp{=file} option, if used, must be
-the last one. By itself, @samp{-a} defaults to @samp{-ahls}.
-
-@item --alternate
-Begin in alternate macro mode.
-@ifclear man
-@xref{Altmacro,,@code{.altmacro}}.
-@end ifclear
-
-@item -D
-Ignored. This option is accepted for script compatibility with calls to
-other assemblers.
-
-@item --debug-prefix-map @var{old}=@var{new}
-When assembling files in directory @file{@var{old}}, record debugging
-information describing them as in @file{@var{new}} instead.
-
-@item --defsym @var{sym}=@var{value}
-Define the symbol @var{sym} to be @var{value} before assembling the input file.
-@var{value} must be an integer constant. As in C, a leading @samp{0x}
-indicates a hexadecimal value, and a leading @samp{0} indicates an octal
-value. The value of the symbol can be overridden inside a source file via the
-use of a @code{.set} pseudo-op.
-
-@item -f
-``fast''---skip whitespace and comment preprocessing (assume source is
-compiler output).
-
-@item -g
-@itemx --gen-debug
-Generate debugging information for each assembler source line using whichever
-debug format is preferred by the target. This currently means either STABS,
-ECOFF or DWARF2.
-
-@item --gstabs
-Generate stabs debugging information for each assembler line. This
-may help debugging assembler code, if the debugger can handle it.
-
-@item --gstabs+
-Generate stabs debugging information for each assembler line, with GNU
-extensions that probably only gdb can handle, and that could make other
-debuggers crash or refuse to read your program. This
-may help debugging assembler code. Currently the only GNU extension is
-the location of the current working directory at assembling time.
-
-@item --gdwarf-2
-Generate DWARF2 debugging information for each assembler line. This
-may help debugging assembler code, if the debugger can handle it. Note---this
-option is only supported by some targets, not all of them.
-
-@item --help
-Print a summary of the command line options and exit.
-
-@item --target-help
-Print a summary of all target specific options and exit.
-
-@item -I @var{dir}
-Add directory @var{dir} to the search list for @code{.include} directives.
-
-@item -J
-Don't warn about signed overflow.
-
-@item -K
-@ifclear DIFF-TBL-KLUGE
-This option is accepted but has no effect on the @value{TARGET} family.
-@end ifclear
-@ifset DIFF-TBL-KLUGE
-Issue warnings when difference tables altered for long displacements.
-@end ifset
-
-@item -L
-@itemx --keep-locals
-Keep (in the symbol table) local symbols. These symbols start with
-system-specific local label prefixes, typically @samp{.L} for ELF systems
-or @samp{L} for traditional a.out systems.
-@ifclear man
-@xref{Symbol Names}.
-@end ifclear
-
-@item --listing-lhs-width=@var{number}
-Set the maximum width, in words, of the output data column for an assembler
-listing to @var{number}.
-
-@item --listing-lhs-width2=@var{number}
-Set the maximum width, in words, of the output data column for continuation
-lines in an assembler listing to @var{number}.
-
-@item --listing-rhs-width=@var{number}
-Set the maximum width of an input source line, as displayed in a listing, to
-@var{number} bytes.
-
-@item --listing-cont-lines=@var{number}
-Set the maximum number of lines printed in a listing for a single line of input
-to @var{number} + 1.
-
-@item -o @var{objfile}
-Name the object-file output from @command{@value{AS}} @var{objfile}.
-
-@item -R
-Fold the data section into the text section.
-
-@kindex --hash-size=@var{number}
-Set the default size of GAS's hash tables to a prime number close to
-@var{number}. Increasing this value can reduce the length of time it takes the
-assembler to perform its tasks, at the expense of increasing the assembler's
-memory requirements. Similarly reducing this value can reduce the memory
-requirements at the expense of speed.
-
-@item --reduce-memory-overheads
-This option reduces GAS's memory requirements, at the expense of making the
-assembly processes slower. Currently this switch is a synonym for
-@samp{--hash-size=4051}, but in the future it may have other effects as well.
-
-@item --statistics
-Print the maximum space (in bytes) and total time (in seconds) used by
-assembly.
-
-@item --strip-local-absolute
-Remove local absolute symbols from the outgoing symbol table.
-
-@item -v
-@itemx -version
-Print the @command{as} version.
-
-@item --version
-Print the @command{as} version and exit.
-
-@item -W
-@itemx --no-warn
-Suppress warning messages.
-
-@item --fatal-warnings
-Treat warnings as errors.
-
-@item --warn
-Don't suppress warning messages or treat them as errors.
-
-@item -w
-Ignored.
-
-@item -x
-Ignored.
-
-@item -Z
-Generate an object file even after errors.
-
-@item -- | @var{files} @dots{}
-Standard input, or source files to assemble.
-
-@end table
-
-@ifset ARC
-The following options are available when @value{AS} is configured for
-an ARC processor.
-
-@table @gcctabopt
-@item -marc[5|6|7|8]
-This option selects the core processor variant.
-@item -EB | -EL
-Select either big-endian (-EB) or little-endian (-EL) output.
-@end table
-@end ifset
-
-@ifset ARM
-The following options are available when @value{AS} is configured for the ARM
-processor family.
-
-@table @gcctabopt
-@item -mcpu=@var{processor}[+@var{extension}@dots{}]
-Specify which ARM processor variant is the target.
-@item -march=@var{architecture}[+@var{extension}@dots{}]
-Specify which ARM architecture variant is used by the target.
-@item -mfpu=@var{floating-point-format}
-Select which Floating Point architecture is the target.
-@item -mfloat-abi=@var{abi}
-Select which floating point ABI is in use.
-@item -mthumb
-Enable Thumb only instruction decoding.
-@item -mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant
-Select which procedure calling convention is in use.
-@item -EB | -EL
-Select either big-endian (-EB) or little-endian (-EL) output.
-@item -mthumb-interwork
-Specify that the code has been generated with interworking between Thumb and
-ARM code in mind.
-@item -k
-Specify that PIC code has been generated.
-@end table
-@end ifset
-
-@ifset CRIS
-See the info pages for documentation of the CRIS-specific options.
-@end ifset
-
-@ifset D10V
-The following options are available when @value{AS} is configured for
-a D10V processor.
-@table @gcctabopt
-@cindex D10V optimization
-@cindex optimization, D10V
-@item -O
-Optimize output by parallelizing instructions.
-@end table
-@end ifset
-
-@ifset D30V
-The following options are available when @value{AS} is configured for a D30V
-processor.
-@table @gcctabopt
-@cindex D30V optimization
-@cindex optimization, D30V
-@item -O
-Optimize output by parallelizing instructions.
-
-@cindex D30V nops
-@item -n
-Warn when nops are generated.
-
-@cindex D30V nops after 32-bit multiply
-@item -N
-Warn when a nop after a 32-bit multiply instruction is generated.
-@end table
-@end ifset
-
-@ifset I960
-The following options are available when @value{AS} is configured for the
-Intel 80960 processor.
-
-@table @gcctabopt
-@item -ACA | -ACA_A | -ACB | -ACC | -AKA | -AKB | -AKC | -AMC
-Specify which variant of the 960 architecture is the target.
-
-@item -b
-Add code to collect statistics about branches taken.
-
-@item -no-relax
-Do not alter compare-and-branch instructions for long displacements;
-error if necessary.
-
-@end table
-@end ifset
-
-@ifset IP2K
-The following options are available when @value{AS} is configured for the
-Ubicom IP2K series.
-
-@table @gcctabopt
-
-@item -mip2022ext
-Specifies that the extended IP2022 instructions are allowed.
-
-@item -mip2022
-Restores the default behaviour, which restricts the permitted instructions to
-just the basic IP2022 ones.
-
-@end table
-@end ifset
-
-@ifset M32C
-The following options are available when @value{AS} is configured for the
-Renesas M32C and M16C processors.
-
-@table @gcctabopt
-
-@item -m32c
-Assemble M32C instructions.
-
-@item -m16c
-Assemble M16C instructions (the default).
-
-@item -relax
-Enable support for link-time relaxations.
-
-@item -h-tick-hex
-Support H'00 style hex constants in addition to 0x00 style.
-
-@end table
-@end ifset
-
-@ifset M32R
-The following options are available when @value{AS} is configured for the
-Renesas M32R (formerly Mitsubishi M32R) series.
-
-@table @gcctabopt
-
-@item --m32rx
-Specify which processor in the M32R family is the target. The default
-is normally the M32R, but this option changes it to the M32RX.
-
-@item --warn-explicit-parallel-conflicts or --Wp
-Produce warning messages when questionable parallel constructs are
-encountered.
-
-@item --no-warn-explicit-parallel-conflicts or --Wnp
-Do not produce warning messages when questionable parallel constructs are
-encountered.
-
-@end table
-@end ifset
-
-@ifset M680X0
-The following options are available when @value{AS} is configured for the
-Motorola 68000 series.
-
-@table @gcctabopt
-
-@item -l
-Shorten references to undefined symbols, to one word instead of two.
-
-@item -m68000 | -m68008 | -m68010 | -m68020 | -m68030
-@itemx | -m68040 | -m68060 | -m68302 | -m68331 | -m68332
-@itemx | -m68333 | -m68340 | -mcpu32 | -m5200
-Specify what processor in the 68000 family is the target. The default
-is normally the 68020, but this can be changed at configuration time.
-
-@item -m68881 | -m68882 | -mno-68881 | -mno-68882
-The target machine does (or does not) have a floating-point coprocessor.
-The default is to assume a coprocessor for 68020, 68030, and cpu32. Although
-the basic 68000 is not compatible with the 68881, a combination of the
-two can be specified, since it's possible to do emulation of the
-coprocessor instructions with the main processor.
-
-@item -m68851 | -mno-68851
-The target machine does (or does not) have a memory-management
-unit coprocessor. The default is to assume an MMU for 68020 and up.
-
-@end table
-@end ifset
-
-@ifset PDP11
-
-For details about the PDP-11 machine dependent features options,
-see @ref{PDP-11-Options}.
-
-@table @gcctabopt
-@item -mpic | -mno-pic
-Generate position-independent (or position-dependent) code. The
-default is @option{-mpic}.
-
-@item -mall
-@itemx -mall-extensions
-Enable all instruction set extensions. This is the default.
-
-@item -mno-extensions
-Disable all instruction set extensions.
-
-@item -m@var{extension} | -mno-@var{extension}
-Enable (or disable) a particular instruction set extension.
-
-@item -m@var{cpu}
-Enable the instruction set extensions supported by a particular CPU, and
-disable all other extensions.
-
-@item -m@var{machine}
-Enable the instruction set extensions supported by a particular machine
-model, and disable all other extensions.
-@end table
-
-@end ifset
-
-@ifset PJ
-The following options are available when @value{AS} is configured for
-a picoJava processor.
-
-@table @gcctabopt
-
-@cindex PJ endianness
-@cindex endianness, PJ
-@cindex big endian output, PJ
-@item -mb
-Generate ``big endian'' format output.
-
-@cindex little endian output, PJ
-@item -ml
-Generate ``little endian'' format output.
-
-@end table
-@end ifset
-
-@ifset M68HC11
-The following options are available when @value{AS} is configured for the
-Motorola 68HC11 or 68HC12 series.
-
-@table @gcctabopt
-
-@item -m68hc11 | -m68hc12 | -m68hcs12
-Specify what processor is the target. The default is
-defined by the configuration option when building the assembler.
-
-@item -mshort
-Specify to use the 16-bit integer ABI.
-
-@item -mlong
-Specify to use the 32-bit integer ABI.
-
-@item -mshort-double
-Specify to use the 32-bit double ABI.
-
-@item -mlong-double
-Specify to use the 64-bit double ABI.
-
-@item --force-long-branches
-Relative branches are turned into absolute ones. This concerns
-conditional branches, unconditional branches and branches to a
-sub routine.
-
-@item -S | --short-branches
-Do not turn relative branches into absolute ones
-when the offset is out of range.
-
-@item --strict-direct-mode
-Do not turn the direct addressing mode into extended addressing mode
-when the instruction does not support direct addressing mode.
-
-@item --print-insn-syntax
-Print the syntax of instruction in case of error.
-
-@item --print-opcodes
-print the list of instructions with syntax and then exit.
-
-@item --generate-example
-print an example of instruction for each possible instruction and then exit.
-This option is only useful for testing @command{@value{AS}}.
-
-@end table
-@end ifset
-
-@ifset SPARC
-The following options are available when @command{@value{AS}} is configured
-for the SPARC architecture:
-
-@table @gcctabopt
-@item -Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite
-@itemx -Av8plus | -Av8plusa | -Av9 | -Av9a
-Explicitly select a variant of the SPARC architecture.
-
-@samp{-Av8plus} and @samp{-Av8plusa} select a 32 bit environment.
-@samp{-Av9} and @samp{-Av9a} select a 64 bit environment.
-
-@samp{-Av8plusa} and @samp{-Av9a} enable the SPARC V9 instruction set with
-UltraSPARC extensions.
-
-@item -xarch=v8plus | -xarch=v8plusa
-For compatibility with the Solaris v9 assembler. These options are
-equivalent to -Av8plus and -Av8plusa, respectively.
-
-@item -bump
-Warn when the assembler switches to another architecture.
-@end table
-@end ifset
-
-@ifset TIC54X
-The following options are available when @value{AS} is configured for the 'c54x
-architecture.
-
-@table @gcctabopt
-@item -mfar-mode
-Enable extended addressing mode. All addresses and relocations will assume
-extended addressing (usually 23 bits).
-@item -mcpu=@var{CPU_VERSION}
-Sets the CPU version being compiled for.
-@item -merrors-to-file @var{FILENAME}
-Redirect error output to a file, for broken systems which don't support such
-behaviour in the shell.
-@end table
-@end ifset
-
-@ifset MIPS
-The following options are available when @value{AS} is configured for
-a @sc{mips} processor.
-
-@table @gcctabopt
-@item -G @var{num}
-This option sets the largest size of an object that can be referenced
-implicitly with the @code{gp} register. It is only accepted for targets that
-use ECOFF format, such as a DECstation running Ultrix. The default value is 8.
-
-@cindex MIPS endianness
-@cindex endianness, MIPS
-@cindex big endian output, MIPS
-@item -EB
-Generate ``big endian'' format output.
-
-@cindex little endian output, MIPS
-@item -EL
-Generate ``little endian'' format output.
-
-@cindex MIPS ISA
-@item -mips1
-@itemx -mips2
-@itemx -mips3
-@itemx -mips4
-@itemx -mips5
-@itemx -mips32
-@itemx -mips32r2
-@itemx -mips64
-@itemx -mips64r2
-Generate code for a particular @sc{mips} Instruction Set Architecture level.
-@samp{-mips1} is an alias for @samp{-march=r3000}, @samp{-mips2} is an
-alias for @samp{-march=r6000}, @samp{-mips3} is an alias for
-@samp{-march=r4000} and @samp{-mips4} is an alias for @samp{-march=r8000}.
-@samp{-mips5}, @samp{-mips32}, @samp{-mips32r2}, @samp{-mips64}, and
-@samp{-mips64r2}
-correspond to generic
-@samp{MIPS V}, @samp{MIPS32}, @samp{MIPS32 Release 2}, @samp{MIPS64},
-and @samp{MIPS64 Release 2}
-ISA processors, respectively.
-
-@item -march=@var{CPU}
-Generate code for a particular @sc{mips} cpu.
-
-@item -mtune=@var{cpu}
-Schedule and tune for a particular @sc{mips} cpu.
-
-@item -mfix7000
-@itemx -mno-fix7000
-Cause nops to be inserted if the read of the destination register
-of an mfhi or mflo instruction occurs in the following two instructions.
-
-@item -mdebug
-@itemx -no-mdebug
-Cause stabs-style debugging output to go into an ECOFF-style .mdebug
-section instead of the standard ELF .stabs sections.
-
-@item -mpdr
-@itemx -mno-pdr
-Control generation of @code{.pdr} sections.
-
-@item -mgp32
-@itemx -mfp32
-The register sizes are normally inferred from the ISA and ABI, but these
-flags force a certain group of registers to be treated as 32 bits wide at
-all times. @samp{-mgp32} controls the size of general-purpose registers
-and @samp{-mfp32} controls the size of floating-point registers.
-
-@item -mips16
-@itemx -no-mips16
-Generate code for the MIPS 16 processor. This is equivalent to putting
-@code{.set mips16} at the start of the assembly file. @samp{-no-mips16}
-turns off this option.
-
-@item -msmartmips
-@itemx -mno-smartmips
-Enables the SmartMIPS extension to the MIPS32 instruction set. This is
-equivalent to putting @code{.set smartmips} at the start of the assembly file.
-@samp{-mno-smartmips} turns off this option.
-
-@item -mips3d
-@itemx -no-mips3d
-Generate code for the MIPS-3D Application Specific Extension.
-This tells the assembler to accept MIPS-3D instructions.
-@samp{-no-mips3d} turns off this option.
-
-@item -mdmx
-@itemx -no-mdmx
-Generate code for the MDMX Application Specific Extension.
-This tells the assembler to accept MDMX instructions.
-@samp{-no-mdmx} turns off this option.
-
-@item -mdsp
-@itemx -mno-dsp
-Generate code for the DSP Release 1 Application Specific Extension.
-This tells the assembler to accept DSP Release 1 instructions.
-@samp{-mno-dsp} turns off this option.
-
-@item -mdspr2
-@itemx -mno-dspr2
-Generate code for the DSP Release 2 Application Specific Extension.
-This option implies -mdsp.
-This tells the assembler to accept DSP Release 2 instructions.
-@samp{-mno-dspr2} turns off this option.
-
-@item -mmt
-@itemx -mno-mt
-Generate code for the MT Application Specific Extension.
-This tells the assembler to accept MT instructions.
-@samp{-mno-mt} turns off this option.
-
-@item --construct-floats
-@itemx --no-construct-floats
-The @samp{--no-construct-floats} option disables the construction of
-double width floating point constants by loading the two halves of the
-value into the two single width floating point registers that make up
-the double width register. By default @samp{--construct-floats} is
-selected, allowing construction of these floating point constants.
-
-@cindex emulation
-@item --emulation=@var{name}
-This option causes @command{@value{AS}} to emulate @command{@value{AS}} configured
-for some other target, in all respects, including output format (choosing
-between ELF and ECOFF only), handling of pseudo-opcodes which may generate
-debugging information or store symbol table information, and default
-endianness. The available configuration names are: @samp{mipsecoff},
-@samp{mipself}, @samp{mipslecoff}, @samp{mipsbecoff}, @samp{mipslelf},
-@samp{mipsbelf}. The first two do not alter the default endianness from that
-of the primary target for which the assembler was configured; the others change
-the default to little- or big-endian as indicated by the @samp{b} or @samp{l}
-in the name. Using @samp{-EB} or @samp{-EL} will override the endianness
-selection in any case.
-
-This option is currently supported only when the primary target
-@command{@value{AS}} is configured for is a @sc{mips} ELF or ECOFF target.
-Furthermore, the primary target or others specified with
-@samp{--enable-targets=@dots{}} at configuration time must include support for
-the other format, if both are to be available. For example, the Irix 5
-configuration includes support for both.
-
-Eventually, this option will support more configurations, with more
-fine-grained control over the assembler's behavior, and will be supported for
-more processors.
-
-@item -nocpp
-@command{@value{AS}} ignores this option. It is accepted for compatibility with
-the native tools.
-
-@item --trap
-@itemx --no-trap
-@itemx --break
-@itemx --no-break
-Control how to deal with multiplication overflow and division by zero.
-@samp{--trap} or @samp{--no-break} (which are synonyms) take a trap exception
-(and only work for Instruction Set Architecture level 2 and higher);
-@samp{--break} or @samp{--no-trap} (also synonyms, and the default) take a
-break exception.
-
-@item -n
-When this option is used, @command{@value{AS}} will issue a warning every
-time it generates a nop instruction from a macro.
-@end table
-@end ifset
-
-@ifset MCORE
-The following options are available when @value{AS} is configured for
-an MCore processor.
-
-@table @gcctabopt
-@item -jsri2bsr
-@itemx -nojsri2bsr
-Enable or disable the JSRI to BSR transformation. By default this is enabled.
-The command line option @samp{-nojsri2bsr} can be used to disable it.
-
-@item -sifilter
-@itemx -nosifilter
-Enable or disable the silicon filter behaviour. By default this is disabled.
-The default can be overridden by the @samp{-sifilter} command line option.
-
-@item -relax
-Alter jump instructions for long displacements.
-
-@item -mcpu=[210|340]
-Select the cpu type on the target hardware. This controls which instructions
-can be assembled.
-
-@item -EB
-Assemble for a big endian target.
-
-@item -EL
-Assemble for a little endian target.
-
-@end table
-@end ifset
-
-@ifset MMIX
-See the info pages for documentation of the MMIX-specific options.
-@end ifset
-
-@ifset XTENSA
-The following options are available when @value{AS} is configured for
-an Xtensa processor.
-
-@table @gcctabopt
-@item --text-section-literals | --no-text-section-literals
-With @option{--text-@-section-@-literals}, literal pools are interspersed
-in the text section. The default is
-@option{--no-@-text-@-section-@-literals}, which places literals in a
-separate section in the output file. These options only affect literals
-referenced via PC-relative @code{L32R} instructions; literals for
-absolute mode @code{L32R} instructions are handled separately.
-
-@item --absolute-literals | --no-absolute-literals
-Indicate to the assembler whether @code{L32R} instructions use absolute
-or PC-relative addressing. The default is to assume absolute addressing
-if the Xtensa processor includes the absolute @code{L32R} addressing
-option. Otherwise, only the PC-relative @code{L32R} mode can be used.
-
-@item --target-align | --no-target-align
-Enable or disable automatic alignment to reduce branch penalties at the
-expense of some code density. The default is @option{--target-@-align}.
-
-@item --longcalls | --no-longcalls
-Enable or disable transformation of call instructions to allow calls
-across a greater range of addresses. The default is
-@option{--no-@-longcalls}.
-
-@item --transform | --no-transform
-Enable or disable all assembler transformations of Xtensa instructions.
-The default is @option{--transform};
-@option{--no-transform} should be used only in the rare cases when the
-instructions must be exactly as specified in the assembly source.
-
-@item --rename-section @var{oldname}=@var{newname}
-When generating output sections, rename the @var{oldname} section to
-@var{newname}.
-@end table
-@end ifset
-
-@ifset Z80
-The following options are available when @value{AS} is configured for
-a Z80 family processor.
-@table @gcctabopt
-@item -z80
-Assemble for Z80 processor.
-@item -r800
-Assemble for R800 processor.
-@item -ignore-undocumented-instructions
-@itemx -Wnud
-Assemble undocumented Z80 instructions that also work on R800 without warning.
-@item -ignore-unportable-instructions
-@itemx -Wnup
-Assemble all undocumented Z80 instructions without warning.
-@item -warn-undocumented-instructions
-@itemx -Wud
-Issue a warning for undocumented Z80 instructions that also work on R800.
-@item -warn-unportable-instructions
-@itemx -Wup
-Issue a warning for undocumented Z80 instructions that do not work on R800.
-@item -forbid-undocumented-instructions
-@itemx -Fud
-Treat all undocumented instructions as errors.
-@item -forbid-unportable-instructions
-@itemx -Fup
-Treat undocumented Z80 instructions that do not work on R800 as errors.
-@end table
-@end ifset
-
-@c man end
-
-@menu
-* Manual:: Structure of this Manual
-* GNU Assembler:: The GNU Assembler
-* Object Formats:: Object File Formats
-* Command Line:: Command Line
-* Input Files:: Input Files
-* Object:: Output (Object) File
-* Errors:: Error and Warning Messages
-@end menu
-
-@node Manual
-@section Structure of this Manual
-
-@cindex manual, structure and purpose
-This manual is intended to describe what you need to know to use
-@sc{gnu} @command{@value{AS}}. We cover the syntax expected in source files, including
-notation for symbols, constants, and expressions; the directives that
-@command{@value{AS}} understands; and of course how to invoke @command{@value{AS}}.
-
-@ifclear GENERIC
-We also cover special features in the @value{TARGET}
-configuration of @command{@value{AS}}, including assembler directives.
-@end ifclear
-@ifset GENERIC
-This manual also describes some of the machine-dependent features of
-various flavors of the assembler.
-@end ifset
-
-@cindex machine instructions (not covered)
-On the other hand, this manual is @emph{not} intended as an introduction
-to programming in assembly language---let alone programming in general!
-In a similar vein, we make no attempt to introduce the machine
-architecture; we do @emph{not} describe the instruction set, standard
-mnemonics, registers or addressing modes that are standard to a
-particular architecture.
-@ifset GENERIC
-You may want to consult the manufacturer's
-machine architecture manual for this information.
-@end ifset
-@ifclear GENERIC
-@ifset H8/300
-For information on the H8/300 machine instruction set, see @cite{H8/300
-Series Programming Manual}. For the H8/300H, see @cite{H8/300H Series
-Programming Manual} (Renesas).
-@end ifset
-@ifset SH
-For information on the Renesas (formerly Hitachi) / SuperH SH machine instruction set,
-see @cite{SH-Microcomputer User's Manual} (Renesas) or
-@cite{SH-4 32-bit CPU Core Architecture} (SuperH) and
-@cite{SuperH (SH) 64-Bit RISC Series} (SuperH).
-@end ifset
-@ifset Z8000
-For information on the Z8000 machine instruction set, see @cite{Z8000 CPU Technical Manual}
-@end ifset
-@end ifclear
-
-@c I think this is premature---doc@cygnus.com, 17jan1991
-@ignore
-Throughout this manual, we assume that you are running @dfn{GNU},
-the portable operating system from the @dfn{Free Software
-Foundation, Inc.}. This restricts our attention to certain kinds of
-computer (in particular, the kinds of computers that @sc{gnu} can run on);
-once this assumption is granted examples and definitions need less
-qualification.
-
-@command{@value{AS}} is part of a team of programs that turn a high-level
-human-readable series of instructions into a low-level
-computer-readable series of instructions. Different versions of
-@command{@value{AS}} are used for different kinds of computer.
-@end ignore
-
-@c There used to be a section "Terminology" here, which defined
-@c "contents", "byte", "word", and "long". Defining "word" to any
-@c particular size is confusing when the .word directive may generate 16
-@c bits on one machine and 32 bits on another; in general, for the user
-@c version of this manual, none of these terms seem essential to define.
-@c They were used very little even in the former draft of the manual;
-@c this draft makes an effort to avoid them (except in names of
-@c directives).
-
-@node GNU Assembler
-@section The GNU Assembler
-
-@c man begin DESCRIPTION
-
-@sc{gnu} @command{as} is really a family of assemblers.
-@ifclear GENERIC
-This manual describes @command{@value{AS}}, a member of that family which is
-configured for the @value{TARGET} architectures.
-@end ifclear
-If you use (or have used) the @sc{gnu} assembler on one architecture, you
-should find a fairly similar environment when you use it on another
-architecture. Each version has much in common with the others,
-including object file formats, most assembler directives (often called
-@dfn{pseudo-ops}) and assembler syntax.@refill
-
-@cindex purpose of @sc{gnu} assembler
-@command{@value{AS}} is primarily intended to assemble the output of the
-@sc{gnu} C compiler @code{@value{GCC}} for use by the linker
-@code{@value{LD}}. Nevertheless, we've tried to make @command{@value{AS}}
-assemble correctly everything that other assemblers for the same
-machine would assemble.
-@ifset VAX
-Any exceptions are documented explicitly (@pxref{Machine Dependencies}).
-@end ifset
-@ifset M680X0
-@c This remark should appear in generic version of manual; assumption
-@c here is that generic version sets M680x0.
-This doesn't mean @command{@value{AS}} always uses the same syntax as another
-assembler for the same architecture; for example, we know of several
-incompatible versions of 680x0 assembly language syntax.
-@end ifset
-
-@c man end
-
-Unlike older assemblers, @command{@value{AS}} is designed to assemble a source
-program in one pass of the source file. This has a subtle impact on the
-@kbd{.org} directive (@pxref{Org,,@code{.org}}).
-
-@node Object Formats
-@section Object File Formats
-
-@cindex object file format
-The @sc{gnu} assembler can be configured to produce several alternative
-object file formats. For the most part, this does not affect how you
-write assembly language programs; but directives for debugging symbols
-are typically different in different file formats. @xref{Symbol
-Attributes,,Symbol Attributes}.
-@ifclear GENERIC
-@ifclear MULTI-OBJ
-For the @value{TARGET} target, @command{@value{AS}} is configured to produce
-@value{OBJ-NAME} format object files.
-@end ifclear
-@c The following should exhaust all configs that set MULTI-OBJ, ideally
-@ifset I960
-On the @value{TARGET}, @command{@value{AS}} can be configured to produce either
-@code{b.out} or COFF format object files.
-@end ifset
-@ifset HPPA
-On the @value{TARGET}, @command{@value{AS}} can be configured to produce either
-SOM or ELF format object files.
-@end ifset
-@end ifclear
-
-@node Command Line
-@section Command Line
-
-@cindex command line conventions
-
-After the program name @command{@value{AS}}, the command line may contain
-options and file names. Options may appear in any order, and may be
-before, after, or between file names. The order of file names is
-significant.
-
-@cindex standard input, as input file
-@kindex --
-@file{--} (two hyphens) by itself names the standard input file
-explicitly, as one of the files for @command{@value{AS}} to assemble.
-
-@cindex options, command line
-Except for @samp{--} any command line argument that begins with a
-hyphen (@samp{-}) is an option. Each option changes the behavior of
-@command{@value{AS}}. No option changes the way another option works. An
-option is a @samp{-} followed by one or more letters; the case of
-the letter is important. All options are optional.
-
-Some options expect exactly one file name to follow them. The file
-name may either immediately follow the option's letter (compatible
-with older assemblers) or it may be the next command argument (@sc{gnu}
-standard). These two command lines are equivalent:
-
-@smallexample
-@value{AS} -o my-object-file.o mumble.s
-@value{AS} -omy-object-file.o mumble.s
-@end smallexample
-
-@node Input Files
-@section Input Files
-
-@cindex input
-@cindex source program
-@cindex files, input
-We use the phrase @dfn{source program}, abbreviated @dfn{source}, to
-describe the program input to one run of @command{@value{AS}}. The program may
-be in one or more files; how the source is partitioned into files
-doesn't change the meaning of the source.
-
-@c I added "con" prefix to "catenation" just to prove I can overcome my
-@c APL training... doc@cygnus.com
-The source program is a concatenation of the text in all the files, in the
-order specified.
-
-@c man begin DESCRIPTION
-Each time you run @command{@value{AS}} it assembles exactly one source
-program. The source program is made up of one or more files.
-(The standard input is also a file.)
-
-You give @command{@value{AS}} a command line that has zero or more input file
-names. The input files are read (from left file name to right). A
-command line argument (in any position) that has no special meaning
-is taken to be an input file name.
-
-If you give @command{@value{AS}} no file names it attempts to read one input file
-from the @command{@value{AS}} standard input, which is normally your terminal. You
-may have to type @key{ctl-D} to tell @command{@value{AS}} there is no more program
-to assemble.
-
-Use @samp{--} if you need to explicitly name the standard input file
-in your command line.
-
-If the source is empty, @command{@value{AS}} produces a small, empty object
-file.
-
-@c man end
-
-@subheading Filenames and Line-numbers
-
-@cindex input file linenumbers
-@cindex line numbers, in input files
-There are two ways of locating a line in the input file (or files) and
-either may be used in reporting error messages. One way refers to a line
-number in a physical file; the other refers to a line number in a
-``logical'' file. @xref{Errors, ,Error and Warning Messages}.
-
-@dfn{Physical files} are those files named in the command line given
-to @command{@value{AS}}.
-
-@dfn{Logical files} are simply names declared explicitly by assembler
-directives; they bear no relation to physical files. Logical file names help
-error messages reflect the original source file, when @command{@value{AS}} source
-is itself synthesized from other files. @command{@value{AS}} understands the
-@samp{#} directives emitted by the @code{@value{GCC}} preprocessor. See also
-@ref{File,,@code{.file}}.
-
-@node Object
-@section Output (Object) File
-
-@cindex object file
-@cindex output file
-@kindex a.out
-@kindex .o
-Every time you run @command{@value{AS}} it produces an output file, which is
-your assembly language program translated into numbers. This file
-is the object file. Its default name is
-@ifclear BOUT
-@code{a.out}.
-@end ifclear
-@ifset BOUT
-@ifset GENERIC
-@code{a.out}, or
-@end ifset
-@code{b.out} when @command{@value{AS}} is configured for the Intel 80960.
-@end ifset
-You can give it another name by using the @option{-o} option. Conventionally,
-object file names end with @file{.o}. The default name is used for historical
-reasons: older assemblers were capable of assembling self-contained programs
-directly into a runnable program. (For some formats, this isn't currently
-possible, but it can be done for the @code{a.out} format.)
-
-@cindex linker
-@kindex ld
-The object file is meant for input to the linker @code{@value{LD}}. It contains
-assembled program code, information to help @code{@value{LD}} integrate
-the assembled program into a runnable file, and (optionally) symbolic
-information for the debugger.
-
-@c link above to some info file(s) like the description of a.out.
-@c don't forget to describe @sc{gnu} info as well as Unix lossage.
-
-@node Errors
-@section Error and Warning Messages
-
-@c man begin DESCRIPTION
-
-@cindex error messages
-@cindex warning messages
-@cindex messages from assembler
-@command{@value{AS}} may write warnings and error messages to the standard error
-file (usually your terminal). This should not happen when a compiler
-runs @command{@value{AS}} automatically. Warnings report an assumption made so
-that @command{@value{AS}} could keep assembling a flawed program; errors report a
-grave problem that stops the assembly.
-
-@c man end
-
-@cindex format of warning messages
-Warning messages have the format
-
-@smallexample
-file_name:@b{NNN}:Warning Message Text
-@end smallexample
-
-@noindent
-@cindex line numbers, in warnings/errors
-(where @b{NNN} is a line number). If a logical file name has been given
-(@pxref{File,,@code{.file}}) it is used for the filename, otherwise the name of
-the current input file is used. If a logical line number was given
-@ifset GENERIC
-(@pxref{Line,,@code{.line}})
-@end ifset
-then it is used to calculate the number printed,
-otherwise the actual line in the current source file is printed. The
-message text is intended to be self explanatory (in the grand Unix
-tradition).
-
-@cindex format of error messages
-Error messages have the format
-@smallexample
-file_name:@b{NNN}:FATAL:Error Message Text
-@end smallexample
-The file name and line number are derived as for warning
-messages. The actual message text may be rather less explanatory
-because many of them aren't supposed to happen.
-
-@node Invoking
-@chapter Command-Line Options
-
-@cindex options, all versions of assembler
-This chapter describes command-line options available in @emph{all}
-versions of the @sc{gnu} assembler; see @ref{Machine Dependencies},
-for options specific
-@ifclear GENERIC
-to the @value{TARGET} target.
-@end ifclear
-@ifset GENERIC
-to particular machine architectures.
-@end ifset
-
-@c man begin DESCRIPTION
-
-If you are invoking @command{@value{AS}} via the @sc{gnu} C compiler,
-you can use the @samp{-Wa} option to pass arguments through to the assembler.
-The assembler arguments must be separated from each other (and the @samp{-Wa})
-by commas. For example:
-
-@smallexample
-gcc -c -g -O -Wa,-alh,-L file.c
-@end smallexample
-
-@noindent
-This passes two options to the assembler: @samp{-alh} (emit a listing to
-standard output with high-level and assembly source) and @samp{-L} (retain
-local symbols in the symbol table).
-
-Usually you do not need to use this @samp{-Wa} mechanism, since many compiler
-command-line options are automatically passed to the assembler by the compiler.
-(You can call the @sc{gnu} compiler driver with the @samp{-v} option to see
-precisely what options it passes to each compilation pass, including the
-assembler.)
-
-@c man end
-
-@menu
-* a:: -a[cdghlns] enable listings
-* alternate:: --alternate enable alternate macro syntax
-* D:: -D for compatibility
-* f:: -f to work faster
-* I:: -I for .include search path
-@ifclear DIFF-TBL-KLUGE
-* K:: -K for compatibility
-@end ifclear
-@ifset DIFF-TBL-KLUGE
-* K:: -K for difference tables
-@end ifset
-
-* L:: -L to retain local symbols
-* listing:: --listing-XXX to configure listing output
-* M:: -M or --mri to assemble in MRI compatibility mode
-* MD:: --MD for dependency tracking
-* o:: -o to name the object file
-* R:: -R to join data and text sections
-* statistics:: --statistics to see statistics about assembly
-* traditional-format:: --traditional-format for compatible output
-* v:: -v to announce version
-* W:: -W, --no-warn, --warn, --fatal-warnings to control warnings
-* Z:: -Z to make object file even after errors
-@end menu
-
-@node a
-@section Enable Listings: @option{-a[cdghlns]}
-
-@kindex -a
-@kindex -ac
-@kindex -ad
-@kindex -ag
-@kindex -ah
-@kindex -al
-@kindex -an
-@kindex -as
-@cindex listings, enabling
-@cindex assembly listings, enabling
-
-These options enable listing output from the assembler. By itself,
-@samp{-a} requests high-level, assembly, and symbols listing.
-You can use other letters to select specific options for the list:
-@samp{-ah} requests a high-level language listing,
-@samp{-al} requests an output-program assembly listing, and
-@samp{-as} requests a symbol table listing.
-High-level listings require that a compiler debugging option like
-@samp{-g} be used, and that assembly listings (@samp{-al}) be requested
-also.
-
-Use the @samp{-ag} option to print a first section with general assembly
-information, like @value{AS} version, switches passed, or time stamp.
-
-Use the @samp{-ac} option to omit false conditionals from a listing. Any lines
-which are not assembled because of a false @code{.if} (or @code{.ifdef}, or any
-other conditional), or a true @code{.if} followed by an @code{.else}, will be
-omitted from the listing.
-
-Use the @samp{-ad} option to omit debugging directives from the
-listing.
-
-Once you have specified one of these options, you can further control
-listing output and its appearance using the directives @code{.list},
-@code{.nolist}, @code{.psize}, @code{.eject}, @code{.title}, and
-@code{.sbttl}.
-The @samp{-an} option turns off all forms processing.
-If you do not request listing output with one of the @samp{-a} options, the
-listing-control directives have no effect.
-
-The letters after @samp{-a} may be combined into one option,
-@emph{e.g.}, @samp{-aln}.
-
-Note if the assembler source is coming from the standard input (e.g.,
-because it
-is being created by @code{@value{GCC}} and the @samp{-pipe} command line switch
-is being used) then the listing will not contain any comments or preprocessor
-directives. This is because the listing code buffers input source lines from
-stdin only after they have been preprocessed by the assembler. This reduces
-memory usage and makes the code more efficient.
-
-@node alternate
-@section @option{--alternate}
-
-@kindex --alternate
-Begin in alternate macro mode, see @ref{Altmacro,,@code{.altmacro}}.
-
-@node D
-@section @option{-D}
-
-@kindex -D
-This option has no effect whatsoever, but it is accepted to make it more
-likely that scripts written for other assemblers also work with
-@command{@value{AS}}.
-
-@node f
-@section Work Faster: @option{-f}
-
-@kindex -f
-@cindex trusted compiler
-@cindex faster processing (@option{-f})
-@samp{-f} should only be used when assembling programs written by a
-(trusted) compiler. @samp{-f} stops the assembler from doing whitespace
-and comment preprocessing on
-the input file(s) before assembling them. @xref{Preprocessing,
-,Preprocessing}.
-
-@quotation
-@emph{Warning:} if you use @samp{-f} when the files actually need to be
-preprocessed (if they contain comments, for example), @command{@value{AS}} does
-not work correctly.
-@end quotation
-
-@node I
-@section @code{.include} Search Path: @option{-I} @var{path}
-
-@kindex -I @var{path}
-@cindex paths for @code{.include}
-@cindex search path for @code{.include}
-@cindex @code{include} directive search path
-Use this option to add a @var{path} to the list of directories
-@command{@value{AS}} searches for files specified in @code{.include}
-directives (@pxref{Include,,@code{.include}}). You may use @option{-I} as
-many times as necessary to include a variety of paths. The current
-working directory is always searched first; after that, @command{@value{AS}}
-searches any @samp{-I} directories in the same order as they were
-specified (left to right) on the command line.
-
-@node K
-@section Difference Tables: @option{-K}
-
-@kindex -K
-@ifclear DIFF-TBL-KLUGE
-On the @value{TARGET} family, this option is allowed, but has no effect. It is
-permitted for compatibility with the @sc{gnu} assembler on other platforms,
-where it can be used to warn when the assembler alters the machine code
-generated for @samp{.word} directives in difference tables. The @value{TARGET}
-family does not have the addressing limitations that sometimes lead to this
-alteration on other platforms.
-@end ifclear
-
-@ifset DIFF-TBL-KLUGE
-@cindex difference tables, warning
-@cindex warning for altered difference tables
-@command{@value{AS}} sometimes alters the code emitted for directives of the
-form @samp{.word @var{sym1}-@var{sym2}}. @xref{Word,,@code{.word}}.
-You can use the @samp{-K} option if you want a warning issued when this
-is done.
-@end ifset
-
-@node L
-@section Include Local Symbols: @option{-L}
-
-@kindex -L
-@cindex local symbols, retaining in output
-Symbols beginning with system-specific local label prefixes, typically
-@samp{.L} for ELF systems or @samp{L} for traditional a.out systems, are
-called @dfn{local symbols}. @xref{Symbol Names}. Normally you do not see
-such symbols when debugging, because they are intended for the use of
-programs (like compilers) that compose assembler programs, not for your
-notice. Normally both @command{@value{AS}} and @code{@value{LD}} discard
-such symbols, so you do not normally debug with them.
-
-This option tells @command{@value{AS}} to retain those local symbols
-in the object file. Usually if you do this you also tell the linker
-@code{@value{LD}} to preserve those symbols.
-
-@node listing
-@section Configuring listing output: @option{--listing}
-
-The listing feature of the assembler can be enabled via the command line switch
-@samp{-a} (@pxref{a}). This feature combines the input source file(s) with a
-hex dump of the corresponding locations in the output object file, and displays
-them as a listing file. The format of this listing can be controlled by
-directives inside the assembler source (i.e., @code{.list} (@pxref{List}),
-@code{.title} (@pxref{Title}), @code{.sbttl} (@pxref{Sbttl}),
-@code{.psize} (@pxref{Psize}), and
-@code{.eject} (@pxref{Eject}) and also by the following switches:
-
-@table @gcctabopt
-@item --listing-lhs-width=@samp{number}
-@kindex --listing-lhs-width
-@cindex Width of first line disassembly output
-Sets the maximum width, in words, of the first line of the hex byte dump. This
-dump appears on the left hand side of the listing output.
-
-@item --listing-lhs-width2=@samp{number}
-@kindex --listing-lhs-width2
-@cindex Width of continuation lines of disassembly output
-Sets the maximum width, in words, of any further lines of the hex byte dump for
-a given input source line. If this value is not specified, it defaults to being
-the same as the value specified for @samp{--listing-lhs-width}. If neither
-switch is used the default is to one.
-
-@item --listing-rhs-width=@samp{number}
-@kindex --listing-rhs-width
-@cindex Width of source line output
-Sets the maximum width, in characters, of the source line that is displayed
-alongside the hex dump. The default value for this parameter is 100. The
-source line is displayed on the right hand side of the listing output.
-
-@item --listing-cont-lines=@samp{number}
-@kindex --listing-cont-lines
-@cindex Maximum number of continuation lines
-Sets the maximum number of continuation lines of hex dump that will be
-displayed for a given single line of source input. The default value is 4.
-@end table
-
-@node M
-@section Assemble in MRI Compatibility Mode: @option{-M}
-
-@kindex -M
-@cindex MRI compatibility mode
-The @option{-M} or @option{--mri} option selects MRI compatibility mode. This
-changes the syntax and pseudo-op handling of @command{@value{AS}} to make it
-compatible with the @code{ASM68K} or the @code{ASM960} (depending upon the
-configured target) assembler from Microtec Research. The exact nature of the
-MRI syntax will not be documented here; see the MRI manuals for more
-information. Note in particular that the handling of macros and macro
-arguments is somewhat different. The purpose of this option is to permit
-assembling existing MRI assembler code using @command{@value{AS}}.
-
-The MRI compatibility is not complete. Certain operations of the MRI assembler
-depend upon its object file format, and can not be supported using other object
-file formats. Supporting these would require enhancing each object file format
-individually. These are:
-
-@itemize @bullet
-@item global symbols in common section
-
-The m68k MRI assembler supports common sections which are merged by the linker.
-Other object file formats do not support this. @command{@value{AS}} handles
-common sections by treating them as a single common symbol. It permits local
-symbols to be defined within a common section, but it can not support global
-symbols, since it has no way to describe them.
-
-@item complex relocations
-
-The MRI assemblers support relocations against a negated section address, and
-relocations which combine the start addresses of two or more sections. These
-are not support by other object file formats.
-
-@item @code{END} pseudo-op specifying start address
-
-The MRI @code{END} pseudo-op permits the specification of a start address.
-This is not supported by other object file formats. The start address may
-instead be specified using the @option{-e} option to the linker, or in a linker
-script.
-
-@item @code{IDNT}, @code{.ident} and @code{NAME} pseudo-ops
-
-The MRI @code{IDNT}, @code{.ident} and @code{NAME} pseudo-ops assign a module
-name to the output file. This is not supported by other object file formats.
-
-@item @code{ORG} pseudo-op
-
-The m68k MRI @code{ORG} pseudo-op begins an absolute section at a given
-address. This differs from the usual @command{@value{AS}} @code{.org} pseudo-op,
-which changes the location within the current section. Absolute sections are
-not supported by other object file formats. The address of a section may be
-assigned within a linker script.
-@end itemize
-
-There are some other features of the MRI assembler which are not supported by
-@command{@value{AS}}, typically either because they are difficult or because they
-seem of little consequence. Some of these may be supported in future releases.
-
-@itemize @bullet
-
-@item EBCDIC strings
-
-EBCDIC strings are not supported.
-
-@item packed binary coded decimal
-
-Packed binary coded decimal is not supported. This means that the @code{DC.P}
-and @code{DCB.P} pseudo-ops are not supported.
-
-@item @code{FEQU} pseudo-op
-
-The m68k @code{FEQU} pseudo-op is not supported.
-
-@item @code{NOOBJ} pseudo-op
-
-The m68k @code{NOOBJ} pseudo-op is not supported.
-
-@item @code{OPT} branch control options
-
-The m68k @code{OPT} branch control options---@code{B}, @code{BRS}, @code{BRB},
-@code{BRL}, and @code{BRW}---are ignored. @command{@value{AS}} automatically
-relaxes all branches, whether forward or backward, to an appropriate size, so
-these options serve no purpose.
-
-@item @code{OPT} list control options
-
-The following m68k @code{OPT} list control options are ignored: @code{C},
-@code{CEX}, @code{CL}, @code{CRE}, @code{E}, @code{G}, @code{I}, @code{M},
-@code{MEX}, @code{MC}, @code{MD}, @code{X}.
-
-@item other @code{OPT} options
-
-The following m68k @code{OPT} options are ignored: @code{NEST}, @code{O},
-@code{OLD}, @code{OP}, @code{P}, @code{PCO}, @code{PCR}, @code{PCS}, @code{R}.
-
-@item @code{OPT} @code{D} option is default
-
-The m68k @code{OPT} @code{D} option is the default, unlike the MRI assembler.
-@code{OPT NOD} may be used to turn it off.
-
-@item @code{XREF} pseudo-op.
-
-The m68k @code{XREF} pseudo-op is ignored.
-
-@item @code{.debug} pseudo-op
-
-The i960 @code{.debug} pseudo-op is not supported.
-
-@item @code{.extended} pseudo-op
-
-The i960 @code{.extended} pseudo-op is not supported.
-
-@item @code{.list} pseudo-op.
-
-The various options of the i960 @code{.list} pseudo-op are not supported.
-
-@item @code{.optimize} pseudo-op
-
-The i960 @code{.optimize} pseudo-op is not supported.
-
-@item @code{.output} pseudo-op
-
-The i960 @code{.output} pseudo-op is not supported.
-
-@item @code{.setreal} pseudo-op
-
-The i960 @code{.setreal} pseudo-op is not supported.
-
-@end itemize
-
-@node MD
-@section Dependency Tracking: @option{--MD}
-
-@kindex --MD
-@cindex dependency tracking
-@cindex make rules
-
-@command{@value{AS}} can generate a dependency file for the file it creates. This
-file consists of a single rule suitable for @code{make} describing the
-dependencies of the main source file.
-
-The rule is written to the file named in its argument.
-
-This feature is used in the automatic updating of makefiles.
-
-@node o
-@section Name the Object File: @option{-o}
-
-@kindex -o
-@cindex naming object file
-@cindex object file name
-There is always one object file output when you run @command{@value{AS}}. By
-default it has the name
-@ifset GENERIC
-@ifset I960
-@file{a.out} (or @file{b.out}, for Intel 960 targets only).
-@end ifset
-@ifclear I960
-@file{a.out}.
-@end ifclear
-@end ifset
-@ifclear GENERIC
-@ifset I960
-@file{b.out}.
-@end ifset
-@ifclear I960
-@file{a.out}.
-@end ifclear
-@end ifclear
-You use this option (which takes exactly one filename) to give the
-object file a different name.
-
-Whatever the object file is called, @command{@value{AS}} overwrites any
-existing file of the same name.
-
-@node R
-@section Join Data and Text Sections: @option{-R}
-
-@kindex -R
-@cindex data and text sections, joining
-@cindex text and data sections, joining
-@cindex joining text and data sections
-@cindex merging text and data sections
-@option{-R} tells @command{@value{AS}} to write the object file as if all
-data-section data lives in the text section. This is only done at
-the very last moment: your binary data are the same, but data
-section parts are relocated differently. The data section part of
-your object file is zero bytes long because all its bytes are
-appended to the text section. (@xref{Sections,,Sections and Relocation}.)
-
-When you specify @option{-R} it would be possible to generate shorter
-address displacements (because we do not have to cross between text and
-data section). We refrain from doing this simply for compatibility with
-older versions of @command{@value{AS}}. In future, @option{-R} may work this way.
-
-@ifset COFF-ELF
-When @command{@value{AS}} is configured for COFF or ELF output,
-this option is only useful if you use sections named @samp{.text} and
-@samp{.data}.
-@end ifset
-
-@ifset HPPA
-@option{-R} is not supported for any of the HPPA targets. Using
-@option{-R} generates a warning from @command{@value{AS}}.
-@end ifset
-
-@node statistics
-@section Display Assembly Statistics: @option{--statistics}
-
-@kindex --statistics
-@cindex statistics, about assembly
-@cindex time, total for assembly
-@cindex space used, maximum for assembly
-Use @samp{--statistics} to display two statistics about the resources used by
-@command{@value{AS}}: the maximum amount of space allocated during the assembly
-(in bytes), and the total execution time taken for the assembly (in @sc{cpu}
-seconds).
-
-@node traditional-format
-@section Compatible Output: @option{--traditional-format}
-
-@kindex --traditional-format
-For some targets, the output of @command{@value{AS}} is different in some ways
-from the output of some existing assembler. This switch requests
-@command{@value{AS}} to use the traditional format instead.
-
-For example, it disables the exception frame optimizations which
-@command{@value{AS}} normally does by default on @code{@value{GCC}} output.
-
-@node v
-@section Announce Version: @option{-v}
-
-@kindex -v
-@kindex -version
-@cindex assembler version
-@cindex version of assembler
-You can find out what version of as is running by including the
-option @samp{-v} (which you can also spell as @samp{-version}) on the
-command line.
-
-@node W
-@section Control Warnings: @option{-W}, @option{--warn}, @option{--no-warn}, @option{--fatal-warnings}
-
-@command{@value{AS}} should never give a warning or error message when
-assembling compiler output. But programs written by people often
-cause @command{@value{AS}} to give a warning that a particular assumption was
-made. All such warnings are directed to the standard error file.
-
-@kindex -W
-@kindex --no-warn
-@cindex suppressing warnings
-@cindex warnings, suppressing
-If you use the @option{-W} and @option{--no-warn} options, no warnings are issued.
-This only affects the warning messages: it does not change any particular of
-how @command{@value{AS}} assembles your file. Errors, which stop the assembly,
-are still reported.
-
-@kindex --fatal-warnings
-@cindex errors, caused by warnings
-@cindex warnings, causing error
-If you use the @option{--fatal-warnings} option, @command{@value{AS}} considers
-files that generate warnings to be in error.
-
-@kindex --warn
-@cindex warnings, switching on
-You can switch these options off again by specifying @option{--warn}, which
-causes warnings to be output as usual.
-
-@node Z
-@section Generate Object File in Spite of Errors: @option{-Z}
-@cindex object file, after errors
-@cindex errors, continuing after
-After an error message, @command{@value{AS}} normally produces no output. If for
-some reason you are interested in object file output even after
-@command{@value{AS}} gives an error message on your program, use the @samp{-Z}
-option. If there are any errors, @command{@value{AS}} continues anyways, and
-writes an object file after a final warning message of the form @samp{@var{n}
-errors, @var{m} warnings, generating bad object file.}
-
-@node Syntax
-@chapter Syntax
-
-@cindex machine-independent syntax
-@cindex syntax, machine-independent
-This chapter describes the machine-independent syntax allowed in a
-source file. @command{@value{AS}} syntax is similar to what many other
-assemblers use; it is inspired by the BSD 4.2
-@ifclear VAX
-assembler.
-@end ifclear
-@ifset VAX
-assembler, except that @command{@value{AS}} does not assemble Vax bit-fields.
-@end ifset
-
-@menu
-* Preprocessing:: Preprocessing
-* Whitespace:: Whitespace
-* Comments:: Comments
-* Symbol Intro:: Symbols
-* Statements:: Statements
-* Constants:: Constants
-@end menu
-
-@node Preprocessing
-@section Preprocessing
-
-@cindex preprocessing
-The @command{@value{AS}} internal preprocessor:
-@itemize @bullet
-@cindex whitespace, removed by preprocessor
-@item
-adjusts and removes extra whitespace. It leaves one space or tab before
-the keywords on a line, and turns any other whitespace on the line into
-a single space.
-
-@cindex comments, removed by preprocessor
-@item
-removes all comments, replacing them with a single space, or an
-appropriate number of newlines.
-
-@cindex constants, converted by preprocessor
-@item
-converts character constants into the appropriate numeric values.
-@end itemize
-
-It does not do macro processing, include file handling, or
-anything else you may get from your C compiler's preprocessor. You can
-do include file processing with the @code{.include} directive
-(@pxref{Include,,@code{.include}}). You can use the @sc{gnu} C compiler driver
-to get other ``CPP'' style preprocessing by giving the input file a
-@samp{.S} suffix. @xref{Overall Options, ,Options Controlling the Kind of
-Output, gcc.info, Using GNU CC}.
-
-Excess whitespace, comments, and character constants
-cannot be used in the portions of the input text that are not
-preprocessed.
-
-@cindex turning preprocessing on and off
-@cindex preprocessing, turning on and off
-@kindex #NO_APP
-@kindex #APP
-If the first line of an input file is @code{#NO_APP} or if you use the
-@samp{-f} option, whitespace and comments are not removed from the input file.
-Within an input file, you can ask for whitespace and comment removal in
-specific portions of the by putting a line that says @code{#APP} before the
-text that may contain whitespace or comments, and putting a line that says
-@code{#NO_APP} after this text. This feature is mainly intend to support
-@code{asm} statements in compilers whose output is otherwise free of comments
-and whitespace.
-
-@node Whitespace
-@section Whitespace
-
-@cindex whitespace
-@dfn{Whitespace} is one or more blanks or tabs, in any order.
-Whitespace is used to separate symbols, and to make programs neater for
-people to read. Unless within character constants
-(@pxref{Characters,,Character Constants}), any whitespace means the same
-as exactly one space.
-
-@node Comments
-@section Comments
-
-@cindex comments
-There are two ways of rendering comments to @command{@value{AS}}. In both
-cases the comment is equivalent to one space.
-
-Anything from @samp{/*} through the next @samp{*/} is a comment.
-This means you may not nest these comments.
-
-@smallexample
-/*
- The only way to include a newline ('\n') in a comment
- is to use this sort of comment.
-*/
-
-/* This sort of comment does not nest. */
-@end smallexample
-
-@cindex line comment character
-Anything from the @dfn{line comment} character to the next newline
-is considered a comment and is ignored. The line comment character is
-@ifset ARC
-@samp{;} on the ARC;
-@end ifset
-@ifset ARM
-@samp{@@} on the ARM;
-@end ifset
-@ifset H8/300
-@samp{;} for the H8/300 family;
-@end ifset
-@ifset HPPA
-@samp{;} for the HPPA;
-@end ifset
-@ifset I80386
-@samp{#} on the i386 and x86-64;
-@end ifset
-@ifset I960
-@samp{#} on the i960;
-@end ifset
-@ifset PDP11
-@samp{;} for the PDP-11;
-@end ifset
-@ifset PJ
-@samp{;} for picoJava;
-@end ifset
-@ifset PPC
-@samp{#} for Motorola PowerPC;
-@end ifset
-@ifset SH
-@samp{!} for the Renesas / SuperH SH;
-@end ifset
-@ifset SPARC
-@samp{!} on the SPARC;
-@end ifset
-@ifset IP2K
-@samp{#} on the ip2k;
-@end ifset
-@ifset M32C
-@samp{#} on the m32c;
-@end ifset
-@ifset M32R
-@samp{#} on the m32r;
-@end ifset
-@ifset M680X0
-@samp{|} on the 680x0;
-@end ifset
-@ifset M68HC11
-@samp{#} on the 68HC11 and 68HC12;
-@end ifset
-@ifset VAX
-@samp{#} on the Vax;
-@end ifset
-@ifset Z80
-@samp{;} for the Z80;
-@end ifset
-@ifset Z8000
-@samp{!} for the Z8000;
-@end ifset
-@ifset V850
-@samp{#} on the V850;
-@end ifset
-@ifset XTENSA
-@samp{#} for Xtensa systems;
-@end ifset
-see @ref{Machine Dependencies}. @refill
-@c FIXME What about i860?
-
-@ifset GENERIC
-On some machines there are two different line comment characters. One
-character only begins a comment if it is the first non-whitespace character on
-a line, while the other always begins a comment.
-@end ifset
-
-@ifset V850
-The V850 assembler also supports a double dash as starting a comment that
-extends to the end of the line.
-
-@samp{--};
-@end ifset
-
-@kindex #
-@cindex lines starting with @code{#}
-@cindex logical line numbers
-To be compatible with past assemblers, lines that begin with @samp{#} have a
-special interpretation. Following the @samp{#} should be an absolute
-expression (@pxref{Expressions}): the logical line number of the @emph{next}
-line. Then a string (@pxref{Strings, ,Strings}) is allowed: if present it is a
-new logical file name. The rest of the line, if any, should be whitespace.
-
-If the first non-whitespace characters on the line are not numeric,
-the line is ignored. (Just like a comment.)
-
-@smallexample
- # This is an ordinary comment.
-# 42-6 "new_file_name" # New logical file name
- # This is logical line # 36.
-@end smallexample
-This feature is deprecated, and may disappear from future versions
-of @command{@value{AS}}.
-
-@node Symbol Intro
-@section Symbols
-
-@cindex characters used in symbols
-@ifclear SPECIAL-SYMS
-A @dfn{symbol} is one or more characters chosen from the set of all
-letters (both upper and lower case), digits and the three characters
-@samp{_.$}.
-@end ifclear
-@ifset SPECIAL-SYMS
-@ifclear GENERIC
-@ifset H8
-A @dfn{symbol} is one or more characters chosen from the set of all
-letters (both upper and lower case), digits and the three characters
-@samp{._$}. (Save that, on the H8/300 only, you may not use @samp{$} in
-symbol names.)
-@end ifset
-@end ifclear
-@end ifset
-@ifset GENERIC
-On most machines, you can also use @code{$} in symbol names; exceptions
-are noted in @ref{Machine Dependencies}.
-@end ifset
-No symbol may begin with a digit. Case is significant.
-There is no length limit: all characters are significant. Symbols are
-delimited by characters not in that set, or by the beginning of a file
-(since the source program must end with a newline, the end of a file is
-not a possible symbol delimiter). @xref{Symbols}.
-@cindex length of symbols
-
-@node Statements
-@section Statements
-
-@cindex statements, structure of
-@cindex line separator character
-@cindex statement separator character
-@ifclear GENERIC
-@ifclear abnormal-separator
-A @dfn{statement} ends at a newline character (@samp{\n}) or at a
-semicolon (@samp{;}). The newline or semicolon is considered part of
-the preceding statement. Newlines and semicolons within character
-constants are an exception: they do not end statements.
-@end ifclear
-@ifset abnormal-separator
-@ifset HPPA
-A @dfn{statement} ends at a newline character (@samp{\n}) or an exclamation
-point (@samp{!}). The newline or exclamation point is considered part of the
-preceding statement. Newlines and exclamation points within character
-constants are an exception: they do not end statements.
-@end ifset
-@ifset H8
-A @dfn{statement} ends at a newline character (@samp{\n}); or (for the
-H8/300) a dollar sign (@samp{$}); or (for the Renesas-SH) a semicolon
-(@samp{;}). The newline or separator character is considered part of
-the preceding statement. Newlines and separators within character
-constants are an exception: they do not end statements.
-@end ifset
-@end ifset
-@end ifclear
-@ifset GENERIC
-A @dfn{statement} ends at a newline character (@samp{\n}) or line
-separator character. (The line separator is usually @samp{;}, unless this
-conflicts with the comment character; see @ref{Machine Dependencies}.) The
-newline or separator character is considered part of the preceding
-statement. Newlines and separators within character constants are an
-exception: they do not end statements.
-@end ifset
-
-@cindex newline, required at file end
-@cindex EOF, newline must precede
-It is an error to end any statement with end-of-file: the last
-character of any input file should be a newline.@refill
-
-An empty statement is allowed, and may include whitespace. It is ignored.
-
-@cindex instructions and directives
-@cindex directives and instructions
-@c "key symbol" is not used elsewhere in the document; seems pedantic to
-@c @defn{} it in that case, as was done previously... doc@cygnus.com,
-@c 13feb91.
-A statement begins with zero or more labels, optionally followed by a
-key symbol which determines what kind of statement it is. The key
-symbol determines the syntax of the rest of the statement. If the
-symbol begins with a dot @samp{.} then the statement is an assembler
-directive: typically valid for any computer. If the symbol begins with
-a letter the statement is an assembly language @dfn{instruction}: it
-assembles into a machine language instruction.
-@ifset GENERIC
-Different versions of @command{@value{AS}} for different computers
-recognize different instructions. In fact, the same symbol may
-represent a different instruction in a different computer's assembly
-language.@refill
-@end ifset
-
-@cindex @code{:} (label)
-@cindex label (@code{:})
-A label is a symbol immediately followed by a colon (@code{:}).
-Whitespace before a label or after a colon is permitted, but you may not
-have whitespace between a label's symbol and its colon. @xref{Labels}.
-
-@ifset HPPA
-For HPPA targets, labels need not be immediately followed by a colon, but
-the definition of a label must begin in column zero. This also implies that
-only one label may be defined on each line.
-@end ifset
-
-@smallexample
-label: .directive followed by something
-another_label: # This is an empty statement.
- instruction operand_1, operand_2, @dots{}
-@end smallexample
-
-@node Constants
-@section Constants
-
-@cindex constants
-A constant is a number, written so that its value is known by
-inspection, without knowing any context. Like this:
-@smallexample
-@group
-.byte 74, 0112, 092, 0x4A, 0X4a, 'J, '\J # All the same value.
-.ascii "Ring the bell\7" # A string constant.
-.octa 0x123456789abcdef0123456789ABCDEF0 # A bignum.
-.float 0f-314159265358979323846264338327\
-95028841971.693993751E-40 # - pi, a flonum.
-@end group
-@end smallexample
-
-@menu
-* Characters:: Character Constants
-* Numbers:: Number Constants
-@end menu
-
-@node Characters
-@subsection Character Constants
-
-@cindex character constants
-@cindex constants, character
-There are two kinds of character constants. A @dfn{character} stands
-for one character in one byte and its value may be used in
-numeric expressions. String constants (properly called string
-@emph{literals}) are potentially many bytes and their values may not be
-used in arithmetic expressions.
-
-@menu
-* Strings:: Strings
-* Chars:: Characters
-@end menu
-
-@node Strings
-@subsubsection Strings
-
-@cindex string constants
-@cindex constants, string
-A @dfn{string} is written between double-quotes. It may contain
-double-quotes or null characters. The way to get special characters
-into a string is to @dfn{escape} these characters: precede them with
-a backslash @samp{\} character. For example @samp{\\} represents
-one backslash: the first @code{\} is an escape which tells
-@command{@value{AS}} to interpret the second character literally as a backslash
-(which prevents @command{@value{AS}} from recognizing the second @code{\} as an
-escape character). The complete list of escapes follows.
-
-@cindex escape codes, character
-@cindex character escape codes
-@table @kbd
-@c @item \a
-@c Mnemonic for ACKnowledge; for ASCII this is octal code 007.
-@c
-@cindex @code{\b} (backspace character)
-@cindex backspace (@code{\b})
-@item \b
-Mnemonic for backspace; for ASCII this is octal code 010.
-
-@c @item \e
-@c Mnemonic for EOText; for ASCII this is octal code 004.
-@c
-@cindex @code{\f} (formfeed character)
-@cindex formfeed (@code{\f})
-@item \f
-Mnemonic for FormFeed; for ASCII this is octal code 014.
-
-@cindex @code{\n} (newline character)
-@cindex newline (@code{\n})
-@item \n
-Mnemonic for newline; for ASCII this is octal code 012.
-
-@c @item \p
-@c Mnemonic for prefix; for ASCII this is octal code 033, usually known as @code{escape}.
-@c
-@cindex @code{\r} (carriage return character)
-@cindex carriage return (@code{\r})
-@item \r
-Mnemonic for carriage-Return; for ASCII this is octal code 015.
-
-@c @item \s
-@c Mnemonic for space; for ASCII this is octal code 040. Included for compliance with
-@c other assemblers.
-@c
-@cindex @code{\t} (tab)
-@cindex tab (@code{\t})
-@item \t
-Mnemonic for horizontal Tab; for ASCII this is octal code 011.
-
-@c @item \v
-@c Mnemonic for Vertical tab; for ASCII this is octal code 013.
-@c @item \x @var{digit} @var{digit} @var{digit}
-@c A hexadecimal character code. The numeric code is 3 hexadecimal digits.
-@c
-@cindex @code{\@var{ddd}} (octal character code)
-@cindex octal character code (@code{\@var{ddd}})
-@item \ @var{digit} @var{digit} @var{digit}
-An octal character code. The numeric code is 3 octal digits.
-For compatibility with other Unix systems, 8 and 9 are accepted as digits:
-for example, @code{\008} has the value 010, and @code{\009} the value 011.
-
-@cindex @code{\@var{xd...}} (hex character code)
-@cindex hex character code (@code{\@var{xd...}})
-@item \@code{x} @var{hex-digits...}
-A hex character code. All trailing hex digits are combined. Either upper or
-lower case @code{x} works.
-
-@cindex @code{\\} (@samp{\} character)
-@cindex backslash (@code{\\})
-@item \\
-Represents one @samp{\} character.
-
-@c @item \'
-@c Represents one @samp{'} (accent acute) character.
-@c This is needed in single character literals
-@c (@xref{Characters,,Character Constants}.) to represent
-@c a @samp{'}.
-@c
-@cindex @code{\"} (doublequote character)
-@cindex doublequote (@code{\"})
-@item \"
-Represents one @samp{"} character. Needed in strings to represent
-this character, because an unescaped @samp{"} would end the string.
-
-@item \ @var{anything-else}
-Any other character when escaped by @kbd{\} gives a warning, but
-assembles as if the @samp{\} was not present. The idea is that if
-you used an escape sequence you clearly didn't want the literal
-interpretation of the following character. However @command{@value{AS}} has no
-other interpretation, so @command{@value{AS}} knows it is giving you the wrong
-code and warns you of the fact.
-@end table
-
-Which characters are escapable, and what those escapes represent,
-varies widely among assemblers. The current set is what we think
-the BSD 4.2 assembler recognizes, and is a subset of what most C
-compilers recognize. If you are in doubt, do not use an escape
-sequence.
-
-@node Chars
-@subsubsection Characters
-
-@cindex single character constant
-@cindex character, single
-@cindex constant, single character
-A single character may be written as a single quote immediately
-followed by that character. The same escapes apply to characters as
-to strings. So if you want to write the character backslash, you
-must write @kbd{'\\} where the first @code{\} escapes the second
-@code{\}. As you can see, the quote is an acute accent, not a
-grave accent. A newline
-@ifclear GENERIC
-@ifclear abnormal-separator
-(or semicolon @samp{;})
-@end ifclear
-@ifset abnormal-separator
-@ifset H8
-(or dollar sign @samp{$}, for the H8/300; or semicolon @samp{;} for the
-Renesas SH)
-@end ifset
-@end ifset
-@end ifclear
-immediately following an acute accent is taken as a literal character
-and does not count as the end of a statement. The value of a character
-constant in a numeric expression is the machine's byte-wide code for
-that character. @command{@value{AS}} assumes your character code is ASCII:
-@kbd{'A} means 65, @kbd{'B} means 66, and so on. @refill
-
-@node Numbers
-@subsection Number Constants
-
-@cindex constants, number
-@cindex number constants
-@command{@value{AS}} distinguishes three kinds of numbers according to how they
-are stored in the target machine. @emph{Integers} are numbers that
-would fit into an @code{int} in the C language. @emph{Bignums} are
-integers, but they are stored in more than 32 bits. @emph{Flonums}
-are floating point numbers, described below.
-
-@menu
-* Integers:: Integers
-* Bignums:: Bignums
-* Flonums:: Flonums
-@ifclear GENERIC
-@ifset I960
-* Bit Fields:: Bit Fields
-@end ifset
-@end ifclear
-@end menu
-
-@node Integers
-@subsubsection Integers
-@cindex integers
-@cindex constants, integer
-
-@cindex binary integers
-@cindex integers, binary
-A binary integer is @samp{0b} or @samp{0B} followed by zero or more of
-the binary digits @samp{01}.
-
-@cindex octal integers
-@cindex integers, octal
-An octal integer is @samp{0} followed by zero or more of the octal
-digits (@samp{01234567}).
-
-@cindex decimal integers
-@cindex integers, decimal
-A decimal integer starts with a non-zero digit followed by zero or
-more digits (@samp{0123456789}).
-
-@cindex hexadecimal integers
-@cindex integers, hexadecimal
-A hexadecimal integer is @samp{0x} or @samp{0X} followed by one or
-more hexadecimal digits chosen from @samp{0123456789abcdefABCDEF}.
-
-Integers have the usual values. To denote a negative integer, use
-the prefix operator @samp{-} discussed under expressions
-(@pxref{Prefix Ops,,Prefix Operators}).
-
-@node Bignums
-@subsubsection Bignums
-
-@cindex bignums
-@cindex constants, bignum
-A @dfn{bignum} has the same syntax and semantics as an integer
-except that the number (or its negative) takes more than 32 bits to
-represent in binary. The distinction is made because in some places
-integers are permitted while bignums are not.
-
-@node Flonums
-@subsubsection Flonums
-@cindex flonums
-@cindex floating point numbers
-@cindex constants, floating point
-
-@cindex precision, floating point
-A @dfn{flonum} represents a floating point number. The translation is
-indirect: a decimal floating point number from the text is converted by
-@command{@value{AS}} to a generic binary floating point number of more than
-sufficient precision. This generic floating point number is converted
-to a particular computer's floating point format (or formats) by a
-portion of @command{@value{AS}} specialized to that computer.
-
-A flonum is written by writing (in order)
-@itemize @bullet
-@item
-The digit @samp{0}.
-@ifset HPPA
-(@samp{0} is optional on the HPPA.)
-@end ifset
-
-@item
-A letter, to tell @command{@value{AS}} the rest of the number is a flonum.
-@ifset GENERIC
-@kbd{e} is recommended. Case is not important.
-@ignore
-@c FIXME: verify if flonum syntax really this vague for most cases
-(Any otherwise illegal letter works here, but that might be changed. Vax BSD
-4.2 assembler seems to allow any of @samp{defghDEFGH}.)
-@end ignore
-
-On the H8/300, Renesas / SuperH SH,
-and AMD 29K architectures, the letter must be
-one of the letters @samp{DFPRSX} (in upper or lower case).
-
-On the ARC, the letter must be one of the letters @samp{DFRS}
-(in upper or lower case).
-
-On the Intel 960 architecture, the letter must be
-one of the letters @samp{DFT} (in upper or lower case).
-
-On the HPPA architecture, the letter must be @samp{E} (upper case only).
-@end ifset
-@ifclear GENERIC
-@ifset ARC
-One of the letters @samp{DFRS} (in upper or lower case).
-@end ifset
-@ifset H8
-One of the letters @samp{DFPRSX} (in upper or lower case).
-@end ifset
-@ifset HPPA
-The letter @samp{E} (upper case only).
-@end ifset
-@ifset I960
-One of the letters @samp{DFT} (in upper or lower case).
-@end ifset
-@end ifclear
-
-@item
-An optional sign: either @samp{+} or @samp{-}.
-
-@item
-An optional @dfn{integer part}: zero or more decimal digits.
-
-@item
-An optional @dfn{fractional part}: @samp{.} followed by zero
-or more decimal digits.
-
-@item
-An optional exponent, consisting of:
-
-@itemize @bullet
-@item
-An @samp{E} or @samp{e}.
-@c I can't find a config where "EXP_CHARS" is other than 'eE', but in
-@c principle this can perfectly well be different on different targets.
-@item
-Optional sign: either @samp{+} or @samp{-}.
-@item
-One or more decimal digits.
-@end itemize
-
-@end itemize
-
-At least one of the integer part or the fractional part must be
-present. The floating point number has the usual base-10 value.
-
-@command{@value{AS}} does all processing using integers. Flonums are computed
-independently of any floating point hardware in the computer running
-@command{@value{AS}}.
-
-@ifclear GENERIC
-@ifset I960
-@c Bit fields are written as a general facility but are also controlled
-@c by a conditional-compilation flag---which is as of now (21mar91)
-@c turned on only by the i960 config of GAS.
-@node Bit Fields
-@subsubsection Bit Fields
-
-@cindex bit fields
-@cindex constants, bit field
-You can also define numeric constants as @dfn{bit fields}.
-Specify two numbers separated by a colon---
-@example
-@var{mask}:@var{value}
-@end example
-@noindent
-@command{@value{AS}} applies a bitwise @sc{and} between @var{mask} and
-@var{value}.
-
-The resulting number is then packed
-@ifset GENERIC
-@c this conditional paren in case bit fields turned on elsewhere than 960
-(in host-dependent byte order)
-@end ifset
-into a field whose width depends on which assembler directive has the
-bit-field as its argument. Overflow (a result from the bitwise and
-requiring more binary digits to represent) is not an error; instead,
-more constants are generated, of the specified width, beginning with the
-least significant digits.@refill
-
-The directives @code{.byte}, @code{.hword}, @code{.int}, @code{.long},
-@code{.short}, and @code{.word} accept bit-field arguments.
-@end ifset
-@end ifclear
-
-@node Sections
-@chapter Sections and Relocation
-@cindex sections
-@cindex relocation
-
-@menu
-* Secs Background:: Background
-* Ld Sections:: Linker Sections
-* As Sections:: Assembler Internal Sections
-* Sub-Sections:: Sub-Sections
-* bss:: bss Section
-@end menu
-
-@node Secs Background
-@section Background
-
-Roughly, a section is a range of addresses, with no gaps; all data
-``in'' those addresses is treated the same for some particular purpose.
-For example there may be a ``read only'' section.
-
-@cindex linker, and assembler
-@cindex assembler, and linker
-The linker @code{@value{LD}} reads many object files (partial programs) and
-combines their contents to form a runnable program. When @command{@value{AS}}
-emits an object file, the partial program is assumed to start at address 0.
-@code{@value{LD}} assigns the final addresses for the partial program, so that
-different partial programs do not overlap. This is actually an
-oversimplification, but it suffices to explain how @command{@value{AS}} uses
-sections.
-
-@code{@value{LD}} moves blocks of bytes of your program to their run-time
-addresses. These blocks slide to their run-time addresses as rigid
-units; their length does not change and neither does the order of bytes
-within them. Such a rigid unit is called a @emph{section}. Assigning
-run-time addresses to sections is called @dfn{relocation}. It includes
-the task of adjusting mentions of object-file addresses so they refer to
-the proper run-time addresses.
-@ifset H8
-For the H8/300, and for the Renesas / SuperH SH,
-@command{@value{AS}} pads sections if needed to
-ensure they end on a word (sixteen bit) boundary.
-@end ifset
-
-@cindex standard assembler sections
-An object file written by @command{@value{AS}} has at least three sections, any
-of which may be empty. These are named @dfn{text}, @dfn{data} and
-@dfn{bss} sections.
-
-@ifset COFF-ELF
-@ifset GENERIC
-When it generates COFF or ELF output,
-@end ifset
-@command{@value{AS}} can also generate whatever other named sections you specify
-using the @samp{.section} directive (@pxref{Section,,@code{.section}}).
-If you do not use any directives that place output in the @samp{.text}
-or @samp{.data} sections, these sections still exist, but are empty.
-@end ifset
-
-@ifset HPPA
-@ifset GENERIC
-When @command{@value{AS}} generates SOM or ELF output for the HPPA,
-@end ifset
-@command{@value{AS}} can also generate whatever other named sections you
-specify using the @samp{.space} and @samp{.subspace} directives. See
-@cite{HP9000 Series 800 Assembly Language Reference Manual}
-(HP 92432-90001) for details on the @samp{.space} and @samp{.subspace}
-assembler directives.
-
-@ifset SOM
-Additionally, @command{@value{AS}} uses different names for the standard
-text, data, and bss sections when generating SOM output. Program text
-is placed into the @samp{$CODE$} section, data into @samp{$DATA$}, and
-BSS into @samp{$BSS$}.
-@end ifset
-@end ifset
-
-Within the object file, the text section starts at address @code{0}, the
-data section follows, and the bss section follows the data section.
-
-@ifset HPPA
-When generating either SOM or ELF output files on the HPPA, the text
-section starts at address @code{0}, the data section at address
-@code{0x4000000}, and the bss section follows the data section.
-@end ifset
-
-To let @code{@value{LD}} know which data changes when the sections are
-relocated, and how to change that data, @command{@value{AS}} also writes to the
-object file details of the relocation needed. To perform relocation
-@code{@value{LD}} must know, each time an address in the object
-file is mentioned:
-@itemize @bullet
-@item
-Where in the object file is the beginning of this reference to
-an address?
-@item
-How long (in bytes) is this reference?
-@item
-Which section does the address refer to? What is the numeric value of
-@display
-(@var{address}) @minus{} (@var{start-address of section})?
-@end display
-@item
-Is the reference to an address ``Program-Counter relative''?
-@end itemize
-
-@cindex addresses, format of
-@cindex section-relative addressing
-In fact, every address @command{@value{AS}} ever uses is expressed as
-@display
-(@var{section}) + (@var{offset into section})
-@end display
-@noindent
-Further, most expressions @command{@value{AS}} computes have this section-relative
-nature.
-@ifset SOM
-(For some object formats, such as SOM for the HPPA, some expressions are
-symbol-relative instead.)
-@end ifset
-
-In this manual we use the notation @{@var{secname} @var{N}@} to mean ``offset
-@var{N} into section @var{secname}.''
-
-Apart from text, data and bss sections you need to know about the
-@dfn{absolute} section. When @code{@value{LD}} mixes partial programs,
-addresses in the absolute section remain unchanged. For example, address
-@code{@{absolute 0@}} is ``relocated'' to run-time address 0 by
-@code{@value{LD}}. Although the linker never arranges two partial programs'
-data sections with overlapping addresses after linking, @emph{by definition}
-their absolute sections must overlap. Address @code{@{absolute@ 239@}} in one
-part of a program is always the same address when the program is running as
-address @code{@{absolute@ 239@}} in any other part of the program.
-
-The idea of sections is extended to the @dfn{undefined} section. Any
-address whose section is unknown at assembly time is by definition
-rendered @{undefined @var{U}@}---where @var{U} is filled in later.
-Since numbers are always defined, the only way to generate an undefined
-address is to mention an undefined symbol. A reference to a named
-common block would be such a symbol: its value is unknown at assembly
-time so it has section @emph{undefined}.
-
-By analogy the word @emph{section} is used to describe groups of sections in
-the linked program. @code{@value{LD}} puts all partial programs' text
-sections in contiguous addresses in the linked program. It is
-customary to refer to the @emph{text section} of a program, meaning all
-the addresses of all partial programs' text sections. Likewise for
-data and bss sections.
-
-Some sections are manipulated by @code{@value{LD}}; others are invented for
-use of @command{@value{AS}} and have no meaning except during assembly.
-
-@node Ld Sections
-@section Linker Sections
-@code{@value{LD}} deals with just four kinds of sections, summarized below.
-
-@table @strong
-
-@ifset COFF-ELF
-@cindex named sections
-@cindex sections, named
-@item named sections
-@end ifset
-@ifset aout-bout
-@cindex text section
-@cindex data section
-@itemx text section
-@itemx data section
-@end ifset
-These sections hold your program. @command{@value{AS}} and @code{@value{LD}} treat them as
-separate but equal sections. Anything you can say of one section is
-true of another.
-@c @ifset aout-bout
-When the program is running, however, it is
-customary for the text section to be unalterable. The
-text section is often shared among processes: it contains
-instructions, constants and the like. The data section of a running
-program is usually alterable: for example, C variables would be stored
-in the data section.
-@c @end ifset
-
-@cindex bss section
-@item bss section
-This section contains zeroed bytes when your program begins running. It
-is used to hold uninitialized variables or common storage. The length of
-each partial program's bss section is important, but because it starts
-out containing zeroed bytes there is no need to store explicit zero
-bytes in the object file. The bss section was invented to eliminate
-those explicit zeros from object files.
-
-@cindex absolute section
-@item absolute section
-Address 0 of this section is always ``relocated'' to runtime address 0.
-This is useful if you want to refer to an address that @code{@value{LD}} must
-not change when relocating. In this sense we speak of absolute
-addresses being ``unrelocatable'': they do not change during relocation.
-
-@cindex undefined section
-@item undefined section
-This ``section'' is a catch-all for address references to objects not in
-the preceding sections.
-@c FIXME: ref to some other doc on obj-file formats could go here.
-@end table
-
-@cindex relocation example
-An idealized example of three relocatable sections follows.
-@ifset COFF-ELF
-The example uses the traditional section names @samp{.text} and @samp{.data}.
-@end ifset
-Memory addresses are on the horizontal axis.
-
-@c TEXI2ROFF-KILL
-@ifnottex
-@c END TEXI2ROFF-KILL
-@smallexample
- +-----+----+--+
-partial program # 1: |ttttt|dddd|00|
- +-----+----+--+
-
- text data bss
- seg. seg. seg.
-
- +---+---+---+
-partial program # 2: |TTT|DDD|000|
- +---+---+---+
-
- +--+---+-----+--+----+---+-----+~~
-linked program: | |TTT|ttttt| |dddd|DDD|00000|
- +--+---+-----+--+----+---+-----+~~
-
- addresses: 0 @dots{}
-@end smallexample
-@c TEXI2ROFF-KILL
-@end ifnottex
-@need 5000
-@tex
-\bigskip
-\line{\it Partial program \#1: \hfil}
-\line{\ibox{2.5cm}{\tt text}\ibox{2cm}{\tt data}\ibox{1cm}{\tt bss}\hfil}
-\line{\boxit{2.5cm}{\tt ttttt}\boxit{2cm}{\tt dddd}\boxit{1cm}{\tt 00}\hfil}
-
-\line{\it Partial program \#2: \hfil}
-\line{\ibox{1cm}{\tt text}\ibox{1.5cm}{\tt data}\ibox{1cm}{\tt bss}\hfil}
-\line{\boxit{1cm}{\tt TTT}\boxit{1.5cm}{\tt DDDD}\boxit{1cm}{\tt 000}\hfil}
-
-\line{\it linked program: \hfil}
-\line{\ibox{.5cm}{}\ibox{1cm}{\tt text}\ibox{2.5cm}{}\ibox{.75cm}{}\ibox{2cm}{\tt data}\ibox{1.5cm}{}\ibox{2cm}{\tt bss}\hfil}
-\line{\boxit{.5cm}{}\boxit{1cm}{\tt TTT}\boxit{2.5cm}{\tt
-ttttt}\boxit{.75cm}{}\boxit{2cm}{\tt dddd}\boxit{1.5cm}{\tt
-DDDD}\boxit{2cm}{\tt 00000}\ \dots\hfil}
-
-\line{\it addresses: \hfil}
-\line{0\dots\hfil}
-
-@end tex
-@c END TEXI2ROFF-KILL
-
-@node As Sections
-@section Assembler Internal Sections
-
-@cindex internal assembler sections
-@cindex sections in messages, internal
-These sections are meant only for the internal use of @command{@value{AS}}. They
-have no meaning at run-time. You do not really need to know about these
-sections for most purposes; but they can be mentioned in @command{@value{AS}}
-warning messages, so it might be helpful to have an idea of their
-meanings to @command{@value{AS}}. These sections are used to permit the
-value of every expression in your assembly language program to be a
-section-relative address.
-
-@table @b
-@cindex assembler internal logic error
-@item ASSEMBLER-INTERNAL-LOGIC-ERROR!
-An internal assembler logic error has been found. This means there is a
-bug in the assembler.
-
-@cindex expr (internal section)
-@item expr section
-The assembler stores complex expression internally as combinations of
-symbols. When it needs to represent an expression as a symbol, it puts
-it in the expr section.
-@c FIXME item debug
-@c FIXME item transfer[t] vector preload
-@c FIXME item transfer[t] vector postload
-@c FIXME item register
-@end table
-
-@node Sub-Sections
-@section Sub-Sections
-
-@cindex numbered subsections
-@cindex grouping data
-@ifset aout-bout
-Assembled bytes
-@ifset COFF-ELF
-conventionally
-@end ifset
-fall into two sections: text and data.
-@end ifset
-You may have separate groups of
-@ifset GENERIC
-data in named sections
-@end ifset
-@ifclear GENERIC
-@ifclear aout-bout
-data in named sections
-@end ifclear
-@ifset aout-bout
-text or data
-@end ifset
-@end ifclear
-that you want to end up near to each other in the object file, even though they
-are not contiguous in the assembler source. @command{@value{AS}} allows you to
-use @dfn{subsections} for this purpose. Within each section, there can be
-numbered subsections with values from 0 to 8192. Objects assembled into the
-same subsection go into the object file together with other objects in the same
-subsection. For example, a compiler might want to store constants in the text
-section, but might not want to have them interspersed with the program being
-assembled. In this case, the compiler could issue a @samp{.text 0} before each
-section of code being output, and a @samp{.text 1} before each group of
-constants being output.
-
-Subsections are optional. If you do not use subsections, everything
-goes in subsection number zero.
-
-@ifset GENERIC
-Each subsection is zero-padded up to a multiple of four bytes.
-(Subsections may be padded a different amount on different flavors
-of @command{@value{AS}}.)
-@end ifset
-@ifclear GENERIC
-@ifset H8
-On the H8/300 platform, each subsection is zero-padded to a word
-boundary (two bytes).
-The same is true on the Renesas SH.
-@end ifset
-@ifset I960
-@c FIXME section padding (alignment)?
-@c Rich Pixley says padding here depends on target obj code format; that
-@c doesn't seem particularly useful to say without further elaboration,
-@c so for now I say nothing about it. If this is a generic BFD issue,
-@c these paragraphs might need to vanish from this manual, and be
-@c discussed in BFD chapter of binutils (or some such).
-@end ifset
-@end ifclear
-
-Subsections appear in your object file in numeric order, lowest numbered
-to highest. (All this to be compatible with other people's assemblers.)
-The object file contains no representation of subsections; @code{@value{LD}} and
-other programs that manipulate object files see no trace of them.
-They just see all your text subsections as a text section, and all your
-data subsections as a data section.
-
-To specify which subsection you want subsequent statements assembled
-into, use a numeric argument to specify it, in a @samp{.text
-@var{expression}} or a @samp{.data @var{expression}} statement.
-@ifset COFF
-@ifset GENERIC
-When generating COFF output, you
-@end ifset
-@ifclear GENERIC
-You
-@end ifclear
-can also use an extra subsection
-argument with arbitrary named sections: @samp{.section @var{name},
-@var{expression}}.
-@end ifset
-@ifset ELF
-@ifset GENERIC
-When generating ELF output, you
-@end ifset
-@ifclear GENERIC
-You
-@end ifclear
-can also use the @code{.subsection} directive (@pxref{SubSection})
-to specify a subsection: @samp{.subsection @var{expression}}.
-@end ifset
-@var{Expression} should be an absolute expression
-(@pxref{Expressions}). If you just say @samp{.text} then @samp{.text 0}
-is assumed. Likewise @samp{.data} means @samp{.data 0}. Assembly
-begins in @code{text 0}. For instance:
-@smallexample
-.text 0 # The default subsection is text 0 anyway.
-.ascii "This lives in the first text subsection. *"
-.text 1
-.ascii "But this lives in the second text subsection."
-.data 0
-.ascii "This lives in the data section,"
-.ascii "in the first data subsection."
-.text 0
-.ascii "This lives in the first text section,"
-.ascii "immediately following the asterisk (*)."
-@end smallexample
-
-Each section has a @dfn{location counter} incremented by one for every byte
-assembled into that section. Because subsections are merely a convenience
-restricted to @command{@value{AS}} there is no concept of a subsection location
-counter. There is no way to directly manipulate a location counter---but the
-@code{.align} directive changes it, and any label definition captures its
-current value. The location counter of the section where statements are being
-assembled is said to be the @dfn{active} location counter.
-
-@node bss
-@section bss Section
-
-@cindex bss section
-@cindex common variable storage
-The bss section is used for local common variable storage.
-You may allocate address space in the bss section, but you may
-not dictate data to load into it before your program executes. When
-your program starts running, all the contents of the bss
-section are zeroed bytes.
-
-The @code{.lcomm} pseudo-op defines a symbol in the bss section; see
-@ref{Lcomm,,@code{.lcomm}}.
-
-The @code{.comm} pseudo-op may be used to declare a common symbol, which is
-another form of uninitialized symbol; see @ref{Comm,,@code{.comm}}.
-
-@ifset GENERIC
-When assembling for a target which supports multiple sections, such as ELF or
-COFF, you may switch into the @code{.bss} section and define symbols as usual;
-see @ref{Section,,@code{.section}}. You may only assemble zero values into the
-section. Typically the section will only contain symbol definitions and
-@code{.skip} directives (@pxref{Skip,,@code{.skip}}).
-@end ifset
-
-@node Symbols
-@chapter Symbols
-
-@cindex symbols
-Symbols are a central concept: the programmer uses symbols to name
-things, the linker uses symbols to link, and the debugger uses symbols
-to debug.
-
-@quotation
-@cindex debuggers, and symbol order
-@emph{Warning:} @command{@value{AS}} does not place symbols in the object file in
-the same order they were declared. This may break some debuggers.
-@end quotation
-
-@menu
-* Labels:: Labels
-* Setting Symbols:: Giving Symbols Other Values
-* Symbol Names:: Symbol Names
-* Dot:: The Special Dot Symbol
-* Symbol Attributes:: Symbol Attributes
-@end menu
-
-@node Labels
-@section Labels
-
-@cindex labels
-A @dfn{label} is written as a symbol immediately followed by a colon
-@samp{:}. The symbol then represents the current value of the
-active location counter, and is, for example, a suitable instruction
-operand. You are warned if you use the same symbol to represent two
-different locations: the first definition overrides any other
-definitions.
-
-@ifset HPPA
-On the HPPA, the usual form for a label need not be immediately followed by a
-colon, but instead must start in column zero. Only one label may be defined on
-a single line. To work around this, the HPPA version of @command{@value{AS}} also
-provides a special directive @code{.label} for defining labels more flexibly.
-@end ifset
-
-@node Setting Symbols
-@section Giving Symbols Other Values
-
-@cindex assigning values to symbols
-@cindex symbol values, assigning
-A symbol can be given an arbitrary value by writing a symbol, followed
-by an equals sign @samp{=}, followed by an expression
-(@pxref{Expressions}). This is equivalent to using the @code{.set}
-directive. @xref{Set,,@code{.set}}. In the same way, using a double
-equals sign @samp{=}@samp{=} here represents an equivalent of the
-@code{.eqv} directive. @xref{Eqv,,@code{.eqv}}.
-
-@node Symbol Names
-@section Symbol Names
-
-@cindex symbol names
-@cindex names, symbol
-@ifclear SPECIAL-SYMS
-Symbol names begin with a letter or with one of @samp{._}. On most
-machines, you can also use @code{$} in symbol names; exceptions are
-noted in @ref{Machine Dependencies}. That character may be followed by any
-string of digits, letters, dollar signs (unless otherwise noted for a
-particular target machine), and underscores.
-@end ifclear
-@ifset SPECIAL-SYMS
-@ifset H8
-Symbol names begin with a letter or with one of @samp{._}. On the
-Renesas SH you can also use @code{$} in symbol names. That
-character may be followed by any string of digits, letters, dollar signs (save
-on the H8/300), and underscores.
-@end ifset
-@end ifset
-
-Case of letters is significant: @code{foo} is a different symbol name
-than @code{Foo}.
-
-Each symbol has exactly one name. Each name in an assembly language program
-refers to exactly one symbol. You may use that symbol name any number of times
-in a program.
-
-@subheading Local Symbol Names
-
-@cindex local symbol names
-@cindex symbol names, local
-A local symbol is any symbol beginning with certain local label prefixes.
-By default, the local label prefix is @samp{.L} for ELF systems or
-@samp{L} for traditional a.out systems, but each target may have its own
-set of local label prefixes.
-@ifset HPPA
-On the HPPA local symbols begin with @samp{L$}.
-@end ifset
-
-Local symbols are defined and used within the assembler, but they are
-normally not saved in object files. Thus, they are not visible when debugging.
-You may use the @samp{-L} option (@pxref{L, ,Include Local Symbols:
-@option{-L}}) to retain the local symbols in the object files.
-
-@subheading Local Labels
-
-@cindex local labels
-@cindex temporary symbol names
-@cindex symbol names, temporary
-Local labels help compilers and programmers use names temporarily.
-They create symbols which are guaranteed to be unique over the entire scope of
-the input source code and which can be referred to by a simple notation.
-To define a local label, write a label of the form @samp{@b{N}:} (where @b{N}
-represents any positive integer). To refer to the most recent previous
-definition of that label write @samp{@b{N}b}, using the same number as when
-you defined the label. To refer to the next definition of a local label, write
-@samp{@b{N}f}---the @samp{b} stands for ``backwards'' and the @samp{f} stands
-for ``forwards''.
-
-There is no restriction on how you can use these labels, and you can reuse them
-too. So that it is possible to repeatedly define the same local label (using
-the same number @samp{@b{N}}), although you can only refer to the most recently
-defined local label of that number (for a backwards reference) or the next
-definition of a specific local label for a forward reference. It is also worth
-noting that the first 10 local labels (@samp{@b{0:}}@dots{}@samp{@b{9:}}) are
-implemented in a slightly more efficient manner than the others.
-
-Here is an example:
-
-@smallexample
-1: branch 1f
-2: branch 1b
-1: branch 2f
-2: branch 1b
-@end smallexample
-
-Which is the equivalent of:
-
-@smallexample
-label_1: branch label_3
-label_2: branch label_1
-label_3: branch label_4
-label_4: branch label_3
-@end smallexample
-
-Local label names are only a notational device. They are immediately
-transformed into more conventional symbol names before the assembler uses them.
-The symbol names are stored in the symbol table, appear in error messages, and
-are optionally emitted to the object file. The names are constructed using
-these parts:
-
-@table @code
-@item @emph{local label prefix}
-All local symbols begin with the system-specific local label prefix.
-Normally both @command{@value{AS}} and @code{@value{LD}} forget symbols
-that start with the local label prefix. These labels are
-used for symbols you are never intended to see. If you use the
-@samp{-L} option then @command{@value{AS}} retains these symbols in the
-object file. If you also instruct @code{@value{LD}} to retain these symbols,
-you may use them in debugging.
-
-@item @var{number}
-This is the number that was used in the local label definition. So if the
-label is written @samp{55:} then the number is @samp{55}.
-
-@item @kbd{C-B}
-This unusual character is included so you do not accidentally invent a symbol
-of the same name. The character has ASCII value of @samp{\002} (control-B).
-
-@item @emph{ordinal number}
-This is a serial number to keep the labels distinct. The first definition of
-@samp{0:} gets the number @samp{1}. The 15th definition of @samp{0:} gets the
-number @samp{15}, and so on. Likewise the first definition of @samp{1:} gets
-the number @samp{1} and its 15th definition gets @samp{15} as well.
-@end table
-
-So for example, the first @code{1:} may be named @code{.L1@kbd{C-B}1}, and
-the 44th @code{3:} may be named @code{.L3@kbd{C-B}44}.
-
-@subheading Dollar Local Labels
-@cindex dollar local symbols
-
-@code{@value{AS}} also supports an even more local form of local labels called
-dollar labels. These labels go out of scope (i.e., they become undefined) as
-soon as a non-local label is defined. Thus they remain valid for only a small
-region of the input source code. Normal local labels, by contrast, remain in
-scope for the entire file, or until they are redefined by another occurrence of
-the same local label.
-
-Dollar labels are defined in exactly the same way as ordinary local labels,
-except that instead of being terminated by a colon, they are terminated by a
-dollar sign, e.g., @samp{@b{55$}}.
-
-They can also be distinguished from ordinary local labels by their transformed
-names which use ASCII character @samp{\001} (control-A) as the magic character
-to distinguish them from ordinary labels. For example, the fifth definition of
-@samp{6$} may be named @samp{.L6@kbd{C-A}5}.
-
-@node Dot
-@section The Special Dot Symbol
-
-@cindex dot (symbol)
-@cindex @code{.} (symbol)
-@cindex current address
-@cindex location counter
-The special symbol @samp{.} refers to the current address that
-@command{@value{AS}} is assembling into. Thus, the expression @samp{melvin:
-.long .} defines @code{melvin} to contain its own address.
-Assigning a value to @code{.} is treated the same as a @code{.org}
-directive. Thus, the expression @samp{.=.+4} is the same as saying
-@ifclear no-space-dir
-@samp{.space 4}.
-@end ifclear
-
-@node Symbol Attributes
-@section Symbol Attributes
-
-@cindex symbol attributes
-@cindex attributes, symbol
-Every symbol has, as well as its name, the attributes ``Value'' and
-``Type''. Depending on output format, symbols can also have auxiliary
-attributes.
-@ifset INTERNALS
-The detailed definitions are in @file{a.out.h}.
-@end ifset
-
-If you use a symbol without defining it, @command{@value{AS}} assumes zero for
-all these attributes, and probably won't warn you. This makes the
-symbol an externally defined symbol, which is generally what you
-would want.
-
-@menu
-* Symbol Value:: Value
-* Symbol Type:: Type
-@ifset aout-bout
-@ifset GENERIC
-* a.out Symbols:: Symbol Attributes: @code{a.out}
-@end ifset
-@ifclear GENERIC
-@ifclear BOUT
-* a.out Symbols:: Symbol Attributes: @code{a.out}
-@end ifclear
-@ifset BOUT
-* a.out Symbols:: Symbol Attributes: @code{a.out}, @code{b.out}
-@end ifset
-@end ifclear
-@end ifset
-@ifset COFF
-* COFF Symbols:: Symbol Attributes for COFF
-@end ifset
-@ifset SOM
-* SOM Symbols:: Symbol Attributes for SOM
-@end ifset
-@end menu
-
-@node Symbol Value
-@subsection Value
-
-@cindex value of a symbol
-@cindex symbol value
-The value of a symbol is (usually) 32 bits. For a symbol which labels a
-location in the text, data, bss or absolute sections the value is the
-number of addresses from the start of that section to the label.
-Naturally for text, data and bss sections the value of a symbol changes
-as @code{@value{LD}} changes section base addresses during linking. Absolute
-symbols' values do not change during linking: that is why they are
-called absolute.
-
-The value of an undefined symbol is treated in a special way. If it is
-0 then the symbol is not defined in this assembler source file, and
-@code{@value{LD}} tries to determine its value from other files linked into the
-same program. You make this kind of symbol simply by mentioning a symbol
-name without defining it. A non-zero value represents a @code{.comm}
-common declaration. The value is how much common storage to reserve, in
-bytes (addresses). The symbol refers to the first address of the
-allocated storage.
-
-@node Symbol Type
-@subsection Type
-
-@cindex type of a symbol
-@cindex symbol type
-The type attribute of a symbol contains relocation (section)
-information, any flag settings indicating that a symbol is external, and
-(optionally), other information for linkers and debuggers. The exact
-format depends on the object-code output format in use.
-
-@ifset aout-bout
-@ifclear GENERIC
-@ifset BOUT
-@c The following avoids a "widow" subsection title. @group would be
-@c better if it were available outside examples.
-@need 1000
-@node a.out Symbols
-@subsection Symbol Attributes: @code{a.out}, @code{b.out}
-
-@cindex @code{b.out} symbol attributes
-@cindex symbol attributes, @code{b.out}
-These symbol attributes appear only when @command{@value{AS}} is configured for
-one of the Berkeley-descended object output formats---@code{a.out} or
-@code{b.out}.
-
-@end ifset
-@ifclear BOUT
-@node a.out Symbols
-@subsection Symbol Attributes: @code{a.out}
-
-@cindex @code{a.out} symbol attributes
-@cindex symbol attributes, @code{a.out}
-
-@end ifclear
-@end ifclear
-@ifset GENERIC
-@node a.out Symbols
-@subsection Symbol Attributes: @code{a.out}
-
-@cindex @code{a.out} symbol attributes
-@cindex symbol attributes, @code{a.out}
-
-@end ifset
-@menu
-* Symbol Desc:: Descriptor
-* Symbol Other:: Other
-@end menu
-
-@node Symbol Desc
-@subsubsection Descriptor
-
-@cindex descriptor, of @code{a.out} symbol
-This is an arbitrary 16-bit value. You may establish a symbol's
-descriptor value by using a @code{.desc} statement
-(@pxref{Desc,,@code{.desc}}). A descriptor value means nothing to
-@command{@value{AS}}.
-
-@node Symbol Other
-@subsubsection Other
-
-@cindex other attribute, of @code{a.out} symbol
-This is an arbitrary 8-bit value. It means nothing to @command{@value{AS}}.
-@end ifset
-
-@ifset COFF
-@node COFF Symbols
-@subsection Symbol Attributes for COFF
-
-@cindex COFF symbol attributes
-@cindex symbol attributes, COFF
-
-The COFF format supports a multitude of auxiliary symbol attributes;
-like the primary symbol attributes, they are set between @code{.def} and
-@code{.endef} directives.
-
-@subsubsection Primary Attributes
-
-@cindex primary attributes, COFF symbols
-The symbol name is set with @code{.def}; the value and type,
-respectively, with @code{.val} and @code{.type}.
-
-@subsubsection Auxiliary Attributes
-
-@cindex auxiliary attributes, COFF symbols
-The @command{@value{AS}} directives @code{.dim}, @code{.line}, @code{.scl},
-@code{.size}, @code{.tag}, and @code{.weak} can generate auxiliary symbol
-table information for COFF.
-@end ifset
-
-@ifset SOM
-@node SOM Symbols
-@subsection Symbol Attributes for SOM
-
-@cindex SOM symbol attributes
-@cindex symbol attributes, SOM
-
-The SOM format for the HPPA supports a multitude of symbol attributes set with
-the @code{.EXPORT} and @code{.IMPORT} directives.
-
-The attributes are described in @cite{HP9000 Series 800 Assembly
-Language Reference Manual} (HP 92432-90001) under the @code{IMPORT} and
-@code{EXPORT} assembler directive documentation.
-@end ifset
-
-@node Expressions
-@chapter Expressions
-
-@cindex expressions
-@cindex addresses
-@cindex numeric values
-An @dfn{expression} specifies an address or numeric value.
-Whitespace may precede and/or follow an expression.
-
-The result of an expression must be an absolute number, or else an offset into
-a particular section. If an expression is not absolute, and there is not
-enough information when @command{@value{AS}} sees the expression to know its
-section, a second pass over the source program might be necessary to interpret
-the expression---but the second pass is currently not implemented.
-@command{@value{AS}} aborts with an error message in this situation.
-
-@menu
-* Empty Exprs:: Empty Expressions
-* Integer Exprs:: Integer Expressions
-@end menu
-
-@node Empty Exprs
-@section Empty Expressions
-
-@cindex empty expressions
-@cindex expressions, empty
-An empty expression has no value: it is just whitespace or null.
-Wherever an absolute expression is required, you may omit the
-expression, and @command{@value{AS}} assumes a value of (absolute) 0. This
-is compatible with other assemblers.
-
-@node Integer Exprs
-@section Integer Expressions
-
-@cindex integer expressions
-@cindex expressions, integer
-An @dfn{integer expression} is one or more @emph{arguments} delimited
-by @emph{operators}.
-
-@menu
-* Arguments:: Arguments
-* Operators:: Operators
-* Prefix Ops:: Prefix Operators
-* Infix Ops:: Infix Operators
-@end menu
-
-@node Arguments
-@subsection Arguments
-
-@cindex expression arguments
-@cindex arguments in expressions
-@cindex operands in expressions
-@cindex arithmetic operands
-@dfn{Arguments} are symbols, numbers or subexpressions. In other
-contexts arguments are sometimes called ``arithmetic operands''. In
-this manual, to avoid confusing them with the ``instruction operands'' of
-the machine language, we use the term ``argument'' to refer to parts of
-expressions only, reserving the word ``operand'' to refer only to machine
-instruction operands.
-
-Symbols are evaluated to yield @{@var{section} @var{NNN}@} where
-@var{section} is one of text, data, bss, absolute,
-or undefined. @var{NNN} is a signed, 2's complement 32 bit
-integer.
-
-Numbers are usually integers.
-
-A number can be a flonum or bignum. In this case, you are warned
-that only the low order 32 bits are used, and @command{@value{AS}} pretends
-these 32 bits are an integer. You may write integer-manipulating
-instructions that act on exotic constants, compatible with other
-assemblers.
-
-@cindex subexpressions
-Subexpressions are a left parenthesis @samp{(} followed by an integer
-expression, followed by a right parenthesis @samp{)}; or a prefix
-operator followed by an argument.
-
-@node Operators
-@subsection Operators
-
-@cindex operators, in expressions
-@cindex arithmetic functions
-@cindex functions, in expressions
-@dfn{Operators} are arithmetic functions, like @code{+} or @code{%}. Prefix
-operators are followed by an argument. Infix operators appear
-between their arguments. Operators may be preceded and/or followed by
-whitespace.
-
-@node Prefix Ops
-@subsection Prefix Operator
-
-@cindex prefix operators
-@command{@value{AS}} has the following @dfn{prefix operators}. They each take
-one argument, which must be absolute.
-
-@c the tex/end tex stuff surrounding this small table is meant to make
-@c it align, on the printed page, with the similar table in the next
-@c section (which is inside an enumerate).
-@tex
-\global\advance\leftskip by \itemindent
-@end tex
-
-@table @code
-@item -
-@dfn{Negation}. Two's complement negation.
-@item ~
-@dfn{Complementation}. Bitwise not.
-@end table
-
-@tex
-\global\advance\leftskip by -\itemindent
-@end tex
-
-@node Infix Ops
-@subsection Infix Operators
-
-@cindex infix operators
-@cindex operators, permitted arguments
-@dfn{Infix operators} take two arguments, one on either side. Operators
-have precedence, but operations with equal precedence are performed left
-to right. Apart from @code{+} or @option{-}, both arguments must be
-absolute, and the result is absolute.
-
-@enumerate
-@cindex operator precedence
-@cindex precedence of operators
-
-@item
-Highest Precedence
-
-@table @code
-@item *
-@dfn{Multiplication}.
-
-@item /
-@dfn{Division}. Truncation is the same as the C operator @samp{/}
-
-@item %
-@dfn{Remainder}.
-
-@item <<
-@dfn{Shift Left}. Same as the C operator @samp{<<}.
-
-@item >>
-@dfn{Shift Right}. Same as the C operator @samp{>>}.
-@end table
-
-@item
-Intermediate precedence
-
-@table @code
-@item |
-
-@dfn{Bitwise Inclusive Or}.
-
-@item &
-@dfn{Bitwise And}.
-
-@item ^
-@dfn{Bitwise Exclusive Or}.
-
-@item !
-@dfn{Bitwise Or Not}.
-@end table
-
-@item
-Low Precedence
-
-@table @code
-@cindex addition, permitted arguments
-@cindex plus, permitted arguments
-@cindex arguments for addition
-@item +
-@dfn{Addition}. If either argument is absolute, the result has the section of
-the other argument. You may not add together arguments from different
-sections.
-
-@cindex subtraction, permitted arguments
-@cindex minus, permitted arguments
-@cindex arguments for subtraction
-@item -
-@dfn{Subtraction}. If the right argument is absolute, the
-result has the section of the left argument.
-If both arguments are in the same section, the result is absolute.
-You may not subtract arguments from different sections.
-@c FIXME is there still something useful to say about undefined - undefined ?
-
-@cindex comparison expressions
-@cindex expressions, comparison
-@item ==
-@dfn{Is Equal To}
-@item <>
-@itemx !=
-@dfn{Is Not Equal To}
-@item <
-@dfn{Is Less Than}
-@item >
-@dfn{Is Greater Than}
-@item >=
-@dfn{Is Greater Than Or Equal To}
-@item <=
-@dfn{Is Less Than Or Equal To}
-
-The comparison operators can be used as infix operators. A true results has a
-value of -1 whereas a false result has a value of 0. Note, these operators
-perform signed comparisons.
-@end table
-
-@item Lowest Precedence
-
-@table @code
-@item &&
-@dfn{Logical And}.
-
-@item ||
-@dfn{Logical Or}.
-
-These two logical operations can be used to combine the results of sub
-expressions. Note, unlike the comparison operators a true result returns a
-value of 1 but a false results does still return 0. Also note that the logical
-or operator has a slightly lower precedence than logical and.
-
-@end table
-@end enumerate
-
-In short, it's only meaningful to add or subtract the @emph{offsets} in an
-address; you can only have a defined section in one of the two arguments.
-
-@node Pseudo Ops
-@chapter Assembler Directives
-
-@cindex directives, machine independent
-@cindex pseudo-ops, machine independent
-@cindex machine independent directives
-All assembler directives have names that begin with a period (@samp{.}).
-The rest of the name is letters, usually in lower case.
-
-This chapter discusses directives that are available regardless of the
-target machine configuration for the @sc{gnu} assembler.
-@ifset GENERIC
-Some machine configurations provide additional directives.
-@xref{Machine Dependencies}.
-@end ifset
-@ifclear GENERIC
-@ifset machine-directives
-@xref{Machine Dependencies}, for additional directives.
-@end ifset
-@end ifclear
-
-@menu
-* Abort:: @code{.abort}
-@ifset COFF
-* ABORT (COFF):: @code{.ABORT}
-@end ifset
-
-* Align:: @code{.align @var{abs-expr} , @var{abs-expr}}
-* Altmacro:: @code{.altmacro}
-* Ascii:: @code{.ascii "@var{string}"}@dots{}
-* Asciz:: @code{.asciz "@var{string}"}@dots{}
-* Balign:: @code{.balign @var{abs-expr} , @var{abs-expr}}
-* Byte:: @code{.byte @var{expressions}}
-* Comm:: @code{.comm @var{symbol} , @var{length} }
-
-* CFI directives:: @code{.cfi_startproc [simple]}, @code{.cfi_endproc}, etc.
-
-* Data:: @code{.data @var{subsection}}
-@ifset COFF
-* Def:: @code{.def @var{name}}
-@end ifset
-@ifset aout-bout
-* Desc:: @code{.desc @var{symbol}, @var{abs-expression}}
-@end ifset
-@ifset COFF
-* Dim:: @code{.dim}
-@end ifset
-
-* Double:: @code{.double @var{flonums}}
-* Eject:: @code{.eject}
-* Else:: @code{.else}
-* Elseif:: @code{.elseif}
-* End:: @code{.end}
-@ifset COFF
-* Endef:: @code{.endef}
-@end ifset
-
-* Endfunc:: @code{.endfunc}
-* Endif:: @code{.endif}
-* Equ:: @code{.equ @var{symbol}, @var{expression}}
-* Equiv:: @code{.equiv @var{symbol}, @var{expression}}
-* Eqv:: @code{.eqv @var{symbol}, @var{expression}}
-* Err:: @code{.err}
-* Error:: @code{.error @var{string}}
-* Exitm:: @code{.exitm}
-* Extern:: @code{.extern}
-* Fail:: @code{.fail}
-@ifclear no-file-dir
-* File:: @code{.file @var{string}}
-@end ifclear
-
-* Fill:: @code{.fill @var{repeat} , @var{size} , @var{value}}
-* Float:: @code{.float @var{flonums}}
-* Func:: @code{.func}
-* Global:: @code{.global @var{symbol}}, @code{.globl @var{symbol}}
-@ifset ELF
-* Gnu_attribute:: @code{.gnu_attribute @var{tag},@var{value}}
-* Hidden:: @code{.hidden @var{names}}
-@end ifset
-
-* hword:: @code{.hword @var{expressions}}
-* Ident:: @code{.ident}
-* If:: @code{.if @var{absolute expression}}
-* Incbin:: @code{.incbin "@var{file}"[,@var{skip}[,@var{count}]]}
-* Include:: @code{.include "@var{file}"}
-* Int:: @code{.int @var{expressions}}
-@ifset ELF
-* Internal:: @code{.internal @var{names}}
-@end ifset
-
-* Irp:: @code{.irp @var{symbol},@var{values}}@dots{}
-* Irpc:: @code{.irpc @var{symbol},@var{values}}@dots{}
-* Lcomm:: @code{.lcomm @var{symbol} , @var{length}}
-* Lflags:: @code{.lflags}
-@ifclear no-line-dir
-* Line:: @code{.line @var{line-number}}
-@end ifclear
-
-* Linkonce:: @code{.linkonce [@var{type}]}
-* List:: @code{.list}
-* Ln:: @code{.ln @var{line-number}}
-
-* LNS directives:: @code{.file}, @code{.loc}, etc.
-
-* Long:: @code{.long @var{expressions}}
-@ignore
-* Lsym:: @code{.lsym @var{symbol}, @var{expression}}
-@end ignore
-
-* Macro:: @code{.macro @var{name} @var{args}}@dots{}
-* MRI:: @code{.mri @var{val}}
-* Noaltmacro:: @code{.noaltmacro}
-* Nolist:: @code{.nolist}
-* Octa:: @code{.octa @var{bignums}}
-* Org:: @code{.org @var{new-lc}, @var{fill}}
-* P2align:: @code{.p2align @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
-@ifset ELF
-* PopSection:: @code{.popsection}
-* Previous:: @code{.previous}
-@end ifset
-
-* Print:: @code{.print @var{string}}
-@ifset ELF
-* Protected:: @code{.protected @var{names}}
-@end ifset
-
-* Psize:: @code{.psize @var{lines}, @var{columns}}
-* Purgem:: @code{.purgem @var{name}}
-@ifset ELF
-* PushSection:: @code{.pushsection @var{name}}
-@end ifset
-
-* Quad:: @code{.quad @var{bignums}}
-* Reloc:: @code{.reloc @var{offset}, @var{reloc_name}[, @var{expression}]}
-* Rept:: @code{.rept @var{count}}
-* Sbttl:: @code{.sbttl "@var{subheading}"}
-@ifset COFF
-* Scl:: @code{.scl @var{class}}
-@end ifset
-@ifset COFF-ELF
-* Section:: @code{.section @var{name}[, @var{flags}]}
-@end ifset
-
-* Set:: @code{.set @var{symbol}, @var{expression}}
-* Short:: @code{.short @var{expressions}}
-* Single:: @code{.single @var{flonums}}
-@ifset COFF-ELF
-* Size:: @code{.size [@var{name} , @var{expression}]}
-@end ifset
-
-* Skip:: @code{.skip @var{size} , @var{fill}}
-* Sleb128:: @code{.sleb128 @var{expressions}}
-* Space:: @code{.space @var{size} , @var{fill}}
-@ifset have-stabs
-* Stab:: @code{.stabd, .stabn, .stabs}
-@end ifset
-
-* String:: @code{.string "@var{str}"}, @code{.string8 "@var{str}"}, @code{.string16 "@var{str}"}, @code{.string32 "@var{str}"}, @code{.string64 "@var{str}"}
-* Struct:: @code{.struct @var{expression}}
-@ifset ELF
-* SubSection:: @code{.subsection}
-* Symver:: @code{.symver @var{name},@var{name2@@nodename}}
-@end ifset
-
-@ifset COFF
-* Tag:: @code{.tag @var{structname}}
-@end ifset
-
-* Text:: @code{.text @var{subsection}}
-* Title:: @code{.title "@var{heading}"}
-@ifset COFF-ELF
-* Type:: @code{.type <@var{int} | @var{name} , @var{type description}>}
-@end ifset
-
-* Uleb128:: @code{.uleb128 @var{expressions}}
-@ifset COFF
-* Val:: @code{.val @var{addr}}
-@end ifset
-
-@ifset ELF
-* Version:: @code{.version "@var{string}"}
-* VTableEntry:: @code{.vtable_entry @var{table}, @var{offset}}
-* VTableInherit:: @code{.vtable_inherit @var{child}, @var{parent}}
-@end ifset
-
-* Warning:: @code{.warning @var{string}}
-* Weak:: @code{.weak @var{names}}
-* Weakref:: @code{.weakref @var{alias}, @var{symbol}}
-* Word:: @code{.word @var{expressions}}
-* Deprecated:: Deprecated Directives
-@end menu
-
-@node Abort
-@section @code{.abort}
-
-@cindex @code{abort} directive
-@cindex stopping the assembly
-This directive stops the assembly immediately. It is for
-compatibility with other assemblers. The original idea was that the
-assembly language source would be piped into the assembler. If the sender
-of the source quit, it could use this directive tells @command{@value{AS}} to
-quit also. One day @code{.abort} will not be supported.
-
-@ifset COFF
-@node ABORT (COFF)
-@section @code{.ABORT} (COFF)
-
-@cindex @code{ABORT} directive
-When producing COFF output, @command{@value{AS}} accepts this directive as a
-synonym for @samp{.abort}.
-
-@ifset BOUT
-When producing @code{b.out} output, @command{@value{AS}} accepts this directive,
-but ignores it.
-@end ifset
-@end ifset
-
-@node Align
-@section @code{.align @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
-
-@cindex padding the location counter
-@cindex @code{align} directive
-Pad the location counter (in the current subsection) to a particular storage
-boundary. The first expression (which must be absolute) is the alignment
-required, as described below.
-
-The second expression (also absolute) gives the fill value to be stored in the
-padding bytes. It (and the comma) may be omitted. If it is omitted, the
-padding bytes are normally zero. However, on some systems, if the section is
-marked as containing code and the fill value is omitted, the space is filled
-with no-op instructions.
-
-The third expression is also absolute, and is also optional. If it is present,
-it is the maximum number of bytes that should be skipped by this alignment
-directive. If doing the alignment would require skipping more bytes than the
-specified maximum, then the alignment is not done at all. You can omit the
-fill value (the second argument) entirely by simply using two commas after the
-required alignment; this can be useful if you want the alignment to be filled
-with no-op instructions when appropriate.
-
-The way the required alignment is specified varies from system to system.
-For the arc, hppa, i386 using ELF, i860, iq2000, m68k, or32,
-s390, sparc, tic4x, tic80 and xtensa, the first expression is the
-alignment request in bytes. For example @samp{.align 8} advances
-the location counter until it is a multiple of 8. If the location counter
-is already a multiple of 8, no change is needed. For the tic54x, the
-first expression is the alignment request in words.
-
-For other systems, including the i386 using a.out format, and the arm and
-strongarm, it is the
-number of low-order zero bits the location counter must have after
-advancement. For example @samp{.align 3} advances the location
-counter until it a multiple of 8. If the location counter is already a
-multiple of 8, no change is needed.
-
-This inconsistency is due to the different behaviors of the various
-native assemblers for these systems which GAS must emulate.
-GAS also provides @code{.balign} and @code{.p2align} directives,
-described later, which have a consistent behavior across all
-architectures (but are specific to GAS).
-
-@node Ascii
-@section @code{.ascii "@var{string}"}@dots{}
-
-@cindex @code{ascii} directive
-@cindex string literals
-@code{.ascii} expects zero or more string literals (@pxref{Strings})
-separated by commas. It assembles each string (with no automatic
-trailing zero byte) into consecutive addresses.
-
-@node Asciz
-@section @code{.asciz "@var{string}"}@dots{}
-
-@cindex @code{asciz} directive
-@cindex zero-terminated strings
-@cindex null-terminated strings
-@code{.asciz} is just like @code{.ascii}, but each string is followed by
-a zero byte. The ``z'' in @samp{.asciz} stands for ``zero''.
-
-@node Balign
-@section @code{.balign[wl] @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
-
-@cindex padding the location counter given number of bytes
-@cindex @code{balign} directive
-Pad the location counter (in the current subsection) to a particular
-storage boundary. The first expression (which must be absolute) is the
-alignment request in bytes. For example @samp{.balign 8} advances
-the location counter until it is a multiple of 8. If the location counter
-is already a multiple of 8, no change is needed.
-
-The second expression (also absolute) gives the fill value to be stored in the
-padding bytes. It (and the comma) may be omitted. If it is omitted, the
-padding bytes are normally zero. However, on some systems, if the section is
-marked as containing code and the fill value is omitted, the space is filled
-with no-op instructions.
-
-The third expression is also absolute, and is also optional. If it is present,
-it is the maximum number of bytes that should be skipped by this alignment
-directive. If doing the alignment would require skipping more bytes than the
-specified maximum, then the alignment is not done at all. You can omit the
-fill value (the second argument) entirely by simply using two commas after the
-required alignment; this can be useful if you want the alignment to be filled
-with no-op instructions when appropriate.
-
-@cindex @code{balignw} directive
-@cindex @code{balignl} directive
-The @code{.balignw} and @code{.balignl} directives are variants of the
-@code{.balign} directive. The @code{.balignw} directive treats the fill
-pattern as a two byte word value. The @code{.balignl} directives treats the
-fill pattern as a four byte longword value. For example, @code{.balignw
-4,0x368d} will align to a multiple of 4. If it skips two bytes, they will be
-filled in with the value 0x368d (the exact placement of the bytes depends upon
-the endianness of the processor). If it skips 1 or 3 bytes, the fill value is
-undefined.
-
-@node Byte
-@section @code{.byte @var{expressions}}
-
-@cindex @code{byte} directive
-@cindex integers, one byte
-@code{.byte} expects zero or more expressions, separated by commas.
-Each expression is assembled into the next byte.
-
-@node Comm
-@section @code{.comm @var{symbol} , @var{length} }
-
-@cindex @code{comm} directive
-@cindex symbol, common
-@code{.comm} declares a common symbol named @var{symbol}. When linking, a
-common symbol in one object file may be merged with a defined or common symbol
-of the same name in another object file. If @code{@value{LD}} does not see a
-definition for the symbol--just one or more common symbols--then it will
-allocate @var{length} bytes of uninitialized memory. @var{length} must be an
-absolute expression. If @code{@value{LD}} sees multiple common symbols with
-the same name, and they do not all have the same size, it will allocate space
-using the largest size.
-
-@ifset ELF
-When using ELF, the @code{.comm} directive takes an optional third argument.
-This is the desired alignment of the symbol, specified as a byte boundary (for
-example, an alignment of 16 means that the least significant 4 bits of the
-address should be zero). The alignment must be an absolute expression, and it
-must be a power of two. If @code{@value{LD}} allocates uninitialized memory
-for the common symbol, it will use the alignment when placing the symbol. If
-no alignment is specified, @command{@value{AS}} will set the alignment to the
-largest power of two less than or equal to the size of the symbol, up to a
-maximum of 16.
-@end ifset
-
-@ifset HPPA
-The syntax for @code{.comm} differs slightly on the HPPA. The syntax is
-@samp{@var{symbol} .comm, @var{length}}; @var{symbol} is optional.
-@end ifset
-
-@node CFI directives
-@section @code{.cfi_startproc [simple]}
-@cindex @code{cfi_startproc} directive
-@code{.cfi_startproc} is used at the beginning of each function that
-should have an entry in @code{.eh_frame}. It initializes some internal
-data structures. Don't forget to close the function by
-@code{.cfi_endproc}.
-
-Unless @code{.cfi_startproc} is used along with parameter @code{simple}
-it also emits some architecture dependent initial CFI instructions.
-
-@section @code{.cfi_endproc}
-@cindex @code{cfi_endproc} directive
-@code{.cfi_endproc} is used at the end of a function where it closes its
-unwind entry previously opened by
-@code{.cfi_startproc}, and emits it to @code{.eh_frame}.
-
-@section @code{.cfi_personality @var{encoding} [, @var{exp}]}
-@code{.cfi_personality} defines personality routine and its encoding.
-@var{encoding} must be a constant determining how the personality
-should be encoded. If it is 255 (@code{DW_EH_PE_omit}), second
-argument is not present, otherwise second argument should be
-a constant or a symbol name. When using indirect encodings,
-the symbol provided should be the location where personality
-can be loaded from, not the personality routine itself.
-The default after @code{.cfi_startproc} is @code{.cfi_personality 0xff},
-no personality routine.
-
-@section @code{.cfi_lsda @var{encoding} [, @var{exp}]}
-@code{.cfi_lsda} defines LSDA and its encoding.
-@var{encoding} must be a constant determining how the LSDA
-should be encoded. If it is 255 (@code{DW_EH_PE_omit}), second
-argument is not present, otherwise second argument should be a constant
-or a symbol name. The default after @code{.cfi_startproc} is @code{.cfi_lsda 0xff},
-no LSDA.
-
-@section @code{.cfi_def_cfa @var{register}, @var{offset}}
-@code{.cfi_def_cfa} defines a rule for computing CFA as: @i{take
-address from @var{register} and add @var{offset} to it}.
-
-@section @code{.cfi_def_cfa_register @var{register}}
-@code{.cfi_def_cfa_register} modifies a rule for computing CFA. From
-now on @var{register} will be used instead of the old one. Offset
-remains the same.
-
-@section @code{.cfi_def_cfa_offset @var{offset}}
-@code{.cfi_def_cfa_offset} modifies a rule for computing CFA. Register
-remains the same, but @var{offset} is new. Note that it is the
-absolute offset that will be added to a defined register to compute
-CFA address.
-
-@section @code{.cfi_adjust_cfa_offset @var{offset}}
-Same as @code{.cfi_def_cfa_offset} but @var{offset} is a relative
-value that is added/substracted from the previous offset.
-
-@section @code{.cfi_offset @var{register}, @var{offset}}
-Previous value of @var{register} is saved at offset @var{offset} from
-CFA.
-
-@section @code{.cfi_rel_offset @var{register}, @var{offset}}
-Previous value of @var{register} is saved at offset @var{offset} from
-the current CFA register. This is transformed to @code{.cfi_offset}
-using the known displacement of the CFA register from the CFA.
-This is often easier to use, because the number will match the
-code it's annotating.
-
-@section @code{.cfi_register @var{register1}, @var{register2}}
-Previous value of @var{register1} is saved in register @var{register2}.
-
-@section @code{.cfi_restore @var{register}}
-@code{.cfi_restore} says that the rule for @var{register} is now the
-same as it was at the beginning of the function, after all initial
-instruction added by @code{.cfi_startproc} were executed.
-
-@section @code{.cfi_undefined @var{register}}
-From now on the previous value of @var{register} can't be restored anymore.
-
-@section @code{.cfi_same_value @var{register}}
-Current value of @var{register} is the same like in the previous frame,
-i.e. no restoration needed.
-
-@section @code{.cfi_remember_state},
-First save all current rules for all registers by @code{.cfi_remember_state},
-then totally screw them up by subsequent @code{.cfi_*} directives and when
-everything is hopelessly bad, use @code{.cfi_restore_state} to restore
-the previous saved state.
-
-@section @code{.cfi_return_column @var{register}}
-Change return column @var{register}, i.e. the return address is either
-directly in @var{register} or can be accessed by rules for @var{register}.
-
-@section @code{.cfi_signal_frame}
-Mark current function as signal trampoline.
-
-@section @code{.cfi_window_save}
-SPARC register window has been saved.
-
-@section @code{.cfi_escape} @var{expression}[, @dots{}]
-Allows the user to add arbitrary bytes to the unwind info. One
-might use this to add OS-specific CFI opcodes, or generic CFI
-opcodes that GAS does not yet support.
-
-@node LNS directives
-@section @code{.file @var{fileno} @var{filename}}
-@cindex @code{file} directive
-When emitting dwarf2 line number information @code{.file} assigns filenames
-to the @code{.debug_line} file name table. The @var{fileno} operand should
-be a unique positive integer to use as the index of the entry in the table.
-The @var{filename} operand is a C string literal.
-
-The detail of filename indices is exposed to the user because the filename
-table is shared with the @code{.debug_info} section of the dwarf2 debugging
-information, and thus the user must know the exact indices that table
-entries will have.
-
-@section @code{.loc @var{fileno} @var{lineno} [@var{column}] [@var{options}]}
-@cindex @code{loc} directive
-The @code{.loc} directive will add row to the @code{.debug_line} line
-number matrix corresponding to the immediately following assembly
-instruction. The @var{fileno}, @var{lineno}, and optional @var{column}
-arguments will be applied to the @code{.debug_line} state machine before
-the row is added.
-
-The @var{options} are a sequence of the following tokens in any order:
-
-@table @code
-@item basic_block
-This option will set the @code{basic_block} register in the
-@code{.debug_line} state machine to @code{true}.
-
-@item prologue_end
-This option will set the @code{prologue_end} register in the
-@code{.debug_line} state machine to @code{true}.
-
-@item epilogue_begin
-This option will set the @code{epilogue_begin} register in the
-@code{.debug_line} state machine to @code{true}.
-
-@item is_stmt @var{value}
-This option will set the @code{is_stmt} register in the
-@code{.debug_line} state machine to @code{value}, which must be
-either 0 or 1.
-
-@item isa @var{value}
-This directive will set the @code{isa} register in the @code{.debug_line}
-state machine to @var{value}, which must be an unsigned integer.
-
-@end table
-
-@section @code{.loc_mark_labels @var{enable}}
-@cindex @code{loc_mark_labels} directive
-The @code{.loc_mark_labels} directive makes the assembler emit an entry
-to the @code{.debug_line} line number matrix with the @code{basic_block}
-register in the state machine set whenever a code label is seen.
-The @var{enable} argument should be either 1 or 0, to enable or disable
-this function respectively.
-
-@node Data
-@section @code{.data @var{subsection}}
-
-@cindex @code{data} directive
-@code{.data} tells @command{@value{AS}} to assemble the following statements onto the
-end of the data subsection numbered @var{subsection} (which is an
-absolute expression). If @var{subsection} is omitted, it defaults
-to zero.
-
-@ifset COFF
-@node Def
-@section @code{.def @var{name}}
-
-@cindex @code{def} directive
-@cindex COFF symbols, debugging
-@cindex debugging COFF symbols
-Begin defining debugging information for a symbol @var{name}; the
-definition extends until the @code{.endef} directive is encountered.
-@ifset BOUT
-
-This directive is only observed when @command{@value{AS}} is configured for COFF
-format output; when producing @code{b.out}, @samp{.def} is recognized,
-but ignored.
-@end ifset
-@end ifset
-
-@ifset aout-bout
-@node Desc
-@section @code{.desc @var{symbol}, @var{abs-expression}}
-
-@cindex @code{desc} directive
-@cindex COFF symbol descriptor
-@cindex symbol descriptor, COFF
-This directive sets the descriptor of the symbol (@pxref{Symbol Attributes})
-to the low 16 bits of an absolute expression.
-
-@ifset COFF
-The @samp{.desc} directive is not available when @command{@value{AS}} is
-configured for COFF output; it is only for @code{a.out} or @code{b.out}
-object format. For the sake of compatibility, @command{@value{AS}} accepts
-it, but produces no output, when configured for COFF.
-@end ifset
-@end ifset
-
-@ifset COFF
-@node Dim
-@section @code{.dim}
-
-@cindex @code{dim} directive
-@cindex COFF auxiliary symbol information
-@cindex auxiliary symbol information, COFF
-This directive is generated by compilers to include auxiliary debugging
-information in the symbol table. It is only permitted inside
-@code{.def}/@code{.endef} pairs.
-@ifset BOUT
-
-@samp{.dim} is only meaningful when generating COFF format output; when
-@command{@value{AS}} is generating @code{b.out}, it accepts this directive but
-ignores it.
-@end ifset
-@end ifset
-
-@node Double
-@section @code{.double @var{flonums}}
-
-@cindex @code{double} directive
-@cindex floating point numbers (double)
-@code{.double} expects zero or more flonums, separated by commas. It
-assembles floating point numbers.
-@ifset GENERIC
-The exact kind of floating point numbers emitted depends on how
-@command{@value{AS}} is configured. @xref{Machine Dependencies}.
-@end ifset
-@ifclear GENERIC
-@ifset IEEEFLOAT
-On the @value{TARGET} family @samp{.double} emits 64-bit floating-point numbers
-in @sc{ieee} format.
-@end ifset
-@end ifclear
-
-@node Eject
-@section @code{.eject}
-
-@cindex @code{eject} directive
-@cindex new page, in listings
-@cindex page, in listings
-@cindex listing control: new page
-Force a page break at this point, when generating assembly listings.
-
-@node Else
-@section @code{.else}
-
-@cindex @code{else} directive
-@code{.else} is part of the @command{@value{AS}} support for conditional
-assembly; see @ref{If,,@code{.if}}. It marks the beginning of a section
-of code to be assembled if the condition for the preceding @code{.if}
-was false.
-
-@node Elseif
-@section @code{.elseif}
-
-@cindex @code{elseif} directive
-@code{.elseif} is part of the @command{@value{AS}} support for conditional
-assembly; see @ref{If,,@code{.if}}. It is shorthand for beginning a new
-@code{.if} block that would otherwise fill the entire @code{.else} section.
-
-@node End
-@section @code{.end}
-
-@cindex @code{end} directive
-@code{.end} marks the end of the assembly file. @command{@value{AS}} does not
-process anything in the file past the @code{.end} directive.
-
-@ifset COFF
-@node Endef
-@section @code{.endef}
-
-@cindex @code{endef} directive
-This directive flags the end of a symbol definition begun with
-@code{.def}.
-@ifset BOUT
-
-@samp{.endef} is only meaningful when generating COFF format output; if
-@command{@value{AS}} is configured to generate @code{b.out}, it accepts this
-directive but ignores it.
-@end ifset
-@end ifset
-
-@node Endfunc
-@section @code{.endfunc}
-@cindex @code{endfunc} directive
-@code{.endfunc} marks the end of a function specified with @code{.func}.
-
-@node Endif
-@section @code{.endif}
-
-@cindex @code{endif} directive
-@code{.endif} is part of the @command{@value{AS}} support for conditional assembly;
-it marks the end of a block of code that is only assembled
-conditionally. @xref{If,,@code{.if}}.
-
-@node Equ
-@section @code{.equ @var{symbol}, @var{expression}}
-
-@cindex @code{equ} directive
-@cindex assigning values to symbols
-@cindex symbols, assigning values to
-This directive sets the value of @var{symbol} to @var{expression}.
-It is synonymous with @samp{.set}; see @ref{Set,,@code{.set}}.
-
-@ifset HPPA
-The syntax for @code{equ} on the HPPA is
-@samp{@var{symbol} .equ @var{expression}}.
-@end ifset
-
-@ifset Z80
-The syntax for @code{equ} on the Z80 is
-@samp{@var{symbol} equ @var{expression}}.
-On the Z80 it is an eror if @var{symbol} is already defined,
-but the symbol is not protected from later redefinition.
-Compare @ref{Equiv}.
-@end ifset
-
-@node Equiv
-@section @code{.equiv @var{symbol}, @var{expression}}
-@cindex @code{equiv} directive
-The @code{.equiv} directive is like @code{.equ} and @code{.set}, except that
-the assembler will signal an error if @var{symbol} is already defined. Note a
-symbol which has been referenced but not actually defined is considered to be
-undefined.
-
-Except for the contents of the error message, this is roughly equivalent to
-@smallexample
-.ifdef SYM
-.err
-.endif
-.equ SYM,VAL
-@end smallexample
-plus it protects the symbol from later redefinition.
-
-@node Eqv
-@section @code{.eqv @var{symbol}, @var{expression}}
-@cindex @code{eqv} directive
-The @code{.eqv} directive is like @code{.equiv}, but no attempt is made to
-evaluate the expression or any part of it immediately. Instead each time
-the resulting symbol is used in an expression, a snapshot of its current
-value is taken.
-
-@node Err
-@section @code{.err}
-@cindex @code{err} directive
-If @command{@value{AS}} assembles a @code{.err} directive, it will print an error
-message and, unless the @option{-Z} option was used, it will not generate an
-object file. This can be used to signal an error in conditionally compiled code.
-
-@node Error
-@section @code{.error "@var{string}"}
-@cindex error directive
-
-Similarly to @code{.err}, this directive emits an error, but you can specify a
-string that will be emitted as the error message. If you don't specify the
-message, it defaults to @code{".error directive invoked in source file"}.
-@xref{Errors, ,Error and Warning Messages}.
-
-@smallexample
- .error "This code has not been assembled and tested."
-@end smallexample
-
-@node Exitm
-@section @code{.exitm}
-Exit early from the current macro definition. @xref{Macro}.
-
-@node Extern
-@section @code{.extern}
-
-@cindex @code{extern} directive
-@code{.extern} is accepted in the source program---for compatibility
-with other assemblers---but it is ignored. @command{@value{AS}} treats
-all undefined symbols as external.
-
-@node Fail
-@section @code{.fail @var{expression}}
-
-@cindex @code{fail} directive
-Generates an error or a warning. If the value of the @var{expression} is 500
-or more, @command{@value{AS}} will print a warning message. If the value is less
-than 500, @command{@value{AS}} will print an error message. The message will
-include the value of @var{expression}. This can occasionally be useful inside
-complex nested macros or conditional assembly.
-
-@ifclear no-file-dir
-@node File
-@section @code{.file @var{string}}
-
-@cindex @code{file} directive
-@cindex logical file name
-@cindex file name, logical
-@code{.file} tells @command{@value{AS}} that we are about to start a new logical
-file. @var{string} is the new file name. In general, the filename is
-recognized whether or not it is surrounded by quotes @samp{"}; but if you wish
-to specify an empty file name, you must give the quotes--@code{""}. This
-statement may go away in future: it is only recognized to be compatible with
-old @command{@value{AS}} programs.
-@end ifclear
-
-@node Fill
-@section @code{.fill @var{repeat} , @var{size} , @var{value}}
-
-@cindex @code{fill} directive
-@cindex writing patterns in memory
-@cindex patterns, writing in memory
-@var{repeat}, @var{size} and @var{value} are absolute expressions.
-This emits @var{repeat} copies of @var{size} bytes. @var{Repeat}
-may be zero or more. @var{Size} may be zero or more, but if it is
-more than 8, then it is deemed to have the value 8, compatible with
-other people's assemblers. The contents of each @var{repeat} bytes
-is taken from an 8-byte number. The highest order 4 bytes are
-zero. The lowest order 4 bytes are @var{value} rendered in the
-byte-order of an integer on the computer @command{@value{AS}} is assembling for.
-Each @var{size} bytes in a repetition is taken from the lowest order
-@var{size} bytes of this number. Again, this bizarre behavior is
-compatible with other people's assemblers.
-
-@var{size} and @var{value} are optional.
-If the second comma and @var{value} are absent, @var{value} is
-assumed zero. If the first comma and following tokens are absent,
-@var{size} is assumed to be 1.
-
-@node Float
-@section @code{.float @var{flonums}}
-
-@cindex floating point numbers (single)
-@cindex @code{float} directive
-This directive assembles zero or more flonums, separated by commas. It
-has the same effect as @code{.single}.
-@ifset GENERIC
-The exact kind of floating point numbers emitted depends on how
-@command{@value{AS}} is configured.
-@xref{Machine Dependencies}.
-@end ifset
-@ifclear GENERIC
-@ifset IEEEFLOAT
-On the @value{TARGET} family, @code{.float} emits 32-bit floating point numbers
-in @sc{ieee} format.
-@end ifset
-@end ifclear
-
-@node Func
-@section @code{.func @var{name}[,@var{label}]}
-@cindex @code{func} directive
-@code{.func} emits debugging information to denote function @var{name}, and
-is ignored unless the file is assembled with debugging enabled.
-Only @samp{--gstabs[+]} is currently supported.
-@var{label} is the entry point of the function and if omitted @var{name}
-prepended with the @samp{leading char} is used.
-@samp{leading char} is usually @code{_} or nothing, depending on the target.
-All functions are currently defined to have @code{void} return type.
-The function must be terminated with @code{.endfunc}.
-
-@node Global
-@section @code{.global @var{symbol}}, @code{.globl @var{symbol}}
-
-@cindex @code{global} directive
-@cindex symbol, making visible to linker
-@code{.global} makes the symbol visible to @code{@value{LD}}. If you define
-@var{symbol} in your partial program, its value is made available to
-other partial programs that are linked with it. Otherwise,
-@var{symbol} takes its attributes from a symbol of the same name
-from another file linked into the same program.
-
-Both spellings (@samp{.globl} and @samp{.global}) are accepted, for
-compatibility with other assemblers.
-
-@ifset HPPA
-On the HPPA, @code{.global} is not always enough to make it accessible to other
-partial programs. You may need the HPPA-only @code{.EXPORT} directive as well.
-@xref{HPPA Directives, ,HPPA Assembler Directives}.
-@end ifset
-
-@ifset ELF
-@node Gnu_attribute
-@section @code{.gnu_attribute @var{tag},@var{value}}
-Record a @sc{gnu} object attribute for this file. @xref{Object Attributes}.
-
-@node Hidden
-@section @code{.hidden @var{names}}
-
-@cindex @code{hidden} directive
-@cindex visibility
-This is one of the ELF visibility directives. The other two are
-@code{.internal} (@pxref{Internal,,@code{.internal}}) and
-@code{.protected} (@pxref{Protected,,@code{.protected}}).
-
-This directive overrides the named symbols default visibility (which is set by
-their binding: local, global or weak). The directive sets the visibility to
-@code{hidden} which means that the symbols are not visible to other components.
-Such symbols are always considered to be @code{protected} as well.
-@end ifset
-
-@node hword
-@section @code{.hword @var{expressions}}
-
-@cindex @code{hword} directive
-@cindex integers, 16-bit
-@cindex numbers, 16-bit
-@cindex sixteen bit integers
-This expects zero or more @var{expressions}, and emits
-a 16 bit number for each.
-
-@ifset GENERIC
-This directive is a synonym for @samp{.short}; depending on the target
-architecture, it may also be a synonym for @samp{.word}.
-@end ifset
-@ifclear GENERIC
-@ifset W32
-This directive is a synonym for @samp{.short}.
-@end ifset
-@ifset W16
-This directive is a synonym for both @samp{.short} and @samp{.word}.
-@end ifset
-@end ifclear
-
-@node Ident
-@section @code{.ident}
-
-@cindex @code{ident} directive
-
-This directive is used by some assemblers to place tags in object files. The
-behavior of this directive varies depending on the target. When using the
-a.out object file format, @command{@value{AS}} simply accepts the directive for
-source-file compatibility with existing assemblers, but does not emit anything
-for it. When using COFF, comments are emitted to the @code{.comment} or
-@code{.rdata} section, depending on the target. When using ELF, comments are
-emitted to the @code{.comment} section.
-
-@node If
-@section @code{.if @var{absolute expression}}
-
-@cindex conditional assembly
-@cindex @code{if} directive
-@code{.if} marks the beginning of a section of code which is only
-considered part of the source program being assembled if the argument
-(which must be an @var{absolute expression}) is non-zero. The end of
-the conditional section of code must be marked by @code{.endif}
-(@pxref{Endif,,@code{.endif}}); optionally, you may include code for the
-alternative condition, flagged by @code{.else} (@pxref{Else,,@code{.else}}).
-If you have several conditions to check, @code{.elseif} may be used to avoid
-nesting blocks if/else within each subsequent @code{.else} block.
-
-The following variants of @code{.if} are also supported:
-@table @code
-@cindex @code{ifdef} directive
-@item .ifdef @var{symbol}
-Assembles the following section of code if the specified @var{symbol}
-has been defined. Note a symbol which has been referenced but not yet defined
-is considered to be undefined.
-
-@cindex @code{ifb} directive
-@item .ifb @var{text}
-Assembles the following section of code if the operand is blank (empty).
-
-@cindex @code{ifc} directive
-@item .ifc @var{string1},@var{string2}
-Assembles the following section of code if the two strings are the same. The
-strings may be optionally quoted with single quotes. If they are not quoted,
-the first string stops at the first comma, and the second string stops at the
-end of the line. Strings which contain whitespace should be quoted. The
-string comparison is case sensitive.
-
-@cindex @code{ifeq} directive
-@item .ifeq @var{absolute expression}
-Assembles the following section of code if the argument is zero.
-
-@cindex @code{ifeqs} directive
-@item .ifeqs @var{string1},@var{string2}
-Another form of @code{.ifc}. The strings must be quoted using double quotes.
-
-@cindex @code{ifge} directive
-@item .ifge @var{absolute expression}
-Assembles the following section of code if the argument is greater than or
-equal to zero.
-
-@cindex @code{ifgt} directive
-@item .ifgt @var{absolute expression}
-Assembles the following section of code if the argument is greater than zero.
-
-@cindex @code{ifle} directive
-@item .ifle @var{absolute expression}
-Assembles the following section of code if the argument is less than or equal
-to zero.
-
-@cindex @code{iflt} directive
-@item .iflt @var{absolute expression}
-Assembles the following section of code if the argument is less than zero.
-
-@cindex @code{ifnb} directive
-@item .ifnb @var{text}
-Like @code{.ifb}, but the sense of the test is reversed: this assembles the
-following section of code if the operand is non-blank (non-empty).
-
-@cindex @code{ifnc} directive
-@item .ifnc @var{string1},@var{string2}.
-Like @code{.ifc}, but the sense of the test is reversed: this assembles the
-following section of code if the two strings are not the same.
-
-@cindex @code{ifndef} directive
-@cindex @code{ifnotdef} directive
-@item .ifndef @var{symbol}
-@itemx .ifnotdef @var{symbol}
-Assembles the following section of code if the specified @var{symbol}
-has not been defined. Both spelling variants are equivalent. Note a symbol
-which has been referenced but not yet defined is considered to be undefined.
-
-@cindex @code{ifne} directive
-@item .ifne @var{absolute expression}
-Assembles the following section of code if the argument is not equal to zero
-(in other words, this is equivalent to @code{.if}).
-
-@cindex @code{ifnes} directive
-@item .ifnes @var{string1},@var{string2}
-Like @code{.ifeqs}, but the sense of the test is reversed: this assembles the
-following section of code if the two strings are not the same.
-@end table
-
-@node Incbin
-@section @code{.incbin "@var{file}"[,@var{skip}[,@var{count}]]}
-
-@cindex @code{incbin} directive
-@cindex binary files, including
-The @code{incbin} directive includes @var{file} verbatim at the current
-location. You can control the search paths used with the @samp{-I} command-line
-option (@pxref{Invoking,,Command-Line Options}). Quotation marks are required
-around @var{file}.
-
-The @var{skip} argument skips a number of bytes from the start of the
-@var{file}. The @var{count} argument indicates the maximum number of bytes to
-read. Note that the data is not aligned in any way, so it is the user's
-responsibility to make sure that proper alignment is provided both before and
-after the @code{incbin} directive.
-
-@node Include
-@section @code{.include "@var{file}"}
-
-@cindex @code{include} directive
-@cindex supporting files, including
-@cindex files, including
-This directive provides a way to include supporting files at specified
-points in your source program. The code from @var{file} is assembled as
-if it followed the point of the @code{.include}; when the end of the
-included file is reached, assembly of the original file continues. You
-can control the search paths used with the @samp{-I} command-line option
-(@pxref{Invoking,,Command-Line Options}). Quotation marks are required
-around @var{file}.
-
-@node Int
-@section @code{.int @var{expressions}}
-
-@cindex @code{int} directive
-@cindex integers, 32-bit
-Expect zero or more @var{expressions}, of any section, separated by commas.
-For each expression, emit a number that, at run time, is the value of that
-expression. The byte order and bit size of the number depends on what kind
-of target the assembly is for.
-
-@ifclear GENERIC
-@ifset H8
-On most forms of the H8/300, @code{.int} emits 16-bit
-integers. On the H8/300H and the Renesas SH, however, @code{.int} emits
-32-bit integers.
-@end ifset
-@end ifclear
-
-@ifset ELF
-@node Internal
-@section @code{.internal @var{names}}
-
-@cindex @code{internal} directive
-@cindex visibility
-This is one of the ELF visibility directives. The other two are
-@code{.hidden} (@pxref{Hidden,,@code{.hidden}}) and
-@code{.protected} (@pxref{Protected,,@code{.protected}}).
-
-This directive overrides the named symbols default visibility (which is set by
-their binding: local, global or weak). The directive sets the visibility to
-@code{internal} which means that the symbols are considered to be @code{hidden}
-(i.e., not visible to other components), and that some extra, processor specific
-processing must also be performed upon the symbols as well.
-@end ifset
-
-@node Irp
-@section @code{.irp @var{symbol},@var{values}}@dots{}
-
-@cindex @code{irp} directive
-Evaluate a sequence of statements assigning different values to @var{symbol}.
-The sequence of statements starts at the @code{.irp} directive, and is
-terminated by an @code{.endr} directive. For each @var{value}, @var{symbol} is
-set to @var{value}, and the sequence of statements is assembled. If no
-@var{value} is listed, the sequence of statements is assembled once, with
-@var{symbol} set to the null string. To refer to @var{symbol} within the
-sequence of statements, use @var{\symbol}.
-
-For example, assembling
-
-@example
- .irp param,1,2,3
- move d\param,sp@@-
- .endr
-@end example
-
-is equivalent to assembling
-
-@example
- move d1,sp@@-
- move d2,sp@@-
- move d3,sp@@-
-@end example
-
-For some caveats with the spelling of @var{symbol}, see also @ref{Macro}.
-
-@node Irpc
-@section @code{.irpc @var{symbol},@var{values}}@dots{}
-
-@cindex @code{irpc} directive
-Evaluate a sequence of statements assigning different values to @var{symbol}.
-The sequence of statements starts at the @code{.irpc} directive, and is
-terminated by an @code{.endr} directive. For each character in @var{value},
-@var{symbol} is set to the character, and the sequence of statements is
-assembled. If no @var{value} is listed, the sequence of statements is
-assembled once, with @var{symbol} set to the null string. To refer to
-@var{symbol} within the sequence of statements, use @var{\symbol}.
-
-For example, assembling
-
-@example
- .irpc param,123
- move d\param,sp@@-
- .endr
-@end example
-
-is equivalent to assembling
-
-@example
- move d1,sp@@-
- move d2,sp@@-
- move d3,sp@@-
-@end example
-
-For some caveats with the spelling of @var{symbol}, see also the discussion
-at @xref{Macro}.
-
-@node Lcomm
-@section @code{.lcomm @var{symbol} , @var{length}}
-
-@cindex @code{lcomm} directive
-@cindex local common symbols
-@cindex symbols, local common
-Reserve @var{length} (an absolute expression) bytes for a local common
-denoted by @var{symbol}. The section and value of @var{symbol} are
-those of the new local common. The addresses are allocated in the bss
-section, so that at run-time the bytes start off zeroed. @var{Symbol}
-is not declared global (@pxref{Global,,@code{.global}}), so is normally
-not visible to @code{@value{LD}}.
-
-@ifset GENERIC
-Some targets permit a third argument to be used with @code{.lcomm}. This
-argument specifies the desired alignment of the symbol in the bss section.
-@end ifset
-
-@ifset HPPA
-The syntax for @code{.lcomm} differs slightly on the HPPA. The syntax is
-@samp{@var{symbol} .lcomm, @var{length}}; @var{symbol} is optional.
-@end ifset
-
-@node Lflags
-@section @code{.lflags}
-
-@cindex @code{lflags} directive (ignored)
-@command{@value{AS}} accepts this directive, for compatibility with other
-assemblers, but ignores it.
-
-@ifclear no-line-dir
-@node Line
-@section @code{.line @var{line-number}}
-
-@cindex @code{line} directive
-@end ifclear
-@ifset no-line-dir
-@node Ln
-@section @code{.ln @var{line-number}}
-
-@cindex @code{ln} directive
-@end ifset
-@cindex logical line number
-@ifset aout-bout
-Change the logical line number. @var{line-number} must be an absolute
-expression. The next line has that logical line number. Therefore any other
-statements on the current line (after a statement separator character) are
-reported as on logical line number @var{line-number} @minus{} 1. One day
-@command{@value{AS}} will no longer support this directive: it is recognized only
-for compatibility with existing assembler programs.
-
-@end ifset
-
-@ifclear no-line-dir
-Even though this is a directive associated with the @code{a.out} or
-@code{b.out} object-code formats, @command{@value{AS}} still recognizes it
-when producing COFF output, and treats @samp{.line} as though it
-were the COFF @samp{.ln} @emph{if} it is found outside a
-@code{.def}/@code{.endef} pair.
-
-Inside a @code{.def}, @samp{.line} is, instead, one of the directives
-used by compilers to generate auxiliary symbol information for
-debugging.
-@end ifclear
-
-@node Linkonce
-@section @code{.linkonce [@var{type}]}
-@cindex COMDAT
-@cindex @code{linkonce} directive
-@cindex common sections
-Mark the current section so that the linker only includes a single copy of it.
-This may be used to include the same section in several different object files,
-but ensure that the linker will only include it once in the final output file.
-The @code{.linkonce} pseudo-op must be used for each instance of the section.
-Duplicate sections are detected based on the section name, so it should be
-unique.
-
-This directive is only supported by a few object file formats; as of this
-writing, the only object file format which supports it is the Portable
-Executable format used on Windows NT.
-
-The @var{type} argument is optional. If specified, it must be one of the
-following strings. For example:
-@smallexample
-.linkonce same_size
-@end smallexample
-Not all types may be supported on all object file formats.
-
-@table @code
-@item discard
-Silently discard duplicate sections. This is the default.
-
-@item one_only
-Warn if there are duplicate sections, but still keep only one copy.
-
-@item same_size
-Warn if any of the duplicates have different sizes.
-
-@item same_contents
-Warn if any of the duplicates do not have exactly the same contents.
-@end table
-
-@node Ln
-@section @code{.ln @var{line-number}}
-
-@cindex @code{ln} directive
-@ifclear no-line-dir
-@samp{.ln} is a synonym for @samp{.line}.
-@end ifclear
-@ifset no-line-dir
-Tell @command{@value{AS}} to change the logical line number. @var{line-number}
-must be an absolute expression. The next line has that logical
-line number, so any other statements on the current line (after a
-statement separator character @code{;}) are reported as on logical
-line number @var{line-number} @minus{} 1.
-@ifset BOUT
-
-This directive is accepted, but ignored, when @command{@value{AS}} is
-configured for @code{b.out}; its effect is only associated with COFF
-output format.
-@end ifset
-@end ifset
-
-@node MRI
-@section @code{.mri @var{val}}
-
-@cindex @code{mri} directive
-@cindex MRI mode, temporarily
-If @var{val} is non-zero, this tells @command{@value{AS}} to enter MRI mode. If
-@var{val} is zero, this tells @command{@value{AS}} to exit MRI mode. This change
-affects code assembled until the next @code{.mri} directive, or until the end
-of the file. @xref{M, MRI mode, MRI mode}.
-
-@node List
-@section @code{.list}
-
-@cindex @code{list} directive
-@cindex listing control, turning on
-Control (in conjunction with the @code{.nolist} directive) whether or
-not assembly listings are generated. These two directives maintain an
-internal counter (which is zero initially). @code{.list} increments the
-counter, and @code{.nolist} decrements it. Assembly listings are
-generated whenever the counter is greater than zero.
-
-By default, listings are disabled. When you enable them (with the
-@samp{-a} command line option; @pxref{Invoking,,Command-Line Options}),
-the initial value of the listing counter is one.
-
-@node Long
-@section @code{.long @var{expressions}}
-
-@cindex @code{long} directive
-@code{.long} is the same as @samp{.int}. @xref{Int,,@code{.int}}.
-
-@ignore
-@c no one seems to know what this is for or whether this description is
-@c what it really ought to do
-@node Lsym
-@section @code{.lsym @var{symbol}, @var{expression}}
-
-@cindex @code{lsym} directive
-@cindex symbol, not referenced in assembly
-@code{.lsym} creates a new symbol named @var{symbol}, but does not put it in
-the hash table, ensuring it cannot be referenced by name during the
-rest of the assembly. This sets the attributes of the symbol to be
-the same as the expression value:
-@smallexample
-@var{other} = @var{descriptor} = 0
-@var{type} = @r{(section of @var{expression})}
-@var{value} = @var{expression}
-@end smallexample
-@noindent
-The new symbol is not flagged as external.
-@end ignore
-
-@node Macro
-@section @code{.macro}
-
-@cindex macros
-The commands @code{.macro} and @code{.endm} allow you to define macros that
-generate assembly output. For example, this definition specifies a macro
-@code{sum} that puts a sequence of numbers into memory:
-
-@example
- .macro sum from=0, to=5
- .long \from
- .if \to-\from
- sum "(\from+1)",\to
- .endif
- .endm
-@end example
-
-@noindent
-With that definition, @samp{SUM 0,5} is equivalent to this assembly input:
-
-@example
- .long 0
- .long 1
- .long 2
- .long 3
- .long 4
- .long 5
-@end example
-
-@ftable @code
-@item .macro @var{macname}
-@itemx .macro @var{macname} @var{macargs} @dots{}
-@cindex @code{macro} directive
-Begin the definition of a macro called @var{macname}. If your macro
-definition requires arguments, specify their names after the macro name,
-separated by commas or spaces. You can qualify the macro argument to
-indicate whether all invocations must specify a non-blank value (through
-@samp{:@code{req}}), or whether it takes all of the remaining arguments
-(through @samp{:@code{vararg}}). You can supply a default value for any
-macro argument by following the name with @samp{=@var{deflt}}. You
-cannot define two macros with the same @var{macname} unless it has been
-subject to the @code{.purgem} directive (@pxref{Purgem}) between the two
-definitions. For example, these are all valid @code{.macro} statements:
-
-@table @code
-@item .macro comm
-Begin the definition of a macro called @code{comm}, which takes no
-arguments.
-
-@item .macro plus1 p, p1
-@itemx .macro plus1 p p1
-Either statement begins the definition of a macro called @code{plus1},
-which takes two arguments; within the macro definition, write
-@samp{\p} or @samp{\p1} to evaluate the arguments.
-
-@item .macro reserve_str p1=0 p2
-Begin the definition of a macro called @code{reserve_str}, with two
-arguments. The first argument has a default value, but not the second.
-After the definition is complete, you can call the macro either as
-@samp{reserve_str @var{a},@var{b}} (with @samp{\p1} evaluating to
-@var{a} and @samp{\p2} evaluating to @var{b}), or as @samp{reserve_str
-,@var{b}} (with @samp{\p1} evaluating as the default, in this case
-@samp{0}, and @samp{\p2} evaluating to @var{b}).
-
-@item .macro m p1:req, p2=0, p3:vararg
-Begin the definition of a macro called @code{m}, with at least three
-arguments. The first argument must always have a value specified, but
-not the second, which instead has a default value. The third formal
-will get assigned all remaining arguments specified at invocation time.
-
-When you call a macro, you can specify the argument values either by
-position, or by keyword. For example, @samp{sum 9,17} is equivalent to
-@samp{sum to=17, from=9}.
-
-@end table
-
-Note that since each of the @var{macargs} can be an identifier exactly
-as any other one permitted by the target architecture, there may be
-occasional problems if the target hand-crafts special meanings to certain
-characters when they occur in a special position. For example, if the colon
-(@code{:}) is generally permitted to be part of a symbol name, but the
-architecture specific code special-cases it when occurring as the final
-character of a symbol (to denote a label), then the macro parameter
-replacement code will have no way of knowing that and consider the whole
-construct (including the colon) an identifier, and check only this
-identifier for being the subject to parameter substitution. So for example
-this macro definition:
-
-@example
- .macro label l
-\l:
- .endm
-@end example
-
-might not work as expected. Invoking @samp{label foo} might not create a label
-called @samp{foo} but instead just insert the text @samp{\l:} into the
-assembler source, probably generating an error about an unrecognised
-identifier.
-
-Similarly problems might occur with the period character (@samp{.})
-which is often allowed inside opcode names (and hence identifier names). So
-for example constructing a macro to build an opcode from a base name and a
-length specifier like this:
-
-@example
- .macro opcode base length
- \base.\length
- .endm
-@end example
-
-and invoking it as @samp{opcode store l} will not create a @samp{store.l}
-instruction but instead generate some kind of error as the assembler tries to
-interpret the text @samp{\base.\length}.
-
-There are several possible ways around this problem:
-
-@table @code
-@item Insert white space
-If it is possible to use white space characters then this is the simplest
-solution. eg:
-
-@example
- .macro label l
-\l :
- .endm
-@end example
-
-@item Use @samp{\()}
-The string @samp{\()} can be used to separate the end of a macro argument from
-the following text. eg:
-
-@example
- .macro opcode base length
- \base\().\length
- .endm
-@end example
-
-@item Use the alternate macro syntax mode
-In the alternative macro syntax mode the ampersand character (@samp{&}) can be
-used as a separator. eg:
-
-@example
- .altmacro
- .macro label l
-l&:
- .endm
-@end example
-@end table
-
-Note: this problem of correctly identifying string parameters to pseudo ops
-also applies to the identifiers used in @code{.irp} (@pxref{Irp})
-and @code{.irpc} (@pxref{Irpc}) as well.
-
-@item .endm
-@cindex @code{endm} directive
-Mark the end of a macro definition.
-
-@item .exitm
-@cindex @code{exitm} directive
-Exit early from the current macro definition.
-
-@cindex number of macros executed
-@cindex macros, count executed
-@item \@@
-@command{@value{AS}} maintains a counter of how many macros it has
-executed in this pseudo-variable; you can copy that number to your
-output with @samp{\@@}, but @emph{only within a macro definition}.
-
-@item LOCAL @var{name} [ , @dots{} ]
-@emph{Warning: @code{LOCAL} is only available if you select ``alternate
-macro syntax'' with @samp{--alternate} or @code{.altmacro}.}
-@xref{Altmacro,,@code{.altmacro}}.
-@end ftable
-
-@node Altmacro
-@section @code{.altmacro}
-Enable alternate macro mode, enabling:
-
-@ftable @code
-@item LOCAL @var{name} [ , @dots{} ]
-One additional directive, @code{LOCAL}, is available. It is used to
-generate a string replacement for each of the @var{name} arguments, and
-replace any instances of @var{name} in each macro expansion. The
-replacement string is unique in the assembly, and different for each
-separate macro expansion. @code{LOCAL} allows you to write macros that
-define symbols, without fear of conflict between separate macro expansions.
-
-@item String delimiters
-You can write strings delimited in these other ways besides
-@code{"@var{string}"}:
-
-@table @code
-@item '@var{string}'
-You can delimit strings with single-quote characters.
-
-@item <@var{string}>
-You can delimit strings with matching angle brackets.
-@end table
-
-@item single-character string escape
-To include any single character literally in a string (even if the
-character would otherwise have some special meaning), you can prefix the
-character with @samp{!} (an exclamation mark). For example, you can
-write @samp{<4.3 !> 5.4!!>} to get the literal text @samp{4.3 > 5.4!}.
-
-@item Expression results as strings
-You can write @samp{%@var{expr}} to evaluate the expression @var{expr}
-and use the result as a string.
-@end ftable
-
-@node Noaltmacro
-@section @code{.noaltmacro}
-Disable alternate macro mode. @xref{Altmacro}.
-
-@node Nolist
-@section @code{.nolist}
-
-@cindex @code{nolist} directive
-@cindex listing control, turning off
-Control (in conjunction with the @code{.list} directive) whether or
-not assembly listings are generated. These two directives maintain an
-internal counter (which is zero initially). @code{.list} increments the
-counter, and @code{.nolist} decrements it. Assembly listings are
-generated whenever the counter is greater than zero.
-
-@node Octa
-@section @code{.octa @var{bignums}}
-
-@c FIXME: double size emitted for "octa" on i960, others? Or warn?
-@cindex @code{octa} directive
-@cindex integer, 16-byte
-@cindex sixteen byte integer
-This directive expects zero or more bignums, separated by commas. For each
-bignum, it emits a 16-byte integer.
-
-The term ``octa'' comes from contexts in which a ``word'' is two bytes;
-hence @emph{octa}-word for 16 bytes.
-
-@node Org
-@section @code{.org @var{new-lc} , @var{fill}}
-
-@cindex @code{org} directive
-@cindex location counter, advancing
-@cindex advancing location counter
-@cindex current address, advancing
-Advance the location counter of the current section to
-@var{new-lc}. @var{new-lc} is either an absolute expression or an
-expression with the same section as the current subsection. That is,
-you can't use @code{.org} to cross sections: if @var{new-lc} has the
-wrong section, the @code{.org} directive is ignored. To be compatible
-with former assemblers, if the section of @var{new-lc} is absolute,
-@command{@value{AS}} issues a warning, then pretends the section of @var{new-lc}
-is the same as the current subsection.
-
-@code{.org} may only increase the location counter, or leave it
-unchanged; you cannot use @code{.org} to move the location counter
-backwards.
-
-@c double negative used below "not undefined" because this is a specific
-@c reference to "undefined" (as SEG_UNKNOWN is called in this manual)
-@c section. doc@cygnus.com 18feb91
-Because @command{@value{AS}} tries to assemble programs in one pass, @var{new-lc}
-may not be undefined. If you really detest this restriction we eagerly await
-a chance to share your improved assembler.
-
-Beware that the origin is relative to the start of the section, not
-to the start of the subsection. This is compatible with other
-people's assemblers.
-
-When the location counter (of the current subsection) is advanced, the
-intervening bytes are filled with @var{fill} which should be an
-absolute expression. If the comma and @var{fill} are omitted,
-@var{fill} defaults to zero.
-
-@node P2align
-@section @code{.p2align[wl] @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
-
-@cindex padding the location counter given a power of two
-@cindex @code{p2align} directive
-Pad the location counter (in the current subsection) to a particular
-storage boundary. The first expression (which must be absolute) is the
-number of low-order zero bits the location counter must have after
-advancement. For example @samp{.p2align 3} advances the location
-counter until it a multiple of 8. If the location counter is already a
-multiple of 8, no change is needed.
-
-The second expression (also absolute) gives the fill value to be stored in the
-padding bytes. It (and the comma) may be omitted. If it is omitted, the
-padding bytes are normally zero. However, on some systems, if the section is
-marked as containing code and the fill value is omitted, the space is filled
-with no-op instructions.
-
-The third expression is also absolute, and is also optional. If it is present,
-it is the maximum number of bytes that should be skipped by this alignment
-directive. If doing the alignment would require skipping more bytes than the
-specified maximum, then the alignment is not done at all. You can omit the
-fill value (the second argument) entirely by simply using two commas after the
-required alignment; this can be useful if you want the alignment to be filled
-with no-op instructions when appropriate.
-
-@cindex @code{p2alignw} directive
-@cindex @code{p2alignl} directive
-The @code{.p2alignw} and @code{.p2alignl} directives are variants of the
-@code{.p2align} directive. The @code{.p2alignw} directive treats the fill
-pattern as a two byte word value. The @code{.p2alignl} directives treats the
-fill pattern as a four byte longword value. For example, @code{.p2alignw
-2,0x368d} will align to a multiple of 4. If it skips two bytes, they will be
-filled in with the value 0x368d (the exact placement of the bytes depends upon
-the endianness of the processor). If it skips 1 or 3 bytes, the fill value is
-undefined.
-
-@ifset ELF
-@node Previous
-@section @code{.previous}
-
-@cindex @code{previous} directive
-@cindex Section Stack
-This is one of the ELF section stack manipulation directives. The others are
-@code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}),
-@code{.pushsection} (@pxref{PushSection}), and @code{.popsection}
-(@pxref{PopSection}).
-
-This directive swaps the current section (and subsection) with most recently
-referenced section/subsection pair prior to this one. Multiple
-@code{.previous} directives in a row will flip between two sections (and their
-subsections). For example:
-
-@smallexample
-.section A
- .subsection 1
- .word 0x1234
- .subsection 2
- .word 0x5678
-.previous
- .word 0x9abc
-@end smallexample
-
-Will place 0x1234 and 0x9abc into subsection 1 and 0x5678 into subsection 2 of
-section A. Whilst:
-
-@smallexample
-.section A
-.subsection 1
- # Now in section A subsection 1
- .word 0x1234
-.section B
-.subsection 0
- # Now in section B subsection 0
- .word 0x5678
-.subsection 1
- # Now in section B subsection 1
- .word 0x9abc
-.previous
- # Now in section B subsection 0
- .word 0xdef0
-@end smallexample
-
-Will place 0x1234 into section A, 0x5678 and 0xdef0 into subsection 0 of
-section B and 0x9abc into subsection 1 of section B.
-
-In terms of the section stack, this directive swaps the current section with
-the top section on the section stack.
-@end ifset
-
-@ifset ELF
-@node PopSection
-@section @code{.popsection}
-
-@cindex @code{popsection} directive
-@cindex Section Stack
-This is one of the ELF section stack manipulation directives. The others are
-@code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}),
-@code{.pushsection} (@pxref{PushSection}), and @code{.previous}
-(@pxref{Previous}).
-
-This directive replaces the current section (and subsection) with the top
-section (and subsection) on the section stack. This section is popped off the
-stack.
-@end ifset
-
-@node Print
-@section @code{.print @var{string}}
-
-@cindex @code{print} directive
-@command{@value{AS}} will print @var{string} on the standard output during
-assembly. You must put @var{string} in double quotes.
-
-@ifset ELF
-@node Protected
-@section @code{.protected @var{names}}
-
-@cindex @code{protected} directive
-@cindex visibility
-This is one of the ELF visibility directives. The other two are
-@code{.hidden} (@pxref{Hidden}) and @code{.internal} (@pxref{Internal}).
-
-This directive overrides the named symbols default visibility (which is set by
-their binding: local, global or weak). The directive sets the visibility to
-@code{protected} which means that any references to the symbols from within the
-components that defines them must be resolved to the definition in that
-component, even if a definition in another component would normally preempt
-this.
-@end ifset
-
-@node Psize
-@section @code{.psize @var{lines} , @var{columns}}
-
-@cindex @code{psize} directive
-@cindex listing control: paper size
-@cindex paper size, for listings
-Use this directive to declare the number of lines---and, optionally, the
-number of columns---to use for each page, when generating listings.
-
-If you do not use @code{.psize}, listings use a default line-count
-of 60. You may omit the comma and @var{columns} specification; the
-default width is 200 columns.
-
-@command{@value{AS}} generates formfeeds whenever the specified number of
-lines is exceeded (or whenever you explicitly request one, using
-@code{.eject}).
-
-If you specify @var{lines} as @code{0}, no formfeeds are generated save
-those explicitly specified with @code{.eject}.
-
-@node Purgem
-@section @code{.purgem @var{name}}
-
-@cindex @code{purgem} directive
-Undefine the macro @var{name}, so that later uses of the string will not be
-expanded. @xref{Macro}.
-
-@ifset ELF
-@node PushSection
-@section @code{.pushsection @var{name} [, @var{subsection}] [, "@var{flags}"[, @@@var{type}[,@var{arguments}]]]}
-
-@cindex @code{pushsection} directive
-@cindex Section Stack
-This is one of the ELF section stack manipulation directives. The others are
-@code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}),
-@code{.popsection} (@pxref{PopSection}), and @code{.previous}
-(@pxref{Previous}).
-
-This directive pushes the current section (and subsection) onto the
-top of the section stack, and then replaces the current section and
-subsection with @code{name} and @code{subsection}. The optional
-@code{flags}, @code{type} and @code{arguments} are treated the same
-as in the @code{.section} (@pxref{Section}) directive.
-@end ifset
-
-@node Quad
-@section @code{.quad @var{bignums}}
-
-@cindex @code{quad} directive
-@code{.quad} expects zero or more bignums, separated by commas. For
-each bignum, it emits
-@ifclear bignum-16
-an 8-byte integer. If the bignum won't fit in 8 bytes, it prints a
-warning message; and just takes the lowest order 8 bytes of the bignum.
-@cindex eight-byte integer
-@cindex integer, 8-byte
-
-The term ``quad'' comes from contexts in which a ``word'' is two bytes;
-hence @emph{quad}-word for 8 bytes.
-@end ifclear
-@ifset bignum-16
-a 16-byte integer. If the bignum won't fit in 16 bytes, it prints a
-warning message; and just takes the lowest order 16 bytes of the bignum.
-@cindex sixteen-byte integer
-@cindex integer, 16-byte
-@end ifset
-
-@node Reloc
-@section @code{.reloc @var{offset}, @var{reloc_name}[, @var{expression}]}
-
-@cindex @code{reloc} directive
-Generate a relocation at @var{offset} of type @var{reloc_name} with value
-@var{expression}. If @var{offset} is a number, the relocation is generated in
-the current section. If @var{offset} is an expression that resolves to a
-symbol plus offset, the relocation is generated in the given symbol's section.
-@var{expression}, if present, must resolve to a symbol plus addend or to an
-absolute value, but note that not all targets support an addend. e.g. ELF REL
-targets such as i386 store an addend in the section contents rather than in the
-relocation. This low level interface does not support addends stored in the
-section.
-
-@node Rept
-@section @code{.rept @var{count}}
-
-@cindex @code{rept} directive
-Repeat the sequence of lines between the @code{.rept} directive and the next
-@code{.endr} directive @var{count} times.
-
-For example, assembling
-
-@example
- .rept 3
- .long 0
- .endr
-@end example
-
-is equivalent to assembling
-
-@example
- .long 0
- .long 0
- .long 0
-@end example
-
-@node Sbttl
-@section @code{.sbttl "@var{subheading}"}
-
-@cindex @code{sbttl} directive
-@cindex subtitles for listings
-@cindex listing control: subtitle
-Use @var{subheading} as the title (third line, immediately after the
-title line) when generating assembly listings.
-
-This directive affects subsequent pages, as well as the current page if
-it appears within ten lines of the top of a page.
-
-@ifset COFF
-@node Scl
-@section @code{.scl @var{class}}
-
-@cindex @code{scl} directive
-@cindex symbol storage class (COFF)
-@cindex COFF symbol storage class
-Set the storage-class value for a symbol. This directive may only be
-used inside a @code{.def}/@code{.endef} pair. Storage class may flag
-whether a symbol is static or external, or it may record further
-symbolic debugging information.
-@ifset BOUT
-
-The @samp{.scl} directive is primarily associated with COFF output; when
-configured to generate @code{b.out} output format, @command{@value{AS}}
-accepts this directive but ignores it.
-@end ifset
-@end ifset
-
-@ifset COFF-ELF
-@node Section
-@section @code{.section @var{name}}
-
-@cindex named section
-Use the @code{.section} directive to assemble the following code into a section
-named @var{name}.
-
-This directive is only supported for targets that actually support arbitrarily
-named sections; on @code{a.out} targets, for example, it is not accepted, even
-with a standard @code{a.out} section name.
-
-@ifset COFF
-@ifset ELF
-@c only print the extra heading if both COFF and ELF are set
-@subheading COFF Version
-@end ifset
-
-@cindex @code{section} directive (COFF version)
-For COFF targets, the @code{.section} directive is used in one of the following
-ways:
-
-@smallexample
-.section @var{name}[, "@var{flags}"]
-.section @var{name}[, @var{subsection}]
-@end smallexample
-
-If the optional argument is quoted, it is taken as flags to use for the
-section. Each flag is a single character. The following flags are recognized:
-@table @code
-@item b
-bss section (uninitialized data)
-@item n
-section is not loaded
-@item w
-writable section
-@item d
-data section
-@item r
-read-only section
-@item x
-executable section
-@item s
-shared section (meaningful for PE targets)
-@item a
-ignored. (For compatibility with the ELF version)
-@end table
-
-If no flags are specified, the default flags depend upon the section name. If
-the section name is not recognized, the default will be for the section to be
-loaded and writable. Note the @code{n} and @code{w} flags remove attributes
-from the section, rather than adding them, so if they are used on their own it
-will be as if no flags had been specified at all.
-
-If the optional argument to the @code{.section} directive is not quoted, it is
-taken as a subsection number (@pxref{Sub-Sections}).
-@end ifset
-
-@ifset ELF
-@ifset COFF
-@c only print the extra heading if both COFF and ELF are set
-@subheading ELF Version
-@end ifset
-
-@cindex Section Stack
-This is one of the ELF section stack manipulation directives. The others are
-@code{.subsection} (@pxref{SubSection}), @code{.pushsection}
-(@pxref{PushSection}), @code{.popsection} (@pxref{PopSection}), and
-@code{.previous} (@pxref{Previous}).
-
-@cindex @code{section} directive (ELF version)
-For ELF targets, the @code{.section} directive is used like this:
-
-@smallexample
-.section @var{name} [, "@var{flags}"[, @@@var{type}[,@var{flag_specific_arguments}]]]
-@end smallexample
-
-The optional @var{flags} argument is a quoted string which may contain any
-combination of the following characters:
-@table @code
-@item a
-section is allocatable
-@item w
-section is writable
-@item x
-section is executable
-@item M
-section is mergeable
-@item S
-section contains zero terminated strings
-@item G
-section is a member of a section group
-@item T
-section is used for thread-local-storage
-@end table
-
-The optional @var{type} argument may contain one of the following constants:
-@table @code
-@item @@progbits
-section contains data
-@item @@nobits
-section does not contain data (i.e., section only occupies space)
-@item @@note
-section contains data which is used by things other than the program
-@item @@init_array
-section contains an array of pointers to init functions
-@item @@fini_array
-section contains an array of pointers to finish functions
-@item @@preinit_array
-section contains an array of pointers to pre-init functions
-@end table
-
-Many targets only support the first three section types.
-
-Note on targets where the @code{@@} character is the start of a comment (eg
-ARM) then another character is used instead. For example the ARM port uses the
-@code{%} character.
-
-If @var{flags} contains the @code{M} symbol then the @var{type} argument must
-be specified as well as an extra argument---@var{entsize}---like this:
-
-@smallexample
-.section @var{name} , "@var{flags}"M, @@@var{type}, @var{entsize}
-@end smallexample
-
-Sections with the @code{M} flag but not @code{S} flag must contain fixed size
-constants, each @var{entsize} octets long. Sections with both @code{M} and
-@code{S} must contain zero terminated strings where each character is
-@var{entsize} bytes long. The linker may remove duplicates within sections with
-the same name, same entity size and same flags. @var{entsize} must be an
-absolute expression.
-
-If @var{flags} contains the @code{G} symbol then the @var{type} argument must
-be present along with an additional field like this:
-
-@smallexample
-.section @var{name} , "@var{flags}"G, @@@var{type}, @var{GroupName}[, @var{linkage}]
-@end smallexample
-
-The @var{GroupName} field specifies the name of the section group to which this
-particular section belongs. The optional linkage field can contain:
-@table @code
-@item comdat
-indicates that only one copy of this section should be retained
-@item .gnu.linkonce
-an alias for comdat
-@end table
-
-Note: if both the @var{M} and @var{G} flags are present then the fields for
-the Merge flag should come first, like this:
-
-@smallexample
-.section @var{name} , "@var{flags}"MG, @@@var{type}, @var{entsize}, @var{GroupName}[, @var{linkage}]
-@end smallexample
-
-If no flags are specified, the default flags depend upon the section name. If
-the section name is not recognized, the default will be for the section to have
-none of the above flags: it will not be allocated in memory, nor writable, nor
-executable. The section will contain data.
-
-For ELF targets, the assembler supports another type of @code{.section}
-directive for compatibility with the Solaris assembler:
-
-@smallexample
-.section "@var{name}"[, @var{flags}...]
-@end smallexample
-
-Note that the section name is quoted. There may be a sequence of comma
-separated flags:
-@table @code
-@item #alloc
-section is allocatable
-@item #write
-section is writable
-@item #execinstr
-section is executable
-@item #tls
-section is used for thread local storage
-@end table
-
-This directive replaces the current section and subsection. See the
-contents of the gas testsuite directory @code{gas/testsuite/gas/elf} for
-some examples of how this directive and the other section stack directives
-work.
-@end ifset
-@end ifset
-
-@node Set
-@section @code{.set @var{symbol}, @var{expression}}
-
-@cindex @code{set} directive
-@cindex symbol value, setting
-Set the value of @var{symbol} to @var{expression}. This
-changes @var{symbol}'s value and type to conform to
-@var{expression}. If @var{symbol} was flagged as external, it remains
-flagged (@pxref{Symbol Attributes}).
-
-You may @code{.set} a symbol many times in the same assembly.
-
-If you @code{.set} a global symbol, the value stored in the object
-file is the last value stored into it.
-
-@ifset HPPA
-The syntax for @code{set} on the HPPA is
-@samp{@var{symbol} .set @var{expression}}.
-@end ifset
-
-@ifset Z80
-On Z80 @code{set} is a real instruction, use
-@samp{@var{symbol} defl @var{expression}} instead.
-@end ifset
-
-@node Short
-@section @code{.short @var{expressions}}
-
-@cindex @code{short} directive
-@ifset GENERIC
-@code{.short} is normally the same as @samp{.word}.
-@xref{Word,,@code{.word}}.
-
-In some configurations, however, @code{.short} and @code{.word} generate
-numbers of different lengths. @xref{Machine Dependencies}.
-@end ifset
-@ifclear GENERIC
-@ifset W16
-@code{.short} is the same as @samp{.word}. @xref{Word,,@code{.word}}.
-@end ifset
-@ifset W32
-This expects zero or more @var{expressions}, and emits
-a 16 bit number for each.
-@end ifset
-@end ifclear
-
-@node Single
-@section @code{.single @var{flonums}}
-
-@cindex @code{single} directive
-@cindex floating point numbers (single)
-This directive assembles zero or more flonums, separated by commas. It
-has the same effect as @code{.float}.
-@ifset GENERIC
-The exact kind of floating point numbers emitted depends on how
-@command{@value{AS}} is configured. @xref{Machine Dependencies}.
-@end ifset
-@ifclear GENERIC
-@ifset IEEEFLOAT
-On the @value{TARGET} family, @code{.single} emits 32-bit floating point
-numbers in @sc{ieee} format.
-@end ifset
-@end ifclear
-
-@ifset COFF-ELF
-@node Size
-@section @code{.size}
-
-This directive is used to set the size associated with a symbol.
-
-@ifset COFF
-@ifset ELF
-@c only print the extra heading if both COFF and ELF are set
-@subheading COFF Version
-@end ifset
-
-@cindex @code{size} directive (COFF version)
-For COFF targets, the @code{.size} directive is only permitted inside
-@code{.def}/@code{.endef} pairs. It is used like this:
-
-@smallexample
-.size @var{expression}
-@end smallexample
-
-@ifset BOUT
-@samp{.size} is only meaningful when generating COFF format output; when
-@command{@value{AS}} is generating @code{b.out}, it accepts this directive but
-ignores it.
-@end ifset
-@end ifset
-
-@ifset ELF
-@ifset COFF
-@c only print the extra heading if both COFF and ELF are set
-@subheading ELF Version
-@end ifset
-
-@cindex @code{size} directive (ELF version)
-For ELF targets, the @code{.size} directive is used like this:
-
-@smallexample
-.size @var{name} , @var{expression}
-@end smallexample
-
-This directive sets the size associated with a symbol @var{name}.
-The size in bytes is computed from @var{expression} which can make use of label
-arithmetic. This directive is typically used to set the size of function
-symbols.
-@end ifset
-@end ifset
-
-@node Sleb128
-@section @code{.sleb128 @var{expressions}}
-
-@cindex @code{sleb128} directive
-@var{sleb128} stands for ``signed little endian base 128.'' This is a
-compact, variable length representation of numbers used by the DWARF
-symbolic debugging format. @xref{Uleb128, ,@code{.uleb128}}.
-
-@ifclear no-space-dir
-@node Skip
-@section @code{.skip @var{size} , @var{fill}}
-
-@cindex @code{skip} directive
-@cindex filling memory
-This directive emits @var{size} bytes, each of value @var{fill}. Both
-@var{size} and @var{fill} are absolute expressions. If the comma and
-@var{fill} are omitted, @var{fill} is assumed to be zero. This is the same as
-@samp{.space}.
-
-@node Space
-@section @code{.space @var{size} , @var{fill}}
-
-@cindex @code{space} directive
-@cindex filling memory
-This directive emits @var{size} bytes, each of value @var{fill}. Both
-@var{size} and @var{fill} are absolute expressions. If the comma
-and @var{fill} are omitted, @var{fill} is assumed to be zero. This is the same
-as @samp{.skip}.
-
-@ifset HPPA
-@quotation
-@emph{Warning:} @code{.space} has a completely different meaning for HPPA
-targets; use @code{.block} as a substitute. See @cite{HP9000 Series 800
-Assembly Language Reference Manual} (HP 92432-90001) for the meaning of the
-@code{.space} directive. @xref{HPPA Directives,,HPPA Assembler Directives},
-for a summary.
-@end quotation
-@end ifset
-@end ifclear
-
-@ifset have-stabs
-@node Stab
-@section @code{.stabd, .stabn, .stabs}
-
-@cindex symbolic debuggers, information for
-@cindex @code{stab@var{x}} directives
-There are three directives that begin @samp{.stab}.
-All emit symbols (@pxref{Symbols}), for use by symbolic debuggers.
-The symbols are not entered in the @command{@value{AS}} hash table: they
-cannot be referenced elsewhere in the source file.
-Up to five fields are required:
-
-@table @var
-@item string
-This is the symbol's name. It may contain any character except
-@samp{\000}, so is more general than ordinary symbol names. Some
-debuggers used to code arbitrarily complex structures into symbol names
-using this field.
-
-@item type
-An absolute expression. The symbol's type is set to the low 8 bits of
-this expression. Any bit pattern is permitted, but @code{@value{LD}}
-and debuggers choke on silly bit patterns.
-
-@item other
-An absolute expression. The symbol's ``other'' attribute is set to the
-low 8 bits of this expression.
-
-@item desc
-An absolute expression. The symbol's descriptor is set to the low 16
-bits of this expression.
-
-@item value
-An absolute expression which becomes the symbol's value.
-@end table
-
-If a warning is detected while reading a @code{.stabd}, @code{.stabn},
-or @code{.stabs} statement, the symbol has probably already been created;
-you get a half-formed symbol in your object file. This is
-compatible with earlier assemblers!
-
-@table @code
-@cindex @code{stabd} directive
-@item .stabd @var{type} , @var{other} , @var{desc}
-
-The ``name'' of the symbol generated is not even an empty string.
-It is a null pointer, for compatibility. Older assemblers used a
-null pointer so they didn't waste space in object files with empty
-strings.
-
-The symbol's value is set to the location counter,
-relocatably. When your program is linked, the value of this symbol
-is the address of the location counter when the @code{.stabd} was
-assembled.
-
-@cindex @code{stabn} directive
-@item .stabn @var{type} , @var{other} , @var{desc} , @var{value}
-The name of the symbol is set to the empty string @code{""}.
-
-@cindex @code{stabs} directive
-@item .stabs @var{string} , @var{type} , @var{other} , @var{desc} , @var{value}
-All five fields are specified.
-@end table
-@end ifset
-@c end have-stabs
-
-@node String
-@section @code{.string} "@var{str}", @code{.string8} "@var{str}", @code{.string16}
-"@var{str}", @code{.string32} "@var{str}", @code{.string64} "@var{str}"
-
-@cindex string, copying to object file
-@cindex string8, copying to object file
-@cindex string16, copying to object file
-@cindex string32, copying to object file
-@cindex string64, copying to object file
-@cindex @code{string} directive
-@cindex @code{string8} directive
-@cindex @code{string16} directive
-@cindex @code{string32} directive
-@cindex @code{string64} directive
-
-Copy the characters in @var{str} to the object file. You may specify more than
-one string to copy, separated by commas. Unless otherwise specified for a
-particular machine, the assembler marks the end of each string with a 0 byte.
-You can use any of the escape sequences described in @ref{Strings,,Strings}.
-
-The variants @code{string16}, @code{string32} and @code{string64} differ from
-the @code{string} pseudo opcode in that each 8-bit character from @var{str} is
-copied and expanded to 16, 32 or 64 bits respectively. The expanded characters
-are stored in target endianness byte order.
-
-Example:
-@smallexample
- .string32 "BYE"
-expands to:
- .string "B\0\0\0Y\0\0\0E\0\0\0" /* On little endian targets. */
- .string "\0\0\0B\0\0\0Y\0\0\0E" /* On big endian targets. */
-@end smallexample
-
-
-@node Struct
-@section @code{.struct @var{expression}}
-
-@cindex @code{struct} directive
-Switch to the absolute section, and set the section offset to @var{expression},
-which must be an absolute expression. You might use this as follows:
-@smallexample
- .struct 0
-field1:
- .struct field1 + 4
-field2:
- .struct field2 + 4
-field3:
-@end smallexample
-This would define the symbol @code{field1} to have the value 0, the symbol
-@code{field2} to have the value 4, and the symbol @code{field3} to have the
-value 8. Assembly would be left in the absolute section, and you would need to
-use a @code{.section} directive of some sort to change to some other section
-before further assembly.
-
-@ifset ELF
-@node SubSection
-@section @code{.subsection @var{name}}
-
-@cindex @code{subsection} directive
-@cindex Section Stack
-This is one of the ELF section stack manipulation directives. The others are
-@code{.section} (@pxref{Section}), @code{.pushsection} (@pxref{PushSection}),
-@code{.popsection} (@pxref{PopSection}), and @code{.previous}
-(@pxref{Previous}).
-
-This directive replaces the current subsection with @code{name}. The current
-section is not changed. The replaced subsection is put onto the section stack
-in place of the then current top of stack subsection.
-@end ifset
-
-@ifset ELF
-@node Symver
-@section @code{.symver}
-@cindex @code{symver} directive
-@cindex symbol versioning
-@cindex versions of symbols
-Use the @code{.symver} directive to bind symbols to specific version nodes
-within a source file. This is only supported on ELF platforms, and is
-typically used when assembling files to be linked into a shared library.
-There are cases where it may make sense to use this in objects to be bound
-into an application itself so as to override a versioned symbol from a
-shared library.
-
-For ELF targets, the @code{.symver} directive can be used like this:
-@smallexample
-.symver @var{name}, @var{name2@@nodename}
-@end smallexample
-If the symbol @var{name} is defined within the file
-being assembled, the @code{.symver} directive effectively creates a symbol
-alias with the name @var{name2@@nodename}, and in fact the main reason that we
-just don't try and create a regular alias is that the @var{@@} character isn't
-permitted in symbol names. The @var{name2} part of the name is the actual name
-of the symbol by which it will be externally referenced. The name @var{name}
-itself is merely a name of convenience that is used so that it is possible to
-have definitions for multiple versions of a function within a single source
-file, and so that the compiler can unambiguously know which version of a
-function is being mentioned. The @var{nodename} portion of the alias should be
-the name of a node specified in the version script supplied to the linker when
-building a shared library. If you are attempting to override a versioned
-symbol from a shared library, then @var{nodename} should correspond to the
-nodename of the symbol you are trying to override.
-
-If the symbol @var{name} is not defined within the file being assembled, all
-references to @var{name} will be changed to @var{name2@@nodename}. If no
-reference to @var{name} is made, @var{name2@@nodename} will be removed from the
-symbol table.
-
-Another usage of the @code{.symver} directive is:
-@smallexample
-.symver @var{name}, @var{name2@@@@nodename}
-@end smallexample
-In this case, the symbol @var{name} must exist and be defined within
-the file being assembled. It is similar to @var{name2@@nodename}. The
-difference is @var{name2@@@@nodename} will also be used to resolve
-references to @var{name2} by the linker.
-
-The third usage of the @code{.symver} directive is:
-@smallexample
-.symver @var{name}, @var{name2@@@@@@nodename}
-@end smallexample
-When @var{name} is not defined within the
-file being assembled, it is treated as @var{name2@@nodename}. When
-@var{name} is defined within the file being assembled, the symbol
-name, @var{name}, will be changed to @var{name2@@@@nodename}.
-@end ifset
-
-@ifset COFF
-@node Tag
-@section @code{.tag @var{structname}}
-
-@cindex COFF structure debugging
-@cindex structure debugging, COFF
-@cindex @code{tag} directive
-This directive is generated by compilers to include auxiliary debugging
-information in the symbol table. It is only permitted inside
-@code{.def}/@code{.endef} pairs. Tags are used to link structure
-definitions in the symbol table with instances of those structures.
-@ifset BOUT
-
-@samp{.tag} is only used when generating COFF format output; when
-@command{@value{AS}} is generating @code{b.out}, it accepts this directive but
-ignores it.
-@end ifset
-@end ifset
-
-@node Text
-@section @code{.text @var{subsection}}
-
-@cindex @code{text} directive
-Tells @command{@value{AS}} to assemble the following statements onto the end of
-the text subsection numbered @var{subsection}, which is an absolute
-expression. If @var{subsection} is omitted, subsection number zero
-is used.
-
-@node Title
-@section @code{.title "@var{heading}"}
-
-@cindex @code{title} directive
-@cindex listing control: title line
-Use @var{heading} as the title (second line, immediately after the
-source file name and pagenumber) when generating assembly listings.
-
-This directive affects subsequent pages, as well as the current page if
-it appears within ten lines of the top of a page.
-
-@ifset COFF-ELF
-@node Type
-@section @code{.type}
-
-This directive is used to set the type of a symbol.
-
-@ifset COFF
-@ifset ELF
-@c only print the extra heading if both COFF and ELF are set
-@subheading COFF Version
-@end ifset
-
-@cindex COFF symbol type
-@cindex symbol type, COFF
-@cindex @code{type} directive (COFF version)
-For COFF targets, this directive is permitted only within
-@code{.def}/@code{.endef} pairs. It is used like this:
-
-@smallexample
-.type @var{int}
-@end smallexample
-
-This records the integer @var{int} as the type attribute of a symbol table
-entry.
-
-@ifset BOUT
-@samp{.type} is associated only with COFF format output; when
-@command{@value{AS}} is configured for @code{b.out} output, it accepts this
-directive but ignores it.
-@end ifset
-@end ifset
-
-@ifset ELF
-@ifset COFF
-@c only print the extra heading if both COFF and ELF are set
-@subheading ELF Version
-@end ifset
-
-@cindex ELF symbol type
-@cindex symbol type, ELF
-@cindex @code{type} directive (ELF version)
-For ELF targets, the @code{.type} directive is used like this:
-
-@smallexample
-.type @var{name} , @var{type description}
-@end smallexample
-
-This sets the type of symbol @var{name} to be either a
-function symbol or an object symbol. There are five different syntaxes
-supported for the @var{type description} field, in order to provide
-compatibility with various other assemblers.
-
-Because some of the characters used in these syntaxes (such as @samp{@@} and
-@samp{#}) are comment characters for some architectures, some of the syntaxes
-below do not work on all architectures. The first variant will be accepted by
-the GNU assembler on all architectures so that variant should be used for
-maximum portability, if you do not need to assemble your code with other
-assemblers.
-
-The syntaxes supported are:
-
-@smallexample
- .type <name> STT_<TYPE_IN_UPPER_CASE>
- .type <name>,#<type>
- .type <name>,@@<type>
- .type <name>,%>type>
- .type <name>,"<type>"
-@end smallexample
-
-The types supported are:
-
-@table @gcctabopt
-@item STT_FUNC
-@itemx function
-Mark the symbol as being a function name.
-
-@item STT_OBJECT
-@itemx object
-Mark the symbol as being a data object.
-
-@item STT_TLS
-@itemx tls_object
-Mark the symbol as being a thead-local data object.
-
-@item STT_COMMON
-@itemx common
-Mark the symbol as being a common data object.
-@end table
-
-Note: Some targets support extra types in addition to those listed above.
-
-@end ifset
-@end ifset
-
-@node Uleb128
-@section @code{.uleb128 @var{expressions}}
-
-@cindex @code{uleb128} directive
-@var{uleb128} stands for ``unsigned little endian base 128.'' This is a
-compact, variable length representation of numbers used by the DWARF
-symbolic debugging format. @xref{Sleb128, ,@code{.sleb128}}.
-
-@ifset COFF
-@node Val
-@section @code{.val @var{addr}}
-
-@cindex @code{val} directive
-@cindex COFF value attribute
-@cindex value attribute, COFF
-This directive, permitted only within @code{.def}/@code{.endef} pairs,
-records the address @var{addr} as the value attribute of a symbol table
-entry.
-@ifset BOUT
-
-@samp{.val} is used only for COFF output; when @command{@value{AS}} is
-configured for @code{b.out}, it accepts this directive but ignores it.
-@end ifset
-@end ifset
-
-@ifset ELF
-@node Version
-@section @code{.version "@var{string}"}
-
-@cindex @code{version} directive
-This directive creates a @code{.note} section and places into it an ELF
-formatted note of type NT_VERSION. The note's name is set to @code{string}.
-@end ifset
-
-@ifset ELF
-@node VTableEntry
-@section @code{.vtable_entry @var{table}, @var{offset}}
-
-@cindex @code{vtable_entry} directive
-This directive finds or creates a symbol @code{table} and creates a
-@code{VTABLE_ENTRY} relocation for it with an addend of @code{offset}.
-
-@node VTableInherit
-@section @code{.vtable_inherit @var{child}, @var{parent}}
-
-@cindex @code{vtable_inherit} directive
-This directive finds the symbol @code{child} and finds or creates the symbol
-@code{parent} and then creates a @code{VTABLE_INHERIT} relocation for the
-parent whose addend is the value of the child symbol. As a special case the
-parent name of @code{0} is treated as referring to the @code{*ABS*} section.
-@end ifset
-
-@node Warning
-@section @code{.warning "@var{string}"}
-@cindex warning directive
-Similar to the directive @code{.error}
-(@pxref{Error,,@code{.error "@var{string}"}}), but just emits a warning.
-
-@node Weak
-@section @code{.weak @var{names}}
-
-@cindex @code{weak} directive
-This directive sets the weak attribute on the comma separated list of symbol
-@code{names}. If the symbols do not already exist, they will be created.
-
-On COFF targets other than PE, weak symbols are a GNU extension. This
-directive sets the weak attribute on the comma separated list of symbol
-@code{names}. If the symbols do not already exist, they will be created.
-
-On the PE target, weak symbols are supported natively as weak aliases.
-When a weak symbol is created that is not an alias, GAS creates an
-alternate symbol to hold the default value.
-
-@node Weakref
-@section @code{.weakref @var{alias}, @var{target}}
-
-@cindex @code{weakref} directive
-This directive creates an alias to the target symbol that enables the symbol to
-be referenced with weak-symbol semantics, but without actually making it weak.
-If direct references or definitions of the symbol are present, then the symbol
-will not be weak, but if all references to it are through weak references, the
-symbol will be marked as weak in the symbol table.
-
-The effect is equivalent to moving all references to the alias to a separate
-assembly source file, renaming the alias to the symbol in it, declaring the
-symbol as weak there, and running a reloadable link to merge the object files
-resulting from the assembly of the new source file and the old source file that
-had the references to the alias removed.
-
-The alias itself never makes to the symbol table, and is entirely handled
-within the assembler.
-
-@node Word
-@section @code{.word @var{expressions}}
-
-@cindex @code{word} directive
-This directive expects zero or more @var{expressions}, of any section,
-separated by commas.
-@ifclear GENERIC
-@ifset W32
-For each expression, @command{@value{AS}} emits a 32-bit number.
-@end ifset
-@ifset W16
-For each expression, @command{@value{AS}} emits a 16-bit number.
-@end ifset
-@end ifclear
-@ifset GENERIC
-
-The size of the number emitted, and its byte order,
-depend on what target computer the assembly is for.
-@end ifset
-
-@c on amd29k, i960, sparc the "special treatment to support compilers" doesn't
-@c happen---32-bit addressability, period; no long/short jumps.
-@ifset DIFF-TBL-KLUGE
-@cindex difference tables altered
-@cindex altered difference tables
-@quotation
-@emph{Warning: Special Treatment to support Compilers}
-@end quotation
-
-@ifset GENERIC
-Machines with a 32-bit address space, but that do less than 32-bit
-addressing, require the following special treatment. If the machine of
-interest to you does 32-bit addressing (or doesn't require it;
-@pxref{Machine Dependencies}), you can ignore this issue.
-
-@end ifset
-In order to assemble compiler output into something that works,
-@command{@value{AS}} occasionally does strange things to @samp{.word} directives.
-Directives of the form @samp{.word sym1-sym2} are often emitted by
-compilers as part of jump tables. Therefore, when @command{@value{AS}} assembles a
-directive of the form @samp{.word sym1-sym2}, and the difference between
-@code{sym1} and @code{sym2} does not fit in 16 bits, @command{@value{AS}}
-creates a @dfn{secondary jump table}, immediately before the next label.
-This secondary jump table is preceded by a short-jump to the
-first byte after the secondary table. This short-jump prevents the flow
-of control from accidentally falling into the new table. Inside the
-table is a long-jump to @code{sym2}. The original @samp{.word}
-contains @code{sym1} minus the address of the long-jump to
-@code{sym2}.
-
-If there were several occurrences of @samp{.word sym1-sym2} before the
-secondary jump table, all of them are adjusted. If there was a
-@samp{.word sym3-sym4}, that also did not fit in sixteen bits, a
-long-jump to @code{sym4} is included in the secondary jump table,
-and the @code{.word} directives are adjusted to contain @code{sym3}
-minus the address of the long-jump to @code{sym4}; and so on, for as many
-entries in the original jump table as necessary.
-
-@ifset INTERNALS
-@emph{This feature may be disabled by compiling @command{@value{AS}} with the
-@samp{-DWORKING_DOT_WORD} option.} This feature is likely to confuse
-assembly language programmers.
-@end ifset
-@end ifset
-@c end DIFF-TBL-KLUGE
-
-@node Deprecated
-@section Deprecated Directives
-
-@cindex deprecated directives
-@cindex obsolescent directives
-One day these directives won't work.
-They are included for compatibility with older assemblers.
-@table @t
-@item .abort
-@item .line
-@end table
-
-@ifset ELF
-@node Object Attributes
-@chapter Object Attributes
-@cindex object attributes
-
-@command{@value{AS}} assembles source files written for a specific architecture
-into object files for that architecture. But not all object files are alike.
-Many architectures support incompatible variations. For instance, floating
-point arguments might be passed in floating point registers if the object file
-requires hardware floating point support---or floating point arguments might be
-passed in integer registers if the object file supports processors with no
-hardware floating point unit. Or, if two objects are built for different
-generations of the same architecture, the combination may require the
-newer generation at run-time.
-
-This information is useful during and after linking. At link time,
-@command{@value{LD}} can warn about incompatible object files. After link
-time, tools like @command{gdb} can use it to process the linked file
-correctly.
-
-Compatibility information is recorded as a series of object attributes. Each
-attribute has a @dfn{vendor}, @dfn{tag}, and @dfn{value}. The vendor is a
-string, and indicates who sets the meaning of the tag. The tag is an integer,
-and indicates what property the attribute describes. The value may be a string
-or an integer, and indicates how the property affects this object. Missing
-attributes are the same as attributes with a zero value or empty string value.
-
-Object attributes were developed as part of the ABI for the ARM Architecture.
-The file format is documented in @cite{ELF for the ARM Architecture}.
-
-@menu
-* GNU Object Attributes:: @sc{gnu} Object Attributes
-* Defining New Object Attributes:: Defining New Object Attributes
-@end menu
-
-@node GNU Object Attributes
-@section @sc{gnu} Object Attributes
-
-The @code{.gnu_attribute} directive records an object attribute
-with vendor @samp{gnu}.
-
-Except for @samp{Tag_compatibility}, which has both an integer and a string for
-its value, @sc{gnu} attributes have a string value if the tag number is odd and
-an integer value if the tag number is even. The second bit (@code{@var{tag} &
-2} is set for architecture-independent attributes and clear for
-architecture-dependent ones.
-
-@subsection Common @sc{gnu} attributes
-
-These attributes are valid on all architectures.
-
-@table @r
-@item Tag_compatibility (32)
-The compatibility attribute takes an integer flag value and a vendor name. If
-the flag value is 0, the file is compatible with other toolchains. If it is 1,
-then the file is only compatible with the named toolchain. If it is greater
-than 1, the file can only be processed by other toolchains under some private
-arrangement indicated by the flag value and the vendor name.
-@end table
-
-@subsection MIPS Attributes
-
-@table @r
-@item Tag_GNU_MIPS_ABI_FP (4)
-The floating-point ABI used by this object file. The value will be:
-
-@itemize @bullet
-@item
-0 for files not affected by the floating-point ABI.
-@item
-1 for files using the hardware floating-point with a standard double-precision
-FPU.
-@item
-2 for files using the hardware floating-point ABI with a single-precision FPU.
-@item
-3 for files using the software floating-point ABI.
-@item
-4 for files using the hardware floating-point ABI with 64-bit wide
-double-precision floating-point registers and 32-bit wide general
-purpose registers.
-@end itemize
-@end table
-
-@subsection PowerPC Attributes
-
-@table @r
-@item Tag_GNU_Power_ABI_FP (4)
-The floating-point ABI used by this object file. The value will be:
-
-@itemize @bullet
-@item
-0 for files not affected by the floating-point ABI.
-@item
-1 for files using double-precision hardware floating-point ABI.
-@item
-2 for files using the software floating-point ABI.
-@item
-3 for files using single-precision hardware floating-point ABI.
-@end itemize
-
-@item Tag_GNU_Power_ABI_Vector (8)
-The vector ABI used by this object file. The value will be:
-
-@itemize @bullet
-@item
-0 for files not affected by the vector ABI.
-@item
-1 for files using general purpose registers to pass vectors.
-@item
-2 for files using AltiVec registers to pass vectors.
-@item
-3 for files using SPE registers to pass vectors.
-@end itemize
-@end table
-
-@node Defining New Object Attributes
-@section Defining New Object Attributes
-
-If you want to define a new @sc{gnu} object attribute, here are the places you
-will need to modify. New attributes should be discussed on the @samp{binutils}
-mailing list.
-
-@itemize @bullet
-@item
-This manual, which is the official register of attributes.
-@item
-The header for your architecture @file{include/elf}, to define the tag.
-@item
-The @file{bfd} support file for your architecture, to merge the attribute
-and issue any appropriate link warnings.
-@item
-Test cases in @file{ld/testsuite} for merging and link warnings.
-@item
-@file{binutils/readelf.c} to display your attribute.
-@item
-GCC, if you want the compiler to mark the attribute automatically.
-@end itemize
-
-@end ifset
-
-@ifset GENERIC
-@node Machine Dependencies
-@chapter Machine Dependent Features
-
-@cindex machine dependencies
-The machine instruction sets are (almost by definition) different on
-each machine where @command{@value{AS}} runs. Floating point representations
-vary as well, and @command{@value{AS}} often supports a few additional
-directives or command-line options for compatibility with other
-assemblers on a particular platform. Finally, some versions of
-@command{@value{AS}} support special pseudo-instructions for branch
-optimization.
-
-This chapter discusses most of these differences, though it does not
-include details on any machine's instruction set. For details on that
-subject, see the hardware manufacturer's manual.
-
-@menu
-@ifset ALPHA
-* Alpha-Dependent:: Alpha Dependent Features
-@end ifset
-@ifset ARC
-* ARC-Dependent:: ARC Dependent Features
-@end ifset
-@ifset ARM
-* ARM-Dependent:: ARM Dependent Features
-@end ifset
-@ifset AVR
-* AVR-Dependent:: AVR Dependent Features
-@end ifset
-@ifset BFIN
-* BFIN-Dependent:: BFIN Dependent Features
-@end ifset
-@ifset CR16
-* CR16-Dependent:: CR16 Dependent Features
-@end ifset
-@ifset CRIS
-* CRIS-Dependent:: CRIS Dependent Features
-@end ifset
-@ifset D10V
-* D10V-Dependent:: D10V Dependent Features
-@end ifset
-@ifset D30V
-* D30V-Dependent:: D30V Dependent Features
-@end ifset
-@ifset H8/300
-* H8/300-Dependent:: Renesas H8/300 Dependent Features
-@end ifset
-@ifset HPPA
-* HPPA-Dependent:: HPPA Dependent Features
-@end ifset
-@ifset I370
-* ESA/390-Dependent:: IBM ESA/390 Dependent Features
-@end ifset
-@ifset I80386
-* i386-Dependent:: Intel 80386 and AMD x86-64 Dependent Features
-@end ifset
-@ifset I860
-* i860-Dependent:: Intel 80860 Dependent Features
-@end ifset
-@ifset I960
-* i960-Dependent:: Intel 80960 Dependent Features
-@end ifset
-@ifset IA64
-* IA-64-Dependent:: Intel IA-64 Dependent Features
-@end ifset
-@ifset IP2K
-* IP2K-Dependent:: IP2K Dependent Features
-@end ifset
-@ifset M32C
-* M32C-Dependent:: M32C Dependent Features
-@end ifset
-@ifset M32R
-* M32R-Dependent:: M32R Dependent Features
-@end ifset
-@ifset M680X0
-* M68K-Dependent:: M680x0 Dependent Features
-@end ifset
-@ifset M68HC11
-* M68HC11-Dependent:: M68HC11 and 68HC12 Dependent Features
-@end ifset
-@ifset MIPS
-* MIPS-Dependent:: MIPS Dependent Features
-@end ifset
-@ifset MMIX
-* MMIX-Dependent:: MMIX Dependent Features
-@end ifset
-@ifset MSP430
-* MSP430-Dependent:: MSP430 Dependent Features
-@end ifset
-@ifset SH
-* SH-Dependent:: Renesas / SuperH SH Dependent Features
-* SH64-Dependent:: SuperH SH64 Dependent Features
-@end ifset
-@ifset PDP11
-* PDP-11-Dependent:: PDP-11 Dependent Features
-@end ifset
-@ifset PJ
-* PJ-Dependent:: picoJava Dependent Features
-@end ifset
-@ifset PPC
-* PPC-Dependent:: PowerPC Dependent Features
-@end ifset
-@ifset SPARC
-* Sparc-Dependent:: SPARC Dependent Features
-@end ifset
-@ifset TIC54X
-* TIC54X-Dependent:: TI TMS320C54x Dependent Features
-@end ifset
-@ifset V850
-* V850-Dependent:: V850 Dependent Features
-@end ifset
-@ifset XTENSA
-* Xtensa-Dependent:: Xtensa Dependent Features
-@end ifset
-@ifset Z80
-* Z80-Dependent:: Z80 Dependent Features
-@end ifset
-@ifset Z8000
-* Z8000-Dependent:: Z8000 Dependent Features
-@end ifset
-@ifset VAX
-* Vax-Dependent:: VAX Dependent Features
-@end ifset
-@end menu
-
-@lowersections
-@end ifset
-
-@c The following major nodes are *sections* in the GENERIC version, *chapters*
-@c in single-cpu versions. This is mainly achieved by @lowersections. There is a
-@c peculiarity: to preserve cross-references, there must be a node called
-@c "Machine Dependencies". Hence the conditional nodenames in each
-@c major node below. Node defaulting in makeinfo requires adjacency of
-@c node and sectioning commands; hence the repetition of @chapter BLAH
-@c in both conditional blocks.
-
-@ifset ALPHA
-@include c-alpha.texi
-@end ifset
-
-@ifset ARC
-@include c-arc.texi
-@end ifset
-
-@ifset ARM
-@include c-arm.texi
-@end ifset
-
-@ifset AVR
-@include c-avr.texi
-@end ifset
-
-@ifset BFIN
-@include c-bfin.texi
-@end ifset
-
-@ifset CR16
-@include c-cr16.texi
-@end ifset
-
-@ifset CRIS
-@include c-cris.texi
-@end ifset
-
-@ifset Renesas-all
-@ifclear GENERIC
-@node Machine Dependencies
-@chapter Machine Dependent Features
-
-The machine instruction sets are different on each Renesas chip family,
-and there are also some syntax differences among the families. This
-chapter describes the specific @command{@value{AS}} features for each
-family.
-
-@menu
-* H8/300-Dependent:: Renesas H8/300 Dependent Features
-* SH-Dependent:: Renesas SH Dependent Features
-@end menu
-@lowersections
-@end ifclear
-@end ifset
-
-@ifset D10V
-@include c-d10v.texi
-@end ifset
-
-@ifset D30V
-@include c-d30v.texi
-@end ifset
-
-@ifset H8/300
-@include c-h8300.texi
-@end ifset
-
-@ifset HPPA
-@include c-hppa.texi
-@end ifset
-
-@ifset I370
-@include c-i370.texi
-@end ifset
-
-@ifset I80386
-@include c-i386.texi
-@end ifset
-
-@ifset I860
-@include c-i860.texi
-@end ifset
-
-@ifset I960
-@include c-i960.texi
-@end ifset
-
-@ifset IA64
-@include c-ia64.texi
-@end ifset
-
-@ifset IP2K
-@include c-ip2k.texi
-@end ifset
-
-@ifset M32C
-@include c-m32c.texi
-@end ifset
-
-@ifset M32R
-@include c-m32r.texi
-@end ifset
-
-@ifset M680X0
-@include c-m68k.texi
-@end ifset
-
-@ifset M68HC11
-@include c-m68hc11.texi
-@end ifset
-
-@ifset MIPS
-@include c-mips.texi
-@end ifset
-
-@ifset MMIX
-@include c-mmix.texi
-@end ifset
-
-@ifset MSP430
-@include c-msp430.texi
-@end ifset
-
-@ifset NS32K
-@include c-ns32k.texi
-@end ifset
-
-@ifset PDP11
-@include c-pdp11.texi
-@end ifset
-
-@ifset PJ
-@include c-pj.texi
-@end ifset
-
-@ifset PPC
-@include c-ppc.texi
-@end ifset
-
-@ifset SH
-@include c-sh.texi
-@include c-sh64.texi
-@end ifset
-
-@ifset SPARC
-@include c-sparc.texi
-@end ifset
-
-@ifset TIC54X
-@include c-tic54x.texi
-@end ifset
-
-@ifset Z80
-@include c-z80.texi
-@end ifset
-
-@ifset Z8000
-@include c-z8k.texi
-@end ifset
-
-@ifset VAX
-@include c-vax.texi
-@end ifset
-
-@ifset V850
-@include c-v850.texi
-@end ifset
-
-@ifset XTENSA
-@include c-xtensa.texi
-@end ifset
-
-@ifset GENERIC
-@c reverse effect of @down at top of generic Machine-Dep chapter
-@raisesections
-@end ifset
-
-@node Reporting Bugs
-@chapter Reporting Bugs
-@cindex bugs in assembler
-@cindex reporting bugs in assembler
-
-Your bug reports play an essential role in making @command{@value{AS}} reliable.
-
-Reporting a bug may help you by bringing a solution to your problem, or it may
-not. But in any case the principal function of a bug report is to help the
-entire community by making the next version of @command{@value{AS}} work better.
-Bug reports are your contribution to the maintenance of @command{@value{AS}}.
-
-In order for a bug report to serve its purpose, you must include the
-information that enables us to fix the bug.
-
-@menu
-* Bug Criteria:: Have you found a bug?
-* Bug Reporting:: How to report bugs
-@end menu
-
-@node Bug Criteria
-@section Have You Found a Bug?
-@cindex bug criteria
-
-If you are not sure whether you have found a bug, here are some guidelines:
-
-@itemize @bullet
-@cindex fatal signal
-@cindex assembler crash
-@cindex crash of assembler
-@item
-If the assembler gets a fatal signal, for any input whatever, that is a
-@command{@value{AS}} bug. Reliable assemblers never crash.
-
-@cindex error on valid input
-@item
-If @command{@value{AS}} produces an error message for valid input, that is a bug.
-
-@cindex invalid input
-@item
-If @command{@value{AS}} does not produce an error message for invalid input, that
-is a bug. However, you should note that your idea of ``invalid input'' might
-be our idea of ``an extension'' or ``support for traditional practice''.
-
-@item
-If you are an experienced user of assemblers, your suggestions for improvement
-of @command{@value{AS}} are welcome in any case.
-@end itemize
-
-@node Bug Reporting
-@section How to Report Bugs
-@cindex bug reports
-@cindex assembler bugs, reporting
-
-A number of companies and individuals offer support for @sc{gnu} products. If
-you obtained @command{@value{AS}} from a support organization, we recommend you
-contact that organization first.
-
-You can find contact information for many support companies and
-individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs
-distribution.
-
-@ifset BUGURL
-In any event, we also recommend that you send bug reports for @command{@value{AS}}
-to @value{BUGURL}.
-@end ifset
-
-The fundamental principle of reporting bugs usefully is this:
-@strong{report all the facts}. If you are not sure whether to state a
-fact or leave it out, state it!
-
-Often people omit facts because they think they know what causes the problem
-and assume that some details do not matter. Thus, you might assume that the
-name of a symbol you use in an example does not matter. Well, probably it does
-not, but one cannot be sure. Perhaps the bug is a stray memory reference which
-happens to fetch from the location where that name is stored in memory;
-perhaps, if the name were different, the contents of that location would fool
-the assembler into doing the right thing despite the bug. Play it safe and
-give a specific, complete example. That is the easiest thing for you to do,
-and the most helpful.
-
-Keep in mind that the purpose of a bug report is to enable us to fix the bug if
-it is new to us. Therefore, always write your bug reports on the assumption
-that the bug has not been reported previously.
-
-Sometimes people give a few sketchy facts and ask, ``Does this ring a
-bell?'' This cannot help us fix a bug, so it is basically useless. We
-respond by asking for enough details to enable us to investigate.
-You might as well expedite matters by sending them to begin with.
-
-To enable us to fix the bug, you should include all these things:
-
-@itemize @bullet
-@item
-The version of @command{@value{AS}}. @command{@value{AS}} announces it if you start
-it with the @samp{--version} argument.
-
-Without this, we will not know whether there is any point in looking for
-the bug in the current version of @command{@value{AS}}.
-
-@item
-Any patches you may have applied to the @command{@value{AS}} source.
-
-@item
-The type of machine you are using, and the operating system name and
-version number.
-
-@item
-What compiler (and its version) was used to compile @command{@value{AS}}---e.g.
-``@code{gcc-2.7}''.
-
-@item
-The command arguments you gave the assembler to assemble your example and
-observe the bug. To guarantee you will not omit something important, list them
-all. A copy of the Makefile (or the output from make) is sufficient.
-
-If we were to try to guess the arguments, we would probably guess wrong
-and then we might not encounter the bug.
-
-@item
-A complete input file that will reproduce the bug. If the bug is observed when
-the assembler is invoked via a compiler, send the assembler source, not the
-high level language source. Most compilers will produce the assembler source
-when run with the @samp{-S} option. If you are using @code{@value{GCC}}, use
-the options @samp{-v --save-temps}; this will save the assembler source in a
-file with an extension of @file{.s}, and also show you exactly how
-@command{@value{AS}} is being run.
-
-@item
-A description of what behavior you observe that you believe is
-incorrect. For example, ``It gets a fatal signal.''
-
-Of course, if the bug is that @command{@value{AS}} gets a fatal signal, then we
-will certainly notice it. But if the bug is incorrect output, we might not
-notice unless it is glaringly wrong. You might as well not give us a chance to
-make a mistake.
-
-Even if the problem you experience is a fatal signal, you should still say so
-explicitly. Suppose something strange is going on, such as, your copy of
-@command{@value{AS}} is out of sync, or you have encountered a bug in the C
-library on your system. (This has happened!) Your copy might crash and ours
-would not. If you told us to expect a crash, then when ours fails to crash, we
-would know that the bug was not happening for us. If you had not told us to
-expect a crash, then we would not be able to draw any conclusion from our
-observations.
-
-@item
-If you wish to suggest changes to the @command{@value{AS}} source, send us context
-diffs, as generated by @code{diff} with the @samp{-u}, @samp{-c}, or @samp{-p}
-option. Always send diffs from the old file to the new file. If you even
-discuss something in the @command{@value{AS}} source, refer to it by context, not
-by line number.
-
-The line numbers in our development sources will not match those in your
-sources. Your line numbers would convey no useful information to us.
-@end itemize
-
-Here are some things that are not necessary:
-
-@itemize @bullet
-@item
-A description of the envelope of the bug.
-
-Often people who encounter a bug spend a lot of time investigating
-which changes to the input file will make the bug go away and which
-changes will not affect it.
-
-This is often time consuming and not very useful, because the way we
-will find the bug is by running a single example under the debugger
-with breakpoints, not by pure deduction from a series of examples.
-We recommend that you save your time for something else.
-
-Of course, if you can find a simpler example to report @emph{instead}
-of the original one, that is a convenience for us. Errors in the
-output will be easier to spot, running under the debugger will take
-less time, and so on.
-
-However, simplification is not vital; if you do not want to do this,
-report the bug anyway and send us the entire test case you used.
-
-@item
-A patch for the bug.
-
-A patch for the bug does help us if it is a good one. But do not omit
-the necessary information, such as the test case, on the assumption that
-a patch is all we need. We might see problems with your patch and decide
-to fix the problem another way, or we might not understand it at all.
-
-Sometimes with a program as complicated as @command{@value{AS}} it is very hard to
-construct an example that will make the program follow a certain path through
-the code. If you do not send us the example, we will not be able to construct
-one, so we will not be able to verify that the bug is fixed.
-
-And if we cannot understand what bug you are trying to fix, or why your
-patch should be an improvement, we will not install it. A test case will
-help us to understand.
-
-@item
-A guess about what the bug is or what it depends on.
-
-Such guesses are usually wrong. Even we cannot guess right about such
-things without first using the debugger to find the facts.
-@end itemize
-
-@node Acknowledgements
-@chapter Acknowledgements
-
-If you have contributed to GAS and your name isn't listed here,
-it is not meant as a slight. We just don't know about it. Send mail to the
-maintainer, and we'll correct the situation. Currently
-@c (January 1994),
-the maintainer is Ken Raeburn (email address @code{raeburn@@cygnus.com}).
-
-Dean Elsner wrote the original @sc{gnu} assembler for the VAX.@footnote{Any
-more details?}
-
-Jay Fenlason maintained GAS for a while, adding support for GDB-specific debug
-information and the 68k series machines, most of the preprocessing pass, and
-extensive changes in @file{messages.c}, @file{input-file.c}, @file{write.c}.
-
-K. Richard Pixley maintained GAS for a while, adding various enhancements and
-many bug fixes, including merging support for several processors, breaking GAS
-up to handle multiple object file format back ends (including heavy rewrite,
-testing, an integration of the coff and b.out back ends), adding configuration
-including heavy testing and verification of cross assemblers and file splits
-and renaming, converted GAS to strictly ANSI C including full prototypes, added
-support for m680[34]0 and cpu32, did considerable work on i960 including a COFF
-port (including considerable amounts of reverse engineering), a SPARC opcode
-file rewrite, DECstation, rs6000, and hp300hpux host ports, updated ``know''
-assertions and made them work, much other reorganization, cleanup, and lint.
-
-Ken Raeburn wrote the high-level BFD interface code to replace most of the code
-in format-specific I/O modules.
-
-The original VMS support was contributed by David L. Kashtan. Eric Youngdale
-has done much work with it since.
-
-The Intel 80386 machine description was written by Eliot Dresselhaus.
-
-Minh Tran-Le at IntelliCorp contributed some AIX 386 support.
-
-The Motorola 88k machine description was contributed by Devon Bowen of Buffalo
-University and Torbjorn Granlund of the Swedish Institute of Computer Science.
-
-Keith Knowles at the Open Software Foundation wrote the original MIPS back end
-(@file{tc-mips.c}, @file{tc-mips.h}), and contributed Rose format support
-(which hasn't been merged in yet). Ralph Campbell worked with the MIPS code to
-support a.out format.
-
-Support for the Zilog Z8k and Renesas H8/300 processors (tc-z8k,
-tc-h8300), and IEEE 695 object file format (obj-ieee), was written by
-Steve Chamberlain of Cygnus Support. Steve also modified the COFF back end to
-use BFD for some low-level operations, for use with the H8/300 and AMD 29k
-targets.
-
-John Gilmore built the AMD 29000 support, added @code{.include} support, and
-simplified the configuration of which versions accept which directives. He
-updated the 68k machine description so that Motorola's opcodes always produced
-fixed-size instructions (e.g., @code{jsr}), while synthetic instructions
-remained shrinkable (@code{jbsr}). John fixed many bugs, including true tested
-cross-compilation support, and one bug in relaxation that took a week and
-required the proverbial one-bit fix.
-
-Ian Lance Taylor of Cygnus Support merged the Motorola and MIT syntax for the
-68k, completed support for some COFF targets (68k, i386 SVR3, and SCO Unix),
-added support for MIPS ECOFF and ELF targets, wrote the initial RS/6000 and
-PowerPC assembler, and made a few other minor patches.
-
-Steve Chamberlain made GAS able to generate listings.
-
-Hewlett-Packard contributed support for the HP9000/300.
-
-Jeff Law wrote GAS and BFD support for the native HPPA object format (SOM)
-along with a fairly extensive HPPA testsuite (for both SOM and ELF object
-formats). This work was supported by both the Center for Software Science at
-the University of Utah and Cygnus Support.
-
-Support for ELF format files has been worked on by Mark Eichin of Cygnus
-Support (original, incomplete implementation for SPARC), Pete Hoogenboom and
-Jeff Law at the University of Utah (HPPA mainly), Michael Meissner of the Open
-Software Foundation (i386 mainly), and Ken Raeburn of Cygnus Support (sparc,
-and some initial 64-bit support).
-
-Linas Vepstas added GAS support for the ESA/390 ``IBM 370'' architecture.
-
-Richard Henderson rewrote the Alpha assembler. Klaus Kaempf wrote GAS and BFD
-support for openVMS/Alpha.
-
-Timothy Wall, Michael Hayes, and Greg Smart contributed to the various tic*
-flavors.
-
-David Heine, Sterling Augustine, Bob Wilson and John Ruttenberg from Tensilica,
-Inc.@: added support for Xtensa processors.
-
-Several engineers at Cygnus Support have also provided many small bug fixes and
-configuration enhancements.
-
-Many others have contributed large or small bugfixes and enhancements. If
-you have contributed significant work and are not mentioned on this list, and
-want to be, let us know. Some of the history has been lost; we are not
-intentionally leaving anyone out.
-
-@include fdl.texi
-
-@node AS Index
-@unnumbered AS Index
-
-@printindex cp
-
-@bye
-@c Local Variables:
-@c fill-column: 79
-@c End:
diff --git a/gas/doc/c-ppc.texi b/gas/doc/c-ppc.texi
deleted file mode 100644
index bc65685bf13..00000000000
--- a/gas/doc/c-ppc.texi
+++ /dev/null
@@ -1,153 +0,0 @@
-@c Copyright 2001, 2002, 2003, 2005, 2006
-@c Free Software Foundation, Inc.
-@c This is part of the GAS manual.
-@c For copying conditions, see the file as.texinfo.
-@ifset GENERIC
-@page
-@node PPC-Dependent
-@chapter PowerPC Dependent Features
-@end ifset
-@ifclear GENERIC
-@node Machine Dependencies
-@chapter PowerPC Dependent Features
-@end ifclear
-
-@cindex PowerPC support
-@menu
-* PowerPC-Opts:: Options
-* PowerPC-Pseudo:: PowerPC Assembler Directives
-@end menu
-
-@node PowerPC-Opts
-@section Options
-
-@cindex options for PowerPC
-@cindex PowerPC options
-@cindex architectures, PowerPC
-@cindex PowerPC architectures
-The PowerPC chip family includes several successive levels, using the same
-core instruction set, but including a few additional instructions at
-each level. There are exceptions to this however. For details on what
-instructions each variant supports, please see the chip's architecture
-reference manual.
-
-The following table lists all available PowerPC options.
-
-@table @code
-@item -mpwrx | -mpwr2
-Generate code for POWER/2 (RIOS2).
-
-@item -mpwr
-Generate code for POWER (RIOS1)
-
-@item -m601
-Generate code for PowerPC 601.
-
-@item -mppc, -mppc32, -m603, -m604
-Generate code for PowerPC 603/604.
-
-@item -m403, -m405
-Generate code for PowerPC 403/405.
-
-@item -m440
-Generate code for PowerPC 440. BookE and some 405 instructions.
-
-@item -m7400, -m7410, -m7450, -m7455
-Generate code for PowerPC 7400/7410/7450/7455.
-
-@item -m750cl
-Generate code for PowerPC 750CL.
-
-@item -mppc64, -m620
-Generate code for PowerPC 620/625/630.
-
-@item -me500, -me500x2
-Generate code for Motorola e500 core complex.
-
-@item -mspe
-Generate code for Motorola SPE instructions.
-
-@item -mppc64bridge
-Generate code for PowerPC 64, including bridge insns.
-
-@item -mbooke64
-Generate code for 64-bit BookE.
-
-@item -mbooke, mbooke32
-Generate code for 32-bit BookE.
-
-@item -me300
-Generate code for PowerPC e300 family.
-
-@item -maltivec
-Generate code for processors with AltiVec instructions.
-
-@item -mvsx
-Generate code for processors with Vector-Scalar (VSX) instructions.
-
-@item -mpower4
-Generate code for Power4 architecture.
-
-@item -mpower5
-Generate code for Power5 architecture.
-
-@item -mpower6
-Generate code for Power6 architecture.
-
-@item -mpower7
-Generate code for Power7 architecture.
-
-@item -mcell
-Generate code for Cell Broadband Engine architecture.
-
-@item -mcom
-Generate code Power/PowerPC common instructions.
-
-@item -many
-Generate code for any architecture (PWR/PWRX/PPC).
-
-@item -mregnames
-Allow symbolic names for registers.
-
-@item -mno-regnames
-Do not allow symbolic names for registers.
-
-@item -mrelocatable
-Support for GCC's -mrelocatable option.
-
-@item -mrelocatable-lib
-Support for GCC's -mrelocatable-lib option.
-
-@item -memb
-Set PPC_EMB bit in ELF flags.
-
-@item -mlittle, -mlittle-endian
-Generate code for a little endian machine.
-
-@item -mbig, -mbig-endian
-Generate code for a big endian machine.
-
-@item -msolaris
-Generate code for Solaris.
-
-@item -mno-solaris
-Do not generate code for Solaris.
-@end table
-
-
-@node PowerPC-Pseudo
-@section PowerPC Assembler Directives
-
-@cindex directives for PowerPC
-@cindex PowerPC directives
-A number of assembler directives are available for PowerPC. The
-following table is far from complete.
-
-@table @code
-@item .machine "string"
-This directive allows you to change the machine for which code is
-generated. @code{"string"} may be any of the -m cpu selection options
-(without the -m) enclosed in double quotes, @code{"push"}, or
-@code{"pop"}. @code{.machine "push"} saves the currently selected
-cpu, which may be restored with @code{.machine "pop"}.
-@end table
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
deleted file mode 100644
index b7857f2caa4..00000000000
--- a/gas/dwarf2dbg.c
+++ /dev/null
@@ -1,1729 +0,0 @@
-/* dwarf2dbg.c - DWARF2 debug support
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
- Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
-
- This file is part of GAS, the GNU Assembler.
-
- GAS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GAS 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 GAS; see the file COPYING. If not, write to the Free
- Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-/* Logical line numbers can be controlled by the compiler via the
- following directives:
-
- .file FILENO "file.c"
- .loc FILENO LINENO [COLUMN] [basic_block] [prologue_end] \
- [epilogue_begin] [is_stmt VALUE] [isa VALUE]
-*/
-
-#include "as.h"
-#include "safe-ctype.h"
-
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#else
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifndef INT_MAX
-#define INT_MAX (int) (((unsigned) (-1)) >> 1)
-#endif
-#endif
-
-#include "dwarf2dbg.h"
-#include <filenames.h>
-
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
-/* We need to decide which character to use as a directory separator.
- Just because HAVE_DOS_BASED_FILE_SYSTEM is defined, it does not
- necessarily mean that the backslash character is the one to use.
- Some environments, eg Cygwin, can support both naming conventions.
- So we use the heuristic that we only need to use the backslash if
- the path is an absolute path starting with a DOS style drive
- selector. eg C: or D: */
-# define INSERT_DIR_SEPARATOR(string, offset) \
- do \
- { \
- if (offset > 1 \
- && string[0] != 0 \
- && string[1] == ':') \
- string [offset] = '\\'; \
- else \
- string [offset] = '/'; \
- } \
- while (0)
-#else
-# define INSERT_DIR_SEPARATOR(string, offset) string[offset] = '/'
-#endif
-
-#ifndef DWARF2_FORMAT
-# define DWARF2_FORMAT(SEC) dwarf2_format_32bit
-#endif
-
-#ifndef DWARF2_ADDR_SIZE
-# define DWARF2_ADDR_SIZE(bfd) (bfd_arch_bits_per_address (bfd) / 8)
-#endif
-
-#include "subsegs.h"
-
-#include "elf/dwarf2.h"
-
-/* Since we can't generate the prolog until the body is complete, we
- use three different subsegments for .debug_line: one holding the
- prolog, one for the directory and filename info, and one for the
- body ("statement program"). */
-#define DL_PROLOG 0
-#define DL_FILES 1
-#define DL_BODY 2
-
-/* If linker relaxation might change offsets in the code, the DWARF special
- opcodes and variable-length operands cannot be used. If this macro is
- nonzero, use the DW_LNS_fixed_advance_pc opcode instead. */
-#ifndef DWARF2_USE_FIXED_ADVANCE_PC
-# define DWARF2_USE_FIXED_ADVANCE_PC 0
-#endif
-
-/* First special line opcde - leave room for the standard opcodes.
- Note: If you want to change this, you'll have to update the
- "standard_opcode_lengths" table that is emitted below in
- out_debug_line(). */
-#define DWARF2_LINE_OPCODE_BASE 13
-
-#ifndef DWARF2_LINE_BASE
- /* Minimum line offset in a special line info. opcode. This value
- was chosen to give a reasonable range of values. */
-# define DWARF2_LINE_BASE -5
-#endif
-
-/* Range of line offsets in a special line info. opcode. */
-#ifndef DWARF2_LINE_RANGE
-# define DWARF2_LINE_RANGE 14
-#endif
-
-#ifndef DWARF2_LINE_MIN_INSN_LENGTH
- /* Define the architecture-dependent minimum instruction length (in
- bytes). This value should be rather too small than too big. */
-# define DWARF2_LINE_MIN_INSN_LENGTH 1
-#endif
-
-/* Flag that indicates the initial value of the is_stmt_start flag. */
-#define DWARF2_LINE_DEFAULT_IS_STMT 1
-
-/* Given a special op, return the line skip amount. */
-#define SPECIAL_LINE(op) \
- (((op) - DWARF2_LINE_OPCODE_BASE)%DWARF2_LINE_RANGE + DWARF2_LINE_BASE)
-
-/* Given a special op, return the address skip amount (in units of
- DWARF2_LINE_MIN_INSN_LENGTH. */
-#define SPECIAL_ADDR(op) (((op) - DWARF2_LINE_OPCODE_BASE)/DWARF2_LINE_RANGE)
-
-/* The maximum address skip amount that can be encoded with a special op. */
-#define MAX_SPECIAL_ADDR_DELTA SPECIAL_ADDR(255)
-
-struct line_entry {
- struct line_entry *next;
- symbolS *label;
- struct dwarf2_line_info loc;
-};
-
-struct line_subseg {
- struct line_subseg *next;
- subsegT subseg;
- struct line_entry *head;
- struct line_entry **ptail;
-};
-
-struct line_seg {
- struct line_seg *next;
- segT seg;
- struct line_subseg *head;
- symbolS *text_start;
- symbolS *text_end;
-};
-
-/* Collects data for all line table entries during assembly. */
-static struct line_seg *all_segs;
-
-struct file_entry {
- const char *filename;
- unsigned int dir;
-};
-
-/* Table of files used by .debug_line. */
-static struct file_entry *files;
-static unsigned int files_in_use;
-static unsigned int files_allocated;
-
-/* Table of directories used by .debug_line. */
-static char **dirs;
-static unsigned int dirs_in_use;
-static unsigned int dirs_allocated;
-
-/* TRUE when we've seen a .loc directive recently. Used to avoid
- doing work when there's nothing to do. */
-bfd_boolean dwarf2_loc_directive_seen;
-
-/* TRUE when we're supposed to set the basic block mark whenever a
- label is seen. */
-bfd_boolean dwarf2_loc_mark_labels;
-
-/* Current location as indicated by the most recent .loc directive. */
-static struct dwarf2_line_info current = {
- 1, 1, 0, 0,
- DWARF2_LINE_DEFAULT_IS_STMT ? DWARF2_FLAG_IS_STMT : 0
-};
-
-/* The size of an address on the target. */
-static unsigned int sizeof_address;
-
-static unsigned int get_filenum (const char *, unsigned int);
-
-#ifndef TC_DWARF2_EMIT_OFFSET
-#define TC_DWARF2_EMIT_OFFSET generic_dwarf2_emit_offset
-
-/* Create an offset to .dwarf2_*. */
-
-static void
-generic_dwarf2_emit_offset (symbolS *symbol, unsigned int size)
-{
- expressionS expr;
-
- expr.X_op = O_symbol;
- expr.X_add_symbol = symbol;
- expr.X_add_number = 0;
- emit_expr (&expr, size);
-}
-#endif
-
-/* Find or create an entry for SEG+SUBSEG in ALL_SEGS. */
-
-static struct line_subseg *
-get_line_subseg (segT seg, subsegT subseg)
-{
- static segT last_seg;
- static subsegT last_subseg;
- static struct line_subseg *last_line_subseg;
-
- struct line_seg **ps, *s;
- struct line_subseg **pss, *ss;
-
- if (seg == last_seg && subseg == last_subseg)
- return last_line_subseg;
-
- for (ps = &all_segs; (s = *ps) != NULL; ps = &s->next)
- if (s->seg == seg)
- goto found_seg;
-
- s = (struct line_seg *) xmalloc (sizeof (*s));
- s->next = NULL;
- s->seg = seg;
- s->head = NULL;
- *ps = s;
-
- found_seg:
- for (pss = &s->head; (ss = *pss) != NULL ; pss = &ss->next)
- {
- if (ss->subseg == subseg)
- goto found_subseg;
- if (ss->subseg > subseg)
- break;
- }
-
- ss = (struct line_subseg *) xmalloc (sizeof (*ss));
- ss->next = *pss;
- ss->subseg = subseg;
- ss->head = NULL;
- ss->ptail = &ss->head;
- *pss = ss;
-
- found_subseg:
- last_seg = seg;
- last_subseg = subseg;
- last_line_subseg = ss;
-
- return ss;
-}
-
-/* Record an entry for LOC occurring at LABEL. */
-
-static void
-dwarf2_gen_line_info_1 (symbolS *label, struct dwarf2_line_info *loc)
-{
- struct line_subseg *ss;
- struct line_entry *e;
-
- e = (struct line_entry *) xmalloc (sizeof (*e));
- e->next = NULL;
- e->label = label;
- e->loc = *loc;
-
- ss = get_line_subseg (now_seg, now_subseg);
- *ss->ptail = e;
- ss->ptail = &e->next;
-}
-
-/* Record an entry for LOC occurring at OFS within the current fragment. */
-
-void
-dwarf2_gen_line_info (addressT ofs, struct dwarf2_line_info *loc)
-{
- static unsigned int line = -1;
- static unsigned int filenum = -1;
-
- symbolS *sym;
-
- /* Early out for as-yet incomplete location information. */
- if (loc->filenum == 0 || loc->line == 0)
- return;
-
- /* Don't emit sequences of line symbols for the same line when the
- symbols apply to assembler code. It is necessary to emit
- duplicate line symbols when a compiler asks for them, because GDB
- uses them to determine the end of the prologue. */
- if (debug_type == DEBUG_DWARF2
- && line == loc->line && filenum == loc->filenum)
- return;
-
- line = loc->line;
- filenum = loc->filenum;
-
- sym = symbol_temp_new (now_seg, ofs, frag_now);
- dwarf2_gen_line_info_1 (sym, loc);
-}
-
-/* Returns the current source information. If .file directives have
- been encountered, the info for the corresponding source file is
- returned. Otherwise, the info for the assembly source file is
- returned. */
-
-void
-dwarf2_where (struct dwarf2_line_info *line)
-{
- if (debug_type == DEBUG_DWARF2)
- {
- char *filename;
- as_where (&filename, &line->line);
- line->filenum = get_filenum (filename, 0);
- line->column = 0;
- line->flags = DWARF2_FLAG_IS_STMT;
- line->isa = current.isa;
- }
- else
- *line = current;
-}
-
-/* A hook to allow the target backend to inform the line number state
- machine of isa changes when assembler debug info is enabled. */
-
-void
-dwarf2_set_isa (unsigned int isa)
-{
- current.isa = isa;
-}
-
-/* Called for each machine instruction, or relatively atomic group of
- machine instructions (ie built-in macro). The instruction or group
- is SIZE bytes in length. If dwarf2 line number generation is called
- for, emit a line statement appropriately. */
-
-void
-dwarf2_emit_insn (int size)
-{
- struct dwarf2_line_info loc;
-
- if (!dwarf2_loc_directive_seen && debug_type != DEBUG_DWARF2)
- return;
-
- dwarf2_where (&loc);
-
- dwarf2_gen_line_info (frag_now_fix () - size, &loc);
- dwarf2_consume_line_info ();
-}
-
-/* Called after the current line information has been either used with
- dwarf2_gen_line_info or saved with a machine instruction for later use.
- This resets the state of the line number information to reflect that
- it has been used. */
-
-void
-dwarf2_consume_line_info (void)
-{
- /* Unless we generate DWARF2 debugging information for each
- assembler line, we only emit one line symbol for one LOC. */
- dwarf2_loc_directive_seen = FALSE;
-
- current.flags &= ~(DWARF2_FLAG_BASIC_BLOCK
- | DWARF2_FLAG_PROLOGUE_END
- | DWARF2_FLAG_EPILOGUE_BEGIN);
-}
-
-/* Called for each (preferably code) label. If dwarf2_loc_mark_labels
- is enabled, emit a basic block marker. */
-
-void
-dwarf2_emit_label (symbolS *label)
-{
- struct dwarf2_line_info loc;
-
- if (!dwarf2_loc_mark_labels)
- return;
- if (S_GET_SEGMENT (label) != now_seg)
- return;
- if (!(bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE))
- return;
- if (files_in_use == 0 && debug_type != DEBUG_DWARF2)
- return;
-
- dwarf2_where (&loc);
-
- loc.flags |= DWARF2_FLAG_BASIC_BLOCK;
-
- dwarf2_gen_line_info_1 (label, &loc);
- dwarf2_consume_line_info ();
-}
-
-/* Get a .debug_line file number for FILENAME. If NUM is nonzero,
- allocate it on that file table slot, otherwise return the first
- empty one. */
-
-static unsigned int
-get_filenum (const char *filename, unsigned int num)
-{
- static unsigned int last_used, last_used_dir_len;
- const char *file;
- size_t dir_len;
- unsigned int i, dir;
-
- if (num == 0 && last_used)
- {
- if (! files[last_used].dir
- && strcmp (filename, files[last_used].filename) == 0)
- return last_used;
- if (files[last_used].dir
- && strncmp (filename, dirs[files[last_used].dir],
- last_used_dir_len) == 0
- && IS_DIR_SEPARATOR (filename [last_used_dir_len])
- && strcmp (filename + last_used_dir_len + 1,
- files[last_used].filename) == 0)
- return last_used;
- }
-
- file = lbasename (filename);
- /* Don't make empty string from / or A: from A:/ . */
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
- if (file <= filename + 3)
- file = filename;
-#else
- if (file == filename + 1)
- file = filename;
-#endif
- dir_len = file - filename;
-
- dir = 0;
- if (dir_len)
- {
- --dir_len;
- for (dir = 1; dir < dirs_in_use; ++dir)
- if (strncmp (filename, dirs[dir], dir_len) == 0
- && dirs[dir][dir_len] == '\0')
- break;
-
- if (dir >= dirs_in_use)
- {
- if (dir >= dirs_allocated)
- {
- dirs_allocated = dir + 32;
- dirs = (char **)
- xrealloc (dirs, (dir + 32) * sizeof (const char *));
- }
-
- dirs[dir] = xmalloc (dir_len + 1);
- memcpy (dirs[dir], filename, dir_len);
- dirs[dir][dir_len] = '\0';
- dirs_in_use = dir + 1;
- }
- }
-
- if (num == 0)
- {
- for (i = 1; i < files_in_use; ++i)
- if (files[i].dir == dir
- && files[i].filename
- && strcmp (file, files[i].filename) == 0)
- {
- last_used = i;
- last_used_dir_len = dir_len;
- return i;
- }
- }
- else
- i = num;
-
- if (i >= files_allocated)
- {
- unsigned int old = files_allocated;
-
- files_allocated = i + 32;
- files = (struct file_entry *)
- xrealloc (files, (i + 32) * sizeof (struct file_entry));
-
- memset (files + old, 0, (i + 32 - old) * sizeof (struct file_entry));
- }
-
- files[i].filename = num ? file : xstrdup (file);
- files[i].dir = dir;
- if (files_in_use < i + 1)
- files_in_use = i + 1;
- last_used = i;
- last_used_dir_len = dir_len;
-
- return i;
-}
-
-/* Handle two forms of .file directive:
- - Pass .file "source.c" to s_app_file
- - Handle .file 1 "source.c" by adding an entry to the DWARF-2 file table
-
- If an entry is added to the file table, return a pointer to the filename. */
-
-char *
-dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED)
-{
- offsetT num;
- char *filename;
- int filename_len;
-
- /* Continue to accept a bare string and pass it off. */
- SKIP_WHITESPACE ();
- if (*input_line_pointer == '"')
- {
- s_app_file (0);
- return NULL;
- }
-
- num = get_absolute_expression ();
- filename = demand_copy_C_string (&filename_len);
- if (filename == NULL)
- return NULL;
- demand_empty_rest_of_line ();
-
- if (num < 1)
- {
- as_bad (_("file number less than one"));
- return NULL;
- }
-
- /* A .file directive implies compiler generated debug information is
- being supplied. Turn off gas generated debug info. */
- debug_type = DEBUG_NONE;
-
- if (num < (int) files_in_use && files[num].filename != 0)
- {
- as_bad (_("file number %ld already allocated"), (long) num);
- return NULL;
- }
-
- get_filenum (filename, num);
-
- return filename;
-}
-
-void
-dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED)
-{
- offsetT filenum, line;
-
- /* If we see two .loc directives in a row, force the first one to be
- output now. */
- if (dwarf2_loc_directive_seen)
- dwarf2_emit_insn (0);
-
- filenum = get_absolute_expression ();
- SKIP_WHITESPACE ();
- line = get_absolute_expression ();
-
- if (filenum < 1)
- {
- as_bad (_("file number less than one"));
- return;
- }
- if (filenum >= (int) files_in_use || files[filenum].filename == 0)
- {
- as_bad (_("unassigned file number %ld"), (long) filenum);
- return;
- }
-
- current.filenum = filenum;
- current.line = line;
-
-#ifndef NO_LISTING
- if (listing)
- {
- if (files[filenum].dir)
- {
- size_t dir_len = strlen (dirs[files[filenum].dir]);
- size_t file_len = strlen (files[filenum].filename);
- char *cp = (char *) alloca (dir_len + 1 + file_len + 1);
-
- memcpy (cp, dirs[files[filenum].dir], dir_len);
- INSERT_DIR_SEPARATOR (cp, dir_len);
- memcpy (cp + dir_len + 1, files[filenum].filename, file_len);
- cp[dir_len + file_len + 1] = '\0';
- listing_source_file (cp);
- }
- else
- listing_source_file (files[filenum].filename);
- listing_source_line (line);
- }
-#endif
-
- SKIP_WHITESPACE ();
- if (ISDIGIT (*input_line_pointer))
- {
- current.column = get_absolute_expression ();
- SKIP_WHITESPACE ();
- }
-
- while (ISALPHA (*input_line_pointer))
- {
- char *p, c;
- offsetT value;
-
- p = input_line_pointer;
- c = get_symbol_end ();
-
- if (strcmp (p, "basic_block") == 0)
- {
- current.flags |= DWARF2_FLAG_BASIC_BLOCK;
- *input_line_pointer = c;
- }
- else if (strcmp (p, "prologue_end") == 0)
- {
- current.flags |= DWARF2_FLAG_PROLOGUE_END;
- *input_line_pointer = c;
- }
- else if (strcmp (p, "epilogue_begin") == 0)
- {
- current.flags |= DWARF2_FLAG_EPILOGUE_BEGIN;
- *input_line_pointer = c;
- }
- else if (strcmp (p, "is_stmt") == 0)
- {
- *input_line_pointer = c;
- value = get_absolute_expression ();
- if (value == 0)
- current.flags &= ~DWARF2_FLAG_IS_STMT;
- else if (value == 1)
- current.flags |= DWARF2_FLAG_IS_STMT;
- else
- {
- as_bad (_("is_stmt value not 0 or 1"));
- return;
- }
- }
- else if (strcmp (p, "isa") == 0)
- {
- *input_line_pointer = c;
- value = get_absolute_expression ();
- if (value >= 0)
- current.isa = value;
- else
- {
- as_bad (_("isa number less than zero"));
- return;
- }
- }
- else
- {
- as_bad (_("unknown .loc sub-directive `%s'"), p);
- *input_line_pointer = c;
- return;
- }
-
- SKIP_WHITESPACE ();
- }
-
- demand_empty_rest_of_line ();
- dwarf2_loc_directive_seen = TRUE;
- debug_type = DEBUG_NONE;
-}
-
-void
-dwarf2_directive_loc_mark_labels (int dummy ATTRIBUTE_UNUSED)
-{
- offsetT value = get_absolute_expression ();
-
- if (value != 0 && value != 1)
- {
- as_bad (_("expected 0 or 1"));
- ignore_rest_of_line ();
- }
- else
- {
- dwarf2_loc_mark_labels = value != 0;
- demand_empty_rest_of_line ();
- }
-}
-
-static struct frag *
-first_frag_for_seg (segT seg)
-{
- return seg_info (seg)->frchainP->frch_root;
-}
-
-static struct frag *
-last_frag_for_seg (segT seg)
-{
- frchainS *f = seg_info (seg)->frchainP;
-
- while (f->frch_next != NULL)
- f = f->frch_next;
-
- return f->frch_last;
-}
-
-/* Emit a single byte into the current segment. */
-
-static inline void
-out_byte (int byte)
-{
- FRAG_APPEND_1_CHAR (byte);
-}
-
-/* Emit a statement program opcode into the current segment. */
-
-static inline void
-out_opcode (int opc)
-{
- out_byte (opc);
-}
-
-/* Emit a two-byte word into the current segment. */
-
-static inline void
-out_two (int data)
-{
- md_number_to_chars (frag_more (2), data, 2);
-}
-
-/* Emit a four byte word into the current segment. */
-
-static inline void
-out_four (int data)
-{
- md_number_to_chars (frag_more (4), data, 4);
-}
-
-/* Emit an unsigned "little-endian base 128" number. */
-
-static void
-out_uleb128 (addressT value)
-{
- output_leb128 (frag_more (sizeof_leb128 (value, 0)), value, 0);
-}
-
-/* Emit a tuple for .debug_abbrev. */
-
-static inline void
-out_abbrev (int name, int form)
-{
- out_uleb128 (name);
- out_uleb128 (form);
-}
-
-/* Get the size of a fragment. */
-
-static offsetT
-get_frag_fix (fragS *frag, segT seg)
-{
- frchainS *fr;
-
- if (frag->fr_next)
- return frag->fr_fix;
-
- /* If a fragment is the last in the chain, special measures must be
- taken to find its size before relaxation, since it may be pending
- on some subsegment chain. */
- for (fr = seg_info (seg)->frchainP; fr; fr = fr->frch_next)
- if (fr->frch_last == frag)
- return (char *) obstack_next_free (&fr->frch_obstack) - frag->fr_literal;
-
- abort ();
-}
-
-/* Set an absolute address (may result in a relocation entry). */
-
-static void
-out_set_addr (symbolS *sym)
-{
- expressionS expr;
-
- out_opcode (DW_LNS_extended_op);
- out_uleb128 (sizeof_address + 1);
-
- out_opcode (DW_LNE_set_address);
- expr.X_op = O_symbol;
- expr.X_add_symbol = sym;
- expr.X_add_number = 0;
- emit_expr (&expr, sizeof_address);
-}
-
-#if DWARF2_LINE_MIN_INSN_LENGTH > 1
-static void scale_addr_delta (addressT *);
-
-static void
-scale_addr_delta (addressT *addr_delta)
-{
- static int printed_this = 0;
- if (*addr_delta % DWARF2_LINE_MIN_INSN_LENGTH != 0)
- {
- if (!printed_this)
- as_bad("unaligned opcodes detected in executable segment");
- printed_this = 1;
- }
- *addr_delta /= DWARF2_LINE_MIN_INSN_LENGTH;
-}
-#else
-#define scale_addr_delta(A)
-#endif
-
-/* Encode a pair of line and address skips as efficiently as possible.
- Note that the line skip is signed, whereas the address skip is unsigned.
-
- The following two routines *must* be kept in sync. This is
- enforced by making emit_inc_line_addr abort if we do not emit
- exactly the expected number of bytes. */
-
-static int
-size_inc_line_addr (int line_delta, addressT addr_delta)
-{
- unsigned int tmp, opcode;
- int len = 0;
-
- /* Scale the address delta by the minimum instruction length. */
- scale_addr_delta (&addr_delta);
-
- /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence.
- We cannot use special opcodes here, since we want the end_sequence
- to emit the matrix entry. */
- if (line_delta == INT_MAX)
- {
- if (addr_delta == MAX_SPECIAL_ADDR_DELTA)
- len = 1;
- else
- len = 1 + sizeof_leb128 (addr_delta, 0);
- return len + 3;
- }
-
- /* Bias the line delta by the base. */
- tmp = line_delta - DWARF2_LINE_BASE;
-
- /* If the line increment is out of range of a special opcode, we
- must encode it with DW_LNS_advance_line. */
- if (tmp >= DWARF2_LINE_RANGE)
- {
- len = 1 + sizeof_leb128 (line_delta, 1);
- line_delta = 0;
- tmp = 0 - DWARF2_LINE_BASE;
- }
-
- /* Bias the opcode by the special opcode base. */
- tmp += DWARF2_LINE_OPCODE_BASE;
-
- /* Avoid overflow when addr_delta is large. */
- if (addr_delta < 256 + MAX_SPECIAL_ADDR_DELTA)
- {
- /* Try using a special opcode. */
- opcode = tmp + addr_delta * DWARF2_LINE_RANGE;
- if (opcode <= 255)
- return len + 1;
-
- /* Try using DW_LNS_const_add_pc followed by special op. */
- opcode = tmp + (addr_delta - MAX_SPECIAL_ADDR_DELTA) * DWARF2_LINE_RANGE;
- if (opcode <= 255)
- return len + 2;
- }
-
- /* Otherwise use DW_LNS_advance_pc. */
- len += 1 + sizeof_leb128 (addr_delta, 0);
-
- /* DW_LNS_copy or special opcode. */
- len += 1;
-
- return len;
-}
-
-static void
-emit_inc_line_addr (int line_delta, addressT addr_delta, char *p, int len)
-{
- unsigned int tmp, opcode;
- int need_copy = 0;
- char *end = p + len;
-
- /* Line number sequences cannot go backward in addresses. This means
- we've incorrectly ordered the statements in the sequence. */
- assert ((offsetT) addr_delta >= 0);
-
- /* Scale the address delta by the minimum instruction length. */
- scale_addr_delta (&addr_delta);
-
- /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence.
- We cannot use special opcodes here, since we want the end_sequence
- to emit the matrix entry. */
- if (line_delta == INT_MAX)
- {
- if (addr_delta == MAX_SPECIAL_ADDR_DELTA)
- *p++ = DW_LNS_const_add_pc;
- else
- {
- *p++ = DW_LNS_advance_pc;
- p += output_leb128 (p, addr_delta, 0);
- }
-
- *p++ = DW_LNS_extended_op;
- *p++ = 1;
- *p++ = DW_LNE_end_sequence;
- goto done;
- }
-
- /* Bias the line delta by the base. */
- tmp = line_delta - DWARF2_LINE_BASE;
-
- /* If the line increment is out of range of a special opcode, we
- must encode it with DW_LNS_advance_line. */
- if (tmp >= DWARF2_LINE_RANGE)
- {
- *p++ = DW_LNS_advance_line;
- p += output_leb128 (p, line_delta, 1);
-
- line_delta = 0;
- tmp = 0 - DWARF2_LINE_BASE;
- need_copy = 1;
- }
-
- /* Prettier, I think, to use DW_LNS_copy instead of a "line +0, addr +0"
- special opcode. */
- if (line_delta == 0 && addr_delta == 0)
- {
- *p++ = DW_LNS_copy;
- goto done;
- }
-
- /* Bias the opcode by the special opcode base. */
- tmp += DWARF2_LINE_OPCODE_BASE;
-
- /* Avoid overflow when addr_delta is large. */
- if (addr_delta < 256 + MAX_SPECIAL_ADDR_DELTA)
- {
- /* Try using a special opcode. */
- opcode = tmp + addr_delta * DWARF2_LINE_RANGE;
- if (opcode <= 255)
- {
- *p++ = opcode;
- goto done;
- }
-
- /* Try using DW_LNS_const_add_pc followed by special op. */
- opcode = tmp + (addr_delta - MAX_SPECIAL_ADDR_DELTA) * DWARF2_LINE_RANGE;
- if (opcode <= 255)
- {
- *p++ = DW_LNS_const_add_pc;
- *p++ = opcode;
- goto done;
- }
- }
-
- /* Otherwise use DW_LNS_advance_pc. */
- *p++ = DW_LNS_advance_pc;
- p += output_leb128 (p, addr_delta, 0);
-
- if (need_copy)
- *p++ = DW_LNS_copy;
- else
- *p++ = tmp;
-
- done:
- assert (p == end);
-}
-
-/* Handy routine to combine calls to the above two routines. */
-
-static void
-out_inc_line_addr (int line_delta, addressT addr_delta)
-{
- int len = size_inc_line_addr (line_delta, addr_delta);
- emit_inc_line_addr (line_delta, addr_delta, frag_more (len), len);
-}
-
-/* Write out an alternative form of line and address skips using
- DW_LNS_fixed_advance_pc opcodes. This uses more space than the default
- line and address information, but it is required if linker relaxation
- could change the code offsets. The following two routines *must* be
- kept in sync. */
-
-static int
-size_fixed_inc_line_addr (int line_delta, addressT addr_delta)
-{
- int len = 0;
-
- /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence. */
- if (line_delta != INT_MAX)
- len = 1 + sizeof_leb128 (line_delta, 1);
-
- if (addr_delta > 50000)
- {
- /* DW_LNS_extended_op */
- len += 1 + sizeof_leb128 (sizeof_address + 1, 0);
- /* DW_LNE_set_address */
- len += 1 + sizeof_address;
- }
- else
- /* DW_LNS_fixed_advance_pc */
- len += 3;
-
- if (line_delta == INT_MAX)
- /* DW_LNS_extended_op + DW_LNE_end_sequence */
- len += 3;
- else
- /* DW_LNS_copy */
- len += 1;
-
- return len;
-}
-
-static void
-emit_fixed_inc_line_addr (int line_delta, addressT addr_delta, fragS *frag,
- char *p, int len)
-{
- expressionS *exp;
- segT line_seg;
- char *end = p + len;
-
- /* Line number sequences cannot go backward in addresses. This means
- we've incorrectly ordered the statements in the sequence. */
- assert ((offsetT) addr_delta >= 0);
-
- /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence. */
- if (line_delta != INT_MAX)
- {
- *p++ = DW_LNS_advance_line;
- p += output_leb128 (p, line_delta, 1);
- }
-
- exp = symbol_get_value_expression (frag->fr_symbol);
- line_seg = subseg_get (".debug_line", 0);
-
- /* The DW_LNS_fixed_advance_pc opcode has a 2-byte operand so it can
- advance the address by at most 64K. Linker relaxation (without
- which this function would not be used) could change the operand by
- an unknown amount. If the address increment is getting close to
- the limit, just reset the address. */
- if (addr_delta > 50000)
- {
- symbolS *to_sym;
- expressionS expr;
-
- assert (exp->X_op = O_subtract);
- to_sym = exp->X_add_symbol;
-
- *p++ = DW_LNS_extended_op;
- p += output_leb128 (p, sizeof_address + 1, 0);
- *p++ = DW_LNE_set_address;
- expr.X_op = O_symbol;
- expr.X_add_symbol = to_sym;
- expr.X_add_number = 0;
- subseg_change (line_seg, 0);
- emit_expr_fix (&expr, sizeof_address, frag, p);
- p += sizeof_address;
- }
- else
- {
- *p++ = DW_LNS_fixed_advance_pc;
- subseg_change (line_seg, 0);
- emit_expr_fix (exp, 2, frag, p);
- p += 2;
- }
-
- if (line_delta == INT_MAX)
- {
- *p++ = DW_LNS_extended_op;
- *p++ = 1;
- *p++ = DW_LNE_end_sequence;
- }
- else
- *p++ = DW_LNS_copy;
-
- assert (p == end);
-}
-
-/* Generate a variant frag that we can use to relax address/line
- increments between fragments of the target segment. */
-
-static void
-relax_inc_line_addr (int line_delta, symbolS *to_sym, symbolS *from_sym)
-{
- expressionS expr;
- int max_chars;
-
- expr.X_op = O_subtract;
- expr.X_add_symbol = to_sym;
- expr.X_op_symbol = from_sym;
- expr.X_add_number = 0;
-
- /* The maximum size of the frag is the line delta with a maximum
- sized address delta. */
- if (DWARF2_USE_FIXED_ADVANCE_PC)
- max_chars = size_fixed_inc_line_addr (line_delta,
- -DWARF2_LINE_MIN_INSN_LENGTH);
- else
- max_chars = size_inc_line_addr (line_delta, -DWARF2_LINE_MIN_INSN_LENGTH);
-
- frag_var (rs_dwarf2dbg, max_chars, max_chars, 1,
- make_expr_symbol (&expr), line_delta, NULL);
-}
-
-/* The function estimates the size of a rs_dwarf2dbg variant frag
- based on the current values of the symbols. It is called before
- the relaxation loop. We set fr_subtype to the expected length. */
-
-int
-dwarf2dbg_estimate_size_before_relax (fragS *frag)
-{
- offsetT addr_delta;
- int size;
-
- addr_delta = resolve_symbol_value (frag->fr_symbol);
- if (DWARF2_USE_FIXED_ADVANCE_PC)
- size = size_fixed_inc_line_addr (frag->fr_offset, addr_delta);
- else
- size = size_inc_line_addr (frag->fr_offset, addr_delta);
-
- frag->fr_subtype = size;
-
- return size;
-}
-
-/* This function relaxes a rs_dwarf2dbg variant frag based on the
- current values of the symbols. fr_subtype is the current length
- of the frag. This returns the change in frag length. */
-
-int
-dwarf2dbg_relax_frag (fragS *frag)
-{
- int old_size, new_size;
-
- old_size = frag->fr_subtype;
- new_size = dwarf2dbg_estimate_size_before_relax (frag);
-
- return new_size - old_size;
-}
-
-/* This function converts a rs_dwarf2dbg variant frag into a normal
- fill frag. This is called after all relaxation has been done.
- fr_subtype will be the desired length of the frag. */
-
-void
-dwarf2dbg_convert_frag (fragS *frag)
-{
- offsetT addr_diff;
-
- addr_diff = resolve_symbol_value (frag->fr_symbol);
-
- /* fr_var carries the max_chars that we created the fragment with.
- fr_subtype carries the current expected length. We must, of
- course, have allocated enough memory earlier. */
- assert (frag->fr_var >= (int) frag->fr_subtype);
-
- if (DWARF2_USE_FIXED_ADVANCE_PC)
- emit_fixed_inc_line_addr (frag->fr_offset, addr_diff, frag,
- frag->fr_literal + frag->fr_fix,
- frag->fr_subtype);
- else
- emit_inc_line_addr (frag->fr_offset, addr_diff,
- frag->fr_literal + frag->fr_fix, frag->fr_subtype);
-
- frag->fr_fix += frag->fr_subtype;
- frag->fr_type = rs_fill;
- frag->fr_var = 0;
- frag->fr_offset = 0;
-}
-
-/* Generate .debug_line content for the chain of line number entries
- beginning at E, for segment SEG. */
-
-static void
-process_entries (segT seg, struct line_entry *e)
-{
- unsigned filenum = 1;
- unsigned line = 1;
- unsigned column = 0;
- unsigned isa = 0;
- unsigned flags = DWARF2_LINE_DEFAULT_IS_STMT ? DWARF2_FLAG_IS_STMT : 0;
- fragS *last_frag = NULL, *frag;
- addressT last_frag_ofs = 0, frag_ofs;
- symbolS *last_lab = NULL, *lab;
- struct line_entry *next;
-
- do
- {
- int line_delta;
-
- if (filenum != e->loc.filenum)
- {
- filenum = e->loc.filenum;
- out_opcode (DW_LNS_set_file);
- out_uleb128 (filenum);
- }
-
- if (column != e->loc.column)
- {
- column = e->loc.column;
- out_opcode (DW_LNS_set_column);
- out_uleb128 (column);
- }
-
- if (isa != e->loc.isa)
- {
- isa = e->loc.isa;
- out_opcode (DW_LNS_set_isa);
- out_uleb128 (isa);
- }
-
- if ((e->loc.flags ^ flags) & DWARF2_FLAG_IS_STMT)
- {
- flags = e->loc.flags;
- out_opcode (DW_LNS_negate_stmt);
- }
-
- if (e->loc.flags & DWARF2_FLAG_BASIC_BLOCK)
- out_opcode (DW_LNS_set_basic_block);
-
- if (e->loc.flags & DWARF2_FLAG_PROLOGUE_END)
- out_opcode (DW_LNS_set_prologue_end);
-
- if (e->loc.flags & DWARF2_FLAG_EPILOGUE_BEGIN)
- out_opcode (DW_LNS_set_epilogue_begin);
-
- /* Don't try to optimize away redundant entries; gdb wants two
- entries for a function where the code starts on the same line as
- the {, and there's no way to identify that case here. Trust gcc
- to optimize appropriately. */
- line_delta = e->loc.line - line;
- lab = e->label;
- frag = symbol_get_frag (lab);
- frag_ofs = S_GET_VALUE (lab);
-
- if (last_frag == NULL)
- {
- out_set_addr (lab);
- out_inc_line_addr (line_delta, 0);
- }
- else if (frag == last_frag && ! DWARF2_USE_FIXED_ADVANCE_PC)
- out_inc_line_addr (line_delta, frag_ofs - last_frag_ofs);
- else
- relax_inc_line_addr (line_delta, lab, last_lab);
-
- line = e->loc.line;
- last_lab = lab;
- last_frag = frag;
- last_frag_ofs = frag_ofs;
-
- next = e->next;
- free (e);
- e = next;
- }
- while (e);
-
- /* Emit a DW_LNE_end_sequence for the end of the section. */
- frag = last_frag_for_seg (seg);
- frag_ofs = get_frag_fix (frag, seg);
- if (frag == last_frag && ! DWARF2_USE_FIXED_ADVANCE_PC)
- out_inc_line_addr (INT_MAX, frag_ofs - last_frag_ofs);
- else
- {
- lab = symbol_temp_new (seg, frag_ofs, frag);
- relax_inc_line_addr (INT_MAX, lab, last_lab);
- }
-}
-
-/* Emit the directory and file tables for .debug_line. */
-
-static void
-out_file_list (void)
-{
- size_t size;
- const char *dir;
- char *cp;
- unsigned int i;
-
- /* Emit directory list. */
- for (i = 1; i < dirs_in_use; ++i)
- {
- dir = remap_debug_filename (dirs[i]);
- size = strlen (dir) + 1;
- cp = frag_more (size);
- memcpy (cp, dir, size);
- }
- /* Terminate it. */
- out_byte ('\0');
-
- for (i = 1; i < files_in_use; ++i)
- {
- if (files[i].filename == NULL)
- {
- as_bad (_("unassigned file number %ld"), (long) i);
- /* Prevent a crash later, particularly for file 1. */
- files[i].filename = "";
- continue;
- }
-
- size = strlen (files[i].filename) + 1;
- cp = frag_more (size);
- memcpy (cp, files[i].filename, size);
-
- out_uleb128 (files[i].dir); /* directory number */
- out_uleb128 (0); /* last modification timestamp */
- out_uleb128 (0); /* filesize */
- }
-
- /* Terminate filename list. */
- out_byte (0);
-}
-
-/* Switch to SEC and output a header length field. Return the size of
- offsets used in SEC. The caller must set EXPR->X_add_symbol value
- to the end of the section. */
-
-static int
-out_header (asection *sec, expressionS *expr)
-{
- symbolS *start_sym;
- symbolS *end_sym;
-
- subseg_set (sec, 0);
- start_sym = symbol_temp_new_now ();;
- end_sym = symbol_temp_make ();
-
- /* Total length of the information. */
- expr->X_op = O_subtract;
- expr->X_add_symbol = end_sym;
- expr->X_op_symbol = start_sym;
-
- switch (DWARF2_FORMAT (sec))
- {
- case dwarf2_format_32bit:
- expr->X_add_number = -4;
- emit_expr (expr, 4);
- return 4;
-
- case dwarf2_format_64bit:
- expr->X_add_number = -12;
- out_four (-1);
- emit_expr (expr, 8);
- return 8;
-
- case dwarf2_format_64bit_irix:
- expr->X_add_number = -8;
- emit_expr (expr, 8);
- return 8;
- }
-
- as_fatal (_("internal error: unknown dwarf2 format"));
- return 0;
-}
-
-/* Emit the collected .debug_line data. */
-
-static void
-out_debug_line (segT line_seg)
-{
- expressionS expr;
- symbolS *prologue_end;
- symbolS *line_end;
- struct line_seg *s;
- int sizeof_offset;
-
- sizeof_offset = out_header (line_seg, &expr);
- line_end = expr.X_add_symbol;
-
- /* Version. */
- out_two (2);
-
- /* Length of the prologue following this length. */
- prologue_end = symbol_temp_make ();
- expr.X_add_symbol = prologue_end;
- expr.X_add_number = - (4 + 2 + 4);
- emit_expr (&expr, sizeof_offset);
-
- /* Parameters of the state machine. */
- out_byte (DWARF2_LINE_MIN_INSN_LENGTH);
- out_byte (DWARF2_LINE_DEFAULT_IS_STMT);
- out_byte (DWARF2_LINE_BASE);
- out_byte (DWARF2_LINE_RANGE);
- out_byte (DWARF2_LINE_OPCODE_BASE);
-
- /* Standard opcode lengths. */
- out_byte (0); /* DW_LNS_copy */
- out_byte (1); /* DW_LNS_advance_pc */
- out_byte (1); /* DW_LNS_advance_line */
- out_byte (1); /* DW_LNS_set_file */
- out_byte (1); /* DW_LNS_set_column */
- out_byte (0); /* DW_LNS_negate_stmt */
- out_byte (0); /* DW_LNS_set_basic_block */
- out_byte (0); /* DW_LNS_const_add_pc */
- out_byte (1); /* DW_LNS_fixed_advance_pc */
- out_byte (0); /* DW_LNS_set_prologue_end */
- out_byte (0); /* DW_LNS_set_epilogue_begin */
- out_byte (1); /* DW_LNS_set_isa */
-
- out_file_list ();
-
- symbol_set_value_now (prologue_end);
-
- /* For each section, emit a statement program. */
- for (s = all_segs; s; s = s->next)
- process_entries (s->seg, s->head->head);
-
- symbol_set_value_now (line_end);
-}
-
-static void
-out_debug_ranges (segT ranges_seg)
-{
- unsigned int addr_size = sizeof_address;
- struct line_seg *s;
- expressionS expr;
- unsigned int i;
-
- subseg_set (ranges_seg, 0);
-
- /* Base Address Entry. */
- for (i = 0; i < addr_size; i++)
- out_byte (0xff);
- for (i = 0; i < addr_size; i++)
- out_byte (0);
-
- /* Range List Entry. */
- for (s = all_segs; s; s = s->next)
- {
- fragS *frag;
- symbolS *beg, *end;
-
- frag = first_frag_for_seg (s->seg);
- beg = symbol_temp_new (s->seg, 0, frag);
- s->text_start = beg;
-
- frag = last_frag_for_seg (s->seg);
- end = symbol_temp_new (s->seg, get_frag_fix (frag, s->seg), frag);
- s->text_end = end;
-
- expr.X_op = O_symbol;
- expr.X_add_symbol = beg;
- expr.X_add_number = 0;
- emit_expr (&expr, addr_size);
-
- expr.X_op = O_symbol;
- expr.X_add_symbol = end;
- expr.X_add_number = 0;
- emit_expr (&expr, addr_size);
- }
-
- /* End of Range Entry. */
- for (i = 0; i < addr_size; i++)
- out_byte (0);
- for (i = 0; i < addr_size; i++)
- out_byte (0);
-}
-
-/* Emit data for .debug_aranges. */
-
-static void
-out_debug_aranges (segT aranges_seg, segT info_seg)
-{
- unsigned int addr_size = sizeof_address;
- struct line_seg *s;
- expressionS expr;
- symbolS *aranges_end;
- char *p;
- int sizeof_offset;
-
- sizeof_offset = out_header (aranges_seg, &expr);
- aranges_end = expr.X_add_symbol;
-
- /* Version. */
- out_two (2);
-
- /* Offset to .debug_info. */
- TC_DWARF2_EMIT_OFFSET (section_symbol (info_seg), sizeof_offset);
-
- /* Size of an address (offset portion). */
- out_byte (addr_size);
-
- /* Size of a segment descriptor. */
- out_byte (0);
-
- /* Align the header. */
- frag_align (ffs (2 * addr_size) - 1, 0, 0);
-
- for (s = all_segs; s; s = s->next)
- {
- fragS *frag;
- symbolS *beg, *end;
-
- frag = first_frag_for_seg (s->seg);
- beg = symbol_temp_new (s->seg, 0, frag);
- s->text_start = beg;
-
- frag = last_frag_for_seg (s->seg);
- end = symbol_temp_new (s->seg, get_frag_fix (frag, s->seg), frag);
- s->text_end = end;
-
- expr.X_op = O_symbol;
- expr.X_add_symbol = beg;
- expr.X_add_number = 0;
- emit_expr (&expr, addr_size);
-
- expr.X_op = O_subtract;
- expr.X_add_symbol = end;
- expr.X_op_symbol = beg;
- expr.X_add_number = 0;
- emit_expr (&expr, addr_size);
- }
-
- p = frag_more (2 * addr_size);
- md_number_to_chars (p, 0, addr_size);
- md_number_to_chars (p + addr_size, 0, addr_size);
-
- symbol_set_value_now (aranges_end);
-}
-
-/* Emit data for .debug_abbrev. Note that this must be kept in
- sync with out_debug_info below. */
-
-static void
-out_debug_abbrev (segT abbrev_seg,
- segT info_seg ATTRIBUTE_UNUSED,
- segT line_seg ATTRIBUTE_UNUSED)
-{
- subseg_set (abbrev_seg, 0);
-
- out_uleb128 (1);
- out_uleb128 (DW_TAG_compile_unit);
- out_byte (DW_CHILDREN_no);
- if (DWARF2_FORMAT (line_seg) == dwarf2_format_32bit)
- out_abbrev (DW_AT_stmt_list, DW_FORM_data4);
- else
- out_abbrev (DW_AT_stmt_list, DW_FORM_data8);
- if (all_segs->next == NULL)
- {
- out_abbrev (DW_AT_low_pc, DW_FORM_addr);
- out_abbrev (DW_AT_high_pc, DW_FORM_addr);
- }
- else
- {
- if (DWARF2_FORMAT (info_seg) == dwarf2_format_32bit)
- out_abbrev (DW_AT_ranges, DW_FORM_data4);
- else
- out_abbrev (DW_AT_ranges, DW_FORM_data8);
- }
- out_abbrev (DW_AT_name, DW_FORM_string);
- out_abbrev (DW_AT_comp_dir, DW_FORM_string);
- out_abbrev (DW_AT_producer, DW_FORM_string);
- out_abbrev (DW_AT_language, DW_FORM_data2);
- out_abbrev (0, 0);
-
- /* Terminate the abbreviations for this compilation unit. */
- out_byte (0);
-}
-
-/* Emit a description of this compilation unit for .debug_info. */
-
-static void
-out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg)
-{
- char producer[128];
- const char *comp_dir;
- const char *dirname;
- expressionS expr;
- symbolS *info_end;
- char *p;
- int len;
- int sizeof_offset;
-
- sizeof_offset = out_header (info_seg, &expr);
- info_end = expr.X_add_symbol;
-
- /* DWARF version. */
- out_two (2);
-
- /* .debug_abbrev offset */
- TC_DWARF2_EMIT_OFFSET (section_symbol (abbrev_seg), sizeof_offset);
-
- /* Target address size. */
- out_byte (sizeof_address);
-
- /* DW_TAG_compile_unit DIE abbrev */
- out_uleb128 (1);
-
- /* DW_AT_stmt_list */
- TC_DWARF2_EMIT_OFFSET (section_symbol (line_seg),
- (DWARF2_FORMAT (line_seg) == dwarf2_format_32bit
- ? 4 : 8));
-
- /* These two attributes are emitted if all of the code is contiguous. */
- if (all_segs->next == NULL)
- {
- /* DW_AT_low_pc */
- expr.X_op = O_symbol;
- expr.X_add_symbol = all_segs->text_start;
- expr.X_add_number = 0;
- emit_expr (&expr, sizeof_address);
-
- /* DW_AT_high_pc */
- expr.X_op = O_symbol;
- expr.X_add_symbol = all_segs->text_end;
- expr.X_add_number = 0;
- emit_expr (&expr, sizeof_address);
- }
- else
- {
- /* This attribute is emitted if the code is disjoint. */
- /* DW_AT_ranges. */
- TC_DWARF2_EMIT_OFFSET (section_symbol (ranges_seg), sizeof_offset);
- }
-
- /* DW_AT_name. We don't have the actual file name that was present
- on the command line, so assume files[1] is the main input file.
- We're not supposed to get called unless at least one line number
- entry was emitted, so this should always be defined. */
- if (files_in_use == 0)
- abort ();
- if (files[1].dir)
- {
- dirname = remap_debug_filename (dirs[files[1].dir]);
- len = strlen (dirname);
- p = frag_more (len + 1);
- memcpy (p, dirname, len);
- INSERT_DIR_SEPARATOR (p, len);
- }
- len = strlen (files[1].filename) + 1;
- p = frag_more (len);
- memcpy (p, files[1].filename, len);
-
- /* DW_AT_comp_dir */
- comp_dir = remap_debug_filename (getpwd ());
- len = strlen (comp_dir) + 1;
- p = frag_more (len);
- memcpy (p, comp_dir, len);
-
- /* DW_AT_producer */
- sprintf (producer, "GNU AS %s", VERSION);
- len = strlen (producer) + 1;
- p = frag_more (len);
- memcpy (p, producer, len);
-
- /* DW_AT_language. Yes, this is probably not really MIPS, but the
- dwarf2 draft has no standard code for assembler. */
- out_two (DW_LANG_Mips_Assembler);
-
- symbol_set_value_now (info_end);
-}
-
-/* Finish the dwarf2 debug sections. We emit .debug.line if there
- were any .file/.loc directives, or --gdwarf2 was given, or if the
- file has a non-empty .debug_info section. If we emit .debug_line,
- and the .debug_info section is empty, we also emit .debug_info,
- .debug_aranges and .debug_abbrev. ALL_SEGS will be non-null if
- there were any .file/.loc directives, or --gdwarf2 was given and
- there were any located instructions emitted. */
-
-void
-dwarf2_finish (void)
-{
- segT line_seg;
- struct line_seg *s;
- segT info_seg;
- int emit_other_sections = 0;
-
- info_seg = bfd_get_section_by_name (stdoutput, ".debug_info");
- emit_other_sections = info_seg == NULL || !seg_not_empty_p (info_seg);
-
- if (!all_segs && emit_other_sections)
- /* There is no line information and no non-empty .debug_info
- section. */
- return;
-
- /* Calculate the size of an address for the target machine. */
- sizeof_address = DWARF2_ADDR_SIZE (stdoutput);
-
- /* Create and switch to the line number section. */
- line_seg = subseg_new (".debug_line", 0);
- bfd_set_section_flags (stdoutput, line_seg, SEC_READONLY | SEC_DEBUGGING);
-
- /* For each subsection, chain the debug entries together. */
- for (s = all_segs; s; s = s->next)
- {
- struct line_subseg *ss = s->head;
- struct line_entry **ptail = ss->ptail;
-
- while ((ss = ss->next) != NULL)
- {
- *ptail = ss->head;
- ptail = ss->ptail;
- }
- }
-
- out_debug_line (line_seg);
-
- /* If this is assembler generated line info, and there is no
- debug_info already, we need .debug_info and .debug_abbrev
- sections as well. */
- if (emit_other_sections)
- {
- segT abbrev_seg;
- segT aranges_seg;
- segT ranges_seg;
-
- assert (all_segs);
-
- info_seg = subseg_new (".debug_info", 0);
- abbrev_seg = subseg_new (".debug_abbrev", 0);
- aranges_seg = subseg_new (".debug_aranges", 0);
-
- bfd_set_section_flags (stdoutput, info_seg,
- SEC_READONLY | SEC_DEBUGGING);
- bfd_set_section_flags (stdoutput, abbrev_seg,
- SEC_READONLY | SEC_DEBUGGING);
- bfd_set_section_flags (stdoutput, aranges_seg,
- SEC_READONLY | SEC_DEBUGGING);
-
- record_alignment (aranges_seg, ffs (2 * sizeof_address) - 1);
-
- if (all_segs->next == NULL)
- ranges_seg = NULL;
- else
- {
- ranges_seg = subseg_new (".debug_ranges", 0);
- bfd_set_section_flags (stdoutput, ranges_seg,
- SEC_READONLY | SEC_DEBUGGING);
- record_alignment (ranges_seg, ffs (2 * sizeof_address) - 1);
- out_debug_ranges (ranges_seg);
- }
-
- out_debug_aranges (aranges_seg, info_seg);
- out_debug_abbrev (abbrev_seg, info_seg, line_seg);
- out_debug_info (info_seg, abbrev_seg, line_seg, ranges_seg);
- }
-}
diff --git a/gas/messages.c b/gas/messages.c
deleted file mode 100644
index 69fcf78743f..00000000000
--- a/gas/messages.c
+++ /dev/null
@@ -1,537 +0,0 @@
-/* messages.c - error reporter -
- Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
- 2003, 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
- This file is part of GAS, the GNU Assembler.
-
- GAS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GAS 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 GAS; see the file COPYING. If not, write to the Free
- Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-#include "as.h"
-
-static void identify (char *);
-static void as_show_where (void);
-static void as_warn_internal (char *, unsigned int, char *);
-static void as_bad_internal (char *, unsigned int, char *);
-
-/* Despite the rest of the comments in this file, (FIXME-SOON),
- here is the current scheme for error messages etc:
-
- as_fatal() is used when gas is quite confused and
- continuing the assembly is pointless. In this case we
- exit immediately with error status.
-
- as_bad() is used to mark errors that result in what we
- presume to be a useless object file. Say, we ignored
- something that might have been vital. If we see any of
- these, assembly will continue to the end of the source,
- no object file will be produced, and we will terminate
- with error status. The new option, -Z, tells us to
- produce an object file anyway but we still exit with
- error status. The assumption here is that you don't want
- this object file but we could be wrong.
-
- as_warn() is used when we have an error from which we
- have a plausible error recovery. eg, masking the top
- bits of a constant that is longer than will fit in the
- destination. In this case we will continue to assemble
- the source, although we may have made a bad assumption,
- and we will produce an object file and return normal exit
- status (ie, no error). The new option -X tells us to
- treat all as_warn() errors as as_bad() errors. That is,
- no object file will be produced and we will exit with
- error status. The idea here is that we don't kill an
- entire make because of an error that we knew how to
- correct. On the other hand, sometimes you might want to
- stop the make at these points.
-
- as_tsktsk() is used when we see a minor error for which
- our error recovery action is almost certainly correct.
- In this case, we print a message and then assembly
- continues as though no error occurred. */
-
-static void
-identify (char *file)
-{
- static int identified;
-
- if (identified)
- return;
- identified++;
-
- if (!file)
- {
- unsigned int x;
- as_where (&file, &x);
- }
-
- if (file)
- fprintf (stderr, "%s: ", file);
- fprintf (stderr, _("Assembler messages:\n"));
-}
-
-/* The number of warnings issued. */
-static int warning_count;
-
-int
-had_warnings (void)
-{
- return warning_count;
-}
-
-/* Nonzero if we've hit a 'bad error', and should not write an obj file,
- and exit with a nonzero error code. */
-
-static int error_count;
-
-int
-had_errors (void)
-{
- return error_count;
-}
-
-/* Print the current location to stderr. */
-
-static void
-as_show_where (void)
-{
- char *file;
- unsigned int line;
-
- as_where (&file, &line);
- identify (file);
- if (file)
- fprintf (stderr, "%s:%u: ", file, line);
-}
-
-/* Send to stderr a string as a warning, and locate warning
- in input file(s).
- Please only use this for when we have some recovery action.
- Please explain in string (which may have '\n's) what recovery was
- done. */
-
-#ifdef USE_STDARG
-void
-as_tsktsk (const char *format, ...)
-{
- va_list args;
-
- as_show_where ();
- va_start (args, format);
- vfprintf (stderr, format, args);
- va_end (args);
- (void) putc ('\n', stderr);
-}
-#else
-void
-as_tsktsk (format, va_alist)
- const char *format;
- va_dcl
-{
- va_list args;
-
- as_show_where ();
- va_start (args);
- vfprintf (stderr, format, args);
- va_end (args);
- (void) putc ('\n', stderr);
-}
-#endif /* not NO_STDARG */
-
-/* The common portion of as_warn and as_warn_where. */
-
-static void
-as_warn_internal (char *file, unsigned int line, char *buffer)
-{
- ++warning_count;
-
- if (file == NULL)
- as_where (&file, &line);
-
- identify (file);
- if (file)
- fprintf (stderr, "%s:%u: ", file, line);
- fprintf (stderr, _("Warning: "));
- fputs (buffer, stderr);
- (void) putc ('\n', stderr);
-#ifndef NO_LISTING
- listing_warning (buffer);
-#endif
-}
-
-/* Send to stderr a string as a warning, and locate warning
- in input file(s).
- Please only use this for when we have some recovery action.
- Please explain in string (which may have '\n's) what recovery was
- done. */
-
-#ifdef USE_STDARG
-void
-as_warn (const char *format, ...)
-{
- va_list args;
- char buffer[2000];
-
- if (!flag_no_warnings)
- {
- va_start (args, format);
- vsnprintf (buffer, sizeof (buffer), format, args);
- va_end (args);
- as_warn_internal ((char *) NULL, 0, buffer);
- }
-}
-#else
-void
-as_warn (format, va_alist)
- const char *format;
- va_dcl
-{
- va_list args;
- char buffer[2000];
-
- if (!flag_no_warnings)
- {
- va_start (args);
- vsnprintf (buffer, sizeof (buffer), format, args);
- va_end (args);
- as_warn_internal ((char *) NULL, 0, buffer);
- }
-}
-#endif /* not NO_STDARG */
-
-/* Like as_bad but the file name and line number are passed in.
- Unfortunately, we have to repeat the function in order to handle
- the varargs correctly and portably. */
-
-#ifdef USE_STDARG
-void
-as_warn_where (char *file, unsigned int line, const char *format, ...)
-{
- va_list args;
- char buffer[2000];
-
- if (!flag_no_warnings)
- {
- va_start (args, format);
- vsnprintf (buffer, sizeof (buffer), format, args);
- va_end (args);
- as_warn_internal (file, line, buffer);
- }
-}
-#else
-void
-as_warn_where (file, line, format, va_alist)
- char *file;
- unsigned int line;
- const char *format;
- va_dcl
-{
- va_list args;
- char buffer[2000];
-
- if (!flag_no_warnings)
- {
- va_start (args);
- vsnprintf (buffer, sizeof (buffer), format, args);
- va_end (args);
- as_warn_internal (file, line, buffer);
- }
-}
-#endif /* not NO_STDARG */
-
-/* The common portion of as_bad and as_bad_where. */
-
-static void
-as_bad_internal (char *file, unsigned int line, char *buffer)
-{
- ++error_count;
-
- if (file == NULL)
- as_where (&file, &line);
-
- identify (file);
- if (file)
- fprintf (stderr, "%s:%u: ", file, line);
- fprintf (stderr, _("Error: "));
- fputs (buffer, stderr);
- (void) putc ('\n', stderr);
-#ifndef NO_LISTING
- listing_error (buffer);
-#endif
-}
-
-/* Send to stderr a string as a warning, and locate warning in input
- file(s). Please us when there is no recovery, but we want to
- continue processing but not produce an object file.
- Please explain in string (which may have '\n's) what recovery was
- done. */
-
-#ifdef USE_STDARG
-void
-as_bad (const char *format, ...)
-{
- va_list args;
- char buffer[2000];
-
- va_start (args, format);
- vsnprintf (buffer, sizeof (buffer), format, args);
- va_end (args);
-
- as_bad_internal ((char *) NULL, 0, buffer);
-}
-
-#else
-void
-as_bad (format, va_alist)
- const char *format;
- va_dcl
-{
- va_list args;
- char buffer[2000];
-
- va_start (args);
- vsnprintf (buffer, sizeof (buffer), format, args);
- va_end (args);
-
- as_bad_internal ((char *) NULL, 0, buffer);
-}
-#endif /* not NO_STDARG */
-
-/* Like as_bad but the file name and line number are passed in.
- Unfortunately, we have to repeat the function in order to handle
- the varargs correctly and portably. */
-
-#ifdef USE_STDARG
-void
-as_bad_where (char *file, unsigned int line, const char *format, ...)
-{
- va_list args;
- char buffer[2000];
-
- va_start (args, format);
- vsnprintf (buffer, sizeof (buffer), format, args);
- va_end (args);
-
- as_bad_internal (file, line, buffer);
-}
-
-#else
-void
-as_bad_where (file, line, format, va_alist)
- char *file;
- unsigned int line;
- const char *format;
- va_dcl
-{
- va_list args;
- char buffer[2000];
-
- va_start (args);
- vsnprintf (buffer, sizeof (buffer), format, args);
- va_end (args);
-
- as_bad_internal (file, line, buffer);
-}
-#endif /* not NO_STDARG */
-
-/* Send to stderr a string as a fatal message, and print location of
- error in input file(s).
- Please only use this for when we DON'T have some recovery action.
- It xexit()s with a warning status. */
-
-#ifdef USE_STDARG
-void
-as_fatal (const char *format, ...)
-{
- va_list args;
-
- as_show_where ();
- va_start (args, format);
- fprintf (stderr, _("Fatal error: "));
- vfprintf (stderr, format, args);
- (void) putc ('\n', stderr);
- va_end (args);
- /* Delete the output file, if it exists. This will prevent make from
- thinking that a file was created and hence does not need rebuilding. */
- if (out_file_name != NULL)
- unlink_if_ordinary (out_file_name);
- xexit (EXIT_FAILURE);
-}
-#else
-void
-as_fatal (format, va_alist)
- char *format;
- va_dcl
-{
- va_list args;
-
- as_show_where ();
- va_start (args);
- fprintf (stderr, _("Fatal error: "));
- vfprintf (stderr, format, args);
- (void) putc ('\n', stderr);
- va_end (args);
- xexit (EXIT_FAILURE);
-}
-#endif /* not NO_STDARG */
-
-/* Indicate assertion failure.
- Arguments: Filename, line number, optional function name. */
-
-void
-as_assert (const char *file, int line, const char *fn)
-{
- as_show_where ();
- fprintf (stderr, _("Internal error!\n"));
- if (fn)
- fprintf (stderr, _("Assertion failure in %s at %s line %d.\n"),
- fn, file, line);
- else
- fprintf (stderr, _("Assertion failure at %s line %d.\n"), file, line);
- fprintf (stderr, _("Please report this bug.\n"));
- xexit (EXIT_FAILURE);
-}
-
-/* as_abort: Print a friendly message saying how totally hosed we are,
- and exit without producing a core file. */
-
-void
-as_abort (const char *file, int line, const char *fn)
-{
- as_show_where ();
- if (fn)
- fprintf (stderr, _("Internal error, aborting at %s line %d in %s\n"),
- file, line, fn);
- else
- fprintf (stderr, _("Internal error, aborting at %s line %d\n"),
- file, line);
- fprintf (stderr, _("Please report this bug.\n"));
- xexit (EXIT_FAILURE);
-}
-
-/* Support routines. */
-
-void
-sprint_value (char *buf, valueT val)
-{
- if (sizeof (val) <= sizeof (long))
- {
- sprintf (buf, "%ld", (long) val);
- return;
- }
- if (sizeof (val) <= sizeof (bfd_vma))
- {
- sprintf_vma (buf, val);
- return;
- }
- abort ();
-}
-
-#define HEX_MAX_THRESHOLD 1024
-#define HEX_MIN_THRESHOLD -(HEX_MAX_THRESHOLD)
-
-static void
-as_internal_value_out_of_range (char * prefix,
- offsetT val,
- offsetT min,
- offsetT max,
- char * file,
- unsigned line,
- int bad)
-{
- const char * err;
-
- if (prefix == NULL)
- prefix = "";
-
- if (val >= min && val <= max)
- {
- addressT right = max & -max;
-
- if (max <= 1)
- abort ();
-
- /* xgettext:c-format */
- err = _("%s out of domain (%d is not a multiple of %d)");
- if (bad)
- as_bad_where (file, line, err,
- prefix, (int) val, (int) right);
- else
- as_warn_where (file, line, err,
- prefix, (int) val, (int) right);
- return;
- }
-
- if ( val < HEX_MAX_THRESHOLD
- && min < HEX_MAX_THRESHOLD
- && max < HEX_MAX_THRESHOLD
- && val > HEX_MIN_THRESHOLD
- && min > HEX_MIN_THRESHOLD
- && max > HEX_MIN_THRESHOLD)
- {
- /* xgettext:c-format */
- err = _("%s out of range (%d is not between %d and %d)");
-
- if (bad)
- as_bad_where (file, line, err,
- prefix, (int) val, (int) min, (int) max);
- else
- as_warn_where (file, line, err,
- prefix, (int) val, (int) min, (int) max);
- }
- else
- {
- char val_buf [sizeof (val) * 3 + 2];
- char min_buf [sizeof (val) * 3 + 2];
- char max_buf [sizeof (val) * 3 + 2];
-
- if (sizeof (val) > sizeof (bfd_vma))
- abort ();
-
- sprintf_vma (val_buf, (bfd_vma) val);
- sprintf_vma (min_buf, (bfd_vma) min);
- sprintf_vma (max_buf, (bfd_vma) max);
-
- /* xgettext:c-format. */
- err = _("%s out of range (0x%s is not between 0x%s and 0x%s)");
-
- if (bad)
- as_bad_where (file, line, err, prefix, val_buf, min_buf, max_buf);
- else
- as_warn_where (file, line, err, prefix, val_buf, min_buf, max_buf);
- }
-}
-
-void
-as_warn_value_out_of_range (char * prefix,
- offsetT value,
- offsetT min,
- offsetT max,
- char * file,
- unsigned line)
-{
- as_internal_value_out_of_range (prefix, value, min, max, file, line, 0);
-}
-
-void
-as_bad_value_out_of_range (char * prefix,
- offsetT value,
- offsetT min,
- offsetT max,
- char * file,
- unsigned line)
-{
- as_internal_value_out_of_range (prefix, value, min, max, file, line, 1);
-}
diff --git a/gas/po/POTFILES.in b/gas/po/POTFILES.in
deleted file mode 100644
index 42a543ed7ec..00000000000
--- a/gas/po/POTFILES.in
+++ /dev/null
@@ -1,232 +0,0 @@
-app.c
-as.c
-as.h
-asintl.h
-atof-generic.c
-bignum.h
-bit_fix.h
-cgen.c
-cgen.h
-cond.c
-config/atof-ieee.c
-config/atof-vax.c
-config/e-crisaout.c
-config/e-criself.c
-config/e-i386aout.c
-config/e-i386coff.c
-config/e-i386elf.c
-config/e-mipsecoff.c
-config/e-mipself.c
-config/obj-aout.c
-config/obj-aout.h
-config/obj-coff.c
-config/obj-coff.h
-config/obj-ecoff.c
-config/obj-ecoff.h
-config/obj-elf.c
-config/obj-elf.h
-config/obj-evax.c
-config/obj-evax.h
-config/obj-fdpicelf.c
-config/obj-fdpicelf.h
-config/obj-som.c
-config/obj-som.h
-config/tc-alpha.c
-config/tc-alpha.h
-config/tc-arc.c
-config/tc-arc.h
-config/tc-arm.c
-config/tc-arm.h
-config/tc-avr.c
-config/tc-avr.h
-config/tc-bfin.c
-config/tc-bfin.h
-config/tc-cr16.c
-config/tc-cr16.h
-config/tc-cris.c
-config/tc-cris.h
-config/tc-crx.c
-config/tc-crx.h
-config/tc-d10v.c
-config/tc-d10v.h
-config/tc-d30v.c
-config/tc-d30v.h
-config/tc-dlx.c
-config/tc-dlx.h
-config/tc-fr30.c
-config/tc-fr30.h
-config/tc-frv.c
-config/tc-frv.h
-config/tc-h8300.c
-config/tc-h8300.h
-config/tc-hppa.c
-config/tc-hppa.h
-config/tc-i370.c
-config/tc-i370.h
-config/tc-i386.c
-config/tc-i386.h
-config/tc-i860.c
-config/tc-i860.h
-config/tc-i960.c
-config/tc-i960.h
-config/tc-ia64.c
-config/tc-ia64.h
-config/tc-ip2k.c
-config/tc-ip2k.h
-config/tc-iq2000.c
-config/tc-iq2000.h
-config/tc-m32c.c
-config/tc-m32c.h
-config/tc-m32r.c
-config/tc-m32r.h
-config/tc-m68hc11.c
-config/tc-m68hc11.h
-config/tc-m68k.c
-config/tc-m68k.h
-config/tc-maxq.c
-config/tc-maxq.h
-config/tc-mcore.c
-config/tc-mcore.h
-config/tc-mep.c
-config/tc-mep.h
-config/tc-mips.c
-config/tc-mips.h
-config/tc-mmix.c
-config/tc-mmix.h
-config/tc-mn10200.c
-config/tc-mn10200.h
-config/tc-mn10300.c
-config/tc-mn10300.h
-config/tc-msp430.c
-config/tc-msp430.h
-config/tc-mt.c
-config/tc-mt.h
-config/tc-ns32k.c
-config/tc-ns32k.h
-config/tc-openrisc.c
-config/tc-openrisc.h
-config/tc-or32.c
-config/tc-or32.h
-config/tc-pdp11.c
-config/tc-pdp11.h
-config/tc-pj.c
-config/tc-pj.h
-config/tc-ppc.c
-config/tc-ppc.h
-config/tc-s390.c
-config/tc-s390.h
-config/tc-score.c
-config/tc-score.h
-config/tc-sh.c
-config/tc-sh.h
-config/tc-sh64.c
-config/tc-sh64.h
-config/tc-sparc.c
-config/tc-sparc.h
-config/tc-spu.c
-config/tc-spu.h
-config/tc-tic30.c
-config/tc-tic30.h
-config/tc-tic4x.c
-config/tc-tic4x.h
-config/tc-tic54x.c
-config/tc-tic54x.h
-config/tc-v850.c
-config/tc-v850.h
-config/tc-vax.c
-config/tc-vax.h
-config/tc-xc16x.c
-config/tc-xc16x.h
-config/tc-xstormy16.c
-config/tc-xstormy16.h
-config/tc-xtensa.c
-config/tc-xtensa.h
-config/tc-z80.c
-config/tc-z80.h
-config/tc-z8k.c
-config/tc-z8k.h
-config/te-386bsd.h
-config/te-aix5.h
-config/te-armeabi.h
-config/te-armlinuxeabi.h
-config/te-dynix.h
-config/te-epoc-pe.h
-config/te-freebsd.h
-config/te-generic.h
-config/te-gnu.h
-config/te-go32.h
-config/te-hppa.h
-config/te-hppa64.h
-config/te-hppalinux64.h
-config/te-i386aix.h
-config/te-ia64aix.h
-config/te-interix.h
-config/te-lnews.h
-config/te-lynx.h
-config/te-mach.h
-config/te-macos.h
-config/te-nbsd.h
-config/te-nbsd532.h
-config/te-netware.h
-config/te-pc532mach.h
-config/te-pe.h
-config/te-psos.h
-config/te-riscix.h
-config/te-sparcaout.h
-config/te-sun3.h
-config/te-svr4.h
-config/te-symbian.h
-config/te-tmips.h
-config/te-vxworks.h
-config/te-wince-pe.h
-config/xtensa-relax.c
-config/xtensa-relax.h
-depend.c
-dw2gencfi.c
-dw2gencfi.h
-dwarf2dbg.c
-dwarf2dbg.h
-ecoff.c
-ecoff.h
-ehopt.c
-emul-target.h
-emul.h
-expr.c
-expr.h
-flonum-copy.c
-flonum-konst.c
-flonum-mult.c
-flonum.h
-frags.c
-frags.h
-hash.c
-hash.h
-input-file.c
-input-file.h
-input-scrub.c
-itbl-lex.h
-itbl-ops.c
-itbl-ops.h
-listing.c
-listing.h
-literal.c
-macro.c
-macro.h
-messages.c
-obj.h
-output-file.c
-output-file.h
-read.c
-read.h
-remap.c
-sb.c
-sb.h
-stabs.c
-struc-symbol.h
-subsegs.c
-subsegs.h
-symbols.c
-symbols.h
-tc.h
-write.c
-write.h
diff --git a/gas/symbols.c b/gas/symbols.c
deleted file mode 100644
index c7262b84451..00000000000
--- a/gas/symbols.c
+++ /dev/null
@@ -1,3176 +0,0 @@
-/* symbols.c -symbol table-
- Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
-
- This file is part of GAS, the GNU Assembler.
-
- GAS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GAS 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 GAS; see the file COPYING. If not, write to the Free
- Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-/* #define DEBUG_SYMS / * to debug symbol list maintenance. */
-
-#include "as.h"
-
-#include "safe-ctype.h"
-#include "obstack.h" /* For "symbols.h" */
-#include "subsegs.h"
-
-#include "struc-symbol.h"
-
-/* This is non-zero if symbols are case sensitive, which is the
- default. */
-int symbols_case_sensitive = 1;
-
-#ifndef WORKING_DOT_WORD
-extern int new_broken_words;
-#endif
-
-/* symbol-name => struct symbol pointer */
-static struct hash_control *sy_hash;
-
-/* Table of local symbols. */
-static struct hash_control *local_hash;
-
-/* Below are commented in "symbols.h". */
-symbolS *symbol_rootP;
-symbolS *symbol_lastP;
-symbolS abs_symbol;
-
-#ifdef DEBUG_SYMS
-#define debug_verify_symchain verify_symbol_chain
-#else
-#define debug_verify_symchain(root, last) ((void) 0)
-#endif
-
-#define DOLLAR_LABEL_CHAR '\001'
-#define LOCAL_LABEL_CHAR '\002'
-
-struct obstack notes;
-#ifdef USE_UNIQUE
-/* The name of an external symbol which is
- used to make weak PE symbol names unique. */
-const char * an_external_name;
-#endif
-
-static char *save_symbol_name (const char *);
-static void fb_label_init (void);
-static long dollar_label_instance (long);
-static long fb_label_instance (long);
-
-static void print_binary (FILE *, const char *, expressionS *);
-static void report_op_error (symbolS *, symbolS *, symbolS *);
-
-/* Return a pointer to a new symbol. Die if we can't make a new
- symbol. Fill in the symbol's values. Add symbol to end of symbol
- chain.
-
- This function should be called in the general case of creating a
- symbol. However, if the output file symbol table has already been
- set, and you are certain that this symbol won't be wanted in the
- output file, you can call symbol_create. */
-
-symbolS *
-symbol_new (const char *name, segT segment, valueT valu, fragS *frag)
-{
- symbolS *symbolP = symbol_create (name, segment, valu, frag);
-
- /* Link to end of symbol chain. */
- {
- extern int symbol_table_frozen;
- if (symbol_table_frozen)
- abort ();
- }
- symbol_append (symbolP, symbol_lastP, &symbol_rootP, &symbol_lastP);
-
- return symbolP;
-}
-
-/* Save a symbol name on a permanent obstack, and convert it according
- to the object file format. */
-
-static char *
-save_symbol_name (const char *name)
-{
- unsigned int name_length;
- char *ret;
-
- name_length = strlen (name) + 1; /* +1 for \0. */
- obstack_grow (&notes, name, name_length);
- ret = obstack_finish (&notes);
-
-#ifdef tc_canonicalize_symbol_name
- ret = tc_canonicalize_symbol_name (ret);
-#endif
-
- if (! symbols_case_sensitive)
- {
- char *s;
-
- for (s = ret; *s != '\0'; s++)
- *s = TOUPPER (*s);
- }
-
- return ret;
-}
-
-symbolS *
-symbol_create (const char *name, /* It is copied, the caller can destroy/modify. */
- segT segment, /* Segment identifier (SEG_<something>). */
- valueT valu, /* Symbol value. */
- fragS *frag /* Associated fragment. */)
-{
- char *preserved_copy_of_name;
- symbolS *symbolP;
-
- preserved_copy_of_name = save_symbol_name (name);
-
- symbolP = (symbolS *) obstack_alloc (&notes, sizeof (symbolS));
-
- /* symbol must be born in some fixed state. This seems as good as any. */
- memset (symbolP, 0, sizeof (symbolS));
-
- symbolP->bsym = bfd_make_empty_symbol (stdoutput);
- if (symbolP->bsym == NULL)
- as_fatal ("bfd_make_empty_symbol: %s", bfd_errmsg (bfd_get_error ()));
- S_SET_NAME (symbolP, preserved_copy_of_name);
-
- S_SET_SEGMENT (symbolP, segment);
- S_SET_VALUE (symbolP, valu);
- symbol_clear_list_pointers (symbolP);
-
- symbolP->sy_frag = frag;
-
- obj_symbol_new_hook (symbolP);
-
-#ifdef tc_symbol_new_hook
- tc_symbol_new_hook (symbolP);
-#endif
-
- return symbolP;
-}
-
-
-/* Local symbol support. If we can get away with it, we keep only a
- small amount of information for local symbols. */
-
-static symbolS *local_symbol_convert (struct local_symbol *);
-
-/* Used for statistics. */
-
-static unsigned long local_symbol_count;
-static unsigned long local_symbol_conversion_count;
-
-/* This macro is called with a symbol argument passed by reference.
- It returns whether this is a local symbol. If necessary, it
- changes its argument to the real symbol. */
-
-#define LOCAL_SYMBOL_CHECK(s) \
- (s->bsym == NULL \
- ? (local_symbol_converted_p ((struct local_symbol *) s) \
- ? (s = local_symbol_get_real_symbol ((struct local_symbol *) s), \
- 0) \
- : 1) \
- : 0)
-
-/* Create a local symbol and insert it into the local hash table. */
-
-static struct local_symbol *
-local_symbol_make (const char *name, segT section, valueT value, fragS *frag)
-{
- char *name_copy;
- struct local_symbol *ret;
-
- ++local_symbol_count;
-
- name_copy = save_symbol_name (name);
-
- ret = (struct local_symbol *) obstack_alloc (&notes, sizeof *ret);
- ret->lsy_marker = NULL;
- ret->lsy_name = name_copy;
- ret->lsy_section = section;
- local_symbol_set_frag (ret, frag);
- ret->lsy_value = value;
-
- hash_jam (local_hash, name_copy, (PTR) ret);
-
- return ret;
-}
-
-/* Convert a local symbol into a real symbol. Note that we do not
- reclaim the space used by the local symbol. */
-
-static symbolS *
-local_symbol_convert (struct local_symbol *locsym)
-{
- symbolS *ret;
-
- assert (locsym->lsy_marker == NULL);
- if (local_symbol_converted_p (locsym))
- return local_symbol_get_real_symbol (locsym);
-
- ++local_symbol_conversion_count;
-
- ret = symbol_new (locsym->lsy_name, locsym->lsy_section, locsym->lsy_value,
- local_symbol_get_frag (locsym));
-
- if (local_symbol_resolved_p (locsym))
- ret->sy_resolved = 1;
-
- /* Local symbols are always either defined or used. */
- ret->sy_used = 1;
-
-#ifdef TC_LOCAL_SYMFIELD_CONVERT
- TC_LOCAL_SYMFIELD_CONVERT (locsym, ret);
-#endif
-
- symbol_table_insert (ret);
-
- local_symbol_mark_converted (locsym);
- local_symbol_set_real_symbol (locsym, ret);
-
- hash_jam (local_hash, locsym->lsy_name, NULL);
-
- return ret;
-}
-
-/* We have just seen "<name>:".
- Creates a struct symbol unless it already exists.
-
- Gripes if we are redefining a symbol incompatibly (and ignores it). */
-
-symbolS *
-colon (/* Just seen "x:" - rattle symbols & frags. */
- const char *sym_name /* Symbol name, as a cannonical string. */
- /* We copy this string: OK to alter later. */)
-{
- register symbolS *symbolP; /* Symbol we are working with. */
-
- /* Sun local labels go out of scope whenever a non-local symbol is
- defined. */
- if (LOCAL_LABELS_DOLLAR
- && !bfd_is_local_label_name (stdoutput, sym_name))
- dollar_label_clear ();
-
-#ifndef WORKING_DOT_WORD
- if (new_broken_words)
- {
- struct broken_word *a;
- int possible_bytes;
- fragS *frag_tmp;
- char *frag_opcode;
-
- if (now_seg == absolute_section)
- {
- as_bad (_("cannot define symbol `%s' in absolute section"), sym_name);
- return NULL;
- }
-
- possible_bytes = (md_short_jump_size
- + new_broken_words * md_long_jump_size);
-
- frag_tmp = frag_now;
- frag_opcode = frag_var (rs_broken_word,
- possible_bytes,
- possible_bytes,
- (relax_substateT) 0,
- (symbolS *) broken_words,
- (offsetT) 0,
- NULL);
-
- /* We want to store the pointer to where to insert the jump
- table in the fr_opcode of the rs_broken_word frag. This
- requires a little hackery. */
- while (frag_tmp
- && (frag_tmp->fr_type != rs_broken_word
- || frag_tmp->fr_opcode))
- frag_tmp = frag_tmp->fr_next;
- know (frag_tmp);
- frag_tmp->fr_opcode = frag_opcode;
- new_broken_words = 0;
-
- for (a = broken_words; a && a->dispfrag == 0; a = a->next_broken_word)
- a->dispfrag = frag_tmp;
- }
-#endif /* WORKING_DOT_WORD */
-
- if ((symbolP = symbol_find (sym_name)) != 0)
- {
- S_CLEAR_WEAKREFR (symbolP);
-#ifdef RESOLVE_SYMBOL_REDEFINITION
- if (RESOLVE_SYMBOL_REDEFINITION (symbolP))
- return symbolP;
-#endif
- /* Now check for undefined symbols. */
- if (LOCAL_SYMBOL_CHECK (symbolP))
- {
- struct local_symbol *locsym = (struct local_symbol *) symbolP;
-
- if (locsym->lsy_section != undefined_section
- && (local_symbol_get_frag (locsym) != frag_now
- || locsym->lsy_section != now_seg
- || locsym->lsy_value != frag_now_fix ()))
- {
- as_bad (_("symbol `%s' is already defined"), sym_name);
- return symbolP;
- }
-
- locsym->lsy_section = now_seg;
- local_symbol_set_frag (locsym, frag_now);
- locsym->lsy_value = frag_now_fix ();
- }
- else if (!(S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
- || S_IS_COMMON (symbolP)
- || S_IS_VOLATILE (symbolP))
- {
- if (S_IS_VOLATILE (symbolP))
- {
- symbolP = symbol_clone (symbolP, 1);
- S_SET_VALUE (symbolP, 0);
- S_CLEAR_VOLATILE (symbolP);
- }
- if (S_GET_VALUE (symbolP) == 0)
- {
- symbolP->sy_frag = frag_now;
-#ifdef OBJ_VMS
- S_SET_OTHER (symbolP, const_flag);
-#endif
- S_SET_VALUE (symbolP, (valueT) frag_now_fix ());
- S_SET_SEGMENT (symbolP, now_seg);
-#ifdef N_UNDF
- know (N_UNDF == 0);
-#endif /* if we have one, it better be zero. */
-
- }
- else
- {
- /* There are still several cases to check:
-
- A .comm/.lcomm symbol being redefined as initialized
- data is OK
-
- A .comm/.lcomm symbol being redefined with a larger
- size is also OK
-
- This only used to be allowed on VMS gas, but Sun cc
- on the sparc also depends on it. */
-
- if (((!S_IS_DEBUG (symbolP)
- && (!S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP))
- && S_IS_EXTERNAL (symbolP))
- || S_GET_SEGMENT (symbolP) == bss_section)
- && (now_seg == data_section
- || now_seg == bss_section
- || now_seg == S_GET_SEGMENT (symbolP)))
- {
- /* Select which of the 2 cases this is. */
- if (now_seg != data_section)
- {
- /* New .comm for prev .comm symbol.
-
- If the new size is larger we just change its
- value. If the new size is smaller, we ignore
- this symbol. */
- if (S_GET_VALUE (symbolP)
- < ((unsigned) frag_now_fix ()))
- {
- S_SET_VALUE (symbolP, (valueT) frag_now_fix ());
- }
- }
- else
- {
- /* It is a .comm/.lcomm being converted to initialized
- data. */
- symbolP->sy_frag = frag_now;
-#ifdef OBJ_VMS
- S_SET_OTHER (symbolP, const_flag);
-#endif
- S_SET_VALUE (symbolP, (valueT) frag_now_fix ());
- S_SET_SEGMENT (symbolP, now_seg); /* Keep N_EXT bit. */
- }
- }
- else
- {
-#if (!defined (OBJ_AOUT) && !defined (OBJ_MAYBE_AOUT) \
- && !defined (OBJ_BOUT) && !defined (OBJ_MAYBE_BOUT))
- static const char *od_buf = "";
-#else
- char od_buf[100];
- od_buf[0] = '\0';
- if (OUTPUT_FLAVOR == bfd_target_aout_flavour)
- sprintf (od_buf, "%d.%d.",
- S_GET_OTHER (symbolP),
- S_GET_DESC (symbolP));
-#endif
- as_bad (_("symbol `%s' is already defined as \"%s\"/%s%ld"),
- sym_name,
- segment_name (S_GET_SEGMENT (symbolP)),
- od_buf,
- (long) S_GET_VALUE (symbolP));
- }
- } /* if the undefined symbol has no value */
- }
- else
- {
- /* Don't blow up if the definition is the same. */
- if (!(frag_now == symbolP->sy_frag
- && S_GET_VALUE (symbolP) == frag_now_fix ()
- && S_GET_SEGMENT (symbolP) == now_seg))
- {
- as_bad (_("symbol `%s' is already defined"), sym_name);
- symbolP = symbol_clone (symbolP, 0);
- }
- }
-
- }
- else if (! flag_keep_locals && bfd_is_local_label_name (stdoutput, sym_name))
- {
- symbolP = (symbolS *) local_symbol_make (sym_name, now_seg,
- (valueT) frag_now_fix (),
- frag_now);
- }
- else
- {
- symbolP = symbol_new (sym_name, now_seg, (valueT) frag_now_fix (),
- frag_now);
-#ifdef OBJ_VMS
- S_SET_OTHER (symbolP, const_flag);
-#endif /* OBJ_VMS */
-
- symbol_table_insert (symbolP);
- }
-
- if (mri_common_symbol != NULL)
- {
- /* This symbol is actually being defined within an MRI common
- section. This requires special handling. */
- if (LOCAL_SYMBOL_CHECK (symbolP))
- symbolP = local_symbol_convert ((struct local_symbol *) symbolP);
- symbolP->sy_value.X_op = O_symbol;
- symbolP->sy_value.X_add_symbol = mri_common_symbol;
- symbolP->sy_value.X_add_number = S_GET_VALUE (mri_common_symbol);
- symbolP->sy_frag = &zero_address_frag;
- S_SET_SEGMENT (symbolP, expr_section);
- symbolP->sy_mri_common = 1;
- }
-
-#ifdef tc_frob_label
- tc_frob_label (symbolP);
-#endif
-#ifdef obj_frob_label
- obj_frob_label (symbolP);
-#endif
-
- return symbolP;
-}
-
-/* Die if we can't insert the symbol. */
-
-void
-symbol_table_insert (symbolS *symbolP)
-{
- register const char *error_string;
-
- know (symbolP);
- know (S_GET_NAME (symbolP));
-
- if (LOCAL_SYMBOL_CHECK (symbolP))
- {
- error_string = hash_jam (local_hash, S_GET_NAME (symbolP),
- (PTR) symbolP);
- if (error_string != NULL)
- as_fatal (_("inserting \"%s\" into symbol table failed: %s"),
- S_GET_NAME (symbolP), error_string);
- return;
- }
-
- if ((error_string = hash_jam (sy_hash, S_GET_NAME (symbolP), (PTR) symbolP)))
- {
- as_fatal (_("inserting \"%s\" into symbol table failed: %s"),
- S_GET_NAME (symbolP), error_string);
- } /* on error */
-}
-
-/* If a symbol name does not exist, create it as undefined, and insert
- it into the symbol table. Return a pointer to it. */
-
-symbolS *
-symbol_find_or_make (const char *name)
-{
- register symbolS *symbolP;
-
- symbolP = symbol_find (name);
-
- if (symbolP == NULL)
- {
- if (! flag_keep_locals && bfd_is_local_label_name (stdoutput, name))
- {
- symbolP = md_undefined_symbol ((char *) name);
- if (symbolP != NULL)
- return symbolP;
-
- symbolP = (symbolS *) local_symbol_make (name, undefined_section,
- (valueT) 0,
- &zero_address_frag);
- return symbolP;
- }
-
- symbolP = symbol_make (name);
-
- symbol_table_insert (symbolP);
- } /* if symbol wasn't found */
-
- return (symbolP);
-}
-
-symbolS *
-symbol_make (const char *name)
-{
- symbolS *symbolP;
-
- /* Let the machine description default it, e.g. for register names. */
- symbolP = md_undefined_symbol ((char *) name);
-
- if (!symbolP)
- symbolP = symbol_new (name, undefined_section, (valueT) 0, &zero_address_frag);
-
- return (symbolP);
-}
-
-symbolS *
-symbol_clone (symbolS *orgsymP, int replace)
-{
- symbolS *newsymP;
- asymbol *bsymorg, *bsymnew;
-
- /* Running local_symbol_convert on a clone that's not the one currently
- in local_hash would incorrectly replace the hash entry. Thus the
- symbol must be converted here. Note that the rest of the function
- depends on not encountering an unconverted symbol. */
- if (LOCAL_SYMBOL_CHECK (orgsymP))
- orgsymP = local_symbol_convert ((struct local_symbol *) orgsymP);
- bsymorg = orgsymP->bsym;
-
- newsymP = obstack_alloc (&notes, sizeof (*newsymP));
- *newsymP = *orgsymP;
- bsymnew = bfd_make_empty_symbol (bfd_asymbol_bfd (bsymorg));
- if (bsymnew == NULL)
- as_fatal ("bfd_make_empty_symbol: %s", bfd_errmsg (bfd_get_error ()));
- newsymP->bsym = bsymnew;
- bsymnew->name = bsymorg->name;
- bsymnew->flags = bsymorg->flags;
- bsymnew->section = bsymorg->section;
- bfd_copy_private_symbol_data (bfd_asymbol_bfd (bsymorg), bsymorg,
- bfd_asymbol_bfd (bsymnew), bsymnew);
-
-#ifdef obj_symbol_clone_hook
- obj_symbol_clone_hook (newsymP, orgsymP);
-#endif
-
-#ifdef tc_symbol_clone_hook
- tc_symbol_clone_hook (newsymP, orgsymP);
-#endif
-
- if (replace)
- {
- if (symbol_rootP == orgsymP)
- symbol_rootP = newsymP;
- else if (orgsymP->sy_previous)
- {
- orgsymP->sy_previous->sy_next = newsymP;
- orgsymP->sy_previous = NULL;
- }
- if (symbol_lastP == orgsymP)
- symbol_lastP = newsymP;
- else if (orgsymP->sy_next)
- orgsymP->sy_next->sy_previous = newsymP;
- orgsymP->sy_previous = orgsymP->sy_next = orgsymP;
- debug_verify_symchain (symbol_rootP, symbol_lastP);
-
- symbol_table_insert (newsymP);
- }
- else
- newsymP->sy_previous = newsymP->sy_next = newsymP;
-
- return newsymP;
-}
-
-/* Referenced symbols, if they are forward references, need to be cloned
- (without replacing the original) so that the value of the referenced
- symbols at the point of use . */
-
-#undef symbol_clone_if_forward_ref
-symbolS *
-symbol_clone_if_forward_ref (symbolS *symbolP, int is_forward)
-{
- if (symbolP && !LOCAL_SYMBOL_CHECK (symbolP))
- {
- symbolS *add_symbol = symbolP->sy_value.X_add_symbol;
- symbolS *op_symbol = symbolP->sy_value.X_op_symbol;
-
- if (symbolP->sy_forward_ref)
- is_forward = 1;
-
- if (is_forward)
- {
- /* assign_symbol() clones volatile symbols; pre-existing expressions
- hold references to the original instance, but want the current
- value. Just repeat the lookup. */
- if (add_symbol && S_IS_VOLATILE (add_symbol))
- add_symbol = symbol_find_exact (S_GET_NAME (add_symbol));
- if (op_symbol && S_IS_VOLATILE (op_symbol))
- op_symbol = symbol_find_exact (S_GET_NAME (op_symbol));
- }
-
- /* Re-using sy_resolving here, as this routine cannot get called from
- symbol resolution code. */
- if (symbolP->bsym->section == expr_section && !symbolP->sy_resolving)
- {
- symbolP->sy_resolving = 1;
- add_symbol = symbol_clone_if_forward_ref (add_symbol, is_forward);
- op_symbol = symbol_clone_if_forward_ref (op_symbol, is_forward);
- symbolP->sy_resolving = 0;
- }
-
- if (symbolP->sy_forward_ref
- || add_symbol != symbolP->sy_value.X_add_symbol
- || op_symbol != symbolP->sy_value.X_op_symbol)
- symbolP = symbol_clone (symbolP, 0);
-
- symbolP->sy_value.X_add_symbol = add_symbol;
- symbolP->sy_value.X_op_symbol = op_symbol;
- }
-
- return symbolP;
-}
-
-symbolS *
-symbol_temp_new (segT seg, valueT ofs, fragS *frag)
-{
- return symbol_new (FAKE_LABEL_NAME, seg, ofs, frag);
-}
-
-symbolS *
-symbol_temp_new_now (void)
-{
- return symbol_temp_new (now_seg, frag_now_fix (), frag_now);
-}
-
-symbolS *
-symbol_temp_make (void)
-{
- return symbol_make (FAKE_LABEL_NAME);
-}
-
-/* Implement symbol table lookup.
- In: A symbol's name as a string: '\0' can't be part of a symbol name.
- Out: NULL if the name was not in the symbol table, else the address
- of a struct symbol associated with that name. */
-
-symbolS *
-symbol_find_exact (const char *name)
-{
- return symbol_find_exact_noref (name, 0);
-}
-
-symbolS *
-symbol_find_exact_noref (const char *name, int noref)
-{
- struct local_symbol *locsym;
- symbolS* sym;
-
- locsym = (struct local_symbol *) hash_find (local_hash, name);
- if (locsym != NULL)
- return (symbolS *) locsym;
-
- sym = ((symbolS *) hash_find (sy_hash, name));
-
- /* Any references to the symbol, except for the reference in
- .weakref, must clear this flag, such that the symbol does not
- turn into a weak symbol. Note that we don't have to handle the
- local_symbol case, since a weakrefd is always promoted out of the
- local_symbol table when it is turned into a weak symbol. */
- if (sym && ! noref)
- S_CLEAR_WEAKREFD (sym);
-
- return sym;
-}
-
-symbolS *
-symbol_find (const char *name)
-{
- return symbol_find_noref (name, 0);
-}
-
-symbolS *
-symbol_find_noref (const char *name, int noref)
-{
-#ifdef tc_canonicalize_symbol_name
- {
- char *copy;
- size_t len = strlen (name) + 1;
-
- copy = (char *) alloca (len);
- memcpy (copy, name, len);
- name = tc_canonicalize_symbol_name (copy);
- }
-#endif
-
- if (! symbols_case_sensitive)
- {
- char *copy;
- const char *orig;
- unsigned char c;
-
- orig = name;
- name = copy = (char *) alloca (strlen (name) + 1);
-
- while ((c = *orig++) != '\0')
- {
- *copy++ = TOUPPER (c);
- }
- *copy = '\0';
- }
-
- return symbol_find_exact_noref (name, noref);
-}
-
-/* Once upon a time, symbols were kept in a singly linked list. At
- least coff needs to be able to rearrange them from time to time, for
- which a doubly linked list is much more convenient. Loic did these
- as macros which seemed dangerous to me so they're now functions.
- xoxorich. */
-
-/* Link symbol ADDME after symbol TARGET in the chain. */
-
-void
-symbol_append (symbolS *addme, symbolS *target,
- symbolS **rootPP, symbolS **lastPP)
-{
- if (LOCAL_SYMBOL_CHECK (addme))
- abort ();
- if (target != NULL && LOCAL_SYMBOL_CHECK (target))
- abort ();
-
- if (target == NULL)
- {
- know (*rootPP == NULL);
- know (*lastPP == NULL);
- addme->sy_next = NULL;
- addme->sy_previous = NULL;
- *rootPP = addme;
- *lastPP = addme;
- return;
- } /* if the list is empty */
-
- if (target->sy_next != NULL)
- {
- target->sy_next->sy_previous = addme;
- }
- else
- {
- know (*lastPP == target);
- *lastPP = addme;
- } /* if we have a next */
-
- addme->sy_next = target->sy_next;
- target->sy_next = addme;
- addme->sy_previous = target;
-
- debug_verify_symchain (symbol_rootP, symbol_lastP);
-}
-
-/* Set the chain pointers of SYMBOL to null. */
-
-void
-symbol_clear_list_pointers (symbolS *symbolP)
-{
- if (LOCAL_SYMBOL_CHECK (symbolP))
- abort ();
- symbolP->sy_next = NULL;
- symbolP->sy_previous = NULL;
-}
-
-/* Remove SYMBOLP from the list. */
-
-void
-symbol_remove (symbolS *symbolP, symbolS **rootPP, symbolS **lastPP)
-{
- if (LOCAL_SYMBOL_CHECK (symbolP))
- abort ();
-
- if (symbolP == *rootPP)
- {
- *rootPP = symbolP->sy_next;
- } /* if it was the root */
-
- if (symbolP == *lastPP)
- {
- *lastPP = symbolP->sy_previous;
- } /* if it was the tail */
-
- if (symbolP->sy_next != NULL)
- {
- symbolP->sy_next->sy_previous = symbolP->sy_previous;
- } /* if not last */
-
- if (symbolP->sy_previous != NULL)
- {
- symbolP->sy_previous->sy_next = symbolP->sy_next;
- } /* if not first */
-
- debug_verify_symchain (*rootPP, *lastPP);
-}
-
-/* Link symbol ADDME before symbol TARGET in the chain. */
-
-void
-symbol_insert (symbolS *addme, symbolS *target,
- symbolS **rootPP, symbolS **lastPP ATTRIBUTE_UNUSED)
-{
- if (LOCAL_SYMBOL_CHECK (addme))
- abort ();
- if (LOCAL_SYMBOL_CHECK (target))
- abort ();
-
- if (target->sy_previous != NULL)
- {
- target->sy_previous->sy_next = addme;
- }
- else
- {
- know (*rootPP == target);
- *rootPP = addme;
- } /* if not first */
-
- addme->sy_previous = target->sy_previous;
- target->sy_previous = addme;
- addme->sy_next = target;
-
- debug_verify_symchain (*rootPP, *lastPP);
-}
-
-void
-verify_symbol_chain (symbolS *rootP, symbolS *lastP)
-{
- symbolS *symbolP = rootP;
-
- if (symbolP == NULL)
- return;
-
- for (; symbol_next (symbolP) != NULL; symbolP = symbol_next (symbolP))
- {
- assert (symbolP->bsym != NULL);
- assert (symbolP->sy_next->sy_previous == symbolP);
- }
-
- assert (lastP == symbolP);
-}
-
-#ifdef OBJ_COMPLEX_RELC
-
-static int
-use_complex_relocs_for (symbolS * symp)
-{
- switch (symp->sy_value.X_op)
- {
- case O_constant:
- return 0;
-
- case O_symbol:
- case O_symbol_rva:
- case O_uminus:
- case O_bit_not:
- case O_logical_not:
- if ( (S_IS_COMMON (symp->sy_value.X_add_symbol)
- || S_IS_LOCAL (symp->sy_value.X_add_symbol))
- &&
- (S_IS_DEFINED (symp->sy_value.X_add_symbol)
- && S_GET_SEGMENT (symp->sy_value.X_add_symbol) != expr_section))
- return 0;
- break;
-
- case O_multiply:
- case O_divide:
- case O_modulus:
- case O_left_shift:
- case O_right_shift:
- case O_bit_inclusive_or:
- case O_bit_or_not:
- case O_bit_exclusive_or:
- case O_bit_and:
- case O_add:
- case O_subtract:
- case O_eq:
- case O_ne:
- case O_lt:
- case O_le:
- case O_ge:
- case O_gt:
- case O_logical_and:
- case O_logical_or:
-
- if ( (S_IS_COMMON (symp->sy_value.X_add_symbol)
- || S_IS_LOCAL (symp->sy_value.X_add_symbol))
- &&
- (S_IS_COMMON (symp->sy_value.X_op_symbol)
- || S_IS_LOCAL (symp->sy_value.X_op_symbol))
-
- && S_IS_DEFINED (symp->sy_value.X_add_symbol)
- && S_IS_DEFINED (symp->sy_value.X_op_symbol)
- && S_GET_SEGMENT (symp->sy_value.X_add_symbol) != expr_section
- && S_GET_SEGMENT (symp->sy_value.X_op_symbol) != expr_section)
- return 0;
- break;
-
- default:
- break;
- }
- return 1;
-}
-#endif
-
-static void
-report_op_error (symbolS *symp, symbolS *left, symbolS *right)
-{
- char *file;
- unsigned int line;
- segT seg_left = S_GET_SEGMENT (left);
- segT seg_right = right ? S_GET_SEGMENT (right) : 0;
-
- if (expr_symbol_where (symp, &file, &line))
- {
- if (seg_left == undefined_section)
- as_bad_where (file, line,
- _("undefined symbol `%s' in operation"),
- S_GET_NAME (left));
- if (seg_right == undefined_section)
- as_bad_where (file, line,
- _("undefined symbol `%s' in operation"),
- S_GET_NAME (right));
- if (seg_left != undefined_section
- && seg_right != undefined_section)
- {
- if (right)
- as_bad_where (file, line,
- _("invalid sections for operation on `%s' and `%s'"),
- S_GET_NAME (left), S_GET_NAME (right));
- else
- as_bad_where (file, line,
- _("invalid section for operation on `%s'"),
- S_GET_NAME (left));
- }
-
- }
- else
- {
- if (seg_left == undefined_section)
- as_bad (_("undefined symbol `%s' in operation setting `%s'"),
- S_GET_NAME (left), S_GET_NAME (symp));
- if (seg_right == undefined_section)
- as_bad (_("undefined symbol `%s' in operation setting `%s'"),
- S_GET_NAME (right), S_GET_NAME (symp));
- if (seg_left != undefined_section
- && seg_right != undefined_section)
- {
- if (right)
- as_bad (_("invalid sections for operation on `%s' and `%s' setting `%s'"),
- S_GET_NAME (left), S_GET_NAME (right), S_GET_NAME (symp));
- else
- as_bad (_("invalid section for operation on `%s' setting `%s'"),
- S_GET_NAME (left), S_GET_NAME (symp));
- }
- }
-}
-
-/* Resolve the value of a symbol. This is called during the final
- pass over the symbol table to resolve any symbols with complex
- values. */
-
-valueT
-resolve_symbol_value (symbolS *symp)
-{
- int resolved;
- valueT final_val = 0;
- segT final_seg;
-
- if (LOCAL_SYMBOL_CHECK (symp))
- {
- struct local_symbol *locsym = (struct local_symbol *) symp;
-
- final_val = locsym->lsy_value;
- if (local_symbol_resolved_p (locsym))
- return final_val;
-
- final_val += local_symbol_get_frag (locsym)->fr_address / OCTETS_PER_BYTE;
-
- if (finalize_syms)
- {
- locsym->lsy_value = final_val;
- local_symbol_mark_resolved (locsym);
- }
-
- return final_val;
- }
-
- if (symp->sy_resolved)
- {
- if (symp->sy_value.X_op == O_constant)
- return (valueT) symp->sy_value.X_add_number;
- else
- return 0;
- }
-
- resolved = 0;
- final_seg = S_GET_SEGMENT (symp);
-
- if (symp->sy_resolving)
- {
- if (finalize_syms)
- as_bad (_("symbol definition loop encountered at `%s'"),
- S_GET_NAME (symp));
- final_val = 0;
- resolved = 1;
- }
-#ifdef OBJ_COMPLEX_RELC
- else if (final_seg == expr_section
- && use_complex_relocs_for (symp))
- {
- symbolS * relc_symbol = NULL;
- char * relc_symbol_name = NULL;
-
- relc_symbol_name = symbol_relc_make_expr (& symp->sy_value);
-
- /* For debugging, print out conversion input & output. */
-#ifdef DEBUG_SYMS
- print_expr (& symp->sy_value);
- if (relc_symbol_name)
- fprintf (stderr, "-> relc symbol: %s\n", relc_symbol_name);
-#endif
-
- if (relc_symbol_name != NULL)
- relc_symbol = symbol_new (relc_symbol_name, undefined_section,
- 0, & zero_address_frag);
-
- if (relc_symbol == NULL)
- {
- as_bad (_("cannot convert expression symbol %s to complex relocation"),
- S_GET_NAME (symp));
- resolved = 0;
- }
- else
- {
- symbol_table_insert (relc_symbol);
-
- /* S_CLEAR_EXTERNAL (relc_symbol); */
- if (symp->bsym->flags & BSF_SRELC)
- relc_symbol->bsym->flags |= BSF_SRELC;
- else
- relc_symbol->bsym->flags |= BSF_RELC;
- /* symp->bsym->flags |= BSF_RELC; */
- copy_symbol_attributes (symp, relc_symbol);
- symp->sy_value.X_op = O_symbol;
- symp->sy_value.X_add_symbol = relc_symbol;
- symp->sy_value.X_add_number = 0;
- resolved = 1;
- }
-
- final_seg = undefined_section;
- goto exit_dont_set_value;
- }
-#endif
- else
- {
- symbolS *add_symbol, *op_symbol;
- offsetT left, right;
- segT seg_left, seg_right;
- operatorT op;
- int move_seg_ok;
-
- symp->sy_resolving = 1;
-
- /* Help out with CSE. */
- add_symbol = symp->sy_value.X_add_symbol;
- op_symbol = symp->sy_value.X_op_symbol;
- final_val = symp->sy_value.X_add_number;
- op = symp->sy_value.X_op;
-
- switch (op)
- {
- default:
- BAD_CASE (op);
- break;
-
- case O_absent:
- final_val = 0;
- /* Fall through. */
-
- case O_constant:
- final_val += symp->sy_frag->fr_address / OCTETS_PER_BYTE;
- if (final_seg == expr_section)
- final_seg = absolute_section;
- /* Fall through. */
-
- case O_register:
- resolved = 1;
- break;
-
- case O_symbol:
- case O_symbol_rva:
- left = resolve_symbol_value (add_symbol);
- seg_left = S_GET_SEGMENT (add_symbol);
- if (finalize_syms)
- symp->sy_value.X_op_symbol = NULL;
-
- do_symbol:
- if (S_IS_WEAKREFR (symp))
- {
- assert (final_val == 0);
- if (S_IS_WEAKREFR (add_symbol))
- {
- assert (add_symbol->sy_value.X_op == O_symbol
- && add_symbol->sy_value.X_add_number == 0);
- add_symbol = add_symbol->sy_value.X_add_symbol;
- assert (! S_IS_WEAKREFR (add_symbol));
- symp->sy_value.X_add_symbol = add_symbol;
- }
- }
-
- if (symp->sy_mri_common)
- {
- /* This is a symbol inside an MRI common section. The
- relocation routines are going to handle it specially.
- Don't change the value. */
- resolved = symbol_resolved_p (add_symbol);
- break;
- }
-
- if (finalize_syms && final_val == 0)
- {
- if (LOCAL_SYMBOL_CHECK (add_symbol))
- add_symbol = local_symbol_convert ((struct local_symbol *)
- add_symbol);
- copy_symbol_attributes (symp, add_symbol);
- }
-
- /* If we have equated this symbol to an undefined or common
- symbol, keep X_op set to O_symbol, and don't change
- X_add_number. This permits the routine which writes out
- relocation to detect this case, and convert the
- relocation to be against the symbol to which this symbol
- is equated. */
- if (! S_IS_DEFINED (add_symbol)
-#if defined (OBJ_COFF) && defined (TE_PE)
- || S_IS_WEAK (add_symbol)
-#endif
- || S_IS_COMMON (add_symbol))
- {
- if (finalize_syms)
- {
- symp->sy_value.X_op = O_symbol;
- symp->sy_value.X_add_symbol = add_symbol;
- symp->sy_value.X_add_number = final_val;
- /* Use X_op_symbol as a flag. */
- symp->sy_value.X_op_symbol = add_symbol;
- final_seg = seg_left;
- }
- final_val = 0;
- resolved = symbol_resolved_p (add_symbol);
- symp->sy_resolving = 0;
- goto exit_dont_set_value;
- }
- else if (finalize_syms
- && ((final_seg == expr_section && seg_left != expr_section)
- || symbol_shadow_p (symp)))
- {
- /* If the symbol is an expression symbol, do similarly
- as for undefined and common syms above. Handles
- "sym +/- expr" where "expr" cannot be evaluated
- immediately, and we want relocations to be against
- "sym", eg. because it is weak. */
- symp->sy_value.X_op = O_symbol;
- symp->sy_value.X_add_symbol = add_symbol;
- symp->sy_value.X_add_number = final_val;
- symp->sy_value.X_op_symbol = add_symbol;
- final_seg = seg_left;
- final_val += symp->sy_frag->fr_address + left;
- resolved = symbol_resolved_p (add_symbol);
- symp->sy_resolving = 0;
- goto exit_dont_set_value;
- }
- else
- {
- final_val += symp->sy_frag->fr_address + left;
- if (final_seg == expr_section || final_seg == undefined_section)
- final_seg = seg_left;
- }
-
- resolved = symbol_resolved_p (add_symbol);
- if (S_IS_WEAKREFR (symp))
- goto exit_dont_set_value;
- break;
-
- case O_uminus:
- case O_bit_not:
- case O_logical_not:
- left = resolve_symbol_value (add_symbol);
- seg_left = S_GET_SEGMENT (add_symbol);
-
- /* By reducing these to the relevant dyadic operator, we get
- !S -> S == 0 permitted on anything,
- -S -> 0 - S only permitted on absolute
- ~S -> S ^ ~0 only permitted on absolute */
- if (op != O_logical_not && seg_left != absolute_section
- && finalize_syms)
- report_op_error (symp, add_symbol, NULL);
-
- if (final_seg == expr_section || final_seg == undefined_section)
- final_seg = absolute_section;
-
- if (op == O_uminus)
- left = -left;
- else if (op == O_logical_not)
- left = !left;
- else
- left = ~left;
-
- final_val += left + symp->sy_frag->fr_address;
-
- resolved = symbol_resolved_p (add_symbol);
- break;
-
- case O_multiply:
- case O_divide:
- case O_modulus:
- case O_left_shift:
- case O_right_shift:
- case O_bit_inclusive_or:
- case O_bit_or_not:
- case O_bit_exclusive_or:
- case O_bit_and:
- case O_add:
- case O_subtract:
- case O_eq:
- case O_ne:
- case O_lt:
- case O_le:
- case O_ge:
- case O_gt:
- case O_logical_and:
- case O_logical_or:
- left = resolve_symbol_value (add_symbol);
- right = resolve_symbol_value (op_symbol);
- seg_left = S_GET_SEGMENT (add_symbol);
- seg_right = S_GET_SEGMENT (op_symbol);
-
- /* Simplify addition or subtraction of a constant by folding the
- constant into X_add_number. */
- if (op == O_add)
- {
- if (seg_right == absolute_section)
- {
- final_val += right;
- goto do_symbol;
- }
- else if (seg_left == absolute_section)
- {
- final_val += left;
- add_symbol = op_symbol;
- left = right;
- seg_left = seg_right;
- goto do_symbol;
- }
- }
- else if (op == O_subtract)
- {
- if (seg_right == absolute_section)
- {
- final_val -= right;
- goto do_symbol;
- }
- }
-
- move_seg_ok = 1;
- /* Equality and non-equality tests are permitted on anything.
- Subtraction, and other comparison operators are permitted if
- both operands are in the same section. Otherwise, both
- operands must be absolute. We already handled the case of
- addition or subtraction of a constant above. This will
- probably need to be changed for an object file format which
- supports arbitrary expressions, such as IEEE-695. */
- if (!(seg_left == absolute_section
- && seg_right == absolute_section)
- && !(op == O_eq || op == O_ne)
- && !((op == O_subtract
- || op == O_lt || op == O_le || op == O_ge || op == O_gt)
- && seg_left == seg_right
- && (seg_left != undefined_section
- || add_symbol == op_symbol)))
- {
- /* Don't emit messages unless we're finalizing the symbol value,
- otherwise we may get the same message multiple times. */
- if (finalize_syms)
- report_op_error (symp, add_symbol, op_symbol);
- /* However do not move the symbol into the absolute section
- if it cannot currently be resolved - this would confuse
- other parts of the assembler into believing that the
- expression had been evaluated to zero. */
- else
- move_seg_ok = 0;
- }
-
- if (move_seg_ok
- && (final_seg == expr_section || final_seg == undefined_section))
- final_seg = absolute_section;
-
- /* Check for division by zero. */
- if ((op == O_divide || op == O_modulus) && right == 0)
- {
- /* If seg_right is not absolute_section, then we've
- already issued a warning about using a bad symbol. */
- if (seg_right == absolute_section && finalize_syms)
- {
- char *file;
- unsigned int line;
-
- if (expr_symbol_where (symp, &file, &line))
- as_bad_where (file, line, _("division by zero"));
- else
- as_bad (_("division by zero when setting `%s'"),
- S_GET_NAME (symp));
- }
-
- right = 1;
- }
-
- switch (symp->sy_value.X_op)
- {
- case O_multiply: left *= right; break;
- case O_divide: left /= right; break;
- case O_modulus: left %= right; break;
- case O_left_shift: left <<= right; break;
- case O_right_shift: left >>= right; break;
- case O_bit_inclusive_or: left |= right; break;
- case O_bit_or_not: left |= ~right; break;
- case O_bit_exclusive_or: left ^= right; break;
- case O_bit_and: left &= right; break;
- case O_add: left += right; break;
- case O_subtract: left -= right; break;
- case O_eq:
- case O_ne:
- left = (left == right && seg_left == seg_right
- && (seg_left != undefined_section
- || add_symbol == op_symbol)
- ? ~ (offsetT) 0 : 0);
- if (symp->sy_value.X_op == O_ne)
- left = ~left;
- break;
- case O_lt: left = left < right ? ~ (offsetT) 0 : 0; break;
- case O_le: left = left <= right ? ~ (offsetT) 0 : 0; break;
- case O_ge: left = left >= right ? ~ (offsetT) 0 : 0; break;
- case O_gt: left = left > right ? ~ (offsetT) 0 : 0; break;
- case O_logical_and: left = left && right; break;
- case O_logical_or: left = left || right; break;
- default: abort ();
- }
-
- final_val += symp->sy_frag->fr_address + left;
- if (final_seg == expr_section || final_seg == undefined_section)
- {
- if (seg_left == undefined_section
- || seg_right == undefined_section)
- final_seg = undefined_section;
- else if (seg_left == absolute_section)
- final_seg = seg_right;
- else
- final_seg = seg_left;
- }
- resolved = (symbol_resolved_p (add_symbol)
- && symbol_resolved_p (op_symbol));
- break;
-
- case O_big:
- case O_illegal:
- /* Give an error (below) if not in expr_section. We don't
- want to worry about expr_section symbols, because they
- are fictional (they are created as part of expression
- resolution), and any problems may not actually mean
- anything. */
- break;
- }
-
- symp->sy_resolving = 0;
- }
-
- if (finalize_syms)
- S_SET_VALUE (symp, final_val);
-
-exit_dont_set_value:
- /* Always set the segment, even if not finalizing the value.
- The segment is used to determine whether a symbol is defined. */
- S_SET_SEGMENT (symp, final_seg);
-
- /* Don't worry if we can't resolve an expr_section symbol. */
- if (finalize_syms)
- {
- if (resolved)
- symp->sy_resolved = 1;
- else if (S_GET_SEGMENT (symp) != expr_section)
- {
- as_bad (_("can't resolve value for symbol `%s'"),
- S_GET_NAME (symp));
- symp->sy_resolved = 1;
- }
- }
-
- return final_val;
-}
-
-static void resolve_local_symbol (const char *, PTR);
-
-/* A static function passed to hash_traverse. */
-
-static void
-resolve_local_symbol (const char *key ATTRIBUTE_UNUSED, PTR value)
-{
- if (value != NULL)
- resolve_symbol_value (value);
-}
-
-/* Resolve all local symbols. */
-
-void
-resolve_local_symbol_values (void)
-{
- hash_traverse (local_hash, resolve_local_symbol);
-}
-
-/* Obtain the current value of a symbol without changing any
- sub-expressions used. */
-
-int
-snapshot_symbol (symbolS **symbolPP, valueT *valueP, segT *segP, fragS **fragPP)
-{
- symbolS *symbolP = *symbolPP;
-
- if (LOCAL_SYMBOL_CHECK (symbolP))
- {
- struct local_symbol *locsym = (struct local_symbol *) symbolP;
-
- *valueP = locsym->lsy_value;
- *segP = locsym->lsy_section;
- *fragPP = local_symbol_get_frag (locsym);
- }
- else
- {
- expressionS expr = symbolP->sy_value;
-
- if (!symbolP->sy_resolved && expr.X_op != O_illegal)
- {
- int resolved;
-
- if (symbolP->sy_resolving)
- return 0;
- symbolP->sy_resolving = 1;
- resolved = resolve_expression (&expr);
- symbolP->sy_resolving = 0;
- if (!resolved)
- return 0;
-
- switch (expr.X_op)
- {
- case O_constant:
- case O_register:
- if (!symbol_equated_p (symbolP))
- break;
- /* Fall thru. */
- case O_symbol:
- case O_symbol_rva:
- symbolP = expr.X_add_symbol;
- break;
- default:
- return 0;
- }
- }
-
- /* Never change a defined symbol. */
- if (symbolP->bsym->section == undefined_section
- || symbolP->bsym->section == expr_section)
- *symbolPP = symbolP;
- *valueP = expr.X_add_number;
- *segP = symbolP->bsym->section;
- *fragPP = symbolP->sy_frag;
-
- if (*segP == expr_section)
- switch (expr.X_op)
- {
- case O_constant: *segP = absolute_section; break;
- case O_register: *segP = reg_section; break;
- default: break;
- }
- }
-
- return 1;
-}
-
-/* Dollar labels look like a number followed by a dollar sign. Eg, "42$".
- They are *really* local. That is, they go out of scope whenever we see a
- label that isn't local. Also, like fb labels, there can be multiple
- instances of a dollar label. Therefor, we name encode each instance with
- the instance number, keep a list of defined symbols separate from the real
- symbol table, and we treat these buggers as a sparse array. */
-
-static long *dollar_labels;
-static long *dollar_label_instances;
-static char *dollar_label_defines;
-static unsigned long dollar_label_count;
-static unsigned long dollar_label_max;
-
-int
-dollar_label_defined (long label)
-{
- long *i;
-
- know ((dollar_labels != NULL) || (dollar_label_count == 0));
-
- for (i = dollar_labels; i < dollar_labels + dollar_label_count; ++i)
- if (*i == label)
- return dollar_label_defines[i - dollar_labels];
-
- /* If we get here, label isn't defined. */
- return 0;
-}
-
-static long
-dollar_label_instance (long label)
-{
- long *i;
-
- know ((dollar_labels != NULL) || (dollar_label_count == 0));
-
- for (i = dollar_labels; i < dollar_labels + dollar_label_count; ++i)
- if (*i == label)
- return (dollar_label_instances[i - dollar_labels]);
-
- /* If we get here, we haven't seen the label before.
- Therefore its instance count is zero. */
- return 0;
-}
-
-void
-dollar_label_clear (void)
-{
- memset (dollar_label_defines, '\0', (unsigned int) dollar_label_count);
-}
-
-#define DOLLAR_LABEL_BUMP_BY 10
-
-void
-define_dollar_label (long label)
-{
- long *i;
-
- for (i = dollar_labels; i < dollar_labels + dollar_label_count; ++i)
- if (*i == label)
- {
- ++dollar_label_instances[i - dollar_labels];
- dollar_label_defines[i - dollar_labels] = 1;
- return;
- }
-
- /* If we get to here, we don't have label listed yet. */
-
- if (dollar_labels == NULL)
- {
- dollar_labels = (long *) xmalloc (DOLLAR_LABEL_BUMP_BY * sizeof (long));
- dollar_label_instances = (long *) xmalloc (DOLLAR_LABEL_BUMP_BY * sizeof (long));
- dollar_label_defines = xmalloc (DOLLAR_LABEL_BUMP_BY);
- dollar_label_max = DOLLAR_LABEL_BUMP_BY;
- dollar_label_count = 0;
- }
- else if (dollar_label_count == dollar_label_max)
- {
- dollar_label_max += DOLLAR_LABEL_BUMP_BY;
- dollar_labels = (long *) xrealloc ((char *) dollar_labels,
- dollar_label_max * sizeof (long));
- dollar_label_instances = (long *) xrealloc ((char *) dollar_label_instances,
- dollar_label_max * sizeof (long));
- dollar_label_defines = xrealloc (dollar_label_defines, dollar_label_max);
- } /* if we needed to grow */
-
- dollar_labels[dollar_label_count] = label;
- dollar_label_instances[dollar_label_count] = 1;
- dollar_label_defines[dollar_label_count] = 1;
- ++dollar_label_count;
-}
-
-/* Caller must copy returned name: we re-use the area for the next name.
-
- The mth occurence of label n: is turned into the symbol "Ln^Am"
- where n is the label number and m is the instance number. "L" makes
- it a label discarded unless debugging and "^A"('\1') ensures no
- ordinary symbol SHOULD get the same name as a local label
- symbol. The first "4:" is "L4^A1" - the m numbers begin at 1.
-
- fb labels get the same treatment, except that ^B is used in place
- of ^A. */
-
-char * /* Return local label name. */
-dollar_label_name (register long n, /* we just saw "n$:" : n a number. */
- register int augend /* 0 for current instance, 1 for new instance. */)
-{
- long i;
- /* Returned to caller, then copied. Used for created names ("4f"). */
- static char symbol_name_build[24];
- register char *p;
- register char *q;
- char symbol_name_temporary[20]; /* Build up a number, BACKWARDS. */
-
- know (n >= 0);
- know (augend == 0 || augend == 1);
- p = symbol_name_build;
-#ifdef LOCAL_LABEL_PREFIX
- *p++ = LOCAL_LABEL_PREFIX;
-#endif
- *p++ = 'L';
-
- /* Next code just does sprintf( {}, "%d", n); */
- /* Label number. */
- q = symbol_name_temporary;
- for (*q++ = 0, i = n; i; ++q)
- {
- *q = i % 10 + '0';
- i /= 10;
- }
- while ((*p = *--q) != '\0')
- ++p;
-
- *p++ = DOLLAR_LABEL_CHAR; /* ^A */
-
- /* Instance number. */
- q = symbol_name_temporary;
- for (*q++ = 0, i = dollar_label_instance (n) + augend; i; ++q)
- {
- *q = i % 10 + '0';
- i /= 10;
- }
- while ((*p++ = *--q) != '\0');;
-
- /* The label, as a '\0' ended string, starts at symbol_name_build. */
- return symbol_name_build;
-}
-
-/* Somebody else's idea of local labels. They are made by "n:" where n
- is any decimal digit. Refer to them with
- "nb" for previous (backward) n:
- or "nf" for next (forward) n:.
-
- We do a little better and let n be any number, not just a single digit, but
- since the other guy's assembler only does ten, we treat the first ten
- specially.
-
- Like someone else's assembler, we have one set of local label counters for
- entire assembly, not one set per (sub)segment like in most assemblers. This
- implies that one can refer to a label in another segment, and indeed some
- crufty compilers have done just that.
-
- Since there could be a LOT of these things, treat them as a sparse
- array. */
-
-#define FB_LABEL_SPECIAL (10)
-
-static long fb_low_counter[FB_LABEL_SPECIAL];
-static long *fb_labels;
-static long *fb_label_instances;
-static long fb_label_count;
-static long fb_label_max;
-
-/* This must be more than FB_LABEL_SPECIAL. */
-#define FB_LABEL_BUMP_BY (FB_LABEL_SPECIAL + 6)
-
-static void
-fb_label_init (void)
-{
- memset ((void *) fb_low_counter, '\0', sizeof (fb_low_counter));
-}
-
-/* Add one to the instance number of this fb label. */
-
-void
-fb_label_instance_inc (long label)
-{
- long *i;
-
- if (label < FB_LABEL_SPECIAL)
- {
- ++fb_low_counter[label];
- return;
- }
-
- if (fb_labels != NULL)
- {
- for (i = fb_labels + FB_LABEL_SPECIAL;
- i < fb_labels + fb_label_count; ++i)
- {
- if (*i == label)
- {
- ++fb_label_instances[i - fb_labels];
- return;
- } /* if we find it */
- } /* for each existing label */
- }
-
- /* If we get to here, we don't have label listed yet. */
-
- if (fb_labels == NULL)
- {
- fb_labels = (long *) xmalloc (FB_LABEL_BUMP_BY * sizeof (long));
- fb_label_instances = (long *) xmalloc (FB_LABEL_BUMP_BY * sizeof (long));
- fb_label_max = FB_LABEL_BUMP_BY;
- fb_label_count = FB_LABEL_SPECIAL;
-
- }
- else if (fb_label_count == fb_label_max)
- {
- fb_label_max += FB_LABEL_BUMP_BY;
- fb_labels = (long *) xrealloc ((char *) fb_labels,
- fb_label_max * sizeof (long));
- fb_label_instances = (long *) xrealloc ((char *) fb_label_instances,
- fb_label_max * sizeof (long));
- } /* if we needed to grow */
-
- fb_labels[fb_label_count] = label;
- fb_label_instances[fb_label_count] = 1;
- ++fb_label_count;
-}
-
-static long
-fb_label_instance (long label)
-{
- long *i;
-
- if (label < FB_LABEL_SPECIAL)
- {
- return (fb_low_counter[label]);
- }
-
- if (fb_labels != NULL)
- {
- for (i = fb_labels + FB_LABEL_SPECIAL;
- i < fb_labels + fb_label_count; ++i)
- {
- if (*i == label)
- {
- return (fb_label_instances[i - fb_labels]);
- } /* if we find it */
- } /* for each existing label */
- }
-
- /* We didn't find the label, so this must be a reference to the
- first instance. */
- return 0;
-}
-
-/* Caller must copy returned name: we re-use the area for the next name.
-
- The mth occurence of label n: is turned into the symbol "Ln^Bm"
- where n is the label number and m is the instance number. "L" makes
- it a label discarded unless debugging and "^B"('\2') ensures no
- ordinary symbol SHOULD get the same name as a local label
- symbol. The first "4:" is "L4^B1" - the m numbers begin at 1.
-
- dollar labels get the same treatment, except that ^A is used in
- place of ^B. */
-
-char * /* Return local label name. */
-fb_label_name (long n, /* We just saw "n:", "nf" or "nb" : n a number. */
- long augend /* 0 for nb, 1 for n:, nf. */)
-{
- long i;
- /* Returned to caller, then copied. Used for created names ("4f"). */
- static char symbol_name_build[24];
- register char *p;
- register char *q;
- char symbol_name_temporary[20]; /* Build up a number, BACKWARDS. */
-
- know (n >= 0);
-#ifdef TC_MMIX
- know ((unsigned long) augend <= 2 /* See mmix_fb_label. */);
-#else
- know ((unsigned long) augend <= 1);
-#endif
- p = symbol_name_build;
-#ifdef LOCAL_LABEL_PREFIX
- *p++ = LOCAL_LABEL_PREFIX;
-#endif
- *p++ = 'L';
-
- /* Next code just does sprintf( {}, "%d", n); */
- /* Label number. */
- q = symbol_name_temporary;
- for (*q++ = 0, i = n; i; ++q)
- {
- *q = i % 10 + '0';
- i /= 10;
- }
- while ((*p = *--q) != '\0')
- ++p;
-
- *p++ = LOCAL_LABEL_CHAR; /* ^B */
-
- /* Instance number. */
- q = symbol_name_temporary;
- for (*q++ = 0, i = fb_label_instance (n) + augend; i; ++q)
- {
- *q = i % 10 + '0';
- i /= 10;
- }
- while ((*p++ = *--q) != '\0');;
-
- /* The label, as a '\0' ended string, starts at symbol_name_build. */
- return (symbol_name_build);
-}
-
-/* Decode name that may have been generated by foo_label_name() above.
- If the name wasn't generated by foo_label_name(), then return it
- unaltered. This is used for error messages. */
-
-char *
-decode_local_label_name (char *s)
-{
- char *p;
- char *symbol_decode;
- int label_number;
- int instance_number;
- char *type;
- const char *message_format;
- int index = 0;
-
-#ifdef LOCAL_LABEL_PREFIX
- if (s[index] == LOCAL_LABEL_PREFIX)
- ++index;
-#endif
-
- if (s[index] != 'L')
- return s;
-
- for (label_number = 0, p = s + index + 1; ISDIGIT (*p); ++p)
- label_number = (10 * label_number) + *p - '0';
-
- if (*p == DOLLAR_LABEL_CHAR)
- type = "dollar";
- else if (*p == LOCAL_LABEL_CHAR)
- type = "fb";
- else
- return s;
-
- for (instance_number = 0, p++; ISDIGIT (*p); ++p)
- instance_number = (10 * instance_number) + *p - '0';
-
- message_format = _("\"%d\" (instance number %d of a %s label)");
- symbol_decode = obstack_alloc (&notes, strlen (message_format) + 30);
- sprintf (symbol_decode, message_format, label_number, instance_number, type);
-
- return symbol_decode;
-}
-
-/* Get the value of a symbol. */
-
-valueT
-S_GET_VALUE (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return resolve_symbol_value (s);
-
- if (!s->sy_resolved)
- {
- valueT val = resolve_symbol_value (s);
- if (!finalize_syms)
- return val;
- }
- if (S_IS_WEAKREFR (s))
- return S_GET_VALUE (s->sy_value.X_add_symbol);
-
- if (s->sy_value.X_op != O_constant)
- {
- if (! s->sy_resolved
- || s->sy_value.X_op != O_symbol
- || (S_IS_DEFINED (s) && ! S_IS_COMMON (s)))
- as_bad (_("attempt to get value of unresolved symbol `%s'"),
- S_GET_NAME (s));
- }
- return (valueT) s->sy_value.X_add_number;
-}
-
-/* Set the value of a symbol. */
-
-void
-S_SET_VALUE (symbolS *s, valueT val)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- {
- ((struct local_symbol *) s)->lsy_value = val;
- return;
- }
-
- s->sy_value.X_op = O_constant;
- s->sy_value.X_add_number = (offsetT) val;
- s->sy_value.X_unsigned = 0;
- S_CLEAR_WEAKREFR (s);
-}
-
-void
-copy_symbol_attributes (symbolS *dest, symbolS *src)
-{
- if (LOCAL_SYMBOL_CHECK (dest))
- dest = local_symbol_convert ((struct local_symbol *) dest);
- if (LOCAL_SYMBOL_CHECK (src))
- src = local_symbol_convert ((struct local_symbol *) src);
-
- /* In an expression, transfer the settings of these flags.
- The user can override later, of course. */
-#define COPIED_SYMFLAGS (BSF_FUNCTION | BSF_OBJECT)
- dest->bsym->flags |= src->bsym->flags & COPIED_SYMFLAGS;
-
-#ifdef OBJ_COPY_SYMBOL_ATTRIBUTES
- OBJ_COPY_SYMBOL_ATTRIBUTES (dest, src);
-#endif
-
-#ifdef TC_COPY_SYMBOL_ATTRIBUTES
- TC_COPY_SYMBOL_ATTRIBUTES (dest, src);
-#endif
-}
-
-int
-S_IS_FUNCTION (symbolS *s)
-{
- flagword flags;
-
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
-
- flags = s->bsym->flags;
-
- return (flags & BSF_FUNCTION) != 0;
-}
-
-int
-S_IS_EXTERNAL (symbolS *s)
-{
- flagword flags;
-
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
-
- flags = s->bsym->flags;
-
- /* Sanity check. */
- if ((flags & BSF_LOCAL) && (flags & BSF_GLOBAL))
- abort ();
-
- return (flags & BSF_GLOBAL) != 0;
-}
-
-int
-S_IS_WEAK (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- /* Conceptually, a weakrefr is weak if the referenced symbol is. We
- could probably handle a WEAKREFR as always weak though. E.g., if
- the referenced symbol has lost its weak status, there's no reason
- to keep handling the weakrefr as if it was weak. */
- if (S_IS_WEAKREFR (s))
- return S_IS_WEAK (s->sy_value.X_add_symbol);
- return (s->bsym->flags & BSF_WEAK) != 0;
-}
-
-int
-S_IS_WEAKREFR (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- return s->sy_weakrefr != 0;
-}
-
-int
-S_IS_WEAKREFD (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- return s->sy_weakrefd != 0;
-}
-
-int
-S_IS_COMMON (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- return bfd_is_com_section (s->bsym->section);
-}
-
-int
-S_IS_DEFINED (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return ((struct local_symbol *) s)->lsy_section != undefined_section;
- return s->bsym->section != undefined_section;
-}
-
-
-#ifndef EXTERN_FORCE_RELOC
-#define EXTERN_FORCE_RELOC IS_ELF
-#endif
-
-/* Return true for symbols that should not be reduced to section
- symbols or eliminated from expressions, because they may be
- overridden by the linker. */
-int
-S_FORCE_RELOC (symbolS *s, int strict)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return ((struct local_symbol *) s)->lsy_section == undefined_section;
-
- return ((strict
- && ((s->bsym->flags & BSF_WEAK) != 0
- || (EXTERN_FORCE_RELOC
- && (s->bsym->flags & BSF_GLOBAL) != 0)))
- || s->bsym->section == undefined_section
- || bfd_is_com_section (s->bsym->section));
-}
-
-int
-S_IS_DEBUG (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- if (s->bsym->flags & BSF_DEBUGGING)
- return 1;
- return 0;
-}
-
-int
-S_IS_LOCAL (symbolS *s)
-{
- flagword flags;
- const char *name;
-
- if (LOCAL_SYMBOL_CHECK (s))
- return 1;
-
- flags = s->bsym->flags;
-
- /* Sanity check. */
- if ((flags & BSF_LOCAL) && (flags & BSF_GLOBAL))
- abort ();
-
- if (bfd_get_section (s->bsym) == reg_section)
- return 1;
-
- if (flag_strip_local_absolute
- /* Keep BSF_FILE symbols in order to allow debuggers to identify
- the source file even when the object file is stripped. */
- && (flags & (BSF_GLOBAL | BSF_FILE)) == 0
- && bfd_get_section (s->bsym) == absolute_section)
- return 1;
-
- name = S_GET_NAME (s);
- return (name != NULL
- && ! S_IS_DEBUG (s)
- && (strchr (name, DOLLAR_LABEL_CHAR)
- || strchr (name, LOCAL_LABEL_CHAR)
- || (! flag_keep_locals
- && (bfd_is_local_label (stdoutput, s->bsym)
- || (flag_mri
- && name[0] == '?'
- && name[1] == '?')))));
-}
-
-int
-S_IS_STABD (symbolS *s)
-{
- return S_GET_NAME (s) == 0;
-}
-
-int
-S_IS_VOLATILE (const symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- return s->sy_volatile;
-}
-
-int
-S_IS_FORWARD_REF (const symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- return s->sy_forward_ref;
-}
-
-const char *
-S_GET_NAME (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return ((struct local_symbol *) s)->lsy_name;
- return s->bsym->name;
-}
-
-segT
-S_GET_SEGMENT (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return ((struct local_symbol *) s)->lsy_section;
- return s->bsym->section;
-}
-
-void
-S_SET_SEGMENT (symbolS *s, segT seg)
-{
- /* Don't reassign section symbols. The direct reason is to prevent seg
- faults assigning back to const global symbols such as *ABS*, but it
- shouldn't happen anyway. */
-
- if (LOCAL_SYMBOL_CHECK (s))
- {
- if (seg == reg_section)
- s = local_symbol_convert ((struct local_symbol *) s);
- else
- {
- ((struct local_symbol *) s)->lsy_section = seg;
- return;
- }
- }
-
- if (s->bsym->flags & BSF_SECTION_SYM)
- {
- if (s->bsym->section != seg)
- abort ();
- }
- else
- s->bsym->section = seg;
-}
-
-void
-S_SET_EXTERNAL (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- if ((s->bsym->flags & BSF_WEAK) != 0)
- {
- /* Let .weak override .global. */
- return;
- }
- if (s->bsym->flags & BSF_SECTION_SYM)
- {
- char * file;
- unsigned int line;
-
- /* Do not reassign section symbols. */
- as_where (& file, & line);
- as_warn_where (file, line,
- _("section symbols are already global"));
- return;
- }
- if (S_GET_SEGMENT (s) == reg_section)
- {
- as_bad ("can't make register symbol `%s' global",
- S_GET_NAME (s));
- return;
- }
- s->bsym->flags |= BSF_GLOBAL;
- s->bsym->flags &= ~(BSF_LOCAL | BSF_WEAK);
-
-#ifdef USE_UNIQUE
- if (! an_external_name && S_GET_NAME(s)[0] != '.')
- an_external_name = S_GET_NAME (s);
-#endif
-}
-
-void
-S_CLEAR_EXTERNAL (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return;
- if ((s->bsym->flags & BSF_WEAK) != 0)
- {
- /* Let .weak override. */
- return;
- }
- s->bsym->flags |= BSF_LOCAL;
- s->bsym->flags &= ~(BSF_GLOBAL | BSF_WEAK);
-}
-
-void
-S_SET_WEAK (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
-#ifdef obj_set_weak_hook
- obj_set_weak_hook (s);
-#endif
- s->bsym->flags |= BSF_WEAK;
- s->bsym->flags &= ~(BSF_GLOBAL | BSF_LOCAL);
-}
-
-void
-S_SET_WEAKREFR (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- s->sy_weakrefr = 1;
- /* If the alias was already used, make sure we mark the target as
- used as well, otherwise it might be dropped from the symbol
- table. This may have unintended side effects if the alias is
- later redirected to another symbol, such as keeping the unused
- previous target in the symbol table. Since it will be weak, it's
- not a big deal. */
- if (s->sy_used)
- symbol_mark_used (s->sy_value.X_add_symbol);
-}
-
-void
-S_CLEAR_WEAKREFR (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return;
- s->sy_weakrefr = 0;
-}
-
-void
-S_SET_WEAKREFD (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- s->sy_weakrefd = 1;
- S_SET_WEAK (s);
-}
-
-void
-S_CLEAR_WEAKREFD (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return;
- if (s->sy_weakrefd)
- {
- s->sy_weakrefd = 0;
- /* If a weakref target symbol is weak, then it was never
- referenced directly before, not even in a .global directive,
- so decay it to local. If it remains undefined, it will be
- later turned into a global, like any other undefined
- symbol. */
- if (s->bsym->flags & BSF_WEAK)
- {
-#ifdef obj_clear_weak_hook
- obj_clear_weak_hook (s);
-#endif
- s->bsym->flags &= ~BSF_WEAK;
- s->bsym->flags |= BSF_LOCAL;
- }
- }
-}
-
-void
-S_SET_THREAD_LOCAL (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- if (bfd_is_com_section (s->bsym->section)
- && (s->bsym->flags & BSF_THREAD_LOCAL) != 0)
- return;
- s->bsym->flags |= BSF_THREAD_LOCAL;
- if ((s->bsym->flags & BSF_FUNCTION) != 0)
- as_bad (_("Accessing function `%s' as thread-local object"),
- S_GET_NAME (s));
- else if (! bfd_is_und_section (s->bsym->section)
- && (s->bsym->section->flags & SEC_THREAD_LOCAL) == 0)
- as_bad (_("Accessing `%s' as thread-local object"),
- S_GET_NAME (s));
-}
-
-void
-S_SET_NAME (symbolS *s, const char *name)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- {
- ((struct local_symbol *) s)->lsy_name = name;
- return;
- }
- s->bsym->name = name;
-}
-
-void
-S_SET_VOLATILE (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- s->sy_volatile = 1;
-}
-
-void
-S_CLEAR_VOLATILE (symbolS *s)
-{
- if (!LOCAL_SYMBOL_CHECK (s))
- s->sy_volatile = 0;
-}
-
-void
-S_SET_FORWARD_REF (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- s->sy_forward_ref = 1;
-}
-
-/* Return the previous symbol in a chain. */
-
-symbolS *
-symbol_previous (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- abort ();
- return s->sy_previous;
-}
-
-/* Return the next symbol in a chain. */
-
-symbolS *
-symbol_next (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- abort ();
- return s->sy_next;
-}
-
-/* Return a pointer to the value of a symbol as an expression. */
-
-expressionS *
-symbol_get_value_expression (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- return &s->sy_value;
-}
-
-/* Set the value of a symbol to an expression. */
-
-void
-symbol_set_value_expression (symbolS *s, const expressionS *exp)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- s->sy_value = *exp;
- S_CLEAR_WEAKREFR (s);
-}
-
-/* Return a pointer to the X_add_number component of a symbol. */
-
-offsetT *
-symbol_X_add_number (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return (offsetT *) &((struct local_symbol *) s)->lsy_value;
-
- return &s->sy_value.X_add_number;
-}
-
-/* Set the value of SYM to the current position in the current segment. */
-
-void
-symbol_set_value_now (symbolS *sym)
-{
- S_SET_SEGMENT (sym, now_seg);
- S_SET_VALUE (sym, frag_now_fix ());
- symbol_set_frag (sym, frag_now);
-}
-
-/* Set the frag of a symbol. */
-
-void
-symbol_set_frag (symbolS *s, fragS *f)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- {
- local_symbol_set_frag ((struct local_symbol *) s, f);
- return;
- }
- s->sy_frag = f;
- S_CLEAR_WEAKREFR (s);
-}
-
-/* Return the frag of a symbol. */
-
-fragS *
-symbol_get_frag (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return local_symbol_get_frag ((struct local_symbol *) s);
- return s->sy_frag;
-}
-
-/* Mark a symbol as having been used. */
-
-void
-symbol_mark_used (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return;
- s->sy_used = 1;
- if (S_IS_WEAKREFR (s))
- symbol_mark_used (s->sy_value.X_add_symbol);
-}
-
-/* Clear the mark of whether a symbol has been used. */
-
-void
-symbol_clear_used (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- s->sy_used = 0;
-}
-
-/* Return whether a symbol has been used. */
-
-int
-symbol_used_p (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 1;
- return s->sy_used;
-}
-
-/* Mark a symbol as having been used in a reloc. */
-
-void
-symbol_mark_used_in_reloc (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- s->sy_used_in_reloc = 1;
-}
-
-/* Clear the mark of whether a symbol has been used in a reloc. */
-
-void
-symbol_clear_used_in_reloc (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return;
- s->sy_used_in_reloc = 0;
-}
-
-/* Return whether a symbol has been used in a reloc. */
-
-int
-symbol_used_in_reloc_p (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- return s->sy_used_in_reloc;
-}
-
-/* Mark a symbol as an MRI common symbol. */
-
-void
-symbol_mark_mri_common (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- s->sy_mri_common = 1;
-}
-
-/* Clear the mark of whether a symbol is an MRI common symbol. */
-
-void
-symbol_clear_mri_common (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return;
- s->sy_mri_common = 0;
-}
-
-/* Return whether a symbol is an MRI common symbol. */
-
-int
-symbol_mri_common_p (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- return s->sy_mri_common;
-}
-
-/* Mark a symbol as having been written. */
-
-void
-symbol_mark_written (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return;
- s->written = 1;
-}
-
-/* Clear the mark of whether a symbol has been written. */
-
-void
-symbol_clear_written (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return;
- s->written = 0;
-}
-
-/* Return whether a symbol has been written. */
-
-int
-symbol_written_p (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- return s->written;
-}
-
-/* Mark a symbol has having been resolved. */
-
-void
-symbol_mark_resolved (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- {
- local_symbol_mark_resolved ((struct local_symbol *) s);
- return;
- }
- s->sy_resolved = 1;
-}
-
-/* Return whether a symbol has been resolved. */
-
-int
-symbol_resolved_p (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return local_symbol_resolved_p ((struct local_symbol *) s);
- return s->sy_resolved;
-}
-
-/* Return whether a symbol is a section symbol. */
-
-int
-symbol_section_p (symbolS *s ATTRIBUTE_UNUSED)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- return (s->bsym->flags & BSF_SECTION_SYM) != 0;
-}
-
-/* Return whether a symbol is equated to another symbol. */
-
-int
-symbol_equated_p (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- return s->sy_value.X_op == O_symbol;
-}
-
-/* Return whether a symbol is equated to another symbol, and should be
- treated specially when writing out relocs. */
-
-int
-symbol_equated_reloc_p (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- /* X_op_symbol, normally not used for O_symbol, is set by
- resolve_symbol_value to flag expression syms that have been
- equated. */
- return (s->sy_value.X_op == O_symbol
-#if defined (OBJ_COFF) && defined (TE_PE)
- && ! S_IS_WEAK (s)
-#endif
- && ((s->sy_resolved && s->sy_value.X_op_symbol != NULL)
- || ! S_IS_DEFINED (s)
- || S_IS_COMMON (s)));
-}
-
-/* Return whether a symbol has a constant value. */
-
-int
-symbol_constant_p (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 1;
- return s->sy_value.X_op == O_constant;
-}
-
-/* Return whether a symbol was cloned and thus removed from the global
- symbol list. */
-
-int
-symbol_shadow_p (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- return 0;
- return s->sy_next == s;
-}
-
-/* Return the BFD symbol for a symbol. */
-
-asymbol *
-symbol_get_bfdsym (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- return s->bsym;
-}
-
-/* Set the BFD symbol for a symbol. */
-
-void
-symbol_set_bfdsym (symbolS *s, asymbol *bsym)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- /* Usually, it is harmless to reset a symbol to a BFD section
- symbol. For example, obj_elf_change_section sets the BFD symbol
- of an old symbol with the newly created section symbol. But when
- we have multiple sections with the same name, the newly created
- section may have the same name as an old section. We check if the
- old symbol has been already marked as a section symbol before
- resetting it. */
- if ((s->bsym->flags & BSF_SECTION_SYM) == 0)
- s->bsym = bsym;
- /* else XXX - What do we do now ? */
-}
-
-#ifdef OBJ_SYMFIELD_TYPE
-
-/* Get a pointer to the object format information for a symbol. */
-
-OBJ_SYMFIELD_TYPE *
-symbol_get_obj (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- return &s->sy_obj;
-}
-
-/* Set the object format information for a symbol. */
-
-void
-symbol_set_obj (symbolS *s, OBJ_SYMFIELD_TYPE *o)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- s->sy_obj = *o;
-}
-
-#endif /* OBJ_SYMFIELD_TYPE */
-
-#ifdef TC_SYMFIELD_TYPE
-
-/* Get a pointer to the processor information for a symbol. */
-
-TC_SYMFIELD_TYPE *
-symbol_get_tc (symbolS *s)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- return &s->sy_tc;
-}
-
-/* Set the processor information for a symbol. */
-
-void
-symbol_set_tc (symbolS *s, TC_SYMFIELD_TYPE *o)
-{
- if (LOCAL_SYMBOL_CHECK (s))
- s = local_symbol_convert ((struct local_symbol *) s);
- s->sy_tc = *o;
-}
-
-#endif /* TC_SYMFIELD_TYPE */
-
-void
-symbol_begin (void)
-{
- symbol_lastP = NULL;
- symbol_rootP = NULL; /* In case we have 0 symbols (!!) */
- sy_hash = hash_new ();
- local_hash = hash_new ();
-
- memset ((char *) (&abs_symbol), '\0', sizeof (abs_symbol));
-#if defined (EMIT_SECTION_SYMBOLS) || !defined (RELOC_REQUIRES_SYMBOL)
- abs_symbol.bsym = bfd_abs_section.symbol;
-#endif
- abs_symbol.sy_value.X_op = O_constant;
- abs_symbol.sy_frag = &zero_address_frag;
-
- if (LOCAL_LABELS_FB)
- fb_label_init ();
-}
-
-int indent_level;
-
-/* Maximum indent level.
- Available for modification inside a gdb session. */
-static int max_indent_level = 8;
-
-void
-print_symbol_value_1 (FILE *file, symbolS *sym)
-{
- const char *name = S_GET_NAME (sym);
- if (!name || !name[0])
- name = "(unnamed)";
- fprintf (file, "sym ");
- fprintf_vma (file, (bfd_vma) ((bfd_hostptr_t) sym));
- fprintf (file, " %s", name);
-
- if (LOCAL_SYMBOL_CHECK (sym))
- {
- struct local_symbol *locsym = (struct local_symbol *) sym;
-
- if (local_symbol_get_frag (locsym) != & zero_address_frag
- && local_symbol_get_frag (locsym) != NULL)
- {
- fprintf (file, " frag ");
- fprintf_vma (file, (bfd_vma) ((bfd_hostptr_t) local_symbol_get_frag (locsym)));
- }
- if (local_symbol_resolved_p (locsym))
- fprintf (file, " resolved");
- fprintf (file, " local");
- }
- else
- {
- if (sym->sy_frag != &zero_address_frag)
- {
- fprintf (file, " frag ");
- fprintf_vma (file, (bfd_vma) ((bfd_hostptr_t) sym->sy_frag));
- }
- if (sym->written)
- fprintf (file, " written");
- if (sym->sy_resolved)
- fprintf (file, " resolved");
- else if (sym->sy_resolving)
- fprintf (file, " resolving");
- if (sym->sy_used_in_reloc)
- fprintf (file, " used-in-reloc");
- if (sym->sy_used)
- fprintf (file, " used");
- if (S_IS_LOCAL (sym))
- fprintf (file, " local");
- if (S_IS_EXTERNAL (sym))
- fprintf (file, " extern");
- if (S_IS_WEAK (sym))
- fprintf (file, " weak");
- if (S_IS_DEBUG (sym))
- fprintf (file, " debug");
- if (S_IS_DEFINED (sym))
- fprintf (file, " defined");
- }
- if (S_IS_WEAKREFR (sym))
- fprintf (file, " weakrefr");
- if (S_IS_WEAKREFD (sym))
- fprintf (file, " weakrefd");
- fprintf (file, " %s", segment_name (S_GET_SEGMENT (sym)));
- if (symbol_resolved_p (sym))
- {
- segT s = S_GET_SEGMENT (sym);
-
- if (s != undefined_section
- && s != expr_section)
- fprintf (file, " %lx", (unsigned long) S_GET_VALUE (sym));
- }
- else if (indent_level < max_indent_level
- && S_GET_SEGMENT (sym) != undefined_section)
- {
- indent_level++;
- fprintf (file, "\n%*s<", indent_level * 4, "");
- if (LOCAL_SYMBOL_CHECK (sym))
- fprintf (file, "constant %lx",
- (unsigned long) ((struct local_symbol *) sym)->lsy_value);
- else
- print_expr_1 (file, &sym->sy_value);
- fprintf (file, ">");
- indent_level--;
- }
- fflush (file);
-}
-
-void
-print_symbol_value (symbolS *sym)
-{
- indent_level = 0;
- print_symbol_value_1 (stderr, sym);
- fprintf (stderr, "\n");
-}
-
-static void
-print_binary (FILE *file, const char *name, expressionS *exp)
-{
- indent_level++;
- fprintf (file, "%s\n%*s<", name, indent_level * 4, "");
- print_symbol_value_1 (file, exp->X_add_symbol);
- fprintf (file, ">\n%*s<", indent_level * 4, "");
- print_symbol_value_1 (file, exp->X_op_symbol);
- fprintf (file, ">");
- indent_level--;
-}
-
-void
-print_expr_1 (FILE *file, expressionS *exp)
-{
- fprintf (file, "expr ");
- fprintf_vma (file, (bfd_vma) ((bfd_hostptr_t) exp));
- fprintf (file, " ");
- switch (exp->X_op)
- {
- case O_illegal:
- fprintf (file, "illegal");
- break;
- case O_absent:
- fprintf (file, "absent");
- break;
- case O_constant:
- fprintf (file, "constant %lx", (unsigned long) exp->X_add_number);
- break;
- case O_symbol:
- indent_level++;
- fprintf (file, "symbol\n%*s<", indent_level * 4, "");
- print_symbol_value_1 (file, exp->X_add_symbol);
- fprintf (file, ">");
- maybe_print_addnum:
- if (exp->X_add_number)
- fprintf (file, "\n%*s%lx", indent_level * 4, "",
- (unsigned long) exp->X_add_number);
- indent_level--;
- break;
- case O_register:
- fprintf (file, "register #%d", (int) exp->X_add_number);
- break;
- case O_big:
- fprintf (file, "big");
- break;
- case O_uminus:
- fprintf (file, "uminus -<");
- indent_level++;
- print_symbol_value_1 (file, exp->X_add_symbol);
- fprintf (file, ">");
- goto maybe_print_addnum;
- case O_bit_not:
- fprintf (file, "bit_not");
- break;
- case O_multiply:
- print_binary (file, "multiply", exp);
- break;
- case O_divide:
- print_binary (file, "divide", exp);
- break;
- case O_modulus:
- print_binary (file, "modulus", exp);
- break;
- case O_left_shift:
- print_binary (file, "lshift", exp);
- break;
- case O_right_shift:
- print_binary (file, "rshift", exp);
- break;
- case O_bit_inclusive_or:
- print_binary (file, "bit_ior", exp);
- break;
- case O_bit_exclusive_or:
- print_binary (file, "bit_xor", exp);
- break;
- case O_bit_and:
- print_binary (file, "bit_and", exp);
- break;
- case O_eq:
- print_binary (file, "eq", exp);
- break;
- case O_ne:
- print_binary (file, "ne", exp);
- break;
- case O_lt:
- print_binary (file, "lt", exp);
- break;
- case O_le:
- print_binary (file, "le", exp);
- break;
- case O_ge:
- print_binary (file, "ge", exp);
- break;
- case O_gt:
- print_binary (file, "gt", exp);
- break;
- case O_logical_and:
- print_binary (file, "logical_and", exp);
- break;
- case O_logical_or:
- print_binary (file, "logical_or", exp);
- break;
- case O_add:
- indent_level++;
- fprintf (file, "add\n%*s<", indent_level * 4, "");
- print_symbol_value_1 (file, exp->X_add_symbol);
- fprintf (file, ">\n%*s<", indent_level * 4, "");
- print_symbol_value_1 (file, exp->X_op_symbol);
- fprintf (file, ">");
- goto maybe_print_addnum;
- case O_subtract:
- indent_level++;
- fprintf (file, "subtract\n%*s<", indent_level * 4, "");
- print_symbol_value_1 (file, exp->X_add_symbol);
- fprintf (file, ">\n%*s<", indent_level * 4, "");
- print_symbol_value_1 (file, exp->X_op_symbol);
- fprintf (file, ">");
- goto maybe_print_addnum;
- default:
- fprintf (file, "{unknown opcode %d}", (int) exp->X_op);
- break;
- }
- fflush (stdout);
-}
-
-void
-print_expr (expressionS *exp)
-{
- print_expr_1 (stderr, exp);
- fprintf (stderr, "\n");
-}
-
-void
-symbol_print_statistics (FILE *file)
-{
- hash_print_statistics (file, "symbol table", sy_hash);
- hash_print_statistics (file, "mini local symbol table", local_hash);
- fprintf (file, "%lu mini local symbols created, %lu converted\n",
- local_symbol_count, local_symbol_conversion_count);
-}
-
-#ifdef OBJ_COMPLEX_RELC
-
-/* Convert given symbol to a new complex-relocation symbol name. This
- may be a recursive function, since it might be called for non-leaf
- nodes (plain symbols) in the expression tree. The caller owns the
- returning string, so should free it eventually. Errors are
- indicated via as_bad and a NULL return value. The given symbol
- is marked with sy_used_in_reloc. */
-
-char *
-symbol_relc_make_sym (symbolS * sym)
-{
- char * terminal = NULL;
- const char * sname;
- char typetag;
- int sname_len;
-
- assert (sym != NULL);
-
- /* Recurse to symbol_relc_make_expr if this symbol
- is defined as an expression or a plain value. */
- if ( S_GET_SEGMENT (sym) == expr_section
- || S_GET_SEGMENT (sym) == absolute_section)
- return symbol_relc_make_expr (& sym->sy_value);
-
- /* This may be a "fake symbol" L0\001, referring to ".".
- Write out a special null symbol to refer to this position. */
- if (! strcmp (S_GET_NAME (sym), FAKE_LABEL_NAME))
- return xstrdup (".");
-
- /* We hope this is a plain leaf symbol. Construct the encoding
- as {S,s}II...:CCCCCCC....
- where 'S'/'s' means section symbol / plain symbol
- III is decimal for the symbol name length
- CCC is the symbol name itself. */
- symbol_mark_used_in_reloc (sym);
-
- sname = S_GET_NAME (sym);
- sname_len = strlen (sname);
- typetag = symbol_section_p (sym) ? 'S' : 's';
-
- terminal = xmalloc (1 /* S or s */
- + 8 /* sname_len in decimal */
- + 1 /* _ spacer */
- + sname_len /* name itself */
- + 1 /* \0 */ );
-
- sprintf (terminal, "%c%d:%s", typetag, sname_len, sname);
- return terminal;
-}
-
-/* Convert given value to a new complex-relocation symbol name. This
- is a non-recursive function, since it is be called for leaf nodes
- (plain values) in the expression tree. The caller owns the
- returning string, so should free() it eventually. No errors. */
-
-char *
-symbol_relc_make_value (offsetT val)
-{
- char * terminal = xmalloc (28); /* Enough for long long. */
-
- terminal[0] = '#';
- bfd_sprintf_vma (stdoutput, terminal + 1, val);
- return terminal;
-}
-
-/* Convert given expression to a new complex-relocation symbol name.
- This is a recursive function, since it traverses the entire given
- expression tree. The caller owns the returning string, so should
- free() it eventually. Errors are indicated via as_bad() and a NULL
- return value. */
-
-char *
-symbol_relc_make_expr (expressionS * exp)
-{
- char * opstr = NULL; /* Operator prefix string. */
- int arity = 0; /* Arity of this operator. */
- char * operands[3]; /* Up to three operands. */
- char * concat_string = NULL;
-
- operands[0] = operands[1] = operands[2] = NULL;
-
- assert (exp != NULL);
-
- /* Match known operators -> fill in opstr, arity, operands[] and fall
- through to construct subexpression fragments; may instead return
- string directly for leaf nodes. */
-
- /* See expr.h for the meaning of all these enums. Many operators
- have an unnatural arity (X_add_number implicitly added). The
- conversion logic expands them to explicit "+" subexpressions. */
-
- switch (exp->X_op)
- {
- default:
- as_bad ("Unknown expression operator (enum %d)", exp->X_op);
- break;
-
- /* Leaf nodes. */
- case O_constant:
- return symbol_relc_make_value (exp->X_add_number);
-
- case O_symbol:
- if (exp->X_add_number)
- {
- arity = 2;
- opstr = "+";
- operands[0] = symbol_relc_make_sym (exp->X_add_symbol);
- operands[1] = symbol_relc_make_value (exp->X_add_number);
- break;
- }
- else
- return symbol_relc_make_sym (exp->X_add_symbol);
-
- /* Helper macros for nesting nodes. */
-
-#define HANDLE_XADD_OPT1(str_) \
- if (exp->X_add_number) \
- { \
- arity = 2; \
- opstr = "+:" str_; \
- operands[0] = symbol_relc_make_sym (exp->X_add_symbol); \
- operands[1] = symbol_relc_make_value (exp->X_add_number); \
- break; \
- } \
- else \
- { \
- arity = 1; \
- opstr = str_; \
- operands[0] = symbol_relc_make_sym (exp->X_add_symbol); \
- } \
- break
-
-#define HANDLE_XADD_OPT2(str_) \
- if (exp->X_add_number) \
- { \
- arity = 3; \
- opstr = "+:" str_; \
- operands[0] = symbol_relc_make_sym (exp->X_add_symbol); \
- operands[1] = symbol_relc_make_sym (exp->X_op_symbol); \
- operands[2] = symbol_relc_make_value (exp->X_add_number); \
- } \
- else \
- { \
- arity = 2; \
- opstr = str_; \
- operands[0] = symbol_relc_make_sym (exp->X_add_symbol); \
- operands[1] = symbol_relc_make_sym (exp->X_op_symbol); \
- } \
- break
-
- /* Nesting nodes. */
-
- case O_uminus: HANDLE_XADD_OPT1 ("0-");
- case O_bit_not: HANDLE_XADD_OPT1 ("~");
- case O_logical_not: HANDLE_XADD_OPT1 ("!");
- case O_multiply: HANDLE_XADD_OPT2 ("*");
- case O_divide: HANDLE_XADD_OPT2 ("/");
- case O_modulus: HANDLE_XADD_OPT2 ("%");
- case O_left_shift: HANDLE_XADD_OPT2 ("<<");
- case O_right_shift: HANDLE_XADD_OPT2 (">>");
- case O_bit_inclusive_or: HANDLE_XADD_OPT2 ("|");
- case O_bit_exclusive_or: HANDLE_XADD_OPT2 ("^");
- case O_bit_and: HANDLE_XADD_OPT2 ("&");
- case O_add: HANDLE_XADD_OPT2 ("+");
- case O_subtract: HANDLE_XADD_OPT2 ("-");
- case O_eq: HANDLE_XADD_OPT2 ("==");
- case O_ne: HANDLE_XADD_OPT2 ("!=");
- case O_lt: HANDLE_XADD_OPT2 ("<");
- case O_le: HANDLE_XADD_OPT2 ("<=");
- case O_ge: HANDLE_XADD_OPT2 (">=");
- case O_gt: HANDLE_XADD_OPT2 (">");
- case O_logical_and: HANDLE_XADD_OPT2 ("&&");
- case O_logical_or: HANDLE_XADD_OPT2 ("||");
- }
-
- /* Validate & reject early. */
- if (arity >= 1 && ((operands[0] == NULL) || (strlen (operands[0]) == 0)))
- opstr = NULL;
- if (arity >= 2 && ((operands[1] == NULL) || (strlen (operands[1]) == 0)))
- opstr = NULL;
- if (arity >= 3 && ((operands[2] == NULL) || (strlen (operands[2]) == 0)))
- opstr = NULL;
-
- if (opstr == NULL)
- concat_string = NULL;
- else
- {
- /* Allocate new string; include inter-operand padding gaps etc. */
- concat_string = xmalloc (strlen (opstr)
- + 1
- + (arity >= 1 ? (strlen (operands[0]) + 1 ) : 0)
- + (arity >= 2 ? (strlen (operands[1]) + 1 ) : 0)
- + (arity >= 3 ? (strlen (operands[2]) + 0 ) : 0)
- + 1);
- assert (concat_string != NULL);
-
- /* Format the thing. */
- sprintf (concat_string,
- (arity == 0 ? "%s" :
- arity == 1 ? "%s:%s" :
- arity == 2 ? "%s:%s:%s" :
- /* arity == 3 */ "%s:%s:%s:%s"),
- opstr, operands[0], operands[1], operands[2]);
- }
-
- /* Free operand strings (not opstr). */
- if (arity >= 1) xfree (operands[0]);
- if (arity >= 2) xfree (operands[1]);
- if (arity >= 3) xfree (operands[2]);
-
- return concat_string;
-}
-
-#endif
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
deleted file mode 100644
index 7516f50c323..00000000000
--- a/gas/testsuite/ChangeLog
+++ /dev/null
@@ -1,950 +0,0 @@
-2008-08-01 Peter Bergner <bergner@vnet.ibm.com>
-
- * gas/ppc/power7.d: New.
- * gas/ppc/power7.s: Likewise.
- * gas/ppc/ppc.exp: Run power7 test.
-
-2008-08-01 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/cfi/cfi-i386.s: Remove tests for AVX register maps.
- * gas/cfi/cfi-x86_64.s: Likewise.
-
- * gas/cfi/cfi-i386.d: Updated.
- * gas/cfi/cfi-x86_64.d: Likewise.
-
-2008-07-31 Peter Bergner <bergner@vnet.ibm.com>
-
- * gas/ppc/cell.s: Add altivec instructions.
- * gas/ppc/cell.d: Update expected output.
- * gas/ppc/power6.d: New.
- * gas/ppc/power6.s: Likewise.
- * gas/ppc/ppc.exp (powerpc64*-*-*): Move cell from here to...
- (powerpc*-*-*): Here. Run power6 test.
-
-2008-07-24 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/nops-1.d: Add -mtune=generic32.
- * gas/i386/nops-2.d: Likewise.
- * gas/i386/nops-3.d: Likewise.
-
- * gas/i386/x86-64-nops-1.d: Add -mtune=generic64.
- * gas/i386/x86-64-nops-2.d: Likewise.
- * gas/i386/x86-64-nops-3.d: Likewise.
- * gas/i386/x86-64-nops-4.d: Likewise.
-
-2008-07-22 Chao-ying Fu <fu@mips.com>
-
- * gas/mips/tls-ill.l: Update error message.
- * gas/mips/octeon-ill.l: Likewise.
-
-2008-07-14 Jie Zhang <jie.zhang@analog.com>
-
- * gas/bfin/{bit2.s, cache2.s, control_code2.s, event2.s,
- logical2.s, move2.s, parallel.s, parallel2.s, parallel3.s,
- parallel4.s, shift2.s, stack2.s, video2.s}: Remove DOS line
- endings.
-
-2008-07-10 Richard Sandiford <rdsandiford@googlemail.com>
-
- * gas/mips/mips16-vis-1.d, gas/mips/mips16-vis-1.s: New tests.
- * gas/mips/mips.exp: Run them.
-
-2008-07-09 Kai Tietz <kai.tietz@onevision.com>
-
- * gas/i386/i386.exp (x86-64-pcrel): Disable for w64.
- (x86-64-sse5): Likewise.
- (x86-64-opcode-inval): Likewise.
- (x86-64-opcode-inval-intel): Likewise.
- (x86-64-w64-pcrel): New.
- * gas/i386/x86-64-w64-pcrel.d: New.
-
-2008-07-07 Adam Nemet <anemet@caviumnetworks.com>
-
- * gas/mips/mips32.s: Move out coprocessor2 insns from here ...
- * gas/mips/mips32-cp2.s: ... to here.
- * gas/mips/mips32.d: Update.
- * gas/mips/mips32-cp2.d: New file.
- * gas/mips/mips32r2.s: Move out coprocessor2 insns from here ...
- * gas/mips/mips32r2-cp2.s: ... to here.
- * gas/mips/mips32r2.d: Update.
- * gas/mips/mips32r2-cp2.d: New file.
- * gas/mips/mips64.s: Move out coprocessor2 insns from here ...
- * gas/mips/mips64-cp2.s: ... to here.
- * gas/mips/mips64.d: Update.
- * gas/mips/mips64-cp2.d: New file.
- * gas/mips/mips.exp: Run mips32-cp2, mips32r2-cp2 and mips64-cp
- except for Octeon.
- * gas/mips/octeon.s: Add supported coprocessor insns. Move pop
- down to keep alphabetical order.
- * gas/mips/octeon.d: Update.
- * gas/mips/octeon-ill.s: Add unsupported coprocessor insns.
- * gas/mips/octeon-ill.l: Update.
-
-2008-07-07 Paul Brook <paul@codesourcery.com>
-
- * gas/arm/movw-local.d: New test.
- * gas/arm/movw-local.s: New test.
-
-2008-06-27 Chao-ying Fu <fu@mips.com>
-
- * gas/mips/odd-float.d: Replace ... with #pass.
- * gas/mips/ldstla-32-shared.d: Add -march=mips1 for as.
- * gas/mips/ldstla-32.d: Likewise.
- * gas/mips/mips16-hilo-match.d: Add -mabi=32 -march=mips1 for as.
-
-2008-06-19 Chao-ying Fu <fu@mips.com>
-
- * gas/mips/e32-rel2.d: Add -march=mips1 for as.
-
-2008-06-16 Hans-Peter Nilsson <hp@bitrange.com>
-
- PR gas/6607
- * gas/mmix/err-loc-10.s, gas/mmix/err-loc-9.s, gas/mmix/loc-6.d,
- gas/mmix/loc-6.s, gas/mmix/loc-7.d, gas/mmix/loc-7.s: New tests.
-
-2008-06-12 Adam Nemet <anemet@caviumnetworks.com>
-
- * gas/mips/octeon.s, gas/mips/octeon.d: Add tests for baddu,
- bbit*, cins*, dmul, pop, dpop, exts*, mtm*, mtp*, syncs, syncw,
- syncws, vm3mulu, vm0 and vmulu.
- * gas/mips/octeon-ill.s, gas/mips/octeon-ill.s: New test.
- * gas/mips/mips.exp: Run it. Run octeon test with
- run_dump_test_arches.
-
- * gas/mips/octeon.s, gas/mips/octeon.d: Add tests for seq* and sne*.
- * gas/mips/octeon-ill.s, gas/mips/octeon-ill.s: Add tests for seqi
- and snei.
-
-2008-06-03 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/i386.exp: Run sse-check-none and
- x86-64-sse-check-none.
-
- * gas/i386/sse-check-none.d: New.
- * gas/i386/sse-check-none.s: Likewise.
- * gas/i386/x86-64-sse-check-none.d: Likewise.
-
-2008-06-03 Paul Brook <paul@codesourcery.com>
-
- * gas/arm/thumb32.d: Update expected output.
-
-2008-05-30 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/x86-64-avx.s: Add tests for vmovd on 64bit operands.
-
- * gas/i386/x86-64-sse2avx.s: Add tests for movd on 64bit
- operands.
-
- * gas/testsuite/gas/i386/x86-64-avx.d: Updated.
- * gas/testsuite/gas/i386/x86-64-avx-intel.d: Likewise.
- * gas/testsuite/gas/i386/x86-64-sse2avx.d: Likewise.
-
-2008-05-27 Martin Schwidefsky <schwidefsky@de.ibm.com>
-
- * gas/s390/zarch-z990.d (idte): Fix operand format.
-
-2008-05-22 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/sse-noavx.s: Add tests for cvtpd2pi, cvtpi2pd and
- cvttpd2pi.
- * gas/i386/x86-64-sse-noavx.s: Likewise.
-
- * gas/i386/sse-noavx.d: Updated.
- * gas/i386/x86-64-sse-noavx.d: Likewise.
-
-2008-05-22 H.J. Lu <hongjiu.lu@intel.com>
-
- PR gas/6517
- * gas/i386/avx.s: Add tests for unspecified memory operand
- size in Intel syntax.
- * gas/i386/x86-64-avx.s: Likewise.
-
- * gas/i386/simd.s: Add tests for cvtsi2ss and cvtsi2sd with
- unspecified memory operand size in Intel syntax.
-
- * gas/i386/avx.d: Updated.
- * gas/i386/avx-intel.d: Likewise.
- * gas/i386/simd.d: Likewise.
- * gas/i386/simd-intel.d: Likewise.
- * gas/i386/simd-suffix.d: Likewise.
- * gas/i386/x86-64-avx.d: Likewise.
- * gas/i386/x86-64-avx-intel.d: Likewise.
-
-2008-05-21 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/sse-noavx.s: Add tests for movdq2q and movq2dq.
- * gas/i386/x86-64-sse-noavx.s: Likewise.
-
- * gas/i386/sse-noavx.d: Updated.
- * gas/i386/x86-64-sse-noavx.d: Likewise.
-
-2008-05-09 Catherine Moore <clm@codesourcery.com>
-
- * gas/mips/mips16-hilo-match.s: New test.
- * gas/mips/mip16-hilo-match.d: New test output.
-
-2008-05-02 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/i386.exp: Run movbe, movbe-intel, inval-movbe, ept,
- ept-intel, inval-ept, x86-64-movbe, x86-64-movbe-intel,
- x86-64-inval-movbe. x86-64-ept, x86-64-ept-intel and
- x86-64-inval-ept.
-
- * gas/i386/arch-10.s: Add movbe and invept.
- * gas/i386/x86-64-arch-2.s: Likewise.
-
- * gas/i386/ept.d: New file
- * gas/i386/ept-intel.d: Likewise.
- * gas/i386/ept.s: Likewise.
- * gas/i386/inval-ept.l: Likewise.
- * gas/i386/inval-ept.s: Likewise.
- * gas/i386/inval-movbe.l: Likewise.
- * gas/i386/inval-movbe.s: Likewise.
- * gas/i386/movbe.d: Likewise.
- * gas/i386/movbe-intel.d: Likewise.
- * gas/i386/movbe.s: Likewise.
- * gas/i386/x86-64-inval-ept.l: Likewise.
- * gas/i386/x86-64-inval-ept.s: Likewise.
- * gas/i386/x86-64-inval-movbe.l: Likewise.
- * gas/i386/x86-64-inval-movbe.s: Likewise.
- * gas/i386/x86-64-ept.d: Likewise.
- * gas/i386/x86-64-ept-intel.d: Likewise.
- * gas/i386/x86-64-ept.s: Likewise.
- * gas/i386/x86-64-movbe.d: Likewise.
- * gas/i386/x86-64-movbe-intel.d: Likewise.
- * gas/i386/x86-64-movbe.s: Likewise.
-
- * gas/i386/arch-10.d: Updated.
- * gas/i386/arch-10-1.l: Likewise.
- * gas/i386/arch-10-2.l: Likewise.
- * gas/i386/arch-10-3.l: Likewise.
- * gas/i386/arch-10-4.l: Likewise.
- * gas/i386/x86-64-arch-2.d: Likewise.
-
-2008-04-28 Adam Nemet <anemet@caviumnetworks.com>
-
- * gas/mips/mips4.s: Split out fp instruction from here ...
- * gas/mips/mips4-fp.s: ... to here.
- * gas/mips/mips4.d: Update.
- * gas/mips/mips4-fp.l: New file. Check error messages with
- -msoft-float.
- * gas/mips/mips4-fp.d: New file. Check disassembly with
- hard-float.
-
- * gas/mips/mips32r2.s: Split out fp instructions from here ...
- * gas/mips/mips32r2-fp32.s: ... to here.
- * gas/mips/mips32r2.d: Update.
- * gas/mips/mips32r2-fp32.l: New file. Check error messages with
- -msoft-float.
- * gas/mips/mips32r2-fp32.d: New file. Check disassembly with
- hard-float.
-
- * gas/mips/mips32r2-ill-nofp.s, gas/mips/mips32r2-ill-nofp.l: New
- test derived from mips32r2-ill.
-
- * gas/mips/mips32-sf32.l: New list test for mips32-sf32.s to check
- error messages for soft-float targets.
-
- * gas/mips/mips-macro-ill-sfp.s, gas/mips/mips-macro-ill-sfp.l:
- New test for -msingle-float.
- * gas/mips/mips-macro-ill-nofp.s, gas/mips/mips-macro-ill-nofp.l:
- New test for -msoft-float.
- * gas/mips/mips-hard-float-flag.s,
- gas/mips/mips-hard-float-flag.l: New test for -mhard-float.
- * gas/mips/mips-double-float-flag.s,
- gas/mips/mips-double-float-flag.l: New test for -mdouble-float.
-
- * gas/mips/mips.exp: Run new mips4-fp and mips32r2-fp dump tests.
- Run mips4-fp and mips32r2-fp list tests with -msoft-float. Run
- new mips32r2-ill-nofp with -msoft-float. Run new mips32-sf32 list
- test with -msoft-float. Run new mips-macro-ill-sfp test with
- -msingle-float. Run new mips-macro-ill-nofp test with
- -msoft-float. Run new mips-hard-float-flag and
- mips-double-float-flag tests.
-
-2008-04-23 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/i386.exp: Run sse-noavx and x86-64-sse-noavx.
-
- * gas/i386/sse-noavx.d: New.
- * gas/i386/sse-noavx.s: Likewise.
- * gas/i386/x86-64-sse-noavx.d: Likewise.
- * gas/i386/x86-64-sse-noavx.s: Likewise.
-
-2008-04-23 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/sse2.s: Add tests for pmuludq, paddq and psubq.
- * gas/i386/x86-64-simd.s: Likewise.
-
- * gas/i386/sse2.d: Updated.
- * gas/i386/x86-64-simd.d: Likewise.
- * gas/i386/x86-64-simd-intel.d: Likewise.
- * gas/i386/x86-64-simd-suffix.d: Likewise.
-
-2008-04-23 David S. Miller <davem@davemloft.net>
-
- * gas/sparc/pc2210.d: New file.
- * gas/sparc/pc2210.d: Likewise.
- * gas/sparc/sparc.exp: Run new %pc22/%pc10 relocation test.
-
-2008-04-18 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/arch-10.d: Updated.
- * gas/i386/avx.d: Likewise.
- * gas/i386/avx-intel.d: Likewise.
- * gas/i386/x86-64-arch-2.d: Likewise.
- * gas/i386/x86-64-avx.d: Likewise.
- * gas/i386/x86-64-avx-intel.d: Likewise.
-
-2008-04-16 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
- Michael Meissner <michael.meissner@amd.com>
-
- * gas/i386/x86-64-sse5.s: Add protX tests to allow memory in the
- middle operand.
- * gas/i386/x86-64-sse5.d: Likewise.
-
-2008-04-16 David S. Miller <davem@davemloft.net>
-
- * gas/sparc/gotops32.d: New.
- * gas/sparc/gotops32.s: Likewise.
- * gas/sparc/gotops64.d: Likewise.
- * gas/sparc/gotops64.s: Likewise.
- * gas/sparc/sparc.exp: Run new gotdata tests.
-
-2008-04-15 Andrew Stubbs <andrew.stubbs@st.com>
-
- * gas/sh/arch/arch.exp: Align PC-relative instructions in the gererated
- assembly files.
- * gas/sh/arch/sh-dsp.s: Regenerate.
- * gas/sh/arch/sh.s: Regenerate.
- * gas/sh/arch/sh2.s: Regenerate.
- * gas/sh/arch/sh2a-nofpu-or-sh3-nommu.s: Regenerate.
- * gas/sh/arch/sh2a-nofpu-or-sh4-nommu-nofpu.s: Regenerate.
- * gas/sh/arch/sh2a-nofpu.s: Regenerate.
- * gas/sh/arch/sh2a-or-sh3e.s: Regenerate.: Regenerate.
- * gas/sh/arch/sh2a-or-sh4.s: Regenerate.
- * gas/sh/arch/sh2a.s: Regenerate.
- * gas/sh/arch/sh2e.s: Regenerate.
- * gas/sh/arch/sh3-dsp.s: Regenerate.
- * gas/sh/arch/sh3-nommu.s: Regenerate.
- * gas/sh/arch/sh3.s: Regenerate.
- * gas/sh/arch/sh3e.s: Regenerate.
- * gas/sh/arch/sh4-nofpu.s: Regenerate.
- * gas/sh/arch/sh4-nommu-nofpu.s: Regenerate.
- * gas/sh/arch/sh4.s: Regenerate.
- * gas/sh/arch/sh4a-nofpu.s: Regenerate.
- * gas/sh/arch/sh4a.s: Regenerate.
- * gas/sh/arch/sh4al-dsp.s: Regenerate.
- * gas/sh/err-mova.s: New test.
-
-2008-04-14 Edmar Wienskoski <edmar@freescale.com>
-
- * gas/ppc/e500mc.s, gas/ppc/e500mc.d: New test.
- * gas/ppc/ppc.exp: Run the new test
-
-2008-04-11 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/lns/lns-big-delta.d: Updated.
- * gas/lns/lns-common-1.d: Likewise.
- * gas/lns/lns-common-1-alt.d: Likewise.
- * gas/lns/lns-duplicate.d: Likewise.
-
-2008-04-10 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/i386.exp: Run sse-check, sse-check-warn,
- sse-check-error, x86-64-sse-check, x86-64-sse-check-warn and
- x86-64-sse-check-error.
-
- * gas/i386/sse-check.d: New.
- * gas/i386/sse-check.s: Likewise.
- * gas/i386/sse-check-error.l: Likewise.
- * gas/i386/sse-check-error.s: Likewise.
- * gas/i386/sse-check-warn.d: Likewise.
- * gas/i386/sse-check-warn.e: Likewise.
- * gas/i386/x86-64-sse-check.d: Likewise.
- * gas/i386/x86-64-sse-check-error.l: Likewise.
- * gas/i386/x86-64-sse-check-error.s: Likewise.
- * gas/i386/x86-64-sse-check-warn.d: Likewise.
-
-2008-04-10 Santiago Urueña <suruena@gmail.com>
-
- * gas/all/gas.exp: Check the performance of the -ag command line
- switch.
-
-2008-04-10 Andreas Krebbel <krebbel1@de.ibm.com>
-
- * gas/s390/zarch-z10.d: Map the compare and branch variants
- with odd condition code mask to version with an even mask.
-
-2008-04-07 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/att-regs.s: Add AVX register test.
- * gas/i386/intel-regs.s: Likewise.
-
- * gas/i386/att-regs.d: Updated.
- * gas/i386/intel-regs.d: Likewise.
-
-2008-04-07 Kaz Kojima <kkojima@rr.iij4u.or.jp>
-
- PR gas/6043
- * gas/sh/sh64/eh-1.d: New.
- * gas/sh/sh64/eh-1.d: Likewise.
-
-2008-04-04 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/arch-10-1.l: Replace CLMUL with PCLMUL.
- * gas/i386/arch-10-2.l: Likewise.
- * gas/i386/arch-10-3.l: Likewise.
- * gas/i386/arch-10-4.l: Likewise.
- * gas/i386/arch-10.s: Likewise.
- * gas/i386/clmul-intel.d: Likewise.
- * gas/i386/clmul.d: Likewise.
- * gas/i386/clmul.s: Likewise.
- * gas/i386/x86-64-arch-2.s: Likewise.
- * gas/i386/x86-64-clmul-intel.d: Likewise.
- * gas/i386/x86-64-clmul.d: Likewise.
- * gas/i386/x86-64-clmul.s: Likewise.
-
- * gas/i386/arch-10.d: Replace clmul with pclmul.
- * gas/i386/x86-64-arch-2.d: Likewise.
-
-2008-04-03 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/i386.exp: Run aes, aes-intel, x86-64-aes,
- x86-64-aes-intel, avx, avx-intel, inval-avx, x86-64-avx,
- x86-64-avx-intel and x86-64-inval-avx.
-
- * gas/cfi/cfi-i386.s: Add tests for AVX register maps.
- * gas/cfi/cfi-x86_64.s: Likewise.
-
- * gas/i386/aes.d: New.
- * gas/i386/aes.s: Likewise.
- * gas/i386/aes-intel.d: Likewise.
- * gas/i386/avx.d: Likewise.
- * gas/i386/avx.s: Likewise.
- * gas/i386/avx-intel.d: Likewise.
- * gas/i386/clmul.d: Likewise.
- * gas/i386/clmul-intel.d: Likewise.
- * gas/i386/clmul.s: Likewise.
- * gas/i386/i386.exp: Likewise.
- * gas/i386/inval-avx.l: Likewise.
- * gas/i386/inval-avx.s: Likewise.
- * gas/i386/sse2avx.d: Likewise.
- * gas/i386/sse2avx.s: Likewise.
- * gas/i386/x86-64-aes.d: Likewise.
- * gas/i386/x86-64-aes.s: Likewise.
- * gas/i386/x86-64-aes-intel.d: Likewise.
- * gas/i386/x86-64-avx.d: Likewise.
- * gas/i386/x86-64-avx.s: Likewise.
- * gas/i386/x86-64-avx-intel.d: Likewise.
- * gas/i386/x86-64-clmul.d: Likewise.
- * gas/i386/x86-64-clmul-intel.d: Likewise.
- * gas/i386/x86-64-clmul.s: Likewise.
- * gas/i386/x86-64-inval-avx.l: Likewise.
- * gas/i386/x86-64-inval-avx.s: Likewise.
- * gas/i386/x86-64-sse2avx.d: Likewise.
- * gas/i386/x86-64-sse2avx.s: Likewise.
-
- * gas/i386/arch-10.s: Add tests for AVX, AES, CLMUL and FMA.
- * gas/i386/x86-64-arch-2.s: Likewise.
-
- * gas/i386/rexw.s: Add AVX tests.
-
- * gas/i386/x86-64-opcode-inval.s: Remove lds/les test.
-
- * gas/cfi/cfi-i386.d: Updated.
- * gas/cfi/cfi-x86_64.d: Likewise.
- * gas/i386/arch-10.d: Likewise.
- * gas/i386/arch-10-1.l: Likewise.
- * gas/i386/arch-10-2.l: Likewise.
- * gas/i386/arch-10-3.l: Likewise.
- * gas/i386/arch-10-4.l: Likewise.
- * gas/i386/rexw.d: Likewise.
- * gas/i386/x86-64-arch-2.d: Likewise.
- * gas/i386/x86-64-opcode-inval.d: Likewise.
- * gas/i386/x86-64-opcode-inval-intel.d: Likewise.
-
-2008-03-26 Bernd Schmidt <bernd.schmidt@analog.com>
-
- From Jie Zhang <jie.zhang@analog.com>
- * gas/bfin/load.d: Update.
- * gas/bfin/expected_comparison_errors.l: New test.
- * gas/bfin/expected_comparison_errors.s: New test.
- * gas/bfin/bfin.exp: Add expected_comparison_errors.
- * gas/bfin/expected_errors.l, gas/bfin/expected_errors.s: Add
- tests for bad options of "multiply and multipy-accumulate to
- accumulator" instructions. Add new vector instruction option
- mode tests.
- * gas/bfin/vector2.s: Add new vector instruction option mode test.
- * gas/bfin/vector2.d: Adjust accordingly.
- * gas/bfin/expected_errors.l, gas/bfin/expected_errors.s:
- Add check for mismatch of accumulator and data register.
- * gas/bfin/arithmetic.s, gas/bfin/arithmetic.d: Add check
- for IU option.
-
- * gas/bfin/flow.d: Adjust since the generated labels for LOOP_BEGIN
- and LOOP_END instruction are local now.
- * gas/bfin/flow2.d: Likewise.
-
- From Mike Frysinger <michael.frysinger@analog.com>
- * gas/bfin/expected_errors.s, gas/bfin/expected_errors.l: Add test
- for mismatched half registers in vector multipy-accumulate
- instructions.
-
- From Robin Getz <rgetz@blackfin.uclinux.org>
- * gas/bfin/arithmetic.d: Update to reflect spaces/capitalization in
- recent changes in opcodes/bfin-dis.c.
- gas/bfin/arithmetic.s: Likewise.
- gas/bfin/bit.d: Likewise.
- gas/bfin/bit2.d: Likewise.
- gas/bfin/control_code.d: Likewise.
- gas/bfin/control_code2.d: Likewise.
- gas/bfin/event.d: Likewise.
- gas/bfin/event2.d: Likewise.
- gas/bfin/flow.d: Likewise.
- gas/bfin/flow2.d: Likewise.
- gas/bfin/load.d: Likewise.
- gas/bfin/logical.d: Likewise.
- gas/bfin/logical2.d: Likewise.
- gas/bfin/move.d: Likewise.
- gas/bfin/move2.d: Likewise.
- gas/bfin/parallel.d: Likewise.
- gas/bfin/parallel2.d: Likewise.
- gas/bfin/parallel3.d: Likewise.
- gas/bfin/parallel4.d: Likewise.
- gas/bfin/shift.d: Likewise.
- gas/bfin/shift2.d: Likewise.
- gas/bfin/stack.d: Likewise.
- gas/bfin/stack2.d: Likewise.
- gas/bfin/store.d: Likewise.
- gas/bfin/vector.d: Likewise.
- gas/bfin/vector2.d: Likewise.
- gas/bfin/video.d: Likewise.
- gas/bfin/video2.d: Likewise.
-
-2008-03-19 Andreas Krebbel <krebbel1@de.ibm.com>
-
- * gas/s390/zarch-z10.d: New file.
- * gas/s390/zarch-z10.s: New file.
- * gas/s390/s390.exp: Run the z10 testcases.
-
-2008-03-17 Richard Sandiford <rsandifo@nildram.co.uk>
-
- * gas/mips/elf-rel26.d: Add -32.
- * gas/mips/mips16-intermix.d: Likewise.
-
-2008-03-13 Nick Clifton <nickc@redhat.com>
-
- PR gas/5895
- * gas/macros/exit.s: New test case.
- * gas/macros/macros.exp: Run the new test, expect it to produce an
- error result.
-
-2008-03-09 Paul Brook <paul@codesourcery.com>
-
- * gas/arm/vfpv3-d16-bad.d: New test.
- * gas/arm/vfpv3-d16-bad.l: New test.
-
-2008-03-06 Andreas Krebbel <krebbel1@de.ibm.com>
-
- * gas/s390/esa-g5.d (cdfbr, cdfr, cefbr, cefr, cxfbr, cxfr,
- dxr, fidr, fier, fixr, lzdr, lzer, lzxr, sqdr, sqer, tp): Fix
- operand format.
- * gas/s390/esa-g5.s: Likewise.
- * gas/s390/zarch-z900.d (cdgbr, cdgr, cegbr, cegr, cxgbr,
- cxgr): Likewise.
- * gas/s390/zarch-z900.s: Likewise.
- * gas/s390/zarch-z9-109.d (cu41, cu42): Remove mask operand.
- * gas/s390/zarch-z9-109.s: Likewise.
-
-2008-03-04 Paul Brook <paul@codesourcery.com>
-
- * gas/arm/archv6m.d: New test.
- * gas/arm/archv6m.s: New test.
- * gas/arm/t16-bad.s: Test low register non flag setting add.
- * gas/arm/t16-bad.l: Update expected output.
-
-2008-03-03 H.J. Lu <hongjiu.lu@intel.com>
-
- PR gas/5543
- * gas/i386/i386.exp: Run inval-equ-1 and inval-equ-2.
-
- * gas/i386/inval-equ-1.l: New.
- * gas/i386/inval-equ-1.s: Likewise.
- * gas/i386/inval-equ-2.l: Likewise.
- * gas/i386/inval-equ-2.s: Likewise.
-
-2008-03-01 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/x86-64-branch.s: Add tests for 16-bit near indirect
- branches.
-
- * gas/i386/x86-64-inval.s: Remove tests for 16-bit near indirect
- branches.
-
- * gas/i386/x86-64-branch.d: Updated.
- * gas/i386/x86-64-inval.l: Likewise.
-
-2008-02-27 Nick Clifton <nickc@redhat.com>
-
- PR 3134
- * gas/h8300/pr3134.s: New test.
- * gas/h8300/pr3134.d: Expected disassembly
- * gas/h8300/h8300.exp: Run the new test.
-
- * gas/h8300/h8300-coff.exp: Fix test for COFF based ports to
- accept h8300-rtemscoff not just h8300-rtems.
-
-2008-02-26 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/jump.d: Updated for COFF.
-
-2008-02-23 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/jump.s: Add tests for far branches.
- * gas/i386/jump16.s: Likewise.
-
- * gas/i386/jump.d: Updated.
- * gas/i386/jump16.d: Likewise.
- * gas/i386/x86-64-inval.l: Likewise.
-
- * gas/i386/x86-64-inval.s: Add tests for 16-bit near indirect
- branches.
-
-2008-02-22 Nick Clifton <nickc@redhat.com>
-
- * gas/m68hc11/bug-1825.d: Update to match changes in the
- information generated with source-in-disassembly listings.
- * gas/m68hc11/indexed12.d: Likewise.
- * gas/m68hc11/insns-dwarf2.d: Likewise.
- * gas/m68hc11/lbranch-dwarf2.d: Likewise.
-
-2008-02-18 H.J. Lu <hongjiu.lu@intel.com>
-
- * cfi/cfi.exp (gas_x86_64_check): New.
- (gas_x86_32_check): Likewise.
- Run 32bit and 64bit tests for x86 targets if they are supportd.
-
-2008-02-18 Jan Beulich <jbeulich@novell.com>
-
- * gas/i386/att-regs.s, gas/i386/att-regs.d,
- gas/i386/intel-regs.s, gas/i386/intel-regs.d: New.
- * gas/i386/i386.exp: Run new tests.
-
-2008-02-14 Nick Clifton <nickc@redhat.com>
-
- PR gas/5712
- * gas/arm/fp-save.s: New test.
- * gas/arm/fp-save.d: Expected disassembly.
-
-2008-02-13 Adam Nemet <anemet@caviumnetworks.com>
-
- * gas/mips/branch-misc-2pic-64.d (#name): Have a unique name
- different from the branch-misc-2-64.d test.
-
-2008-02-13 Jan Beulich <jbeulich@novell.com>
-
- * gas/i386/intelok.s: Replace invalid offset expression with
- valid ones.
- * gas/i386/x86_64.s: Likewise.
-
-2008-02-13 Jan Beulich <jbeulich@novell.com>
-
- * gas/i386/intelbad.s, gas/i386/intelok.s: Add 'bound' tests.
- * gas/i386/intelbad.l, gas/i386/intelok.l, gas/i386/intelok.e,
- gas/i386/opcode-intel.d: Adjust.
-
-2008-02-13 Jan Beulich <jbeulich@novell.com>
-
- * gas/cfi/cfi-i386.s: Add code testing use of all registers.
- Fix a few comments.
- * gas/cfi/cfi-x86_64.s: Likewise.
- * gas/cfi/cfi-i386.d, gas/cfi/cfi-x86_64.d: Adjust.
-
-2008-02-12 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/i386.exp: Run x86-64-arch-2 instead of
- x86-64-arch-10.
-
- * gas/i386/x86-64-arch-10.d: Removed.
-
- * gas/i386/x86-64-arch-2.d: New.
- * gas/i386/x86-64-arch-2.s: Likewise.
-
-2008-02-12 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/x86-64-xsave.d: Remove prefix.
-
-2008-02-11 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/arch-10.s: Add xgetbv.
-
- * gas/i386/arch-10.d: Updated.
- * gas/i386/arch-10-1.l: Likewise.
- * gas/i386/arch-10-2.l: Likewise.
- * gas/i386/arch-10-3.l: Likewise.
- * gas/i386/arch-10-4.l: Likewise.
- * gas/i386/x86-64-arch-10.d: Likewise.
-
-2002-02-11 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/i386.exp: Run xsave, xsave-intel, x86-64-xsave
- and x86-64-xsave-intel.
-
- * gas/i386/x86-64-xsave-intel.d: New file.
- * gas/i386/x86-64-xsave.d: Likewise.
- * gas/i386/x86-64-xsave.s: Likewise.
- * gas/i386/xsave-intel.d: Likewise.
- * gas/i386/xsave.d: Likewise.
- * gas/i386/xsave.s: Likewise.
-
-2008-02-05 Adam Nemet <anemet@caviumnetworks.com>
-
- * gas/mips/mips.exp: Invoke the tests smartmips, mips32-dsp,
- mips32-dspr2, mips64-dsp and mips32-mt with run_dump_test instead
- of run_dump_test_arches.
- * gas/mips/smartmips.d: Pass -mips32.
- * gas/mips/mips64-dsp.d: Pass -mips64r2.
- * gas/mips/mips32-dsp.d: Pass -mips32r2.
- * gas/mips/mips32-dspr2.d: Likewise.
- * gas/mips/mips32-mt.d: Likewise.
-
-2008-02-04 Adam Nemet <anemet@caviumnetworks.com>
-
- * gas/mips/mips.exp: Call mips_arch_create for Octeon. Invoke
- Octeon tests.
- * gas/mips/octeon.s, gas/mips/octeon.d: New test.
-
-2008-01-31 Marc Gauthier <marc@tensilica.com>
-
- * gas/all/gas.exp: Recognize Xtensa processor variants.
- * gas/elf/elf.exp: Likewise.
- * gas/lns/lns.exp: Likewise.
-
-2008-01-28 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/cfi/cfi-alpha-1.d: Replace DW_CFA_def_cfa_reg with
- DW_CFA_def_cfa_register.
- * gas/cfi/cfi-alpha-3.d: Likewise.
- * gas/cfi/cfi-hppa-1.d: Likewise.
- * gas/cfi/cfi-i386.d: Likewise.
- * gas/cfi/cfi-m68k.d: Likewise.
- * gas/cfi/cfi-mips-1.d: Likewise.
- * gas/cfi/cfi-sh-1.d: Likewise.
- * gas/cfi/cfi-sparc-1.d: Likewise.
- * gas/cfi/cfi-sparc64-1.d: Likewise.
- * gas/cfi/cfi-x86_64.d: Likewise.
-
- * gas/cfi/cfi-common-1.d: Updated for i386/x86-64 register
- names.
- * gas/cfi/cfi-common-2.d: Likewise.
- * gas/cfi/cfi-common-5.d: Likewise.
- * gas/cfi/cfi-i386.d: Likewise.
- * gas/cfi/cfi-x86_64.d: Likewise.
-
-2008-01-24 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/x86-64-sib.s: Add tests for r12.
-
- * gas/i386/x86-64-sib-intel.d: Updated.
- * gas/i386/x86-64-sib.d: Likewise.
-
-2008-01-23 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/i386.exp : Run x86-64-arch-1 and x86-64-arch-10.
-
- * gas/i386/x86-64-arch-1.d: New.
- * gas/i386/x86-64-arch-1.s: Likewise.
- * gas/i386/x86-64-arch-10.d: Likewise.
-
-2008-01-23 Tristan Gingold <gingold@adacore.com>
-
- * gas/ia64/regs.d: Updated as the ia64 disassembler now displays
- symbolic names for all ar registers.
-
-2008-01-22 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/arch-10.d: New.
- * gas/i386/arch-11.s: Likewise.
- * gas/i386/arch-12.d: Likewise.
- * gas/i386/arch-12.s: Likewise.
-
- * gas/i386/i386.exp: Run arch-11 and arch-12.
-
-2008-01-22 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/arch-10-1.l: New.
- * gas/i386/arch-10-1.s: Likewise.
- * gas/i386/arch-10-2.l: Likewise.
- * gas/i386/arch-10-2.s: Likewise.
- * gas/i386/arch-10-3.l: Likewise.
- * gas/i386/arch-10-3.s: Likewise.
- * gas/i386/arch-10-4.l: Likewise.
- * gas/i386/arch-10-4.s: Likewise.
- * gas/i386/arch-10.d: Likewise.
- * gas/i386/arch-10.s: Likewise.
-
- * gas/i386/i386.exp: Run arch-10, arch-10-1, arch-10-2,
- arch-10-3 and arch-10-4.
-
- * gas/i386/nops-2.s: Use movsbl instead of cmove.
- * gas/i386/nops-2-i386.d: Updated.
- * gas/i386/nops-2-merom.d: Likewise.
- * gas/i386/nops-2.d: Likewise.
- * gas/i386/x86-64-nops-2.d: Likewise.
-
-2008-01-15 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/prescott.s: Add tests for movddup in Intel syntax.
- * gas/i386/x86-64-prescott.s: Likewise.
-
- * gas/i386/prescott.d: Updated.
- * gas/i386/x86-64-prescott.d: Likewise.
-
-2008-01-15 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/i386.s: Add more tests for movsx and movzx.
- * gas/i386/x86_64.s: Likewise.
-
- * gas/i386/inval.s: Remove tests for movsxw and movzxw.
-
- * gas/i386/x86-64-inval.s: Remove tests for movsxb, movsxw,
- movsxl, movzxb and movzxw.
-
- * gas/i386/i386.d: Updated.
- * gas/i386/inval.l: Likewise.
- * gas/i386/x86_64.d: Likewise.
- * gas/i386/x86-64-inval.l: Likewise.
-
-2008-01-14 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/i386.s: Add tests for movsx, movzx and movnti.
- * gas/i386/inval.s: Likewise.
- * gas/i386/x86_64.s: Likewise.
- * gas/i386/x86-64-inval.s: Likewise.
-
- * gas/i386/i386.d: Updated.
- * gas/i386/inval.l: Likewise.
- * gas/i386/x86_64.d: Likewise.
- * gas/i386/x86-64-inval.l: Likewise.
-
-2008-01-12 H.J. Lu <hongjiu.lu@intel.com>
-
- PR gas/5534
- * gas/i386/i386.s: Add tests for fnstsw and fstsw.
- * gas/i386/inval.s: Likewise.
- * gas/i386/x86_64.s: Likewise.
-
- * gas/i386/intel.s: Use word instead of dword on ss.
-
- * gas/i386/x86-64-inval.s: Add tests for fnstsw, fstsw, in
- and out.
-
- * gas/i386/prefix.s: Remove invalid fstsw.
-
- * gas/i386/inval.l: Updated.
- * gas/i386/intelbad.l: Likewise.
- * gas/i386/i386.d: Likewise.
- * gas/i386/x86_64.d: Likewise.
- * gas/i386/x86-64-inval.l: Likewise.
- * gas/i386/prefix.d: Updated.
-
-2008-01-10 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/nops.s: Add more tests with opcodes from 0x0f19
- to 0x0f1f.
- * gas/i386/x86-64-nops.s: Likewise.
-
- * gas/i386/nops.d: Updated.
- * gas/i386/x86-64-nops.d: Likewise.
-
-2008-01-09 Bob Wilson <bob.wilson@acm.org>
-
- * gas/lns/lns.exp: Run new lns-big-delta test for targets that set
- DWARF2_USE_FIXED_ADVANCE_PC.
- * gas/lns/lns-big-delta.s: New.
- * gas/lns/lns-big-delta.d: New.
-
-2008-01-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- PR gas/5322
- * lib/gas-defs.exp (gas_host_run): Add fourth argument to regsub
- command.
-
-2008-01-05 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/intel.s: Add tests for fadd, faddp, fdiv, fdivp,
- fdivr, fdivrp, fmul, fmulp, fsub, fsubp, fsubr and fsubrp.
-
- * gas/i386/intel.d: Updated.
- * gas/i386/intel.e: Likewise.
-
-2008-01-04 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/rexw.d: New.
- * gas/i386/rexw.s: Likewise.
-
- * gas/i386/x86-64-sse4_1-intel.d: Updated.
- * gas/i386/x86-64-sse4_1.d: Likewise.
-
-2008-01-04 Nick Clifton <nickc@redhat.com>
-
- * gas/ppc/altivec_and_spe.s: New test - checks that ISA extension
- command line options (-maltivec, -mspe) can be specified before
- CPU selection command line options.
- * gas/ppc/altivec_and_spe.d: Expected disassembly.
- * gas/ppc/ppc.exp: Run the new test
-
-2008-01-03 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/arch-9.d: New file.
- * gas/i386/arch-9.s: Likewise.
-
- * gas/i386/i386.exp: Run arch-9.
-
-2008-01-02 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/arch-5.d: New file.
- * gas/i386/arch-5.s: Likewise.
- * gas/i386/arch-6.d: Likewise.
- * gas/i386/arch-6.s: Likewise.
- * gas/i386/arch-7.d: Likewise.
- * gas/i386/arch-7.s: Likewise.
- * gas/i386/arch-8.d: Likewise.
- * gas/i386/arch-8.s: Likewise.
-
- * gas/i386/i386.exp: Run arch-5, arch-6, arch-7 and arch-8.
-
-2008-01-02 H.J. Lu <hongjiu.lu@intel.com>
-
- * gas/i386/i386.s: Add tests for movq.
- * gas/i386/x86_64.s: Likewise.
-
- * gas/i386/i386.d Updated.
- * gas/i386/x86_64.d: Likewise.
-
-2008-01-02 H.J. Lu <hongjiu.lu@intel.com>
-
- PR gas/5534
- * gas/i386/intel.s: Use QWORD on movq instead of DWORD.
-
- * gas/i386/inval.s: Add tests for movq.
- * gas/i386/x86-64-inval.s: Likewise.
-
- * gas/i386/inval.l: Updated.
- * gas/i386/x86-64-inval.l: Likewise.
-
-2008-01-02 Catherine Moore <clm@codesourcery.com>
-
- * gas/mips/jalr.s: New test.
- * gas/mips/jalr.l: New test output.
- * gas/mips/mips.exp: Run new test.
-
-For older changes see ChangeLog-2007
-
-Local Variables:
-mode: change-log
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
diff --git a/gas/testsuite/gas/cfi/cfi-i386.d b/gas/testsuite/gas/cfi/cfi-i386.d
deleted file mode 100644
index ef477d32be5..00000000000
--- a/gas/testsuite/gas/cfi/cfi-i386.d
+++ /dev/null
@@ -1,152 +0,0 @@
-#readelf: -wf
-#name: CFI on i386
-The section .eh_frame contains:
-
-00000000 00000014 00000000 CIE
- Version: 1
- Augmentation: "zR"
- Code alignment factor: 1
- Data alignment factor: -4
- Return address column: 8
- Augmentation data: 1b
-
- DW_CFA_def_cfa: r4 \(esp\) ofs 4
- DW_CFA_offset: r8 \(eip\) at cfa-4
- DW_CFA_nop
- DW_CFA_nop
-
-00000018 00000014 0000001c FDE cie=00000000 pc=00000000..00000012
- DW_CFA_advance_loc: 6 to 00000006
- DW_CFA_def_cfa_offset: 4664
- DW_CFA_advance_loc: 11 to 00000011
- DW_CFA_def_cfa_offset: 4
-
-00000030 00000018 00000034 FDE cie=00000000 pc=00000012..0000001f
- DW_CFA_advance_loc: 1 to 00000013
- DW_CFA_def_cfa_offset: 8
- DW_CFA_offset: r5 \(ebp\) at cfa-8
- DW_CFA_advance_loc: 2 to 00000015
- DW_CFA_def_cfa_register: r5 \(ebp\)
- DW_CFA_advance_loc: 9 to 0000001e
- DW_CFA_def_cfa_register: r4 \(esp\)
-
-0000004c 00000014 00000050 FDE cie=00000000 pc=0000001f..0000002f
- DW_CFA_advance_loc: 2 to 00000021
- DW_CFA_def_cfa_register: r3 \(ebx\)
- DW_CFA_advance_loc: 13 to 0000002e
- DW_CFA_def_cfa: r4 \(esp\) ofs 4
-
-00000064 00000010 00000068 FDE cie=00000000 pc=0000002f..00000035
- DW_CFA_nop
- DW_CFA_nop
- DW_CFA_nop
-
-00000078 00000010 0000007c FDE cie=00000000 pc=00000035..00000044
- DW_CFA_nop
- DW_CFA_nop
- DW_CFA_nop
-
-0000008c 00000010 00000000 CIE
- Version: 1
- Augmentation: "zR"
- Code alignment factor: 1
- Data alignment factor: -4
- Return address column: 8
- Augmentation data: 1b
-
- DW_CFA_undefined: r8 \(eip\)
- DW_CFA_nop
-
-000000a0 00000094 00000018 FDE cie=0000008c pc=00000044..00000071
- DW_CFA_advance_loc: 1 to 00000045
- DW_CFA_undefined: r0 \(eax\)
- DW_CFA_advance_loc: 1 to 00000046
- DW_CFA_undefined: r1 \(ecx\)
- DW_CFA_advance_loc: 1 to 00000047
- DW_CFA_undefined: r2 \(edx\)
- DW_CFA_advance_loc: 1 to 00000048
- DW_CFA_undefined: r3 \(ebx\)
- DW_CFA_advance_loc: 1 to 00000049
- DW_CFA_undefined: r4 \(esp\)
- DW_CFA_advance_loc: 1 to 0000004a
- DW_CFA_undefined: r5 \(ebp\)
- DW_CFA_advance_loc: 1 to 0000004b
- DW_CFA_undefined: r6 \(esi\)
- DW_CFA_advance_loc: 1 to 0000004c
- DW_CFA_undefined: r7 \(edi\)
- DW_CFA_advance_loc: 1 to 0000004d
- DW_CFA_undefined: r9 \(eflags\)
- DW_CFA_advance_loc: 1 to 0000004e
- DW_CFA_undefined: r40 \(es\)
- DW_CFA_advance_loc: 1 to 0000004f
- DW_CFA_undefined: r41 \(cs\)
- DW_CFA_advance_loc: 1 to 00000050
- DW_CFA_undefined: r43 \(ds\)
- DW_CFA_advance_loc: 1 to 00000051
- DW_CFA_undefined: r42 \(ss\)
- DW_CFA_advance_loc: 1 to 00000052
- DW_CFA_undefined: r44 \(fs\)
- DW_CFA_advance_loc: 1 to 00000053
- DW_CFA_undefined: r45 \(gs\)
- DW_CFA_advance_loc: 1 to 00000054
- DW_CFA_undefined: r48 \(tr\)
- DW_CFA_advance_loc: 1 to 00000055
- DW_CFA_undefined: r49 \(ldtr\)
- DW_CFA_advance_loc: 1 to 00000056
- DW_CFA_undefined: r39 \(mxcsr\)
- DW_CFA_advance_loc: 1 to 00000057
- DW_CFA_undefined: r21 \(xmm0\)
- DW_CFA_advance_loc: 1 to 00000058
- DW_CFA_undefined: r22 \(xmm1\)
- DW_CFA_advance_loc: 1 to 00000059
- DW_CFA_undefined: r23 \(xmm2\)
- DW_CFA_advance_loc: 1 to 0000005a
- DW_CFA_undefined: r24 \(xmm3\)
- DW_CFA_advance_loc: 1 to 0000005b
- DW_CFA_undefined: r25 \(xmm4\)
- DW_CFA_advance_loc: 1 to 0000005c
- DW_CFA_undefined: r26 \(xmm5\)
- DW_CFA_advance_loc: 1 to 0000005d
- DW_CFA_undefined: r27 \(xmm6\)
- DW_CFA_advance_loc: 1 to 0000005e
- DW_CFA_undefined: r28 \(xmm7\)
- DW_CFA_advance_loc: 1 to 0000005f
- DW_CFA_undefined: r37 \(fcw\)
- DW_CFA_advance_loc: 1 to 00000060
- DW_CFA_undefined: r38 \(fsw\)
- DW_CFA_advance_loc: 1 to 00000061
- DW_CFA_undefined: r11 \(st\(?0?\)?\)
- DW_CFA_advance_loc: 1 to 00000062
- DW_CFA_undefined: r12 \(st\(?1\)?\)
- DW_CFA_advance_loc: 1 to 00000063
- DW_CFA_undefined: r13 \(st\(?2\)?\)
- DW_CFA_advance_loc: 1 to 00000064
- DW_CFA_undefined: r14 \(st\(?3\)?\)
- DW_CFA_advance_loc: 1 to 00000065
- DW_CFA_undefined: r15 \(st\(?4\)?\)
- DW_CFA_advance_loc: 1 to 00000066
- DW_CFA_undefined: r16 \(st\(?5\)?\)
- DW_CFA_advance_loc: 1 to 00000067
- DW_CFA_undefined: r17 \(st\(?6\)?\)
- DW_CFA_advance_loc: 1 to 00000068
- DW_CFA_undefined: r18 \(st\(?7\)?\)
- DW_CFA_advance_loc: 1 to 00000069
- DW_CFA_undefined: r29 \(mm0\)
- DW_CFA_advance_loc: 1 to 0000006a
- DW_CFA_undefined: r30 \(mm1\)
- DW_CFA_advance_loc: 1 to 0000006b
- DW_CFA_undefined: r31 \(mm2\)
- DW_CFA_advance_loc: 1 to 0000006c
- DW_CFA_undefined: r32 \(mm3\)
- DW_CFA_advance_loc: 1 to 0000006d
- DW_CFA_undefined: r33 \(mm4\)
- DW_CFA_advance_loc: 1 to 0000006e
- DW_CFA_undefined: r34 \(mm5\)
- DW_CFA_advance_loc: 1 to 0000006f
- DW_CFA_undefined: r35 \(mm6\)
- DW_CFA_advance_loc: 1 to 00000070
- DW_CFA_undefined: r36 \(mm7\)
- DW_CFA_nop
- DW_CFA_nop
- DW_CFA_nop
-
diff --git a/gas/testsuite/gas/cfi/cfi-i386.s b/gas/testsuite/gas/cfi/cfi-i386.s
deleted file mode 100644
index 9da0db122db..00000000000
--- a/gas/testsuite/gas/cfi/cfi-i386.s
+++ /dev/null
@@ -1,165 +0,0 @@
- .text
-
-#; func_locvars
-#; - function with a space on the stack
-#; allocated for local variables
-
- .type func_locvars,@function
-func_locvars:
- .cfi_startproc
-
- #; alocate space for local vars
- sub $0x1234,%esp
- .cfi_adjust_cfa_offset 0x1234
-
- #; dummy body
- movl $1,%eax
-
- #; release space of local vars and return
- add $0x1234,%esp
- .cfi_adjust_cfa_offset -0x1234
- ret
- .cfi_endproc
-
-#; func_prologue
-#; - functions that begins with standard
-#; prologue: "pushq %rbp; movq %rsp,%rbp"
-
- .type func_prologue,@function
-func_prologue:
- .cfi_startproc
-
- #; prologue, CFI is valid after
- #; each instruction.
- pushl %ebp
- .cfi_def_cfa_offset 8
- .cfi_offset ebp,-8
- movl %esp, %ebp
- .cfi_def_cfa_register ebp
-
- #; function body
- call func_locvars
- addl $3, %eax
-
- #; epilogue with valid CFI
- #; (we're better than gcc :-)
- leave
- .cfi_def_cfa_register esp
- ret
- .cfi_endproc
-
-#; func_otherreg
-#; - function that moves frame pointer to
-#; another register (ebx) and then allocates
-#; a space for local variables
-
- .type func_otherreg,@function
-func_otherreg:
- .cfi_startproc
-
- #; save frame pointer to ebx
- mov %esp,%ebx
- .cfi_def_cfa_register ebx
-
- #; alocate space for local vars
- #; (no .cfi_{def,adjust}_cfa_offset here,
- #; because CFA is computed from ebx!)
- sub $100,%esp
-
- #; function body
- call func_prologue
- add $2, %eax
-
- #; restore frame pointer from ebx
- mov %ebx,%esp
- .cfi_def_cfa esp,4
- ret
- .cfi_endproc
-
-#; main
-#; - typical function
- .type main,@function
-main:
- .cfi_startproc
-
- #; only function body that doesn't
- #; touch the stack at all.
- call func_otherreg
-
- #; return
- ret
- .cfi_endproc
-
-#; _start
-#; - standard entry point
-
- .type _start,@function
- .globl _start
-_start:
- .cfi_startproc
- call main
- movl %eax,%edi
- movl $0x1,%eax
- int $0x80
- hlt
- .cfi_endproc
-
-#; func_all_registers
-#; - test for all .cfi register numbers.
-#; This function is never called and the CFI info doesn't make sense.
-
- .type func_all_registers,@function
-func_all_registers:
- .cfi_startproc simple
-
- .cfi_undefined eip ; nop
- .cfi_undefined eax ; nop
- .cfi_undefined ecx ; nop
- .cfi_undefined edx ; nop
- .cfi_undefined ebx ; nop
- .cfi_undefined esp ; nop
- .cfi_undefined ebp ; nop
- .cfi_undefined esi ; nop
- .cfi_undefined edi ; nop
- .cfi_undefined eflags ; nop
-
- .cfi_undefined es ; nop
- .cfi_undefined cs ; nop
- .cfi_undefined ds ; nop
- .cfi_undefined ss ; nop
- .cfi_undefined fs ; nop
- .cfi_undefined gs ; nop
- .cfi_undefined tr ; nop
- .cfi_undefined ldtr ; nop
-
- .cfi_undefined mxcsr ; nop
- .cfi_undefined xmm0 ; nop
- .cfi_undefined xmm1 ; nop
- .cfi_undefined xmm2 ; nop
- .cfi_undefined xmm3 ; nop
- .cfi_undefined xmm4 ; nop
- .cfi_undefined xmm5 ; nop
- .cfi_undefined xmm6 ; nop
- .cfi_undefined xmm7 ; nop
-
- .cfi_undefined fcw ; nop
- .cfi_undefined fsw ; nop
- .cfi_undefined st ; nop
- .cfi_undefined st(1) ; nop
- .cfi_undefined st(2) ; nop
- .cfi_undefined st(3) ; nop
- .cfi_undefined st(4) ; nop
- .cfi_undefined st(5) ; nop
- .cfi_undefined st(6) ; nop
- .cfi_undefined st(7) ; nop
-
- .cfi_undefined mm0 ; nop
- .cfi_undefined mm1 ; nop
- .cfi_undefined mm2 ; nop
- .cfi_undefined mm3 ; nop
- .cfi_undefined mm4 ; nop
- .cfi_undefined mm5 ; nop
- .cfi_undefined mm6 ; nop
- .cfi_undefined mm7 ; nop
-
- .cfi_endproc
diff --git a/gas/testsuite/gas/cfi/cfi-x86_64.d b/gas/testsuite/gas/cfi/cfi-x86_64.d
deleted file mode 100644
index 3fc7d530f84..00000000000
--- a/gas/testsuite/gas/cfi/cfi-x86_64.d
+++ /dev/null
@@ -1,227 +0,0 @@
-#readelf: -wf
-#name: CFI on x86-64
-The section .eh_frame contains:
-
-00000000 00000014 00000000 CIE
- Version: 1
- Augmentation: "zR"
- Code alignment factor: 1
- Data alignment factor: -8
- Return address column: 16
- Augmentation data: 1b
-
- DW_CFA_def_cfa: r7 \(rsp\) ofs 8
- DW_CFA_offset: r16 \(rip\) at cfa-8
- DW_CFA_nop
- DW_CFA_nop
-
-00000018 00000014 0000001c FDE cie=00000000 pc=00000000..00000014
- DW_CFA_advance_loc: 7 to 00000007
- DW_CFA_def_cfa_offset: 4668
- DW_CFA_advance_loc: 12 to 00000013
- DW_CFA_def_cfa_offset: 8
-
-00000030 0000001c 00000034 FDE cie=00000000 pc=00000014..00000022
- DW_CFA_advance_loc: 1 to 00000015
- DW_CFA_def_cfa_offset: 16
- DW_CFA_offset: r6 \(rbp\) at cfa-16
- DW_CFA_advance_loc: 3 to 00000018
- DW_CFA_def_cfa_register: r6 \(rbp\)
- DW_CFA_advance_loc: 9 to 00000021
- DW_CFA_def_cfa: r7 \(rsp\) ofs 8
- DW_CFA_nop
- DW_CFA_nop
- DW_CFA_nop
-
-00000050 00000014 00000054 FDE cie=00000000 pc=00000022..00000035
- DW_CFA_advance_loc: 3 to 00000025
- DW_CFA_def_cfa_register: r8 \(r8\)
- DW_CFA_advance_loc: 15 to 00000034
- DW_CFA_def_cfa_register: r7 \(rsp\)
- DW_CFA_nop
-
-00000068 00000010 0000006c FDE cie=00000000 pc=00000035..0000003b
- DW_CFA_nop
- DW_CFA_nop
- DW_CFA_nop
-
-0000007c 00000010 00000080 FDE cie=00000000 pc=0000003b..0000004d
- DW_CFA_nop
- DW_CFA_nop
- DW_CFA_nop
-
-00000090 00000010 00000000 CIE
- Version: 1
- Augmentation: "zR"
- Code alignment factor: 1
- Data alignment factor: -8
- Return address column: 16
- Augmentation data: 1b
-
- DW_CFA_def_cfa: r7 \(rsp\) ofs 8
-
-000000a4 0000002c 00000018 FDE cie=00000090 pc=0000004d..00000058
- DW_CFA_advance_loc: 1 to 0000004e
- DW_CFA_def_cfa_offset: 16
- DW_CFA_advance_loc: 1 to 0000004f
- DW_CFA_def_cfa_register: r8 \(r8\)
- DW_CFA_advance_loc: 1 to 00000050
- DW_CFA_def_cfa_offset: 4676
- DW_CFA_advance_loc: 1 to 00000051
- DW_CFA_offset_extended_sf: r4 \(rsi\) at cfa\+16
- DW_CFA_advance_loc: 1 to 00000052
- DW_CFA_register: r8 \(r8\) in r9 \(r9\)
- DW_CFA_advance_loc: 1 to 00000053
- DW_CFA_remember_state
- DW_CFA_advance_loc: 1 to 00000054
- DW_CFA_restore: r6 \(rbp\)
- DW_CFA_advance_loc: 1 to 00000055
- DW_CFA_undefined: r16 \(rip\)
- DW_CFA_advance_loc: 1 to 00000056
- DW_CFA_same_value: r3 \(rbx\)
- DW_CFA_advance_loc: 1 to 00000057
- DW_CFA_restore_state
- DW_CFA_nop
-
-000000d4 00000010 00000000 CIE
- Version: 1
- Augmentation: "zR"
- Code alignment factor: 1
- Data alignment factor: -8
- Return address column: 16
- Augmentation data: 1b
-
- DW_CFA_undefined: r16 \(rip\)
- DW_CFA_nop
-
-000000e8 000000cc 00000018 FDE cie=000000d4 pc=00000058..00000097
- DW_CFA_advance_loc: 1 to 00000059
- DW_CFA_undefined: r0 \(rax\)
- DW_CFA_advance_loc: 1 to 0000005a
- DW_CFA_undefined: r2 \(rcx\)
- DW_CFA_advance_loc: 1 to 0000005b
- DW_CFA_undefined: r1 \(rdx\)
- DW_CFA_advance_loc: 1 to 0000005c
- DW_CFA_undefined: r3 \(rbx\)
- DW_CFA_advance_loc: 1 to 0000005d
- DW_CFA_undefined: r7 \(rsp\)
- DW_CFA_advance_loc: 1 to 0000005e
- DW_CFA_undefined: r6 \(rbp\)
- DW_CFA_advance_loc: 1 to 0000005f
- DW_CFA_undefined: r4 \(rsi\)
- DW_CFA_advance_loc: 1 to 00000060
- DW_CFA_undefined: r5 \(rdi\)
- DW_CFA_advance_loc: 1 to 00000061
- DW_CFA_undefined: r8 \(r8\)
- DW_CFA_advance_loc: 1 to 00000062
- DW_CFA_undefined: r9 \(r9\)
- DW_CFA_advance_loc: 1 to 00000063
- DW_CFA_undefined: r10 \(r10\)
- DW_CFA_advance_loc: 1 to 00000064
- DW_CFA_undefined: r11 \(r11\)
- DW_CFA_advance_loc: 1 to 00000065
- DW_CFA_undefined: r12 \(r12\)
- DW_CFA_advance_loc: 1 to 00000066
- DW_CFA_undefined: r13 \(r13\)
- DW_CFA_advance_loc: 1 to 00000067
- DW_CFA_undefined: r14 \(r14\)
- DW_CFA_advance_loc: 1 to 00000068
- DW_CFA_undefined: r15 \(r15\)
- DW_CFA_advance_loc: 1 to 00000069
- DW_CFA_undefined: r49 \([er]flags\)
- DW_CFA_advance_loc: 1 to 0000006a
- DW_CFA_undefined: r50 \(es\)
- DW_CFA_advance_loc: 1 to 0000006b
- DW_CFA_undefined: r51 \(cs\)
- DW_CFA_advance_loc: 1 to 0000006c
- DW_CFA_undefined: r53 \(ds\)
- DW_CFA_advance_loc: 1 to 0000006d
- DW_CFA_undefined: r52 \(ss\)
- DW_CFA_advance_loc: 1 to 0000006e
- DW_CFA_undefined: r54 \(fs\)
- DW_CFA_advance_loc: 1 to 0000006f
- DW_CFA_undefined: r55 \(gs\)
- DW_CFA_advance_loc: 1 to 00000070
- DW_CFA_undefined: r62 \(tr\)
- DW_CFA_advance_loc: 1 to 00000071
- DW_CFA_undefined: r63 \(ldtr\)
- DW_CFA_advance_loc: 1 to 00000072
- DW_CFA_undefined: r58 \(fs\.base\)
- DW_CFA_advance_loc: 1 to 00000073
- DW_CFA_undefined: r59 \(gs\.base\)
- DW_CFA_advance_loc: 1 to 00000074
- DW_CFA_undefined: r64 \(mxcsr\)
- DW_CFA_advance_loc: 1 to 00000075
- DW_CFA_undefined: r17 \(xmm0\)
- DW_CFA_advance_loc: 1 to 00000076
- DW_CFA_undefined: r18 \(xmm1\)
- DW_CFA_advance_loc: 1 to 00000077
- DW_CFA_undefined: r19 \(xmm2\)
- DW_CFA_advance_loc: 1 to 00000078
- DW_CFA_undefined: r20 \(xmm3\)
- DW_CFA_advance_loc: 1 to 00000079
- DW_CFA_undefined: r21 \(xmm4\)
- DW_CFA_advance_loc: 1 to 0000007a
- DW_CFA_undefined: r22 \(xmm5\)
- DW_CFA_advance_loc: 1 to 0000007b
- DW_CFA_undefined: r23 \(xmm6\)
- DW_CFA_advance_loc: 1 to 0000007c
- DW_CFA_undefined: r24 \(xmm7\)
- DW_CFA_advance_loc: 1 to 0000007d
- DW_CFA_undefined: r25 \(xmm8\)
- DW_CFA_advance_loc: 1 to 0000007e
- DW_CFA_undefined: r26 \(xmm9\)
- DW_CFA_advance_loc: 1 to 0000007f
- DW_CFA_undefined: r27 \(xmm10\)
- DW_CFA_advance_loc: 1 to 00000080
- DW_CFA_undefined: r28 \(xmm11\)
- DW_CFA_advance_loc: 1 to 00000081
- DW_CFA_undefined: r29 \(xmm12\)
- DW_CFA_advance_loc: 1 to 00000082
- DW_CFA_undefined: r30 \(xmm13\)
- DW_CFA_advance_loc: 1 to 00000083
- DW_CFA_undefined: r31 \(xmm14\)
- DW_CFA_advance_loc: 1 to 00000084
- DW_CFA_undefined: r32 \(xmm15\)
- DW_CFA_advance_loc: 1 to 00000085
- DW_CFA_undefined: r65 \(fcw\)
- DW_CFA_advance_loc: 1 to 00000086
- DW_CFA_undefined: r66 \(fsw\)
- DW_CFA_advance_loc: 1 to 00000087
- DW_CFA_undefined: r33 \(st\(?0?\)?\)
- DW_CFA_advance_loc: 1 to 00000088
- DW_CFA_undefined: r34 \(st\(?1\)?\)
- DW_CFA_advance_loc: 1 to 00000089
- DW_CFA_undefined: r35 \(st\(?2\)?\)
- DW_CFA_advance_loc: 1 to 0000008a
- DW_CFA_undefined: r36 \(st\(?3\)?\)
- DW_CFA_advance_loc: 1 to 0000008b
- DW_CFA_undefined: r37 \(st\(?4\)?\)
- DW_CFA_advance_loc: 1 to 0000008c
- DW_CFA_undefined: r38 \(st\(?5\)?\)
- DW_CFA_advance_loc: 1 to 0000008d
- DW_CFA_undefined: r39 \(st\(?6\)?\)
- DW_CFA_advance_loc: 1 to 0000008e
- DW_CFA_undefined: r40 \(st\(?7\)?\)
- DW_CFA_advance_loc: 1 to 0000008f
- DW_CFA_undefined: r41 \(mm0\)
- DW_CFA_advance_loc: 1 to 00000090
- DW_CFA_undefined: r42 \(mm1\)
- DW_CFA_advance_loc: 1 to 00000091
- DW_CFA_undefined: r43 \(mm2\)
- DW_CFA_advance_loc: 1 to 00000092
- DW_CFA_undefined: r44 \(mm3\)
- DW_CFA_advance_loc: 1 to 00000093
- DW_CFA_undefined: r45 \(mm4\)
- DW_CFA_advance_loc: 1 to 00000094
- DW_CFA_undefined: r46 \(mm5\)
- DW_CFA_advance_loc: 1 to 00000095
- DW_CFA_undefined: r47 \(mm6\)
- DW_CFA_advance_loc: 1 to 00000096
- DW_CFA_undefined: r48 \(mm7\)
- DW_CFA_nop
- DW_CFA_nop
- DW_CFA_nop
- DW_CFA_nop
- DW_CFA_nop
-
diff --git a/gas/testsuite/gas/cfi/cfi-x86_64.s b/gas/testsuite/gas/cfi/cfi-x86_64.s
deleted file mode 100644
index 65c2aa27595..00000000000
--- a/gas/testsuite/gas/cfi/cfi-x86_64.s
+++ /dev/null
@@ -1,214 +0,0 @@
- .text
-
-#; func_locvars
-#; - function with a space on the stack
-#; allocated for local variables
-
- .type func_locvars,@function
-func_locvars:
- .cfi_startproc
-
- #; alocate space for local vars
- sub $0x1234,%rsp
- .cfi_adjust_cfa_offset 0x1234
-
- #; dummy body
- movl $1,%eax
-
- #; release space of local vars and return
- add $0x1234,%rsp
- .cfi_adjust_cfa_offset -0x1234
- ret
- .cfi_endproc
-
-#; func_prologue
-#; - functions that begins with standard
-#; prologue: "pushq %rbp; movq %rsp,%rbp"
-
- .type func_prologue,@function
-func_prologue:
- .cfi_startproc
-
- #; prologue, CFI is valid after
- #; each instruction.
- pushq %rbp
- .cfi_def_cfa_offset 16
- .cfi_offset %rbp, -16
- movq %rsp, %rbp
- .cfi_def_cfa_register %rbp
-
- #; function body
- call func_locvars
- addl $3, %eax
-
- #; epilogue with valid CFI
- #; (we're better than gcc :-)
- leaveq
- .cfi_def_cfa %rsp, 8
- ret
- .cfi_endproc
-
-#; func_otherreg
-#; - function that moves frame pointer to
-#; another register (r12) and then allocates
-#; a space for local variables
-
- .type func_otherreg,@function
-func_otherreg:
- .cfi_startproc
-
- #; save frame pointer to r8
- movq %rsp,%r8
- .cfi_def_cfa_register r8
-
- #; alocate space for local vars
- #; (no .cfi_{def,adjust}_cfa_offset here,
- #; because CFA is computed from r8!)
- sub $100,%rsp
-
- #; function body
- call func_prologue
- addl $2, %eax
-
- #; restore frame pointer from r8
- movq %r8,%rsp
- .cfi_def_cfa_register rsp
- ret
- .cfi_endproc
-
-#; main
-#; - typical function
- .type main,@function
-main:
- .cfi_startproc
-
- #; only function body that doesn't
- #; touch the stack at all.
- call func_otherreg
-
- #; return
- ret
- .cfi_endproc
-
-#; _start
-#; - standard entry point
-
- .type _start,@function
- .globl _start
-_start:
- .cfi_startproc
- call main
- movq %rax,%rdi
- movq $0x3c,%rax
- syscall
- hlt
- .cfi_endproc
-
-#; func_alldirectives
-#; - test for all .cfi directives.
-#; This function is never called and the CFI info doesn't make sense.
-
- .type func_alldirectives,@function
-func_alldirectives:
- .cfi_startproc simple
- .cfi_def_cfa rsp,8
- nop
- .cfi_def_cfa_offset 16
- nop
- .cfi_def_cfa_register r8
- nop
- .cfi_adjust_cfa_offset 0x1234
- nop
- .cfi_offset %rsi, 0x10
- nop
- .cfi_register %r8, %r9
- nop
- .cfi_remember_state
- nop
- .cfi_restore %rbp
- nop
- .cfi_undefined %rip
- nop
- .cfi_same_value rbx
- nop
- .cfi_restore_state
- ret
- .cfi_endproc
-
-#; func_all_registers
-#; - test for all .cfi register numbers.
-#; This function is never called and the CFI info doesn't make sense.
-
- .type func_all_registers,@function
-func_all_registers:
- .cfi_startproc simple
-
- .cfi_undefined rip ; nop
- .cfi_undefined rax ; nop
- .cfi_undefined rcx ; nop
- .cfi_undefined rdx ; nop
- .cfi_undefined rbx ; nop
- .cfi_undefined rsp ; nop
- .cfi_undefined rbp ; nop
- .cfi_undefined rsi ; nop
- .cfi_undefined rdi ; nop
- .cfi_undefined r8 ; nop
- .cfi_undefined r9 ; nop
- .cfi_undefined r10 ; nop
- .cfi_undefined r11 ; nop
- .cfi_undefined r12 ; nop
- .cfi_undefined r13 ; nop
- .cfi_undefined r14 ; nop
- .cfi_undefined r15 ; nop
- .cfi_undefined rflags ; nop
-
- .cfi_undefined es ; nop
- .cfi_undefined cs ; nop
- .cfi_undefined ds ; nop
- .cfi_undefined ss ; nop
- .cfi_undefined fs ; nop
- .cfi_undefined gs ; nop
- .cfi_undefined tr ; nop
- .cfi_undefined ldtr ; nop
- .cfi_undefined fs.base ; nop
- .cfi_undefined gs.base ; nop
-
- .cfi_undefined mxcsr ; nop
- .cfi_undefined xmm0 ; nop
- .cfi_undefined xmm1 ; nop
- .cfi_undefined xmm2 ; nop
- .cfi_undefined xmm3 ; nop
- .cfi_undefined xmm4 ; nop
- .cfi_undefined xmm5 ; nop
- .cfi_undefined xmm6 ; nop
- .cfi_undefined xmm7 ; nop
- .cfi_undefined xmm8 ; nop
- .cfi_undefined xmm9 ; nop
- .cfi_undefined xmm10 ; nop
- .cfi_undefined xmm11 ; nop
- .cfi_undefined xmm12 ; nop
- .cfi_undefined xmm13 ; nop
- .cfi_undefined xmm14 ; nop
- .cfi_undefined xmm15 ; nop
-
- .cfi_undefined fcw ; nop
- .cfi_undefined fsw ; nop
- .cfi_undefined st ; nop
- .cfi_undefined st(1) ; nop
- .cfi_undefined st(2) ; nop
- .cfi_undefined st(3) ; nop
- .cfi_undefined st(4) ; nop
- .cfi_undefined st(5) ; nop
- .cfi_undefined st(6) ; nop
- .cfi_undefined st(7) ; nop
-
- .cfi_undefined mm0 ; nop
- .cfi_undefined mm1 ; nop
- .cfi_undefined mm2 ; nop
- .cfi_undefined mm3 ; nop
- .cfi_undefined mm4 ; nop
- .cfi_undefined mm5 ; nop
- .cfi_undefined mm6 ; nop
- .cfi_undefined mm7 ; nop
-
- .cfi_endproc
diff --git a/gas/testsuite/gas/ppc/cell.d b/gas/testsuite/gas/ppc/cell.d
deleted file mode 100644
index ca1db2bbc15..00000000000
--- a/gas/testsuite/gas/ppc/cell.d
+++ /dev/null
@@ -1,37 +0,0 @@
-#as: -mcell
-#objdump: -dr -Mcell
-#name: Cell tests (includes Altivec)
-
-
-.*: +file format elf(32)?(64)?-powerpc.*
-
-
-Disassembly of section \.text:
-
-0+00 <.text>:
- 0: 7c 01 14 0e lvlx v0,r1,r2
- 4: 7c 00 14 0e lvlx v0,0,r2
- 8: 7c 01 16 0e lvlxl v0,r1,r2
- c: 7c 00 16 0e lvlxl v0,0,r2
- 10: 7c 01 14 4e lvrx v0,r1,r2
- 14: 7c 00 14 4e lvrx v0,0,r2
- 18: 7c 01 16 4e lvrxl v0,r1,r2
- 1c: 7c 00 16 4e lvrxl v0,0,r2
- 20: 7c 01 15 0e stvlx v0,r1,r2
- 24: 7c 00 15 0e stvlx v0,0,r2
- 28: 7c 01 17 0e stvlxl v0,r1,r2
- 2c: 7c 00 17 0e stvlxl v0,0,r2
- 30: 7c 01 15 4e stvrx v0,r1,r2
- 34: 7c 00 15 4e stvrx v0,0,r2
- 38: 7c 01 17 4e stvrxl v0,r1,r2
- 3c: 7c 00 17 4e stvrxl v0,0,r2
- 40: 7c 00 0c 28 ldbrx r0,0,r1
- 44: 7c 01 14 28 ldbrx r0,r1,r2
- 48: 7c 00 0d 28 stdbrx r0,0,r1
- 4c: 7c 01 15 28 stdbrx r0,r1,r2
- 50: 7c 60 06 6c dss 3
- 54: 7e 00 06 6c dssall
- 58: 7c 25 22 ac dst r5,r4,1
- 5c: 7e 08 3a ac dstt r8,r7,0
- 60: 7c 65 32 ec dstst r5,r6,3
- 64: 7e 44 2a ec dststt r4,r5,2
diff --git a/gas/testsuite/gas/ppc/cell.s b/gas/testsuite/gas/ppc/cell.s
deleted file mode 100644
index 681364cbffa..00000000000
--- a/gas/testsuite/gas/ppc/cell.s
+++ /dev/null
@@ -1,31 +0,0 @@
- .section ".text"
- lvlx %r0, %r1, %r2
- lvlx %r0, 0, %r2
- lvlxl %r0, %r1, %r2
- lvlxl %r0, 0, %r2
- lvrx %r0, %r1, %r2
- lvrx %r0, 0, %r2
- lvrxl %r0, %r1, %r2
- lvrxl %r0, 0, %r2
-
- stvlx %r0, %r1, %r2
- stvlx %r0, 0, %r2
- stvlxl %r0, %r1, %r2
- stvlxl %r0, 0, %r2
- stvrx %r0, %r1, %r2
- stvrx %r0, 0, %r2
- stvrxl %r0, %r1, %r2
- stvrxl %r0, 0, %r2
-
- ldbrx %r0, 0, %r1
- ldbrx %r0, %r1, %r2
-
- stdbrx %r0, 0, %r1
- stdbrx %r0, %r1, %r2
-
- dss 3
- dssall
- dst 5,4,1
- dstt 8,7,0
- dstst 5,6,3
- dststt 4,5,2
diff --git a/gas/testsuite/gas/ppc/power6.d b/gas/testsuite/gas/ppc/power6.d
deleted file mode 100644
index 20488230652..00000000000
--- a/gas/testsuite/gas/ppc/power6.d
+++ /dev/null
@@ -1,31 +0,0 @@
-#as: -a32 -mpower6
-#objdump: -dr -Mpower6
-#name: POWER6 tests (includes DFP and Altivec)
-
-.*: +file format elf32-powerpc.*
-
-Disassembly of section \.text:
-
-0+00 <start>:
- 0: 4c 00 03 24 doze
- 4: 4c 00 03 64 nap
- 8: 4c 00 03 a4 sleep
- c: 4c 00 03 e4 rvwinkle
- 10: 7c 83 01 34 prtyw r3,r4
- 14: 7d cd 01 74 prtyd r13,r14
- 18: 7d 5c 02 a6 mfcfar r10
- 1c: 7d 7c 03 a6 mtcfar r11
- 20: 7c 83 2b f8 cmpb r3,r4,r5
- 24: 7c c0 3c be mffgpr f6,r7
- 28: 7d 00 4d be mftgpr r8,f9
- 2c: 7d 4b 66 2a lwzcix r10,r11,r12
- 30: 7d ae 7e 2e lfdpx f13,r14,r15
- 34: ee 11 90 04 dadd f16,f17,f18
- 38: fe 96 c0 04 daddq f20,f22,f24
- 3c: 7c 60 06 6c dss 3
- 40: 7e 00 06 6c dssall
- 44: 7c 25 22 ac dst r5,r4,1
- 48: 7e 08 3a ac dstt r8,r7,0
- 4c: 7c 65 32 ec dstst r5,r6,3
- 50: 7e 44 2a ec dststt r4,r5,2
-
diff --git a/gas/testsuite/gas/ppc/power6.s b/gas/testsuite/gas/ppc/power6.s
deleted file mode 100644
index 30cb7ef9b09..00000000000
--- a/gas/testsuite/gas/ppc/power6.s
+++ /dev/null
@@ -1,25 +0,0 @@
-# PowerPC POWER6 AltiVec tests
-#as: -mpower6
- .section ".text"
-start:
- doze
- nap
- sleep
- rvwinkle
- prtyw 3,4
- prtyd 13,14
- mfcfar 10
- mtcfar 11
- cmpb 3,4,5
- mffgpr 6,7
- mftgpr 8,9
- lwzcix 10,11,12
- lfdpx 13,14,15
- dadd 16,17,18
- daddq 20,22,24
- dss 3
- dssall
- dst 5,4,1
- dstt 8,7,0
- dstst 5,6,3
- dststt 4,5,2
diff --git a/gas/testsuite/gas/ppc/power7.d b/gas/testsuite/gas/ppc/power7.d
deleted file mode 100644
index 04013439bcd..00000000000
--- a/gas/testsuite/gas/ppc/power7.d
+++ /dev/null
@@ -1,57 +0,0 @@
-#as: -a32 -mpower7
-#objdump: -dr -Mpower7
-#name: POWER7 tests (includes DFP, Altivec and VSX)
-
-.*: +file format elf32-powerpc.*
-
-Disassembly of section \.text:
-
-0+00 <power7>:
- 0: 7c 64 2e 98 lxvd2x vs3,r4,r5
- 4: 7c 64 2e d8 lxvd2ux vs3,r4,r5
- 8: 7d 64 2e 99 lxvd2x vs43,r4,r5
- c: 7d 64 2e d9 lxvd2ux vs43,r4,r5
- 10: 7c 64 2f 98 stxvd2x vs3,r4,r5
- 14: 7c 64 2f d8 stxvd2ux vs3,r4,r5
- 18: 7d 64 2f 99 stxvd2x vs43,r4,r5
- 1c: 7d 64 2f d9 stxvd2ux vs43,r4,r5
- 20: f0 64 28 50 xxmrghd vs3,vs4,vs5
- 24: f1 6c 68 57 xxmrghd vs43,vs44,vs45
- 28: f0 64 2b 50 xxmrgld vs3,vs4,vs5
- 2c: f1 6c 6b 57 xxmrgld vs43,vs44,vs45
- 30: f0 64 28 50 xxmrghd vs3,vs4,vs5
- 34: f1 6c 68 57 xxmrghd vs43,vs44,vs45
- 38: f0 64 2b 50 xxmrgld vs3,vs4,vs5
- 3c: f1 6c 6b 57 xxmrgld vs43,vs44,vs45
- 40: f0 64 29 50 xxpermdi vs3,vs4,vs5,1
- 44: f1 6c 69 57 xxpermdi vs43,vs44,vs45,1
- 48: f0 64 2a 50 xxpermdi vs3,vs4,vs5,2
- 4c: f1 6c 6a 57 xxpermdi vs43,vs44,vs45,2
- 50: f0 64 27 80 xvmovdp vs3,vs4
- 54: f1 6c 67 87 xvmovdp vs43,vs44
- 58: f0 64 27 80 xvmovdp vs3,vs4
- 5c: f1 6c 67 87 xvmovdp vs43,vs44
- 60: f0 64 2f 80 xvcpsgndp vs3,vs4,vs5
- 64: f1 6c 6f 87 xvcpsgndp vs43,vs44,vs45
- 68: 4c 00 03 24 doze
- 6c: 4c 00 03 64 nap
- 70: 4c 00 03 a4 sleep
- 74: 4c 00 03 e4 rvwinkle
- 78: 7c 83 01 34 prtyw r3,r4
- 7c: 7d cd 01 74 prtyd r13,r14
- 80: 7d 5c 02 a6 mfcfar r10
- 84: 7d 7c 03 a6 mtcfar r11
- 88: 7c 83 2b f8 cmpb r3,r4,r5
- 8c: 7c c0 3c be mffgpr f6,r7
- 90: 7d 00 4d be mftgpr r8,f9
- 94: 7d 4b 66 2a lwzcix r10,r11,r12
- 98: 7d ae 7e 2e lfdpx f13,r14,r15
- 9c: ee 11 90 04 dadd f16,f17,f18
- a0: fe 96 c0 04 daddq f20,f22,f24
- a4: 7c 60 06 6c dss 3
- a8: 7e 00 06 6c dssall
- ac: 7c 25 22 ac dst r5,r4,1
- b0: 7e 08 3a ac dstt r8,r7,0
- b4: 7c 65 32 ec dstst r5,r6,3
- b8: 7e 44 2a ec dststt r4,r5,2
- bc: 4e 80 00 20 blr
diff --git a/gas/testsuite/gas/ppc/power7.s b/gas/testsuite/gas/ppc/power7.s
deleted file mode 100644
index 56fe0dc1a83..00000000000
--- a/gas/testsuite/gas/ppc/power7.s
+++ /dev/null
@@ -1,58 +0,0 @@
- .file "power7.c"
- .section ".text"
- .align 2
- .p2align 4,,15
- .globl power7
- .type power7, @function
-power7:
- lxvd2x 3,4,5
- lxvd2ux 3,4,5
- lxvd2x 43,4,5
- lxvd2ux 43,4,5
- stxvd2x 3,4,5
- stxvd2ux 3,4,5
- stxvd2x 43,4,5
- stxvd2ux 43,4,5
- xxmrghd 3,4,5
- xxmrghd 43,44,45
- xxmrgld 3,4,5
- xxmrgld 43,44,45
- xxpermdi 3,4,5,0
- xxpermdi 43,44,45,0
- xxpermdi 3,4,5,3
- xxpermdi 43,44,45,3
- xxpermdi 3,4,5,1
- xxpermdi 43,44,45,1
- xxpermdi 3,4,5,2
- xxpermdi 43,44,45,2
- xvmovdp 3,4
- xvmovdp 43,44
- xvcpsgndp 3,4,4
- xvcpsgndp 43,44,44
- xvcpsgndp 3,4,5
- xvcpsgndp 43,44,45
- doze
- nap
- sleep
- rvwinkle
- prtyw 3,4
- prtyd 13,14
- mfcfar 10
- mtcfar 11
- cmpb 3,4,5
- mffgpr 6,7
- mftgpr 8,9
- lwzcix 10,11,12
- lfdpx 13,14,15
- dadd 16,17,18
- daddq 20,22,24
- dss 3
- dssall
- dst 5,4,1
- dstt 8,7,0
- dstst 5,6,3
- dststt 4,5,2
- blr
- .size power7,.-power7
- .ident "GCC: (GNU) 4.1.2 20070115 (prerelease) (SUSE Linux)"
- .section .note.GNU-stack,"",@progbits
diff --git a/gas/testsuite/gas/ppc/ppc.exp b/gas/testsuite/gas/ppc/ppc.exp
deleted file mode 100644
index 90a5cfff4c2..00000000000
--- a/gas/testsuite/gas/ppc/ppc.exp
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Some PowerPC tests
-#
-
-# These tests are currently ELF specific, only because nobody has
-# converted them to look for XCOFF relocations.
-
-if { [istarget powerpc64*-*-*] || [istarget *-*-elf64*]} then {
-# FIXME: Pass -x to objdump as well as -Dr for astest64 and astest2_64.
- run_dump_test "astest64"
- run_dump_test "astest2_64"
- run_dump_test "test1elf64"
- run_dump_test "power4"
- run_list_test "range64" "-a64"
-} elseif { [istarget powerpc*-*aix*] } then {
- run_dump_test "test1xcoff32"
-} elseif { [istarget powerpc*-*-*bsd*] \
- || [istarget powerpc*-*-elf*] \
- || [istarget powerpc*-*-eabi*] \
- || [istarget powerpc*-*-sysv4*] \
- || [istarget powerpc*-*-linux*] \
- || [istarget powerpc*-*-solaris*] \
- || [istarget powerpc*-*-rtems*] } then {
- run_dump_test "astest"
- run_dump_test "astest2"
- run_dump_test "test1elf32"
-}
-
-if { [istarget powerpc*-*-*] } then {
- run_dump_test "simpshft"
- run_dump_test "machine"
- run_dump_test "regnames"
-
- if { [istarget powerpc-*-*aix*] } then {
- run_dump_test "altivec_xcoff"
- run_dump_test "altivec_xcoff64"
- run_dump_test "booke_xcoff"
- run_dump_test "booke_xcoff64"
- } else {
- run_dump_test "altivec"
- run_dump_test "altivec_and_spe"
- run_dump_test "booke"
- run_dump_test "e500"
- run_list_test "range" "-a32"
- run_dump_test "ppc750ps"
- run_dump_test "e500mc"
- run_dump_test "cell"
- run_dump_test "power6"
- run_dump_test "power7"
- }
-}
diff --git a/gas/write.c b/gas/write.c
deleted file mode 100644
index 660df811b66..00000000000
--- a/gas/write.c
+++ /dev/null
@@ -1,2539 +0,0 @@
-/* write.c - emit .o file
- Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
-
- This file is part of GAS, the GNU Assembler.
-
- GAS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- GAS 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 GAS; see the file COPYING. If not, write to the Free
- Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-/* This thing should be set up to do byteordering correctly. But... */
-
-#include "as.h"
-#include "subsegs.h"
-#include "obstack.h"
-#include "output-file.h"
-#include "dwarf2dbg.h"
-#include "libbfd.h"
-
-#ifndef TC_ADJUST_RELOC_COUNT
-#define TC_ADJUST_RELOC_COUNT(FIX, COUNT)
-#endif
-
-#ifndef TC_FORCE_RELOCATION
-#define TC_FORCE_RELOCATION(FIX) \
- (generic_force_reloc (FIX))
-#endif
-
-#ifndef TC_FORCE_RELOCATION_ABS
-#define TC_FORCE_RELOCATION_ABS(FIX) \
- (TC_FORCE_RELOCATION (FIX))
-#endif
-
-#ifndef TC_FORCE_RELOCATION_LOCAL
-#define TC_FORCE_RELOCATION_LOCAL(FIX) \
- (!(FIX)->fx_pcrel \
- || TC_FORCE_RELOCATION (FIX))
-#endif
-
-#ifndef TC_FORCE_RELOCATION_SUB_SAME
-#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
- (! SEG_NORMAL (SEG))
-#endif
-
-#ifndef TC_FORCE_RELOCATION_SUB_ABS
-#define TC_FORCE_RELOCATION_SUB_ABS(FIX) 0
-#endif
-
-#ifndef TC_FORCE_RELOCATION_SUB_LOCAL
-#ifdef DIFF_EXPR_OK
-#define TC_FORCE_RELOCATION_SUB_LOCAL(FIX) 0
-#else
-#define TC_FORCE_RELOCATION_SUB_LOCAL(FIX) 1
-#endif
-#endif
-
-#ifndef TC_VALIDATE_FIX_SUB
-#ifdef UNDEFINED_DIFFERENCE_OK
-/* The PA needs this for PIC code generation. */
-#define TC_VALIDATE_FIX_SUB(FIX) 1
-#else
-#define TC_VALIDATE_FIX_SUB(FIX) \
- ((FIX)->fx_r_type == BFD_RELOC_GPREL32 \
- || (FIX)->fx_r_type == BFD_RELOC_GPREL16)
-#endif
-#endif
-
-#ifndef TC_LINKRELAX_FIXUP
-#define TC_LINKRELAX_FIXUP(SEG) 1
-#endif
-
-#ifndef MD_APPLY_SYM_VALUE
-#define MD_APPLY_SYM_VALUE(FIX) 1
-#endif
-
-#ifndef TC_FINALIZE_SYMS_BEFORE_SIZE_SEG
-#define TC_FINALIZE_SYMS_BEFORE_SIZE_SEG 1
-#endif
-
-#ifndef MD_PCREL_FROM_SECTION
-#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from (FIX)
-#endif
-
-#ifndef TC_FAKE_LABEL
-#define TC_FAKE_LABEL(NAME) (strcmp ((NAME), FAKE_LABEL_NAME) == 0)
-#endif
-
-/* Positive values of TC_FX_SIZE_SLACK allow a target to define
- fixups that far past the end of a frag. Having such fixups
- is of course most most likely a bug in setting fx_size correctly.
- A negative value disables the fixup check entirely, which is
- appropriate for something like the Renesas / SuperH SH_COUNT
- reloc. */
-#ifndef TC_FX_SIZE_SLACK
-#define TC_FX_SIZE_SLACK(FIX) 0
-#endif
-
-/* Used to control final evaluation of expressions. */
-int finalize_syms = 0;
-
-int symbol_table_frozen;
-
-symbolS *abs_section_sym;
-
-/* Remember the value of dot when parsing expressions. */
-addressT dot_value;
-
-/* Relocs generated by ".reloc" pseudo. */
-struct reloc_list* reloc_list;
-
-void print_fixup (fixS *);
-
-/* We generally attach relocs to frag chains. However, after we have
- chained these all together into a segment, any relocs we add after
- that must be attached to a segment. This will include relocs added
- in md_estimate_size_for_relax, for example. */
-static int frags_chained = 0;
-
-static int n_fixups;
-
-#define RELOC_ENUM enum bfd_reloc_code_real
-
-/* Create a fixS in obstack 'notes'. */
-
-static fixS *
-fix_new_internal (fragS *frag, /* Which frag? */
- int where, /* Where in that frag? */
- int size, /* 1, 2, or 4 usually. */
- symbolS *add_symbol, /* X_add_symbol. */
- symbolS *sub_symbol, /* X_op_symbol. */
- offsetT offset, /* X_add_number. */
- int pcrel, /* TRUE if PC-relative relocation. */
- RELOC_ENUM r_type ATTRIBUTE_UNUSED /* Relocation type. */)
-{
- fixS *fixP;
-
- n_fixups++;
-
- fixP = obstack_alloc (&notes, sizeof (fixS));
-
- fixP->fx_frag = frag;
- fixP->fx_where = where;
- fixP->fx_size = size;
- /* We've made fx_size a narrow field; check that it's wide enough. */
- if (fixP->fx_size != size)
- {
- as_bad (_("field fx_size too small to hold %d"), size);
- abort ();
- }
- fixP->fx_addsy = add_symbol;
- fixP->fx_subsy = sub_symbol;
- fixP->fx_offset = offset;
- fixP->fx_dot_value = dot_value;
- fixP->fx_pcrel = pcrel;
- fixP->fx_r_type = r_type;
- fixP->fx_im_disp = 0;
- fixP->fx_pcrel_adjust = 0;
- fixP->fx_bit_fixP = 0;
- fixP->fx_addnumber = 0;
- fixP->fx_tcbit = 0;
- fixP->fx_tcbit2 = 0;
- fixP->fx_done = 0;
- fixP->fx_no_overflow = 0;
- fixP->fx_signed = 0;
-
-#ifdef USING_CGEN
- fixP->fx_cgen.insn = NULL;
- fixP->fx_cgen.opinfo = 0;
-#endif
-
-#ifdef TC_FIX_TYPE
- TC_INIT_FIX_DATA (fixP);
-#endif
-
- as_where (&fixP->fx_file, &fixP->fx_line);
-
- /* Usually, we want relocs sorted numerically, but while
- comparing to older versions of gas that have relocs
- reverse sorted, it is convenient to have this compile
- time option. xoxorich. */
- {
-
- fixS **seg_fix_rootP = (frags_chained
- ? &seg_info (now_seg)->fix_root
- : &frchain_now->fix_root);
- fixS **seg_fix_tailP = (frags_chained
- ? &seg_info (now_seg)->fix_tail
- : &frchain_now->fix_tail);
-
-#ifdef REVERSE_SORT_RELOCS
-
- fixP->fx_next = *seg_fix_rootP;
- *seg_fix_rootP = fixP;
-
-#else /* REVERSE_SORT_RELOCS */
-
- fixP->fx_next = NULL;
-
- if (*seg_fix_tailP)
- (*seg_fix_tailP)->fx_next = fixP;
- else
- *seg_fix_rootP = fixP;
- *seg_fix_tailP = fixP;
-
-#endif /* REVERSE_SORT_RELOCS */
- }
-
- return fixP;
-}
-
-/* Create a fixup relative to a symbol (plus a constant). */
-
-fixS *
-fix_new (fragS *frag, /* Which frag? */
- int where, /* Where in that frag? */
- int size, /* 1, 2, or 4 usually. */
- symbolS *add_symbol, /* X_add_symbol. */
- offsetT offset, /* X_add_number. */
- int pcrel, /* TRUE if PC-relative relocation. */
- RELOC_ENUM r_type /* Relocation type. */)
-{
- return fix_new_internal (frag, where, size, add_symbol,
- (symbolS *) NULL, offset, pcrel, r_type);
-}
-
-/* Create a fixup for an expression. Currently we only support fixups
- for difference expressions. That is itself more than most object
- file formats support anyhow. */
-
-fixS *
-fix_new_exp (fragS *frag, /* Which frag? */
- int where, /* Where in that frag? */
- int size, /* 1, 2, or 4 usually. */
- expressionS *exp, /* Expression. */
- int pcrel, /* TRUE if PC-relative relocation. */
- RELOC_ENUM r_type /* Relocation type. */)
-{
- symbolS *add = NULL;
- symbolS *sub = NULL;
- offsetT off = 0;
-
- switch (exp->X_op)
- {
- case O_absent:
- break;
-
- case O_register:
- as_bad (_("register value used as expression"));
- break;
-
- case O_add:
- /* This comes up when _GLOBAL_OFFSET_TABLE_+(.-L0) is read, if
- the difference expression cannot immediately be reduced. */
- {
- symbolS *stmp = make_expr_symbol (exp);
-
- exp->X_op = O_symbol;
- exp->X_op_symbol = 0;
- exp->X_add_symbol = stmp;
- exp->X_add_number = 0;
-
- return fix_new_exp (frag, where, size, exp, pcrel, r_type);
- }
-
- case O_symbol_rva:
- add = exp->X_add_symbol;
- off = exp->X_add_number;
- r_type = BFD_RELOC_RVA;
- break;
-
- case O_uminus:
- sub = exp->X_add_symbol;
- off = exp->X_add_number;
- break;
-
- case O_subtract:
- sub = exp->X_op_symbol;
- /* Fall through. */
- case O_symbol:
- add = exp->X_add_symbol;
- /* Fall through. */
- case O_constant:
- off = exp->X_add_number;
- break;
-
- default:
- add = make_expr_symbol (exp);
- break;
- }
-
- return fix_new_internal (frag, where, size, add, sub, off, pcrel, r_type);
-}
-
-/* Generic function to determine whether a fixup requires a relocation. */
-int
-generic_force_reloc (fixS *fix)
-{
- if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
- || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
- return 1;
-
- if (fix->fx_addsy == NULL)
- return 0;
-
- return S_FORCE_RELOC (fix->fx_addsy, fix->fx_subsy == NULL);
-}
-
-/* Append a string onto another string, bumping the pointer along. */
-void
-append (char **charPP, char *fromP, unsigned long length)
-{
- /* Don't trust memcpy() of 0 chars. */
- if (length == 0)
- return;
-
- memcpy (*charPP, fromP, length);
- *charPP += length;
-}
-
-/* This routine records the largest alignment seen for each segment.
- If the beginning of the segment is aligned on the worst-case
- boundary, all of the other alignments within it will work. At
- least one object format really uses this info. */
-
-void
-record_alignment (/* Segment to which alignment pertains. */
- segT seg,
- /* Alignment, as a power of 2 (e.g., 1 => 2-byte
- boundary, 2 => 4-byte boundary, etc.) */
- int align)
-{
- if (seg == absolute_section)
- return;
-
- if ((unsigned int) align > bfd_get_section_alignment (stdoutput, seg))
- bfd_set_section_alignment (stdoutput, seg, align);
-}
-
-int
-get_recorded_alignment (segT seg)
-{
- if (seg == absolute_section)
- return 0;
-
- return bfd_get_section_alignment (stdoutput, seg);
-}
-
-/* Reset the section indices after removing the gas created sections. */
-
-static void
-renumber_sections (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *countparg)
-{
- int *countp = (int *) countparg;
-
- sec->index = *countp;
- ++*countp;
-}
-
-static fragS *
-chain_frchains_together_1 (segT section, struct frchain *frchp)
-{
- fragS dummy, *prev_frag = &dummy;
- fixS fix_dummy, *prev_fix = &fix_dummy;
-
- for (; frchp; frchp = frchp->frch_next)
- {
- prev_frag->fr_next = frchp->frch_root;
- prev_frag = frchp->frch_last;
- assert (prev_frag->fr_type != 0);
- if (frchp->fix_root != (fixS *) NULL)
- {
- if (seg_info (section)->fix_root == (fixS *) NULL)
- seg_info (section)->fix_root = frchp->fix_root;
- prev_fix->fx_next = frchp->fix_root;
- seg_info (section)->fix_tail = frchp->fix_tail;
- prev_fix = frchp->fix_tail;
- }
- }
- assert (prev_frag->fr_type != 0);
- assert (prev_frag != &dummy);
- prev_frag->fr_next = 0;
- return prev_frag;
-}
-
-static void
-chain_frchains_together (bfd *abfd ATTRIBUTE_UNUSED,
- segT section,
- void *xxx ATTRIBUTE_UNUSED)
-{
- segment_info_type *info;
-
- /* BFD may have introduced its own sections without using
- subseg_new, so it is possible that seg_info is NULL. */
- info = seg_info (section);
- if (info != (segment_info_type *) NULL)
- info->frchainP->frch_last
- = chain_frchains_together_1 (section, info->frchainP);
-
- /* Now that we've chained the frags together, we must add new fixups
- to the segment, not to the frag chain. */
- frags_chained = 1;
-}
-
-static void
-cvt_frag_to_fill (segT sec ATTRIBUTE_UNUSED, fragS *fragP)
-{
- switch (fragP->fr_type)
- {
- case rs_align:
- case rs_align_code:
- case rs_align_test:
- case rs_org:
- case rs_space:
-#ifdef HANDLE_ALIGN
- HANDLE_ALIGN (fragP);
-#endif
- know (fragP->fr_next != NULL);
- fragP->fr_offset = (fragP->fr_next->fr_address
- - fragP->fr_address
- - fragP->fr_fix) / fragP->fr_var;
- if (fragP->fr_offset < 0)
- {
- as_bad_where (fragP->fr_file, fragP->fr_line,
- _("attempt to .org/.space backwards? (%ld)"),
- (long) fragP->fr_offset);
- fragP->fr_offset = 0;
- }
- fragP->fr_type = rs_fill;
- break;
-
- case rs_fill:
- break;
-
- case rs_leb128:
- {
- valueT value = S_GET_VALUE (fragP->fr_symbol);
- int size;
-
- size = output_leb128 (fragP->fr_literal + fragP->fr_fix, value,
- fragP->fr_subtype);
-
- fragP->fr_fix += size;
- fragP->fr_type = rs_fill;
- fragP->fr_var = 0;
- fragP->fr_offset = 0;
- fragP->fr_symbol = NULL;
- }
- break;
-
- case rs_cfa:
- eh_frame_convert_frag (fragP);
- break;
-
- case rs_dwarf2dbg:
- dwarf2dbg_convert_frag (fragP);
- break;
-
- case rs_machine_dependent:
- md_convert_frag (stdoutput, sec, fragP);
-
- assert (fragP->fr_next == NULL
- || ((offsetT) (fragP->fr_next->fr_address - fragP->fr_address)
- == fragP->fr_fix));
-
- /* After md_convert_frag, we make the frag into a ".space 0".
- md_convert_frag() should set up any fixSs and constants
- required. */
- frag_wane (fragP);
- break;
-
-#ifndef WORKING_DOT_WORD
- case rs_broken_word:
- {
- struct broken_word *lie;
-
- if (fragP->fr_subtype)
- {
- fragP->fr_fix += md_short_jump_size;
- for (lie = (struct broken_word *) (fragP->fr_symbol);
- lie && lie->dispfrag == fragP;
- lie = lie->next_broken_word)
- if (lie->added == 1)
- fragP->fr_fix += md_long_jump_size;
- }
- frag_wane (fragP);
- }
- break;
-#endif
-
- default:
- BAD_CASE (fragP->fr_type);
- break;
- }
-#ifdef md_frag_check
- md_frag_check (fragP);
-#endif
-}
-
-struct relax_seg_info
-{
- int pass;
- int changed;
-};
-
-static void
-relax_seg (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *xxx)
-{
- segment_info_type *seginfo = seg_info (sec);
- struct relax_seg_info *info = (struct relax_seg_info *) xxx;
-
- if (seginfo && seginfo->frchainP
- && relax_segment (seginfo->frchainP->frch_root, sec, info->pass))
- info->changed = 1;
-}
-
-static void
-size_seg (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
-{
- flagword flags;
- fragS *fragp;
- segment_info_type *seginfo;
- int x;
- valueT size, newsize;
-
- subseg_change (sec, 0);
-
- seginfo = seg_info (sec);
- if (seginfo && seginfo->frchainP)
- {
- for (fragp = seginfo->frchainP->frch_root; fragp; fragp = fragp->fr_next)
- cvt_frag_to_fill (sec, fragp);
- for (fragp = seginfo->frchainP->frch_root;
- fragp->fr_next;
- fragp = fragp->fr_next)
- /* Walk to last elt. */
- ;
- size = fragp->fr_address + fragp->fr_fix;
- }
- else
- size = 0;
-
- flags = bfd_get_section_flags (abfd, sec);
-
- if (size > 0 && ! seginfo->bss)
- flags |= SEC_HAS_CONTENTS;
-
- flags &= ~SEC_RELOC;
- x = bfd_set_section_flags (abfd, sec, flags);
- assert (x);
-
- newsize = md_section_align (sec, size);
- x = bfd_set_section_size (abfd, sec, newsize);
- assert (x);
-
- /* If the size had to be rounded up, add some padding in the last
- non-empty frag. */
- assert (newsize >= size);
- if (size != newsize)
- {
- fragS *last = seginfo->frchainP->frch_last;
- fragp = seginfo->frchainP->frch_root;
- while (fragp->fr_next != last)
- fragp = fragp->fr_next;
- last->fr_address = size;
- if ((newsize - size) % fragp->fr_var == 0)
- fragp->fr_offset += (newsize - size) / fragp->fr_var;
- else
- /* If we hit this abort, it's likely due to subsegs_finish not
- providing sufficient alignment on the last frag, and the
- machine dependent code using alignment frags with fr_var
- greater than 1. */
- abort ();
- }
-
-#ifdef tc_frob_section
- tc_frob_section (sec);
-#endif
-#ifdef obj_frob_section
- obj_frob_section (sec);
-#endif
-}
-
-#ifdef DEBUG2
-static void
-dump_section_relocs (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, FILE *stream)
-{
- segment_info_type *seginfo = seg_info (sec);
- fixS *fixp = seginfo->fix_root;
-
- if (!fixp)
- return;
-
- fprintf (stream, "sec %s relocs:\n", sec->name);
- while (fixp)
- {
- symbolS *s = fixp->fx_addsy;
-
- fprintf (stream, " %08lx: type %d ", (unsigned long) fixp,
- (int) fixp->fx_r_type);
- if (s == NULL)
- fprintf (stream, "no sym\n");
- else
- {
- print_symbol_value_1 (stream, s);
- fprintf (stream, "\n");
- }
- fixp = fixp->fx_next;
- }
-}
-#else
-#define dump_section_relocs(ABFD,SEC,STREAM) ((void) 0)
-#endif
-
-#ifndef EMIT_SECTION_SYMBOLS
-#define EMIT_SECTION_SYMBOLS 1
-#endif
-
-/* Resolve U.A.OFFSET_SYM and U.A.SYM fields of RELOC_LIST entries,
- and check for validity. Convert RELOC_LIST from using U.A fields
- to U.B fields. */
-static void
-resolve_reloc_expr_symbols (void)
-{
- struct reloc_list *r;
-
- for (r = reloc_list; r; r = r->next)
- {
- expressionS *symval;
- symbolS *sym;
- bfd_vma offset, addend;
- asection *sec;
- reloc_howto_type *howto;
-
- resolve_symbol_value (r->u.a.offset_sym);
- symval = symbol_get_value_expression (r->u.a.offset_sym);
-
- offset = 0;
- sym = NULL;
- if (symval->X_op == O_constant)
- sym = r->u.a.offset_sym;
- else if (symval->X_op == O_symbol)
- {
- sym = symval->X_add_symbol;
- offset = symval->X_add_number;
- symval = symbol_get_value_expression (symval->X_add_symbol);
- }
- if (sym == NULL
- || symval->X_op != O_constant
- || (sec = S_GET_SEGMENT (sym)) == NULL
- || !SEG_NORMAL (sec))
- {
- as_bad_where (r->file, r->line, _("invalid offset expression"));
- sec = NULL;
- }
- else
- offset += S_GET_VALUE (sym);
-
- sym = NULL;
- addend = r->u.a.addend;
- if (r->u.a.sym != NULL)
- {
- resolve_symbol_value (r->u.a.sym);
- symval = symbol_get_value_expression (r->u.a.sym);
- if (symval->X_op == O_constant)
- sym = r->u.a.sym;
- else if (symval->X_op == O_symbol)
- {
- sym = symval->X_add_symbol;
- addend += symval->X_add_number;
- symval = symbol_get_value_expression (symval->X_add_symbol);
- }
- if (symval->X_op != O_constant)
- {
- as_bad_where (r->file, r->line, _("invalid reloc expression"));
- sec = NULL;
- }
- else if (sym != NULL)
- symbol_mark_used_in_reloc (sym);
- }
- if (sym == NULL)
- {
- if (abs_section_sym == NULL)
- abs_section_sym = section_symbol (absolute_section);
- sym = abs_section_sym;
- }
-
- howto = r->u.a.howto;
-
- r->u.b.sec = sec;
- r->u.b.s = symbol_get_bfdsym (sym);
- r->u.b.r.sym_ptr_ptr = &r->u.b.s;
- r->u.b.r.address = offset;
- r->u.b.r.addend = addend;
- r->u.b.r.howto = howto;
- }
-}
-
-/* This pass over fixups decides whether symbols can be replaced with
- section symbols. */
-
-static void
-adjust_reloc_syms (bfd *abfd ATTRIBUTE_UNUSED,
- asection *sec,
- void *xxx ATTRIBUTE_UNUSED)
-{
- segment_info_type *seginfo = seg_info (sec);
- fixS *fixp;
-
- if (seginfo == NULL)
- return;
-
- dump_section_relocs (abfd, sec, stderr);
-
- for (fixp = seginfo->fix_root; fixp; fixp = fixp->fx_next)
- if (fixp->fx_done)
- /* Ignore it. */
- ;
- else if (fixp->fx_addsy)
- {
- symbolS *sym;
- asection *symsec;
-
-#ifdef DEBUG5
- fprintf (stderr, "\n\nadjusting fixup:\n");
- print_fixup (fixp);
-#endif
-
- sym = fixp->fx_addsy;
-
- /* All symbols should have already been resolved at this
- point. It is possible to see unresolved expression
- symbols, though, since they are not in the regular symbol
- table. */
- resolve_symbol_value (sym);
-
- if (fixp->fx_subsy != NULL)
- resolve_symbol_value (fixp->fx_subsy);
-
- /* If this symbol is equated to an undefined or common symbol,
- convert the fixup to being against that symbol. */
- while (symbol_equated_reloc_p (sym)
- || S_IS_WEAKREFR (sym))
- {
- symbolS *newsym = symbol_get_value_expression (sym)->X_add_symbol;
- if (sym == newsym)
- break;
- fixp->fx_offset += symbol_get_value_expression (sym)->X_add_number;
- fixp->fx_addsy = newsym;
- sym = newsym;
- }
-
- if (symbol_mri_common_p (sym))
- {
- fixp->fx_offset += S_GET_VALUE (sym);
- fixp->fx_addsy = symbol_get_value_expression (sym)->X_add_symbol;
- continue;
- }
-
- /* If the symbol is undefined, common, weak, or global (ELF
- shared libs), we can't replace it with the section symbol. */
- if (S_FORCE_RELOC (fixp->fx_addsy, 1))
- continue;
-
- /* Is there some other (target cpu dependent) reason we can't adjust
- this one? (E.g. relocations involving function addresses on
- the PA. */
-#ifdef tc_fix_adjustable
- if (! tc_fix_adjustable (fixp))
- continue;
-#endif
-
- /* Since we're reducing to section symbols, don't attempt to reduce
- anything that's already using one. */
- if (symbol_section_p (sym))
- continue;
-
- symsec = S_GET_SEGMENT (sym);
- if (symsec == NULL)
- abort ();
-
- if (bfd_is_abs_section (symsec))
- {
- /* The fixup_segment routine normally will not use this
- symbol in a relocation. */
- continue;
- }
-
- /* Don't try to reduce relocs which refer to non-local symbols
- in .linkonce sections. It can lead to confusion when a
- debugging section refers to a .linkonce section. I hope
- this will always be correct. */
- if (symsec != sec && ! S_IS_LOCAL (sym))
- {
- if ((symsec->flags & SEC_LINK_ONCE) != 0
- || (IS_ELF
- /* The GNU toolchain uses an extension for ELF: a
- section beginning with the magic string
- .gnu.linkonce is a linkonce section. */
- && strncmp (segment_name (symsec), ".gnu.linkonce",
- sizeof ".gnu.linkonce" - 1) == 0))
- continue;
- }
-
- /* Never adjust a reloc against local symbol in a merge section
- with non-zero addend. */
- if ((symsec->flags & SEC_MERGE) != 0
- && (fixp->fx_offset != 0 || fixp->fx_subsy != NULL))
- continue;
-
- /* Never adjust a reloc against TLS local symbol. */
- if ((symsec->flags & SEC_THREAD_LOCAL) != 0)
- continue;
-
- /* We refetch the segment when calling section_symbol, rather
- than using symsec, because S_GET_VALUE may wind up changing
- the section when it calls resolve_symbol_value. */
- fixp->fx_offset += S_GET_VALUE (sym);
- fixp->fx_addsy = section_symbol (S_GET_SEGMENT (sym));
-#ifdef DEBUG5
- fprintf (stderr, "\nadjusted fixup:\n");
- print_fixup (fixp);
-#endif
- }
-
- dump_section_relocs (abfd, sec, stderr);
-}
-
-/* fixup_segment()
-
- Go through all the fixS's in a segment and see which ones can be
- handled now. (These consist of fixS where we have since discovered
- the value of a symbol, or the address of the frag involved.)
- For each one, call md_apply_fix to put the fix into the frag data.
-
- Result is a count of how many relocation structs will be needed to
- handle the remaining fixS's that we couldn't completely handle here.
- These will be output later by emit_relocations(). */
-
-static long
-fixup_segment (fixS *fixP, segT this_segment)
-{
- long seg_reloc_count = 0;
- valueT add_number;
- fragS *fragP;
- segT add_symbol_segment = absolute_section;
-
- if (fixP != NULL && abs_section_sym == NULL)
- abs_section_sym = section_symbol (absolute_section);
-
- /* If the linker is doing the relaxing, we must not do any fixups.
-
- Well, strictly speaking that's not true -- we could do any that
- are PC-relative and don't cross regions that could change size.
- And for the i960 we might be able to turn callx/callj into bal
- anyways in cases where we know the maximum displacement. */
- if (linkrelax && TC_LINKRELAX_FIXUP (this_segment))
- {
- for (; fixP; fixP = fixP->fx_next)
- if (!fixP->fx_done)
- {
- if (fixP->fx_addsy == NULL)
- {
- /* There was no symbol required by this relocation.
- However, BFD doesn't really handle relocations
- without symbols well. So fake up a local symbol in
- the absolute section. */
- fixP->fx_addsy = abs_section_sym;
- }
- symbol_mark_used_in_reloc (fixP->fx_addsy);
- if (fixP->fx_subsy != NULL)
- symbol_mark_used_in_reloc (fixP->fx_subsy);
- seg_reloc_count++;
- }
- TC_ADJUST_RELOC_COUNT (fixP, seg_reloc_count);
- return seg_reloc_count;
- }
-
- for (; fixP; fixP = fixP->fx_next)
- {
-#ifdef DEBUG5
- fprintf (stderr, "\nprocessing fixup:\n");
- print_fixup (fixP);
-#endif
-
- fragP = fixP->fx_frag;
- know (fragP);
-#ifdef TC_VALIDATE_FIX
- TC_VALIDATE_FIX (fixP, this_segment, skip);
-#endif
- add_number = fixP->fx_offset;
-
- if (fixP->fx_addsy != NULL)
- add_symbol_segment = S_GET_SEGMENT (fixP->fx_addsy);
-
- if (fixP->fx_subsy != NULL)
- {
- segT sub_symbol_segment;
- resolve_symbol_value (fixP->fx_subsy);
- sub_symbol_segment = S_GET_SEGMENT (fixP->fx_subsy);
- if (fixP->fx_addsy != NULL
- && sub_symbol_segment == add_symbol_segment
- && !TC_FORCE_RELOCATION_SUB_SAME (fixP, add_symbol_segment))
- {
- add_number += S_GET_VALUE (fixP->fx_addsy);
- add_number -= S_GET_VALUE (fixP->fx_subsy);
- fixP->fx_offset = add_number;
- fixP->fx_addsy = NULL;
- fixP->fx_subsy = NULL;
-#ifdef TC_M68K
- /* See the comment below about 68k weirdness. */
- fixP->fx_pcrel = 0;
-#endif
- }
- else if (sub_symbol_segment == absolute_section
- && !TC_FORCE_RELOCATION_SUB_ABS (fixP))
- {
- add_number -= S_GET_VALUE (fixP->fx_subsy);
- fixP->fx_offset = add_number;
- fixP->fx_subsy = NULL;
- }
- else if (sub_symbol_segment == this_segment
- && !TC_FORCE_RELOCATION_SUB_LOCAL (fixP))
- {
- add_number -= S_GET_VALUE (fixP->fx_subsy);
- fixP->fx_offset = (add_number + fixP->fx_dot_value
- + fixP->fx_frag->fr_address);
-
- /* Make it pc-relative. If the back-end code has not
- selected a pc-relative reloc, cancel the adjustment
- we do later on all pc-relative relocs. */
- if (0
-#ifdef TC_M68K
- /* Do this for m68k even if it's already described
- as pc-relative. On the m68k, an operand of
- "pc@(foo-.-2)" should address "foo" in a
- pc-relative mode. */
- || 1
-#endif
- || !fixP->fx_pcrel)
- add_number += MD_PCREL_FROM_SECTION (fixP, this_segment);
- fixP->fx_subsy = NULL;
- fixP->fx_pcrel = 1;
- }
- else if (!TC_VALIDATE_FIX_SUB (fixP))
- {
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("can't resolve `%s' {%s section} - `%s' {%s section}"),
- fixP->fx_addsy ? S_GET_NAME (fixP->fx_addsy) : "0",
- segment_name (add_symbol_segment),
- S_GET_NAME (fixP->fx_subsy),
- segment_name (sub_symbol_segment));
- }
- }
-
- if (fixP->fx_addsy)
- {
- if (add_symbol_segment == this_segment
- && !TC_FORCE_RELOCATION_LOCAL (fixP))
- {
- /* This fixup was made when the symbol's segment was
- SEG_UNKNOWN, but it is now in the local segment.
- So we know how to do the address without relocation. */
- add_number += S_GET_VALUE (fixP->fx_addsy);
- fixP->fx_offset = add_number;
- if (fixP->fx_pcrel)
- add_number -= MD_PCREL_FROM_SECTION (fixP, this_segment);
- fixP->fx_addsy = NULL;
- fixP->fx_pcrel = 0;
- }
- else if (add_symbol_segment == absolute_section
- && !TC_FORCE_RELOCATION_ABS (fixP))
- {
- add_number += S_GET_VALUE (fixP->fx_addsy);
- fixP->fx_offset = add_number;
- fixP->fx_addsy = NULL;
- }
- else if (add_symbol_segment != undefined_section
- && ! bfd_is_com_section (add_symbol_segment)
- && MD_APPLY_SYM_VALUE (fixP))
- add_number += S_GET_VALUE (fixP->fx_addsy);
- }
-
- if (fixP->fx_pcrel)
- {
- add_number -= MD_PCREL_FROM_SECTION (fixP, this_segment);
- if (!fixP->fx_done && fixP->fx_addsy == NULL)
- {
- /* There was no symbol required by this relocation.
- However, BFD doesn't really handle relocations
- without symbols well. So fake up a local symbol in
- the absolute section. */
- fixP->fx_addsy = abs_section_sym;
- }
- }
-
- if (!fixP->fx_done)
- md_apply_fix (fixP, &add_number, this_segment);
-
- if (!fixP->fx_done)
- {
- ++seg_reloc_count;
- if (fixP->fx_addsy == NULL)
- fixP->fx_addsy = abs_section_sym;
- symbol_mark_used_in_reloc (fixP->fx_addsy);
- if (fixP->fx_subsy != NULL)
- symbol_mark_used_in_reloc (fixP->fx_subsy);
- }
-
- if (!fixP->fx_bit_fixP && !fixP->fx_no_overflow && fixP->fx_size != 0)
- {
- if (fixP->fx_size < sizeof (valueT))
- {
- valueT mask;
-
- mask = 0;
- mask--; /* Set all bits to one. */
- mask <<= fixP->fx_size * 8 - (fixP->fx_signed ? 1 : 0);
- if ((add_number & mask) != 0 && (add_number & mask) != mask)
- {
- char buf[50], buf2[50];
- sprint_value (buf, fragP->fr_address + fixP->fx_where);
- if (add_number > 1000)
- sprint_value (buf2, add_number);
- else
- sprintf (buf2, "%ld", (long) add_number);
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("value of %s too large for field of %d bytes at %s"),
- buf2, fixP->fx_size, buf);
- } /* Generic error checking. */
- }
-#ifdef WARN_SIGNED_OVERFLOW_WORD
- /* Warn if a .word value is too large when treated as a signed
- number. We already know it is not too negative. This is to
- catch over-large switches generated by gcc on the 68k. */
- if (!flag_signed_overflow_ok
- && fixP->fx_size == 2
- && add_number > 0x7fff)
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("signed .word overflow; switch may be too large; %ld at 0x%lx"),
- (long) add_number,
- (long) (fragP->fr_address + fixP->fx_where));
-#endif
- } /* Not a bit fix. */
-
-#ifdef TC_VALIDATE_FIX
- skip: ATTRIBUTE_UNUSED_LABEL
- ;
-#endif
-#ifdef DEBUG5
- fprintf (stderr, "result:\n");
- print_fixup (fixP);
-#endif
- } /* For each fixS in this segment. */
-
- TC_ADJUST_RELOC_COUNT (fixP, seg_reloc_count);
- return seg_reloc_count;
-}
-
-static void
-fix_segment (bfd *abfd ATTRIBUTE_UNUSED,
- asection *sec,
- void *xxx ATTRIBUTE_UNUSED)
-{
- segment_info_type *seginfo = seg_info (sec);
-
- fixup_segment (seginfo->fix_root, sec);
-}
-
-static void
-install_reloc (asection *sec, arelent *reloc, fragS *fragp,
- char *file, unsigned int line)
-{
- char *err;
- bfd_reloc_status_type s;
-
- s = bfd_install_relocation (stdoutput, reloc,
- fragp->fr_literal, fragp->fr_address,
- sec, &err);
- switch (s)
- {
- case bfd_reloc_ok:
- break;
- case bfd_reloc_overflow:
- as_bad_where (file, line, _("relocation overflow"));
- break;
- case bfd_reloc_outofrange:
- as_bad_where (file, line, _("relocation out of range"));
- break;
- default:
- as_fatal (_("%s:%u: bad return from bfd_install_relocation: %x"),
- file, line, s);
- }
-}
-
-static void
-write_relocs (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
-{
- segment_info_type *seginfo = seg_info (sec);
- unsigned int i;
- unsigned int n;
- struct reloc_list *my_reloc_list, **rp, *r;
- arelent **relocs;
- fixS *fixp;
-
- /* If seginfo is NULL, we did not create this section; don't do
- anything with it. */
- if (seginfo == NULL)
- return;
-
- n = 0;
- for (fixp = seginfo->fix_root; fixp; fixp = fixp->fx_next)
- if (!fixp->fx_done)
- n++;
-
-#ifdef RELOC_EXPANSION_POSSIBLE
- n *= MAX_RELOC_EXPANSION;
-#endif
-
- /* Extract relocs for this section from reloc_list. */
- rp = &reloc_list;
- my_reloc_list = NULL;
- while ((r = *rp) != NULL)
- {
- if (r->u.b.sec == sec)
- {
- *rp = r->next;
- r->next = my_reloc_list;
- my_reloc_list = r;
- n++;
- }
- else
- rp = &r->next;
- }
-
- relocs = xcalloc (n, sizeof (arelent *));
-
- i = 0;
- for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next)
- {
- int j;
- int fx_size, slack;
- offsetT loc;
-
- if (fixp->fx_done)
- continue;
-
- fx_size = fixp->fx_size;
- slack = TC_FX_SIZE_SLACK (fixp);
- if (slack > 0)
- fx_size = fx_size > slack ? fx_size - slack : 0;
- loc = fixp->fx_where + fx_size;
- if (slack >= 0 && loc > fixp->fx_frag->fr_fix)
- as_bad_where (fixp->fx_file, fixp->fx_line,
- _("internal error: fixup not contained within frag"));
-
-#ifndef RELOC_EXPANSION_POSSIBLE
- {
- arelent *reloc = tc_gen_reloc (sec, fixp);
-
- if (!reloc)
- continue;
- relocs[i++] = reloc;
- j = 1;
- }
-#else
- {
- arelent **reloc = tc_gen_reloc (sec, fixp);
-
- for (j = 0; reloc[j]; j++)
- relocs[i++] = reloc[j];
- }
-#endif
-
- for ( ; j != 0; --j)
- install_reloc (sec, relocs[i - j], fixp->fx_frag,
- fixp->fx_file, fixp->fx_line);
- }
- n = i;
-
-#ifdef DEBUG4
- {
- unsigned int i, j, nsyms;
- asymbol **sympp;
- sympp = bfd_get_outsymbols (stdoutput);
- nsyms = bfd_get_symcount (stdoutput);
- for (i = 0; i < n; i++)
- if (((*relocs[i]->sym_ptr_ptr)->flags & BSF_SECTION_SYM) == 0)
- {
- for (j = 0; j < nsyms; j++)
- if (sympp[j] == *relocs[i]->sym_ptr_ptr)
- break;
- if (j == nsyms)
- abort ();
- }
- }
-#endif
-
- for (r = my_reloc_list; r != NULL; r = r->next)
- {
- fragS *f;
- for (f = seginfo->frchainP->frch_root; f; f = f->fr_next)
- if (f->fr_address <= r->u.b.r.address
- && r->u.b.r.address < f->fr_address + f->fr_fix)
- break;
- if (f == NULL)
- as_bad_where (r->file, r->line,
- _("reloc not within (fixed part of) section"));
- else
- {
- relocs[n++] = &r->u.b.r;
- install_reloc (sec, &r->u.b.r, f, r->file, r->line);
- }
- }
-
- if (n)
- {
- flagword flags = bfd_get_section_flags (abfd, sec);
- flags |= SEC_RELOC;
- bfd_set_section_flags (abfd, sec, flags);
- bfd_set_reloc (stdoutput, sec, relocs, n);
- }
-
-#ifdef SET_SECTION_RELOCS
- SET_SECTION_RELOCS (sec, relocs, n);
-#endif
-
-#ifdef DEBUG3
- {
- unsigned int i;
- arelent *r;
- asymbol *s;
- fprintf (stderr, "relocs for sec %s\n", sec->name);
- for (i = 0; i < n; i++)
- {
- r = relocs[i];
- s = *r->sym_ptr_ptr;
- fprintf (stderr, " reloc %2d @%p off %4lx : sym %-10s addend %lx\n",
- i, r, (unsigned long)r->address, s->name, (unsigned long)r->addend);
- }
- }
-#endif
-}
-
-static void
-write_contents (bfd *abfd ATTRIBUTE_UNUSED,
- asection *sec,
- void *xxx ATTRIBUTE_UNUSED)
-{
- segment_info_type *seginfo = seg_info (sec);
- addressT offset = 0;
- fragS *f;
-
- /* Write out the frags. */
- if (seginfo == NULL
- || !(bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS))
- return;
-
- for (f = seginfo->frchainP->frch_root;
- f;
- f = f->fr_next)
- {
- int x;
- addressT fill_size;
- char *fill_literal;
- offsetT count;
-
- assert (f->fr_type == rs_fill);
- if (f->fr_fix)
- {
- x = bfd_set_section_contents (stdoutput, sec,
- f->fr_literal, (file_ptr) offset,
- (bfd_size_type) f->fr_fix);
- if (!x)
- as_fatal (_("can't write %s: %s"), stdoutput->filename,
- bfd_errmsg (bfd_get_error ()));
- offset += f->fr_fix;
- }
- fill_literal = f->fr_literal + f->fr_fix;
- fill_size = f->fr_var;
- count = f->fr_offset;
- assert (count >= 0);
- if (fill_size && count)
- {
- char buf[256];
- if (fill_size > sizeof (buf))
- {
- /* Do it the old way. Can this ever happen? */
- while (count--)
- {
- x = bfd_set_section_contents (stdoutput, sec,
- fill_literal,
- (file_ptr) offset,
- (bfd_size_type) fill_size);
- if (!x)
- as_fatal (_("can't write %s: %s"), stdoutput->filename,
- bfd_errmsg (bfd_get_error ()));
- offset += fill_size;
- }
- }
- else
- {
- /* Build a buffer full of fill objects and output it as
- often as necessary. This saves on the overhead of
- potentially lots of bfd_set_section_contents calls. */
- int n_per_buf, i;
- if (fill_size == 1)
- {
- n_per_buf = sizeof (buf);
- memset (buf, *fill_literal, n_per_buf);
- }
- else
- {
- char *bufp;
- n_per_buf = sizeof (buf) / fill_size;
- for (i = n_per_buf, bufp = buf; i; i--, bufp += fill_size)
- memcpy (bufp, fill_literal, fill_size);
- }
- for (; count > 0; count -= n_per_buf)
- {
- n_per_buf = n_per_buf > count ? count : n_per_buf;
- x = bfd_set_section_contents
- (stdoutput, sec, buf, (file_ptr) offset,
- (bfd_size_type) n_per_buf * fill_size);
- if (!x)
- as_fatal (_("cannot write to output file"));
- offset += n_per_buf * fill_size;
- }
- }
- }
- }
-}
-
-static void
-merge_data_into_text (void)
-{
- seg_info (text_section)->frchainP->frch_last->fr_next =
- seg_info (data_section)->frchainP->frch_root;
- seg_info (text_section)->frchainP->frch_last =
- seg_info (data_section)->frchainP->frch_last;
- seg_info (data_section)->frchainP = 0;
-}
-
-static void
-set_symtab (void)
-{
- int nsyms;
- asymbol **asympp;
- symbolS *symp;
- bfd_boolean result;
-
- /* Count symbols. We can't rely on a count made by the loop in
- write_object_file, because *_frob_file may add a new symbol or
- two. */
- nsyms = 0;
- for (symp = symbol_rootP; symp; symp = symbol_next (symp))
- nsyms++;
-
- if (nsyms)
- {
- int i;
- bfd_size_type amt = (bfd_size_type) nsyms * sizeof (asymbol *);
-
- asympp = bfd_alloc (stdoutput, amt);
- symp = symbol_rootP;
- for (i = 0; i < nsyms; i++, symp = symbol_next (symp))
- {
- asympp[i] = symbol_get_bfdsym (symp);
- symbol_mark_written (symp);
- }
- }
- else
- asympp = 0;
- result = bfd_set_symtab (stdoutput, asympp, nsyms);
- assert (result);
- symbol_table_frozen = 1;
-}
-
-/* Finish the subsegments. After every sub-segment, we fake an
- ".align ...". This conforms to BSD4.2 brane-damage. We then fake
- ".fill 0" because that is the kind of frag that requires least
- thought. ".align" frags like to have a following frag since that
- makes calculating their intended length trivial. */
-
-#ifndef SUB_SEGMENT_ALIGN
-#ifdef HANDLE_ALIGN
-/* The last subsegment gets an alignment corresponding to the alignment
- of the section. This allows proper nop-filling at the end of
- code-bearing sections. */
-#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) \
- (!(FRCHAIN)->frch_next ? get_recorded_alignment (SEG) : 0)
-#else
-#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0
-#endif
-#endif
-
-void
-subsegs_finish (void)
-{
- struct frchain *frchainP;
- asection *s;
-
- for (s = stdoutput->sections; s; s = s->next)
- {
- segment_info_type *seginfo = seg_info (s);
- if (!seginfo)
- continue;
-
- for (frchainP = seginfo->frchainP;
- frchainP != NULL;
- frchainP = frchainP->frch_next)
- {
- int alignment = 0;
-
- subseg_set (s, frchainP->frch_subseg);
-
- /* This now gets called even if we had errors. In that case,
- any alignment is meaningless, and, moreover, will look weird
- if we are generating a listing. */
- if (!had_errors ())
- {
- alignment = SUB_SEGMENT_ALIGN (now_seg, frchainP);
- if ((bfd_get_section_flags (now_seg->owner, now_seg) & SEC_MERGE)
- && now_seg->entsize)
- {
- unsigned int entsize = now_seg->entsize;
- int entalign = 0;
-
- while ((entsize & 1) == 0)
- {
- ++entalign;
- entsize >>= 1;
- }
- if (entalign > alignment)
- alignment = entalign;
- }
- }
-
- if (subseg_text_p (now_seg))
- frag_align_code (alignment, 0);
- else
- frag_align (alignment, 0, 0);
-
- /* frag_align will have left a new frag.
- Use this last frag for an empty ".fill".
-
- For this segment ...
- Create a last frag. Do not leave a "being filled in frag". */
- frag_wane (frag_now);
- frag_now->fr_fix = 0;
- know (frag_now->fr_next == NULL);
- }
- }
-}
-
-/* Write the object file. */
-
-void
-write_object_file (void)
-{
- struct relax_seg_info rsi;
-#ifndef WORKING_DOT_WORD
- fragS *fragP; /* Track along all frags. */
-#endif
-
- /* Do we really want to write it? */
- {
- int n_warns, n_errs;
- n_warns = had_warnings ();
- n_errs = had_errors ();
- /* The -Z flag indicates that an object file should be generated,
- regardless of warnings and errors. */
- if (flag_always_generate_output)
- {
- if (n_warns || n_errs)
- as_warn (_("%d error%s, %d warning%s, generating bad object file"),
- n_errs, n_errs == 1 ? "" : "s",
- n_warns, n_warns == 1 ? "" : "s");
- }
- else
- {
- if (n_errs)
- as_fatal (_("%d error%s, %d warning%s, no object file generated"),
- n_errs, n_errs == 1 ? "" : "s",
- n_warns, n_warns == 1 ? "" : "s");
- }
- }
-
-#ifdef OBJ_VMS
- /* Under VMS we try to be compatible with VAX-11 "C". Thus, we call
- a routine to check for the definition of the procedure "_main",
- and if so -- fix it up so that it can be program entry point. */
- vms_check_for_main ();
-#endif /* OBJ_VMS */
-
- /* From now on, we don't care about sub-segments. Build one frag chain
- for each segment. Linked thru fr_next. */
-
- /* Remove the sections created by gas for its own purposes. */
- {
- int i;
-
- bfd_section_list_remove (stdoutput, reg_section);
- bfd_section_list_remove (stdoutput, expr_section);
- stdoutput->section_count -= 2;
- i = 0;
- bfd_map_over_sections (stdoutput, renumber_sections, &i);
- }
-
- bfd_map_over_sections (stdoutput, chain_frchains_together, (char *) 0);
-
- /* We have two segments. If user gave -R flag, then we must put the
- data frags into the text segment. Do this before relaxing so
- we know to take advantage of -R and make shorter addresses. */
- if (flag_readonly_data_in_text)
- {
- merge_data_into_text ();
- }
-
- rsi.pass = 0;
- while (1)
- {
-#ifndef WORKING_DOT_WORD
- /* We need to reset the markers in the broken word list and
- associated frags between calls to relax_segment (via
- relax_seg). Since the broken word list is global, we do it
- once per round, rather than locally in relax_segment for each
- segment. */
- struct broken_word *brokp;
-
- for (brokp = broken_words;
- brokp != (struct broken_word *) NULL;
- brokp = brokp->next_broken_word)
- {
- brokp->added = 0;
-
- if (brokp->dispfrag != (fragS *) NULL
- && brokp->dispfrag->fr_type == rs_broken_word)
- brokp->dispfrag->fr_subtype = 0;
- }
-#endif
-
- rsi.changed = 0;
- bfd_map_over_sections (stdoutput, relax_seg, &rsi);
- rsi.pass++;
- if (!rsi.changed)
- break;
- }
-
- /* Note - Most ports will use the default value of
- TC_FINALIZE_SYMS_BEFORE_SIZE_SEG, which 1. This will force
- local symbols to be resolved, removing their frag information.
- Some ports however, will not have finished relaxing all of
- their frags and will still need the local symbol frag
- information. These ports can set
- TC_FINALIZE_SYMS_BEFORE_SIZE_SEG to 0. */
- finalize_syms = TC_FINALIZE_SYMS_BEFORE_SIZE_SEG;
-
- bfd_map_over_sections (stdoutput, size_seg, (char *) 0);
-
- /* Relaxation has completed. Freeze all syms. */
- finalize_syms = 1;
-
-#ifdef md_post_relax_hook
- md_post_relax_hook;
-#endif
-
-#ifndef WORKING_DOT_WORD
- {
- struct broken_word *lie;
- struct broken_word **prevP;
-
- prevP = &broken_words;
- for (lie = broken_words; lie; lie = lie->next_broken_word)
- if (!lie->added)
- {
- expressionS exp;
-
- subseg_change (lie->seg, lie->subseg);
- exp.X_op = O_subtract;
- exp.X_add_symbol = lie->add;
- exp.X_op_symbol = lie->sub;
- exp.X_add_number = lie->addnum;
-#ifdef TC_CONS_FIX_NEW
- TC_CONS_FIX_NEW (lie->frag,
- lie->word_goes_here - lie->frag->fr_literal,
- 2, &exp);
-#else
- fix_new_exp (lie->frag,
- lie->word_goes_here - lie->frag->fr_literal,
- 2, &exp, 0, BFD_RELOC_16);
-#endif
- *prevP = lie->next_broken_word;
- }
- else
- prevP = &(lie->next_broken_word);
-
- for (lie = broken_words; lie;)
- {
- struct broken_word *untruth;
- char *table_ptr;
- addressT table_addr;
- addressT from_addr, to_addr;
- int n, m;
-
- subseg_change (lie->seg, lie->subseg);
- fragP = lie->dispfrag;
-
- /* Find out how many broken_words go here. */
- n = 0;
- for (untruth = lie;
- untruth && untruth->dispfrag == fragP;
- untruth = untruth->next_broken_word)
- if (untruth->added == 1)
- n++;
-
- table_ptr = lie->dispfrag->fr_opcode;
- table_addr = (lie->dispfrag->fr_address
- + (table_ptr - lie->dispfrag->fr_literal));
- /* Create the jump around the long jumps. This is a short
- jump from table_ptr+0 to table_ptr+n*long_jump_size. */
- from_addr = table_addr;
- to_addr = table_addr + md_short_jump_size + n * md_long_jump_size;
- md_create_short_jump (table_ptr, from_addr, to_addr, lie->dispfrag,
- lie->add);
- table_ptr += md_short_jump_size;
- table_addr += md_short_jump_size;
-
- for (m = 0;
- lie && lie->dispfrag == fragP;
- m++, lie = lie->next_broken_word)
- {
- if (lie->added == 2)
- continue;
- /* Patch the jump table. */
- /* This is the offset from ??? to table_ptr+0. */
- to_addr = table_addr - S_GET_VALUE (lie->sub);
-#ifdef TC_CHECK_ADJUSTED_BROKEN_DOT_WORD
- TC_CHECK_ADJUSTED_BROKEN_DOT_WORD (to_addr, lie);
-#endif
- md_number_to_chars (lie->word_goes_here, to_addr, 2);
- for (untruth = lie->next_broken_word;
- untruth && untruth->dispfrag == fragP;
- untruth = untruth->next_broken_word)
- {
- if (untruth->use_jump == lie)
- md_number_to_chars (untruth->word_goes_here, to_addr, 2);
- }
-
- /* Install the long jump. */
- /* This is a long jump from table_ptr+0 to the final target. */
- from_addr = table_addr;
- to_addr = S_GET_VALUE (lie->add) + lie->addnum;
- md_create_long_jump (table_ptr, from_addr, to_addr, lie->dispfrag,
- lie->add);
- table_ptr += md_long_jump_size;
- table_addr += md_long_jump_size;
- }
- }
- }
-#endif /* not WORKING_DOT_WORD */
-
- /* Resolve symbol values. This needs to be done before processing
- the relocations. */
- if (symbol_rootP)
- {
- symbolS *symp;
-
- for (symp = symbol_rootP; symp; symp = symbol_next (symp))
- resolve_symbol_value (symp);
- }
- resolve_local_symbol_values ();
- resolve_reloc_expr_symbols ();
-
- PROGRESS (1);
-
-#ifdef tc_frob_file_before_adjust
- tc_frob_file_before_adjust ();
-#endif
-#ifdef obj_frob_file_before_adjust
- obj_frob_file_before_adjust ();
-#endif
-
- bfd_map_over_sections (stdoutput, adjust_reloc_syms, (char *) 0);
-
-#ifdef tc_frob_file_before_fix
- tc_frob_file_before_fix ();
-#endif
-#ifdef obj_frob_file_before_fix
- obj_frob_file_before_fix ();
-#endif
-
- bfd_map_over_sections (stdoutput, fix_segment, (char *) 0);
-
- /* Set up symbol table, and write it out. */
- if (symbol_rootP)
- {
- symbolS *symp;
- bfd_boolean skip_next_symbol = FALSE;
-
- for (symp = symbol_rootP; symp; symp = symbol_next (symp))
- {
- int punt = 0;
- const char *name;
-
- if (skip_next_symbol)
- {
- /* Don't do anything besides moving the value of the
- symbol from the GAS value-field to the BFD value-field. */
- symbol_get_bfdsym (symp)->value = S_GET_VALUE (symp);
- skip_next_symbol = FALSE;
- continue;
- }
-
- if (symbol_mri_common_p (symp))
- {
- if (S_IS_EXTERNAL (symp))
- as_bad (_("%s: global symbols not supported in common sections"),
- S_GET_NAME (symp));
- symbol_remove (symp, &symbol_rootP, &symbol_lastP);
- continue;
- }
-
- name = S_GET_NAME (symp);
- if (name)
- {
- const char *name2 =
- decode_local_label_name ((char *) S_GET_NAME (symp));
- /* They only differ if `name' is a fb or dollar local
- label name. */
- if (name2 != name && ! S_IS_DEFINED (symp))
- as_bad (_("local label `%s' is not defined"), name2);
- }
-
- /* Do it again, because adjust_reloc_syms might introduce
- more symbols. They'll probably only be section symbols,
- but they'll still need to have the values computed. */
- resolve_symbol_value (symp);
-
- /* Skip symbols which were equated to undefined or common
- symbols. */
- if (symbol_equated_reloc_p (symp)
- || S_IS_WEAKREFR (symp))
- {
- const char *name = S_GET_NAME (symp);
- if (S_IS_COMMON (symp)
- && !TC_FAKE_LABEL (name)
- && !S_IS_WEAKREFR (symp)
- && (!S_IS_EXTERNAL (symp) || S_IS_LOCAL (symp)))
- {
- expressionS *e = symbol_get_value_expression (symp);
- as_bad (_("Local symbol `%s' can't be equated to common symbol `%s'"),
- name, S_GET_NAME (e->X_add_symbol));
- }
- if (S_GET_SEGMENT (symp) == reg_section)
- {
- /* Report error only if we know the symbol name. */
- if (S_GET_NAME (symp) != reg_section->name)
- as_bad (_("can't make global register symbol `%s'"),
- name);
- }
- symbol_remove (symp, &symbol_rootP, &symbol_lastP);
- continue;
- }
-
-#ifdef obj_frob_symbol
- obj_frob_symbol (symp, punt);
-#endif
-#ifdef tc_frob_symbol
- if (! punt || symbol_used_in_reloc_p (symp))
- tc_frob_symbol (symp, punt);
-#endif
-
- /* If we don't want to keep this symbol, splice it out of
- the chain now. If EMIT_SECTION_SYMBOLS is 0, we never
- want section symbols. Otherwise, we skip local symbols
- and symbols that the frob_symbol macros told us to punt,
- but we keep such symbols if they are used in relocs. */
- if (symp == abs_section_sym
- || (! EMIT_SECTION_SYMBOLS
- && symbol_section_p (symp))
- /* Note that S_IS_EXTERNAL and S_IS_LOCAL are not always
- opposites. Sometimes the former checks flags and the
- latter examines the name... */
- || (!S_IS_EXTERNAL (symp)
- && (punt || S_IS_LOCAL (symp) ||
- (S_IS_WEAKREFD (symp) && ! symbol_used_p (symp)))
- && ! symbol_used_in_reloc_p (symp)))
- {
- symbol_remove (symp, &symbol_rootP, &symbol_lastP);
-
- /* After symbol_remove, symbol_next(symp) still returns
- the one that came after it in the chain. So we don't
- need to do any extra cleanup work here. */
- continue;
- }
-
- /* Make sure we really got a value for the symbol. */
- if (! symbol_resolved_p (symp))
- {
- as_bad (_("can't resolve value for symbol `%s'"),
- S_GET_NAME (symp));
- symbol_mark_resolved (symp);
- }
-
- /* Set the value into the BFD symbol. Up til now the value
- has only been kept in the gas symbolS struct. */
- symbol_get_bfdsym (symp)->value = S_GET_VALUE (symp);
-
- /* A warning construct is a warning symbol followed by the
- symbol warned about. Don't let anything object-format or
- target-specific muck with it; it's ready for output. */
- if (symbol_get_bfdsym (symp)->flags & BSF_WARNING)
- skip_next_symbol = TRUE;
- }
- }
-
- PROGRESS (1);
-
- /* Now do any format-specific adjustments to the symbol table, such
- as adding file symbols. */
-#ifdef tc_adjust_symtab
- tc_adjust_symtab ();
-#endif
-#ifdef obj_adjust_symtab
- obj_adjust_symtab ();
-#endif
-
- /* Stop if there is an error. */
- if (had_errors ())
- return;
-
- /* Now that all the sizes are known, and contents correct, we can
- start writing to the file. */
- set_symtab ();
-
- /* If *_frob_file changes the symbol value at this point, it is
- responsible for moving the changed value into symp->bsym->value
- as well. Hopefully all symbol value changing can be done in
- *_frob_symbol. */
-#ifdef tc_frob_file
- tc_frob_file ();
-#endif
-#ifdef obj_frob_file
- obj_frob_file ();
-#endif
-
- bfd_map_over_sections (stdoutput, write_relocs, (char *) 0);
-
-#ifdef tc_frob_file_after_relocs
- tc_frob_file_after_relocs ();
-#endif
-#ifdef obj_frob_file_after_relocs
- obj_frob_file_after_relocs ();
-#endif
-
- bfd_map_over_sections (stdoutput, write_contents, (char *) 0);
-}
-
-#ifdef TC_GENERIC_RELAX_TABLE
-/* Relax a fragment by scanning TC_GENERIC_RELAX_TABLE. */
-
-long
-relax_frag (segT segment, fragS *fragP, long stretch)
-{
- const relax_typeS *this_type;
- const relax_typeS *start_type;
- relax_substateT next_state;
- relax_substateT this_state;
- offsetT growth;
- offsetT aim;
- addressT target;
- addressT address;
- symbolS *symbolP;
- const relax_typeS *table;
-
- target = fragP->fr_offset;
- address = fragP->fr_address;
- table = TC_GENERIC_RELAX_TABLE;
- this_state = fragP->fr_subtype;
- start_type = this_type = table + this_state;
- symbolP = fragP->fr_symbol;
-
- if (symbolP)
- {
- fragS *sym_frag;
-
- sym_frag = symbol_get_frag (symbolP);
-
-#ifndef DIFF_EXPR_OK
- know (sym_frag != NULL);
-#endif
- know (S_GET_SEGMENT (symbolP) != absolute_section
- || sym_frag == &zero_address_frag);
- target += S_GET_VALUE (symbolP);
-
- /* If frag has yet to be reached on this pass,
- assume it will move by STRETCH just as we did.
- If this is not so, it will be because some frag
- between grows, and that will force another pass. */
-
- if (stretch != 0
- && sym_frag->relax_marker != fragP->relax_marker
- && S_GET_SEGMENT (symbolP) == segment)
- {
- target += stretch;
- }
- }
-
- aim = target - address - fragP->fr_fix;
-#ifdef TC_PCREL_ADJUST
- /* Currently only the ns32k family needs this. */
- aim += TC_PCREL_ADJUST (fragP);
-#endif
-
-#ifdef md_prepare_relax_scan
- /* Formerly called M68K_AIM_KLUDGE. */
- md_prepare_relax_scan (fragP, address, aim, this_state, this_type);
-#endif
-
- if (aim < 0)
- {
- /* Look backwards. */
- for (next_state = this_type->rlx_more; next_state;)
- if (aim >= this_type->rlx_backward)
- next_state = 0;
- else
- {
- /* Grow to next state. */
- this_state = next_state;
- this_type = table + this_state;
- next_state = this_type->rlx_more;
- }
- }
- else
- {
- /* Look forwards. */
- for (next_state = this_type->rlx_more; next_state;)
- if (aim <= this_type->rlx_forward)
- next_state = 0;
- else
- {
- /* Grow to next state. */
- this_state = next_state;
- this_type = table + this_state;
- next_state = this_type->rlx_more;
- }
- }
-
- growth = this_type->rlx_length - start_type->rlx_length;
- if (growth != 0)
- fragP->fr_subtype = this_state;
- return growth;
-}
-
-#endif /* defined (TC_GENERIC_RELAX_TABLE) */
-
-/* Relax_align. Advance location counter to next address that has 'alignment'
- lowest order bits all 0s, return size of adjustment made. */
-static relax_addressT
-relax_align (register relax_addressT address, /* Address now. */
- register int alignment /* Alignment (binary). */)
-{
- relax_addressT mask;
- relax_addressT new_address;
-
- mask = ~((~0) << alignment);
- new_address = (address + mask) & (~mask);
-#ifdef LINKER_RELAXING_SHRINKS_ONLY
- if (linkrelax)
- /* We must provide lots of padding, so the linker can discard it
- when needed. The linker will not add extra space, ever. */
- new_address += (1 << alignment);
-#endif
- return (new_address - address);
-}
-
-/* Now we have a segment, not a crowd of sub-segments, we can make
- fr_address values.
-
- Relax the frags.
-
- After this, all frags in this segment have addresses that are correct
- within the segment. Since segments live in different file addresses,
- these frag addresses may not be the same as final object-file
- addresses. */
-
-int
-relax_segment (struct frag *segment_frag_root, segT segment, int pass)
-{
- unsigned long frag_count;
- struct frag *fragP;
- relax_addressT address;
- int ret;
-
- /* In case md_estimate_size_before_relax() wants to make fixSs. */
- subseg_change (segment, 0);
-
- /* For each frag in segment: count and store (a 1st guess of)
- fr_address. */
- address = 0;
- for (frag_count = 0, fragP = segment_frag_root;
- fragP;
- fragP = fragP->fr_next, frag_count ++)
- {
- fragP->relax_marker = 0;
- fragP->fr_address = address;
- address += fragP->fr_fix;
-
- switch (fragP->fr_type)
- {
- case rs_fill:
- address += fragP->fr_offset * fragP->fr_var;
- break;
-
- case rs_align:
- case rs_align_code:
- case rs_align_test:
- {
- addressT offset = relax_align (address, (int) fragP->fr_offset);
-
- if (fragP->fr_subtype != 0 && offset > fragP->fr_subtype)
- offset = 0;
-
- if (offset % fragP->fr_var != 0)
- {
- as_bad_where (fragP->fr_file, fragP->fr_line,
- _("alignment padding (%lu bytes) not a multiple of %ld"),
- (unsigned long) offset, (long) fragP->fr_var);
- offset -= (offset % fragP->fr_var);
- }
-
- address += offset;
- }
- break;
-
- case rs_org:
- case rs_space:
- /* Assume .org is nugatory. It will grow with 1st relax. */
- break;
-
- case rs_machine_dependent:
- /* If fr_symbol is an expression, this call to
- resolve_symbol_value sets up the correct segment, which will
- likely be needed in md_estimate_size_before_relax. */
- if (fragP->fr_symbol)
- resolve_symbol_value (fragP->fr_symbol);
-
- address += md_estimate_size_before_relax (fragP, segment);
- break;
-
-#ifndef WORKING_DOT_WORD
- /* Broken words don't concern us yet. */
- case rs_broken_word:
- break;
-#endif
-
- case rs_leb128:
- /* Initial guess is always 1; doing otherwise can result in
- stable solutions that are larger than the minimum. */
- address += fragP->fr_offset = 1;
- break;
-
- case rs_cfa:
- address += eh_frame_estimate_size_before_relax (fragP);
- break;
-
- case rs_dwarf2dbg:
- address += dwarf2dbg_estimate_size_before_relax (fragP);
- break;
-
- default:
- BAD_CASE (fragP->fr_type);
- break;
- }
- }
-
- /* Do relax(). */
- {
- unsigned long max_iterations;
-
- /* Cumulative address adjustment. */
- offsetT stretch;
-
- /* Have we made any adjustment this pass? We can't just test
- stretch because one piece of code may have grown and another
- shrank. */
- int stretched;
-
- /* Most horrible, but gcc may give us some exception data that
- is impossible to assemble, of the form
-
- .align 4
- .byte 0, 0
- .uleb128 end - start
- start:
- .space 128*128 - 1
- .align 4
- end:
-
- If the leb128 is two bytes in size, then end-start is 128*128,
- which requires a three byte leb128. If the leb128 is three
- bytes in size, then end-start is 128*128-1, which requires a
- two byte leb128. We work around this dilemma by inserting
- an extra 4 bytes of alignment just after the .align. This
- works because the data after the align is accessed relative to
- the end label.
-
- This counter is used in a tiny state machine to detect
- whether a leb128 followed by an align is impossible to
- relax. */
- int rs_leb128_fudge = 0;
-
- /* We want to prevent going into an infinite loop where one frag grows
- depending upon the location of a symbol which is in turn moved by
- the growing frag. eg:
-
- foo = .
- .org foo+16
- foo = .
-
- So we dictate that this algorithm can be at most O2. */
- max_iterations = frag_count * frag_count;
- /* Check for overflow. */
- if (max_iterations < frag_count)
- max_iterations = frag_count;
-
- ret = 0;
- do
- {
- stretch = 0;
- stretched = 0;
-
- for (fragP = segment_frag_root; fragP; fragP = fragP->fr_next)
- {
- offsetT growth = 0;
- addressT was_address;
- offsetT offset;
- symbolS *symbolP;
-
- fragP->relax_marker ^= 1;
- was_address = fragP->fr_address;
- address = fragP->fr_address += stretch;
- symbolP = fragP->fr_symbol;
- offset = fragP->fr_offset;
-
- switch (fragP->fr_type)
- {
- case rs_fill: /* .fill never relaxes. */
- growth = 0;
- break;
-
-#ifndef WORKING_DOT_WORD
- /* JF: This is RMS's idea. I do *NOT* want to be blamed
- for it I do not want to write it. I do not want to have
- anything to do with it. This is not the proper way to
- implement this misfeature. */
- case rs_broken_word:
- {
- struct broken_word *lie;
- struct broken_word *untruth;
-
- /* Yes this is ugly (storing the broken_word pointer
- in the symbol slot). Still, this whole chunk of
- code is ugly, and I don't feel like doing anything
- about it. Think of it as stubbornness in action. */
- growth = 0;
- for (lie = (struct broken_word *) (fragP->fr_symbol);
- lie && lie->dispfrag == fragP;
- lie = lie->next_broken_word)
- {
-
- if (lie->added)
- continue;
-
- offset = (S_GET_VALUE (lie->add)
- + lie->addnum
- - S_GET_VALUE (lie->sub));
- if (offset <= -32768 || offset >= 32767)
- {
- if (flag_warn_displacement)
- {
- char buf[50];
- sprint_value (buf, (addressT) lie->addnum);
- as_warn_where (fragP->fr_file, fragP->fr_line,
- _(".word %s-%s+%s didn't fit"),
- S_GET_NAME (lie->add),
- S_GET_NAME (lie->sub),
- buf);
- }
- lie->added = 1;
- if (fragP->fr_subtype == 0)
- {
- fragP->fr_subtype++;
- growth += md_short_jump_size;
- }
- for (untruth = lie->next_broken_word;
- untruth && untruth->dispfrag == lie->dispfrag;
- untruth = untruth->next_broken_word)
- if ((symbol_get_frag (untruth->add)
- == symbol_get_frag (lie->add))
- && (S_GET_VALUE (untruth->add)
- == S_GET_VALUE (lie->add)))
- {
- untruth->added = 2;
- untruth->use_jump = lie;
- }
- growth += md_long_jump_size;
- }
- }
-
- break;
- } /* case rs_broken_word */
-#endif
- case rs_align:
- case rs_align_code:
- case rs_align_test:
- {
- addressT oldoff, newoff;
-
- oldoff = relax_align (was_address + fragP->fr_fix,
- (int) offset);
- newoff = relax_align (address + fragP->fr_fix,
- (int) offset);
-
- if (fragP->fr_subtype != 0)
- {
- if (oldoff > fragP->fr_subtype)
- oldoff = 0;
- if (newoff > fragP->fr_subtype)
- newoff = 0;
- }
-
- growth = newoff - oldoff;
-
- /* If this align happens to follow a leb128 and
- we have determined that the leb128 is bouncing
- in size, then break the cycle by inserting an
- extra alignment. */
- if (growth < 0
- && (rs_leb128_fudge & 16) != 0
- && (rs_leb128_fudge & 15) >= 2)
- {
- segment_info_type *seginfo = seg_info (segment);
- struct obstack *ob = &seginfo->frchainP->frch_obstack;
- struct frag *newf;
-
- newf = frag_alloc (ob);
- obstack_blank_fast (ob, fragP->fr_var);
- obstack_finish (ob);
- memcpy (newf, fragP, SIZEOF_STRUCT_FRAG);
- memcpy (newf->fr_literal,
- fragP->fr_literal + fragP->fr_fix,
- fragP->fr_var);
- newf->fr_type = rs_fill;
- newf->fr_fix = 0;
- newf->fr_offset = (((offsetT) 1 << fragP->fr_offset)
- / fragP->fr_var);
- if (newf->fr_offset * newf->fr_var
- != (offsetT) 1 << fragP->fr_offset)
- {
- newf->fr_offset = (offsetT) 1 << fragP->fr_offset;
- newf->fr_var = 1;
- }
- /* Include growth of new frag, because rs_fill
- frags don't normally grow. */
- growth += newf->fr_offset * newf->fr_var;
- /* The new frag address is newoff. Adjust this
- for the amount we'll add when we process the
- new frag. */
- newf->fr_address = newoff - stretch - growth;
- newf->relax_marker ^= 1;
- fragP->fr_next = newf;
-#ifdef DEBUG
- as_warn (_("padding added"));
-#endif
- }
- }
- break;
-
- case rs_org:
- {
- addressT target = offset;
- addressT after;
-
- if (symbolP)
- {
- /* Convert from an actual address to an octet offset
- into the section. Here it is assumed that the
- section's VMA is zero, and can omit subtracting it
- from the symbol's value to get the address offset. */
- know (S_GET_SEGMENT (symbolP)->vma == 0);
- target += S_GET_VALUE (symbolP) * OCTETS_PER_BYTE;
- }
-
- know (fragP->fr_next);
- after = fragP->fr_next->fr_address + stretch;
- growth = target - after;
- if (growth < 0)
- {
- growth = 0;
-
- /* Don't error on first few frag relax passes.
- The symbol might be an expression involving
- symbol values from other sections. If those
- sections have not yet been processed their
- frags will all have zero addresses, so we
- will calculate incorrect values for them. The
- number of passes we allow before giving an
- error is somewhat arbitrary. It should be at
- least one, with larger values requiring
- increasingly contrived dependencies between
- frags to trigger a false error. */
- if (pass < 2)
- {
- /* Force another pass. */
- ret = 1;
- break;
- }
-
- /* Growth may be negative, but variable part of frag
- cannot have fewer than 0 chars. That is, we can't
- .org backwards. */
- as_bad_where (fragP->fr_file, fragP->fr_line,
- _("attempt to move .org backwards"));
-
- /* We've issued an error message. Change the
- frag to avoid cascading errors. */
- fragP->fr_type = rs_align;
- fragP->fr_subtype = 0;
- fragP->fr_offset = 0;
- fragP->fr_fix = after - address;
- }
- }
- break;
-
- case rs_space:
- growth = 0;
- if (symbolP)
- {
- offsetT amount;
-
- amount = S_GET_VALUE (symbolP);
- if (S_GET_SEGMENT (symbolP) != absolute_section
- || S_IS_COMMON (symbolP)
- || ! S_IS_DEFINED (symbolP))
- {
- as_bad_where (fragP->fr_file, fragP->fr_line,
- _(".space specifies non-absolute value"));
- /* Prevent repeat of this error message. */
- fragP->fr_symbol = 0;
- }
- else if (amount < 0)
- {
- /* Don't error on first few frag relax passes.
- See rs_org comment for a longer explanation. */
- if (pass < 2)
- {
- ret = 1;
- break;
- }
-
- as_warn_where (fragP->fr_file, fragP->fr_line,
- _(".space or .fill with negative value, ignored"));
- fragP->fr_symbol = 0;
- }
- else
- growth = (was_address + fragP->fr_fix + amount
- - fragP->fr_next->fr_address);
- }
- break;
-
- case rs_machine_dependent:
-#ifdef md_relax_frag
- growth = md_relax_frag (segment, fragP, stretch);
-#else
-#ifdef TC_GENERIC_RELAX_TABLE
- /* The default way to relax a frag is to look through
- TC_GENERIC_RELAX_TABLE. */
- growth = relax_frag (segment, fragP, stretch);
-#endif /* TC_GENERIC_RELAX_TABLE */
-#endif
- break;
-
- case rs_leb128:
- {
- valueT value;
- offsetT size;
-
- value = resolve_symbol_value (fragP->fr_symbol);
- size = sizeof_leb128 (value, fragP->fr_subtype);
- growth = size - fragP->fr_offset;
- fragP->fr_offset = size;
- }
- break;
-
- case rs_cfa:
- growth = eh_frame_relax_frag (fragP);
- break;
-
- case rs_dwarf2dbg:
- growth = dwarf2dbg_relax_frag (fragP);
- break;
-
- default:
- BAD_CASE (fragP->fr_type);
- break;
- }
- if (growth)
- {
- stretch += growth;
- stretched = 1;
- if (fragP->fr_type == rs_leb128)
- rs_leb128_fudge += 16;
- else if (fragP->fr_type == rs_align
- && (rs_leb128_fudge & 16) != 0
- && stretch == 0)
- rs_leb128_fudge += 16;
- else
- rs_leb128_fudge = 0;
- }
- }
-
- if (stretch == 0
- && (rs_leb128_fudge & 16) == 0
- && (rs_leb128_fudge & -16) != 0)
- rs_leb128_fudge += 1;
- else
- rs_leb128_fudge = 0;
- }
- /* Until nothing further to relax. */
- while (stretched && -- max_iterations);
-
- if (stretched)
- as_fatal (_("Infinite loop encountered whilst attempting to compute the addresses of symbols in section %s"),
- segment_name (segment));
- }
-
- for (fragP = segment_frag_root; fragP; fragP = fragP->fr_next)
- if (fragP->last_fr_address != fragP->fr_address)
- {
- fragP->last_fr_address = fragP->fr_address;
- ret = 1;
- }
- return ret;
-}
-
-void
-number_to_chars_bigendian (char *buf, valueT val, int n)
-{
- if (n <= 0)
- abort ();
- while (n--)
- {
- buf[n] = val & 0xff;
- val >>= 8;
- }
-}
-
-void
-number_to_chars_littleendian (char *buf, valueT val, int n)
-{
- if (n <= 0)
- abort ();
- while (n--)
- {
- *buf++ = val & 0xff;
- val >>= 8;
- }
-}
-
-void
-write_print_statistics (FILE *file)
-{
- fprintf (file, "fixups: %d\n", n_fixups);
-}
-
-/* For debugging. */
-extern int indent_level;
-
-void
-print_fixup (fixS *fixp)
-{
- indent_level = 1;
- fprintf (stderr, "fix ");
- fprintf_vma (stderr, (bfd_vma)((bfd_hostptr_t) fixp));
- fprintf (stderr, " %s:%d",fixp->fx_file, fixp->fx_line);
- if (fixp->fx_pcrel)
- fprintf (stderr, " pcrel");
- if (fixp->fx_pcrel_adjust)
- fprintf (stderr, " pcrel_adjust=%d", fixp->fx_pcrel_adjust);
- if (fixp->fx_im_disp)
- {
-#ifdef TC_NS32K
- fprintf (stderr, " im_disp=%d", fixp->fx_im_disp);
-#else
- fprintf (stderr, " im_disp");
-#endif
- }
- if (fixp->fx_tcbit)
- fprintf (stderr, " tcbit");
- if (fixp->fx_done)
- fprintf (stderr, " done");
- fprintf (stderr, "\n size=%d frag=", fixp->fx_size);
- fprintf_vma (stderr, (bfd_vma) ((bfd_hostptr_t) fixp->fx_frag));
- fprintf (stderr, " where=%ld offset=%lx addnumber=%lx",
- (long) fixp->fx_where,
- (unsigned long) fixp->fx_offset,
- (unsigned long) fixp->fx_addnumber);
- fprintf (stderr, "\n %s (%d)", bfd_get_reloc_code_name (fixp->fx_r_type),
- fixp->fx_r_type);
- if (fixp->fx_addsy)
- {
- fprintf (stderr, "\n +<");
- print_symbol_value_1 (stderr, fixp->fx_addsy);
- fprintf (stderr, ">");
- }
- if (fixp->fx_subsy)
- {
- fprintf (stderr, "\n -<");
- print_symbol_value_1 (stderr, fixp->fx_subsy);
- fprintf (stderr, ">");
- }
- fprintf (stderr, "\n");
-#ifdef TC_FIX_DATA_PRINT
- TC_FIX_DATA_PRINT (stderr, fixp);
-#endif
-}
diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog
deleted file mode 100644
index cccfd4cba97..00000000000
--- a/gdb/gdbtk/ChangeLog
+++ /dev/null
@@ -1,171 +0,0 @@
-2008-08-02 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-cmds.c: Don't include itcl.h.
- * generic/gdbtk-hooks.c: Likewise.
- * generic/gdbtk.c: Include tcl.h and tk.h instead of itcl.h
- and itk.h.
- (gdbtk_init): Rewrite to accommodate using a system-provided
- Tcl, Tk, Itcl, Itk.
- (gdbtk_source_start_file) [!_WIN32]: Don't call error() when
- we fail to source the start file. Just dump the message to stderr.
- Throw an exception indicating the failure.
- * library/ehandler.itb (GDBEventHander::dispatch): "itcl_info" is
- deprecated: use "itcl::find objects" instead.
- * library/managedwin.itb (window_instance): Ditto.
- (restart): Ditto.
- (shutdown): Ditto.
- (_open): Ditto.
- (find): Ditto.
- * library/globalpref.itb (_build_win): Don't pass config arguments
- for libgui widgets to the constructor. Configure the widget after
- creation.
- * library/srcpref.itb (_build_win): Ditto.
- * library/main.tcl: Update Tcl, Tk, Itcl, Itk, and Iwidgets (just
- added to this loop) version requirements.
- No need to initialize Iwidgets separately.
- * plugins/Make-rules (TCLHDIR): Renamed to TCL_INCLUDES. Change
- all references.
- (TCL_BUILD_LIB_SPEC): Renamed to TCL_LIBRARY. Change all references.
- * plugins/acinclude.m4: Include the standard tcl.m4 instead
- of the sourceware-derived one.
- * plugins/configure.ac: Use Tcl's standard SC_* macros instead of
- the sourceware-derived CYG_AC_* macros.
- Add logic to deal with using a system-supplied Tcl/Tk.
- * plugins/configure: Regenerated.
- * plugins/Makefile.in: Regenerated.
-
-2008-07-25 Tom Tromey <tromey@redhat.com>
-
- * generic/gdbtk-hooks.c: Include observer.h, not gdb-events.h.
- (gdbtk_add_hooks): Use observers, not events.
- (gdbtk_architecture_changed): Add argument, for observer.
- * generic/gdbtk-bp.c: Include observer.h.
- (gdb_set_bp): Notify observer.
- (gdb_set_bp_addr): Likewise.
-
-2008-07-14 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-stack.c (gdb_block_args): Remove deprecated values
- LOC_LOCAL_ARG, LOC_COMPUTED_ARG, LOC_REGPARM, LOC_BASEARG_ARG, and
- LOC_BASEARG.
- (gdb_get_blocks): Likewise.
- (gdb_get_vars_command): Likewise.
- Fix type-punned pointer error introduced on 03-07.
-
- * generic/gdbtk-cmds.c (gdbtk_load_asm): Use paddress instead
- of deprecated_print_address_numeric.
- (gdb_stop): Update use of target_stop.
-
- * generic/gdbtk.h (gdbtk_get_ptid): Declare new function.
- * generic/gdbtk-hooks.c (gdbtk_wait): Save inferior's ptid.
- (gdbtk_get_ptid): Define new function.
- * generic/gdbtk-varobj.c (variable_update): Update for recent
- varobj_update API change.
- * generic/gdbtk-wrapper.h (GDB_varobj_update): Likewise.
- * generic/gdbtk-wrapper.c (GDB_varobj_update): Likewise.
- (wrap_varobj_update): Likewise.
-
- * library/targetselection.itb (init_target_db): Initialize
- preferences here instead of ...
- (_init): ... here.
- (_init_prefs): Define gdb/load/default-portname, too.
-
-2008-05-12 Pierre Muller <muller@ics.u-strasbg.fr>
-
- * Update uses of val_print functions with additional language argument.
- generic/gdbtk-cmds.c: Add "language.h" include.
- (gdb_eval): Add current_language as new arg of val_print.
- generic/gdbtk-register.c: Add "language.h" include.
- (get_register): Add current_language as new arg of val_print.
- generic/gdbtk-wrapper.c: Add "language.h" include.
- (wrap_val_print): Add current_language as new arg of val_print.
-
-2008-04-21 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-cmds.c (symtab_to_filename): Call gdb's
- open_source_file instead of find_and_open_source.
-
-2008-03-28 Maciej W. Rozycki <macro@mips.com>
-
- * README: Fix a typo.
-
-2008-03-18 Maciej W. Rozycki <macro@mips.com>
-
- * generic/gdbtk-interp.c (gdbtk_interpreter_init): New parameter
- top_level.
-
-2008-03-07 Keith Seitz <kseitz@sourceware.org>
-
- * generic/gdbtk-register.c (map_arg): New data type
- for passing arguments to mapping functions.
- (map_func): New definition of mapping function.
- Changed all callers to use these new types.
- * generic/gdbtk-stack.c (gdb_get_vars_command): Change
- cast to int to dereference of int *.
- * generic/gdbtk-wrapper.c: Change all casts to char * for
- results and args to use pointer or integer flavor of
- gdb_wrapper_args.results and .args.
- * generic/gdbtk-wrapper.h: struct gdb_wrapper_arguments
- members result and args now return a union of void * and int.
-
-2008-03-03 Keith Seitz <keiths@redhat.com>
-
- From Dave Murphy <davem@devkitpro.org>:
- * gdbtk-cmds.c: Guard <sys/ioctl.h> with HAVE_SYS_IOCTL_H.
- * gdbtk-hooks.c: Ditto.
- * gdbtk.c: Ditto.
- * gdbtk-interp.c: Include windows.h under mingw32.
- (gdbtk_start_timer, gdbtk_stop_timer): Remove timer calls under mingw.
- (gdbtk_init): Include windows-specific commands under mingw without
- cygwin path commands.
- * library/download.itb (Download::download_it): Only use ide_cygwin_path
- on cygwin hosts.
- * library/interface.tcl (_open_file): Ditto.
- * library/prefs.tcl (pref_read): Ditto.
- * library/targetselection.itb (TargetSelection::default_port): Default
- to "/dev/com1" under cygwin and "COM1" under mingw.
- (TargetSelection::port_list): Use "/dev/com" under cygwin and
- "COM" under mingw.
-
-2008-02-08 Keith Seitz <keiths@redhat.com>
-
- * library/main.tcl: Add gdbtk_platform definitions.
- * library/attachdlg.itb (list_pids): Use gdbtk_platform
- instead of tcl_platform.
- * library/bpwin.itb (build_win): Likewise.
- (_bp_add): Likewise.
- (_bp_modify): Likewise.
- * library/download.itb (download_it): Likewise.
- * library/globalpref.itb (_build_win): Likewise.
- * library/helpviewer.tcl (open_help): Likewise.
- * library/interface.tcl (gdbtk_tcl_query): Likewise.
- (show_warning): Likewise.
- (open_file): Likewise.
- (run_executable): Likewise.
- * library/managedwin.itb (reveal): Likewise.
- (_create): Likewise.
- * library/prefs.tcl (pref_read): Likewise.
- (pref_set_defaults): Likewise.
- (pref_set_colors): Likewise.
- * library/session.tcl (_exe_name): Likewise.
- * library/srcbar.itcl (_update_file_menu): Likewise.
- (create_run_menu): Likewise.
- * library/srctextwin.itb (_mtime_changed): Likewise.
- (LoadFromCache): Likewise.
- * library/targetselection.itb (default_port): Likewise.
- (build_win): Likewise.
-
- * library/memwin.itb (build_win): Remove unused tcl_platform
- declaration.
- * library/pluginwin.itcl (enable_ui): Likewise.
- * library/process.itb (build_win): Likewise.
- * library/srcbar.itcl (enable_ui): Likewise.
- * library/srcwin.itb (location): Likewise.
- * library/stackwin.itb (build_win): Likewise.
- * library/tdump.tcl (build_win): Likewise.
-
-2008-02-05 Maciej W. Rozycki <macro@mips.com>
-
- * generic/gdbtk-varobj.c (variable_children): Adjust
- for varobj_list_children change.
-
diff --git a/gdb/gdbtk/ChangeLog-2001 b/gdb/gdbtk/ChangeLog-2001
deleted file mode 100644
index b543b911d71..00000000000
--- a/gdb/gdbtk/ChangeLog-2001
+++ /dev/null
@@ -1,1719 +0,0 @@
-2001-12-21 Tom Tromey <tromey@redhat.com>
-
- * generic/gdbtk-cmds.h (full_lookup_symtab): Don't declare.
- * generic/gdbtk-cmds.c (gdb_find_file_command): Use
- lookup_symtab.
- (gdb_listfuncs): Likewise.
- (gdb_loadfile): Likewise.
- (full_lookup_symtab): Removed.
- * generic/gdbtk-bp.c (gdb_find_bp_at_line): Use lookup_symtab.
- (gdb_set_bp): Likewise.
-
-2001-12-21 Keith Seitz <keiths@redhat.com>
-
- * library/bpwin.ith (_select_and_popup): New private method.
- * library/bpwin.itb (bp_select): Don't bind to Button-3.
- (build_win): Bind Button-3 to _select_and_popup.
- (_select_and_popup): New private method.
-
-2001-12-18 Keith Seitz <keiths@redhat.com>
-
- * library/memwin.itb (incr_addr): Fix typo.
-
-2001-12-16 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-cmds.c (hex2bin): Replace LITTLE_ENDIAN with
- BFD_ENDIAN_LITTLE.
-
-2001-12-10 Ian Roxborough <irox@redhat.com>
-
- * library/interface.tcl (set_target_name): Call "pref getd"
- instead of "pref get" to avoid undefined preference error
- message for default-hostname.
-
-2001-12-07 Keith Seitz <keiths@redhat.com>
-
- * library/managedwin.itb (shutdown): Don't save geometry for
- plugins, either.
-
-2001-12-05 Keith Seitz <keiths@redhat.com>
-
- * library/console.itb (busy): Set the cursor to the watch.
- (idle): Reset cursor to normal.
-
-2001-11-30 Martin M. Hunt <hunt@redhat.com>
-
- * library/interface.tcl (gdbtk_eval): Remove
- undocumented debug function.
-
-2001-11-21 Tom Tromey <tromey@redhat.com>
-
- * library/interface.tcl (gdbtk_tcl_preloop): Override session's
- command-line arguments if required.
-
-2001-11-20 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk.c (gdbtk_init): If DISPLAY is not set on Unix,
- clear the init_ui_hook so that gdb will properly initialize
- the cli.
-
-2001-11-08 Martin M. Hunt <hunt@redhat.com>
- * generic/gdbtk-cmds.c (gdb_eval): Add an optional
- format argument.
- (hex2bin): Swap bytes around if target is little endian.
- Fix loop count.
- (gdb_incr_addr): New function to do address arithmetic.
- Needed because some addresses are 64-bits and tcl can't
- deal with them, except as strings.
-
- * library/memwin.itb (MemWin::build_win): Add a label
- to indicate the target endianess.
- (MemWin::edit): Use gdb_incr_addr.
- (MemWin::busy): The constructor calls gdbtk_busy which
- calls this before the window has finished drawing, so
- don't disable items that don't exist yet.
- (MemWin::update_address): Set a flag, bad_expr, if the
- expression does not evaluate. Call gdb_eval with 'x' flag
- to force the result to be hex.
- (MemWin::BadExpr): Set bad_expr.
- (MemWin::incr_addr): Use gdb_incr_addr.
- (MemWin::update_addr): Return is bad_expr is set. Use
- gdb_incr_addr.
- (MemWin::goto): Call update_address.
- * library/memwin.itb: Declare private variable bad_expr.
-
- * library/util.tcl (gdbtk_endian): New procedure. Returns
- BIG or LITTLE to indicate target endianess.
-
-2001-11-08 Martin M. Hunt <hunt@redhat.com>
- * library/managedwin.itb (ManagedWin::shutdown): Fix
- typo in class name DebugWinDOpts.
-
- * library/debugwin.itb: Add MemWin to _classes.
-
-2001-11-05 Martin M. Hunt <hunt@redhat.com>
- * generic/gdbtk-cmds.h (gdbtk_set_result): Declare.
- A printf-like function to return error messages.
- * generic/gdbtk-cmds.c (gdbtk_set_result): New
- function.
- (gdb_cmd): Use gdbtk_set_result.
- (gdb_immediate_command): Ditto.
- (gdb_load_info): Ditto.
- (gdb_find_file_command): Ditto.
- (gdb_listfuncs): Ditto.
- (gdb_load_disassembly): Ditto.
- (gdb_loc): Ditto.
- (gdb_set_mem): Ditto.
- (gdb_get_mem): Ditto.
- (gdb_loadfile): Ditto.
- * generic/gdbtk-varobj.c (variable_format): Ditto.
- (variable_value): Ditto.
- * generic/gdbtk-stack.c (gdb_get_vars_command): Ditto.
- * generic/gdbtk-bp.c (gdb_get_breakpoint_info): Ditto.
- (gdb_set_bp): Ditto.
- (gdb_set_bp_addr): Ditto.
- (gdb_get_tracepoint_info): Ditto.
-
-2001-11-05 Martin M. Hunt <hunt@redhat.com>
-
- * library/stackwin.itb (StcakWin::reconfig): Destroy sbox
- if it exists.
-
- * library/process.itb (ProcessWin::reconfig): Destroy sbox
- if it exists. This fixes reconfig failures on Windows. Also
- destroy slbox.
-
- * library/bpwin.itb (BpWin::reconfig): Destroy sbox if
- it exists.This fixes reconfig failures on Windows. Also
- destroy sf
-
- * library/tdump.tcl (TdumpWin::reconfig): Delete sbox
- and stext then rebuild window.
-
-2001-11-05 Martin M. Hunt <hunt@redhat.com>
-
- * library/debugwin.itb (DebugWin::build_win):
- Initialize gdbtk_de(ERRORS_ONLY) and gdbtk_de(filter_var)
- (DebugWin::puts): Rewrite filter to handle new options.
- (DebugWinDOpts::build_win): Update list of classes. Change
- filter dialog so we can not display only errors and warnings
- or choose between displaying ALL classes except those selected
- or only selected classes. Fix "OK" button to apply
- changes before closing dialog.
- DebugWinOpts::_apply): Now takes an agrument that
- indicates if dialog should exit after applying filter.
-
- * library/debugwin.ith (_apply): Now takes an arg.
-
- * library/main.tcl: If GDBTK_DEBUGFILE is not set,
- use "insight.log" as the default. If GDBTK_DEBUG is set
- and nonzero, start logging debug messages to
- GDBTK_DEBUGFILE immediately. Never open the debug window
- automatically.
-
- * library/managedwin.itb (ManagedWin::shutdown): Don't
- save debug window options dialog on active list
-
- * library/srcwin.itb: Remove troublesome debug line.
-
-2001-11-05 Martin M. Hunt <hunt@redhat.com>
- * library/globalpref.itb (GlobalPref::_init_var):
- New method to initialize _saved and _new arrays.
- (GlobalPref::constructor): Call _init_var.
- (GlobalPref::_buildwin): Use _new array for prefs
- variables. Font optimizations. Remove troublesome
- fonts and sort the list.
- (GlobalPref::toggle_tracing_mode): Removed. Some
- functionality moved to _apply and _cancel.
- (GlobalPref::_apply): Set prefs with values from the
- _new array.
- (SrcPref::_cancel): Reset prefs with values from _saved.
- * library/globalpref.ith: Changed private variables
- and methods to start with underscore.
- (tracing_cb): Removed.
- (_init): Changed from proc to method.
-
-2001-11-01 Keith Seitz <keiths@redhat.com>
-
- * library/memwin.itb (update_addr): Evaluate the address
- to be sent to gdb_get_mem to prevent passing error strings
- to string_to_coreaddr in gdb_get_mem.
-
-2001-10-29 Martin M. Hunt <hunt@redhat.com>
-
- * library/debugwin.itb: Don't increment number of
- TopLevelWins.
-
- * library/managedwin.itb: Don't save DebugWins to
- active list.
-
-2001-10-29 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-bp.c (gdb_set_bp_addr): When setting
- the bp addr_string, use the string the function was called
- with instead of using sprintf to write a new one. This
- avoids a problem with truncating 64-bit addresses.
-
- * library/srcbar.itcl (SrcBar::create_buttons) Don't
- set width of address label.
- (SrcBar::address) When the address changes, recompute
- width of address label. If it is more than 10, force it
- to 18, otherwise use 10.
-
-2001-10-29 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-bp.c (gdb_find_bp_at_addr): Use
- string_to_core_addr to read address so 64 bits will work.
- (gdb_set_bp): Set error message with Tcl_SetObjResult()
- so it will be displayed.
- (gdb_set_bp_addr):Use string_to_core_addr to read address.
- Set error message with Tcl_SetObjResult().
-
- * generic/gdbtk-cmds.c (gdb_get_mem): :Use string_to_core_addr
- to read address. Set error message with Tcl_SetObjResult() or
- Tcl_WrongNumArgs.
-
-2001-10-27 Tom Tromey <tromey@redhat.com>
-
- * tclIndex: Updated.
- * library/main.tcl: Add session_notice_file_change to
- file_changed_hook.
- * library/session.tcl (session_load): Only load the executable.
- (session_notice_file_change): New proc.
- (SESSION_exe_name): New proc.
- (session_save): Use it.
- (session_notice_file_change): Likewise.
- * library/interface.tcl (gdbtk_tcl_exec_file_display): Don't call
- session_save.
- (gdbtk_tcl_preloop): Don't set executable name or try to find
- main. Notice a new session if required.
-
-2001-10-18 Martin M. Hunt <hunt@redhat.com>
-
- * library/srcpref.itb (SrcPref::contructor): Move array
- initialization to _init_var.
- (SrcPref::_init_var): New method to initialize _saved and
- _new arrays.
- (SrcPref::buildwin): Rename to _buildwin. Have widgets use
- _new instead of [pref varname ...]. Set initial value of
- tab size spinint.
- (SrcPref::_apply): Set prefs with values from the _new array.
- (SrcPref::_cancel): Reset disassembly flavor and don't call
- _save because nothing is saved unless OK is selected.
- (SrcPref::set_flavor): Rename to _set_flavor.
- (SrcPref::_pick): Just set _new, not prefs.
-
- * library/srcpref.ith: Add private variable _new and
- private method cancel. Rename others with leading underscore.
-
-2001-10-16 Andrew Cagney <ac131313@redhat.com>
-
- From 2001-08-29 John Moore <jmoore@redhat.com>:
- * gdbtk/generic/gdbtk-cmds.c (gdb_disassemble): Replaced
- parse_and_eval_address() with string_to_core_addr().
- (gdb_load_disassembly): Same.
- (gdb_set_mem): Ditto.
- * gdbtk/generic/gdbtk-stack.c (gdb_block_vars): Ditto.
- * gdbtk/generic/gdbtk-varobj.c (variable_create): Same.
-
-2001-10-17 Tom Tromey <tromey@cygnus.com>
-
- * console.itb (Console::_build_win): Handle bindings which
- are ";". Also, completely override underlying Text binding.
-
-2001-10-12 Tom Tromey <tromey@redhat.com>
-
- * library/console.itb (Console::_build_win): Bind Control-m and
- Control-j.
-
-2001-10-12 Daniel Jacobowitz <drow@mvista.com>
-
- * generic/gdbtk-cmds.c (gdb_listfuncs): Use ALL_BLOCK_SYMBOLS.
- * generic/gdbtk-stack.c (gdb_block_vars): Likewise.
- (gdb_get_blocks): Likewise.
- (gdb_get_vars_command): Likewise.
-
-2001-10-10 Ian Roxborough <irox@redhat.com>
-
- * library/gdbtoolbar.itcl (GDBToolBar::add): Add option
- for "custom" type.
- (GDBToolBar::toolbar_add_custom): new method.
-
-2001-10-06 Tom Tromey <tromey@redhat.com>
-
- * library/session.tcl (SESSION_recreate_bps): Use
- gdb_run_readline_command_no_output to recreate breakpoints.
- * library/interface.tcl (gdb_run_readline_command): Set
- readlineShowUser element of gdbtk_state.
- (gdb_run_readline_command_no_output): New proc.
- (initialize_gdbtk): Initialize readlineShowUser element.
- (gdbtk_tcl_readline_begin): Use readlineShowUser element.
- (gdbtk_tcl_readline): Likewise.
-
-2001-10-05 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-bp.c (get_breakpoint_commands): New function.
- (gdb_get_breakpoint_info): Use gdb_breakpoint_commands to
- assemble breakpoint commands information.
-
-2001-10-02 Tom Tromey <tromey@redhat.com>
-
- * library/tclIndex: Updated.
- * library/prefs.tcl (pref_set_defaults): Define gdb/editor
- preference.
- * library/srcpref.itb (SrcPref::constructor): Save gdb/editor
- preference.
- (SrcPref::build_win): Added external editor control.
- * library/srctextwin.itb (SrcTextWin::do_source_popup): Always
- enable external editor. Use `code' instead of `list'.
- * library/srcwin.itb (SrcWin::edit): Use Editor::edit.
- * library/editor.tcl: New file.
- * generic/gdbtk.c (enable_external_editor): Removed.
- (external_editor_command): Default to NULL.
- (gdbtk_init): Don't set enable_external_editor. Free external
- editor command when finished with it.
-
-2001-09-28 Tom Tromey <tromey@redhat.com>
-
- * library/console.itb (Console::_operate_and_get_next): New method.
- (Console::_setprompt): Insert next history element if requested.
- (Console::_build_win): Bind C-o to _operate_and_get_next.
- * library/console.ith (_operate_and_get_next): Declare.
- (_pendingHistElement): New variable.
-
-2001-09-27 Elena Zannoni <ezannoni@redhat.com>
-
- * library/targetselection.itb (build_win, default_port): Handle
- hpux 11.00.
-
-2001-09-27 Keith Seitz <keiths@redhat.com>
-
- * library/prefs.tcl (escape_value): Update to work
- with Tcl's new and old syntax.
-
-2001-09-19 Keith Seitz <keiths@redhat.com>
-
- * library/main.tcl: Append iwidgets library path, if needed.
- * generic/gdbtk.c (gdbtk_init): Add TCLLIBPATH to iwidgets
- package index.
- Define IWIDGETS_LIBRARY in interpreter so that we can add
- this path to the auto_path at the right time later.
-
-2001-09-10 Ian Roxborough <irox@redhat.com>
-
- * generic/gdbtk.c (gdbtk_init): Set IWIDGETS_LIBRARY if
- Insight is launched from within the build directory.
- * library/util.tcl (find_iwidgets_library): Removed.
- * library/main.tcl: Don't call find_iwidgets_library, do a
- package require instead.
-
-2001-08-28 Keith Seitz <keiths@redhat.com>
-
- * library/bpwin.itb (bp_select): Use standard preferences
- for selection fg & bg, not tixOption database.
-
- * process.itb, tracedlg.tcl: Remove all traces of those
- three evil little letters, "t", "i", "x".
-
-2001-08-28 Keith Seitz <keiths@redhat.com>
-
- * library/tracedlg.tcl (build_win): Use libgui's
- Labelledframe instead of tixLabelFrame.
- Use iwidgets::scrolledlistbox instead of tixScrolledListbox.
- (edit): Check if there is a selection in the listbox
- before proceeding.
- Escape method callbacks before passing to ActionDlg.
-
- * library/actiondlg.tcl (constructor): Use "gdb_reginfo"
-
-2001-08-28 Keith Seitz <keiths@redhat.com>
-
- * library/tdump.tcl (class TdumpWin): Inherit from GDBWin
- and ManagedWin.
- (constructor): Remove old itcl2 handling code and name the
- window.
- (build_win): Use iwidgets::scrolledtext instead of
- tixScrolledText.
- (twin): Remove unused variable. Use itk_component(stext)
- instead.
- (maxwidth): Remove unused variable.
- (destructor): Remove unused method.
- (config): Ditto.
-
-2001-08-28 Keith Seitz <keiths@redhat.com>
-
- * library/srcpref.itb (build_win): Use iwidgets::spinint
- instead of tixControl.
-
-2001-08-28 Keith Seitz <keiths@redhat.com>
-
- * library/process.ith (top): Remove unused protected variable.
- Use GDBWin::_top instead.
- (lb): Remove unused variable.
- (change_context): Remove parameter. It's not needed.
- * library/process.itb (constructor): Don't set the variable
- "top". It isn't needed. GDBWin has this information.
- (buildwin): Get rid of tixScrolledListbox. Use
- iwidgets::scrolledlistbox instead.
- Loose the balloon help. It annoys more than helps.
- (update): Use new scrolledlistbox component.
- Split the list of threads BEFORE doing llength. Someone
- shoot me if this has to be fixed one more time...
- (change_context): Update definition and usage.
- (cursor): Use GDBWin::_top instead of our own private copy.
-
-2001-08-28 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_disassemble_driver): We should be
- looking for "thread", not "threads" to determine if we have
- a multi-threaded child process.
-
-2001-08-28 Keith Seitz <keiths@redhat.com>
-
- * library/bpwin.itb (build_win): Get rid of tixScrolledWindow
- and use iwidgets::scrolledframe until something better comes
- along.
-
-2001-08-23 Tom Tromey <tromey@redhat.com>
-
- * library/srcwin.itb (SrcWin::fillFuncCB): Sort function names.
-
-2001-08-23 Martin M. Hunt <hunt@redhat.com>
-
- * library/targetselection.itb: Added PMON and DDB targets.
-
-2001-08-22 Tom Tromey <tromey@redhat.com>
-
- * library/prefs.tcl (pref_read): Version number appears in
- comment.
-
-2001-08-21 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk.c (gdbtk_init): Gdb just fixed this. No
- need for the workaround I just checked in anymore.
-
-2001-08-21 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk.c (gdbtk_init): Reinitialize disassemle info's
- stream parameter: we just deleted the one it saved when we
- re-routed gdb_stdout to our own gdb_stdout.
-
-2001-08-20 Keith Seitz <keiths@redhat.com>
-
- * library/stackwin.itb (build_win): Use iwidget's scrolled listbox
- instead of tix scrolled list box.
- (update): Update to use iwidget's scrolled list box.
- (change_frame): Ditto.
- Remove parameters.
- * library/stackwin.ith (change_frame): Remove all parameters.
-
-2001-08-20 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_load_disassembly): Save the original
- address from parse_and_eval_address: if find_pc_partial_function
- errors, we will lose our original address.
- If find_pc_partial_function does error, print out both
- the address we thought we were disassembling at AND the address
- we actually did disassemble at. This should help elide address-
- to-pointer and pointer-to-address problems.
- * library/srctextwin.itb (FillAssembly): When gdb_load_disassembly
- fails, use its error message instead of the cooked "Unable to
- Read insturctions..." message.
- (UnLoadFromCache): If oldpane is empty, don't try show it,
- don't try to set our view to it, don't do anything but
- erase the given pane.
-
-2001-08-17 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-varobj.c (variable_obj_command): Pass pointer
- to varobj* when calling variable_update (API changed).
- (variable_create): Don't pass varobj* to install_variable. It's
- not used.
- (variable_children): Likewise.
- (variable_update): Change parameters to accept pointer to
- varobj*. Matches API change in varobj_update.
- (install_variable): Remove unused "var" parameter.
-
-2001-08-16 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk.c (gdbtk_init): Revert change from earlier.
- It is insufficient. We must get the absolute pathname
- from autoconf.
- Don't bother setting TCL_LIBRARY: it must be set already
- in order for us to execute a script.
-
-2001-08-16 Keith Seitz <keiths@redhat.com>
-
- * library/globalpref.ith (_change_font, _change_size): New
- private methods.
- (_size): New private variable.
- (font_changed, wfont_changed): Removed.
- * library/globalpref.itb (make_font_item): Change combobox
- callback to use _change_font.
- Replace tixControl with iwidgets::spinint.
- (font_changed, wfont_changed): Removed.
- (_change_font, _change_size): New private methods.
- * tclIndex: Regenerate.
-
-2001-08-16 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk.c (gdbtk_init): Make sure we're working with
- absolute pathnames in the *_LIBRAY variables.
-
-2001-08-16 Keith Seitz <keiths@redhat.com>
-
- From Ian Roxborough <irox@redhat.com>
- * generic/gdbtk-hooks.c (x_event): Deal with Tcl API insanity
- for Tcl_ObjGetVar2 or Tcl_GetObjVar2.
- (gdbtk_trace_find): Likewise for Tcl_GlobalEvalObj
- or Tcl_EvalObj (TCL_EVAL_GLOBAL).
-
-2001-08-15 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk.c (gdbtk_init): Don't assume a particular
- layout for the source directory, let the Makefile tell us
- where the real source directory is.
- When compiling under Cygwin, convert the (posix) path to a
- win32 path, which is what tcl really wants.
-
-2001-08-15 Ian Roxborough <irox@redhat.com>
-
- * generic/gdbtk.c (gdbtk_init): If Insight isn't
- executed from inside a directory called "bin",
- assume that we are being running from the build
- directory and set the *_LIBRARY variables to point
- to (hopefully) the correct source directory.
-
-2001-08-13 Keith Seitz <keiths@redhat.com>
-
- * library/regwin.ith: Rewrite.
- * library/regwin.itb: Rewrite.
- * library/tclIndex: Regenerate.
-
-2001-08-13 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-register.c (gdb_register_info): New function.
- Consolidates all register handling.
- (get_register_size): New function.
- (gdb_changed_register_list, gdb_fetch_registers,
- gdb_regnames): Deprecate.
- (setup_architecture_data): Free old register cache
- when necessary.
-
-2001-08-13 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-hooks.c (gdbtk_add_hooks): Register
- architecture_changed event handler.
- (gdbtk_architecture_changed): New function.
- * library/gdbevent.ith (class ArchChangdEvent): New event.
- * library/ehandler.ith (arch_changed): New method. Handler
- for ArchChangedEvents.
- * library/interface.tcl (gdbtk_tcl_architecture_changed): New
- proc to handle architecture change events.
-
-2001-08-09 Keith Seitz <keiths@redhat.com>
-
- * library/prefs.tcl (pref_set_defaults): Add new font
- color defaults for highlighting, headers, selecting, and "normal".
- Get rid of gdb/variable/highlight_fg and gdb/reg/highlight_fg.
- * library/variables.tcl (build_win): Use gdb/font/highlight_fg
- and gdb/font/highilght_bg to set highlight style.
- * library/memwin.itb (build_win): Use header_fg and header_bg.
-
-2001-08-03 Keith Seitz <keiths@redhat.com>
-
- * library/srcbar.itcl (_post): New method.
- (_update_file_menu): New method.
- (create_file_menu): Move the guts to _update_file_menu.
- Add a post command to the menu.
- * library/interface.tcl (gdbtk_tcl_file_changed): Catch the
- call to run_hooks.
- (gdbtk_tcl_exec_file_display): Save the new session, too.
- (set_exe_name): Don't bother saving the session here.
- (_close_file): Save the session here, too.
- (gdbtk_clear_file): Catch the call to run_hooks, too.
- * library/gdbmenubar.itcl (menubar_new_menu): Allow caller
- to specify optional arguments to be passed to Tk when
- creating the menu.
- Tk's "menu add" command returns an empty string. Save the
- menu's index in the parent instead. This is what all
- the menu subcommands want.
-
-2001-08-02 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-bp.c (gdb_get_breakpoint_info): Update
- with recent breakpoint structure changes in gdb.
- (gdb_set_bp_addr): Likewise.
- (gdb_get_tracepoint_info): Update with recent tracepoint
- structure changes in gdb.
-
-2001-07-31 Elena Zannoni <ezannoni@redhat.com>
-
- * generic/gdbtk-cmds.c: Don't include regcache.h.
- * generic/gdbtk-register.c: Include regcache.h.
-
-2001-07-26 Jonathan Larmour <jlarmour@redhat.com>
-
- * library/prefs.tcl (pref_set_defaults): Add additional entry
- points for eCos if main is not present.
-
-2001-07-21 Martin M. Hunt <hunt@redhat.com>
-
- * library/interface.tcl (gdbtk_locate_main): Fix function
- so that it returns either a null string or a valid location,
- as documented.
-
- * library/variables.tcl (build_menu_helper): Set
- the Format menu option to "disabled" initially.
-
-2001-07-20 Martin M. Hunt <hunt@redhat.com>
-
- * library/managedwin.itb: Revert to global to properly
- initialize geometry with some window managers.
- * library/managedwin.ith (shutdown): Remove _geometry.
-
- * library/memwin.itb: Fix syntax to open a new window
- using the "-force" flag.
-
- * generic/gdbtk-register.c (gdb_regnames): Fix 'if'
- statement so count is decremented only if "-numbers"
- is the first arg.
-
-2001-07-18 Martin M. Hunt <hunt@redhat.com>
-
- * library/util.tcl (find_iwidgets_library): Look
- for iwidgets3* so we don't accidently find iwidgets2.x.
-
-2001-07-16 Nick Duffek <nsd@redhat.com>
-
- * library/regwin.itb (RegWin::build_win): Add radio button
- for unsigned register format.
- (RegWin::reg_select): Iterate through 8 rather than 7 formats.
- (RegWin::but3): Add menu option for unsigned register format.
-
-2001-07-13 Keith Seitz <keiths@redhat.com>
-
- * library/download.itb (constructor): Use the iwidgets
- feedback widget instead of tixMeter.
- Pack all the topmost widgets together -- don't use grid.
- (update_download): Support the feedback widget.
- (done): Ditto.
-
- * library/download.ith (steps): New private variable.
- (num_steps): New common.
-
-2001-07-12 Keith Seitz <keiths@redhat.com>
-
- * library/srcbar.itcl (create_trace_buttons): Fix
- syntax errors.
-
- * library/tracedlg.tcl: Update to work with Itcl3.0
- and ManagedWin.
-
- * library/actiondlg.tcl: Update to work with Itcl3.0
- and ManagedWin.
- (build_win): Use iwidgets scrolled listbox instead
- of the tix one.
-
-2001-07-05 Keith Seitz <keiths@redhat.com>
-
- * library/managedwin.itb (_create): Don't pass "-over"
- to center_window unless we really are asked to put the
- window over another!
-
-2001-06-18 Keith Seitz <keiths@redhat.com>
-
- * library/managedwin.itb (_create): When creating a
- window over another, be sure to center on the window,
- not the object.
-
-2001-06-13 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-bp.c (gdbtk_tracepoint_create): Change
- parameter to int to match breakpoint notifications.
- (gdbtk_tracepoint_modify): Ditto.
- (gdbtk_tracepoint_delete): Ditto.
- (tracepoint_notify): Ditto.
- * generic/gdbtk-hooks.c (gdbtk_add_hooks): Remove
- tracepoint hooks and install tracepoint event handlers.
-
-2001-06-11 Tom Tromey <tromey@redhat.com>
-
- * library/help/session.html: New file.
- * library/help/index.html: Added link.
-
- * library/session.tcl (session_save): Save breakpoints.
- (SESSION_serialize_bps): New proc.
- (SESSION_recreate_bps): New proc.
- (session_load): Recreate breakpoints.
- * library/util.tcl (bp_exists): Expect user specification in
- breakpoint info.
- * library/srctextwin.itb (SrcTextWin::showBPBalloon): Expect user
- specification in breakpoint info.
- * library/gdbevent.itb (BreakpointEvent::_init): Initialize
- _user_specification.
- (BreakpointEvent::get): Handle user_specification.
- * library/gdbevent.ith (BreakpointEvent): Added
- _user_specification field.
- * library/bpwin.itb (BpWin::bp_store): Expect user specification
- and use it when saving.
- (BpWin::bp_type): Expect user specification.
- * generic/gdbtk-bp.c (BREAKPOINT_IS_WATCHPOINT): New macro.
- (gdb_get_breakpoint_info): Added `user specification' to result.
-
-2001-06-11 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-stack.c (gdb_stack): Return TCL_ERROR if
- we are unable to get the current frame. get_current_frame
- may have output an error message.
-
-2001-06-07 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-hooks.c (x_event): Remove unused variable "count".
- (tracepoint_notify): Remove superfluous declaration. This funtion
- was moved to gdbtk-bp.c.
-
- * generic/gdbtk-bp.c (gdb_find_bp_at_addr): Remove unused variable
- "b".
- (gdb_set_bp): Remove unused variable "cmd".
- (gdb_set_bp_addr): Remove unused variables "cmd" and "filename".
-
- * generic/gdbtk.c (gdbtk_init): Remove unused variables
- "auto_path_name", "auto_path_elem", and "found_main".
-
-2001-06-05 Martin Hunt <hunt@redhat.com>
-
- * generic/gdbtk.c (_initialize_gdbtk): Don't close console yet.
- (gdbtk_init): Wait until after tcl/tk stuff is all initialized
- to close console (on Windows) and redirect ouput.
-
-2001-06-05 Martin Hunt <hunt@redhat.com>
-
- * library/globalpref.itb(build_win): Don't change directory
- before building icon combobox. Add debug lines.
-
-2001-06-04 Keith Seitz <keiths@redhat.com>
-
- * library/srcbar.itcl (constructor): Set the toolbar's initial
- state.
-
-2001-06-04 Keith Seitz <keiths@redhat.com>
-
- * library/interface.tcl (gdb_update_hook): Mark as deprecated.
- (gdbtk_update): Dispatch and UpdateEvent, too.
- * library/ehandler.ith (update): New event handler.
- * library/gdbevent.ith (UpdateEvent): New event.
- * library/gdbevent.itb (UpdateEvent::constructor): New method.
- (UpdateEvent::get): New method.
- * library/kod.ith (udpate): Match event handler definition.
- * library/kod.itb (update): Ditto.
- (build_win): Pass dummy argument to update method.
- (top): Ditto.
- (up): Ditto.
- (set_variable): Ditto.
- * library/memwin.ith (update): Match event handler definition.
- * library/memwin.itb (update): Ditto.
- (constructor): Remove gdb_update_hook.
- (destructor): Ditto.
- * library/process.ith (update): Match event handler definition.
- * library/process.itb (update): Ditto.
- (constructor): Remove gdb_update_hook.
- (destructor): Ditto.
- (build_win): Pass dummy argument to update method.
- * library/regwin.ith (update): Match event handler definition.
- * library/regwin.itb (update): Ditto.
- (constructor): Remove gdb_update_hook.
- (destructor): Ditto.
- (build_win): Pass dummy argument to update method.
- (but3): Ditto.
- (unedit): Ditto.
- * library/stackwin.ith (update): Match event handler definition.
- * library/stackwin.itb (update): Ditto.
- (constructor): Remove gdb_update_hook.
- (destructor): Ditto.
- (build_win): Pass dummy argument to update method.
- * library/tdump.tcl (update): Match event handler definition.
- (constructor): Remove gdb_update_hook.
- (destructor): Ditto.
- (build_win): Pass dummy argument to update method.
- * library/variables.tcl (update): Match event handler definition.
- (build_win): Pass dummy argument to update method.
- * library/locals.tcl (update): Match event handler definition.
- (constructor): Pass dummy argument to update method.
- * library/watch.tcl (update): Match event handler definition.
- Pass dummy argument to VariableWin::update.
- (add): Pass dummy argument to update method.
- * library/srcwin.ith (update): New method.
- (update_hook_init): Remove.
- * library/srcwin.itb (update): New method.
- (constructor): Remove gdb_update_hook.
- (destructor): Ditto.
- * tclIndex: Regenerate.
-
-2001-06-01 Keith Seitz <keiths@redhat.com>
-
- * library/console.itb (constructor): Pass dummy argument
- to idle method.
- (destructor): Ditto.
-
-2001-05-31 Keith Seitz <keiths@redhat.com>
-
- * library/interface.tcl (gdbtk_idle): Run hooks, too,
- until they're all gone.
-
-2001-05-31 Keith Seitz <keiths@redhat.com>
-
- * library/interface.tcl (gdb_idle_hook): Mark as deprecated.
- (gdbtk_idle): Dispatch an IdleEvent. gdb_idle_hook is gone.
- * library/ehandler.ith (idle): New event handler.
- * library/gdbevent.ith (IdleEvent): New event.
- * library/console.ith (idle): Match event handler definition.
- * library/console.itb (idle): Ditto.
- (constructor): Remove gdb_idle_hook.
- (destructor): Ditto.
- * library/kod.ith (idle): Match event handler definition.
- * library/kod.itb (idle): Ditto.
- (constructor): Remove gdb_idle_hook.
- (destructor): Ditto.
- * library/memwin.ith (idle): Match event handler definition.
- * library/memwin.itb (idle): Ditto.
- (constructor): Remove gdb_idle_hook.
- (destructor): Ditto.
- * library/pluginwin.itcl (stopped): Rename to "idle" and
- match event handler definition.
- Fix misleading comments.
- * library/process.ith (idle): Match event handler definition.
- * library/process.itb (idle): Ditto.
- (constructor): Remove gdb_idle_hook.
- (destructor): Ditto.
- * library/regwin.ith (idle): Match event handler definition.
- * library/regwin.itb (idle): Ditto.
- (constructor): Remove gdb_idle_hook.
- (destructor): Ditto.
- * library/srcbar.itcl (idle): New method.
- (constructor): Remove gdb_idle_hook.
- (destructor): Ditto.
- * library/srcwin.ith (idle): Match event handler definition.
- * library/srcwin.itb (idle): Ditto.
- (constructor): Remove gdb_idle_hook.
- (destructor): Ditto.
- * library/stackwin.ith (idle): Match event handler definition.
- * library/stackwin.itb (idle): Ditto.
- (constructor): Remove gdb_idle_hook.
- (destructor): Ditto.
- * library/variables.tcl (idle): Match event handler definition.
- (constructor): Remove gdb_idle_hook.
- (destructor): Ditto.
- * library/plugins/rhabout/rhabout.itcl (stopped): Rename
- to "idle" and match new event handler definition.
- * library/tclIndex: Regenerated.
-
-2001-05-31 Keith Seitz <keiths@redhat.com>
-
- * library/interface.tcl (gdb_busy_hook): Deprecate.
- (gdbtk_busy): Create and dispatch a BusyEvent instead
- of running hooks.
- * library/ehandler.ith (busy): New event handler.
- * library/gdbevent.ith (BusyEvent): New event class.
- * library/console.ith: Inherit from GDBEventHandler.
- (busy): Match event handler definition.
- * library/console.itb (busy): Ditto.
- (constructor): Remove gdb_busy_event.
- (destructor): Ditto.
- * library/kod.ith (busy): Match event handler definition.
- * library/kod.itb (busy): Ditto.
- (constructor): Remove gdb_busy_hook.
- (destructor): Ditto.
- * library/memwin.ith (busy): Match event handler definition.
- * library/memwin.itb (busy): Ditto.
- (constructor): Remove gdb_busy_hook.
- (destructor): Ditto.
- * library/pluginwin.itcl (running): Rename to "busy" and
- match event handler definition.
- (consturctor): Remove gdb_busy_hook.
- (destructor): Ditto.
- * library/process.ith (busy): Match event handler definition.
- * library/process.itb (busy): Ditto.
- (constructor): Remove gdb_busy_hook.
- (destructor): Ditto.
- * library/regwin.ith (busy): Match event handler definition.
- * library/regwin.itb (busy): Ditto.
- (constructor): Remove gdb_busy_hook.
- (destructor): Ditto.
- * library/srcbar.itcl (constructor): Remove gdb_busy_hook.
- (destructor): Ditto.
- (busy): New method.
- * library/srcwin.ith (busy): Match event handler definition.
- * library/srcwin.itb (busy): Ditto.
- Only do the "busy" stuff if do_updates is set.
- (toggle_updates): Remove gdb_busy_hook.
- (constructor): Ditto.
- (destructor): Ditto.
- * library/stackwin.ith (busy): Match event handler definition.
- * library/stackwin.itb (busy): Ditto.
- (constructor): Remove gdb_busy_hook.
- (destructor): Ditto.
- * library/variables.tcl (constructor): Ditto.
- (destructor): Ditto.
- (disable_ui): Rename to "busy" and match event handler
- definition.
- * library/plugins/rhabout/rhabout.itcl (running): Rename
- to "busy" and match new event handler definition.
- * library/tclIndex: Regenerated.
-
-2001-05-25 Keith Seitz <keiths@cygnus.com>
-
- * generic/gdbtk-cmds.c (bin2hex): New function.
- (fromhex): New function.
- (gdb_set_mem): New function.
- (Gdbtk_Init): Add new command, "gdb_set_mem".
- * library/memwin.itb (edit): Use "gdb_set_mem" to set
- memory, not some gdb_cmd contrivance.
- When sending data to gdb_set_mem, make sure that it
- is properly zero-padded.
-
-2001-05-22 Keith Seitz <keiths@cygnus.com>
-
- * memwin.ith (error_dialog): Declare public method.
- * memwin.itb (error_dialog): Define.
- (edit): When attempting to set memory, post an error dialog
- if gdb told us an error occurred while writing the memory.
-
-2001-05-22 Keith Seitz <keiths@cygnus.com>
-
- * library/interface.tcl (gdbtk_tcl_file_changed): Handle
- the case of empty-string files, sent by gdb when the
- user requests to reset the file.
- (_close_file): New proc to deal with closing an exe.
- * library/srcbar.itcl (create_file_menu): Add "Close" menu
- option.
- (create_view_menu): Change key binding for Watch Window to
- Ctrl+T to accomodate "Close" going to Ctrl+W.
- * library/srctextwin.itb (config_win): Update key binding
- for Watch Window.
- Add key binding for Close.
- (do_key): Add "close".
- (_clear_cache): Finally implement. I think this works now.
-
-2001-05-22 Keith Seitz <keiths@cygnus.com>
-
- * library/variables.tcl (postMenu): Add mysterious workaround
- for popup menu bug in Tk for windows.
- Highlight the selection, too.
-
-2001-05-21 Keith Seitz <keiths@cygnus.com>
-
- * library/managedwin.itb (_create): Check the geometry of
- any window we create. Don't create a window that is
- bigger than the screen.
-
-2001-05-18 Keith Seitz <keiths@cygnus.com>
-
- * library/managedwin.ith (_geometry): Use a protected variable
- instead of a global from ManagedWin::reveal.
- (open): Make arg list reflect managedwin.itb.
- * library/managedwin.itb (window_name): Use class variable
- _top instead of recomputing the toplevel every time.
- (reveal): Ditto.
- Use class variable "_geometry" instead of global variable.
- (shutdown): Do not save ModalDialogs.
- (_create): If centering the new window, use libgui's
- center_window to do it.
-
-2001-05-18 Keith Seitz <keiths@cygnus.com>
-
- * generic/gdbtk-hooks.c (gdbtk_wait): Change integer pid
- argument to match gdb's new "ptid_t" pids.
-
-2001-05-14 Keith Seitz <keiths@cygnus.com>
-
- * library/interface.tcl (gdbtk_quit_check): Don't save sessions
- here. It doesn't work for the Console Window.
- (gdbtk_cleanup): Save session information here.
- (gdbtk_tcl_exec_file_display): When files are loaded,
- get the full pathname to the exe.
-
-2001-05-11 Tom Tromey <tromey@redhat.com>
-
- * library/prefs.tcl (pref_save): Fix bug when key in gdb space has
- extra `/' in it.
-
-2001-05-11 Kevin Buettner <kevinb@redhat.com>
-
- * generic/gdbtk-bp.c (set_raw_breakpoint): Revise declaration
- to match the recently changed declaration in breakpoint.c.
- Update all callers.
-
-2001-05-11 Keith Seitz <keiths@cygnus.com>
-
- * generic/gdbtk-bp.c (gdbtk_create_breakpoint): Safe guard
- against "invalid" (internal) breakpoint numbers.
- (gdbtk_modify_breakpoint): Ditto.
- (gdbtk_delete_breakpoint): Ditto.
-
-2001-05-10 Keith Seitz <keiths@cygnus.com>
-
- * generic/gdbtk-bp.c (gdb_set_bp): Generate a breakpoint event
- when we create a breakpoint. The hook is no longer used.
- (gdb_set_bp_addr): Ditto.
-
-2001-05-10 Keith Seitz <keiths@cygnus.com>
-
- * generic/gdbtk-bp.c (breakpoint_list, breakpoint_list_size): New
- variables. Gdb is forcing us to maintain our own breakpoint
- database.
- (Gdbtk_Breakpoint_Init): Initialize our breakpoint database.
- (gdb_find_bp_at_addr): Use our breakpoint database.
- (gdb_find_bp_at_line): Ditto.
- (gdb_get_breakpoint_list): Ditto.
- (gdb_get_breakpoint_info): Remove deleted breakpoint hack.
- (gdbtk_create_breakpoint): Moved here from gdbtk-hooks.c.
- Add breakpoint to our breakpoint database.
- (gdbtk_modify_breakpoint): Ditto the move.
- (gdbtk_delete_breakpoint): Ditto the move.
- Remove breakpoint from our database.
- (gdb_get_tracepoint_info): Remove delete tracepoint hack.
- It's not needed for tracepoints: they were implemented properly.
- (gdbtk_create_tracepoint): Moved here from gdbtk-hooks.c.
- (gdbtk_modify_tracepoint): Ditto.
- (gdbtk_delete_tracepoint): Ditto.
- * generic/gdbtk-hooks.c: Include "gdb-events.h".
- (gdbtk_create_breakpoint): Moved to gdbtk-bp.c
- (gdbtk_modify_breakpoint): Ditto.
- (gdbtk_delete_breakpoint): Ditto.
- (breakpoint_notify): Ditto.
- (gdbtk_create_tracepoint): Ditto.
- (gdbtk_modify_tracepoint): Ditto.
- (gdbtk_delete_tracepoint): Ditto.
- (tracepoint_notify): Ditto.
- (report_error): No longer static.
- (gdbtk_add_hooks): Create our own event handler
- vector and register breakpoint_create, breakpoint_modify,
- and breakpoint_delete handlers in gdbtk-bp.c.
-
-2001-05-10 Keith Seitz <keiths@cygnus.com>
-
- * generic/gdbtk-cmds.c: Put on diet. All breakpoint-,
- tracepoint-, register-, and stack-related functions moved
- into separate files.
- (call_wrapper): Renamed to "gdbtk_call_wrapper" and export.
- Update all callers.
- * generic/gdbtk.h: Move all breakpoint-related stuff into
- gdbtk-bp.c.
- Remove declaration for "call_wrapper". Now in gdbtk-cmds.h
- (and called "gdbtk_call_wrapper").
- * generic/gdbtk-varobj.c: Include "gdbtk-cmds.h".
- * generic/gdbtk-cmds.h: New file.
- * generic/gdbtk-bp.c: New file.
- * generic/gdbtk-register.c: New file.
- * generic/gdbtk-stack.c: New file.
-
-2001-05-09 Keith Seitz <keiths@cygnus.com>
-
- * library/interface.tcl (gdb_quit_hook): Remove. It's unused.
- (gdbtk_quit): Do no shutdown window manager and save
- preferences here.
- (gdbtk_cleanup): This is the proper place to do those
- things.
-
-2001-05-07 Keith Seitz <keiths@cygnus.com>
-
- * library/globalpref.itb (build_win): Preserve the
- current working directory.
-
-2001-05-06 Kevin Buettner <kevinb@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_target_has_execution_command)
- (get_clear_file): Use ptid_equal() for comparing ptid values.
- Use ``null_ptid'' instead of 0 in comparisons against
- ``inferior_ptid''.
-
- From Phil Edwards <pedwards@disaster.jaj.com>:
- * generic/gdbtk-cmds.c (gdb_target_has_execution_command)
- (get_clear_file): Rename ``inferior_pid'' to ``inferior_ptid''.
-
-2001-05-01 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Include the command "warp_pointer"
- for all platforms. Used for testing ONLY.
-
- * util.tcl (gdbtk_read_defs): If there is an error reading
- the testsuite definition file, print the error message to
- stderr, not stdout. This will allow tcl to know that an error
- has occurred.
- (find_iwidgets_library): Make it work for running testsuites
- from installed directory.
-
- * main.tcl: If we failed to find iwidgets, check if the
- testsuite is running. If it is running, do not pop up
- a dialog box: just print out the error and exit.
- Initialize _test(verbose) for the testsuite.
-
-2001-04-23 Keith Seitz <keiths@cygnus.com>
-
- * generic/gdbtk-cmds.c (gdb_get_breakpoint_info): If unable
- to find the requested breakpoint for lookup, check if
- it is about to be deleted and return information about
- that breakpoint.
- (gdb_get_tracepoint_info): Ditto for tracepoints.
- * generic/gdbtk-hooks.c (gdbtk_deleted_bp): New global.
- (gdbtk_delete_breakpoint): Remember the deleted breakpoint
- for gdb_get_breakpoint_info, in case it is called during
- the event notification.
- (gdbtk_delete_tracepoints): Ditto for tracepoints.
-
- * generic/gdbtk-cmds.c (gdb_entry_point): Return an empty
- string when there is no active target (i.e., there is no
- entry point to return yet).
-
-2001-04-20 Keith Seitz <keiths@cygnus.com>
-
- * library/srctextwin.ith (handle_set_hook): Rename to set_variable.
- * library/srctextwin.itb (set_variable): Handle SetVariableEvent.
- (constructor): Remove gdb_set_hook.
- (destructor): Ditto.
- * library/srcbar.itcl: Inherit from GDBEventHandler.
- (set_hook): Rename to set_variable and handle SetVariableEvent.
- (constructor): Remove gdb_set_hook.
- (destructor): Ditto.
- * library/regwin.ith (handle_set_hook): Renamed to set_variable.
- * library/regwin.itb (set_variable): Handle SetVariableEvent.
- (constructor): Remove gdb_set_hook.
- (destructor): Ditto.
- * library/kod.ith (set_os): Renamed to "set_variable".
- * library/kod.itb (set_variable): Handle SetVariableEvent.
- (constructor): Remove gdb_set_hook.
- (destructor): Ditto.
- * library/tclIndex: Regenerated.
-
-2001-04-20 Keith Seitz <keiths@cygnus.com>
-
- * library/interface.tcl (gdbtk_tcl_set_variable): New proc.
- * library/gdbevent.ith (SetVariableEvent): New event.
- * library/gdbevent.itb (SetVariableEvent::get): Override
- GDBEvent::get.
- * library/ehandler.ith (set_variable): New public method.
- * generic/gdbtk-hooks.c (gdbtk_set_hook): Let inteface function
- gdbtk_tcl_set_variable do all the work.
- * tclIndex: Regenerated.
-
-2001-04-19 Keith Seitz <keiths@cygnus.com>
-
- * library/gdbevent.ith: New file. Defines new event model.
- * library/gdbevent.itb: New file. Implements new event
- model.
- * library/ehandler.ith: New file. Defines new event model.
- * library/ehandler.itb: New file. Implements new event
- model.
- * library/gdbwin.ith: Inherit from GDBEventHandler.
- (update): Delete unused method.
- (_state): Delete unused variable.
- * library/tclIndex: Regenerated.
-
- * generic/gdbtk-cmds.c (gdb_set_bp): Use create_breakpoint_hook
- to notify gui of changes.
- (gdb_set_bp_addr): Ditto.
- (gdb_get_breakpoint_info): Update comments to match reality.
- * generic/gdbtk-hooks.c (breakpoint_notify): Only pass the
- breakpoint number which generated the event.
- (tracepoint_notify): Ditto for tracepoints.
- * library/interface.tcl (gdb_breakpoint_change_hook): Mark
- as deprecated and comment out definition.
- (gdbtk_tcl_breakpoint): Use new GDBEvent event "breakpoint"
- to notify rest of UI about breakpoint event.
- (gdbtk_tcl_tracepoint): Ditto for "tracepoint" event.
- * library/bpwin.ith (update): Renamed to "breakpoint".
- (breakpoint): New public method.
- (tracepoint): New public method.
- (bp_add): Take event as argument instead of number.
- (bp_modify): Ditto.
- (bp_delete): Ditto.
- * library/bpwin.itb (constructor): Remove
- gdb_breakpoint_changed_hook.
- (destructor): Ditto.
- (build_win): Insert any existing breakpoints by
- making BreakpointEvents for them.
- (breakpoint): Renamed from "update" to handle
- breakpoint events.
- Remove code to deal with tracepoints.
- (tracepoint): New method to handle tracepoint
- events.
- (bp_add): Deal with breakpoint events, not breakpoint
- numbers.
- (bp_modify): Ditto.
- (bp_delete): Ditto.
- * library/srctextwin.ith: Inherit from GDBWin.
- (breakpoint): New public method.
- (tracepoint): New public method.
- * library/srctextwin.itb (constructor): Remove
- gdb_breakpoint_changed_hook.
- (destructor): Ditto.
- (breakpoint): New method to handle breakpoint event.
- (tracepoint): New method to handle tracepoint event.
- (do_bp): Handle duplicate breakpoints for asm, too.
- (remove_bp_at_line): Delete breakpoints by number, not
- linespec. clear_command removes breakpoints from the
- breakpoint_chain BEFORE deleting the breakpoint. delete_command
- does this afterward (so we can call gdb_get_breakpoint_info on
- an about-to-be-deleted breakpoint).
-
-2001-04-18 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk.c (gdbtk_init): Initialize uiout.
-
-2001-04-18 Tom Tromey <tromey@redhat.com>
-
- * library/interface.tcl (run_executable): Use
- gdb_set_inferior_args.
- * library/session.tcl (session_load): Use gdb_set_inferior_args.
- * generic/gdbtk-cmds.c (Gdbtk_Init): Register
- gdb_set_inferior_args.
- (gdb_get_inferior_args): New function.
-
-2001-04-17 Tom Tromey <tromey@redhat.com>
-
- * library/session.tcl (session_save): Use gdb_get_inferior_args.
- * generic/gdbtk-cmds.c (inferior_args): Removed.
- (Gdbtk_Init): Don't register gdb_inferior_args variable. Do
- register gdb_get_inferior_args function.
- (gdb_get_inferior_args): New function.
-
-2001-04-17 Fernando Nasser <fnasser@redhat.com>
-
- * library/variables.tcl (update): Temporary fix to the detection of
- "type_changed" condition. Proper fix will require that this condition
- is properly reported by the underlying code.
-
-2001-04-12 Nicholas Duffek <nsd@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_entry_point): New TCL command.
- * library/interface.tcl (gdbtk_locate_main): Try the program's
- entry point if no main function is found.
-
-2001-04-10 Keith Seitz <keiths@cygnus.com>
-
- From Tom Tromey (tromey@redhat.com):
- * library/managedwin.itb (reveal): We actually do want to force
- the focus for Windows.
-
-2001-04-09 Martin M. Hunt <hunt@redhat.com>
-
- * library/managedwin.itb (ManagedWin::reveal): After
- deiconifying window for the first time, set its geometry
- again, if the platform is unix. This fixes a problem with kde.
- (ManagedWin::_create): Set a variable with the initial
- geometry.
-
-2001-04-04 Christopher Faylor <cgf@redhat.com>
-
- * generic/gdbtk.c: Add __CYGWIN__ conditional to WIN32 test.
-
-2001-04-04 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-hooks.c (gdbtk_fileopen): New function.
- Initialize ui_file stuff for gdbtk.
- (gdbtk_fputs): Don't print if gdbtk_disable_fputs. Send
- stdlog and stdtarg to their handler functions.
-
- * generic/gdbtk.c (Gdbtk_Init): Don't set gdb_stdlog
- and gdb_stdtarg to gdb_stdout,
- (gdbtk_init): Unset gdbtk_disable_fputs
- when ready to accept output from gdb. Remove references to
- fputs_unfiltered_hook.
-
- * generic/gdbtk.h: Declare new flag gdbtk_disable_fputs.
-
- * generic/gdbtk-cmds.c (gdb_restore_fputs): Instead of setting
- fputs_unfiltered_hook, set the new flag gdbtk_disable_fputs.
-
- * library/prefs.tcl (pref_set_defaults): Add defaults
- for log_fg and target_fg.
-
- * library/interface.tcl (gdbtk_tcl_fputs_error): Use
- err_tag.
- (gdbtk_tcl_fputs_log): New function. Write log messages
- to console.
- (gdbtk_tcl_fputs_target): New function. Write target
- IO to console.
-
- * library/console.ith (einsert): Add tag parameter.
-
- * library/console.itb (_build_win): Add new tags for log
- and target IO.
- (einsert): Add tag parameter.
-
-2001-04-02 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_loadfile): Adjust size of text_argv
- array to prevent writing out of range. Remove unused variables.
- Fix formatting.
- (gdb_get_tracepoint_info): Remove unused variable "fname".
- (gdb_load_disassembly): Remove unused variable "widget".
- (gdb_loc): Remove unused variable "sym".
- (gdb_set_bp_addr): Remove unused variable "line".
- (gdb_get_breakpoint_info): Remove unused variable "sym".
- (get_frame_name): Remove unused variable "name".
-
-2001-03-29 Fernando Nasser <fnasser@redhat.com>
-
- * library/variables.tcl (update): Cope with varobj type changes.
-
-2001-03-29 Fernando Nasser <fnasser@redhat.com>
-
- * library/variables.tcl (destructor): Remove file_changed_hook hook.
-
-2001-03-29 Fernando Nasser <fnasser@redhat.com>
-
- * generic/gdbtk-varobj.c (variable_obj_command): Do not cache varobj
- handles as they may change -- use varobj_get_handle() instead.
-
-2001-03-15 Martin Hunt <hunt@redhat.com>
- * library/browserwin.itb: Change all references to freeze_me,
- thaw_me and Top to _freeze_me, _thaw_me, and _top to match
- changes to managedwin.
-
- * library/kod.itb: Ditto.
-
-2001-03-15 Tom Tromey <tromey@redhat.com>
-
- * library/mempref.itb (MemPref::build_win): Correctly set initial
- value of combobox.
- * library/memwin.itb: Added copyright header.
- (MemWin::constructor): Set defaults from preference database.
- (MemWin::reconfig): Update preference database.
- * library/prefs.tcl (pref_save): Save `mem' preferences.
- (pref_set_defaults): Define default memory preferences.
-
-2001-03-08 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-cmds.c (map_arg_registers): Use REG_NUM instead of
- ARCH_REG_NUM.
-
-2001-03-01 Nicholas Duffek <nsd@redhat.com>
-
- * README.GDBTK: Minor spelling, grammar, and formatting fixes.
-
-2001-03-01 Keith Seitz <keiths@cygnus.com>
-
- * library/managedwin.ith: Move all implementations into
- managedwin.itb.
- (public variable nosize): Delete.
- (freeze_me, thaw_me, make_icon_window): Prepend with
- underscore to remind people these are not public
- methods/procs.
- (protected variable Top, screenwidth, screenheight): Ditto
- for these variables.
- (protected common manage_active, mainwindow): Delete.
- (enable): Delete.
- (reconfig): Add empty body.
- * library/managedwin.itb: Move all implementations from
- header here.
- Update all references to renamed variables/methods/procs.
- (destructor, restart, shutdown, _open, find) Let
- Itcl tell us which ManagedWins we have lying around.
- (enable): Delete.
- (reconfig): It's empty. Moved empty body to header.
-
-2001-03-01 Nicholas Duffek <nsd@redhat.com>
-
- * library/managedwin.itb (ManagedWin::shutdown): Save each
- managed window's geometry as a preference.
- * library/managedwin.ith (ManagedWin::destructor): Don't save
- managed windows' geometries as preferences.
-
-2001-03-01 Nicholas Duffek <nsd@redhat.com>
-
- * library/srctextwin.itb (SrcTextWin::location): Clear previous
- pane's cursor after switching panes.
-
-2001-03-01 Nicholas Duffek <nsd@redhat.com>
-
- * library/srctextwin.itb (config_win): Give focus to $win.
-
-Tue Feb 27 23:56:23 2001 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-cmds.c: Include recently created "regcache.h"
-
-2001-02-27 Keith Seitz <kseitz@nwlink.com>
-
- * generic/gdbtk-cmds.c (gdb_fetch_registers): Mark
- the result as generating a list only if it really does
- generate a list.
-
-2001-02-21 Fernando Nasser <fnasser@redhat.com>
-
- * TODO: New file. Initial version of the TODO file, as posted to the
- insight list circa October 2000.
-
-2001-02-14 Fernando Nasser <fnasser@redhat.com>
-
- From 2001-02-09 Martin Hunt <hunt@redhat.com>
- * generic/gdbtk-cmds.c (gdb_load_disassembly): In mixed
- mode, source lines should be tagged with source_tag2.
-
-2001-02-08 Fernando Nasser <fnasser@redhat.com>
-
- From 2001-02-06 Martin Hunt <hunt@redhat.com>
- * library/debugwin.itb: Change window name to "Insight Debug"
- * library/embeddedwin.ith: Fix debug messages.
- * library/locals.tcl: Ditto.
- * library/watch.tcl (postMenu): Ditto.
- * library/variables.tcl: Ditto.
- * library/interface.tcl: Ditto.
- * library/regwin.itb: Ditto.
- * library/gdbwin.ith: Ditto.
- * library/srcbar.itcl: Ditto.
-
-2001-02-06 Fernando Nasser <fnasser@redhat.com>
-
- Originally from Martin Hunt <hunt@redhat.com>, with modifications
- * library/srcwin.itb (_name): Check for errors when invoking
- gdb_find_file.
- * library/srctextwin.itb (_mtime_changed, location): Ditto.
- * generic/gdbtk-cmds.c (gdb_find_file_command): Better error checking.
- (full_lookup_symtab): Fix misleading comment.
-
-2001-02-04 Fernando Nasser <fnasser@redhat.com>
-
- * library/plugins/plugins.tcl: Fix typos and remove "-transient"
- parameter from open command.
- * library/plugins/HOW-TO: New file. Describes how to add a plug-in
- window to Insight.
-
-2001-02-01 Fernando Nasser <fnasser@redhat.com>
-
- * library/images/insight.gif: New splash screen/about graphics.
- * library/images2/insight.gif: New splash screen/about graphics.
- * library/about.tcl: Update copyright, window title and change colors
- to match new splash screen/about images.
-
-2001-02-01 Fernando Nasser <fnasser@redhat.com>
-
- * library/gdbtoolbar.itcl (add): New method. Emulate the style of the
- toolbar iwidget commands.
- (toolbar_show): Old name.
- (show): New name.
- (toolbar_create_button): Old name.
- (create): New name.
- (toolbar_configure_button): Old name.
- (itemconfigure): New name.
- (toolbar_bind_button): Old name.
- (itembind): New name.
- (toolbar_set_button_balloon): Old name.
- (itemballoon): New name.
- (toolbar_add_button): Make private.
- (toolbar_add_label): Ditto.
- (toolbar_add_button_separator): Ditto.
- (toolbar_remove_button): Ditto.
- (tollbar_insert_button): Ditto.
- * library/srcbar.itcl: Adjust to the above syntax.
- * library/plugins/rhabout/rhabout.itcl: Ditto.
-
-2001-02-01 Fernando Nasser <fnasser@redhat.com>
-
- * library/gdbmenubar.itcl (constructor): Remove unused code.
- (add): New method. Emulate the style of the menubar iwidget commands.
- (menubar_show): Old name.
- (show): New name.
- (menubar_menu_exists): Old name.
- (exists): New name.
- (menubar_clear_menu): Old name.
- (clear): New name.
- (menubar_delete_menu): Old name.
- (delete): New name.
- (menubar_new_menu): Make private. Does not return anything.
- (menubar_add_menu_command): Make private.
- (menubar_add_menu_separator): Ditto.
- (menubar_change_menu_state): Ditto.
- * library/srcbar.itcl: Adjust to the above syntax.
- * library/plugins/plugins.tcl: Ditto.
- * library/plugins/rhabout/rhabout.itcl: Ditto.
-
-2001-02-01 Fernando Nasser <fnasser@redhat.com>
-
- * library/pluginwin.itcl (contrucdtor, destructor): Use "code" to
- specify callbacks.
- (running, stopped, no_inferior): Make it a protected method.
- (childsite): Explicitly mark as a public method.
- * library/plugins/rhabout/rhabout.itcl (constructor): Add a label
- widget to show status messages.
- (running, stopped): Overload versions of the base class; display
- status messages as an example.
-
-2001-01-31 Fernando Nasser <fnasser@redhat.com>
-
- * library/pluginwin.itcl: New file. Implements the PluginWindow
- class that provides some basic functionality for plug-ins.
- * library/plugins/rhabout/rhabout.itcl: Inherit from the new
- PluginWindow class. Remove code dependent on ModalDlg.
- (constructor): Creates menus and a toolbar to show how these
- PluginWindow components are used.
- * library/tclIndex: Regenerate.
-
-2001-01-31 Fernando Nasser <fnasser@redhat.com>
-
- * library/plugins/rhabout.tcl: Add load for optional sample C command
- procedure.
- * library/plugins/rhabout/rhabout.itcl (constructor): Try calling
- optional sample C command procedure rhabout_extra_text.
- * library/plugins/rhabout/rhabout.c: New file. Implement an example
- plug-in shared library with a sample C command procedure.
- * library/plugins/rhabout/Makefile: New file. Makefile for the sample
- shared library above (Linux only).
-
-2001-01-28 Fernando Nasser <fnasser@redhat.com>
-
- * library/plugins: New directory. Sample plug-in directory to help
- developers of Insight plug-ins. See README file in that directory.
- * library/plugins/plugins.tcl: New file. Sample version of a code
- fragment file which adds entries to the PlugIn menu of the Source
- Window to activate custom plug-in windows.
- * library/plugins/pkgIndex.tcl: New file. Sample version of a file
- with package information for the installed plug-ins.
- * library/plugins/rhabout.tcl: New file. Sample file providing a
- plug-in package.
- * library/plugins/rhabout: New directory. Sample plug-in.
- * library/plugins/rhabout/rhabout.itcl: New file. Sample class
- implementing a plug-in window.
- * library/plugins/rhabout/tclIndex: New file. Tcl index for the sample
- plug-in implementation.
-
-2001-01-28 Fernando Nasser <fnasser@redhat.com>
-
- * library/main.tcl: Add plugin subdirectory, if existent, to auto_path.
- * library/srcbar.itcl (create_plugin_menu): New method. Create a pull
- down menu for plugins if there are any for this target configuration.
- (create_menu_items): Invoke the new method above.
-
-2001-01-28 Fernando Nasser <fnasser@redhat.com>
-
- * library/gdbmenubar.itcl (menubar_new_menu): Save lable of a menu to
- use as index.
- (menubar_delete_menu): New function. Delete a menu.
-
-2001-01-28 Fernando Nasser <fnasser@redhat.com>
-
- * library/gdbmenubar.itcl (menu_list): Add missing declararion for
- global variable.
-
-2001-01-28 Fernando Nasser <fnasser@redhat.com>
-
- * library/gdbmenubar.itcl (set_class_state): Turn off verbose debug
- messages.
- * library/gdbtoolbar.itcl (set_class_state): Ditto.
-
-2001-01-26 Fernando Nasser <fnasser@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_clear_file): Call exec_file_clear() and
- symbol_file_clear() instead of exec_file_command() and
- symbol_file_command().
- (gdb_find_file_command): Return the proper error text.
-
-2001-01-25 Fernando Nasser <fnasser@redhat.com>
-
- * library/srcbar.itcl: New file. Implement SrcBar, a menu and toolbar
- for the Source Window (code previously in srcmenubar.itcl and
- srctoolbar.itcl).
- * library/srcmenubar.itcl: Remove obsolete file.
- * library/srctoolbar.itcl: Remove obsolete file.
- * library/srcbar.tcl: Remove obsolete file.
- * library/gdbmenubar.itcl (menubar_show): New method. Associate the
- menu with the toplevel window.
- * library/srcwin.itb (_build_win): Use SrcBar.
- * library/tclIndex: Regenerate.
-
-2001-01-24 Fernando Nasser <fnasser@redhat.com>
-
- From Martin Hunt <hunt@cygnus.com>
- * generic/gdbtk-cmds.c (gdb_set_bp_addr, gdb_set_bp): Change
- strsave() to xstrdup().
-
-2001-01-24 Fernando Nasser <fnasser@redhat.com>
-
- From Martin Hunt <hunt@cygnus.com>
- * generic/gdbtk-cmds.c (gdbtk_dis_asm_read_memory): Fix call
- to xfer_memory().
-
-2001-01-19 Fernando Nasser <fnasser@redhat.com>
-
- * library/prefs.tcl (pref_set_defaults): Set default value of
- gdb/src/top_control to place the source window controls at the top.
-
-2001-01-18 Fernando Nasser <fnasser@redhat.com>
-
- * library/srctextwin.itb (_highlightAsmLine): Add missing FUNCNAME
- parameter.
- (FillAssembly, FillMixed): Pass the FUNCNAME parameter that is
- needed by the above method.
- * library/srctextwin.ith (_highlightAsmLine): Add FUNCNAME parameter
- to method definition.
-
-2001-01-17 Fernando Nasser <fnasser@redhat.com>
-
- * library/srctextwin.itb (_highlightAsmLine): Add missing FILENAME
- parameter.
- (FillAssembly, FillMixed): Pass the FILENAME parameter that is
- needed by the above method.
- * library/srctextwin.ith (_highlightAsmLine): Add FILENAME parameter
- to method definition.
-
-2001-01-15 Fernando Nasser <fnasser@redhat.com>
-
- * srcwin.itb (clear_file): Pass the appropriate value to the GO
- argument of mode() so it does not try to read a source file when
- no executable is loaded.
-
-2001-01-09 Fernando Nasser <fnasser@redhat.com>
-
- * library/srcmenubar.itcl (create_file_menu): Add missing incr for
- session numbers.
-
-2001-01-04 Fernando Nasser <fnasser@redhat.com>
-
- The following changes fix the problem of having to click on a splash
- window to make it disapear.
- * modal.tcl (post): Take as an argument "expire", the time a modal
- window is displayed.
- * managedwin.itb (open): Check for an "expire" argument and pass the
- value down to modal post method.
-
-2001-01-04 Fernando Nasser <fnasser@redhat.com>
-
- * library/gdbmenubar.itcl (set_class_state): New public method.
- Standard method to control state by class.
- (menubar_menu_class_find): Delete public accessor method.
- (menubar_change_menu_state): Change the state of a menu item
- not of a whole class list.
- * library/srcmenubar.itcl (enable_ui): Use set_class_state instead
- of prying into base class internal data.
- * library/gdbtoolbar.itcl (set_class_state): New public method.
- Standard method to control state by class.
- (toolbar_button_class_find): Delete public accessor method.
- * library/srctoolbar.itcl (enable_ui): Use set_class_state instead
- of prying into base class internal data.
-
-2001-01-04 Fernando Nasser <fnasser@redhat.com>
-
- * library/interface.tcl (gdbtk_connect): New proc. Connects to ai
- remote target (code previously at library/gdbmenubar.itcl).
- (disconnect): Rename to...
- (gdbtk_disconnect): New name for proc disconnect.
- * library/srcmenubar.itcl (do_connect): Remove the code mentioned
- above and call the new interface proc gdbtk_connect.
- Also, call ::update idletasks after changing the state of the
- menu entries.
- (do_detach): Call gdbtk_disconnect, not ::disconnect (old name).
- (do_disconnect): Call gdbtk_disconnect, not disconnect (old name).
-
-2001-01-03 Fernando Nasser <fnasser@redhat.com>
-
- * library/prefs.tcl (pref_set_defaults): Define gdb/src/top_control
- to allow the source window controls to be placed at the top.
- * library/srcwin.itb (_build_win): Test for gdb/src/top_control
- and place the controls accordingly.
-
-2001-01-02 Fernando Nasser <fnasser@redhat.com>
-
- * library/gdbmenubar.itcl: New file. Define the GDBMenuBar class,
- a generic menubar building facility for Insight windows (WIP).
- * library/gdbtoolbar.itcl: New file. Define the GDBToolBar class,
- a generic toolbar building facility for Insight windows (WIP).
- * library/srcmenubar.itcl: New file. Define the SrcMenuBar class,
- which implements the Source Window menubar (inherits GDBMenuBar).
- * library/srctoolbar.itcl: New file. Define the SrcToolBar class,
- which implements the Source Window toolbar (inherits GDBToolBar).
- * library/srcwin.itb (_build_win): Use SrcMenuBar and SrcToolBar
- instead of the obsolete GDBSrcBar.
- * library/srcbar.tcl: Mark as OBSOLETE.
- * library/toolbar.tcl: Mark as OBSOLETE. Rename class GDBToolBar
- to avoid conflict with new class with the same name.
- * library/Makefile (TCL): Include .itcl files.
- * library/tclIndex: Regenerate.
-
-2001-01-02 Fernando Nasser <fnasser@redhat.com>
-
- * library/srcwin.itb (_build_win): If gdb is running a program, load
- the window with source for that location (if available).
- (download_progress): Calls to "update" must refer to the global
- namespace.
-
-2001-01-02 Fernando Nasser <fnasser@redhat.com>
-
- * library/interface.tcl (gdbtk_quit_check): Save session whenever
- possible.
-
-2001-01-01 Fernando Nasser <fnasser@redhat.com>
-
- * library/ChangeLog-2000: New file. Entries dated 2000 moved here
- from library/ChangeLog.
- * library/ChangeLog: Removed.
- * generic/ChangeLog-2000: New file. Entries dated 2000 moved here
- from library/ChangeLog.
- * generic/ChangeLog: Removed.
-
-2000-12-14 Fernando Nasser <fnasser@redhat.com>
-
- * library/ChangeLog-1999: New file. Entries dated 1999 moved here
- from library/ChangeLog.
- * library/ChangeLog-1998: New file. Similar change for 1998.
- * library/ChangeLog-1997: New file. Similar change for 1997.
- * library/ChangeLog: Removed entries previous to 2000.
- * generic/ChangeLog-1999: New file. Entries dated 1999 moved here
- from library/ChangeLog.
- * generic/ChangeLog-1998: New file. Similar change for 1998.
- * generic/ChangeLog-1997: New file. Similar change for 1997.
- * generic/ChangeLog: Removed entries previous to 2000.
-
-2000-04-17 Jonathan Larmour <jlarmour@redhat.co.uk>
-
- * ChangeLog-gdbtk: Renamed to ChangeLog
- * ChangeLog: New file
- * README.GDBTK: No need for changelog-default-name hint for Emacs now
-
-Sat Feb 5 00:14:30 2000 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdb.rc, gdbtool.ico, README.GDBTK: To here from top level GDB
- directory.
- * gdb/gdbtcl2: Directory moved to gdbtk/library.
- * gdb/gdbtk/generic: New directory.
-
diff --git a/gdb/gdbtk/ChangeLog-2002 b/gdb/gdbtk/ChangeLog-2002
deleted file mode 100644
index 6c22903ad3e..00000000000
--- a/gdb/gdbtk/ChangeLog-2002
+++ /dev/null
@@ -1,878 +0,0 @@
-2002-12-20 Martin M. Hunt <hunt@redhat.com>
-
- * library/srcbar.itcl (SrcBar): Don't load vmake icon.
-
- * library/images: Removed back.gif, build.gif, file.gif, fore.gif,
- gdbtk.gif, opt.gif, tools.gif, tools2_3d.gif, and vmake.gif.
-
- * library/images2: Removed back.gif, build.gif, file.gif, fore.gif,
- gdbtk.gif, load.gif, opt.gif, tools.gif, tools2_3d.gif, and vmake.gif.
-
-2002-12-18 Martin M. Hunt <hunt@redhat.com>
-
- * library/main.tcl: Don't try to print errors to stderr on Windows.
-
-2002-12-18 Martin M. Hunt <hunt@redhat.com>
-
- * library/regwin.itb (RegWin::update): When updating, check
- that a cell still exists before checking its value.
- (RegWin::_select_group): Clear cells with changed values before
- changing group. After new group is selected, highlight any changed
- values still visible.
-
-2002-12-17 Martin M. Hunt <hunt@redhat.com>
-
- * library/interface.tcl (gdbtk_tcl_fputs_target_err):
- New function.
- (gdbtk_tcl_fputs_target): Open console window if it is
- not already open.
- (gdbtk_gets): New function.
- Opens a console window if necessary and calls Console::gets.
-
- * library/console.ith (gets): Declare method.
- (_input_mode): New private variable.
- (_input_result): Ditto.
- (_input_error): Ditto.
- (_cancel): New private method
- (invoke): Add arg.
-
- * library/console.itb (_setprompt): Allow setting prompt
- to nothing. Delete to beginning of line before writing prompt.
- (gets): New public method to prompt user for input.
- (_cancel): New private method to handle ^C when inputting data.
- (invoke): Check for ^d when in input mode.
-
-2002-12-17 Martin M. Hunt <hunt@redhat.com>
-
- * library/regwin.itb (_load_prefs): Get list of registers from
- the group name.
- (_build_win): Remove old menu system. Replace with an optionmenu
- that contains all the valid group names for this architecture.
- (_layout_table): No need to update old menu.
- (_but3): Add "Close" to popup menu.
- (_delete_from_display): No need to update old menu.
- (_display_all): Ditto.
- (_post_menu): Deleted.
- (_select_group): New method. Callback for group optionmenu.
-
- * library/regwin.ith: New private variable _group.
- New private method _select_group. Removed _post_menu.
-
- * generic/gdbtk-register.c: Include reggroups.h.
- (gdb_register_info): Add "group" and "grouplist".
- (gdb_regformat): Fix Tcl_WrongNumArgs call so it doesn't crash.
- (gdb_reggrouplist): New function. Returns the names of the
- register groups.
- (gdb_reggroup): New function. Returns the register numbers of the
- registers in a group.
-
-2002-12-06 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_update_mem): Don't add a 0x prefix.
-
-2002-12-05 Martin M. Hunt <hunt@redhat.com>
-
- * library/regwin.itb (update): Revert previous patch to this
- function. But also don't tag blank cells.
- (_but3): Fix help call.
-
-2002-12-04 Martin M. Hunt <hunt@redhat.com>
-
- * library/regwin.itb (_but3): Fix help call.
-
- * library/helpviewer.tcl (open_help): Fix KDE apps list.
-
- * library/debugwin.itb (build_win): Fix help call.
-
- * library/regwin.itb (update): Remove some old code
- that marked registers as changed when the target started.
- (_build_win): Make changed registers more visible by
- changing their bg to Colors(change).
-
- * library/prefs.tcl (pref_set_option_db): Create a new
- Color(change) which is the color of text indicating a change.
- Current default is green.
-
- * library/vartree.itb (_init_data): Make changed values
- Color(change). Can't change bg, so we change fill color.
-
-2002-12-04 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-hooks.c: Include tcl.h and tk.h to pull
- in declarations for some Tk functions used in this file.
- * generic/gdbtk-cmds.c: Likewise.
-
-2002-12-03 Martin M. Hunt <hunt@redhat.com>
-
- * library/vartree.itb (_but3): Add popup menu item to dump
- memory at the value of the variable.
-
- * library/vartree.itb (buildlayer): Check for error when updating
- a variable's value.
- (update_var): Ditto.
-
- * library/srcpref.itb: Latest tk doesn't support
- "-col" as a grid option. Use "-column".
-
- * library/regwin.itb: Ditto.
-
- * library/main.tcl: Require package "debug". Make
- package loading a bit more robust.
-
-2002-11-30 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-stack.c: Replace selected_frame with
- deprecated_selected_frame.
- * generic/gdbtk-register.c: Ditto.
- * generic/gdbtk-cmds.c (gdb_loc): Replace selected_frame with
- deprecated_selected_frame. Use get_frame_pc and find_frame_sal.
-
-2002-11-27 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk.c (gdbtk_init): Don't call Tix_Init.
- Don't include tix.h
-
- * generic/gdbtk-hooks.c: Don't include tix.h.
-
- * generic/gdbtkj-cmds.c: Don't include tix.h.
-
-2002-11-27 Andrew Cagney <cagney@redhat.com>
-
- * generic/gdbtk-stack.c (get_frame_name): Use get_frame_type
- instead of deprecated_frame_in_dummy.
- * generic/gdbtk-cmds.c (gdb_loc): Ditto.
-
-2002-11-19 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-stack.c (gdb_selected_frame): Use get_frame_base
- instead of FRAME_FP. Mention that get_frame_id() should be used.
-
-2002-11-19 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_loc): Use get_frame_type instead of
- ->signal_handler_caller.
- * generic/gdbtk-stack.c (get_frame_name): Ditto.
- (get_frame_name): Ditto.
-
-2002-11-12 Andrew Cagney <ac131313@redhat.com>
-
- From 2002-11-11 David Carlton <carlton@math.stanford.edu>
- * generic/gdbtk-stack.c (get_frame_name): Replace call to
- frame_in_dummy with one to deprecated_frame_in_dummy.
- * generic/gdbtk-cmds.c (gdb_loc): Ditto.
-
-2002-11-11 Martin M. Hunt <hunt@redhat.com>
-
- * library/srctextwin.itb (do_key): Add arg to
- print call.
-
-2002-11-11 Martin M. Hunt <hunt@redhat.com>
-
- * library/data.ith: Deleted.
- * library/data.itb: Deleted.
-
-2002-11-11 Martin M. Hunt <hunt@redhat.com>
-
- * library/memwin.itb: Supply arg to _update_address.
-
-2002-11-11 Martin M. Hunt <hunt@redhat.com>
-
- * library/toolbar.tcl: Deleted this obsolete file.
- * library/tclIndex: Rebuilt.
-
-2002-11-11 Martin M. Hunt <hunt@redhat.com>
-
- * library/srcbar.itcl (create_help_menu): For unix systems,
- if compatibility is set to KDE or GNOME, put the help menu
- in the right place. Otherwise put it on the far right, like
- Motif does.
-
-2002-11-11 Martin M. Hunt <hunt@redhat.com>
-
- * library/helpviewer.tcl: New file. Finds
- an appropriate help browser and displays the help files.
-
- * library/vartree.itb: Fix open_help calls.
-
- * library/helpviewer.ith: Deleted.
- * library/helpviewer.itb: Deleted.
-
- * library/prefs.tcl (pref_set_defaults): Remove
- pref gdb/help/browser. Add pref gdb/help/browsername.
- We couldn't simply rename because it would break older
- versions of Insight that expect gdb/help/browser to be
- a number.
-
-2002-11-08 Martin M. Hunt <hunt@redhat.com>
-
- * library/prefs.tcl (pref_save): Fix GDBtkInitVersion.
- (pref_save): Check that value is not null before writing.
-
-2002-11-07 Martin M. Hunt <hunt@redhat.com>
-
- * library/util.tcl (CygScrolledListbox): Delete.
-
- * library/srctextwin.itb: Change from CygScrolledListbox
- to iwidgets::scrolledlistbox. Set foreground and background.
- Center popup over source window.
-
-2002-11-06 Martin M. Hunt <hunt@redhat.com>
-
- * library/locals.tcl (build_win): Fix so window opens
- on Windows.
-
-2002-11-06 Martin M. Hunt <hunt@redhat.com>
- * library/debugwin.itb: Remove VariableWin. Add VarTree.
-
-2002-11-06 Martin M. Hunt <hunt@redhat.com>
- * library/watch.tcl: Completely rewritten to use VarTree.
- * library/locals.tcl: Completely rewritten to use VarTree.
- * library/variables.tcl: Deleted.
- * library/vartree.ith: New file.
- * library/vartree.itb: New file. Implements a variable
- tree.
- * library/tclIndex: Rebuilt.
-
-2002-11-06 Martin M. Hunt <hunt@redhat.com>
- * library/globalpref.itb (_build_win): Add radiobox
- to select KDE/GNOME/default for pref gdb/compat. Remove
- browser option.
-
- * library/regwin.itb (build_win): Colors(hbg) has been
- removed so use Colors(bg) instead.
-
- * library/prefs.tcl (pref_set_defaults): Add a new
- preference "gdb/compat" which can be set to KDE, GNOME,
- Windows or default. This allows us to change Insight's
- behavior based on windowing system.
- (pref_set_colors): Attempt to read in .gtkrc files.
- Do different things for KDE vs GNOME.
- (pref_load_default): New function. Load default colors.
- (pref_load_gnome): New function. Find and open GNOME file.
- (load_gnome_file): New function. Loads GNOME file.
- (pref_set_option_db): New function. Set option database.
-
-2002-11-06 Martin M. Hunt <hunt@redhat.com>
- * generic/gdbtk-varobj.c: Remove FREEIF and replace with xfree.
- Make format_string static.
- (variable_update): Return an object
- with "-1" in it on error.
-
-2002-11-06 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-hooks.c (gdbtk_call_command): Make a null
- cleanup and run it after every issued gdb command. Apparently
- some commands depend on this. [This should really be part of
- main gdb...]
-
-2002-10-15 Martin M. Hunt <hunt@redhat.com>
-
- * library/tclIndex: Rebuilt.
-
- * library/* : auto_mkindex cannot rebuild
- tclIndex because it does not recognize the namespace
- import in main.tcl. To get it to work again, rename the
- following:
- body -> itcl::body
- configbody -> itcl::configbody
- class -> itcl::class
-
-2002-10-10 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_update_mem): No results
- were being returned. Append results to result_ptr_obj_ptr.
-
-2002-10-10 Martin M. Hunt <hunt@redhat.com>
-
- * library/session.tcl (save): Save target_cmd,
- attach, load, run, and cont as session prefs.
- (notice_file_change): Load in above session
- prefs.
-
- * library/interface.tcl (set_target): Set icons busy
- before attempting target command and set back to idle after.
- (run_executable): Return on ATTACH_ERROR.
- (gdbtk_run): If run button is hit when a program
- is currently being debugged, put up a dialog allowing
- user to continue or cancel.
-
-2002-10-09 Martin M. Hunt <hunt@redhat.com>
-
- * library/targetselection.itb (init_target_db): Add gdbserver
- target.
- (get_target_list): Always add "gdbserver" to list of valid
- targets.
- (valid_target): Always allow "gdbserver".
-
-2002-09-27 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-hooks.c (gdbtk_add_hooks): Add gdbtk_annotate_signal
- as annotate_signalled_hook.
-
-2002-09-26 Andrew Cagney <ac131313@redhat.com>
-
- From Grace Sainsbury <graces@redhat.com>:
- * generic/gdbtk-main.c: New file.
-
-2002-09-24 Martin M. Hunt <hunt@redhat.com>
-
- * library/srctextwin.itb (FillMixed): Fix debug
- statement for 64-bit.
- (_highlightAsmLine): Fix 64-bit arithmetic.
-
-2002-09-19 Martin M. Hunt <hunt@redhat.com>
-
- * library/srctextwin.itb (FillAssembly): Fix debug
- statement for 64-bit addresses.
- (showBPBalloon): Fix for 64-bit addresses.
-
- * library/memwin.itb (incr_addr): Fix 64-bit addresses.
-
-2002-09-18 Keith Seitz <keiths@redhat.com>
-
- * library/console.itb (_build_win): Bind control-c and control-v
- to copy and paste.
-
-2002-08-15 Keith Seitz <keiths@redhat.com>
-
- * README: Massive update.
-
-2002-08-14 Keith Seitz <keiths@redhat.com>
-
- * README.GDBTK: Updated and renamed to README.
- * README: "New" file.
-
-2002-08-14 Keith Seitz <keiths@redhat.com>
-
- * library/srcbar.itcl (create_plugin_menu): Deal with
- multi plugin directories.
- Catch any errors that might occur reading plugin.tcl.
- * library/main.tcl: Add plugins from new default directory.
- (INSIGHT_PLUGINS): New environment variable to point to other
- plugin directories.
-
-2002-08-14 Keith Seitz <keiths@redhat.com>
-
- * library/plugins: Removed.
- * plugins/: New folder to hold plugins.
- * Makefile.am, Makefile.in, aclocal.m4, configure,
- configure.in: New files.
-
-2002-08-14 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk.c (view_command): New function to display
- location in source window.
- (gdbtk_init): Add new gdb "view" command.
-
-2002-08-06 Keith Seitz <keiths@redhat.com>
-
- * library/srcwin.itb (_build_win): Anchor status label so that
- text appears at left instead of centered.
-
-2002-08-03 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-bp.c: Include "gdb_string.h".
- * generic/gdbtk-register.c: Ditto.
- * generic/gdbtk-varobj.c: Ditto.
-
-2002-08-01 Keith Seitz <keiths@redhat.com>
-
- * library/prefs.tcl (pref_read): Don't suppress setting the default
- colors if the user has suppressed reading the preferences file.
-
-2002-07-31 Keith Seitz <keiths@redhat.com>
-
- * library/browserwin.itb (_full_funcs_combo): Remove "-modal"
- option from tk_messageBox call. It was redhat-local in tk8.0,
- but is no longer in tk8.3.
- * library/download.itb (download_it): Likewise.
- * library/interface.tcl (gdbtk_tcl_query): Likewise.
- (show_warning): Likewise.
- (set_exe): Likewise.
- (set_target): Likewise.
- * library/memwin.itb (error_dialog): Likewise.
- * library/srcwin.itb (fillFuncCB): Likewise.
- * library/util.tcl (tfind_cmd): Likewise.
-
-2002-07-03 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-hooks.c (gdbtk_call_command): Use cmd_func().
-
-2002-06-12 Keith Seitz <keiths@redhat.com>
-
- * library/gdbmenubar.itcl (add): Add new "cascade" type.
- (menubar_add_cascade): New method to build cascading menus.
-
-2002-06-07 Martin M. Hunt <hunt@redhat.com>
-
- * library/prefs.tcl (pref_set_colors): New function. Set up colors
- from Windows system colors or X resource database. Save in array.
- (pref_set_defaults): Remove gdb/font/normal_fg, etc.
- (pref_read): Call pref_set_colors.
-
- * library/main.tcl: Remove call to "tix resetoptions TixGray".
-
- * library/bpwin.itb, library/browserwin.itb, library/console.itb,
- library/globalpref.itb, library/memwin.itb, library/process.itb,
- library/regwin.itb, library/srcpref.itb, library/srctextwin.itb,
- library/stackwin.itb, library/tdump.tcl, library/tracedlg.tcl,
- library/variables.tcl: Replace calls to [pref get gdb/fonts/*]
- for colors with references to Color array. Remove all tixOptions calls.
- Fix up colors as necessary.
-
-2002-05-31 Martin M. Hunt <hunt@redhat.com>
-
- * library/prefs.tcl (pref_read): If the regular expression
- cannot parse line, print debug message and skip it.
-
-2002-05-15 Martin M. Hunt <hunt@redhat.com>
-
- * library/help/register.html: Rewrite docs.
-
- * library/regwin.ith (_types): New private variable array to save
- the possible types for each register.
- (_type): New private variable array to save the selected type for
- each register.
- (_rows): New private variable. Number of rows in the table.
- (_cols): New private variable. Number of cols in the table.
- (_load_prefs): New private method.
- (_open_memory): New private method.
- (_edit_menu): Deleted:
- (_select): Deleted.
- (_change_format): Add optional type argument.
-
- * library/regwin.itb (RegWin::_load_prefs): New method. Collects
- all the prefs stuff here instead of in _layout_table. Prefs
- code was all rewritten to handle new types and formats.
- (RegWin::_build_win): Disable Double-1 binding. Bind
- button 1 to edit the cell. Don't make an Edit menu item.
- Remove Natural, Binary, Octal, and Raw formats. Add "Open
- Memory Window" menu item.
- (RegWin::_dimensions): This function was being abused so I removed
- it. Replaced with inline code in _layout_table which saves its
- computed values so it doesn't have to be recalculated unless
- something changes.
- (RegWin::_layout_table): Rewritten to be more efficient. Grabs
- all values in one call to gdb_reginfo instead of one for each register.
- Uses new types and formats. Calls _load_prefs.
- (RegWin::_accept_edit): Use type information when setting value.
- When done, call _unedit to remove tags.
- (RegWin::_open_memory): Open memory window with initial value
- set to the value of a register.
- (RegWin::_but3): Add types menu items. Limit format options
- to reasonable ones. Add "Open Memory Window". Add "Help"
- (RegWin::_edit): Just call _select_cell.
- (RegWin::_edit_menu): Deleted.
- (RegWin::_move): Don't recompute rows and cols; use _rows and
- _cols computed by _layout_table.
- (RegWin::_post_menu): Update types and formats. Disable "Open Memory
- Window" if register is not integer. Remove Edit.
- (RegWin::_select): Deleted.
- (RegWin::_select_cell): Tag cell as being edited. Then
- call focus, which is a workaround for a TkTable glitch where
- the insertion bar sometimes disappeared.
- (RegWin::_unedit): Clear selection. Call focus. Don't change
- any bindings.
- (RegWin::_get_value): Eliminate previous crap and just call
- "gdb_reginfo value".
- (RegWin::_change_format): Add optional type arg. Call
- "gdb_reginfo format".
- (RegWin::_update): Get a list of all the changed registers
- instead of checking one at a time.
-
- * generic/gdbtk-register.c (Gdbtk_Register_Init): Don't
- create gdb_pc_reg. It is not used. Call register_gdbarch_swap
- with regformat and regtype.
- (gdb_register_info): Add "type" and "format" options.
- (get_pc_register): Delete.
- (get_register_types): New function. Returns list of valid types
- for a list of registers.
- (get_register): Use saved format and type for each register. Check if
- there are any registers yet (target not running). Use mem_file
- to collect output. Append output to a list.
- (map_arg_registers): If passed a list, iterate though each element
- and build a list of values to return.
- (setup_architecture_data): Memory was not being initialized, so
- use xcalloc(). Allocate memory for regformat and regtype.
- (gdb_regformat): New function called by "gdb_reginfo format".
-
-2002-05-15 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_eval): For mem_file stuff, delete
- the file when done and free memory.
-
-2002-05-06 Martin M. Hunt <hunt@redhat.com>
-
- * library/session.tcl (notice_file_change): Catch the
- directory change, in case the directory no longer exists.
-
-2002-05-05 Alexandre Oliva <aoliva@redhat.com>
-
- * generic/gdbtk-register.c (get_register, register_changed_p):
- Don't depend on variable-sized automatic arrays.
-
-2002-05-04 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-wrapper.h (GDB_select_frame): Delete declaration.
- * generic/gdbtk-wrapper.c (GDB_select_frame): Delete function.
- (wrap_select_frame): Delete function.
-
-2002-04-26 Martin M. Hunt <hunt@redhat.com>
-
- * library/interface.tcl (gdbtk_force_quit): New function.
- Closes source windows then calls gdb_force_quit.
- (gdbtk_quit): Call gdbtk_force_quit.
-
-2002-04-24 Keith Seitz <keiths@redhat.com>
-
- * library/managedwin.ith (_ignore_on_save): New protected method.
- * library/managedwin.itb (shutdown): If _ignore_on_save, don't
- save this window to the active window list in the preferences
- file.
- * library/debugwin.ith (DebugWin::_ignore_on_save): Don't save
- this window to preferences active list.
- (DebugWinDOpts::_ignore_on_save): Likewise.
- * library/pluginwin.itcl (_ignore_on_save): Likewise.
- * library/download.ith (_ignore_on_save): Likewise.
-
-2002-04-22 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-stack.c (Gdbtk_Stack_Init): Don't link
- selected_frame_level directly.
- * generic/gdbtk-hooks.c (gdbtk_selected_frame_changed): Set
- the global "gdb_selected_frame_level" directly.
-
-2002-04-21 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-wrapper.c (GDB_find_frame_addr_in_frame_chain):
- Delete function.
- (wrap_find_frame_addr_in_frame_chain): Delete function.
- * generic/gdbtk-wrapper.h (GDB_find_frame_addr_in_frame_chain):
- Delete declaration.
-
-2002-04-17 Andrew Cagney <cagney@redhat.com>
-
- * generic/gdbtk.c (gdbtk_init): Use error or throw_exception to
- report an error.
-
-2002-04-12 Andrew Cagney <cagney@redhat.com>
-
- * generic/gdbtk-register.c (register_changed_p): Use
- frame_register_read instead of read_relative_register_raw_bytes.
- (get_register): Delete out-of-date comment.
-
-2002-04-08 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-wrapper.c (wrap_get_frame_block): Add missing NULL
- parameter. Match recent get_frame_block changes.
-
-2002-04-05 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-stack.c (gdb_block_vars): Update get_frame_block to
- match recent gdb changes.
- (gdb_get_blocks): Likewise.
- (gdb_get_vars_command): Likewise.
- (gdb_selected_block): Likewise.
-
-2002-04-04 Keith Seitz <keiths@redhat.com>
-
- * library/download.itb (constructor): Set feedback meter
- to "0.0".
- Remove "steps" array.
- (update_download): Use fractional completions for feedback.
- (done): Ditto.
- * library/download.ith (protected variable steps): Remove.
-
-2002-04-04 Daniel Jacobowitz <drow@mvista.com>
-
- * generic/gdbtk-cmds.c (gdb_disassemble_driver): Skip
- end-of-function markers in the line table.
-
-2002-04-01 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_load_disassembly): Use string_to_core_addr
- instead of parse_and_eval_address.
- Use xfree instead of free.
-
-2002-03-25 Elena Zannoni <ezannoni@redhat.com>
-
- * generic/gdbtk-hooks.c: Include cli/cli-decode.h for
- cmd_list_element.
-
-2002-03-25 Alexandre Oliva <aoliva@redhat.com>
-
- * generic/gdbtk.c (HAS_STDARG): Define.
- * generic/gdbtk-cmds.c (HAS_STDARG): Likewise.
- * generic/gdbtk-hooks.c (HAS_STDARG): Likewise.
-
-2002-03-14 Keith Seitz <keiths@redhat.com>
-
- * library/bpwin.itb (constructor): Set some sane initial
- size.
-
-2002-03-07 Martin M. Hunt <hunt@redhat.com>
-
- * library/srctextwin.itb (SrcTextWin::showBPBalloon): Put
- linefeeds between multiple breakpoints.
-
-2002-03-06 Martin M. Hunt <hunt@redhat.com>
-
- * library/srctextwin.itb (SrcTextWin::showBPBalloon):
- Reformat output. Add conditions, ignore count, commands.
-
- * library/interface.tcl (gdbtk_tcl_readline): Remove
- call to "command::insert" and instead insert the command
- into the console window.
- (gdbtk_tcl_readline_end): Catch the unsets and do not call
- non-existent function command::end_multi_line_input.
-
-2002-03-06 Martin M. Hunt <hunt@redhat.com>
-
- * library/bpwin.itb: Left-justify the labels in
- the table.
-
-2002-03-06 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-cmds.c: Include "ctype.h" if available.
- (gdb_get_mem): Renamed to gdb_update_mem.
- (gdb_update_mem): Take array as first tcl argument. This
- array will hold the data for the table, which is now stuffed
- in C instead of tcl.
- (gdb_eval): Use our own ui-file instead of gdb_stdout.
- * library/memwin.ith (_update_address): New method.
- (update_address): Address expression is no longer optional.
- * library/memwin.itb (build_win): Use _update_address instead of
- update_address.
- (toggle_enabled): Ditto.
- (newsize): Use _update_address instead of update_addr.
- (update_address_cb): Use _update_address instead of update_address.
- (do_popup): Likewise.
- (goto): Likewise.
- (incr_addr): Use _update_address instead of update_addr.
- (edit): Use gdb_update_mem instead of gdb_get_mem.
- (update_addr): use gdb_update_mem to do all the window updating.
-
-2002-03-06 Martin M. Hunt <hunt@redhat.com>
-
- * library/srcwin.itb: Don't try to set balloon help
- for search widget; it moved to srcbar.
-
-2002-03-05 Martin M. Hunt <hunt@redhat.com>
-
- * library/prefs.tcl (pref_read): If a preference specifies
- "src-font", substitute "global/fixed".
- (pref_set_defaults): Change defaults from "src-font" to
- "global/fixed". Do not create font object "src-font". Do
- not add hook to trace its changes.
- (pref_src-font_trace): Remove.
-
- * library/console.itb (Console::_update_option): Remove
- font update because this happens automatically.
-
- * library/globalpref.itb: No need to set
- changed flag for fonts; updates happen automatically
- when prefs are updated.
-
- * library/bpwin.itb: Replaced src-font with global/fixed.
- * library/browserwin.itb: Ditto.
- * library/mempref.itb: Ditto.
- * library/memwin.itb: Ditto.
- * library/process.itb: Ditto.
- * library/regwin.itb: Ditto.
- * library/srcbar.itcl: Ditto.
- * library/srcpref.itb: Ditto.
- * library/srctextwin.itb: Ditto.
- * library/srcwin.itb: Ditto.
- * library/stackwin.itb: Ditto.
- * library/tdump.tcl: Ditto.
- * library/tracedlg.tcl: Ditto.
- * library/variables.tcl: Ditto.
- * library/watch.tcl: Ditto.
-
-2002-03-01 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-register.c (register_changed_p): Don't use REGISTER_BYTES.
- There is no guarantee anymore that REGISTER_BYTES contains
- NUM_REGS+NUM_PSEUDO_REGS registers.
- (setup_architecture_data): Likewise.
-
-2002-02-25 Ian Roxborough <irox@redhat.com>
-
- * library/srcbar.itcl (SrcBar::create_buttons): Added
- "Search in source file" entry box and label to the top
- row toolbar.
- * library/srcwin.itb (SrcWin::_build_win): Removed
- "Search in source file" entry box.
- (SrcWin::_search): Renamed to "search", add string
- parameter and cleaned up.
- * library/srcwin.ith (SrcWin): Removed private
- method "_search" and added public method "search".
-
-2002-02-17 Tom Tromey <tromey@redhat.com>
-
- * library/tclIndex: Updated.
- * library/srcbar.itcl (SrcBar): Use new Session namespace.
- * library/main.tcl: Use new Session namespace.
- * library/interface.tcl (gdbtk_tcl_preloop): Use new Session
- namespace.
- (gdbtk_cleanup): Likewise.
- (_close_file): Likewise.
- * library/session.tcl: Use a namespace. Renamed all functions.
-
-2002-02-13 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-hooks.c (gdbtk_print_frame_info): Don't
- set GDB globals current_source_symtab and current_source_line.
- Let GDB do it.
-
-2002-02-13 Keith Seitz <keiths@redhat.com>
-
- * library/managedwin.itb (_create): If given a transient window,
- make sure that the SrcWin that is to become its master exists;
- otherwise, use ".".
-
-2002-02-12 Keith Seitz <keiths@redhat.com>
-
- From Don Bowman <don@sandvine.com>:
- * library/targetselection.itb (init_target_db): Add target
- vxWorks.
- Update copyright.
-
-2002-02-10 Daniel Jacobowitz <drow@mvista.com>
-
- * generic/gdbtk-cmds.c (gdb_listfuncs): Don't call
- BLOCK_SHOULD_SORT.
- * library/browserwin.itb (BrowserWin::_fill_funcs_combo): Sort
- the output of gdb_listfuncs.
-
-2002-02-07 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk.c, generic/gdbtk-bp.c, generic/gdbtk-cmds.c,
- generic/gdbtk-hooks.c, generic/gdbtk-stack.c: Cleanup includes.
-
-2002-02-06 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk.c, generic/gdbtk-bp.c, generic/gdbtk-cmds.c,
- generic/gdbtk-hooks.c, generic/gdbtk-register.c,
- generic/gdbtk-stack.c, generic/gdbtk-varobj.c,
- generic/gdbtk-wrapper.c: Cleanup. Fix indentation. Fix
- function declarations. Remove unused variables. Add 2002
- copyrights.
-
-2002-02-06 Keith Seitz <keiths@redhat.com>
-
- * library/images/cygnus.gif: Remove.
- * library/images2/cygnus.gif: Remove.
-
-2002-02-05 Elena Zannoni <ezannoni@redhat.com>
-
- * generic/gdbtk-cmds.c (gdbtk_load_asm, gdbtk_print_asm): Use
- TARGET_PRINT_INSN instead of tm_print_insn.
-
-2002-01-18 Keith Seitz <keiths@redhat.com>
-
- * library/console.ith (get_text): Delete.
- (test): New public method.
- * library/console.itb (get_text): Delete.
- (test): New public method.
-
-2002-01-15 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-varobj.c (variable_value): When varobj_get_value
- fails, use error_last_message to return the error to tcl land.
- This allows us to display nice messages about why "0xdeadbeef" is
- not accessible!
-
-2002-01-11 Martin M. Hunt <hunt@redhat.com>
-
- * library/memwin.itb (idle): Check for existence of window.
- Prevents race-condition error.
-
- * library/srctextwin.itb (enable): Check for existence of $twin.
-
- * library/interface.tcl (gdbtk_tcl_exec_file_display):
- Set pathname in host-independent manner using "file" and
- gdb_current_directory.
-
-2002-01-10 Keith Seitz <keiths@redhat.com>
-
- * library/Makefile (ITCL_SH): Renamed to "ITCLSH".
- (tclIndex): We no longer have an Itcl shell, so we must use
- "package require Itcl".
-
-2002-01-08 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_find_file_command): If the symtab
- doesn't have the filename's fullname, look it up with
- symtab_to_filename.
-
-2002-01-08 Keith Seitz <keiths@redhat.com>
-
- * library/srcwin.itb (location): Fix typo. It's "addr" not
- "address".
-
-2002-01-08 Tom Tromey <tromey@redhat.com>
-
- * library/interface.tcl (gdbtk_tcl_preloop): Use current directory
- when `--args' given.
-
-2002-01-07 Ian Roxborough <irox@redhat.com>
-
- * library/srcbar.itcl (SrcBar::create_buttons): Line number
- and address fields have been removed and added to the
- status bar.
- * library/srcwin.itb (SrcWin::_build_win): Add address and
- line number fields to status bar. Moved download progress
- bar to status bar.
- (SrcWin::download_progress): Use canvas on status bar.
- Remember to adjust width of 64-bit address.
- (SrcWin::location): Set line number and address on status bar.
- * library/srcwin.ith (SrcWin): Added new private variable.
-
-2002-01-04 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_disassemble_driver): Replace
- LITTLE_ENDIAN with BFD_ENDIAN_LITTLE.
- * generic/gdbtk-register.c (get_register): Ditto.
-
-2002-01-04 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-wrapper.h: Add typedef value_ptr.
-
-2002-01-03 Martin M. Hunt <hunt@redhat.com>
-
- * library/session.tcl (SESSION_serialize_bps): Ignore
- breakpoints set on internal_error and info_command because
- these are set by .gdbinit and will be recreated by it.
- This is a bit of a hack and should be fixed properly
- someday.
-
- * library/debugwin.itb: Fix incorrect button names
- so they will be enabled/disabled properly.
-
- * library/srctextwin.itb: Set focus on srcwin only
- if another window doesn't have the focus.
-
-2002-01-02 Keith Seitz <keiths@redhat.com>
-
- * library/interface.tcl (set_exe): Allow users to debug
- executables with no debug information.
-
-2002-01-02 Keith Seitz <keiths@redhat.com>
-
- * library/console.ith (insert): Add tag parameter.
- (einsert): Delete.
- * library/console.itb: (insert): Add tag parameter.
- (einsert): Delete.
- * library/interface.tcl (gdbtk_tcl_fputs): Use Console::insert.
- (gdbtk_tcl_fputs_error): Likewise.
- (gdbtk_tcl_fputs_log): Likewise.
- (gdbtk_tcl_fputs_target): Likewise.
- (set_target): Likewise.
-
-2002-01-02 Ian Roxborough <irox@redhat.com>
-
- * library/managedwin.itb (ManagedWin::_create): When
- making a modal window transient, use the source window
- as the master and not ".".
-
diff --git a/gdb/gdbtk/ChangeLog-2003 b/gdb/gdbtk/ChangeLog-2003
deleted file mode 100644
index 5a005a2aafc..00000000000
--- a/gdb/gdbtk/ChangeLog-2003
+++ /dev/null
@@ -1,431 +0,0 @@
-2003-12-17 Jeff Johnston <jjohnstn@redhat.com>
-
- * generic/gdbtk-bp.c: Change calls to decode_line_1 to add
- new NULL parameter.
- * generic/gdbtk-cmds.c: Ditto.
- * generic/gdbtk-stack.c: Ditto.
-
-2003-12-11 Jim Blandy <jimb@redhat.com>
-
- * library/prefs.tcl (pref_read): The section marker or the word
- 'option' must be the first thing on the line; they don't count if
- they appear in the middle of the line.
-
-2003-11-24 David Carlton <carlton@kealia.com>
-
- * generic/gdbtk.c (target_is_native): Replace STREQ by strcmp.
- * generic/gdbtk-cmds.c (gdb_stop): Replace STREQ by strcmp.
- (gdb_search): Replace STREQN by strncmp and DEPRECATED_SYMBOL_NAME
- by SYMBOL_LINKAGE_NAME.
- * generic/gdbtk-varobj.c (variable_format): Replace STREQN by
- strncmp.
-
-2003-11-11 David Carlton <carlton@kealia.com>
-
- * generic/gdbtk-bp.c (gdb_find_bp_at_addr): Replace use of
- BREAKPOINT->address by BREAKPOINT->loc->address.
- (gdb_get_breakpoint_info): Ditto.
-
-2003-10-06 David Carlton <carlton@kealia.com>
-
- * generic/gdbtk-register.c (get_register_size): Replace
- REGISTER_RAW_SIZE by DEPRECATED_REGISTER_RAW_SIZE.
- (get_register, register_changed_p): Ditto.
-
-2003-09-30 David Carlton <carlton@kealia.com>
-
- * generic/gdbtk-register.c (get_register): Replace
- REGISTER_VIRTUAL_SIZE by
- DEPRECATED_REGISTER_VIRTUAL_SIZE.
-
-2003-09-08 Andrew Cagney <cagney@redhat.com>
-
- * generic/gdbtk-cmds.c: Include "disasm.h".
- (gdbtk_load_asm): Use "gdb_print_insn" instead of
- TARGET_PRINT_INSN .
- (gdb_disassemble_driver): Delete code referencing
- "deprecated_tm_print_insn_info". Delete "di" and "di_initialized"
- and any code initializing those variables. Pass NULL as "di"
- parameter to "print_asm_fn".
- (disassemble_from_exec): Mention that it is unused.
-
-2003-08-05 Andrew Cagney <cagney@redhat.com>
-
- * generic/gdbtk-register.c (gdb_reggrouplist): Update, use
- reggroup_next.
- (gdb_reggroup): Ditto.
-
-2003-08-04 David Carlton <carlton@kealia.com>
-
- * generic/gdbtk.c (gdbtk_source_start_file): Add "%s" first
- argument to error call.
- (tk_command): Ditto.
- (view_command): Ditto.
-
-2003-07-29 Martin Hunt <hunt@redhat.com>
-
- * library/prefs.tcl (pref_set_option_db): On Windows, fix
- highlighting of buttons. On Unix, fix highlighting of
- menus.
-
-2003-07-10 Martin Hunt <hunt@redhat.com>
-
- * library/prefs.tcl (pref_set_option_db): Only set
- activeBackground for Unix.
-
-2003-07-02 Martin Hunt <hunt@redhat.com>
-
- * library/prefs.tcl (pref_set_option_db): Only
- set checkbutton select color for Unix. Fixes Windows
- checkbutton problem.
-
-2003-06-26 Keith R Seitz <keiths@redhat.com>
-
- From Roland Schwingel <Roland.Schwingel@onevision.de>:
- * generic/gdbtk-cmds.c (gdb_find_file_command): If filename
- is already an absolute filename, try stat'ing it before searching
- symtabs.
-
-2003-06-13 Martin Hunt <hunt@redhat.com>
-
- * library/prefs.tcl (load_gnome_file): Fix parsing
- of gtk theme files so Red Hat 9 (and others) GNOME colors
- are correct.
-
-2003-06-11 David Carlton <carlton@bactrian.org>
-
- * generic/gdbtk-stack.c: Include dictionary.h.
- (gdb_block_vars): Update use of ALL_BLOCK_SYMBOLS.
- (gdb_get_blocks, gdb_get_vars_command): Ditto.
- * generic/gdbtk-cmds.c: Include dictionary.h.
- (gdb_listfuncs): Update use of ALL_BLOCK_SYMBOLS.
-
-2003-06-11 David Carlton <carlton@bactrian.org>
-
- * generic/gdbtk-register.c (get_register): REGISTER_CONVERTIBLE
- and REGISTER_CONVERT_TO_VIRTUAL are deprecated.
-
-2003-05-12 Elena Zannoni <ezannoni@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_search): Replace namespace_enum
- with domain_emum, and *_NAMESPACE with *_DOMAIN.
-
-2003-05-08 Andrew Cagney <cagney@redhat.com>
-
- * generic/gdbtk-register.c (get_register): Replace
- MAX_REGISTER_VIRTUAL_SIZE and MAX_REGISTER_RAW_SIZE with
- MAX_REGISTER_SIZE.
- (register_changed_p, setup_architecture_data): Ditto.
-
-2003-04-30 Andrew Cagney <cagney@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_disassemble_driver): Instead of
- TARGET_PRINT_INSN_INFO, "dis_asm_memory_error",
- "dis_asm_read_memory", and "dis_asm_print_address", use
- "deprecated_tm_print_insn_info"
-
-2003-04-11 Andrew Cagney <cagney@redhat.com>
-
- * generic/gdbtk-stack.c (get_frame_name): Use get_frame_pc and
- get_next_frame.
-
-2003-03-18 Keith Seitz <keiths@redhat.com>
-
- From Nick Kelsey <nickk@ubicom.com>:
- * process.itb (build_win): Removed ide_sizebox instantiation that is
- no longer required and is causing errors for win hosts.
- * tdump.tcl (build_win): Ditto.
- * locals.tcl (build_win): Removed ide_sizebox instantiation that is
- no longer required and already commented out.
- * regwin.itb (build_win): Ditto.
- * srcwin.itb (constructor): Ditto.
- * stackwin.itb (constructor): Ditto.
- * watch.tcl (constructor): Ditto.
-
-2003-03-24 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-register.c (get_register_types): Use
- register_type instead of REGISTER_VIRTUAL_TYPE.
- (get_register): Ditto.
-
-2003-03-17 Keith R Seitz <keiths@redhat.com>
-
- * generic/gdbtk-register.c (get_register): Use frame_register
- instead of get_saved_register (which was deleted from gdb).
-
-2003-03-06 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-interp.c (gdbtk_interpreter_init): Remove
- unused variable.
-
- * generic/gdbtk-cmds.c (gdb_update_mem): Remove unused variable.
- (gdbtk_print_source): Deleted.
- (gdbtk_print_asm): Deleted.
-
-2003-03-06 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-bp.c (gdb_get_tracepoint_info): Return CORE_ADDR.
-
-2003-03-06 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_disassemble): Deleted.
- (sprintf_append_element_to_obj): Deleted.
-
- * generic/gdbtk-bp.c (get_breakpoint_commands): Use
- Tcl_ListObjAppendElement() instead of
- sprintf_append_element_to_obj().
-
-2003-03-05 Martin M. Hunt <hunt@redhat.com>
-
- * library/srctextwin.itb (SrcTextWin::FillAssembly):
- Remove unused variables asm_lo_addr and asm_hi_addr.
- (FillMixed): Ditto.
-
-2003-03-05 Martin M. Hunt <hunt@redhat.com>
-
- * generic/gdbtk-cmds.c (Gdbtk_Init): Create gdb_CA_to_TAS.
- (gdb_load_disassembly): Now takes CORE_ADDRs. Returns CORE_ADDRs
- for low and high.
- (gdbtk_load_asm): Use CORE_ADDRs.
- (gdb_loc): Return CORE_ADDRs.
- (gdb_entry_point): Return CORE_ADDR.
- (gdb_incr_addr): Update description.
- (gdb_CA_to_TAS): New function. Takes a CORE_ADDR and returns
- a target sddress string.
-
- * generic/gdbtk-bp.c (gdb_find_bp_at_addr): Change to
- take a CORE_ADDR.
- (gdb_get_breakpoint_info): Returns a CORE_ADDR.
- (gdb_set_bp_addr): Takes a CORE_ADDR.
-
- * library/bpwin.itb (bp_add): Call gdb_CA_to_TAS before
- displaying address.
- (bp_modify): Ditto.
-
- * library/srcwin.itb (location): Call gdb_CA_to_TAS before
- displaying address. Don't add "0x" in front of address.
- (set_execution_status): Call gdb_CA_to_TAS before
- displaying address. Don't call [gdb_cmd printf] to format
- output. Weird.
-
-2003-02-25 David Carlton <carlton@math.stanford.edu>
-
- * generic/gdbtk.h: Replace all instances of SYMBOL_NAME by
- DEPRECATED_SYMBOL_NAME.
- * generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Ditto.
- * generic/gdbtk-stack.c, generic/gdbtk-cmds.c: Update copyright.
-
-2003-02-21 Tom Tromey <tromey@redhat.com>
-
- * generic/gdbtk-interp.c (gdbtk_interpreter_init): Declare locals
- before code.
-
-2003-02-21 Daniel Jacobowitz <drow@mvista.com>
-
- * generic/gdbtk-stack.c (gdb_get_blocks, gdb_block_vars)
- (gdb_get_vars_command): Handle LOC_COMPUTED and LOC_COMPUTED_ARG.
-
-2003-02-20 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_search): Change SYMBOL_SOURCE_NAME
- to SYMBOL_PRINT_NAME to track recent changes in gdb.
-
-2003-02-20 Pierre Muller <muller@ics.u-strasbg.fr>
-
- * generic/gdbtk-cmds.c: Add missing "block.h" include.
- generic/gdbtk-stack.c: Ditto.
- generic/gdbtk-wrapper.c: Ditto.
-
-2003-02-18 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-main.c (main): Change name of intepreter to "insight".
- * generic/gdbtk.h: Add ifdef wrappers.
- (gdbtk_init): Declare.
- (gdbtk_source_start_file): Declare.
- * generic/gdbtk.c (gdbtk_init): Export.
- Reomve init_ui_hook stuff.
- Do not add hooks here anymore (moved into interps).
- Do not muck with gdbk_stdout et al (moved into interps).
- (gdbtk_source_start_file): Code ripped out of gdbtk_init
- which deals with sourcing the main startup file.
- (gdbtk_init_1): Hack: New function.
- (argv0): Hack: New static global.
- (tk_init): Moved to gdbtk-interps.c.
- (gdbtk_resume): Likewise.
- (gdbtk_suspend): Likewise.
- (gdbtk_prompt_p): Likewise.
- (gdbtk_exec): Likewise.
- (gdbtk_command_loop): Likewise.
- (_initialize_gdbtk): Move interpreter stuff to gdbtk-interps.c.
- Hack: Add new init_ui_hook.
- * generic/gdbtk-interps.c: New file.
-
-2003-02-17 Christopher Faylor <cgf@redhat.com>
-
- Revert below change.
-
-2003-02-17 Christopher Faylor <cgf@redhat.com>
-
- * gdbtk/gdbtk.c (tk_procs): Make file global. Declare at top.
- (_initialize_gdbtk): Move interp_add from here.
- (gdb_tk): Call interp_add here. Pass correct uiout to interp_new.
-
-2003-02-14 Keith Seitz <keiths@redhat.com>
-
- From Chris Faylor <cgf@redhat.com>:
- * generic/gdbtk-main.c (main): Initialize args.interpreter_p.
-
-2003-02-14 Martin M. Hunt <hunt@redhat.com>
-
- * library/globalpref.itb (GlobalPref::_change_icons): Fix
- curselection call for combobox.
-
-2003-02-12 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-hooks.c (tk_command_loop): Move function ...
- * generic/gdbtk.c (gdbtk_command_loop): ... to here. Add data
- parameter.
-
- * generic/gdbtk.c: Include "interps.h".
- (_initialize_gdbtk): Register the "gdbtk" interpreter. Don't set
- init_ui_hook.
- (gdbtk_init): Change parameter to a void data pointer.
- (tk_init, gdbtk_resume, gdbtk_suspend): New functions.
- (gdbtk_prompt_p, gdbtk_exec): New functions.
-
- * generic/gdbtk-hooks.c (gdbtk_add_hooks): Don't set
- command_loop_hook. Update copyright.
-
-2003-02-11 Martin M. Hunt <hunt@redhat.com>
-
- * library/help/images/browser1.png: New file.
- * library/help/images/browser2.png: New file.
-
-2003-02-11 Keith R Seitz <keiths@redhat.com>
-
- * generic/gdbtk-register.c (register_changed_p): If the selected
- frame is NULL, do not call frame_register_read, since that will
- now cause an internal error.
-
-2003-02-10 Andrew Cagney <ac131313@redhat.com>
-
- * generic/gdbtk-varobj.c (gdb_variable_command): Ditto for
- `commands'.
- (variable_type): Ditto for `first'.
- (variable_obj_command): Ditto.
- (variable_create): Ditto for create_options.
- (variable_type): Ditto for `last'. Use `string' and not `first'
- when modifying the buffer.
- (struct disassembly_client_data ): Ditto for `asm_argv'
- * generic/gdbtk-register.c (gdb_register_info): Ditto for
- `commands'.
- * generic/gdbtk-hooks.c (tk_command_loop): Ditto for `msg'.
- * generic/gdbtk-cmds.c (gdb_search): Ditto for `switches'.
- (gdbtk_load_source): Ditto for `text_argv'.
- (struct disassembly_client_data ): Ditto for `source_argv'.
- (gdbtk_load_asm): Ditto for `text_argv'.
- (struct disassembly_client_data ): Ditto for `asm_argv'
- (gdb_loadfile): Ditto for `text_argv'.
- * generic/gdbtk.c (TclDebug): Make `v' a constant pointer.
- (gdbtk_init): Ditto for `old_chain', `src_path', `msg', and
- `lib_path'.
-
-2003-02-10 Martin M. Hunt <hunt@redhat.com>
-
- * library/browserwin.itb: Set textbackground option to
- $::Colors(textbg) instead of "white".
-
-2003-02-10 Martin M. Hunt <hunt@redhat.com>
-
- * library/interface.tcl (gdbtk_attach_native): Don't force the user
- to choose an exec file when attaching.
-
- * library/attachdlg.itb: Some fixes to work with latest iwidgets.
-
-2003-02-10 Martin M. Hunt <hunt@redhat.com>
-
- * library/prefs.tcl (pref_set_defaults): Remove prefs
- gdb/browser/width, gdb/browser/top_height, gdb/browser/view_height,
- gdb/browser/view_is_open. Add gdb/browser/layout.
-
- * library/browserwin.ith: Update declarations to match
- changes in browserwin.itb.
-
- * library/browserwin.itb (constructor): Don't set toplevel
- bindings. Set _layout from prefs.
- (destructor): Don't check $resize_after. Don't save view_is_open.
- (_build_win): Create a popup menu and bind to button 3.
- Split the rest into 4 functions; _build_file_frame,
- _build_filter_frame, _build_function_frame, and _build_view_frame.
- Pack these 4 frames according to $_layout.
- (_toggle_more): Deleted.
- (_bind_toplevel): Deleted.
- (_do_resize): Deleted.
- (_resize): Deleted.
- (_fill_source): Always fill because source is always visible.
- (_fill_funcs_combo): Limit width of combo to 40 chars.
- (_build_filter_frame): New function.
- (_build_file_frame): New function.
- (_build_function_frame): New function.
- (_build_view_frame): New function.
- (_switch_layout): New function. Toggle between layouts.
-
- * library/tclIndex: Rebuilt.
-
- * library/help/browser.html: Rewrite.
-
-2003-02-03 Martin M. Hunt <hunt@redhat.com>
-
- * library/targetselection.itb (TargetSelection::build_win): Remove
- duplicate label.
-
-2003-02-03 Martin M. Hunt <hunt@redhat.com>
-
- * library/globalpref.itb, library/mempref.itb, library/srcpref.itb,
- library/srcwin.itb, library/targetselection.itb, library/tracedlg.tcl:
- Set background color of comboboxes to Colors(textbg).
-
- * library/main.tcl: Load combobox version 2.2.
-
- * library/prefs.tcl: Minor optimization. Change order of main_names
- to have the most common, "main", first.
-
-2003-02-03 Martin M. Hunt <hunt@redhat.com>
-
- * library/targetselection.itb (TargetSelection::port_list): Keep
- checking ports on Windows until we can open no more. Replaces
- fixed limit of 9.
-
-2003-02-03 Martin M. Hunt <hunt@redhat.com>
-
- * library/session.tcl (_recreate_bps): Catch errors.
-
-2003-02-03 Martin M. Hunt <hunt@redhat.com>
-
- * library/interface.tcl (gdbtk_locate_main): Rewrite for efficiency.
- No longer uses gdb_search. Caches result.
- (initialize_gdbtk): Initialize gdb_locate_main cache.
- * library/main.tcl: Call initialize_gdbtk after loading prefs.
-
-2003-01-21 Martin M. Hunt <hunt@redhat.com>
- * library/main.tcl: Don't require iwidgets 3.0.
-
- * library/console.itb (Console::_build_win): Rename
- tkTextClosestGap to tk::TextClosestGap. Rename tkCancelRepeat
- to tk::CancelRepeat. Rename tkPriv to tk::Priv. Needed for tk 8.4.1.
-
- * library/bpwin.itb (BpWin::build_win): Don't
- create sizebox.
- * library/locals.tcl (build_win): Ditto.
- * library/regwin.itb (RegWin::_build_win): Ditto.
- * library/srcwin.itb (SrcWin::constructor): Ditto.
- * library/stackwin.itb (StackWin::build_win): Ditto.
- * library/watch.tcl (build_win): Ditto.
-
- * generic/gdbtk.c (gdbtk_init): Look for iwidgets in
- "iwidgets" instead of "iwidgets3.0.0".
- Don't call ide_create_sizebox_command.
-
- * ChangeLog: New log for 2003.
- * ChangeLog-2002: Renamed from ChangeLog.
-
diff --git a/gdb/gdbtk/ChangeLog-2004 b/gdb/gdbtk/ChangeLog-2004
deleted file mode 100644
index 07201506650..00000000000
--- a/gdb/gdbtk/ChangeLog-2004
+++ /dev/null
@@ -1,209 +0,0 @@
-2004-12-13 Ben Elliston <bje@au.ibm.com>
-
- Remove some warnings:
- * generic/gdbtk-hooks.c (gdbtk_pre_add_symbol): Cast `name'.
- * generic/gdbtk-cmds.c (gdbtk_dis_asm_read_memory): Remove.
-
-2004-12-08 Keith Seitz <kseitz@sources.redhat.com>
-
- * library/download.ith (completed_steps): New variable.
- * library/download.itb (Download::constructor): Remove
- "-fraction" option from iwidgets feedback widget. It's not a valid
- option!
- (update_download): Compute the step number and use that to
- update the feedback widget.
- (done): Use completed_steps to figure out how many steps
- the dumb feedback meter needs to show full.
- (download_it): Initialize completed_steps.
-
-2004-11-18 Keith Seitz <kseitz@sources.redhat.com>
-
- * generic/gdbtk-wrapper.c (wrap_type_print): Use value_type instead
- of VALUE_TYPE.
- * generic/gdbtk-cmds.c (gdb_eval): Likewise.
-
-2004-10-31 David Lecomber <dsl@sources.redhat.com>
- * generic/gdbtk-register.c: Add message parameter
- to call of get_selected_frame.
-
-2004-08-27 Martin Hunt <hunt@redhat.com>
-
- * library/ipc.tcl: New file.
- * library/ipcpref.ith: New file.
- * library/ipcpref.itb: New file.
-
- * library/srcwin.itb (SrcWin::inferior): Call ipc
- send if enabled.
-
- * library/prefs.tcl (pref_set_defaults): Enable color
- schemes by default. Add IPC defaults.
-
- * library/srcbar.itcl (create_pref_menu): Create
- "Advanced" cascade menu and put "Edit Color Schemes"
- and "IPC Support" under it.
-
- * library/managedwin.itb (ManagedWin::destructor):
- If IPC enabled then send "quit" on exit.
-
- * library/main.tcl: Start IPC if enabled.
-
- * library/prefs.tcl (pref_set_defaults): Add IPC defaults.
-
- * library/gdbmenubar.itcl (menubar_get_current_menu):
- New method.
-
-2004-08-09 Ben Elliston <bje@au.ibm.com>
-
- * generic/gdbtk-register.c (get_register_size): Use
- register_size() instead of DEPRECATED_REGISTER_RAW_SIZE.
- (get_register): Likewise.
- (register_changed_p): Likewise.
-
-2004-07-02 Martin Hunt <hunt@redhat.com>
-
- * library/targetselection.itb: Use /dev/comX for
- cygwin instead of just comX.
-
- * library/interface.tcl (gdbtk_tcl_preloop): Set baud rate.
-
-2004-07-02 Martin Hunt <hunt@redhat.com>
-
- * generic/gdbtk-cmds.c (symtab_to_filename): New function. Like
- symtab_to_fullname() but returns the filename if the fullname
- cannot be found.
-
- * generic/gdbtk-cmds.c (gdb_find_file_command): Revert
- patch of 2004-06-11. Use symtab_to_filename() again.
- (gdb_loc): Ditto.
- (gdb_loadfile): Ditto.
- * generic/gdbtk-bp.c (gdb_get_breakpoint_info): Ditto.
- (gdb_get_tracepoint_info): Ditto.
-
- * generic/gdbtk-cmds.h: Declare symtab_to_filename().
-
-2004-06-26 Andrew Cagney <cagney@gnu.org>
-
- * generic/gdbtk-hooks.c (gdbtk_add_hooks): Call
- deprecated_set_gdb_event_hooks.
-
-2004-06-25 Andrew Cagney <cagney@gnu.org>
-
- * generic/gdbtk.h: "ui_loop_hook" was deprecated, update.
- * generic/gdbtk-hooks.c (gdbtk_add_hooks, x_event): Ditto.
- * generic/gdbtk-cmds.c: Ditto.
-
-2004-06-24 Andrew Cagney <cagney@gnu.org>
-
- * generic/gdbtk-hooks.c (gdbtk_add_hooks): Update references to
- pre_add_symbol_hook and post_add_symbol_hook, both deprecated.
- * library/interface.tcl (gdbtk_memory_changed): Update comments.
-
-2004-06-24 Andrew Cagney <cagney@gnu.org>
-
- * generic/gdbtk-hooks.c (ui_loop_hook, pre_add_symbol_hook)
- (post_add_symbol_hook, selected_frame_level_changed_hook): Delete
- extern declarations.
-
-2004-06-15 Alan Modra <amodra@bigpond.net.au>
-
- * generic/gdbtk-cmds.c (gdb_load_info): Use bfd_get_section_size
- instead of bfd_get_section_size_before_reloc.
-
-2004-06-11 Martin Hunt <hunt@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_find_file_command): Use
- symtab_to_fullname() instead of symtab_to_filename().
- (gdb_loc): Ditto.
- (gdb_loadfile): Ditto.
- * generic/gdbtk-bp.c (gdb_get_breakpoint_info): Ditto.
- (gdb_get_tracepoint_info): Ditto.
-
- * generic/gdbtk-register.c (get_register): Simplify and remove
- references to DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL.
-
-2004-05-27 Martin Hunt <hunt@redhat.com>
-
- * library/tdump.tcl (build_win): Remove old nonworking
- code to select scrolledtext mode. Just use "dynamic".
-
-2004-04-22 Keith Seitz <kseitz@sources.redhat.com>
-
- * generic/gdbtk-hooks.c (gdbtk_add_hooks): "Update" deprecated hooks.
- "Houston... We have a problem."
- * generic/gdbtk-interp.c (gdbtk_interpreter_resume): Likewise.
- * generic/gdbtk.c (gdbtk_init_1): Likewise.
-
-2004-04-19 Roland McGrath <roland@redhat.com>
-
- * generic/gdbtk-hooks.c: Update gdbtk_pre_add_symbol forward decl to
- match defn type change.
-
-2004-04-15 Roland McGrath <roland@redhat.com>
-
- * generic/gdbtk-hooks.c (gdbtk_pre_add_symbol): Add const to arg type.
- (pre_add_symbol): Likewise in extern decl.
-
-2004-04-05 Martin Hunt <hunt@redhat.com>
-
- * library/session.tcl: Make hostname and portname
- session-dependent. Add gdb_bg_num (the color
- scheme number) as a per-session variable.
-
- * library/prefs.tcl (pref_read): If color schemes are in use,
- set colors based on the current scheme.
- (pref_save): Add "bg" section.
- (pref_set_defaults): Define new variable gdb/use_color_schemes
- and define 16 default background colors.
-
- * library/managedwin.itb (ManagedWin::window_name): Append
- window "instance" string to window name.
- (ManagedWin::window_instance): Set window instance string.
-
- * library/debugwin.itb: Add a reconfig method to restore
- unique black textbackground, overriding color scheme.
-
- * library/csprefs.itb:
- * library/csprefs.ith: New files. Implement color scheme
- preferences.
-
- * library/util.tcl (set_bg_colors): New function.
- (r_setcolors): New function.
-
- * library/regwin.itb (_prefs_changed): Deleted.
- (reconfig): New function. Updates tkTable color tags
- if color scheme changes.
- * library/regwin.ith: Update to reflect above changes.
-
- * library/srcbar.itcl (create_pref_menu): Add pulldown
- menus for "Edit Color Schemes..." and "Use Color Schemes".
- (reconfig): Fix up menu items for color schemes.
-
- * library/globalpref.itb (_init_var): Add
- gdb/use_color_schemes to variable list.
- (_build_win): Add a checkbutton to enable/disable
- color schemes.
-
- * library/gdbmenubar.itcl (menubar_add_cascade): Add a class
- argument so cascade menus can be managed by class too.
-
- * library/interface.tcl (gdbtk_tcl_fputs): Check for
- existence of gdbtk_state(console). Stops annoying error
- messages.
- (gdbtk_tcl_fputs_error): Ditto.
- (gdbtk_tcl_fputs_log): Ditto.
-
-2004-03-29 Martin Hunt <hunt@redhat.com>
-
- * generic/gdbtk-register.c (map_arg_registers): If a specific
- register was requested, just return it without validating it
- has a name.
- (get_register): Check DEPRECATED_REGISTER_CONVERTIBLE_P ().
-
-2004-02-17 Martin Hunt <hunt@redhat.com>
-
- * generic/gdbtk-register.c (Gdbtk_Register_Init): Replace
- calls to register_gdbarch_swap with deprecated_register_gdbarch_swap.
-
- * library/srcwin.itb: Remove an apparently redundant call
- to gdbtk_locate_main and location. This actually broke in
- situations where no source files were found.
diff --git a/gdb/gdbtk/ChangeLog-2005 b/gdb/gdbtk/ChangeLog-2005
deleted file mode 100644
index 2c70bcd635d..00000000000
--- a/gdb/gdbtk/ChangeLog-2005
+++ /dev/null
@@ -1,214 +0,0 @@
-2005-12-23 Eli Zaretskii <eliz@gnu.org>
-
- * library/attachdlg.itb:
- * library/actiondlg.tcl:
- * library/about.tcl:
- * library/ehandler.itb:
- * library/editor.tcl:
- * library/download.ith:
- * library/download.itb:
- * library/debugwin.ith:
- * library/debugwin.itb:
- * library/cspref.ith:
- * library/cspref.itb:
- * library/console.ith:
- * library/console.itb:
- * library/browserwin.ith:
- * library/browserwin.itb:
- * library/bpwin.ith:
- * library/bpwin.itb:
- * library/blockframe.ith:
- * library/managedwin.ith:
- * library/managedwin.itb:
- * library/main.tcl:
- * library/locals.tcl:
- * library/ipcpref.ith:
- * library/ipcpref.itb:
- * library/ipc.tcl:
- * library/interface.tcl:
- * library/helpviewer.tcl:
- * library/globalpref.ith:
- * library/globalpref.itb:
- * library/gdbwin.ith:
- * library/gdbtoolbar.itcl:
- * library/gdbmenubar.itcl:
- * library/gdbevent.ith:
- * library/gdbevent.itb:
- * library/embeddedwin.ith:
- * library/ehandler.ith:
- * library/srcwin.itb:
- * library/srctextwin.ith:
- * library/srctextwin.itb:
- * library/srcpref.ith:
- * library/srcpref.itb:
- * library/srcbar.itcl:
- * library/session.tcl:
- * library/regwin.ith:
- * library/regwin.itb:
- * library/process.ith:
- * library/process.itb:
- * library/prefs.tcl:
- * library/pluginwin.itcl:
- * library/modal.tcl:
- * library/memwin.ith:
- * library/memwin.itb:
- * library/mempref.ith:
- * library/mempref.itb:
- * library/watch.tcl:
- * library/watch.tcl:
- * library/warning.tcl:
- * library/vartree.ith:
- * library/vartree.itb:
- * library/util.tcl:
- * library/tracedlg.tcl:
- * library/toplevelwin.ith:
- * library/tfind_args.tcl:
- * library/tdump.tcl:
- * library/targetselection.ith:
- * library/targetselection.itb:
- * library/stackwin.ith:
- * library/stackwin.itb:
- * library/srcwin.ith:
- * generic/gdbtk.h:
- * generic/gdbtk.c:
- * generic/gdbtk-wrapper.h:
- * generic/gdbtk-wrapper.c:
- * generic/gdbtk-varobj.c:
- * generic/gdbtk-stack.c:
- * generic/gdbtk-register.c:
- * generic/gdbtk-main.c:
- * generic/gdbtk-interp.c:
- * generic/gdbtk-hooks.c:
- * generic/gdbtk-cmds.h:
- * generic/gdbtk-cmds.c:
- * generic/gdbtk-bp.c: Put (C) after Copyright. Update the FSF
- address.
-
-2005-11-29 Andrew Stubbs <andrew.stubbs@st.com>
-
- * library/prefs.tcl (pref_read): Read preferences file if environment
- variable INSIGHT_FORCE_READ_PREFERENCES is set (regardless of -nx).
- * README: Mention INSIGHT_FORCE_READ_PREFERENCES.
-
-2005-11-11 Keith Seitz <keiths@redhat.com>
-
- From Spencer Oliver <spencer.oliver@anglia.com>:
- * library/targetselection.itb (build_win): Only pack the xterm checkbutton
- on unix platforms.
-
-2005-09-12 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk.c (gdbtk_init): Remove all mention of Tix.
- * README: Ditto.
-
-2005-08-31 Keith Seitz <keiths@redhat.com>
-
- * library/help/target.html: Update dialog options.
- * library/targetselection.itb (help): Implement.
- (build_win): Don't disable help button.
- Only display "use tty" option on unix hosts.
-
-2005-08-31 Keith Seitz <keiths@redhat.com>
-
- * library/bpwin.itb (bp_store): gdb_get_breakpoint_info outputs
- the breakpoint condition, too -- include it in the lassign.
-
-2005-08-31 Keith Seitz <keiths@redhat.com>
-
- From Dieter Ruppert <dieter_ruppert@siemens.com>:
- * library/memwin.itb (update_address): Change parameter name
- so that it does not shadow a member variable.
- Save the updated address internally.
-
-2005-06-13 Keith Seitz <keiths@redhat.com>
-
- From Charles Brockman <mr hyphen chuck at att dot net>:
- * library/interface.tcl (gdbtk_tcl_warning): Filter "RTTI symbol not found"
- "warnings", too.
-
-2005-06-06 Keith Seitz <keiths@redhat.com>
-
- * library/interface.tcl (gdbtk_tcl_fputs_error): gdbtk_state is in the global
- namespace. Fix references.
- (gdbtk_tcl_fputs_log): Likewise.
-
- From Steven Johnson <johnson@sakuraindustries.com>:
- * library/interface.tcl (gdbtk_tcl_warning): Filter some basic warnings
- from gdb - "incomplete CFI.." and "Internal error".
-
-2005-06-06 Keith Seitz <keiths@redhat.com>
-
- From Steven Johnson <sjohnson@sakraindustries.com>:
- * generic/gcbtk-cmds.c (gdb_loc): Hand gdb_loc called before remote
- target connected, where gdb_loc now returns the entry address as $pc.
-
-2005-06-01 Keith Seitz <keiths@redhat.com>
-
- From James Lemke <jim@wasabisystems.com>:
- * generic/gdbtk-hooks.c (gdbtk_fileopenin, gdbtk_read): New functions
- for target to read stdin from console window.
- * generic/gdbtk-interp.c (_stdtargin): Added.
- * generic/gdbtk.h (gdbtk_fileopenin): Add declaration.
-
-2005-05-26 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_set_mem): target_write_memory now takes
- gdb_byte* instead of char*.
- * generic/gdbtk-register.c (get_register): frame_register and val_print
- take gdb_byte* instead of char*.
- * generic/gdbtk-wrapper.c: Ditto the val_print part.
-
- From Paul Schlie <schlie@comcast.net>:
- * generic/gdbtk-bp.c (gdb_set_bp): Use lbasename instead of basename.
- * generic/gdbtk-cmds.c (gdb_listfiles): Likewise.
-
-2005-04-28 Ben Elliston <bje@au.ibm.com>
-
- * generic/gdbtk-interp.c (gdbtk_interpreter_exec): Return struct
- gdb_exception due to the 2005-04-26 renaming of struct exception.
- * generic/gdbtk.c (gdbtk_source_start_file): Likewise.
-
-2005-02-25 Keith Seitz <kseitz@sources.redhat.com>
-
- * generic/gdbtk.c (gdbtk_source_start_file): In the _WIN32 case,
- use throw_exception (struct exception).
-
-2005-02-16 Martin Hunt <hunt@redhat.com>
-
- * generic/gdbtk-stack.c (get_frame_name): Replace
- print_address_numeric with deprecated_print_address_numeric.
- * generic/gdbtk-cmds.c (gdbtk_load_asm): Ditto.
-
-2005-02-07 Keith Seitz <kseitz@sources.redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_eval): VALUE_EMBEDDED_OFFSET and
- VALUE_CONTENTS are now functions.
-
-
-2005-01-19 Keith Seitz <kseitz@sources.redhat.com>
-
- * Makefile.in: Regenerate.
- * aclocal.m4: Regenerate.
- * plugins/Makefile.in; Regenerate.
- * plugins/aclocal.m4: Regenerate.
-
-2005-01-17 Keith Seitz <kseitz@sources.redhat.com>
-
- * generic/gdbtk-varobj.c (variable_value): Remove all instances
- of error_last_message. It's gone.
-
- * generic/gdbtk-wrapper.c: Include exceptions.h
- * generic/gdbtk-cmds.c: Likewise.
- * generic/gdbtk-interp.c: Likewise.
- (gdbtk_interpreter_exec): Change return type to struct
- exception. Return exception_none.
-
-2005-01-13 Keith Seitz <keiths@redhat.com>
-
- * configure.in: Rename to ...
- * configure.ac: ... this.
- * configure: Regenerate with autoconf 2.59.
- * plugins/configure.in: Rename to ...
- * plugins/configure.ac: ... this.
- * pluginx/configure: Regenerate with autoconf 2.59.
-
diff --git a/gdb/gdbtk/ChangeLog-2006 b/gdb/gdbtk/ChangeLog-2006
deleted file mode 100644
index eeecaff2bf2..00000000000
--- a/gdb/gdbtk/ChangeLog-2006
+++ /dev/null
@@ -1,98 +0,0 @@
-2006-11-30 Keith Seitz <keiths@redhat.com>
-
- insight/293:
- * library/watch.tcl (no_inferior): Remove all varobjs and
- clear the display.
- (clear_file): Call no_inferior. Update comments.
- * library/locals.tcl: Remove unused variables "Running"
- and "Variables". Changed throughout.
- (no_inferior): Delete the current frame and clear the display.
- (clear_file): Call no_inferior. Update comments.
- (context_switch): To delete an Itcl object, one uses
- "delete object" not "destroy".
-
-2006-11-30 Keith Seitz <keiths@redhat.com>
-
- insight/299:
- * generic/gdbtk.c (gdbtk_init): Don't check if DISPLAY is set,
- it isn't needed anymore. Gdb will not abort, and Tk_Init will
- fail gracefully.
-
-2006-11-30 Keith Seitz <keiths@redhat.com>
-
- * library/targetselection.itb (constructor): "top" is unused.
- Remove it.
- (get_target_list): Use "scan" to parse "help target" output.
-
-2006-11-09 Keith Seitz <keiths@redhat.com>
-
- * help/trace/locals.html: Remove all references to gdb.ini. Even
- Cygwin now uses .gdbinit.
- * help/trace/watch.html: Likewise.
-
-2006-09-28 Keith Seitz <keiths@redhat.com>
-
- * aclocal.m4: Regenerate.
- * configure: Regenerate.
- * Makefile.in: Regenerate.
-
-2006-09-19 Keith Seitz <keiths@redhat.com>
-
- From Andrew Stubbs <andrew.stubbs@st.com>:
- * library/prefs.tcl (pref_save): Save preferences if
- INSIGHT_FORCE_READ_PREFERENCES is set in the environment.
-
-2006-09-14 Keith Seitz <keiths@redhat.com>
-
- * README: Update startup info and add DISPLAY environment
- variable.
-
-2006-08-25 Maciej W. Rozycki <macro@mips.com>
-
- * generic/gdbtk-cmds.c (gdb_update_mem): Use target_read.
-
-2006-08-25 Keith Seitz <keiths@redhat.com>
-
- * library/prefs.tcl (pref_set_defaults): Disable IPC, gdb/ipc/enabled,
- by default.
-
-2006-06-26 Keith Seitz <keiths@redhat.com>
-
- * library/srcwin.itb (_build_win): Add invisible frame to workaround
- the missing frame problem.
-
-2006-03-29 Brian Dessent <brian@dessent.net>
-
- * generic/gdbtk-cmds.c: Include sys/cygwin.h if __CYGWIN__ defined.
- (gdb_path_conv): Call cygwin_conv_to_full_win32_path instead.
-
-2006-01-23 Keith Seitz <keiths@redhat.com>
-
- From Andrew Stubbs <andrew.stubbs@st.com>:
- * library/help/source.html: Add entries for the missing menu commands.
-
-2006-01-23 Keith Seitz <keiths@redhat.com>
-
- From Andrew Stubbs <andrew.stubbs@st.com>:
- * library/mempref.itb (MemPref::constructor): Allow the Byte Per Row
- combo box to accept arbitrary values.
- (MemPref::set_bytes_per_row): Validate the new value; reject invalid
- entries and round up to a multiple of the word size.
- (MemPref::apply): Read the value from the text box even if the user
- has not pressed return.
- (MemPref::enable_format): Ensure the bytes per row value is still valid.
- (MemPref::disable_format): Likewise.
- * library/mempref.ith (MemPref): Add $gbprlist.
- * library/help/memory.html: Update.
-
-2006-01-23 Keith Seitz <keiths@redhat.com>
-
- From Andrew Stubbs <andrew.stubbs@st.com>:
- * library/helpviewer.tcl (open_help): Add firefox and opera to the
- browser list used to display help.
-
-2006-01-23 Keith Seitz <keiths@redhat.comt>
-
- * ChangeLog: Cleared and saved to ...
- * ChagneLog-2005: ... here.
-
diff --git a/gdb/gdbtk/ChangeLog-2007 b/gdb/gdbtk/ChangeLog-2007
deleted file mode 100644
index 2dc85bf04e1..00000000000
--- a/gdb/gdbtk/ChangeLog-2007
+++ /dev/null
@@ -1,60 +0,0 @@
-2007-07-02 Markus Deuling <deuling@de.ibm.com>
-
- * gdbtk/generic/gdbtk-stack.c (get_frame_name): Remove dead code
- (PC_LOAD_SEGMENT).
-
-2007-06-27 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-register.c (Gdbtk_Register_Init): Remove
- calls to deprecated_register_gdbarch_swap.
- Add "gdb_reg_arch_changed" command.
- * library/regwin.itb (arch_changed): Call gdb_reg_arch_changed.
-
-2007-06-21 Maciej W. Rozycki <macro@mips.com>
-
- * generic/gdbtk-cmds.c (gdbtk_load_asm): Update the call to
- gdb_print_insn().
-
-2007-06-09 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-register.c get_register): Replace REGISTER_NAME
- with gdbarch_register_name.
- (get_register_name): Ditto.
- (map_arg_registers): Ditto.
-
-2007-06-04 Keith Seitz <keiths@redhat.com>
-
- * generic/gdbtk-cmds.c (hex2bin): Use gdbarch_byte_order instead
- of TARGET_BYTE_ORDER.
- * generic/gdbtk-register.c (get_register): Likewise.
- (map_arg_registers): Use gdbarch_num_regs and gdbarch_num_pseduo_regs
- instead of NUM_REGS and NUM_PSEUDO_REGS.
- (setup_architecture_data): Likewise.
- (gdb_regformat): Likewise.
- (gdb_reggroup): Likewise.
-
-2007-05-22 Chris Dearman <chris@mips.com>
-
- * generic/gdbtk-stack.c (get_frame_name): Remove spurious
- newlines from dummy/sigtramp frame names.
-
-2007-04-27 Maciej W. Rozycki <macro@mips.com>
-
- * generic/gdbtk-wrapper.c (GDB_varobj_update): New function.
- (wrap_varobj_update): Likewise.
- * generic/gdbtk-wrapper.h (GDB_varobj_update): New declaration.
- * generic/gdbtk-varobj.c (variable_update): Call
- GDB_varobj_update() rather than varobj_update() directly. Take
- the new semantics of the latter into account.
- * generic/gdbtk-cmds.c: Include "varobj.h".
- * generic/gdbtk-stack.c: Likewise.
-
-2007-03-13 Kevin Buettner <kevinb@redhat.com>
-
- * generic/gdbtk-cmds.c (gdb_loc): Eliminate use of
- `deprecated_selected_frame'.
- * generic/gdbtk-register.c (register_changed_p): Likewise.
- * generic/gdbtk-stack.c (gdb_block_vars, gdb_get_blocks)
- (gdb_get_vars_command, gdb_selected_block, gdb_selected_frame):
- Likewise.
-
diff --git a/gdb/gdbtk/Makefile.am b/gdb/gdbtk/Makefile.am
deleted file mode 100644
index 530ab66e228..00000000000
--- a/gdb/gdbtk/Makefile.am
+++ /dev/null
@@ -1,4 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = cygnus
-SUBDIRS = plugins
diff --git a/gdb/gdbtk/Makefile.in b/gdb/gdbtk/Makefile.in
deleted file mode 100644
index ca878e03829..00000000000
--- a/gdb/gdbtk/Makefile.in
+++ /dev/null
@@ -1,410 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 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.
-
-@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-DIST_COMMON = $(srcdir)/../../config.guess $(srcdir)/../../config.sub \
- README ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/../../mkinstalldirs
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
-CONFIG_CLEAN_FILES =
-depcomp =
-am__depfiles_maybe =
-SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EXEEXT = @EXEEXT@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-subdirs = @subdirs@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-AUTOMAKE_OPTIONS = cygnus
-SUBDIRS = plugins
-all: all-recursive
-
-.SUFFIXES:
-am--refresh:
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
- cd $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-uninstall-info-am:
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-am:
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
- check-am clean clean-generic clean-recursive ctags \
- ctags-recursive distclean distclean-generic \
- distclean-recursive distclean-tags dvi dvi-am html html-am \
- info info-am install install-am install-data install-data-am \
- install-exec install-exec-am install-info install-info-am \
- install-man install-strip installcheck installcheck-am \
- installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic maintainer-clean-recursive \
- mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
- pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
- uninstall-info-am
-
-# 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:
diff --git a/gdb/gdbtk/README b/gdb/gdbtk/README
deleted file mode 100644
index bd0c71a6d2f..00000000000
--- a/gdb/gdbtk/README
+++ /dev/null
@@ -1,289 +0,0 @@
- README
- Written by Stu Grossman
- Updated 9/26/95 by Fred Fish for gdb 4.15 release
- Updated 4/18/97 by Martin Hunt
- Updated 8/15/02 by Keith Seitz
-
-This file describes how to build, install, use and hack on Insight (formerly
-GDBtk), a TK-based GUI for GDB, the GNU debugger.
-
-Introduction
-============
-
-Insight is a version of GDB that uses Tcl/Tk to implement a graphical
-user inter-face. It is a fully integrated GUI, not a separate
-front-end program. The interface consists of several separate
-windows, which use standard elements like buttons, scrollbars, entry
-boxes and such to create a fairly easy to use interface. Each window
-has a distinct content and purpose, and can be enabled or disabled
-individually. The windows contain things like the current source
-file, a disassembly of the current function, text commands (for things
-that aren't accessible via a button), and so forth.
-
-Building and Installing
-=======================
-
-Building Insight is very straightforward. It is configured/built by
-default when you checkout or download Insight. Right now, Insight MUST
-be built using the versions of Tcl, Tk, and Itcl that come with
-the sources. We're working to fix that, but it is going to take a lot
-of time. (Want to help?)
-
-On Unix machines, you will also need to have X11 (R4/R5/R6) installed
-(this is a prerequisite to installing Tk).
-
-Insight inherits much of GDB's configuration options (like where it is
-to be installed). See the GDB README file for more details on configure
-options and such for GDB.
-
-It is recommended that Insight, like GDB, be built outside of the source
-directory in order to preserve the integrity of the source directory. This
-is very useful, for example, when building GDB/Insight for multiple hosts
-or targets.
-
-For example:
-
- host> ls
- src/
- host> mkdir insight; cd insight
- host> ../src/configure
- host> make
- host> make install
-
-Environment Variables
-=====================
-
-Insight and all of its support infrastructure read various environment variables
-for optional startup information. All of these environment variables are
-optional: Insight and its packages know how to find their files in both the
-install and the source trees.
-
- Name Description
- ---- -----------
- TCL_LIBRARY The location of the Tcl library files
- TK_LIBRARY The location of the Tk library files
- REDHAT_GUI_LIBRARY The location of the libgui library files
- GDBTK_LIBRARY The location of the Insight library files
- INSIGHT_PLUGINS A colon-separated list of directories
- to search for plugins (see gdb/gdbtk/plugins/HOW-TO)
- GDBTK_DEBUG Controls runtime loading of the Debug Window.
- (This is the most useful debug option.)
- GDBTK_TRACE Controls runtime tracing of the tcl code
- GDBTK_DEBUGFILE Filename to send debug output
- GDBTK_TEST_RUNNING Testsuite variable. See gdb/testsuite/gdb.gdbtk/README
- for more information.
- INSIGHT_FORCE_READ_PREFERENCES
- If set, read .gdbtkinit (or gdb.ini on windows)
- even when -nx is passed to GDB.
- DISPLAY The display to use on unix/X platforms.
- Not used on Windows platforms.
-
-All of the environment variables for controlling Insight are well documented
-in gdb/gdbtk/library/main.tcl. Search for "env" to find them all.
-
-Using Insight
-=============
-
-You can start Insight by running the `insight' executable (for cross-platform
-targets, include the build triple, i.e., `powerpc-elf-insight'). Alternatively start
-Insight by telling GDB to start it with `gdb -w' or `gdb -i=insight'. If
-everything goes well, you should have several windows pop up. To get going,
-hit the Run button, and go exploring.
-
-If you want to use GDB in command line mode, just use the -nw option or the
-console interpreter (`insight -i=console').
-
-Insight comes with all your standard debugger windows, including:
-
- o Console Window
- o Source Window
- o Register Window
- o Memory Window
- o Locals Window
- o Watch Window
- o Stack Window
- o Thread/Process Window
- o Function Browser Window
- o Debug Window (for developers)
-
-Insight also has an extensive (if outdated) online help system which describes
-all the windows and explains how to use them. Users are urged to browse this
-help system for information on using Insight.
-
-Hacking Insight
-===============
-
-The GUI is primarily implemented by Tcl/Tk code which lives in gdb/gdbtk/library
- and bunch of C files in gdb/gdbtk/generic. The Tcl/Tk code determines the look
-and feel, the layout, and the functions associated with all of the interface
-elements. The C code is mostly just glue between GDB internals and Tcl-land.
-In essence, all of the policy is implemented in Tcl/Tk, and is easily changed
-without recompiling.
-
-To make more serious changes to the interface, such as adding a new window or
-changing the framework, you will have to hack the tcl code (and probably the C
-code as well). The tcl library install directory is $(libdir) (probably
-/usr/local/lib/insight1.0). But, you will probably want to hack on your own
-private copy before putting it up for the rest of the users. To find the GDB tcl
-code, GDB first checks for the environment variable GDBTK_LIBRARY. GDB will check
-this directory for the file "main.tcl". If GDBTK_LIBRARY is not set, GDB will
-look for main.tcl in the install directory, and finally it will try to find
-the tcl directory in the sources.
-
-A word about the different files in Insight is in order. Insight is a hybrid of
-C code and "Tcl" code (actually Incr Tcl code). We use the following conventions
-for naming our tcl files (most of the time!). Any file with a ".tcl" extension
-is simply vanilla tcl code. Any file ending with ".itcl" is an Itcl file,
-class definition and implementation all in one. So far so good. Now comes the
-toughy: Files ending in ".ith" are Itcl class definition files, and they all
-must have a corresponding implementation file, ending in ".itb". Why do we do
-this? Simple. With Itcl, one can reread class implementations at runtime, but
-one cannot change the class definition. So all those ".itcl" files can only
-be reread be restarting Insight. The same is not true, though, of the ".itb"
-files. Those files can be changed and immediately reread and used in Insight
-without having to restart (as long as the class definition doesn't change). This
-is a nifty Itcl feature which is fully exploited by the Debug Window, which
-has a "ReSource" menu on it to reread the Tcl files. (To get to the Debug Window,
-hit Ctrl-Alt-F11 in the Source Window or type "tk ManagedWin::open DebugWin" in
-the Console Window.)
-
-Internally, Insight is basically GDB, linked with Tcl/Tk, some Tcl/Tk extensions,
-and some glue code that interfaces GDB internals to Tcl-land. This means that
-Insight operates as a single program, not a front-end to GDB. All GDB commands,
-and a great deal of the target program state are accessible to the Tcl programmer.
-In addition, there are many callbacks from GDB to notify Tcl-land of important
-events. Many of these are accomplished via "hooks" in GDB, and others are
-accomplished using event notifications. GDB is slowly deprecating the use of
-"hooks" in favor of its new event mechanism.
-
-All of the below commands have lots of nice comments before them explaining what
-they all do, how they are to be used, etc. The source code is the definitive
-authority (other than a maintainer) for the definition/usage of a command in
-Insight. Hackers are urged to read through the source code for any commands
-which may need explaining.
-
-New Tcl Commands:
-
-Here is a brief, if incomplete, summary of the Tcl commands that are created
-by Insight. These are installed into the Tcl interpreter in the C files.
-
- Name Description
- ---- -----------
- gdb_cmd Sends a text command to gdb. Returns the result.
- DEPRECATED: Do not use any more.
- gdb_loc Returns a list of useful tidbits about the specified
- GDB linespec
- gdb_sourcelines Returns a list of executable lines for a source file
- gdb_listfiles Returns a list of all of the source files
- gdb_stop Stops the target process (or at least tries to)
- gdb_reginfo Returns information about registers (names, numbers,
- values, size, etc.)
- gdb_disassemble Returns the text of a disassembly of the entire
- function. No longer used.
- gdb_load_disassembly Loads the disassembly of a location into a
- source window's textbox
- gdb_eval Returns the value of a given expression
- gdb_get_breakpoint_list Returns a list of all breakpoints
- gdb_get_breakpoint_info Returns a list of info about a breakpoint
-
-Tcl procedures that are hooked into GDB:
-
-This is a list, albeit incomplete, of the "hook" functions that are installed
-into GDB. The actual "hooks" are installed/initialized in
-gdb/gdbtk/generic/gdbtk-hooks.c (and maybe one or two in gdbtk.c). The list
-below is the Tcl side of the hook.
-
- Name Description
- ---- -----------
- gdb_tcl_fputs Sends output into Tcl for the command window
- gdb_tcl_query Pops up a query window
- gdbtk_tcl_breakpoint Notifies Tcl of changes to a breakpoint
- gdbtk_tcl_idle Notifies Tcl that debugged process is now idle
- gdbtk_tcl_busy Notifies Tcl that debugged process is now running
-
-Events:
-
-Starting with GDB 5.0, GDB has had an event loop. Although largely unused right
-now, with it came some useful "baggage", especially event notifications, even
-though they, too, were largely incomplete. The list of events continues to grow,
-and Insight and GDB often "share" overlapping events, but the list below is
-complete (since there are only a few defined events). The source for these
-events can be found in gdb/gdbtk/library/gdbevents.it[hb].
-
- Name Description
- ---- -----------
- BreakpointEvent A breakpoint has been created/modified/deleted
- TracepointEvent A tracepoint has been created/modified/deleted
- SetVariableEvent User has issued a "set" command in Console
- BusyEvent The debugger is "busy"
- IdleEvent The debugger is "idle"
- UpdateEvent The state of the target has changed (or the
- GDB's view of the target has changed)
- ArchChangedEvent The architecture of the system has changed
- (this can happen when GDB defaults to using
- some basic CPU and detects that a more elaborate
- CPU is actually being used, e.g., SH5)
-
-GDB Commands:
-
-Insight installs a few GDB commands, which are available with the Console Window.
-
- Name Description
- ---- -----------
- tk Executes the arguments in the Insight Tcl
- interpreter
- view Displays the given linespec in the Source Window
-
-Problems
-========
-
-During building, you may run into problems with finding Tcl, Tk or X11. Look
-in gdb/Makefile, and fix TCL_CFLAGS, TCL, TK_CFLAGS, TK, and ENABLE_CLIBS as
-appropriate.
-
-If you one of the following messages when you run gdb:
-
- Tcl_Init failed: can't find init.tcl; perhaps you need to
- install Tcl or set your TCL_LIBRARY environment variable?
-or
- Tk_Init failed: can't find tk.tcl; perhaps you need to
- install Tk or set your TK_LIBRARY environment variable?
-
-then you haven't installed Tcl or TK properly. Fix the appropriate environment
-variable to point at the {tcl tk}/library directory, and restart gdb.
-
-Known Bugs
-==========
-
-generic problems
-
- o Using the GDB commands "up"/"down"/"frame" in Console Window
- can cause GDB and Insight to get out of sync. If this happens,
- simply use the Stack Window or the frame navigation buttons on
- the Source Window's toolbar to resync the two.
-
- o Not really a problem, but it might be nice to have a frame/stack
- window that displays the last N words on the stack, along with
- indications about which function owns a particular frame, how the
- frame pointers are chained, and possibly the names of variables
- alongside their frame slots.
-
-host- or target-specific problems
-
- o Windows is hosed. Tk8.3 in sources.redhat.com is not stable
- on windows. Wanna help?
-
-Where to find help
-==================
-
-The first place to turn for help is the online help system. It may be old, but
-it is still largely correct: it explains what everything does. If that fails,
-search the mailing list archives for other users who may have had similar problems
-or questions. The archives are online at
-
-http://sources.redhat.com/insight/mailinglist.htm .
-
-If all else fails, send a note to the mailing list, insight@sources.redhat.com,
-where users and maintainers lurk. This is a very low traffic list, so don't
-be afraid to join the list. Instructions for joining are on our homepage,
-http://sources.redhat.com/insight .
diff --git a/gdb/gdbtk/TODO b/gdb/gdbtk/TODO
deleted file mode 100644
index 942febdb2ca..00000000000
--- a/gdb/gdbtk/TODO
+++ /dev/null
@@ -1,113 +0,0 @@
-If you find inaccuracies in this list, please send mail to
-insight@sources.redhat.com. If you would like to work on any
-of these, you should consider sending mail to the same address, to
-find out whether anyone else is working on it.
-
- New Features and Enhancements
- =============================
-
-Display of the target program output. Perhaps use the XTerm hack created
-by Tom.
-
---
-
-Support for inserting breakpoints at arbitrary locations, perhaps adding an
-entry widget to the breakpoints window.
-
---
-
-Support for hardware breakpoints and watchpoints (will need fixes in gdb).
-
---
-
-"Disassembly from Memory" Window. Perhaps as a pane in place of the source
-code one.
-
---
-
-Register Window capable of handling large number of registers, typed
-registers, registers organized in groups that can be shown/hidden and
-that provide for better screen organization.
-
---
-
-Per-project preferences so that one can have a preferred target settings
-for each project (and environment variable and the current directory would
-be searched for the project preference file -- global preferences would
-still come from the users's home directory).
-
---
-
-Reactivate the "Use this target?" confirmation box. Do it independently of
-the above?
-
---
-
-Add option to activate the Source Window from the signal popup box when
-the inferior program is signaled.
-
- Code Cleanups
- =============
-
-Reorganize the Source Memory code.
-
---
-
-Clean up the class hierarchy.
-
---
-
-Migrate to Tcl/Tk 8.3.2
-
---
-
-Try BLT tree as an alternative to the Tix Tree, so we can drop Tix altogether.
-
---
-
-Optional use of installed Tcl/Tk (keeping it available on the distribution)
-
---
-
-Fix the gdbtk testsuite.
-
---
-
-Enhance the test harness, perhaps migrating to the new SourceNavigator testing
-system.
-
- Architectural Improvements
- ==========================
-
-Decouple the GUI from gdb, running them as separate processes.
-
---
-
-Separate the Tcl part from the Tk part to facilitate scripting.
-
- Bug Fixes
- =========
-
-Fix process attach, specially the process listing code.
-
-Fix Source Window so that Key shortcuts work (may not be possible without
-rewritting).
-
-Fix info popup annoyances (like trying to show a large array without even
-adding line breaks and showing up over right click menus).
-
-Fix command window command line recall that misses the arguments of
-commands that autoincrement their arguments.
-
-Fix function browser window problems.
-
-Maximization of a window affects preference sizing but forgets that maximized
-state was set.
-
-Taskbar "always on top" hides funcxtion combobox.
-
---
-Fernando Nasser
-Red Hat Canada Ltd. E-Mail: fnasser@cygnus.com
-2323 Yonge Street, Suite #300
-Toronto, Ontario M4P 2C9
diff --git a/gdb/gdbtk/aclocal.m4 b/gdb/gdbtk/aclocal.m4
deleted file mode 100644
index b6186f2ab86..00000000000
--- a/gdb/gdbtk/aclocal.m4
+++ /dev/null
@@ -1,879 +0,0 @@
-# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005 Free Software Foundation, Inc.
-# This file 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.
-
-# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
- [AM_AUTOMAKE_VERSION([1.9.6])])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 7
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 8
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-#serial 3
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 12
-
-# 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.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.58])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])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
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-])
-])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $1 | $1:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
-# From Jim Meyering
-
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 4
-
-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
-]
-)
-
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 3
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 4
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-#
-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
-# created by `make install' are always world readable, even if the
-# installer happens to have an overly restrictive umask (e.g. 077).
-# This was a mistake. There are at least two reasons why we must not
-# use `-m 0755':
-# - it causes special bits like SGID to be ignored,
-# - it may be too restrictive (some setups expect 775 directories).
-#
-# Do not use -m 0755 and let people choose whatever they expect by
-# setting umask.
-#
-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
-# Some implementations (such as Solaris 8's) are not thread-safe: if a
-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
-# concurrently, both version can detect that a/ is missing, but only
-# one can create it and the other will error out. Consequently we
-# restrict ourselves to GNU make (using the --version option ensures
-# this.)
-AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-AC_SUBST([mkdir_p])])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 3
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 4
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# 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 conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $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]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
- [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
diff --git a/gdb/gdbtk/configure b/gdb/gdbtk/configure
deleted file mode 100755
index 46bcf5ef90b..00000000000
--- a/gdb/gdbtk/configure
+++ /dev/null
@@ -1,4285 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59.
-#
-# Copyright (C) 2003 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-exec 6>&1
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_config_libobj_dir=.
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete. It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_unique_file="generic/gdbtk.h"
-ac_subdirs_all="$ac_subdirs_all plugins"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE subdirs LIBOBJS LTLIBOBJS'
-ac_subst_files=''
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-ac_prev=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_option in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval "enable_$ac_feature=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_$ac_feature='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "with_$ac_package='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval "with_$ac_package=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
- eval "$ac_envvar='$ac_optarg'"
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
- { (exit 1); exit 1; }; }
- else
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
- fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
- { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
- cat <<_ACEOF
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
- headers in a nonstandard directory <include dir>
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- ac_popdir=`pwd`
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d $ac_dir || continue
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
- cd $ac_dir
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- echo
- $SHELL $ac_srcdir/configure.gnu --help=recursive
- elif test -f $ac_srcdir/configure; then
- echo
- $SHELL $ac_srcdir/configure --help=recursive
- elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
- echo
- $ac_configure --help
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
- cd $ac_popdir
- done
-fi
-
-test -n "$ac_init_help" && exit 0
-if $ac_init_version; then
- cat <<\_ACEOF
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit 0
-fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_sep=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-{
- (set) 2>&1 |
- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
- ;;
- *)
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-}
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- sed "/^$/d" confdefs.h | sort
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core &&
- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
- ' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . $cache_file;;
- *) . ./$cache_file;;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
- eval ac_new_val="\$ac_env_${ac_var}_value"
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_aux_dir=
-for ac_dir in ../.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f $ac_dir/shtool; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in ../.. $srcdir/../.." >&2;}
- { (exit 1); exit 1; }; }
-fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
-
-am__api_version="1.9"
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL=$ac_install_sh
- fi
-fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# 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 conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $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".
- { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
-Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
-Check your system clock" >&2;}
- { (exit 1); exit 1; }; }
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-test "$program_prefix" != NONE &&
- program_transform_name="s,^,$program_prefix,;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s,\$,$program_suffix,;$program_transform_name"
-# Double any \ or $. echo might interpret backslashes.
-# By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AWK+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AWK="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$AWK" && break
-done
-
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.make <<\_ACEOF
-all:
- @echo 'ac_maketemp="$(MAKE)"'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftest.make
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- SET_MAKE=
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE=insight
- VERSION=1.0
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- STRIP=$ac_ct_STRIP
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
-
-
-
-
-echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
-echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
- # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then
- enableval="$enable_maintainer_mode"
- USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
-fi;
- echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
-echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
-
-
-if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-# Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
- { (exit 1); exit 1; }; }
-
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
- ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
-build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
- ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
-host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.make <<\_ACEOF
-all:
- @echo 'ac_maketemp="$(MAKE)"'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftest.make
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- SET_MAKE=
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$ac_ct_CC" && break
-done
-
- CC=$ac_ct_CC
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
- "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
- (eval $ac_compiler --version </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
- (eval $ac_compiler -v </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
- (eval $ac_compiler -V </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
- (eval $ac_link_default) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Find the output, starting from the most likely. This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
- conftest.$ac_ext )
- # This is the source file.
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
- break;;
- * )
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std1 is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std1. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_stdc=$ac_arg
-break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
- x|xno)
- echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
- *)
- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
- CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-# Some people use a C++ compiler to compile C. Since we use `exit',
-# in C++ we need to declare it. In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
- choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- for ac_declaration in \
- '' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);'
-do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-DEPDIR="${am__leading_dot}deps"
-
- ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-
-
-echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
- enableval="$enable_dependency_tracking"
-
-fi;
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-
-depcc="$CC" am_compiler_list=
-
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-
-
-if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-
-
-
-
-
-subdirs="$subdirs plugins"
-
- ac_config_files="$ac_config_files Makefile"
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
- (set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-} |
- sed '
- t clear
- : clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
- if test -w $cache_file; then
- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
- cat confcache >$cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ ]*$//;
-}'
-fi
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
-t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
-t quote
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
-t quote
-d
-: quote
-s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output. A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
-
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-_ACEOF
-
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Configuration commands:
-$config_commands
-
-Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.59,
- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- -*)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
- esac
-
- case $ac_option in
- # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1" ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# INIT-COMMANDS section.
-#
-
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_config_target in $ac_config_targets
-do
- case "$ac_config_target" in
- # Handling of arguments.
- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@CYGPATH_W@,$CYGPATH_W,;t t
-s,@PACKAGE@,$PACKAGE,;t t
-s,@VERSION@,$VERSION,;t t
-s,@ACLOCAL@,$ACLOCAL,;t t
-s,@AUTOCONF@,$AUTOCONF,;t t
-s,@AUTOMAKE@,$AUTOMAKE,;t t
-s,@AUTOHEADER@,$AUTOHEADER,;t t
-s,@MAKEINFO@,$MAKEINFO,;t t
-s,@install_sh@,$install_sh,;t t
-s,@STRIP@,$STRIP,;t t
-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
-s,@mkdir_p@,$mkdir_p,;t t
-s,@AWK@,$AWK,;t t
-s,@SET_MAKE@,$SET_MAKE,;t t
-s,@am__leading_dot@,$am__leading_dot,;t t
-s,@AMTAR@,$AMTAR,;t t
-s,@am__tar@,$am__tar,;t t
-s,@am__untar@,$am__untar,;t t
-s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
-s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
-s,@MAINT@,$MAINT,;t t
-s,@build@,$build,;t t
-s,@build_cpu@,$build_cpu,;t t
-s,@build_vendor@,$build_vendor,;t t
-s,@build_os@,$build_os,;t t
-s,@host@,$host,;t t
-s,@host_cpu@,$host_cpu,;t t
-s,@host_vendor@,$host_vendor,;t t
-s,@host_os@,$host_os,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@DEPDIR@,$DEPDIR,;t t
-s,@am__include@,$am__include,;t t
-s,@am__quote@,$am__quote,;t t
-s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
-s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
-s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
-s,@CCDEPMODE@,$CCDEPMODE,;t t
-s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
-s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
-s,@subdirs@,$subdirs,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
- cat >>$CONFIG_STATUS <<\_ACEOF
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
- fi
-fi # test -n "$CONFIG_FILES"
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
- esac
-
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
-
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
- ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
- ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_dest" : 'X\(//\)[^/]' \| \
- X"$ac_dest" : 'X\(//\)$' \| \
- X"$ac_dest" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
- { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
- case $ac_dest in
- depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`(dirname "$mf") 2>/dev/null ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`(dirname "$file") 2>/dev/null ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p $dirpart/$fdir
- else
- as_dir=$dirpart/$fdir
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
- { (exit 1); exit 1; }; }; }
-
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
- ;;
- esac
-done
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
-#
-# CONFIG_SUBDIRS section.
-#
-if test "$no_recursion" != yes; then
-
- # Remove --cache-file and --srcdir arguments so they do not pile up.
- ac_sub_configure_args=
- ac_prev=
- for ac_arg in $ac_configure_args; do
- if test -n "$ac_prev"; then
- ac_prev=
- continue
- fi
- case $ac_arg in
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
- | --c=*)
- ;;
- --config-cache | -C)
- ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- ;;
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- ;;
- *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
- esac
- done
-
- # Always prepend --prefix to ensure using the same prefix
- # in subdir configurations.
- ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args"
-
- ac_popdir=`pwd`
- for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
-
- # Do not complain, so a configure script can configure whichever
- # parts of a large source tree are present.
- test -d $srcdir/$ac_dir || continue
-
- { echo "$as_me:$LINENO: configuring in $ac_dir" >&5
-echo "$as_me: configuring in $ac_dir" >&6;}
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
- cd $ac_dir
-
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'"
- elif test -f $ac_srcdir/configure; then
- ac_sub_configure="$SHELL '$ac_srcdir/configure'"
- elif test -f $ac_srcdir/configure.in; then
- ac_sub_configure=$ac_configure
- else
- { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5
-echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
- ac_sub_configure=
- fi
-
- # The recursion is here.
- if test -n "$ac_sub_configure"; then
- # Make the cache file name correct relative to the subdirectory.
- case $cache_file in
- [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
- *) # Relative path.
- ac_sub_cache_file=$ac_top_builddir$cache_file ;;
- esac
-
- { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
-echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
- # The eval makes quoting arguments work.
- eval $ac_sub_configure $ac_sub_configure_args \
- --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir ||
- { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5
-echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- cd $ac_popdir
- done
-fi
-
diff --git a/gdb/gdbtk/configure.ac b/gdb/gdbtk/configure.ac
deleted file mode 100644
index 5925d6b84e0..00000000000
--- a/gdb/gdbtk/configure.ac
+++ /dev/null
@@ -1,12 +0,0 @@
-AC_INIT(generic/gdbtk.h)
-AC_CONFIG_AUX_DIR(../..)
-AM_INIT_AUTOMAKE(insight, 1.0)
-AM_MAINTAINER_MODE
-AC_CANONICAL_HOST
-AC_PROG_MAKE_SET
-AC_PROG_CC
-AC_OBJEXT
-AC_EXEEXT
-
-AC_CONFIG_SUBDIRS(plugins)
-AC_OUTPUT(Makefile)
diff --git a/gdb/gdbtk/gdb.rc b/gdb/gdbtk/gdb.rc
deleted file mode 100644
index 9f7c44035a0..00000000000
--- a/gdb/gdbtk/gdb.rc
+++ /dev/null
@@ -1 +0,0 @@
-tk ICON DISCARDABLE "gdbtool.ico"
diff --git a/gdb/gdbtk/gdbtool.ico b/gdb/gdbtk/gdbtool.ico
deleted file mode 100644
index 919202c7f43..00000000000
--- a/gdb/gdbtk/gdbtool.ico
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/generic/ChangeLog-1997 b/gdb/gdbtk/generic/ChangeLog-1997
deleted file mode 100644
index 365457035b8..00000000000
--- a/gdb/gdbtk/generic/ChangeLog-1997
+++ /dev/null
@@ -1,1196 +0,0 @@
-Tue Dec 16 21:16:42 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.in (LIBGUI): New variable.
- (GUI_CFLAGS_X): New variable.
- (IDE_CFLAGS): Add $(GUI_CFLAGS_X).
- * configure.in: Add $(LIBGUI) to TCL_LIBS and CONFIG_DEPS.
- * configure: Rebuild.
-
-Wed Dec 10 13:16:45 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_get_tracepoint_info): Use info in struct
- symtab_and_line (not struct tracepoint) so that we get the
- real line info for an address. Arrange data more like
- gdb_get_breakpoint_info.
- (tracepoint_notify): Use info in struct symtab_and_line again.
- (gdbtk_init): Add command "gdb_get_tracepoint_list" into
- interpreter.
- (gdb_get_tracepoint_list): New function that aids the source
- window in displaying tracepoints when the file changes.
-
-Fri Dec 5 10:31:23 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * gdbtk.c (gdbtk_init): Add gdb_find_file into interpreter.
- (gdb_find_file_command): New function which searches source path
- to find the real full filename of a file.
-
-Mon Dec 1 10:19:44 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c: Move include of "guitcl.h" back out of IDE ifdef.
- (gdbtk_init): Move ide_initialize_paths out of IDE ifdef.
-
- * configure.in (TCL_LIBS, CONFIG_DEPS): Add IDE libraries for all
- builds.
- (CONFIG_OBS): Remove tracepoint.o, which should always be included.
-
- * configure: regenerate
-
- * Makefile.in (install-only): ALWAYS install the new gdbtk
- (REMOTE_OBS): add tracepoint.o
-
-Thu Nov 27 09:07:18 1997 Michael Meissner <meissner@cygnus.com>
-
- * configure.in ({TCL_LIBS,CONFIG_DEPS}): Don't add IDE libraries
- if not --enable-ide.
- (CONFIG_OBS): Add tracepoint.o to list if --enable-gdbtk.
- * configure: Regenerate.
-
- * gdbtk.c (gdb_get_breakpoint_info): Add missing filename
- argument.
- (toplevel): Move include of guitcl.h into #ifdef IDE region.
- (gdbtk_init): Move ide_initialize_paths call into #ifdef IDE
- section.
-
- * Makefile.in (gdbtk.o): Update dependencies.
-
-Wed Nov 26 15:02:43 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_loc): symtab_to_filename can return NULL.
- (breakpoint_notify): Ditto.
- (gdb_get_breakpoint_info): Ditto.
-
-Wed Nov 26 11:33:09 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- Merge in code from Foundry branch:
-
- * Makefile.in (install-only): install the new gdbtk, not the old
-
- * gdbtk.c (gdbtk_call_command): also run idle hooks for class_trace
- commands
- (gdbtk_init): Add new commands "gdb_get_locals", "gdb_get_args",
- "gdb_get_function", "gdb_get_line", "gdb_get_file",
- "gdb_tracepoint_exists", "gdb_get_tracepoint_info", "gdb_actions",
- and "gdb_prompt".
- (gdb_get_vars_command): New function.
- (gdb_get_line_command): New.
- (gdb_get_file_command): New.
- (gdb_get_function_command): New.
- (gdb_get_tracepoint_info): New.
- (gdbtk_create_tracepoint): New.
- (gdbtk_delete_tracepoint): New.
- (tracepoint_notify): New.
- (tracepoint_exists): New.
- (gdb_actions_command): New.
- (gdb_tracepoint_exists_command): New.
- (gdb_prompt_command): New.
-
-Thu Nov 13 18:15:54 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c: Move include of gdbcore.h to top of file.
- (close_bfds): New static function if _WIN32.
- (gdbtk_readline): Call close_bfds.
- (call_wrapper, tk_command_loop): Likewise.
- (gdb_clear_file): New static function.
- (gdbtk_init): Create gdb_clear_file Tcl command.
-
-Wed Nov 12 14:58:39 1997 Jeff Holcomb <jeffh@cygnus.com>
-
- * gdbtk.c: gdbtk_load_hash and ui_load_progress_hook return an
- int result.
- (gdbtk_load_hash): download hash routine returns an int result.
-
-Mon Nov 10 15:11:51 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Call ide_create_shell_execute_command if
- __CYGWIN32__.
- * configure.in: Add -lshell32 to WIN32LIBS on cygwin32.
- * configure: Rebuild.
-
-Sun Nov 9 16:25:34 1997 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Run ide_create_help_command.
-
-Tue Oct 28 17:31:47 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Call ide_create_winprint_command.
-
-Thu Oct 23 15:53:37 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Add -lgdi32 to WIN32LIBS when linking gdbtk on
- cygwin32.
- * configure: Rebuild.
-
-Wed Oct 22 21:32:54 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Create sizebox command on Windows.
-
-Thu Oct 9 14:33:21 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Remove assertion argument from call to
- ide_create_window_register_command.
-
-Wed Oct 1 11:09:52 1997 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Pass name of restore interface to
- ide_create_window_register_command.
-
-Fri Sep 26 21:08:22 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * gdbtk.c (gdbtk_init): Initialize ui_load_progress_hook.
-
-Thu Sep 25 03:05:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_load_info): New function. Returns a list
- of section names and sizes for an executable.
- (gdbtk_load_hash): Stub function to call tcl function
- download_hash.
-
-Tue Sep 23 01:29:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_get_mem): Fix compiler warning.
-
-Sun Sep 21 00:15:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_get_mem): Fix problem with ASCII dump.
-
-Tue Sep 16 18:07:17 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_get_mem): New function. Returns
- a formatted memory dump with optional ASCII dump.
-
-Mon Sep 8 12:48:50 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c: Include ilutk.h if IDE.
- (gdb_confirm_quit, gdb_force_quit): New static functions.
- (gdbtk_init): Add Tcl commands gdb_confirm_quit and
- gdb_force_quit.
-
-Mon Sep 8 03:05:33 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_get_breakpoint_info): Now returns the
- function a breakpoint is in.
-
-Fri Sep 5 20:23:58 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Call ide_create_exit_command.
-
-Wed Sep 3 19:39:15 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c: Include guitcl.h.
- (gdbtk_init): Always call ide_initialize_paths. Set the Tcl
- variable IDE to 1 when using the IDE. Always try using auto path
- to find main.tcl.
- * Makefile.in (IDE_CFLAGS_X): Always include libide.
- (LIBIDE): New variable.
- (IDE_X): Omit -lide.
- (IDE_DEPS): Omit libide.
- * configure.in: Add LIBIDE to TCL_LIBS and CONFIG_DEPS.
- * configure: Rebuild.
-
-Mon Aug 25 02:28:55 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * gdbtk.c: (gdb_target_has_inferior) check if inferior_pid is non-zero
- before assuming that the inferior is running.
-
-Mon Aug 25 01:06:48 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdbtk_start_timer): Pass third argument to setitimer.
- (gdbtk_stop_timer): Likewise.
-
-Mon Aug 25 00:23:08 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * gdbtk.c: (gdbtk_init) create new command "gdb_target_has_execution"
- (gdb_target_has_execution_command) new function
-
-Sun Aug 24 20:27:22 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdb_loc): If there are no symbols, just bail
- immediately.
- (tk_command_loop): Print errors encountered while running
- gdbtk_tcl_preloop.
-
-Sun Aug 24 13:44:03 1997 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Run ide_create_build_command.
-
-Sat Aug 23 21:53:39 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c: If CYGWIN32, include <sys/time.h>.
- (x_fd): Don't define if WINNT.
- (gdbtk_start_timer, gdbtk_stop_timer): New static functions if
- CYGWIN32.
- (gdbtk_wait): Don't set up signal handling if WINNT. If CYGWIN32,
- call gdbtk_start_timer and gdbtk_stop_timer.
- (gdbtk_init): Don't set up signal handling or make x_fd
- asynchronous if CYGWIN32.
-
-Fri Aug 22 15:23:15 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (error_string_ptr): New static variable.
- (gdbtk_fputs): If result_ptr is NULL, and error_string_ptr is not
- NULL, and we're outputting to stderr, append string to
- error_string_ptr rather than calling gdbtk_tcl_fputs.
- (call_wrapper): Set up error_string_ptr. Put both error string
- and normal string in Tcl result.
-
- * gdbtk.c (gdbtk_init): Don't call ide_run_server_init until after
- gdb has initialized.
-
-Thu Aug 21 19:14:38 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c: If _WIN32, include winuser.h.
- (gdbtk_init): If _WIN32, use MessageBox to display an error
- evaluating main.tcl.
-
-Thu Aug 21 00:48:00 1997 Martin M. Hunt <hunt@pern.cygnus.com>
-
- * gdbtk.c (gdbtk_init): Add call to ide_run_server_init().
- (gdb_cmd): For the load command, don't buffer the I/O.
-
-Wed Aug 20 11:41:22 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_query): Chaneg free() call to Tcl_Free().
-
-Tue Aug 19 17:09:19 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.in (TCL_DEPS, TK_DEPS): New variables.
- (ITCL_DEPS, TIX_DEPS): New variables.
- (IDE_DEPS): New variable.
- (CDEPS): Include @CONFIG_DEPS@.
- * configure.in: Set and substitute CONFIG_DEPS and TIX_DEPS.
- * configure: Rebuild.
-
-Sun Aug 17 00:42:11 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_listfuncs): New function that returns
- a list of all the functions in a source file.
-
-Tue Aug 12 16:35:21 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.in (install-only): Install tclIndex if ENABLE_IDE.
-
-Mon Aug 11 10:43:04 1997 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Use ide_event_init_from_environment.
-
-Fri Aug 8 15:59:24 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Change gdbtk_lib_tmp and gdbtk_file to be
- dynamically allocated, rather than fixed size. Pass "gdbtcl" to
- ide_initialize_paths to match installed directory name. If IDE,
- use auto_path to search for main.tcl.
- * Makefile.in (install-only): If ENABLE_IDE, install from gdbtcl2
- rather than gdbtcl.
-
- * gdbtk.c (gdbtk_cleanup): New static function.
- (gdbtk_init): Add gdbtk_cleanup as a final cleanup. Uncomment
- call to ide_initialize_paths. If we can't initialize the event
- system, set GDBTK_IDE to 0 in the Tcl interpreter. Create the
- ide_window_register and the ide_window commands. Initialize tk,
- itcl, and tix after initializing the IDE.
-
- * configure.in (tixdir): Update for cygwin32 case for Tcl 8.0.
- * configure: Rebuild.
-
-Fri Aug 8 00:13:32 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (breakpoint_notify): Change buffer size from 100
- to 256 to avoid memory corruption with very long pathnames.
-
-Thu Aug 7 14:08:23 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * configure.in: Change required Tix version to 4.1.8.0 .
- * configure: Rebuilt.
-
-Fri Aug 1 15:21:44 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (Tcl_Alloc): Don't provide our own version of this if
- _WIN32.
- (Tcl_Realloc, Tcl_Free): Likewise.
- * configure.in: Check for cygwin32 environment. Define and
- substitute WIN32LIBS and WIN32LDAPP. Always set configdir to
- unix; setting it to win was for an old Tcl/Tk configuration
- scheme.
- * aclocal.m4 (CY_AC_LOAD_TKCONFIG): Substitute TK_BUILD_INCLUDES.
- * Makefile.in (TK_CFLAGS): Add @TK_BUILD_INCLUDES@.
- (WIN32LDAPP, WIN32LIBS): Define.
- (CLIBS): Add $(WIN32LIBS).
- (gdb): Use $(WIN32LDAPP).
- * configure: Rebuild.
-
-Tue Jul 22 19:45:37 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * configure.in, aclocal.m4: Another fix to find the
- correct Tix library name.
-
- * configure: Rebuilt.
-
-Mon Jul 21 22:24:07 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * aclocal.m4: Search for the correct tix library.
-
-Thu Jul 10 00:02:41 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * Makefile.in, configure.in, aclocal.m4: Add Itcl, Tix, and
- IDE configuration information.
-
- * gdbtk.c (breakpoint_notify): Send address, linenumber and
- filename when a breakpoint is set. Avoids call to bp_info.
- (gdbtk_init): Call Tcl_FindExecutable(). Add code to handle
- Itcl, Tix and IDE initialization.
-
- * configure: Regenerated.
-
-Fri Jun 13 10:28:09 1997 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Make truth value test explicit.
- Remove unused static variable "Gdbtk_Library".
-
-Sat Jun 7 02:34:19 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * gdbtk.c (gdb_get_breakpoint_info): Add string for new
- enumeration del_at_next_stop to bpdisp array.
-
-Tue Jun 3 15:46:51 1997 Tom Tromey <tromey@cygnus.com>
-
- * Makefile.in (LIB_RUNTIME_DIR): New variable.
-
-Wed May 7 19:10:19 1997 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk.c (wrapped_call): New function - make actual call to tk
- worker function.
- (call_wrapper): Rewrite to use top.c:catch_errors.
-
- * gdbtk.c (gdb_stop): If No target_stop set quit flag and hope for
- best.
-
-Mon Apr 21 14:00:08 1997 Doug Evans <dje@canuck.cygnus.com>
-
- * gdbtk.c (gdb_disassemble): Store endian-ness in `di'.
-
-Wed Apr 16 12:33:06 1997 Andrew Cagney <cagney@b1.cygnus.com>
-
- * Makefile.in (install-only): Make list of gdbtcl files to install
- explicit - was picking up files such as ChangeLog etc.
- (install-only): Don't blindly create the directory.
-
-Tue Apr 1 15:04:21 1997 Jason Molenda (crash@godzilla.cygnus.co.jp)
-
- * configure.in (gdbtcl): Create soft-link for gdbtcl/ directory
- instead of gdbtk.tcl.
-
-Fri Mar 28 17:04:02 1997 Jason Molenda (crash@godzilla.cygnus.co.jp)
-
- * Makefile.in (gdbtk.o): look for GDBTK_LIBRARY in $(datadir) by
- default, not $(srcdir).
-
-Wed Mar 19 15:16:17 1997 Martin M. Hunt <hunt@onions.cygnus.com>
-
- * Makefile.in: Install gdbtcl dir instead of gdbtk.tcl.
-
- * gdbtk.c: Added some ifdefs for Windows. Changed GDBTK_FILENAME
- to GDBTK_LIBRARY, which is now a path to search.
- (gdb_path_conv): New function. Convert Cygwin32 pathname to
- DOS-style pathname.
-
- * {aclocal.m4,configure.in}: Changes for Windows builds.
-
- * configure: Rebuilt.
-
-Fri Mar 14 10:01:29 1997 Tom Tromey <tromey@cygnus.com>
-
- * configure: Regenerated.
- * configure.in (LIBS): Re-reverse order of TCL_LIBS and TK_LIBS.
-
-Wed Mar 12 14:29:52 1997 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk.c (x_event): Use Tcl_DoOneEvent, TCL_DONT_WAIT,
- TCL_ALL_EVENTS.
-
- * configure: Regenerated.
- * configure.in (ENABLE_GDBTK): Put TCL_LIBS after TK_LIBS in
- LIBS.
-
-Mon Feb 10 13:50:53 1997 Stu Grossman (grossman@critters.cygnus.com)
-
- * gdbtk.c (call_wrapper): Clear running_now if an error occurs.
-
-Wed Dec 11 18:51:35 1996 Mark Alexander <marka@cygnus.com>
-
- * gdbtk.c (gdb_loc): Correct truncation of PC on 64-bit MIPS.
-
-Tue Nov 19 09:26:14 1996 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk.c (gdbtk_readline): Fix memory leak.
-
-Mon Nov 18 23:43:05 1996 Tom Tromey <tromey@cygnus.com>
-
- Fixes for Tcl 7.6 / Tk 4.2:
- * gdbtk.tcl (apply_filespec): Use tk_getOpenFile.
- Remove old fileselect code.
- * gdbtk.c (Tcl_Alloc): Rename from Tcl_Malloc.
-
-Fri Sep 27 10:25:30 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (create_copyright_window): Increase timeout from
- 15 seconds to 30 seconds.
-
-Wed Sep 4 17:28:40 1996 Stu Grossman (grossman@critters.cygnus.com)
-
- * configure configure.in: Add host *windows* to list of hosts
- that don't support GDBtk.
-
-Fri Aug 23 00:44:57 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Check for a DISPLAY env variable and
- gracefully degrade to using command line interface if none is
- found.
-
-Fri Aug 9 12:32:53 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * Makefile.in (LIB_INSTALL_DIR): New macro.
- (TCL): Include @TCL_LD_SEARCH_FLAGS@.
-
-Thu Aug 1 20:35:01 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.c (mainWindow): Deleted.
- (cleanup_init): Don't destroy main window.
- (gdbtk_init): Main window now created by Tk_Init.
-
- * configure.in: Most X checks now handled automatically by Tk.
- Use new macros to find Tcl/Tk.
- * aclocal.m4: New version for new Tcl/Tk; from Don Libes.
- * config.in, configure: Regenerated.
-
- * Makefile.in (TCL, TCL_CFLAGS, TK, TK_CFLAGS, X11_CFLAGS,
- X11_LDFLAGS, X11_LIBS): Changed for new Tcl and Tk.
-
-Thu Aug 1 16:12:05 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
-
- * Makefile.in (gdbtk.tcl): put in $(datadir), not $(libdir).
-
-Fri Jul 26 14:07:37 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdb_disassemble): Initialize di.flavour.
-
-Thu Jul 25 19:41:31 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c (null_routine): Ditto.
- (gdbtk_flush): Ditto.
- (gdbtk_fputs): Ditto.
- (gdbtk_query): Ditto.
- (gdbtk_readline): Ditto.
- (gdbtk_readline_end): Ditto.
- (gdb_get_breakpoint_list): Ditto.
- (gdb_get_breakpoint_info): Ditto.
- (breakpoint_notify): Ditto.
- (gdbtk_create_breakpoint): Ditto.
- (gdbtk_delete_breakpoint): Ditto.
- (gdbtk_modify_breakpoint): Ditto.
- (gdb_loc): Ditto.
- (gdb_eval): Ditto.
- (gdb_sourcelines): Ditto.
- (map_arg_registers): Ditto.
- (get_register_name): Ditto.
- (gdb_regnames): Ditto.
- (get_register): Ditto.
- (gdb_fetch_registers): Ditto.
- (register_changed_p): Ditto.
- (gdb_changed_register_list): Ditto.
- (gdb_cmd): Ditto.
- (call_wrapper): Ditto.
- (gdb_listfiles): Ditto.
- (gdb_stop): Ditto.
- (gdbtk_dis_asm_read_memory): Ditto.
- (compare_lines): Ditto.
- (gdb_disassemble): Ditto.
- (tk_command): Ditto.
- (cleanup_init): Ditto.
- (gdbtk_interactive): Ditto.
- (x_event): Ditto.
- (gdbtk_wait): Ditto.
- (gdbtk_call_command): Ditto.
- (tk_command_loop): Ditto.
- (gdbtk_init): Ditto.
-
- * gdbtk.c (register_changed_p): Remove unused local variable "buf".
-
-Sat Jul 20 17:46:40 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (files_command): Reorder the binding tags for
- the listbox widget to avoid referencing the listbox after
- the containing widget has been destroyed by the action of
- a previous binding.
-
-Sat Jul 20 10:09:28 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (delete_expr): Unset corresponding element of
- expr_update_list when destroying an expression.
- (create_expr_window): Initialize expr_num, delete_expr_num,
- and expr_update_list here when each new expression window
- is created, rather than once at startup.
-
-Mon Jul 15 16:44:05 1996 Stu Grossman (grossman@critters.cygnus.com)
-
- * gdbtk.c (gdb_disassemble): Setup di.mach from
- tm_print_insn_info.mach, and set endian from TARGET_BYTE_ORDER.
-
-Fri Jun 21 11:04:47 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (create_register_windows): Include missing '$'s.
- Add global declarations for various reg_format_* variables.
- * gdbtk.tcl (populate_register_window): Make initial window one
- line taller to account for new column header line.
-
-Fri Jun 21 09:46:47 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c (get_register): Support for printing raw formats.
- * gdbtk.tcl: Add hint for using debug_interface.
- (center_window, add_breakpoint_frame, delete_breakpoint_frame):
- Enclose arg in braces for consistency.
- (create_registers_window, populate_reg_window, update_registers):
- Major rewrite to support displaying multiple formats in the register
- window.
- (init_reg_info): New function.
- (recompute_reg_display_list): Reset reg_display_list, start
- register display lines at line 2.
-
-Thu Jun 20 08:18:59 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (gdbtk_tcl_readline_begin): Handle backspace to
- avoid backing up over prompt. At every input, make sure insert
- point is at least after command start, handle control-u to delete
- current input line.
- (tclsh): Handle backspace to avoid backing up over prompt. Handle
- control-u to delete current input line.
-
-Wed Jun 19 17:23:38 1996 Geoffrey Noer <noer@cygnus.com>
-
- * configure.in: disable gdbtk for *cygwin32* hosted compiles
- * configure: regenerated with autoconf 2.8
-
-Sun May 19 16:49:37 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c (gdbtk_readline_begin, gdbtk_readline, gdbtk_readline_end):
- New functions.
- (tk_command_loop): Set instream to NULL to enable Tk user interaction.
- (gdbtk_init): Set readline_begin_hook, readline_hook,
- and readline_end_hook.
- * gdbtk.tcl (gdbtk_tcl_readline_begin, gdbtk_tcl_readline,
- gdbtk_tcl_readline_end): New functions.
- (tclsh): Pack scroll bar on right side of window, not left.
-
-Fri May 17 13:54:34 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (create_command_window): Change a misspelled "get"
- to the intended "cget".
- (delete_line): Fix so it deletes the current line at the
- insertion cursor.
-
-Thu May 16 19:20:29 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (gdb_prompt): Set this early on.
- (create_command_window): Use gdb_prompt rather than "(gdb) ".
- (gdbtk_tcl_preloop): Proc executed just prior to Tk main loop.
- (tclsh): If an evaluation window already exists, just bring it
- to the front instead of trying to create another.
- * gdbtk.c (tk_command_loop): New function.
- (gdbtk_init): Call tk_command_loop rather than Tk_MainLoop.
-
-Thu May 16 16:16:35 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (evaluate_tcl_command, tclsh): New functions that
- implement a tcl evaluation window for gdbtk maintainers to use.
-
-Thu May 16 11:42:58 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl (files_command): Correctly insert list of files into
- listbox widget.
-
- * gdbtk.tcl (files_command): listbox command no longer accepts
- -geometry.
-
-Wed May 15 16:04:09 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.tcl (create_command_window): If command window's buffer
- is disabled, don't execute any of the key bindings.
-
-Mon May 13 13:43:25 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c (tk_command): Catch case where no argument is given
- since this will cause the tcl interpreter to dump core.
-
-Wed May 8 20:33:24 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c: Fix a couple of misspellings.
-
-Thu May 2 19:17:49 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.tcl (debug_interface): New global, use to aid debugging.
- (insert_breakpoint_tag, delete_breakpoint_tag): Fix range.
- (file_popup_menu): Delete, never used.
- (listing_window_popup): Rename from listing_window_button_1,
- remove breakpoint toggling code.
- (toggle_breakpoint): New procedure.
- (create_file_win): Bind popup menu to button 2, toggle breakpoints
- with button 1 in breakpoint area, add display of tagged areas if
- debugging on.
-
-Fri Apr 5 13:44:40 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.c (running_now): New global variable.
- (gdb_cmd): Test it before executing any command.
- (gdbtk_call_command): Set it when inferior is running.
- * gdbtk.tcl (gdbtk_tcl_busy, gdbtk_tcl_idle): Enable and
- disable interaction with command window's text appropriately.
-
-Fri Apr 5 13:25:42 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * gdbtk.c (SIOCSPGRP, linux): If on Linux, undef SIOCSPGRP, since
- some versions of the kernel don't support it.
-
-Tue Feb 6 16:31:25 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl (create_file_win): Eliminate text widget B1 binding so
- double-clicking will work again.
- (create_asm_win): Put "break" at end of all B1 bindings.
- (create_file_win): Lower "sel" tag, don't raise it.
- (ensure_line_visible): New proc.
- (update_listing, update_assembly): Use it.
- (create_copyright_window): Destroy window on Leave event.
- (create_command_window): Put "break" at end of all B2 bindings.
-
-Wed Jan 24 15:28:41 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl, gdbtk.c: Updated copyrights.
-
- * configure.in: Look for -ldl or -ldld when using Tcl 7.5 or
- greater.
- * configure: Rebuilt.
-
-Tue Jan 23 09:00:48 1996 Doug Evans <dje@charmed.cygnus.com>
-
- * gdbtk.c (gdb_disassemble): Pass fprintf_unfiltered to
- INIT_DISASSEMBLE_INFO.
-
-Mon Jan 15 09:58:41 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl (create_expr_window): Many changes to update GUI.
- (add_expr): Changes from create_expr_window.
- (create_command_window): Set focus.
- (delete_expr): Rewrote.
- (expr_update_button): New proc.
- (add_expr): Put bindings on FocusIn, FocusOut.
- Don't allow .file_popup to be torn off.
-
-Fri Jan 12 09:36:17 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl (gdbtk_tcl_query): Swap Yes and No buttons.
- (update_listing): Use lassign. Use "see" to scroll. Don't need
- screen_top, screen_bot, screen_height.
- (update_assembly): Use "see" to scroll.
- (textscrollproc): Removed.
- (create_file_win): Don't use textscrollproc.
- (asmscrollproc): Removed.
- (create_asm_window): Don't use asmscrollproc.
- (create_asm_win): Ditto.
- (screen_height, screen_top, screen_bot): Removed.
- (run_editor): New proc.
- (build_framework): Use it.
- (create_file_win, create_source_window): Don't use textscrollproc.
- (create_breakpoints_window): Set -xscrollcommand on canvas.
- (not_implemented_yet): Default button is 0.
- (delete_char): Don't use tk_textBackspace.
- (create_command_window): Allow Tk bindings to fire after deleting
- character.
- (create_command_window): Make Delete delete left, not right.
-
-Thu Jan 11 10:08:14 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl (FSBox): Don't use tk_listboxSingleSelect.
-
- Changes in sync with expect:
- * configure.in (ENABLE_GDBTK): Use CY_AC_PATH_TCL and
- CY_AC_PATH_TK.
- * aclocal.m4: Replaced with version from expect.
- * configure: Regenerated.
-
-Wed Jan 10 09:07:22 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl (gdbtk_tcl_fputs, gdbtk_tcl_fputs_error,
- gdbtk_tcl_flush): Use "see", not "yview".
- (gdbtk_tcl_query): Use questhead bitmap.
- various: Always wrap condition of 'if' in {...}.
- (add_breakpoint_frame): Set -value on radiobuttons.
- (lassign): New proc.
- (add_breakpoint_frame): Use lassign, not series of assignments.
- (decr): Made faster.
- (interactive_cmd): Use "see", not "yview".
- (not_implemented_yet): Use warning bitmap.
- (update_expr): Don't allow $expr to be evalled by Tcl.
- (create_expr_window): Don't use "focus".
- (delete_char, delete_line): Define globally.
- (delete_line, delete_char, create_command_window, update_autocmd,
- build_framework, create_asm_win, create_file_win): Use "see", not
- "yview".
- (create_copyright_window, center_window, bind_widget_after_class):
- New procs.
- (FSBox,create_command_window, create_autocmd_window): Binding
- changes for Tk4.
- (textscrollproc): Define globally.
- (build_framework): tk_menuBar no longer needed. Keys Prior, Next,
- Home, End, Up, and Down are all defined by Tk.
- (apply_filespec): Use error bitmap in dialog.
- (files_command): Don't use tk_listboxSingleSelect.
- (files_command): Don't use "uniq" to remove duplicates from a
- list.
- (update_assembly): Use lassign.
- (create_asm_win): Removed redundant bindings.
- (listing_window_button_1, file_popup_menu): Use tk_popup.
- (ButtonRelease-1 binding): Just remove tag from window; rest
- handled by Tk.
-
- * gdbtk.c (gdbtk_query): Use Tcl_Merge to provide quoting.
- (call_wrapper): Use Tcl_Eval, not Tcl_VarEval.
- (gdbtk_call_command): Ditto.
-
-Thu Jan 4 16:04:54 1996 Stu Grossman (grossman@cygnus.com)
-
- * configure configure.in: Make --enable-gdbtk be the default.
-
-Thu Dec 28 15:10:49 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * README.GDBTK: Polish introductory paragraph.
-
-Mon Oct 16 11:27:06 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdb_disassemble): Use fprintf_unfiltered instead of
- fprintf_filtered.
-
-Tue Oct 10 15:26:39 1995 Fred Fish <fnf@cygnus.com>
-
- * README.GDBTK: Updated for version 4.15.
-
-Sat Aug 19 17:20:22 1995 Michael Tiemann <tiemann@axon.cygnus.com>
-
- * gdbtk.tcl: ENABLE comes back as "1" or "0", not "enable" or
- "disable".
- Also, wire up the breakpoint window so that it can be demo'd.
-
-Tue Aug 1 11:44:53 1995 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * gdbtk.c: Include "gdb_string.h" instead of <string.h>.
-
-Tue Jun 20 10:19:40 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c: Add functions Tcl_Malloc, Tcl_Realloc, and Tcl_Free.
-
- * gdbtk.tcl (add_breakpoint_frame): Add more fields.
- * (create_file_win create_asm_win build_framework): Create null
- bindings for meta keys to keep window from dropping down to
- insertion point when meta is pressed by itself. New bindings:
- Up/Down - Scroll up/down one line at a time
- Next/Prior - Scroll up/down one page at a time
- Home/End - Warp to current pc/end of file
- * (build_framework): Turn on breakpoint menu.
- * (create_command_window): Implement tab completion. Add binding
- for ^C to stop target.
-
-Fri May 19 06:15:40 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
-
- * gdbtk.c: Conditionalize use of stdarg rather than varargs on
- ANSI_PROTOTYPES not __STDC__; it must match the definition of
- PARAMS.
-
-Thu May 18 15:58:46 1995 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * gdbtk.c (gdbtk_query): Use stdarg.h macros when compiling with
- an ANSI compiler.
-
-Sat Apr 15 13:52:24 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.c (gdb_disassemble): Read from inferior if connected
- to a VxWorks target.
-
-Fri Apr 14 10:18:20 1995 Stu Grossman (grossman@cygnus.com)
-
- * README.GDBTK: New file. Contains the obvious.
-
-Tue Apr 11 11:07:12 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * gdbtk.c (gdbtk_init): If SIOCSPGRP is not available, but
- F_SETOWN is, use that.
-
-Thu Apr 6 17:00:46 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * Makefile.in (X11_INCLUDES): Define as empty.
- (X11_CFLAGS): Define as including $(X11_INCLUDES).
- (X11_LIB_SWITCHES): Define as empty.
- (X11_LIBS): Define as -lX11.
-
- * configure.in (enable_gdbtk): If gdbtk, support the --x-includes
- and --x-libraries switches, setting the X11_INCLUDES and
- X11_LIB_SWITCHES respectively. Instead of using a hardcoded -lX11
- in ENABLE_CLIBS, use the X11_LIB_SWITCHES and X11_LIBS variables.
-
- * gdbtk.c (gdbtk_init): If SIOCSPGRP is not available, don't use
- it. This means that the stop button doesn't work, but is better
- than nothing.
-
-Wed Mar 29 17:09:29 1995 Stu Grossman (grossman@cygnus.com)
-
- * Makefile.in (gdbtk.o): Use X11_CFLAGS to provide alternate
- locations (per-host) for X11 include files.
- * config/pa/hppahpux.mh (XM_CLIBS): Add -L/usr/lib/X11R5 to force
- the use of R5 libs.
- (X11_CFLAGS): Add this to indicate the locs
- of the R5 include files.
-
-Wed Mar 8 16:12:21 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdb_get_breakpoint_info): Return error if breakpoint
- type is not bp_breakpoint.
-
-Tue Feb 14 17:16:41 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c: Ditto.
- * gdbtk.c: General cleanups, get rid of unused variables. Redo
- handling of stdout/stderr to just return output as the result of
- the tcl command that caused the output. Cleanup -Wall stuff.
- * (breakpoint_notify): Now returns just action and breakpoint
- number.
- * (gdb_get_breakpoint_list): New routine. Does the obvious.
- * (gdb_get_breakpoint_info): Mostly derived from the old
- breakpoint_notify, but returns lots more info.
- * (dsprintf_append_element): Helper routine, works like printf,
- but appends a tcl element onto the specified DString. Good for
- building up lists as return values.
- * (gdbtk_enable/disable_breakpoint): Go away. Replaced with
- gdbtk_modify_breakpoint.
- * (*many routines*): Use new result protocol.
- * (call_wrapper): Make sure that recursive calls don't trash results.
- * gdbtk.tcl: New windows, autocmd, and breakpoints.
- * (gdbtk_tcl_fputs): Don't use $current_output_win redirection
- anymore. It's not needed (in fact, this routine may not be needed
- anymore).
- * (gdbtk_tcl_breakpoint): Change to reflect new breakpoint
- notification protocol.
- * (gdbtk_tcl_busy gdbtk_tcl_idle): Straighten out buttons, remove
- catches.
- * (interactive_cmd): Use this wrapper around button invocations
- of many commands. This will catch errors and put the results into
- the command window. It also updates all the other windows.
- * Also, change reliefs of most things to sunken. This actually
- looks better.
- * (create_file_win): Fix margin binding to allow breakpoints to
- work again.
- * (create_asm_win): Use return value of gdb_disassemble instead
- of implicit I/O to the command window.
- * (create_command_window): Use new result protocol to get output
- from commands.
-
-Sun Feb 5 20:32:44 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * gdbtk.c (gdb_disassemble): Deference pointer to function before
- calling it (pre-ANSI compilers generally require this).
-
-Fri Feb 3 11:19:20 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdb_disassemble): Get rid of
- dis_asm_read_memory_hook. We can now call the disassemblers
- directly and have no need for this hook anymore.
-
-Mon Jan 30 17:34:24 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl (create_file_win): Disable old popup menu for source
- window.
-
-Wed Jan 25 18:23:46 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdbtk_init): Prevent segfault when gdbtk.tcl can't be
- found.
- * gdbtk.tcl: Initialize expr_update_list() to prevent errors when
- popping up expression window for the first time.
-
-Tue Jan 24 12:10:28 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl (create_registers_window): Work around a radiobutton
- widget bug to make Options|Natural button work.
-
- * gdbtk.c (gdb_disassemble): Fix problem with source+assembly and
- g++ caused by out-of-order pc's.
- * gdbtk.tcl (files_command): Remove duplicate file names. Also,
- add scrollbar.
-
-Mon Jan 23 17:21:09 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl: Take .gdbtkinit if it exists. Makes gdbtk match the
- doc!
-
-Thu Jan 12 15:02:40 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c, gdbtk.tcl: Update/add copyright.
- * gdbtk.tcl (build_framework): Several fixes for filespec widget,
- including dismiss button, and better error handling.
- * (create_command_win): Bind button 2 to retrieve selection.
-
-Wed Jan 11 17:06:55 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl: Add button to control mixed source disassembly.
- Use text widgets in expr window. The give me more control over
- layout.
- Add auto-updating of exprs in expression window.
- Handle expressions out of scope a bit better.
- Make selected window pop up to the top when invoked via the
- menubar.
- Make copyright message have raised relief.
-
- * gdbtk.c (gdbtk_init): Improve handling for errors in gdbtk.tcl
- during startup.
-
-Thu Jan 5 17:38:29 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (finish_saving_output): Don't do anything if not saving
- output.
- * (breakpoint_notify): Don't send null filename to tcl.
- * (gdb_eval): New tcl command to eval an expression.
- * (gdb_disassemble): New tcl command to do disassembly. This
- allows tcl code to choose between exec file and target memeory,
- and can also do mixed source and assembly.
- * (gdbtk_init): Move reading of gdbtk.tcl to the end to make sure
- that more of the environment is set up. Also, create link between
- gdb and tcl vars disassemble{-_}from{-_}exec.
-
- * gdbtk.tcl: New expression window support.
- * Make assembly window be 80 columns wide.
- * Use new disassembly method. Add menu items to select
- disassembly from exec file or target.
- * Change View menubar item to Options.
-
- * Get rid of Stack, Breakpoints, Signals, and Variables Windows,
- since they don't exist yet.
-
- * Pop up a copyright window on startup.
-
-Wed Jan 4 19:49:10 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.tcl (build_framework): Add standard commands menu, more
- windows to standard windows menu.
- (not_implemented_yet): Clarify message.
-
-Fri Dec 30 15:49:00 1994 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.tcl (FSBox): New proc, File Selection Box code from exmh.
- (not_implemented_yet): New proc.
- (build_framework): Add various file commands to file menu.
-
-Fri Dec 23 16:18:50 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdbtk_wait gdbtk_init): Portability improvements for
- SIGIO handling.
-
-Mon Dec 19 09:55:47 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl (update_assembly): Force update to make sure that pc
- is visible when creating new assembly windows.
-
-Sun Dec 18 23:31:20 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdbtk_wait gdbtk_init): Use different method of
- enabling I/O interrupts for SVR4 (streams).
- * (start_saving_output save_output get_saved_output
- finish_saving_output flush_holdbuf gdbtk_flush gdbtk_fputs
- gdbtk_init):
- Totally revamp to use TCLs dynamic string functions. Also, quote
- all data passed back to TCL to prevent errors with unmatched
- braces, odd characters, etc... This fixes several wierd problems
- with outputting strings containing unmatched braces.
- * (breakpoint_notify gdb_loc): Use long hex format to output
- addresses of breakpoints and PCs. This fixes some Alpha problems.
- * (breakpoint_notify): Add stream arg to call to gdbtk_fputs.
- * (gdb_listfiles): Also, go through the symtabs when looking for
- files. This makes xcoff work (sort of), but probably breaks
- something else.
- * (gdb_stop): Return TCL_OK instead of nothing. This fixes odd
- TCL errors when hitting stop button.
- * (tk_command): Don't pass interp->result on to Tcl_{Var}Eval, as
- that will trash the result. strdup the result instead and pass
- that on. Improve error handling as well.
-
- * gdbtk.tcl (gdbtk_tcl_flush): Use global def of
- current_output_win. Makes flushing actually work!
- * (asm_win_name create_asm_win update_assembly): Bunch of fixes
- to make assembly windows stop flashing when loading a new file.
- * (gdbtk_tcl_busy gdbtk_tcl_idle): Use catch to prevent gdb_cmd
- errors from losing control.
- * (create_source_window): Add source file selection to View menu.
- * (create_command_window (<Key-Return> binding): Quote text fed
- into gdb_cmd to prevent eval errors.
-
-Thu Dec 15 16:40:10 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c: Improve mechanism for capturing output values.
- (full_filename): Remove.
- (gdb_cmd call_wrapper gdbtk_init): Protect all calls from tcl land
- with call_wrapper. This prevents longjmps (usually via error())
- from jumping out of tcl/tk and leaving things in an indeterminate
- state.
- (gdbtk_fputs): Differentiate stdout from stderr when passing text
- into tcl land.
- * gdbtk.tcl: New view option to disable line numbers. Put catch
- around most uses of gdb_cmd. Add update button to reg config
- window. Stop doing immediate updates when selecting registers.
- Change register view values into checkbuttons.
-
-Mon Dec 12 16:59:29 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl (reg_config_menu create_registers_window
- recompute_reg_display_list): Use array instead of individual vars
- for register display list.
- * (recompute_reg_display_list update_registers): Fix bug with not
- displaying all registers.
-
-Mon Dec 12 12:22:21 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c: New tcl commands: gdb_fetch_registers,
- gdb_changed_register_list, and gdb_regnames.
- * gdbtk.tcl: Use monochrome color model for now.
- * (delete_breakpoint_tag create_file_win): Add breakdot support.
- * (create_file_win create_asm_win update_listing build_framework
- create_source_window create_command_window): Re-org window
- creation to give all windows consistent look and feel.
- * (update_listing update_asm): Change pc pointer to '->'.
- * (registers_command reg_config_menu create_registers_window
- populate_reg_window update_registers): Revamp register window.
- Allow selection of registers to be displayed. Highlight changed
- registers.
-
-Mon Nov 28 09:17:20 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl (build_framework): Fix bug with setting window titles.
-
- * gdbtk.tcl (build_framework): Add "Report bug" to help menu.
-
- * gdbtk.tcl: Re-arrange windows using new, consistent layout. Clean
- up lots of code and centralize framework initialization.
-
-Wed Nov 16 15:28:29 1994 Rob Savoye (rob@cygnus.com)
-
- * Makefile.in: Fix the test for installing gdbtk.
-
-Mon Nov 14 08:51:29 1994 Stu Grossman (grossman@cygnus.com)
-
- * Makefile.in: Install gdbtk.tcl.
- * configure.in: Add ENABLE_GDBTK flag.
- * gdbtk.c (gdb_sourcelines): Returns list of source lines
- containing code. (gdb_regnames): Returns list of register names.
-
-Thu Nov 3 14:25:24 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdb_stop): Switch to target_stop().
-
-Tue Nov 1 16:41:12 1994 Stu Grossman (grossman@cygnus.com)
-
- * Makefile.in: Use $(objdir)/tcl and $(objdir)/tk if they are
- available.
- * configure.in (ENABLE_CLIBS): Use $(TCL) and $(TK) instead of
- -ltcl and -ltk.
- * gdbtk.c: Get rid of lots of unnecessary #includes.
- * (gdbtk_init): Use ConnectionNumber macro instead of referencing
- Display structure directly.
- * gdbtk.tcl: Change exit button to quit button.
-
-Wed Oct 26 15:41:07 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c: Change sense and name of no_windows variable. Now
- called use_windows, and defaults to off (for compatibility).
-
-Thu Oct 20 17:35:45 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdb_cmd): Force GUI into idle mode when errors occur.
- * (gdb_stop): New tcl command to stop the target process.
- * (x_event, gdbtk_wait): Allow GUI to interrupt gdb out of target
- waits.
- * (gdbtk_call_command): Wrapper around command processing to
- alert GUI of target state changes.
- * (gdbtk_init): Get the fd of X server for doing async
- notification of X events (via x_event). Setup new hooks.
- * gdbtk.tcl: Add scrollbars to assembly and command windows.
- * Change window foreground & background colors.
- * Create margin tag for breakpoints in source and assembly windows.
- * Add new routines to be invoked when target state changes to/from
- idle.
- * Add start of expression window.
- * Change bindings of mouse button 1 in assembly and source window
- to just set or clear breakpoints when in the margin tag.
- * Change shape of register window to be more vertical to better
- reflect its contents.
- * Add stop button.
- * Cleanup some code around command window bindings.
-
-Sat Sep 17 17:05:14 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl: Let ^U delete lines in the command window.
-
-Fri Sep 16 15:40:34 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c: Replace calls to full_filename with symtab_to_filename.
- * gdbtk.tcl: New routine pc_to_line replaces in line code. New
- routine decr replaces in line code.
- * (create_file_win): Use catch to handle open failures more
- elegantly. Also, create special window to display file open
- failure message. Move opening of file prior to creation of text
- widget.
- * (create_asm_win): Add PC as argument. We now base disassembly
- on PC instead of function name, since function names can be
- ambiguous (usually seen with shared libs). Also, use catch to
- simplify code where we don't care about failures.
-
-Wed Sep 14 00:55:26 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl: Add ref counts to breakpoint tags.
- * Put quotes around function name in disassemble command to better
- handle assembler names containing `.'.
- * Make pclist element 0 be filler to avoid off-by-one problem with
- line numbers.
- * Set names of top-level windows.
- * Add register display window.
- * Add PC to label of assembly window.
-
-Tue Sep 13 08:59:04 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdbtk_flush gdbtk_fputs): Buffer up output to make
- disassembly more efficient.
- * (breakpoint_notify): Include pc in gdbtk_tcl_breakpoint
- callback.
- * (gdb_loc): Include pc in return value. Also, return function
- name if arg was specified.
- * (gdb_cmd_stub): Call gdb_flush to drain internal GDB buffers
- after command completes.
- * (gdbtk_init): Improve error handling.
-
- * gdbtk.tcl: Add lots of comments. Clean up code.
- * (gdbtk_tcl_fputs): Make output window redirectable.
- * Add assembly window, and breapoint support.
- * Make button 1 in margin toggle breakpoints.
- * Use stippling to indicate breakpoint disabling.
-
-Fri Sep 2 19:11:40 1994 Stu Grossman (grossman@cygnus.com)
-
- * configure.in: Don't symlink to gdbtk.tcl if it's already there.
-
-Thu Jul 28 14:37:36 1994 Stu Grossman (grossman@cygnus.com)
-
- Support for TK GUI.
- * Makefile.in: Add rule for gdbtk.o.
- * configure.in: Add support for --enable-gdbtk.
- * gdbtk.c: New file. Contains support routines for TK interface.
- * gdbtk.tcl: New file. Implements GUI policy.
-
-
-Local Variables:
-mode: change-log
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
diff --git a/gdb/gdbtk/generic/ChangeLog-1998 b/gdb/gdbtk/generic/ChangeLog-1998
deleted file mode 100644
index ca919a6156c..00000000000
--- a/gdb/gdbtk/generic/ChangeLog-1998
+++ /dev/null
@@ -1,837 +0,0 @@
- Mon Dec 21 11:11:02 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (get_register): Call get_saved_register instead of
- read_relative_register_raw_bytes to fetch registers.
-
- Thu Dec 17 09:00:56 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (gdb_search): Don't mention C++ RTTI and
- global constructor/destructor symbols.
-
- Thu Nov 12 15:20:15 1998 Jim Ingham <jingham@cygnus.com>
- * More bug fixes merged in from devo.
-
- * gdbtk-cmds.c (gdb_cmd): Added an optional second argument to the
- gdb_cmd, which is from_tty. This is passed to the gdb command
- parser. It is 0 by default, and the console window passes 1.
-
- * gdbtk-cmds.c: moved disassemble_from_exec from gdbtk.c to gdbtk-cmds.c
- with all the other link-var'ed variables
-
- * gdbtk-hooks.c (gdbtk_trace_find): Only run the hook functions if
- we are called from_tty.
-
- * gdbtk-hooks.c (gdbtk_trace_start_stop): Set the trace buttons
- from a trace_start_command callback rather than doing it as a
- special case in gdb_cmd.
-
- * tracepoint.c (tstart_command, tstop_command): Add call to
- trace_start_stop_hook here.
-
- 1998-11-04 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_set_bp_addr): For callback, send full
- pathname instead of just basename.
-
- 1998-11-03 Keith Seitz <keiths@cygnus.com>
- * v850ice.c (do_gdb): New function.
- (ice_stepi): Use do_gdb to step properly.
- (ice_nexti): Use do_gdb to step properly.
- (view_source): Correct call to src window's location for new version.
-
- Tue Aug 25 18:13:30 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk.c (gdbtk_init): I hadn't excised ALL the old startup code,
- so it was not working correctly. Now it does.
-
- Fri Aug 21 14:37:40 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Changed the startup code to use
- tcl_findLibrary
-
-
-
-
-on Dec 28 17:44:36 1998 David Taylor <taylor@texas.cygnus.com>
-
-
- The following changes were made by Jim Blandy <jimb@cygnus.com>,
- Edith Epstein <eepstein@cygnus.com>, Elena Zannoni
- <ezannoni@cygnus.com> Stan Shebs <shebs@cygnus.com>, and David
- Taylor <taylor@cygnus.com>, as part of the project to merge in
- changes originally made by HP; HP did not create ChangeLog
- entries.
-
- * gdbtk.c (gdbtk_init): change stderr to gdb_stderr.
-
- * gdbtk-cmds.c
- (get_pc_register): Use paddr_nz, not sprintf's %llx and
- a cast to `long long'. Those aren't portable.
- (gdb_eval): add embedded_offset param to val_print call
- (get_register): add embedded_offset param to val_print call
-
- * gdbtk-hooks.c
- (tk_command_loop): change instream to a FILE.
- (gdbtk_flush): change both the declaration and definition to
- use GDB_FILE rather than FILE.
-
-Mon Dec 21 11:11:02 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (get_register): Call get_saved_register instead of
- read_relative_register_raw_bytes to fetch registers.
-
-Thu Dec 17 09:00:56 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (gdb_search): Don't mention C++ RTTI and
- global constructor/destructor symbols.
-
-Tue Dec 15 10:09:31 1998 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c (gdb_disassemble): Fix typo.
-
-Sun Dec 13 09:52:51 1998 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c: Update TARGET_PRINT_INSN_INFO, TARGET_PRINT_INSN.
-
-Fri Dec 11 09:52:04 1998 Andrew Cagney <cagney@chook>
-
- * gdbtk-cmds.c: Replace reg_name with REGISTER_NAME.
-
-Mon Dec 14 13:20:50 1998 Jim Ingham <jingham@cygnus.com>
-
- * Makefile.in, configure.in configure - add support for LIBGUI
- outside the IDE context.
-
-Thu Nov 19 13:14:57 1998 Geoffrey Noer <noer@cygnus.com>
-
- * gdbtk-cmds.c: Can't start using new API names yet. Switch back
- to calling cygwin32_ funcs until some time has passed...
- * gdbtk.c: Ditto. Also, include sys/cygwin.h for Cygwin, instead
- of providing own proto.
-
-Fri Nov 13 00:15:08 1998 Geoffrey Noer <noer@cygnus.com>
-
- Changes to account for name change from cygwin32 to cygwin and
- clean up Win32-related ifdefs.
-
- * gdbtk.c: lose "32" from cygwin_ func calls. ifndef for
- checking DISPLAY should be for _WIN32, not WINNT.
- * gdbtk.h: pick GDBTK_PATH_SEP based on _WIN32, not WINNT.
- * gdbtk-cmds.c (gdb_path_conv): lose "32" from cygwin_ func call,
- change ifdef to __CYGWIN32__ instead of WINNT.
- * {gdbtk.c, gdbtk-hooks.c}: __CYGWIN32__ refs drop the "32".
-
-Thu Nov 12 15:20:15 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk-cmds.c (gdb_cmd): Added an optional second argument to the
- gdb_cmd, which is from_tty. This is passed to the gdb command
- parser. It is 0 by default, and the console window passes 1.
-
- * gdbtk-cmds.c: moved disassemble_from_exec from gdbtk.c to gdbtk-cmds.c
- with all the other link-var'ed variables
-
- * gdbtk-hooks.c (gdbtk_trace_find): Only run the hook functions if
- we are called from_tty.
-
- * gdbtk-hooks.c (gdbtk_trace_start_stop): Set the trace buttons
- from a trace_start_command callback rather than doing it as a
- special case in gdb_cmd.
-
- * tracepoint.c (tstart_command, tstop_command): Add call to
- trace_start_stop_hook here.
-
-Wed Nov 4 12:41:42 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk-cmds.c (gdb_set_bp_addr): Pass the type, enable & thread
- to gdbtk_tcl_breakpoint.
- * gdbtk-hooks.c (gdbtk_trace_find): Added this function. It is
- the hook function for tfind commands.
- * tracepoint.c (trace_find_command): Added the trace_find_hook,
- run when you do trace_find_command.
- * tracepoint.h: Define the trace_find_hook.
-
-1998-11-03 Keith Seitz <keiths@cygnus.com>
-
- * v850ice.c (do_gdb): New function.
- (ice_stepi): Use do_gdb to step properly.
- (ice_nexti): Use do_gdb to step properly.
- (view_source): Correct call to src window's location for new version.
-
-Mon Nov 2 11:16:10 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk-cmds (gdb_get_tracepoint_info): Demangle C++ function names.
-
-Fri Oct 30 11:22:23 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk-cmds (gdb_get_tracepoint_info): Fixed typo.
-
-Wed Oct 28 16:19:02 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_set_bp_addr): For callback, send full
- pathname instead of just basename.
-
-Wed Oct 28 10:14:33 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk-cmds.c: Made the bdtypes & bpdisp arrays shared so they
- could be used in gdbtk-hooks.c (breakpoint_notify).
- Also fixed a few error messages to actually print the bp number
- rather that #%d...
- * gdbtk-hooks.c (breakpoint_notify): pass more of the information
- about the breakpoint into the Tcl command, so it does not have to
- try and guess about information we have on the C side.
- * gdbtk.h: Export the bptypes & pbdisp arrays.
-
-1998-10-13 Jason Molenda (jsm@bugshack.cygnus.com)
-
- * gdbtk.c, gdbtk-cmds.c: Cast parameters passed to make_cleanup to
- use the new make_cleanup_func typedef.
-
-1998-10-08 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_add_hooks): Install a hook for
- (new) file_changed_hook.
- (gdbtk_exec_file_changed): Rename to gdbtk_exec_file_display
- to mimic hook's name.
- (gdbtk_file_changed): New hook function.
-
-Tue Oct 6 22:57:13 1998 Andrew Cagney <cagney@b1.cygnus.com>
-
- * configure.in (links): Link gdbtcl2 directory instead of gdbtcl.
-
-Mon Oct 5 00:34:00 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_set_bp_addr): New command. Sets a
- breakpoint at an address. Use this instead of gdb_cmd "break"
- because the syntax of the break command is broken and doesn't
- allow you to create a thread-specific BP at an address. Also
- this is faster.
-
-Sun Oct 4 22:35:47 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_set_bp): Add an optional thread number.
- (gdb_find_bp_at_line): New function. Returns a list of bpnums
- at the specified line number.
- (gdb_find_bp_at_addr): New function. Returns a list of bpnums
- at an address..
-
-1998-10-02 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_exec_file_changed): New function which handles
- exec_file changes.
- (gdbtk_add_hooks): Define exec_file_display_hook (to gdbtk_exec_file_changed)
-
- * gdbtk-cmds.c (gdb_stop): target_stop is ALWAYS defined, so
- compare against something a little more meaningful (target_ignore).
-
-1998-09-24 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk.c (gdbtk_wait): Don't run the timer for ice targets.
-
- * v850ice.c (WM_ADDR_TO_SYM): New message.
- (v850ice_wndproc): Add handler for WM_SOURCE.
- (v850ice_wait): Call the ui_loop_hook occasionally.
- (ice_cont): Acknowledge message before doing anything.
- (ice_stepi): Ack message and let gdbtk do stepping.
- (ice_nexti): Ack message and let gdbtk do stepping.
- (view_source): New function ICE calls to display source code.
-
-1998-09-18 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (get_frame_name): Demangle function names, too.
-
-Thu Sep 10 22:10:29 1998 Jim Ingham <jingham@cygnus.com>
-
- *gdbtk-cmds.c (gdb_disassemble): Make sure the symtab's linetable is not
- null before trying to use it...
-
-1998-09-02 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (gdb_cmd): Do not run the timer when downloading --
- the ui_progress_hook that has been installed will actually
- update the gui for us.
-
-Mon Aug 31 15:42:10 1998 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk-hooks.c (context_hook): Don't define.
-
-1998-08-31 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (gdb_listfuncs): When stripping out "global destructors"
- and "global constructors", do not append any elements to the result.
-
-Sun Aug 30 00:49:18 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (Gdbtk_Init): Link C variable gdb_context
- with tcl variable gdb_context_id.
-
- * gdbtk-hooks.c (gdbtk_context_change): Implement new hook called
- context_hook. Called when threads change.
-
- * gdbtk.c: Initialize gdb_context.
-
- * gdbtk.h: Declare gdb_context.
-
- * infrun (wait_for_inferior): Call context_hook.
-
- * thread.c (thread_command): Call context_hook.
-
- * defs.h: Declare context_hook.
-
-Fri Aug 28 12:14:49 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_loadfile): Open the file after doing
- the symtab lookup and calling symtab_to_filename(). This
- makes GDBtk work with the GDB "dir" command.
-
-1998-08-18 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_add_hooks): Set selected_frame_level_changed_hook.
- (gdbtk_selected_frame_changed): New function.
-
- * gdbtk-cmds.c (Gdbtk_Init): Add command gdb_stack into interpreter.
- Link gdb's global selected_frame_level with interpreter global
- gdb_selected_frame_level.
- (gdb_stack): New function to faciltate speedier backtraces from
- gdbtk.
- (get_frame_name): New helper function for gdb_stack.
-
-Tue Aug 18 15:42:40 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_listfuncs): Strip out global constructors
- and destructors from the function list.
-
-Thu Aug 13 15:09:59 1998 Drew Moseley <dmoseley@cygnus.com>
-
- * gdbtk.c (gdbtk_cleanup): added a scope-level around the contents
- of the #ifdef so that the variable declarations in there would not
- be illegal in a C compilation.
-
-Mon Jul 27 13:07:16 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_call_command): Removed because it is now
- in gdbtk-hooks.c
- (null_routine): Removed.
-
- * gdbtk-hooks.c (tracepoint_notify): Fix sprintf to
- match number of arguments.
-
- * gdbtk-cmds.c (gdb_loc): When calling gdb_loc with an
- argument, call find_pc_line() to get a complete
- symtab_and_line struct.
-
-Fri Jul 24 14:25:43 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (gdb_search): Add missing NULL to switches.
- Add missing flags to result_ptr.
- Pass along any errors caused by getting the list of files from
- tcl.
- Allocate correct amount of memory for the file list.
- Don't do any unecessary cleanups.
-
-Fri Jul 24 01:08:37 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_loadfile): When there are no
- linenumbers, use only one tab.
-
-Sat Jul 18 12:28:39 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_cleanup): Add call to tcl function
- gdbtk_cleanup. We need this so the GUI gets to clean
- up no matter how GDB exits.
-
-Wed Jul 1 13:10:58 1998 Jim Ingham <jingham@cygnus.com>
-
- * Moved gdbtk_hooks.c & gdbtk_cmds.c to gdbtk-hooks.c &
- gdbtk-cmds.c to comply with the gdb conventions. Changed the
- configure & makefile to reflect the change...
-
-Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk.c: removed all the commands and hooks from this file so
- now it contains only the startup code.
- * gdbtk.c (gdbtk_init): Fixed a bug in the startup code on Windows
- that caused gdbtk not to find the share directory unless
- GDBTK_LIBRARY was set.
- * gdbtk_cmds.c: New file - this contains all the Tcl commands that
- gdb defines. All the old commands were moved here, the
- string-based commands were converted to object commands, and the
- object-based commands were all converted to uniformly use the
- call_wrapper. A new function, Gdbtk_Init was added to centralize
- initializing the gdb package.
- * gdbtk_hooks.c: New file - All the hooks were moved here, and a new
- function, gdbtk_add_hooks was added to centralize adding all these
- hook functions. gdbtk_fputs was also modified to handle the new
- result_ptr structure. See the comments in gdbtk.h for more
- details.
- * gdbtk.h: New file - this contains all the defines and globals
- shared by gdbtk.c, gdbtk_cmds.c & gdbtk_hooks.c
- * Makefile.in, configure.in & configure: mutatis mutandi for the
- new files.
-
-
-Mon Jun 29 11:49:17 1998 Keith Seitz <keiths@cygnus.com>
-
- * main.c (main): Don't include gdbtk test code if GDBTK is
- not defined by configure.
-
- * configure.in: When enabling gdbtk, add "-DGDBTK" to ENABLE_CFLAGS.
-
- * configure: Regenerate.
-
-Fri Jun 26 13:56:07 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk.c: Change all references to static global "interp" to
- "gdbtk_interp" and export this global.
- (gdbtk_init): If gdbtk_source_filename is not NULL, source this file
- into the interpreter when it goes idle.
- Add new command "gdb_search".
- (gdb_search): New function which searches the symbol table.
- (gdbtk_test): New function called by main when the --tclcommand
- option is used.
-
- * main.c (main): Add a new option "--tclcommand" which is used
- by the testsuite to source a file into the interpreter when it
- goes idle.
-
-Sun Jun 21 09:31:12 1998 Ron Unrau (runrau@cygnus.com)
-
- * gdbtk.c (gdb_set_bp): Use new interface.
-
-Wed Jun 17 19:12:23 1998 Jeff Holcomb <jeffh@cygnus.com>
-
- * Makefile.in (install-only): Install tracing help files.
-
-Mon Jun 15 13:18:21 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Add elements to the auto_path AS LIST
- ELEMENTS. This allows gdbtk to work when installed in a directory
- which has a space in the path. D. Moseley pointed out the bug.
-
-
-Tue Jun 9 14:10:46 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk.c (gdb_get_vars_command): Return static variables and
- variables stored in registers.
-
- * main.c (main): Call pre/post_add_symbol_hook's when loading
- executables and symbol files.
-
-Fri Jun 5 00:16:22 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Change all references to
- GDBTK_IDE to IDE_ENABLED.
-
-Thu Jun 4 18:31:53 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Initialize tkTable.
-
-Thu Jun 4 10:15:03 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c: merged:
-
- - Elena Zannoni <ezannoni@kwikemart.cygnus.com>
- (call_obj_wrapper): in case of error, copy the
- error message from the result to the error_string.
- (gdbtk_fputs): add comments.
- (gdb_actions_command): call validate_actionline when installing the
- tracepoint, to do the syntax checking of the actions for us.
- - Elena Zannoni <ezannoni@kwikemart.cygnus.com>
- (gdb_get_trace_frame_num): new function to get the
- trace frame number from gdb.
- (gdbtk_init): added new command gdb_get_trace_frame_num.
- - Jim Blandy <jimb@zwingli.cygnus.com>
- (struct wrapped_call_objs): Change the `func' member to
- be a Tcl_ObjCmdProc, not an Tcl_CmdProc, since it accepts a vector
- of objects as arguments. Change the object vector to be const,
- since that's what all the users of this structure seem to expect.
- (call_obj_wrapper): Cast clientData properly before storing it in
- the wrapped_args structure.
-
-Thu May 28 17:19:14 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk.c (_initialize_gdbtk): Get rid of the console. Patch from
- Chris Faylor (cgf@cygnus.com).
-
- * configure.in: Link cygwin32 with subsystem console.
-
- * configure: Regenerated
-
-Sun May 24 14:00:24 1998 Keith Seitz <keiths@cygnus.com>
-
- * ser-unix.c (wait_for): Do not reset timeout_remaining for cygwin32 so that
- we can use this member to track real timeouts.
- (hardwire_readchar): Modify for cygwin32 so that we only ever use a real
- system timeout of one second. Track the "real" timeout as a series of these
- one second timeouts.
- Call ui_loop_hook to keep the gui alive.
-
- * top.c: Define new hook for cygwin32, "ui_loop_hook".
-
- * gdbtk.c (gdbtk_init): Add ui_loop_hook for CygWin32 to work around
- update problems.
-
-Thu May 21 13:56:24 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c: reinserted the changes that were accidentally deleted:
- (_initialize_gdbtk): Use correct device names in
- cygwin-specific call (cosmetic change).
- (gdbtk_ignorable_warning): removed va_list parameter,
- which was unused.
- (_initialize_gdbtk): add cygwin32 specific code to
- allow `gdb -nw' to work when specified specified from a windows
- console-mode command line.
-
-1998-05-19 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * gdbtk.c (struct wrapped_call_objs): Change the `func' member to
- be a Tcl_ObjCmdProc, not an Tcl_CmdProc, since it accepts a vector
- of objects as arguments. Change the object vector to be const,
- since that's what all the users of this structure seem to expect.
- (call_obj_wrapper): Cast clientData properly before storing it in
- the wrapped_args structure.
-
-Wed May 13 11:12:58 1998 James Ingham <jingham@leda.cygnus.com>
-
- * gdbtk.c: Fixed a goof in the definition of the gdb_get_args &
- gdb_get_locals Tcl commands. Moved the previous ChangeLog entry
- from ChangeLog to ChangeLog-gdbtk (here)...
-
-Tue May 12 13:29:20 1998 Jeff Holcomb <jeffh@cygnus.com>
-
- * Makefile.in (install-only): Add images/icons.txt and
- images2/icons.txt to files that need to be installed.
-
-Tue May 12 12:03:16 1998 James Ingham <jingham@leda.cygnus.com>
-
- * gdbtk.c: Add an object call wrapper for the new Tcl_Obj based
- commands. This way the obj commands will also go through
- catch_errors. This is just a bandaid while I rewrite the
- string-based commands to use the object format.
-
-Tue May 5 09:30:25 1998 Christopher Faylor <cgf@cygnus.com>
-
- * gdbtk.c (_initialize_gdbtk): Use correct device names in
- cygwin-specific call (cosmetic change).
-
-Wed Apr 29 15:53:16 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c (gdbtk_ignorable_warning): removed va_list parameter,
- which was unused.
-
-Tue Apr 28 19:41:33 1998 Tom Tromey <tromey@cygnus.com>
-
- * Makefile.in (GDBTKLIBS): New macro.
- (INSTALLED_LIBS): Include GDBTKLIBS.
- (CLIBS): Likewise.
- * configure: Rebuilt.
- * configure.in: Put Tcl/Tk libs into GDBTKLIBS, not LIBS.
- (GDBTKLIBS): AC_SUBST.
-
-Thu Apr 23 19:01:05 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * Makefile.in (install-only): Install help files.
-
-Wed Apr 22 21:17:35 1998 Christopher Faylor <cgf@cygnus.com>
-
- * gdbtk.c (_initialize_gdbtk): add cygwin32 specific code to
- allow `gdb -nw' to work when specified specified from a windows
- console-mode command line.
-
-Wed Apr 15 11:23:53 1998 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtcl: Remove directory and contents, this version of
- the interface is obsolete.
-
-Mon Apr 13 16:17:52 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_loadfile): Change fstat() call to stat().
- Needed because you can't convert a FILE* to an fd.
-
-Mon Apr 13 16:28:07 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c: (perror_with_name_wrapper) new function to call
- perror_with_name safely.
- (gdb_loadfile) added source vs. executable time stamp check.
- (gdbtk_warning) new function to pass a warning message to the gui.
- (gdbtk_ignorable_warning) new function to pass a warning
- to the gui. Used only for the src. vs. exec check.
- (gdbtk_init) added warning_hook
- added include <sys/stat.h>
-
-Mon Apr 13 12:58:26 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdbtk_start_timer): Include on all platforms. Decrease
- timer interval a little.
- (gdbtk_stop_timer): Include on all platforms.
- (gdbtk_wait): No more signals! Use a timer on all platforms to keep the
- GUI alive.
- (gdbtk_init): Remove FIOASYNC and all x_fd references. Now using timers
- on all platforms.
-
-Fri Apr 10 15:48:10 1998 Jason Molenda (crash@bugshack.cygnus.com)
-
- * gdbtk.c (gdb_listfiles): Allocate space for 'files' dynamically.
-
-Thu Apr 9 14:20:59 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Remove redundant variable "IDE".
-
-Tue Apr 7 15:13:58 1998 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.tcl: Remove, no longer used.
-
-Tue Apr 7 12:49:45 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_cmd): NEVER call the busy, update, and idle hooks.
-
-Tue Mar 31 15:42:06 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_loadfile): Don't use the return result from
- sprintf, which returns a char * under SunOS4.
-
-Tue Mar 31 17:18:43 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Add $(LIBIDETCL) as well as $(LIBIDE) if
- --enable-ide.
- * Makefile.in (IDE_CFLAGS_X): Add -I for libidetcl/src.
- (LIBIDETCL): Define.
- * configure: Rebuild.
-
-Sun Mar 29 21:19:46 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_get_tracepoint_info): Change formatting of address.
- (tracepoint_exists): Remove code which confuses assembly traces.
-
-Sat Mar 28 12:13:23 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_cmd): If argc > 2, assume that the busy and idle hooks
- should not be called.
-
-Thu Mar 26 22:29:28 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c: (gdb_trace_status) new function.
- (gdbtk_init) added command "gdb_is_tracing".
- (tracepoint_notify) added passcount information.
-
-Thu Mar 26 12:00:35 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_fputs): Insert fencepost.
- (gdb_loc): Correct pc calculation.
- (gdb_immediate_command): Return if a load is in progress.
- (gdb_cmd): Return if a load is in progress.
- (target_stop_wrapper): New function.
- (gdb_stop): Call target_stop_wrapper.
- (x_event): Add fencepost and optimize load cancel check.
- (gdbtk_start_timer): Set up structs only once.
- (gdbtk_stop_timer): Just use preset structs to set timer parameters.
- (gdb_loadfile): If file cannot be loaded, return error message.
- (gdb_loadfile): Add space before tab so that lines without
- a '-' can later be changed to have one.
-
-Wed Mar 25 14:08:51 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c (gdbtk_pre_add_symbol): Use Tcl_merge to form Tcl commands.
-
-Mon Mar 23 13:41:39 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c (gdb_get_mem): Rewrite to fetch entire contents
- of the memory window at once.
-
-Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- Merged changes from Foundry: list follows by author:
-
- - Tom Tromey <tromey@cygnus.com>
-
- * Makefile.in (gdbres.o): New target.
- (WINDRES): New define.
- * configure: Rebuilt.
- * configure.in (WINDRES): Define.
- (CONFIG_OBS): Include gdbres.o on Windows.
- * gdbtool.ico: New file.
- * gdb.rc: New file.
- * gdbtk.c (gdbtk_init): Call ide_create_messagebox_command.
- (gdbtk_cleanup): Call ide_interface_deregister_all.
- (gdbtk_init): Pass event handle to cleanup.
- (TclDebug): Use Tcl_Merge to construct command.
- (gdbtk_init): Call ide_create_cygwin_path_command.
-
- - Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_set_bp): Set addr_string for bp.
- (gdb_get_breakpoint_info): Demangle function
- names in breakpoint info.
- Include "demangle.h".
- (gdb_loc, gdb_listfuncs): Demangle C++
- function names.
- (gdb_set_bp): Properly quote filename to fix
- problems with spaces. Send pc back as a hex string.
- (gdb_listfuncs): Remove debugging line.
- Turn off some debugging lines.
- (breakpoint_notify): Return correct line number.
- (gdb_get_breakpoint_info): Return correct line number.
- (gdb_set_bp): New function to provide a better way to
- set breakpoints.
- (gdbtk_readline, gdbtk_readline_begin): Memory
- allocated by tcl needs to be freed by Tcl_Free().
- (find_file_in_dir): Deleted.
- (gdb_find_file_command): Call full_lookup_symtab().
- (gdb_listfuncs): Call full_lookup_symtab().
- (full_lookup_symtab): New function. Like lookup_symtab
- except handles multiple files with the same basename,
- full pathnames, and always sets symtab->fullname.
- (gdb_loadfile): Call full_lookup_symtab(). Clear
- realloc'd memory.
- (gdb_loadfile): Don't tag lines without source.
- Tag source lines with source_tag.
- (gdb_find_file_command, find_file_in_dir):
- Rewrite. Now searches symtabs and psymtabs for a match
- on the partial or full filename. Returns the full pathname.
- (gdb_loadfile): Realloc additional memory
- if someone loads in a file with more than 160,000
- lines. I don't know if this really works because
- I don't have enough memory to test it.
- (gdb_sourcelines): Deleted.
- (gdb_loadfile): New function. Takes a text widget
- and loads it with the contents of a file. Marks
- and tags source lines.
- (pc_changed): New function.
- (get_pc_register): Returns the value of
- the PC to GDB.
- (gdb_loc): If looking on the stack, return
- real pc along with calling source line.
- (gdb_loc): Return "" instead of "N/A" if
- filename is not found.
- (gdb_get_breakpoint_info): Same.
- (get_register): For Natural mode, set format to 0.
- Minor bugfixes from keiths.
- (TclDebug): New function for debugging use.
- (gdb_loc): Return correct PC for frames
- that are not the innermost frame.
- (gdb_listfiles): Rewritten to use object
- API. Now takes an optional dirname which will cause
- only files in that directory or its subdirectories
- to be returned. Now returns basenames instead of
- full pathnames.
- (gdb_cmd): Set/reset load_in_progress flag.
- (call_wrapper): Don't pop up dialog for errors in
- downloads; just abort download.
- (gdbtk_load_hash): Set return value correctly.
-
- - Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdbtk_init): Define the ui_loop_hook so that it can be
- called by routines which might block, allowing us to update the GUI.
- (gdbtk_wait): Move timer calls to annotation hooks.
- (gdbtk_init): Define the annotation hooks.
- (gdbtk_annotate_starting): New function for cygwin32 hosts.
- (gdbtk_annotate_stopped): New function for cygwin32 hosts.
- (gdbtk_annotate_exited): New function for cygwin32 hosts.
- (gdbtk_annotate_signalled): New function. for cygwin32 hosts.
- (gdbtk_init): Use gdbtk_print_frame_info hook.
- (gdbtk_print_frame_info): New function which sets current_source_symtab
- based on the given symtab and line info.
- (gdb_immediate_command): New function which does
- not buffer any
- output. (Contrast to gdb_cmd.)
- (gdb_prompt_command): New function to return gdb's prompt.
- (find_file_in_dir): New functon which searches source paths
- for a given filename.
- (gdb_find_file): New function which returns path to given file -- uses
- find_file_in_dir.
- (gdbtk_init): Install "gdb_immediate", "gdb_find_file", and
- "gdb_prompt"
- commands into interpreter.
-
- - Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdbtk_timer_going): If __CYGWIN32__, new static
- variable.
- (gdb_cmd): If __CYGWIN32__, if executing the load command, call
- gdbtk_start_timer and gdbtk_stop_timer.
- (call_wrapper): If __CYGWIN32__, if the timer is going, turn it
- off. Clear load_in_progress.
- (x_event): If load_in_progress, quit if download_cancel_ok.
- (gdbtk_start_timer): Set gdbtk_timer_going.
- (gdbtk_stop_timer): Clear gdbtk_timer_going.
- (gdbtk_wait): Call x_event.
- (gdbtk_init): Call ide_create_win_grab_command if
- __CYGIN32__.
- (gdb_clear_file): Clear stop_pc.
-
-Wed Mar 4 16:50:18 1998 Jason Molenda (crash@bugshack.cygnus.com)
-
- * gdbtk.c (gdb_listfiles): Fix thinko in last change.
-
-Wed Mar 4 15:34:49 1998 Jason Molenda (crash@bugshack.cygnus.com)
-
- * gdbtk.c (gdb_listfiles): Allocate space for 'files' dynamically.
-
-Tue Feb 10 17:50:37 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdbtk_modify_tracepoint): Define new tracepoint modification hook.
- (gdbtk_print_frame_info): Define this hook so that current_source_symtab
- is set properly.
- (gdb_actions_command): Use free_actions () from tracepoint.c/h.
-
-Mon Jan 26 11:37:55 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_actions_command): Make note of next action
- before freeing all references to it.
-
-Sat Jan 24 23:52:08 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c: Merge from Foundry branch.
- (TclDebug): New debugging function.
- (gdb_loc): For frames, find address of calling function
- instead of whatever is on the stack (usually the next
- instruction).
- (gdb_listfiles): Takes an optional pathname argument and
- returns an alphabetized list of basenames of files in the
- path.
-
-Wed Jan 22 10:37:02 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * symfile.c: Define two new hooks for symbol reading:
- "pre_add_symbol_hook" and "post_add_symbol_hook". These hooks
- are called before we begin reading symbols, and after we finish.
- (generic_load): Use new symbol reading hooks and get rid of
- compiler warning.
-
- * gdbtk.c (gdbtk_init): Add hooks for pre- and post-symbol reading.
- (gdbtk_pre_add_symbol): New function: the pre-add-symbol hook.
- (gdbtk_post_add_symbol): New function: the post-add-symbol hook.
- (find_file_in_dir): New function. Moved the guts of gdb_find_file_command
- into here to allow its use by others.
- (gdb_loc): Use find_file_in_dir to return the real path to the file
- (or "N/A" if we can't find it).
-
- * configure.in (TIX_LIB_EXT): Define new variable for those special cases
- when TCL_SHLIB_SUFFIX is not enough to specify the dependency.
-
- * configure: Regenerate.
-
-Fri Jan 23 07:47:06 1998 Fred Fish <fnf@cygnus.com>
-
- * Makefile.in (uninstall): Remove installed gdbtcl dir, if one
- was installed.
-
-Thu Jan 15 12:42:28 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_immediate_command): New function which does not buffer any
- output. (Contrast to gdb_cmd.)
- (gdbtk_init): Install "gdb_immediate" command into interpreter.
-
-Wed Jan 14 16:38:44 1998 Keith Seitz <keiths@pizza.cygnus.com>
-
- * configure.in (--enable-gdbtk): If tcl was built with --enable-shared,
- use TCL_SHLIB_SUFFIX to specify the suffix of the library file so that
- we don't expect to see "libfoo.a" instead of "libfoo.{so,sl, etc}".
-
- * configure: Regenerate.
-
-Wed Dec 31 16:50:26 1998 Keith Seitz (keiths@onions.cygnus.com)
-
- * gdbtk.c (gdb_actions_command): extract and save step count
- from "while-stepping" command
-
diff --git a/gdb/gdbtk/generic/ChangeLog-1999 b/gdb/gdbtk/generic/ChangeLog-1999
deleted file mode 100644
index b5788594070..00000000000
--- a/gdb/gdbtk/generic/ChangeLog-1999
+++ /dev/null
@@ -1,2624 +0,0 @@
-1999-09-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * gdbtk-varobj.c (variable_value): Fix small memory leak.
-
-Thu Nov 18 18:19:59 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk.c (tk_command), gdbtk-hooks.c (gdbtk_readline),
- gdbtk-variable.c (variable_type): Replace strdup with xstrdup.
-
-Thu Nov 18 19:03:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c (gdb_get_mem): Document nbr parameter. Fix check
- on nbr and nbytes parameters.
-
-1999-11-18 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk-cmds.c (gdb_actions_command): Updated for new
- get_tracepoint_by_number.
-
-Tue Nov 9 15:40:51 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c (gdb_get_mem): Keep calling
- target_read_memory_partial until all the data is read.
-
-1999-11-01 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk-cmds.c (gdb_actions_command): Updated for new
- get_tracepoint_by_number.
-
-Fri Oct 15 18:34:41 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-hooks.c (ui_load_progress_hook): Move extern declaration
- to defs.h.
- (gdbtk_load_hash): Update SECTION argument to match prototype.
- Make static.
-
-Wed Oct 13 17:57:17 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_flush): Delete.
- (gdbtk_add_hooks): Don't initialize flush_hook.
-
-Mon Oct 11 10:19:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c (gdb_get_tracepoint_info): Use paddr_nz to convert
- the address into a string.
-
-1999-10-05 James Ingham <jingham@leda.cygnus.com>
-
- * gdbtk-cmds.c (map_arg_registers): Don't stop at the first
- undefined register, but skip it and go on. There may be other
- defined registers higher up in the list.
-
-1999-09-29 Fred Fish <fnf@cygnus.com>
-
- * gdbtk-varobj.c (variable_create): Replace cast "(CORE_ADDR) - 1"
- with the more obviously intended expression "(CORE_ADDR) -1".
-
-1999-09-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * gdbtk-variable.c (variable_value): Fix handling of baseclasses and
- correct the behavior when it is not a baseclass (both cases could
- potentially dumping core).
-
-1999-09-23 James Ingham <jingham@leda.cygnus.com>
-
- * gdbtk.c (gdbtk_init): Add the initialization of the shell
- execute command under cygwin.
-
- * gdbtk-hooks.c (gdbtk_attach): New function, run from the attach
- hook.
- (gdbtk_detach): New function, run from the detach hook.
- (gdbtk_add_hooks): Add the attach & detach hooks.
-
-1999-09-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * gdbtk-varobj.c (variable_create): Dynamically allocate variable
- object name string.
-
-1999-09-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * gdbtk-variable.c (_gdb_variable): Remove unused entry.
- (variable_update): Fix error in list initialization (apparently
- innocuous).
- (type_changeable): Fix handling of typedef'ed structs and
- unions (removing c_variable.exp test case 2.12 FAIL).
-
-Mon Sep 20 18:03:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-variable.c (new_root_variable): Fix prototype declaration.
- * gdbtk.c (_initialize_gdbtk): Add declaration.
- * gdbtk-cmds.c (tracepoint_exists): Make static. Add declaration.
- * gdbtk.c (gdbtk_add_hooks): Move declaration from here.
- * gdbtk.h (gdbtk_add_hooks): To here.
-
-Fri Sep 17 19:00:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c: Include "source.h".
- (gdb_load_disassembly): Fix printf calls.
- Makefile.in (gdbtk-cmds.o): Add dependency on source.h.
-
- * gdbtk.c: Include <itk.h> for Itk_Init.
-
-1999-09-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * gdbtk-varobj.c: New file. It supersedes gdbtk-variable.c and
- uses standard gdb varobj code.
-
-Fri Sep 3 20:16:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk.c (gdbtk_init): Cast ``host_name'' and ``target_name'' to
- void. While Tcl_SetVar2 treats the value argument as read-only
- its prototype does not specify const for the parameter.
-
-Mon Aug 30 17:56:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk.c, gdbtk-hooks.c, gdbtk-cmds.c: #include <unistd.h> moved
- to defs.h.
-
-Mon Aug 30 15:34:42 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-hooks.c (x_event): Missing result to return - return 0.
- Make in_x_event volatile.
- (in_fputs): Make volatile.
-
-1999-09-02 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.c: Include version.h, remove inconsistent decls of
- host_name and target_name.
-
-1999-08-27 James Ingham <jingham@leda.cygnus.com>
-
- * gdbtk.h: Add def'n for gdbtk_fputs, since it is needed outside
- of gdbtk-hooks.c
-
- * gdbtk-cmds.c (gdb_load_disassembly): Really implement this
- function. Load the source widget from C.
- (gdbtk_load_source): Helper for the above, which loads source lines.
- (gdbtk_load_asm): Helper for the above, which loads assembly
- lines.
- (gdb_restore_fputs): New function, restore the gdbtk_fputs hook,
- in case somebody supressed it, and then errored out before they
- got a chance to put it back.
-
-1999-08-10 James Ingham <jingham@leda.cygnus.com>
-
- * gdbtk-hooks.c: Remove the gdb_disassembly_flavor_hook. Use the
- set_hook instead.
-
-Mon Aug 9 10:28:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk.c, gdbtk-cmds.c: Delete #if ANSI_PROTOTYPES code, GDB
- assumes ISO-C.
-
-1999-08-06 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_add_hooks): Set `set_hook'.
- (gdbtk_set_hook): New function.
-
-1999-08-05 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-variable.c (new_variable): Add missing return value.
-
-1999-08-02 James Ingham <jingham@leda.cygnus.com>
-
- * gdbtk-cmds.c: Misc. Cleanups... Mostly wrapping at 80
- characters.
- (gdb_loadfile): Go straight to the widget command to insert the
- text, rather than through the interpreter. Gives about 2x-3x
- speedup in rendering the source text.
- (gdb_disassemble): Rewrite to separate out the generic disassembly
- work from the printing part. The former goes in
- gdb_disassembly_driver. This way I can share the code with the
- version that loads the text widget directly.
- (gdb_load_disassembly): New function. This will load the text
- widget directly (not done yet).
- (gdbtk_load_source): Load the text widget with a source line.
- (gdbtk_load_asm): Load the text widget with an assembly line.
- (gdbtk_print_source): Print a source line to stdout.
- (gdbtk_print_asm): Print an assembly line to stdout.
- (gdb_disassemble_driver): New function.
-
- * gdbtk.h: Fix a compiler warning from Keith's 07-27 checkin.
-
-1999-08-02 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-variable.c (CPLUS_FAKE_CHILD): NULL variables are not
- "fakes", either.
-
-1999-07-27 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-variable.c: Rewrite. :-)
- * gdbtk-wrapper.c (GDB_value_ind): New function.
- (GDB_value_slice): New function.
- (GDB_value_coerce_array): New function.
- (GDB_value_struct_elt): New function.
- (GDB_value_cast): New function.
- (GDB_get_frame_block): New function.
- (wrap_value_slice): New function.
- (wrap_value_coerce_array): New function.
- (wrap_value_struct_elt): New function.
- (wrap_value_cast): New function.
- (wrap_get_frame_block): New function.
- * gdbtk-wrapper.h: Add declarations for above new functions.
- * gdbtk-cmds.c (gdb_selected_block): New function.
- (gdb_get_blocks): New function.
- (gdb_block_vars): New function.
-
-1999-07-16 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (gdb_loc): Change all references of "stop_pc" to
- "read_pc ()".
-
- * gdbtk.c (target_is_native): New function.
- (target_should_use_timer): Use target_is_native to determine whether
- the timer should run.
- * gdbtk.h (target_is_native): Add prototype.
- * gdbtk-cmds.c (gdb_disassemble): Use target_is_native to determine if
- we should disassemble from inferior memory.
-
-1999-07-09 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * gdbtk-variable.c (variable_obj_command): Add missing comments
- for object variable commands.
-
-Fri Jul 9 12:06:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c (Gdbtk_Init): Explicitly route log/debug and target
- output to stderr instead of stdout.
-
-1999-06-21 James Ingham <jingham@leda.cygnus.com>
-
- * gdbtk.c (target_should_use_timer): Add check for "linuxthreads"
- to enable the timer for Linux as well as other natives.
-
-1999-06-15 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_annotate_signal): Run
- gdbtk_stop_idle_callback so that signals don't interfere
- with the stop button.
-
-1999-06-10 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Add host_name and target_name to
- GDBStartup.
-
- * gdbtk-cmds.c (gdb_clear_file): Delete breakpoints and
- clear the exec file, too.
- (gdb_loadfile): Don't close a file that's not opened until
- later.
-
-Wed Jun 9 14:21:40 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c (old_regs): Change array to a pointer.
- (setup_architecture_data): New function.
- (Gdbtk_Init): Call setup_architecture_data. Register ``old_regs''
- as an architecture dependant variable.
-
-1999-05-25 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-wrapper.c (GDB_val_print): Fix compiler warnings.
- (wrap_val_print): Ditto.
- (GDB_block_for_pc): Ditto.
- (wrap_block_for_pc): Ditto.
- (GDB_find_frame_addr_in_frame_chain): Ditto.
- (wrap_find_frame_addr_in_frame_chain): Ditto.
-
- * gdbtk-variable.c (variable_create): Rename "-pc" option
- to the more explicit name "-frame". Update usage.
- (create_variable): Swallow errors before parse_exp_1, too.
- If no frame is given as an argument, use the current frame;
- otherwise, use the current block in the specified frame.
- (variable_children): Check for errors creating children.
- (create_child): Ditto.
-
- * gdbtk-cmds.c (get_selected_frame): New function.
- (Gdbtk_Init): Add get_selected_frame to interpreter.
- (gdb_get_vars_command): Use current block in selected frame
- if no args specified.
-
- * Makefile.in (gdbtk-cmds.o): Depend on frame.h, too
-
-Tue May 25 16:12:57 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c (REGISTER_CONVERTIBLE,
- REGISTER_CONVERT_TO_VIRTUAL): Delete default definitions.
- gdbarch.h ensures that there is always a definition available.
-
-1999-05-20 Andrew Cagney <cagney@b1.cygnus.com>
-
- Mon Apr 26 09:15:27 1999 Andrew Cagney <cagney@b1.cygnus.com>:
- * gdbtk.c (x_event_wrapper): Wrapper for x_event that matches
- signal function signature.
- (gdbtk_start_timer): set .sa_handler to x_event_wrapper instead of
- x_event.
-
-1999-05-14 Keith Seitz <keiths@cygnus.com>
-
- * configure.in (ENABLE_GDBTK): Don't clobber WIN32LIBS.
- * configure: Regenerated.
-
-1999-04-12 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-variable.c (variable_value_changed): Swallow errors from
- evaluate_expression.
-
-1999-04-09 James Ingham <jingham@cygnus.com>
-
- * gdbtk-cmds.c (gdb_get_mem): Use the Tcl list API to add the
- ASCII entry to the return list. We were trying to do the quoting
- by hand which is bound to lose in some cases.
-
-1999-04-06 Martin Hunt <hunt@cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_annotate_signal): New function.
- Notifies GDBtk when a signal occurs.
-
-1999-04-02 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_force_detach): New global.
- (x_event): Change to return gdbtk_force_detach so that
- callers will know if we want to detach. See comments.
- (gdbtk_wait): Insert calls to gdbtk_start/stop_timer. This
- is a nop for most hosts/targets. Remove ice-specific code.
-
- * gdbtk-cmds.c (gdb_stop): Add "detach" option, which forces
- gdb to detach from the target. See comments.
-
- * gdbtk.c (target_should_use_timer): New function.
- (gdbtk_start_timer): Only use on unix native targets.
- (gdbtk_stop_timer): Ditto.
-
- * gdbtk.h (x_event): Update declaration: now returns an int.
-
-1999-03-29 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.c, gdbtk-cmds.c, gdbtk-hooks.c: Don't include setjmp.h.
-
-1999-03-29 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (pc_function_name): New function which returns the
- source name (regardless of mangling) of the function at a given PC.
- (gdb_get_function_command): Use it.
- (gdb_get_tracepoint_info): Ditto.
- (gdb_loc): Ditto.
- (gdb_get_breakpoint_info): Ditto.
-
- * Makefile.in (install-only): Don't install help/index.toc: it doesn't
- exist anymore.
-
-Wed Mar 10 19:37:23 1999 Geoffrey Noer <noer@cygnus.com>
-
- * gdbtk-cmds.c: Don't need to include any Win32 API headers.
- * gdbtk-hooks.c: Include Windows.h, not just winuser.h.
- * gdbtk.c: Ditto.
-
-1999-03-04 Martin Hunt <hunt@cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_load_hash): Change download_hash()
- to Download::download_hash().
-
-1999-03-01 Martin Hunt <hunt@cygnus.com>
-
- * gdbtk.c (TclDebug): Increase buffer size to 10000, in case
- backtraces are very long.
-
-1999-02-26 James Ingham <jingham@cygnus.com>
-
- * gdbtk-cmds.c (gdb_search): Add a -filename switch, which returns
- the file in which the function or type was defined, along with the
- function...
-
- * gdbtk.c (gdbtk_find_main): The external editor stuff was getting
- set twice...
-
-1999-02-18 Martin Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_disassemble): When debugging native threads,
- set disassemble_from_exec to 0. This fixes bugs where disassembly
- of threaded programs failed.
-
-1999-02-16 James Ingham <jingham@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Remove redundant setting of the external
- editor variables.
-
-1999-02-11 Martin Hunt <hunt@cygnus.com>
-
- * gdbtk-variable.c (variable_format): Enable binary format.
-
-1999-02-11 Martin Hunt <hunt@cygnus.com>
-
- * gdbtk-hooks.c: Change ALL Tcl_Eval calls in hooks to
- call report_error() if there are errors.
-
-1999-02-11 Martin Hunt <hunt@cygnus.com>
-
- * gdbtk.c, gdbtk-cmds.c, gdbtk-hooks.c: Removed old IDE stuff.
-
-1999-02-09 Martin Hunt <hunt@cygnus.com>
-
- * gdbtk-hooks.c: Remove gdbtk_ignorable_warning prototype.
- It is in gdbtk.h.
- (report_error): New function. Displays debugging information
- if a hook function fails. All hook functions should probably
- call this.
- (gdbtk_warning): Call report_error() if there is a problem.
- (gdbtk_register_changed): Call report_error() if there is a problem.
- (gdbtk_memory_changed): Call report_error() if there is a problem.
- (gdbtk_ignorable_warning): Pass along class argument. If there
- is a problem, call report_error().
-
- * gdbtk-cmds.c: Remove TclDebug prototype. It is in gdbtk.h.
- (gdb_loadfile): Add class name to gdbtk_ignorable_warning call.
-
- * gdbtk.c (TclDebug): Add "priority" argument. Calls "dbug"
- instead of "debug". Removed non-ANSI ifdefs.
-
- * gdbtk.h: Fixed protos for gdbtk_ignorable_warning and TclDebug.
-
-1999-02-05 James Ingham <jingham@cygnus.com>
-
- * Makefile.in: Add GDBTK_CFLAGS - this is now used to hold
- -fwritable-strings when compiling with Tk8.1.
- * configure.in: Add GDBTK_CFLAGS, set it to -fwritable-strings for
- Tcl/Tk8.1 & greater.
- * acinclude.m4: Move the rest of the defines to find Itcl, Itk &
- Tix from aclocal.m4 to here.
- * aclocal.m4: regenerate.
- * configure: regenerate.
-
- * gdbtk-hooks.c (x_event): Tcl_ObjGetVar2 was removed from
- Tcl8.1. Use Tcl_GetVar2 instead.
- * gdbtk-hooks.c (gdbtk_trace_find): Fix up call to
- Tcl_GlobalEvalObj for Tcl/Tk 8.1.
- * gdbtk-hooks.c (gdbtk_trace_start_stop): Call to Tcl_EvalObj was
- inefficient, replace with call to Tcl_GlobalEval.
- * gdbtk.c: Don't swap out the Tcl_Alloc calls in gdbtk.c. We took
- care of that in Tcl itself for 8.1.
- * gdbtk.c: Remove const from the script string since Tcl8.1 has
- taken to scribbling sentinals into strings passed to it again...
-
- * gdbtk-cmds.c (wrapped_call): Change declaration of 1st arg from
- char * to PTR to eliminate warning.
- * gdbtk-cmds.c (perror_with_name_wrapper): Ditto
-
-Thu Feb 4 10:35:28 1999 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-variable.c (variable_create): Allocate enough
- space to hold the NULL, too!
-
-Wed Feb 3 13:37:07 1999 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-variable.c (variable_create): Add parentheses to the name
- so that casts do not confuse the expression parser.
-
-1999-02-03 Keith Seitz <keiths@cygnus.com>
-
- * gdbtool.ico: Add missing desktop image.
-
-1999-02-02 Martin Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (get_register): For RAW display, concat all the
- pieces together before calling fputs.
-
-1999-02-01 Martin Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c: (gdb_set_bp): Change the "type" argument
- to be ASCII instead of an integer. Currently accepts "temp"
- or "normal". Fixed error messages.
- (gdb_set_bp_addr): Ditto.
-
-1999-01-29 James Ingham <jingham@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Set the fputs_unfiltered_hook to
- gdbtk_fputs BEFORE you eval script. The old code was setting it
- to null until after you did this, but that is wrong, because it
- will cause the output of CAUGHT errors to go to gdb_stderr, which
- is wrong. You only want to write errors to the console if the
- eval generates an error.
-
-1999-01-29 Martin Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_get_breakpoint_info): When printing addresses,
- do not rely on the format string "%lx" -- it does not exist for all
- hosts. Use paddr instead.
- (gdb_loadfile): Increase maximum line size to pass testsuite cases.
-
- * gdbtk-hooks.c (gdbtk_add_hooks): Remove pc_changed_hook and
- add register_changed_hook and memory_changed_hook.
- (gdbtk_register_changed): New function.
- (gdbtk_memory_changed): New function.
-
- * gdbtk.c (gdbtk_init): Create tcl warp_pointer command
- for use with testing.
-
- * gdbtk-cmds.c (gdb_loc): Fix for case where there are only
- minimal symbols. Also make gdb_loc return the shared library
- the location is in, if it is in one.
-
-1999-01-27 James Ingham <jingham@cygnus.com>
-
- * gdbtk-wrapper.c: Missed a couple of places where FILE->GDB_FILE
- in the fputs_unfiltered_hook needed to propagate.
-
-1999-01-27 James Ingham <jingham@cygnus.com>
-
- Merging in changes from gdbtk-980810 - the Itcl3
- gdb branch.
-
- 1999-01-12 Martin Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_loadfile): Increase maximum line size so
- files with very long lines get numbered correctly.
-
- Thu Jan 7 06:50:32 1999 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_add_hooks): Add the error_begin_hook;
- (gdbtk_error_begin): New function.
- (gdbtk_fputs): If GDBTK_ERROR_ONLY is set, treat output to
- any stream as if it had come from gdb_stderr.
-
- * gdbtk.h: Define GDBTK_SYMBOL_SOURCE_NAME: does the same thing
- as SYMBOL_SOURCE_NAME, except that it NEVER returns a mangled name.
- Define GDBTK_ERROR_ONLY flag for result_ptr.
-
- * gdbtk-cmds.c (gdb_listfuncs): Use SYMBOL_DEMANGLED_NAME to
- get the symbol's fully demangled name (including class and
- args for overloaded funcs), not cplus_demangle.
- (get_frame_name): Use GDBTK_SYMBOL_SOURCE_NAME to get the name
- of the frame level.
-
- * gdbtk-wrapper.c, gdbtk-wrapper.h:
- (GDB_val_print): Allow caller to specify all function args to val_print.
- (wrap_val_print): Ditto.
-
- * gdbtk-variable.c (variable_value): Clear addressprint when getting
- value of C++ reference-type variables
- If we errored because a parent (struct pointer) was junk, output
- an error message indicating so.
- (call_gdb_val_print): Tell val_print to dereference C++ reference
- types.
- (number_of_children): void * also has no children.
- (get_call_output): Clear any error flags that may have been set
- as a result of error_begin.
-
- * utils.c (error_begin_hook): New hook.
- (error_begin): Call error_begin_hook so that the GUI
- gets notified.
-
- * defs.h (error_begin_hook): Declare.
-
- Wed Jan 6 08:43:31 1999 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-wrapper.c, gdbtk-wrapper.h: Add wrappers for parse_exp_1,
- evaluate_type, block_for_pc, block_innermost_frame, reinit_frame_cache,
- and find_frame_addr_in_frame_chain.
-
- * gdbtk-variable.c (variable_create): Check for failure when
- creating variables.
- (create_variable): Use wrapped calls for block_for_pc, parse_exp_1,
- and block_innermost_frame.
- Return NULL if parse_exp_1 fails.
- Attempt to prohibit creating a gdb_variable for type names.
- (variable_value_changed): Use wrapped calls for reinit_frame_cache and
- find_frame_addr_in_frame_chain.
- (variable_type): Use wrapped call for evaluate_type.
- (variable_value): Use wrapped call for parse_exp_1.
- (variable_editable): Use wrapped call for evaluate_type.
-
- Tue Jan 5 11:37:17 1999 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-variable.c: New variable object interface.
- * gdbtk-wrapper.c, gdbtk-wrapper.h: New wrappers for safely calling
- gdb functions without the fear of longjmp'ing.
- * configure.in (CONFIG_OBS): Add gdbtk-wrapper.o and gdbtk-variable.o
- when gdbtk is enabled.
- * configure: Regenerate.
- * Makefile.in: Add gdbtk-wrapper.o and gdbtk-variable.o
- * gdbtk-cmds.c (call_wrapper): Export so that other files can use.
- (Gdbtk_Init): Initialize new variable interface.
- * gdbtk.h: Add declaration for call_wrapper.
-
- Tue Jan 5 11:19:14 1999 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (gdb_loc): Call resolve_sal_pc to before using
- the sal's pc.
-
- * gdbtk.c (gdbtk_init): Add global array GDBStartup to interpreter
- which contains any startup info. Add "inhibit_prefs" (follows -nx)
- so that "-nx" turns preference reading/writing off.
-
- Mon Dec 21 11:11:02 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (get_register): Call get_saved_register instead of
- read_relative_register_raw_bytes to fetch registers.
-
- Thu Dec 17 09:00:56 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (gdb_search): Don't mention C++ RTTI and
- global constructor/destructor symbols.
-
- Thu Nov 12 15:20:15 1998 Jim Ingham <jingham@cygnus.com>
- * More bug fixes merged in from devo.
-
- * gdbtk-cmds.c (gdb_cmd): Added an optional second argument to the
- gdb_cmd, which is from_tty. This is passed to the gdb command
- parser. It is 0 by default, and the console window passes 1.
-
- * gdbtk-cmds.c: moved disassemble_from_exec from gdbtk.c to gdbtk-cmds.c
- with all the other link-var'ed variables
-
- * gdbtk-hooks.c (gdbtk_trace_find): Only run the hook functions if
- we are called from_tty.
-
- * gdbtk-hooks.c (gdbtk_trace_start_stop): Set the trace buttons
- from a trace_start_command callback rather than doing it as a
- special case in gdb_cmd.
-
- * tracepoint.c (tstart_command, tstop_command): Add call to
- trace_start_stop_hook here.
-
- 1998-11-04 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_set_bp_addr): For callback, send full
- pathname instead of just basename.
-
- 1998-11-03 Keith Seitz <keiths@cygnus.com>
- * v850ice.c (do_gdb): New function.
- (ice_stepi): Use do_gdb to step properly.
- (ice_nexti): Use do_gdb to step properly.
- (view_source): Correct call to src window's location for new version.
-
- Tue Aug 25 18:13:30 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk.c (gdbtk_init): I hadn't excised ALL the old startup code,
- so it was not working correctly. Now it does.
-
- Fri Aug 21 14:37:40 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Changed the startup code to use
- tcl_findLibrary
-
-
-
-
-on Dec 28 17:44:36 1998 David Taylor <taylor@texas.cygnus.com>
-
-
- The following changes were made by Jim Blandy <jimb@cygnus.com>,
- Edith Epstein <eepstein@cygnus.com>, Elena Zannoni
- <ezannoni@cygnus.com> Stan Shebs <shebs@cygnus.com>, and David
- Taylor <taylor@cygnus.com>, as part of the project to merge in
- changes originally made by HP; HP did not create ChangeLog
- entries.
-
- * gdbtk.c (gdbtk_init): change stderr to gdb_stderr.
-
- * gdbtk-cmds.c
- (get_pc_register): Use paddr_nz, not sprintf's %llx and
- a cast to `long long'. Those aren't portable.
- (gdb_eval): add embedded_offset param to val_print call
- (get_register): add embedded_offset param to val_print call
-
- * gdbtk-hooks.c
- (tk_command_loop): change instream to a FILE.
- (gdbtk_flush): change both the declaration and definition to
- use GDB_FILE rather than FILE.
-
-Mon Dec 21 11:11:02 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (get_register): Call get_saved_register instead of
- read_relative_register_raw_bytes to fetch registers.
-
-Thu Dec 17 09:00:56 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (gdb_search): Don't mention C++ RTTI and
- global constructor/destructor symbols.
-
-Tue Dec 15 10:09:31 1998 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c (gdb_disassemble): Fix typo.
-
-Sun Dec 13 09:52:51 1998 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c: Update TARGET_PRINT_INSN_INFO, TARGET_PRINT_INSN.
-
-Fri Dec 11 09:52:04 1998 Andrew Cagney <cagney@chook>
-
- * gdbtk-cmds.c: Replace reg_name with REGISTER_NAME.
-
-Mon Dec 14 13:20:50 1998 Jim Ingham <jingham@cygnus.com>
-
- * Makefile.in, configure.in configure - add support for LIBGUI
- outside the IDE context.
-
-Thu Nov 19 13:14:57 1998 Geoffrey Noer <noer@cygnus.com>
-
- * gdbtk-cmds.c: Can't start using new API names yet. Switch back
- to calling cygwin32_ funcs until some time has passed...
- * gdbtk.c: Ditto. Also, include sys/cygwin.h for Cygwin, instead
- of providing own proto.
-
-Fri Nov 13 00:15:08 1998 Geoffrey Noer <noer@cygnus.com>
-
- Changes to account for name change from cygwin32 to cygwin and
- clean up Win32-related ifdefs.
-
- * gdbtk.c: lose "32" from cygwin_ func calls. ifndef for
- checking DISPLAY should be for _WIN32, not WINNT.
- * gdbtk.h: pick GDBTK_PATH_SEP based on _WIN32, not WINNT.
- * gdbtk-cmds.c (gdb_path_conv): lose "32" from cygwin_ func call,
- change ifdef to __CYGWIN32__ instead of WINNT.
- * {gdbtk.c, gdbtk-hooks.c}: __CYGWIN32__ refs drop the "32".
-
-Thu Nov 12 15:20:15 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk-cmds.c (gdb_cmd): Added an optional second argument to the
- gdb_cmd, which is from_tty. This is passed to the gdb command
- parser. It is 0 by default, and the console window passes 1.
-
- * gdbtk-cmds.c: moved disassemble_from_exec from gdbtk.c to gdbtk-cmds.c
- with all the other link-var'ed variables
-
- * gdbtk-hooks.c (gdbtk_trace_find): Only run the hook functions if
- we are called from_tty.
-
- * gdbtk-hooks.c (gdbtk_trace_start_stop): Set the trace buttons
- from a trace_start_command callback rather than doing it as a
- special case in gdb_cmd.
-
- * tracepoint.c (tstart_command, tstop_command): Add call to
- trace_start_stop_hook here.
-
-Wed Nov 4 12:41:42 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk-cmds.c (gdb_set_bp_addr): Pass the type, enable & thread
- to gdbtk_tcl_breakpoint.
- * gdbtk-hooks.c (gdbtk_trace_find): Added this function. It is
- the hook function for tfind commands.
- * tracepoint.c (trace_find_command): Added the trace_find_hook,
- run when you do trace_find_command.
- * tracepoint.h: Define the trace_find_hook.
-
-1998-11-03 Keith Seitz <keiths@cygnus.com>
-
- * v850ice.c (do_gdb): New function.
- (ice_stepi): Use do_gdb to step properly.
- (ice_nexti): Use do_gdb to step properly.
- (view_source): Correct call to src window's location for new version.
-
-Mon Nov 2 11:16:10 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk-cmds (gdb_get_tracepoint_info): Demangle C++ function names.
-
-Fri Oct 30 11:22:23 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk-cmds (gdb_get_tracepoint_info): Fixed typo.
-
-Wed Oct 28 16:19:02 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_set_bp_addr): For callback, send full
- pathname instead of just basename.
-
-Wed Oct 28 10:14:33 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk-cmds.c: Made the bdtypes & bpdisp arrays shared so they
- could be used in gdbtk-hooks.c (breakpoint_notify).
- Also fixed a few error messages to actually print the bp number
- rather that #%d...
- * gdbtk-hooks.c (breakpoint_notify): pass more of the information
- about the breakpoint into the Tcl command, so it does not have to
- try and guess about information we have on the C side.
- * gdbtk.h: Export the bptypes & pbdisp arrays.
-
-1998-10-13 Jason Molenda (jsm@bugshack.cygnus.com)
-
- * gdbtk.c, gdbtk-cmds.c: Cast parameters passed to make_cleanup to
- use the new make_cleanup_func typedef.
-
-1998-10-08 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_add_hooks): Install a hook for
- (new) file_changed_hook.
- (gdbtk_exec_file_changed): Rename to gdbtk_exec_file_display
- to mimic hook's name.
- (gdbtk_file_changed): New hook function.
-
-Tue Oct 6 22:57:13 1998 Andrew Cagney <cagney@b1.cygnus.com>
-
- * configure.in (links): Link gdbtcl2 directory instead of gdbtcl.
-
-Mon Oct 5 00:34:00 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_set_bp_addr): New command. Sets a
- breakpoint at an address. Use this instead of gdb_cmd "break"
- because the syntax of the break command is broken and doesn't
- allow you to create a thread-specific BP at an address. Also
- this is faster.
-
-Sun Oct 4 22:35:47 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_set_bp): Add an optional thread number.
- (gdb_find_bp_at_line): New function. Returns a list of bpnums
- at the specified line number.
- (gdb_find_bp_at_addr): New function. Returns a list of bpnums
- at an address..
-
-1998-10-02 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_exec_file_changed): New function which handles
- exec_file changes.
- (gdbtk_add_hooks): Define exec_file_display_hook (to gdbtk_exec_file_changed)
-
- * gdbtk-cmds.c (gdb_stop): target_stop is ALWAYS defined, so
- compare against something a little more meaningful (target_ignore).
-
-1998-09-24 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk.c (gdbtk_wait): Don't run the timer for ice targets.
-
- * v850ice.c (WM_ADDR_TO_SYM): New message.
- (v850ice_wndproc): Add handler for WM_SOURCE.
- (v850ice_wait): Call the ui_loop_hook occasionally.
- (ice_cont): Acknowledge message before doing anything.
- (ice_stepi): Ack message and let gdbtk do stepping.
- (ice_nexti): Ack message and let gdbtk do stepping.
- (view_source): New function ICE calls to display source code.
-
-1998-09-18 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (get_frame_name): Demangle function names, too.
-
-Thu Sep 10 22:10:29 1998 Jim Ingham <jingham@cygnus.com>
-
- *gdbtk-cmds.c (gdb_disassemble): Make sure the symtab's linetable is not
- null before trying to use it...
-
-1998-09-02 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (gdb_cmd): Do not run the timer when downloading --
- the ui_progress_hook that has been installed will actually
- update the gui for us.
-
-Mon Aug 31 15:42:10 1998 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk-hooks.c (context_hook): Don't define.
-
-1998-08-31 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (gdb_listfuncs): When stripping out "global destructors"
- and "global constructors", do not append any elements to the result.
-
-Sun Aug 30 00:49:18 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (Gdbtk_Init): Link C variable gdb_context
- with tcl variable gdb_context_id.
-
- * gdbtk-hooks.c (gdbtk_context_change): Implement new hook called
- context_hook. Called when threads change.
-
- * gdbtk.c: Initialize gdb_context.
-
- * gdbtk.h: Declare gdb_context.
-
- * infrun (wait_for_inferior): Call context_hook.
-
- * thread.c (thread_command): Call context_hook.
-
- * defs.h: Declare context_hook.
-
-Fri Aug 28 12:14:49 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_loadfile): Open the file after doing
- the symtab lookup and calling symtab_to_filename(). This
- makes GDBtk work with the GDB "dir" command.
-
-1998-08-18 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-hooks.c (gdbtk_add_hooks): Set selected_frame_level_changed_hook.
- (gdbtk_selected_frame_changed): New function.
-
- * gdbtk-cmds.c (Gdbtk_Init): Add command gdb_stack into interpreter.
- Link gdb's global selected_frame_level with interpreter global
- gdb_selected_frame_level.
- (gdb_stack): New function to faciltate speedier backtraces from
- gdbtk.
- (get_frame_name): New helper function for gdb_stack.
-
-Tue Aug 18 15:42:40 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_listfuncs): Strip out global constructors
- and destructors from the function list.
-
-Thu Aug 13 15:09:59 1998 Drew Moseley <dmoseley@cygnus.com>
-
- * gdbtk.c (gdbtk_cleanup): added a scope-level around the contents
- of the #ifdef so that the variable declarations in there would not
- be illegal in a C compilation.
-
-Mon Jul 27 13:07:16 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_call_command): Removed because it is now
- in gdbtk-hooks.c
- (null_routine): Removed.
-
- * gdbtk-hooks.c (tracepoint_notify): Fix sprintf to
- match number of arguments.
-
- * gdbtk-cmds.c (gdb_loc): When calling gdb_loc with an
- argument, call find_pc_line() to get a complete
- symtab_and_line struct.
-
-Fri Jul 24 14:25:43 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk-cmds.c (gdb_search): Add missing NULL to switches.
- Add missing flags to result_ptr.
- Pass along any errors caused by getting the list of files from
- tcl.
- Allocate correct amount of memory for the file list.
- Don't do any unecessary cleanups.
-
-Fri Jul 24 01:08:37 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk-cmds.c (gdb_loadfile): When there are no
- linenumbers, use only one tab.
-
-Sat Jul 18 12:28:39 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_cleanup): Add call to tcl function
- gdbtk_cleanup. We need this so the GUI gets to clean
- up no matter how GDB exits.
-
-Wed Jul 1 13:10:58 1998 Jim Ingham <jingham@cygnus.com>
-
- * Moved gdbtk_hooks.c & gdbtk_cmds.c to gdbtk-hooks.c &
- gdbtk-cmds.c to comply with the gdb conventions. Changed the
- configure & makefile to reflect the change...
-
-Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk.c: removed all the commands and hooks from this file so
- now it contains only the startup code.
- * gdbtk.c (gdbtk_init): Fixed a bug in the startup code on Windows
- that caused gdbtk not to find the share directory unless
- GDBTK_LIBRARY was set.
- * gdbtk_cmds.c: New file - this contains all the Tcl commands that
- gdb defines. All the old commands were moved here, the
- string-based commands were converted to object commands, and the
- object-based commands were all converted to uniformly use the
- call_wrapper. A new function, Gdbtk_Init was added to centralize
- initializing the gdb package.
- * gdbtk_hooks.c: New file - All the hooks were moved here, and a new
- function, gdbtk_add_hooks was added to centralize adding all these
- hook functions. gdbtk_fputs was also modified to handle the new
- result_ptr structure. See the comments in gdbtk.h for more
- details.
- * gdbtk.h: New file - this contains all the defines and globals
- shared by gdbtk.c, gdbtk_cmds.c & gdbtk_hooks.c
- * Makefile.in, configure.in & configure: mutatis mutandi for the
- new files.
-
-
-Mon Jun 29 11:49:17 1998 Keith Seitz <keiths@cygnus.com>
-
- * main.c (main): Don't include gdbtk test code if GDBTK is
- not defined by configure.
-
- * configure.in: When enabling gdbtk, add "-DGDBTK" to ENABLE_CFLAGS.
-
- * configure: Regenerate.
-
-Fri Jun 26 13:56:07 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk.c: Change all references to static global "interp" to
- "gdbtk_interp" and export this global.
- (gdbtk_init): If gdbtk_source_filename is not NULL, source this file
- into the interpreter when it goes idle.
- Add new command "gdb_search".
- (gdb_search): New function which searches the symbol table.
- (gdbtk_test): New function called by main when the --tclcommand
- option is used.
-
- * main.c (main): Add a new option "--tclcommand" which is used
- by the testsuite to source a file into the interpreter when it
- goes idle.
-
-Sun Jun 21 09:31:12 1998 Ron Unrau (runrau@cygnus.com)
-
- * gdbtk.c (gdb_set_bp): Use new interface.
-
-Wed Jun 17 19:12:23 1998 Jeff Holcomb <jeffh@cygnus.com>
-
- * Makefile.in (install-only): Install tracing help files.
-
-Mon Jun 15 13:18:21 1998 Jim Ingham <jingham@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Add elements to the auto_path AS LIST
- ELEMENTS. This allows gdbtk to work when installed in a directory
- which has a space in the path. D. Moseley pointed out the bug.
-
-
-Tue Jun 9 14:10:46 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk.c (gdb_get_vars_command): Return static variables and
- variables stored in registers.
-
- * main.c (main): Call pre/post_add_symbol_hook's when loading
- executables and symbol files.
-
-Fri Jun 5 00:16:22 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Change all references to
- GDBTK_IDE to IDE_ENABLED.
-
-Thu Jun 4 18:31:53 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Initialize tkTable.
-
-Thu Jun 4 10:15:03 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c: merged:
-
- - Elena Zannoni <ezannoni@kwikemart.cygnus.com>
- (call_obj_wrapper): in case of error, copy the
- error message from the result to the error_string.
- (gdbtk_fputs): add comments.
- (gdb_actions_command): call validate_actionline when installing the
- tracepoint, to do the syntax checking of the actions for us.
- - Elena Zannoni <ezannoni@kwikemart.cygnus.com>
- (gdb_get_trace_frame_num): new function to get the
- trace frame number from gdb.
- (gdbtk_init): added new command gdb_get_trace_frame_num.
- - Jim Blandy <jimb@zwingli.cygnus.com>
- (struct wrapped_call_objs): Change the `func' member to
- be a Tcl_ObjCmdProc, not an Tcl_CmdProc, since it accepts a vector
- of objects as arguments. Change the object vector to be const,
- since that's what all the users of this structure seem to expect.
- (call_obj_wrapper): Cast clientData properly before storing it in
- the wrapped_args structure.
-
-Thu May 28 17:19:14 1998 Keith Seitz <keiths@cygnus.com>
-
- * gdbtk.c (_initialize_gdbtk): Get rid of the console. Patch from
- Chris Faylor (cgf@cygnus.com).
-
- * configure.in: Link cygwin32 with subsystem console.
-
- * configure: Regenerated
-
-Sun May 24 14:00:24 1998 Keith Seitz <keiths@cygnus.com>
-
- * ser-unix.c (wait_for): Do not reset timeout_remaining for cygwin32 so that
- we can use this member to track real timeouts.
- (hardwire_readchar): Modify for cygwin32 so that we only ever use a real
- system timeout of one second. Track the "real" timeout as a series of these
- one second timeouts.
- Call ui_loop_hook to keep the gui alive.
-
- * top.c: Define new hook for cygwin32, "ui_loop_hook".
-
- * gdbtk.c (gdbtk_init): Add ui_loop_hook for CygWin32 to work around
- update problems.
-
-Thu May 21 13:56:24 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c: reinserted the changes that were accidentally deleted:
- (_initialize_gdbtk): Use correct device names in
- cygwin-specific call (cosmetic change).
- (gdbtk_ignorable_warning): removed va_list parameter,
- which was unused.
- (_initialize_gdbtk): add cygwin32 specific code to
- allow `gdb -nw' to work when specified specified from a windows
- console-mode command line.
-
-1998-05-19 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * gdbtk.c (struct wrapped_call_objs): Change the `func' member to
- be a Tcl_ObjCmdProc, not an Tcl_CmdProc, since it accepts a vector
- of objects as arguments. Change the object vector to be const,
- since that's what all the users of this structure seem to expect.
- (call_obj_wrapper): Cast clientData properly before storing it in
- the wrapped_args structure.
-
-Wed May 13 11:12:58 1998 James Ingham <jingham@leda.cygnus.com>
-
- * gdbtk.c: Fixed a goof in the definition of the gdb_get_args &
- gdb_get_locals Tcl commands. Moved the previous ChangeLog entry
- from ChangeLog to ChangeLog-gdbtk (here)...
-
-Tue May 12 13:29:20 1998 Jeff Holcomb <jeffh@cygnus.com>
-
- * Makefile.in (install-only): Add images/icons.txt and
- images2/icons.txt to files that need to be installed.
-
-Tue May 12 12:03:16 1998 James Ingham <jingham@leda.cygnus.com>
-
- * gdbtk.c: Add an object call wrapper for the new Tcl_Obj based
- commands. This way the obj commands will also go through
- catch_errors. This is just a bandaid while I rewrite the
- string-based commands to use the object format.
-
-Tue May 5 09:30:25 1998 Christopher Faylor <cgf@cygnus.com>
-
- * gdbtk.c (_initialize_gdbtk): Use correct device names in
- cygwin-specific call (cosmetic change).
-
-Wed Apr 29 15:53:16 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c (gdbtk_ignorable_warning): removed va_list parameter,
- which was unused.
-
-Tue Apr 28 19:41:33 1998 Tom Tromey <tromey@cygnus.com>
-
- * Makefile.in (GDBTKLIBS): New macro.
- (INSTALLED_LIBS): Include GDBTKLIBS.
- (CLIBS): Likewise.
- * configure: Rebuilt.
- * configure.in: Put Tcl/Tk libs into GDBTKLIBS, not LIBS.
- (GDBTKLIBS): AC_SUBST.
-
-Thu Apr 23 19:01:05 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * Makefile.in (install-only): Install help files.
-
-Wed Apr 22 21:17:35 1998 Christopher Faylor <cgf@cygnus.com>
-
- * gdbtk.c (_initialize_gdbtk): add cygwin32 specific code to
- allow `gdb -nw' to work when specified specified from a windows
- console-mode command line.
-
-Wed Apr 15 11:23:53 1998 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtcl: Remove directory and contents, this version of
- the interface is obsolete.
-
-Mon Apr 13 16:17:52 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_loadfile): Change fstat() call to stat().
- Needed because you can't convert a FILE* to an fd.
-
-Mon Apr 13 16:28:07 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c: (perror_with_name_wrapper) new function to call
- perror_with_name safely.
- (gdb_loadfile) added source vs. executable time stamp check.
- (gdbtk_warning) new function to pass a warning message to the gui.
- (gdbtk_ignorable_warning) new function to pass a warning
- to the gui. Used only for the src. vs. exec check.
- (gdbtk_init) added warning_hook
- added include <sys/stat.h>
-
-Mon Apr 13 12:58:26 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdbtk_start_timer): Include on all platforms. Decrease
- timer interval a little.
- (gdbtk_stop_timer): Include on all platforms.
- (gdbtk_wait): No more signals! Use a timer on all platforms to keep the
- GUI alive.
- (gdbtk_init): Remove FIOASYNC and all x_fd references. Now using timers
- on all platforms.
-
-Fri Apr 10 15:48:10 1998 Jason Molenda (crash@bugshack.cygnus.com)
-
- * gdbtk.c (gdb_listfiles): Allocate space for 'files' dynamically.
-
-Thu Apr 9 14:20:59 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Remove redundant variable "IDE".
-
-Tue Apr 7 15:13:58 1998 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.tcl: Remove, no longer used.
-
-Tue Apr 7 12:49:45 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_cmd): NEVER call the busy, update, and idle hooks.
-
-Tue Mar 31 15:42:06 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_loadfile): Don't use the return result from
- sprintf, which returns a char * under SunOS4.
-
-Tue Mar 31 17:18:43 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Add $(LIBIDETCL) as well as $(LIBIDE) if
- --enable-ide.
- * Makefile.in (IDE_CFLAGS_X): Add -I for libidetcl/src.
- (LIBIDETCL): Define.
- * configure: Rebuild.
-
-Sun Mar 29 21:19:46 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_get_tracepoint_info): Change formatting of address.
- (tracepoint_exists): Remove code which confuses assembly traces.
-
-Sat Mar 28 12:13:23 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_cmd): If argc > 2, assume that the busy and idle hooks
- should not be called.
-
-Thu Mar 26 22:29:28 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c: (gdb_trace_status) new function.
- (gdbtk_init) added command "gdb_is_tracing".
- (tracepoint_notify) added passcount information.
-
-Thu Mar 26 12:00:35 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_fputs): Insert fencepost.
- (gdb_loc): Correct pc calculation.
- (gdb_immediate_command): Return if a load is in progress.
- (gdb_cmd): Return if a load is in progress.
- (target_stop_wrapper): New function.
- (gdb_stop): Call target_stop_wrapper.
- (x_event): Add fencepost and optimize load cancel check.
- (gdbtk_start_timer): Set up structs only once.
- (gdbtk_stop_timer): Just use preset structs to set timer parameters.
- (gdb_loadfile): If file cannot be loaded, return error message.
- (gdb_loadfile): Add space before tab so that lines without
- a '-' can later be changed to have one.
-
-Wed Mar 25 14:08:51 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c (gdbtk_pre_add_symbol): Use Tcl_merge to form Tcl commands.
-
-Mon Mar 23 13:41:39 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c (gdb_get_mem): Rewrite to fetch entire contents
- of the memory window at once.
-
-Sat Mar 21 19:34:49 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- Merged changes from Foundry: list follows by author:
-
- - Tom Tromey <tromey@cygnus.com>
-
- * Makefile.in (gdbres.o): New target.
- (WINDRES): New define.
- * configure: Rebuilt.
- * configure.in (WINDRES): Define.
- (CONFIG_OBS): Include gdbres.o on Windows.
- * gdbtool.ico: New file.
- * gdb.rc: New file.
- * gdbtk.c (gdbtk_init): Call ide_create_messagebox_command.
- (gdbtk_cleanup): Call ide_interface_deregister_all.
- (gdbtk_init): Pass event handle to cleanup.
- (TclDebug): Use Tcl_Merge to construct command.
- (gdbtk_init): Call ide_create_cygwin_path_command.
-
- - Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_set_bp): Set addr_string for bp.
- (gdb_get_breakpoint_info): Demangle function
- names in breakpoint info.
- Include "demangle.h".
- (gdb_loc, gdb_listfuncs): Demangle C++
- function names.
- (gdb_set_bp): Properly quote filename to fix
- problems with spaces. Send pc back as a hex string.
- (gdb_listfuncs): Remove debugging line.
- Turn off some debugging lines.
- (breakpoint_notify): Return correct line number.
- (gdb_get_breakpoint_info): Return correct line number.
- (gdb_set_bp): New function to provide a better way to
- set breakpoints.
- (gdbtk_readline, gdbtk_readline_begin): Memory
- allocated by tcl needs to be freed by Tcl_Free().
- (find_file_in_dir): Deleted.
- (gdb_find_file_command): Call full_lookup_symtab().
- (gdb_listfuncs): Call full_lookup_symtab().
- (full_lookup_symtab): New function. Like lookup_symtab
- except handles multiple files with the same basename,
- full pathnames, and always sets symtab->fullname.
- (gdb_loadfile): Call full_lookup_symtab(). Clear
- realloc'd memory.
- (gdb_loadfile): Don't tag lines without source.
- Tag source lines with source_tag.
- (gdb_find_file_command, find_file_in_dir):
- Rewrite. Now searches symtabs and psymtabs for a match
- on the partial or full filename. Returns the full pathname.
- (gdb_loadfile): Realloc additional memory
- if someone loads in a file with more than 160,000
- lines. I don't know if this really works because
- I don't have enough memory to test it.
- (gdb_sourcelines): Deleted.
- (gdb_loadfile): New function. Takes a text widget
- and loads it with the contents of a file. Marks
- and tags source lines.
- (pc_changed): New function.
- (get_pc_register): Returns the value of
- the PC to GDB.
- (gdb_loc): If looking on the stack, return
- real pc along with calling source line.
- (gdb_loc): Return "" instead of "N/A" if
- filename is not found.
- (gdb_get_breakpoint_info): Same.
- (get_register): For Natural mode, set format to 0.
- Minor bugfixes from keiths.
- (TclDebug): New function for debugging use.
- (gdb_loc): Return correct PC for frames
- that are not the innermost frame.
- (gdb_listfiles): Rewritten to use object
- API. Now takes an optional dirname which will cause
- only files in that directory or its subdirectories
- to be returned. Now returns basenames instead of
- full pathnames.
- (gdb_cmd): Set/reset load_in_progress flag.
- (call_wrapper): Don't pop up dialog for errors in
- downloads; just abort download.
- (gdbtk_load_hash): Set return value correctly.
-
- - Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdbtk_init): Define the ui_loop_hook so that it can be
- called by routines which might block, allowing us to update the GUI.
- (gdbtk_wait): Move timer calls to annotation hooks.
- (gdbtk_init): Define the annotation hooks.
- (gdbtk_annotate_starting): New function for cygwin32 hosts.
- (gdbtk_annotate_stopped): New function for cygwin32 hosts.
- (gdbtk_annotate_exited): New function for cygwin32 hosts.
- (gdbtk_annotate_signalled): New function. for cygwin32 hosts.
- (gdbtk_init): Use gdbtk_print_frame_info hook.
- (gdbtk_print_frame_info): New function which sets current_source_symtab
- based on the given symtab and line info.
- (gdb_immediate_command): New function which does
- not buffer any
- output. (Contrast to gdb_cmd.)
- (gdb_prompt_command): New function to return gdb's prompt.
- (find_file_in_dir): New functon which searches source paths
- for a given filename.
- (gdb_find_file): New function which returns path to given file -- uses
- find_file_in_dir.
- (gdbtk_init): Install "gdb_immediate", "gdb_find_file", and
- "gdb_prompt"
- commands into interpreter.
-
- - Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdbtk_timer_going): If __CYGWIN32__, new static
- variable.
- (gdb_cmd): If __CYGWIN32__, if executing the load command, call
- gdbtk_start_timer and gdbtk_stop_timer.
- (call_wrapper): If __CYGWIN32__, if the timer is going, turn it
- off. Clear load_in_progress.
- (x_event): If load_in_progress, quit if download_cancel_ok.
- (gdbtk_start_timer): Set gdbtk_timer_going.
- (gdbtk_stop_timer): Clear gdbtk_timer_going.
- (gdbtk_wait): Call x_event.
- (gdbtk_init): Call ide_create_win_grab_command if
- __CYGIN32__.
- (gdb_clear_file): Clear stop_pc.
-
-Wed Mar 4 16:50:18 1998 Jason Molenda (crash@bugshack.cygnus.com)
-
- * gdbtk.c (gdb_listfiles): Fix thinko in last change.
-
-Wed Mar 4 15:34:49 1998 Jason Molenda (crash@bugshack.cygnus.com)
-
- * gdbtk.c (gdb_listfiles): Allocate space for 'files' dynamically.
-
-Tue Feb 10 17:50:37 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdbtk_modify_tracepoint): Define new tracepoint modification hook.
- (gdbtk_print_frame_info): Define this hook so that current_source_symtab
- is set properly.
- (gdb_actions_command): Use free_actions () from tracepoint.c/h.
-
-Mon Jan 26 11:37:55 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_actions_command): Make note of next action
- before freeing all references to it.
-
-Sat Jan 24 23:52:08 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c: Merge from Foundry branch.
- (TclDebug): New debugging function.
- (gdb_loc): For frames, find address of calling function
- instead of whatever is on the stack (usually the next
- instruction).
- (gdb_listfiles): Takes an optional pathname argument and
- returns an alphabetized list of basenames of files in the
- path.
-
-Wed Jan 22 10:37:02 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * symfile.c: Define two new hooks for symbol reading:
- "pre_add_symbol_hook" and "post_add_symbol_hook". These hooks
- are called before we begin reading symbols, and after we finish.
- (generic_load): Use new symbol reading hooks and get rid of
- compiler warning.
-
- * gdbtk.c (gdbtk_init): Add hooks for pre- and post-symbol reading.
- (gdbtk_pre_add_symbol): New function: the pre-add-symbol hook.
- (gdbtk_post_add_symbol): New function: the post-add-symbol hook.
- (find_file_in_dir): New function. Moved the guts of gdb_find_file_command
- into here to allow its use by others.
- (gdb_loc): Use find_file_in_dir to return the real path to the file
- (or "N/A" if we can't find it).
-
- * configure.in (TIX_LIB_EXT): Define new variable for those special cases
- when TCL_SHLIB_SUFFIX is not enough to specify the dependency.
-
- * configure: Regenerate.
-
-Fri Jan 23 07:47:06 1998 Fred Fish <fnf@cygnus.com>
-
- * Makefile.in (uninstall): Remove installed gdbtcl dir, if one
- was installed.
-
-Thu Jan 15 12:42:28 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_immediate_command): New function which does not buffer any
- output. (Contrast to gdb_cmd.)
- (gdbtk_init): Install "gdb_immediate" command into interpreter.
-
-Wed Jan 14 16:38:44 1998 Keith Seitz <keiths@pizza.cygnus.com>
-
- * configure.in (--enable-gdbtk): If tcl was built with --enable-shared,
- use TCL_SHLIB_SUFFIX to specify the suffix of the library file so that
- we don't expect to see "libfoo.a" instead of "libfoo.{so,sl, etc}".
-
- * configure: Regenerate.
-
-Wed Dec 31 16:50:26 1998 Keith Seitz (keiths@onions.cygnus.com)
-
- * gdbtk.c (gdb_actions_command): extract and save step count
- from "while-stepping" command
-
-Tue Dec 16 21:16:42 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.in (LIBGUI): New variable.
- (GUI_CFLAGS_X): New variable.
- (IDE_CFLAGS): Add $(GUI_CFLAGS_X).
- * configure.in: Add $(LIBGUI) to TCL_LIBS and CONFIG_DEPS.
- * configure: Rebuild.
-
-Wed Dec 10 13:16:45 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_get_tracepoint_info): Use info in struct
- symtab_and_line (not struct tracepoint) so that we get the
- real line info for an address. Arrange data more like
- gdb_get_breakpoint_info.
- (tracepoint_notify): Use info in struct symtab_and_line again.
- (gdbtk_init): Add command "gdb_get_tracepoint_list" into
- interpreter.
- (gdb_get_tracepoint_list): New function that aids the source
- window in displaying tracepoints when the file changes.
-
-Fri Dec 5 10:31:23 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * gdbtk.c (gdbtk_init): Add gdb_find_file into interpreter.
- (gdb_find_file_command): New function which searches source path
- to find the real full filename of a file.
-
-Mon Dec 1 10:19:44 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c: Move include of "guitcl.h" back out of IDE ifdef.
- (gdbtk_init): Move ide_initialize_paths out of IDE ifdef.
-
- * configure.in (TCL_LIBS, CONFIG_DEPS): Add IDE libraries for all
- builds.
- (CONFIG_OBS): Remove tracepoint.o, which should always be included.
-
- * configure: regenerate
-
- * Makefile.in (install-only): ALWAYS install the new gdbtk
- (REMOTE_OBS): add tracepoint.o
-
-Thu Nov 27 09:07:18 1997 Michael Meissner <meissner@cygnus.com>
-
- * configure.in ({TCL_LIBS,CONFIG_DEPS}): Don't add IDE libraries
- if not --enable-ide.
- (CONFIG_OBS): Add tracepoint.o to list if --enable-gdbtk.
- * configure: Regenerate.
-
- * gdbtk.c (gdb_get_breakpoint_info): Add missing filename
- argument.
- (toplevel): Move include of guitcl.h into #ifdef IDE region.
- (gdbtk_init): Move ide_initialize_paths call into #ifdef IDE
- section.
-
- * Makefile.in (gdbtk.o): Update dependencies.
-
-Wed Nov 26 15:02:43 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * gdbtk.c (gdb_loc): symtab_to_filename can return NULL.
- (breakpoint_notify): Ditto.
- (gdb_get_breakpoint_info): Ditto.
-
-Wed Nov 26 11:33:09 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- Merge in code from Foundry branch:
-
- * Makefile.in (install-only): install the new gdbtk, not the old
-
- * gdbtk.c (gdbtk_call_command): also run idle hooks for class_trace
- commands
- (gdbtk_init): Add new commands "gdb_get_locals", "gdb_get_args",
- "gdb_get_function", "gdb_get_line", "gdb_get_file",
- "gdb_tracepoint_exists", "gdb_get_tracepoint_info", "gdb_actions",
- and "gdb_prompt".
- (gdb_get_vars_command): New function.
- (gdb_get_line_command): New.
- (gdb_get_file_command): New.
- (gdb_get_function_command): New.
- (gdb_get_tracepoint_info): New.
- (gdbtk_create_tracepoint): New.
- (gdbtk_delete_tracepoint): New.
- (tracepoint_notify): New.
- (tracepoint_exists): New.
- (gdb_actions_command): New.
- (gdb_tracepoint_exists_command): New.
- (gdb_prompt_command): New.
-
-Thu Nov 13 18:15:54 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c: Move include of gdbcore.h to top of file.
- (close_bfds): New static function if _WIN32.
- (gdbtk_readline): Call close_bfds.
- (call_wrapper, tk_command_loop): Likewise.
- (gdb_clear_file): New static function.
- (gdbtk_init): Create gdb_clear_file Tcl command.
-
-Wed Nov 12 14:58:39 1997 Jeff Holcomb <jeffh@cygnus.com>
-
- * gdbtk.c: gdbtk_load_hash and ui_load_progress_hook return an
- int result.
- (gdbtk_load_hash): download hash routine returns an int result.
-
-Mon Nov 10 15:11:51 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Call ide_create_shell_execute_command if
- __CYGWIN32__.
- * configure.in: Add -lshell32 to WIN32LIBS on cygwin32.
- * configure: Rebuild.
-
-Sun Nov 9 16:25:34 1997 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Run ide_create_help_command.
-
-Tue Oct 28 17:31:47 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Call ide_create_winprint_command.
-
-Thu Oct 23 15:53:37 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Add -lgdi32 to WIN32LIBS when linking gdbtk on
- cygwin32.
- * configure: Rebuild.
-
-Wed Oct 22 21:32:54 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Create sizebox command on Windows.
-
-Thu Oct 9 14:33:21 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Remove assertion argument from call to
- ide_create_window_register_command.
-
-Wed Oct 1 11:09:52 1997 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Pass name of restore interface to
- ide_create_window_register_command.
-
-Fri Sep 26 21:08:22 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * gdbtk.c (gdbtk_init): Initialize ui_load_progress_hook.
-
-Thu Sep 25 03:05:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_load_info): New function. Returns a list
- of section names and sizes for an executable.
- (gdbtk_load_hash): Stub function to call tcl function
- download_hash.
-
-Tue Sep 23 01:29:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_get_mem): Fix compiler warning.
-
-Sun Sep 21 00:15:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_get_mem): Fix problem with ASCII dump.
-
-Tue Sep 16 18:07:17 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_get_mem): New function. Returns
- a formatted memory dump with optional ASCII dump.
-
-Mon Sep 8 12:48:50 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c: Include ilutk.h if IDE.
- (gdb_confirm_quit, gdb_force_quit): New static functions.
- (gdbtk_init): Add Tcl commands gdb_confirm_quit and
- gdb_force_quit.
-
-Mon Sep 8 03:05:33 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_get_breakpoint_info): Now returns the
- function a breakpoint is in.
-
-Fri Sep 5 20:23:58 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Call ide_create_exit_command.
-
-Wed Sep 3 19:39:15 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c: Include guitcl.h.
- (gdbtk_init): Always call ide_initialize_paths. Set the Tcl
- variable IDE to 1 when using the IDE. Always try using auto path
- to find main.tcl.
- * Makefile.in (IDE_CFLAGS_X): Always include libide.
- (LIBIDE): New variable.
- (IDE_X): Omit -lide.
- (IDE_DEPS): Omit libide.
- * configure.in: Add LIBIDE to TCL_LIBS and CONFIG_DEPS.
- * configure: Rebuild.
-
-Mon Aug 25 02:28:55 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * gdbtk.c: (gdb_target_has_inferior) check if inferior_pid is non-zero
- before assuming that the inferior is running.
-
-Mon Aug 25 01:06:48 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdbtk_start_timer): Pass third argument to setitimer.
- (gdbtk_stop_timer): Likewise.
-
-Mon Aug 25 00:23:08 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * gdbtk.c: (gdbtk_init) create new command "gdb_target_has_execution"
- (gdb_target_has_execution_command) new function
-
-Sun Aug 24 20:27:22 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdb_loc): If there are no symbols, just bail
- immediately.
- (tk_command_loop): Print errors encountered while running
- gdbtk_tcl_preloop.
-
-Sun Aug 24 13:44:03 1997 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Run ide_create_build_command.
-
-Sat Aug 23 21:53:39 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c: If CYGWIN32, include <sys/time.h>.
- (x_fd): Don't define if WINNT.
- (gdbtk_start_timer, gdbtk_stop_timer): New static functions if
- CYGWIN32.
- (gdbtk_wait): Don't set up signal handling if WINNT. If CYGWIN32,
- call gdbtk_start_timer and gdbtk_stop_timer.
- (gdbtk_init): Don't set up signal handling or make x_fd
- asynchronous if CYGWIN32.
-
-Fri Aug 22 15:23:15 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (error_string_ptr): New static variable.
- (gdbtk_fputs): If result_ptr is NULL, and error_string_ptr is not
- NULL, and we're outputting to stderr, append string to
- error_string_ptr rather than calling gdbtk_tcl_fputs.
- (call_wrapper): Set up error_string_ptr. Put both error string
- and normal string in Tcl result.
-
- * gdbtk.c (gdbtk_init): Don't call ide_run_server_init until after
- gdb has initialized.
-
-Thu Aug 21 19:14:38 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c: If _WIN32, include winuser.h.
- (gdbtk_init): If _WIN32, use MessageBox to display an error
- evaluating main.tcl.
-
-Thu Aug 21 00:48:00 1997 Martin M. Hunt <hunt@pern.cygnus.com>
-
- * gdbtk.c (gdbtk_init): Add call to ide_run_server_init().
- (gdb_cmd): For the load command, don't buffer the I/O.
-
-Wed Aug 20 11:41:22 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdbtk_query): Chaneg free() call to Tcl_Free().
-
-Tue Aug 19 17:09:19 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.in (TCL_DEPS, TK_DEPS): New variables.
- (ITCL_DEPS, TIX_DEPS): New variables.
- (IDE_DEPS): New variable.
- (CDEPS): Include @CONFIG_DEPS@.
- * configure.in: Set and substitute CONFIG_DEPS and TIX_DEPS.
- * configure: Rebuild.
-
-Sun Aug 17 00:42:11 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (gdb_listfuncs): New function that returns
- a list of all the functions in a source file.
-
-Tue Aug 12 16:35:21 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.in (install-only): Install tclIndex if ENABLE_IDE.
-
-Mon Aug 11 10:43:04 1997 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Use ide_event_init_from_environment.
-
-Fri Aug 8 15:59:24 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Change gdbtk_lib_tmp and gdbtk_file to be
- dynamically allocated, rather than fixed size. Pass "gdbtcl" to
- ide_initialize_paths to match installed directory name. If IDE,
- use auto_path to search for main.tcl.
- * Makefile.in (install-only): If ENABLE_IDE, install from gdbtcl2
- rather than gdbtcl.
-
- * gdbtk.c (gdbtk_cleanup): New static function.
- (gdbtk_init): Add gdbtk_cleanup as a final cleanup. Uncomment
- call to ide_initialize_paths. If we can't initialize the event
- system, set GDBTK_IDE to 0 in the Tcl interpreter. Create the
- ide_window_register and the ide_window commands. Initialize tk,
- itcl, and tix after initializing the IDE.
-
- * configure.in (tixdir): Update for cygwin32 case for Tcl 8.0.
- * configure: Rebuild.
-
-Fri Aug 8 00:13:32 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * gdbtk.c (breakpoint_notify): Change buffer size from 100
- to 256 to avoid memory corruption with very long pathnames.
-
-Thu Aug 7 14:08:23 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * configure.in: Change required Tix version to 4.1.8.0 .
- * configure: Rebuilt.
-
-Fri Aug 1 15:21:44 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (Tcl_Alloc): Don't provide our own version of this if
- _WIN32.
- (Tcl_Realloc, Tcl_Free): Likewise.
- * configure.in: Check for cygwin32 environment. Define and
- substitute WIN32LIBS and WIN32LDAPP. Always set configdir to
- unix; setting it to win was for an old Tcl/Tk configuration
- scheme.
- * aclocal.m4 (CY_AC_LOAD_TKCONFIG): Substitute TK_BUILD_INCLUDES.
- * Makefile.in (TK_CFLAGS): Add @TK_BUILD_INCLUDES@.
- (WIN32LDAPP, WIN32LIBS): Define.
- (CLIBS): Add $(WIN32LIBS).
- (gdb): Use $(WIN32LDAPP).
- * configure: Rebuild.
-
-Tue Jul 22 19:45:37 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * configure.in, aclocal.m4: Another fix to find the
- correct Tix library name.
-
- * configure: Rebuilt.
-
-Mon Jul 21 22:24:07 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * aclocal.m4: Search for the correct tix library.
-
-Thu Jul 10 00:02:41 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * Makefile.in, configure.in, aclocal.m4: Add Itcl, Tix, and
- IDE configuration information.
-
- * gdbtk.c (breakpoint_notify): Send address, linenumber and
- filename when a breakpoint is set. Avoids call to bp_info.
- (gdbtk_init): Call Tcl_FindExecutable(). Add code to handle
- Itcl, Tix and IDE initialization.
-
- * configure: Regenerated.
-
-Fri Jun 13 10:28:09 1997 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Make truth value test explicit.
- Remove unused static variable "Gdbtk_Library".
-
-Sat Jun 7 02:34:19 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * gdbtk.c (gdb_get_breakpoint_info): Add string for new
- enumeration del_at_next_stop to bpdisp array.
-
-Tue Jun 3 15:46:51 1997 Tom Tromey <tromey@cygnus.com>
-
- * Makefile.in (LIB_RUNTIME_DIR): New variable.
-
-Wed May 7 19:10:19 1997 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk.c (wrapped_call): New function - make actual call to tk
- worker function.
- (call_wrapper): Rewrite to use top.c:catch_errors.
-
- * gdbtk.c (gdb_stop): If No target_stop set quit flag and hope for
- best.
-
-Mon Apr 21 14:00:08 1997 Doug Evans <dje@canuck.cygnus.com>
-
- * gdbtk.c (gdb_disassemble): Store endian-ness in `di'.
-
-Wed Apr 16 12:33:06 1997 Andrew Cagney <cagney@b1.cygnus.com>
-
- * Makefile.in (install-only): Make list of gdbtcl files to install
- explicit - was picking up files such as ChangeLog etc.
- (install-only): Don't blindly create the directory.
-
-Tue Apr 1 15:04:21 1997 Jason Molenda (crash@godzilla.cygnus.co.jp)
-
- * configure.in (gdbtcl): Create soft-link for gdbtcl/ directory
- instead of gdbtk.tcl.
-
-Fri Mar 28 17:04:02 1997 Jason Molenda (crash@godzilla.cygnus.co.jp)
-
- * Makefile.in (gdbtk.o): look for GDBTK_LIBRARY in $(datadir) by
- default, not $(srcdir).
-
-Wed Mar 19 15:16:17 1997 Martin M. Hunt <hunt@onions.cygnus.com>
-
- * Makefile.in: Install gdbtcl dir instead of gdbtk.tcl.
-
- * gdbtk.c: Added some ifdefs for Windows. Changed GDBTK_FILENAME
- to GDBTK_LIBRARY, which is now a path to search.
- (gdb_path_conv): New function. Convert Cygwin32 pathname to
- DOS-style pathname.
-
- * {aclocal.m4,configure.in}: Changes for Windows builds.
-
- * configure: Rebuilt.
-
-Fri Mar 14 10:01:29 1997 Tom Tromey <tromey@cygnus.com>
-
- * configure: Regenerated.
- * configure.in (LIBS): Re-reverse order of TCL_LIBS and TK_LIBS.
-
-Wed Mar 12 14:29:52 1997 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk.c (x_event): Use Tcl_DoOneEvent, TCL_DONT_WAIT,
- TCL_ALL_EVENTS.
-
- * configure: Regenerated.
- * configure.in (ENABLE_GDBTK): Put TCL_LIBS after TK_LIBS in
- LIBS.
-
-Mon Feb 10 13:50:53 1997 Stu Grossman (grossman@critters.cygnus.com)
-
- * gdbtk.c (call_wrapper): Clear running_now if an error occurs.
-
-Wed Dec 11 18:51:35 1996 Mark Alexander <marka@cygnus.com>
-
- * gdbtk.c (gdb_loc): Correct truncation of PC on 64-bit MIPS.
-
-Tue Nov 19 09:26:14 1996 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk.c (gdbtk_readline): Fix memory leak.
-
-Mon Nov 18 23:43:05 1996 Tom Tromey <tromey@cygnus.com>
-
- Fixes for Tcl 7.6 / Tk 4.2:
- * gdbtk.tcl (apply_filespec): Use tk_getOpenFile.
- Remove old fileselect code.
- * gdbtk.c (Tcl_Alloc): Rename from Tcl_Malloc.
-
-Fri Sep 27 10:25:30 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (create_copyright_window): Increase timeout from
- 15 seconds to 30 seconds.
-
-Wed Sep 4 17:28:40 1996 Stu Grossman (grossman@critters.cygnus.com)
-
- * configure configure.in: Add host *windows* to list of hosts
- that don't support GDBtk.
-
-Fri Aug 23 00:44:57 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c (gdbtk_init): Check for a DISPLAY env variable and
- gracefully degrade to using command line interface if none is
- found.
-
-Fri Aug 9 12:32:53 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * Makefile.in (LIB_INSTALL_DIR): New macro.
- (TCL): Include @TCL_LD_SEARCH_FLAGS@.
-
-Thu Aug 1 20:35:01 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.c (mainWindow): Deleted.
- (cleanup_init): Don't destroy main window.
- (gdbtk_init): Main window now created by Tk_Init.
-
- * configure.in: Most X checks now handled automatically by Tk.
- Use new macros to find Tcl/Tk.
- * aclocal.m4: New version for new Tcl/Tk; from Don Libes.
- * config.in, configure: Regenerated.
-
- * Makefile.in (TCL, TCL_CFLAGS, TK, TK_CFLAGS, X11_CFLAGS,
- X11_LDFLAGS, X11_LIBS): Changed for new Tcl and Tk.
-
-Thu Aug 1 16:12:05 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
-
- * Makefile.in (gdbtk.tcl): put in $(datadir), not $(libdir).
-
-Fri Jul 26 14:07:37 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * gdbtk.c (gdb_disassemble): Initialize di.flavour.
-
-Thu Jul 25 19:41:31 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c (null_routine): Ditto.
- (gdbtk_flush): Ditto.
- (gdbtk_fputs): Ditto.
- (gdbtk_query): Ditto.
- (gdbtk_readline): Ditto.
- (gdbtk_readline_end): Ditto.
- (gdb_get_breakpoint_list): Ditto.
- (gdb_get_breakpoint_info): Ditto.
- (breakpoint_notify): Ditto.
- (gdbtk_create_breakpoint): Ditto.
- (gdbtk_delete_breakpoint): Ditto.
- (gdbtk_modify_breakpoint): Ditto.
- (gdb_loc): Ditto.
- (gdb_eval): Ditto.
- (gdb_sourcelines): Ditto.
- (map_arg_registers): Ditto.
- (get_register_name): Ditto.
- (gdb_regnames): Ditto.
- (get_register): Ditto.
- (gdb_fetch_registers): Ditto.
- (register_changed_p): Ditto.
- (gdb_changed_register_list): Ditto.
- (gdb_cmd): Ditto.
- (call_wrapper): Ditto.
- (gdb_listfiles): Ditto.
- (gdb_stop): Ditto.
- (gdbtk_dis_asm_read_memory): Ditto.
- (compare_lines): Ditto.
- (gdb_disassemble): Ditto.
- (tk_command): Ditto.
- (cleanup_init): Ditto.
- (gdbtk_interactive): Ditto.
- (x_event): Ditto.
- (gdbtk_wait): Ditto.
- (gdbtk_call_command): Ditto.
- (tk_command_loop): Ditto.
- (gdbtk_init): Ditto.
-
- * gdbtk.c (register_changed_p): Remove unused local variable "buf".
-
-Sat Jul 20 17:46:40 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (files_command): Reorder the binding tags for
- the listbox widget to avoid referencing the listbox after
- the containing widget has been destroyed by the action of
- a previous binding.
-
-Sat Jul 20 10:09:28 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (delete_expr): Unset corresponding element of
- expr_update_list when destroying an expression.
- (create_expr_window): Initialize expr_num, delete_expr_num,
- and expr_update_list here when each new expression window
- is created, rather than once at startup.
-
-Mon Jul 15 16:44:05 1996 Stu Grossman (grossman@critters.cygnus.com)
-
- * gdbtk.c (gdb_disassemble): Setup di.mach from
- tm_print_insn_info.mach, and set endian from TARGET_BYTE_ORDER.
-
-Fri Jun 21 11:04:47 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (create_register_windows): Include missing '$'s.
- Add global declarations for various reg_format_* variables.
- * gdbtk.tcl (populate_register_window): Make initial window one
- line taller to account for new column header line.
-
-Fri Jun 21 09:46:47 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c (get_register): Support for printing raw formats.
- * gdbtk.tcl: Add hint for using debug_interface.
- (center_window, add_breakpoint_frame, delete_breakpoint_frame):
- Enclose arg in braces for consistency.
- (create_registers_window, populate_reg_window, update_registers):
- Major rewrite to support displaying multiple formats in the register
- window.
- (init_reg_info): New function.
- (recompute_reg_display_list): Reset reg_display_list, start
- register display lines at line 2.
-
-Thu Jun 20 08:18:59 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (gdbtk_tcl_readline_begin): Handle backspace to
- avoid backing up over prompt. At every input, make sure insert
- point is at least after command start, handle control-u to delete
- current input line.
- (tclsh): Handle backspace to avoid backing up over prompt. Handle
- control-u to delete current input line.
-
-Wed Jun 19 17:23:38 1996 Geoffrey Noer <noer@cygnus.com>
-
- * configure.in: disable gdbtk for *cygwin32* hosted compiles
- * configure: regenerated with autoconf 2.8
-
-Sun May 19 16:49:37 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c (gdbtk_readline_begin, gdbtk_readline, gdbtk_readline_end):
- New functions.
- (tk_command_loop): Set instream to NULL to enable Tk user interaction.
- (gdbtk_init): Set readline_begin_hook, readline_hook,
- and readline_end_hook.
- * gdbtk.tcl (gdbtk_tcl_readline_begin, gdbtk_tcl_readline,
- gdbtk_tcl_readline_end): New functions.
- (tclsh): Pack scroll bar on right side of window, not left.
-
-Fri May 17 13:54:34 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (create_command_window): Change a misspelled "get"
- to the intended "cget".
- (delete_line): Fix so it deletes the current line at the
- insertion cursor.
-
-Thu May 16 19:20:29 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (gdb_prompt): Set this early on.
- (create_command_window): Use gdb_prompt rather than "(gdb) ".
- (gdbtk_tcl_preloop): Proc executed just prior to Tk main loop.
- (tclsh): If an evaluation window already exists, just bring it
- to the front instead of trying to create another.
- * gdbtk.c (tk_command_loop): New function.
- (gdbtk_init): Call tk_command_loop rather than Tk_MainLoop.
-
-Thu May 16 16:16:35 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.tcl (evaluate_tcl_command, tclsh): New functions that
- implement a tcl evaluation window for gdbtk maintainers to use.
-
-Thu May 16 11:42:58 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl (files_command): Correctly insert list of files into
- listbox widget.
-
- * gdbtk.tcl (files_command): listbox command no longer accepts
- -geometry.
-
-Wed May 15 16:04:09 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.tcl (create_command_window): If command window's buffer
- is disabled, don't execute any of the key bindings.
-
-Mon May 13 13:43:25 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c (tk_command): Catch case where no argument is given
- since this will cause the tcl interpreter to dump core.
-
-Wed May 8 20:33:24 1996 Fred Fish <fnf@cygnus.com>
-
- * gdbtk.c: Fix a couple of misspellings.
-
-Thu May 2 19:17:49 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.tcl (debug_interface): New global, use to aid debugging.
- (insert_breakpoint_tag, delete_breakpoint_tag): Fix range.
- (file_popup_menu): Delete, never used.
- (listing_window_popup): Rename from listing_window_button_1,
- remove breakpoint toggling code.
- (toggle_breakpoint): New procedure.
- (create_file_win): Bind popup menu to button 2, toggle breakpoints
- with button 1 in breakpoint area, add display of tagged areas if
- debugging on.
-
-Fri Apr 5 13:44:40 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.c (running_now): New global variable.
- (gdb_cmd): Test it before executing any command.
- (gdbtk_call_command): Set it when inferior is running.
- * gdbtk.tcl (gdbtk_tcl_busy, gdbtk_tcl_idle): Enable and
- disable interaction with command window's text appropriately.
-
-Fri Apr 5 13:25:42 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * gdbtk.c (SIOCSPGRP, linux): If on Linux, undef SIOCSPGRP, since
- some versions of the kernel don't support it.
-
-Tue Feb 6 16:31:25 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl (create_file_win): Eliminate text widget B1 binding so
- double-clicking will work again.
- (create_asm_win): Put "break" at end of all B1 bindings.
- (create_file_win): Lower "sel" tag, don't raise it.
- (ensure_line_visible): New proc.
- (update_listing, update_assembly): Use it.
- (create_copyright_window): Destroy window on Leave event.
- (create_command_window): Put "break" at end of all B2 bindings.
-
-Wed Jan 24 15:28:41 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl, gdbtk.c: Updated copyrights.
-
- * configure.in: Look for -ldl or -ldld when using Tcl 7.5 or
- greater.
- * configure: Rebuilt.
-
-Tue Jan 23 09:00:48 1996 Doug Evans <dje@charmed.cygnus.com>
-
- * gdbtk.c (gdb_disassemble): Pass fprintf_unfiltered to
- INIT_DISASSEMBLE_INFO.
-
-Mon Jan 15 09:58:41 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl (create_expr_window): Many changes to update GUI.
- (add_expr): Changes from create_expr_window.
- (create_command_window): Set focus.
- (delete_expr): Rewrote.
- (expr_update_button): New proc.
- (add_expr): Put bindings on FocusIn, FocusOut.
- Don't allow .file_popup to be torn off.
-
-Fri Jan 12 09:36:17 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl (gdbtk_tcl_query): Swap Yes and No buttons.
- (update_listing): Use lassign. Use "see" to scroll. Don't need
- screen_top, screen_bot, screen_height.
- (update_assembly): Use "see" to scroll.
- (textscrollproc): Removed.
- (create_file_win): Don't use textscrollproc.
- (asmscrollproc): Removed.
- (create_asm_window): Don't use asmscrollproc.
- (create_asm_win): Ditto.
- (screen_height, screen_top, screen_bot): Removed.
- (run_editor): New proc.
- (build_framework): Use it.
- (create_file_win, create_source_window): Don't use textscrollproc.
- (create_breakpoints_window): Set -xscrollcommand on canvas.
- (not_implemented_yet): Default button is 0.
- (delete_char): Don't use tk_textBackspace.
- (create_command_window): Allow Tk bindings to fire after deleting
- character.
- (create_command_window): Make Delete delete left, not right.
-
-Thu Jan 11 10:08:14 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl (FSBox): Don't use tk_listboxSingleSelect.
-
- Changes in sync with expect:
- * configure.in (ENABLE_GDBTK): Use CY_AC_PATH_TCL and
- CY_AC_PATH_TK.
- * aclocal.m4: Replaced with version from expect.
- * configure: Regenerated.
-
-Wed Jan 10 09:07:22 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * gdbtk.tcl (gdbtk_tcl_fputs, gdbtk_tcl_fputs_error,
- gdbtk_tcl_flush): Use "see", not "yview".
- (gdbtk_tcl_query): Use questhead bitmap.
- various: Always wrap condition of 'if' in {...}.
- (add_breakpoint_frame): Set -value on radiobuttons.
- (lassign): New proc.
- (add_breakpoint_frame): Use lassign, not series of assignments.
- (decr): Made faster.
- (interactive_cmd): Use "see", not "yview".
- (not_implemented_yet): Use warning bitmap.
- (update_expr): Don't allow $expr to be evalled by Tcl.
- (create_expr_window): Don't use "focus".
- (delete_char, delete_line): Define globally.
- (delete_line, delete_char, create_command_window, update_autocmd,
- build_framework, create_asm_win, create_file_win): Use "see", not
- "yview".
- (create_copyright_window, center_window, bind_widget_after_class):
- New procs.
- (FSBox,create_command_window, create_autocmd_window): Binding
- changes for Tk4.
- (textscrollproc): Define globally.
- (build_framework): tk_menuBar no longer needed. Keys Prior, Next,
- Home, End, Up, and Down are all defined by Tk.
- (apply_filespec): Use error bitmap in dialog.
- (files_command): Don't use tk_listboxSingleSelect.
- (files_command): Don't use "uniq" to remove duplicates from a
- list.
- (update_assembly): Use lassign.
- (create_asm_win): Removed redundant bindings.
- (listing_window_button_1, file_popup_menu): Use tk_popup.
- (ButtonRelease-1 binding): Just remove tag from window; rest
- handled by Tk.
-
- * gdbtk.c (gdbtk_query): Use Tcl_Merge to provide quoting.
- (call_wrapper): Use Tcl_Eval, not Tcl_VarEval.
- (gdbtk_call_command): Ditto.
-
-Thu Jan 4 16:04:54 1996 Stu Grossman (grossman@cygnus.com)
-
- * configure configure.in: Make --enable-gdbtk be the default.
-
-Thu Dec 28 15:10:49 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * README.GDBTK: Polish introductory paragraph.
-
-Mon Oct 16 11:27:06 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdb_disassemble): Use fprintf_unfiltered instead of
- fprintf_filtered.
-
-Tue Oct 10 15:26:39 1995 Fred Fish <fnf@cygnus.com>
-
- * README.GDBTK: Updated for version 4.15.
-
-Sat Aug 19 17:20:22 1995 Michael Tiemann <tiemann@axon.cygnus.com>
-
- * gdbtk.tcl: ENABLE comes back as "1" or "0", not "enable" or
- "disable".
- Also, wire up the breakpoint window so that it can be demo'd.
-
-Tue Aug 1 11:44:53 1995 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * gdbtk.c: Include "gdb_string.h" instead of <string.h>.
-
-Tue Jun 20 10:19:40 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c: Add functions Tcl_Malloc, Tcl_Realloc, and Tcl_Free.
-
- * gdbtk.tcl (add_breakpoint_frame): Add more fields.
- * (create_file_win create_asm_win build_framework): Create null
- bindings for meta keys to keep window from dropping down to
- insertion point when meta is pressed by itself. New bindings:
- Up/Down - Scroll up/down one line at a time
- Next/Prior - Scroll up/down one page at a time
- Home/End - Warp to current pc/end of file
- * (build_framework): Turn on breakpoint menu.
- * (create_command_window): Implement tab completion. Add binding
- for ^C to stop target.
-
-Fri May 19 06:15:40 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
-
- * gdbtk.c: Conditionalize use of stdarg rather than varargs on
- ANSI_PROTOTYPES not __STDC__; it must match the definition of
- PARAMS.
-
-Thu May 18 15:58:46 1995 J.T. Conklin <jtc@rtl.cygnus.com>
-
- * gdbtk.c (gdbtk_query): Use stdarg.h macros when compiling with
- an ANSI compiler.
-
-Sat Apr 15 13:52:24 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.c (gdb_disassemble): Read from inferior if connected
- to a VxWorks target.
-
-Fri Apr 14 10:18:20 1995 Stu Grossman (grossman@cygnus.com)
-
- * README.GDBTK: New file. Contains the obvious.
-
-Tue Apr 11 11:07:12 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * gdbtk.c (gdbtk_init): If SIOCSPGRP is not available, but
- F_SETOWN is, use that.
-
-Thu Apr 6 17:00:46 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * Makefile.in (X11_INCLUDES): Define as empty.
- (X11_CFLAGS): Define as including $(X11_INCLUDES).
- (X11_LIB_SWITCHES): Define as empty.
- (X11_LIBS): Define as -lX11.
-
- * configure.in (enable_gdbtk): If gdbtk, support the --x-includes
- and --x-libraries switches, setting the X11_INCLUDES and
- X11_LIB_SWITCHES respectively. Instead of using a hardcoded -lX11
- in ENABLE_CLIBS, use the X11_LIB_SWITCHES and X11_LIBS variables.
-
- * gdbtk.c (gdbtk_init): If SIOCSPGRP is not available, don't use
- it. This means that the stop button doesn't work, but is better
- than nothing.
-
-Wed Mar 29 17:09:29 1995 Stu Grossman (grossman@cygnus.com)
-
- * Makefile.in (gdbtk.o): Use X11_CFLAGS to provide alternate
- locations (per-host) for X11 include files.
- * config/pa/hppahpux.mh (XM_CLIBS): Add -L/usr/lib/X11R5 to force
- the use of R5 libs.
- (X11_CFLAGS): Add this to indicate the locs
- of the R5 include files.
-
-Wed Mar 8 16:12:21 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdb_get_breakpoint_info): Return error if breakpoint
- type is not bp_breakpoint.
-
-Tue Feb 14 17:16:41 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c: Ditto.
- * gdbtk.c: General cleanups, get rid of unused variables. Redo
- handling of stdout/stderr to just return output as the result of
- the tcl command that caused the output. Cleanup -Wall stuff.
- * (breakpoint_notify): Now returns just action and breakpoint
- number.
- * (gdb_get_breakpoint_list): New routine. Does the obvious.
- * (gdb_get_breakpoint_info): Mostly derived from the old
- breakpoint_notify, but returns lots more info.
- * (dsprintf_append_element): Helper routine, works like printf,
- but appends a tcl element onto the specified DString. Good for
- building up lists as return values.
- * (gdbtk_enable/disable_breakpoint): Go away. Replaced with
- gdbtk_modify_breakpoint.
- * (*many routines*): Use new result protocol.
- * (call_wrapper): Make sure that recursive calls don't trash results.
- * gdbtk.tcl: New windows, autocmd, and breakpoints.
- * (gdbtk_tcl_fputs): Don't use $current_output_win redirection
- anymore. It's not needed (in fact, this routine may not be needed
- anymore).
- * (gdbtk_tcl_breakpoint): Change to reflect new breakpoint
- notification protocol.
- * (gdbtk_tcl_busy gdbtk_tcl_idle): Straighten out buttons, remove
- catches.
- * (interactive_cmd): Use this wrapper around button invocations
- of many commands. This will catch errors and put the results into
- the command window. It also updates all the other windows.
- * Also, change reliefs of most things to sunken. This actually
- looks better.
- * (create_file_win): Fix margin binding to allow breakpoints to
- work again.
- * (create_asm_win): Use return value of gdb_disassemble instead
- of implicit I/O to the command window.
- * (create_command_window): Use new result protocol to get output
- from commands.
-
-Sun Feb 5 20:32:44 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
-
- * gdbtk.c (gdb_disassemble): Deference pointer to function before
- calling it (pre-ANSI compilers generally require this).
-
-Fri Feb 3 11:19:20 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdb_disassemble): Get rid of
- dis_asm_read_memory_hook. We can now call the disassemblers
- directly and have no need for this hook anymore.
-
-Mon Jan 30 17:34:24 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl (create_file_win): Disable old popup menu for source
- window.
-
-Wed Jan 25 18:23:46 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdbtk_init): Prevent segfault when gdbtk.tcl can't be
- found.
- * gdbtk.tcl: Initialize expr_update_list() to prevent errors when
- popping up expression window for the first time.
-
-Tue Jan 24 12:10:28 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl (create_registers_window): Work around a radiobutton
- widget bug to make Options|Natural button work.
-
- * gdbtk.c (gdb_disassemble): Fix problem with source+assembly and
- g++ caused by out-of-order pc's.
- * gdbtk.tcl (files_command): Remove duplicate file names. Also,
- add scrollbar.
-
-Mon Jan 23 17:21:09 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl: Take .gdbtkinit if it exists. Makes gdbtk match the
- doc!
-
-Thu Jan 12 15:02:40 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c, gdbtk.tcl: Update/add copyright.
- * gdbtk.tcl (build_framework): Several fixes for filespec widget,
- including dismiss button, and better error handling.
- * (create_command_win): Bind button 2 to retrieve selection.
-
-Wed Jan 11 17:06:55 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl: Add button to control mixed source disassembly.
- Use text widgets in expr window. The give me more control over
- layout.
- Add auto-updating of exprs in expression window.
- Handle expressions out of scope a bit better.
- Make selected window pop up to the top when invoked via the
- menubar.
- Make copyright message have raised relief.
-
- * gdbtk.c (gdbtk_init): Improve handling for errors in gdbtk.tcl
- during startup.
-
-Thu Jan 5 17:38:29 1995 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (finish_saving_output): Don't do anything if not saving
- output.
- * (breakpoint_notify): Don't send null filename to tcl.
- * (gdb_eval): New tcl command to eval an expression.
- * (gdb_disassemble): New tcl command to do disassembly. This
- allows tcl code to choose between exec file and target memeory,
- and can also do mixed source and assembly.
- * (gdbtk_init): Move reading of gdbtk.tcl to the end to make sure
- that more of the environment is set up. Also, create link between
- gdb and tcl vars disassemble{-_}from{-_}exec.
-
- * gdbtk.tcl: New expression window support.
- * Make assembly window be 80 columns wide.
- * Use new disassembly method. Add menu items to select
- disassembly from exec file or target.
- * Change View menubar item to Options.
-
- * Get rid of Stack, Breakpoints, Signals, and Variables Windows,
- since they don't exist yet.
-
- * Pop up a copyright window on startup.
-
-Wed Jan 4 19:49:10 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.tcl (build_framework): Add standard commands menu, more
- windows to standard windows menu.
- (not_implemented_yet): Clarify message.
-
-Fri Dec 30 15:49:00 1994 Stan Shebs <shebs@andros.cygnus.com>
-
- * gdbtk.tcl (FSBox): New proc, File Selection Box code from exmh.
- (not_implemented_yet): New proc.
- (build_framework): Add various file commands to file menu.
-
-Fri Dec 23 16:18:50 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdbtk_wait gdbtk_init): Portability improvements for
- SIGIO handling.
-
-Mon Dec 19 09:55:47 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl (update_assembly): Force update to make sure that pc
- is visible when creating new assembly windows.
-
-Sun Dec 18 23:31:20 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdbtk_wait gdbtk_init): Use different method of
- enabling I/O interrupts for SVR4 (streams).
- * (start_saving_output save_output get_saved_output
- finish_saving_output flush_holdbuf gdbtk_flush gdbtk_fputs
- gdbtk_init):
- Totally revamp to use TCLs dynamic string functions. Also, quote
- all data passed back to TCL to prevent errors with unmatched
- braces, odd characters, etc... This fixes several wierd problems
- with outputting strings containing unmatched braces.
- * (breakpoint_notify gdb_loc): Use long hex format to output
- addresses of breakpoints and PCs. This fixes some Alpha problems.
- * (breakpoint_notify): Add stream arg to call to gdbtk_fputs.
- * (gdb_listfiles): Also, go through the symtabs when looking for
- files. This makes xcoff work (sort of), but probably breaks
- something else.
- * (gdb_stop): Return TCL_OK instead of nothing. This fixes odd
- TCL errors when hitting stop button.
- * (tk_command): Don't pass interp->result on to Tcl_{Var}Eval, as
- that will trash the result. strdup the result instead and pass
- that on. Improve error handling as well.
-
- * gdbtk.tcl (gdbtk_tcl_flush): Use global def of
- current_output_win. Makes flushing actually work!
- * (asm_win_name create_asm_win update_assembly): Bunch of fixes
- to make assembly windows stop flashing when loading a new file.
- * (gdbtk_tcl_busy gdbtk_tcl_idle): Use catch to prevent gdb_cmd
- errors from losing control.
- * (create_source_window): Add source file selection to View menu.
- * (create_command_window (<Key-Return> binding): Quote text fed
- into gdb_cmd to prevent eval errors.
-
-Thu Dec 15 16:40:10 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c: Improve mechanism for capturing output values.
- (full_filename): Remove.
- (gdb_cmd call_wrapper gdbtk_init): Protect all calls from tcl land
- with call_wrapper. This prevents longjmps (usually via error())
- from jumping out of tcl/tk and leaving things in an indeterminate
- state.
- (gdbtk_fputs): Differentiate stdout from stderr when passing text
- into tcl land.
- * gdbtk.tcl: New view option to disable line numbers. Put catch
- around most uses of gdb_cmd. Add update button to reg config
- window. Stop doing immediate updates when selecting registers.
- Change register view values into checkbuttons.
-
-Mon Dec 12 16:59:29 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl (reg_config_menu create_registers_window
- recompute_reg_display_list): Use array instead of individual vars
- for register display list.
- * (recompute_reg_display_list update_registers): Fix bug with not
- displaying all registers.
-
-Mon Dec 12 12:22:21 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c: New tcl commands: gdb_fetch_registers,
- gdb_changed_register_list, and gdb_regnames.
- * gdbtk.tcl: Use monochrome color model for now.
- * (delete_breakpoint_tag create_file_win): Add breakdot support.
- * (create_file_win create_asm_win update_listing build_framework
- create_source_window create_command_window): Re-org window
- creation to give all windows consistent look and feel.
- * (update_listing update_asm): Change pc pointer to '->'.
- * (registers_command reg_config_menu create_registers_window
- populate_reg_window update_registers): Revamp register window.
- Allow selection of registers to be displayed. Highlight changed
- registers.
-
-Mon Nov 28 09:17:20 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl (build_framework): Fix bug with setting window titles.
-
- * gdbtk.tcl (build_framework): Add "Report bug" to help menu.
-
- * gdbtk.tcl: Re-arrange windows using new, consistent layout. Clean
- up lots of code and centralize framework initialization.
-
-Wed Nov 16 15:28:29 1994 Rob Savoye (rob@cygnus.com)
-
- * Makefile.in: Fix the test for installing gdbtk.
-
-Mon Nov 14 08:51:29 1994 Stu Grossman (grossman@cygnus.com)
-
- * Makefile.in: Install gdbtk.tcl.
- * configure.in: Add ENABLE_GDBTK flag.
- * gdbtk.c (gdb_sourcelines): Returns list of source lines
- containing code. (gdb_regnames): Returns list of register names.
-
-Thu Nov 3 14:25:24 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdb_stop): Switch to target_stop().
-
-Tue Nov 1 16:41:12 1994 Stu Grossman (grossman@cygnus.com)
-
- * Makefile.in: Use $(objdir)/tcl and $(objdir)/tk if they are
- available.
- * configure.in (ENABLE_CLIBS): Use $(TCL) and $(TK) instead of
- -ltcl and -ltk.
- * gdbtk.c: Get rid of lots of unnecessary #includes.
- * (gdbtk_init): Use ConnectionNumber macro instead of referencing
- Display structure directly.
- * gdbtk.tcl: Change exit button to quit button.
-
-Wed Oct 26 15:41:07 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c: Change sense and name of no_windows variable. Now
- called use_windows, and defaults to off (for compatibility).
-
-Thu Oct 20 17:35:45 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdb_cmd): Force GUI into idle mode when errors occur.
- * (gdb_stop): New tcl command to stop the target process.
- * (x_event, gdbtk_wait): Allow GUI to interrupt gdb out of target
- waits.
- * (gdbtk_call_command): Wrapper around command processing to
- alert GUI of target state changes.
- * (gdbtk_init): Get the fd of X server for doing async
- notification of X events (via x_event). Setup new hooks.
- * gdbtk.tcl: Add scrollbars to assembly and command windows.
- * Change window foreground & background colors.
- * Create margin tag for breakpoints in source and assembly windows.
- * Add new routines to be invoked when target state changes to/from
- idle.
- * Add start of expression window.
- * Change bindings of mouse button 1 in assembly and source window
- to just set or clear breakpoints when in the margin tag.
- * Change shape of register window to be more vertical to better
- reflect its contents.
- * Add stop button.
- * Cleanup some code around command window bindings.
-
-Sat Sep 17 17:05:14 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl: Let ^U delete lines in the command window.
-
-Fri Sep 16 15:40:34 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c: Replace calls to full_filename with symtab_to_filename.
- * gdbtk.tcl: New routine pc_to_line replaces in line code. New
- routine decr replaces in line code.
- * (create_file_win): Use catch to handle open failures more
- elegantly. Also, create special window to display file open
- failure message. Move opening of file prior to creation of text
- widget.
- * (create_asm_win): Add PC as argument. We now base disassembly
- on PC instead of function name, since function names can be
- ambiguous (usually seen with shared libs). Also, use catch to
- simplify code where we don't care about failures.
-
-Wed Sep 14 00:55:26 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.tcl: Add ref counts to breakpoint tags.
- * Put quotes around function name in disassemble command to better
- handle assembler names containing `.'.
- * Make pclist element 0 be filler to avoid off-by-one problem with
- line numbers.
- * Set names of top-level windows.
- * Add register display window.
- * Add PC to label of assembly window.
-
-Tue Sep 13 08:59:04 1994 Stu Grossman (grossman@cygnus.com)
-
- * gdbtk.c (gdbtk_flush gdbtk_fputs): Buffer up output to make
- disassembly more efficient.
- * (breakpoint_notify): Include pc in gdbtk_tcl_breakpoint
- callback.
- * (gdb_loc): Include pc in return value. Also, return function
- name if arg was specified.
- * (gdb_cmd_stub): Call gdb_flush to drain internal GDB buffers
- after command completes.
- * (gdbtk_init): Improve error handling.
-
- * gdbtk.tcl: Add lots of comments. Clean up code.
- * (gdbtk_tcl_fputs): Make output window redirectable.
- * Add assembly window, and breapoint support.
- * Make button 1 in margin toggle breakpoints.
- * Use stippling to indicate breakpoint disabling.
-
-Fri Sep 2 19:11:40 1994 Stu Grossman (grossman@cygnus.com)
-
- * configure.in: Don't symlink to gdbtk.tcl if it's already there.
-
-Thu Jul 28 14:37:36 1994 Stu Grossman (grossman@cygnus.com)
-
- Support for TK GUI.
- * Makefile.in: Add rule for gdbtk.o.
- * configure.in: Add support for --enable-gdbtk.
- * gdbtk.c: New file. Contains support routines for TK interface.
- * gdbtk.tcl: New file. Implements GUI policy.
-
-
-Local Variables:
-mode: change-log
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
diff --git a/gdb/gdbtk/generic/ChangeLog-2000 b/gdb/gdbtk/generic/ChangeLog-2000
deleted file mode 100644
index 51993bdee1a..00000000000
--- a/gdb/gdbtk/generic/ChangeLog-2000
+++ /dev/null
@@ -1,211 +0,0 @@
-2000-11-29 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk-cmds.c (Gdbtk_Init): Create gdb_current_directory,
- gdb_inferior_args, and gdb_source_path variables.
-
-2000-11-29 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk-cmds.c (call_wrapper): Don't reset result if wrapped
- command returned error.
-
-2000-11-28 Tom Tromey <tromey@cygnus.com>
-
- * gdbtk-cmds.c (gdb_clear_file): Use Tcl_WrongNumArgs.
- (gdb_confirm_quit): Likewise.
- (gdb_force_quit): Likewise.
- (gdb_eval): Likewise.
- (gdb_immediate_command): Likewise.
- (gdb_get_vars_command): Likewise.
- (gdb_get_line_command): Likewise.
- (gdb_get_file_command): Likewise.
- (gdb_get_function_command): Likewise.
- (gdb_cmd): Likewise. Also, don't allow more than 2 arguments.
- (gdb_listfiles): Corrected usage of Tcl_WrongNumArgs.
- (gdb_listfuncs): Use Tcl_WrongNumArgs. Return error.
- (gdb_fetch_registers): Likewise.
- (gdb_tracepoint_exists_command): Use Tcl_WrongNumArgs.
- (gdb_get_tracepoint_info): Likewise.
- (gdb_get_trace_frame_num): Likewise.
- (gdb_actions_command): Likewise.
- (gdb_disassemble): Likewise. Also, return error.
- (gdb_get_breakpoint_list): Likewise.
- (gdb_path_conv): Likewise.
- (gdb_load_disassembly): Use Tcl_WrongNumArgs.
- (gdb_loc): Likewise.
- (gdb_set_bp): Likewise.
- (gdb_set_bp_addr): Likewise.
- (gdb_get_breakpoint_info): Likewise.
-
-2000-10-23 Fernando Nasser <fnasser@redhat.com>
-
- From 2000-10-19 Steven Johnson <sbjohnson@ozemail.com.au>
- Note: The original patch used asprintf/vasprintf. I changed it to
- use the new xasprintf/xvasprintf gdb functions.
- * gdbtk.c (TclDebug, gdbtk_init): Replaced the vast majority of
- sprintf/vsprintf calls with asprintf and vasprintf respectively.
- Should prevent any possible buffer overruns possible with
- fixed size sprintf buffers. Specifically fixes a problem with long
- filenames and clearing breakpoints overflowing their buffers when
- using sprintf, causing a segfault. Generically should also prevent
- any other similar problems from occuring.
- * gdbtk-cmds.c (sprintf_append_element_to_obj, get_pc_register,
- gdb_get_tracepoint_info, gdb_load_disassembly, gdbtk_load_source,
- gdbtk_load_asm, gdb_set_bp, gdb_set_bp_addr, gdb_get_breakpoint_info,
- gdb_selected_frame, gdb_selected_block, gdb_get_blocks): Ditto.
- * gdbtk-hooks.c (gdbtk_warning, gdbtk_ignorable_warning,
- gdbtk_readline_begin, gdbtk_set_hook, breakpoint_notify,
- gdbtk_query, tracepoint_notify, gdbtk_error_begin,
- gdbtk_annotate_signal): Ditto.
-
-2000-10-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * gdbtk-hooks.c (x_event): Only process events if the target is
- running.
-
-2000-10-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * gdbtk-variable.c: Removed. Obsolete file.
-
-2000-10-13 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * gdbtk.c (target_is_native): The "multi-thread" target is native.
-
-2000-09-15 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * gdbtk-varobj.c (variable_value): Send back the error text issued
- by gdb so it can be displayed in a pop-up box.
-
-2000-07-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk-cmds.c (map_arg_registers): Set numregs to include the
- pseudo regs as well.
-
-2000-07-10 Kevin Buettner <kevinb@redhat.com>
-
- * gdbtk-cmds.c, gdbtk-hooks.c, gdbtk-variable.c: Eliminate use
- of PARAMS in function pointer declarations.
-
-2000-07-02 Kevin Buettner <kevinb@redhat.com>
-
- * gdbtk-cmds.c, gdbtk-hooks.c, gdbtk-variable.c,
- gdbtk-varobj.c, gdbtk-wrapper.c, gdbtk-wrapper.h, gdbtk.c,
- gdbtk.h: Eliminate use of PARAMS from declarations in these
- files.
-
-2000-06-08 Fernando Nasser <fnasser@cygnus.com>
-
- * gdbtk-cmds.c (get_register): Allow editing of typed registers if
- the type is a union with the first tag equal to the register name.
-
-Thu Jun 8 17:59:01 2000 Andrew Cagney <cagney@b1.cygnus.com>
-
- (gdb_load_info): Use make_cleanup_bfd_close.
- (gdb_search): Use make_cleanup_free_search_symbols.
- * gdbtk.c (cleanup_init): Change signature to match make_cleanups.
- (gdbtk_init): Discard make_cleanup_func cast.
- * gdbtk-cmds.c (gdb_eval): Ditto.
-
-2000-06-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * gdbtk.c: Remove CYGWIN32 conditional around timer machinery.
- Cygwin can handle timers fine now.
-
-2000-04-17 Jonathan Larmour <jlarmour@redhat.co.uk>
-
- * ChangeLog-gdbtk: Renamed to ChangeLog
- * ChangeLog: New file
- * gdbtk-cmds.c, gdbtk-hooks.c, gdbtk-variable.c, gdbtk-varobj.c,
- gdbtk-wrapper.h, gdbtk-wrapper.c, gdbtk.h, gdbtk.c: No need for
- changelog-default-name hint for Emacs now
-
-2000-04-14 Jonathan Larmour <jlarmour@redhat.co.uk>
-
- * gdbtk.c (gdbtk_init): For now, reset gdb_stdtarg to gdb_stdout
- when using gdbtk.
-
-2000-04-01 Jim Blandy <jimb@redhat.com>
-
- * gdbtk-hooks.c (gdbtk_restore_result_ptr): New function.
- * gdbtk.h (gdbtk_restore_result_ptr): Declare it.
- * gdbtk-cmds.c (gdbtk_load_asm): Use it to restore the old value
- of result_ptr, in case we get errors while disassembling things.
-
-2000-03-28 Jim Blandy <jimb@redhat.com>
-
- Handle the fact that there are holes in the register numbering.
- * gdbtk-cmds.c (gdb_regnames): If given the -numbers option,
- return the register numbers along with their names.
- (get_register_name): Record both the register name and number, if
- requested.
-
-2000-03-13 James Ingham <jingham@leda.cygnus.com>
-
- * gdbtk-varobj.c (variable_create): Pass the correct
- "how_specified" flag to the varobj_create routine.
-
-2000-02-29 James Ingham <jingham@leda.cygnus.com>
-
- * gdbtk-cmds.c (gdb_disassemble_driver): The to_shortname for
- Linux is "linuxthreads", not "linux-threads", so we have to change
- the heuristic to account for this. This fixes a crash when trying
- to disassemble from shared libraries.
-
-2000-02-23 Keith R Seitz <kseitz@nwlink.com>
-
- * gdbtk-wrapper.h: Add declarations for GDB_get_prev_frame, GDB_get_next_frame,
- GDB_find_relative_frame, GDB_get_current_frame.
- * gdbtk-wrapper.c (GDB_get_prev_frame, wrap_get_prev_frame): New functions.
- (GDB_get_next_frame, wrap_get_next_frame): New functions.
- (GDB_find_relative_frame, wrap_find_relative_frame): New functions.
- (GDB_get_current_frame, wrap_get_current_frame): New functions.
-
- * gdbtk-hooks.c (gdbtk_add_hooks): Use "specify_exec_file_hook" so
- that our hook is added to the list of hooks run instead of overwriting
- all other hooks.
-
- * gdbtk-cmds.c (gdb_stack): Wrap all calls to internal functions and
- deal with errors more gracefully.
-
-Wed Feb 23 13:01:36 2000 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c (gdbtk_dis_asm_read_memory): Change LEN to unsigned
- long. Match ../include/dis-asm.h change.
-
-Fri Feb 4 23:19:03 2000 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk.c (gdbtk_init): Update default path to tcl code - now
- gdbtk/library.
-
-Fri Feb 4 23:19:03 2000 Andrew Cagney <cagney@b1.cygnus.com>
-
- * ChangeLog-gdbtk, gdbtk-cmds.c, gdbtk-hooks.c, gdbtk-variable.c,
- gdbtk-varobj.c, gdbtk-wrapper.c, gdbtk-wrapper.h, gdbtk.c,
- gdbtk.h: Moved here from the top level GDB directory.
-
-Tue Feb 1 00:17:12 2000 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-hooks.c, gdbtk-variable.c, gdbtk-wrapper.c,
- gdbtk-wrapper.h, gdbtk.h: Update to reflect rename of gdb-file /
- GDB_FILE to ui-file / ``struct ui_file''.
-
-2000-01-31 Keith Seitz <kseitz@nwlink.com>
-
- * gdbtk-cmds.c (gdb_disassemble_driver) If using multi-arch, set the
- architecture in the disassembly info.
-
-Mon Jan 31 18:32:06 2000 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-variable.c, gdbtk-cmds.c, gdbtk.c: Include "tui/tui-file.h"
-
-Mon Jan 3 01:09:24 2000 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdbtk-cmds.c (gdb_get_mem): Use builtin_type_int32 et.al. to
- force the word size to 32 bits.
-
-
-Local Variables:
-mode: change-log
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
diff --git a/gdb/gdbtk/generic/gdbtk-bp.c b/gdb/gdbtk/generic/gdbtk-bp.c
deleted file mode 100644
index 2d56a433066..00000000000
--- a/gdb/gdbtk/generic/gdbtk-bp.c
+++ /dev/null
@@ -1,996 +0,0 @@
-/* Tcl/Tk command definitions for Insight - Breakpoints.
- Copyright (C) 2001, 2002, 2008 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-#include "defs.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "source.h"
-#include "linespec.h"
-#include "breakpoint.h"
-#include "tracepoint.h"
-#include "gdb_string.h"
-#include <tcl.h>
-#include "gdbtk.h"
-#include "gdbtk-cmds.h"
-#include "observer.h"
-
-/* From breakpoint.c */
-extern struct breakpoint *breakpoint_chain;
-
-/* From gdbtk-hooks.c */
-extern void report_error (void);
-
-/* These two lookup tables are used to translate the type & disposition fields
- of the breakpoint structure (respectively) into something gdbtk understands.
- They are also used in gdbtk-hooks.c */
-
-char *bptypes[] =
- {"none", "breakpoint", "hw breakpoint", "until",
- "finish", "watchpoint", "hw watchpoint",
- "read watchpoint", "acc watchpoint",
- "longjmp", "longjmp resume", "step resume",
- "sigtramp", "watchpoint scope",
- "call dummy", "shlib events", "catch load",
- "catch unload", "catch fork", "catch vfork",
- "catch exec", "catch catch", "catch throw"
- };
-char *bpdisp[] =
- {"delete", "delstop", "disable", "donttouch"};
-
-/* Is this breakpoint interesting to a user interface? */
-#define BREAKPOINT_IS_INTERESTING(bp) \
-((bp)->type == bp_breakpoint \
- || (bp)->type == bp_hardware_breakpoint \
- || (bp)->type == bp_watchpoint \
- || (bp)->type == bp_hardware_watchpoint \
- || (bp)->type == bp_read_watchpoint \
- || (bp)->type == bp_access_watchpoint)
-
-/* Is this breakpoint a watchpoint? */
-#define BREAKPOINT_IS_WATCHPOINT(bp) \
-((bp)->type == bp_watchpoint \
- || (bp)->type == bp_hardware_watchpoint \
- || (bp)->type == bp_read_watchpoint \
- || (bp)->type == bp_access_watchpoint)
-
-/*
- * These are routines we need from breakpoint.c.
- * at some point make these static in breakpoint.c and move GUI code there
- */
-
-extern struct breakpoint *set_raw_breakpoint (struct symtab_and_line sal,
- enum bptype bp_type);
-extern void set_breakpoint_count (int);
-extern int breakpoint_count;
-
-/* Breakpoint/Tracepoint lists. Unfortunately, gdb forces us to
- keep a list of breakpoints, too. Why couldn't it be done like
- treacepoints? */
-#define DEFAULT_LIST_SIZE 32
-static struct breakpoint **breakpoint_list;
-static int breakpoint_list_size = DEFAULT_LIST_SIZE;
-
-/*
- * Forward declarations
- */
-
-/* Breakpoint-related functions */
-static int gdb_find_bp_at_addr (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_find_bp_at_line (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_get_breakpoint_info (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST[]);
-static int gdb_get_breakpoint_list (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST[]);
-static int gdb_set_bp (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST objv[]);
-static int gdb_set_bp_addr (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-
-/* Tracepoint-related functions */
-static int gdb_actions_command (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_get_trace_frame_num (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_get_tracepoint_info (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_get_tracepoint_list (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_trace_status (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST[]);
-static int gdb_tracepoint_exists_command (ClientData, Tcl_Interp *,
- int, Tcl_Obj * CONST objv[]);
-static Tcl_Obj *get_breakpoint_commands (struct command_line *cmd);
-
-static int tracepoint_exists (char *args);
-
-/* Breakpoint/tracepoint events and related functions */
-
-void gdbtk_create_breakpoint (int);
-void gdbtk_delete_breakpoint (int);
-void gdbtk_modify_breakpoint (int);
-void gdbtk_create_tracepoint (int);
-void gdbtk_delete_tracepoint (int);
-void gdbtk_modify_tracepoint (int);
-static void breakpoint_notify (int, const char *);
-static void tracepoint_notify (int, const char *);
-
-int
-Gdbtk_Breakpoint_Init (Tcl_Interp *interp)
-{
- /* Breakpoint commands */
- Tcl_CreateObjCommand (interp, "gdb_find_bp_at_addr", gdbtk_call_wrapper,
- gdb_find_bp_at_addr, NULL);
- Tcl_CreateObjCommand (interp, "gdb_find_bp_at_line", gdbtk_call_wrapper,
- gdb_find_bp_at_line, NULL);
- Tcl_CreateObjCommand (interp, "gdb_get_breakpoint_info", gdbtk_call_wrapper,
- gdb_get_breakpoint_info, NULL);
- Tcl_CreateObjCommand (interp, "gdb_get_breakpoint_list", gdbtk_call_wrapper,
- gdb_get_breakpoint_list, NULL);
- Tcl_CreateObjCommand (interp, "gdb_set_bp", gdbtk_call_wrapper, gdb_set_bp, NULL);
- Tcl_CreateObjCommand (interp, "gdb_set_bp_addr", gdbtk_call_wrapper,
- gdb_set_bp_addr, NULL);
-
- /* Tracepoint commands */
- Tcl_CreateObjCommand (interp, "gdb_actions",
- gdbtk_call_wrapper, gdb_actions_command, NULL);
- Tcl_CreateObjCommand (interp, "gdb_get_trace_frame_num",
- gdbtk_call_wrapper, gdb_get_trace_frame_num, NULL);
- Tcl_CreateObjCommand (interp, "gdb_get_tracepoint_info",
- gdbtk_call_wrapper, gdb_get_tracepoint_info, NULL);
- Tcl_CreateObjCommand (interp, "gdb_get_tracepoint_list",
- gdbtk_call_wrapper, gdb_get_tracepoint_list, NULL);
- Tcl_CreateObjCommand (interp, "gdb_is_tracing",
- gdbtk_call_wrapper, gdb_trace_status, NULL);
- Tcl_CreateObjCommand (interp, "gdb_tracepoint_exists",
- gdbtk_call_wrapper, gdb_tracepoint_exists_command, NULL);
-
- /* Initialize our tables of BPs. */
- breakpoint_list = (struct breakpoint **) xmalloc (breakpoint_list_size * sizeof (struct breakpoint *));
- memset (breakpoint_list, 0, breakpoint_list_size * sizeof (struct breakpoint *));
-
- return TCL_OK;
-}
-
-/*
- * This section contains commands for manipulation of breakpoints.
- */
-
-/* set a breakpoint by source file and line number
- flags are as follows:
- least significant 2 bits are disposition, rest is
- type (normally 0).
-
- enum bptype {
- bp_breakpoint, Normal breakpoint
- bp_hardware_breakpoint, Hardware assisted breakpoint
- }
-
- Disposition of breakpoint. Ie: what to do after hitting it.
- enum bpdisp {
- del, Delete it
- del_at_next_stop, Delete at next stop, whether hit or not
- disable, Disable it
- donttouch Leave it alone
- };
-*/
-
-
-/* This implements the tcl command "gdb_find_bp_at_addr"
-
-* Tcl Arguments:
-* addr: CORE_ADDR
-* Tcl Result:
-* It returns a list of breakpoint numbers
-*/
-static int
-gdb_find_bp_at_addr (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- int i;
- CORE_ADDR addr;
- Tcl_WideInt waddr;
-
- if (objc != 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "address");
- return TCL_ERROR;
- }
-
- if (Tcl_GetWideIntFromObj (interp, objv[1], &waddr) != TCL_OK)
- return TCL_ERROR;
- addr = waddr;
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
- for (i = 0; i < breakpoint_list_size; i++)
- {
- if (breakpoint_list[i] != NULL
- && breakpoint_list[i]->loc->address == addr)
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewIntObj (i));
- }
-
- return TCL_OK;
-}
-
-/* This implements the tcl command "gdb_find_bp_at_line"
-
-* Tcl Arguments:
-* filename: the file in which to find the breakpoint
-* line: the line number for the breakpoint
-* Tcl Result:
-* It returns a list of breakpoint numbers
-*/
-static int
-gdb_find_bp_at_line (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-
-{
- struct symtab *s;
- int i, line;
-
- if (objc != 3)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "filename line");
- return TCL_ERROR;
- }
-
- s = lookup_symtab (Tcl_GetStringFromObj (objv[1], NULL));
- if (s == NULL)
- return TCL_ERROR;
-
- if (Tcl_GetIntFromObj (interp, objv[2], &line) == TCL_ERROR)
- {
- result_ptr->flags = GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
- for (i = 0; i < breakpoint_list_size; i++)
- if (breakpoint_list[i] != NULL
- && breakpoint_list[i]->line_number == line
- && !strcmp (breakpoint_list[i]->source_file, s->filename))
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewIntObj (i));
-
- return TCL_OK;
-}
-
-/* This implements the tcl command gdb_get_breakpoint_info
- *
- * Tcl Arguments:
- * breakpoint_number
- * Tcl Result:
- * A list with {file, function, line_number, address, type, enabled?,
- * disposition, ignore_count, {list_of_commands},
- * condition, thread, hit_count user_specification}
- */
-static int
-gdb_get_breakpoint_info (ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[])
-{
- struct symtab_and_line sal;
- int bpnum;
- struct breakpoint *b;
- char *funcname, *filename;
-
- Tcl_Obj *new_obj;
-
- if (objc != 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "breakpoint");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIntFromObj (NULL, objv[1], &bpnum) != TCL_OK)
- {
- result_ptr->flags = GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
-
- b = (bpnum <= breakpoint_list_size ? breakpoint_list[bpnum] : NULL);
- if (!b || b->type != bp_breakpoint)
- {
- gdbtk_set_result (interp, "Breakpoint #%d does not exist.", bpnum);
- return TCL_ERROR;
- }
-
- sal = find_pc_line (b->loc->address, 0);
-
- filename = symtab_to_filename (sal.symtab);
- if (filename == NULL)
- filename = "";
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (filename, -1));
-
- funcname = pc_function_name (b->loc->address);
- new_obj = Tcl_NewStringObj (funcname, -1);
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, new_obj);
-
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewIntObj (b->line_number));
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (core_addr_to_string
- (b->loc->address),
- -1));
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (bptypes[b->type], -1));
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewBooleanObj (b->enable_state == bp_enabled));
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (bpdisp[b->disposition], -1));
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewIntObj (b->ignore_count));
-
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- get_breakpoint_commands (b->commands));
-
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (b->cond_string, -1));
-
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewIntObj (b->thread));
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewIntObj (b->hit_count));
-
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (BREAKPOINT_IS_WATCHPOINT (b)
- ? b->exp_string
- : b->addr_string, -1));
-
- return TCL_OK;
-}
-
-/* Helper function for gdb_get_breakpoint_info, this function is
- responsible for figuring out what to type at the "commands" command
- in gdb's cli in order to get at the same command list passed here. */
-
-static Tcl_Obj *
-get_breakpoint_commands (struct command_line *cmd)
-{
- Tcl_Obj *obj, *tmp;
-
- obj = Tcl_NewObj ();
- while (cmd != NULL)
- {
- switch (cmd->control_type)
- {
- case simple_control:
- /* A simple command. Just append it. */
- Tcl_ListObjAppendElement (NULL, obj,
- Tcl_NewStringObj (cmd->line, -1));
- break;
-
- case break_control:
- /* A loop_break */
- Tcl_ListObjAppendElement (NULL, obj,
- Tcl_NewStringObj ("loop_break", -1));
- break;
-
- case continue_control:
- /* A loop_continue */
- Tcl_ListObjAppendElement (NULL, obj,
- Tcl_NewStringObj ("loop_continue", -1));
- break;
-
- case while_control:
- /* A while loop. Must append "end" to the end of it. */
- tmp = Tcl_NewStringObj ("while ", -1);
- Tcl_AppendToObj (tmp, cmd->line, -1);
- Tcl_ListObjAppendElement (NULL, obj, tmp);
- Tcl_ListObjAppendList (NULL, obj,
- get_breakpoint_commands (*cmd->body_list));
- Tcl_ListObjAppendElement (NULL, obj,
- Tcl_NewStringObj ("end", -1));
- break;
-
- case if_control:
- /* An if statement. cmd->body_list[0] is the true part,
- cmd->body_list[1] contains the "else" (false) part. */
- tmp = Tcl_NewStringObj ("if ", -1);
- Tcl_AppendToObj (tmp, cmd->line, -1);
- Tcl_ListObjAppendElement (NULL, obj, tmp);
- Tcl_ListObjAppendList (NULL, obj,
- get_breakpoint_commands (cmd->body_list[0]));
- if (cmd->body_count == 2)
- {
- Tcl_ListObjAppendElement (NULL, obj,
- Tcl_NewStringObj ("else", -1));
- Tcl_ListObjAppendList (NULL, obj,
- get_breakpoint_commands(cmd->body_list[1]));
- }
- Tcl_ListObjAppendElement (NULL, obj,
- Tcl_NewStringObj ("end", -1));
- break;
-
- case invalid_control:
- /* Something invalid. Just skip it. */
- break;
- }
-
- cmd = cmd->next;
- }
-
- return obj;
-}
-
-/* This implements the tcl command gdb_get_breakpoint_list
- * It builds up a list of the current breakpoints.
- *
- * Tcl Arguments:
- * None.
- * Tcl Result:
- * A list of breakpoint numbers.
- */
-static int
-gdb_get_breakpoint_list (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- int i;
- Tcl_Obj *new_obj;
-
- if (objc != 1)
- {
- Tcl_WrongNumArgs (interp, 1, objv, NULL);
- return TCL_ERROR;
- }
-
- for (i = 0; i < breakpoint_list_size; i++)
- {
- if (breakpoint_list[i] != NULL
- && breakpoint_list[i]->type == bp_breakpoint)
- {
- new_obj = Tcl_NewIntObj (i);
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, new_obj);
- }
- }
-
- return TCL_OK;
-}
-
-/* This implements the tcl command "gdb_set_bp"
- * It sets breakpoints, and notifies the GUI.
- *
- * Tcl Arguments:
- * filename: the file in which to set the breakpoint
- * line: the line number for the breakpoint
- * type: the type of the breakpoint
- * thread: optional thread number
- * Tcl Result:
- * The return value of the call to gdbtk_tcl_breakpoint.
- */
-static int
-gdb_set_bp (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct symtab_and_line sal;
- int line, thread = -1;
- struct breakpoint *b;
- char *buf, *typestr;
- enum bpdisp disp;
-
- if (objc != 4 && objc != 5)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "filename line type ?thread?");
- return TCL_ERROR;
- }
-
- sal.symtab = lookup_symtab (Tcl_GetStringFromObj (objv[1], NULL));
- if (sal.symtab == NULL)
- return TCL_ERROR;
-
- if (Tcl_GetIntFromObj (interp, objv[2], &line) == TCL_ERROR)
- {
- result_ptr->flags = GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
-
- typestr = Tcl_GetStringFromObj (objv[3], NULL);
- if (strncmp (typestr, "temp", 4) == 0)
- disp = disp_del;
- else if (strncmp (typestr, "normal", 6) == 0)
- disp = disp_donttouch;
- else
- {
- gdbtk_set_result (interp, "type must be \"temp\" or \"normal\"");
- return TCL_ERROR;
- }
-
- if (objc == 5)
- {
- if (Tcl_GetIntFromObj (interp, objv[4], &thread) == TCL_ERROR)
- {
- result_ptr->flags = GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
- }
-
- sal.line = line;
- if (!find_line_pc (sal.symtab, sal.line, &sal.pc))
- return TCL_ERROR;
-
- sal.section = find_pc_overlay (sal.pc);
- b = set_raw_breakpoint (sal, bp_breakpoint);
- set_breakpoint_count (breakpoint_count + 1);
- b->number = breakpoint_count;
- b->disposition = disp;
- b->thread = thread;
-
- /* FIXME: this won't work for duplicate basenames! */
- xasprintf (&buf, "%s:%d", lbasename (Tcl_GetStringFromObj (objv[1], NULL)),
- line);
- b->addr_string = xstrdup (buf);
- free(buf);
-
- /* now send notification command back to GUI */
- observer_notify_breakpoint_created (b->number);
- return TCL_OK;
-}
-
-/* This implements the tcl command "gdb_set_bp_addr"
- * It sets breakpoints, and notifies the GUI.
- *
- * Tcl Arguments:
- * addr: the CORE_ADDR at which to set the breakpoint
- * type: the type of the breakpoint
- * thread: optional thread number
- * Tcl Result:
- * The return value of the call to gdbtk_tcl_breakpoint.
- */
-static int
-gdb_set_bp_addr (ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[])
-
-{
- struct symtab_and_line sal;
- int thread = -1;
- CORE_ADDR addr;
- Tcl_WideInt waddr;
- struct breakpoint *b;
- char *saddr, *typestr;
- enum bpdisp disp;
-
- if (objc != 3 && objc != 4)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "address type ?thread?");
- return TCL_ERROR;
- }
-
- if (Tcl_GetWideIntFromObj (interp, objv[1], &waddr) != TCL_OK)
- return TCL_ERROR;
- addr = waddr;
- saddr = Tcl_GetStringFromObj (objv[1], NULL);
-
- typestr = Tcl_GetStringFromObj (objv[2], NULL);
- if (strncmp (typestr, "temp", 4) == 0)
- disp = disp_del;
- else if (strncmp (typestr, "normal", 6) == 0)
- disp = disp_donttouch;
- else
- {
- gdbtk_set_result (interp, "type must be \"temp\" or \"normal\"");
- return TCL_ERROR;
- }
-
- if (objc == 4)
- {
- if (Tcl_GetIntFromObj (interp, objv[3], &thread) == TCL_ERROR)
- {
- result_ptr->flags = GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
- }
-
- sal = find_pc_line (addr, 0);
- sal.pc = addr;
- b = set_raw_breakpoint (sal, bp_breakpoint);
- set_breakpoint_count (breakpoint_count + 1);
- b->number = breakpoint_count;
- b->disposition = disp;
- b->thread = thread;
- b->addr_string = xstrdup (saddr);
-
- /* now send notification command back to GUI */
- observer_notify_breakpoint_created (b->number);
- return TCL_OK;
-}
-
-/*
- * This section contains functions that deal with breakpoint
- * events from gdb.
- */
-
-/* The next three functions use breakpoint_notify to allow the GUI
- * to handle creating, deleting and modifying breakpoints. These three
- * functions are put into the appropriate gdb hooks in gdbtk_init.
- */
-
-void
-gdbtk_create_breakpoint (int num)
-{
- struct breakpoint *b;
- for (b = breakpoint_chain; b != NULL; b = b->next)
- {
- if (b->number == num)
- break;
- }
-
- if (b == NULL || !BREAKPOINT_IS_INTERESTING (b))
- return;
-
- /* Check if there is room to store it */
- if (num >= breakpoint_list_size)
- {
- int oldsize = breakpoint_list_size;
- while (num >= breakpoint_list_size)
- breakpoint_list_size += DEFAULT_LIST_SIZE;
- breakpoint_list = (struct breakpoint **) xrealloc (breakpoint_list, breakpoint_list_size * sizeof (struct breakpoint *));
- memset (&(breakpoint_list[oldsize]), 0, (breakpoint_list_size - oldsize) * sizeof (struct breakpoint *));
- }
-
- breakpoint_list[num] = b;
- breakpoint_notify (num, "create");
-}
-
-void
-gdbtk_delete_breakpoint (int num)
-{
- if (num >= 0
- && num <= breakpoint_list_size
- && breakpoint_list[num] != NULL)
- {
- breakpoint_notify (num, "delete");
- breakpoint_list[num] = NULL;
- }
-}
-
-void
-gdbtk_modify_breakpoint (int num)
-{
- if (num >= 0)
- breakpoint_notify (num, "modify");
-}
-
-/* This is the generic function for handling changes in
- * a breakpoint. It routes the information to the Tcl
- * command "gdbtk_tcl_breakpoint" in the form:
- * gdbtk_tcl_breakpoint action b_number b_address b_line b_file
- * On error, the error string is written to gdb_stdout.
- */
-static void
-breakpoint_notify (int num, const char *action)
-{
- char *buf;
-
- if (num > breakpoint_list_size
- || num < 0
- || breakpoint_list[num] == NULL
- /* FIXME: should not be so restrictive... */
- || breakpoint_list[num]->type != bp_breakpoint)
- return;
-
- /* We ensure that ACTION contains no special Tcl characters, so we
- can do this. */
- xasprintf (&buf, "gdbtk_tcl_breakpoint %s %d", action, num);
-
- if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK)
- report_error ();
- free(buf);
-}
-
-/*
- * This section contains the commands that deal with tracepoints:
- */
-
-/* This implements the tcl command gdb_actions
- * It sets actions for a given tracepoint.
- *
- * Tcl Arguments:
- * number: the tracepoint in question
- * actions: the actions to add to this tracepoint
- * Tcl Result:
- * None.
- */
-
-static int
-gdb_actions_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct tracepoint *tp;
- Tcl_Obj **actions;
- int nactions, i, len;
- char *number, *args, *action;
- long step_count;
- struct action_line *next = NULL, *temp;
- enum actionline_type linetype;
-
- if (objc != 3)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "number actions");
- return TCL_ERROR;
- }
-
- args = number = Tcl_GetStringFromObj (objv[1], NULL);
- tp = get_tracepoint_by_number (&args, 0, 0);
- if (tp == NULL)
- {
- Tcl_AppendStringsToObj (result_ptr->obj_ptr, "Tracepoint \"",
- number, "\" does not exist", NULL);
- return TCL_ERROR;
- }
-
- /* Free any existing actions */
- if (tp->actions != NULL)
- free_actions (tp);
-
- step_count = 0;
-
- Tcl_ListObjGetElements (interp, objv[2], &nactions, &actions);
-
- /* Add the actions to the tracepoint */
- for (i = 0; i < nactions; i++)
- {
- temp = xmalloc (sizeof (struct action_line));
- temp->next = NULL;
- action = Tcl_GetStringFromObj (actions[i], &len);
- temp->action = savestring (action, len);
-
- linetype = validate_actionline (&(temp->action), tp);
-
- if (linetype == BADLINE)
- {
- free (temp);
- continue;
- }
-
- if (next == NULL)
- {
- tp->actions = temp;
- next = temp;
- }
- else
- {
- next->next = temp;
- next = temp;
- }
- }
-
- return TCL_OK;
-}
-
-static int
-gdb_get_trace_frame_num (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- if (objc != 1)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "linespec");
- return TCL_ERROR;
- }
-
- Tcl_SetIntObj (result_ptr->obj_ptr, get_traceframe_number ());
- return TCL_OK;
-
-}
-
-static int
-gdb_get_tracepoint_info (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct symtab_and_line sal;
- int tpnum;
- struct tracepoint *tp;
- struct action_line *al;
- Tcl_Obj *action_list;
- char *filename, *funcname;
-
- if (objc != 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "tpnum");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIntFromObj (NULL, objv[1], &tpnum) != TCL_OK)
- {
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
-
- ALL_TRACEPOINTS (tp)
- if (tp->number == tpnum)
- break;
-
- if (tp == NULL)
- {
- gdbtk_set_result (interp, "Tracepoint #%d does not exist", tpnum);
- return TCL_ERROR;
- }
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
- sal = find_pc_line (tp->address, 0);
- filename = symtab_to_filename (sal.symtab);
- if (filename == NULL)
- filename = "N/A";
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewStringObj (filename, -1));
-
- funcname = pc_function_name (tp->address);
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewStringObj
- (funcname, -1));
-
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewIntObj (sal.line));
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewStringObj (core_addr_to_string (tp->address), -1));
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewIntObj (tp->enabled_p));
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewIntObj (tp->pass_count));
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewIntObj (tp->step_count));
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewIntObj (tp->thread));
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewIntObj (tp->hit_count));
-
- /* Append a list of actions */
- action_list = Tcl_NewObj ();
- for (al = tp->actions; al != NULL; al = al->next)
- {
- Tcl_ListObjAppendElement (interp, action_list,
- Tcl_NewStringObj (al->action, -1));
- }
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, action_list);
-
- return TCL_OK;
-}
-
-/* return a list of all tracepoint numbers in interpreter */
-static int
-gdb_get_tracepoint_list (ClientData clientData,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *CONST objv[])
-{
- struct tracepoint *tp;
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
-
- ALL_TRACEPOINTS (tp)
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewIntObj (tp->number));
-
- return TCL_OK;
-}
-
-static int
-gdb_trace_status (ClientData clientData,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *CONST objv[])
-{
- int result = 0;
-
- if (trace_running_p)
- result = 1;
-
- Tcl_SetIntObj (result_ptr->obj_ptr, result);
- return TCL_OK;
-}
-
-/* returns -1 if not found, tracepoint # if found */
-static int
-tracepoint_exists (char *args)
-{
- struct tracepoint *tp;
- char **canonical;
- struct symtabs_and_lines sals;
- char *file = NULL;
- int result = -1;
-
- sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL);
- if (sals.nelts == 1)
- {
- resolve_sal_pc (&sals.sals[0]);
- file = xmalloc (strlen (sals.sals[0].symtab->dirname)
- + strlen (sals.sals[0].symtab->filename) + 1);
- if (file != NULL)
- {
- strcpy (file, sals.sals[0].symtab->dirname);
- strcat (file, sals.sals[0].symtab->filename);
-
- ALL_TRACEPOINTS (tp)
- {
- if (tp->address == sals.sals[0].pc)
- result = tp->number;
-#if 0
- /* Why is this here? This messes up assembly traces */
- else if (tp->source_file != NULL
- && strcmp (tp->source_file, file) == 0
- && sals.sals[0].line == tp->line_number)
- result = tp->number;
-#endif
- }
- }
- }
- if (file != NULL)
- free (file);
- return result;
-}
-
-static int
-gdb_tracepoint_exists_command (ClientData clientData,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *CONST objv[])
-{
- char *args;
-
- if (objc != 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv,
- "function:line|function|line|*addr");
- return TCL_ERROR;
- }
-
- args = Tcl_GetStringFromObj (objv[1], NULL);
-
- Tcl_SetIntObj (result_ptr->obj_ptr, tracepoint_exists (args));
- return TCL_OK;
-}
-
-/*
- * This section contains functions which deal with tracepoint
- * events from gdb.
- */
-
-void
-gdbtk_create_tracepoint (int num)
-{
- tracepoint_notify (num, "create");
-}
-
-void
-gdbtk_delete_tracepoint (int num)
-{
- tracepoint_notify (num, "delete");
-}
-
-void
-gdbtk_modify_tracepoint (int num)
-{
- tracepoint_notify (num, "modify");
-}
-
-static void
-tracepoint_notify (int num, const char *action)
-{
- char *buf;
-
- /* We ensure that ACTION contains no special Tcl characters, so we
- can do this. */
- xasprintf (&buf, "gdbtk_tcl_tracepoint %s %d", action, num);
-
- if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK)
- report_error ();
- free(buf);
-}
diff --git a/gdb/gdbtk/generic/gdbtk-cmds.c b/gdb/gdbtk/generic/gdbtk-cmds.c
deleted file mode 100644
index 6a75cd4cc53..00000000000
--- a/gdb/gdbtk/generic/gdbtk-cmds.c
+++ /dev/null
@@ -1,3025 +0,0 @@
-/* Tcl/Tk command definitions for Insight.
- Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2007, 2008
- Free Software Foundation, Inc.
-
- Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support.
- Substantially augmented by Martin Hunt, Keith Seitz & Jim Ingham of
- Cygnus Support.
-
- This file is part of GDB.
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-#include "defs.h"
-#include "inferior.h"
-#include "source.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdbcore.h"
-#include "demangle.h"
-#include "linespec.h"
-#include "tui/tui-file.h"
-#include "top.h"
-#include "annotate.h"
-#include "block.h"
-#include "dictionary.h"
-#include "filenames.h"
-#include "disasm.h"
-#include "value.h"
-#include "varobj.h"
-#include "exceptions.h"
-#include "language.h"
-#include "target.h"
-
-/* tcl header files includes varargs.h unless HAS_STDARG is defined,
- but gdb uses stdarg.h, so make sure HAS_STDARG is defined. */
-#define HAS_STDARG 1
-
-#include <tcl.h>
-#include <tk.h>
-
-#include "guitcl.h"
-#include "gdbtk.h"
-#include "gdbtk-wrapper.h"
-#include "gdbtk-cmds.h"
-
-#include <signal.h>
-#include <fcntl.h>
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#include <sys/time.h>
-#include <sys/stat.h>
-
-#include "gdb_string.h"
-#include "dis-asm.h"
-#include "gdbcmd.h"
-
-#ifdef __CYGWIN__
-#include <sys/cygwin.h> /* for cygwin_conv_to_full_win32_path */
-#endif
-
-#ifdef HAVE_CTYPE_H
-#include <ctype.h> /* for isprint() */
-#endif
-
-/* Various globals we reference. */
-extern char *source_path;
-
-/* These two objects hold boolean true and false,
- and are shared by all the list objects that gdb_listfuncs
- returns. */
-
-static Tcl_Obj *mangled, *not_mangled;
-
-/* These two control how the GUI behaves when gdb is either tracing or loading.
- They are used in this file & gdbtk_hooks.c */
-
-int No_Update = 0;
-int load_in_progress = 0;
-
-/* This Structure is used in gdb_disassemble_driver.
- We need a different sort of line table from the normal one cuz we can't
- depend upon implicit line-end pc's for lines to do the
- reordering in this function. */
-
-struct my_line_entry
-{
- int line;
- CORE_ADDR start_pc;
- CORE_ADDR end_pc;
-};
-
-/* Use this to pass the Tcl Text widget command and the open file
- descriptor to the disassembly load command. */
-
-struct disassembly_client_data
-{
- FILE *fp;
- int file_opened_p;
- int widget_line_no;
- Tcl_Interp *interp;
- char *widget;
- Tcl_Obj *result_obj[3];
- const char *asm_argv[14];
- const char *source_argv[7];
- char *map_arr;
- Tcl_DString src_to_line_prefix;
- Tcl_DString pc_to_line_prefix;
- Tcl_DString line_to_pc_prefix;
- Tcl_CmdInfo cmd;
-};
-
-/* This variable determines where memory used for disassembly is read
- from. See note in gdbtk.h for details. */
-/* NOTE: cagney/2003-09-08: This variable is unused. */
-int disassemble_from_exec = -1;
-
-extern int gdb_variable_init (Tcl_Interp * interp);
-
-/*
- * Declarations for routines exported from this file
- */
-
-int Gdbtk_Init (Tcl_Interp * interp);
-
-/*
- * Declarations for routines used only in this file.
- */
-
-static int compare_lines (const PTR, const PTR);
-static int comp_files (const void *, const void *);
-static int gdb_clear_file (ClientData, Tcl_Interp * interp, int,
- Tcl_Obj * CONST[]);
-static int gdb_cmd (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_confirm_quit (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST[]);
-static int gdb_entry_point (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_eval (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_find_file_command (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_force_quit (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_get_file_command (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_get_function_command (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_get_line_command (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_update_mem (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_set_mem (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_immediate_command (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST[]);
-static int gdb_incr_addr (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_CA_to_TAS (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_listfiles (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_listfuncs (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_loadfile (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_load_disassembly (ClientData clientData, Tcl_Interp
- * interp, int objc, Tcl_Obj * CONST objv[]);
-static int gdb_get_inferior_args (ClientData clientData,
- Tcl_Interp *interp,
- int objc, Tcl_Obj * CONST objv[]);
-static int gdb_set_inferior_args (ClientData clientData,
- Tcl_Interp *interp,
- int objc, Tcl_Obj * CONST objv[]);
-static int gdb_load_info (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_loc (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_path_conv (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_prompt_command (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_restore_fputs (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST[]);
-static int gdb_search (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST objv[]);
-static int gdb_stop (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static int gdb_target_has_execution_command (ClientData,
- Tcl_Interp *, int,
- Tcl_Obj * CONST[]);
-static void gdbtk_load_source (ClientData clientData,
- struct symtab *symtab,
- int start_line, int end_line);
-static CORE_ADDR gdbtk_load_asm (ClientData clientData, CORE_ADDR pc,
- struct disassemble_info *di);
-static int gdb_disassemble_driver (CORE_ADDR low, CORE_ADDR high,
- int mixed_source_and_assembly,
- ClientData clientData,
- void (*print_source_fn) (ClientData, struct
- symtab *, int,
- int),
- CORE_ADDR (*print_asm_fn) (ClientData,
- CORE_ADDR,
- struct
- disassemble_info
- *));
-char *get_prompt (void);
-static int perror_with_name_wrapper (PTR args);
-static int wrapped_call (PTR opaque_args);
-static int hex2bin (const char *hex, char *bin, int count);
-static int fromhex (int a);
-
-
-/* Gdbtk_Init
- * This loads all the Tcl commands into the Tcl interpreter.
- *
- * Arguments:
- * interp - The interpreter into which to load the commands.
- *
- * Result:
- * A standard Tcl result.
- */
-
-int
-Gdbtk_Init (Tcl_Interp *interp)
-{
- Tcl_CreateObjCommand (interp, "gdb_cmd", gdbtk_call_wrapper, gdb_cmd, NULL);
- Tcl_CreateObjCommand (interp, "gdb_immediate", gdbtk_call_wrapper,
- gdb_immediate_command, NULL);
- Tcl_CreateObjCommand (interp, "gdb_loc", gdbtk_call_wrapper, gdb_loc, NULL);
- Tcl_CreateObjCommand (interp, "gdb_path_conv", gdbtk_call_wrapper, gdb_path_conv,
- NULL);
- Tcl_CreateObjCommand (interp, "gdb_listfiles", gdbtk_call_wrapper, gdb_listfiles,
- NULL);
- Tcl_CreateObjCommand (interp, "gdb_listfuncs", gdbtk_call_wrapper, gdb_listfuncs,
- NULL);
- Tcl_CreateObjCommand (interp, "gdb_entry_point", gdbtk_call_wrapper,
- gdb_entry_point, NULL);
- Tcl_CreateObjCommand (interp, "gdb_update_mem", gdbtk_call_wrapper, gdb_update_mem,
- NULL);
- Tcl_CreateObjCommand (interp, "gdb_set_mem", gdbtk_call_wrapper, gdb_set_mem,
- NULL);
- Tcl_CreateObjCommand (interp, "gdb_stop", gdbtk_call_wrapper, gdb_stop, NULL);
- Tcl_CreateObjCommand (interp, "gdb_restore_fputs", gdbtk_call_wrapper, gdb_restore_fputs,
- NULL);
- Tcl_CreateObjCommand (interp, "gdb_eval", gdbtk_call_wrapper, gdb_eval, NULL);
- Tcl_CreateObjCommand (interp, "gdb_incr_addr", gdbtk_call_wrapper, gdb_incr_addr, NULL);
- Tcl_CreateObjCommand (interp, "gdb_CA_to_TAS", gdbtk_call_wrapper, gdb_CA_to_TAS, NULL);
- Tcl_CreateObjCommand (interp, "gdb_clear_file", gdbtk_call_wrapper,
- gdb_clear_file, NULL);
- Tcl_CreateObjCommand (interp, "gdb_confirm_quit", gdbtk_call_wrapper,
- gdb_confirm_quit, NULL);
- Tcl_CreateObjCommand (interp, "gdb_force_quit", gdbtk_call_wrapper,
- gdb_force_quit, NULL);
- Tcl_CreateObjCommand (interp, "gdb_target_has_execution",
- gdbtk_call_wrapper,
- gdb_target_has_execution_command, NULL);
- Tcl_CreateObjCommand (interp, "gdb_load_info", gdbtk_call_wrapper, gdb_load_info,
- NULL);
- Tcl_CreateObjCommand (interp, "gdb_get_function", gdbtk_call_wrapper,
- gdb_get_function_command, NULL);
- Tcl_CreateObjCommand (interp, "gdb_get_line", gdbtk_call_wrapper,
- gdb_get_line_command, NULL);
- Tcl_CreateObjCommand (interp, "gdb_get_file", gdbtk_call_wrapper,
- gdb_get_file_command, NULL);
- Tcl_CreateObjCommand (interp, "gdb_prompt",
- gdbtk_call_wrapper, gdb_prompt_command, NULL);
- Tcl_CreateObjCommand (interp, "gdb_find_file",
- gdbtk_call_wrapper, gdb_find_file_command, NULL);
- Tcl_CreateObjCommand (interp, "gdb_loadfile", gdbtk_call_wrapper, gdb_loadfile,
- NULL);
- Tcl_CreateObjCommand (interp, "gdb_load_disassembly", gdbtk_call_wrapper,
- gdb_load_disassembly, NULL);
- Tcl_CreateObjCommand (gdbtk_interp, "gdb_search", gdbtk_call_wrapper,
- gdb_search, NULL);
- Tcl_CreateObjCommand (interp, "gdb_get_inferior_args", gdbtk_call_wrapper,
- gdb_get_inferior_args, NULL);
- Tcl_CreateObjCommand (interp, "gdb_set_inferior_args", gdbtk_call_wrapper,
- gdb_set_inferior_args, NULL);
-
- /* gdb_context is used for debugging multiple threads or tasks */
- Tcl_LinkVar (interp, "gdb_context_id",
- (char *) &gdb_context,
- TCL_LINK_INT | TCL_LINK_READ_ONLY);
-
- /* Make gdb's notion of the pwd visible. This is read-only because
- (1) it doesn't make sense to change it directly and (2) it is
- allocated using xmalloc and not Tcl_Alloc. You might think we
- could just use the Tcl `pwd' command. However, Tcl (erroneously,
- imho) maintains a cache of the current directory name, and
- doesn't provide a way for gdb to invalidate the cache. */
- Tcl_LinkVar (interp, "gdb_current_directory",
- (char *) &current_directory,
- TCL_LINK_STRING | TCL_LINK_READ_ONLY);
-
- /* Current gdb source file search path. This is read-only for
- reasons similar to those for gdb_current_directory. */
- Tcl_LinkVar (interp, "gdb_source_path",
- (char *) &source_path,
- TCL_LINK_STRING | TCL_LINK_READ_ONLY);
-
- /* Init variable interface... */
- if (gdb_variable_init (interp) != TCL_OK)
- return TCL_ERROR;
-
- /* Init breakpoint module */
- if (Gdbtk_Breakpoint_Init (interp) != TCL_OK)
- return TCL_ERROR;
-
- /* Init stack module */
- if (Gdbtk_Stack_Init (interp) != TCL_OK)
- return TCL_ERROR;
-
- /* Init register module */
- if (Gdbtk_Register_Init (interp) != TCL_OK)
- return TCL_ERROR;
-
- /* Determine where to disassemble from */
- Tcl_LinkVar (gdbtk_interp, "disassemble-from-exec",
- (char *) &disassemble_from_exec,
- TCL_LINK_INT);
-
- Tcl_PkgProvide (interp, "Gdbtk", GDBTK_VERSION);
- return TCL_OK;
-}
-
-/* This routine acts as a top-level for all GDB code called by Tcl/Tk. It
- handles cleanups, and uses catch_errors to trap calls to return_to_top_level
- (usually via error).
- This is necessary in order to prevent a longjmp out of the bowels of Tk,
- possibly leaving things in a bad state. Since this routine can be called
- recursively, it needs to save and restore the contents of the result_ptr as
- necessary. */
-
-int
-gdbtk_call_wrapper (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct wrapped_call_args wrapped_args;
- gdbtk_result new_result, *old_result_ptr;
- int wrapped_returned_error = 0;
-
- old_result_ptr = result_ptr;
- result_ptr = &new_result;
- result_ptr->obj_ptr = Tcl_NewObj ();
- result_ptr->flags = GDBTK_TO_RESULT;
-
- wrapped_args.func = (Tcl_ObjCmdProc *) clientData;
- wrapped_args.interp = interp;
- wrapped_args.objc = objc;
- wrapped_args.objv = objv;
- wrapped_args.val = TCL_OK;
-
- if (!catch_errors (wrapped_call, &wrapped_args, "", RETURN_MASK_ALL))
- {
-
- wrapped_args.val = TCL_ERROR; /* Flag an error for TCL */
-
- /* Make sure the timer interrupts are turned off. */
- gdbtk_stop_timer ();
-
- gdb_flush (gdb_stderr); /* Flush error output */
- gdb_flush (gdb_stdout); /* Sometimes error output comes here as well */
-
- /* If we errored out here, and the results were going to the
- console, then gdbtk_fputs will have gathered the result into the
- result_ptr. We also need to echo them out to the console here */
-
- gdb_flush (gdb_stderr); /* Flush error output */
- gdb_flush (gdb_stdout); /* Sometimes error output comes here as well */
-
- /* In case of an error, we may need to force the GUI into idle
- mode because gdbtk_call_command may have bombed out while in
- the command routine. */
-
- running_now = 0;
- Tcl_Eval (interp, "gdbtk_tcl_idle");
-
- }
- else
- {
- /* If the wrapped call returned an error directly, then we don't
- want to reset the result. */
- wrapped_returned_error = wrapped_args.val == TCL_ERROR;
- }
-
- /* do not suppress any errors -- a remote target could have errored */
- load_in_progress = 0;
-
- /*
- * Now copy the result over to the true Tcl result. If
- * GDBTK_TO_RESULT flag bit is set, this just copies a null object
- * over to the Tcl result, which is fine because we should reset the
- * result in this case anyway. If the wrapped command returned an
- * error, then we assume that the result is already set correctly.
- */
- if ((result_ptr->flags & GDBTK_IN_TCL_RESULT) || wrapped_returned_error)
- {
- Tcl_DecrRefCount (result_ptr->obj_ptr);
- }
- else
- {
- Tcl_SetObjResult (interp, result_ptr->obj_ptr);
- }
-
- result_ptr = old_result_ptr;
-
-#ifdef _WIN32
- close_bfds ();
-#endif
-
- return wrapped_args.val;
-}
-
-/*
- * This is the wrapper that is passed to catch_errors.
- */
-
-static int
-wrapped_call (PTR opaque_args)
-{
- struct wrapped_call_args *args = (struct wrapped_call_args *) opaque_args;
- args->val = (*args->func) (args->func, args->interp, args->objc, args->objv);
- return 1;
-}
-
-
-/*
- * This section contains the commands that control execution.
- */
-
-/* This implements the tcl command gdb_clear_file.
-
-* Prepare to accept a new executable file. This is called when we
-* want to clear away everything we know about the old file, without
-* asking the user. The Tcl code will have already asked the user if
-* necessary. After this is called, we should be able to run the
-* `file' command without getting any questions.
-*
-* Arguments:
-* None
-* Tcl Result:
-* None
-*/
-
-static int
-gdb_clear_file (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- if (objc != 1)
- {
- Tcl_WrongNumArgs (interp, 1, objv, NULL);
- return TCL_ERROR;
- }
-
- if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
- {
- if (attach_flag)
- target_detach (NULL, 0);
- else
- target_kill ();
- }
-
- if (target_has_execution)
- pop_target ();
-
- delete_command (NULL, 0);
- exec_file_clear (0);
- symbol_file_clear (0);
-
- return TCL_OK;
-}
-
-/* This implements the tcl command gdb_confirm_quit
- * Ask the user to confirm an exit request.
- *
- * Arguments:
- * None
- * Tcl Result:
- * A boolean, 1 if the user answered yes, 0 if no.
- */
-
-static int
-gdb_confirm_quit (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- int ret;
-
- if (objc != 1)
- {
- Tcl_WrongNumArgs (interp, 1, objv, NULL);
- return TCL_ERROR;
- }
-
- ret = quit_confirm ();
- Tcl_SetBooleanObj (result_ptr->obj_ptr, ret);
- return TCL_OK;
-}
-
-/* This implements the tcl command gdb_force_quit
- * Quit without asking for confirmation.
- *
- * Arguments:
- * None
- * Tcl Result:
- * None
- */
-
-static int
-gdb_force_quit (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- if (objc != 1)
- {
- Tcl_WrongNumArgs (interp, 1, objv, NULL);
- return TCL_ERROR;
- }
-
- quit_force ((char *) NULL, 1);
- return TCL_OK;
-}
-
-/* Pressing the stop button on the source window should attempt to
- * stop the target. If, after some short time, this fails, a dialog
- * should appear allowing the user to detach.
- *
- * The global GDBTK_FORCE_DETACH is set when we wish to detach from a
- * target. This value is returned by deprecated_ui_loop_hook
- * (x_event), indicating to callers that they should detach.
- *
- * Read the comments before x_event to find out how we (try) to keep
- * gdbtk alive while some other event loop has stolen control from us.
- */
-
-/*
- * This command implements the tcl command gdb_stop, which
- * is used to either stop the target or detach.
- * Note that it is assumed that a simulator or native target
- * can ALWAYS be stopped. Doing a "detach" on them has no effect.
- *
- * Arguments:
- * None or "detach"
- * Tcl Result:
- * None
- */
-
-static int
-gdb_stop (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- int force = 0;
- char *s;
-
- if (objc > 1)
- {
- s = Tcl_GetStringFromObj (objv[1], NULL);
- if (strcmp (s, "detach") == 0)
- force = 1;
- }
-
- if (force)
- {
- /* Set the "forcibly detach from target" flag. x_event will
- return this value to callers when they should forcibly detach. */
- gdbtk_force_detach = 1;
- }
- else
- {
- if (target_ignore != (void (*) (void)) current_target.to_stop)
- target_stop (gdbtk_get_ptid ());
- else
- quit_flag = 1; /* hope something sees this */
- }
-
- return TCL_OK;
-}
-
-
-/*
- * This section contains Tcl commands that are wrappers for invoking
- * the GDB command interpreter.
- */
-
-
-/* This implements the tcl command `gdb_eval'.
- * It uses the gdb evaluator to return the value of
- * an expression in the current language
- *
- * Tcl Arguments:
- * expression - the expression to evaluate.
- * format - optional format character. Valid chars are:
- * o - octal
- * x - hex
- * d - decimal
- * u - unsigned decimal
- * t - binary
- * f - float
- * a - address
- * c - char
- * Tcl Result:
- * The result of the evaluation.
- */
-
-static int
-gdb_eval (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct expression *expr;
- struct cleanup *old_chain = NULL;
- int format = 0;
- value_ptr val;
- struct ui_file *stb;
- long dummy;
- char *result;
-
- if (objc != 2 && objc != 3)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "expression [format]");
- return TCL_ERROR;
- }
-
- if (objc == 3)
- format = *(Tcl_GetStringFromObj (objv[2], NULL));
-
- expr = parse_expression (Tcl_GetStringFromObj (objv[1], NULL));
- old_chain = make_cleanup (free_current_contents, &expr);
- val = evaluate_expression (expr);
-
- /* "Print" the result of the expression evaluation. */
- stb = mem_fileopen ();
- make_cleanup_ui_file_delete (stb);
- val_print (value_type (val), value_contents (val),
- value_embedded_offset (val), VALUE_ADDRESS (val),
- stb, format, 0, 0, 0, current_language);
- result = ui_file_xstrdup (stb, &dummy);
- Tcl_SetObjResult (interp, Tcl_NewStringObj (result, -1));
- xfree (result);
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
-
- do_cleanups (old_chain);
- return TCL_OK;
-}
-
-/* This implements the tcl command "gdb_cmd".
-
-* It sends its argument to the GDB command scanner for execution.
-* This command will never cause the update, idle and busy hooks to be called
-* within the GUI.
-*
-* Tcl Arguments:
-* command - The GDB command to execute
-* from_tty - 1 indicates this comes to the console.
-* Pass this to the gdb command.
-* Tcl Result:
-* The output from the gdb command (except for the "load" & "while"
-* which dump their output to the console.
-*/
-
-static int
-gdb_cmd (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- int from_tty = 0;
-
- if (objc < 2 || objc > 3)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "command ?from_tty?");
- return TCL_ERROR;
- }
-
- if (objc == 3)
- {
- if (Tcl_GetBooleanFromObj (NULL, objv[2], &from_tty) != TCL_OK)
- {
- gdbtk_set_result (interp, "from_tty must be a boolean.");
- return TCL_ERROR;
- }
- }
-
- if (running_now || load_in_progress)
- return TCL_OK;
-
- No_Update = 1;
-
- /* for the load instruction (and possibly others later) we
- set turn off the GDBTK_TO_RESULT flag bit so gdbtk_fputs()
- will not buffer all the data until the command is finished. */
-
- if ((strncmp ("load ", Tcl_GetStringFromObj (objv[1], NULL), 5) == 0))
- {
- result_ptr->flags &= ~GDBTK_TO_RESULT;
- load_in_progress = 1;
- }
-
- execute_command (Tcl_GetStringFromObj (objv[1], NULL), from_tty);
-
- if (load_in_progress)
- {
- load_in_progress = 0;
- result_ptr->flags |= GDBTK_TO_RESULT;
- }
-
- bpstat_do_actions (&stop_bpstat);
-
- return TCL_OK;
-}
-
-/*
- * This implements the tcl command "gdb_immediate"
- *
- * It does exactly the same thing as gdb_cmd, except NONE of its outut
- * is buffered. This will also ALWAYS cause the busy, update, and idle
- * hooks to be called, contrasted with gdb_cmd, which NEVER calls them.
- * It turns off the GDBTK_TO_RESULT flag, which diverts the result
- * to the console window.
- *
- * Tcl Arguments:
- * command - The GDB command to execute
- * from_tty - 1 to indicate this is from the console.
- * Tcl Result:
- * None.
- */
-
-static int
-gdb_immediate_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- int from_tty = 0;
-
- if (objc < 2 || objc > 3)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "command ?from_tty?");
- return TCL_ERROR;
- }
-
- if (objc == 3)
- {
- if (Tcl_GetBooleanFromObj (NULL, objv[2], &from_tty) != TCL_OK)
- {
- gdbtk_set_result (interp, "from_tty must be a boolean.");
- return TCL_ERROR;
- }
- }
-
- if (running_now || load_in_progress)
- return TCL_OK;
-
- No_Update = 0;
-
- result_ptr->flags &= ~GDBTK_TO_RESULT;
-
- execute_command (Tcl_GetStringFromObj (objv[1], NULL), from_tty);
-
- bpstat_do_actions (&stop_bpstat);
-
- result_ptr->flags |= GDBTK_TO_RESULT;
-
- return TCL_OK;
-}
-
-/* This implements the tcl command "gdb_prompt"
-
-* It returns the gdb interpreter's prompt.
-*
-* Tcl Arguments:
-* None.
-* Tcl Result:
-* The prompt.
-*/
-
-static int
-gdb_prompt_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- Tcl_SetStringObj (result_ptr->obj_ptr, get_prompt (), -1);
- return TCL_OK;
-}
-
-
-/*
- * This section contains general informational commands.
- */
-
-/* This implements the tcl command "gdb_target_has_execution"
-
-* Tells whether the target is executing.
-*
-* Tcl Arguments:
-* None
-* Tcl Result:
-* A boolean indicating whether the target is executing.
-*/
-
-static int
-gdb_target_has_execution_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- int result = 0;
-
- if (target_has_execution && ! ptid_equal (inferior_ptid, null_ptid))
- result = 1;
-
- Tcl_SetBooleanObj (result_ptr->obj_ptr, result);
- return TCL_OK;
-}
-
-/* This implements the tcl command "gdb_get_inferior_args"
-
-* Returns inferior command line arguments as a string
-*
-* Tcl Arguments:
-* None
-* Tcl Result:
-* A string containing the inferior command line arguments
-*/
-
-static int
-gdb_get_inferior_args (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- if (objc != 1)
- {
- Tcl_WrongNumArgs (interp, 1, objv, NULL);
- return TCL_ERROR;
- }
-
- Tcl_SetStringObj (result_ptr->obj_ptr, get_inferior_args (), -1);
- return TCL_OK;
-}
-
-/* This implements the tcl command "gdb_set_inferior_args"
-
-* Sets inferior command line arguments
-*
-* Tcl Arguments:
-* A string containing the inferior command line arguments
-* Tcl Result:
-* None
-*/
-
-static int
-gdb_set_inferior_args (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- char *args;
-
- if (objc != 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "argument");
- return TCL_ERROR;
- }
-
- args = Tcl_GetStringFromObj (objv[1], NULL);
-
- /* The xstrdup/xfree stuff is so that we maintain a coherent picture
- for gdb. I would expect the accessors to do this, but they
- don't. */
- args = xstrdup (args);
- args = set_inferior_args (args);
- xfree (args);
-
- return TCL_OK;
-}
-
-/* This implements the tcl command "gdb_load_info"
-
-* It returns information about the file about to be downloaded.
-*
-* Tcl Arguments:
-* filename: The file to open & get the info on.
-* Tcl Result:
-* A list consisting of the name and size of each section.
-*/
-
-static int
-gdb_load_info (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- bfd *loadfile_bfd;
- struct cleanup *old_cleanups;
- asection *s;
- Tcl_Obj *ob[2];
-
- char *filename = Tcl_GetStringFromObj (objv[1], NULL);
-
- loadfile_bfd = bfd_openr (filename, gnutarget);
- if (loadfile_bfd == NULL)
- {
- gdbtk_set_result (interp, "Open of %s failed", filename);
- return TCL_ERROR;
- }
- old_cleanups = make_cleanup_bfd_close (loadfile_bfd);
-
- if (!bfd_check_format (loadfile_bfd, bfd_object))
- {
- gdbtk_set_result (interp, "Bad Object File");
- return TCL_ERROR;
- }
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
-
- for (s = loadfile_bfd->sections; s; s = s->next)
- {
- if (s->flags & SEC_LOAD)
- {
- bfd_size_type size = bfd_get_section_size (s);
- if (size > 0)
- {
- ob[0] = Tcl_NewStringObj ((char *)
- bfd_get_section_name (loadfile_bfd, s),
- -1);
- ob[1] = Tcl_NewLongObj ((long) size);
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewListObj (2, ob));
- }
- }
- }
-
- do_cleanups (old_cleanups);
- return TCL_OK;
-}
-
-
-/* This implements the tcl command "gdb_get_line"
-
-* It returns the linenumber for a given linespec. It will take any spec
-* that can be passed to decode_line_1
-*
-* Tcl Arguments:
-* linespec - the line specification
-* Tcl Result:
-* The line number for that spec.
-*/
-static int
-gdb_get_line_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct symtabs_and_lines sals;
- char *args, **canonical;
-
- if (objc != 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "linespec");
- return TCL_ERROR;
- }
-
- args = Tcl_GetStringFromObj (objv[1], NULL);
- sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL);
- if (sals.nelts == 1)
- {
- Tcl_SetIntObj (result_ptr->obj_ptr, sals.sals[0].line);
- return TCL_OK;
- }
-
- Tcl_SetStringObj (result_ptr->obj_ptr, "N/A", -1);
- return TCL_OK;
-
-}
-
-/* This implements the tcl command "gdb_get_file"
-
-* It returns the file containing a given line spec.
-*
-* Tcl Arguments:
-* linespec - The linespec to look up
-* Tcl Result:
-* The file containing it.
-*/
-
-static int
-gdb_get_file_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct symtabs_and_lines sals;
- char *args, **canonical;
-
- if (objc != 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "linespec");
- return TCL_ERROR;
- }
-
- args = Tcl_GetStringFromObj (objv[1], NULL);
- sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL);
- if (sals.nelts == 1)
- {
- Tcl_SetStringObj (result_ptr->obj_ptr,
- sals.sals[0].symtab->filename, -1);
- return TCL_OK;
- }
-
- Tcl_SetStringObj (result_ptr->obj_ptr, "N/A", -1);
- return TCL_OK;
-}
-
-/* This implements the tcl command "gdb_get_function"
-
-* It finds the function containing the given line spec.
-*
-* Tcl Arguments:
-* linespec - The line specification
-* Tcl Result:
-* The function that contains it, or "N/A" if it is not in a function.
-*/
-static int
-gdb_get_function_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- char *function;
- struct symtabs_and_lines sals;
- char *args, **canonical;
-
- if (objc != 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "linespec");
- return TCL_ERROR;
- }
-
- args = Tcl_GetStringFromObj (objv[1], NULL);
- sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL);
- if (sals.nelts == 1)
- {
- resolve_sal_pc (&sals.sals[0]);
- function = pc_function_name (sals.sals[0].pc);
- Tcl_SetStringObj (result_ptr->obj_ptr, function, -1);
- return TCL_OK;
- }
-
- Tcl_SetStringObj (result_ptr->obj_ptr, "N/A", -1);
- return TCL_OK;
-}
-
-/* This implements the tcl command "gdb_find_file"
-
-* It searches the symbol tables to get the full pathname to a file.
-*
-* Tcl Arguments:
-* filename: the file name to search for.
-* Tcl Result:
-* The full path to the file, an empty string if the file was not
-* available or an error message if the file is not found in the symtab.
-*/
-
-static int
-gdb_find_file_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct symtab *st;
- char *filename, *fullname = NULL;
-
- if (objc != 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "filename");
- return TCL_ERROR;
- }
-
- filename = Tcl_GetStringFromObj (objv[1], NULL);
-
- /* Shortcut: There seems to be some mess in gdb dealing with
- files. While we should let gdb sort it out, it doesn't hurt
- to be a little defensive here.
-
- If the filename is already an absolute filename, just try
- to stat it. If it's not found, then ask gdb to find it for us. */
- if (IS_ABSOLUTE_PATH (filename))
- {
- struct stat st;
- const int status = stat (filename, &st);
-
- if (status == 0)
- {
- if (S_ISREG (st.st_mode))
- fullname = filename;
- }
- }
- else
- {
- /* Ask gdb to find the file for us. */
- st = lookup_symtab (filename);
-
- /* We should always get a symtab. */
- if (!st)
- {
- gdbtk_set_result (interp, "File not found in symtab (2)");
- return TCL_ERROR;
- }
-
- fullname =
- (st->fullname == NULL ? symtab_to_filename (st) : st->fullname);
- }
-
- /* We may not be able to open the file (not available). */
- if (fullname == NULL)
- {
- Tcl_SetStringObj (result_ptr->obj_ptr, "", -1);
- return TCL_OK;
- }
-
- Tcl_SetStringObj (result_ptr->obj_ptr, fullname, -1);
-
- return TCL_OK;
-}
-
-/* This implements the tcl command "gdb_listfiles"
-
-* This lists all the files in the current executible.
-*
-* Note that this currently pulls in all sorts of filenames
-* that aren't really part of the executable. It would be
-* best if we could check each file to see if it actually
-* contains executable lines of code, but we can't do that
-* with psymtabs.
-*
-* Arguments:
-* ?pathname? - If provided, only files which match pathname
-* (up to strlen(pathname)) are included. THIS DOES NOT
-* CURRENTLY WORK BECAUSE PARTIAL_SYMTABS DON'T SUPPLY
-* THE FULL PATHNAME!!!
-*
-* Tcl Result:
-* A list of all matching files.
-*/
-static int
-gdb_listfiles (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct objfile *objfile;
- struct partial_symtab *psymtab;
- struct symtab *symtab;
- const char *lastfile, *pathname = NULL;
- const char **files;
- int files_size;
- int i, numfiles = 0, len = 0;
-
- files_size = 1000;
- files = (const char **) xmalloc (sizeof (char *) * files_size);
-
- if (objc > 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "?pathname?");
- return TCL_ERROR;
- }
- else if (objc == 2)
- pathname = Tcl_GetStringFromObj (objv[1], &len);
-
- ALL_PSYMTABS (objfile, psymtab)
- {
- if (numfiles == files_size)
- {
- files_size = files_size * 2;
- files = (const char **) xrealloc (files, sizeof (char *) * files_size);
- }
- if (psymtab->filename)
- {
- if (!len || !strncmp (pathname, psymtab->filename, len)
- || !strcmp (psymtab->filename, lbasename (psymtab->filename)))
- {
- files[numfiles++] = lbasename (psymtab->filename);
- }
- }
- }
-
- ALL_SYMTABS (objfile, symtab)
- {
- if (numfiles == files_size)
- {
- files_size = files_size * 2;
- files = (const char **) xrealloc (files, sizeof (char *) * files_size);
- }
- if (symtab->filename && symtab->linetable && symtab->linetable->nitems)
- {
- if (!len || !strncmp (pathname, symtab->filename, len)
- || !strcmp (symtab->filename, lbasename (symtab->filename)))
- {
- files[numfiles++] = lbasename (symtab->filename);
- }
- }
- }
-
- qsort (files, numfiles, sizeof (char *), comp_files);
-
- lastfile = "";
-
- /* Discard the old result pointer, in case it has accumulated anything
- and set it to a new list object */
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
-
- for (i = 0; i < numfiles; i++)
- {
- if (strcmp (files[i], lastfile))
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewStringObj (files[i], -1));
- lastfile = files[i];
- }
-
- free (files);
- return TCL_OK;
-}
-
-static int
-comp_files (const void *file1, const void *file2)
-{
- return strcmp (*(char **) file1, *(char **) file2);
-}
-
-
-/* This implements the tcl command "gdb_search"
-
-
-* Tcl Arguments:
-* option - One of "functions", "variables" or "types"
-* regexp - The regular expression to look for.
-* Then, optionally:
-* -files fileList
-* -static 1/0
-* -filename 1/0
-* Tcl Result:
-* A list of all the matches found. Optionally, if -filename is set to 1,
-* then the output is a list of two element lists, with the symbol first,
-* and the file in which it is found second.
-*/
-
-static int
-gdb_search (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct symbol_search *ss = NULL;
- struct symbol_search *p;
- struct cleanup *old_chain = NULL;
- Tcl_Obj *CONST * switch_objv;
- int index, switch_objc, i, show_files = 0;
- domain_enum space = 0;
- char *regexp;
- int static_only, nfiles;
- Tcl_Obj **file_list;
- char **files;
- static const char *search_options[] =
- {"functions", "variables", "types", (char *) NULL};
- static const char *switches[] =
- {"-files", "-filename", "-static", (char *) NULL};
- enum search_opts
- {
- SEARCH_FUNCTIONS, SEARCH_VARIABLES, SEARCH_TYPES
- };
- enum switches_opts
- {
- SWITCH_FILES, SWITCH_FILENAME, SWITCH_STATIC_ONLY
- };
-
- if (objc < 3)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "option regexp ?arg ...?");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIndexFromObj (interp, objv[1], search_options, "option", 0,
- &index) != TCL_OK)
- {
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
-
- /* Unfortunately, we cannot teach search_symbols to search on
- multiple regexps, so we have to do a two-tier search for
- any searches which choose to narrow the playing field. */
- switch ((enum search_opts) index)
- {
- case SEARCH_FUNCTIONS:
- space = FUNCTIONS_DOMAIN;
- break;
- case SEARCH_VARIABLES:
- space = VARIABLES_DOMAIN;
- break;
- case SEARCH_TYPES:
- space = TYPES_DOMAIN;
- break;
- }
-
- regexp = Tcl_GetStringFromObj (objv[2], NULL);
- /* Process any switches that refine the search */
- switch_objc = objc - 3;
- switch_objv = objv + 3;
-
- static_only = 0;
- nfiles = 0;
- files = (char **) NULL;
- while (switch_objc > 0)
- {
- if (Tcl_GetIndexFromObj (interp, switch_objv[0], switches,
- "option", 0, &index) != TCL_OK)
- {
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
-
- switch ((enum switches_opts) index)
- {
- case SWITCH_FILENAME:
- {
- if (switch_objc < 2)
- {
- Tcl_WrongNumArgs (interp, 3, objv,
- "?-files fileList -filename 1|0 -static 1|0?");
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
- if (Tcl_GetBooleanFromObj (interp, switch_objv[1], &show_files)
- != TCL_OK)
- {
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
- switch_objc--;
- switch_objv++;
- }
- break;
- case SWITCH_FILES:
- {
- int result;
- if (switch_objc < 2)
- {
- Tcl_WrongNumArgs (interp, 3, objv,
- "?-files fileList -filename 1|0 -static 1|0?");
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
- result = Tcl_ListObjGetElements (interp, switch_objv[1],
- &nfiles, &file_list);
- if (result != TCL_OK)
- return result;
-
- files = (char **) xmalloc (nfiles * sizeof (char *));
- for (i = 0; i < nfiles; i++)
- files[i] = Tcl_GetStringFromObj (file_list[i], NULL);
- switch_objc--;
- switch_objv++;
- }
- break;
- case SWITCH_STATIC_ONLY:
- if (switch_objc < 2)
- {
- Tcl_WrongNumArgs (interp, 3, objv,
- "?-files fileList -filename 1|0 -static 1|0?");
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
- if (Tcl_GetBooleanFromObj (interp, switch_objv[1], &static_only)
- != TCL_OK)
- {
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
- switch_objc--;
- switch_objv++;
- }
- switch_objc--;
- switch_objv++;
- }
-
- search_symbols (regexp, space, nfiles, files, &ss);
- if (ss != NULL)
- old_chain = make_cleanup_free_search_symbols (ss);
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
-
- for (p = ss; p != NULL; p = p->next)
- {
- Tcl_Obj *elem;
-
- if (static_only && p->block != STATIC_BLOCK)
- continue;
-
- /* Strip off some C++ special symbols, like RTTI and global
- constructors/destructors. */
- if ((p->symbol != NULL
- && strncmp (SYMBOL_LINKAGE_NAME (p->symbol), "__tf", 4) != 0
- && strncmp (SYMBOL_LINKAGE_NAME (p->symbol), "_GLOBAL_", 8) != 0)
- || p->msymbol != NULL)
- {
- elem = Tcl_NewListObj (0, NULL);
-
- if (p->msymbol == NULL)
- Tcl_ListObjAppendElement (interp, elem,
- Tcl_NewStringObj (SYMBOL_PRINT_NAME (p->symbol), -1));
- else
- Tcl_ListObjAppendElement (interp, elem,
- Tcl_NewStringObj (SYMBOL_PRINT_NAME (p->msymbol), -1));
-
- if (show_files)
- {
- if ((p->symtab != NULL) && (p->symtab->filename != NULL))
- {
- Tcl_ListObjAppendElement (interp, elem, Tcl_NewStringObj
- (p->symtab->filename, -1));
- }
- else
- {
- Tcl_ListObjAppendElement (interp, elem,
- Tcl_NewStringObj ("", 0));
- }
- }
-
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, elem);
- }
- }
-
- if (ss != NULL)
- do_cleanups (old_chain);
-
- return TCL_OK;
-}
-
-/* This implements the tcl command gdb_listfuncs
-
-* It lists all the functions defined in a given file
-*
-* Arguments:
-* file - the file to look in
-* Tcl Result:
-* A list of two element lists, the first element is
-* the symbol name, and the second is a boolean indicating
-* whether the symbol is demangled (1 for yes).
-*/
-
-static int
-gdb_listfuncs (clientData, interp, objc, objv)
- ClientData clientData;
- Tcl_Interp *interp;
- int objc;
- Tcl_Obj *CONST objv[];
-{
- struct symtab *symtab;
- struct blockvector *bv;
- struct block *b;
- struct symbol *sym;
- int i;
- struct dict_iterator iter;
- Tcl_Obj *funcVals[2];
-
- if (objc != 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "file");
- return TCL_ERROR;
- }
-
- symtab = lookup_symtab (Tcl_GetStringFromObj (objv[1], NULL));
- if (!symtab)
- {
- gdbtk_set_result (interp, "No such file (%s)",
- Tcl_GetStringFromObj (objv[1], NULL));
- return TCL_ERROR;
- }
-
- if (mangled == NULL)
- {
- mangled = Tcl_NewBooleanObj (1);
- not_mangled = Tcl_NewBooleanObj (0);
- Tcl_IncrRefCount (mangled);
- Tcl_IncrRefCount (not_mangled);
- }
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
-
- bv = BLOCKVECTOR (symtab);
- for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
- {
- b = BLOCKVECTOR_BLOCK (bv, i);
- ALL_BLOCK_SYMBOLS (b, iter, sym)
- {
- if (SYMBOL_CLASS (sym) == LOC_BLOCK)
- {
-
- char *name = SYMBOL_DEMANGLED_NAME (sym);
-
- if (name)
- {
- /* strip out "global constructors" and
- * "global destructors"
- * because we aren't interested in them. */
-
- if (strncmp (name, "global ", 7))
- {
- /* If the function is overloaded,
- * print out the functions
- * declaration, not just its name. */
-
- funcVals[0] = Tcl_NewStringObj (name, -1);
- funcVals[1] = mangled;
- }
- else
- continue;
-
- }
- else
- {
- funcVals[0] = Tcl_NewStringObj (DEPRECATED_SYMBOL_NAME (sym), -1);
- funcVals[1] = not_mangled;
- }
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewListObj (2, funcVals));
- }
- }
- }
- return TCL_OK;
-}
-
-/* This implements the TCL command `gdb_restore_fputs'
- It sets the fputs_unfiltered hook back to gdbtk_fputs.
- Its sole reason for being is that sometimes we move the
- fputs hook out of the way to specially trap output, and if
- we get an error which we weren't expecting, it won't get put
- back, so we run this at idle time as insurance.
-*/
-
-static int
-gdb_restore_fputs (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- gdbtk_disable_fputs = 0;
- return TCL_OK;
-}
-
-
-/* This implements the tcl command gdb_load_disassembly
- *
- * Arguments:
- * widget - the name of a text widget into which to load the data
- * source_with_assm - must be "source" or "nosource"
- * low_address - the CORE_ADDR from which to start disassembly
- * ?hi_address? - the CORE_ADDR to which to disassemble, defaults
- * to the end of the function containing low_address.
- * Tcl Result:
- * The text widget is loaded with the data, and a list is returned.
- * The first element of the list is a two element list containing the
- * real low & high elements, the rest is a mapping between line number
- * in the text widget, and either the source line number of that line,
- * if it is a source line, or the assembly address. You can distinguish
- * between the two, because the address will start with 0x...
- */
-
-static int
-gdb_load_disassembly (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- CORE_ADDR low, high, orig;
- struct disassembly_client_data client_data;
- int mixed_source_and_assembly, ret_val, i;
- char *arg_ptr;
- char *map_name;
- Tcl_WideInt waddr;
-
- if (objc != 6 && objc != 7)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "[source|nosource] map_arr index_prefix low_address ?hi_address");
- return TCL_ERROR;
- }
-
- client_data.widget = Tcl_GetStringFromObj (objv[1], NULL);
- if ( Tk_NameToWindow (interp, client_data.widget,
- Tk_MainWindow (interp)) == NULL)
- {
- gdbtk_set_result (interp, "Invalid widget name.");
- return TCL_ERROR;
- }
-
- if (!Tcl_GetCommandInfo (interp, client_data.widget, &client_data.cmd))
- {
- gdbtk_set_result (interp, "Can't get widget command info");
- return TCL_ERROR;
- }
-
- arg_ptr = Tcl_GetStringFromObj (objv[2], NULL);
- if (*arg_ptr == 's' && strcmp (arg_ptr, "source") == 0)
- mixed_source_and_assembly = 1;
- else if (*arg_ptr == 'n' && strcmp (arg_ptr, "nosource") == 0)
- mixed_source_and_assembly = 0;
- else
- {
- gdbtk_set_result (interp, "Second arg must be 'source' or 'nosource'");
- return TCL_ERROR;
- }
-
- /* As we populate the text widget, we will also create an array in the
- caller's scope. The name is given by objv[3].
- Each source line gets an entry or the form:
- array($prefix,srcline=$src_line_no) = $widget_line_no
-
- Each assembly line gets two entries of the form:
- array($prefix,pc=$pc) = $widget_line_no
- array($prefix,line=$widget_line_no) = $src_line_no
-
- Where prefix is objv[4].
- */
-
- map_name = Tcl_GetStringFromObj (objv[3], NULL);
-
- if (*map_name != '\0')
- {
- char *prefix;
- int prefix_len;
-
- client_data.map_arr = "map_array";
- if (Tcl_UpVar (interp, "1", map_name, client_data.map_arr, 0) != TCL_OK)
- {
- gdbtk_set_result (interp, "Can't link map array.");
- return TCL_ERROR;
- }
-
- prefix = Tcl_GetStringFromObj (objv[4], &prefix_len);
-
- Tcl_DStringInit(&client_data.src_to_line_prefix);
- Tcl_DStringAppend (&client_data.src_to_line_prefix,
- prefix, prefix_len);
- Tcl_DStringAppend (&client_data.src_to_line_prefix, ",srcline=",
- sizeof (",srcline=") - 1);
-
- Tcl_DStringInit(&client_data.pc_to_line_prefix);
- Tcl_DStringAppend (&client_data.pc_to_line_prefix,
- prefix, prefix_len);
- Tcl_DStringAppend (&client_data.pc_to_line_prefix, ",pc=",
- sizeof (",pc=") - 1);
-
- Tcl_DStringInit(&client_data.line_to_pc_prefix);
- Tcl_DStringAppend (&client_data.line_to_pc_prefix,
- prefix, prefix_len);
- Tcl_DStringAppend (&client_data.line_to_pc_prefix, ",line=",
- sizeof (",line=") - 1);
-
- }
- else
- {
- client_data.map_arr = "";
- }
-
- /* Now parse the addresses */
- if (Tcl_GetWideIntFromObj (interp, objv[5], &waddr) != TCL_OK)
- return TCL_ERROR;
- low = waddr;
-
- orig = low;
-
- if (objc == 6)
- {
- if (find_pc_partial_function (low, NULL, &low, &high) == 0)
- error ("No function contains address 0x%s", core_addr_to_string (orig));
- }
- else
- {
- if (Tcl_GetWideIntFromObj (interp, objv[6], &waddr) != TCL_OK)
- return TCL_ERROR;
- high = waddr;
- }
-
- /* Setup the client_data structure, and call the driver function. */
-
- client_data.file_opened_p = 0;
- client_data.widget_line_no = 0;
- client_data.interp = interp;
- for (i = 0; i < 3; i++)
- {
- client_data.result_obj[i] = Tcl_NewObj();
- Tcl_IncrRefCount (client_data.result_obj[i]);
- }
-
- /* Fill up the constant parts of the argv structures */
- client_data.asm_argv[0] = client_data.widget;
- client_data.asm_argv[1] = "insert";
- client_data.asm_argv[2] = "end";
- client_data.asm_argv[3] = "-\t";
- client_data.asm_argv[4] = "break_rgn_tag";
- /* client_data.asm_argv[5] = address; */
- client_data.asm_argv[6] = "break_rgn_tag";
- /* client_data.asm_argv[7] = offset; */
- client_data.asm_argv[8] = "break_rgn_tag";
- client_data.asm_argv[9] = ":\t\t";
- client_data.asm_argv[10] = "source_tag";
- /* client_data.asm_argv[11] = code; */
- client_data.asm_argv[12] = "source_tag";
- client_data.asm_argv[13] = "\n";
-
- if (mixed_source_and_assembly)
- {
- client_data.source_argv[0] = client_data.widget;
- client_data.source_argv[1] = "insert";
- client_data.source_argv[2] = "end";
- /* client_data.source_argv[3] = line_number; */
- client_data.source_argv[4] = "";
- /* client_data.source_argv[5] = line; */
- client_data.source_argv[6] = "source_tag2";
- }
-
- ret_val = gdb_disassemble_driver (low, high, mixed_source_and_assembly,
- (ClientData) &client_data,
- gdbtk_load_source, gdbtk_load_asm);
-
- /* Now clean up the opened file, and the Tcl data structures */
-
- if (client_data.file_opened_p == 1)
- fclose(client_data.fp);
-
- if (*client_data.map_arr != '\0')
- {
- Tcl_DStringFree(&client_data.src_to_line_prefix);
- Tcl_DStringFree(&client_data.pc_to_line_prefix);
- Tcl_DStringFree(&client_data.line_to_pc_prefix);
- }
-
- for (i = 0; i < 3; i++)
- {
- Tcl_DecrRefCount (client_data.result_obj[i]);
- }
-
- /* Finally, if we were successful, stick the low & high addresses
- into the Tcl result. */
-
- if (ret_val == TCL_OK)
- {
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (core_addr_to_string (low), -1));
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (core_addr_to_string (high), -1));
- }
- return ret_val;
-}
-
-static void
-gdbtk_load_source (ClientData clientData, struct symtab *symtab,
- int start_line, int end_line)
-{
- struct disassembly_client_data *client_data =
- (struct disassembly_client_data *) clientData;
- char *buffer;
- int index_len;
-
- index_len = Tcl_DStringLength (&client_data->src_to_line_prefix);
-
- if (client_data->file_opened_p == 1)
- {
- const char **text_argv;
- char line[10000], line_number[18];
- int found_carriage_return = 1;
-
- /* First do some sanity checks on the requested lines */
-
- if (start_line < 1
- || end_line < start_line || end_line > symtab->nlines)
- {
- return;
- }
-
- line_number[0] = '\t';
- line[0] = '\t';
-
- text_argv = client_data->source_argv;
-
- text_argv[3] = line_number;
- text_argv[5] = line;
-
- if (fseek (client_data->fp, symtab->line_charpos[start_line - 1],
- SEEK_SET) < 0)
- {
- fclose(client_data->fp);
- client_data->file_opened_p = -1;
- return;
- }
-
- for (; start_line < end_line; start_line++)
- {
- if (!fgets (line + 1, 9980, client_data->fp))
- {
- fclose(client_data->fp);
- client_data->file_opened_p = -1;
- return;
- }
-
- client_data->widget_line_no++;
-
- sprintf (line_number + 1, "%d", start_line);
-
- if (found_carriage_return)
- {
- char *p = strrchr(line, '\0') - 2;
- if (*p == '\r')
- {
- *p = '\n';
- *(p + 1) = '\0';
- }
- else
- found_carriage_return = 0;
- }
-
- /* Run the command, then add an entry to the map array in
- the caller's scope, if requested. */
-
- client_data->cmd.proc (client_data->cmd.clientData,
- client_data->interp, 7, text_argv);
-
- if (*client_data->map_arr != '\0')
- {
-
- Tcl_DStringAppend (&client_data->src_to_line_prefix,
- line_number + 1, -1);
-
- /* FIXME: Convert to Tcl_SetVar2Ex when we move to 8.2. This
- will allow us avoid converting widget_line_no into a string. */
-
- xasprintf (&buffer, "%d", client_data->widget_line_no);
-
- Tcl_SetVar2 (client_data->interp, client_data->map_arr,
- Tcl_DStringValue (&client_data->src_to_line_prefix),
- buffer, 0);
- free(buffer);
-
- Tcl_DStringSetLength (&client_data->src_to_line_prefix, index_len);
- }
- }
-
- }
- else if (!client_data->file_opened_p)
- {
- int fdes;
- /* The file is not yet open, try to open it, then print the
- first line. If we fail, set FILE_OPEN_P to -1. */
-
- fdes = open_source_file (symtab);
- if (fdes < 0)
- {
- client_data->file_opened_p = -1;
- }
- else
- {
- /* FIXME: Convert to a Tcl File Channel and read from there.
- This will allow us to get the line endings and conversion
- to UTF8 right automatically when we move to 8.2.
- Need a Cygwin call to convert a file descriptor to the native
- Windows handler to do this. */
-
- client_data->file_opened_p = 1;
- client_data->fp = fdopen (fdes, FOPEN_RB);
- clearerr (client_data->fp);
-
- if (symtab->line_charpos == 0)
- find_source_lines (symtab, fdes);
-
- /* We are called with an actual load request, so call ourselves
- to load the first line. */
-
- gdbtk_load_source (clientData, symtab, start_line, end_line);
- }
- }
- else
- {
- /* If we couldn't open the file, or got some prior error, just exit. */
- return;
- }
-}
-
-
-/* FIXME: cagney/2003-09-08: "di" is not used and unneeded. */
-static CORE_ADDR
-gdbtk_load_asm (ClientData clientData, CORE_ADDR pc,
- struct disassemble_info *di)
-{
- struct disassembly_client_data * client_data
- = (struct disassembly_client_data *) clientData;
- const char **text_argv;
- int i, pc_to_line_len, line_to_pc_len;
- gdbtk_result new_result;
- int insn;
- struct cleanup *old_chain = NULL;
-
- pc_to_line_len = Tcl_DStringLength (&client_data->pc_to_line_prefix);
- line_to_pc_len = Tcl_DStringLength (&client_data->line_to_pc_prefix);
-
- text_argv = client_data->asm_argv;
-
- /* Preserve the current Tcl result object, print out what we need, and then
- suck it out of the result, and replace... */
-
- old_chain = make_cleanup (gdbtk_restore_result_ptr, (void *) result_ptr);
- result_ptr = &new_result;
- result_ptr->obj_ptr = client_data->result_obj[0];
- result_ptr->flags = GDBTK_TO_RESULT;
-
- /* Null out the three return objects we will use. */
-
- for (i = 0; i < 3; i++)
- Tcl_SetObjLength (client_data->result_obj[i], 0);
-
- fputs_filtered (paddress (pc), gdb_stdout);
- gdb_flush (gdb_stdout);
-
- result_ptr->obj_ptr = client_data->result_obj[1];
- print_address_symbolic (pc, gdb_stdout, 1, "\t");
- gdb_flush (gdb_stdout);
-
- result_ptr->obj_ptr = client_data->result_obj[2];
- /* FIXME: cagney/2003-09-08: This should use gdb_disassembly. */
- insn = gdb_print_insn (pc, gdb_stdout, NULL);
- gdb_flush (gdb_stdout);
-
- client_data->widget_line_no++;
-
- text_argv[5] = Tcl_GetStringFromObj (client_data->result_obj[0], NULL);
- text_argv[7] = Tcl_GetStringFromObj (client_data->result_obj[1], NULL);
- text_argv[11] = Tcl_GetStringFromObj (client_data->result_obj[2], NULL);
-
- client_data->cmd.proc (client_data->cmd.clientData,
- client_data->interp, 14, text_argv);
-
- if (*client_data->map_arr != '\0')
- {
- char *buffer;
-
- /* Run the command, then add an entry to the map array in
- the caller's scope. */
-
- Tcl_DStringAppend (&client_data->pc_to_line_prefix, core_addr_to_string (pc), -1);
-
- /* FIXME: Convert to Tcl_SetVar2Ex when we move to 8.2. This
- will allow us avoid converting widget_line_no into a string. */
-
- xasprintf (&buffer, "%d", client_data->widget_line_no);
-
- Tcl_SetVar2 (client_data->interp, client_data->map_arr,
- Tcl_DStringValue (&client_data->pc_to_line_prefix),
- buffer, 0);
-
- Tcl_DStringAppend (&client_data->line_to_pc_prefix, buffer, -1);
-
-
- Tcl_SetVar2 (client_data->interp, client_data->map_arr,
- Tcl_DStringValue (&client_data->line_to_pc_prefix),
- core_addr_to_string (pc), 0);
-
- /* Restore the prefixes to their initial state. */
-
- Tcl_DStringSetLength (&client_data->pc_to_line_prefix, pc_to_line_len);
- Tcl_DStringSetLength (&client_data->line_to_pc_prefix, line_to_pc_len);
-
- xfree (buffer);
- }
-
- do_cleanups (old_chain);
-
- return pc + insn;
-}
-
-static int
-gdb_disassemble_driver (CORE_ADDR low, CORE_ADDR high,
- int mixed_source_and_assembly,
- ClientData clientData,
- void (*print_source_fn) (ClientData, struct symtab *, int, int),
- CORE_ADDR (*print_asm_fn) (ClientData, CORE_ADDR, struct disassemble_info *))
-{
- CORE_ADDR pc;
-
- /* If just doing straight assembly, all we need to do is disassemble
- everything between low and high. If doing mixed source/assembly, we've
- got a totally different path to follow. */
-
- if (mixed_source_and_assembly)
- { /* Come here for mixed source/assembly */
- /* The idea here is to present a source-O-centric view of a function to
- the user. This means that things are presented in source order, with
- (possibly) out of order assembly immediately following. */
- struct symtab *symtab;
- struct linetable_entry *le;
- int nlines;
- int newlines;
- struct my_line_entry *mle;
- struct symtab_and_line sal;
- int i;
- int out_of_order;
- int next_line;
-
- /* Assume symtab is valid for whole PC range */
- symtab = find_pc_symtab (low);
-
- if (!symtab || !symtab->linetable)
- goto assembly_only;
-
- /* First, convert the linetable to a bunch of my_line_entry's. */
-
- le = symtab->linetable->item;
- nlines = symtab->linetable->nitems;
-
- if (nlines <= 0)
- goto assembly_only;
-
- mle = (struct my_line_entry *) alloca (nlines *
- sizeof (struct my_line_entry));
-
- out_of_order = 0;
-
- /* Copy linetable entries for this function into our data structure,
- creating end_pc's and setting out_of_order as appropriate. */
-
- /* First, skip all the preceding functions. */
-
- for (i = 0; i < nlines - 1 && le[i].pc < low; i++) ;
-
- /* Now, copy all entries before the end of this function. */
-
- newlines = 0;
- for (; i < nlines - 1 && le[i].pc < high; i++)
- {
- if (le[i].line == le[i + 1].line
- && le[i].pc == le[i + 1].pc)
- continue; /* Ignore duplicates */
-
- /* Skip any end-of-function markers. */
- if (le[i].line == 0)
- continue;
-
- mle[newlines].line = le[i].line;
- if (le[i].line > le[i + 1].line)
- out_of_order = 1;
- mle[newlines].start_pc = le[i].pc;
- mle[newlines].end_pc = le[i + 1].pc;
- newlines++;
- }
-
- /* If we're on the last line, and it's part of the function, then we
- need to get the end pc in a special way. */
-
- if (i == nlines - 1
- && le[i].pc < high)
- {
- mle[newlines].line = le[i].line;
- mle[newlines].start_pc = le[i].pc;
- sal = find_pc_line (le[i].pc, 0);
- mle[newlines].end_pc = sal.end;
- newlines++;
- }
-
- /* Now, sort mle by line #s (and, then by addresses within lines). */
-
- if (out_of_order)
- qsort (mle, newlines, sizeof (struct my_line_entry), compare_lines);
-
- /* Now, for each line entry, emit the specified lines (unless they have
- been emitted before), followed by the assembly code for that line. */
-
- next_line = 0; /* Force out first line */
- for (i = 0; i < newlines; i++)
- {
- /* Print out everything from next_line to the current line. */
-
- if (mle[i].line >= next_line)
- {
- if (next_line != 0)
- print_source_fn (clientData, symtab, next_line,
- mle[i].line + 1);
- else
- print_source_fn (clientData, symtab, mle[i].line,
- mle[i].line + 1);
-
- next_line = mle[i].line + 1;
- }
-
- for (pc = mle[i].start_pc; pc < mle[i].end_pc; )
- {
- QUIT;
- /* FIXME: cagney/2003-09-08: This entire function should
- be replaced by gdb_disassembly. */
- pc = print_asm_fn (clientData, pc, NULL);
- }
- }
- }
- else
- {
- assembly_only:
- for (pc = low; pc < high; )
- {
- QUIT;
- /* FIXME: cagney/2003-09-08: This entire function should be
- replaced by gdb_disassembly. */
- pc = print_asm_fn (clientData, pc, NULL);
- }
- }
-
- return TCL_OK;
-}
-
-/* This will be passed to qsort to sort the results of the disassembly */
-
-static int
-compare_lines (const PTR mle1p, const PTR mle2p)
-{
- struct my_line_entry *mle1, *mle2;
- int val;
-
- mle1 = (struct my_line_entry *) mle1p;
- mle2 = (struct my_line_entry *) mle2p;
-
- val = mle1->line - mle2->line;
-
- if (val != 0)
- return val;
-
- return mle1->start_pc - mle2->start_pc;
-}
-
-/* This implements the TCL command `gdb_loc',
-
-* Arguments:
-* ?symbol? The symbol or address to locate - defaults to pc
-* Tcl Return:
-* a list consisting of the following:
-* basename, function name, filename, line number, address, current pc
-*/
-
-static int
-gdb_loc (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
-{
- char *filename;
- struct symtab_and_line sal;
- char *fname;
- CORE_ADDR pc;
-
- if (objc == 1)
- {
- /* This function can be called, before the target is properly
- set-up, the following prevents an error, by trying to
- read_pc when there is no pc to read. It defaults pc,
- before the target is connected to the entry point of the
- program */
- if (!target_has_registers)
- {
- pc = entry_point_address ();
- sal = find_pc_line (pc, 0);
- }
- else
- {
- struct frame_info *frame;
-
- frame = get_selected_frame (NULL);
-
- if (get_frame_pc (frame) != read_pc ())
- {
- /* Note - this next line is not correct on all architectures.
- For a graphical debugger we really want to highlight the
- assembly line that called the next function on the stack.
- Many architectures have the next instruction saved as the
- pc on the stack, so what happens is the next instruction
- is highlighted. FIXME */
- pc = get_frame_pc (frame);
- find_frame_sal (frame, &sal);
- }
- else
- {
- pc = read_pc ();
- sal = find_pc_line (pc, 0);
- }
- }
- }
- else if (objc == 2)
- {
- struct symtabs_and_lines sals;
- int nelts;
-
- sals = decode_line_spec (Tcl_GetStringFromObj (objv[1], NULL), 1);
-
- nelts = sals.nelts;
- sal = sals.sals[0];
- free (sals.sals);
-
- if (sals.nelts != 1)
- {
- gdbtk_set_result (interp, "Ambiguous line spec", -1);
- return TCL_ERROR;
- }
- resolve_sal_pc (&sal);
- pc = sal.pc;
- }
- else
- {
- Tcl_WrongNumArgs (interp, 1, objv, "?symbol?");
- return TCL_ERROR;
- }
-
- if (sal.symtab)
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (sal.symtab->filename, -1));
- else
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj ("", 0));
-
- fname = pc_function_name (pc);
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (fname, -1));
-
- filename = symtab_to_filename (sal.symtab);
- if (filename == NULL)
- filename = "";
-
- /* file name */
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewStringObj (filename, -1));
- /* line number */
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewIntObj (sal.line));
- /* PC in current frame */
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (core_addr_to_string (pc), -1));
- /* Real PC */
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (core_addr_to_string (stop_pc), -1));
- /* shared library */
-#ifdef PC_SOLIB
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj (PC_SOLIB (pc), -1));
-#else
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj ("", -1));
-#endif
- return TCL_OK;
-}
-
-/* This implements the TCL command gdb_entry_point. It returns the current
- entry point address. */
-
-static int
-gdb_entry_point (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- char *addrstr;
-
- /* If we have not yet loaded an exec file, then we have no
- entry point, so return an empty string.*/
- if ((int) current_target.to_stratum > (int) dummy_stratum)
- {
- addrstr = (char *)core_addr_to_string (entry_point_address ());
- Tcl_SetStringObj (result_ptr->obj_ptr, addrstr, -1);
- }
- else
- Tcl_SetStringObj (result_ptr->obj_ptr, "", -1);
-
- return TCL_OK;
-}
-
-/* Covert hex to binary. Stolen from remote.c,
- but added error handling */
-static int
-fromhex (int a)
-{
- if (a >= '0' && a <= '9')
- return a - '0';
- else if (a >= 'a' && a <= 'f')
- return a - 'a' + 10;
- else if (a >= 'A' && a <= 'F')
- return a - 'A' + 10;
-
- return -1;
-}
-
-static int
-hex2bin (const char *hex, char *bin, int count)
-{
- int i, m, n;
- int incr = 2;
-
-
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_LITTLE)
- {
- /* need to read string in reverse */
- hex += count - 2;
- incr = -2;
- }
-
- for (i = 0; i < count; i += 2)
- {
- if (hex[0] == 0 || hex[1] == 0)
- {
- /* Hex string is short, or of uneven length.
- Return the count that has been converted so far. */
- return i;
- }
- m = fromhex (hex[0]);
- n = fromhex (hex[1]);
- if (m == -1 || n == -1)
- return -1;
- *bin++ = m * 16 + n;
- hex += incr;
- }
-
- return i;
-}
-
-/* This implements the Tcl command 'gdb_set_mem', which
- * sets some chunk of memory.
- *
- * Arguments:
- * gdb_set_mem addr hexstr len
- *
- * addr: address of data to set
- * hexstr: ascii string of data to set
- * len: number of bytes of data to set
- */
-static int
-gdb_set_mem (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- CORE_ADDR addr;
- gdb_byte buf[128];
- char *hexstr;
- int len, size;
-
- if (objc != 4)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "addr hex_data len");
- return TCL_ERROR;
- }
-
- /* Address to write */
- addr = string_to_core_addr (Tcl_GetStringFromObj (objv[1], NULL));
-
- /* String value to write: it's in hex */
- hexstr = Tcl_GetStringFromObj (objv[2], NULL);
- if (hexstr == NULL)
- return TCL_ERROR;
-
- /* Length of buf */
- if (Tcl_GetIntFromObj (interp, objv[3], &len) != TCL_OK)
- return TCL_ERROR;
-
- /* Convert hexstr to binary and write */
- if (hexstr[0] == '0' && hexstr[1] == 'x')
- hexstr += 2;
- size = hex2bin (hexstr, (char *) buf, strlen (hexstr));
- if (size < 0)
- {
- /* Error in input */
- gdbtk_set_result (interp, "Invalid hexadecimal input: \"0x%s\"", hexstr);
- return TCL_ERROR;
- }
-
- target_write_memory (addr, buf, len);
- return TCL_OK;
-}
-
-/* This implements the Tcl command 'gdb_update_mem', which
- * updates a block of memory in the memory window
- *
- * Arguments:
- * gdb_update_mem data addr form size nbytes bpr aschar
- *
- * 1 data: variable that holds table's data
- * 2 addr: address of data to dump
- * 3 mform: a char indicating format
- * 4 size: size of each element; 1,2,4, or 8 bytes
- * 5 nbytes: the number of bytes to read
- * 6 bpr: bytes per row
- * 7 aschar: if present, an ASCII dump of the row is included. ASCHAR
- * used for unprintable characters.
- *
- * Return:
- * a list of three integers: {border_col_width data_col_width ascii_col_width}
- * which can be used to set the table's column widths. */
-
-static int
-gdb_update_mem (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- long dummy;
- char index[20];
- CORE_ADDR addr;
- int nbytes, rnum, bpr;
- int size, asize, i, j, bc;
- int max_ascii_len, max_val_len, max_label_len;
- char format, aschar;
- char *data, *tmp;
- char buff[128], *mbuf, *mptr, *cptr, *bptr;
- struct ui_file *stb;
- struct type *val_type;
- struct cleanup *old_chain;
-
- if (objc < 7 || objc > 8)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "data addr format size bytes bytes_per_row ?ascii_char?");
- return TCL_ERROR;
- }
-
- /* Get table data and link to a local variable */
- data = Tcl_GetStringFromObj (objv[1], NULL);
- if (data == NULL)
- {
- gdbtk_set_result (interp, "could not get data variable");
- return TCL_ERROR;
- }
-
- if (Tcl_UpVar (interp, "1", data, "data", 0) != TCL_OK)
- {
- gdbtk_set_result (interp, "could not link table data");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIntFromObj (interp, objv[4], &size) != TCL_OK)
- return TCL_ERROR;
- else if (size <= 0)
- {
- gdbtk_set_result (interp, "Invalid size, must be > 0");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIntFromObj (interp, objv[5], &nbytes) != TCL_OK)
- return TCL_ERROR;
- else if (nbytes <= 0)
- {
- gdbtk_set_result (interp, "Invalid number of bytes, must be > 0");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIntFromObj (interp, objv[6], &bpr) != TCL_OK)
- return TCL_ERROR;
- else if (bpr <= 0)
- {
- gdbtk_set_result (interp, "Invalid bytes per row, must be > 0");
- return TCL_ERROR;
- }
-
- tmp = Tcl_GetStringFromObj (objv[2], NULL);
- if (tmp == NULL)
- {
- gdbtk_set_result (interp, "could not get address");
- return TCL_ERROR;
- }
- addr = string_to_core_addr (tmp);
-
- format = *(Tcl_GetStringFromObj (objv[3], NULL));
- mbuf = (char *) xmalloc (nbytes + 32);
- if (!mbuf)
- {
- gdbtk_set_result (interp, "Out of memory.");
- return TCL_ERROR;
- }
-
- memset (mbuf, 0, nbytes + 32);
- mptr = cptr = mbuf;
-
- rnum = target_read (&current_target, TARGET_OBJECT_MEMORY, NULL,
- mbuf, addr, nbytes);
- if (rnum <= 0)
- {
- gdbtk_set_result (interp, "Unable to read memory.");
- return TCL_ERROR;
- }
-
- if (objc == 8)
- aschar = *(Tcl_GetStringFromObj (objv[7], NULL));
- else
- aschar = 0;
-
- switch (size)
- {
- case 1:
- val_type = builtin_type_int8;
- asize = 'b';
- break;
- case 2:
- val_type = builtin_type_int16;
- asize = 'h';
- break;
- case 4:
- val_type = builtin_type_int32;
- asize = 'w';
- break;
- case 8:
- val_type = builtin_type_int64;
- asize = 'g';
- break;
- default:
- val_type = builtin_type_int8;
- asize = 'b';
- }
-
- bc = 0; /* count of bytes in a row */
- bptr = &buff[0]; /* pointer for ascii dump */
-
- /* Open a memory ui_file that we can use to print memory values */
- stb = mem_fileopen ();
- old_chain = make_cleanup_ui_file_delete (stb);
-
- /* A little macro to do column indices. As a rule, given the current
- byte, i, of a total nbytes and the bytes per row, bpr, and the size of
- each cell, size, the row and column will be given by:
-
- row = i/bpr
- col = (i%bpr)/size
- */
-#define INDEX(row,col) sprintf (index, "%d,%d",(row),(col))
-
- /* Fill in address labels */
- max_label_len = 0;
- for (i = 0; i < nbytes; i += bpr)
- {
- char s[130];
- sprintf (s, "%s", core_addr_to_string (addr + i));
- INDEX ((int) i/bpr, -1);
- Tcl_SetVar2 (interp, "data", index, s, 0);
-
- /* The tcl code in MemWin::update_addr used to track the size
- of each cell. I don't see how these could change for any given
- update, so we don't loop over all cells. We just note the first
- size. */
- if (max_label_len == 0)
- max_label_len = strlen (s);
- }
-
- /* Fill in memory */
- max_val_len = 0; /* Ditto the above comments about max_label_len */
- max_ascii_len = 0;
- for (i = 0; i < nbytes; i += size)
- {
- INDEX ((int) i/bpr, (int) (i%bpr)/size);
-
- if (i >= rnum)
- {
- /* Read fewer bytes than requested */
- tmp = "N/A";
-
- if (aschar)
- {
- for (j = 0; j < size; j++)
- *bptr++ = 'X';
- }
- }
- else
- {
- /* print memory to our uiout file and set the table's variable */
- ui_file_rewind (stb);
- print_scalar_formatted (mptr, val_type, format, asize, stb);
- tmp = ui_file_xstrdup (stb, &dummy);
-
- /* See comments above on max_*_len */
- if (max_val_len == 0)
- max_val_len = strlen (tmp);
-
- if (aschar)
- {
- for (j = 0; j < size; j++)
- {
- if (isprint (*cptr))
- *bptr++ = *cptr++;
- else
- {
- *bptr++ = aschar;
- cptr++;;
- }
- }
- }
- }
- Tcl_SetVar2 (interp, "data", index, tmp, 0);
-
- mptr += size;
- bc += size;
-
- if (aschar && (bc >= bpr))
- {
- /* end of row. Add it to the result and reset variables */
- *bptr = '\000';
- INDEX (i/bpr, bpr/size);
- Tcl_SetVar2 (interp, "data", index, buff, 0);
-
- /* See comments above on max_*_len */
- if (max_ascii_len == 0)
- max_ascii_len = strlen (buff);
-
- bc = 0;
- bptr = &buff[0];
- }
- }
-
- /* return max_*_len so that column widths can be set */
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewIntObj (max_label_len + 1));
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewIntObj (max_val_len + 1));
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, Tcl_NewIntObj (max_ascii_len + 1));
- do_cleanups (old_chain);
- xfree (mbuf);
- return TCL_OK;
-#undef INDEX
-}
-
-
-/* This implements the tcl command "gdb_loadfile"
- * It loads a c source file into a text widget.
- *
- * Tcl Arguments:
- * widget: the name of the text widget to fill
- * filename: the name of the file to load
- * linenumbers: A boolean indicating whether or not to display line numbers.
- * Tcl Result:
- *
- */
-
-/* In this routine, we will build up a "line table", i.e. a
- * table of bits showing which lines in the source file are executible.
- * LTABLE_SIZE is the number of bytes to allocate for the line table.
- *
- * Its size limits the maximum number of lines
- * in a file to 8 * LTABLE_SIZE. This memory is freed after
- * the file is loaded, so it is OK to make this very large.
- * Additional memory will be allocated if needed. */
-#define LTABLE_SIZE 20000
-static int
-gdb_loadfile (ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[])
-{
- char *file, *widget;
- int linenumbers, ln, lnum, ltable_size;
- FILE *fp;
- char *ltable;
- struct symtab *symtab;
- struct linetable_entry *le;
- long mtime = 0;
- struct stat st;
- char line[10000], line_num_buf[18];
- const char *text_argv[9];
- Tcl_CmdInfo text_cmd;
-
-
- if (objc != 4)
- {
- Tcl_WrongNumArgs(interp, 1, objv, "widget filename linenumbers");
- return TCL_ERROR;
- }
-
- widget = Tcl_GetStringFromObj (objv[1], NULL);
- if ( Tk_NameToWindow (interp, widget, Tk_MainWindow (interp)) == NULL)
- {
- return TCL_ERROR;
- }
-
- if (!Tcl_GetCommandInfo (interp, widget, &text_cmd))
- {
- gdbtk_set_result (interp, "Can't get widget command info");
- return TCL_ERROR;
- }
-
- file = Tcl_GetStringFromObj (objv[2], NULL);
- Tcl_GetBooleanFromObj (interp, objv[3], &linenumbers);
-
- symtab = lookup_symtab (file);
- if (!symtab)
- {
- gdbtk_set_result (interp, "File not found in symtab");
- return TCL_ERROR;
- }
-
- file = symtab_to_filename ( symtab );
- if ((fp = fopen ( file, "r" )) == NULL)
- {
- gdbtk_set_result (interp, "Can't open file for reading");
- return TCL_ERROR;
- }
-
- if (stat (file, &st) < 0)
- {
- catch_errors (perror_with_name_wrapper, "gdbtk: get time stamp", "",
- RETURN_MASK_ALL);
- return TCL_ERROR;
- }
-
- if (symtab && symtab->objfile && symtab->objfile->obfd)
- mtime = bfd_get_mtime(symtab->objfile->obfd);
- else if (exec_bfd)
- mtime = bfd_get_mtime(exec_bfd);
-
- if (mtime && mtime < st.st_mtime)
- {
- gdbtk_ignorable_warning("file_times",\
- "Source file is more recent than executable.\n");
- }
-
-
- /* Source linenumbers don't appear to be in order, and a sort is */
- /* too slow so the fastest solution is just to allocate a huge */
- /* array and set the array entry for each linenumber */
-
- ltable_size = LTABLE_SIZE;
- ltable = (char *)malloc (LTABLE_SIZE);
- if (ltable == NULL)
- {
- fclose (fp);
- gdbtk_set_result (interp, "Out of memory.");
- return TCL_ERROR;
- }
-
- memset (ltable, 0, LTABLE_SIZE);
-
- if (symtab->linetable && symtab->linetable->nitems)
- {
- le = symtab->linetable->item;
- for (ln = symtab->linetable->nitems ;ln > 0; ln--, le++)
- {
- lnum = le->line >> 3;
- if (lnum >= ltable_size)
- {
- char *new_ltable;
- new_ltable = (char *)realloc (ltable, ltable_size*2);
- memset (new_ltable + ltable_size, 0, ltable_size);
- ltable_size *= 2;
- if (new_ltable == NULL)
- {
- free (ltable);
- fclose (fp);
- gdbtk_set_result (interp, "Out of memory.");
- return TCL_ERROR;
- }
- ltable = new_ltable;
- }
- ltable[lnum] |= 1 << (le->line % 8);
- }
- }
-
- ln = 1;
-
- line[0] = '\t';
- text_argv[0] = widget;
- text_argv[1] = "insert";
- text_argv[2] = "end";
- text_argv[5] = line;
- text_argv[6] = "source_tag";
- text_argv[8] = NULL;
-
- if (linenumbers)
- {
- int found_carriage_return = 1;
-
- line_num_buf[1] = '\t';
-
- text_argv[3] = line_num_buf;
-
- while (fgets (line + 1, 9980, fp))
- {
- /* Look for DOS style \r\n endings, and if found,
- * strip off the \r. We assume (for the sake of
- * speed) that ALL lines in the file have DOS endings,
- * or none do.
- */
-
- if (found_carriage_return)
- {
- char *p = strrchr(line, '\0') - 2;
- if (*p == '\r')
- {
- *p = '\n';
- *(p + 1) = '\0';
- }
- else
- found_carriage_return = 0;
- }
-
- sprintf (line_num_buf+2, "%d", ln);
- if (ltable[ln >> 3] & (1 << (ln % 8)))
- {
- line_num_buf[0] = '-';
- text_argv[4] = "break_rgn_tag";
- }
- else
- {
- line_num_buf[0] = ' ';
- text_argv[4] = "";
- }
-
- text_cmd.proc(text_cmd.clientData, interp, 7, text_argv);
- ln++;
- }
- }
- else
- {
- int found_carriage_return = 1;
-
- while (fgets (line + 1, 9980, fp))
- {
- if (found_carriage_return)
- {
- char *p = strrchr(line, '\0') - 2;
- if (*p == '\r')
- {
- *p = '\n';
- *(p + 1) = '\0';
- }
- else
- found_carriage_return = 0;
- }
-
- if (ltable[ln >> 3] & (1 << (ln % 8)))
- {
- text_argv[3] = "- ";
- text_argv[4] = "break_rgn_tag";
- }
- else
- {
- text_argv[3] = " ";
- text_argv[4] = "";
- }
-
- text_cmd.proc(text_cmd.clientData, interp, 7, text_argv);
- ln++;
- }
- }
-
- free (ltable);
- fclose (fp);
- return TCL_OK;
-}
-
-/*
- * This section contains a bunch of miscellaneous utility commands
- */
-
-/* This implements the tcl command gdb_path_conv
-
-* On Windows, it canonicalizes the pathname,
-* On Unix, it is a no op.
-*
-* Arguments:
-* path
-* Tcl Result:
-* The canonicalized path.
-*/
-
-static int
-gdb_path_conv (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- if (objc != 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, NULL);
- return TCL_ERROR;
- }
-
-#ifdef __CYGWIN__
- {
- char pathname[256], *ptr;
-
- cygwin_conv_to_full_win32_path (Tcl_GetStringFromObj (objv[1], NULL),
- pathname);
- for (ptr = pathname; *ptr; ptr++)
- {
- if (*ptr == '\\')
- *ptr = '/';
- }
- Tcl_SetStringObj (result_ptr->obj_ptr, pathname, -1);
- }
-#else
- Tcl_SetStringObj (result_ptr->obj_ptr, Tcl_GetStringFromObj (objv[1], NULL),
- -1);
-#endif
-
- return TCL_OK;
-}
-
-/*
- * This section has utility routines that are not Tcl commands.
- */
-
-static int
-perror_with_name_wrapper (PTR args)
-{
- perror_with_name (args);
- return 1;
-}
-
-/* Look for the function that contains PC and return the source
- (demangled) name for this function.
-
- If no symbol is found, it returns an empty string. In either
- case, memory is owned by gdb. Do not attempt to free it. */
-char *
-pc_function_name (CORE_ADDR pc)
-{
- struct symbol *sym;
- char *funcname = NULL;
-
- /* First lookup the address in the symbol table... */
- sym = find_pc_function (pc);
- if (sym != NULL)
- funcname = GDBTK_SYMBOL_SOURCE_NAME (sym);
- else
- {
- /* ... if that fails, look it up in the minimal symbols. */
- struct minimal_symbol *msym = NULL;
-
- msym = lookup_minimal_symbol_by_pc (pc);
- if (msym != NULL)
- funcname = GDBTK_SYMBOL_SOURCE_NAME (msym);
- }
-
- if (funcname == NULL)
- funcname = "";
-
- return funcname;
-}
-
-void
-gdbtk_set_result (Tcl_Interp *interp, const char *fmt,...)
-{
- va_list args;
- char *buf;
-
- va_start (args, fmt);
- xvasprintf (&buf, fmt, args);
- va_end (args);
- Tcl_SetObjResult (interp, Tcl_NewStringObj (buf, -1));
- xfree(buf);
-}
-
-
-/* This implements the tcl command 'gdb_incr_addr'.
- * It does address arithmetic and outputs a proper
- * hex string. This was originally implemented
- * when tcl did not support 64-bit values, but we keep
- * it because it saves us from having to call incr
- * followed by format to get the result in hex.
- * Also, it may be true in the future that CORE_ADDRs
- * will have their own ALU to deal properly with
- * architecture-specific address arithmetic.
- *
- * Tcl Arguments:
- * addr - CORE_ADDR
- * number - optional number to add to the address
- * default is 1.
- *
- * Tcl Result:
- * hex string containing the result of addr + number
- */
-
-static int
-gdb_incr_addr (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- CORE_ADDR address;
- int number = 1;
-
- if (objc != 2 && objc != 3)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "CORE_ADDR [number]");
- return TCL_ERROR;
- }
-
- address = string_to_core_addr (Tcl_GetStringFromObj (objv[1], NULL));
-
- if (objc == 3)
- {
- if (Tcl_GetIntFromObj (interp, objv[2], &number) != TCL_OK)
- return TCL_ERROR;
- }
-
- address += number;
-
- Tcl_SetStringObj (result_ptr->obj_ptr, (char *)core_addr_to_string (address), -1);
-
- return TCL_OK;
-}
-
-/* This implements the tcl command 'gdb_CAS_to_TAS'.
- * It takes a CORE_ADDR and outputs a string suitable
- * for displaying as the target address.
- *
- * Note that CORE_ADDRs are internal addresses which map
- * to target addresses in different ways depending on the
- * architecture. The target address string is a user-readable
- * string may be quite different than the CORE_ADDR. For example,
- * a CORE_ADDR of 0x02001234 might indicate a data address of
- * 0x1234 which this function might someday output as something
- * like "D:1234".
- *
- * Tcl Arguments:
- * address - CORE_ADDR
- *
- * Tcl Result:
- * string
- */
-
-static int
-gdb_CA_to_TAS (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- CORE_ADDR address;
- Tcl_WideInt wide_addr;
-
- if (objc != 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "CORE_ADDR");
- return TCL_ERROR;
- }
-
- /* Read address into a wideint, which is the largest tcl supports
- then convert to a CORE_ADDR */
- if (Tcl_GetWideIntFromObj (interp, objv[1], &wide_addr) != TCL_OK)
- return TCL_ERROR;
- address = wide_addr;
-
- /* This is not really correct. Using paddr_nz() will convert to hex and truncate
- to 32-bits when required but will otherwise not do what we really want. */
- Tcl_SetStringObj (result_ptr->obj_ptr, paddr_nz (address), -1);
-
- return TCL_OK;
-}
-
-/* Another function that was removed in GDB and replaced
- * with something similar, but different enough to break
- * Insight.
- */
-char *
-symtab_to_filename (struct symtab *s)
-{
- int r;
-
- if (!s)
- return NULL;
-
- /* Don't check s->fullname here, the file could have been
- deleted/moved/..., look for it again */
- r = open_source_file (s);
- if (r)
- close (r);
-
- if (s->fullname && *s->fullname)
- return s->fullname;
- return s->filename;
-}
diff --git a/gdb/gdbtk/generic/gdbtk-cmds.h b/gdb/gdbtk/generic/gdbtk-cmds.h
deleted file mode 100644
index 9a1c6a94f73..00000000000
--- a/gdb/gdbtk/generic/gdbtk-cmds.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Tcl/Tk command interface for Insight
- Copyright (C) 2001 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-#if !defined(GDBTK_CMDS_H)
-#define GDBTK_CMDS_H 1
-
-/* This structure filled in gdbtk_call_wrapper and passed to
- the wrapped call function.
- It stores the command pointer and arguments
- run in the wrapper function. */
-struct wrapped_call_args
- {
- Tcl_Interp *interp;
- Tcl_ObjCmdProc *func;
- int objc;
- Tcl_Obj *CONST * objv;
- int val;
- };
-
-/* A generic call-wrapper to catch longjmps when calling C commands from
- tcl. ALL tcl commands should be wrapped in this call. */
-extern int gdbtk_call_wrapper (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-
-/* Returns the source (demangled) name for a function at PC. Returns empty string
- if not found. Memory is owned by gdb. Do not free it. */
-extern char *pc_function_name (CORE_ADDR pc);
-
-/* Convenience function to sprintf something(s) into a new element in
- a Tcl list object. */
-extern void sprintf_append_element_to_obj (Tcl_Obj * objp, char *format, ...);
-
-/* printf-like function to return error messages */
-extern void gdbtk_set_result (Tcl_Interp *interp, const char *fmt,...);
-
-/* Module init routines: Each module of commands should be declared here. */
-extern int Gdbtk_Breakpoint_Init (Tcl_Interp *interp);
-extern int Gdbtk_Stack_Init (Tcl_Interp *interp);
-extern int Gdbtk_Register_Init (Tcl_Interp *interp);
-
-/* replacement for removed gdb function */
-char *symtab_to_filename (struct symtab *s);
-
-#endif /* GDBTK_CMDS_H */
diff --git a/gdb/gdbtk/generic/gdbtk-hooks.c b/gdb/gdbtk/generic/gdbtk-hooks.c
deleted file mode 100644
index 0720dd8e9c9..00000000000
--- a/gdb/gdbtk/generic/gdbtk-hooks.c
+++ /dev/null
@@ -1,843 +0,0 @@
-/* Startup code for Insight.
-
- Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 200, 2002, 2003, 2004, 2008
- Free Software Foundation, Inc.
-
- Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support.
-
- This file is part of GDB.
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-#include "defs.h"
-#include "inferior.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdbcore.h"
-#include "tracepoint.h"
-#include "demangle.h"
-#include "top.h"
-#include "annotate.h"
-#include "cli/cli-decode.h"
-#include "observer.h"
-
-#ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
-/* tcl header files includes varargs.h unless HAS_STDARG is defined,
- but gdb uses stdarg.h, so make sure HAS_STDARG is defined. */
-#define HAS_STDARG 1
-
-#include <tcl.h>
-#include <tk.h>
-#include "guitcl.h"
-#include "gdbtk.h"
-
-#include <signal.h>
-#include <fcntl.h>
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#include <sys/time.h>
-
-#include "gdb_string.h"
-#include "dis-asm.h"
-#include "gdbcmd.h"
-
-
-volatile int in_fputs = 0;
-
-/* Set by gdb_stop, this flag informs x_event to tell its caller
- that it should forcibly detach from the target. */
-int gdbtk_force_detach = 0;
-
-/* From gdbtk-bp.c */
-extern void gdbtk_create_breakpoint (int);
-extern void gdbtk_delete_breakpoint (int);
-extern void gdbtk_modify_breakpoint (int);
-extern void gdbtk_create_tracepoint (int);
-extern void gdbtk_delete_tracepoint (int);
-extern void gdbtk_modify_tracepoint (int);
-
-static void gdbtk_architecture_changed (struct gdbarch *);
-static void gdbtk_trace_find (char *arg, int from_tty);
-static void gdbtk_trace_start_stop (int, int);
-static void gdbtk_attach (void);
-static void gdbtk_detach (void);
-static void gdbtk_file_changed (char *);
-static void gdbtk_exec_file_display (char *);
-static void gdbtk_call_command (struct cmd_list_element *, char *, int);
-static ptid_t gdbtk_wait (ptid_t, struct target_waitstatus *);
-int x_event (int);
-static int gdbtk_query (const char *, va_list);
-static void gdbtk_warning (const char *, va_list);
-static char *gdbtk_readline (char *);
-static void gdbtk_readline_begin (char *format,...);
-static void gdbtk_readline_end (void);
-static void gdbtk_pre_add_symbol (const char *);
-static void gdbtk_print_frame_info (struct symtab *, int, int, int);
-static void gdbtk_post_add_symbol (void);
-static void gdbtk_register_changed (int regno);
-static void gdbtk_memory_changed (CORE_ADDR addr, int len);
-static void gdbtk_selected_frame_changed (int);
-static void gdbtk_context_change (int);
-static void gdbtk_error_begin (void);
-void report_error (void);
-static void gdbtk_annotate_signal (void);
-static void gdbtk_set_hook (struct cmd_list_element *cmdblk);
-
-/*
- * gdbtk_fputs can't be static, because we need to call it in gdbtk.c.
- * See note there for details.
- */
-
-long gdbtk_read (struct ui_file *, char *, long);
-void gdbtk_fputs (const char *, struct ui_file *);
-static int gdbtk_load_hash (const char *, unsigned long);
-
-static ptid_t gdbtk_ptid;
-
-/*
- * gdbtk_add_hooks - add all the hooks to gdb. This will get called by the
- * startup code to fill in the hooks needed by core gdb.
- */
-
-void
-gdbtk_add_hooks (void)
-{
- /* Gdb observers */
- observer_attach_breakpoint_created (gdbtk_create_breakpoint);
- observer_attach_breakpoint_modified (gdbtk_modify_breakpoint);
- observer_attach_breakpoint_deleted (gdbtk_delete_breakpoint);
- observer_attach_tracepoint_created (gdbtk_create_tracepoint);
- observer_attach_tracepoint_modified (gdbtk_modify_tracepoint);
- observer_attach_tracepoint_deleted (gdbtk_delete_tracepoint);
- observer_attach_architecture_changed (gdbtk_architecture_changed);
-
- /* Hooks */
- deprecated_call_command_hook = gdbtk_call_command;
- deprecated_set_hook = gdbtk_set_hook;
- deprecated_readline_begin_hook = gdbtk_readline_begin;
- deprecated_readline_hook = gdbtk_readline;
- deprecated_readline_end_hook = gdbtk_readline_end;
-
- deprecated_print_frame_info_listing_hook = gdbtk_print_frame_info;
- deprecated_query_hook = gdbtk_query;
- deprecated_warning_hook = gdbtk_warning;
-
- deprecated_interactive_hook = gdbtk_interactive;
- deprecated_target_wait_hook = gdbtk_wait;
- deprecated_ui_load_progress_hook = gdbtk_load_hash;
-
- deprecated_ui_loop_hook = x_event;
- deprecated_pre_add_symbol_hook = gdbtk_pre_add_symbol;
- deprecated_post_add_symbol_hook = gdbtk_post_add_symbol;
- deprecated_file_changed_hook = gdbtk_file_changed;
- specify_exec_file_hook (gdbtk_exec_file_display);
-
- deprecated_trace_find_hook = gdbtk_trace_find;
- deprecated_trace_start_stop_hook = gdbtk_trace_start_stop;
-
- deprecated_attach_hook = gdbtk_attach;
- deprecated_detach_hook = gdbtk_detach;
-
- deprecated_register_changed_hook = gdbtk_register_changed;
- deprecated_memory_changed_hook = gdbtk_memory_changed;
- deprecated_selected_frame_level_changed_hook = gdbtk_selected_frame_changed;
- deprecated_context_hook = gdbtk_context_change;
-
- deprecated_error_begin_hook = gdbtk_error_begin;
-
- deprecated_annotate_signal_hook = gdbtk_annotate_signal;
- deprecated_annotate_signalled_hook = gdbtk_annotate_signal;
-}
-
-/* These control where to put the gdb output which is created by
- {f}printf_{un}filtered and friends. gdbtk_fputs is the lowest
- level of these routines and capture all output from the rest of
- GDB.
-
- The reason to use the result_ptr rather than the gdbtk_interp's result
- directly is so that a call_wrapper invoked function can preserve its result
- across calls into Tcl which might be made in the course of the function's
- execution.
-
- * result_ptr->obj_ptr is where to accumulate the result.
- * GDBTK_TO_RESULT flag means the output goes to the gdbtk_tcl_fputs proc
- instead of to the result_ptr.
- * GDBTK_MAKES_LIST flag means add to the result as a list element.
-
-*/
-
-gdbtk_result *result_ptr = NULL;
-
-/* If you want to restore an old value of result_ptr whenever cleanups
- are run, pass this function to make_cleanup, along with the value
- of result_ptr you'd like to reinstate. */
-void
-gdbtk_restore_result_ptr (void *old_result_ptr)
-{
- result_ptr = (gdbtk_result *) old_result_ptr;
-}
-
-/* This allows you to Tcl_Eval a tcl command which takes
- a command word, and then a single argument. */
-int
-gdbtk_two_elem_cmd (cmd_name, argv1)
- char *cmd_name;
- char *argv1;
-{
- char *command;
- int result, flags_ptr, arg_len, cmd_len;
-
- arg_len = Tcl_ScanElement (argv1, &flags_ptr);
- cmd_len = strlen (cmd_name);
- command = malloc (arg_len + cmd_len + 2);
- strcpy (command, cmd_name);
- strcat (command, " ");
-
- Tcl_ConvertElement (argv1, command + cmd_len + 1, flags_ptr);
-
- result = Tcl_Eval (gdbtk_interp, command);
- if (result != TCL_OK)
- report_error ();
- free (command);
- return result;
-}
-
-struct ui_file *
-gdbtk_fileopenin (void)
-{
- struct ui_file *file = ui_file_new ();
- set_ui_file_read (file, gdbtk_read);
- return file;
-}
-
-struct ui_file *
-gdbtk_fileopen (void)
-{
- struct ui_file *file = ui_file_new ();
- set_ui_file_fputs (file, gdbtk_fputs);
- return file;
-}
-
-/* This handles input from the gdb console.
- */
-
-long
-gdbtk_read (struct ui_file *stream, char *buf, long sizeof_buf)
-{
- int result;
- size_t actual_len;
-
- if (stream == gdb_stdtargin)
- {
- result = Tcl_Eval (gdbtk_interp, "gdbtk_console_read");
- if (result != TCL_OK)
- {
- report_error ();
- actual_len = 0;
- }
- else
- actual_len = strlen (gdbtk_interp->result);
-
- /* Truncate the string if it is too big for the caller's buffer. */
- if (actual_len >= sizeof_buf)
- actual_len = sizeof_buf - 1;
-
- memcpy (buf, gdbtk_interp->result, actual_len);
- buf[actual_len] = '\0';
- return actual_len;
- }
- else
- {
- errno = EBADF;
- return 0;
- }
-}
-
-
-/* This handles all the output from gdb. All the gdb printf_xxx functions
- * eventually end up here. The output is either passed to the result_ptr
- * where it will go to the result of some gdbtk command, or passed to the
- * Tcl proc gdbtk_tcl_fputs (where it is usually just dumped to the console
- * window.
- *
- * The cases are:
- *
- * 1) result_ptr == NULL - This happens when some output comes from gdb which
- * is not generated by a command in gdbtk-cmds, usually startup stuff.
- * In this case we just route the data to gdbtk_tcl_fputs.
- * 2) The GDBTK_TO_RESULT flag is set - The result is supposed to go to Tcl.
- * We place the data into the result_ptr, either as a string,
- * or a list, depending whether the GDBTK_MAKES_LIST bit is set.
- * 3) The GDBTK_TO_RESULT flag is unset - We route the data to gdbtk_tcl_fputs
- * UNLESS it was coming to gdb_stderr. Then we place it in the result_ptr
- * anyway, so it can be dealt with.
- *
- */
-
-void
-gdbtk_fputs (const char *ptr, struct ui_file *stream)
-{
- if (gdbtk_disable_fputs)
- return;
-
- in_fputs = 1;
-
- if (stream == gdb_stdlog)
- gdbtk_two_elem_cmd ("gdbtk_tcl_fputs_log", (char *) ptr);
- else if (stream == gdb_stdtarg)
- gdbtk_two_elem_cmd ("gdbtk_tcl_fputs_target", (char *) ptr);
- else if (result_ptr != NULL)
- {
- if (result_ptr->flags & GDBTK_TO_RESULT)
- {
- if (result_ptr->flags & GDBTK_MAKES_LIST)
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj ((char *) ptr, -1));
- else
- Tcl_AppendToObj (result_ptr->obj_ptr, (char *) ptr, -1);
- }
- else if (stream == gdb_stderr || result_ptr->flags & GDBTK_ERROR_ONLY)
- {
- if (result_ptr->flags & GDBTK_ERROR_STARTED)
- Tcl_AppendToObj (result_ptr->obj_ptr, (char *) ptr, -1);
- else
- {
- Tcl_SetStringObj (result_ptr->obj_ptr, (char *) ptr, -1);
- result_ptr->flags |= GDBTK_ERROR_STARTED;
- }
- }
- else
- {
- gdbtk_two_elem_cmd ("gdbtk_tcl_fputs", (char *) ptr);
- if (result_ptr->flags & GDBTK_MAKES_LIST)
- gdbtk_two_elem_cmd ("gdbtk_tcl_fputs", " ");
- }
- }
- else
- {
- gdbtk_two_elem_cmd ("gdbtk_tcl_fputs", (char *) ptr);
- }
-
- in_fputs = 0;
-}
-
-/*
- * This routes all warnings to the Tcl function "gdbtk_tcl_warning".
- */
-
-static void
-gdbtk_warning (const char *warning, va_list args)
-{
- char *buf;
- xvasprintf (&buf, warning, args);
- gdbtk_two_elem_cmd ("gdbtk_tcl_warning", buf);
- free(buf);
-}
-
-
-/* Error-handling function for all hooks */
-/* Hooks are not like tcl functions, they do not simply return */
-/* TCL_OK or TCL_ERROR. Also, the calling function typically */
-/* doesn't care about errors in the hook functions. Therefore */
-/* after every hook function, report_error should be called. */
-/* report_error can just call Tcl_BackgroundError() which will */
-/* pop up a messagebox, or it can silently log the errors through */
-/* the gdbtk dbug command. */
-
-void
-report_error ()
-{
- TclDebug ('E', Tcl_GetVar (gdbtk_interp, "errorInfo", TCL_GLOBAL_ONLY));
- /* Tcl_BackgroundError(gdbtk_interp); */
-}
-
-/*
- * This routes all ignorable warnings to the Tcl function
- * "gdbtk_tcl_ignorable_warning".
- */
-
-void
-gdbtk_ignorable_warning (const char *class, const char *warning)
-{
- char *buf;
- xasprintf (&buf, "gdbtk_tcl_ignorable_warning {%s} {%s}", class, warning);
- if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK)
- report_error ();
- free(buf);
-}
-
-static void
-gdbtk_register_changed (int regno)
-{
- if (Tcl_Eval (gdbtk_interp, "gdbtk_register_changed") != TCL_OK)
- report_error ();
-}
-
-static void
-gdbtk_memory_changed (CORE_ADDR addr, int len)
-{
- if (Tcl_Eval (gdbtk_interp, "gdbtk_memory_changed") != TCL_OK)
- report_error ();
-}
-
-
-/* This hook is installed as the deprecated_ui_loop_hook, which is
- * used in several places to keep the gui alive (x_event runs gdbtk's
- * event loop). Users include:
- * - ser-tcp.c in socket reading code
- * - ser-unix.c in serial port reading code
- * - built-in simulators while executing
- *
- * x_event used to be called on SIGIO on the socket to the X server
- * for unix. Unfortunately, Linux does not deliver SIGIO, so we resort
- * to an elaborate scheme to keep the gui alive.
- *
- * For simulators and socket or serial connections on all hosts, we
- * rely on deprecated_ui_loop_hook (x_event) to keep us going. If the
- * user requests a detach (as a result of pressing the stop button --
- * see comments before gdb_stop in gdbtk-cmds.c), it sets the global
- * GDBTK_FORCE_DETACH, which is the value that x_event returns to it's
- * caller. It is up to the caller of x_event to act on this
- * information.
- *
- * For native unix, we simply set an interval timer which calls
- * x_event to allow the debugger to run through the Tcl event
- * loop. See comments before gdbtk_start_timer and gdb_stop_timer
- * in gdbtk.c.
- *
- * For native windows (and a few other targets, like the v850 ICE), we
- * rely on the target_wait loops to call deprecated_ui_loop_hook to
- * keep us alive. */
-int
-x_event (int signo)
-{
- static volatile int in_x_event = 0;
- static Tcl_Obj *varname = NULL;
-
- /* Do nor re-enter this code or enter it while collecting gdb output. */
- if (in_x_event || in_fputs)
- return 0;
-
- /* Also, only do things while the target is running (stops and redraws).
- FIXME: We wold like to at least redraw at other times but this is bundled
- together in the TCL_WINDOW_EVENTS group and we would also process user
- input. We will have to prevent (unwanted) user input to be generated
- in order to be able to redraw (removing this test here). */
- if (!running_now)
- return 0;
-
- in_x_event = 1;
- gdbtk_force_detach = 0;
-
- /* Process pending events */
- while (Tcl_DoOneEvent (TCL_DONT_WAIT | TCL_ALL_EVENTS) != 0)
- ;
-
- if (load_in_progress)
- {
- int val;
- if (varname == NULL)
- {
-#if TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION < 1 || TCL_MINOR_VERSION > 2)
- Tcl_Obj *varnamestrobj = Tcl_NewStringObj ("download_cancel_ok", -1);
- varname = Tcl_ObjGetVar2 (gdbtk_interp, varnamestrobj, NULL, TCL_GLOBAL_ONLY);
-#else
- varname = Tcl_GetObjVar2 (gdbtk_interp, "download_cancel_ok", NULL, TCL_GLOBAL_ONLY);
-#endif
- }
- if ((Tcl_GetIntFromObj (gdbtk_interp, varname, &val) == TCL_OK) && val)
- {
- quit_flag = 1;
-#ifdef REQUEST_QUIT
- REQUEST_QUIT;
-#else
- if (immediate_quit)
- quit ();
-#endif
- }
- }
- in_x_event = 0;
-
- return gdbtk_force_detach;
-}
-
-/* VARARGS */
-static void
-gdbtk_readline_begin (char *format,...)
-{
- va_list args;
- char *buf;
-
- va_start (args, format);
- xvasprintf (&buf, format, args);
- gdbtk_two_elem_cmd ("gdbtk_tcl_readline_begin", buf);
- free(buf);
-}
-
-static char *
-gdbtk_readline (char *prompt)
-{
- int result;
-
-#ifdef _WIN32
- close_bfds ();
-#endif
-
- result = gdbtk_two_elem_cmd ("gdbtk_tcl_readline", prompt);
-
- if (result == TCL_OK)
- {
- return (xstrdup (gdbtk_interp->result));
- }
- else
- {
- gdbtk_fputs (gdbtk_interp->result, gdb_stdout);
- gdbtk_fputs ("\n", gdb_stdout);
- return (NULL);
- }
-}
-
-static void
-gdbtk_readline_end ()
-{
- if (Tcl_Eval (gdbtk_interp, "gdbtk_tcl_readline_end") != TCL_OK)
- report_error ();
-}
-
-static void
-gdbtk_call_command (struct cmd_list_element *cmdblk,
- char *arg, int from_tty)
-{
- struct cleanup *old_chain;
-
- old_chain = make_cleanup (null_cleanup, 0);
- running_now = 0;
- if (cmdblk->class == class_run || cmdblk->class == class_trace)
- {
-
- running_now = 1;
- if (!No_Update)
- Tcl_Eval (gdbtk_interp, "gdbtk_tcl_busy");
- cmd_func (cmdblk, arg, from_tty);
- running_now = 0;
- if (!No_Update)
- Tcl_Eval (gdbtk_interp, "gdbtk_tcl_idle");
- }
- else
- cmd_func (cmdblk, arg, from_tty);
-
- do_cleanups (old_chain);
-}
-
-/* Called after a `set' command succeeds. Runs the Tcl hook
- `gdb_set_hook' with the full name of the variable (a Tcl list) as
- the first argument and the new value as the second argument. */
-
-static void
-gdbtk_set_hook (struct cmd_list_element *cmdblk)
-{
- Tcl_DString cmd;
- char *p;
- char *buffer = NULL;
-
- Tcl_DStringInit (&cmd);
- Tcl_DStringAppendElement (&cmd, "gdbtk_tcl_set_variable");
-
- /* Append variable name as sublist. */
- Tcl_DStringStartSublist (&cmd);
- p = cmdblk->prefixname;
- while (p && *p)
- {
- char *q = strchr (p, ' ');
- char save = '\0';
- if (q)
- {
- save = *q;
- *q = '\0';
- }
- Tcl_DStringAppendElement (&cmd, p);
- if (q)
- *q = save;
- p = q + 1;
- }
- Tcl_DStringAppendElement (&cmd, cmdblk->name);
- Tcl_DStringEndSublist (&cmd);
-
- switch (cmdblk->var_type)
- {
- case var_string_noescape:
- case var_filename:
- case var_enum:
- case var_string:
- Tcl_DStringAppendElement (&cmd, (*(char **) cmdblk->var
- ? *(char **) cmdblk->var
- : "(null)"));
- break;
-
- case var_boolean:
- Tcl_DStringAppendElement (&cmd, (*(int *) cmdblk->var ? "1" : "0"));
- break;
-
- case var_uinteger:
- case var_zinteger:
- xasprintf (&buffer, "%u", *(unsigned int *) cmdblk->var);
- Tcl_DStringAppendElement (&cmd, buffer);
- break;
-
- case var_integer:
- xasprintf (&buffer, "%d", *(int *) cmdblk->var);
- Tcl_DStringAppendElement (&cmd, buffer);
- break;
-
- default:
- /* This case should already be trapped by the hook caller. */
- Tcl_DStringAppendElement (&cmd, "error");
- break;
- }
-
- if (Tcl_Eval (gdbtk_interp, Tcl_DStringValue (&cmd)) != TCL_OK)
- report_error ();
-
- Tcl_DStringFree (&cmd);
-
- if (buffer != NULL)
- {
- free(buffer);
- }
-}
-
-int
-gdbtk_load_hash (const char *section, unsigned long num)
-{
- char *buf;
- xasprintf (&buf, "Download::download_hash %s %ld", section, num);
- if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK)
- report_error ();
- free(buf);
-
- return atoi (gdbtk_interp->result);
-}
-
-
-/* This hook is called whenever we are ready to load a symbol file so that
- the UI can notify the user... */
-static void
-gdbtk_pre_add_symbol (const char *name)
-{
- gdbtk_two_elem_cmd ("gdbtk_tcl_pre_add_symbol", (char *) name);
-}
-
-/* This hook is called whenever we finish loading a symbol file. */
-static void
-gdbtk_post_add_symbol ()
-{
- if (Tcl_Eval (gdbtk_interp, "gdbtk_tcl_post_add_symbol") != TCL_OK)
- report_error ();
-}
-
-/* This hook function is called whenever we want to wait for the
- target. */
-
-static ptid_t
-gdbtk_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
-{
- gdbtk_force_detach = 0;
- gdbtk_start_timer ();
- ptid = target_wait (ptid, ourstatus);
- gdbtk_stop_timer ();
- gdbtk_ptid = ptid;
-
- return ptid;
-}
-
-/*
- * This handles all queries from gdb.
- * The first argument is a printf style format statement, the rest are its
- * arguments. The resultant formatted string is passed to the Tcl function
- * "gdbtk_tcl_query".
- * It returns the users response to the query, as well as putting the value
- * in the result field of the Tcl interpreter.
- */
-
-static int
-gdbtk_query (const char *query, va_list args)
-{
- char *buf;
- long val;
-
- xvasprintf (&buf, query, args);
- gdbtk_two_elem_cmd ("gdbtk_tcl_query", buf);
- free(buf);
-
- val = atol (gdbtk_interp->result);
- return val;
-}
-
-
-static void
-gdbtk_print_frame_info (struct symtab *s, int line,
- int stopline, int noerror)
-{
-}
-
-/*
- * gdbtk_trace_find
- *
- * This is run by the trace_find_command. arg is the argument that was passed
- * to that command, from_tty is 1 if the command was run from a tty, 0 if it
- * was run from a script. It runs gdbtk_tcl_tfind_hook passing on these two
- * arguments.
- *
- */
-
-static void
-gdbtk_trace_find (char *arg, int from_tty)
-{
- Tcl_Obj *cmdObj;
-
- cmdObj = Tcl_NewListObj (0, NULL);
- Tcl_ListObjAppendElement (gdbtk_interp, cmdObj,
- Tcl_NewStringObj ("gdbtk_tcl_trace_find_hook", -1));
- Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewStringObj (arg, -1));
- Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewIntObj (from_tty));
-#if TCL_MAJOR_VERSION == 8 && (TCL_MINOR_VERSION < 1 || TCL_MINOR_VERSION > 2)
- if (Tcl_GlobalEvalObj (gdbtk_interp, cmdObj) != TCL_OK)
- report_error ();
-#else
- if (Tcl_EvalObj (gdbtk_interp, cmdObj, TCL_EVAL_GLOBAL) != TCL_OK)
- report_error ();
-#endif
-}
-
-/*
- * gdbtk_trace_start_stop
- *
- * This is run by the trace_start_command and trace_stop_command.
- * The START variable determines which, 1 meaning trace_start was run,
- * 0 meaning trace_stop was run.
- *
- */
-
-static void
-gdbtk_trace_start_stop (int start, int from_tty)
-{
-
- if (start)
- Tcl_GlobalEval (gdbtk_interp, "gdbtk_tcl_tstart");
- else
- Tcl_GlobalEval (gdbtk_interp, "gdbtk_tcl_tstop");
-
-}
-
-static void
-gdbtk_selected_frame_changed (int level)
-{
-#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 1
- char *a;
- xasprintf (&a, "%d", level);
- Tcl_SetVar (gdbtk_interp, "gdb_selected_frame_level", a, TCL_GLOBAL_ONLY);
- xfree (a);
-#else
- Tcl_SetVar2Ex (gdbtk_interp, "gdb_selected_frame_level", NULL,
- Tcl_NewIntObj (level), TCL_GLOBAL_ONLY);
-#endif
-}
-
-/* Called when the current thread changes. */
-/* gdb_context is linked to the tcl variable "gdb_context_id" */
-static void
-gdbtk_context_change (int num)
-{
- gdb_context = num;
-}
-
-/* Called from file_command */
-static void
-gdbtk_file_changed (char *filename)
-{
- gdbtk_two_elem_cmd ("gdbtk_tcl_file_changed", filename);
-}
-
-/* Called from exec_file_command */
-static void
-gdbtk_exec_file_display (char *filename)
-{
- gdbtk_two_elem_cmd ("gdbtk_tcl_exec_file_display", filename);
-}
-
-/* Called from error_begin, this hook is used to warn the gui
- about multi-line error messages */
-static void
-gdbtk_error_begin ()
-{
- if (result_ptr != NULL)
- result_ptr->flags |= GDBTK_ERROR_ONLY;
-}
-
-/* notify GDBtk when a signal occurs */
-static void
-gdbtk_annotate_signal ()
-{
- char *buf;
-
- /* Inform gui that the target has stopped. This is
- a necessary stop button evil. We don't want signal notification
- to interfere with the elaborate and painful stop button detach
- timeout. */
- Tcl_Eval (gdbtk_interp, "gdbtk_stop_idle_callback");
-
- xasprintf (&buf, "gdbtk_signal %s {%s}", target_signal_to_name (stop_signal),
- target_signal_to_string (stop_signal));
- if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK)
- report_error ();
- free(buf);
-}
-
-static void
-gdbtk_attach ()
-{
- if (Tcl_Eval (gdbtk_interp, "after idle \"update idletasks;gdbtk_attached\"") != TCL_OK)
- {
- report_error ();
- }
-}
-
-static void
-gdbtk_detach ()
-{
- if (Tcl_Eval (gdbtk_interp, "gdbtk_detached") != TCL_OK)
- {
- report_error ();
- }
-}
-
-/* Called from gdbarch_update_p whenever the architecture changes. */
-static void
-gdbtk_architecture_changed (struct gdbarch *ignore)
-{
- Tcl_Eval (gdbtk_interp, "gdbtk_tcl_architecture_changed");
-}
-
-ptid_t
-gdbtk_get_ptid (void)
-{
- return gdbtk_ptid;
-}
diff --git a/gdb/gdbtk/generic/gdbtk-interp.c b/gdb/gdbtk/generic/gdbtk-interp.c
deleted file mode 100644
index f4dd3ec1ce4..00000000000
--- a/gdb/gdbtk/generic/gdbtk-interp.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* Insight Definitions for GDB, the GNU debugger.
- Written by Keith Seitz <kseitz@sources.redhat.com>
-
- Copyright (C) 2003, 2004, 2008 Free Software Foundation, Inc.
-
- This file is part of Insight.
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-#include "defs.h"
-#include "interps.h"
-#include "ui-file.h"
-#include "ui-out.h"
-#include "cli-out.h"
-#include "gdb_string.h"
-#include "cli/cli-cmds.h"
-#include "cli/cli-decode.h"
-#include "exceptions.h"
-
-#include "tcl.h"
-#include "tk.h"
-#include "gdbtk.h"
-
-#ifdef __MINGW32__
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-#endif
-
-
-static void gdbtk_command_loop (void);
-static void hack_disable_interpreter_exec (char *, int);
-
-struct gdbtk_interp_data
-{
- struct ui_file *_stdout;
- struct ui_file *_stderr;
- struct ui_file *_stdlog;
- struct ui_file *_stdtarg;
- struct ui_file *_stdtargin;
-};
-
-static struct gdbtk_interp_data *gdbtk_data;
-
-/* See note in gdbtk_interpreter_init */
-static void
-hack_disable_interpreter_exec (char *args, int from_tty)
-{
- error ("interpreter-exec not available when running Insight");
-}
-
-static void *
-gdbtk_interpreter_init (int top_level)
-{
- /* Disable interpreter-exec. It causes us big trouble right now. */
- struct cmd_list_element *cmd = NULL;
- struct cmd_list_element *alias = NULL;
- struct cmd_list_element *prefix = NULL;
-
- gdbtk_init ();
-
- if (lookup_cmd_composition ("interpreter-exec", &alias, &prefix, &cmd))
- {
- set_cmd_cfunc (cmd, hack_disable_interpreter_exec);
- }
-
- return gdbtk_data;
-}
-
-static int
-gdbtk_interpreter_resume (void *data)
-{
- static int started = 0;
- struct gdbtk_interp_data *d = (struct gdbtk_interp_data *) data;
- gdbtk_add_hooks ();
-
- gdb_stdout = d->_stdout;
- gdb_stderr = d->_stderr;
- gdb_stdlog = d->_stdlog;
- gdb_stdtarg = d->_stdtarg;
- gdb_stdtargin = d->_stdtargin;
-
- deprecated_command_loop_hook = gdbtk_command_loop;
-
- /* 2003-02-11 keiths: We cannot actually source our main Tcl file in
- our interpreter's init function because any errors that may
- get generated will go to the wrong gdb_stderr. Instead of hacking
- our interpreter init function to force gdb_stderr to our ui_file,
- we defer sourcing the startup file until now, when gdb is ready
- to let our interpreter run. */
- if (!started)
- {
- started = 1;
- gdbtk_source_start_file ();
- }
-
- return 1;
-}
-
-static int
-gdbtk_interpreter_suspend (void *data)
-{
- return 1;
-}
-
-static int
-gdbtk_interpreter_display_prompt_p (void *data)
-{
- return 1;
-}
-
-static struct gdb_exception
-gdbtk_interpreter_exec (void *data, const char *command_str)
-{
- return exception_none;
-}
-
-/* This function is called instead of gdb's internal command loop. This is the
- last chance to do anything before entering the main Tk event loop.
- At the end of the command, we enter the main loop. */
-
-static void
-gdbtk_command_loop (void)
-{
- extern FILE *instream;
-
- /* We no longer want to use stdin as the command input stream */
- instream = NULL;
-
- if (Tcl_Eval (gdbtk_interp, "gdbtk_tcl_preloop") != TCL_OK)
- {
- const char *msg;
-
- /* Force errorInfo to be set up propertly. */
- Tcl_AddErrorInfo (gdbtk_interp, "");
-
- msg = Tcl_GetVar (gdbtk_interp, "errorInfo", TCL_GLOBAL_ONLY);
-#ifdef _WIN32
- MessageBox (NULL, msg, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL);
-#else
- fputs_unfiltered (msg, gdb_stderr);
-#endif
- }
-
-#ifdef _WIN32
- close_bfds ();
-#endif
-
- Tk_MainLoop ();
-}
-
-void
-_initialize_gdbtk_interp (void)
-{
- static const struct interp_procs procs = {
- gdbtk_interpreter_init, /* init_proc */
- gdbtk_interpreter_resume, /* resume_proc */
- gdbtk_interpreter_suspend, /* suspend_proc */
- gdbtk_interpreter_exec, /* exec_proc */
- gdbtk_interpreter_display_prompt_p /* prompt_proc_p */
- };
- struct interp *gdbtk_interp;
-
- gdbtk_data =
- (struct gdbtk_interp_data *) xmalloc (sizeof (struct gdbtk_interp_data));
- memset (gdbtk_data, 0, sizeof (struct gdbtk_interp_data));
- gdbtk_data->_stdout = gdbtk_fileopen ();
- gdbtk_data->_stderr = gdbtk_fileopen ();
- gdbtk_data->_stdlog = gdbtk_fileopen ();
- gdbtk_data->_stdtarg = gdbtk_fileopen ();
- gdbtk_data->_stdtargin = gdbtk_fileopenin ();
- gdbtk_interp = interp_new ("insight", gdbtk_data, cli_out_new (gdbtk_data->_stdout),
- &procs);
- interp_add (gdbtk_interp);
-}
diff --git a/gdb/gdbtk/generic/gdbtk-main.c b/gdb/gdbtk/generic/gdbtk-main.c
deleted file mode 100644
index 39864f93a9e..00000000000
--- a/gdb/gdbtk/generic/gdbtk-main.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Main function for gdb with insight.
-
- Copyright (C) 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-
-#include "defs.h"
-#include "main.h"
-#include "gdb_string.h"
-
-int
-main (int argc, char **argv)
-{
- struct captured_main_args args;
- memset (&args, 0, sizeof args);
- args.argc = argc;
- args.argv = argv;
- args.use_windows = 1;
- args.interpreter_p = "insight";
- return gdb_main (&args);
-}
diff --git a/gdb/gdbtk/generic/gdbtk-register.c b/gdb/gdbtk/generic/gdbtk-register.c
deleted file mode 100644
index 257b57c1bd4..00000000000
--- a/gdb/gdbtk/generic/gdbtk-register.c
+++ /dev/null
@@ -1,585 +0,0 @@
-/* Tcl/Tk command definitions for Insight - Registers
- Copyright (C) 2001, 2002, 2004, 2007 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-#include "defs.h"
-#include "frame.h"
-#include "regcache.h"
-#include "reggroups.h"
-#include "value.h"
-#include "target.h"
-#include "gdb_string.h"
-#include "language.h"
-
-#include <tcl.h>
-#include "gdbtk.h"
-#include "gdbtk-cmds.h"
-
-/* Argument passed to our register-mapping functions */
-typedef union
-{
- int integer;
- void *ptr;
-} map_arg;
-
-/* Type of our mapping functions */
-typedef void (*map_func)(int, map_arg);
-
-/* This contains the previous values of the registers, since the last call to
- gdb_changed_register_list.
-
- It is an array of (NUM_REGS+NUM_PSEUDO_REGS)*MAX_REGISTER_RAW_SIZE bytes. */
-
-static int gdb_register_info (ClientData, Tcl_Interp *, int, Tcl_Obj **);
-static void get_register (int, map_arg);
-static void get_register_name (int, map_arg);
-static void get_register_size (int, map_arg);
-static int map_arg_registers (Tcl_Interp *, int, Tcl_Obj **,
- map_func, map_arg);
-static void register_changed_p (int, map_arg);
-static void setup_architecture_data (void);
-static int gdb_regformat (ClientData, Tcl_Interp *, int, Tcl_Obj **);
-static int gdb_reggroup (ClientData, Tcl_Interp *, int, Tcl_Obj **);
-static int gdb_reggrouplist (ClientData, Tcl_Interp *, int, Tcl_Obj **);
-
-static void get_register_types (int regnum, map_arg);
-
-static char *old_regs = NULL;
-static int *regformat = (int *)NULL;
-static struct type **regtype = (struct type **)NULL;
-
-int
-Gdbtk_Register_Init (Tcl_Interp *interp)
-{
- Tcl_CreateObjCommand (interp, "gdb_reginfo", gdbtk_call_wrapper,
- gdb_register_info, NULL);
- Tcl_CreateObjCommand (interp, "gdb_reg_arch_changed", gdbtk_call_wrapper,
- setup_architecture_data, NULL);
-
- /* Register/initialize any architecture specific data */
- setup_architecture_data ();
-
- return TCL_OK;
-}
-
-/* This implements the tcl command "gdb_reginfo".
- * It returns the requested information about registers.
- *
- * Tcl Arguments:
- * OPTION - "changed", "name", "size", "value" (see below)
- * REGNUM(S) - the register(s) for which info is requested
- *
- * Tcl Result:
- * The requested information
- *
- * Options:
- * changed
- * Returns a list of registers whose values have changed since the
- * last time the proc was called.
- *
- * usage: gdb_reginfo changed [regnum0, ..., regnumN]
- *
- * name
- * Return a list containing the names of the registers whose numbers
- * are given by REGNUM ... . If no register numbers are given, return
- * all the registers' names.
- *
- * usage: gdb_reginfo name [-numbers] [regnum0, ..., regnumN]
- *
- * Note that some processors have gaps in the register numberings:
- * even if there is no register numbered N, there may still be a
- * register numbered N+1. So if you call gdb_regnames with no
- * arguments, you can't assume that the N'th element of the result is
- * register number N.
- *
- * Given the -numbers option, gdb_regnames returns, not a list of names,
- * but a list of pairs {NAME NUMBER}, where NAME is the register name,
- * and NUMBER is its number.
- *
- * size
- * Returns the raw size of the register(s) in bytes.
- *
- * usage: gdb_reginfo size [regnum0, ..., regnumN]
- *
- * value
- * Returns a list of register values.
- *
- * usage: gdb_reginfo value [regnum0, ..., regnumN]
- */
-static int
-gdb_register_info (ClientData clientData, Tcl_Interp *interp, int objc,
- Tcl_Obj **objv)
-{
- int index;
- map_arg arg;
- map_func func;
- static const char *commands[] = {"changed", "name", "size", "value", "type",
- "format", "group", "grouplist", NULL};
- enum commands_enum { REGINFO_CHANGED, REGINFO_NAME, REGINFO_SIZE, REGINFO_VALUE,
- REGINFO_TYPE, REGINFO_FORMAT, REGINFO_GROUP, REGINFO_GROUPLIST };
-
- if (objc < 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "name|size|value|type|format|groups [regnum1 ... regnumN]");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIndexFromObj (interp, objv[1], commands, "options", 0,
- &index) != TCL_OK)
- {
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
-
- /* Skip the option */
- objc -= 2;
- objv += 2;
-
- switch ((enum commands_enum) index)
- {
- case REGINFO_CHANGED:
- func = register_changed_p;
- arg.ptr = NULL;
- break;
-
- case REGINFO_NAME:
- {
- int len;
- char *s = Tcl_GetStringFromObj (objv[0], &len);
- if (objc != 0 && strncmp (s, "-numbers", len) == 0)
- {
- arg.integer = 1;
- objc--;
- objv++;
- }
- else
- arg.ptr = NULL;
-
- func = get_register_name;
- }
- break;
-
- case REGINFO_SIZE:
- func = get_register_size;
- arg.ptr = NULL;
- break;
-
- case REGINFO_VALUE:
- func = get_register;
- arg.ptr = NULL;
- break;
-
- case REGINFO_TYPE:
- func = get_register_types;
- arg.ptr = NULL;
- break;
-
- case REGINFO_FORMAT:
- return gdb_regformat (clientData, interp, objc, objv);
-
- case REGINFO_GROUP:
- return gdb_reggroup (clientData, interp, objc, objv);
-
- case REGINFO_GROUPLIST:
- return gdb_reggrouplist (clientData, interp, objc, objv);
-
- default:
- return TCL_ERROR;
- }
-
- return map_arg_registers (interp, objc, objv, func, arg);
-}
-
-static void
-get_register_size (int regnum, map_arg arg)
-{
- Tcl_ListObjAppendElement (gdbtk_interp, result_ptr->obj_ptr,
- Tcl_NewIntObj (register_size (current_gdbarch, regnum)));
-}
-
-/* returns a list of valid types for a register */
-/* Normally this will be only one type, except for SIMD and other */
-/* special registers. */
-
-static void
-get_register_types (int regnum, map_arg arg)
-{
- struct type *reg_vtype;
- int i,n;
-
- reg_vtype = register_type (current_gdbarch, regnum);
-
- if (TYPE_CODE (reg_vtype) == TYPE_CODE_UNION)
- {
- n = TYPE_NFIELDS (reg_vtype);
- /* limit to 16 types */
- if (n > 16)
- n = 16;
-
- for (i = 0; i < n; i++)
- {
- Tcl_Obj *ar[3], *list;
- char *buff;
- xasprintf (&buff, "%lx", (long)TYPE_FIELD_TYPE (reg_vtype, i));
- ar[0] = Tcl_NewStringObj (TYPE_FIELD_NAME (reg_vtype, i), -1);
- ar[1] = Tcl_NewStringObj (buff, -1);
- if (TYPE_CODE (TYPE_FIELD_TYPE (reg_vtype, i)) == TYPE_CODE_FLT)
- ar[2] = Tcl_NewStringObj ("float", -1);
- else
- ar[2] = Tcl_NewStringObj ("int", -1);
- list = Tcl_NewListObj (3, ar);
- Tcl_ListObjAppendElement (gdbtk_interp, result_ptr->obj_ptr, list);
- xfree (buff);
- }
- }
- else
- {
- Tcl_Obj *ar[3], *list;
- char *buff;
- xasprintf (&buff, "%lx", (long)reg_vtype);
- ar[0] = Tcl_NewStringObj (TYPE_NAME(reg_vtype), -1);
- ar[1] = Tcl_NewStringObj (buff, -1);
- if (TYPE_CODE (reg_vtype) == TYPE_CODE_FLT)
- ar[2] = Tcl_NewStringObj ("float", -1);
- else
- ar[2] = Tcl_NewStringObj ("int", -1);
- list = Tcl_NewListObj (3, ar);
- xfree (buff);
- Tcl_ListObjAppendElement (gdbtk_interp, result_ptr->obj_ptr, list);
- }
-}
-
-
-static void
-get_register (int regnum, map_arg arg)
-{
- int realnum;
- CORE_ADDR addr;
- enum lval_type lval;
- struct type *reg_vtype;
- gdb_byte buffer[MAX_REGISTER_SIZE];
- int optim, format;
- struct cleanup *old_chain = NULL;
- struct ui_file *stb;
- long dummy;
- char *res;
-
- format = regformat[regnum];
- if (format == 0)
- format = 'x';
-
- reg_vtype = regtype[regnum];
- if (reg_vtype == NULL)
- reg_vtype = register_type (current_gdbarch, regnum);
-
- if (!target_has_registers)
- {
- if (result_ptr->flags & GDBTK_MAKES_LIST)
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewStringObj ("", -1));
- else
- Tcl_SetStringObj (result_ptr->obj_ptr, "", -1);
- return;
- }
-
- frame_register (get_selected_frame (NULL), regnum, &optim, &lval,
- &addr, &realnum, buffer);
-
- if (optim)
- {
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
- Tcl_NewStringObj ("Optimized out", -1));
- return;
- }
-
- stb = mem_fileopen ();
- old_chain = make_cleanup_ui_file_delete (stb);
-
- if (format == 'r')
- {
- /* shouldn't happen. raw format is deprecated */
- int j;
- char *ptr, buf[1024];
-
- strcpy (buf, "0x");
- ptr = buf + 2;
- for (j = 0; j < register_size (current_gdbarch, regnum); j++)
- {
- int idx = ((gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
- ? j : register_size (current_gdbarch, regnum) - 1 - j);
- sprintf (ptr, "%02x", (unsigned char) buffer[idx]);
- ptr += 2;
- }
- fputs_unfiltered (buf, stb);
- }
- else
- {
- if ((TYPE_CODE (reg_vtype) == TYPE_CODE_UNION)
- && (strcmp (FIELD_NAME (TYPE_FIELD (reg_vtype, 0)),
- gdbarch_register_name (current_gdbarch, regnum)) == 0))
- {
- val_print (FIELD_TYPE (TYPE_FIELD (reg_vtype, 0)), buffer, 0, 0,
- stb, format, 1, 0, Val_pretty_default, current_language);
- }
- else
- val_print (reg_vtype, buffer, 0, 0,
- stb, format, 1, 0, Val_pretty_default, current_language);
- }
-
- res = ui_file_xstrdup (stb, &dummy);
-
- if (result_ptr->flags & GDBTK_MAKES_LIST)
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewStringObj (res, -1));
- else
- Tcl_SetStringObj (result_ptr->obj_ptr, res, -1);
-
- xfree (res);
- do_cleanups (old_chain);
-}
-
-static void
-get_register_name (int regnum, map_arg arg)
-{
- /* Non-zero if the caller wants the register numbers, too. */
- int numbers = arg.integer;
- Tcl_Obj *name
- = Tcl_NewStringObj (gdbarch_register_name (current_gdbarch, regnum), -1);
- Tcl_Obj *elt;
-
- if (numbers)
- {
- /* Build a tuple of the form "{REGNAME NUMBER}", and append it to
- our result. */
- Tcl_Obj *array[2];
-
- array[0] = name;
- array[1] = Tcl_NewIntObj (regnum);
- elt = Tcl_NewListObj (2, array);
- }
- else
- elt = name;
-
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, elt);
-}
-
-/* This is a sort of mapcar function for operations on registers */
-
-static int
-map_arg_registers (Tcl_Interp *interp, int objc, Tcl_Obj **objv,
- map_func func, map_arg arg)
-{
- int regnum, numregs;
-
- /* Note that the test for a valid register must include checking the
- gdbarch_register_name because gdbarch_num_regs may be allocated for
- the union of the register sets within a family of related processors.
- In this case, some entries of gdbarch_register_name will change
- depending upon the particular processor being debugged. */
-
- numregs = (gdbarch_num_regs (current_gdbarch)
- + gdbarch_num_pseudo_regs (current_gdbarch));
-
- if (objc == 0) /* No args, just do all the regs */
- {
- result_ptr->flags |= GDBTK_MAKES_LIST;
- for (regnum = 0; regnum < numregs; regnum++)
- {
- if (gdbarch_register_name (current_gdbarch, regnum) == NULL
- || *(gdbarch_register_name (current_gdbarch, regnum)) == '\0')
- continue;
- func (regnum, arg);
- }
- return TCL_OK;
- }
-
- if (objc == 1)
- if (Tcl_ListObjGetElements (interp, *objv, &objc, &objv ) != TCL_OK)
- return TCL_ERROR;
-
- if (objc > 1)
- result_ptr->flags |= GDBTK_MAKES_LIST;
-
- /* Else, list of register #s, just do listed regs */
- for (; objc > 0; objc--, objv++)
- {
- if (Tcl_GetIntFromObj (NULL, *objv, &regnum) != TCL_OK)
- {
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
-
- if (regnum >= 0 && regnum < numregs)
- func (regnum, arg);
- else
- {
- Tcl_SetStringObj (result_ptr->obj_ptr, "bad register number", -1);
- return TCL_ERROR;
- }
- }
- return TCL_OK;
-}
-
-static void
-register_changed_p (int regnum, map_arg arg)
-{
- char raw_buffer[MAX_REGISTER_SIZE];
-
- if (!target_has_registers
- || !frame_register_read (get_selected_frame (NULL), regnum, raw_buffer))
- return;
-
- if (memcmp (&old_regs[regnum * MAX_REGISTER_SIZE], raw_buffer,
- register_size (current_gdbarch, regnum)) == 0)
- return;
-
- /* Found a changed register. Save new value and return its number. */
-
- memcpy (&old_regs[regnum * MAX_REGISTER_SIZE], raw_buffer,
- register_size (current_gdbarch, regnum));
-
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewIntObj (regnum));
-}
-
-static void
-setup_architecture_data ()
-{
- int numregs;
-
- xfree (old_regs);
- xfree (regformat);
- xfree (regtype);
-
- numregs = (gdbarch_num_regs (current_gdbarch)
- + gdbarch_num_pseudo_regs (current_gdbarch));
- old_regs = xcalloc (1, numregs * MAX_REGISTER_SIZE + 1);
- regformat = (int *)xcalloc (numregs, sizeof(int));
- regtype = (struct type **)xcalloc (numregs, sizeof(struct type **));
-}
-
-/* gdb_regformat sets the format for a register */
-/* This is necessary to allow "gdb_reginfo value" to return a list */
-/* of registers and values. */
-/* Usage: gdb_reginfo format regno typeaddr format */
-
-static int
-gdb_regformat (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj **objv)
-{
- int fm, regno, numregs;
- struct type *type;
-
- if (objc != 3)
- {
- Tcl_WrongNumArgs (interp, 0, objv, "gdb_reginfo regno type format");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIntFromObj (interp, objv[0], &regno) != TCL_OK)
- return TCL_ERROR;
-
- type = (struct type *)strtol (Tcl_GetStringFromObj (objv[1], NULL), NULL, 16);
- fm = (int)*(Tcl_GetStringFromObj (objv[2], NULL));
-
- numregs = (gdbarch_num_regs (current_gdbarch)
- + gdbarch_num_pseudo_regs (current_gdbarch));
- if (regno >= numregs)
- {
- gdbtk_set_result (interp, "Register number %d too large", regno);
- return TCL_ERROR;
- }
-
- regformat[regno] = fm;
- regtype[regno] = type;
-
- return TCL_OK;
-}
-
-
-/* gdb_reggrouplist returns the names of the register groups */
-/* for the current architecture. */
-/* Usage: gdb_reginfo groups */
-
-static int
-gdb_reggrouplist (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj **objv)
-{
- struct reggroup *group;
- int i = 0;
-
- if (objc != 0)
- {
- Tcl_WrongNumArgs (interp, 0, objv, "gdb_reginfo grouplist");
- return TCL_ERROR;
- }
-
- for (group = reggroup_next (current_gdbarch, NULL);
- group != NULL;
- group = reggroup_next (current_gdbarch, group))
- {
- if (reggroup_type (group) == USER_REGGROUP)
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewStringObj (reggroup_name (group), -1));
- }
- return TCL_OK;
-}
-
-
-/* gdb_reggroup returns the names of the registers in a group. */
-/* Usage: gdb_reginfo group groupname */
-
-static int
-gdb_reggroup (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj **objv)
-{
- struct reggroup *group;
- char *groupname;
- int regnum, num;
-
- if (objc != 1)
- {
- Tcl_WrongNumArgs (interp, 0, objv, "gdb_reginfo group groupname");
- return TCL_ERROR;
- }
-
- groupname = Tcl_GetStringFromObj (objv[0], NULL);
- if (groupname == NULL)
- {
- gdbtk_set_result (interp, "could not read groupname");
- return TCL_ERROR;
- }
-
- for (group = reggroup_next (current_gdbarch, NULL);
- group != NULL;
- group = reggroup_next (current_gdbarch, group))
- {
- if (strcmp (groupname, reggroup_name (group)) == 0)
- break;
- }
-
- if (group == NULL)
- return TCL_ERROR;
-
- num = (gdbarch_num_regs (current_gdbarch)
- + gdbarch_num_pseudo_regs (current_gdbarch));
- for (regnum = 0; regnum < num; regnum++)
- {
- if (gdbarch_register_reggroup_p (current_gdbarch, regnum, group))
- Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewIntObj (regnum));
- }
- return TCL_OK;
-}
-
diff --git a/gdb/gdbtk/generic/gdbtk-stack.c b/gdb/gdbtk/generic/gdbtk-stack.c
deleted file mode 100644
index b41c9d74f59..00000000000
--- a/gdb/gdbtk/generic/gdbtk-stack.c
+++ /dev/null
@@ -1,601 +0,0 @@
-/* Tcl/Tk command definitions for Insight - Stack.
- Copyright (C) 2001, 2002, 2003, 2008 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-#include "defs.h"
-#include "target.h"
-#include "breakpoint.h"
-#include "linespec.h"
-#include "block.h"
-#include "dictionary.h"
-#include "varobj.h"
-
-#include <tcl.h>
-#include "gdbtk.h"
-#include "gdbtk-cmds.h"
-#include "gdbtk-wrapper.h"
-
-static int gdb_block_vars (ClientData clientData,
- Tcl_Interp * interp, int objc,
- Tcl_Obj * CONST objv[]);
-static int gdb_get_args_command (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_get_blocks (ClientData clientData,
- Tcl_Interp * interp, int objc,
- Tcl_Obj * CONST objv[]);
-static int gdb_get_locals_command (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_get_vars_command (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST objv[]);
-static int gdb_selected_block (ClientData clientData,
- Tcl_Interp * interp, int argc,
- Tcl_Obj * CONST objv[]);
-static int gdb_selected_frame (ClientData clientData,
- Tcl_Interp * interp, int argc,
- Tcl_Obj * CONST objv[]);
-static int gdb_stack (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
-static void get_frame_name (Tcl_Interp *interp, Tcl_Obj *list,
- struct frame_info *fi);
-
-int
-Gdbtk_Stack_Init (Tcl_Interp *interp)
-{
- Tcl_CreateObjCommand (interp, "gdb_block_variables", gdbtk_call_wrapper,
- gdb_block_vars, NULL);
- Tcl_CreateObjCommand (interp, "gdb_get_blocks", gdbtk_call_wrapper,
- gdb_get_blocks, NULL);
- Tcl_CreateObjCommand (interp, "gdb_get_args", gdbtk_call_wrapper,
- gdb_get_args_command, NULL);
- Tcl_CreateObjCommand (interp, "gdb_get_locals", gdbtk_call_wrapper,
- gdb_get_locals_command, NULL);
- Tcl_CreateObjCommand (interp, "gdb_selected_block", gdbtk_call_wrapper,
- gdb_selected_block, NULL);
- Tcl_CreateObjCommand (interp, "gdb_selected_frame", gdbtk_call_wrapper,
- gdb_selected_frame, NULL);
- Tcl_CreateObjCommand (interp, "gdb_stack", gdbtk_call_wrapper, gdb_stack, NULL);
-
- return TCL_OK;
-}
-
-/* This implements the tcl command gdb_block_vars.
- *
- * Returns all variables valid in the specified block.
- *
- * Arguments:
- * The start and end addresses which identify the block.
- * Tcl Result:
- * All variables defined in the given block.
- */
-static int
-gdb_block_vars (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct block *block;
- struct dict_iterator iter;
- struct symbol *sym;
- CORE_ADDR start, end;
-
- if (objc < 3)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "startAddr endAddr");
- return TCL_ERROR;
- }
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
- if (!target_has_registers)
- return TCL_OK;
-
- start = string_to_core_addr (Tcl_GetStringFromObj (objv[1], NULL));
- end = string_to_core_addr (Tcl_GetStringFromObj (objv[2], NULL));
-
- block = get_frame_block (get_selected_frame (NULL), 0);
-
- while (block != 0)
- {
- if (BLOCK_START (block) == start && BLOCK_END (block) == end)
- {
- ALL_BLOCK_SYMBOLS (block, iter, sym)
- {
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_ARG: /* argument */
- case LOC_REF_ARG: /* reference arg */
- case LOC_REGPARM_ADDR: /* indirect register arg */
- case LOC_LOCAL: /* stack local */
- case LOC_STATIC: /* static */
- case LOC_REGISTER: /* register */
- case LOC_COMPUTED: /* computed location */
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewStringObj (DEPRECATED_SYMBOL_NAME (sym),
- -1));
- break;
-
- default:
- break;
- }
- }
-
- return TCL_OK;
- }
- else if (BLOCK_FUNCTION (block))
- break;
- else
- block = BLOCK_SUPERBLOCK (block);
- }
-
- return TCL_OK;
-}
-
-/* This implements the tcl command gdb_get_blocks
- *
- * Returns the start and end addresses for all blocks in
- * the selected frame.
- *
- * Arguments:
- * None
- * Tcl Result:
- * A list of all valid blocks in the selected_frame.
- */
-static int
-gdb_get_blocks (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct block *block;
- struct dict_iterator iter;
- int junk;
- struct symbol *sym;
- CORE_ADDR pc;
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
-
- if (target_has_registers)
- {
- struct frame_info *frame = get_selected_frame (NULL);
-
- block = get_frame_block (frame, 0);
- pc = get_frame_pc (frame);
- while (block != 0)
- {
- junk = 0;
- ALL_BLOCK_SYMBOLS (block, iter, sym)
- {
- switch (SYMBOL_CLASS (sym))
- {
- default:
- case LOC_UNDEF: /* catches errors */
- case LOC_CONST: /* constant */
- case LOC_TYPEDEF: /* local typedef */
- case LOC_LABEL: /* local label */
- case LOC_BLOCK: /* local function */
- case LOC_CONST_BYTES: /* loc. byte seq. */
- case LOC_UNRESOLVED: /* unresolved static */
- case LOC_OPTIMIZED_OUT: /* optimized out */
- junk = 1;
- break;
-
- case LOC_ARG: /* argument */
- case LOC_REF_ARG: /* reference arg */
- case LOC_REGPARM_ADDR: /* indirect register arg */
-
- case LOC_LOCAL: /* stack local */
- case LOC_STATIC: /* static */
- case LOC_REGISTER: /* register */
- case LOC_COMPUTED: /* computed location */
- junk = 0;
- break;
- }
- }
-
- /* If we found a block with locals in it, add it to the list.
- Note that the ranges of start and end address for blocks
- are exclusive, so double-check against the PC */
-
- if (!junk && pc < BLOCK_END (block))
- {
- char *addr;
-
- Tcl_Obj *elt = Tcl_NewListObj (0, NULL);
- xasprintf (&addr, "0x%s", paddr_nz (BLOCK_START (block)));
- Tcl_ListObjAppendElement (interp, elt,
- Tcl_NewStringObj (addr, -1));
- free(addr);
- xasprintf (&addr, "0x%s", paddr_nz (BLOCK_END (block)));
- Tcl_ListObjAppendElement (interp, elt,
- Tcl_NewStringObj (addr, -1));
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, elt);
- free(addr);
- }
-
- if (BLOCK_FUNCTION (block))
- break;
- else
- block = BLOCK_SUPERBLOCK (block);
- }
- }
-
- return TCL_OK;
-}
-
-/* gdb_get_args -
- * This and gdb_get_locals just call gdb_get_vars_command with the right
- * value of clientData. We can't use the client data in the definition
- * of the command, because the call wrapper uses this instead...
- */
-static int
-gdb_get_args_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- return gdb_get_vars_command ((ClientData) 1, interp, objc, objv);
-}
-
-
-static int
-gdb_get_locals_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- return gdb_get_vars_command ((ClientData) 0, interp, objc, objv);
-}
-
-/* This implements the tcl commands "gdb_get_locals" and "gdb_get_args"
-
-* This function sets the Tcl interpreter's result to a list of variable names
-* depending on clientData. If clientData is one, the result is a list of
-* arguments; zero returns a list of locals -- all relative to the block
-* specified as an argument to the command. Valid commands include
-* anything decode_line_1 can handle (like "main.c:2", "*0x02020202",
-* and "main").
-*
-* Tcl Arguments:
-* linespec - the linespec defining the scope of the lookup. Empty string
-* to use the current block in the innermost frame.
-* Tcl Result:
-* A list of the locals or args
-*/
-static int
-gdb_get_vars_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- struct symtabs_and_lines sals;
- struct symbol *sym;
- struct block *block;
- char **canonical, *args;
- struct dict_iterator iter;
- int i, arguments;
-
- if (objc > 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv,
- "[function:line|function|line|*addr]");
- return TCL_ERROR;
- }
-
- arguments = *(int*) &clientData;
-
- /* Initialize the result pointer to an empty list. */
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
-
- if (objc == 2)
- {
- args = Tcl_GetStringFromObj (objv[1], NULL);
- sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL);
- if (sals.nelts == 0)
- {
- gdbtk_set_result (interp, "error decoding line");
- return TCL_ERROR;
- }
-
- /* Resolve all line numbers to PC's */
- for (i = 0; i < sals.nelts; i++)
- resolve_sal_pc (&sals.sals[i]);
-
- block = block_for_pc (sals.sals[0].pc);
- }
- else
- {
- /* Specified currently selected frame */
- if (!target_has_registers)
- return TCL_OK;
-
- block = get_frame_block (get_selected_frame (NULL), 0);
- }
-
- while (block != 0)
- {
- ALL_BLOCK_SYMBOLS (block, iter, sym)
- {
- switch (SYMBOL_CLASS (sym))
- {
- default:
- case LOC_UNDEF: /* catches errors */
- case LOC_CONST: /* constant */
- case LOC_TYPEDEF: /* local typedef */
- case LOC_LABEL: /* local label */
- case LOC_BLOCK: /* local function */
- case LOC_CONST_BYTES: /* loc. byte seq. */
- case LOC_UNRESOLVED: /* unresolved static */
- case LOC_OPTIMIZED_OUT: /* optimized out */
- break;
- case LOC_ARG: /* argument */
- case LOC_REF_ARG: /* reference arg */
- case LOC_REGPARM_ADDR: /* indirect register arg */
- if (arguments)
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewStringObj (DEPRECATED_SYMBOL_NAME (sym), -1));
- break;
- case LOC_LOCAL: /* stack local */
- case LOC_STATIC: /* static */
- case LOC_REGISTER: /* register */
- case LOC_COMPUTED: /* computed location */
- if (!arguments)
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewStringObj (DEPRECATED_SYMBOL_NAME (sym), -1));
- break;
- }
- }
- if (BLOCK_FUNCTION (block))
- break;
- else
- block = BLOCK_SUPERBLOCK (block);
- }
-
- return TCL_OK;
-}
-
-/* This implements the tcl command gdb_selected_block
- *
- * Returns the start and end addresses of the innermost
- * block in the selected frame.
- *
- * Arguments:
- * None
- * Tcl Result:
- * The currently selected block's start and end addresses
- */
-static int
-gdb_selected_block (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- char *start = NULL;
- char *end = NULL;
-
- if (!target_has_registers)
- {
- xasprintf (&start, "%s", "");
- xasprintf (&end, "%s", "");
- }
- else
- {
- struct block *block;
- block = get_frame_block (get_selected_frame (NULL), 0);
- xasprintf (&start, "0x%s", paddr_nz (BLOCK_START (block)));
- xasprintf (&end, "0x%s", paddr_nz (BLOCK_END (block)));
- }
-
- Tcl_SetListObj (result_ptr->obj_ptr, 0, NULL);
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewStringObj (start, -1));
- Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
- Tcl_NewStringObj (end, -1));
-
- free(start);
- free(end);
- return TCL_OK;
-}
-
-/* This implements the tcl command gdb_selected_frame
-
-* Returns the address of the selected frame
-* frame.
-*
-* Arguments:
-* None
-* Tcl Result:
-* The currently selected frame's address
-*/
-static int
-gdb_selected_frame (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- char *frame;
-
- if (!target_has_registers)
- xasprintf (&frame, "%s","");
- else
- /* FIXME: cagney/2002-11-19: This should be using get_frame_id()
- to identify the frame and *NOT* get_frame_base(). */
- xasprintf (&frame, "0x%s",
- paddr_nz (get_frame_base (get_selected_frame (NULL))));
-
- Tcl_SetStringObj (result_ptr->obj_ptr, frame, -1);
-
- free(frame);
- return TCL_OK;
-}
-
-/* This implements the tcl command gdb_stack.
- * It builds up a list of stack frames.
- *
- * Tcl Arguments:
- * start - starting stack frame
- * count - number of frames to inspect
- * Tcl Result:
- * A list of function names
- */
-static int
-gdb_stack (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- int start, count;
-
- if (objc < 3)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "start count");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIntFromObj (NULL, objv[1], &start))
- {
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
- if (Tcl_GetIntFromObj (NULL, objv[2], &count))
- {
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
-
- if (target_has_stack)
- {
- gdb_result r;
- struct frame_info *top;
- struct frame_info *fi;
-
- /* Find the outermost frame */
- r = GDB_get_current_frame (&fi);
- if (r != GDB_OK)
- return TCL_ERROR;
-
- while (fi != NULL)
- {
- top = fi;
- r = GDB_get_prev_frame (fi, &fi);
- if (r != GDB_OK)
- fi = NULL;
- }
-
- /* top now points to the top (outermost frame) of the
- stack, so point it to the requested start */
- start = -start;
- r = GDB_find_relative_frame (top, &start, &top);
-
- result_ptr->obj_ptr = Tcl_NewListObj (0, NULL);
- if (r != GDB_OK)
- return TCL_OK;
-
- /* If start != 0, then we have asked to start outputting
- frames beyond the innermost stack frame */
- if (start == 0)
- {
- fi = top;
- while (fi && count--)
- {
- get_frame_name (interp, result_ptr->obj_ptr, fi);
- r = GDB_get_next_frame (fi, &fi);
- if (r != GDB_OK)
- break;
- }
- }
- }
-
- return TCL_OK;
-}
-
-/* A helper function for get_stack which adds information about
- * the stack frame FI to the caller's LIST.
- *
- * This is stolen from print_frame_info in stack.c.
- */
-static void
-get_frame_name (Tcl_Interp *interp, Tcl_Obj *list, struct frame_info *fi)
-{
- struct symtab_and_line sal;
- struct symbol *func = NULL;
- register char *funname = 0;
- enum language funlang = language_unknown;
- Tcl_Obj *objv[1];
-
- if (get_frame_type (fi) == DUMMY_FRAME)
- {
- objv[0] = Tcl_NewStringObj ("<function called from gdb>", -1);
- Tcl_ListObjAppendElement (interp, list, objv[0]);
- return;
- }
- if ((get_frame_type (fi) == SIGTRAMP_FRAME))
- {
- objv[0] = Tcl_NewStringObj ("<signal handler called>", -1);
- Tcl_ListObjAppendElement (interp, list, objv[0]);
- return;
- }
-
- sal =
- find_pc_line (get_frame_pc (fi),
- get_next_frame (fi) != NULL
- && !(get_frame_type (fi) == SIGTRAMP_FRAME)
- && !(get_frame_type (fi) == DUMMY_FRAME));
-
- func = find_pc_function (get_frame_pc (fi));
- if (func)
- {
- struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (fi));
- if (msymbol != NULL
- && (SYMBOL_VALUE_ADDRESS (msymbol)
- > BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
- {
- func = 0;
- funname = GDBTK_SYMBOL_SOURCE_NAME (msymbol);
- funlang = SYMBOL_LANGUAGE (msymbol);
- }
- else
- {
- funname = GDBTK_SYMBOL_SOURCE_NAME (func);
- funlang = SYMBOL_LANGUAGE (func);
- }
- }
- else
- {
- struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (fi));
- if (msymbol != NULL)
- {
- funname = GDBTK_SYMBOL_SOURCE_NAME (msymbol);
- funlang = SYMBOL_LANGUAGE (msymbol);
- }
- }
-
- if (sal.symtab)
- {
- objv[0] = Tcl_NewStringObj (funname, -1);
- Tcl_ListObjAppendElement (interp, list, objv[0]);
- }
- else
- {
-#if 0
- /* we have no convenient way to deal with this yet... */
- if (fi->pc != sal.pc || !sal.symtab)
- {
- deprecated_print_address_numeric (fi->pc, 1, gdb_stdout);
- printf_filtered (" in ");
- }
- printf_symbol_filtered (gdb_stdout, funname ? funname : "??", funlang,
- DMGL_ANSI);
-#endif
- objv[0] = Tcl_NewStringObj (funname != NULL ? funname : "??", -1);
-#ifdef PC_SOLIB
- if (!funname)
- {
- char *lib = PC_SOLIB (get_frame_pc (fi));
- if (lib)
- {
- Tcl_AppendStringsToObj (objv[0], " from ", lib, (char *) NULL);
- }
- }
-#endif
- Tcl_ListObjAppendElement (interp, list, objv[0]);
- }
-}
diff --git a/gdb/gdbtk/generic/gdbtk-varobj.c b/gdb/gdbtk/generic/gdbtk-varobj.c
deleted file mode 100644
index a527cd4b765..00000000000
--- a/gdb/gdbtk/generic/gdbtk-varobj.c
+++ /dev/null
@@ -1,619 +0,0 @@
-/* Variable user interface layer for GDB, the GNU debugger.
- Copyright (C) 1999, 2000, 2001, 2002, 2008 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-#include "defs.h"
-#include "value.h"
-#include "gdb_string.h"
-#include "varobj.h"
-
-#include <tcl.h>
-#include "gdbtk.h"
-#include "gdbtk-cmds.h"
-#include "gdbtk-wrapper.h"
-
-/*
- * Public functions defined in this file
- */
-
-int gdb_variable_init (Tcl_Interp *);
-
-/*
- * Private functions defined in this file
- */
-
-/* Entries into this file */
-
-static int gdb_variable_command (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST[]);
-
-static int variable_obj_command (ClientData, Tcl_Interp *, int,
- Tcl_Obj * CONST[]);
-
-/* Variable object subcommands */
-
-static int variable_create (Tcl_Interp *, int, Tcl_Obj * CONST[]);
-
-static void variable_delete (Tcl_Interp *, struct varobj *, int);
-
-static Tcl_Obj *variable_children (Tcl_Interp *, struct varobj *);
-
-static int variable_format (Tcl_Interp *, int, Tcl_Obj * CONST[],
- struct varobj *);
-
-static int variable_type (Tcl_Interp *, int, Tcl_Obj * CONST[],
- struct varobj *);
-
-static int variable_value (Tcl_Interp *, int, Tcl_Obj * CONST[],
- struct varobj *);
-
-static Tcl_Obj *variable_update (Tcl_Interp * interp, struct varobj **var);
-
-/* Helper functions for the above subcommands. */
-
-static void install_variable (Tcl_Interp *, char *);
-
-static void uninstall_variable (Tcl_Interp *, char *);
-
-/* String representations of gdb's format codes */
-static char *format_string[] =
- {"natural", "binary", "decimal", "hexadecimal", "octal"};
-
-
-/* Initialize the variable code. This function should be called once
- to install and initialize the variable code into the interpreter. */
-int
-gdb_variable_init (Tcl_Interp *interp)
-{
- Tcl_Command result;
- static int initialized = 0;
-
- if (!initialized)
- {
- result = Tcl_CreateObjCommand (interp, "gdb_variable", gdbtk_call_wrapper,
- (ClientData) gdb_variable_command, NULL);
- if (result == NULL)
- return TCL_ERROR;
-
- initialized = 1;
- }
-
- return TCL_OK;
-}
-
-/* This function defines the "gdb_variable" command which is used to
- create variable objects. Its syntax includes:
-
- gdb_variable create
- gdb_variable create NAME
- gdb_variable create -expr EXPR
- gdb_variable create -frame FRAME
- (it will also include permutations of the above options)
-
- NAME = name of object to create. If no NAME, then automatically create
- a name
- EXPR = the gdb expression for which to create a variable. This will
- be the most common usage.
- FRAME = the frame defining the scope of the variable.
-*/
-static int
-gdb_variable_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- static const char *commands[] =
- {"create", "list", NULL};
- enum commands_enum
- {
- VARIABLE_CREATE, VARIABLE_LIST
- };
- int index, result;
-
- if (objc < 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "option ?arg...?");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIndexFromObj (interp, objv[1], commands, "options", 0,
- &index) != TCL_OK)
- {
- return TCL_ERROR;
- }
-
- switch ((enum commands_enum) index)
- {
- case VARIABLE_CREATE:
- result = variable_create (interp, objc - 2, objv + 2);
- break;
-
- default:
- return TCL_ERROR;
- }
-
- return result;
-}
-
-/* This function implements the actual object command for each
- variable object that is created (and each of its children).
-
- Currently the following commands are implemented:
- - delete delete this object and its children
- - update update the variable and its children (root vars only)
- - numChildren how many children does this object have
- - children create the children and return a list of their objects
- - name print out the name of this variable
- - format query/set the display format of this variable
- - type get the type of this variable
- - value get/set the value of this variable
- - editable is this variable editable?
-*/
-static int
-variable_obj_command (ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- enum commands_enum
- {
- VARIABLE_DELETE,
- VARIABLE_NUM_CHILDREN,
- VARIABLE_CHILDREN,
- VARIABLE_FORMAT,
- VARIABLE_TYPE,
- VARIABLE_VALUE,
- VARIABLE_NAME,
- VARIABLE_EDITABLE,
- VARIABLE_UPDATE
- };
- static const char *commands[] =
- {
- "delete",
- "numChildren",
- "children",
- "format",
- "type",
- "value",
- "name",
- "editable",
- "update",
- NULL
- };
- struct varobj *var;
- char *varobj_name;
- int index, result;
-
- /* Get the current handle for this variable token (name). */
- varobj_name = Tcl_GetStringFromObj (objv[0], NULL);
- if (varobj_name == NULL)
- return TCL_ERROR;
- var = varobj_get_handle (varobj_name);
-
-
- if (objc < 2)
- {
- Tcl_WrongNumArgs (interp, 1, objv, "option ?arg...?");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIndexFromObj (interp, objv[1], commands, "options", 0,
- &index) != TCL_OK)
- return TCL_ERROR;
-
- result = TCL_OK;
- switch ((enum commands_enum) index)
- {
- case VARIABLE_DELETE:
- if (objc > 2)
- {
- int len;
- char *s = Tcl_GetStringFromObj (objv[2], &len);
- if (*s == 'c' && strncmp (s, "children", len) == 0)
- {
- variable_delete (interp, var, 1 /* only children */ );
- break;
- }
- }
- variable_delete (interp, var, 0 /* var and children */ );
- break;
-
- case VARIABLE_NUM_CHILDREN:
- Tcl_SetObjResult (interp, Tcl_NewIntObj (varobj_get_num_children (var)));
- break;
-
- case VARIABLE_CHILDREN:
- {
- Tcl_Obj *children = variable_children (interp, var);
- Tcl_SetObjResult (interp, children);
- }
- break;
-
- case VARIABLE_FORMAT:
- result = variable_format (interp, objc, objv, var);
- break;
-
- case VARIABLE_TYPE:
- result = variable_type (interp, objc, objv, var);
- break;
-
- case VARIABLE_VALUE:
- result = variable_value (interp, objc, objv, var);
- break;
-
- case VARIABLE_NAME:
- {
- char *name = varobj_get_expression (var);
- Tcl_SetObjResult (interp, Tcl_NewStringObj (name, -1));
- xfree (name);
- }
- break;
-
- case VARIABLE_EDITABLE:
- Tcl_SetObjResult (interp,
- Tcl_NewIntObj (varobj_get_attributes (var) & 0x00000001 /* Editable? */ ));
- break;
-
- case VARIABLE_UPDATE:
- /* Only root variables can be updated */
- {
- Tcl_Obj *obj = variable_update (interp, &var);
- Tcl_SetObjResult (interp, obj);
- }
- break;
-
- default:
- return TCL_ERROR;
- }
-
- return result;
-}
-
-/*
- * Variable object construction/destruction
- */
-
-/* This function is responsible for processing the user's specifications
- and constructing a variable object. */
-static int
-variable_create (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
-{
- enum create_opts
- {
- CREATE_EXPR, CREATE_FRAME
- };
- static const char *create_options[] =
- {"-expr", "-frame", NULL};
- struct varobj *var;
- char *name;
- char *obj_name;
- int index;
- CORE_ADDR frame = (CORE_ADDR) -1;
- int how_specified = USE_SELECTED_FRAME;
-
- /* REMINDER: This command may be invoked in the following ways:
- gdb_variable create [NAME] [-expr EXPR] [-frame FRAME]
-
- NAME = name of object to create. If no NAME, then automatically create
- a name
- EXPR = the gdb expression for which to create a variable. This will
- be the most common usage.
- FRAME = the address of the frame defining the variable's scope
- */
- name = NULL;
- if (objc)
- name = Tcl_GetStringFromObj (objv[0], NULL);
- if (name == NULL || *name == '-')
- {
- /* generate a name for this object */
- obj_name = varobj_gen_name ();
- }
- else
- {
- /* specified name for object */
- obj_name = strdup (name);
- objv++;
- objc--;
- }
-
- /* Run through all the possible options for this command */
- name = NULL;
- while (objc > 0)
- {
- if (Tcl_GetIndexFromObj (interp, objv[0], create_options, "options",
- 0, &index) != TCL_OK)
- {
- xfree (obj_name);
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
- return TCL_ERROR;
- }
-
- switch ((enum create_opts) index)
- {
- case CREATE_EXPR:
- name = Tcl_GetStringFromObj (objv[1], NULL);
- objc--;
- objv++;
- break;
-
- case CREATE_FRAME:
- {
- char *str;
- str = Tcl_GetStringFromObj (objv[1], NULL);
- frame = string_to_core_addr (str);
- how_specified = USE_SPECIFIED_FRAME;
- objc--;
- objv++;
- }
- break;
-
- default:
- break;
- }
-
- objc--;
- objv++;
- }
-
- /* Create the variable */
- var = varobj_create (obj_name, name, frame, how_specified);
-
- if (var != NULL)
- {
- /* Install a command into the interpreter that represents this
- object */
- install_variable (interp, obj_name);
- Tcl_SetObjResult (interp, Tcl_NewStringObj (obj_name, -1));
- result_ptr->flags |= GDBTK_IN_TCL_RESULT;
-
- xfree (obj_name);
- return TCL_OK;
- }
-
- xfree (obj_name);
- return TCL_ERROR;
-}
-
-/* Delete the variable object VAR and its children */
-/* If only_children_p, Delete only the children associated with the object. */
-static void
-variable_delete (Tcl_Interp *interp, struct varobj *var,
- int only_children_p)
-{
- char **dellist;
- char **vc;
-
- varobj_delete (var, &dellist, only_children_p);
-
- vc = dellist;
- while (*vc != NULL)
- {
- uninstall_variable (interp, *vc);
- xfree (*vc);
- vc++;
- }
-
- xfree (dellist);
-}
-
-/* Return a list of all the children of VAR, creating them if necessary. */
-static Tcl_Obj *
-variable_children (Tcl_Interp *interp, struct varobj *var)
-{
- Tcl_Obj *list;
- VEC(varobj_p) *children;
- struct varobj *child;
- char *childname;
- int ix;
-
- list = Tcl_NewListObj (0, NULL);
-
- children = varobj_list_children (var);
-
- for (ix = 0; VEC_iterate (varobj_p, children, ix, child); ++ix)
- {
- childname = varobj_get_objname (child);
- /* Add child to result list and install the Tcl command for it. */
- Tcl_ListObjAppendElement (NULL, list,
- Tcl_NewStringObj (childname, -1));
- install_variable (interp, childname);
- }
-
- return list;
-}
-
-/* Update the values for a variable and its children. */
-/* NOTE: Only root variables can be updated... */
-
-static Tcl_Obj *
-variable_update (Tcl_Interp *interp, struct varobj **var)
-{
- int i;
- Tcl_Obj *changed;
- VEC (varobj_update_result) *changes;
- varobj_update_result *r;
-
- if (GDB_varobj_update (var, 1, &changes) != GDB_OK)
- return Tcl_NewStringObj ("-1", -1);
-
- changed = Tcl_NewListObj (0, NULL);
- for (i = 0; VEC_iterate (varobj_update_result, changes, i, r); ++i)
- {
- switch (r->status)
- {
- case VAROBJ_IN_SCOPE:
- {
- Tcl_Obj *var
- = Tcl_NewStringObj (varobj_get_objname (r->varobj), -1);
- Tcl_ListObjAppendElement (NULL, changed, var);
- }
- break;
-
- case VAROBJ_NOT_IN_SCOPE:
- case VAROBJ_INVALID:
- /* These need to be (re-)implemented in the UI */
- break;
- }
- }
-
- return changed;
-}
-
-/* This implements the format object command allowing
- the querying or setting of the object's display format. */
-static int
-variable_format (Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[], struct varobj *var)
-{
- if (objc > 2)
- {
- /* Set the format of VAR to given format */
- int len;
- char *fmt = Tcl_GetStringFromObj (objv[2], &len);
- if (strncmp (fmt, "natural", len) == 0)
- varobj_set_display_format (var, FORMAT_NATURAL);
- else if (strncmp (fmt, "binary", len) == 0)
- varobj_set_display_format (var, FORMAT_BINARY);
- else if (strncmp (fmt, "decimal", len) == 0)
- varobj_set_display_format (var, FORMAT_DECIMAL);
- else if (strncmp (fmt, "hexadecimal", len) == 0)
- varobj_set_display_format (var, FORMAT_HEXADECIMAL);
- else if (strncmp (fmt, "octal", len) == 0)
- varobj_set_display_format (var, FORMAT_OCTAL);
- else
- {
- gdbtk_set_result (interp, "unknown display format \"",
- fmt, "\": must be: \"natural\", \"binary\""
- ", \"decimal\", \"hexadecimal\", or \"octal\"");
- return TCL_ERROR;
- }
- }
- else
- {
- /* Report the current format */
- Tcl_Obj *fmt;
-
- /* FIXME: Use varobj_format_string[] instead */
- fmt = Tcl_NewStringObj (
- format_string[(int) varobj_get_display_format (var)], -1);
- Tcl_SetObjResult (interp, fmt);
- }
-
- return TCL_OK;
-}
-
-/* This function implements the type object command, which returns the type of a
- variable in the interpreter (or an error). */
-static int
-variable_type (Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[], struct varobj *var)
-{
- const char *first;
- const char *last;
- char *string;
- Tcl_RegExp regexp;
-
- /* For the "fake" variables, do not return a type.
- Their type is NULL anyway */
- /* FIXME: varobj_get_type() calls type_print(), so we may have to wrap
- its call here and return TCL_ERROR in the case it errors out */
- if ((string = varobj_get_type (var)) == NULL)
- {
- Tcl_ResetResult (interp);
- return TCL_OK;
- }
-
- first = string;
-
- /* gdb will print things out like "struct {...}" for anonymous structs.
- In gui-land, we don't want the {...}, so we strip it here. */
- regexp = Tcl_RegExpCompile (interp, "{...}");
- if (Tcl_RegExpExec (interp, regexp, string, first))
- {
- /* We have an anonymous struct/union/class/enum */
- Tcl_RegExpRange (regexp, 0, &first, &last);
- if (*(first - 1) == ' ')
- first--;
- string[first - string] = '\0';
- }
-
- Tcl_SetObjResult (interp, Tcl_NewStringObj (string, -1));
- xfree (string);
- return TCL_OK;
-}
-
-/* This function implements the value object command, which allows an object's
- value to be queried or set. */
-static int
-variable_value (Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[], struct varobj *var)
-{
- char *r;
-
- /* If we're setting the value of the variable, objv[2] will contain the
- variable's new value. */
- if (objc > 2)
- {
- /* FIXME: Do we need to test if val->error is set here?
- If so, make it an attribute. */
- if (varobj_get_attributes (var) & 0x00000001 /* Editable? */ )
- {
- char *s;
-
- s = Tcl_GetStringFromObj (objv[2], NULL);
- if (!varobj_set_value (var, s))
- {
- gdbtk_set_result (interp, "Could not assign expression to variable object");
- return TCL_ERROR;
- }
- }
-
- Tcl_ResetResult (interp);
- return TCL_OK;
- }
-
- r = varobj_get_value (var);
-
- if (r == NULL)
- {
- gdbtk_set_result (interp, "Could not read variable object value after assignment");
- return TCL_ERROR;
- }
- else
- {
- Tcl_SetObjResult (interp, Tcl_NewStringObj (r, -1));
- xfree (r);
- return TCL_OK;
- }
-}
-
-/* Helper functions for the above */
-
-/* Install the given variable VAR into the tcl interpreter with
- the object name NAME. */
-static void
-install_variable (Tcl_Interp *interp, char *name)
-{
- Tcl_CreateObjCommand (interp, name, variable_obj_command,
- NULL, NULL);
-}
-
-/* Unistall the object VAR in the tcl interpreter. */
-static void
-uninstall_variable (Tcl_Interp *interp, char *varname)
-{
- Tcl_DeleteCommand (interp, varname);
-}
-
diff --git a/gdb/gdbtk/generic/gdbtk-wrapper.c b/gdb/gdbtk/generic/gdbtk-wrapper.c
deleted file mode 100644
index b2252fb2cc6..00000000000
--- a/gdb/gdbtk/generic/gdbtk-wrapper.c
+++ /dev/null
@@ -1,757 +0,0 @@
-/* longjmp-free interface between gdb and gdbtk.
- Copyright (C) 1999, 2000, 2002, 2008 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-#include "defs.h"
-#include "frame.h"
-#include "value.h"
-#include "varobj.h"
-#include "block.h"
-#include "exceptions.h"
-#include "language.h"
-#include "gdbtk-wrapper.h"
-
-/*
- * Wrapper functions exported to the world
- */
-
-gdb_result GDB_value_fetch_lazy (value_ptr);
-
-gdb_result GDB_evaluate_expression (struct expression *, value_ptr *);
-
-gdb_result GDB_type_print (value_ptr, char *, struct ui_file *, int);
-
-gdb_result GDB_val_print (struct type *type, char *valaddr,
- CORE_ADDR address, struct ui_file *stream,
- int format, int deref_ref, int recurse,
- enum val_prettyprint pretty);
-
-gdb_result GDB_value_equal (value_ptr, value_ptr, int *);
-
-gdb_result GDB_parse_exp_1 (char **stringptr, struct block *block, int comma,
- struct expression **result);
-
-gdb_result GDB_evaluate_type (struct expression *exp, value_ptr * result);
-
-gdb_result GDB_block_for_pc (CORE_ADDR pc, struct block **result);
-
-gdb_result GDB_block_innermost_frame (struct block *block,
- struct frame_info **result);
-
-gdb_result GDB_reinit_frame_cache (void);
-
-gdb_result GDB_value_ind (value_ptr val, value_ptr * rval);
-
-gdb_result GDB_value_slice (value_ptr val, int low, int num,
- value_ptr * rval);
-
-gdb_result GDB_value_coerce_array (value_ptr val, value_ptr * rval);
-
-gdb_result GDB_value_struct_elt (value_ptr * argp, value_ptr * args,
- char *name, int *static_memfunc,
- char *err, value_ptr * rval);
-
-gdb_result GDB_value_cast (struct type *type, value_ptr val,
- value_ptr * rval);
-
-gdb_result GDB_get_frame_block (struct frame_info *fi, struct block **rval);
-
-gdb_result GDB_get_prev_frame (struct frame_info *fi,
- struct frame_info **result);
-
-gdb_result GDB_get_next_frame (struct frame_info *fi,
- struct frame_info **result);
-
-gdb_result GDB_find_relative_frame (struct frame_info *fi,
- int *start, struct frame_info **result);
-
-gdb_result GDB_get_current_frame (struct frame_info **result);
-
-gdb_result GDB_varobj_update (struct varobj **varp, int explicit,
- VEC (varobj_update_result) **changes);
-
-/*
- * Private functions for this file
- */
-static gdb_result call_wrapped_function (catch_errors_ftype *,
- struct gdb_wrapper_arguments *);
-
-static int wrap_type_print (char *);
-
-static int wrap_evaluate_expression (char *);
-
-static int wrap_value_fetch_lazy (char *);
-
-static int wrap_val_print (char *);
-
-static int wrap_value_equal (char *);
-
-static int wrap_parse_exp_1 (char *opaque_arg);
-
-static int wrap_evaluate_type (char *opaque_arg);
-
-static int wrap_block_for_pc (char *opaque_arg);
-
-static int wrap_block_innermost_frame (char *opaque_arg);
-
-static int wrap_reinit_frame_cache (char *opaque_arg);
-
-static int wrap_value_ind (char *opaque_arg);
-
-static int wrap_value_slice (char *opaque_arg);
-
-static int wrap_value_coerce_array (char *opaque_arg);
-
-static int wrap_value_struct_elt (char *opaque_arg);
-
-static int wrap_value_cast (char *opaque_arg);
-
-static int wrap_get_frame_block (char *opaque_arg);
-
-static int wrap_get_prev_frame (char *opaque_arg);
-
-static int wrap_get_next_frame (char *opaque_arg);
-
-static int wrap_find_relative_frame (char *opaque_arg);
-
-static int wrap_get_current_frame (char *opaque_arg);
-
-static int wrap_varobj_update (char *opaque_arg);
-
-static gdb_result
-call_wrapped_function (catch_errors_ftype *fn, struct gdb_wrapper_arguments *arg)
-{
- if (!catch_errors (fn, (char *) &arg, "", RETURN_MASK_ERROR))
- {
- /* An error occurred */
- return GDB_ERROR;
- }
-
- return GDB_OK;
-}
-
-gdb_result
-GDB_type_print (value_ptr val, char *varstring,
- struct ui_file *stream, int show)
-{
- struct gdb_wrapper_arguments args;
-
- args.args[0].ptr = val;
- args.args[1].ptr = varstring;
- args.args[2].ptr = stream;
- args.args[3].integer = show;
- return call_wrapped_function ((catch_errors_ftype *) wrap_type_print, &args);
-}
-
-static int
-wrap_type_print (char *a)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a;
- value_ptr val = (value_ptr) (*args)->args[0].ptr;
- char *varstring = (*args)->args[1].ptr;
- struct ui_file *stream = (struct ui_file *) (*args)->args[2].ptr;
- int show = (*args)->args[3].integer;
- type_print (value_type (val), varstring, stream, show);
- return 1;
-}
-
-gdb_result
-GDB_val_print (struct type *type,
- char *valaddr,
- CORE_ADDR address,
- struct ui_file *stream,
- int format,
- int deref_ref,
- int recurse,
- enum val_prettyprint pretty)
-{
- struct gdb_wrapper_arguments args;
-
- args.args[0].ptr = type;
- args.args[1].ptr = valaddr;
- args.args[2].ptr = &address;
- args.args[3].ptr = stream;
- args.args[4].integer = format;
- args.args[5].integer = deref_ref;
- args.args[6].integer = recurse;
- args.args[7].integer = pretty;
-
- return call_wrapped_function ((catch_errors_ftype *) wrap_val_print, &args);
-}
-
-static int
-wrap_val_print (char *a)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a;
- struct type *type;
- const gdb_byte *valaddr;
- CORE_ADDR address;
- struct ui_file *stream;
- int format;
- int deref_ref;
- int recurse;
- enum val_prettyprint pretty;
-
- type = (struct type *) (*args)->args[0].ptr;
- valaddr = (gdb_byte *) (*args)->args[1].ptr;
- address = *(CORE_ADDR *) (*args)->args[2].ptr;
- stream = (struct ui_file *) (*args)->args[3].ptr;
- format = (*args)->args[4].integer;
- deref_ref = (*args)->args[5].integer;
- recurse = (*args)->args[6].integer;
- pretty = (enum val_prettyprint) (*args)->args[7].integer;
-
- val_print (type, valaddr, 0, address, stream, format, deref_ref,
- recurse, pretty, current_language);
- return 1;
-}
-
-gdb_result
-GDB_value_fetch_lazy (value_ptr value)
-{
- struct gdb_wrapper_arguments args;
-
- args.args[0].ptr = value;
- return call_wrapped_function ((catch_errors_ftype *) wrap_value_fetch_lazy, &args);
-}
-
-static int
-wrap_value_fetch_lazy (char *a)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a;
-
- value_fetch_lazy ((value_ptr) (*args)->args[0].ptr);
- return 1;
-}
-
-gdb_result
-GDB_evaluate_expression (struct expression *exp, value_ptr *value)
-{
- struct gdb_wrapper_arguments args;
- gdb_result result;
- args.args[0].ptr = exp;
-
- result = call_wrapped_function ((catch_errors_ftype *) wrap_evaluate_expression, &args);
- if (result != GDB_OK)
- return result;
-
- *value = (value_ptr) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_evaluate_expression (char *a)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a;
-
- (*args)->result.ptr =
- evaluate_expression ((struct expression *) (*args)->args[0].ptr);
- return 1;
-}
-
-gdb_result
-GDB_value_equal (val1, val2, result)
- value_ptr val1;
- value_ptr val2;
- int *result;
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = val1;
- args.args[1].ptr = val2;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_value_equal, &args);
- if (r != GDB_OK)
- return r;
-
- *result = args.result.integer;
- return GDB_OK;
-}
-
-static int
-wrap_value_equal (char *a)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a;
- value_ptr val1, val2;
-
- val1 = (value_ptr) (*args)->args[0].ptr;
- val2 = (value_ptr) (*args)->args[1].ptr;
-
- (*args)->result.integer = value_equal (val1, val2);
- return 1;
-}
-
-gdb_result
-GDB_parse_exp_1 (char **stringptr, struct block *block,
- int comma, struct expression **result)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = stringptr;
- args.args[1].ptr = block;
- args.args[2].integer = comma;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_parse_exp_1, &args);
- if (r != GDB_OK)
- return r;
-
- *result = (struct expression *) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_parse_exp_1 (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
- struct block *block;
- char **stringptr;
- int comma;
-
- stringptr = (char **) (*args)->args[0].ptr;
- block = (struct block *) (*args)->args[1].ptr;
- comma = (*args)->args[2].integer;
-
- (*args)->result.ptr = parse_exp_1 (stringptr, block, comma);
- return 1;
-}
-
-gdb_result
-GDB_evaluate_type (struct expression *exp, value_ptr *result)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = exp;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_evaluate_type, &args);
- if (r != GDB_OK)
- return r;
-
- *result = (value_ptr) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_evaluate_type (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
- struct expression *exp;
-
- exp = (struct expression *) (*args)->args[0].ptr;
- (*args)->result.ptr = evaluate_type (exp);
- return 1;
-}
-
-gdb_result
-GDB_block_for_pc (CORE_ADDR pc, struct block **result)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = &pc;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_block_for_pc, &args);
- if (r != GDB_OK)
- return r;
-
- *result = (struct block *) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_block_for_pc (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
- CORE_ADDR pc;
-
- pc = *(CORE_ADDR *) (*args)->args[0].ptr;
- (*args)->result.ptr = block_for_pc (pc);
- return 1;
-}
-
-gdb_result
-GDB_block_innermost_frame (struct block *block, struct frame_info **result)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = block;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_block_innermost_frame, &args);
- if (r != GDB_OK)
- return r;
-
- *result = (struct frame_info *) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_block_innermost_frame (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
- struct block *block;
-
- block = (struct block *) (*args)->args[0].ptr;
- (*args)->result.ptr = block_innermost_frame (block);
- return 1;
-}
-
-gdb_result
-GDB_reinit_frame_cache ()
-{
- gdb_result r;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_reinit_frame_cache, NULL);
- if (r != GDB_OK)
- return r;
-
- return GDB_OK;
-}
-
-static int
-wrap_reinit_frame_cache (char *opaque_arg)
-{
- reinit_frame_cache ();
- return 1;
-}
-
-gdb_result
-GDB_value_ind (value_ptr val, value_ptr *rval)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = val;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_value_ind, &args);
- if (r != GDB_OK)
- return r;
-
- *rval = (value_ptr) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_value_ind (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
- value_ptr val;
-
- val = (value_ptr) (*args)->args[0].ptr;
- (*args)->result.ptr = value_ind (val);
- return 1;
-}
-
-gdb_result
-GDB_value_slice (value_ptr val, int low, int num, value_ptr *rval)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = val;
- args.args[1].integer = low;
- args.args[2].integer = num;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_value_slice, &args);
- if (r != GDB_OK)
- return r;
-
- *rval = (value_ptr) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_value_slice (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
- value_ptr val;
- int low, num;
-
- val = (value_ptr) (*args)->args[0].ptr;
- low = (*args)->args[1].integer;
- num = (*args)->args[2].integer;
- (*args)->result.ptr = value_slice (val, low, num);
- return 1;
-}
-
-gdb_result
-GDB_value_coerce_array (val, rval)
- value_ptr val;
- value_ptr *rval;
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = val;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_value_coerce_array,
- &args);
- if (r != GDB_OK)
- return r;
-
- *rval = (value_ptr) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_value_coerce_array (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
- value_ptr val;
-
- val = (value_ptr) (*args)->args[0].ptr;
- (*args)->result.ptr = value_coerce_array (val);
- return 1;
-}
-
-gdb_result
-GDB_value_struct_elt (value_ptr *argp,
- value_ptr *args,
- char *name,
- int *static_memfunc,
- char *err,
- value_ptr *rval)
-{
- struct gdb_wrapper_arguments argss;
- gdb_result r;
-
- argss.args[0].ptr = argp;
- argss.args[1].ptr = args;
- argss.args[2].ptr = name;
- argss.args[3].ptr = static_memfunc;
- argss.args[4].ptr = err;
- r = call_wrapped_function ((catch_errors_ftype *) wrap_value_struct_elt, &argss);
- if (r != GDB_OK)
- return r;
-
- *rval = (value_ptr) argss.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_value_struct_elt (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **argss = (struct gdb_wrapper_arguments **) opaque_arg;
- value_ptr *argp, *args;
- char *name;
- int *static_memfunc;
- char *err;
-
- argp = (value_ptr *) (*argss)->args[0].ptr;
- args = (value_ptr *) (*argss)->args[1].ptr;
- name = (char *) (*argss)->args[2].ptr;
- static_memfunc = (int *) (*argss)->args[3].ptr;
- err = (char *) (*argss)->args[4].ptr;
-
- (*argss)->result.ptr = value_struct_elt (argp, args, name, static_memfunc, err);
- return 1;
-}
-
-gdb_result
-GDB_value_cast (struct type *type, value_ptr val, value_ptr *rval)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = type;
- args.args[1].ptr = val;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_value_cast, &args);
- if (r != GDB_OK)
- return r;
-
- *rval = (value_ptr) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_value_cast (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
- value_ptr val;
- struct type *type;
-
- type = (struct type *) (*args)->args[0].ptr;
- val = (value_ptr) (*args)->args[1].ptr;
- (*args)->result.ptr = value_cast (type, val);
-
- return 1;
-}
-
-gdb_result
-GDB_get_frame_block (struct frame_info *fi, struct block **rval)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = fi;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_get_frame_block, &args);
- if (r != GDB_OK)
- return r;
-
- *rval = (struct block *) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_get_frame_block (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
- struct frame_info *fi;
-
- fi = (struct frame_info *) (*args)->args[0].ptr;
- (*args)->result.ptr = get_frame_block (fi, NULL);
-
- return 1;
-}
-
-gdb_result
-GDB_get_prev_frame (struct frame_info *fi, struct frame_info **result)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = fi;
- r = call_wrapped_function ((catch_errors_ftype *) wrap_get_prev_frame, &args);
- if (r != GDB_OK)
- return r;
-
- *result = (struct frame_info *) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_get_prev_frame (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
- struct frame_info *fi = (struct frame_info *) (*args)->args[0].ptr;
-
- (*args)->result.ptr = get_prev_frame (fi);
- return 1;
-}
-
-gdb_result
-GDB_get_next_frame (struct frame_info *fi, struct frame_info **result)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = fi;
- r = call_wrapped_function ((catch_errors_ftype *) wrap_get_next_frame, &args);
- if (r != GDB_OK)
- return r;
-
- *result = (struct frame_info *) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_get_next_frame (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
- struct frame_info *fi = (struct frame_info *) (*args)->args[0].ptr;
-
- (*args)->result.ptr = get_next_frame (fi);
- return 1;
-}
-
-gdb_result
-GDB_find_relative_frame (struct frame_info *fi, int *start,
- struct frame_info **result)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = fi;
- args.args[1].ptr = start;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_find_relative_frame,
- &args);
- if (r != GDB_OK)
- return r;
-
- *result = (struct frame_info *) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_find_relative_frame (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
- struct frame_info *fi = (struct frame_info *) (*args)->args[0].ptr;
- int *start = (int *) (*args)->args[1].ptr;
-
- (*args)->result.ptr = find_relative_frame (fi, start);
- return 1;
-}
-
-gdb_result
-GDB_get_current_frame (struct frame_info **result)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_get_current_frame,
- &args);
- if (r != GDB_OK)
- return r;
-
- *result = (struct frame_info *) args.result.ptr;
- return GDB_OK;
-}
-
-static int
-wrap_get_current_frame (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) opaque_arg;
-
- (*args)->result.ptr = get_current_frame ();
- return 1;
-}
-
-gdb_result
-GDB_varobj_update (struct varobj **varp, int explicit,
- VEC (varobj_update_result) **changes)
-{
- struct gdb_wrapper_arguments args;
- gdb_result r;
-
- args.args[0].ptr = varp;
- args.args[1].integer = explicit;
-
- r = call_wrapped_function ((catch_errors_ftype *) wrap_varobj_update, &args);
- if (r != GDB_OK)
- return r;
-
- *changes = args.result.ptr;
- return GDB_OK;
-}
-
-static int wrap_varobj_update (char *opaque_arg)
-{
- struct gdb_wrapper_arguments **args
- = (struct gdb_wrapper_arguments **) opaque_arg;
- struct varobj **varp = (struct varobj **) (*args)->args[0].ptr;
- int explicit = (*args)->args[1].integer;
- (*args)->result.ptr = varobj_update (varp, explicit);
- return 1;
-}
diff --git a/gdb/gdbtk/generic/gdbtk-wrapper.h b/gdb/gdbtk/generic/gdbtk-wrapper.h
deleted file mode 100644
index e9d290f5647..00000000000
--- a/gdb/gdbtk/generic/gdbtk-wrapper.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* longjmp-free interface between gdb and gdbtk.
- Copyright (C) 1999, 2000, 2002, 2008 Free Software Foundation, Inc.
-
-This file is part of GDB. It contains routines to safely call common gdb
-functions without the fear of longjmp'ing.
-
-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., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
-
-#ifndef GDBTK_WRAPPER_H
-#define GDBTK_WRAPPER_H
-#include "vec.h"
-
-/* Use this struct used to pass arguments to wrapper routines. We assume
- (arbitrarily) that no gdb function takes more than ten arguments. */
-struct gdb_wrapper_arguments {
-
- /* Pointer to some result from the gdb function call, if any */
- union
- {
- int integer;
- void *ptr;
- } result;
-
- /* The list of arguments. */
- union
- {
- void *ptr;
- int integer;
- } args[10];
-};
-
-/* FIXME: cagney/2002-01-04: GDB no longer uses or supplies the
- value_ptr typedef. Provide one here to keep the Insight code
- immediatly happy. */
-typedef struct value *value_ptr;
-
-/* Whenever any gdb function wrapper is called, its return status is: */
-typedef enum gdb_wrapper_status { GDB_OK, GDB_ERROR } gdb_result;
-
-/* This list of functions which have been wrapped. Please keep this list
- in alphabetical order, using "GDB_" to prefix the actual name of the
- function. */
-extern gdb_result GDB_evaluate_expression (struct expression *expr,
- value_ptr * val);
-extern gdb_result GDB_type_print (value_ptr val, char *varstring,
- struct ui_file *stream, int show);
-extern gdb_result GDB_val_print (struct type *type, char *valaddr,
- CORE_ADDR address, struct ui_file *stream,
- int format, int deref_ref, int recurse,
- enum val_prettyprint pretty);
-extern gdb_result GDB_value_fetch_lazy (value_ptr value);
-extern gdb_result GDB_value_equal (value_ptr val1, value_ptr val2,
- int *result);
-extern gdb_result GDB_parse_exp_1 (char **stringptr, struct block *block,
- int comma, struct expression **result);
-extern gdb_result GDB_evaluate_type (struct expression *exp,
- value_ptr * result);
-extern gdb_result GDB_block_for_pc (CORE_ADDR pc, struct block **result);
-extern gdb_result GDB_block_innermost_frame (struct block *block,
- struct frame_info **result);
-extern gdb_result GDB_reinit_frame_cache (void);
-extern gdb_result GDB_value_ind (value_ptr val, value_ptr * rval);
-extern gdb_result GDB_value_slice (value_ptr val, int low, int num,
- value_ptr * rval);
-extern gdb_result GDB_value_coerce_array (value_ptr val, value_ptr * rval);
-extern gdb_result GDB_value_struct_elt (value_ptr * argp, value_ptr * args,
- char *name, int *static_memfunc,
- char *err, value_ptr * rval);
-extern gdb_result GDB_value_cast (struct type *type, value_ptr val,
- value_ptr * rval);
-gdb_result GDB_get_frame_block (struct frame_info *fi, struct block **rval);
-extern gdb_result GDB_get_prev_frame (struct frame_info *fi,
- struct frame_info **result);
-extern gdb_result GDB_get_next_frame (struct frame_info *fi,
- struct frame_info **result);
-extern gdb_result GDB_find_relative_frame (struct frame_info *fi,
- int *start,
- struct frame_info **result);
-extern gdb_result GDB_get_current_frame (struct frame_info **result);
-extern gdb_result GDB_varobj_update (struct varobj **varp, int explicit,
- VEC (varobj_update_result) **changes);
-#endif /* GDBTK_WRAPPER_H */
-
diff --git a/gdb/gdbtk/generic/gdbtk.c b/gdb/gdbtk/generic/gdbtk.c
deleted file mode 100644
index 485ec535e82..00000000000
--- a/gdb/gdbtk/generic/gdbtk.c
+++ /dev/null
@@ -1,775 +0,0 @@
-/* Startup code for Insight
- Copyright (C) 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003, 2004, 2006, 2008
- Free Software Foundation, Inc.
-
- Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support.
-
- This file is part of GDB.
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-#include "defs.h"
-#include "inferior.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdbcore.h"
-#include "tracepoint.h"
-#include "demangle.h"
-#include "version.h"
-#include "top.h"
-#include "annotate.h"
-#include "exceptions.h"
-
-#if defined(_WIN32) || defined(__CYGWIN__)
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
-/* tcl header files includes varargs.h unless HAS_STDARG is defined,
- but gdb uses stdarg.h, so make sure HAS_STDARG is defined. */
-#define HAS_STDARG 1
-
-#include <tcl.h>
-#include <tk.h>
-#include "guitcl.h"
-#include "gdbtk.h"
-
-#include <fcntl.h>
-#include <sys/stat.h>
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#include <sys/time.h>
-#include <signal.h>
-
-#include "gdb_string.h"
-#include "dis-asm.h"
-#include "gdbcmd.h"
-
-#ifdef __CYGWIN32__
-#include <sys/cygwin.h> /* for cygwin32_attach_handle_to_fd */
-#endif
-
-extern void _initialize_gdbtk (void);
-
-#ifndef __MINGW32__
-/* For unix natives, we use a timer to periodically keep the gui alive.
- See comments before x_event. */
-static sigset_t nullsigmask;
-static struct sigaction act1, act2;
-static struct itimerval it_on, it_off;
-
-static void
-x_event_wrapper (int signo)
-{
- x_event (signo);
-}
-#endif
-
-/*
- * This variable controls the interaction with an external editor.
- */
-
-char *external_editor_command = NULL;
-
-extern int Tktable_Init (Tcl_Interp * interp);
-
-void gdbtk_init (void);
-
-static void gdbtk_init_1 (char *argv0);
-
-void gdbtk_interactive (void);
-
-static void cleanup_init (void *ignore);
-
-static void tk_command (char *, int);
-
-static int target_should_use_timer (struct target_ops *t);
-
-int target_is_native (struct target_ops *t);
-
-int gdbtk_test (char *);
-
-static void view_command (char *, int);
-
-/* Handle for TCL interpreter */
-Tcl_Interp *gdbtk_interp = NULL;
-
-static int gdbtk_timer_going = 0;
-
-/* linked variable used to tell tcl what the current thread is */
-int gdb_context = 0;
-
-/* This variable is true when the inferior is running. See note in
- * gdbtk.h for details.
- */
-int running_now;
-
-/* This variable holds the name of a Tcl file which should be sourced by the
- interpreter when it goes idle at startup. Used with the testsuite. */
-static char *gdbtk_source_filename = NULL;
-
-int gdbtk_disable_fputs = 1;
-
-static const char *argv0;
-
-#ifndef _WIN32
-
-/* Supply malloc calls for tcl/tk. We do not want to do this on
- Windows, because Tcl_Alloc is probably in a DLL which will not call
- the mmalloc routines.
- We also don't need to do it for Tcl/Tk8.1, since we locally changed the
- allocator to use malloc & free. */
-
-#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0
-char *
-TclpAlloc (unsigned int size)
-{
- return xmalloc (size);
-}
-
-char *
-TclpRealloc (char *ptr, unsigned int size)
-{
- return xrealloc (ptr, size);
-}
-
-void
-TclpFree (char *ptr)
-{
- free (ptr);
-}
-#endif /* TCL_VERSION == 8.0 */
-
-#endif /* ! _WIN32 */
-
-#ifdef _WIN32
-
-/* On Windows, if we hold a file open, other programs can't write to
- * it. In particular, we don't want to hold the executable open,
- * because it will mean that people have to get out of the debugging
- * session in order to remake their program. So we close it, although
- * this will cost us if and when we need to reopen it.
- */
-
-void
-close_bfds ()
-{
- struct objfile *o;
-
- ALL_OBJFILES (o)
- {
- if (o->obfd != NULL)
- bfd_cache_close (o->obfd);
- }
-
- if (exec_bfd != NULL)
- bfd_cache_close (exec_bfd);
-}
-
-#endif /* _WIN32 */
-
-
-/* TclDebug (const char *fmt, ...) works just like printf() but
- * sends the output to the GDB TK debug window.
- * Not for normal use; just a convenient tool for debugging
- */
-
-void
-TclDebug (char level, const char *fmt,...)
-{
- va_list args;
- char *buf;
- const char *v[3];
- char *merge;
- char *priority;
-
- switch (level)
- {
- case 'W':
- priority = "W";
- break;
- case 'E':
- priority = "E";
- break;
- case 'X':
- priority = "X";
- break;
- default:
- priority = "I";
- }
-
- va_start (args, fmt);
-
-
- xvasprintf (&buf, fmt, args);
- va_end (args);
-
- v[0] = "dbug";
- v[1] = priority;
- v[2] = buf;
-
- merge = Tcl_Merge (3, v);
- if (Tcl_Eval (gdbtk_interp, merge) != TCL_OK)
- Tcl_BackgroundError (gdbtk_interp);
- Tcl_Free (merge);
- free(buf);
-}
-
-
-/*
- * The rest of this file contains the start-up, and event handling code for gdbtk.
- */
-
-/*
- * This cleanup function is added to the cleanup list that surrounds the Tk
- * main in gdbtk_init. It deletes the Tcl interpreter.
- */
-
-static void
-cleanup_init (void *ignore)
-{
- if (gdbtk_interp != NULL)
- Tcl_DeleteInterp (gdbtk_interp);
- gdbtk_interp = NULL;
-}
-
-/* Come here during long calculations to check for GUI events. Usually invoked
- via the QUIT macro. */
-
-void
-gdbtk_interactive ()
-{
- /* Tk_DoOneEvent (TK_DONT_WAIT|TK_IDLE_EVENTS); */
-}
-
-/* Start a timer which will keep the GUI alive while in target_wait. */
-void
-gdbtk_start_timer ()
-{
- static int first = 1;
-
- if (first)
- {
- /* first time called, set up all the structs */
- first = 0;
-#ifndef __MINGW32__
- sigemptyset (&nullsigmask);
-
- act1.sa_handler = x_event_wrapper;
- act1.sa_mask = nullsigmask;
- act1.sa_flags = 0;
-
- act2.sa_handler = SIG_IGN;
- act2.sa_mask = nullsigmask;
- act2.sa_flags = 0;
-
- it_on.it_interval.tv_sec = 0;
- it_on.it_interval.tv_usec = 250000; /* .25 sec */
- it_on.it_value.tv_sec = 0;
- it_on.it_value.tv_usec = 250000;
-
- it_off.it_interval.tv_sec = 0;
- it_off.it_interval.tv_usec = 0;
- it_off.it_value.tv_sec = 0;
- it_off.it_value.tv_usec = 0;
-#endif
- }
-
- if (target_should_use_timer (&current_target))
- {
- if (!gdbtk_timer_going)
- {
-#ifndef __MINGW32__
- sigaction (SIGALRM, &act1, NULL);
- setitimer (ITIMER_REAL, &it_on, NULL);
-#endif
- gdbtk_timer_going = 1;
- }
- }
- return;
-}
-
-/* Stop the timer if it is running. */
-void
-gdbtk_stop_timer ()
-{
- if (gdbtk_timer_going)
- {
- gdbtk_timer_going = 0;
-#ifndef __MINGW32__
- setitimer (ITIMER_REAL, &it_off, NULL);
- sigaction (SIGALRM, &act2, NULL);
-#endif
- }
- return;
-}
-
-/* Should this target use the timer? See comments before
- x_event for the logic behind all this. */
-static int
-target_should_use_timer (struct target_ops *t)
-{
- return target_is_native (t);
-}
-
-/* Is T a native target? */
-int
-target_is_native (struct target_ops *t)
-{
- char *name = t->to_shortname;
-
- if (strcmp (name, "exec") == 0 || strcmp (name, "hpux-threads") == 0
- || strcmp (name, "child") == 0 || strcmp (name, "procfs") == 0
- || strcmp (name, "solaris-threads") == 0
- || strcmp (name, "linuxthreads") == 0
- || strcmp (name, "multi-thread") == 0)
- return 1;
-
- return 0;
-}
-
-/* gdbtk_init installs this function as a final cleanup. */
-
-static void
-gdbtk_cleanup (PTR dummy)
-{
- Tcl_Eval (gdbtk_interp, "gdbtk_cleanup");
- Tcl_Finalize ();
-}
-
-
-/* Initialize gdbtk. This involves creating a Tcl interpreter,
- * defining all the Tcl commands that the GUI will use, pointing
- * all the gdb "hooks" to the correct functions,
- * and setting the Tcl auto loading environment so that we can find all
- * the Tcl based library files.
- */
-
-void
-gdbtk_init (void)
-{
- struct cleanup *old_chain;
- char *s;
- int element_count;
- const char **exec_path;
- CONST char *internal_exec_name;
- Tcl_Obj *command_obj;
- int running_from_builddir;
-
- old_chain = make_cleanup (cleanup_init, 0);
-
- /* First init tcl and tk. */
- Tcl_FindExecutable (argv0);
- gdbtk_interp = Tcl_CreateInterp ();
-
-#ifdef TCL_MEM_DEBUG
- Tcl_InitMemory (gdbtk_interp);
-#endif
-
- if (!gdbtk_interp)
- error ("Tcl_CreateInterp failed");
-
- /* Set up some globals used by gdb to pass info to gdbtk
- for start up options and the like */
- xasprintf (&s, "%d", inhibit_gdbinit);
- Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "inhibit_prefs", s, TCL_GLOBAL_ONLY);
- free(s);
-
- /* Note: Tcl_SetVar2() treats the value as read-only (making a
- copy). Unfortunately it does not mark the parameter as
- ``const''. */
- Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "host_name", (char*) host_name, TCL_GLOBAL_ONLY);
- Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "target_name", (char*) target_name, TCL_GLOBAL_ONLY);
- {
-#ifdef __CYGWIN
- char *srcdir = (char *) alloca (cygwin_posix_to_win32_path_list_buf_size (SRC_DIR));
- cygwin_posix_to_win32_path_list (SRC_DIR, srcdir);
-#else /* !__CYGWIN */
- char *srcdir = SRC_DIR;
-#endif /* !__CYGWIN */
- Tcl_SetVar2 (gdbtk_interp, "GDBStartup", "srcdir", srcdir, TCL_GLOBAL_ONLY);
- }
-
- /* This is really lame, but necessary. We need to set the path to our
- library sources in the global GDBTK_LIBRARY. This was only necessary
- for running from the build dir, but when using a system-supplied
- Tcl/Tk/Itcl, we cannot rely on the user installing Insight into
- the same tcl library directory. */
-
- internal_exec_name = Tcl_GetNameOfExecutable ();
-
- Tcl_SplitPath ((char *) internal_exec_name, &element_count, &exec_path);
- if (strcmp (exec_path[element_count - 2], "bin") == 0)
- running_from_builddir = 0;
- else
- running_from_builddir = 1;
- Tcl_Free ((char *) exec_path);
-
- /* This seems really complicated, and that's because it is.
- We would like to preserve the following ways of running
- Insight (and having it work, of course):
-
- 1. Installed using installed Tcl et al
- 2. From build directory using installed Tcl et al
- 3. Installed using Tcl et al from the build tree
- 4. From build directory using Tcl et al from the build tree
-
- When running from the builddir (nos. 2,4), we set all the
- *_LIBRARY variables manually to point at the proper locations in
- the source tree. (When Tcl et al are installed, their
- corresponding variables get set incorrectly, but tcl_findLibrary
- will still find the correct installed versions.)
-
- When not running from the build directory, we must set GDBTK_LIBRARY,
- just in case we are running from a non-standard install directory
- (i.e., Tcl and Insight were installed into two different
- install directories). One snafu: we use libgui's Paths
- environment variable to do this, so we cannot actually
- set GDBTK_LIBRARY until libgui is initialized. */
-
- if (running_from_builddir)
- {
- /* We check to see if TCL_LIBRARY, TK_LIBRARY,
- ITCL_LIBRARY, ITK_LIBRARY, and maybe a couple other
- environment variables have been set (we don't want
- to override the User's settings).
-
- If the *_LIBRARY variable is is not set, point it at
- the source directory. */
- static char set_lib_paths_script[] = "\
- set srcDir [file dirname $GDBStartup(srcdir)]\n\
- if {![info exists env(TCL_LIBRARY)]} {\n\
- set env(TCL_LIBRARY) [file join $srcDir tcl library]\n\
- }\n\
-\
- if {![info exists env(TK_LIBRARY)]} {\n\
- set env(TK_LIBRARY) [file join $srcDir tk library]\n\
- }\n\
-\
- if {![info exists env(ITCL_LIBRARY)]} {\n\
- set env(ITCL_LIBRARY) [file join $srcDir itcl itcl library]\n\
- }\n\
-\
- if {![info exists env(ITK_LIBRARY)]} {\n\
- set env(ITK_LIBRARY) [file join $srcDir itcl itk library]\n\
- }\n\
-\
- if {![info exists env(IWIDGETS_LIBRARY)]} {\n\
- set env(IWIDGETS_LIBRARY) \
- [file join $srcDir itcl iwidgets generic]\n\
- }\n\
-\
- if {![info exists env(GDBTK_LIBRARY)]} {\n\
- set env(GDBTK_LIBRARY) [file join $GDBStartup(srcdir) gdbtk library]\n\
- }\n\
-\
- # Append the directory with the itcl/itk/iwidgets pkg indexes\n\
- set startDir [file dirname [file dirname [info nameofexecutable]]]\n\
- lappend ::auto_path [file join $startDir itcl itcl]\n\
- lappend ::auto_path [file join $startDir itcl itk]\n\
- lappend ::auto_path [file join $startDir itcl iwidgets]\n";
-
- command_obj = Tcl_NewStringObj (set_lib_paths_script, -1);
- Tcl_IncrRefCount (command_obj);
- Tcl_EvalObj (gdbtk_interp, command_obj);
- Tcl_DecrRefCount (command_obj);
- }
-
- make_final_cleanup (gdbtk_cleanup, NULL);
-
- if (Tcl_Init (gdbtk_interp) != TCL_OK)
- error ("Tcl_Init failed: %s", gdbtk_interp->result);
-
- /* Initialize the Paths variable. */
- if (ide_initialize_paths (gdbtk_interp, "") != TCL_OK)
- error ("ide_initialize_paths failed: %s", gdbtk_interp->result);
-
- if (Tk_Init (gdbtk_interp) != TCL_OK)
- error ("Tk_Init failed: %s", gdbtk_interp->result);
-
- if (Tktable_Init (gdbtk_interp) != TCL_OK)
- error ("Tktable_Init failed: %s", gdbtk_interp->result);
-
- Tcl_StaticPackage (gdbtk_interp, "Tktable", Tktable_Init,
- (Tcl_PackageInitProc *) NULL);
-
- /* If we are not running from the build directory,
- initialize GDBTK_LIBRARY. See comments above. */
- if (!running_from_builddir)
- {
- static char set_gdbtk_library_script[] = "\
- if {![info exists env(GDBTK_LIBRARY)]} {\n\
- set env(GDBTK_LIBRARY) [file join [file dirname [file dirname $Paths(guidir)]] insight1.0]\n\
- }\n";
-
- command_obj = Tcl_NewStringObj (set_gdbtk_library_script, -1);
- Tcl_IncrRefCount (command_obj);
- Tcl_EvalObj (gdbtk_interp, command_obj);
- Tcl_DecrRefCount (command_obj);
- }
-
- /*
- * These are the commands to do some Windows Specific stuff...
- */
-
-#ifdef __WIN32__
- if (ide_create_messagebox_command (gdbtk_interp) != TCL_OK)
- error ("messagebox command initialization failed");
- /* On Windows, create a sizebox widget command */
-#if 0
- if (ide_create_sizebox_command (gdbtk_interp) != TCL_OK)
- error ("sizebox creation failed");
-#endif
- if (ide_create_winprint_command (gdbtk_interp) != TCL_OK)
- error ("windows print code initialization failed");
- if (ide_create_win_grab_command (gdbtk_interp) != TCL_OK)
- error ("grab support command initialization failed");
-#endif
-#ifdef __CYGWIN32__
- /* Path conversion functions. */
- if (ide_create_cygwin_path_command (gdbtk_interp) != TCL_OK)
- error ("cygwin path command initialization failed");
- if (ide_create_shell_execute_command (gdbtk_interp) != TCL_OK)
- error ("cygwin shell execute command initialization failed");
-#endif
-
- /* Only for testing -- and only when it can't be done any
- other way. */
- if (cyg_create_warp_pointer_command (gdbtk_interp) != TCL_OK)
- error ("warp_pointer command initialization failed");
-
- /*
- * This adds all the Gdbtk commands.
- */
-
- if (Gdbtk_Init (gdbtk_interp) != TCL_OK)
- {
- error ("Gdbtk_Init failed: %s", gdbtk_interp->result);
- }
-
- Tcl_StaticPackage (gdbtk_interp, "Insight", Gdbtk_Init, NULL);
-
- /* Add a back door to Tk from the gdb console... */
-
- add_com ("tk", class_obscure, tk_command,
- "Send a command directly into tk.");
-
- add_com ("view", class_obscure, view_command,
- "View a location in the source window.");
-
- /*
- * Set the variable for external editor:
- */
-
- if (external_editor_command != NULL)
- {
- Tcl_SetVar (gdbtk_interp, "external_editor_command",
- external_editor_command, 0);
- xfree (external_editor_command);
- external_editor_command = NULL;
- }
-
-#ifdef __CYGWIN32__
- (void) FreeConsole ();
-#endif
-
- discard_cleanups (old_chain);
-}
-
-void
-gdbtk_source_start_file (void)
-{
- /* find the gdb tcl library and source main.tcl */
-#ifdef NO_TCLPRO_DEBUGGER
- static char script[] = "\
-proc gdbtk_find_main {} {\n\
- global Paths GDBTK_LIBRARY\n\
- rename gdbtk_find_main {}\n\
- tcl_findLibrary insight 1.0 {} main.tcl GDBTK_LIBRARY GDBTKLIBRARY\n\
- set Paths(appdir) $GDBTK_LIBRARY\n\
-}\n\
-gdbtk_find_main";
-#else
- static char script[] = "\
-proc gdbtk_find_main {} {\n\
- global Paths GDBTK_LIBRARY env\n\
- rename gdbtk_find_main {}\n\
- if {[info exists env(DEBUG_STUB)]} {\n\
- source $env(DEBUG_STUB)\n\
- debugger_init\n\
- set debug_startup 1\n\
- } else {\n\
- set debug_startup 0\n\
- }\n\
- tcl_findLibrary insight 1.0 {} main.tcl GDBTK_LIBRARY GDBTK_LIBRARY\n\
- set Paths(appdir) $GDBTK_LIBRARY\n\
-}\n\
-gdbtk_find_main";
-#endif /* NO_TCLPRO_DEBUGGER */
-
- /* now enable gdbtk to parse the output from gdb */
- gdbtk_disable_fputs = 0;
-
- if (Tcl_GlobalEval (gdbtk_interp, (char *) script) != TCL_OK)
- {
- struct gdb_exception e;
- const char *msg;
-
- /* Force errorInfo to be set up propertly. */
- Tcl_AddErrorInfo (gdbtk_interp, "");
- msg = Tcl_GetVar (gdbtk_interp, "errorInfo", TCL_GLOBAL_ONLY);
-
-#ifdef _WIN32
- /* On windows, display the error using a pop-up message box.
- If GDB wasn't started from the DOS prompt, the user won't
- get to see the failure reason. */
- MessageBox (NULL, msg, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL);
-#else
- /* gdb_stdout is already pointing to OUR stdout, so we cannot
- use *_[un]filtered here. Since we're "throwing" an exception
- which should cause us to exit, just print out the error
- to stderr. */
- fputs (msg, stderr);
-#endif
-
- e.reason = RETURN_ERROR;
- e.error = GENERIC_ERROR;
- e.message = msg;
- throw_exception (e);
- }
-
- /* Now source in the filename provided by the --tclcommand option.
- This is mostly used for the gdbtk testsuite... */
-
- if (gdbtk_source_filename != NULL)
- {
- char *s = "after idle source ";
- char *script = concat (s, gdbtk_source_filename, (char *) NULL);
- Tcl_Eval (gdbtk_interp, script);
- free (gdbtk_source_filename);
- free (script);
- }
-}
-
-static void
-gdbtk_init_1 (char *arg0)
-{
- argv0 = arg0;
- deprecated_init_ui_hook = NULL;
-}
-
-/* gdbtk_test is used in main.c to validate the -tclcommand option to
- gdb, which sources in a file of tcl code after idle during the
- startup procedure. */
-
-int
-gdbtk_test (char *filename)
-{
- if (access (filename, R_OK) != 0)
- return 0;
- else
- gdbtk_source_filename = xstrdup (filename);
- return 1;
-}
-
-/* Come here during initialize_all_files () */
-
-void
-_initialize_gdbtk ()
-{
- /* Current_interpreter not set yet, so we must check
- if "interpreter_p" is set to "insight" to know if
- insight is GOING to run. */
- if (strcmp (interpreter_p, "insight") == 0)
- deprecated_init_ui_hook = gdbtk_init_1;
-#ifdef __CYGWIN__
- else
- {
- DWORD ft = GetFileType (GetStdHandle (STD_INPUT_HANDLE));
-
- switch (ft)
- {
- case FILE_TYPE_DISK:
- case FILE_TYPE_CHAR:
- case FILE_TYPE_PIPE:
- break;
- default:
- AllocConsole ();
- cygwin32_attach_handle_to_fd ("/dev/conin", 0,
- GetStdHandle (STD_INPUT_HANDLE),
- 1, GENERIC_READ);
- cygwin32_attach_handle_to_fd ("/dev/conout", 1,
- GetStdHandle (STD_OUTPUT_HANDLE),
- 0, GENERIC_WRITE);
- cygwin32_attach_handle_to_fd ("/dev/conout", 2,
- GetStdHandle (STD_ERROR_HANDLE),
- 0, GENERIC_WRITE);
- break;
- }
- }
-#endif
-}
-
-static void
-tk_command (char *cmd, int from_tty)
-{
- int retval;
- char *result;
- struct cleanup *old_chain;
-
- /* Catch case of no argument, since this will make the tcl interpreter
- dump core. */
- if (cmd == NULL)
- error_no_arg ("tcl command to interpret");
-
- retval = Tcl_Eval (gdbtk_interp, cmd);
-
- result = xstrdup (gdbtk_interp->result);
-
- old_chain = make_cleanup (free, result);
-
- if (retval != TCL_OK)
- error ("%s", result);
-
- printf_unfiltered ("%s\n", result);
-
- do_cleanups (old_chain);
-}
-
-static void
-view_command (char *args, int from_tty)
-{
- char *script;
- struct cleanup *old_chain;
-
- if (args != NULL)
- {
- xasprintf (&script,
- "[lindex [ManagedWin::find SrcWin] 0] location BROWSE_TAG [gdb_loc %s]",
- args);
- old_chain = make_cleanup (xfree, script);
- if (Tcl_Eval (gdbtk_interp, script) != TCL_OK)
- {
- Tcl_Obj *obj = Tcl_GetObjResult (gdbtk_interp);
- error ("%s", Tcl_GetStringFromObj (obj, NULL));
- }
-
- do_cleanups (old_chain);
- }
- else
- error ("Argument required (location to view)");
-}
diff --git a/gdb/gdbtk/generic/gdbtk.h b/gdb/gdbtk/generic/gdbtk.h
deleted file mode 100644
index e5e5d1da389..00000000000
--- a/gdb/gdbtk/generic/gdbtk.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/* Tcl/Tk interface routines header file.
- Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2003, 2008
- Free Software Foundation, Inc.
-
- Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support.
-
- This file is part of GDB. It contains the public data that is shared between
- the gdbtk startup code and the gdbtk commands.
-
- 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., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-#ifndef _GDBTK_H
-#define _GDBTK_H
-
-#ifdef _WIN32
-#define GDBTK_PATH_SEP ";"
-#else
-#define GDBTK_PATH_SEP ":"
-#endif
-
-/* Some versions (1.3.79, 1.3.81) of Linux don't support SIOCSPGRP the way
- gdbtk wants to use it... */
-#ifdef __linux__
-#undef SIOCSPGRP
-#endif
-
-/*
- * These are the version numbers for GDBTK. There is a package require
- * statement in main.tcl that checks the version. If you make an incompatible
- * change to the gdb commands, or add any new commands, be sure to bump the
- * version number both here and in main.tcl. This will save us the trouble of
- * having a version of gdb find the wrong versions of the Tcl libraries.
- */
-
-#define GDBTK_MAJOR_VERSION "1"
-#define GDBTK_MINOR_VERSION "0"
-#define GDBTK_VERSION "1.0"
-
-/*
- * These are variables that are needed in gdbtk commands.
- */
-
-/* This variable determines where memory used for disassembly is read from.
- If > 0, then disassembly comes from the exec file rather than the
- target (which might be at the other end of a slow serial link). If
- == 0 then disassembly comes from target. If < 0 disassembly is
- automatically switched to the target if it's an inferior process,
- otherwise the exec file is used. It is defined in gdbtk.c */
-
-
-extern int disassemble_from_exec;
-
-/* This variable is true when the inferior is running. Although it's
- possible to disable most input from widgets and thus prevent
- attempts to do anything while the inferior is running, any commands
- that get through - even a simple memory read - are Very Bad, and
- may cause GDB to crash or behave strangely. So, this variable
- provides an extra layer of defense. It is defined in gdbtk.c */
-
-extern int running_now;
-
-/* These two control how the GUI behaves when tracing or loading
- They are defined in gdbtk-cmds.c */
-
-extern int No_Update;
-extern int load_in_progress;
-
-/* This is the main gdbtk interpreter. It is defined and initialized
- in gdbtk.c */
-
-extern Tcl_Interp *gdbtk_interp;
-
-/*
- * This structure controls how the gdb output is fed into gdbtk_call_wrapper invoked
- * commands. See the explanation of gdbtk_fputs in gdbtk_hooks.c for more details.
- */
-
-typedef struct gdbtk_result
- {
- Tcl_Obj *obj_ptr; /* This will eventually be copied over to the
- Tcl result */
- int flags; /* Flag vector to control how the result is
- used. */
- }
-gdbtk_result;
-
-struct target_ops;
-struct ptid_t;
-
-/* These defines give the allowed values for the gdbtk_result.flags field. */
-
-#define GDBTK_TO_RESULT 1 /* This controls whether output from
- gdbtk_fputs goes to the command result, or
- to gdbtk_tcl_fputs. */
-#define GDBTK_MAKES_LIST 2 /* whether gdbtk_fputs adds the
- element it is outputting as a string, or
- as a separate list element. */
-#define GDBTK_IN_TCL_RESULT 4 /* Indicates that the result is already in the
- Tcl result. You can use this to preserve
- error messages from functions like
- Tcl_GetIntFromObj. You can also store the
- output of a call wrapped command directly in
- the Tcl result if you want, but beware, it will
- not then be preserved across recursive
- gdbtk_call_wrapper invocations. */
-#define GDBTK_ERROR_STARTED 8 /* This one is just used in gdbtk_fputs. If we
- see some output on stderr, we need to clear
- the result we have been accumulating, or the
- error and the previous successful output
- will get mixed, which would be confusing. */
-#define GDBTK_ERROR_ONLY 16 /* Indicates that all incoming I/O is
- to be treated as if it had arrived for gdb_stderr. This is
- used to help error_begin in utils.c. */
-
-/* This is a pointer to the gdbtk_result struct that
- we are currently filling. We use the C stack to make a stack of these
- structures for nested calls to gdbtk commands that are invoked through
- the gdbtk_call_wrapper mechanism. See that function for more details. */
-
-extern gdbtk_result *result_ptr;
-
-/* If you want to restore an old value of result_ptr whenever cleanups
- are run, pass this function to make_cleanup, along with the value
- of result_ptr you'd like to reinstate. */
-extern void gdbtk_restore_result_ptr (void *);
-
-/* GDB context identifier */
-extern int gdb_context;
-
-/* Internal flag used to tell callers of deprecated_ui_loop_hook
- whether they should detach from the target. See explanations before
- x_event and gdb_stop. */
-extern int gdbtk_force_detach;
-
-/*
- * These functions are used in all the modules of Gdbtk.
- *
- */
-
-extern int Gdbtk_Init (Tcl_Interp * interp);
-extern void gdbtk_stop_timer (void);
-extern void gdbtk_start_timer (void);
-extern void gdbtk_ignorable_warning (const char *, const char *);
-extern void gdbtk_interactive (void);
-extern int x_event (int);
-extern int gdbtk_two_elem_cmd (char *, char *);
-extern int target_is_native (struct target_ops *t);
-extern void gdbtk_fputs (const char *, struct ui_file *);
-extern struct ui_file *gdbtk_fileopen (void);
-extern struct ui_file *gdbtk_fileopenin (void);
-extern int gdbtk_disable_fputs;
-extern ptid_t gdbtk_get_ptid (void);
-
-#ifdef _WIN32
-extern void close_bfds ();
-#endif /* _WIN32 */
-
-extern void
- TclDebug (char level, const char *fmt,...);
-
-/* A convenience macro for getting the demangled source names,
- regardless of the user's mangling style. */
-#define GDBTK_SYMBOL_SOURCE_NAME(symbol) \
- (SYMBOL_DEMANGLED_NAME (symbol) != NULL \
- ? SYMBOL_DEMANGLED_NAME (symbol) \
- : DEPRECATED_SYMBOL_NAME (symbol))
-
-
-/* gdbtk_add_hooks - add all the hooks to gdb. This will get called
- by the startup code to fill in the hooks needed by core gdb. */
-extern void gdbtk_add_hooks (void);
-
-/* Initialize Insight */
-extern void gdbtk_init (void);
-
-/* Start Insight. Insight must have already been initialized with a call
- to gdbtk_init. */
-extern void gdbtk_source_start_file (void);
-#endif /* !_GDBTK_H */
diff --git a/gdb/gdbtk/library/ChangeLog-1997 b/gdb/gdbtk/library/ChangeLog-1997
deleted file mode 100644
index 0ec4a0b0d0d..00000000000
--- a/gdb/gdbtk/library/ChangeLog-1997
+++ /dev/null
@@ -1,1487 +0,0 @@
-Wed Dec 10 13:17:21 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * src.tcl (file): Insert tracepoint dots into the source window, too.
-
- * tracedlg.tcl (build_win): Add an update to workaround a Tix/Tk bug when
- mapping the dialog under X.
-
- * console.tcl (insert): Add all errors to the end of the text widget.
- (einsert): Send errors to end of text widget, not insertion pt.
- (invoke): Send errors to end of text widget, not insertion pt.
-
- * interface.tcl (gdbtk_tcl_readline_begin): Insert message into
- command window so that the user sees messages like "Enter commands, one
- per line. Enter 'end' when finished."
-
- * actiondlg.tcl (change_other): Clear the entry on <Return>.
- Add fencepost to avoid manipulating collect list twice which
- could otherwise have undesired side effects.
- Add some validation test for typed-in entries.
- (ok): Call change_other to check the "Other" entry widget when the
- dialog is dismissed.
- (change): fix typo
-
-Mon Dec 8 15:07:51 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * tracedlg.tcl (get_data): New method which gets the data associated
- with an action.
- (add_all_actions): Use the new get_data method.
-
- * actiondlg.tcl (get_selections): Add "declaration" for i so that
- its scope is not limited to for loop.
-
-Fri Dec 5 10:01:24 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * tracedlg.tcl (build_win): Add support for ranges of lines at which
- tracepoint should be set.
- (add_action): With ranges, use actions from first in tracepoint in the
- range.
- (ok): Set tracepoints for ranges, asking if it is ok to overwrite
- any existing ones when necessary. Dismiss the dialog first -- or else
- it could hang around forever.
- (edit): With ranges, use actions of the first tracepoint.
- TraceDlg::Lines: Renamed from TraceDlg::Line.
- TraceDlg::New: New protected variable (indicates if there are any new
- tracepoints being set with this dialog).
- TraceDlg::Exists: New protected variable (indicates if there are any
- existing tracepoints that may be overwritten -- so ask the user first).
-
- * src.tcl (fill_files): Use gdb_find_file to test for the existence
- of a file, not "file exists".
- (do_popup): Filter the selection a little. If the selection is
- multi-line selection, enable the tracepoint range option. Don't
- display "add to watch" for EVERYTHING!
- (validBPLine): Valid lines can have images on them, too.
- (bp_line): Fallout of above: check if breakpoint exists before
- deciding whether to clear it or set it.
- (getVariable): Sllow LINE to be passed, so others can filter lines, too.
- (set_tracepoint): Pass TraceDlg a list of lines -- only one line in this
- case.
- (tracepoint_range): New function to set tracepoint ranges.
- (file): Use gdb_find_file to get the real filename.
-
-Wed Nov 26 15:02:43 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * balloon.tcl, gettext.tcl: Remove obsolete files.
-
- * console.tcl (invoke): Remove debug line.
-
- * src.tcl (update): Remove debug line.
-
- * prefs.tcl (pref_set_defaults): Turn debug mode off by deafult.
-
-Wed Nov 26 11:30:49 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * main.tcl: Initialize gdbtk_state(readline).
-
- * console.tcl (invoke): Check if we are in readline mode, so that
- we wait for the user's input and set a global with the result.
- (activate): Add prompt argument for readline's prompt.
- (setprompt): Add prompt argument for readline's prompt.
-
- * interface.tcl (gdbtk_tcl_readline): hack to get readline working
-
- * lots: Merge with foundry's 11/18/97 build.
-
- * console.tcl (setprompt): Get prompt from gdb.
-
- * prefs.tcl (pref_set_defaults): Add tracepoint defaults.
-
- * interface.tcl (gdbtk_tcl_tracepoint): New function which mimicks
- gdbtk_tcl_breakpoint.
-
- * src.tcl (constructor): Set default behavior of left click. Make
- a tracepoint dot, too.
- (fill_files): "New" function: ripped out of "location". It fills the
- 'files' combo box on the bottom of the source window.
- (location): Use fill_files to fill the files combo box.
- (do_bp): Add support for tracepoints.
- (bp_line): Add support for tracepoints.
- (set_tracepoint): New function to set a tracepoint on a given line.
- (config_win): Add "Set tracepoint here" to right-click menu.
-
- * actiondlg.tcl: New file to help with tracepoint data collection actions.
-
- * tracedlg.tcl: New file to help with tracepoints.
-
-Mon Nov 17 16:49:56 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (config_win): Remove stray character.
-
-Mon Nov 17 16:04:08 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * main.tcl (startup code: Use the first element from the
- vmake-exelist list.
- (exe_name): Likewise.
- (gdbtk_tcl_preloop): Quote file name passed to file.
- (download): Quote file name passed to load.
-
-Sun Nov 16 18:21:57 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * bp.tcl (build_win): Change headers to be raised.
- Change resizing so that the bp grid doesn't change
- size and is always in the upper left corner. Scrollbars
- will appear if the window is shrunk too small.
- (bp_add): Set checkbutton color differently if not
- on Windows.
-
- * manage.tcl (manage_init): About title should only
- have Foundry in it if we are running Foundry.
-
-Fri Nov 14 11:15:29 1997 Jeff Holcomb <jeffh@cygnus.com>
-
- * manage.tcl (manage_init): About window title is now "About
- Cygnus Foundry".
-
- * toolbar.tcl (create_menu_items): Changed "About Foundry
- Debugger..." menu option to "About Cygnus Foundry...".
-
-Fri Nov 14 00:00:42 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * memory.tcl (toggle_enabled): Toggle the background
- color when Auto Update is changed.
-
- * download_pref.tcl (save): New method. Save new
- defaults.
-
- * pref.tcl (build_win): Don't delete subwidget.
- (save): New method.
-
- * manage.tcl (manage_init): Change preferences title.
-
- * prefs.tcl (pref_set_defaults): Define gdb/advanced.
- Used for testing advanced features.
-
- * src.tcl (build_win): Set min size for top pane.
- (mode): Set minimum size for pane2 when needed.
-
- * toolbar.tcl (create_menu_items): Underline the
- W in "Web", not the "e".
-
-Thu Nov 13 16:07:53 1997 Jeff Holcomb <jeffh@cygnus.com>
-
- * download.tcl (done): Update window and show the window for
- at least 3 seconds.
- (constructor): Initialize start_time and last_num.
-
-Thu Nov 13 18:17:07 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * main.tcl (ide_run_server): Call run_executable.
- (run_executable): New procedure, mostly from old ide_run_server.
- If ! GDBTK_IDE, just execute a run command. In the case where
- we've already downloaded, don't bother to do the run command after
- idle. If downloading is not forced, ask whether we should do it.
- * src.tcl (config_win): Call run_executable, not gdb_cmd run.
- * srcbar.tcl (_set_run): Likewise.
- * toolbar.tcl (create_menu_items): Likewise.
-
- * main.tcl: Initialize gdb_exe_set. If IDE, arrange to receive
- process-ended events.
- (gdbtk_tcl_preloop): Don't try to read the file if it doesn't
- exist.
- (download): Don't try to download the file if it doesn't exist.
- Set gdb_download_mtime.
- (exe_name): Just call set_exe_name.
- (set_exe_name): New procedure. Like old exe_name, but call
- gdb_clear_file before running gdb file command, set gdb_exe_set,
- and run gdb_idle_hook.
- (receive_process_ended): New procedure.
-
-Thu Nov 13 13:35:32 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * prefs.tcl (pref_set_defaults): Set debug off by default.
-
- * src.tcl (config_win): Bind Ctrl+P and Ctrl+D.
- (update_title): Change window titlebar.
-
- * srcbar.tcl (_set_run): Change balloon help for
- stop and run icons.
- (create_menu_items): Add accelerator for Print Source.
-
- * toolbar.tcl (create_buttons): Change balloon help for
- project icon.
- (create_menu_items): Change access keys. Add accelerator
- for Download.
-
-Thu Nov 13 10:47:04 1997 Jeff Holcomb <jeffh@cygnus.com>
-
- * download.tcl (constructor): Fix text and button layout.
- Don't allow resizing.
-
-Wed Nov 12 16:59:17 1997 Jeff Holcomb <jeffh@cygnus.com>
-
- * download.tcl (constructor): Patch from Ian to redo the
- download window and also cancel support.
- (update): Ditto.
- (done): Ditto.
- (cancel): New method to handle canceling the download.
- (download_hash): Cancel support.
-
-Wed Nov 12 13:11:20 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * memory.tcl (build_win): Change "Address" to "Addresses"
- on menu and add separator.
-
-Tue Nov 11 11:00:25 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * download_pref.tcl (cancel): Must reset combobox
- because dialog no longer gets deleted.
-
-Tue Nov 11 15:40:36 1997 Tom Tromey <tromey@cygnus.com>
-
- * toolbar.tcl (create_menu_items): Underline "W", not "C", in
- "Cygnus on the Web".
-
-Tue Nov 11 11:00:25 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * variables.tcl (edit): Disable menus when in editing mode.
-
-Tue Nov 11 02:00:25 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * variables.tcl (selectionChanged): When selection changes,
- cancel any editing in progress.
- (build_win): Set background in text styles.
- (edit): Set background colors.
- (UnEdit): Clear selection when done.
-
-Mon Nov 10 12:22:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * variables.tcl (build_win): Set background color.
-
-Mon Nov 10 05:30:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * about.tcl (build_win): Bind button one to close
- the window.
-
- * tclIndex: Rebuilt.
-
-Mon Nov 10 03:00:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * download_pref.tcl (build_win): Fix reading of initial
- baud rate.
-
- * download.tcl (Download): Call keep_raised.
-
- * main.tcl (ide_do_run): Catch GDB commands.
- (ide_run_server): Catch GDB commands.
- (ide_do_run): Don't set gdb_download_complete to 0.
- We don't need further downloads unless executable changes
- or Download is selected from the menubar.
- (keep_raised): Keep a window on top.
-
- * src.tcl (config_win): Catch GDB commands.
-
- * toolbar.tcl (create_menu_items): Catch GDB commands.
- (create_menu_items): Remove automatic step.
-
- * srcbar.tcl (_set_run): Catch GDB commands.
-
- * stack.tcl (build_win): Change background color.
-
- * bp.tcl: Change background color.
- (destructor): Remove breakpoint change hook.
- (bp_type): Fix problem with toggling temp to normal bps.
- (build_win): Add popup menu.
-
- * interface.tcl (gdbtk_tcl_query): Change title and type.
-
-Mon Nov 10 00:26:25 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * pref.tcl (build_win): OK button wasn't working.
-
- * main.tcl: Rework all the "automatic" downloading stuff so
- it doesn't download and run when only the preferences are
- being displayed.
-
- * src.tcl (open_src): Callback from IDE that opens
- a source window when the bug is clicked on. Starts
- up automatic download if necessary.
-
- * tclIndex: Rebuilt.
-
- * images2/bp.gif, stack.gif, up,gif, down.gif, bottom.gif:
- Updated icons.
-
-Sun Nov 9 19:30:33 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * main.tcl (gdbtk_tcl_preloop): Remove uneeded if statement.
- Remove calls to manage get_state.
-
- * manage.tcl (manage_get_state): Remove.
- (manage_init): Add save state to several windows.
- (manage_create): Use ide_property instead of prefs to find window
- geometry.
- (manage_delete): Restructure to fix several bugs.
- (manage_save): Use ide_property instead of prefs. Don't
- call pref_save.
- (manage_register_defaults): Remove calls to manage_get_state.
-
- * tclIndex: Rebuilt.
-
-Sun Nov 9 16:34:44 1997 Tom Tromey <tromey@cygnus.com>
-
- * pref.tcl (build_win): Removed View page.
-
- * toolbar.tcl (create_menu_items): Debugger -> "Foundry Debugger";
- Help menu now parallels vmake.
- * manage.tcl (manage_init): GDBTK -> "Foundry Debugger".
-
-Sun Nov 9 18:24:18 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * memory.tcl (build_win): Use a single menu, remove ``Hide
- menubar'' entry, add ^U binding.
- * manage.tcl (manage_init): Change name of memory window from
- ``Memory Dump'' to ``Memory''.
-
- * srcbar.tcl (create_buttons): Remove toggle update button.
-
- * src.tcl (update_title): Don't use colon if there is no file
- name.
-
- * main.tcl: If GDBTK_IDE, initialize gdb_download_complete.
- (gdbtk_tcl_preloop): If GDBTK_IDE, call download.
- (ide_run_server): Don't run if we already have a run request. If
- download is complete, run program as an idle callback. Otherwise,
- wait until the download is complete before running the program.
- (ide_do_run): New procedure to support ide_run_server.
- (download): Don't run program. Set gdb_download_complete.
-
- * src.tcl (name): Give an error if the file does not exist.
- (location): Only add files that exist to the file name combobox.
-
-Sun Nov 9 11:09:39 1997 Tom Tromey <tromey@cygnus.com>
-
- * src.tcl (name): Use better error message.
-
- * locals.tcl (build_win): New method.
- * watch.tcl (build_win): Create menu. Watch -> "Add Watch".
- (Menu): New instance variable.
- (selectionChanged): New method.
- (postMenu): "Stop Watching" -> Remove.
- * variables.tcl (build_win): Set -ignoreinvoke on Tree widget, and
- set -command to run editEntry method. Don't install <Double-1>
- binding. Put headers on Tree widget. Run selectionChanged
- method.
- (editEntry): Renamed. Now takes entry name as argument.
- (populate): Don't set -state disabled on new items.
- (getSelection): New method.
- (selectionChanged): New method.
- (build_menu_helper): New method.
- (postMenu): View->Format.
- (build_win): Likewise.
-
- * variables.tcl (editXY): Only edit if entry is not empty.
-
- * srcbar.tcl (create_menu_items): Edit -> Open.
- (create_buttons): Likewise.
-
-Thu Nov 6 11:00:41 1997 Tom Tromey <tromey@cygnus.com>
-
- * manage.tcl (manage_delete): Special-case deletion of pref window.
- (manage_create): Don't special-case deletion of pref window.
-
-Thu Nov 6 13:57:32 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * manage.tcl (manage_get_state): Return an empty string for a
- withdrawn window and for the preferences window.
-
- * main.tcl (exe_name): Don't do anything if the executable name
- has not actually changed.
-
-Wed Nov 5 23:08:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * main.tcl (download): Always specify exact filename
- to load.
-
-Wed Nov 5 00:31:53 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * manage.tcl (manage_delete): Only delete source window if
- user answers yes to query.
-
- * bp.tcl: Rewrite to include pulldown menu and new look.
-
- * register.tcl: Rewrite to include pulldown menu and new look.
-
- * stack.tcl: Open initial size wide enough to show all text.
-
- * src.tcl: Modified popup window. Remove option to open
- multiple source windows because the IDE window code doesn't
- work with it.
-
- * srcbar.tcl (_set_run): Change balloon message for Run.
-
- * variables.tcl, watch.tcl: Use fixed font.
-
- * toolbar.tcl (create_menu_items): Handle Close Debugger correctly.
-
- * mem_pref.tcl: Put focus and grab on window.
-
- * memory.tcl: Balloon message change.
-
-Mon Nov 3 11:04:44 1997 Tom Tromey <tromey@cygnus.com>
-
- * main.tcl (gdbtk_tcl_preloop): Look at main even if IDE running.
- (ide_run_server): Open src window.
-
- * manage.tcl (manage_init): Don't recreate initial windows when
- running under IDE.
-
-Fri Oct 31 00:00:04 1997 Tom Tromey <tromey@cygnus.com>
-
- * pref.tcl (cancel): Use manage delete.
- * toolbar.tcl (create_menu_items): Don't register debugger
- preference window.
- * manage.tcl (manage_register_defaults): Use idewindow, not
- idewindow_proc.
- (manage_delete): Don't deregister preference window.
- (manage): Added find, create_closed methods.
- (manage_create): Added visibility argument; changed all callers.
- Special case destruction of pref window.
- * main.tcl: IDE window callback proc is "manage find". Register
- debugger preference window. Create closed src and pref windows
- initially.
- (gdbtk_tcl_preloop): Don't create source window in IDE mode.
-
- * src.tcl (trace_variable): New method.
- (constructor): Use variable traces to track target/exe changes.
- (destructor): Remove variable traces.
-
-Thu Oct 30 12:50:28 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * mem_pref.tcl: Change buttons to OK/Cancel/Apply.
- Minor cleanup.
-
- * memory.tcl: New look. Added menubar.
-
-Tue Oct 28 23:03:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * toolbar.tcl (create_buttons): Clean up balloon help
- for buttons.
- (create_menu_items): Move print menu items to srcbar.tcl.
- Cleanup labels.
-
- * srcbar.tcl (create_menu_items): Add print menu items.
- (create_buttons): Clean up balloon help for buttons.
-
-Tue Oct 28 17:26:15 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * toolbar.tcl (create_menu_items): Add print menu items.
- (print): New function. Calls the proper print routine.
-
- * src.tcl (print): New function. Dump the contents
- of the text widget to a printer.
-
-Tue Oct 28 01:06:15 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * toolbar.tcl (create_menu_items): Add new
- preferences menu code.
-
- * pref.tcl (build_win): Remove all old ppreferences.
- Add Connection and View preferences.
- (cancel): New function. Restore previous values and
- quit.
-
- * manage.tcl (manage_delete): Unregister preferences
- on exit.
-
- * src.tcl (constructor): Add sizebox under Windows.
-
- * download.tcl (constructor): Remove shortcuts on buttons.
- Put focus on "OK" button.
-
- * download_pref.tcl (cancel): New function. Restores
- previous values.
-
-Tue Oct 21 15:28:29 1997 Tom Tromey <tromey@cygnus.com>
-
- * main.tcl: Main window now named "Foundry Debugger".
-
-Fri Oct 24 14:03:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * manage.tcl (manage_menu): Deleted.
- (manage_delete): Notify IDE when windows are deleted.
- (manage_raise): New function.
- (manage_create): Notify IDE when a window is created.
-
- * download.tcl (constructor): Put focus on download
- window.
-
- * toolbar.tcl (create_menu_items): Make "Window" menu
- and IDE managed-menu, but don't put anything in it.
-
-Fri Oct 24 12:28:43 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * toolbar.tcl (create_menu_items): Add View menu.
-
- * src.tcl (config_win): Add accelerators for new View
- menu.
-
-Wed Oct 22 21:30:52 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * download.tcl (Download): Make window local modal.
- Raise it to top.
-
- * srcbar.tcl (create_buttons): Change border size on
- address and line labels. Change balloon help. Remove
- vertical line.
-
-Mon Oct 20 10:12:23 1997 Tom Tromey <tromey@cygnus.com>
-
- * toolbar.tcl (create_buttons): vmake window now named "Foundry
- Project".
-
-Mon Oct 13 19:02:33 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * bp.tcl (bp_modify): Change color of checkbuttons.
-
- * download.tcl (done): Write "DONE" on progress meters.
-
-Thu Oct 9 14:33:21 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * main.tcl: Call ide_window_register restorer.
-
-Thu Oct 9 12:46:25 1997 Tom Tromey <tromey@cygnus.com>
-
- * src.tcl (updateBalloon): Changed name of balloon variable.
- (showBalloon): Likewise. Use new "balloon show" command.
- (SrcBalloon): Removed.
- (TimeOut): Default is 1000 (1 second).
-
-Wed Oct 1 11:33:36 1997 Tom Tromey <tromey@cygnus.com>
-
- * main.tcl: Use "manage get_state" as window saver.
-
- * manage.tcl (manage): Added "restore", "get_state" options.
- (manage_restore): New proc.
- (manage_get_state): Likewise.
- (manage_register_defaults): Use "manage get_state" as window
- saver.
-
-Sun Sep 28 04:20:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * bp.tcl: Clean up the spacing to make the widget look better.
-
- * download_pref.tcl: Show the initial baud rate correctly.
-
- * download.tcl: Cleanup correctly when deleted.
-
- * main.tcl (gdb_tcl_preloop): Set baud rate.
- (ide_run_server): Delay download 1 second.
- (demo_it): Do gdb "next" commands every 2 seconds.
-
- * manage.tcl (manage_create): Withdraw window immediately then
- deiconify it when done.
-
- * prefs.tcl (pref_set_defaults): Don't define stack bg color.
-
- * register.tcl: Withdraw window immediately so we don't have
- to watch it slowly draw. Make it look more like memory window.
-
- * src.tcl: Fix major bug where source window got lost when
- the source file was not found. Reconfigures more smoothly.
-
- * srcbar.tcl (create_menu_items): Comment out "Close Debugger"
- menu item because it was broken.
-
- * stack.tcl: Use the same background color as the other windows.
-
- * toolbar.tcl: Add "Automatic Step" menu item.
-
-Fri Sep 26 21:10:11 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * download.tcl (done): display bytes loaded as an integer.
-
-Fri Sep 26 13:09:47 1997 Tom Tromey <tromey@cygnus.com>
-
- * images2/edit.gif: Replaced.
-
-Fri Sep 26 00:42:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * main.tcl (ide_run_server): Just call download.
- (download): First set baud rate then target. Then, depending
- on preferences set a breakpoint at 'main' and 'exit' and run.
- (set_baud): New function.
-
- * download_pref.tcl (build_win) Add checkbuttons for "Run until
- 'main'" and "Set breakpoint at 'exit'.
- (change_baud): Set preference when baud changes.
-
- * pref.tcl (reconfig): Correct problem with download options.
-
- * prefs.tcl (pref_set_defaults): Define gdb/load/main,
- gdb/load/exit, and gdb/load/baud.
-
- * src.tcl (location): Fix a problem where the browse tag was
- sometimes not deleted.
-
- * manage.tcl: Add a window title for Download Options.
-
-Thu Sep 25 15:39:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * download_pref.tcl: New file. Creates a download options dialog.
-
- * manage.tcl: Add download prefs window to list.
-
- * toolbar.tcl: Add Download preferences to menu.
-
- * pref.tcl: Add Download to tab notebook preferences.
-
- * src.tcl: Set activebackground on popup to indicate color
- of the breakpoint dot that will be set.
-
-Thu Sep 25 12:36:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * download.tcl (done): Make sure all indicators show download
- completed, even if we weren't properly notified.
-
- * manage.tcl: Better support for windows that want to set
- their own titles.
-
- * src.tcl (update_title): New function. Sets titlebar
- to indicate current filename, and under IDE, executable and
- target.
-
- * images2/reg.gif: Updated image.
-
-Thu Sep 25 08:58:44 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * src.tcl (config_win): don't focus src window on Enter events
-
-Thu Sep 25 03:11:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * main.tcl (ide_run_server): Set target and download automatically.
- (download): Open a download window.
-
- * download.tcl: New file. Implements a download window.
-
- * manage.tcl (manage_init): Add download window.
- (manage_create): If there is no title, don't try to set one and
- don't try to set geometry.
-
- * registers.tcl: Make it look more like memory window.
-
- * toolbar.tcl, floatbar.tcl, srcbar.tcl: Update look of menus and toolbars
- to be closer to prototype.
-
- * Makefile: Add download.tcl.
-
- * tclIndex: Rebuilt.
-
- * images/memory.gif: Update.
-
- * images/bp.gif: New file. Breakpoint icon.
-
-Wed Sep 24 07:43:47 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * variables.tcl (VariableWin::build_win): add double-click binding to edit
- (editXY): new method to support above
-
- * prefs.tcl (pref_set_defaults): add register window pref for highlight color
-
- * register.tcl (RegWin::constructor): set highlight and normal fg
- (build_win): build window using grid geometry manager, not grid widget
- (dimensions): new method
- (fixLength): new method
- (but3): use "Menu" (protected data)
- (edit): use entry to edit values
- (acceptEdit): new method
- (unedit): new method
- (update): change to use new grid layout and change highlighting
- (reconfig): destroy scrolled window, too
- ScrolledWin: new protected data
- Menu: new protected data
- Editing: new protected data
-
-Tue Sep 23 15:15:22 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * main.tcl: If GDBTK_IDE, withdraw . before making any calls
- across the IDE backplane.
- * manage.tcl (manage_init): If using a floating toolbar, and
- GDBTK_IDE, deiconify . to undo the withdrawal.
-
-Tue Sep 23 01:31:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * main.tcl: Reorder calls to pref init and standard_look_and_feel.
-
- * global_pref.tcl: Change font requester to modify both src-font
- and global.fixed. Change to be compatible with latest libide font code.
-
- * prefs.tcl: Changes to get working with latest libide font code.
-
-Mon Sep 22 15:16:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * memory.tcl: Add editing. Remove debugging lines.
- Fix problems with resizing.
-
- * mem_pref.tcl: Remove debugging line.
-
-Fri Sep 19 08:22:25 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * variables.tcl (build_win): use preferences
- (getAllClassMembers): new method
- (getPath): update to support C++
-
- * watch.tcl (build_win): augment parent class' build_win instead of replacing it
-
- * stack.tcl (build_win): use preferences
- (update): catch gdb_loc in case source window is not open yet
-
- * prefs.tcl (pref_set_defaults): add new defaults for all previously
- hard-coded fonts and colors
-
- * global_pref.tcl (build_win): use preferences
-
- * console.tcl (Console::constructor): use preferences
-
- * bp.tcl (bp_add): use preferences
- (bp_modify): use preferences
-
-
- * src.tcl (SrcWin::constructor): use preferences
- (build_win): use preferences
- (config_win): use preferences, bind <Enter> to focus source window textbox
- so that our keypresses always work
- (SrcBalloon): new protected variable
- (TimeOut): new common variable
-
-Wed Sep 17 13:54:29 1997 Tom Tromey <tromey@cygnus.com>
-
- * toolbar.tcl (build_win): Use standard_toolbar.
-
-Wed Sep 17 13:52:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (config_win): Set bg color back to default.
-
-Tue Sep 16 23:10:00 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * images2/*: Delete unused icons.
-
-Tue Sep 16 21:30:40 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * bp.tcl (bp_add): Add some padding to space things
- out more. Anchor labels to the right side.
-
- * src.tcl: Fix problem where breakpoints were disappearing
- when files changed.
-
-Tue Sep 16 17:45:05 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * manage.tcl: Change manage_create and manage_open to accept
- a variable number of args. Add mem and mempref window types.
- Fix pref save call.
-
- * memory.tcl: New file. Implements a memory dump window.
- Currently read-only.
-
- * mem_pref.tcl: New file. Implements options dialog for
- memory dump window.
-
- * pref.tcl, toolbar_pref.tcl, register.tcl, src_pref.tcl,
- global_pref.tcl, about.tcl: Make "attach" a public config
- variable.
-
- * main.tcl: Use standard_look_and_feel.
-
- * Makefile, tclIndex: Rebuilt.
-
- * images/check.gif: A check mark image.
-
- * images/stop.gif: Fix transparency.
-
-Tue Sep 16 08:13:03 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * src.tcl (getVariable): fix off by one error when a breakpoint
- is set at a line
- (hasBreakpoint): new method
- (SrcWin): add idle hook for source balloons
- (updateBalloon): new method
- (showBalloon): use register_balloon
- (register_balloon): new method
-
-Tue Sep 16 05:55:31 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * watch.tcl (add): use a little more robust (if more obscure) method
- of determining validity of a variable name
- (label): translate % to $ in names
-
- * variables.tcl (Variable::setType): allow for convenience variables
- (Variable::isConvenience): new method
- (Variable::displayHex): allow for convenience variables
- (VariableWin::edit): do not eval $data when editing (for conv. vars)
- (VariableWin::postMenu): use virtual method label to title popup
-
-Fri Sep 12 12:17:13 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * variables.tcl (Variable::value): when no display style specified,
- choose some reasonable default for the given type
-
- * src.tcl (config_win): ad bindings to support variable balloons in source mode
- (getVariable): new method
- (cancelMotion): new method
- (motion): new method
- (showBalloon): new method
- timeoutID: new protected variable
- TimeOut: new protected variable
-
-Fri Sep 12 05:47:56 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * variables.tcl (getLocals): return empty list when no locals present.
-
-Thu Sep 11 14:13:19 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * variables.tcl (VariableWin::build_win): change popup construction
- (VariableWin::postMenu): redo menu layout to use dynamic idices of
- panes
- (VariableWin::edit): new method
- (VariableWin::UnEdit): new method
- (VariableWin::changeValue): new method
- (VariableWin::getPath): handle unamed unions/structs and arrays more
- intelligently
- VariableWin::Editing: new protected variable
- VariableWin::EditEntry: new protected variable
- (Variable::isOpenable): make sure we can open unions
- (Variable::isUnamed): new method
- (Variable::isUnion): new method
- (Variable::setType): handle unions and unamed structs/unions better
- (Variable::displayHex): unions, structs only display in hex
- (Variable::isArray): new method
- (Variable::isEnum): new method
- (Variable::isEditable): new method
- (Variable::value): enums now show symbol values, too. Analogous to char
- and char*.
-
- * watch.tcl (WatchWin::build_win): change popup construction
- (WatchWin::postMenu): redo menu layout to use dynamic indices of panes
-
-
-Wed Sep 10 20:44:12 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * manage.tcl (manage_register_defaults): Rename from
- manage_register_default. Take a list of windows.
- (manage_menu): Invoke manage_register_defaults once as an idle
- callback, rather than invoking manage_register_default in many
- different idle callbacks.
-
-Wed Sep 10 00:49:23 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (edit): Don't start editor if we're not
- debugging anything.
-
- * main.tcl: Keep correct colorscheme for windows.
-
-Mon Sep 8 12:10:26 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * manage.tcl (manage_restart): Only restart toolbar once.
-
- * global_pref.tcl: Minor fix.
-
- * images2/vmake.gif: Fix transparency.
-
-Mon Sep 8 13:05:11 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * interface.tcl (gdbtk_tcl_query): Use tk_messageBox rather than
- tk_dialog.
-
- * main.tcl: Register check and exit handlers using new commands
- provided by gdbtk.
-
-Mon Sep 8 03:01:25 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * global_pref.tcl (build_win): Some font fixes.
-
-Mon Sep 8 02:25:17 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl: Make disabled breakpoints black.
- Make comboboxes only use scrollbars when needed.
-
- * interface.tcl (gdbtk_tcl_breakpoint): Change to support
- changes in gdbtk.c. Supply breakpoint number to hooks.
-
- * manage.tcl: Add breakpoint window. Add support for
- dynamically attaching/detaching toolbars.
-
- * bp.tcl: New file. Breakpoint window.
-
- * main.tcl: Change palette for debugging.
-
- * pref.tcl: New file. Preferences dialog.
-
- * floatbar.tcl: Add target and download buttons.
- Add spacing.
-
- * srcbar.tcl, toolbar.tcl: Change to use flat icons. Work with
- floating toolbar if requested.
-
- * prefs.tcl: Define new preferences to force toolbar
- to float or be attached to the source windows.
-
- * global_pref.tcl: Remove icon requester.
-
- * toolbar_pref.tcl: Add icon combobox. Add checkbuttons
- for forcing toolbar to either float or be attached to src window.
-
- * Makefile: Add bp.tcl
-
- * images/*: Fix transparency and add new icons.
-
- * images2/*: Add flat icons.
-
-Fri Sep 5 20:24:07 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * main.tcl: Register an exit handler when using the IDE.
-
-Thu Sep 4 11:47:38 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * ALL: Change preferences to use new preferences.
- Change "dbug" calls to "debug".
-
- * pref.tcl: New file. Local preferences read/write.
-
- * gettext.tcl, debug.tcl, balloon.tcl: Delete. Use
- versions from libide instead.
-
-Wed Sep 3 09:20:13 1997 Tom Tromey <tromey@cygnus.com>
-
- * main.tcl (add): Pass idewindow_no_state to idewindow_proc.
- * manage.tcl (manage_register_default): Pass idewindow_no_state to
- idewindow_proc.
-
-Mon Aug 25 05:59:01 1997 Martin M. Hunt <hunt@pern.cygnus.com>
-
- * images2/{finished.gif, finishedu.gif, nextd.gif nextu.gif,
- stepd.gif, stepu.gif}: Use icons with straight brackets
- instead of slanted.
-
- * prefs.tcl (pref_set_defaults): Set default debugMode to 0.
-
- * register.tcl (build_win): Change font to fixed and bg to white.
-
- * src.tcl: Change all references to fonts to "src-font".
-
- * global_pref.tcl: Change font requester to do src-font.
-
- * srcbar.tcl: Change address and line labels to use
- src-font and be sunken.
-
- * stack.tcl: Chnage bg to white and fonr to src-font.
-
-Mon Aug 25 03:06:35 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * src.tcl: (set_status) check if inferior is running first, and reset
- message for status window if it is not.
-
-
-Mon Aug 25 00:28:39 1997 Martin M. Hunt <hunt@pern.cygnus.com>
-
- * srcbar.tcl: Change stack images to be consistent with others.
-
- * images2/{upu.gif,upd.gif,bottomd.gif,bottomu.gif,downu.gif,
- downd.gif}: New stack images.
-
- * images2/edit[ud].gif: Correct quantization and transparency.
-
- * manage.tcl (manage_delete): Kill gdb when all source windows
- are deleted.
- (manage_create): Only add IDE entries on the first source window.
-
- * src.tcl (do_popup): Don't map window if already mapped. Fixes
- problem with tk_popup. Change menu items.
-
-Mon Aug 25 00:24:43 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * src.tcl: (set_status) change to using gdb_target_has_execution to
- determine if the target is running
-
-Sun Aug 24 23:02:19 1997 Tom Tromey <tromey@cygnus.com>
-
- * toolbar.tcl (build_win): Make sure object is deleted when window
- is destroyed.
- (destructor): Don't destroy containing widget; just us.
-
- * srcbar.tcl (create_menu_items): Added Exit item to menu.
-
- * src.tcl (build_win): Use grid, not packer, to lay out main
- window.
- (mode): Pack new text widget into pane; don't repack the pane
- itself.
-
-Sun Aug 24 22:06:30 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * varialbes.tcl: (build_win) set hlist font to 'tix option get
- fixed_font', change selectBackground to Hlist background, select-
- BorderWidth to 0, selectForeground to black. Use tk_popup instead of
- tixPopup widget.
- (postMenu) make necessary tk_popup changes, make sure functions are
- only allowed to be displayed in hex.
- (isFunction) new method
- (displayHex) functions only displayable as hex
- (value) extract the address of functions for value
- * watch.tcl: (constructor) remove popup menu customization
- (build_win) change from tixPopup to tk_popup, hack the
- hlist options to use the correct font, etc as in variables.tcl,
- (validateEntry) always erase the contents of the entry
- (postMenu) make all changes to use tk_popup and move the "Stop
- watching" menu addition here
- (label) make sure that we use "foo.bar" and "foo->bar" correctly
- (add) fix typo preventing recognition of variables already being
- watched
-
-Sun Aug 24 18:49:16 1997 Martin M. Hunt <hunt@pern.cygnus.com>
-
- * console.tcl (invoke): Don't display error messages in console window.
- (constructor): Enable cut-and-paste. Fix intermittant bug.
-
- * main.tcl (gdbtk_tcl_preloop): Don't automatically do anything
- but issue the file command.
- (download): Issue load command. Called when icon is selected.
- (set_target): Issue target command. Called when target
- icon is selected.
-
- * srcbar.tcl: Add target and download buttons to toolbar.
-
-Sun Aug 24 20:30:41 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * main.tcl (gdbtk_tcl_preloop): If GDBTK_IDE, then automatically
- set file and target based on properties. If using the simulator,
- load the executable. Catch and ignore errors from setting the
- source window to show main.
-
-Sun Aug 24 14:39:23 1997 Tom Tromey <tromey@cygnus.com>
-
- * src.tcl (constructor): Don't set `editor'.
- (location): Never update external editor.
- (edit): Don't set `editor'.
- (editor): Removed instance variable.
-
- * images2/stepiu.gif, images2/stepid.gif, images2/nextiu.gif,
- images2/nextid.gif: Installed new versions.
-
- * srcbar.tcl (_toggle_updates): Pass $updatevalue to
- updatecommand.
- (destructor): Implemented.
- (_set_stepi): New method.
- (displaymode): Run _set_stepi when changed.
- (updatevalue): Global state stored in global array.
- (create_buttons): Create stepi, nexti buttons. Run _set_stepi.
- (_load_src_images): Create stepi, nexti icons.
-
- * images2/stepiu.gif, images2/stepid.gif, images2/nextiu.gif,
- images2/nextid.gif: New images.
- (create_buttons): Likewise.
-
- * src.tcl (toggle_updates): Use $value, not $a.
-
- * src.tcl (mode): Don't change commands on (nonexistent) step/next
- buttons.
-
- * toolbar.tcl (create_buttons): Added watch button.
- (_load_images): Create watch images.
- * images2/watchd.gif, images2/watchu.gif: New files.
- * images2/varsd.gif, images2/varsu.gif: Changed.
-
- * images2/*: Removed old images, added many new images.
-
- * prefs.tcl (pref_set_defaults): Default images are in images2
- directory.
- * src.tcl (build_win): Make a GDBSrcBar.
- (location): address and line information now in toolbar.
- (mode): Set -displaymode on toolbar.
- (update): Set -running on toolbar.
- (busy): Likewise.
- (edit): Now a method, not a proc.
- (toggle_updates): Added "value" argument.
- * Makefile (TCL): Added srcbar.tcl, floatbar.tcl.
- * toolbar.tcl (create_buttons): New method.
- (create_menu_items): Likewise.
- (build_win): Run create_menu_items and create_buttons. Move most
- of body into these methods. Removed Exit command from File menu.
- (_loaded_images): New common variable.
- (_load_images): New method.
- (create_buttons): Run it.
- (create_menu_items): Removed Tools menu.
- (configure): Renamed from config.
- * srcbar.tcl: New file. Implements toolbar attached to source
- window.
- * floatbar.tcl: New file. Implements floating toolbar.
- * manage.tcl (manage_init): toolbar-type is GDBFloatBar.
- (manage_init): Don't create toolbar if running under IDE.
-
-Sun Aug 24 13:05:22 1997 Martin M. Hunt <hunt@pern.cygnus.com>
-
- * manage.tcl (manage_init): Remove idemenuname from
- the _manage_objects array; it was redundant.
- (manage_create): Stop notifying IDE about new transient
- windows.
-
-Sun Aug 24 01:07:29 1997 Tom Tromey <tromey@cygnus.com>
-
- * about.tcl, console.tcl, global_pref.tcl, prefs.tcl,
- register.tcl, src.tcl, src_pref.tcl, stack.tcl, toolbar.tcl,
- toolbar_pref.tcl: Added Copyright statement.
-
- * Makefile (tags, TAGS): New targets.
-
- * toolbar.tcl (build_win): Quit->Exit. Only display this item if
- not using the IDE.
-
-Sat Aug 23 21:55:54 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * src.tcl (SrcWin update): Set command for stop icon.
- (SrcWin busy): Likewise.
-
- * manage.tcl: Move comments out of array initialization.
-
-Sat Aug 23 17:36:06 1997 Martin M. Hunt <hunt@pern.cygnus.com>
-
- * src.tcl (name): Handle case where files are part of the
- sources, but are unreadable.
- (build_win): Set filename combobox size to default.
-
- * manage.tcl: Remove breakpoint window from window list.
-
-Sat Aug 23 16:49:53 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * src.tcl: remove old breakdot stuff
- (reconfig) make sure we redraw the breakdots when font changes
- (file) check for duplicate break-able lines
- * variables.tcl: remove debug output
- * watch.tcl: add entry field to enter watch expressions
-
-Sat Aug 23 17:44:45 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * manage.tcl (manage_create): Register the window if it is not
- already registered, rather than if it is already registered.
-
- * src.tcl (SrcWin config_win): Add special double and triple click
- bindings to override standard text bindings in break dot area.
-
- * prefs.tcl (pref_set_defaults): Set the global font to the Tix
- default font. Set the src font to the Tix default fixed font.
- * src.tcl (SrcWin config_win): Configure the text font.
- * console.tcl (Console constructor): Set the cont to the Tix
- fixed font.
-
-Fri Aug 22 20:42:51 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * src.tcl: add breakpoint image that is text-size insensitive
- change layout of source, assembly, and mixed windows to use
- tabs, if possible, allowing more clickable area for toggling
- breakpoints, etc.
- * variables.tcl: (VariableWin::isFloat) new method
- (VariableWin::value) make sure floats are output as floats
- when user specifies "decimal" output
-
-Fri Aug 22 16:23:32 1997 Martin M. Hunt <hunt@pern.cygnus.com>
-
- * src.tcl (goto_func): Catch errors.
-
-Fri Aug 22 16:35:39 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * main.tcl: Use underscores rather than dashes in variable names.
- (ide_run_server): Make gdb_target_name global. Call file before
- calling target. Call load before calling run.
-
-Fri Aug 22 12:15:06 1997 Martin M. Hunt <hunt@pern.cygnus.com>
-
- * debug.tcl (dbug): Make debug window scrolled. Make it
- work with standalone gdb.
-
- * prefs.tcl (pref_save): Fix puts that were incorrectly
- changed to dbug.
-
-Thu Aug 21 17:57:59 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * ALL: Change all "puts" to "dbug".
-
- * debug.tcl: New file. Opens a window for debugging messages.
-
-Thu Aug 21 14:30:53 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * watch.tcl: (add) strip commas, too
-
-Thu Aug 21 14:26:36 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * variables.tcl: (buid_win) use listbox's font for font measuring
-
-Thu Aug 21 02:52:35 1997 Martin M. Hunt <hunt@pern.cygnus.com>
-
- * src.tcl (name): Check source filenames and handle errors
- if not found.
-
- * variables.tcl (destructor): Display styles are not
- objects so must be destroyed instead of deleted.
- (name): comment out debugging line.
-
- * main.tcl: Add stuff from standard_look_and_feel.
-
- * prefs.tcl, manage.tcl: Minor cleanup.
-
-Thu Aug 21 00:39:35 1997 Martin M. Hunt <hunt@pern.cygnus.com>
-
- * main.tcl (ide_run_server) New function. Starts GDB when
- asked politely.
- (target_name): New function. Watches for changes in the target
- name.
- (exe_name): New function. Watches for changes in the
- executable name.
-
- * console.tcl (insert, einsert): Scroll so the insertion
- point can be seen.
-
- * manage.tcl: SPecial hacks to create a global "console".
- Needed because we can't have puts searching for a console
- window everytime a puts arrives.
-
- * interface.tcl (gdbtk_tcl_fputs, gdbtk_tcl_fputs_error):
- Write to the console if one exists, and do an update.
-
- * tclIndex: Rebuilt.
-
-Wed Aug 20 17:23:07 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * variables.tcl: (Variable::setType VariableWin::getPath) handle types
- with multiple names (unsigned char, long long unsigned int) properly
- * locals.tcl: (update) comment out debug info
-
-Wed Aug 20 16:36:49 1997 Keith Seitz <keiths@pizza.cygnus.com>
-
- * watch.tcl: (add) try to handle errors more gracefully
- * variables.tcl: (value) make sure we handle bad pointer
- dereferences nicely
- (lots of places) switch to using 'ouput' instead of 'print'
-
-Wed Aug 20 11:43:35 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (file): Handle case where source files do
- not have any lines which generate code.
- (set_status): Keep status to one line.
-
-Wed Aug 20 00:00:52 1997 Tom Tromey <tromey@sanguine.cygnus.com>
-
- * images2/build.gif, images2/file.gif, images2/reg.gif,
- images2/stop.gif, images2/continue.gif, images2/finish.gif,
- images2/next.gif, images2/step.gif, images2/run.gif: New files.
-
-Tue Aug 19 14:52:59 1997 Keith Seitz <keiths@onions.cygnus.com>
-
- * tclIndex: rebuilt
- * Makefile: add variables.tcl, watch.tcl, and locals.tcl
- * manage.tcl: (manage_init): add locals window
- * src.tcl: (do_popup): add binding for watch window
- (addToWatch): new method
- * locals.tcl: new file
- * variables.tcl: new file
- * watch.tcl: new file
-
-
-Mon Aug 18 01:28:19 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * manage.tcl: Change window names to have only first
- char of each word capitalized.
-
- * global_pref.tcl (get_file): Handle bad pathnames.
-
-Sun Aug 17 01:59:02 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * register.tcl (destructor): Call manage delete.
- * global_pref.tcl (destructor): Call manage delete.
- * prefs.tcl (destructor): Call manage delete.
- * src_pref.tcl (destructor): Call manage delete.
- * toolbar_pref.tcl (destructor): Call manage delete.
-
- * manage.tcl: (manage_delete): Remove windows that
- have been quit, rather than killed by window manager.
-
- * src.tcl (location): Don't call gdb_listfuncs on
- NULL filenames.
-
-Sun Aug 17 00:18:02 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl: Major changes to support file browsing.
- Also bug fixes for assembly mode, new comboboxes
- for filename and function selection.
-
- * src_pref.tcl: New file. Allows selection of
- colors used in source display.
-
- * prefs.tcl: Add new window type for src prefs.
- Set default colors for source window.
-
- * manage.tcl (manage_init): Add srcpref window type.
- (manage_restart): Preserve window geometries on restarts.
-
- * Makefile: Add src_pref.tcl.
-
- * tclIndex: Rebuilt.
-
- * toolbar.tcl: Add call to source prefs.
-
- * main.tcl: Change initial "src file" call to
- "src location".
-
-Thu Aug 14 15:49:02 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * manage.tcl (manage_create): Some fixes for IDE windows.
-
-Thu Aug 14 03:18:10 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * register.tcl, stack.tcl (destructor): Remove hook.
-
- * manage.tcl: Mostly rewritten from scratch to be
- more efficient and handle multiple windows of the same type.
- (manage_open): New function opens or creates a window
- as necessary.
- (manage_create): Now always creates a new window.
-
- * global_pref.tcl (build_win): Only put up font message
- box on Unix systems.
-
- * main.tcl: Change "manage create" calls to "manage open"
-
- * src (destructor): Remove hooks.
- (do_popup): Add a menu item to open another source window.
-
- * toolbar.tcl (build_win): Change "manage create" calls to
- "manage open". Bind button 3 on iconbar to "manage create".
-
- * prefs.tcl: Changes required for new features in manage.tcl.
-
- * tclIndex: Rebuilt.
-
- * hooks.tcl (remove_hook): Fix.
- (lremove): New function.
-
-Tue Aug 12 16:06:04 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * main.tcl: If running in the IDE, register the source window as
- the generic gdb window.
-
-Tue Aug 12 01:42:10 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * global_pref.tcl (build_win): Add a font size control
- widget, and a font preview window. Implement scanning
- for fixed-width fonts and a font cache.
- (font_changed): Save all font attributes in new-style
- font description.
-
- * balloon.tcl: Merge in latest changes from libide.
-
- * prefs.tcl (pref): Rename variables to make function
- clearer.
- (pref_init): After reading in prefs file, create
- all named fonts.
- (pref_set_defaults): Set default font to {courier 12 roman}.
-
-Mon Aug 11 13:47:49 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * tclIndex: New file.
-
- * Makefile: New file. Generates tclIndex when needed.
-
- * manage.tcl (manage_init): Add an icon for GDB.
- (manage_create): Bind Map and Unmap for toolbar toplevel.
- Tell window manager to display icon if one exists.
- (manage_iconify): Iconify or deiconify all windows.
- (make_icon_window): Build a window with an icon in it.
- (bind_for_toplevel_only): Local copy, because if you build
- GDB without IDE you won't get the one in libide.
-
- * main.tcl: Remove all the source commands.
-
- * toolbar.tcl: Use "-menu" configuration option for toplevel.
-
- * images/cygnus_icon.gif: A cygnus logo with GDB on it.
- For Unix window managers.
-
-Fri Aug 8 16:01:20 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * manage.tcl (manage): Add menu subcommand.
- (manage_init): Add -menu, -menuname, and -idemenuname options for
- all the windows.
- (manage_create): Register transient windows.
- (manage_menu, manage_register_default): New procedures.
- * toolbar.tcl (build_win): Call manage_menu to set up the window
- menu.
-
-Thu Aug 7 16:51:43 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * stack.tcl: Bind button 1 to select current
- frame. Add balloonhelp.
-
-Thu Aug 7 14:00:18 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * main.tcl, manage.tcl, toolbar.tcl: Add support
- for stack window.
-
- * stack.tcl, images/stack.gif: New files.
-
- * ALL: Change "::" to "@@" for itcl1.5/tcl8.0. You
- muct now use tcl8 for gdbtk to work.
-
-Tue Aug 5 12:10:43 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * register.tcl, global_pref.tcl: Change color "darkred"
- to red so it will work on windows.
-
-Tue Aug 5 12:01:26 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * manage.tcl (manage_init): Unset prefs are now ""
- instead of 0.
-
-Tue Aug 5 02:21:47 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * images*/run.gif: Change to green again.
-
-Tue Aug 5 01:42:56 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * main.tcl: Source register.tcl
-
- * register.tcl: New file. Editable register window
- and register preferences.
-
- * toolbar.tcl: Add hooks for register prefs.
-
- * manage.tcl: Add register window to list of windows.
- Deiconify windows when requested.
-
- * src.tcl: Minor changes.
-
- * global_pref.tcl: Bind return key to image dir entry
- widget.
-
- * prefs.tcl: Add register prefs to notebook widget.
- Change default for pref get to {} instead of 0.
-
-Fri Aug 1 14:21:25 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * images/*: Smaller toolbar icons. Fix some gifs
- to be transparent.
-
-Thu Jul 31 01:20:51 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (mode): Don't try to display EDIT button
- in any mode.
-
-Thu Jul 31 00:56:26 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * global_pref.tcl (build_win): Add ComboBox for simple font selection.
-
- * prefs.tcl (pref_init): Allow "option" commands in init file.
-
- * src.tcl: Remove EDIT button. Change fonts to use global font if
- no src font is specified.
-
- * toolbar.tcl: Enable Tools/Edit pulldown menu.
-
-Wed Jul 30 14:43:49 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * about.tcl (build_win): Set bg to white for Cygnus gif.
-
-Wed Jul 30 14:39:49 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * manage.tcl (manage_create): Fix window raising.
-
-Wed Jul 30 13:40:11 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * initial checkin.
-
diff --git a/gdb/gdbtk/library/ChangeLog-1998 b/gdb/gdbtk/library/ChangeLog-1998
deleted file mode 100644
index e44f3fc7a2a..00000000000
--- a/gdb/gdbtk/library/ChangeLog-1998
+++ /dev/null
@@ -1,3486 +0,0 @@
-Mon Dec 21 14:12:14 1998 Keith Seitz <keiths@cygnus.com>
-
- * manage.tcl (manage_create): Set window geometry after window is
- created.
-
- * prefs.tcl (pref_save): Save out preferences for memory window, too.
-
-Thu Dec 17 08:54:37 1998 Keith Seitz <keiths@cygnus.com>
-
- * browser.tcl (fill_source): Strip off any function args
- which could arise from C++ function names.
- (search): Be careful of C++ functions with spaces in the name
- returned from gdb_search.
-
-Tue Dec 15 13:24:42 1998 Keith Seitz <keiths@cygnus.com>
-
- * prefs.tcl (escape_value, unescape_value): New procs to
- escape equal signs in preference values.
- (pref_read): Use unescape_value whenever prefs are read.
- (pref_save): Use escape_value whenever prefs are saved..
-
-Tue Dec 15 11:07:01 1998 Keith Seitz <keiths@cygnus.com>
-
- * process.tcl (build_win): Do not export the listbox's selection
- as the X selection so that multiple listboxes can have selections
- highlighted at the same time.
-
- * stack.tcl (build_win): Ditto.
-
-Mon Dec 14 15:53:38 1998 Keith Seitz <keiths@cygnus.com>
-
- * watch.tcl (update): Catch errors to getLocals, which could error
- if no symbol table is loaded.
-
- * locals.tcl (update): Ditto.
-
-1998-11-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * kod.tcl: fix <Double-1> command spec for listbox.
-
-1998-11-13 Martin M. Hunt <hunt@cygnus.com>
-
- * srctextwin.tcl (bp): Pass "asm" argument to do_bp.
- (do_bp): Use asm argument to determine whether to
- check for multiple bps on the same src line. Remove
- redundant "if" statement.
-
-1998-11-12 Martin M. Hunt <hunt@cygnus.com>
-
- * srctextwin.tcl (do_bp): Fix multiple assembly
- breakpoints mapping to the same line number.
-
-Thu Nov 12 15:20:15 1998 Jim Ingham <jingham@cygnus.com>
-
- * console.tcl (complete): I added the ability to pass from_tty
- from gdb_cmd to the underlying commands. Pass 1 when the
- command is invoked from the console.
-
- * interface.tcl (gdbtk_tcl_tstart, gdbtk_tcl_tstop): Run the
- src window's do_tstop method rather than manipulating the
- widgets by hand.
-
- * src.tcl (build_win): Redo the packing so that the function
- combobox doesn't push all the other combo-boxes off the screen
- if it has a very long function name in it.
-
- * srcbar.tcl (do_tstop): Added a mode that just changes the
- GUI, which can be called from console hooks.
-
- * srctextwin.tcl: Fixed some bugs I introduced in setting
- breakpoints in the assembly & mixed mode windows. Dropped
- the notion of joint breakpoint images for lines that have
- breakpoints of two separate types. Too fragile.
- Also added the "dont_change_appearance" flag, used in the
- continue_to_here method to tell the GUI not to reflect the
- temporary disabling of all the breakpoints.
-
- * toolbar.tcl (insert_buttons): Added a little more error-checking.
-
-Wed Nov 11 08:40:04 1998 Fernando Nasser <fnasser@cygnus.com>
-
- * kod.c: adjusted sizes and packing options of widgets
-
-1998-11-10 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * main.tcl: small fix to the kod code as requested by the maintainers
- * kod.tcl: use show kod and info <kod cmd> as per spec
-
-Mon Nov 9 17:00:45 1998 Fernando Nasser <fnasser@cygnus.com>
-
- * kod.tcl: New file that implements the Kernel Object Display window
- * Makefile: added kod.tcl
- * main.tcl: test for kod support
- * manage.tcl (manage_init): support for kod
- * prefs.tcl (pref_save, pref_set_defaults): ibid
- * scrtextwin.tcl (config_win, do_key): ibid
- * toolbar.tcl (_load_images, create_window_buttons,
- create_view_menu): ibid
- * tclIndex: regen
-
-Mon Nov 9 12:09:48 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
-
- * actiondlg.tcl: Customize the stack collect string to collect
- the FP reg plus 64 words of stack mem. This will work for many
- targets. As noted in earlier comment, we need a way to configure
- this to the specific target.
-
-Wed Nov 4 12:41:42 1998 Jim Ingham <jingham@cygnus.com>
-
- * actiondlg.tcl: Get the stack collect string from an instance
- variable. Need to implement some way to get this from the
- target settings...
- * global_pref.tcl (toggle_tracing_mode): Add & remove hooks
- when you go in and out of tracing mode. Also reset the B1
- behavior when you leave tracing mode
- * interface.tcl (gdbtk_tcl_trace_find_hook): Added the trace
- find hook, so you can switch the GUI state when the tfind
- command is used to enter & leave browse mode.
- * srcbar.tcl (constructor, destructor trace_find_hook): Added
- the trace_find_hook to the source toolbar, and added the
- necessary hooks to handle it.
- * srctextwin.tcl (trace_find_hook): Added a trace find hook to
- the sourcebar as well.
- * stack.tcl (update): protect against errors in gdb_stack.
- Just return "NO STACK" if we couldn't get it.
- * src_pref.tcl (constructor, cancel): Put all the saved prefs
- in an array, on cancel, see if any have changed and only
- rebuild the window if there have been changes.
-
-1998-11-03 Keith Seitz <keiths@cygnus.com>
-
- * target.tcl: Add ice target.
- (GdbLoadPref): Add "after_attaching" preference.
- (set_saved): Add "after_attaching" preference.
- (write_saved): Add "after_attaching" preference.
- (change_target): Add "after_attaching" preference.
- (build_win): Add "after_attaching" entry to options
- frame.
-
- * main.tcl (set_target_name): Add ice target.
- (set_target): If an "after_attaching" preference exists,
- run it.
-
-Mon Nov 2 13:24:10 1998 Jim Ingham <jingham@cygnus.com>
-
- * bp.tcl (update): The hook function was passing more
- arguments than this function expected.
-
-Mon Nov 2 11:16:10 1998 Jim Ingham <jingham@cygnus.com>
-
- * toolbar.tcl: Added Tdump image.
-
-Fri Oct 30 17:36:05 1998 Jim Ingham <jingham@cygnus.com>
-
- * src.tcl (set_execution_status): Changed status messages,
- tracing is not the same as async debugging...
-
-Fri Oct 30 17:06:31 1998 Jim Ingham <jingham@cygnus.com>
-
- * bp.tcl (bp_all): Only remove tracepoints in the tracepoint
- window, and breakpoints in the breakpoint window.
-
-Fri Oct 30 11:22:23 1998 Jim Ingham <jingham@cygnus.com>
-
- * actiondlg.tcl: Added special tag "Collect Stack". This
- still needs to get hooked into the target database to deal
- with targets that need to do something special to collect the
- stack. Also moved some repeated code into loops.
- * main.tcl (source_file): Source in a file of gdb commands.
- * srcbar.tcl (constructor): Added source file menu entry, and
- made stack buttons belong to both the Trace & Control classes.
- * srctextwin.tcl (constructor): One too many separators in the
- trace trace popup menu.
- * tclIndex: regenerated.
- * tfind_args.tcl: Added "tfind frame"
- * toolbar.tcl (create_button): Allow a button to belong to
- more than one class.
- * toolbar.tcl (enable_ui): Eliminate redundant code, and allow
- a button to belong to more than one class.
- * toolbar.tcl (create_trace_menu): Added save tracepoints &
- Tfind frame menu items.
- * tracedlg.tcl: Added deletion of actions, and fixed a
- the whiile-stepping combobox callback for the new combobox.
- * util.tcl (save_trace_commands): new proc.
-
-1998-10-29 Michael Snyder <msnyder@demo-laptop2.cygnus.com>
-
- * target.tcl: add /dev/cua0 for Linux.
-
-Tue Oct 27 13:46:03 1998 Jim Ingham <jingham@cygnus.com>
-
- * Many little bug fixes all over in order to get tracing to work
- along with normal program control.
- * toolbar.tcl: Rewrote much of the code here to put commonly
- used code into functions, and clean up adding menus and
- buttons. Added the ability to disable particular menu items,
- not just whole menus. Added the ability to delete and insert
- buttons on the fly.
- * srcbar.tcl: Pushed the changes to toolbar.tcl into this file.
- * srctextwin.tcl: Changed the code dealing with breakpoints
- and tracepoints to use the text tags more consistently. Use
- only one set of menus for the whole widget, rather than having
- a separate set for the SRC+ASM case. Rewrote a lot of the
- code to separate out the tracing & program control functions.
- * interface.tcl (gdbtk_tcl_breakpoint): pass more information
- to the scrtextwin when a breakpoint changes state, so it can
- do the right thing without having to guess...
- * tracedlg.tcl (build_win): get the packing right so the
- window expands correctly.
- * main.tcl: do_tstop -> tstop, do_tstart -> tstart to avoid
- confusion with the methods in ScrBar.tcl.
- * prefs.tcl: Added two new preferences B1_Behavior to control
- whether B1 sets breakpoints or tracepoints.
- * src_prefs.tcl: Put in support for the B1_Behavior.
- * global_prefs.tcl: Put back tracing checkbox.
- * tdump.tcl: Fixed an incorrect (1 rather than 1.0) text
- widget line specification.
- * tfind_args.tcl (build_win): Bind return in the entry to the
- OK button. Clear the entry field if the Type has changed.
- * utils.tcl: Added comments for the debug commands.
- * watch.tcl (build_win): Flash the OK button before invoking it.
-
-Wed Oct 28 16:19:57 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * srctextwin.tcl: Changed the _map cache to use
- the variable Cname instead of the kludgy upvar alias.
-
-Mon Oct 26 21:08:54 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * srctextwin.tcl (motion): Show breakpoint balloons
- even when not running.
- (showBPBalloon): Check for null before displaying.
-
-Wed Oct 21 10:05:17 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * images/kod.gif: Added temporary kernel object display icon.
-
-Wed Oct 14 17:30:07 PDT 1998 Jim Ingham <jingham@cygnus.com>
-
- * main.tcl (gdbtk_tcl_preloop): Fixed the code to set gdb_exe_name.
- I seem to have dropped a variable...
- * main.tcl (_open_file): Make the open file dialog truely
- modal on windows.
-
-Wed Oct 14 14:29:17 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * target.tcl: Change default runlist for remote
- targets to download.
- (build_win): Add user-defined list of functions for
- initial breakpoints.
-
- * main.tcl (run_executable): Set user-defined initial
- breakpoints.
-
- * prefs.tcl (pref_set_defaults): Define new prefs
- gdb/load/bp_at_func and gdb/load/bp_func. These are
- user-defined initial breakpoints.
-
-Sat Oct 10 00:21:44 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * help/source.html: Add new images, add description of changes
- to breakpoints and threads support. Fix typos.
-
- * help/memory.html: Cleanup and add new information.
-
- * help/breakpoint.html: Reformat.
-
- * help/images: Add a bunch of new GIFs.
-
-1998-10-08 Keith Seitz <keiths@cygnus.com>
-
- * main.tcl (run_executable): Do not call set_exe here, either.
- (_open_file): Add some comments about using set_exe
- here instead of in download_it and run_executable. Do not look
- for main, either, since the file hooks will take care of that.
-
- * interface.tcl (gdbtk_tcl_pre_add_symbol): Do not reset the
- source windows here -- only show the user what is going on.
- (gdbtk_tcl_post_add_symbol): Force the source windows' file
- comboboxes to refill, since adding a symbol file may actually
- expand the debugger's view of the world.
- (gdbtk_tcl_file_changed): New hook proc. Called by file_changed_hook
- in symfile.c, this hook will cause the source window to point
- to main/entry. gdbtk_tcl_exec_file_display actually sets up
- gdbtk for this.
- (gdbtk_tcl_exec_file_display): Renamed from
- gdbtk_tcl_exec_file_changed for clarity. This hook is called
- from exec_file_display_hook in exec_file_command. This function
- sets up gdbtk to use a new executable, including resetting the
- debugger's state and source window(s). See comments in this file
- for more information.
-
- * download.tcl (download_it): Don't call set_exe here and
- do not touch state variables gdb_target_changed -- run_executable
- will do it. (In short, make download_it one step closer to only
- doing the download!)
-
-1998-10-08 Keith Seitz <keiths@cygnus.com>
-
- * variables.tcl (UnEdit): Fix quoting problems so that arrays may be
- inspected/edited.
- (edit): Ditto.
-
-Wed Oct 7 16:03:00 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * srctextwin.tcl (reconfig): Fix bindings.
-
-Wed Oct 7 13:07:00 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * manage.tcl (manage_create): Bind ALL source windows
- Map and Unmap events.
- (manage_delete): Small optimization.
- (manage_iconify): When the last source window is iconified,
- iconify all the support windows too. When any source
- window is deiconified, deiconify everything.
-
- * src.tcl (destructor): Destroy SrcTextWin too.
-
-Tue Oct 6 23:00:08 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (set_status): Display only the first line of
- the message.
- (build_win): Configure status window to a height of 1.
-
- * srcbar.tcl (create_menu_items): Change "Open..."
- menu item to call _open_file proc. Remove old
- _open_file method.
-
- * main.tcl (run_executable): If the run command fails
- with a result of "No executable" then call _open_file.
- (_open_file): New proc. Opens a file requester and
- sets the executable name to the selected file.
-
- * toolbar.tcl (create_menu_items): Add "..." to Source
- and Global prefs menu item.
-
-Mon Oct 5 21:10:30 1998 Jim Ingham <jingham@cygnus.com>
-
- * srctextwin.tcl (set_tracepoint): The filename variable
- changed to current(filename) but this use was not updated.
-
- * global_prefs: Added a global preference to turn on the
- tracing. It only sets the tracing preference, and does
- not cause gdb to relayout the toolbar yet...
-
- * util.tcl: Fixed the comments for the little debug
- thingie.
-
- * util.tcl (auto_step): Added a way to cancel the
- auto_stepping. This is not currently used, but with this
- it could be...
-
-Mon Oct 5 00:43:11 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * srctextwin.tcl (SrcTextWin): Create a threaded image
- with a color of [pref get gdb/src/thread_fg].
- (bind_src_tags): Bind bp_tag <Motion> and <Leave> for
- balloon help on breakpoints.
- (config_win): A bunch of binding changes to support
- balloon help breakpoints and setting multiple BPs
- on a line. Add menu item for thread specific BPs.
- (reconfig): Similar changes as above.
- (register_balloon): Remove.
- (updateBalloon): Cleanup and don't call register_balloon.
- (do_bp): When a BP is deleted, call gdb_find_bp_at_line()
- to see if there are any more BPs at the same line number.
- Add "thread" BP type.
- (bp_line): Accept an optional list of thread numbers to
- set BPs on. Loop through the list setting BPs on each thread.
- (motion): Accept a window and type argument. Call
- showBPBalloon in type is not "var".
- (showBPBalloon): New method.Opens a balloon with breakpoint
- info in it.
- (showballoon): Accept window parameter.
- (ask_thread_bp): New. A thread selector dialog. Opens
- a scrolled listbox with a list of threads and allows
- the user to multiselect threads to set BPs on.
- (do_thread_bp): New callback from ask_thread_bp()
- listbox.
-
- * src_pref.tcl: Replace disabled color selector with thread
- fg selector. Disabled color should probably always be
- black anyways.
-
- * util.tcl (CygScrolledListbox): Temporary simple scrolled
- listbox. Replace with a better one soon.
-
- * prefs.tcl (pref_set_defaults): Set default for thread fg.
-
- * bp.tcl (bp_add): For thread BPs, set the button color
- correctly.
-
- * tclIndex: Rebuilt.
-
-Fri Oct 2 17:07:32 1998 Jim Ingham <jingham@cygnus.com>
-
- * util.tcl (debug namespace): Added helper functions
- "trace_var", "remove_trace" & "remove_all_traces" which
- watch a variable, and dump the stack, and its value when
- it is touched... They are in the "debug" namespace.
- *tclIndex: regenerate index.
-
-Fri Oct 2 14:02:25 1998 Jim Ingham <jingham@cygnus.com>
-
- * main.tcl (gdbtk_tcl_preloop): Catch the error when no file
- is given on the command line.
-
-1998-10-02 Keith Seitz <keiths@cygnus.com>
-
- * srcbar.tcl (_open_file): Call SrcWin::point_to_main.
- (_set_runstop): Catch the stop in case the user
- aborts a session.
-
- * srctextwin.tcl (destructor): New. Remove all previously added
- hooks.
-
- * src.tcl (point_to_main): New function. I got tired of typing
- the same five lines over and over again.
-
- * main.tcl (set_baud): Target baud preferences are stored as
- [target name]-baud, not [target name]/baud.
- (run_executable): Call SrcWin::point_to_main.
- (gdbtk_tcl_preloop): Call SrcWin::point_to_main.
-
- * interface.tcl (gdbtk_tcl_pre_add_symbol): Use "update idletasks", not
- just "update".
- (gdbtk_tcl_post_add_symbol): Rewrite to have better behavior
- for symbol files which have been loaded. Use a small hack to work
- with gdbtk_tcl_exec_file_changed so that we look for main only
- when a new executable is loaded.
- (gdbtk_tcl_exec_file_changed): New proc to do some necessary
- setup when an exec file changes.
-
- * tclIndex: Regenerate.
-
-Fri Oct 2 11:40:05 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * Makefile (TCL): Add modal.tcl.
-
- * tclIndex: Rebuilt.
-
-1998-10-02 Keith Seitz <keiths@cygnus.com>
-
- * srcbar.tcl (_set_runstop): Catch the stop in case the user
- aborts a session.
-
-Thu Oct 1 18:58:11 1998 Jim Ingham <jingham@cygnus.com>
-
- * main.tcl (gdbtk_tcl_preloop): We were using lindex on the
- return value from info files, but if the directory had a space
- in it, then the result was not a proper Tcl list, and so the
- command would fail. Use regexp instead...
-
-Thu Oct 1 17:21:26 1998 Jim Ingham <jingham@cygnus.com>
-
- * download.tcl (download_it): One more place where we used
- "Foundry_Debugger" unconditionally... Stamped out.
-
- * main.tcl (set_target): Don't put the "Trying to
- communicate..." message in the window title, put it in the
- status area, and remember to remove it when you are done.
-
-Wed Sep 30 21:32:39 1998 Jim Ingham <jingham@cygnus.com>
-
- * srctextwin.tcl (insertBreakTag): There was a bug in the
- method of inserting break tags. If a tag of the intended
- type did not already exist, insertBreakTag would not set it.
- This method is a little less flexible, but actually works
- for all our uses.
-
-Wed Sep 30 19:42:43 1998 Jim Ingham <jingham@cygnus.com>
-
- * src.tcl (set_execution_status): When the program has
- terminated, most stubs detach. Then we need to set
- gdb_target_changed here so gdb will know to reattack when
- you press the Run button.
-
- * memory.tcl (update_address): We caught the gdb_eval when you
- give an address expression, but then only trapped the case
- where you gave an invalid address or non-existant symbol.
- Trap all the other errors as well...
-
-Wed Sep 30 16:55:53 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * bp.tcl: Add optional "thread" column and menu items
- to turn it on and off.
-
- * prefs.tcl (pref_set_defaults): Add gdb/bp/show_threads
- preference used for toggling the display of the thread
- column in the BP window. Default is 0 (off).
-
-1998-09-28 Keith Seitz <keiths@cygnus.com>
-
- * download.tcl (download_it): Don't download if there is no executable...
-
-Mon Sep 28 14:23:39 1998 Jim Ingham <jingham@cygnus.com>
-
- * modal.tcl: NEW FILE. Had to fix a bug in the dialogs
- so I made a sub-class: ModalDialog. The bug was that
- manage.tcl sets the WM_DELETE_WINDOW handler to be
- "manage delete" of the window, which is wrong for these
- windows, they need to unpost themselves first. Override
- this in the post method.
- * mem_pref.tcl: Subclass & remove the code that went into
- the ModalDialog class.
- * target.tcl: ditto.
- * tclIndex: regenerate for the new class.
-
-Fri Sep 25 19:01:32 1998 Jim Ingham <jingham@cygnus.com>
-
- * utils.tcl (freeze): Hacked the freeze method so that it comes closer
- to working on Windows, but it still flashes. Use a post
- method, like that im mem_prefs.tcl or target.tcl instead.
- * mem_pref.tcl (post): Added post method, so you can use the
- Windows EnableWindow call without sending your app into the
- background when the dialog is dismissed.
- * target.tcl (post): Added the same method to this class.
- Really should subclass these. Will do this when we rework the
- class hierarchy for Itcl3.0.
- * memory.tcl (create_prefs): Use the new post method.
- * main.tcl (set_target_name): Use the post method rather than
- freeze.
-
-1998-09-25 Keith Seitz <keiths@cygnus.com>
- * main.tcl (set_baud): Baud rates are saved in gdb/load/target-baud,
- not gdb/load/target/baud.
- (set_target): Attempt to silently detach before attaching.
-
- * target.tcl: Add gdb_target entries for Angel and ARM Remote
- protocols.
-
-1998-09-18 Keith Seitz <keiths@cygnus.com>
-
- * interface.tcl (gdbtk_tcl_post_add_symbol): Force the source window
- to 'main'; if that fails, let gdb guess based on stop_pc.
-
-1998-09-04 Keith Seitz <keiths@cygnus.com>
-
- * srctextwin.tcl (SrcTextWin::destructor): Define and remove
- previously installed hooks.
-
- * browser.tcl (get_selection): Listbox indices start at zero!
- Clear the selection if the user clicks below the last visible
- item in the listbox.
-
-Thu Sep 3 16:43:43 1998 Jim Ingham <jingham@leda.cygnus.com>
-
- * mem_prefs.tcl: Fixed the size & format radiogroups in
- the memory preferences so that they match the format
- options being sent to it by the memory window. Also
- greyed out the format box when float or double is selected.
- Also made sure we didn't re-enable any disabled widgets in
- the idle function.
-
-Sun Aug 30 00:40:28 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * process.tcl: New file. Implement a process/thread selection
- and display window.
-
- * srctextwin.tcl (do_key): Add entry for thread/process
- window.
- (config_win): Bind "Thread List" to Control-H.
- (FillSource): Fix bug when source is not found.
-
- * toolbar.tcl (create_menu_items): Add Thread List to menu
-
- * manage.tcl (manage_init): Add process window to
- managed array.
-
- * prefs.tcl (pref_save): Add "process" to window types to save.
-
- * Makefile: Add process.tcl
-
- * tclIndex: Rebuilt
-
-1998-08-28 Keith Seitz <keiths@cygnus.com>
-
- * variables.tcl (edit): Format data so that C arrays are not
- mistaken for tcl commands.
- (UnEdit): Ditto.
-
-Thu Aug 27 14:13:09 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * main.tcl (run_executable): If the target is "sim"
- then the pref "sim-opts" should be treated as target
- options instead of command line arguments.
-
-Wed Aug 26 00:06:11 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (mode): Set the mode widget using entryset.
- (build_win): Use default combobox selectbackground.
-
- * srctextwin.tcl (FillMixed): Better error handling.
- (LoadFIle): Stop harrassing users with worthless dialog boxes.
-
- * main.tcl (run_executable): Set args when arguments are
- given in the target dialog.
-
- * helpViewer.tcl (insertHtml): Window may have been
- closed while waiting for HTMLparse, so catch next commands
- to prevent error message.
-
- * images/stack.gif: Use the image from images2 because
- it looks better.
-
-Tue Aug 25 16:09:02 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (build_win): Change fonts on comboboxes to src-font.
-
- * global_pref.tcl: Change to new combobox.
-
-Tue Aug 25 11:41:43 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * srctextwin.tcl (insertBreakTag): Take an index
- instead of a linenumber. Check for bp_tag and break_tag.
- (display_breaks): Reset all lines back to break_tag
- after deleting bp image. Fixes caching bug.
- (do_bp): Fix up calls to insertBreakTag.
-
-Fri Aug 21 12:44:25 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * target.tcl (build_win): Remove tix stuff. Set maxheight
- of comboboxes to 10. Remove all code to count elements
- in comboboxes because the new one does it for us.
- (fill_rates): Remove combobox height configure code.
- (fill_targets): Same.
-
- * src.tcl (build_win): Change combobox -height to
- -maxheight for combobox 1.05.
- (name, goto_func): Use combobox entryset instead of SetSilent.
- (SetSilent): Deleted.
-
- * srctextwin.tcl (FillSource): Fix change mode call when
- no source is found.
-
-1998-08-20 Keith Seitz <keiths@cygnus.com>
-
- * srctextwin.tcl (print): New method. Moved from src.tcl.
-
- * srcbar.tcl (create_menu_items): Add page setup for non-ide again..
-
- * src.tcl (build_win): Fix balloon help for new comboboxes.
- (print): Move guts to srctextwin and invoke that method.
-
- * target.tcl: Remove protected variable tcpmode.
- Add "options" member for sim and exec targets. For sim, this is
- options to pass to the simulator; for exec, command line arguments.
- (build_win): Replace tix comboboxes with one from libgui.
- (set_saved): Add target-options when appropriate.
- (write_saved): Add target-options when appropriate.
- (fill_rates): Modify to work with new combobox.
- (fill_targets): Modify to work with new combobox.
- (config_dialog): New method which maps/unmaps/relabels comboboxes
- and entries for each target.
- (change_target): Remove all code pertaining to mapping/unmapping/relabeling
- comboboxes and entries and call config_dialog instead.
- (change_baud): Remove all code pertaining to mapping/unmapping/relabeling
- comboboxes and entries and call config_dialog instead.
-
- * console.tcl (Console): Add key binding for TAB completion.
- (find_lcp): New helper method for find_completion.
- (find_completion): New helper method for complete.
- (complete): New method (bound to tab key) which computes the completion
- of the current command line.
- (reset_tab): New method to reset the tab completion whenever a key
- is pressed (forces complete to recompute the completions instead of
- printing out the last list of completions).
-
-1998-08-18 Keith Seitz <keiths@cygnus.com>
-
- * stack.tcl (update): Use new built-in command gdb_stack for
- backtraces.
- Use the global gdb_selected_frame_level to figure out which
- line in the listbox should be highlighted.
- ALWAYS highlight the selected frame.
- Put a fencepost arount update so that we can prevent it from
- being called twice when change_frame is used.
- (change_frame): Protect call to gdbtk_update so that this object is
- not updated twice.
-
- * srctextwin.tcl (config_win): Copy the properties of the selection tag
- into a new "search" tag that will be used by the search widget.
- (search): Use the defined "search" tag to highlight found text.
- Remove all search-tagged text from the window when an empty expression
- is entered.
-
-Mon Aug 17 14:27:54 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * main.tcl (do_tstop): Require combobox package.
-
- * src.tcl (build_win): Use new combobox.
- (name): Changes for new combobox.
- (goto_func): Changes for new combobox.
- (FillNameCB): Changes for new combobox.
- (FillFuncCB): Changes for new combobox.
- (SetSilent): New method, like tixSetSilent.
- (mode): Changes for new combobox.
- (set_name): Changes for new combobox.
- (reset): Changes for new combobox.
-
- * srctextwin.tcl (FillSource): Call parent's mode method when
- mode is changed to assembly.
- (location): Call display_breaks only if flag is set.
- (LoadFIle, FillAssembly, FillMixed): Set display_breaks flag.
- (display_breaks): Set all breakpoints in a single pass.
- (insertBreakTag): Check $stop before trying to remove tag.
-
-Mon Jul 27 12:35:31 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * interface.tcl (gdbtk_tcl_tracepoint): Make function match C
- implementation by adding pass_count.
-
-Sat Jul 25 22:40:49 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * manage.tcl (manage_init): Change "loadpref" to "targetsel"
- and change class name to TargetSelection. This avoids confusion
- with the IDE GdbLoadPref class.
- * target.tcl (TargetSelection): Change class name.
- * main.tcl (set_target_name): Change "loadpref" to" targetsel"
-
-Fri Jul 24 14:37:49 1998 Keith Seitz <keiths@cygnus.com>
-
- * util.tcl (bp_exists): New procedure.
- * srctextwin.tcl (SrcTextWin::constructor): Add public vars
- "parent" and "ignore_var_balloons" and initialize accordingly.
- (config_win): Add binding for browser.
- Add binding for up/down arrows to scroll more naturally.
- (do_key): Add browser entry.
- * browser.tcl: Add srctextwin into browser.
- * prefs.tcl (pref_set_defaults): Add new preferences for the func
- browser.
- * tclIndex: Regenerate.
-
-Fri Jul 24 00:53:28 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * srctextwin.tcl (SrcTextWin): Initialize LineNums.
- (setTabs): Set tabs correctly when in assembly mode
- or when there are no linenumbers.
- (bind_src_tags): Remove lineNum_tag bindings.
- (config_win): Remove lineNum_tag and line_tag. Set
- linenumbers to break_tag and bp_tag instead.
- (FillAssembly): Don't use lineNum_tag.
- (FillMixed): Don't use line_tag.
- (LoadFile): Use new protected variable LineNums.
- (insertBreakTag): Instead of trying to calculate the
- correct location of the new tag, simply ask the widget
- where the old one was.
- (do_bp): Call insertBreakTag when bps are deleted.
-
- * src.tcl (FillNameCB): Call gdb_listfiles with [pwd].
-
-Sat Jul 18 13:27:20 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (location): Change BROWSE_TAG to STACK_TAG.
-
- * interface.tcl (gdbtk_quit): New function. Called by
- cleanup code in GDB.
-
-Fri Jul 17 00:03:43 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * memory.tcl (build_win): Change address controlbox to
- call update_address_cb.
- (update_address_cb): New method. Handle address
- controlbox callbacks. Set flag and call update_address.
- (update_address): Call BadExpr on bad expressions.
- Use local variable "ae" to set public variable addr_exp.
- This fixes bug where widget forgets its address when
- reconfigured. Set table background white when expression
- is OK.
- (BadExpr): When a bad expression is entered, create a
- messagebox and set the table bg to gray.
-
- * mem_pref.tcl (apply): Remove mystery debug line.
-
-Thu Jul 16 16:56:12 1998 Jim Ingham <jingham@cygnus.com>
-
- * download.tcl, ide.tcl, interface.tcl, main.tcl, manage.tcl
- srcbar.tcl, toolbar.tcl: Merged the IDE changes back into devo.
-
-Mon Jul 13 14:34:45 1998 Jim Ingham <jingham@cygnus.com>
-
- * mem_pref.tcl (destructor): Remember to delete the variable
- trace that implements the entry widget checking.
-
-Fri Jul 10 19:17:53 1998 Jim Ingham <jingham@cygnus.com>
-
- * mem_pref.tcl: Changed the number of bytes entry widget so
- that it only accepts +'ve integers, and protect against the
- case where the user deletes the contents of this entry, then
- closes the window. Also made the entry disabled when the
- other radio button is selected.
-
-Wed Jul 8 23:20:33 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * srctextwin.tcl (FillSource): Fix code that
- detects when no line numbers are available and we must use
- assembly mode.
-
-Mon Jul 6 17:53:50 1998 Jim Ingham <jingham@cygnus.com>
-
- * download.tcl, helpViewer.tcl, html_library.tcl, memory.tcl,
- register.tcl, src.tcl, srctextwin.tcl, target.tcl,
- tracedlg.tcl, util.tcl, variables.tcl, warning.tcl, watch.tcl:
- With the Tcl 8.0 compiler, expr commands are more efficient if
- you use:
- expr {$foo + $bar}
- instead of:
- expr $foo + $bar
- So I changed all the uses of expr to this form.
-
-
-Mon Jul 6 15:19:59 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * srctextwin.tcl (FillSource): Call Parent's mode method
- to combobox will be updated.
- * src.tcl (mode): Pass along second argument to mode_set.
-
-Wed Jul 1 15:09:47 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * srctextwin.tcl (location): Add missing parameter
- to FillSource call in SRC+ASM.
-
-Wed Jul 1 11:07:21 1998 Jim Ingham <jingham@cygnus.com>
-
- * main.tcl (gdbtk_preloop): Call gdbtk_idle on spec. If there was an
- error in loading an executible specified on the command line,
- then the pre_add_symbol hook would have called gdbtk_busy but
- the corresponding call to gdbtk_idle would not have occured.
-
- Also changed some catch calls so they didn't use
- "catch {set foo [real_command]}"
- but rather the more efficient:
- "catch {real_command} foo"
-
- * register.tcl: more catch cleanups
- * src.tcl: more catch cleanups
- * stack.tcl: more catch cleanups
- * target.tcl: more catch cleanups
- * tdump.tcl: more catch cleanups
- * variables.tcl: more catch cleanups
- * watch.tcl: more catch cleanups
-
-Wed Jul 1 12:21:55 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (build_win): Remove incorrect runstop
- argument for srcbar.
-
-Wed Jul 1 11:25:48 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * floatbar.tcl: Deleted.
- * Makefile: Removed floatbar.tcl
- * tclIndex: Rebuilt.
-
-Wed Jul 1 11:19:05 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * toolbar.tcl (enable_ui): Now takes an argument and
- handles disable_ui and no_inferior functions.
- (disable_ui): Deleted.
- (no_inferior): Deleted.
- (constructor): Set idle, busy, and no_inferior hooks
- to enable_ui.
-
- * srcbar.tcl (_open_file): Fix for multiple source windows.
-
-Wed Jul 1 01:40:52 1998 Martin M. Hunt <hunt@cygnus.com>
- * Makefile: Added srctextwin.tcl.
- * tclIndex: Rebuilt.
- * src.tcl: Major rewrite to move the source text window
- into another object implemented in srctextwin.tcl. Every function
- changed and many moved to srctextwin.tcl.
- * srctextwin.tcl: New file.
- * bp.tcl (goto_bp): Fix call to source widget.
-
- * src_pref.tcl (build_win): Add line number
- checkbutton. Layout needs changed.
- * prefs.tcl (pref_set_defaults): Add linenum pref.
-
-Thu Jun 25 17:31:30 1998 Keith Seitz <keiths@cygnus.com>
-
- * toolbar.tcl (create_menu_items): Add Function Browser menu item.
-
- * tclIndex: Regenerate.
-
- * Makefile: Add browser.tcl.
-
- * util.tcl (do_test): New procedure for invoking a test in the
- testsuite from the command line.
- (gdbtk_read_defs): New procedure for reading in the testsuite definitions
- file
-
- * src.tcl (build_win): Create new entry for searching the source window.
- This "feature" shares the screen with the download indicator.
- (download_progress): If starting a download, unmap the search widget
- and map the download progress indicator in its place. When downloading
- is done, do the opposite.
- (config_win): Bind the down and up arrow keys to directly scroll the
- window.
- (search): New method which searches for strings in the source window
- and jumps to a particular line.
- (set_state): Do not reset current_file to empty when an exe has been
- downloaded.
- (bp): Do not special case tracepoint debugging.
-
- * manage.tcl (manage_init): Add elements for function browser.
- (manage_create): If GDBTK_TEST_RUNNING is set in the environment,
- place all windows on the screen at +0+0.
-
- * prefs.tcl (pref_save): Add new preference category "search".
- (pref_set_defaults): Add search preferences.
-
- * tracedlg.tcl (TraceDlg::destructor): Destroy the actions dialog is
- it exists.
- (add_action): Save the object returned from the window manager when
- the actions dialog is opened so that we can later destroy it if
- necessary.
- (done): Clear ActionsDlg when the actions dialog is destroyed.
-
- * main.tcl (do_tstart): Do not disable the "Begin collection" menu
- item when we issue a tstart.
-
- * console.tcl (paste): New method which handles all Paste events for
- this window.
- (Console): Bind the middle mouse button on unix to generate a paste
- event.
- Override default binding for button-2 motion to allow easier pasting
- into the window.
- Bind the paste event to the method paste.
-
-Wed Jun 17 13:50:48 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (reconfig): Recognize tab size changes.
-
- * src_pref.tcl (build_win): Add tab control. Remove extra frame.
- Justify variable ballons text. Set activebackgrounds on
- color buttons.
-
-Tue Jun 9 13:57:24 1998 Keith Seitz <keiths@cygnus.com>
-
- * helpViewer.tcl (HtmlViewer): Display appropriate help based on the
- preference gdb/mode.
-
- * help/trace: Add help files for tracing.
-
- * main.tcl (gdbtk_tcl_preloop): Call gdbtk_update so that the
- source window fills files into the combobox.
-
- * srcbar.tcl (_open_file): "cd" to directory, don't add it to the
- search list. This never gets reset anywhere, so if multiple file
- commands are added, we could get the wrong path. Call gdb_clear_file,
- too.
-
- * interface.tcl (gdbtk_tcl_pre_add_symbol): Call the reset method
- of the source window, too.
-
- * src.tcl (reset): New method used to clear the source window
- whenever multiple file commands are used.
-
- * tdump.tcl (update): Erase the contents of the tdump window
- when displaying a new dump.
-
- * stack.tcl (update): Errors from the backtrace can contain
- backtrace info, too, so make sure we print as much of that as
- possible.
-
- * register.tcl (build_win): Do not allow editing in tracing
- mode.
- (reg_select): Do not allow editing in tracing mode.
-
- * memory.tcl (update_address): Check that gdb's handling of chars and
- char*s doesn't abort the update.
-
- * variables.tcl (build_win): Disable editing in tracing mode.
- (build_menu_helper): Disable editing in tracing mode.
- (getLocals): Use the builtin functions gdb_get_locals and
- gdb_get_args to get all local variables. Concat lists together.
- (Variable::value): Set a default value for "radix" in case
- the regsub fails.
-
-Tue Jun 9 00:00:18 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * interface.tcl (gdbtk_quit): No longer use quit_hook.
- Just call "manage save".
- * manage.tcl (manage): Remove manage quit.
- (manage_quit): Deleted.
- (manage_init): Remove quit_hook.
- (manage_save): Use "Pref setd" instead of "pref set".
- * prefs.tcl (pref_set_defaults): Remove quit_hook.
- (pref_quit): Deleted.
-
-Mon Jun 8 16:15:33 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * target.tcl (set_check_button): Check for existence of
- button before trying to set its state.
-
-Mon Jun 8 13:31:08 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * memory.tcl (build_win): Always Bind configure event to
- newsize method. Change table widget to use incr_addr for
- both incr and decr. Enable autorepeat.
- (create_prefs): Set rheight (row height).
- (newsize): Set rheight if necessary. Return if numbytes
- is not zero.
- (update_address): Move gdbtk_idle and gdbtk_busy calls to
- update_addr.
- (update_addr): Surround with gdbtk_idle and gdbtk_busy.
- (incr_addr): Take an argument to indicate how much
- to increment or decrement by.
- (decr_addr): Deleted.
-
-Fri Jun 5 00:13:49 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * Change all references to GDBTK_IDE to IDE_ENABLED.
-
-Thu Jun 4 18:34:11 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * memory.tcl: Complete rewrite. Added many new features
- and made it much faster.
-
- * mem_pref.tcl (build_win): Set listbox width.
-
- * images/check.gif: New image. Used in version of
- memory window without a menubar.
-
-Thu Jun 4 10:53:33 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * tclIndex: regenerated.
-
- Merged (most recent first):
-
- - Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * tracedlg.tcl (ok): if the tracepoint does not exist (this can happen
- if user is editing a tp and decides to remove it from tp window)
- do not core dump, give an error message instead, and return.
-
- * bp.tcl (get_actions): invoke trace dialog from tracepoint window,
- passing filename and line as arguments, rather than address.
-
- - Jeff Holcomb <jeffh@cygnus.com>
-
- * main.tcl (set_baud): Change gdb/load/$gdb_target_name/baud
- to gdb/load/${gdb_target_name}-baud.
-
- - Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * tdump.tcl (update): call tdump only if the current trace frame
- number is not -1.
-
- * interface.tcl (gdbtk_tcl_tstart): update menus entries only, do
- not do actual command.
- (gdbtk_tcl_tstopt): update menus entries only, do not do actual
- command.
- (gdbtk_tcl_warning): remove tdump warning message from list of not
- displayed messages.
-
- * main.tcl (do_tstart): catch error output from tstart and display
- error dialog.
- (do_tstop): catch error output from tstop and display error dialog.
-
- * bp.tcl (bp_add): align properly the bpnum and passcount fields,
- for the tracepoint window.
-
- * main.tcl (set_exe): set file_done (new global state variable)
- depending whether new file was read in or not.
- (set_target_name): return 0 if user chose cancel from target setting
- window displayed by 'connect'.
- (set_target): if no target_cmd is specified call set_target_name and
- ask user for it.
- (async_connect): handle possible outcomes of set_target command,
- issue appropriate messages to user.
- Initialize file_done to 0.
-
- * target.tcl (cancel): set gdb_target_name to CANCEL for use by
- set_target_name.
- Added public data 'exportcancel'.
-
- * toolbar.tcl (do_async_connect): change menu items state only
- if connect was successful.
-
- * src.tcl (bp): modify condition for SOURCE case to display tp dot
- after connecting to target.
-
- * actiondlg.tcl (constructor): make dialog non modal.
- (destructor): release grab not any longer necessary.
- (change): make lsearch use exact pattern matching for entries
- added to the collect list using the 'other' field. The new syntax
- allows array elements to be specified and this messes up the
- default glob style pattern matching.
- (change_other): reject memranges (obsolete). Delegate validation
- of user input to the lower levels, in gdb. I.e. keep everything
- until the whole tracepoint is installed.
-
- * tracedlg.tcl (gdb_add_tracepoint): call to gdb_actions is now
- catching the errors (in case of incorrect syntax) and displaying
- them to the user.
-
- * main.tcl (set_target): Changed text of error message to mention
- the Target Settings dialog.
-
- * prefs.tcl: Set default preference for gdb/load/check to 0.
-
- * target.tcl (build_win): disable comparison with executable for
- 'exec' targets.
- (set_check_button): new method. Enable/disable the check button
- for comparing executable.
- (change_target): call set_chack_button when target changes.
- Set default preference gdb/load/check to 0.
-
- * stack.tcl: set initial window width value to 40, so that window
- looks better if opened before a stack exists.
-
- - David Taylor <taylor@texas.cygnus.com>
-
- * main.tcl (async_connect): remote-compare is now compare-sections.
-
- - Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * warning.tcl (constructor): call destructor if dialog doesn't
- need to be displayed.
-
- * console.tcl (invoke): make function get input and return if in
- readline state, independently from the value of Running.
-
- * src.tcl (set_state): set state of pop up menus only for synch
- mode.
-
- * tdump.tcl (build_win): simplify the window, eliminating pane.
- This fixes resize problems.
- (update): add call to see to display last thing outputted to the
- window.
-
- * tfind_args.tcl (do_it): call the tfind_cmd procedure.
-
- * toolbar.tcl (create_menu_items): changed calls to tstart and tstop
- to use do_tstart and do_tstop.
-
- * srcbar.tcl (runstop): do not call _set_trace in asynch case,
- just use _set_runstop always.
- (_set_runstop): added handling for asynch mode cases.
- (_set_trace): removed.
-
- * main.tcl (do_tstart): new procedure to execute tstart command
- update tstart/tstop button, and menu entries accordingly.
- (do_tstop): new procedure for tstop, as above.
- (run_executable): calls do_tstart in the asynch case.
-
- * interface.tcl (gdbtk_tcl_tstart): new procedure to invoke
- the tstart command
- (gdbtk_tcl_tstop): new procedure to invoke the tstop command
-
- * interface.tcl: (gdbtk_tcl_warning) do not display warning
- about no current trace frame upon opening of tdump window.
-
- * main.tcl: (run_executable) in asynch mode just call tstart,
- connect is now done independently.
- (async_connect) new procedure to connect and do comarison with
- remote executable, in asynch mode. Sets up gui state globals.
- (async_disconnect) new procedure to disconnect from target in
- asynch mode. Sets up gui state globals.
-
- * prefs.tcl: added new preference gdb/load/check
-
- * srcbar.tcl: (create_buttons) tfind commands now use tfind_cmd
- function
-
- * target.tcl: added new preference gdb/load/check to execute an
- automatic remote-compare command on connection to target in asynch
- mode
- (set_saved) set saved value for new preference
- (write saved) write saved value for new preference
- (build_win) set state of 'run to main', 'break at exit', 'display
- dowload' to disabled for asynch mode target dialog.
- Added new checkbutton for automatic comparison of remote exec.
- Saved_check: new protected member
-
- * tdump.tcl: (update) changed check for no frame, since 0 is legal
- trace frame number.
-
- * toolbar.tcl: (create_menu_items): added menus items 'connect to
- target' and 'disconnect', in async mode. Changed to call tfind_cmd
- to execute tfind commands
- (do_async_connect): new method to connect to target in async mode.
- (do_asynch_disconnect): new method to disconnect from target in
- async mode.
-
- * util.tcl: (tfind_cmd): new proc to execute a tfind command on
- the target
-
-Thu May 28 12:49:29 1998 Keith Seitz <keiths@cygnus.com>
-
- * target.tcl: Add sparclite target.
- (fill_targets): Add sparclite target.
-
- * main.tcl (set_target_name): Rearrange so that the default behavior
- is to assume a remote-like target.
-
- * src.tcl (browse_to): Helper function for BpWin::goto_bp which causes
- the source window to show the specified location.
-
- * bp.tcl (bp_add): Clean up repetitive code.
- Add double-click binding which shows the breakpoint
- in the source window.
- (bp_select): Clean up repetitive code.
- (goto_bp): New function.
-
-Sun May 24 14:05:27 1998 Keith Seitz <keiths@cygnus.com>
-
- * src.tcl (reconfig): Remove the variable balloon selection in the text
- widget, too, when we are disabling varialbe balloons.
-
- * target.tcl: Add a "runlist" parameter to all gdb_target entries. This list
- controls the default behavior of the run button.
- (GdbLoadPref): Define the run preferences based on this target.
- (build_win): Add a "more options" dropdown pane to allow users to modify the
- behavior of the run button.
- (set_saved): Add run button preferences.
- (write_saved): Add run button preferences.
- (fill_targets): Add the "pretty name" to the combo box, not gdb's internal
- target name.
- (change_target): Use get_target to translate the "pretty-name" to the
- real target name.
- (save): Write out saved values, too.
- (get_target): New method to translate the "pretty-name" of a target into gdb's
- internal name/
- (toggle_more_options): New method to handle mapping and unmapping of the
- "more options" pane.
- (set_run): New method. Moved from src_pref.tcl.
- (valid_target): Moved here from main.tcl.
- (native_debugging): Moved here from main.tcl.
- (change_target): Don't write_saved here -- wait until dialog is closed.
-
- * src_pref.tcl (build_win): Use libgui's Labelledframe class instead of the
- Tix labeled frame.
- Remove the run button frame -- this has moved into the target selection dialog.
- (set_run): Moved to targets.tcl.
-
- * prefs.tcl (pref_set_defaults): Change default preferences for the run
- button to only do a run. Target selection will reset these as appropriate.
-
- * main.tcl (set_baud): Baud preferences are in TARGET-baud, not
- TARGET/baud.
- (run_executable): Remove special cases for exec targets.
- (native_debugging,valid_target): Move to target.tcl.
-
- * images/more.gif, images/less.gif: New images for drop frames.
-
- * tclIndex: Regenerate.
-
-Wed May 20 13:43:00 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * toolbar.tcl (create_menu_items): Remove register prefs.
-
- * images/stop.gif: Set transparent bit.
-
-Tue May 19 12:34:11 1998 Keith Seitz <keiths@cygnus.com>
-
- * bp.tcl (bp_add): Use source window's colors. Use "file tail" not
- "lindex [file split ] end".
- (bp_modify): Use source window's colors. Use "file tail" not
- "lindex [file split ] end".
- (bp_remove): Call bp_select before we delete the breakpoint.
-
- * main.tcl (run_executable): Encapsulate all calls to debugger
- based on new run preferences.
-
- * manage.tcl (manage_init): Change loadpref titles to "Target Selection"
-
- * pref.tcl (build_win): Disable Help button until it works.
-
- * prefs.tcl (pref_set_defaults): Define new run button preferences.
- Lose stack and bp window color preferences -- use the source window
- ones instead. Lose left_click, too.
-
- * src.tcl: Remove all references to _Source_Left_Click and replace with new
- protected variable Tracing. Define new protected variable UseVariableBalloons
- so that we don't follow the preferences blindly. Replace all preference calls
- for these two globals.
- (reconfig): Allow reconfiguration of variable balloons and popup menu colors.
- (config_win): Add binding for File Menu->Open.
- (do_key): Add open key.
-
- * src_pref.tcl (SrcPref): Save all newly added preferences.
- (build_win): Add new preferences for mode, variable balloons,
- lots of color choices.
- (cancel): Reset all new preferences.
- (pick): Allow passing of button in to make things a little easier.
- (reconfig): Keep empty -- no need for this to reconfigure itself.
- (set_run): New method to make sure someone does not try to run _and_
- continue a target with the run button.
-
- * stack.tcl (build_win): Use the source window's preferences to set colors.
-
- * target.tcl (build_win): Disable Help button until it works.
-
-Mon May 18 15:25:00 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * html_library.tcl (HMstack): Remove stray 'g' that was
- preventing autoloading.
-
-Mon May 18 13:17:30 1998 Keith Seitz <keiths@cygnus.com>
-
- * helpViewer.tcl (HtmlViewer): Initialize glossary.
- (glossaryPost): Fill in skeleton supplied by jingham.
- (glossaryUnpost): Ditto.
- (lookup): New method to lookup glossary definitions.
- (HMset_image): Add special image names.
-
-Fri May 15 00:30:06 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * memory.tcl (update_address): Source window was never being
- updated due to a faulty fencepost. I removed it. Was it
- useful?
-
-Tue May 12 11:47:11 PDT 1998 James Ingham <jingham@leda.cygnus.com>
-
- * helpViewer.tcl: Made the fonts for the viewer track the global
- font preferences
- *html_library.tcl: Use Tcl Font objects for the fonts rather than
- building up X Font Specs.
-
-
-Thu May 7 16:03:32 1998 Keith Seitz <keiths@cygnus.com>
-
- * toolbar.tcl (create_menu_items): Remove automatic stepping.
- (create_menu_items): "Cygnus on the Web..." should point to GNUPro page...
-
-Wed May 6 20:18:34 1998 Keith Seitz <keiths@cygnus.com>
-
- * main.tcl (set_target_name): Recognize d10v and m32r targets.
- (valid_target): Change test to recognize all tcp targets.
-
- * target.tcl: Add m32r and d10v tcp targets.
-
-Wed May 6 12:52:12 1998 Keith Seitz <keiths@cygnus.com>
-
- * srcbar.tcl (create_menu_items): Install a page setup menu item for
- non-ide debuggers.
-
- * src.tcl (print): Don't call idewindow_freeze and idewindow_thaw
- the ide is not running
-
-Wed May 6 10:41:30 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * bp.tcl (get_actions): set bpnum to be the real tracepoint number,
- not the selected row number.
-
-Tue May 5 04:07:12 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * target.tcl: Add D10V and M32R target.
-
- * prefs.tcl (pref_set_defaults): Set debugging off
- by default.
-
-Fri May 1 15:23:57 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * main.tcl (valid_target) make 'remotetcp' a valid
- target.
-
-Fri May 1 11:50:40 1998 Jim Ingham <jingham@leda.cygnus.com>
-
- * helpViewer.tcl: Added the skeleton for the Glossary entries.
- Fixed the zoom to top of page when rendering is complete nit.
- Added a reconfig method to refresh the current page.
- Compulsive reordering of methods.
-
-Thu Apr 30 00:04:52 1998 Martin M. Hunt <hunt@cygnus.com
-
- * global_pref.tcl (change_icons): Remove debug line.
-
- * toolbar.tcl: Change image names to end with _img
- so they don't conflist with command names.
- * srcbar.tcl: Same.
-
-Tue Apr 28 16:51:09 1998 Jim Ingham <jingham@leda.cygnus.com>
-
- * html_library.tcl: The redefinition of tkFocusOK in this file
- can cause an infinite recursion loop in autoloading tkFocusOK.
- Change proc -> ::proc to hide the definition from itcl_mkindex
- * tclIndex: remade without the reference to tkFocusOK.
-
-Tue Apr 28 16:51:09 1998 Jim Ingham <jingham@leda.cygnus.com>
-
- * helpViewer.tcl: The index page now shows up properly in the
- history list. Also added images for the fore, back and home
- buttons, and removed the close button.
-
- * manage.tcl: Moved the wm withdraw of a new toplevel before the
- constructor is run in manage_create. This avoids flashing.
-
- * main.tcl: Changed the tk application name of gdbtk from tk
- to gdbtk.
-
-Mon Apr 27 14:18:01 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * helpViewer.tcl: (constructor) Change 'Foreward' to 'Forward' and
- calls to 'foreward' method to calls to 'foreward' method.
- (forward) changed method name from 'foreward'.
-
-Thu Apr 23 19:02:25 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * toolbar.tcl (create_menu_items): Use the new help viewer when not
- using the IDE.
-
- * helpViewer.tcl (HtmlViewer::constructor): Set default values for
- previously passed-in variables.
- (HtmlViewer::destructor): Destroy the toplevel, too.
- (HMset_image): prepend the dir name "images" to the image path.
-
-Thu Apr 23 13:31:07 1998 Jim Ingham <jingham@leda.cygnus.com>
-
- * html_library.tcl: First checkin
- * helpViewer.tcl: First checkin
- * manage.tcl (manage): Added the help veiwer to the windows
- list. Aslo compulsively alphabetized the list...
- * tclIndex Rebuilt for the new procs.
-
-Mon Apr 20 11:14:17 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * global_pref.tcl (build_win): Add font selector for the status font.
-
- * main.tcl (run_executable): Exec targets are always "loaded".
-
-Sat Apr 18 02:11:04 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * prefs.tcl (pref_read): Remove debug line.
-
- * util.tcl (toggle_debug_mode): When enabling or
- disabling debugging, also enable or disable error
- reporting and stack traces.
-
-Sat Apr 18 01:13:03 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * srcbar.tcl (_toggle_updates): Cleanup.
-
- * src.tcl (do_popup): Fix problems with selections. While
- I'm messing with this code anyway, change how it works
- so that the popup will contain the word that is under the cursor
- if nothing is selected.
-
- * toolbar.tcl (create_buttons): Bind button 3 to create
- new windows when possible.
-
- * stack.tcl (StackWin): Fix broken deiconify call.
-
- * images/[console.gif, reg.gif]: Update.
-
-Fri Apr 17 10:34:23 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (location): Don't look up the full pathname
- of each file added to the combobox.
-
-Fri Apr 17 09:58:59 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * target.tcl (default_port): New proc. Returns a default port
- based on host os.
- (startup code): Use default port to determine the default port
- to use for all hosts.
- (build_win): Only set the target if it is valid.
- For unix, use port names that correspond to the OS running.
- Change gdb/load/$target-portnum to gdb/load/$target-port (typo?)
- (get_target_list): Do not allow "exec" for cross debugging.
- (save): Do not do dismiss dialog if the target is not valid.
- (cancel): If exportcancel is set, set gdb_target_cmd to "CANCEL". This
- will allow run_executable to cancel a run if the user cancels target
- selection.
- (exportcancel): New public data.
-
- * main.tcl (set_target_name): Return status to caller so that the user
- can cancel a run request when the target selection dialog is opened.
- Do not modify gdb_exe_changed -- it has already been set proprely.
- (set_target): If gdb_target_cmd is empty, call set_target_name to
- set it.
- Allow all set_target_name commands to cancel target selection.
- (run_executable): Allow all set_target_name commands to cancel
- target selection.
- Always clear bp's at main and exit, since this proc will set them
- for all targets now.
- Save the bp number for the breakpoint installed at main and exit so
- that we can reliably delete them if the user cancels any subsequent
- target selection.
- Whenever the run is canceled, delete the breakpoints at main and exit.
- Move setting of breakpoints at main and exit from download_it here.
- (valid_target): New proc. Returns true if the given target is a valid,
- runnable target.
- (native_debugging): New proc. Returns true if this gdb is not a cross
- gdb.
- (startup code): Do not call set_target_name here -- let run_executable
- do it.
-
- * interface.tcl (gdbtk_tcl_query): Update the display when this dialog
- is dismissed.
- (gdbtk_tcl_warning): Always show warnings in the debug window.
-
- * download.tcl (download_it): Move setting breaks at main,exit to
- run_executable in main.tcl.
-
-Thu Apr 16 11:28:01 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * main.tcl (set_target_name): Add "prompt" parameter
- which allows this function to be called without it always
- prompting for the target name. This allows it to quietly
- initialize variables from preferences.
- (set_target): Remove HACK_FIRST_HACK.
- (run_executable): Check the result of [set_target].
- If it fails, prompt for a new target and repeat.
- (startup code): Remove HACK_FIRST_HACK.
- Call set_target_name to initialize gdb_target_cmd from
- preferences.
-
- * toolbar.tcl (create_menu_items): Call set_target_name
- for the target menu item. This will open the dialog and
- then set the target command correctly.
-
- * target.tcl (save): Set default target preference.
-
-Wed Apr 15 11:29:47 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (reconfig): Tell toolbar to reconfig.
-
- * global_pref.tcl (build_win): Add support for changing
- icons. Put fonts in a labelled frame.
- (update_file): Removed.
- (change_icons): Callback for icon combobox.
-
- * srcbar.tcl (_load_src_images): Remove old target and
- load images. Add reconfig parameter which reloads images.
- Use global gdb_ImageDir.
- (reconfig): New method.
-
- * floatbar.tcl (create_buttons): Remove target image.
- Use global gdb_ImageDir.
-
- * toolbar.tcl (_load_images): Use global gdb_ImageDir.
- Add reconfig parameter which reloads images.
- (reconfig): Don't rebuild everything, just reload images.
- (create_menu_items): Change "Fonts" preferences menu
- item to "Global".
-
- * prefs.tcl (pref_set_defaults): Save only basename in
- gdb/ImageDir preference. Initialize global gdb_ImageDir.
- (pref_read): Set gdb_ImageDir.
-
- * memory.tcl (build_win): Use global gdb_ImageDir.
-
- * manage.tcl (make_icon_window): Use global gdb_ImageDir.
-
- * about.tcl (build_win): Use global gdb_ImageDir.
-
- * images/icons.txt: New file; icon descriptions.
- * images/vmake.gif: New file.
- * images/vars.gif: New file.
- * images/watch.gif: New file.
- * images/bp.gif: New file.
- * images/memory.gif: New file.
-
- * images2/icons.txt: New file; icon descriptions.
-
- * toolbar_pref.tcl: Removed.
-
- * main.tcl (run_executable): If target is "exec" don't
- show target dialog unless the run command fails.
-
-Wed Apr 15 13:15:22 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * interface.tcl: (gdbtk_tcl_warning) changed to selectively
- display warnings in the GUI.
- (show_warning) new procedure. Displays warning dialogs.
-
-Wed Apr 15 07:13:04 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * src.tcl (do_popup): Fix merge casualty -- revert to pre-3/22 version.
- Don't allow tracepoint ranges to be set unless in asynch mode.
-
-Mon Apr 13 16:00:06 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * warning.tcl: new file. Implements WarningDlg class, for warning
- dialogs.
-
- * tclIndex: regenerated
-
- * Makefile: added new file warning.tcl
-
- * manage.tcl: added new window warningdlg, for ignorable warnings.
-
- * interface.tcl: (gdbtk_tcl_warning) new procedure. Creates a warning
- dialog.
- (gdbtk_tcl_ignorable_warning) new procedure. Creates a warning dialog.
- The user can choose to not have this dialog pop up again during the
- same debugging session.
-
-Mon Apr 13 13:04:20 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * stack.tcl (StackWin::constructor): Withdraw toplevel before calling
- all busy hooks; then build the window, go idle and pop the window onto
- the screen.
-
- * main.tcl (set_target_name): Use a regexp to match target names.
- Add "sds" as a target.
- (run_executable): Use gdb_immediate to run executable.
-
-Fri Apr 10 10:27:42 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * bp.tcl: changed default value of public var tracepoints to be 0.
-
-Thu Apr 9 15:21:49 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * global_pref.tcl (destructor): Delete test fonts here instead of
- in ok and cancel. This fixes bug when dialog was closed by
- clicking on close gadget.
-
- * src_pref.tcl (pick): When colors are changed, immediately
- update the dialog.
-
-Thu Apr 9 04:03:27 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * target.tcl (build_win): Bind <Return> for cancel and help buttons.
-
-Wed Apr 8 10:57:14 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * tdump.tcl: (update): show stuff on window only if current
- trace frame is not null.
-
- * variables.tcl: (build_win): get the current output-radix
- (getVariables): decide the format to display a var based on Radix
- VariableWin class: added protected member Radix
- (value): decide display based on output-radix
-
-Wed Apr 8 06:17:42 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * bp.tcl (get_actions): Open the trace dialog based on a tracepoint's
- number.
-
- * tracedlg.tcl (title): New method to title window based on mode.
- (TraceDlg::constructor): After the interp is idle, title this window.
- (build_win): Add support to simply pass a tracepoint number for editing.
-
-Tue Apr 7 12:49:45 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * variables.tcl (VariableWin): We should deiconify after withdrawing...
-
- * tracedlg.tcl (gdb_edit_tracepoint): Make necessary gdb_cmd changes
- to support new API.
- (gdb_add_tracepoint): Make necessary gdb_cmd changes to support new
- API.
-
- * tdump.tcl (update): Make necessary gdb_cmd changes to support new
- API.
- (TdumpWin::constructor): We should deiconify after we withdraw...
- Change idle callback to an update callback.
- (TdumpWin::destructor): Change idle callback to update callback.
-
- * srcbar.tcl (_open_file): Make necessary gdb_cmd changes to support new
- API.
- (create_buttons): Change all tracing commands to use gdb_immediate.
-
- * main.tcl (set_target_name): Add simulator target.
-
- * src.tcl (mode): When changing modes, clear the line to pc mappings.
- (location): Do not set current_addr if we are not running and gdb_loc
- thinks we're at 0x0.
- Clear the text-window-line to pc mapping when appropriate.
- Revert display_breaks change for SRC+ASM mode.
- (bp): Make sure mapping of PC to src window line exists before
- attempting to set breakpoints/tracepoints.
-
-Fri Apr 3 13:57:42 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * src.tcl: (do_key): added actions for key bindings in trace mode.
- (config_win): added key bindings for trace mode.
-
- * srcbar.tcl: (_set_trace) changed balloon contents for tstart/
- tstop button.
-
- * toolbar.tcl: (create_menu_items): changed names of menu items
- tstart and tstop to 'Begin Collection' and 'End Collection'.
- Changed name of Preference menu item from 'GDB' to 'Fonts'.
- Changed name of File menu item from 'Debugger Preferences' to
- 'Target Settings'.
- Commented out Preference menu item 'Download'.
- (create_buttons): tdump button, inserted text 'Td' in place of missing
- icon.
-
-
-Tue Mar 31 17:20:59 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile (TCL): Add ide.tcl.
- * tclIndex: Rebuild.
-
-Sun Mar 29 18:50:46 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * tracedlg.tcl (build_win): Enable tracepoints at assembly addresses.
- (add_action): Enable tracepoints at assembly addresses.
- (ok): Enable tracepoints at assembly addresses.
- (edit): Enable tracepoints at assembly addresses.
- (gdb_add_tracepoint): Enable tracepoints at assembly addresses.
-
- * srcbar.tcl (_open_file): If main () exists, show it.
-
- * src.tcl (display_breaks): If we are displaying breaks in assembly,
- clear the line and file specs.
- (location): Use display_breaks to insert breaks and traces.
- (bp): Rewrite. Actions are based on mode of the source window.
- (bp_line): When setting a tracepoint in assembly, pass address
- to set_tracepoint.
- (set_tracepoint): Open trace dialog specifying either line or
- address at which to set trace.
- (tracepoint_range): Rewrite. Actions are based on the mode of the
- source window. Now able to insert ranges of traces in any mode.
-
- * actiondlg.tcl (ActionDlg::constructor): Enable widget via address
- specification.
- (ActionDlg::Line): Default to empty list.
- (ActionDlg::Address): Add new memeber to enable assembly operation.
-
-Sun Mar 29 21:21:37 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * bp.tcl: add tracepoint number to tracepoint window.
- (build_win)(bp_add)(bp_select)(bp_modify)(bp_delete)
-
- * manage.tcl: (manage_init) do not open windows not related to
- current mode
-
- * tdump.tcl: (reconfig) remove it
- (config) add toplevel window, show window after it has been built.
- (update) add calls to busy and idle hooks, add third argument to
- gdb_cmd call
-
-Sun Mar 29 15:01:03 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * srcbar.tcl (_set_trace): Use gdb_immediate to execute the "tstop".
- Call run_executable when requesting a tstart.
- (_open_file): Convert all paths under cygwin32 to a posix-compliant
- pathname. Add this path to the source search list.
-
- * src.tcl (set_execution_status): Change stop messages to support
- tracing.
- (tracepoint_range): Clear the selection when we set a range of
- tracepoints.
-
- * main.tcl (set_target): Use gdb_immediate so that the console gets
- output of target command.
- (run_executable): Use gdb_immediate for run command.
- Include trace support.
-
-Sat Mar 28 15:50:01 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * srcbar.tcl (create_menu_items): Put menu items in proper order.
- (_open_file): Add exe file's directory to the default source
- search path.
-
-Sat Mar 28 14:29:08 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * srcbar.tcl (GDBSrcBar: runstop trace): If running async'ly, set
- the run/stop button by calling _set_trace. Otherwise use _set_runstop.
- (create_menu_items): Add file command to open a new exe.
- (_open_file): New method to handle requests to open a new exe.
-
- * main.tcl (set_target): If this is the first time running,
- then show the download prefs dialog.
-
-Sat Mar 28 16:30:55 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * tracedlg.tcl: (build_win) reinserted 'update idletasks' to
- display Actions frame properly.
-
- * actiondlg.tcl: (sort) moved "All Registers", "All Locals",
- "All Arguments" to beginning of list.
-
- * src.tcl: (line_is_executable) new method. Used in
- tracepoint_range.
-
-Sat Mar 28 10:58:04 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * tracedlg.tcl (gdb_edit_tracepoint): Don't let gdb_cmd call busy and
- idle hooks.
- (gdb_add_tracepoint): Ditto.
-
- * src.tcl (config_win): Change exit key binding from 'q' to 'x.'
- (goto_func): That's "file tail", not "file split."
-
- * srcbar.tcl (_set_stepi): Don't do anything if we're debugging
- asynchronously.
-
-Sat Mar 28 10:09:21 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * toolbar.tcl (create_menu_items): Change "Close Debugger"
- menu item to "Exit".
-
-Sat Mar 28 02:38:51 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src_pref.tcl (build_win): Fix Save and Apply buttons.
- Change "Save" to "OK". Use standard_button_box.
- (save): New method, save and exit.
- (apply): New method; save and don't exit.
- (cancel): New method; cancel all changes.
-
- * src.tcl (reconfig): Reconfigure colors, too.
-
- * global_pref.tcl (Globalpref): Fix deiconify call.
- (build_win): Use standard_button_box. Set default to OK.
- Remove unused stuff. Cleanup display.
-
- * Makefile: Removed toolbar_pref.tcl.
-
- * tclIndex: Rebuilt.
-
- * srcbar.tcl (create_buttons): Make toolbar always attached
- to source window.
-
- * toolbar.tcl (build_win): Always display toolbar and
- menubar attached to source window.
-
- * prefs.tcl (pref_set_defaults): Removed toolbar prefs.
-
- * manage.tcl (manage_init): Remove hack to change preferences
- names.
- (manage_init): Remove toolbar and toolbar prefs code.
- (manage_create): Remove toolbar code.
- (manage_open): Remove toolbar code.
- (manage_find): Remove toolbar code.
- (manage_delete): Remove toolbar code.
- (manage_restart): Remove toolbar code.
-
-Fri Mar 27 19:52:53 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * toolbar.tcl (create_menu_items): Do not disable preferences.
-
- * src.tcl (reconfig): Rewrite to not destroy window.
- Symbolic fonts are a blessing!
- Pass the image handles for our breakdots to makeBreakDots.
- (file): Move breakpoint/tracepoint insertion to a separate function...
- (display_breaks): .... this one.
- (location): Move the block which fills combo boxes to top in
- case an error causes us to exit early.
- (makeBreakDot): Accept an optional image handler so that it can be
- configured instead of created.
-
- * global_pref.tcl (build_win): Carry around a list of all changable
- fonts in case more granularity is needed. (Windows cannot change
- menu font...) Disable menu font for windows.
- (ok): Check the list of changable fonts.
- (cancel): Check the list of changable fonts.
- (apply): Check the list of changable fonts.
-
- * console.tcl (reconfig): New (empty) method to handle preference
- changes.
-
-Fri Mar 27 16:08:57 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * global_pref.tcl (ok): Must use preferences for comparison. Don't
- "manage restart" unless needed.
- (cancel): Don't configure the font -- changing the preference will do
- it automagically.
-
-Fri Mar 27 14:21:02 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * toolbar.tcl (create_menu_items): Use gdbtk_quit to initiate a quit.
-
- * src.tcl (do_key): Use gdbtk_quit to initiate a quit.
-
- * prefs.tcl (pref_save): Set a default value for WIN.
- Don't "manage restart".
- (pref_set_defaults): Register a quit hook to save preferences.
- (pref_quit): Call pref_save to save all preferences when we quit.
-
- * manage.tcl (manage): Add "quit".
- (manage_init): Register a gdb_quit_hook.
- (manage_delete): Instead of guessing when and what to ask to confirm
- a quit, call gdbtk_quit.
- (manage_quit): New procedure. This is called from the gdb_quit_hook to save
- window active'ness and geometries by calling manage_save.
-
- * interface.tcl: Define "gdb_quit_hook".
- (gdbtk_quit): New procedure to call whenever a quit is requested.
-
- * global_pref.tcl (ok): Do not save preferences here.
-
-Fri Mar 27 12:21:07 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * tracedlg.tcl (TraceDlg): Wait until idle to deiconify ourselves.
-
- * global_pref.tcl (Globalpref): Withdraw window before creating and
- deiconify it when idle.
- (cancel): Let the window manager destroy us.
- (ok): Let the window manager destroy us.
-
- * target.tcl (GdbLoadPref::constructor): Withdraw window before creating
- and deiconfiy it when idle.
-
- * memory.tcl (MemWin::constructor): Withdraw window before going
- busy.
-
- * register.tcl (RegWin::constructor): Withdraw window before going
- busy.
-
- * src.tcl (SrcWin::constructor): Withdraw window before creating and
- deiconify it when idle.
-
-Fri Mar 27 10:52:30 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * target.tcl: Fix entry for temotetcp.
-
- * main.tcl (set_target_name): Build correct gdb_target_cmd.
-
-Fri Mar 27 11:23:18 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * target.tcl: (build_win) added call to change_target to
- get the correct entry widgets when the dialog is opened.
-
-Fri Mar 27 01:43:41 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * target.tcl: Add simulator and remotetcp targets to
- target database. Change all the gdb/load/$target/foo
- preferences to gdb/load/$target-foo because the prefs
- code expects gdb/section/varname. The extra slash confuses
- it.
- (set_saved): Add saved_portname and saved_hostname for TCP.
- (write_saved): Add saved_portname and saved_hostname for TCP.
- (fill_rates): change states of hostname and portnum entry widgets.
- (fill_targets): Add fake remotetcp entry in target list.
- (change_baud): When switching between tcp and serial targets
- pack or forget the appropriate widgets.
- (build_win): Create hostname and port number entry widgets.
- (change_target): Update hostname and portnum widgets.
-
- * prefs.tcl (pref_save): Add 'load' as a section to be saved.
- Set gdb/load/target to 'exec'.
-
- * manage.tcl (_manage_null_handler): Deleted.
-
- * download.tcl (download_it): Don't call IDE functions
- unless GDTK_IDE is set.
-
- * main.tcl (gdbtk_tcl_preloop): Get name of executable
- if one was supplied on command line.
- (set_target_name): Save target name as preference.
- (run_executable): Call set_target.
-
-Fri Mar 27 00:23:46 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * src.tcl (location): Catch error of getting location of main.
-
- * prefs.tcl (pref_set_defaults): Add gdb/toolbar/active.
- Add trace for global/fixed font to update src-font.
- (pref_read): Add code to deal with global preferences.
- (pref_save): Add code to deal with global preferences.
- (pref_src-font_trace): Trace function which set src-font to global/fixed.
-
- * global_pref.tcl (build_win): Relayout font selectors and add a selections
- for menu and default fonts.
- Rename Save to OK and Quit to Cancel, renaming methods, too.
- (font_changed): Add arguments to facilitate multiple fonts.
- (reconfig): Define as empty.
- (ok): Rewrite to facilitate multiple fonts.
- (cancel): Rewrite to facilitate multiple fonts.
- (apply): Rewrite to facilitate multiple fonts.
-
- * manage.tcl (manage_restart): Call gdbtk_idle to reset the toolbar after
- it is recreated.
-
-Thu Mar 26 23:49:26 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * tdump.tcl, tfind_args.tcl: New files.
-
-Thu Mar 26 22:29:28 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * tracedlg.tcl: (config) commented out grab. Made window non-modal.
- (destructor) do not release grab.
- (done) do not reinstall grab.
-
- * toolbar.tcl: (create_buttons) changed buttons for the tracepoint
- case to open tdump window, and tracepoint window.
- (create_menu_items) change Run menu to do tstart, tstop for tracepoint
- case. Changed View menu to show tracepoint window for tracepoint case.
- Changed 'Control' menu to 'Trace' menu for tracepoint case, with
- tfind commands.
-
- * srcbar.tcl: (create_buttons) changed the buttons for the
- tracepoint case to do tfind commands.
- (_set_trace) new method. Toggles tstart/tstop button.
-
- * src.tcl: (config) decide defatul action for left click on
- source based on 'mode' preference.
- (bp_line) ditto.
- (config_win) modify pop upmenu on source window to display only
- 'set tracepoint'.
-
- * prefs.tcl: (pref_set_defaults) added preference gdb/mode for
- tracepoints or breakpoint display.
-
- * manage.tcl: (manage_init) added tracepoint window, args windows
- for tfind, tdump window.
- (manage_open) use eval in call to manage_create.
-
- * bp.tcl: (build_win) added PassCount to the display and modified
- the menus for the tracepoint case to display actions.
- (bp_add) display pass_count too in the tracepoint list.
- (bp_select) changed indexes of menu entries to be entries names.
- added field passcount to selection for tracepoints.
- (bp_modify) added passcount for tracepoints.
- (bp_delete) added passcount for tracepoints.
- (get_actions) new method
- Added new public member "tracepoints" to decide which kind of window
- needs to be displayed.
-
- * Makefile: added new files tfind_args.tcl and tdump.tcl.
-
- * tclIndex: regenerated
-
-Thu Mar 26 14:23:00 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * main.tcl (set_target_name): Make target dialog always
- on top.
-
- * target.tcl (build_win): Bind Return to save.
- (GdbLoadPref): Denter dialog on screen.
-
-Thu Mar 26 14:16:36 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * memory.tcl (update_address): Catch errors to update_addr so that
- we do not error and leave the GUI busy.
-
-Thu Mar 26 13:51:58 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * toolbar.tcl (create_menu_items): Remove "Cygnus
- Foundry Tour" and "Submit a PR" from the menu.
-
- * src.tcl (file): Set title to GDB.
-
- * manage.tcl (manage_init): Set About name.
-
- * main.tcl (set_target): Set title to GDB.
-
- * interface.tcl (gdbtk_tcl_query): Set title correctly.
-
- * Makefile: Remove download_pref.tcl.
-
-Thu Mar 26 11:33:02 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * Makefile: Add target.tcl to list of sources.
-
- * tclIndex: Rebuilt.
-
- * target.tcl (GdbLoadPref): Trace changes to gdb_loaded.
- (target_trace): New procedure. This is invoked by a write trace
- to gdb_loaded.
-
- * interface.tcl (gdbtk_busy): New procedure to run all busy hooks
- (gdbtk_update): New procedure to run all update hooks
- (gdbtk_idle): New procedure to run all idle hooks. Also runs the
- no inferior hooks if no inferior has been created.
- Rename old gdb_idle_hook to gdb_update_hook for clarity.
- Change all references of run_hooks to use gdbtk_busy, gdbtk_idle, and
- gdtk_update.
-
- * download.tcl: Make busy/update/idle hook changes.
-
- * main.tcl: Make busy/update/idle hook changes.
- (set_exe): Clear gdb_loaded whenever a new exec file is selected.
-
- * manage.tcl: Make busy/update/idle hook changes.
-
- * mem_pref.tcl: Make busy/update/idle hook changes.
-
- * memory.tcl: Make busy/update/idle hook changes.
-
- * register.tcl: Make busy/update/idle hook changes.
-
- * src.tcl: Make busy/update/idle hook changes.
-
- * stack.tcl: Make busy/update/idle hook changes.
-
- * variables.tcl: Make busy/update/idle hook changes.
-
- Merged with Foundry 1.0:
- Wed Mar 25 14:22:28 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * register.tcl (reconfig): Call busy and idle hooks.
-
- * memory.tcl (update_address): Call busy and idle hooks.
-
- Wed Mar 25 11:38:49 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (location): Fix typo.
-
- Tue Mar 24 21:03:01 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (location): If gdb_listfuncs returns an error, display
- an error message that says the file was either not found or contained
- no debugging information.
- (location): When disassembling, put busy and idle calls before
- and after. Set "NoRun" to indicate the busy hook should not
- display the stop sign because the target isn't running, GDB may
- just take a few seconds to do the disassembly.
- (busy): Hack to support NoRun mode.
-
- * srcbar.tcl (_set_runstop): Add another case to disable the
- Run icon instead of changing it to a stop sign.
-
- * main.tcl (set_exe): If the file has no debugging information,
- display an error message and exit. This should only happen with
- intentionally stripped files.
-
- Tue Mar 24 17:04:36 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * mem_pref.tcl (build_win): Keep track of all widgets that should be
- disabled when busy.
- (busy): New method which disables anything that could cause trouble.
- (idle): New method which re-enables anything that "busy" disables.
- (apply): Call busy and the busy hooks before doing update of memory
- window. Then call idle and the idle callbacks when we are done.
-
- Tue Mar 24 12:07:52 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (location): Filter out .s and .S files because
- Foundry does not yet support assembly source debugging.
-
- Tue Mar 24 08:50:46 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * register.tcl (but3): Don't pop up the right-click menu if we are
- running.
-
- * download.tcl (download_it): Force an update so that all windows
- are created and get their busy hooks called.
-
- * console.tcl (invoke): Make sure we are not running.
- (busy): New method.
- (idle): New method.
-
- Mon Mar 23 15:00:57 1998 Drew Moseley <dmoseley@cygnus.com>
-
- * src.tcl: (location): Assume we are locating main() if the target is
- not running and we can't figure out which function we are in.
-
- * main.tcl (run_executable): Change to assembly mode when we try to
- load a blank file. This usually means that source level debugging
- was not enabled when this file was compiled.
-
- Reverse the parameters to src method::location() method invocation so
- they are in the correct order
-
- Mon Mar 23 12:04:23 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (update): Comment out debug lines.
-
- * main.tcl (set_target_name): If the target name changes,
- force a new "file" command to be issued by setting
- gdb_exe_changed.
-
- Sat Mar 21 00:09:37 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * download.tcl (download_it): Remove call to run_idle_hooks.
-
- * src.tcl (no_inferior): Call set_execution_status.
-
- * bp.tcl (bp_modify, bp_delete): Change to take an entry
- number.
- (update): Sometimes "create" calls are for existing
- breakpoints and should be "modified" calls. Detect this
- and pass the entry number to bp_delete or bp_modify.
-
- Fri Mar 20 22:50:55 1998 Tom Tromey <tromey@cygnus.com>
-
- * console.tcl (insert): Remove all \r characters from string to be
- inserted.
-
- Fri Mar 20 01:55:14 1998 Keith Seitz <keiths@cygnus.com>
-
- * watch.tcl (validateEntry): Fencepost for running.
-
- * variables.tcl (VariableWin): Use "add_hook_before".
- (idle_done): New gdb_idle_done_hook for this object.
- (update): Don't call enable_ui here.
- (enable_ui): Change cursor for this object.
- (disable_ui): Ditto.
- (no_inferior): Ditto.
-
- * toolbar.tcl (GDBToolBar): Use "add_hook_before".
-
- * stack.tcl (StackWin): Use "add_hook_before".
- (StackWin): Encapsulate creation of this object with
- busy and idle hooks so that the user gets some feedback and to
- prevent other widgets from attempting to update.
- (update): Add some sanity checking so that we do not update with
- garbage in the window.
- (idle_done): New gdb_idle_done_hook for this object.
- (change_frame): Fencepost for running.
- (busy): New gdb_busy_hook for this object.
- (no_inferior): New gdb_no_inferior_hook for this object.
- (cursor): New helper method to set the cursor of all subwindows.
-
- * src.tcl (SrcWin): Use "add_hook_before".
- (toggle_updates): Use "add_hook_before".
- (stack): Encapsulate creation of the stack object with
- busy and idle hooks so that the user gets some feedback and to
- prevent other widgets from attempting to update.
- (idle_done): New gdb_idle_done_hook for this object.
- (set_execution_status): When Program is Terminated..., reset
- gdb_running.
- (config_win): Pull mouse pointer cursor assignments in text widget
- out into a separate function.
- (bind_src_tags): New method to set the cursor for the window's text
- widget tags.
- (disable_ui): Call bind_src_tags to change cursor to "watch".
- (enable_ui): Ditto.
- (no_inferior): Ditto.
- (cursor): New helper method to set the cursor of all subwindows.
-
- * register.tcl (RegWin): Encapsulate creation of this object with
- busy and idle hooks so that the user gets some feedback and to
- prevent other widgets from attempting to update.
- Use "add_hook_before".
- (reg_select_up): Fencepost for running.
- (reg_select_down): Fencepost for running.
- (reg_select_right): Fencepost for running.
- (reg_select_left): Fencepost for running.
- (reg_select): Fencepost for running.
- (edit): Fencepost for running.
- (idle_done): New gdb_idle_done_hook for this object.
- (busy): New gdb_busy_hook for this object.
-
- * memory.tcl (MemWin): Encapsulate creation of this object with
- busy and idle hooks so that the user gets some feedback and to
- prevent other widgets from attempting to update.
- Use "add_hook_before".
- (create_prefs): Fencepost for running.
- (idle_done): New gdb_idle_done_hook for this object.
- (edit): Fencepost for running.
- (newsize): Fencepost for running.
- (busy): New method to block UI while running inferior.
- (do_popup): Fencepost for running.
- (cursor): New method to change the cursor definition for this
- object.
-
- * manage.tcl (manage_init): Use "add_hook_before".
-
- * main.tcl (run_executable): Use "run_idle_hooks".
-
- * ide.tcl (gdbtk_ide_init): Don't create the source window here.
-
- * interface.tcl: Define new hook "gdb_idle_done_hook" -- to be called
- when the debugger does completely idle to allow input to objects
- again.
- (run_idle_hooks): New procedure to wrap the idle hooks.
- (gdbtk_tcl_idle): Split the idle callbacks into two parts: one that
- only updates widgets and one that tells widgets to accept input
- again.
-
- * download.tcl (Download): Use add_hook_before instead of add_hook.
- (download_it): Use run_idle_hooks instead running the idle hooks
- directly.
-
- * bp.tcl (BpWin): Use add_hook_before instead of add_hook.
-
- Wed Mar 18 18:59:00 1998 Sean Mahan <smahan@cygnus.com>
-
- * download.tcl (download_hash): Added an 'update' so the
- status bar would work on an MBX board.
-
- Wed Mar 18 01:50:19 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * prefs.tcl (pref_set_defaults): Define gdb/src/tab_size
- to default to a tab size of 4.
-
- * src.tcl (setTabs): Set up tabs correctly.
-
- * download.tcl (download_it): Set correct state after
- user cancels download.
-
- Tue Mar 17 12:30:23 1998 Tom Tromey <tromey@cygnus.com>
-
- * console.tcl (throttle): New public variable.
- (insert): Delete initial text when past the throttle limit.
-
- Tue Mar 17 13:31:38 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * ide.tcl (gdb_exit_check): Do not let gdb confirm the quit if we
- are downloading.
-
- Tue Mar 17 13:25:22 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * console.tcl (insert): Force update of screen.
-
- Mon Mar 16 10:22:00 1998 Sean Mahan <smahan@cygnus.com>
-
- * toolbar.tcl (create_menu_items): Added 'Submit PR' to the
- help menu. For PR15334
-
- Sun Mar 15 15:01:27 1998 Tom Tromey <tromey@cygnus.com>
-
- * interface.tcl (gdbtk_tcl_fputs): Don't call update.
-
- * src.tcl (build_win): Changed capitalization on balloon help.
-
- Fri Mar 13 10:01:48 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * src.tcl (mode): Add a horizontal scrollbar to the assembly pane
- of SRC+ASM mode when necessary.
-
- Fri Mar 13 00:47:59 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * main.tcl (run_executable): Don't force downloads for sim.
-
- * download.tcl (download_it): Don't bother calling calling set_baud
- for sim.
-
- * manage.tcl (manage_delete): Deregister the window before deleting
- it to prevent those annoying bgerror messages.
-
- Thu Mar 12 15:28:22 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * download.tcl (Download): Define a list of all sections.
- (update_download): Loop through the list of sections, updating the
- current section's progress and marking any previously loaded sections
- as done, if needed.
- (do_download_hooks): New procedure.
- (download_hash): Use a timer to force update of GUI at regular
- intervals -- GUI should not update 10,000 times a second.
-
- Tue Mar 10 06:32:24 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * interface.tcl (gdbtk_tcl_query): Allow caller to specify the default
- button. If none is specified, it is set to 'yes'.
-
- * manage.tcl (manage_delete): While inferior is running, gdb_cmd returns
- immediately, so we need to manually ask the user if he wants to quit.
-
- Tue Mar 10 10:52:09 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * download.tcl (download_it): Change where old breakpoints
- are cleared.
- (done): Set focus on "OK" or delete.
-
- Tue Mar 10 05:23:42 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * src.tcl (do_key): New method to wrap all keypresses.
- (mode): Use do_key method.
- (config_win): Use do_key method.
-
- Mon Mar 9 23:06:21 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src.tcl (download_progress): Add an optional message
- parameter to the function for use with error messages.
- Don't set_status twice on cancel. Call update if
- load fails.
-
- * download.tcl (done): If 'msg' is set, it should be
- displayed and download has failed. Update all source
- windows.
- (cancel): Don't delete window here. Let it get deleted
- after call to method 'done'.
- (download_it): If download failed, call done method
- with error message. Force reissue of target command.
- Handle set_target failures.
-
- * main.tcl (set_target): Check result of target command
- to see if the user cancelled the command.
- (run_executable): Use gdb_program_has_run instead of
- gdb_app_running, which was removed everywhere. Force
- download when gdb_program_has_run. If user cancels download
- before the download starts, preserve previous state.
-
- Mon Mar 9 15:06:21 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * console.tcl (invoke): After gdb_immediate() finishes
- check to see if the window is still there.
-
- * main.tcl: Initialize gdbtk_state(console).
-
- * interface.tcl: Remove some unused globals. Replace gdb_console
- with gdbtk_state(console).
- (gdbtk_tcl_readline_*): Don't set gdbtk_state(console) every
- time. Let manage.tcl do it.
-
- * manage.tcl (manage_create): Replace gdb_console with
- gdbtk_state(console). Check for windows that were deleted,
- but not actually gone yet.
- (manage_delete): Replace gdb_console with gdbtk_state(console).
-
- Mon Mar 9 09:08:11 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * watch.tcl (build_win): Tweak layout of the entry and button,
- switching to grid geometry manager.
-
-Thu Mar 26 01:22:23 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * target.tcl: New file. Implements target dialog.
-
- * srcbar.tcl (_set_run): Remove because it was no longer used.
-
- * util.tcl (freeze): Only call idewindow_freeze when
- using the IDE.
-
- * prefs.tcl (pref_set_defaults): Set default tab size to 4.
-
- * src.tcl (location): If gdb_listfuncs cannot find
- functions, display error message.
- (setTabs): Set real tabs according to gdb/src/tab_size.
-
- * main.tcl (set_exe): Check to see if file was stripped.
- Cannot debug without some symbols.
- (set_target_name): If target changes, set gdb_exe_changed
- so new "file" command will be sent. When not using IDE,
- display target requester.
-
- * manage.tcl: Set loadpref to GdbLoadPref.
-
-Wed Mar 25 14:13:52 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * manage.tcl (manage_init) added tracedlg and actiondlg windows.
-
-Wed Mar 25 14:08:51 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * interface.tcl (gdbtk_tcl_pre_add_symbol): New procedure.
- (gdbtk_tcl_post_add_symbol): New procedure.
-
- * src.tcl (set_execution_status): Use "set_status" to write to the
- status bar, not "set Status".
-
-Mon Mar 23 13:41:39 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * memory.tcl: Changes to support new faster gdb_get_mem().
- (do_popup): Add "Go To" and Open New Window" to the popup
- menu.
-
-Sat Mar 21 21:18:06 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- Merged changes from Foundry (list follows in reverse chronological
- order)
-
- Sean Mahan <smahan@cygnus.com>
- * download_pref.tcl (help): Added method to display context
- sensitive help.
-
- Keith Seitz <keiths@onions.cygnus.com>
- * src.tcl (bp_line): Don't insert breakpoints if we're running.
- (disable_ui): Disable selections. Workaround for TkTextDisplay bug.
- (enable_ui): Enable selections.
- (no_inferior): Enable selections.
-
- Tom Tromey <tromey@cygnus.com>
- * toolbar.tcl (create_menu_items): Use gdb_immediate, not gdb_cmd,
- so that output appears in console window.
- * src.tcl (bp_line): Use gdb_immediate when running "continue".
- (mode): Use gdb_immediate, not gdb_cmd, so that output appears in
- console window.
- (config_win): Likewise.
- * srcbar.tcl (create_buttons): Use gdb_immediate, not gdb_cmd, so
- that output appears in console window.
- * console.tcl (lvarpush): Removed.
- (_insertion): New method.
- (_saved_insertion): New private variable.
- (constructor): Don't let user use mouse to put cursor outside
- command line.
- * src.tcl (build_win): Use global/status font on status bar.
- * interface.tcl (gdbtk_tcl_query): Moved vwait out of `if'
- statement -- must vwait in all cases, not just in case when
- question is actually asked.
-
- Keith Seitz <keiths@onions.cygnus.com>
- * variables.tcl (deleteTree): Reset Locals and ChangeList, too.
-
- Martin M. Hunt <hunt@cygnus.com>
- * toolbar.tcl (enable_ui): Don't always set stepi and nexti
- buttons on.
-
- Keith Seitz <keiths@onions.cygnus.com>
- * toolbar.tcl (no_inferior): Instead of enabling/disabling the
- individual menus on Windows, disable each menu's entries.
- (disable_ui): Ditto.
- (enable_ui): Ditto.
-
- Keith Seitz <keiths@onions.cygnus.com>
- * manage.tcl (manage_delete): Catch destruction of the src window when
- downloading and ask user if this is what he intends.
- (manage_init): Don't install idle, busy, and no_inferior hooks. Allow gdb
- to exit whenever the user wants to.
- * srcbar.tcl (cancel_download): download_cancel_ok is a global.
-
- Martin M. Hunt <hunt@cygnus.com>
- * ide.tcl (receive_file_changed): Minor fix when a new
- executable is built when GDB is running.
-
- Martin M. Hunt <hunt@cygnus.com>
- * bp.tcl (bp_delete): If a selected breakpoint is deleted,
- set "selected" to 0.
-
- Keith Seitz <keiths@onions.cygnus.com>
- * srcbar.tcl (cancel_download): New method to cancel downloads. Needed
- to cancel download dialog-enabled downloads.
- (_set_runstop): Call cancel_download.
- * download.tcl (Download::constructor): Make sure to set the toolbar
- properly so that the Stop/Cancel button cancels a download.
- (download_it): Force the CANCEL to all download_progress_hook's.
- * src.tcl (download_progress): Add special section identifier for
- canceled downloads.
- (SrcWin::destructor): Pass the state_hook's command to remove_hook.
-
- Sean Mahan <smahan@cygnus.com>
- * toolbar.tcl (create_menu_items): Help menu follows "Help Topics"
- standard (PR 15082).
-
- Tom Tromey <tromey@cygnus.com>
- * interface.tcl (gdbtk_tcl_query): Consolidate Windows case; must
- `vwait' even when question is already being asked.
-
- Martin M. Hunt <hunt@cygnus.com>
- * interface.tcl (gdbtk_tcl_query): Only use ide_messageBox
- on Windows.
-
- Martin M. Hunt <hunt@cygnus.com>
- * register.tcl: Catch several gdb_register commands
- so errors don't bother us.
- * variables.tcl (destructor): Remove all hooks.
-
- Martin M. Hunt <hunt@cygnus.com>
- * download.tcl (done): Don't let seconds be zero.
- * manage.tcl (manage_disable_all): Don't ever disable "."
-
- Martin M. Hunt <hunt@cygnus.com>
- * main.tcl (run_executable): Removed delete_breakpoints
- stuff.
- * download.tcl (download_it): Removed delete_breakpoints
- stuff. Clear any breakpoints at exit and main before
- restarting. They get set again automatically if the
- preferences say they should.
- (Download): Don't call freeze on download window, because
- it stops updating when we do.
- (update): Renamed to update_download to avoid confusion.
- * src.tcl (mode): When changing from SRC+ASM to another
- mode, unset "awin".
- (bp_line): On a "Continue to Here" don't try to
- restore breakpoints that didn't exist before.
-
- Tom Tromey <tromey@cygnus.com>
- * interface.tcl (gdbtk_tcl_query): Set -parent on dialog.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (build_win): Set mode combobox width to 10.
- (goto_func): If a function name is an unmangled one,
- it is a C++ method so don't prepend filename when
- setting location. This is a kludge, but we are limited
- by the symtax the GDB command line parser will accept.
- (location): When loading function combobox,
- remember which names are unmangled. Change width of
- function combobox dynamically to better accomodate
- those long C++ names.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (bp_line): When doing a "continue to here",
- first save states of all breakpoints then restore
- when finished.
- (config_win): Uncomment "Continue to Here" menu item.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (location): Use ide_cygwin_path on Windows
- to change project root to the right format.
-
- Drew Moseley <dmoseley@cygnus.com>
- * main.tcl: (run_executable): Modified to call download_it
- with the parameter indicating whether to delete breakpoints.
- If GDB is loaded ($gdb_loaded == 1) and the app is running
- ($gdb_app_running == 1) then we don't delete the breakpoints.
- All other situations will require deleting the breakpoints.
- This allows us to redownload and run the same executable w/o
- losing the breakpoint information.
- * download.tcl: (download_it): Modified this routine to
- take a boolean parameter indicating whether to delete
- the breakpoints before downloading.
-
- Sean Mahan <smahan@cygnus.com>
- * toolbar.tcl (create_menu_items): Couldn't use 'helpdir'
- variable so used Paths(prefix) and added help.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (set_state): Turn off debugging.
- (location): Map windows pathnames into form GDB uses
- internally.
- (bp_line): Use gdb_set_bp to set breakpoints on
- a specific line in a file.
-
- Martin M. Hunt <hunt@cygnus.com>
- * stack.tcl (update): Skip over any empty elements
- in parsing the stack line to get the correct PC.
-
- Keith Seitz <keiths@onions.cygnus.com>
- * download.tcl (download_it): Run gdb_busy_hook's.
- If anything fails, make sure that the no_inferior_hook's are run.
- Note errors that occur during downloading, ignoring the
- "cancelled download" message. If an error occurs, set the
- global gdb_download_error to the error message so that it can
- be shown to the user later. Don't run the idle hooks if nothing
- * src.tcl (download_progress): Do not rely on the value of
- "download_cancel_ok" -- it is cleared in download_it.
- Reorder code to take advantage of gdb_loaded and gdb_download_error
- to determine if a download was canceled, successful, or failed due
- to an error. Truncate the "DOWNLOAD FINISHED:" message so that it
- will fit into the status bar given the recent font changes.
- (busy): If gdb_loaded, set the status bar to read "Program is running."
- Otherwise, don't touch it.
- (config_win): Comment out "Continue to here" right-click menu item
- until it can properly preserve breakpoint state.
- (no_inferior): Configure the toolbar to -runstop 0. All of these
- toolbar references should be done via the busy hook by the SrcBar
- class itself someday...
-
- Sean Mahan <smahan@cygnus.com>
- * toolbar.tcl (create_menu_items): Added ability to launch
- the tour help file from the help menu.
-
- Martin M. Hunt <hunt@cygnus.com>
- * manage.tcl, ide.tcl: Disable some debugging messages.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (set_state): When loaded state changes, invalidate
- current file.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (SrcWin): Change default title to "Foundry Debugger".
- (build_win): Change name and function combobox heights to 0.
- Set status bar font to src-font.
- (name): Rewrite to use _files array. This array allows us
- to map full pathnames with short names that are easily displayed.
- (file): Call set_name to update name combobox.
- (location): Call set_name to update name combobox. When setting
- the function combobox, adjust height to a maximum of 10. CLear
- filename combobox if there is no valid filename. When setting the
- filename combobox, adjust height to a maximum of 10. Create
- _files array mapping full pathnames to short names. For IDE, use
- vmake/source-files and project-root to build full pathnames.
- When changing mode, save current line. Don't mark current line
- with PC_TAG if gdb_running is 0.
- (set_name): New function. Update the name combobox, using
- the short name from _files if available.
- * bp.tcl (bp_modify, bp_add): Use short file name from
- _files global array.
-
- Keith Seitz <keiths@onions.cygnus.com>
- * variables.tcl (VariableWin): Add idle, busy, and no inferior hooks.
- (selectionChanged): Use Running fencepost.
- (updateNow): Use Running fencepost.
- (editEntry): Use Running fencepost.
- (postMenu): Use Running fencepost.
- (setDisplay): Use Running fencepost.
- (open): Use Running fencepost.
- (close): Use Running fencepost.
- (enable_ui): Define new procedure to install fencepost.
- (disable_ui): Define new procedure to remove fencepost.
- (no_inferior): Define new procedure to remove fencepost and clear tree.
- (Running): New protected data. This is used as a fencepost in this object.
- * main.tcl: Run gdb_no_inferior_hook's when done initializing.
- * src.tcl (disable_ui): Disable the combo boxes, too.
- (enable_ui): Enable the combo boxes, too.
- * download.tcl (download_it): Run gdb_no_inferior_hooks, too.
-
- Martin M. Hunt <hunt@cygnus.com>
- * main.tcl: Move IDE help initialization to ide.tcl.
- * ide.tcl (gdbtk_ide_init): Move help system
- initialization here.
-
- Sean Mahan <smahan@cygnus.com>
- * main.tcl: Initialized help sub-system for the ide.
-
- Tomy Hudson <thudson@thudson5.cygnus.com>
- * prefs.tcl: Changed COM1 back to com1 per Martins request.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (file): Call gdb_loadfile to do most of the
- work.
-
- Tomy Hudson <thudson@thudson5.cygnus.com>
- * prefs.tcl: Changed "com1" to "COM1"
-
- <dmoseley@cygnus.com>
- * main.tcl: (run_executable): Added code to test for app_running.
- If the app has been started and the user requests a "run", then
- we must redownload to ensure that the global initialized data is
- handled properly.
- * download.tcl: (download_it): See above note.
-
- Sean Mahan <smahan@cygnus.com>
- * toolbar.tcl (create_menu_items): changed "Tutorial" to "Cygnus
- Foundry Tour" in the Help menu.
-
- Tom Tromey <tromey@cygnus.com>
- * memory.tcl (mem_del): "destroy forget" is invalid; use "destroy"
- instead.
- * interface.tcl (gdbtk_tcl_query): Only ask each question once.
-
- Martin M. Hunt <hunt@cygnus.com>
- * manage.tcl (manage_init): Initialize new global
- _manage_enabled_flag to 1.
- (manage_disable_all): Only disable if
- _manage_enabled_flag is 1.
- (manage_enable_all): Only enable if _manage_enabled_flag
- is not 1.
-
- Martin M. Hunt <hunt@cygnus.com>
- * manage.tcl (manage_iconify): Check for toplevel
- of "." before doing anything.
- * main.tcl (set_target_name): Use "pref getd" in
- case port is undefined.
-
- Keith Seitz <keiths@onions.cygnus.com>
- * toolbar.tcl (GDBToolBar::constructor): Add appropriate idle, busy, and
- no-inferior hooks for this class.
- (create_buttons): Add all buttons to two lists so we can disable or enable
- them according to the inferior's run state.
- (create_menu_items): Same with the menus.
- * srcbar.tcl (create_buttons): Add all buttons to two lists so we can disable
- or enable them according to the inferior's run state.
- (create_menu_items): Same with the menus.
- (_set_run): Don't do anything to disable UI elements: the idle, busy, and
- no_inferior hooks will take care of it.
- (_set_runstop): Don't do anything to disable UI elements: the idle, busy, and
- no_inferior hooks will take care of it.
- * manage.tcl (manage): Add two new manage protocols: enable_all and
- disable_all.
- (manage_disable_all): New procedure to disable window manager functions
- such as window deletions.
- (manage_enable_all): New procedure to undo any changes made by
- manage_disable_all.
- (_manage_set_property): New helper procedure for above.
- (manage_init): Install this module's idle, busy, and no_inferior hooks.
- * src.tcl (SrcWin::constructor): Add new no_inferior hook.
- (disable_ui): New procedure to disable ui elements.
- (enable_ui): New procedure to enable_ui elements.
- (no_inferior): New procedure to reset GUI.
- (SrcWin::Running): New protected variable. A fencepost for the above
- hooks.
- (do_popup): Use above fencepost.
- (showBalloon): Use above fencepost.
- * main.tcl: Define new hook " gdb_no_inferior_hook".
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (SrcWin): Immediately set title name
- to "Debugger".
-
- Martin M. Hunt <hunt@cygnus.com>
- * download_pref.tcl (LoadPref): Make window transient.
-
- Martin M. Hunt <hunt@cygnus.com>
- * register.tcl (build_win): Set scrollbars to auto
- on Unix.
- * stack.tcl (build_win): Set scrollbars to auto
- on Unix.
- * memory.tcl (build_win): Restore proper resize
- functioning on Unix.
- * bp.tcl (build_win): Fix problem with merging Tom's
- sizebox change. Fix Tom's change so scrollbars aren't
- always on on Unix, at least.
- * interface.tcl (gdbtk_pc_changed): Called from GDB when
- the PC is changed with a "set $pc" command.
- (gdb_show_command, gdb_args, gdb_stack_trace,
- gdb_docstring,gdb_stack_depth, gdb_stack_frame): Removed.
-
- Martin M. Hunt <hunt@cygnus.com>
- * memory.tcl (destructor): Destroy memory prefs window
- if one exists.
- (create_prefs): Make prefs window transient.
- * util.tcl (freeze): Make keep_raised an option.
-
- Martin M. Hunt <hunt@cygnus.com>
- * ide.tcl (receive_file_changed): Ignore object file
- changes. On source file changes, put up a messagebox
- warning the user. Change both messageboxes to be system
- modal, which seems to just mean they will be on top.
-
- Martin M. Hunt <hunt@cygnus.com>
- * download.tcl (download_it): Reset download_cancel flag.
- * src.tcl: Create "tagtype" as a protected variable
- containing the current tag mode; PC, BROWSE, or STACK.
- Change all functions to use it.
- (mode): Fix problem with changing modes
- while browsing stack functions.
- (name): Add good filenames to the combobox history.
- (SrcWin): Turn off automatic history in name combobox.
- (file): If filename is not found, but is part of sources,
- put it in combobox followed by "(not found)"
- (location): Reorder and restructure this function to
- be more robust when files cannot be found or mode changes
- are required. When stack browsing, highlight PC if it is
- in the displayed area, and fix the off-by-1 problem
- with PCs saved on the stack.
- (update): Use lassign and new tagtype variable.
- (set_execution_status): Change message formats for MIXED
- and SRC+ASM modes.
- (mode): Update toolbar and mode display before calling
- location. Use tagtype so tag mode is preserved.
- * bp.tcl (bp_type): Deselect line before changing its
- type.
-
- Tom Tromey <tromey@cygnus.com>
- * bp.tcl (build_win): Use built-in sizebox of tixScrolledWindow.
- * watch.tcl (console): Set Sizebox to 0.
- * memory.tcl (build_win): Use built-in sizebox of
- tixScrolledWindow.
- * stack.tcl (build_win): Use built-in sizebox of
- tixScrolledWindow.
- * locals.tcl (build_win): Don't create sizebox.
- * variables.tcl (build_win): Use built-in sizebox of
- tixScrolledWindow.
- (Sizebox): New instance variable.
- * console.tcl (console): Use built-in sizebox of
- tixScrolledWindow.
- * register.tcl (build_win): Use built-in sizebox of
- tixScrolledWindow.
-
- Martin M. Hunt <hunt@cygnus.com>
- * main.tcl (set_target_name): Set port based on target
- name.
- (set_baud): Set baud rate based on target name.
- * srcbar.tcl: Change shortcuts to use () instead of <>.
- * download.tcl (download_it): Set download_verbose
- based on target name.
- * src.tcl (build_win): Set height to 0 for name and
- function comboboxes.
- (location): In IDE, use vmake/source-files property
- to fill name combobox.
-
- Keith Seitz <keiths@onions.cygnus.com>
- * variables.tcl (build_win): Set the variable window's
- default size to 40 chars.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (set_state): When loaded state changes,
- set program_has_run state to 0.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (set_status): Rewrite to handle temporary
- status messages.
- (set_execution_status): New function. Put a message
- about the current program status in the status bar.
- (trace_help): New function. Trace on changing ballon
- help messages. Write them in the status bar.
- * main.tcl (set_target): Comment out changing cursor.
-
- Martin M. Hunt <hunt@cygnus.com>
- * variables.tcl (changeValue): Trim string before
- comparing with "".
-
- Keith Seitz <keiths@onions.cygnus.com>
- * console.tcl (constructor): Set no wrap mode.
- * src.tcl (SrcWin::name): Make sure we ask gdb where the source file
- is before asking the source window to open it.
- (SrcWin::file): Do not ask gdb where the file is -- someone else
- already has. Set the file selector to the filename only once and
- only if successful finding the file.
- (SrcWin::location): Add flag idicating that a file load has failed.
- Resolves recursive loop with SrcWin::mode and SrcWin::location.
- Make sure the file and function selectors are filled only once.
- (SrcWin::mode): Add error flag to indicate that a file load failed.
- Resolves recursive loop with SrcWin::location.
- Make sure we exit with the proper mode set on the source window.
- (SrcWin::current_addr): Define a default value of 0x0.
- * console.tcl (invoke): Use new gdb_immediate command instead of
- gdb_cmd.
- (insert): Add all errors to the end of the text widget.
- Send errors to end of text widget, not insertion pt.
- (einsert): Send errors to end of text widget, not insertion pt.
- * interface.tcl (gdbtk_tcl_readline_begin): Insert message into
- command window so that the user sees messages like "Enter commands,
- one per line. Enter 'end' when finished."
- * main.tcl: Initialize gdbtk_state(readline).
-
- Tom Tromey <tromey@cygnus.com>
- * manage.tcl (manage_open): Force focus onto toplevel.
- * mem_pref.tcl (build_win): Don't put <Return> binding on
- toplevel; instead put focus on OK button.
-
- Martin M. Hunt <hunt@cygnus.com>
- * main.tcl (set_target_name): Replace "com1" with
- the port name we really want to use.
- * bp.tcl (build_win): Use place manager for sizebox
- so it doesn't go away when window is resized.
- * stack.tcl (build_win): Fix stack window.
- * memory.tcl: Back out previous changes.
- * locals.tcl (build_win): Use place manager for sizebox
- so it doesn't go away when window is resized.
-
- Tom Tromey <tromey@cygnus.com>
- * mem_pref.tcl (build_win): Make OK button default.
- * ide.tcl (gdbtk_ide_init): Set gdb_pretty_name. Track changes to
- target-pretty-name property.
- * src.tcl (update_title): Display pretty name for target.
- * main.tcl (set_target): Display pretty name for target.
- (gdb_pretty_name): New global.
- * ide.tcl (target_pretty_name_changed): New proc.
- (receive_file_changed): Display pretty name for target.
- * download.tcl (download_it): Display pretty name for target.
- (console): Likewise.
-
- Thomas Hudson <thudson@cygnus.com>
- * bp.tcl (build_win): Added frame and sizebox to bottom.
- Returned geometry management to previous packing style
- and window layout.
- * stack.tcl (build_win): ditto
- * memory.tcl (build_win): ditto
- * watch.tcl (build_win): ditto
- * locals.tcl (build_win): ditto
-
- Martin M. Hunt <hunt@cygnus.com>
- * manage.tcl (manage_iconify): Catch iconify command.
- * download.tcl (download_it): If set_target fails,
- set gdb_downloading to 0 and return.
- * main.tcl (set_target): Handle target command timeouts.
- Pop up messagebox. Set cursor to "watch". Set title
- on source window. Return 0 on error.
-
- Martin M. Hunt <hunt@cygnus.com>
- * manage.tcl (manage_find): Fix to return a list of windows.
- * console.tcl (Console): Fix sizebox so it doesn't create
- a whole blank line and it doesn't mess up Unix.
- * register.tcl (build_win): Change "Show" to "Display".
-
- Tomy Hudson <thudson@cygnus.com>
- * console.tcl (build_win) Added frame and ide_sizebox to
- bottom of window.
- * stack.tcl (build_win) Added frame and ide_sizebox to
- bottom of window.
- * watch.tcl (build_win) Added frame and ide_sizebox to
- bottom of window.
- * locals.tcl (build_win) Added frame and ide_sizebox to
- bottom of window.
-
- Tom Tromey <tromey@cygnus.com>
- * memory.tcl (build_win): Updated -underline values.
-
- Martin M. Hunt <hunt@cygnus.com>
- * memory.tcl (init_addr_exp): New function. Set the
- initial address expression to the location of .data
- if it is defined. Otherwise use $pc.
-
- Tom Tromey <tromey@cygnus.com>
- * bp.tcl (build_win): Changed packing so content fills window.
- Removed `g' and `a' frames. Changed gridding on labels.
- (bp_add): Changed gridding on new entries.
- * memory.tcl (build_win): Put spaces in front of all menu labels.
-
- Martin M. Hunt <hunt@cygnus.com>
- * download.tcl (download_it): Change error to messagebox.
-
- Tom Tromey <tromey@cygnus.com>
- * register.tcl (reg_display_list): Initialize to empty list.
- (init_reg_display_vars): Don't unset reg_display_list; set it to
- empty list.
- (delete_from_display_list): Likewise.
-
- Martin M. Hunt <hunt@cygnus.com>
- * ide.tcl (ide_run_server, ide_do_run_server): Take
- an optional argument to indicate if program should be
- run or simply downloaded.
- * console.tcl (Console): Enable scrollbars in both
- directions.
- * main.tcl: Moved keep_raised, sleep, and toggle_debug_mode
- to util.tcl.
- (set_exe): If exe changed, set gdb_target_changed
- to force new target command to be sent.
- (set_target_name): Check to see if gdb_target_changed.
- (run_executable): If exe or target changed, set gdb_loaded to
- 0, forcing a new download. If download only, try to
- display function main in source window.
- * util.tcl: New file.
- * hooks.tcl: Removed. Use version in libide.
- * Makefile: Add util.tcl.
- * download.tcl (Download): Call freeze to make modal window.
- (_map): Deleted.
- (download_it): Call set_baud, then set_exe then set_target.
- * mem_pref.tcl (build_win): Set default number of bytes
- to 128.
- * memory.tcl (build_win): Enable horizontal scrollbar
- when in resize mode. Anchor to top-left. Use "nb" to
- count actual number of bytes displayed, instead of "numbytes"
- which will be 0 when in resize mode.
- (delete_prefs): Deleted.
- * src.tcl (mode): Update mode combobox with new mode name.
- (location): In SRC+ASM mode if we step into a function without
- source code, unhighlight everything in the source pane and let
- the assembly pane show our current location.
- (build_win): Enable scrollbars in both directions.
- (set_state): Call update_title.
- (update_title): Don't set title if the target or exe has changed.
- (trace_variable): Couldn't figure out what this did that
- could be useful so delete it and everything that references it.
- * watch.tcl: Add description and copyright.
- * variables.tcl, interface.tcl, locals.tcl: Add copyright.
- * prefs.tcl, register.tcl: Add copyright.
-
- Tomy Hudson <thudson@cygnus.com>
- * register.tcl (reg_select_): Modified reg_select_* movement
- methods to use the register display list instead of
- a straight index.
-
- Tomy Hudson <thudson@cygnus.com>
- * register.tcl (unedit): Changed input focus to $ScrolledWin.$Editing
- in unedit. This allows arrow and tab key bindings to work
- after an edit.
-
- Tomy Hudson <thudson@cygnus.com>
- * register.tcl (build_win): Added key bindings and support
- for tab and arrow keys, including four new methods;
- reg_select_up,reg_select_down, reg_select_left, reg_select_right
- * register.tcl (build_win): Added spacing frame and ide_sizebox
- to window. Changed geometry manager to grid.
-
- Martin M. Hunt <hunt@cygnus.com>
- * stack.tcl (update): Only insert entries that have
- length. Break when matching entry in listbox is found.
- * src.tcl (config_win): Fix control-v binding so
- it doesn't paste on Windows. Cancel <Delete>
- binding.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (build_win): Force focus from toplevel
- down to text window.
- (mode): Restructure code to be clearer. Set focus
- when done.
-
- Tomy Hudson <thudson@cygnus.com>
- * src.tcl (mode): Modified key bindings for MIXED mode
- to be the same as ASSEMBLY mode
-
- Martin M. Hunt <hunt@cygnus.com>
- * manage.tcl (manage_init): set bp-save to 1.
- * variables.tcl (changeValue): If new value is null,
- cancel edit.
-
- Tomy Hudson <thudson@cygnus.com>
- * memory.tcl (do_popup): Added method do_popup. Changed binding of
- button-3 to invoke popup menu.
-
- Tomy Hudson <thudson@cygnus.com>
- * src.tcl (do_popup): Removed check for space in variable name
- that disabled popup menu items. Only check now is for "".
-
- Tomy Hudson <thudson@cygnus.com>
- * src.tcl (do_popup): Removed variable name from
- popup menu items. Added check for sane variable in selection
- to disable menu items when appropriate.
-
- Martin M. Hunt <hunt@cygnus.com>
- * bp.tcl (bp_delete): Destroy widgets in deleted
- line.
- * srcbar.tcl (_set_run): Enable View menu items
- when download is finished.
- * download_pref.tcl (LoadPref): Call loadprefs
- with gdbrunning set to 1.
-
- Tom Tromey <tromey@cygnus.com>
- * ide.tcl (gdbtk_ide_init): Use property vmake/exelist, not
- vmake-exelist.
-
- Martin M. Hunt <hunt@cygnus.com>
- * variables.tcl (build_menu_helper): Comment-out
- Update menu.
- (getVariables): Change variable name so it doesn't
- get confused with window variables.
- (postMenu): Comment-out Update entries.
- (UnEdit): Unbind keys when unediting.
- * memory.tcl (create_prefs): When prefs are already
- open, raise and focus the window.
- * bp.tcl (bp_type): Deselect current line when type changes.
-
- Martin M. Hunt <hunt@cygnus.com>
- * toolbar.tcl (create_menu_items): Call open_url for
- web connections.
- * src.tcl (name): When new file load fails, remove it
- from combobox. When load succeeds, clear status message.
- (location): Change how files are loaded into combobox.
- Call new gdb_listfiles function.
-
- Martin M. Hunt <hunt@cygnus.com>
- * manage.tcl (manage_create): Give newly created windows
- the focus on all platforms.
- * mem_pref.tcl (destructor): Notify parent when exiting.
- * srcbar.tcl (_set_run): Better state handling on
- pulldowns and icons.
- * src.tcl (build_win): Start with toolbar in right state.
- * memory.tcl (MemWin): Withdraw window until finished.
- (delete_prefs): New function.
-
- Martin M. Hunt <hunt@cygnus.com>
- * manage.tcl: For IDE, iconify all windows when source
- window is iconified.
- * mem_pref.tcl: Take out all the modal stuff.
- Leave this window non-modal.
- * download.tcl: Fix references to source window.
- (Download): Make window modal and always on top.
- * memory.tcl (destructor): Kill mem prefs window too.
- * variables.tcl (changeValue): Clean up.
- * register.tcl (acceptEdit): Change error messagebox.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (set_state): Disable items in breakpoint
- popups.
- (config_win): Change capitalization in popups.
-
- Martin M. Hunt <hunt@cygnus.com>
- * main.tcl: Major rewrite. Simplify. Move IDE
- functions to new file. Add state variables and
- hooks. Add copyright.
- * ide.tcl: New file. IDE functions.
- * download.tcl (download_it): Use new state variables.
- * src.tcl: Use new state variables.
- (constructor): Add state hook.
- (set_state): Hook to enable/disable menus and icons.
- * srcbar.tcl (runstop): Renamed from "running"
- (running): Public variable to control icons.
- (_set_runstop): Change Running man to stop sign.
- (_set_run): Enable/disable icons depending on debugger
- state.
- * manage.tcl (create_closed): Deleted function.
- (manage_create): Remove visibility argumnet.
- (manage_delete): Remove special case for debugger prefs.
- * prefs.tcl (pref_set_defaults): Remove gdb/advanced.
- * hooks.tcl: Add copyright.
- * Makefile: Add ide.tcl.
-
- Tom Tromey <tromey@cygnus.com>
- * download_pref.tcl (LoadPref): Inherit from GdbLoadPref.
- (constructor): Rewritten.
- (build_win): Removed.
- (change_baud): Removed.
- (save): Removed.
- (cancel): Removed.
- (config): Removed.
- (reconfig): Removed.
-
- Martin M. Hunt <hunt@cygnus.com>
- * main.tcl (target_name_changed): Append correct
- port name to target name.
- (gdbtk_ide_init): Don't initialize IDE preferences.
- Append port name to target name.
- * toolbar.tcl (create_menu_items): Add Debugger Preferences
- to File menu.
- * pref.tcl: Remove all ide preferences functions.
- * prefs.tcl (pref_set_defaults): Define gdb/load/port.
- * download_pref.tcl: Added serial port selection.
-
- Martin M. Hunt <hunt@cygnus.com>
- * register.tcl (acceptEdit): Remove leading spaces from
- values.
- * src.tcl (config_win): New tag bp_tag. Like break_tag
- except used when a bp is set on that line. Bind new menu
- to bp_tag.
- (insertBreakTag): Accept tag type. Remove old tag.
- (do_bp): When a breakpoint is set, use bp_tag.
-
- Tom Tromey <tromey@cygnus.com>
- * pref.tcl (pref_ide_proc): Withdraw the toplevel, not the
- window.
-
- Tom Tromey <tromey@cygnus.com>
- * tclIndex: Rebuilt.
- * mem_pref.tcl (build_win): Use standard_button_box.
- (_map): New method.
- (constructor): Run _map on <Map> event.
- * pref.tcl (pref_ide_proc): Use idewindow_check_freeze.
- (pref_modal_dialog): Use idewindow_freeze and idewindow_thaw.
- * hooks.tcl: Removed.
- * Makefile (TCL): Removed hooks.tcl.
-
- Tom Tromey <tromey@cygnus.com>
- * main.tcl (ide_run_server): Quote call to ide_do_run_server.
-
- Tom Tromey <tromey@cygnus.com>
- * download_pref.tcl (build_win): Make OK button default. Invoke
- when Return pressed.
- * download_pref.tcl (build_win): Don't allow pref window to
- resize. Use standard_button_box to lay out buttons.
- * pref.tcl (pref_ide_proc): Handle window freezing.
- (pref_modal_dialog): Freeze and thaw window around the grab.
- (build_win): Use standard_button_box to lay out buttons. Don't
- allow pref window to resize.
-
- Ian Lance Taylor <ian@cygnus.com>
- * src.tcl (src_ide_proc): Download the file in an idle callback.
- Execute the idewindow command even if the download was cancelled.
- * library/main.tcl (ide_run_server): Do everything in an idle
- callback.
- (ide_do_run_server): New procedure.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl (bp_line): Use hasBP instead of validBPLine.
- Allow type TC even if BP set.
- (validBPLine): Renamed to hasBP.
-
- Tom Tromey <tromey@cygnus.com>
- * manage.tcl (manage_open): Special case "about" window when
- running under IDE.
-
- Martin M. Hunt <hunt@cygnus.com>
- * main.tcl (set_target): Set the target again if the
- executable has changed and executed a "file" command.
- * memory.tcl (update_address): Accept numerical entries
- and catch errors.
- * download.tcl (Download): Cancel button should call
- cancel method.
- * main.tcl (run_executable): Fixed messageBox.
-
- Tom Tromey <tromey@cygnus.com>
- * floatbar.tcl (constructor): Added.
- * srcbar.tcl (constructor): Added.
- * toolbar.tcl (_ide_title): New instance variable.
- (create_menu_items): Pass _ide_title to idewindmenu.
-
- Martin M. Hunt <hunt@cygnus.com>
- * main.tcl (toggle_debug_mode): Fix typo and print
- debug message before disabling it.
-
- Martin M. Hunt <hunt@cygnus.com>
- * manage.tcl (manage_delete): Don't remove a window
- from the active list until after it has already deleted
- itself.
- * toolbar.tcl (create_menu_items): Change Console shortcut
- to Ctrl+N.
- * src.tcl (config_win): Change Console shortcut to Ctrl+N.
-
- Martin M. Hunt <hunt@cygnus.com>
- * src.tcl: (do_bp): Catch errors.
- (validBPLine): Valid lines have a "-" or an image.
-
- Martin M. Hunt <hunt@cygnus.com>
- * main.tcl (ide_run_server): Don't run executable if
- download was cancelled. Reset cancelled flag.
- (run_executable): Call download_it.
- (download): Renamed download_it and moved to download.tcl.
- (set_target): Don't set target if the name hasn't changed
- from the last time.
- * register.tcl (reg_select): Catch errors.
- (delete_from_display_list): Enable menu item.
- * src.tcl (build_win): Add progress bar for downloads.
- (download_progress): New function. Callback to update
- progress meter.
- (src_ide_proc): Don't open src window if download
- cancelled.
- * toolbar.tcl (create_menu_items): Call download_it.
- * srcbar.tcl (_set_run): New mode. Sets run button to stop
- sign during downloads.
- * prefs.tcl (pref_set_defaults): Define gdb/load/verbose.
- * interface.tcl: Define new hook download_progress_hook.
- * floatbar.tcl (create_buttons): Call download_it.
- * download_pref.tcl: Add download dialog prefs.
- * download.tcl (Download): Change back to old dialog
- with each section listed seperately.
- (download_hash): Use a hook.
- (download_it): New function. Replaces old "download"
- from main.tcl. Now deletes all breakpoints before
- downloading and handles cancels correctly.
-
- Martin M. Hunt <hunt@cygnus.com>
- * main.tcl (download): Don't quote the executable name
- with single quotes.
-
- Tom Tromey <tromey@cygnus.com>
- * src.tcl (src_ide_proc): Exit gdb when destroy request seen.
-
- Ian Lance Taylor <ian@cygnus.com>
- * main.tcl (gdbtk_ide_init): Use src_ide_proc for the source
- window, rather than idewindow_proc. Remove extraneous line.
- * src.tcl (src_ide_proc): New procedure, replacing open_src. Only
- download if we are opening the source window.
- (src_no_save): New procedure.
- * main.tcl (gdbtk_ide_init): Initialize gdb_checking_for_exit.
- Register gdb_exit_check as the exit check procedure.
- (gdb_exit_check): New procedure.
- * interface.tcl (gdbtk_tcl_query): If gdb_checking_for_exit, use a
- system modal message box.
- * src.tcl (build_win): Create a FocusIn binding to push focus down
- from the top level.
- * console.tcl: Change all control, alt, and unadorned character
- bindings to use bind_plain_key.
- * memory.tcl: Likewise.
- * src.tcl: Likewise.
- * variables.tcl: Likewise.
- * src.tcl: Use bind_plain_key rather than explicitly ignoring Alt
- bindings.
- * src.tcl (print): Call idewindow_freeze and idewindow_thaw around
- call to print menu.
- * srcbar.tcl (create_menu_items): Likewise, around call to page
- setup menu.
- * main.tcl (gdbtk_ide_init): Use an underscore in generic window
- name, to set the accelerator key.
- (ide_run_server): Likewise.
- * toolbar.tcl (create_buttons): Likewise.
-
- Martin M. Hunt <hunt@cygnus.com>
- * register.tcl (acceptEdit): If no value is entered,
- set the cell to 0.
-
- Ian Lance Taylor <ian@cygnus.com>
- * src.tcl (config_win): Add ignored Alt bindings for all the
- unmodified key bindings.
- * download.tcl (constructor): Withdraw the window before doing
- anything. Set the width of the label. Don't try to center the
- window. Pass toplevels to wm transient. Run keep_raised after
- 500. Don't call update.
- (done): Use after rather than a busy loop.
- (destructor): Cancel the after if it is defined.
- (after_id): New protected variable.
- * main.tcl (download): If download is already running, don't do
- anything. If .load0.load exists, delete it before calling manage
- create.
- * main.tcl (gdbtk_ide_init): Use pref_ide_proc rather than
- idewindow_proc when registering the preference window.
- * download_pref.tcl (save, cancel): Call pref_ide_finished.
- * pref.tcl (save, cancel): Likewise.
- (pref_ide_proc): New procedure.
- (pref_no_save): New procedure.
- (pref_modal_dialog): New procedure.
- (pref_ide_finished): New procedure.
- * tclIndex: Rebuild.
- * main.tcl (gdbtk_ide_init): Initialize gdb_download_cancelled.
- (run_executable): Put a trace on gdb_download_cancelled. Change
- the dialog box message. If the user cancels the download, clear
- gdb_run_pending and just return without running.
- (ide_do_run): Remove the traces on gdb_download_cancelled. If the
- user cancelled the download, just clear gdb_run_pending.
- (target_name_changed): Clear gdb_download_cancelled. Call
- set_exe_name.
- (download): If the executable is not up to date, ask whether the
- user is really really sure. If the user cancels the download
- using the dialog button, set gdb_download_cancelled, and don't set
- the breakpoints or gdb_download_complete.
- (set_exe_name): Clear gdb_download_cancelled.
- (receive_file_changed): Ask whether we should download the new
- executable.
- * src.tcl (open_src): Don't download the file if
- gdb_download_cancelled is set.
- * interface.tcl (gdbtk_tcl_query): Pass -modal task to
- tk_messageBox.
- * main.tcl (set_exe_name): Tell the src window to go back to
- looking at main if the file changes.
- * src.tcl (update): Catch errors when calling gdb_loc.
- * main.tcl (gdbtk_ide_init): Handle file-created, file-changed,
- file-removed, and file-deleted events rather than process-ended
- events.
- (set_exe_name): Call gdb_clear_file even if the file does not
- exist. Likewise for setting gdb_download_complete to zero.
- (receive_file_changed): Rename from receive_process_ended. Only
- check the executable mtime if the tail of the file name matches
- the executable name.
-
- Ian Lance Taylor <ian@cygnus.com>
- * srcbar.tcl (create_menu_items): Change ``Print Setup...'' to
- ``Page Setup...''. Pass -parent to ide_winprint page_setup.
- * src.tcl (print): Pass -parent to send_printer.
-
- Ian Lance Taylor <ian@cygnus.com>
- * main.tcl: Move initialization code to end of file, after all
- procedures have been defined.
- (gdbtk_ide_init): New procedure to handle IDE initialization.
- (gdbtk_tcl_preloop): Don't do anything if using the IDE.
- (ide_run_server): Error if file does not exist. Use
- idewindow_activate_by_name, rather than manage open. Do
- everything after idle.
- (run_executable): Clean up a bit. Consistently use ide_do_run.
- (target_name_changed): Rename from target_name. Rename parameter
- num to propset.
- (download): Error if the file does not exist. Call set_exe_name.
- Don't set gdb_download_mtime. Don't check whether gdb_run_pending
- is 2.
- (exe_name_changed): Rename from exe_name.
- (set_exe_name): Set gdb_exe_mtime. Quote filename passed to
- gdb_cmd.
- (receive_process_ended): Don't check the data argument. Check
- gdb_exe_set rather than gdb_download_complete. Check
- gdb_exe_mtime rather than gdb_download_mtime.
- * src.tcl (open_src): Set the location to main as well as
- downloading the file. Don't set gdb_run_pending to 2.
-
-
-Tue Feb 10 17:50:37 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * bp.tcl (build_win): Do not set the disabled foreground for menus. Insert
- all tracepoints, too.
- (bp_add): Handle tracepoints.
- (bp_type): Handle tracepoints.
- (update): Handle tracepoints.
- (bp_all): Do tracepoints, too.
- (Index_to_bptype): New protected variable to index type of break (breakpoint
- or tracepoint) against index in window.
- (bp_select): Disable/Enable menu items based on type.
- (bp_able): Handle tracepoints.
-
- * src.tcl (do_bp): Handle disabled tracepoints.
-
- * actiondlg.tcl (change_other): Handle memranges and use info address to
- validate entries.
-
- * tracedlg.tcl (edit): Handle memranges when formatting data for
- action dialog.
-
-Mon Jan 26 11:44:39 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * src.tcl (fill_files): Don't check for file's existance -- let
- SrcWin::name do that.
-
- * actiondlg.tcl (change): Add everything that is specified, not
- just the things about which we know.
-
-Sun Jan 25 01:01:32 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * stack.tcl (update): Only insert entries that have
- length. Break when matching entry in listbox is found.
-
- * src.tcl (fill_files): Don't call lsort. New listfiles
- command sorts for us.
-
- * variables.tcl (changeValue): If new value is null,
- cancel edit.
- (build_menu_helper): Comment-out Update menu.
- (getVariables): Change variable name so it doesn't
- get confused with window variables.
- (postMenu): Comment-out Update entries.
- (UnEdit): Unbind keys when unediting.
-
-Thu Jan 22 10:38:19 1998 Keith Seitz <keiths@cygnus.com>
-
- * toolbar.tcl (create_menu_items): Disable preferences.
-
- * prefs.tcl (pref_set_defaults): Attach the toolbar to the source window
- by deafult.
- * src.tcl (SrcWin::build_win): Turn off history for the file selector.
- (SrcWin::name): Use SOURCEWIN_set_status to upate status.
- Make sure we ask gdb where the source file is before asking
- the source window to open it.
- (SrcWin::file): Do not ask gdb where the file is -- someone else already has.
- Set the file selector to the filename only once and only if
- successful finding the file.
- (SrcWin::fill_files): Sort the files before inserting into file selector.
- (SrcWin::location): Add flag idicating that a file load has failed. Resolves
- recursive loop with SrcWin::mode and SrcWin::location.
- Make sure the file and function selectors are filled only once.
- Use SOURCEWIN_set_status and SOURCEWIN_reset_status as appropriate.
- (SrcWin::set_status): Add verbatim flag to allow a generic message to be
- displayed.
- (SrcWin::mode): Add error flag to indicate that a file load failed. Resolves
- recursive loop with SrcWin::location.
- Make sure we exit with the proper mode set on the source window.
- (SrcWin::reset_status): New procedure.
- (SrcWin::current_addr): Define a default value of 0x0.
- (SrcWin::Status): New protected variable.
- (SrcWin::bp_line): Check if breakpoint set in assembly-mode, too.
- (SOURCEWIN_set_status): New procedure to temporarily set the status bar.
- (SOURCEWIN_reset_status): New procedure which is called after the status bar
- should be reset.
- (SOURCEWIN_reinit): New procedure to reinitialize the source window. (To be
- called when new symbol files are added and like).
-
- * interface.tcl (gdbtk_tcl_query): Properly set the name of the
- query dialog.
- (gdbtk_tcl_pre_add_symbol): Hook called from gdbtk.c to inform user that
- we are reading symbols.
- (gdbtk_tcl_post_add_symbol): Hook called from gdbtk.c to inform user that
- are finished reading symbols.
-
- * src.tcl (SOURCEWIN_reinit): New procedure which updates the source window with
- a default file, fills the file selectors, etc.
- (SOURCEWIN_set_status): New procedure which can be used to set the status bar
- on the source window.
- (set_status): Add flag for setting the status as-is.
-
- * main.tcl: Call SOURCEWIN_reinit to setup the source window on startup.
-
-
-Fri Jan 16 09:11:30 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * src.tcl (SOURCEWIN_set_status): New procedure to allow anyone to set the
- status bar text at the bottom of the source window.
- (fill_files): Use a little more full-proof method (if slower) for eliminating
- duplicates int the files combobox.
-
- * interface.tcl (gdbtk_tcl_pre_add_symbol): New procedure called prior to
- a symbol file is loaded.
- (gdbtk_tcl_post_add_symbol): New procedure called after a symbol file is
- loaded.
-
-Thu Jan 15 12:41:27 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * console.tcl (invoke): Use new gdb_immediate command instead of gdb_cmd.
-
-Wed Dec 31 16:50:26 1998 Keith Seitz (keiths@onions.cygnus.com)
-
- * actiondlg.tcl (change): handle '$' in register names.
-
diff --git a/gdb/gdbtk/library/ChangeLog-1999 b/gdb/gdbtk/library/ChangeLog-1999
deleted file mode 100644
index 1494f6a54b5..00000000000
--- a/gdb/gdbtk/library/ChangeLog-1999
+++ /dev/null
@@ -1,1083 +0,0 @@
-1999-12-15 Fernando Nasser <fnasser@rtl.cygnus.com>
-
- * variables.tcl: UnEdit any fields open to edit before colapsing
- a tree branch (it was generating a Tcl exception and stack dump).
-
-1999-09-29 James Ingham <jingham@leda.cygnus.com>
-
- * prefs.tcl (pref_read): Convert env(HOME) to a win32 path BEFORE
- handing it to file join, so we won't look for a network drive.
-
-1999-09-23 James Ingham <jingham@leda.cygnus.com>
-
- * toolbar.tcl (GDBToolBar): Typo.
- (new_menu): Changed this to allow menus to be altered as well as
- added.
- (menu_exists): New method.
- (clear_menu): New method.
- (_load_src_images): Moved here from srcbar.tcl. Added Attach &
- Detach classes. This is all still kind of ill-factored.
- (In instance data): Made menu data arrays rather than dynamically
- constructed variables.
-
- * srcwin.itb (SrcWin::set_execution_status): Let gdb print the PC,
- since Tcl's conversion may not be wide enough.
-
- * srctextwin.ith: initialize the Cname variable.
-
- * srctextwin.itb (SrcTextWin::location):
- (SrcTextWin::location): Change address compare to a string
- compare. These are always both hex in the same format, but on a
- 64 bit host the conversion would fail.
- (SrcTextWin::showBalloon): Catch all errors in the balloon help
- but also report them to the debug window.
- (SrcTextWin::LoadFromCache): Erase and reload dirty cached windows.
-
- * srcbar.tcl (create_run_menu): Add "Attach", "Detach" and "Kill"
- for native targets.
- (do_attach): Attach to a native target.
- (do_detach): Detach from a native target.
- (do_kill): Kill a native target.
-
- * memwin.itb (MemWin::toggle_enabled): Toggle the state of the
- widget, as well as the color, so people can't edit when the window
- doesn't contain valid memory.
- (MemWin::update_address): Set the state to normal if we have
- loaded valid memory.
- (MemWin::BadExpr): Set the state to disabled on error.
- (MemWin::incr_addr): Set the state to normal if a step succeeds.
-
- * managedwin.itb (ManagedWin::open_dlg): New function. Preferred
- function when you know you are opening a dialog.
- (ManagedWin::_open): new function, contains the common bits of
- opening windows & dialogs.
- (ManagedWin::open): Use the _open function.
- (ManagedWin::_create): Don't use Icon windows with modal dialogs.
-
- * interface.tcl (gdbtk_cleanup): Set a shutting_down flag.
- (gdbtk_tcl_fputs): Restore the fputs hook. This is trivial to do,
- and ensures that no one will delete the hook behind our backs.
- (gdbtk_tcl_fputs_error): ditto.
- (_open_file): Make file parameter optional, and don't query if it
- is provided.
- (gdbtk_attached): New function. Called from attach hook.
- (gdbtk_detached): New function. Called from detach hook.
-
- * helpviewer.ith (HtmlViewer): Add the attach dialog to the list
- of topics.
-
- * srcbar.tcl (do_kill): Added the Kill menu item for killing the
- inferior on native targets.
-
-1999-09-16 James Ingham <jingham@leda.cygnus.com>
-
- * prefs.tcl (pref_set_defaults): define the wrap preference for
- the console window.
-
- * console.itb (Console::_paste): Add the "delete selection"
- semantics so we can use this for all the Paste events.
- (Console::_delete): New method, centralize delete handling so we
- can protect against things like delete deleting a selection up in
- the history region of the window.
- (Console::_build_win): Change bindings to use _paste & _delete.
- (Console::_build_win): wrap if told to by the wrap parameter.
-
- * console.ith: Declare _delete.
-
-1999-09-16 Stan Shebs <shebs@andros.cygnus.com>
-
- * targetselection.itb (TargetSelection::init_target_db): Remove
- references to D10V target, use only standard remote for D10V.
-
-1999-09-15 James Ingham <jingham@leda.cygnus.com>
-
- * console.itb (Console::_paste): Fix another "set foo [catch ...]"
- idiom.
- (Console::_build_win): Remove the extraneous posting of the
- <<Paste>> event in handling B2-Release. Just call _paste.
-
-1999-09-10 James Ingham <jingham@leda.cygnus.com>
- From Mumit Khan <khan@xraylith.wisc.edu>
-
- * prefs.tcl (pref_set_defaults): Add main_names preference.
- * interface.tcl (gdbtk_locate_main): New proc.
- (run_executable): Use.
- * srcwin.itb (SrcWin::_build_win): Use.
- (SrcWin::location): Likewise.
- (SrcWin::point_to_main): Likewise.
-
-1999-08-27 James Ingham <jingham@leda.cygnus.com>
-
- * srctextwin.itb (SrcTextWin::FillAssembly): Use the new
- gdb_load_disassembly.
- (SrcTextWin::FillMixed): Use the new gdb_load_disassembly.
-
- * interface.tcl (gdbtk_idle): Call gdbtk_restore_fputs at idle
- time. This puts the gdbtk_fputs hook back in place, just in case
- an error left it pointing to null.
-
-1999-08-11 Tom Tromey <tromey@cygnus.com>
-
- * kod.itb (KodWin::build_win): Don't use Tix.
- (Various): Changed as a result of build_win change.
- (KodWin::destructor): Unset new globals. Also unset
- kodActivePane.
-
- * kod.ith (labh): Removed variable.
-
- * kod.ith (set_os): Declare.
- * kod.itb (KodWin::build_win): Don't use Tix labelled frame
- widget or Tix paned widget. Removed size boxes from Windows
- code.
- (KodWin::constructor): Add `$this set' to gdb_set_hook.
- (KodWin::destructor): Remove from hook.
- (KodWin::set_os): New method.
-
- * toolbar.tcl (GDBToolBar::destructor): Remove from gdb_set_hook.
- (GDBToolBar::constructor): Add to gdb_set_hook.
- (set_hook): New method.
- (create_view_menu): Don't put kod onto menu.
-
- * kod.itb (KodWin::display_object): Don't put `Details' message in
- label; this messes up resize and doesn't really add anything.
-
- * images/kod.gif, images2/kod.gif: Removed.
- * toolbar.tcl (create_window_buttons): Removed kod button.
- (add_menu_command): Don't load kod image.
-
- * kod.itb: Renamed from kod.tcl. Restructured to follow new itcl
- conventions.
- * kod.ith: New file.
-
- * toolbar.tcl (create_window_buttons): Use gdb_kod_cmd, not
- gdb_kod_name.
- (create_view_menu): Likewise.
- * interface.tcl (initialize_gdbtk): Don't mention gdb_kod_name.
-
- * targetselection.itb (TargetSelection::init_target_db): Added
- Cisco targets. From Martin Hunt.
-
- * kod.tcl (build_win): Use correct capitalization for buttons.
-
-1999-08-10 James Ingham <jingham@leda.cygnus.com>
-
- * srctextwin.itb (SrcTextWin::constructor): Add the disassembly
- flavor hook.
- (SrcTextWin::disassembly_changed): New method, fix up all the
- windows when the disassembly flavor changes.
- (SrcTextWin::_mtime_changed): We were setting the filename:dirty
- to 1 regardless of the result of the mtime check... Doh!
- (SrcTextWin::reconfig): The setTabs call was assuming ALL windows
- were source windows.
- (SrcTextWin::do_tag_popup): Remove the balloon when the breakpoint
- popups are posted as well.
- (SrcTextWin::do_source_popup): Also handle the case where there is
- a selection, but the point is not over it.
-
- * srctextwin.itb (SrcTextWin::destructor): Remove it when the
- object goes away.
-
- * regwin.itb (RegWin::constructor): Add the disassembly_flavor_hook.
- (RegWin::destructor): Remove it when the widget is destroyed.
- (RegWin::disassembly_changed): New method, tell the widget it
- needs to redisplay itself with the new register names.
- (RegWin::reconfig): Actually do the reconstruction if the register
- set names have changed.
- * regwin.ith: Add declarations for the new methods.
-
- * interface.tcl (gdbtk_tcl_disassembly_hook): New hook to support
- changing the disassembly flavor.
-
- * srctextwin.itb (SrcTextWin::getVariable): Use a selection in
- preference to the word around the hit point, if there is one.
- (SrcTextWin::do_source_popup): Really dismiss the balloon when you
- popup a menu...
-
-1999-08-05 James Ingham <jingham@leda.cygnus.com>
-
- * srctextwin.itb (SrcTextWin::showBalloon): Fix ShowBalloon. We
- can't use "info line" to tell us whether we should post a balloon
- over the current line, since gdb only considers the first line of
- a statement executible, not the continuation lines. Instead, show
- any line in the currently selected function. Sigh...
-
-1999-08-06 Tom Tromey <tromey@cygnus.com>
-
- * interface.tcl (gdb_set_hook): New hook.
-
-1999-08-02 Tom Tromey <tromey@cygnus.com>
-
- * managedwin.ith (window_name): Removed extraneous comma.
-
-1999-07-27 Keith Seitz <keiths@cygnus.com>
-
- * variables.tcl: Rewrite to use new variable rewrite.
- * locals.tcl: Ditto.
- * watch.tcl: Ditto.
- * srctextwin.itb (updateBalloon): Use new variable rewrite.
- * blockframe.ith, blockframe.itb: New block and frame classes.
- * data.ith, data,itb: New stack and queue classes (data structures).
- * tclIndex: Rebuilt.
-
-1999-07-20 Jason Molenda (jsm@bugshack.cygnus.com)
-
- * prefs.tcl (pref_set_defaults): Set tab_size to the univeral
- standard of 8, not 4.
-
-1999-07-16 Stan Shebs <shebs@andros.cygnus.com>
-
- * All files (*.tcl, *.itb, *.ith): Add GPL notices, regularize
- copyright and header comments.
-
-1999-06-29 James Ingham <jingham@leda.cygnus.com>
-
- * bpwin.itb (BpWin::bp_store): New proc, store away the current
- breakpoint list into a gdb command file.
- (BpWin::bp_restore): restore a breakpoint list from a command file.
- (BpWin::build_win): Add menu items for store & restore breakpoints.
-
-1999-06-24 Keith Seitz <keiths@cygnus.com>
-
- * srcwin.itb (SrcWin::destructor): Its "gdb_clear_file_hook",
- not "gdb_clear_file".
-
-1999-06-23 James Ingham <jingham@leda.cygnus.com>
-
- * srctextwin.itb (SrcTextWin::_mtime_changed): Catch the call to
- mtime. This will fail when you are in assembly mode, and the file
- is actually a function address.
- (SrcTextWin::motion): Catch the call to showBalloon. There are
- various things that can go wrong here, and we certainly don't want
- the user to hear about them.
-
-1999-06-15 Keith Seitz <keiths@cygnus.com>
-
- * interface.tcl (gdbtk_stop_idle_callback): Catch calls to
- remove hook, since it could already be gone if we got a signal.
-
- * srcwin.itb (busy): If there is no target and the
- debugger is native, we should also let the user know
- that his program is running.
-
-1999-06-11 James Ingham <jingham@leda.cygnus.com>
-
- * interface.tcl (gdbtk_tcl_exec_file_display): Only call clear
- file if there is a file loaded in the source window. This avoids
- some flashing at startup.
-
-1999-06-10 Keith Seitz <keiths@cygnus.com>
-
- * srctextwin.itb (do_source_popup): Clear the varBalloon tag
- before mapping a popup onto the screen.
- (showBalloon): The "-pc" option was removed from gdb_variable.
- Provide equivalent functionality, and display popups again.
-
- * interface.tcl (set_target): Don't call the target dialog
- if there gdb_target_cmd is empty and we are a native debugger.
- Don't set a default target -- force the gui to ask the first
- time!
- (run_executable): Set options after we have a target, not before.
-
- * watch.tcl (destructor): Don't call no_inferior -- the window's
- already been destroyed. Instead, run through our list of variables
- and delete them.
-
-1999-06-10 James Ingham <jingham@leda.cygnus.com>
-
- * srctextwin.itb (SrcTextWin::clear_file): Don't try to set the
- text view back to the gdbtk_scratch_widget, this is very fragile.
- (SrcTextWin::LoadFromCache): initialize the mtime correctly when
- you add a window to the cache.
- (SrcTextWin::LoadFromCache): don't add the ,asm,lib to the scratch
- widget pane name.
-
- * interface.tcl (gdbtk_tcl_exec_file_display): Only run
- gdbtk_clear_file if the filename is not null. This avoids source
- window flashing.
-
- * srctextwin.itb (SrcTextWin::_mtime_changed): Set a dirty flag
- when the mtime has changed so that you can know to reload the
- source.
- (SrcTextWin::LoadFromCache): Look at the dirty flag, and reload
- from disk if it is set.
-
-1999-06-10 Keith Seitz <keiths@cygnus.com>
-
- * watch.tcl (clear_file): New method.
- * variables.tcl (constructor): Register gdb_clear_file hook.
- (destructor): Unregister gdb_clear_file hook.
- (clear_file): New method.
- * targetselection.itb (init_target_db): Add Picobug monitor.
- (fill_targets): Don't explicitly list every TCP target: deduce
- it from the target database.
- (native_debugging): Compare host and target triples.
- * srcwin.ith (clear_file): Add declaration.
- * srcwin.itb (constructor): Register gdb_clear_file hook.
- (destructor): Unregister gdb_clear_file hook.
- (clear_file): New method.
- * srctextwin.ith (LoadFile): Add arg "mtime_changed".
- (clear_file): Add declaration.
- (_mtime_changed): Add declaration.
- (_initialize_srctextwin): Add declaration.
- (_clear_cache): Add declaration.
- * srctextwin.itb (constructor): Move all initialization
- to _intialize_srctextwin so that we can easily re-initialize.
- (Stwc): Change layout to explicitly list panes
- and mtimes.
- (ClearTags): Catch calls removing tags. Needed when
- loading new executables.
- (_mtime_changed): New method.
- (FillSource): Immitate command line gdb, checking
- if a file has changed since it was last used. If it has, load
- it into the cache.
- (LoadFile): Add parameter to inform whether a file's
- mtime has changed. Reload the cache if it has.
- (clear_file): New method.
- (_initialize_srctextwin): New method.
- (_clear_cache): New method. Stubbed.
- * main.tcl: Move initialization of state to initialize_gdbtk in
- interface.tcl
- * interface.tcl (gdbtk_tcl_exec_file_display): Don't reset source
- windows or globals here -- the clear file hook will do that.
- (set_exe_name): Always say the exe has changed, in case
- the user reloads the same exe (which he's recompiled).
- (set_exe): Don't call gdb_clear_file.
- (set_target): Return string result codes.
- (clear_file_hook): New hook.
- (gdbtk_clear_file): New proc.
- (initialize_gdbtk): New proc. Moved initialization of
- globals (yich) here from main.tcl
- * download.itb (download_it): When running set_target,
- use new string return codes.
-
- * interface.tcl (gdbtk_attach_target): New proc. Moved
- contents of run_executable dealing with attaching to
- a target here.
- (run_executable): Use gdbtk_attach_target.
- (connect): Remove and merge with gdbtk_attach_target.
- * srcbar.tcl (do_connect): Use gdbtk_attach_target to
- attach to the target.
-
- * tclIndex: Regenerate.
-
-1999-06-07 James Ingham <jingham@leda.cygnus.com>
-
- * memwin.ith (numbytes): Change the default to 0, which means
- "depends on window size". This is really the useful value.
-
- * memwin.itb (MemWin::newsize): Move getting the rheight to AFTER
- the update idletasks. Otherwise the bbox call will return "" when
- the window is being constructed.
- (MemWin::reconfig): Set rheight back to "" to force it to be
- recomputed. Both font changes and switch to "depends on window
- size" could invalidate this.
-
-1999-06-08 Keith Seitz <keiths@cygnus.com>
-
- * srcwin.itb (set_execution_status): Do not try to second
- guess gdb_target_has_execution with gdb_running. Make
- gdb_running follow it. We'll have to fix those targets
- that do not set inferior_pid as they crawl out of the woodwork.
-
-1999-06-07 James Ingham <jingham@leda.cygnus.com>
-
- * prefs.tcl (pref_set_defaults): Set the initial height and with
- of the browser to 0 so the packer & gridder can get this right on
- systems with different fonts. Fixes CR 100619.
-
- * browserwin.itb (BrowserWin::_build_win): Don't set the height
- and width of the file_box and func_box. This keeps them from
- floating correctly when there is not stored default.
-
-1999-06-04 James Ingham <jingham@leda.cygnus.com>
-
- * regwin.itb (RegWin::acceptEdit): Call gdbtk_update after
- changing the register value so that the locals and watch window
- will get updated if any of these variables are in registers. Fixes
- CR 100670.
-
-1999-05-25 Keith Seitz <keiths@cygnus.com>
-
- * variables.tcl (getLocals): Don't pass any args to
- gdb_get_{locals, args} so that the currently selected frame is used.
- (context_switch): New method.
- * locals.tcl (getVariablesBlankPath): Don't catch call to getLocals.
- getLocals will do it and return {} if an error occurs.
- Always pass the frame of the variable to the variable backend,
- assuming that the selected frame is the proper frame to use.
- (update): Recognize context switches a little better.
-
- * variables.tcl (cursor): New method.
- (enable_ui): Use "cursor".
- (disable_ui): Ditto.
- (no_inferior): Ditto.
- (open): Change toplevel's cursor when opening variables.
-
-1999-05-03 Martin Hunt <hunt@cygnus.com>
-
- * toolbar.tcl (create_help_menu): Open About window as transient.
-
- * main.tcl: Open About window as transient.
-
- * about.tcl (About): Set window title.
-
-1999-04-27 James Ingham <jingham@cygnus.com>
-
- * srcpref.itb (build_win): Pack the frame containing the
- disassembly flavor chooser. Redid some of the other packing to
- look a bit nicer too.
-
- * srcpref.itb (save): Call apply and then close rather than
- duplicating the apply code.
-
-1999-04-26 James Ingham <jingham@cygnus.com>
-
- * modal.tcl (ModalDialog): Add the "expire" variable, and cancel
- the dialog after the given time if set.
-
- * managedwin.ith (destructor): Use the new quit_if_last method to
- decide whether to quit the app or not. This way you can manage
- create a splash screen and not quit the app when you take it down.
- (quit_if_last): Add default implementation - returns 1.
-
- * about.tcl (quit_if_last): Add the quit_if_last to the About box,
- returning 0.
-
- * main.tcl: Added a line to open a splash screen, but commented it
- out for devo.
-
-1999-04-22 Keith Seitz <keiths@cygnus.com>
-
- * targetselection.itb (port_list): ManagedWin has a proc named
- "open". We really want the tcl command "::open" to open a port.
-
-1999-04-15 Martin Hunt <hunt@cygnus.com>
-
- * prefs.tcl (pref_set_defaults): New pref, gdb/use_icons.
- This is set if Unix should use gdbtk_icon.gif as an icon. Some
- window managers, such as olvwm, have problems with it.
- * managedwin.itb (ManagedWin::_create): Don't create icon
- for Unix, unless gdb/use_icons is set.
- * globalpref.itb (GlobalPref::build_win): Add a checkbutton to set
- pref gdb/use_icons.
-
- * managedwin.itb (ManagedWin::window_name): If iconname is
- not specified, use window name.
- (ManagedWin::_create): For Unix, call make_icon_window.
- (ManagedWin::make_icon_window): New function. Makes a unix
- icon.
-
- * main.tcl: Set initial target to "exec" if running in
- test mode.
-
- * bpwin.itb (BpWin::constructor): Set icon name to "BPs".
- * regwin.itb (BpWin::build_win): Set icon name to "Regs".
- * srcwin.itb (SrcWin::_update_title): Set icon name to basename
- of filename.
- * variables.tcl (VariableWin::build_win): Set icon name to "Locals".
-
-1999-04-12 Keith Seitz <keiths@cygnus.com>
-
- * variables.tcl (populate): Update the value of the parent variable's
- children before stuffing them into the window. This makes sure
- that the value of the variable is always current.
-
-1999-04-09 James Ingham <jingham@cygnus.com>
-
- * memwin.itb (MemWin::incr_addr): Fix the increment-decrement
- control. It would allow you to scroll into negative addresses,
- which causes some simulators to crash. It would also increment
- improperly in cases where the address value in hex corresponded to
- a negative signed int.
-
-1999-04-07 Martin Hunt <hunt@cygnus.com>
-
- * interface.tcl (gdbtk_signal): Don't set gdb_running to 0.
-
-1999-04-06 Martin Hunt <hunt@cygnus.com>
-
- * targetselection.itb (TargetSelection::getname): Call init_target_db.
- (TargetSelection::init_target_db): Add target mon2000. Set
- most remote targets to default to downloading. Add new
- baudrates for remote target. Other misc target fixes.
- (save) Use "pref setd" in case pref is not created yet.
- (TargetSelection::config_dialog): Gray out port number when
- in exec mode.
-
- * targetselection.ith: Add public proc init_target_db.
-
- * srcwin.itb (SrcWin::set_execution_status): Don't print anything
- if gdb_running is 0.
-
- * srctextwin.itb (SrcTextWin::motion): Show variable values
- even when not debugging. Needed so users can examine values after
- a segfault.
-
- * interface.tcl (set_target): If the target name is "",
- use the default target name.
- (run_executable): Set gdb_running correctly. Don't
- allow downloading to "exec".
- (gdbtk_signal): New function called from gdbtk_annotate_signal.
- Sets gdb_running to 0 and pops up a dialog with the
- signal name and description.
-
- * main.tcl: Set initial target name to "". Set gdb_target_changed
- so a dialog will always be forced the first time.
-
- * download.itb (Download::download_it): Set gdb_loaded before
- notifying src windows the download is done. Catch the notifications
- in case the dialog has been closed.
-
- * console.itb (Console::destructor): Set gdbtk_state(console)
- to "" instead of unsetting it.
-
-1999-04-02 James Ingham <jingham@cygnus.com>
-
- * memwin.itb (MemWin::build_win): Remove the -validate option from
- the memory spinner. It was not appropriate, since you can type
- expressions into the window.
-
-1999-04-02 Keith Seitz <keiths@cygnus.com>
-
- * tclIndex: Rebuilt.
- * toolbar.tcl (create_control_buttons): Use SrcWin's
- inferior method to centralize control of inferior state.
- (create_control_buttons): Ditto.
- (source): Move SrcBar's public variable "source" here,
- so that the toolbar can use that info, too.
- * srcwin.itb (SrcWin::inferior): New public method
- to consildate inferior control and dispatch to proper
- handlers.
- * srcwin.ith (SrcWin::inferior): Add declaration.
- * srctextwin.itb (SrcTextWin::do_key): Use parent SrcWin's inferior
- method to handle inferior state changes (run, step, next, etc).
- * interface.tcl: Add procs to centralize inferior control:
- gdbtk_step, gdbtk_next, gdbtk_stepi, gdbtk_nexti, gdbtk_run,
- gdbtk_continue, gdbtk_finish, gdbtk_stop.
- New stop button code (see comments before gdbtk_stop):
- (gdbtk_stop_idle_callback): Idle callback for stop button.
- (gdbtk_detach): New proc to forcibly detach from target.
- * main.tcl: Initialize data used by stop button.
- * srcbar.tcl (create_run_menu): Call SrcWin's inferior
- method with button commands.
- (source): Move "source" to Toolbar class.
-
-1999-03-29 Keith Seitz <keiths@cygnus.com>
-
- * browserwin.itb (BrowserWin::do_all_bp): Fix quoting of break
- command.
- (BrowserWin::_toggle_bp): Ditto.
-
-1999-03-19 Keith Seitz <keiths@cygnus.com>
-
- * download.itb (Download::download_it): Configure SrcWin's toolbar,
- too, to a downloading state.
- * srcbar.tcl (runstop): Change states from numbers to
- strings to avoid confusion.
- (_set_runstop): Change states from numbers to strings to
- avoid confusion.
- * srcwin.ith (toolbar): New public method.
- * srcwin.itb: Change all references of runstop to use new strings
- introduced into GDBSrcBar::_set_runstop.
- (SrcWin::toolbar): New public method to configure the state of the toolbar.
- * tclIndex: Regenerate.
-
-1999-03-18 Martin Hunt <hunt@cygnus.com>
-
- * interface.tcl (set_target_name): Remove first argument.
- If prompt is not set, still update gdb_target_cmd.
- (set_target): Call set_target_name with prompt argument
- set correctly.
- (run_executable): Check for no exe name. Catch problems
- with bad target names and prompt for new one.
-
- * main.tcl: Set target name from prefs. If it is "",
- the set "gdb_target_changed" to force it to be changed
- later.
-
- * prefs.tcl (pref_set_defaults): Don't set target default
- to "exec". Leave the default unset.
-
- * srcbar.tcl (create_menu_items): Update args to
- set_target_name.
-
-1999-03-18 Keith Seitz <keiths@cygnus.com>
-
- * prefs.tcl (pref_read): Change unix preference filename
- to ".gdbtkinit". This bogosity has been around long enough.
-
-1999-03-16 Martin Hunt <hunt@cygnus.com>
-
- * managedwin.itb (ManagedWin::_create): When running under
- testsuite, don't resize.
-
-1999-03-13 James Ingham <jingham@cygnus.com>
-
- * browserwin.itb (BrowserWin::search): If all the files are
- selected in the file box, then don't pass the files argument.
- This makes the function browser a little quicker. The main
- slowdown, however, is sorting the resultant list. Maybe do this
- in C to get this quicker?
-
- * memwin.itb (MemWin::edit): Comment out the line that reads back
- in the newly set memory value. Because of the chain of calls,
- on Windows this causes some evil race that results in GDBTk
- filling all the visible cells with the new value. I don't
- understand it yet, so this is just a temporary fix.
-
-1999-03-12 James Ingham <jingham@cygnus.com>
-
- * memwin.ith (MemWin): Add saved_addr to the class. This is where
- we store the old address before we change addresses, so that we
- can get back to a good state in case of errors.
-
- * memwin.itb (MemWin::update_addr): gdb_get_mem does not always
- return an error code when it hits an error. Catch that here.
- (MemWin::update_address): Store away the old address, so we can
- restore it if there is an error.
- (MemWin::BadExpr): Restore the saved address in case of errors.
-
-
-1999-03-09 James Ingham <jingham@cygnus.com>
-
- * Rebuilt tclIndex.
-
-1999-03-08 James Ingham <jingham@cygnus.com>
-
- * srctextwin.itb (SrcTextWin::constructor): pc(funcname) was
- changed to pc(func), but the initialization was not changed...
-
- * download.ith (dont_remember_size): Download window should not
- remember its size.
-
- * interface.tcl (connect): Handle the case where set_target
- returns 3...
-
- * debugwin.itb (DebugWinDOpts::build_win): Replace $this delete
- with delete object $this.
- * tfind_args.tcl (build_win): Ditto...
- * helpviewer.itb (HtmlViewer::_buildwin): Ditto...
-
- * srcbar.tcl (GDBSrcBar): Reorder the Source & the page setup &
- print menus...
-
-1999-03-04 Martin Hunt <hunt@cygnus.com>
-
- * download.ith: New file.
- * download.itb: New file. Implements itcl3 class and replaces
- download.tcl.
-
- * srcbar.tcl (create_menu_items): Call create_run_menu
- without arguments.
- (create_run_menu): Add Disconnect and Connect to Run menu
- instead of file menu. Change download_it to Download::download_it.
-
- * srctextwin.itb (do_key): Change binding to call
- Download::download_it.
-
- * debugwin.itb (DebugWinDOpts::build_win): Add ProcessWIn to list
- of classes for filter.
-
- * interface.tcl (set_target): No need to set window title.
- (run_executable): Change download_it to Download::download_it
-
-1999-03-04 James Ingham <jingham@cygnus.com>
-
- * modal.tcl (ModalDialog): Handle WM_DELETE_WINDOW by calling the
- cancel method. Also set unpost_notification to different values
- in unpost & the destructor, so if the object dies irregularly, you
- know not to try to double destruct it.
-
-1999-03-03 James Ingham <jingham@cygnus.com>
-
- * warning.tcl (WarningDlg::constructor):Destroy with unpost.
-
- * util.tcl (get_disassembly_flavor, set_disassembly_flavor,
- init_disassembly_flavor): Added these functions for the Intel P2
- disassembly flavors.
- (list_element_strcmp): New function for lsort -command on lists.
-
- * tracedlg.tcl (TraceDlg): Change combobox callback to reflect new
- after behavior.
-
- * targetselction.itb (TargetSelection::save): If the target
- is not valid, tell the user rather than simple refusing to go
- away.
- Also move stuff around to isolate the instance dependant stuff as
- much as possible
- Also replace delete with unpost.
-
- * targetselection.ith (TargetSelection): Make as much of the
- initialization stuff Class functions as possible. Then only
- initialize it once.
-
- * srcwin.ith (_update_title): initialize need_files.
-
- * srcwin.itb (SrcWin::_build_win): I changed the combobox so it
- ran its code in an idle handler, so we can take out all the after
- idle... cruft here.
-
- * srctextwin.ith (SrcTextWin): Added textheight variable so you
- can adjust the height of the text display.
-
- * srctextwin.itb (SrcTextWin::build_win): Don't hardcode the size
- of the text window, set it with the textheight option instead.
- Also replace childsite with "component text" wherever required.
-
- * srcpref.itb (SrcPref::build_win, set_flavor): Added the Intel
- disassembly flavor combobox. Added set_flavor method to support
- this.
- * srcpref.ith: Added declaration for set_flavor, and
- disassembly_flavor instance variable.
-
- * modal.tcl (ModalDialog::post, unpost): Added unpost method to
- provide a more regular way to dismiss the dialogs. Just
- destroying them was leading to funny destruction order bugs.
- Added cancel method, which is what client code should call to
- "force close" the dialog, so child classes can override, and do
- some cleanup.
-
- * memwin.itb (MemWin::destructor): Call the cancel method of the
- Preferences dialog (if it is posted) rather than just destroying
- it.
-
- * mempref.itb (MemPref::ok): call unpost, since this is a modal
- dialog.
-
- * managedwin.itb (ManagedWin::reveal): Used to be called raise.
- Don't reuse Tcl or Tk commands unless there is a really good
- reason to...
- (ManagedWin::destroy_toplevel): renamed from delete, which
- conflicts both with the Itcl1.5 delete method, and the Itcl3.0
- delete command... Also, don't use this as the way to destroy
- ManagedWins, rather destroy the object and let the object take
- care of removing its toplevel.
- (ManagedWin::_create): Group all the windows with
- . for WindowManagers that properly handle this.
- (ManagedWin::_create): Use dont_remember_size
- rather than the instance variable. Also, windows which don't
- remember size are not necessarily transient.
- (ManagedWin::_create): Only call post if the
- ManagedWin also isa ModalDialog. It is clearer what is going on.
- * managedwin.ith: Carry through the name changes.
-
- * main.tcl: call init_disassembly_flavor for Intel assembly
- flavors.
-
- *main.tcl: Group . with . This is half of the work required to
- play nice with WindowMaker. The other half waits till we can get
- gdb to pass the command-line arguments to Tcl.
-
- * interface.tcl: Add file_changed_hook to the hooks. The browser
- window watches this and refreshes the file box if it changes.
-
- * globalpref.ith (GlobalPref): This should be a modal dialog.
- * globalpref.itb (GlobalPref::build_win): call update idletasks,
- not update. Since we are calling update, there is no reason to
- delay calling resize_font_item_height.
- * globalpref.itb: Replace destroy toplevel with unpost.
-
- * debugwin.itb (DebugWin::build_win): Replace childsite with
- "component text"
-
- * console.itb (Console::_build_win): Replace childsite with
- "component text"
-
- * browserwin.itb: Rewritten pretty completely.
- * prefs.tcl (pref_set_defaults): add the browser preferences.
-
- * prefs.tcl (pref_set_defaults): add the intel disassembly flavor
- preference.
-
- * about.tcl (About): This should be a modal dialog.
-
-1999-03-02 James Ingham <jingham@cygnus.com>
-
- * globalpref.itb (GlobalPref::make_font_item): Don't do the
- resize_font_item_height here, since an update can cause the resize
- before all the windows are built. Delay to the end of build_win
- instead.
-
-1999-02-24 James Ingham <jingham@cygnus.com>
-
- * toolbar.tcl (remove_button): Specify the row in the toolbar from
- which you are removing the item. On Windows, there are two rows
- in the standard toolbar...
-
-1999-02-22 Martin Hunt <hunt@cygnus.com>
-
- * warning.tcl (WarningDlg::constructor): Remove extra quote
- that was causing loading of this module to fail.
-
- * managedwin.itb (ManagedWin::_create): If the pack fails
- (for example because the warning dialog reliazed it should
- ignore the warning) print a warning debug message and return.
- Also, while testing, tell the window manager to position
- the window without asking the user for the position.
-
-1999-02-18 Martin Hunt <hunt@cygnus.com>
-
- * srctextwin.itb (SrcTextWin::FillAssembly): As a last resort,
- if the disassembly fails for some reason, switch to the scratch
- pane and write in a message about not being able to disassemble.
-
-1999-02-18 Martin Hunt <hunt@cygnus.com>
-
- * helpviewer.ith (HtmlViewer): Add thread and function
- browser windows to help index.
-
- * help/index.toc: Removed.
-
-1999-02-18 Martin Hunt <hunt@cygnus.com>
-
- * help/thread.html: New file. Thread window online help.
- * help/index.html: Add thread.html, and alphabetize list.
- * help/source.html: Add index for thread_bp.
-
-1999-02-17 Martin Hunt <hunt@cygnus.com>
-
- * globalpref.itb (GlobalPref::build_win): Add a checkbutton to
- allow use of an internet browser to read help files.
-
- * prefs.tcl (pref_set_defaults): Add preference gdb/help/browser.
- Default is to use builtin html help.
-
- * helpviewer.itb (HtmlViewer::open_help): New public proc.
- Depending on preferences, opens help in external browser or
- internal htmlviewer.
-
- * toolbar.tcl (create_help_menu): Use HtmlViewer::open_help.
-
-1999-02-17 Martin Hunt <hunt@cygnus.com>
-
- * managedwin.itb (ManagedWin::_create): Restore some lines that
- were accidently checked in commented out.
-
-1999-02-17 Keith Seitz <keiths@cygnus.com>
-
- * help/index.html: Add function browser.
- * help/browser.html: New help file.
-
-1999-02-12 Martin Hunt <hunt@cygnus.com>
-
- * managedwin.itb (ManagedWin::_create): If a window class defines a
- public variable "nosize" the size will not be set, only the position.
- * browserwin.ith (toggle_all_bp): Add public variable "nosize".
-
-1999-02-12 Martin Hunt <hunt@cygnus.com>
-
- * process.ith: New file.
- * process.itb: New file. Converted process.tcl to new itcl class.
- * process.tcl: Deleted.
-
- * warning.tcl (WarningDlg::constructor): Set the window name.
-
-1999-02-11 Martin Hunt <hunt@cygnus.com>
-
- * variables.tcl (editEntry): Check that $variable is not empty.
-
- * warning.tcl (WarningDlg::constructor): Put focus on the
- "OK" button and bind it to <Return>.
-
- * watch.tcl (add): If the user attempts to add a non-existent
- variable to the watch-window, display an ignorable warning.
-
- * interface.tcl (gdbtk_tcl_ignorable_warning): -transient
- should not take an argument.
- (set_target_name): Ditto.
- * srcbar.tcl (create_menu_items): Ditto.
- * memwin.itb (MemWin::create_prefs): Ditto.
- * managedwin.itb (ManagedWin::_create): Ditto.
-
-1999-02-11 James Ingham <jingham@cygnus.com>
-
- Move the Intel disassembly mode changes into devo.
-
- * main.tcl: Init the disassembly flavor bits.
- * prefs.tcl: Define disassembly-flavor
- * srcpref.ith: Add current_disassembly_flavor instance variable
- and set_flavor method.
- * srcpref.itb (build_win): Add the disassembly_flavor combobox.
- (apply): set the flavor, if applicable.
- (set_flavor): New method.
- * util.tcl: Add 3 new functions - get_disassembly_flavor,
- list_disassembly_flavor and init_disassembly_flavor.
-
-1999-02-10 Martin Hunt <hunt@cygnus.com>
-
- * srcwin.itb, download.tcl, main.tcl, srcbar.tcl: Removed old
- IDE stuff.
-
- * toolbar.tcl (create_help_menu): Updated Cygnus URL and
- removed old IDE stuff.
- (create_ide_buttons): Removed.
-
-1999-02-10 Martin Hunt <hunt@cygnus.com>
-
- * managedwin.itb (ManagedWin::_create): Bind Alt-F4 to
- always close the window.
-
-1999-02-10 Martin Hunt <hunt@cygnus.com>
-
- * main.tcl: Removed old debugging preferences.
- * prefs.tcl (pref_set_defaults): Ditto.
-
-1999-02-09 Martin Hunt <hunt@cygnus.com>
-
- * managedwin.itb (ManagedWin::_create): Simplify raise
- and post now that all windows use new manager.
-
- * warning.tcl (WarningDlg): Rewrite of entire class to use
- new itcl 3.0 class. Also now uses a "class name" to keep
- track of which messages should be ignored. Uses tk_messageBox
- of the message doesn't have -ignorable set.
-
- * interface.tcl: Removed IDE stuff.
- (gdbtk_tcl_ignorable_warning): Accept "class" argument and
- use it when creating a WarningDlg. Use new ManagedWin::open.
-
- * srctextwin.itb (SrcTextWin::set_tp_at_line): Fix TraceDlg
- open command to use ManagedWin::open.
-
- * srcpref.itb (SrcPref::build_win): Comment out line number
- option. It wasn't very useful and did not become effective
- until GDBtk was restarted.
-
-1999-02-09 James Ingham <jingham@cygnus.com>
-
- * srctextwin.itb (build_win): Set the paned window background to
- white so it looks better when you switch windows.
-
- * mempref.itb (build_win): Use the libgui combobox for the bytes per
- line field.
-
- * mempref.itb: remove some global declarations that I missed when
- I converted all the variables to instance data.
-
- * variables.tcl (change_value): Catch one more place where $this
- was being passed as a window name.
-
- * TODO: Added some more items, and removed some that had been fixed.
-
-Mon Feb 8 12:27:16 1999 Keith Seitz <keiths@cygnus.com>
-
- * interface.tcl (set_target_name): Fix switch syntax
- error and getd the options preference in case it's not set.
-
-
-Thu Feb 4 11:55:43 1999 Keith Seitz <keiths@cygnus.com>
-
- * targetselection.itb (_init_db): Add MIPS target.
- (fill_targets): Ditto.
-
-Thu Feb 4 07:56:12 1999 Keith Seitz <keiths@cygnus.com>
-
- * targetselection.itb: Set "TargetSelection::target_trace"
- as the correct trace for gdb_loaded.
- * targetselection.ith: Make "target_trace" a public proc.
-
-1999-02-03 Martin Hunt <hunt@cygnus.com>
-
- * help/console.html: Cleaned up and added history and editing
- commands.
-
- * stackwin.itb (StackWin::build_win): Remove balloon help.
-
- * console.itb (Console::_search_history): New function.
- Does a pattern match on history buffer.
- (Console::_rsearch_history): New function. Does a pattern
- match on history buffer in the reverse direction.
- (Console::_build_win): Bind Control-Up, Control-Down,
- Shift-Up, and Shift-Down to search history instead of mess
- up the console window. Bind Control-o to break to disable it.
-
- * help/stack.html: Cleanup.
-
- * help/source.html: Add a bunch of missing quotation marks.
-
-1999-02-03 Martin Hunt <hunt@cygnus.com>
-
- * memwin.itb: Change from tixControl widget to iwidgets::spinint.
- Fix problems with error dialogs.
-
-1999-02-02 Martin Hunt <hunt@cygnus.com>
-
- * srctextwin.itb (SrcTextWin::do_source_popup): Even after fixing the
- obvious syntax errors in this function, it didn't work. So I
- simplified the logic. Now it will attempt to use whatever is selected.
- If multiple lines are selected and tracing is enabled, it will set
- tracepoints, otherwise it will try to extract a variable name from single
- lines only.
-
- * main.tcl: Only open debugwin if GDBTK_DEBUG > 1.
-
- * toolbar.tcl (create_view_menu): Only add "Debug WIndow" menu
- item if GDBTK_DEBUG is set.
-
-1999-02-02 Martin Hunt <hunt@cygnus.com>
-
- * browserwin.itb (BrowserWin::_fill_source): Add lib argument
- from gdb_loc to the call to $Source location.
- (BrowserWin::_goto_func): Ditto.
-
-1999-02-01 James Ingham <jingham@cygnus.com>
-
- * browserwin.itb (BrowserWin::_fill_source): Add a null lib
- argument to the call to $Source location.
-
-1999-02-01 Martin Hunt <hunt@cygnus.com>
-
- * prefs.tcl (pref_save): Change the list of sections back into
- a list.
-
-1999-02-01 Martin Hunt <hunt@cygnus.com>
-
- * srctextwin.itb (SrcTextWin::FillMixed): Simplify line formatting.
- (SrcTextWin::continue_to_here): Call gdb_set_bp with new type arg.
- (SrcTextWin::set_bp_at_line): Call gdb_set_bp with new type arg.
- Use "catch" command and display error if there is one.
-
-1999-02-01 Martin Hunt <hunt@cygnus.com>
-
- * srcwin.itb (SrcWin::goto_func): Dont attach filename if
- there isn't a valid one.
-
-Fri Jan 29 20:01:30 1999 Fernando Nasser <fnasser@rtl.cygnus.com>
-
- * main.tcl: Restored kod code lost with merge
- * prefs.tcl: Ditto.
- * srctextwin.tcl: Ditto.
- * toolbar.tcl: Ditto
- * kod.tcl: Adapted to the new branch.
-
-1999-01-28 Martin Hunt <hunt@cygnus.com>
-
- * srcwin.itb (SrcWin::_build_win): Only call gdb_loc once.
- (SrcWin::location): Update linespec for gdb_loc to include
- the "lib" arg.
-
- * srctextwin.itb (SrcTextWin::LoadFromCache): Add "lib"
- argument. This is used to create a unique cache key so
- we don't confuse the disassembly of a function in a shared
- lib with the disassembly of its trampoline. Also updated
- UnLoadFromCache, LoadFIle, FillSource, FillMixed, and FillAssembly
- to pass this argument around.
-
- * helpviewer.ith (HtmlViewer::constructor): Declare we have a
- constructor.
- (PageStack::constructor): Delete this declaration.
-
- * helpviewer.itb (HtmlViewer::constructor): initialize args before
- calling _buildwin
-
- * main.tcl: Only open initial debug window if GDBTK_DEBUG
- is set.
-
- * help/debug.html: Add help for GDBTK_DEBUG
-
-Wed Jan 27 07:18:05 1999 Keith Seitz <keiths@cygnus.com>
-
- * interface.tcl (gdbtk_pc_changed): Removed.
- (gdbtk_register_changed): New procedure.
- (gdbtk_memory_changed): New procedure.
-
diff --git a/gdb/gdbtk/library/ChangeLog-2000 b/gdb/gdbtk/library/ChangeLog-2000
deleted file mode 100644
index 5d16d82673d..00000000000
--- a/gdb/gdbtk/library/ChangeLog-2000
+++ /dev/null
@@ -1,409 +0,0 @@
-2000-12-13 Fernando Nasser <fnasser@redhat.com>
-
- * variables.tcl (constructor): Use the file_changed_hook to remove
- all variables if the exec file changes. This prevents the Watch
- Window to dump core because the "types" are not valid anymore.
-
-2000-12-13 Fernando Nasser <fnasser@redhat.com>
-
- * session.tcl (session_save): Save target name.
- (session_load): Restore target name.
-
-2000-12-08 Tom Tromey <tromey@redhat.com>
-
- * managedwin.itb (ManagedWin::startup): Only open source window
- if it doesn't already exist.
-
- * toolbar.tcl (create_help_menu): Remove `Cygnus' item.
-
- * console.itb (Console::invoke): Trim trailing newlines from
- text.
-
-2000-12-07 Tom Tromey <tromey@redhat.com>
-
- * managedwin.itb (ManagedWin::reveal): Don't set focus.
-
- * tclIndex: Rebuilt.
- * interface.tcl (set_exe_name): Save session.
- (gdbtk_quit_check): Save session.
- * session.tcl: New file.
- * srcbar.tcl (create_menu_items): Add menu items to recall old
- sessions.
-
- * bpwin.itb (BpWin::goto_bp): Handle multiple source windows.
- * srctextwin.itb (SrcTextWin::get_file): New method.
- (SrcTextWin::set_tag_to_stack): New method.
- * srctextwin.ith (get_file): Declare.
- * srcwin.ith (update_hook_init, window_list, pc_window): New
- common variables.
- (_choose_window, choose_and_update, is_fixed, get_file): Declare.
- * srcwin.itb (SrcWin::_choose_window): New method.
- (SrcWin::choose_and_update): Likewise.
- (SrcWin::_update): Renamed from update. Now private. Added `loc'
- argument.
- (SrcWin::get_file): New method.
- (SrcWin::is_fixed): Likewise.
- (SrcWin::constructor): Only add update hook once. Append this
- object to window list.
- (SrcWin::destructor): Don't add update hook. Remove this object
- from window list. Clear pc_window if necessary.
- (SrcWin::get_top): New method.
- (SrcWin::_set_tag_to_stack): New method.
- (SrcWin::choose_and_display): New method.
-
- * srctextwin.itb (SrcTextWin::do_source_popup): Added "Set
- Breakpoint" to popup menu.
-
- * srcwin.itb (SrcWin::edit): Use uplevel, not eval, to evaluate
- external editor expression.
-
-2000-12-06 Tom Tromey <tromey@redhat.com>
-
- * targetselection.itb (TargetSelection::build_win): Add option to
- start xterm.
- * interface.tcl (run_executable): Call tty::create if requested.
- * tty.tcl: New file.
-
-2000-12-02 Tom Tromey <tromey@redhat.com>
-
- * console.ith (_set_wrap): Declare.
- (_update_option): Likewise.
- * console.itb (Console::constructor): Install preference hooks
- (commented out pending a bug fix).
- (Console::destructor): Remove preference hooks.
- (Console::_set_wrap): New method.
- (Console::_update_option): New method.
- (Console::_build_win): Use _set_wrap.
-
-2000-12-01 Larry Smith <lsmith@redhat.com>
-
- * console.itb (invoke): Added logic to allow user to build
- up multiline "tk" commands based on results from checking
- command with [info complete $cmd]s.
-
-2000-11-30 Tom Tromey <tromey@cygnus.com>
-
- * srctextwin.ith (enable_disable_at_line): Declare.
- * srctextwin.itb (SrcTextWin::build_popups): Create popup for
- disabled breakpoint. Add "disable" to breakpoint menu.
- (enable_disable_at_line): New method.
- (SrcTextWin::do_bp): Don't remove the tag we are adding -- remove
- the "opposite" tag.
-
-2000-11-30 Tom Tromey <tromey@cygnus.com>
-
- * prefs.tcl (pref_save): Put version number into file. Added
- `session' to list of top-level keys. Allow keys with many `/'s.
- (pref_read): Recognize version number.
- (escape_value): Generate URL-style encoding.
- (unescape_value): Added `version' argument. Handle URL decoding.
-
-2000-11-29 Larry Smith <lsmith@redhat.com>
-
- * regwin.itb (build_win,but3): Added "Double" menu entry to
- permit selection of "f" format for register display.
-
-2000-11-06 Fernando Nasser <fnasser@cygnus.com>
-
- * interface.tcl (show_warning): Add missing argument to ide_messageBox
- and add comments explaining why we use it for windows.
-
-2000-11-01 Larry Smith <lsmith@redhat.com>
-
- * console.itb (_build_win): Added code to remove horizontal
- scrollbar by setting -hscrollmode none, which enables the
- console widget to wrap text properly.
- * globalpref.itb (build_win): added checkbutton to enable
- wrapping text in the console window.
-
-2000-10-31 Larry Smith <lsmith@redhat.com>
-
- * targetselection.ith (run_method): Add variable for
- "Run Program" and "Continue..." buttons
- * targetselection.itb (build_win): put "Run Program" and
- "Continue From..." buttons into a frame and save them in new
- run_method variable.
- * change targetselection.itb (change_target) disables "Run
- Program" and "Continue..." buttons when the target is "exec",
- enables them for all others.
-
-2000-10-26 Larry Smith <lsmith@redhat.com>
-
- * targetselection.itb: Run Program and Continue From Last Stop
- are now radio buttons rather than checkbuttons
-
-2000-10-26 Mo DeJong <mdejong@redhat.com>
-
- * attachdlg.itb (list_pids): Use "ps axw" to get pid list
- when running under Linux. Use string match instead of
- regexp match is ps filter entry.
- * attachdlg.ith (list_pids): Change default argument to "*".
-
-2000-10-23 Fernando Nasser <fnasser@cygnus.com>
-
- * util.tcl (find_iwidgets_library): Use the directories that were
- actually searched in the error message.
-
-2000-10-13 Fernando Nasser <fnasser@cygnus.com>
-
- With Steven Johnson <sbjohnson@ozemail.com.au>
- This change fixes part of the possible scenarios where a race condition
- would cause core dumps if there were commands changing registers or
- other target resources in a startup script.
- The remaining scenarios are fixed by a patch to generic/gdbtk-hooks.c
- * interface.tcl (gdbtk_update_safe): New function. Like gdbtk_update
- but does nothing if target is running.
- (gdbtk_register_changed): Call the above safe version.
- (gdbtk_memory_changed): Likewise.
-
-2000-10-11 Fernando Nasser <fnasser@cygnus.com>
-
- * srctextwin.itb (build_popups): Fix typos that caused duplicate
- "Jump to Here" menu entries in the breakpoint-set right-click pop-up
- menu.
-
-2000-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * download.itb (download_it): Fix previous changes for non-windows
- hosts.
- * srctextwin.itb (LoadFromCache): Ditto.
-
-2000-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * download.itb (download_it): Convert filename to native before
- passing it to a Tcl command.
- * srctextwin.itb (_mtime_changed): Ditto.
- (LoadFromCache): Ditto.
-
-2000-09-18 Fernando Nasser <fnasser@cygnus.com>
-
- * watch.tcl (build_win): Use code when setting callback.
-
-2000-08-10 Fernando Nasser <fnasser@cygnus.com>
-
- * targetselection.itb (change_baud): Fix typo (ETH, not ETX).
-
-2000-08-10 Fernando Nasser <fnasser@cygnus.com>
-
- * targetselection.itb (init_target_db): Add 115200 baud option to
- target remote.
-
-2000-08-10 Fernando Nasser <fnasser@cygnus.com>
-
- * targetselection.itb (change_baud): Don't set baud for ETX.
-
-2000-08-10 Fernando Nasser <fnasser@cygnus.com>
-
- * srctextwin.itb (jump_to_here): New method. Implements the
- "Jump to Here" popup menu option.
- (build_popups): Add the "Jump to Here" option to the popup menu.
- * srctextwin.ith: Add declaration of jump_to_here().
-
-2000-08-09 Fernando Nasser <fnasser@cygnus.com>
-
- * srctextwin.itb (FillSource): Add comments.
- * srcwin.itb (set_execution_status): Fix typo in SRC+ASM message.
- It is gdb_cmd, not gb_cmd.
-
-2000-08-08 Fernando Nasser <fnasser@cygnus.com>
-
- * srctextwin.itb (LoadFromCache): Do not cache if cannot stat the file.
- This lead to problems trying to access a incomplete cache entry later.
-
-2000-06-06 Fernando Nasser <fnasser@cygnus.com>
-
- * util.tcl (find_iwidgets_library): Add missing global declaration
- which caused a stack trace instead of the proper error message.
-
-2000-05-04 Fernando Nasser <fnasser@cygnus.com>
-
- * regwin.itb (build_win, update): Safer test for editable.
-
-2000-05-01 Fernando Nasser <fnasser@cygnus.com>
-
- * variables.tcl (edit): Make changes to a variable which is a register
- to be reflected on the register window by running the update hook.
-
-2000-05-01 Fernando Nasser <fnasser@cygnus.com>
-
- * regwin.itb (build_win): Adjust size of columns independently, force
- typed registers to raw mode and check if values can be edited.
- Also, add "Add to Watch" option to the menu.
- (update): Similar changes to similar code.
- (init_reg_display_vars): Initialize new variables used above.
- (reg_select): Deactivate menu options when action is not possible.
- (but3): Ditto.
- (edit): Do not edit if it is not editable.
- (acceptEdit): Fix bug is error message box display.
- (addToWatch): New mwthod. Add a register to the Watch window.
- * regwin.ith: Add addToWatch to the class.
- * tclIndex: Regenerate.
-
-2000-04-27 James Ingham <jingham@leda.cygnus.com>
-
- These changes allow Insight to handle the case where there are
- symbols for the source files, but the source files are not in the
- location pointed to by the symbol.
-
- * srctextwin.itb (SrcTextWin::setTabs): Make the "asm" type for
- the source display "S" not "", which is not very clear.
- (SrcTextWin::configWin): ditto.
- (SrcTextWin::FillAssembly): Handle all return values from
- LoadFromCache.
- * (SrcTextWin::LoadFile): Handle "couldn't find file" return from
- LoadFromCache.
- * (SrcTextWin::LoadFromCache): If the source file could not be
- found, return -1 rather than choking.
- Also change "asm" type for source from "" to "S".
- * srctextwin.ith: Change the defaults for the "asm" type from ""
- to "S" for Source display. This is just cosmetic, but clearer.
-
-2000-04-13 Tom Tromey <tromey@cygnus.com>
-
- * console.itb (Console::_complete): Dequoted first argument to
- switch. Window name is `$_twin', not `_twin'.
-
-2000-04-10 Tom Tromey <tromey@cygnus.com>
-
- * srctextwin.itb (SrcTextWin::build_popups): Don't set actibe
- background on popup menu item.
-
-2000-04-08 Tom Tromey <tromey@cygnus.com>
-
- * console.itb (Console::_build_win): Make Control-a, Control-u,
- and Control-w bindings show the insertion point.
-
-2000-04-05 James Ingham <jingham@leda.cygnus.com>
-
- * regwin.itb (RegWin::build_win): Enable the "Display all
- registers" menu at startup if any registers have been removed.
- (RegWin::save_reg_display_vars): Handle cases where the register
- set is not contiguous.
- (RegWin::destructor): Actually save away the removed registers.
- The latter two are Steve Johnson's change.
-
- * regwin.ith (RegWin): Added "all_regs_shown" and
- "disp_all_menu_item" to handle tracking whether any registers have
- been removed from the display.
-
-
-2000-04-03 Steve Johnson <sbjohnson@ozemail.com.au>
-
- * regwin.itb (dimensions): Use rows from preference file rather
- than hard-coding a preference.
- * prefs.tcl (pref_set_defaults): Add gdb/reg/rows preference.
-
-2000-04-03 James Ingham <jingham@leda.cygnus.com>
-
- * util.tcl (find_iwidgets_library): Follow links in determining
- the location of the executable.
-
-2000-03-30 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * variables.tcl (edit): Remove call to close, which caused editing
- of variables to fail.
- Note: I don't know why we would need to do this here as it seems
- that the "delete entry" operation will do that.
- Perhaps this was to account to some old widget bug.
- But we cannot call close here because it calls UnEdit,
- which unsets some of the edit state.
- (open): Make sure to abort any ongoing edit. This was causing problems
- when someone tried to expand an structure while editing its pointer.
-
-2000-03-28 James Ingham <jingham@leda.cygnus.com>
-
- * managedwin.itb (ManagedWin::startup): Open the SrcWin, this does
- two things, 1) Makes sure that there IS a SrcWin, and 2) brings
- the first such window to the foreground...
-
-2000-03-28 Jim Blandy <jimb@redhat.com>
-
- Handle the fact that there are holes in the register numbering.
- * regwin.itb (RegWin::init_reg_display_vars): Ask gdb_regnames to
- provide the register numbers, too; don't just assume that the Nth
- element is register N.
-
-2000-03-27 James Ingham <jingham@leda.cygnus.com>
-
- * interface.tcl (gdbtk_quit): Let the window manager store away
- the list of active windows before quitting.
- (gdbtk_tcl_preloop): Open all the windows that were active in the
- former session.
- * prefs.tcl (pref_set_defaults): Set the default value of the
- "gdb/window/active" pref. Stores the list of active windows.
- * managedwin.itb (ManagedWin::pickle): New method - store away
- instructions to recreate this window.
- (ManagedWin::shutdown): New Method - run through the active windows
- pickling them all.
- (ManagedWin::startup): Restore all the saved active windows.
- * managedwin.ith: Declare pickle, shutdown & startup.
- * tclIndex: regenerate.
-
-2000-03-10 James Ingham <jingham@leda.cygnus.com>
-
- * targetselection.ith (get_target_list): Should be a proc, since
- it does nothing instance-specific.
-
- * util.tcl (keep_raised): For some reason raising a window, then
- deiconifying it is MUCH faster on "e" & WindowMaker under XFree.
- Go figure. Other WM's don't seem to care, so do it this way...
- * managedwin.itb (ManagedWin::reveal): Ditto...
-
-2000-03-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * srcbar.tcl (do_attach): Just call gdbtk_attach_native.
- (do_connect): Replace gdbtk_attach_target call with
- gdbtk_attach_remote call.
-
- * interface.tcl (gdbtk_attach_native): Renamed from do_attach method
- and moved from srcbar.tcl.
- (gdbtk_attach_remote): New proc. Renamed from gdb_attach_target,
- to better distinguish from the native version.
- (run_executable): Change gdbtk_attach_target call into
- gdbtk_attach_remote.
-
- * srctextwin.itb: Add keyboard accelerator for Attach command.
-
- * tclIndex: Rebuild.
-
-2000-03-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- From: James Ingham <jingham@leda.cygnus.com>:
- * attachdlg.itb (build_win): Pack the dialog better, so that when
- window is resized components are not hidden.
-
-2000-03-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * attachdlg.itb: Give a name to the window.
-
-2000-03-01 James Ingham <jingham@leda.cygnus.com>
-
- * interface.tcl (_open_file): The window which had the focus could
- get deleted by the vwait implicit in the tk_getOpenFile call. So
- check and make sure it is still around before raising it...
-
-2000-02-23 Keith R Seitz <kseitz@nwlink.com>
-
- * srctextwin.ith (_highlightAsmLine): Define new method.
- * srctextwin.itb (_highlightAsmLine): New method.
- (FillAssembly, FillMixed): Use _highlightAsmLine to highlight
- the current assembly line.
-
-Fri Feb 4 23:19:03 2000 Andrew Cagney <cagney@b1.cygnus.com>
-
- * gdb/gdbtcl2: Directory renamed to gdb/gdbtk/library.
-
-2000-01-12 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- * targetselection.itb (init_target_db): Add the word "serial" to
- the Angel target to make the distinction clear from the UDP connection.
-
-2000-01-05 Fernando Nasser <fnasser@totem.to.cygnus.com>
-
- From Dave Vogel (dave@lightsurf.com):
- * targetselection.itb (init_target_db, config_dialog): Add support
- for selecting a target running the Angel monitor (RDI protocol)
- over an UDP connection.
- * interface.tcl (set_target_name): Set hostname when target is RDI
- over UDP (see previous entry).
-
diff --git a/gdb/gdbtk/library/Makefile b/gdb/gdbtk/library/Makefile
deleted file mode 100644
index c1e653b7944..00000000000
--- a/gdb/gdbtk/library/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-
-TCL := $(wildcard *.tcl *.itcl *.ith *.itb)
-
-TCLSH = tclsh
-
-tclIndex: $(TCL) Makefile
- echo "package require Itcl; auto_mkindex `pwd` $(TCL)" | $(TCLSH)
-
-tags: TAGS
-TAGS: $(TCL)
- etags --lang=none --regex='/[ \t]*\(proc\|method\|itcl_class\)[ \t]+\([^ \t]+\)/\1/' $(TCL)
diff --git a/gdb/gdbtk/library/about.tcl b/gdb/gdbtk/library/about.tcl
deleted file mode 100644
index 937b48051c8..00000000000
--- a/gdb/gdbtk/library/about.tcl
+++ /dev/null
@@ -1,43 +0,0 @@
-# About window for GDBtk.
-# Copyright (C) 1997, 1998, 1999, 2000, 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements About window
-# ----------------------------------------------------------------------
-
-itcl::class About {
- inherit ManagedWin ModalDialog
- constructor {args} {
- global gdb_ImageDir
- set f [frame $itk_interior.f]
- label $f.image1 -bg #ee0000 -image \
- [image create photo -file [file join $gdb_ImageDir insight.gif]]
- message $f.m -bg #ee0000 -fg white -text [gdb_cmd {show version}] \
- -aspect 500 -relief flat
- pack $f.image1 $f.m $itk_interior.f -fill both -expand yes
- pack $itk_interior
- bind $f.image1 <1> [code $this unpost]
- bind $f.m <1> [code $this unpost]
- window_name "About Red Hat Insight"
- }
-
- # Don't quit if this is the last window. The only way that this can
- # happen is if we are the splash screen.
-
- method quit_if_last {} {
- return 0
- }
-
-}
-
diff --git a/gdb/gdbtk/library/actiondlg.tcl b/gdb/gdbtk/library/actiondlg.tcl
deleted file mode 100644
index 20314bfabf9..00000000000
--- a/gdb/gdbtk/library/actiondlg.tcl
+++ /dev/null
@@ -1,810 +0,0 @@
-# Tracepoint actions dialog for Insight.
-# Copyright (C) 1997, 1998, 1999, 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class ActionDlg {
- inherit ManagedWin
-
- # ------------------------------------------------------------------
- # CONSTRUCTOR
- # ------------------------------------------------------------------
- constructor {args} {
- global _TStepCount _TOtherVariable
-
- eval itk_initialize $args
-
- set Registers [gdb_reginfo name]
- if {$Line != ""} {
- set Locals [gdb_get_locals "$File:$Line"]
- set Args [gdb_get_args "$File:$Line"]
- } else {
- set Locals [gdb_get_locals "*$Address"]
- set Args [gdb_get_args "*$Address"]
- }
- set Variables [concat $Locals $Args]
- foreach a $Registers {
- lappend Variables "\$$a"
- }
-
- if {[llength $Args] > 0} {
- lappend Variables "All Arguments"
- }
- if {[llength $Locals] > 0} {
- lappend Variables "All Locals"
- }
- lappend Variables "All Registers"
- lappend Variables "Collect Stack"
-
- build_win
-
- # Set a default return status, in case we are destroyed
- set _TOtherVariable {}
-
- # Fill the listboxes with any default data
- if {"$Data" != {}} {
- change 1 $Data
- }
- }
-
- # ------------------------------------------------------------------
- # DESTRUCTOR - destroy window containing widget
- # ------------------------------------------------------------------
- destructor {
-
- # Remove this window and all hooks
- # grab release $this
-
- # Note that this is okay: the callback (TraceDlg::done, usually) will
- # ignore stray "cancel" callbacks
- eval $Callback cancel
- }
-
- # ------------------------------------------------------------------
- # METHOD: build_win - build the Trace dialog box (cache this?)
- # ------------------------------------------------------------------
- method build_win {} {
- global _TStepCount _TOtherVariable
-
- set f $itk_interior
-
- # The two frames of this dialog
- set bbox [frame $f.bbox]; # for holding OK,CANCEL buttons
- set data [frame $f.data]; # for everything else
-
- # Setup the button box
- button $bbox.ok -text OK -command "$this ok"
- button $bbox.cancel -text CANCEL -command "$this cancel"
- pack $bbox.ok $bbox.cancel -side left -padx 10 -expand yes
-
- # The "Data Collection" Frame
- set top [frame $data.top]
- set bot [frame $data.bot]
-
- set boxes [frame $top.boxes]
- set cFrame [frame $boxes.cFrame]
- set vFrame [frame $boxes.vFrame]
- set bFrame [frame $boxes.bframe]
- set oFrame [frame $top.uFrame]
- pack $cFrame $bFrame $vFrame -side left -expand yes -padx 5
-
- # While stepping
- if {$WhileStepping} {
- set step_frame [frame $top.stepf]
- label $step_frame.whilelbl -text {While Stepping, Steps:}
- set WhileSteppingEntry [entry $step_frame.steps \
- -textvariable _TStepCount \
- -width 5]
- pack $step_frame.whilelbl $WhileSteppingEntry -side left
- }
-
- # The Collect listbox
- label $cFrame.lbl -text {Collect:}
- set CollectLB [iwidgets::scrolledlistbox $cFrame.lb -hscrollmode dynamic \
- -vscrollmode dynamic \
- -selectioncommand [code $this toggle_button_state 0] \
- -dblclickcommand [code $this change 0] \
- -selectmode extended \
- -exportselection false]
- [$CollectLB component listbox] configure -background gray92
- pack $cFrame.lbl $cFrame.lb -side top -expand yes -pady 2
-
- # The Variables listbox
- label $vFrame.lbl -text {Variables:}
- set VariablesLB [iwidgets::scrolledlistbox $vFrame.lb -hscrollmode dynamic \
- -vscrollmode dynamic \
- -selectioncommand [code $this toggle_button_state 1] \
- -dblclickcommand [code $this change 1] \
- -selectmode extended \
- -exportselection false]
- [$VariablesLB component listbox] configure -background gray92
- pack $vFrame.lbl $vFrame.lb -side top -expand yes -pady 2
-
- # The button frame
- set AddButton [button $bFrame.add -text {<<< Collect} \
- -command "$this change 1" -state disabled]
- set RemoveButton [button $bFrame.del -text {Ignore >>>} \
- -command "$this change 0" -state disabled]
- pack $bFrame.add $bFrame.del -side top -expand yes -pady 5
-
- # The other frame (type-in)
- label $oFrame.lbl -text {Other:}
- set OtherEntry [entry $oFrame.ent -textvariable _TOtherVariable]
- pack $oFrame.lbl $OtherEntry -side left
- bind $OtherEntry <Return> "$this change_other"
-
- # Pack these frames
- if {$WhileStepping} {
- pack $step_frame -side top
- }
-
- pack $boxes $oFrame -side top -padx 5 -pady 5
- pack $top $bot -side top
-
- # Fill the list boxes
- fill_listboxes
-
- # Pack the main frames
- # after idle
- pack $f.data $bbox -side top -padx 4 -pady 2 \
- -expand yes -fill x
-
- # !!???
- if {$WhileStepping} {
- $WhileSteppingEntry delete 0 end
- $WhileSteppingEntry insert 0 $Steps
- }
- }
-
- method toggle_button_state {add} {
-
- # This is invoked whenever a <1> event is generated in
- # the listbox...
- if {$add} {
- set a [$VariablesLB getcurselection]
- if {"$a" != ""} {
- $AddButton configure -state normal
- $RemoveButton configure -state disabled
- }
- } else {
- set a [$CollectLB getcurselection]
- if {"$a" != ""} {
- $AddButton configure -state disabled
- $RemoveButton configure -state normal
- }
- }
- }
-
-
- # ------------------------------------------------------------------
- # METHOD: fill_listboxes - fills the two listboxes
- # ------------------------------------------------------------------
- method fill_listboxes {{last {}}} {
-
- # Fill the Collect listbox with the variables being collected
- if {[info exists Collect]} {
- fill_collect $last
- }
-
- fill_variables $last
- }
-
- # ------------------------------------------------------------------
- # METHOD: change - change a selected variable
- # ------------------------------------------------------------------
- method change {add {select {}}} {
- if {"$select" == {}} {
- set selections [get_selections $add]
- set lb [lindex $selections 0]
- set last [lindex $selections 1]
- set selection [lindex $selections 2]
- set noname 1
- } else {
- # This usually (only) occurs when we open this dialog for editing
- # some existing action.
- set lb {}
- set last {}
- set noname 0
- set selection $select
- }
-
- $RemoveButton configure -state disabled
- $AddButton configure -state disabled
-
- # Remove all the selections from one list
- # and add them to the other list
- if {$add} {
- set list1 $Variables
- set list2 $Collect
- } else {
- set list1 $Collect
- set list2 $Variables
- }
-
- foreach a $selection {
- if {$noname} {
- set name [$lb get $a]
- } else {
- set name $a
- }
-
- if {"$name" == "All Locals" || "$name" == {$loc}} {
- set name "All Locals"
- set lists [all_locals $add]
- set list1 [lindex $lists 0]
- set list2 [lindex $lists 1]
- } elseif {"$name" == "All Registers" || "$name" == {$reg}} {
- set name "All Registers"
- set lists [all_regs $add]
- set list1 [lindex $lists 0]
- set list2 [lindex $lists 1]
- } elseif {"$name" == "All Arguments" || "$name" == {$arg}} {
- set name "All Arguments"
- set lists [all_args $add]
- set list1 [lindex $lists 0]
- set list2 [lindex $lists 1]
- } else {
- set i [lsearch -exact $list1 $name]
- set list1 [lreplace $list1 $i $i]
-
- # Check if this is something we want to keep on a list
- if {[lsearch $Args $name] != -1 || [lsearch $Registers [string trim $name \$]] != -1 || [lsearch $Locals $name] != -1 || $add} {
- lappend list2 $name
- }
- }
-
- if {$add} {
- set Collect $list2
- set Variables $list1
- } else {
- set Collect $list1
- set Variables $list2
- }
- }
-
- # Update boxes (!! SLOW !!)
- fill_collect $last
- fill_variables $last
- }
-
- # ------------------------------------------------------------------
- # METHOD: fill_collect - fill the collect box
- # ------------------------------------------------------------------
- method fill_collect {{last {}}} {
-
- $CollectLB delete 0 end
- set Collect [sort $Collect]
- foreach a $Collect {
- $CollectLB insert end $a
- }
- if {"$last" != ""} {
- $CollectLB see $last
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: fill_variables - fill the variables box
- # ------------------------------------------------------------------
- method fill_variables {{last {}}} {
-
- $VariablesLB delete 0 end
- set Variables [sort $Variables]
- foreach a $Variables {
- $VariablesLB insert end $a
- }
-
- if {"$last" != ""} {
- $VariablesLB see $last
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: sort - sort a list of variables, placing regs and
- # special identifiers (like "All Locals") at end
- # ------------------------------------------------------------------
- method sort {list} {
-
- set special_names {
- "All Arguments" args \
- "All Locals" locs \
- "All Registers" regs \
- "Collect Stack" stack
- }
-
- foreach {name var} $special_names {
- set i [lsearch $list $name]
- if {$i != -1} {
- set $var 1
- set list [lreplace $list $i $i]
- } else {
- set $var 0
- }
- }
-
- # Extract all the locals, regs, args, globals
- set types_list {Args Locals Registers }
- foreach type $types_list {
- set used_$type {}
-
- foreach a [set $type] {
- set i [lsearch $list $a]
- if {$i != -1} {
- lappend used_$type $a
- set list [lreplace $list $i $i]
- }
- }
- set used_$type [lsort [set used_$type]]
- }
-
- set globals [lsort $list]
-
- # Sort the remaining list in order: args, locals, globals, regs
- set list [concat $used_Args $used_Locals $globals $used_Registers]
-
- set list2 {}
-
- foreach {name var} $special_names {
- if {[set $var]} {
- lappend list2 $name
- }
- }
-
- set list [concat $list2 $list]
- return $list
- }
-
- # ------------------------------------------------------------------
- # METHOD: all_args - add/remove all args
- # ------------------------------------------------------------------
- method all_args {add} {
-
- if {$add} {
- set list1 $Variables
- set list2 $Collect
- } else {
- set list1 $Collect
- set list2 $Variables
- }
-
-# foreach var $Args {
-# set i [lsearch $list1 $var]
-# if {$i != -1} {
-# set list1 [lreplace $list1 $i $i]
-# lappend list2 $var
-# }
-# }
-
- lappend list2 "All Arguments"
- set i [lsearch $list1 "All Arguments"]
- if {$i != -1} {
- set list1 [lreplace $list1 $i $i]
- }
-
- return [list $list1 $list2]
- }
-
- # ------------------------------------------------------------------
- # METHOD: all_locals - add/remove all locals
- # ------------------------------------------------------------------
- method all_locals {add} {
-
- if {$add} {
- set list1 $Variables
- set list2 $Collect
- } else {
- set list1 $Collect
- set list2 $Variables
- }
-
-# foreach var $Locals {
-# set i [lsearch $list1 $var]
-# if {$i != -1} {
-# set list1 [lreplace $list1 $i $i]
-# lappend list2 $var
-# }
-# }
-
- lappend list2 "All Locals"
- set i [lsearch $list1 "All Locals"]
- if {$i != -1} {
- set list1 [lreplace $list1 $i $i]
- }
-
- return [list $list1 $list2]
- }
-
- # ------------------------------------------------------------------
- # METHOD: all_regs - add/remove all registers
- # ------------------------------------------------------------------
- method all_regs {add} {
-
- if {$add} {
- set list1 $Variables
- set list2 $Collect
- } else {
- set list1 $Collect
- set list2 $Variables
- }
-
-# foreach var $Registers {
-# set i [lsearch $list1 "\$$var"]
-# if {$i != -1} {
-# set list1 [lreplace $list1 $i $i]
-# lappend list2 "\$$var"
-# }
-# }
-
- lappend list2 "All Registers"
- set i [lsearch $list1 "All Registers"]
- if {$i != -1} {
- set list1 [lreplace $list1 $i $i]
- }
-
- return [list $list1 $list2]
- }
-
- # ------------------------------------------------------------------
- # METHOD: change_other - add/remove a user defined type
- # ------------------------------------------------------------------
- method change_other {} {
- set other [$OtherEntry get]
-
- if {"$other" != ""} {
- set added 0
-
- # Check if this is a local/register/arg
- set i [lsearch $Locals "$other"]
- if {$i != -1} {
- set i [lsearch $Collect "$other"]
- set added 1
- if {$i != -1} {
- # It's a local on the collection list
- debug "local on collection list"
- set add 0
- set list1 [lreplace $Collect $i $i]
- set list2 [concat $Variables "$other"]
- } else {
- # It's a local on the variables list
- debug "local on variable list"
- set add 1
- set i [lsearch $Variables "$other"]
- set list1 [lreplace $Variables $i $i]
- set list2 [concat $Collect "$other"]
- }
- }
-
- set i [lsearch $Registers [string trim "$other" \$]]
- if {$i != -1} {
- set i [lsearch $Collect "$other"]
- set added 1
- if {$i != -1} {
- # It's a register on the collection list
- debug "register on collection list"
- set add 0
- set list1 [lreplace $Collect $i $i]
- set list2 [concat $Variables "$other"]
- } else {
- # It's a register on the variables list
- debug "register on variable list"
- set add 1
- set i [lsearch $Variables "$other"]
- set list1 [lreplace $Variables $i $i]
- set list2 [concat $Collect "$other"]
- }
- }
-
- set i [lsearch $Args $other]
- if {$i != -1} {
- set i [lsearch $Collect "$other"]
- set added 1
- if {$i != -1} {
- # It's an arg on the collection list
- debug "arg on collection list"
- set add 0
- set list1 [lreplace $Collect $i $i]
- set list2 [concat $Variables "$other"]
- } else {
- # It's an arg on the variables list
- debug "arg on variable list"
- set add 1
- set i [lsearch $Variables "$other"]
- set list1 [lreplace $Variables $i $i]
- set list2 [concat $Collect "$other"]
- }
- }
-
- # Check for special tags
- if {!$added} {
- if {"[string tolower $other]" == "all locals"} {
- set i [lsearch $Variables "All Locals"]
- if {$i != -1} {
- # It's "All Locals" on the variables list
- set add 1
- set lists [all_locals 1]
- set list1 [lindex $lists 0]
- set list2 [lindex $lists 1]
- } else {
- # It's "All Locals" on the Collect list
- set add 0
- set lists [all_locals 0]
- set list1 [lindex $lists 0]
- set list2 [lindex $lists 1]
- }
- } elseif {"[string tolower $other]" == "all registers"} {
- set i [lsearch $Variables "All Registers"]
- if {$i != -1} {
- # It's "All Registers" on the Variables list
- set add 1
- set lists [all_regs 1]
- set list1 [lindex $lists 0]
- set list2 [lindex $lists 1]
- } else {
- set add 0
- set lists [all_regs 0]
- set list1 [lindex $lists 0]
- set list2 [lindex $lists 1]
- }
- } elseif {"[string tolower $other]" == "all arguments"} {
- set i [lsearch $Variables "All Arguments"]
- if {$i != -1} {
- # It's "All Arguments" on the Variables list
- set add 1
- set lists [all_args 1]
- set list1 [lindex $lists 0]
- set list2 [lindex $lists 1]
- } else {
- set add 0
- set lists [all_args 0]
- set list1 [lindex $lists 0]
- set list2 [lindex $lists 1]
- }
- } elseif {"[string tolower $other]" == "collect stack"} {
- set i [lsearch $Variables "Collect Stack"]
- if {$i != -1} {
- # It's "All Arguments" on the Variables list
- set add 1
- set lists [all_args 1]
- set list1 [lindex $lists 0]
- set list2 [lindex $lists 1]
- } else {
- set add 0
- set lists [all_args 0]
- set list1 [lindex $lists 0]
- set list2 [lindex $lists 1]
- }
- } else {
- # Check if this entry is on the Collect list
- set i [lsearch $Collect $other]
- if {$i != -1} {
- # It's on the list -- remove it
- set add 0
- set list1 [lreplace $Collect $i $i]
- set list2 $Variables
- } else {
- # It's not on the list -- add it
-
- set other [string trim $other \ \r\t\n]
-
- # accept everything, send to gdb to validate
- set ok 1
-
- # memranges will be rejected right here
-
- if {[string range $other 0 1] == "\$("} {
- tk_messageBox -type ok -icon error \
- -message "Expression syntax not supported"
- set ok 0
- }
-
- # do all syntax checking later
- if {$ok} {
- #debug "Keeping \"$other\""
- # We MUST string out all spaces...
- if {[regsub -all { } $other {} expression]} {
- set other $expression
- }
- set add 1
- set list1 $Variables
- set list2 [concat $Collect "$other"]
- } else {
- #debug "Discarding \"$other\""
- }
- }
- }
- }
-
- # Clear the entry
- $OtherEntry delete 0 end
-
- if {$add} {
- set Variables $list1
- set Collect $list2
- } else {
- set Variables $list2
- set Collect $list1
- }
- fill_listboxes
- }
- }
-
-
- # ------------------------------------------------------------------
- # METHOD: get_selections - get all the selected variables
- # pass 0 to get the selections from the collect box
- # Returns a list of: listbox in which the selections were
- # obtained, last element selected on the list, and all the
- # selected elements
- # ------------------------------------------------------------------
- method get_selections {vars} {
-
- if {$vars} {
- set widget $VariablesLB
- } else {
- set widget $CollectLB
- }
-
- set elements [$widget curselection]
- set list {}
- set i 0
- foreach i $elements {
- lappend list [$widget get $i]
- }
-
- return [list $widget $i $elements]
- }
-
- # ------------------------------------------------------------------
- # METHOD: cancel - cancel the dialog and do not set the trace
- # ------------------------------------------------------------------
- method cancel {} {
- ::delete object $this
- }
-
- method remove_special {list items} {
-
- foreach item $items {
- set i [lsearch $list $item]
- if {$i != -1} {
- set list [lreplace $list $i $i]
- } else {
- set i [lsearch $list \$$item]
- if {$i != -1} {
- set list [lreplace $list $i $i]
- }
- }
- }
-
- return $list
- }
-
- # ------------------------------------------------------------------
- # METHOD: ok - validate the tracepoint and install it
- # ------------------------------------------------------------------
- method ok {} {
- global _TStepCount
-
- # Add anything in the OtherEntry
- change_other
-
- # Check that we are collecting data
- if {[llength $Collect] == 0} {
- # No data!
- set msg "No data specified for the given action."
- set answer [tk_messageBox -type ok -title "Tracepoint Error" \
- -icon error \
- -message $msg]
- case $answer {
- cancel {
- cancel
- }
- ok {
- return
- }
- }
- }
-
- set i [lsearch $Collect "All Locals"]
- if {$i != -1} {
- set data [lreplace $Collect $i $i]
- set data [concat $data {$loc}]
-
- # Remove all the locals from the list
- set data [remove_special $data $Locals]
- } else {
- set data $Collect
- }
-
- set i [lsearch $data "All Registers"]
- if {$i != -1} {
- set data [lreplace $data $i $i]
- set data [concat $data {$reg}]
-
- # Remove all the locals from the list
- set data [remove_special $data $Registers]
- }
-
- set i [lsearch $data "All Arguments"]
- if {$i != -1} {
- set data [lreplace $data $i $i]
- set data [concat $data {$arg}]
-
- # Remove all the locals from the list
- set data [remove_special $data $Args]
- }
-
- set i [lsearch $data "Collect Stack"]
- if {$i != -1} {
- set data [lreplace $data $i $i]
- set data [concat $data [collect_stack]]
-
- }
-
- # Remove repeats
- set d {}
- foreach i $data {
- if {![info exists check($i)]} {
- set check($i) 1
- lappend d $i
- }
- }
-
- if {$WhileStepping} {
- set steps $_TStepCount
- } else {
- set steps 0
- }
-
- if {"$Data" != {}} {
- set command "modify"
- } else {
- set command "add"
- }
-
- debug "DATA = $data"
- eval $Callback $command $steps [list $data]
- ::delete object $this
- }
-
-
- method collect_stack {} {
- return $StackCollect
- }
-
- method cmd {line} {
- $line
- }
-
- # PUBLIC DATA
- public variable File
- public variable Line {}
- public variable WhileStepping 0
- public variable Number
- public variable Callback
- public variable Data {}
- public variable Steps {}
- public variable Address {}
-
- # PROTECTED DATA
- protected variable WhileSteppingEntry
- protected variable CollectLB
- protected variable VariablesLB
- protected variable Variables {}
- protected variable Collect {}
- protected variable Locals
- protected variable Args
- protected variable Registers
- protected variable Others {}
- protected variable AddButton
- protected variable RemoveButton
- protected variable OtherEntry
- protected variable StackCollect {*(char*)$sp@64}
-}
diff --git a/gdb/gdbtk/library/attachdlg.itb b/gdb/gdbtk/library/attachdlg.itb
deleted file mode 100644
index 64ae195d7ae..00000000000
--- a/gdb/gdbtk/library/attachdlg.itb
+++ /dev/null
@@ -1,232 +0,0 @@
-# Attach Dialog for Insight.
-# Copyright (C) 1999, 2002, 2003, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::body AttachDlg::constructor {args} {
- eval itk_initialize $args
- window_name "Attach To Process"
- build_win
-}
-
-itcl::body AttachDlg::build_win {} {
- # Frame
- itk_component add pid {
- iwidgets::labeledframe $itk_interior.f -labeltext "Choose Process" \
- -relief groove -borderwidth 2 -ipadx 6 -ipady 4
- }
-
- # Listbox of processes
- itk_component add choose_pid {
- iwidgets::scrolledlistbox [$itk_component(pid) childsite].pid \
- -visibleitems 30x15 -hscrollmode dynamic -vscrollmode dynamic\
- -exportselection 0 -selectioncommand [code $this select_pid] \
- -foreground $::Colors(textfg) -textbackground $::Colors(textbg) \
- -dblclickcommand [code $this doit]
- }
-
- # Filter entryfield
- itk_component add pid_filter {
- iwidgets::entryfield [$itk_component(pid) childsite].filt \
- -labeltext "Filter:" \
- -foreground $::Colors(textfg) -textbackground $::Colors(textbg) \
- -focuscommand [code $this clear_pid_selection] \
- -command [code $this filter_pid_selection]
- }
- $itk_component(pid_filter) insert 0 *
-
- # seperator
- itk_component add pid_sep {
- frame [$itk_component(pid) childsite].sep \
- -height 2 -borderwidth 1 -relief sunken
- }
-
- # PID_ENTRY: this is the PID entry box. You can enter the pid
- # by hand here, or click on the listbox to have it entered for you.
- itk_component add pid_entry {
- iwidgets::entryfield [$itk_component(pid) childsite].lab \
- -labeltext "PID:" -validate numeric \
- -foreground $::Colors(textfg) -textbackground $::Colors(textbg) \
- -focuscommand [code $this clear_pid_selection]
- }
- pack $itk_component(choose_pid) -fill x -side top -pady 4
- pack $itk_component(pid_filter) -fill x -side top -pady 4
- pack $itk_component(pid_sep) -fill x -side top -pady 8
- pack $itk_component(pid_entry) -fill x -side bottom -pady 4
-
- itk_component add symbol_label {
- iwidgets::labeledframe $itk_interior.sym -labeltext "Choose Exec file" \
- -labelpos nw -relief groove -borderwidth 2 \
- -ipadx 8 -ipady 6
- }
-
- itk_component add symbol_file {
- iwidgets::entryfield [$itk_interior.sym childsite].f -labeltext "File:" \
- -foreground $::Colors(textfg) -textbackground $::Colors(textbg)
- }
- pack $itk_component(symbol_file) -pady 4 -padx 4 -fill x
-
- # can't use the -state in the entryfield, 'cause that affects the
- # label as well...
- #$itk_component(symbol_file) component entry configure -state disabled
- $itk_component(symbol_file) configure -state normal
- $itk_component(symbol_file) insert 0 $::gdb_exe_name
- #$itk_component(symbol_file) configure -state disabled
-
- itk_component add symbol_browse {
- button [$itk_component(symbol_file) childsite].br -text "Choose..." \
- -command [code $this choose_symbol_file]
- }
- pack $itk_component(symbol_browse) -pady 4 -padx 4 -ipadx 4
-
- itk_component add button_box {
- frame $itk_interior.b
- }
-
- itk_component add cancel {
- button $itk_component(button_box).cancel -text "Cancel" \
- -command [code $this cancel]
- }
-
- itk_component add ok {
- button $itk_component(button_box).ok -text "OK" -command [code $this doit]
- }
-
-# if {$::gdb_exe_name == ""} {
-# $itk_component(ok) configure -state disabled
-# }
-
- ::standard_button_box $itk_component(button_box)
-
- pack $itk_component(button_box) -side bottom -fill x -pady 4 -padx 4
- pack $itk_component(symbol_label) -side bottom -fill x -pady 4 -padx 4
- pack $itk_component(pid) -fill both -expand 1 -pady 4 -padx 4
-
- after idle [list update idletasks; $this list_pids]
-}
-
-# ------------------------------------------------------------------
-# METHOD: doit - This accepts the attach command.
-# ------------------------------------------------------------------
-
-itcl::body AttachDlg::doit {} {
- set AttachDlg::last_button 1
- set AttachDlg::last_pid [$itk_component(pid_entry) get]
- set AttachDlg::symbol_file [$itk_component(symbol_file) get]
- unpost
-}
-
-# ------------------------------------------------------------------
-# METHOD: cancel - unpost the dialog box without attaching.
-# ------------------------------------------------------------------
-
-itcl::body AttachDlg::cancel {} {
- set AttachDlg::last_button 0
- set AttachDlg::last_pid {}
- unpost
-}
-
-# ------------------------------------------------------------------
-# METHOD: choose_symbol_file - Query for a new symbol file.
-# ------------------------------------------------------------------
-
-itcl::body AttachDlg::choose_symbol_file {} {
- set file [tk_getOpenFile -parent . -title "Load New Executable"]
- if {$file != ""} {
- $itk_component(symbol_file) configure -state normal
- $itk_component(symbol_file) clear
- $itk_component(symbol_file) insert 0 $file
-# $itk_component(symbol_file) configure -state disabled
- $itk_component(ok) configure -state active
- }
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: list_pids - List the available processes. Right now,
-# this just spawns ps, which means we have to deal with
-# all the different ps flags & output formats. At some
-# point we should steal some C code to do it by hand.
-# ------------------------------------------------------------------
-
-itcl::body AttachDlg::list_pids {{pattern *}} {
- global gdbtk_platform
-
- switch $gdbtk_platform(os) {
- Linux {
- set ps_cmd "ps axw"
- }
- default {
- set ps_cmd "ps w"
- }
- }
- if {[catch {::open "|$ps_cmd" r} psH]} {
- set errTxt "Could not exec ps: $psH
-You will have to enter the PID by hand."
- ManagedWin::open WarningDlg -message [list $errTxt]
- return
- }
- gets $psH header
-
- set nfields [llength $header]
- set nfields_m_1 [expr {$nfields - 1}]
- set regexp {^ *([^ ]*) +}
- for {set i 1} {$i < $nfields_m_1} {incr i} {
- append regexp {[^ ]* +}
- }
- append regexp {(.*)$}
-
- $itk_component(choose_pid) clear
- set pid_list {}
-
- while {[gets $psH line] >= 0} {
- regexp $regexp $line dummy PID COMMAND
- if {[string match $pattern $COMMAND]} {
- lappend pid_list [list $PID $COMMAND]
- $itk_component(choose_pid) insert end $COMMAND
- }
- }
-
- close $psH
- $itk_component(choose_pid) selection set 0
- select_pid
-}
-
-# ------------------------------------------------------------------
-# METHOD: select_pid - Grab the selected element from the PID listbox
-# and insert the associated PID into the entry form.
-# ------------------------------------------------------------------
-
-itcl::body AttachDlg::select_pid {} {
- set hit [$itk_component(choose_pid) curselection]
- if {$hit != ""} {
- $itk_component(pid_entry) clear
- $itk_component(pid_entry) insert 0 [lindex [lindex $pid_list $hit] 0]
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: clear_pid_selection - Clear the current PID selection.
-# ------------------------------------------------------------------
-
-itcl::body AttachDlg::clear_pid_selection {} {
- $itk_component(choose_pid) selection clear 0 end
- $itk_component(pid_entry) selection range 0 end
-}
-
-# ------------------------------------------------------------------
-# METHOD: filter_pid_selection - Filters the pid box.
-# ------------------------------------------------------------------
-
-itcl::body AttachDlg::filter_pid_selection {} {
- list_pids [$itk_component(pid_filter) get]
-}
diff --git a/gdb/gdbtk/library/attachdlg.ith b/gdb/gdbtk/library/attachdlg.ith
deleted file mode 100644
index 71ee4876eb0..00000000000
--- a/gdb/gdbtk/library/attachdlg.ith
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# attachdlg.ith - itcl declarations for class AttachDlg
-# ----------------------------------------------------------------------
-# Implements Attach to process window
-#
-# ----------------------------------------------------------------------
-# Copyright (C) 1999 Cygnus Solutions
-#
-itcl::class AttachDlg {
- inherit ModalDialog ManagedWin
-
- public {
- method constructor {args}
- proc last_button {} {return $last_button}
- proc pid {} {return $last_pid}
- proc symbol_file {} {return $symbol_file}
- }
-
- protected {
- method build_win {args}
- method cancel {}
- method choose_symbol_file {}
- method doit {}
- method list_pids {{pattern *}}
- method select_pid {}
- method clear_pid_selection {}
- method filter_pid_selection {}
-
- variable pid_list
-
- common last_button 0
- common last_pid {}
- common symbol_file
- }
-}
diff --git a/gdb/gdbtk/library/blockframe.itb b/gdb/gdbtk/library/blockframe.itb
deleted file mode 100644
index 6819c1f3847..00000000000
--- a/gdb/gdbtk/library/blockframe.itb
+++ /dev/null
@@ -1,227 +0,0 @@
-# Block and frame class implementations for GDBtk.
-# Copyright (C) 1997, 1998, 1999 Cygnus Solutions
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ------------------------------------------------------------------
-# Block
-# ------------------------------------------------------------------
-itcl::body Block::constructor {start end args} {
-
- # Record runtime info about this block
- set _start $start
- set _end $end
- set _variables [_findVariables]
- eval configure $args
-}
-
-# Destroy ourself.
-itcl::body Block::destructor {} {
-
- # Each block is responsible for destroying its
- # variables and removing them from the list of
- # of all variables for this frame
- foreach var $_variables {
- $var delete
- }
-}
-
-# Return a list of variables defined in this block
-# This list is determined when we are created.
-itcl::body Block::variables {} {
- return $_variables
-}
-
-# Find the new variables for this block.
-itcl::body Block::_findVariables {} {
-
- # Find the new variables for this block.
- set variables [gdb_block_variables $_start $_end]
-
- # Create variables.
- set vars {}
- foreach variable $variables {
- # Be paranoid: catch errors constructing variable.
- set err [catch {gdb_variable create -expr $variable} obj]
- if {!$err} {
- lappend vars $obj
- }
- }
-
- return $vars
-}
-
-itcl::body Block::update {} {
-
- set changed {}
- foreach var $_variables {
- set changed [concat $changed [$var update]]
- }
-
- return $changed
-}
-
-itcl::body Block::info {} {
-
- return [list $_start $_end]
-}
-
-# ------------------------------------------------------------------
-# Frame
-# ------------------------------------------------------------------
-itcl::body Frame::constructor {addr} {
-
- set _addr $addr
-
- # Create all blocks in the selected frame
- set _blocks {}
- _createBlocks [gdb_get_blocks]
-
-}
-
-itcl::body Frame::destructor {} {
- # destroy our own blocks
- foreach block $_blocks {
- _removeBlock $block
- }
-}
-
-itcl::body Frame::_removeBlock {blockObj} {
-
- set i [lsearch $_blocks $blockObj]
- if {$i != -1} {
- set _blocks [lreplace $_blocks $i $i]
- delete object $blockObj
- }
-}
-
-itcl::body Frame::_addBlock {block} {
-
- set start [lindex $block 0]
- set end [lindex $block 1]
- set b [Block \#auto $start $end]
- lappend _blocks $b
-
- return $b
-}
-
-itcl::body Frame::_createBlocks {blocks} {
-
- foreach block $blocks {
- set b [_addBlock $block]
- }
-}
-
-itcl::body Frame::update {} {
-
- set vars {}
- foreach block $_blocks {
- set vars [concat $vars [$block update]]
- }
-
- return $vars
-}
-
-itcl::body Frame::variables {} {
-
- set vars {}
- foreach block $_blocks {
- set vars [concat $vars [$block variables]]
- }
-
- return $vars
-}
-
-itcl::body Frame::new {} {
- # find any new variables. So get a list of all blocks,
- # eliminate duplicates, and get those variables.
-
- set blocks [gdb_get_blocks]
- set new {}
-
- foreach block $blocks {
- set b [_findBlock $block]
- if {$b == ""} {
- # Found a new block. Create it get its variables
- set b [_addBlock $block]
- set new [concat $new [$b variables]]
- }
- }
-
- return $new
-}
-
-itcl::body Frame::deleteOld {} {
-
- foreach block [_oldBlocks] {
- _removeBlock $block
- }
-}
-
-itcl::body Frame::_oldBlocks {} {
-
- set blocks [gdb_get_blocks]
- set oldObjs $_blocks
-
- foreach block $blocks {
- set obj [_findBlock $block]
- if {$obj != ""} {
- # Found it.. Remove it from old
- set i [lsearch $oldObjs $obj]
- set oldObjs [lreplace $oldObjs $i $i]
- }
- }
-
- return $oldObjs
-}
-
-itcl::body Frame::old {} {
-
- # All the variables in the blocks in old are now gone...
- # We don't remove blocks here, since the frontend viewer
- # might want to keep these variables around for a little while
- # longer.
- set vars {}
- set old [_oldBlocks]
- foreach block $old {
- set vars [concat $vars [$block variables]]
- }
-
- return $vars
-}
-
-itcl::body Frame::_findBlock {block} {
-
- foreach b $_blocks {
- set info [$b info]
- if {$info == $block} {
- return $b
- }
- }
-
- return ""
-}
-
-itcl::body Frame::_findBlockIndex {block} {
-
- set i 0
- foreach b $_blocks {
- set info [$b info]
- if {$info == $block} {
- return $i
- }
- incr i
- }
-
- return -1
-}
-
-
diff --git a/gdb/gdbtk/library/blockframe.ith b/gdb/gdbtk/library/blockframe.ith
deleted file mode 100644
index 2a2457820d9..00000000000
--- a/gdb/gdbtk/library/blockframe.ith
+++ /dev/null
@@ -1,63 +0,0 @@
-# Class definitions for blocks and frames for GDBtk.
-# Copyright (C) 1997, 1998, 1999 Cygnus Solutions
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-itcl::class Block {
-
- public {
- method constructor {start end args}
- method destructor {}
- method variables {}
- method update {}
- method info {}
- }
-
- private {
- # Start and end address for this block
- variable _start
- variable _end
-
- # List of variables (new) variables defined in this block
- variable _variables
-
- method _findVariables {}
- }
-}
-
-itcl::class Frame {
-
- public {
- method constructor {addr}
- method destructor {}
- method variables {}
- method update {}
- method new {}
- method old {}
- method deleteOld {}
- method address {} { return $_addr }
- }
-
- private {
- method _createBlocks {blocks}
- method _addBlock {block}
- method _findBlock {block}
- method _findBlockIndex {block}
- method _removeBlock {blockObj}
- method _oldBlocks {}
-
- # Our address
- variable _addr
-
- # A list of all blocks
- variable _blocks
- }
-}
diff --git a/gdb/gdbtk/library/bpwin.itb b/gdb/gdbtk/library/bpwin.itb
deleted file mode 100644
index 027eba8e14a..00000000000
--- a/gdb/gdbtk/library/bpwin.itb
+++ /dev/null
@@ -1,728 +0,0 @@
-# Breakpoint window for Insight.
-# Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ------------------------------------------------------------------
-# CONSTRUCTOR: create the main breakpoint window
-# ------------------------------------------------------------------
-itcl::body BpWin::constructor {args} {
- window_name "Breakpoints" "BPs"
-
- if {[pref getd gdb/bp/menu] != ""} {
- set mbar 0
- }
- set show_threads [pref get gdb/bp/show_threads]
- debug "Ready to build"
- build_win
- eval itk_initialize $args
-
- # The scrolledframe uses a canvas, which doesn't properly
- # calculate an initial size, so we must set a default
- # window size here. ManagedWin could override this still
- # if there is a user preference for the geometry.
- wm geometry $_top 350x165
- debug "done building"
-}
-
-# ------------------------------------------------------------------
-# DESTRUCTOR: destroy the breakpoint window
-# ------------------------------------------------------------------
-itcl::body BpWin::destructor {} {}
-
-
-# ------------------------------------------------------------------
-# METHOD: build_win - build the main breakpoint window
-# ------------------------------------------------------------------
-itcl::body BpWin::build_win {} {
- global _bp_en _bp_disp
- set bg1 $::Colors(bg)
-
- set hsmode dynamic
- set vsmode dynamic
-
- # FIXME: The iwidgets scrolled frame is pretty useless.
- # When we get BLT, use its hiertable to do this.
- itk_component add sframe {
- iwidgets::scrolledframe $itk_interior.sf \
- -hscrollmode $hsmode -vscrollmode $vsmode
- }
-
- set twin [$itk_component(sframe) childsite]
-
- # write header
- if {$tracepoints} {
- label $twin.num0 -text "Num" -relief raised -bd 2 -anchor center \
- -font global/fixed
- }
- label $twin.thread0 -text "Thread" -relief raised -bd 2 -anchor center \
- -font global/fixed
- label $twin.addr0 -text "Address" -relief raised -bd 2 -anchor center \
- -font global/fixed
- label $twin.file0 -text "File" -relief raised -bd 2 -anchor center \
- -font global/fixed
- label $twin.line0 -text "Line" -relief raised -bd 2 -anchor center \
- -font global/fixed
- label $twin.func0 -text "Function" -relief raised -bd 2 -anchor center \
- -font global/fixed
-
- if {$tracepoints} {
- label $twin.pass0 -text "PassCount" -relief raised -borderwidth 2 \
- -anchor center -font global/fixed
- grid x $twin.num0 $twin.addr0 $twin.file0 $twin.line0 $twin.func0 $twin.pass0 \
- -sticky new
- } else {
- if {$show_threads} {
- grid x $twin.thread0 $twin.addr0 $twin.file0 $twin.line0 $twin.func0 -sticky new
- # Let the File and Function columns expand; no others.
- grid columnconfigure $twin 3 -weight 1
- grid columnconfigure $twin 5 -weight 1
- } else {
- grid x $twin.addr0 $twin.file0 $twin.line0 $twin.func0 -sticky new
- # Let the File and Function columns expand; no others.
- grid columnconfigure $twin 2 -weight 1
- grid columnconfigure $twin 4 -weight 1
- }
- }
-
-
- # The last row must always suck up all the leftover vertical
- # space.
- set next_row 1
- grid rowconfigure $twin $next_row -weight 1
-
- if { $mbar } {
- menu $itk_interior.m -tearoff 0
- [winfo toplevel $itk_interior] configure -menu $itk_interior.m
- if { $tracepoints == 0 } {
- $itk_interior.m add cascade -menu $itk_interior.m.bp -label "Breakpoint" -underline 0
- } else {
- $itk_interior.m add cascade -menu $itk_interior.m.bp -label "Tracepoint" -underline 0
- }
- set m [menu $itk_interior.m.bp]
- if { $tracepoints == 0 } {
- $m add radio -label "Normal" -variable _bp_disp($selected) \
- -value donttouch -underline 0 -state disabled
- $m add radio -label "Temporary" -variable _bp_disp($selected) \
- -value delete -underline 0 -state disabled
- } else {
- $m add command -label "Actions" -underline 0 -state disabled
- }
-
- $m add separator
- $m add radio -label "Enabled" -variable _bp_en($selected) -value 1 \
- -underline 0 -state disabled
- $m add radio -label "Disabled" -variable _bp_en($selected) -value 0 \
- -underline 0 -state disabled
- $m add separator
- $m add command -label "Remove" -underline 0 -state disabled
- $itk_interior.m add cascade -menu $itk_interior.m.all -label "Global" \
- -underline 0
- set m [menu $itk_interior.m.all]
- $m add check -label " Show Threads" \
- -variable [pref varname gdb/bp/show_threads] \
- -underline 1 -command "$this toggle_threads"
- $m add separator
- $m add command -label "Disable All" -underline 0 \
- -command "$this bp_all disable"
- $m add command -label "Enable All" -underline 0 \
- -command "$this bp_all enable"
- $m add separator
- $m add command -label "Remove All" -underline 0 \
- -command "$this bp_all delete"
- $m add separator
- $m add command -label "Store Breakpoints..." -underline 0 \
- -command [code $this bp_store]
- $m add command -label "Restore Breakpoints..." -underline 3 \
- -command [code $this bp_restore]
- }
-
- set Menu [menu $itk_interior.pop -tearoff 0]
-
- if { $tracepoints == 0 } {
- $Menu add radio -label "Normal" -variable _bp_disp($selected) \
- -value donttouch -underline 0
- $Menu add radio -label "Temporary" -variable _bp_disp($selected) \
- -value delete -underline 0
- } else {
- $Menu add command -label "Actions" -underline 0
- }
- $Menu add separator
- $Menu add radio -label "Enabled" -variable _bp_en($selected) -value 1 -underline 0
- $Menu add radio -label "Disabled" -variable _bp_en($selected) -value 0 -underline 0
- $Menu add separator
- $Menu add command -label "Remove" -underline 0
- $Menu add cascade -menu $Menu.all -label "Global" -underline 0
- set m [menu $Menu.all]
- $m add check -label " Show Threads" -variable [pref varname gdb/bp/show_threads] \
- -underline 1 -command "$this toggle_threads"
- $m add separator
- $m add command -label "Disable All" -underline 0 -command "$this bp_all disable"
- $m add command -label "Enable All" -underline 0 -command "$this bp_all enable"
- $m add separator
- $m add command -label "Remove All" -underline 0 -command "$this bp_all delete"
-
- if { $tracepoints == 0 } {
- # insert all breakpoints
- foreach i [gdb_get_breakpoint_list] {
- set e [BreakpointEvent \#auto -action create -number $i]
- bp_add $e
- delete object $e
- }
- } else {
- # insert all tracepoints
- foreach i [gdb_get_tracepoint_list] {
- set e [TracepointEvent \#auto -action create -number $i]
- bp_add $e 1
- delete object $e
- }
- }
-
- pack $itk_component(sframe) -side left -expand true -fill both
-}
-
-# ------------------------------------------------------------------
-# METHOD: bp_add - add a breakpoint entry
-# ------------------------------------------------------------------
-itcl::body BpWin::bp_add {bp_event {tracepoint 0}} {
- global _bp_en _bp_disp gdbtk_platform _files
-
- set number [$bp_event get number]
- set thread [$bp_event get thread]
- set disposition [$bp_event get disposition]
- set file [$bp_event get file]
-
- if {$tracepoint} {
- set diposition tracepoint
- set bptype tracepoint
- } else {
- set bptype breakpoint
- }
-
- debug "bp_add bpnum=$number thread=$thread show=$show_threads"
- set i $next_row
- set _bp_en($i) [$bp_event get enabled]
- set _bp_disp($i) $disposition
- set temp($i) ""
- switch $disposition {
- donttouch { set color [pref get gdb/src/bp_fg] }
- delete {
- set color [pref get gdb/src/temp_bp_fg]
- set temp($i) delete
- }
- tracepoint {
- set color [pref get gdb/src/trace_fg]
- }
- default { set color yellow }
- }
-
- if {$thread != "-1"} {set color [pref get gdb/src/thread_fg]}
-
- if {$gdbtk_platform(platform) == "windows"} {
- checkbutton $twin.en$i -relief flat -variable _bp_en($i) \
- -activebackground $bg1 -command "$this bp_able $i" -fg $color
- } else {
- checkbutton $twin.en$i -relief flat -variable _bp_en($i) \
- -command "$this bp_able $i" -activebackground $bg1 \
- -selectcolor $color -highlightbackground $bg1
- }
-
- if {$tracepoints} {
- label $twin.num$i -text "$number " -relief flat -anchor w -font global/fixed
- }
- label $twin.addr$i -text "[gdb_CA_to_TAS [$bp_event get address]] " -relief flat -anchor w -font global/fixed -bg $bg1
- if {[info exists _files(short,$file)]} {
- set file $_files(short,$file)
- } else {
- # FIXME. Really need to do better than this.
- set file [::file tail $file]
- }
- if {$show_threads} {
- if {$thread == "-1"} {set thread "ALL"}
- label $twin.thread$i -text "$thread " -relief flat -anchor w -font global/fixed
- }
- label $twin.file$i -text "$file " -relief flat -anchor w -font global/fixed
- label $twin.line$i -text "[$bp_event get line] " -relief flat -anchor w -font global/fixed
- label $twin.func$i -text "[$bp_event get function] " -relief flat -anchor w -font global/fixed
- if {$tracepoints} {
- label $twin.pass$i -text "[$bp_event get pass_count] " -relief flat -anchor w -font global/fixed
- }
-
- if {$mbar} {
- set zz [list addr file func line]
- if {$tracepoints} {lappend zz num pass}
- if {$show_threads} {lappend zz thread}
- foreach thing $zz {
- bind $twin.${thing}${i} <1> "$this bp_select $i"
- bind $twin.${thing}${i} <Double-1> "$this goto_bp $i"
- bind $twin.${thing}${i} <3> [code $this _select_and_popup $i %X %Y]
- }
- }
-
- if {$tracepoints} {
- grid $twin.en$i $twin.num$i $twin.addr$i $twin.file$i $twin.line$i \
- $twin.func$i $twin.pass$i -sticky new -ipadx 4 -ipady 2
- } else {
- if {$show_threads} {
- grid $twin.en$i $twin.thread$i $twin.addr$i $twin.file$i $twin.line$i \
- $twin.func$i -sticky new -ipadx 4 -ipady 2
- } else {
- grid $twin.en$i $twin.addr$i $twin.file$i $twin.line$i \
- $twin.func$i -sticky new -ipadx 4 -ipady 2
- }
- }
-
- # This used to be the last row. Fix it vertically again.
- grid rowconfigure $twin $i -weight 0
-
- set index_to_bpnum($i) $number
- set Index_to_bptype($i) $bptype
- incr i
- set next_row $i
- grid rowconfigure $twin $i -weight 1
-}
-
-# ------------------------------------------------------------------
-# METHOD: bp_store - stores away the breakpoints in a file of gdb
-# commands
-# ------------------------------------------------------------------
-itcl::body BpWin::bp_store {} {
- set out_file [tk_getSaveFile]
- if {$out_file == ""} {
- return
- }
- if {[catch {::open $out_file w} outH]} {
- tk_messageBox -message "Could not open $out_file: $outH"
- return
- }
- foreach breakpoint [gdb_get_breakpoint_list] {
- # This is an lassign
- foreach {file function line_no address type \
- enable_p disp ignore cmds cond thread hit_count user_spec} \
- [gdb_get_breakpoint_info $breakpoint] {
- break
- }
-
- if {$user_spec != ""} {
- set bp_specifier $user_spec
- } elseif {$file != ""} {
- set filename [file tail $file]
- set bp_specifier $filename:$line_no
- } else {
- set bp_specifier *$address
- }
-
- # FIXME: doesn't handle watchpoints.
- if {[string compare $disp "delete"] == 0} {
- puts $outH "tbreak $bp_specifier"
- } else {
- puts $outH "break $bp_specifier"
- }
-
- if {!$enable_p} {
- puts $outH "disable \$bpnum"
- }
- if {$ignore > 0} {
- puts $outH "ignore \$bpnum $ignore"
- }
- }
- close $outH
-}
-
-# ------------------------------------------------------------------
-# METHOD: bp_restore - restore the breakpoints from a file of gdb
-# commands
-# ------------------------------------------------------------------
-itcl::body BpWin::bp_restore {} {
- set inH [tk_getOpenFile]
- if {$inH == ""} {
- return
- }
- bp_all delete
- if {[catch {gdb_cmd "source $inH"} err]} {
- tk_messageBox -message "Error sourcing in BP file $inH: \"$err\""
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: bp_select - select a row in the grid
-# ------------------------------------------------------------------
-itcl::body BpWin::bp_select { r } {
- global _bp_en _bp_disp
-
- set zz [list addr file func line]
- if {$tracepoints} {lappend zz num pass}
- if {$show_threads} {lappend zz thread}
-
- if {$selected} {
- set i $selected
-
- foreach thing $zz {
- $twin.${thing}${i} configure -fg $::Colors(fg) -bg $bg1
- }
- }
-
- # if we click on the same line, unselect it and return
- if {$selected == $r} {
- set selected 0
-
- if {$tracepoints == 0} {
- $itk_interior.m.bp entryconfigure "Normal" -state disabled
- $itk_interior.m.bp entryconfigure "Temporary" -state disabled
- } else {
- $itk_interior.m.bp entryconfigure "Actions" -state disabled
- }
- $itk_interior.m.bp entryconfigure "Enabled" -state disabled
- $itk_interior.m.bp entryconfigure "Disabled" -state disabled
- $itk_interior.m.bp entryconfigure "Remove" -state disabled
-
- return
- }
-
- foreach thing $zz {
- $twin.${thing}${r} configure -fg $::Colors(sfg) -bg $::Colors(sbg)
- }
-
- if {$tracepoints == 0} {
- $itk_interior.m.bp entryconfigure "Normal" -variable _bp_disp($r) \
- -command "$this bp_type $r" -state normal
- $itk_interior.m.bp entryconfigure "Temporary" -variable _bp_disp($r) \
- -command "$this bp_type $r" -state normal
- $Menu entryconfigure "Normal" -variable _bp_disp($r) \
- -command "$this bp_type $r" -state normal
- $Menu entryconfigure "Temporary" -variable _bp_disp($r) \
- -command "$this bp_type $r" -state normal
- } else {
- $itk_interior.m.bp entryconfigure "Actions" -command "$this get_actions $r" -state normal
- $Menu entryconfigure "Actions" -command "$this get_actions $r" -state normal
- }
- $itk_interior.m.bp entryconfigure "Enabled" -variable _bp_en($r) \
- -command "$this bp_able $r" -state normal
- $itk_interior.m.bp entryconfigure "Disabled" -variable _bp_en($r) \
- -command "$this bp_able $r" -state normal
- $itk_interior.m.bp entryconfigure "Remove" -command "$this bp_remove $r" -state normal
- $Menu entryconfigure "Enabled" -variable _bp_en($r) \
- -command "$this bp_able $r" -state normal
- $Menu entryconfigure "Disabled" -variable _bp_en($r) \
- -command "$this bp_able $r" -state normal
- $Menu entryconfigure "Remove" -command "$this bp_remove $r" -state normal
-
- set selected $r
-}
-
-# ------------------------------------------------------------------
-# NAME: private method BpWin::_select_and_popup
-# DESCRIPTION: Select the given breakpoint and popup the options
-# menu at the given location.
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body BpWin::_select_and_popup {bp X Y} {
- if {$selected != $bp} {
- bp_select $bp
- }
- tk_popup $Menu $X $Y
-}
-
-# ------------------------------------------------------------------
-# METHOD: bp_modify - modify a breakpoint entry
-# ------------------------------------------------------------------
-itcl::body BpWin::bp_modify {bp_event {tracepoint 0}} {
- global _bp_en _bp_disp gdbtk_platform _files
-
- set number [$bp_event get number]
- set thread [$bp_event get thread]
- set disposition [$bp_event get disposition]
- set file [$bp_event get file]
-
- if {$tracepoint} {
- set disposition tracepoint
- set bptype tracepoint
- } else {
- set bptype breakpoint
- }
-
- set found 0
- for {set i 1} {$i < $next_row} {incr i} {
- if { $number == $index_to_bpnum($i)
- && "$Index_to_bptype($i)" == "$bptype"} {
- incr found
- break
- }
- }
-
- if {!$found} {
- debug "ERROR: breakpoint number $number not found!"
- return
- }
-
- if {$_bp_en($i) != [$bp_event get enabled]} {
- set _bp_en($i) [$bp_event get enabled]
- }
-
- if {$_bp_disp($i) != $disposition} {
- set _bp_disp($i) $disposition
- }
-
- switch $disposition {
- donttouch { set color [pref get gdb/src/bp_fg] }
- delete {
- set color [pref get gdb/src/temp_bp_fg]
- }
- tracepoint { set color [pref get gdb/src/trace_fg] }
- default { set color yellow}
- }
-
- if {$thread != "-1"} {set color [pref get gdb/src/thread_fg]}
-
- if {$gdbtk_platform(platform) == "windows"} then {
- $twin.en$i configure -fg $color
- } else {
- $twin.en$i configure -selectcolor $color
- }
- if {$tracepoints} {
- $twin.num$i configure -text "$number "
- }
- $twin.addr$i configure -text "[gdb_CA_to_TAS [$bp_event get address]] "
- if {[info exists _files(short,$file)]} {
- set file $_files(short,$file)
- } else {
- # FIXME. Really need to do better than this.
- set file [::file tail $file]
- }
- if {$show_threads} {
- if {$thread == "-1"} {set thread "ALL"}
- $twin.thread$i configure -text "$thread "
- }
- $twin.file$i configure -text "$file "
- $twin.line$i configure -text "[$bp_event get line] "
- $twin.func$i configure -text "[$bp_event get function] "
- if {$tracepoints} {
- $twin.pass$i configure -text "[$bp_event get pass_count] "
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: bp_able - enable/disable a breakpoint
-# ------------------------------------------------------------------
-itcl::body BpWin::bp_able { i } {
- global _bp_en
-
- bp_select $i
-
- switch $Index_to_bptype($i) {
- breakpoint {set type {}}
- tracepoint {set type "tracepoint"}
- }
-
- if {$_bp_en($i) == "1"} {
- set command "enable $type $temp($i) "
- } else {
- set command "disable $type "
- }
-
- append command "$index_to_bpnum($i)"
- gdb_cmd "$command"
-}
-
-# ------------------------------------------------------------------
-# METHOD: bp_remove - remove a breakpoint
-# ------------------------------------------------------------------
-itcl::body BpWin::bp_remove { i } {
-
- bp_select $i
-
- switch $Index_to_bptype($i) {
- breakpoint { set type {} }
- tracepoint { set type "tracepoint" }
- }
-
- gdb_cmd "delete $type $index_to_bpnum($i)"
-}
-
-# ------------------------------------------------------------------
-# METHOD: bp_type - change the breakpoint type (disposition)
-# ------------------------------------------------------------------
-itcl::body BpWin::bp_type { i } {
-
- if {$Index_to_bptype($i) != "breakpoint"} {
- return
- }
-
- set bpnum $index_to_bpnum($i)
- #debug "bp_type $i $bpnum"
- set bpinfo [gdb_get_breakpoint_info $bpnum]
- lassign $bpinfo file func line pc type enabled disposition \
- ignore_count commands cond thread hit_count user_spec
- bp_select $i
- switch $disposition {
- delete {
- gdb_cmd "delete $bpnum"
- gdb_cmd "break *$pc"
- }
- donttouch {
- gdb_cmd "delete $bpnum"
- gdb_cmd "tbreak *$pc"
- }
- default { debug "Unknown breakpoint disposition: $disposition" }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: bp_delete - delete a breakpoint
-# ------------------------------------------------------------------
-itcl::body BpWin::bp_delete {bp_event} {
- set number [$bp_event get number]
- for {set i 1} {$i < $next_row} {incr i} {
- if { $number == $index_to_bpnum($i) } {
- if {$tracepoints} {
- grid forget $twin.en$i $twin.num$i $twin.addr$i $twin.file$i \
- $twin.line$i $twin.func$i $twin.pass$i
- destroy $twin.en$i $twin.num$i $twin.addr$i $twin.file$i \
- $twin.line$i $twin.func$i $twin.pass$i
- } else {
- if {$show_threads} {
- grid forget $twin.thread$i
- destroy $twin.thread$i
- }
- grid forget $twin.en$i $twin.addr$i $twin.file$i $twin.line$i $twin.func$i
- destroy $twin.en$i $twin.addr$i $twin.file$i $twin.line$i $twin.func$i
- }
- if {$selected == $i} {
- set selected 0
- }
- return
- }
- }
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: breakpoint - Update widget when a breakpoint
-# event is received from the backend.
-# ------------------------------------------------------------------
-itcl::body BpWin::breakpoint {bp_event} {
-
- set action [$bp_event get action]
- #debug "bp update $action [$bp_event get number] [$bp_event get type]"
-
- switch $action {
- modify { bp_modify $bp_event 0 }
- create { bp_add $bp_event 0 }
- delete { bp_delete $bp_event }
- default { dbug E "Unknown breakpoint action: $action" }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: tracepoint - Update widget when a tracepoint event
-# is received from the backend.
-# ------------------------------------------------------------------
-itcl::body BpWin::tracepoint {tp_event} {
-
- set action [$tp_event get action]
- #debug "tp update $action [$tp_event get number]"
-
- switch $action {
- modify { bp_modify $tp_event 1 }
- create { bp_add $tp_event 1 }
- delete { bp_delete $tp_event }
- default { dbug E "Unknown tracepoint action: $action" }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: bp_all - perform a command on all breakpoints
-# ------------------------------------------------------------------
-itcl::body BpWin::bp_all { command } {
-
- if {!$tracepoints} {
- # Do all breakpoints
- foreach bpnum [gdb_get_breakpoint_list] {
- if { $command == "enable"} {
- for {set i 1} {$i < $next_row} {incr i} {
- if { $bpnum == $index_to_bpnum($i)
- && "$Index_to_bptype($i)" == "breakpoint"} {
- gdb_cmd "enable $temp($i) $bpnum"
- break
- }
- }
- } else {
- gdb_cmd "$command $bpnum"
- }
- }
- } else {
- # Do all tracepoints
- foreach bpnum [gdb_get_tracepoint_list] {
- if { $command == "enable"} {
- for {set i 1} {$i < $next_row} {incr i} {
- if { $bpnum == $index_to_bpnum($i)
- && "$Index_to_bptype($i)" == "tracepoint"} {
- gdb_cmd "enable tracepoint $bpnum"
- break
- }
- }
- } else {
- gdb_cmd "$command tracepoint $bpnum"
- }
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: get_actions - pops up the add trace dialog on a selected
-# tracepoint
-# ------------------------------------------------------------------
-itcl::body BpWin::get_actions {bpnum} {
- set bpnum $index_to_bpnum($bpnum)
- set bpinfo [gdb_get_tracepoint_info $bpnum]
- lassign $bpinfo file func line pc enabled pass_count \
- step_count thread hit_count actions
-
- set filename [::file tail $file]
- ManagedWin::open TraceDlg -File $filename -Lines $line
-}
-
-# ------------------------------------------------------------------
-# METHOD: toggle_threads - callback when show_threads is toggled
-# ------------------------------------------------------------------
-itcl::body BpWin::toggle_threads {} {
- set show_threads [pref get gdb/bp/show_threads]
- reconfig
-}
-
-# ------------------------------------------------------------------
-# METHOD: reconfig - used when preferences change
-# ------------------------------------------------------------------
-itcl::body BpWin::reconfig {} {
- if {[winfo exists $itk_interior.f]} { destroy $itk_interior.f }
- if {[winfo exists $itk_interior.m]} { destroy $itk_interior.m }
- if {[winfo exists $itk_interior.sbox]} { destroy $itk_interior.sbox }
- if {[winfo exists $itk_interior.sf]} { destroy $itk_interior.sf }
- if {[winfo exists $itk_interior.pop]} { destroy $itk_interior.pop }
- build_win
-}
-
-# ------------------------------------------------------------------
-# METHOD: goto_bp - show bp in source window
-# ------------------------------------------------------------------
-itcl::body BpWin::goto_bp {r} {
- set bpnum $index_to_bpnum($r)
- if {$tracepoints} {
- set bpinfo [gdb_get_tracepoint_info $bpnum]
- } else {
- set bpinfo [gdb_get_breakpoint_info $bpnum]
- }
- set pc [lindex $bpinfo 3]
-
- SrcWin::choose_and_display BROWSE_TAG [gdb_loc *$pc]
-}
diff --git a/gdb/gdbtk/library/bpwin.ith b/gdb/gdbtk/library/bpwin.ith
deleted file mode 100644
index fa005a65c62..00000000000
--- a/gdb/gdbtk/library/bpwin.ith
+++ /dev/null
@@ -1,59 +0,0 @@
-# Breakpoint window class definition for Insight
-# Copyright (C) 1997, 1998, 1999, 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class BpWin {
- inherit EmbeddedWin GDBWin
-
- public {
- variable tracepoints 0
-
- method constructor {args}
- method destructor {}
- method bp_select {r}
- method bp_able { i }
- method bp_remove { i }
- method bp_restore {}
- method bp_store {}
- method bp_type { i }
- method bp_all { command }
- method get_actions {bpnum}
- method toggle_threads {}
- method reconfig {}
- method goto_bp {r}
-
- # GDB Events
- method breakpoint {event}
- method tracepoint {event}
- }
-
- private {
- variable twin
- variable next_row 0
- variable index_to_bpnum
- variable Index_to_bptype
- variable temp
- variable mbar 1
- variable selected 0
- variable bg1
- variable Menu
- variable show_threads ;#cached copy of [pref get gdb/bp/show_threads]
-
- method build_win {}
- method bp_add {bp_event {tracepoint 0}}
- method bp_modify {bp_event {tracepoint 0}}
- method bp_delete {bp_event}
- method _select_and_popup {bp X Y}
- }
-
-}
diff --git a/gdb/gdbtk/library/browserwin.itb b/gdb/gdbtk/library/browserwin.itb
deleted file mode 100644
index d8f42db6faa..00000000000
--- a/gdb/gdbtk/library/browserwin.itb
+++ /dev/null
@@ -1,731 +0,0 @@
-# Browswer window for Insight.
-# Copyright (C) 1998, 1999, 2001, 2002, 2003 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements Browser window for Insight
-#
-# ----------------------------------------------------------------------
-
-option add *BrowserWin.textBackground $::Colors(textbg)
-
-# ------------------------------------------------------------------
-# CONSTRUCTOR - create new browser window
-# ------------------------------------------------------------------
-itcl::body BrowserWin::constructor {args} {
- debug
- #eval itk_initialize $args
- window_name "Function Browser"
-
- set _layout [pref get gdb/browser/layout]
- set Current(filename) {}
- set Current(function) {}
- _build_win
-
- eval itk_initialize $args
- add_hook file_changed_hook [code $this _fill_file_box]
-}
-
-# ------------------------------------------------------------------
-# DESTRUCTOR - destroy window containing widget
-# ------------------------------------------------------------------
-itcl::body BrowserWin::destructor {} {
- debug
- if {$filter_trace_after != ""} {
- after cancel $filter_trace_after
- }
-
- remove_hook file_changed_hook [code $this _fill_file_box]
- trace vdelete [pref varname gdb/search/last_symbol] \
- w [code $this _filter_trace_proc]
-}
-
-# ------------------------------------------------------------------
-# METHOD: _build_win - build the main browser window
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_build_win {} {
- debug
-
- # popup menu
- itk_component add popup {
- menu $itk_interior.pop -tearoff 0
- } {}
- set pop $itk_component(popup)
- $pop add command -label "Toggle Layout" -command [code $this _switch_layout]
- $pop add command -label "Help" -command "open_help browser.html"
- $pop add separator
- $pop add command -label "Close" -command "destroy [winfo toplevel $itk_interior]"
- bind [winfo toplevel $itk_interior] <3> "tk_popup $itk_component(popup) %X %Y"
-
- # Four Main Frames: filter, files, functions, and view (source)
- # Their layout depends on _layout
-
- if {$_layout == 1} {
- set p [cyg::panedwindow $itk_interior.p -orient vertical -height 5i \
- -width 5i]
- $p add left
- set p2 [cyg::panedwindow [$p childsite left].p]
-
- $p2 add file
- _build_file_frame [$p2 childsite file]
-
- $p2 add filter
- set f [frame [$p2 childsite filter].f]
- _build_filter_frame $f
- _build_function_frame $f
- pack $f -fill both -expand yes
- pack $p2 -fill both -expand yes
-
- $p add view
- _build_view_frame [$p childsite view]
-
- } else {
- set p [cyg::panedwindow $itk_interior.p -height 5i -width 5i]
- $p add top
- set f [frame [$p childsite top].f]
- _build_filter_frame $f
-
- set browser [cyg::panedwindow $f.p -orient vertical]
- $browser add file
- _build_file_frame [$browser childsite file]
- $browser add function
- _build_function_frame [$browser childsite function]
-
- pack $browser -fill both -expand yes
- pack $f -fill both -expand yes
-
- $p add view
- _build_view_frame [$p childsite view]
- }
-
- # Fill file box
- _fill_file_box
-
- pack $p -fill both -expand yes
-}
-
-# ------------------------------------------------------------------
-# METHOD: _filter_trace_proc
-# This is called when something is entered in the filter
-# box. The actual filtering is done in an after to avoid
-# flashing too much if the user is typing quickly.
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_filter_trace_proc {v1 v2 mode} {
- if {$filter_trace_after != ""} {
- after cancel $filter_trace_after
- }
- set filter_trace_after [after 100 [code $this _filter_trace_after]]
-}
-
-# ------------------------------------------------------------------
-# METHOD: _filter_trace_after
-# This is a wrapper around search, needed to pass to trace
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_filter_trace_after {} {
- set filter_trace_after ""
- search
-}
-
-# ------------------------------------------------------------------
-# METHOD: _search_src
-# Search for text or jump to a specific line
-# in source window, going in the specified DIRECTION.
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_search_src {direction} {
- set exp [$itk_component(view_search) get]
- $itk_component(view_src) search $exp $direction
-}
-
-# ------------------------------------------------------------------
-# METHOD: search
-# Search for functions matching regexp/pattern
-# in specified files
-# ------------------------------------------------------------------
-itcl::body BrowserWin::search {} {
-
- set files [$itk_component(file_box) getcurselection]
-
- if {[llength $files] == 0} {
- return
- }
-
- _freeze_me
-
- set filt_pat [format $filter_regexp($cur_filter_mode) \
- [pref get gdb/search/last_symbol]]
-
- if {[llength $files] == [$itk_component(file_box) size]} {
- set err [catch {gdb_search functions $filt_pat \
- -filename 1} matches]
- } else {
- set err [catch {gdb_search functions $filt_pat \
- -files $files -filename 1} matches]
- }
-
- if {$err} {
- debug "ERROR searching for [pref get gdb/search/last_symbol]: $matches"
- _thaw_me
- return
- }
-
- $itk_component(func_box) delete 0 end
-
- set i -1
- catch {unset index_to_file}
-
- foreach func [lsort -command "list_element_strcmp 0" $matches] {
- $itk_component(func_box) insert end [lindex $func 0]
- set index_to_file([incr i]) [lindex $func 1]
- }
- _thaw_me
-}
-
-# ------------------------------------------------------------------
-# METHOD: _process_file_selection
-# This fills the func combo, and the more window if it
-# is currently open with the hit in the File combobox.
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_process_file_selection {y} {
-
- set curIndex [$itk_component(file_box) nearest $y]
- set curSelection [$itk_component(file_box) curselection]
-
- # We got a button-release - First make sure the click selected the item...
-
- if {[lsearch $curIndex $curSelection] >= 0} {
- _fill_source [$itk_component(file_box) get $curIndex] 0
- } else {
- # If the item was deselected, go back to the first one in the list...
- # It would be better to keep a stack of the clicked items, and go to the
- # last one on the stack. But in extended mode, this is tricky. FIXME
-
- if {[llength $curSelection] > 0} {
- _fill_source [$itk_component(file_box) get [lindex $curSelection 0]] 0
- } else {
- _fill_source ""
- }
- }
-
- search
-}
-
-# ------------------------------------------------------------------
-# METHOD: _process_func_selection
-# This points the more window to the hit in the Func combobox
-# if it is currently open.
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_process_func_selection {y} {
-
- set curIndex [$itk_component(func_box) nearest $y]
- set curSelection [$itk_component(func_box) curselection]
-
- # We got a button-release - First make sure the click selected the item...
-
- if {[lsearch $curIndex $curSelection] >= 0} {
- set funcName [$itk_component(func_box) get $curIndex]
- set fileName $index_to_file($curIndex)
- _fill_source $funcName 1 $fileName
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: do_all_bp
-# Toggle a bp at every selected function in FuncLB
-# ------------------------------------------------------------------
-itcl::body BrowserWin::do_all_bp {onp} {
-
- set funcs [$itk_component(func_box) getcurselection]
- _freeze_me
-
- foreach f $funcs {
- if {[catch {gdb_loc $f} linespec]} {
- dbug W "Could not gdb_loc \"$f\""
- return
- }
- set bpnum [bp_exists $linespec]
- if {$bpnum == -1 && $onp} {
-
- # FIXME: gdb_set_bp is the preferred method, but it requires
- # a file and line number. This doesn't work very well for
- # templates...
- gdb_cmd "break $f"
- } elseif {!$onp} {
- catch {gdb_cmd "delete $bpnum"}
- }
- }
- _thaw_me
-}
-
-# ------------------------------------------------------------------
-# METHOD: _toggle_bp
-# Toggle bp at function specified by the given Y
-# coordinate in the listbox
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_toggle_bp {y} {
-
- set f [$itk_component(func_box) get [$itk_component(func_box) nearest $y]]
- if {$f != ""} {
- if {[catch {gdb_loc $f} linespec]} {
- return
- }
- set bpnum [bp_exists $linespec]
- if {$bpnum == -1} {
- # FIXME: gdb_set_bp is the preferred method, but it requires
- # a file and line number. This doesn't work very well for
- # templates...
- gdb_cmd "break $f"
- } else {
- catch {gdb_cmd "delete $bpnum"}
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _select
-# Un/Highlight all files in the files list
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_select {highlight} {
- if {$highlight} {
- $itk_component(file_box) selection set 0 end
- } else {
- $itk_component(file_box) selection clear 0 end
- }
- search
-}
-
-# ------------------------------------------------------------------
-# METHOD: _set_filter_mode
-# React to changes in the filter mode
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_set_filter_mode {w mode} {
- if {[string compare $mode $cur_filter_mode] != 0} {
- set cur_filter_mode $mode
- pref set gdb/search/filter_mode $mode
- search
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _file_hide_h
-# Run when the "Hide .h files" preference is chosen.
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_file_hide_h {} {
- _fill_file_box
- search
-}
-
-# ------------------------------------------------------------------
-# METHOD: _fill_source
-# Helper function to fill the srctextwin
-# when needed.
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_fill_source {f {funcp 1} {filename ""}} {
- if {($funcp && [string compare $f $Current(function)]) \
- || [string compare $f $Current(filename)]} {
- if {!$funcp} {
- if {$filename == ""} {
- set f $f:1
- } else {
- set f $f:$filename
- }
- }
-
- if {[catch {gdb_loc $f} linespec]} {
- return
- }
-
- lassign $linespec foo funcname name line addr pc_addr lib
- set file_changed [string compare $Current(filename) $name]
-
- if {$file_changed} {
- # Set the file name label:
- $itk_component(view_name) configure -text $name:
- _freeze_me
- }
-
- # fill srctextwin
- $itk_component(view_src) location BROWSE_TAG $name $funcname \
- $line $addr $pc_addr lib
-
- if {$file_changed} {
- _thaw_me
- }
-
- set Current(function) $funcname
- # fill func combo
- if {$file_changed} {
- set Current(filename) $name
- _fill_funcs_combo $name
- }
- # Set current function in combo box
- $itk_component(view_func) entryset $f
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: mode
-# Function called by srctextwin when the display
-# mode changes
-# ------------------------------------------------------------------
-itcl::body BrowserWin::mode {w {mode ""} {go 1}} {
- if {$mode != ""} {
- $itk_component(view_src) mode_set $mode $go
- $itk_component(view_mode) entryset $mode
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _goto_func
-# Callback for the function combo box which
-# sets the srctextwin looking at the given function (VAL)
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_goto_func {w {val ""}} {
- if {$val != ""} {
- set mang 0
- if {[info exists _mangled_func($val)]} {
- set mang $_mangled_func($val)
- }
- if {$mang} {
- set loc $val
- } else {
- set fn [lindex [::file split $Current(filename)] end]
- set loc $fn:$val
- }
- debug "GOTO \"$loc\""
- if {![catch {gdb_loc $loc} result]} {
- lassign $result foo funcname name line addr pc_addr lib
- $itk_component(view_src) location BROWSE_TAG $name $funcname \
- $line $addr $pc_addr lib
- } else {
- dbug W "gdb_loc returned \"$result\""
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _fill_file_box
-# This private method fills the file listbox
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_fill_file_box {} {
- # It would be cool if gdb_listfiles took a regexp to match,
- # but it doesn't...
-
- $itk_component(file_box) clear
- set allFiles [gdb_listfiles]
-
- if {[pref get gdb/browser/hide_h]} {
- foreach file $allFiles {
- if {[string compare [file extension $file] ".h"]} {
- $itk_component(file_box) insert end $file
- }
- }
- } else {
- foreach file $allFiles {
- $itk_component(file_box) insert end $file
- }
- }
- search
-}
-
-# ------------------------------------------------------------------
-# METHOD: _fill_funcs_combo
-# This private method fills the functions combo box
-# with all the functions in NAME.
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_fill_funcs_combo {name} {
-
- $itk_component(view_func) list delete 0 end
- if {$name != ""} {
- set maxlen 10
- if {[catch {gdb_listfuncs $name} listfuncs]} {
- tk_messageBox -icon error -default ok \
- -title "GDB" -type ok \
- -message "This file can not be found or does not contain\ndebugging information."
- return
- }
- foreach f [lsort $listfuncs] {
- lassign $f func mang
- if {$func == "global constructors keyed to main"} {continue}
- set _mangled_func($func) $mang
- $itk_component(view_func) list insert end $func
- if {[string length $func] > $maxlen} {
- set maxlen [string length $func]
- }
- }
- # limit size to 40 chars because if we don't set a reasonable limit
- # then the combobox can be wider than the screen
- if {$maxlen > 40} {set maxlen 40}
-
- $itk_component(view_func) configure -width [expr {$maxlen + 1}]
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _build_filter_frame
-# This private method builds the filter frame
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_build_filter_frame {parent} {
-
- itk_component add filter {
- iwidgets::labeledframe $parent.filter -labeltext "Function Filter" \
- -relief groove -borderwidth 2 -ipadx 6 -ipady 4
- }
-
- # Set up the contents of the Filter frame
- if {$_layout == 2} {
- itk_component add filt_label {
- label [$itk_component(filter) childsite].lbl -text "Show if function " \
- -font global/fixed
- }
- }
-
- itk_component add filt_type {
- combobox::combobox [$itk_component(filter) childsite].type -height 4 \
- -width 15 -editable 0 \
- -command [code $this _set_filter_mode] \
- -font global/fixed
- } {
- rename -background -textbackground textBackground Background
- }
-
- # Fill the filter mode combo-box
- foreach elem $filter_modes {
- $itk_component(filt_type) list insert end $elem
- }
-
- set cur_filter_mode [pref get gdb/search/filter_mode]
- if {[lsearch $filter_modes $cur_filter_mode] < 0} {
- set cur_filter_mode [lindex $filter_modes 0]
- }
- $itk_component(filt_type) entryset $cur_filter_mode
-
- itk_component add filt_entry {
- entry [$itk_component(filter) childsite].ent -font global/fixed \
- -textvariable [pref varname gdb/search/last_symbol]
- } {}
- bind_plain_key $itk_component(filt_entry) Return [list $this search]
-
- # Watch keystrokes into the entry box and filter on them...
- trace variable [pref varname gdb/search/last_symbol] w \
- [code $this _filter_trace_proc]
-
- if {$_layout == 2} {
- pack $itk_component(filt_label) -side left
- }
- pack $itk_component(filt_type) -side left -padx 4 -fill y -pady 5
- pack $itk_component(filt_entry) -side right -fill both -expand 1 \
- -padx 6 -pady 5
-
- pack $itk_component(filter) -fill x -anchor n -pady 3
-}
-
-# ------------------------------------------------------------------
-# METHOD: _build_file_frame
-# This private method builds the files frame
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_build_file_frame {parent} {
-
- # Labeled Frame
- itk_component add file_frame {
- iwidgets::labeledframe $parent.file -labeltext "Files" \
- -relief groove -borderwidth 2 -ipadx 6 -ipady 4
- }
-
- # Listbox with files
- itk_component add file_box {
- iwidgets::scrolledlistbox [$itk_component(file_frame) childsite].listbox \
- -selectmode extended -exportselection false \
- -hscrollmode dynamic -vscrollmode dynamic -foreground $::Colors(textfg) \
- -textbackground $::Colors(textbg)
- } {}
-
- bind [$itk_component(file_box) component listbox] <ButtonRelease-1> \
- [code $this _process_file_selection %y]
-
- itk_component add file_sep {
- frame [$itk_component(file_frame) childsite].sep -relief raised -height 2 \
- -borderwidth 1
- }
-
- itk_component add file_hide {
- checkbutton [$itk_component(file_frame) childsite].hide \
- -text "Hide .h files" \
- -variable [pref varname gdb/browser/hide_h] \
- -command [code $this _file_hide_h]
- }
-
- itk_component add file_all {
- button [$itk_component(file_frame) childsite].sel \
- -text "Select All" \
- -command [code $this _select 1]
- }
-
- # pack all the pieces
- grid $itk_component(file_box) -column 0 -row 0 -columnspan 2 \
- -sticky news
- grid $itk_component(file_sep) -column 0 -row 1 -columnspan 2 \
- -sticky ew -pady 8
- grid $itk_component(file_hide) -column 0 -row 2 -padx 5 -sticky w
- grid $itk_component(file_all) -column 1 -row 2 -padx 5 -sticky e
-
- grid columnconfigure [$itk_component(file_frame) childsite] 0 -weight 1
- grid rowconfigure [$itk_component(file_frame) childsite] 0 -weight 1
-
- # finally pack the main frame
- pack $itk_component(file_frame) -side left -fill both -expand yes
-}
-
-# ------------------------------------------------------------------
-# METHOD: _build_function_frame
-# This private method builds the functions frame
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_build_function_frame {parent} {
-
- # Labeled Frame
- itk_component add func_frame {
- iwidgets::labeledframe $parent.file -labeltext "Function" \
- -relief groove -borderwidth 2 -ipadx 6 -ipady 4
- }
-
- # Functions Listbox
- itk_component add func_box {
- iwidgets::scrolledlistbox [$itk_component(func_frame) childsite].listbox \
- -selectmode extended -hscrollmode dynamic -vscrollmode dynamic \
- -exportselection false -foreground $::Colors(textfg) \
- -textbackground $::Colors(textbg)
- } {}
-
- bind [$itk_component(func_box) component listbox] <ButtonRelease-1> \
- [code $this _process_func_selection %y]
- bind $itk_component(func_box) <3> [code $this _toggle_bp %y]
-
- itk_component add func_sep {
- frame [$itk_component(func_frame) childsite].sep -relief raised \
- -height 2 -borderwidth 1
- }
-
- itk_component add func_add_bp {
- button [$itk_component(func_frame) childsite].abp -text "Set BP" \
- -command [code $this do_all_bp 1]
- }
-
- itk_component add func_remove_bp {
- button [$itk_component(func_frame) childsite].rbp -text "Delete BP" \
- -command [code $this do_all_bp 0]
- }
-
- # pack all the pieces
- grid $itk_component(func_box) -column 0 -row 0 -columnspan 2 -sticky news
- grid $itk_component(func_sep) -row 1 -column 0 -columnspan 2 \
- -sticky ew -pady 8
- grid $itk_component(func_remove_bp) -row 2 -column 0 -padx 5 -sticky w
- grid $itk_component(func_add_bp) -row 2 -column 1 -padx 5 -sticky e
-
- grid columnconfigure [$itk_component(func_frame) childsite] 0 -weight 1
- grid rowconfigure [$itk_component(func_frame) childsite] 0 -weight 1
-
- # finally pack the main frame
- pack $itk_component(func_frame) -fill both -expand yes
-}
-
-# ------------------------------------------------------------------
-# METHOD: _build_view_frame
-# This private method builds the view frame
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_build_view_frame {parent} {
- itk_component add view {
- frame $parent.view
- }
-
- itk_component add view_src {
- SrcTextWin $itk_component(view).src -Tracing 0 \
- -parent $this -ignore_var_balloons 0
- } {
- rename -background -textbackground textBackground Background
- }
-
- itk_component add view_bottom {
- frame $itk_component(view).bottom
- }
-
- itk_component add view_name {
- label $itk_component(view).name -font global/fixed
- }
-
- itk_component add view_func {
- combobox::combobox $itk_component(view_bottom).combo -maxheight 15\
- -font global/fixed -command [code $this _goto_func]
- } {
- rename -background -textbackground textBackground Background
- }
-
- itk_component add view_mode {
- combobox::combobox $itk_component(view_bottom).mode -width 9 \
- -font global/fixed -command [code $this mode]
- } {
- rename -background -textbackground textBackground Background
- }
-
- itk_component add view_search {
- entry $itk_component(view_bottom).search -borderwidth 2 \
- -font global/fixed -width 10 -background $::Colors(textbg)
- } {}
-
- # Pack all the components of view into the frame:
- pack $itk_component(view_func) -side left -anchor w
- pack $itk_component(view_mode) -side left -padx 5
- pack $itk_component(view_search) -side right -padx 5 -expand 1 -anchor e
- pack $itk_component(view_name) -side top -fill x -padx 5 -pady 3
- pack $itk_component(view_bottom) -side bottom -fill x -pady 3 -padx 5
- pack $itk_component(view_src) -fill both -expand 1 -padx 5 -pady 3
-
- # Fill combo boxes
- $itk_component(view_mode) list insert end SOURCE
- $itk_component(view_mode) list insert end ASSEMBLY
- $itk_component(view_mode) list insert end MIXED
- # don't allow SRC+ASM mode... $itk_component(view_mode) insert end SRC+ASM
- $itk_component(view_mode) entryset [$itk_component(view_src) mode_get]
-
- # Key bindings
- bind_plain_key $itk_component(view_search) Return \
- [code $this _search_src forwards]
- bind_plain_key $itk_component(view_search) Shift-Return \
- [code $this _search_src backwards]
-
- pack $itk_component(view) -fill both -expand yes
-}
-
-# ------------------------------------------------------------------
-# METHOD: _switch_layout
-# Switch between different layouts
-#
-# ------------------------------------------------------------------
-itcl::body BrowserWin::_switch_layout {} {
- # only 2 right now, so toggle
- if {$_layout == 1} {
- set _layout 2
- } else {
- set _layout 1
- }
- pref set gdb/browser/layout $_layout
- destroy $itk_interior.p
- destroy $itk_component(popup)
- set Current(filename) {}
- set Current(function) {}
- if {$filter_trace_after != ""} {
- after cancel $filter_trace_after
- }
- trace vdelete [pref varname gdb/search/last_symbol] \
- w [code $this _filter_trace_proc]
- _build_win
-}
diff --git a/gdb/gdbtk/library/browserwin.ith b/gdb/gdbtk/library/browserwin.ith
deleted file mode 100644
index 8e36a70707f..00000000000
--- a/gdb/gdbtk/library/browserwin.ith
+++ /dev/null
@@ -1,77 +0,0 @@
-# Browser window class definition for Insight.
-# Copyright (C) 1998, 1999, 2003 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-itcl::class BrowserWin {
- inherit EmbeddedWin
-
- public {
- method constructor {args}
- method destructor {}
- method mode {w {mode ""} {go 1}}
- method search {}
- method test_get {var}
- method do_all_bp {onp}
-
- }
-
- private {
- method _build_win {}
- method _file_hide_h {}
- method _fill_file_box {}
- method _fill_funcs_combo {name}
- method _fill_source {f {funcp 1} {filename ""}}
- method _filter_trace_proc {v1 v2 mode}
- method _filter_trace_after {}
- method _goto_func {w {val ""}}
- method _process_file_selection {y}
- method _process_func_selection {y}
- method _search_src {direction}
- method _select {highlight}
- method _set_filter_mode {w mode}
- method _toggle_bp {y}
- method _build_filter_frame {parent}
- method _build_file_frame {parent}
- method _build_function_frame {parent}
- method _build_view_frame {parent}
- method _switch_layout
-
- variable cur_filter_mode
- variable Current;
- variable labelUpdateCode ""
- variable index_to_file
- variable _mangled_func
- variable filter_trace_after ""
- variable _layout
-
- common componentToRow
- array set componentToRow {
- filter 0
- browser 1
- view 2
- view_hidden 3
- }
-
- common filter_modes [list "starts with" \
- "contains" \
- "ends with" \
- "matches regexp"]
- common filter_regexp
- array set filter_regexp {
- "starts with" ^%s
- "contains" %s
- "ends with" %s$
- "matches regexp" %s
- }
- }
-}
-
diff --git a/gdb/gdbtk/library/console.itb b/gdb/gdbtk/library/console.itb
deleted file mode 100644
index 63a2baf44a1..00000000000
--- a/gdb/gdbtk/library/console.itb
+++ /dev/null
@@ -1,747 +0,0 @@
-# Console window for Insight
-# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::body Console::constructor {args} {
- global gdbtk_state
- window_name "Console Window"
-
- debug "$args"
- _build_win
- eval itk_initialize $args
- add_hook gdb_no_inferior_hook [list $this idle dummy]
-
- # There are a bunch of console prefs that have no UI
- # for the user to modify them. In the event that the user
- # really wants to change them, they will have to be modified
- # in prefs.tcl or by editing .gdbtkinit. When these prefs
- # gain a prefs UI, the user may change them dynamically
- # and the console window will need notification that they
- # have changed. Add them to the following list and
- # Console::_update_option.
- foreach option {gdb/console/wrap} {
- pref add_hook $option [code $this _update_option]
- }
-
- set gdbtk_state(console) $this
-}
-
-itcl::body Console::destructor {} {
- global gdbtk_state
- set gdbtk_state(console) ""
- remove_hook gdb_no_inferior_hook [list $this idle dummy]
-}
-
-itcl::body Console::_build_win {} {
- iwidgets::scrolledtext $itk_interior.stext \
- -vscrollmode dynamic -textbackground white
-
- set _twin [$itk_interior.stext component text]
-
- _set_wrap [pref get gdb/console/wrap]
-
- $_twin tag configure prompt_tag -foreground [pref get gdb/console/prompt_fg]
- $_twin tag configure err_tag -foreground [pref get gdb/console/error_fg]
- $_twin tag configure log_tag -foreground [pref get gdb/console/log_fg]
- $_twin tag configure target_tag -foreground [pref get gdb/console/target_fg]
- $_twin configure -font [pref get gdb/console/font] \
- -bg $::Colors(textbg) -fg $::Colors(textfg)
-
- #
- # bind editing keys for console window
- #
- bind $_twin <Return> "$this invoke; break"
- bind_plain_key $_twin Control-m "$this invoke; break"
- bind_plain_key $_twin Control-j "$this invoke; break"
-
- # History control.
- bind_plain_key $_twin Control-p "[code $this _previous]; break"
- bind $_twin <Up> "[code $this _previous]; break"
- bind_plain_key $_twin Control-n "[code $this _next]; break"
- bind $_twin <Down> "[code $this _next]; break"
- bind $_twin <Meta-less> "[code $this _first]; break"
- bind $_twin <Home> "[code $this _first]; break"
- bind $_twin <Meta-greater> "[code $this _last]; break"
- bind $_twin <End> "[code $this _last]; break"
- bind_plain_key $_twin Control-o "[code $this _operate_and_get_next]; break"
-
- # Tab completion
- bind_plain_key $_twin KeyPress-Tab "[code $this _complete]; break"
-
- # Don't let left arrow or ^B go over the prompt
- bind_plain_key $_twin Control-b {
- if {[%W compare insert <= {cmdmark + 1 char}]} {
- break
- }
- }
- bind $_twin <Left> [bind $_twin <Control-b>]
-
- # Don't let Control-h, Delete, or Backspace back up over the prompt.
- bind_plain_key $_twin Control-h "[code $this _delete]; break"
-
- bind $_twin <BackSpace> "[code $this _delete]; break"
-
- bind $_twin <Delete> "[code $this _delete 1]; break"
-
- # Control-a moves to start of line.
- bind_plain_key $_twin Control-a {
- %W mark set insert {cmdmark + 1 char}
- %W see {insert linestart}
- break
- }
-
- # Control-u deletes to start of line.
- bind_plain_key $_twin Control-u {
- %W delete {cmdmark + 1 char} insert
- %W see {insert linestart}
- }
-
- # Control-w deletes previous word.
- bind_plain_key $_twin Control-w {
- if {[%W compare {insert -1c wordstart} > cmdmark]} {
- %W delete {insert -1c wordstart} insert
- %W see insert
- }
- }
-
- bind $_twin <Control-Up> "[code $this _search_history]; break"
- bind $_twin <Shift-Up> "[code $this _search_history]; break"
- bind $_twin <Control-Down> "[code $this _rsearch_history]; break"
- bind $_twin <Shift-Down> "[code $this _rsearch_history]; break"
-
- # Don't allow key motion to move insertion point outside the command
- # area. This is done by fixing up the insertion point after any key
- # movement. We only need to do this after events we do not
- # explicitly override. Note that since the edit line is always the
- # last line, we can't possibly go past it, so we don't bother
- # checking that. Note also that we check for a binding which is
- # simply `;'; this lets us handle keys already bound via
- # bind_plain_key.
- foreach event [bind Text] {
- if {[string match *Key* $event]
- && ([bind $_twin $event] == ""
- || [bind $_twin $event] == ";")} {
- bind $_twin $event [bind Text $event]
- bind $_twin $event {+
- if {[%W compare insert <= {cmdmark + 1 char}]} {
- %W mark set insert {cmdmark + 1 char}
- }
- break
- }
- }
- }
-
- # Don't allow mouse to put cursor outside command line. For some
- # events we do this by noticing when the cursor is outside the
- # range, and then saving the insertion point. For others we notice
- # the saved insertion point.
- set pretag pre-$_twin
- bind $_twin <1> [format {
- if {[%%W compare [tk::TextClosestGap %%W %%x %%y] <= cmdmark]} {
- %s _insertion [%%W index insert]
- } else {
- %s _insertion {}
- }
- } $this $this]
- bind $_twin <B1-Motion> [format {
- if {[%s _insertion] != ""} {
- %%W mark set insert [%s _insertion]
- }
- } $this $this $this]
- # FIXME: has inside information.
- bind $_twin <ButtonRelease-1> [format {
- tk::CancelRepeat
- if {[%s _insertion] != ""} {
- %%W mark set insert [%s _insertion]
- }
- %s _insertion {}
- break
- } $this $this $this]
-
- # Don't allow inserting text outside the command line. FIXME:
- # requires inside information.
- # Also make it a little easier to paste by making the button
- # drags a little "fuzzy".
- bind $_twin <B2-Motion> {
- if {!$tk_strictMotif} {
- if {($tk::Priv(x) - 2 < %x < $tk::Priv(x) + 2) \
- || ($tk::Priv(y) - 2 < %y < $tk::Priv(y) + 2)} {
- set tk::Priv(mouseMoved) 1
- }
- if {$tk::Priv(mouseMoved)} {
- %W scan dragto %x %y
- }
- }
- break
- }
- bind $_twin <ButtonRelease-2> [format {
- if {!$tk::Priv(mouseMoved) || $tk_strictMotif} {
- %s
- break
- }
- } [code $this _paste 1]]
- bind $_twin <<Paste>> "[code $this _paste 0]; break"
- bind $_twin <<PasteSelection>> "[code $this _paste 0]; break"
- bind_plain_key $_twin Control-c "event generate $_twin <<Copy>>"
- bind_plain_key $_twin Control-v "[code $this _paste 1]; break"
-
- _setprompt
- pack $itk_interior.stext -expand yes -fill both
-
- focus $_twin
-
-}
-
-itcl::body Console::idle {event} {
- set _running 0
- $_top configure -cursor {}
-}
-
-# ------------------------------------------------------------------
-# METHOD: busy - busy event handler
-# ------------------------------------------------------------------
-itcl::body Console::busy {event} {
- set _running 1
- $_top configure -cursor watch
-}
-
-# ------------------------------------------------------------------
-# METHOD: insert - insert new text in the text widget
-# ------------------------------------------------------------------
-itcl::body Console::insert {line {tag ""}} {
- if {$_needNL} {
- $_twin insert {insert linestart} "\n"
- }
- # Remove all \r characters from line.
- set line [join [split $line \r] {}]
- $_twin insert {insert -1 line lineend} $line $tag
-
- set nlines [lindex [split [$_twin index end] .] 0]
- if {$nlines > $throttle} {
- set delta [expr {$nlines - $throttle}]
- $_twin delete 1.0 ${delta}.0
- }
-
- $_twin see insert
- set _needNL 0
- ::update idletasks
-}
-
-# ------------------------------------------------------------------
-# NAME: ConsoleWin::_operate_and_get_next
-# DESCRIPTION: Invokes the current command and, if this
-# command came from the history, arrange for
-# the next history command to be inserted once this
-# command is finished.
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body Console::_operate_and_get_next {} {
- if {$_histElement >= 0} {
- # _pendingHistElement will be used after the new history element
- # is pushed. So we must increment it.
- set _pendingHistElement [expr {$_histElement + 1}]
- }
- invoke
-}
-
-#-------------------------------------------------------------------
-# METHOD: _previous - recall the previous command
-# ------------------------------------------------------------------
-itcl::body Console::_previous {} {
- if {$_histElement == -1} {
- # Save partial command.
- set _partialCommand [$_twin get {cmdmark + 1 char} {cmdmark lineend}]
- }
- incr _histElement
- set text [lindex $_history $_histElement]
- if {$text == ""} {
- # No dice.
- incr _histElement -1
- # FIXME flash window.
- } else {
- $_twin delete {cmdmark + 1 char} {cmdmark lineend}
- $_twin insert {cmdmark + 1 char} $text
- }
-}
-
-#-------------------------------------------------------------------
-# METHOD: _search_history - search history for match
-# ------------------------------------------------------------------
-itcl::body Console::_search_history {} {
- set str [$_twin get {cmdmark + 1 char} {cmdmark lineend}]
-
- if {$_histElement == -1} {
- # Save partial command.
- set _partialCommand $str
- set ix [lsearch $_history ${str}*]
- } else {
- set str $_partialCommand
- set num [expr $_histElement + 1]
- set ix [lsearch [lrange $_history $num end] ${str}*]
- incr ix $num
- }
-
- set text [lindex $_history $ix]
- if {$text != ""} {
- set _histElement $ix
- $_twin delete {cmdmark + 1 char} {cmdmark lineend}
- $_twin insert {cmdmark + 1 char} $text
- }
-}
-
-#-------------------------------------------------------------------
-# METHOD: _rsearch_history - search history in reverse for match
-# ------------------------------------------------------------------
-itcl::body Console::_rsearch_history {} {
- if {$_histElement != -1} {
- set str $_partialCommand
- set num [expr $_histElement - 1]
- set ix $num
- while {$ix >= 0} {
- if {[string match ${str}* [lindex $_history $ix]]} {
- break
- }
- incr ix -1
- }
-
- set text ""
- if {$ix >= 0} {
- set text [lindex $_history $ix]
- set _histElement $ix
- } else {
- set text $_partialCommand
- set _histElement -1
- }
- $_twin delete {cmdmark + 1 char} {cmdmark lineend}
- $_twin insert {cmdmark + 1 char} $text
- }
-}
-
-#-------------------------------------------------------------------
-# METHOD: _next - recall the next command (scroll forward)
-# ------------------------------------------------------------------
-itcl::body Console::_next {} {
- if {$_histElement == -1} {
- # FIXME flash window.
- return
- }
- incr _histElement -1
- if {$_histElement == -1} {
- set text $_partialCommand
- } else {
- set text [lindex $_history $_histElement]
- }
- $_twin delete {cmdmark + 1 char} {cmdmark lineend}
- $_twin insert {cmdmark + 1 char} $text
-}
-
-#-------------------------------------------------------------------
-# METHOD: _last - get the last history element
-# ------------------------------------------------------------------
-itcl::body Console::_last {} {
- set _histElement 0
- _next
-}
-
-#-------------------------------------------------------------------
-# METHOD: _first - get the first (earliest) history element
-# ------------------------------------------------------------------
-itcl::body Console::_first {} {
- set _histElement [expr {[llength $_history] - 1}]
- _previous
-}
-
-
-
-#-------------------------------------------------------------------
-# METHOD: _setprompt - put a prompt at the beginning of a line
-# ------------------------------------------------------------------
-itcl::body Console::_setprompt {{prompt {}}} {
- if {$prompt == ""} {
- #set prompt [pref get gdb/console/prompt]
- set prompt [gdb_prompt]
- } elseif {$prompt == "none"} {
- set prompt ""
- }
-
- $_twin delete {insert linestart} {insert lineend}
- $_twin insert {insert linestart} $prompt prompt_tag
- $_twin mark set cmdmark "insert -1 char"
- $_twin see insert
-
- if {$_pendingHistElement >= 0} {
- set _histElement $_pendingHistElement
- set _pendingHistElement -1
- _next
- }
-}
-
-#-------------------------------------------------------------------
-# METHOD: gets - get a line of input from the console
-# ------------------------------------------------------------------
-itcl::body Console::gets {} {
- set _input_mode 1
-# _setprompt "(input) "
- _setprompt none
- $_twin delete insert end
- $_twin mark set cmdmark {insert -1 char}
-
- bind_plain_key $_twin Control-d "$this invoke 1; break"
- bind_plain_key $_twin Control-c "[code $this _cancel]; break"
-
- vwait [scope _input_result]
- set _input_mode 0
- bind_plain_key $_twin Control-c "event generate $_twin <<Copy>>"
- activate
- if {$_input_error} {
- set _input_error 0
- return -code error ""
- }
- return $_input_result
-}
-
-#-------------------------------------------------------------------
-# METHOD: cancel - cancel input when ^C is hit
-# ------------------------------------------------------------------
-itcl::body Console::_cancel {} {
- if {$_input_mode} {
- set _needNL 1
- $_twin mark set insert {insert lineend}
- $_twin insert {insert lineend} "^C\n"
- incr _invoking
- set _input_error 1
- set _input_result ""
- }
-}
-
-#-------------------------------------------------------------------
-# METHOD: activate - run this after a command is run
-# ------------------------------------------------------------------
-itcl::body Console::activate {{prompt {}}} {
- if {$_invoking > 0} {
- incr _invoking -1
- _setprompt $prompt
- }
-}
-
-#-------------------------------------------------------------------
-# METHOD: invoke - invoke a command
-# ------------------------------------------------------------------
-itcl::body Console::invoke {{controld 0}} {
- global gdbtk_state
-
- set text [$_twin get {cmdmark + 1 char} end ]
-
- if { "[string range $text 0 1]" == "tk" } {
- if {! [info complete $text] } {
- $_twin insert {insert lineend} " \\\n"
- $_twin see insert
- return
- }
- }
-
- incr _invoking
-
- set text [string trimright $text \n]
- if {$text == ""} {
- set text [lindex $_history 0]
- $_twin insert {insert lineend} $text
- }
- $_twin mark set insert {insert lineend}
- $_twin insert {insert lineend} "\n"
-
- set ok 0
- if {$_running} {
- if {[string index $text 0] == "!"} {
- set text [string range $text 1 end]
- set ok 1
- }
- }
-
- if {$_input_mode} {
- if {!$controld} {append text \n}
- set _input_result $text
- set _needNL 1
- return
- }
-
- # Only push new nonempty history items.
- if {$text != "" && [lindex $_history 0] != $text} {
- lvarpush _history $text
- }
-
- set index [$_twin index insert]
-
- # Clear current history element, and current partial element.
- set _histElement -1
- set _partialCommand ""
-
- # Need a newline before next insert.
- set _needNL 1
-
- # run command
- if {$gdbtk_state(readline)} {
- set gdbtk_state(readline_response) $text
- return
- }
-
- if {!$_running || $ok} {
- set result [catch {gdb_immediate "$text" 1} message]
- } else {
- set result 1
- set message "The debugger is busy."
- }
-
- # gdb_immediate may take a while to finish. Exit if
- # our window has gone away.
- if {![winfo exists $_twin]} { return }
-
- if {$result} {
- global errorInfo
- dbug W "Error: $errorInfo\n"
- $_twin insert end "Error: $message\n" err_tag
- } elseif {$message != ""} {
- $_twin insert $index "$message\n"
- }
-
- # Make the prompt visible again.
- activate
-
- # Make sure the insertion point is visible.
- $_twin see insert
-}
-
-#-------------------------------------------------------------------
-# PRIVATE METHOD: _delete - Handle a Delete of some sort.
-# ------------------------------------------------------------------
-itcl::body Console::_delete {{right 0}} {
-
- # If we are deleting to the right, and we have this turned off,
- # delete to the right.
-
- if {$right && ![pref get gdb/console/deleteLeft]} {
- set right 0
- }
-
- if {!$right} {
- set insert_valid [$_twin compare insert > {cmdmark + 1 char}]
- set delete_loc "insert-1c"
- } else {
- set insert_valid [$_twin compare insert > cmdmark]
- set delete_loc "insert"
- }
-
- # If there is a selection on the command line, delete it,
- # If there is a selection above the command line, do a
- # regular delete, but don't delete the prompt.
- # If there is no selection, do the delete.
-
- if {![catch {$_twin index sel.first}]} {
- if {[$_twin compare sel.first <= cmdmark]} {
- if {$insert_valid} {
- $_twin delete $delete_loc
- }
- } else {
- $_twin delete sel.first sel.last
- }
- } elseif {$insert_valid} {
- $_twin delete $delete_loc
- }
-}
-
-#-------------------------------------------------------------------
-# PRIVATE METHOD: _insertion - Set or get saved insertion point
-# ------------------------------------------------------------------
-itcl::body Console::_insertion {args} {
- if {! [llength $args]} {
- return $_saved_insertion
- } else {
- set _saved_insertion [lindex $args 0]
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _paste - paste the selection into the console window
-# ------------------------------------------------------------------
-itcl::body Console::_paste {{check_primary 1}} {
- set sel {}
-
- if {!$check_primary || [catch {selection get} sel] || $sel == ""} {
- if {[catch {selection get -selection CLIPBOARD} sel] || $sel == ""} {
- return
- }
- }
-
- #if there is a selection, insert over it:
- if {![catch {$_twin index sel.first}]
- && [$_twin compare sel.first > {cmdmark + 1 char}]} {
- set point [$_twin index sel.first]
- $_twin delete sel.first sel.last
- $_twin insert $point $sel
- } else {
- $_twin insert insert $sel
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _find_lcp - Return the longest common prefix in SLIST.
-# Can be empty string.
-# ------------------------------------------------------------------
-itcl::body Console::_find_lcp {slist} {
- # Handle trivial cases where list is empty or length 1
- if {[llength $slist] <= 1} {return [lindex $slist 0]}
-
- set prefix [lindex $slist 0]
- set prefixlast [expr [string length $prefix] - 1]
-
- foreach str [lrange $slist 1 end] {
- set test_str [string range $str 0 $prefixlast]
- while {[string compare $test_str $prefix] != 0} {
- incr prefixlast -1
- set prefix [string range $prefix 0 $prefixlast]
- set test_str [string range $str 0 $prefixlast]
- }
- if {$prefixlast < 0} break
- }
- return $prefix
-}
-
-# ------------------------------------------------------------------
-# METHOD: _find_completion - Look through COMPLETIONS to generate
-# the suffix needed to do command
-# ------------------------------------------------------------------
-itcl::body Console::_find_completion {cmd completions} {
- # Get longest common prefix
- set lcp [_find_lcp $completions]
- set cmd_len [string length $cmd]
- # Return suffix beyond end of cmd
- return [string range $lcp $cmd_len end]
-}
-
-# ------------------------------------------------------------------
-# METHOD: _complete - Command line completion
-# ------------------------------------------------------------------
-itcl::body Console::_complete {} {
-
- set command_line [$_twin get {cmdmark + 1 char} {cmdmark lineend}]
- set choices [gdb_cmd "complete $command_line" 1]
- set choices [string trimright $choices \n]
- set choices [split $choices \n]
-
- # Just do completion if this is the first tab
- if {!$_saw_tab} {
- set _saw_tab 1
- set completion [_find_completion $command_line $choices]
-
- # Here is where the completion is actually done. If there
- # is one match, complete the command and print a space.
- # If two or more matches, complete the command and beep.
- # If no match, just beep.
- switch [llength $choices] {
- 0 {}
- 1 {
- $_twin insert end "$completion "
- set _saw_tab 0
- return
- }
-
- default {
- $_twin insert end $completion
- }
- }
- bell
- $_twin see end
- bind $_twin <KeyPress> [code $this _reset_tab]
- } else {
- # User hit another consecutive tab. List the choices.
- # Note that at this point, choices may contain commands
- # with spaces. We have to lop off everything before (and
- # including) the last space so that the completion list
- # only shows the possibilities for the last token.
- set choices [lsort $choices]
- if {[regexp ".* " $command_line prefix]} {
- regsub -all $prefix $choices {} choices
- }
- if {[llength choices] != 0} {
- insert "\nCompletions:\n[join $choices \ ]\n"
- $_twin see end
- bind $_twin <KeyPress> [code $this _reset_tab]
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _reset_tab - Helper method for tab completion. Used
-# to reset the tab when a key is pressed.
-# ------------------------------------------------------------------
-itcl::body Console::_reset_tab {} {
- bind $_twin <KeyPress> {}
- set _saw_tab 0
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: _set_wrap - Set wrap mode
-# ------------------------------------------------------------------
-itcl::body Console::_set_wrap {wrap} {
- if { $wrap } {
- set hsm none
- set wv char
- } else {
- set hsm dynamic
- set wv none
- }
-
- $itk_interior.stext configure -hscrollmode $hsm
- $_twin configure -wrap $wv
-}
-
-# ------------------------------------------------------------------
-# METHOD: _update_option - Update in response to preference change
-# ------------------------------------------------------------------
-itcl::body Console::_update_option {name value} {
- switch -- $name {
- gdb/console/wrap {
- _set_wrap $value
- }
-
- gdb/console/prompt_fg {
- $_twin tag configure prompt_tag -foreground $value
- }
-
- gdb/console/error_fg {
- $_twin tag configure err_tag -foreground $value
- }
- }
-}
-
-# ------------------------------------------------------------------
-# NAME: public method Console::test
-# DESCRIPTION: Executes the given command
-#
-# ARGUMENTS: Command to run
-# RETURNS: Return value of command
-#
-# NOTES: This will only run if env(GDBTK_TEST_RUNNING)==1.
-# FOR TESTING ONLY
-# ------------------------------------------------------------------
-itcl::body Console::test {args} {
- global env
-
- if {[info exists env(GDBTK_TEST_RUNNING)] && $env(GDBTK_TEST_RUNNING) == 1} {
- return [eval $args]
- }
-}
-
diff --git a/gdb/gdbtk/library/console.ith b/gdb/gdbtk/library/console.ith
deleted file mode 100644
index bf834f3223e..00000000000
--- a/gdb/gdbtk/library/console.ith
+++ /dev/null
@@ -1,77 +0,0 @@
-# Console window class definition for GDBtk.
-# Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements a console display widget using primitive widgets as the building
-# blocks.
-# ----------------------------------------------------------------------
-
-itcl::class Console {
- inherit EmbeddedWin GDBEventHandler
-
- public {
- #Approximate maximum number of lines allowed in widget
- variable throttle 2000
-
- method constructor {args}
- method destructor {}
- method insert {line {tag ""}}
- method invoke {{controld 0}}
- method _insertion {args}
- method activate {{prompt {}}}
- method test {args}
- method gets {}
-
- #
- # GDB Events
- #
- method busy {event}
- method idle {event}
- }
-
- private {
- variable _twin
- variable _invoking 0
- variable _needNL 1
- variable _history {}
- variable _histElement -1
- variable _partialCommand ""
- variable _saved_insertion ""
- variable _running 0
- variable _saw_tab 0
- variable _pendingHistElement -1
- variable _input_mode 0
- variable _input_result ""
- variable _input_error 0
-
- method _build_win {}
- method _cancel {}
- method _complete {}
- method _delete {{left 0}}
- method _find_completion {cmd completions}
- method _find_lcp {slist}
- method _first {}
- method _last {}
- method _next {}
- method _operate_and_get_next {}
- method _paste {{check_primary 1}}
- method _previous {}
- method _reset_tab {}
- method _search_history {}
- method _rsearch_history {}
- method _setprompt {{prompt {}}}
- method _set_wrap {wrap}
- method _update_option {name value}
- }
-}
diff --git a/gdb/gdbtk/library/cspref.itb b/gdb/gdbtk/library/cspref.itb
deleted file mode 100644
index 551992c9f65..00000000000
--- a/gdb/gdbtk/library/cspref.itb
+++ /dev/null
@@ -1,152 +0,0 @@
-# Color Scheme preferences dialog for Insight.
-# Copyright (C) 2004 Red Hat
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ------------------------------------------------------------------
-# CONSTRUCTOR - create new source preferences window
-# ------------------------------------------------------------------
-itcl::body CSPref::constructor {args} {
- window_name "Color Scheme Preferences"
- _init_var
- _build_win
-}
-
-# ------------------------------------------------------------------
-# METHOD: init_var - initialize preference variables
-# ------------------------------------------------------------------
-itcl::body CSPref::_init_var {} {
- for {set i 0} {$i < 16} {incr i} {
- lappend vlist gdb/bg/$i
- }
-
- foreach var $vlist {
- set _saved($var) [pref get $var]
- set _new($var) $_saved($var)
- }
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: build_win - build the dialog
-# ------------------------------------------------------------------
-itcl::body CSPref::_build_win {} {
- frame $itk_interior.f
- frame $itk_interior.f.a
- frame $itk_interior.f.b
- set f $itk_interior.f.a
-
- # Description frame
- set d [labelframe $f.desc -text "Description"]
- label $d.txt -justify left -wraplength 6i -background $::Colors(textbg) \
- -text "There are many situations where multiple instances\
-of Insight may be running. Some examples are when debugging itself, when debugging\
-client and server programs, or multiprocessor systems. In these situations, it is easy\
-to get confused by the many different windows. Insight provides a simple way to have\
-all the windows belonging to a particular Insight instance use the same background color.\
-\n\nClick on a color below to edit it. This is a text background color. Other colors are\
-computed based on it."
- pack $d.txt -side top
- pack $f.desc -expand yes -fill both
-
- set w [labelframe $f.colors -text "Text Backgrounds"]
- for {set i 0} {$i < 16} {incr i} {
- set color $_new(gdb/bg/$i)
- button $w.$i -text [format "%X" $i] -activebackground $color -bg $color \
- -command [code $this _pick $color $w.$i $i]
- }
-
- grid $w.0 $w.1 $w.2 $w.3 $w.4 $w.5 $w.6 $w.7 -padx 10 -pady 10 -sticky we
- grid $w.8 $w.9 $w.10 $w.11 $w.12 $w.13 $w.14 $w.15 -padx 10 -pady 10 -sticky we
-
- pack $w -fill both -expand yes
- pack $f.colors -fill both -expand yes
-
- button $itk_interior.f.b.ok -text OK -width 7 -underline 0 -command [code $this _save]
- button $itk_interior.f.b.apply -text Apply -width 7 -underline 0 -command [code $this _apply]
- button $itk_interior.f.b.quit -text Cancel -width 7 -underline 0 -command [code $this _cancel]
- standard_button_box $itk_interior.f.b
- pack $itk_interior.f.a $itk_interior.f.b $itk_interior.f -expand yes -fill both -padx 5 -pady 5
-}
-
-# ------------------------------------------------------------------
-# METHOD: apply - apply changes
-# ------------------------------------------------------------------
-itcl::body CSPref::_apply {} {
- foreach var [array names _new] {
- if {$_new($var) != [pref get $var]} {
- pref set $var $_new($var)
- }
- }
- set_bg_colors
-}
-
-# ------------------------------------------------------------------
-# METHOD: _cancel
-# ------------------------------------------------------------------
-itcl::body CSPref::_cancel {} {
- set bg_changed 0
-
- if {[string compare [pref get gdb/bg/$::gdb_bg_num] $_saved(gdb/bg/$::gdb_bg_num)] != 0} {
- set bg_changed 1
- }
-
- foreach elem [array names _saved] {
- set cur_val [pref get $elem]
- if {[string compare $cur_val $_saved($elem)] != 0} {
- pref set $elem $_saved($elem)
- }
- }
-
- if {$bg_changed} {
- set_bg_colors
- } else {
- ManagedWin::restart
- }
- unpost
-}
-
-# ------------------------------------------------------------------
-# METHOD: save - apply changes and quit
-# ------------------------------------------------------------------
-itcl::body CSPref::_save {} {
- _apply
- unpost
-}
-
-# ------------------------------------------------------------------
-# METHOD: reconfig - called when windows are reconfigured
-# ------------------------------------------------------------------
-
-itcl::body CSPref::reconfig {} {
- # Unfortunately, r_setcolors recolors buttons if we do an Apply,
- # so fix them up here.
-
- for {set i 0} {$i < 10} {incr i} {
- set color $_new(gdb/bg/$i)
- $w.$i configure -activebackground $color -bg $color
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: pick - pick colors
-# ------------------------------------------------------------------
-itcl::body CSPref::_pick {color win num} {
- #debug "$color $win $num"
- set new_color [tk_chooseColor -initialcolor $color -title "Choose color"]
- if {$new_color != $color && $new_color != {}} {
- $win configure -activebackground $new_color -bg $new_color \
- -command [code $this _pick $new_color $w.${num}b $num]
- set _new(gdb/bg/$num) $new_color
- pref set gdb/bg/$num $new_color
- }
-}
diff --git a/gdb/gdbtk/library/cspref.ith b/gdb/gdbtk/library/cspref.ith
deleted file mode 100644
index 587fd2aa401..00000000000
--- a/gdb/gdbtk/library/cspref.ith
+++ /dev/null
@@ -1,36 +0,0 @@
-# Color Scheme preferences dialog class definition for GDBtk.
-# Copyright (C) 2004, Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class CSPref {
- inherit ManagedWin ModalDialog
-
- private {
- variable _saved ;# These are the saved values...
- variable _new ;# These are the changed values
- variable w
- method _apply {}
- method _build_win {}
- method _cancel {}
- method _init_var {}
- method _pick {color win num}
- method _save {}
- method _setcolors {}
- }
-
- public {
- method constructor {args}
- method reconfig {}
- }
-}
-
diff --git a/gdb/gdbtk/library/debugwin.itb b/gdb/gdbtk/library/debugwin.itb
deleted file mode 100644
index 623f044dafd..00000000000
--- a/gdb/gdbtk/library/debugwin.itb
+++ /dev/null
@@ -1,483 +0,0 @@
-# Debug window for GDBtk.
-# Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWin::constructor
-#
-# SYNOPSIS: constructor::args
-#
-# DESC: Creates the debug window
-#
-# ARGS: None are used yet.
-# -----------------------------------------------------------------------------
-itcl::body DebugWin::constructor {args} {
- debug $args
- window_name "Insight Debug" "Debug"
-
- build_win
-}
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWin::destructor
-#
-# SYNOPSIS: Not called by hand
-#
-# DESC: Destroys the debug window
-#
-# ARGS: None
-# -----------------------------------------------------------------------------
-itcl::body DebugWin::destructor {} {
- # notify debug code that window is going away
- ::debug::debugwin ""
-}
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWin::reconfig
-#
-# SYNOPSIS: Reconfigure callback
-#
-# DESC: Fixes up window colors
-#
-# ARGS: None
-# -----------------------------------------------------------------------------
-itcl::body DebugWin::reconfig {} {
- # This keeps the Debug window using its unique black background.
- # Otherwise, a reconfigure event will color it to match the other windows
- $itk_interior.s configure -textbackground black
-}
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWin::build_win
-#
-# SYNOPSIS: build_win
-#
-# DESC: Creates the Debug Window. Reads the contents of the debug log
-# file, if it exists. Notifies the debug functions in ::debug
-# to send output here.
-# -----------------------------------------------------------------------------
-itcl::body DebugWin::build_win {} {
- global gdb_ImageDir GDBTK_LIBRARY
-
- set top [winfo toplevel $itk_interior]
-
- # initialize the gdbtk_de array
- if {![info exists ::gdbtk_de]} {
- set ::gdbtk_de(ALL) 1
- set ::gdbtk_de(ERRORS_ONLY) 0
- set ::gdbtk_de(others) 0
- set ::gdbtk_de(filter_var) ALL
- }
-
- # create menubar
- set menu [menu $itk_interior.m -tearoff 0]
- $menu add cascade -menu $menu.file -label "File" -underline 0
- set m [menu $menu.file]
- $m add command -label "Clear" -underline 1 \
- -command [code $this _clear]
- $m add command -label "Mark Old" -underline 1 \
- -command [code $this _mark_old]
- $m add separator
- $m add command -label "Save" -underline 0 \
- -command [code $this _save_contents]
- $m add separator
- $m add command -label "Close" -underline 0 \
- -command "::debug::debugwin {};delete object $this"
- $menu add cascade -menu $menu.trace -label "Trace"
- set m [menu $menu.trace]
- $m add radiobutton -label Start -variable ::debug::tracing -value 1
- $m add radiobutton -label Stop -variable ::debug::tracing -value 0
- $menu add cascade -menu $menu.rs -label "ReSource"
- set m [menu $menu.rs]
- foreach f [lsort [glob [file join $GDBTK_LIBRARY *.itb]]] {
- $m add command -label "Source [file tail $f]"\
- -command [list source $f]
- }
- $m add separator
- $m add command -label "Source ALL" -command [code $this _source_all]
-
- $menu add cascade -menu $menu.opt -label "Options"
- set m [menu $menu.opt]
- $m add command -label "Display" -underline 0 \
- -command [list ManagedWin::open DebugWinDOpts -over $this]
- if {!$::debug::initialized} {
- $menu entryconfigure 1 -state disabled
- $menu add cascade -label " Tracing Not Initialized" -foreground red \
- -activeforeground red
- }
- $menu add cascade -menu $menu.help -label "Help" -underline 0
- set m [menu $menu.help]
- $m add command -label "Debugging Functions" -underline 0 \
- -command {open_help debug.html}
-
- $top configure -menu $menu
-
- iwidgets::scrolledtext $itk_interior.s -hscrollmode static \
- -vscrollmode static -wrap none -textbackground black -foreground white
- set _t [$itk_interior.s component text]
- pack $itk_interior.s -expand 1 -fill both
-
- # define tags
- foreach color $_colors {
- $_t tag configure [lindex $color 0] -foreground [lindex $color 1]
- }
- $_t tag configure trace -foreground gray
- $_t tag configure args -foreground blue
- $_t tag configure marked -background grey20
-
- loadlog
-
- # now notify the debug functions to use this window
- ::debug::debugwin $this
-
- # override the window delete procedure so the messages are
- # turned off first.
- wm protocol $top WM_DELETE_WINDOW "::debug::debugwin {};destroy $top"
-}
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWin::puts
-#
-# SYNOPSIS: puts {level cls func msg}
-#
-# DESC: Writes debugging information into the DebugWin. A filter
-# will be applied to determine if the message should be
-# displayed or not.
-#
-# ARGS: level - priority level. See debug::dbug for details.
-# cls - class name of caller, for example "SrcWin"
-# func - function name of caller
-# msg - message to display
-# -----------------------------------------------------------------------------
-itcl::body DebugWin::puts {level cls func msg} {
- # filter. check if we should display this message
- # for now we always let high-level messages through
- if {$level == "I"} {
-
- # errors and warnings only
- if {$::gdbtk_de(ERRORS_ONLY)} { return }
-
- # ALL classes except those set
- if {$::gdbtk_de(ALL)} {
- if {[info exists ::gdbtk_de($cls)]} {
- if {$::gdbtk_de($cls)} {
- return
- }
- } elseif {$::gdbtk_de(others)} {
- return
- }
- }
-
- # ONLY the classes set
- if {!$::gdbtk_de(ALL)} {
- if {[info exists ::gdbtk_de($cls)]} {
- if {!$::gdbtk_de($cls)} {
- return
- }
- } elseif {!$::gdbtk_de(others)} {
- return
- }
- }
- }
-
- if {$func != ""} {
- append cls ::$func
- }
- $_t insert end "($cls) " {} "$msg\n" $level
- $_t see insert
-}
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWin::put_trace
-#
-# SYNOPSIS: put_trace {enter level func ar}
-#
-# DESC: Writes trace information into the DebugWin. A filter
-# will be applied to determine if the message should be
-# displayed or not.
-#
-# ARGS: enter - 1 if this is a function entry, 0 otherwise.
-# level - stack level
-# func - function name
-# ar - function arguments
-# -----------------------------------------------------------------------------
-itcl::body DebugWin::put_trace {enter level func ar} {
- set x [expr {$level * 2 - 2}]
- if {$enter} {
- $_t insert end "[string range $_bigstr 0 $x]$func " trace "$ar\n" args
- } else {
- $_t insert end "[string range $_bigstr 0 $x]<- $func " trace "$ar\n" args
- }
- $_t see insert
-}
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWin::loadlog
-#
-# SYNOPSIS: loadlog
-#
-# DESC: Reads the contents of the debug log file, if it exists, into
-# the DebugWin.
-# -----------------------------------------------------------------------------
-itcl::body DebugWin::loadlog {} {
- $_t delete 0.0 end
- # Now load in log file, if possible.
- # this is rather rude, using the logfile variable in the debug namespace
- if {$::debug::logfile != "" && $::debug::logfile != "stdout"} {
- flush $::debug::logfile
- seek $::debug::logfile 0 start
- while {[gets $::debug::logfile line] >= 0} {
- while {[catch {set f [lindex $line 0]} f]} {
- # If the lindex failed its because the remainder of the
- # list is on the next line. Get it.
- if {[gets $::debug::logfile line2] < 0} {
- break
- }
- append line \n $line2
- }
- if {$f == "T"} {
- put_trace [lindex $line 1] [lindex $line 2] [lindex $line 3] \
- [lindex $line 4]
- } else {
- puts $f [lindex $line 1] [lindex $line 2] [lindex $line 3]
- }
- }
- }
-}
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWin::_source_all
-#
-# SYNOPSIS: _source_all
-#
-# DESC: Re-sources all the .itb files.
-# -----------------------------------------------------------------------------
-itcl::body DebugWin::_source_all {} {
- foreach f [glob [file join $::GDBTK_LIBRARY *.itb]] {
- source $f
- }
-}
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWin::_clear
-#
-# SYNOPSIS: _clear
-#
-# DESC: Clears out the content of the debug window.
-# -----------------------------------------------------------------------------
-itcl::body DebugWin::_clear {} {
- $_t delete 1.0 end
-}
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWin::_mark_old
-#
-# SYNOPSIS: _mark_old
-#
-# DESC: Changes the background of the current contents of the window.
-# -----------------------------------------------------------------------------
-itcl::body DebugWin::_mark_old {} {
- $_t tag add marked 1.0 "end - 1c"
-}
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWin::_save_contents
-#
-# SYNOPSIS: _save_contents
-#
-# DESC: Changes the background of the current contents of the window.
-# -----------------------------------------------------------------------------
-itcl::body DebugWin::_save_contents {} {
- set file [tk_getSaveFile -title "Choose debug window dump file" \
- -parent [winfo toplevel $itk_interior]]
- if {$file == ""} {
- return
- }
-
- if {[catch {::open $file w} fileH]} {
- tk_messageBox -type ok -icon error -message \
- "Can't open file: \"$file\". \n\nThe error was:\n\n\"$fileH\""
- return
- }
- ::puts $fileH [$_t get 1.0 end]
-
-}
-
-###############################################################################
-# -----------------------------------------------------------------------------
-# NAME: DebugWinDOpts::constructor
-#
-# SYNOPSIS: constructor
-#
-# DESC: Creates the Debug Window Options Dialog.
-# -----------------------------------------------------------------------------
-itcl::body DebugWinDOpts::constructor {args} {
- window_name "Debug Window Options"
- build_win
- eval itk_initialize $args
-}
-
-###############################################################################
-# -----------------------------------------------------------------------------
-# NAME: DebugWinDOpts::destructor
-#
-# SYNOPSIS: Not called by hand
-#
-# DESC: Destroys the Debug Window Options Dialog.
-# -----------------------------------------------------------------------------
-itcl::body DebugWinDOpts::destructor {} {
-}
-
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWinDOpts::build_win
-#
-# SYNOPSIS: build_win
-#
-# DESC: Creates the Debug Window Options Dialog. This dialog allows the
-# user to select which information is displayed in the debug
-# window and (eventually) how it looks.
-# -----------------------------------------------------------------------------
-itcl::body DebugWinDOpts::build_win {} {
- wm title [winfo toplevel $itk_interior] "Debug Display Options"
- # initialize here so we can resource this file and update the list
- set _classes {DebugWin RegWin SrcBar SrcWin ToolBar WatchWin EmbeddedWin \
- ManagedWin GDBWin StackWin SrcTextWin global \
- BpWin TargetSelection ModalDialog ProcessWin \
- GDBEventHandler MemWin VarTree}
- set _classes [concat [lsort $_classes] others]
-
- set f [frame $itk_interior.f]
- set btns [frame $itk_interior.buttons]
-
- iwidgets::Labeledframe $f.display -labelpos nw -labeltext {Classes}
- set fr [$f.display childsite]
- radiobutton $fr.0 -text "Messages from ALL classes EXCEPT those selected below" \
- -variable ::gdbtk_de(filter_var) -value ALL -command [code $this _all]
- radiobutton $fr.1 -text "Messages from ONLY those classes selected below" \
- -variable ::gdbtk_de(filter_var) -value ONLY -command [code $this _all]
- radiobutton $fr.2 -text "Only WARNINGS and ERRORS" \
- -variable ::gdbtk_de(filter_var) -value ERRORS -command [code $this _all]
-
- grid $fr.0 -sticky w -padx 5 -pady 5
- grid $fr.1 -sticky w -padx 5 -pady 5
- grid $fr.2 -sticky w -padx 5 -pady 5
-
- iwidgets::Labeledframe $f.classes
- set fr [$f.classes childsite]
-
- set i 0
- foreach cls $_classes {
- if {![info exists ::gdbtk_de($cls)]} {
- set ::gdbtk_de($cls) 0
- }
- checkbutton $fr.$i -text $cls -variable ::gdbtk_de($cls)
- incr i
- }
-
- set k [expr 3*(int($i/3))]
- set more [expr $i - $k]
- set j 0
- while {$j < $k} {
- grid $fr.$j $fr.[expr $j+1] $fr.[expr $j+2] -sticky w -padx 5 -pady 5
- incr j 3
- }
- switch $more {
- 1 { grid $fr.$j x x -sticky w -padx 5 -pady 5}
- 2 { grid $fr.$j $fr.[expr $j+1] x -sticky w -padx 5 -pady 5}
- }
-
- pack $f.display -side top -expand 1 -fill both
- pack $f.classes -side top -expand 1 -fill both
-
- button $btns.ok -text [gettext OK] -width 7 -command [code $this _apply 1] \
- -default active
- button $btns.apply -text "Apply to All" -width 7 \
- -command [code $this _apply 0]
- if {$::debug::logfile == "" || $::debug::logfile == "stdout"} {
- $btns.apply configure -state disabled
- }
- button $btns.help -text [gettext Help] -width 10 -command [code $this help] \
- -state disabled
- standard_button_box $btns
- bind $btns.ok <Return> "$btns.ok flash; $btns.ok invoke"
- bind $btns.apply <Return> "$btns.apply flash; $btns.apply invoke"
- bind $btns.help <Return> "$btns.help flash; $btns.help invoke"
-
- pack $btns $f -side bottom -expand 1 -fill both -anchor e
- focus $btns.ok
-}
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWinDOpts::_all
-#
-# SYNOPSIS: _all
-#
-# DESC: Callback for selecting ALL classes. If the user selects ALL,
-# deselect all the individual class checkbuttons.
-# -----------------------------------------------------------------------------
-itcl::body DebugWinDOpts::_all {} {
- switch $::gdbtk_de(filter_var) {
- ALL {
- set ::gdbtk_de(ALL) 1
- set ::gdbtk_de(ERRORS_ONLY) 0
- #enable class buttons
- set num 0
- foreach class $_classes {
- [$itk_interior.f.classes childsite].$num configure -state normal
- incr num
- }
- }
- ONLY {
- set ::gdbtk_de(ALL) 0
- set ::gdbtk_de(ERRORS_ONLY) 0
- #enable class buttons
- set num 0
- foreach class $_classes {
- [$itk_interior.f.classes childsite].$num configure -state normal
- incr num
- }
- }
- ERRORS {
- set ::gdbtk_de(ALL) 0
- set ::gdbtk_de(ERRORS_ONLY) 1
- # disable class buttons
- set num 0
- foreach class $_classes {
- [$itk_interior.f.classes childsite].$num configure -state disabled
- incr num
- }
- }
- }
-}
-
-
-# -----------------------------------------------------------------------------
-# NAME: DebugWinDOpts::_apply
-#
-# SYNOPSIS: _apply
-#
-# DESC: Callback for the "Apply" button. Loads the contents of the
-# log file through the new filter into the debug window. The
-# button is disabled if there is no log file.
-# -----------------------------------------------------------------------------
-itcl::body DebugWinDOpts::_apply { done } {
- set dw [ManagedWin::find DebugWin]
- debug $dw
- if {$dw != ""} {
- $dw loadlog
- }
- if {$done} {
- delete object $this
- }
-}
diff --git a/gdb/gdbtk/library/debugwin.ith b/gdb/gdbtk/library/debugwin.ith
deleted file mode 100644
index b6a961d6c5b..00000000000
--- a/gdb/gdbtk/library/debugwin.ith
+++ /dev/null
@@ -1,93 +0,0 @@
-# Debug window class definition for GDBtk.
-# Copyright (C) 1998, 1999 Cygnus Solutions
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# -----------------------------------------------------------------------------
-# NAME:
-# class DebugWin
-#
-# DESC:
-# This class implements a debug output window to display internal
-# debugging information. It can handle debugging messages, tracing,
-# and eventually profiling.
-#
-# NOTES:
-# This window is for developers.
-#
-# -----------------------------------------------------------------------------
-itcl::class DebugWin {
- inherit ManagedWin
-
- private {
- variable _t
- variable _colors {
- {I green}
- {W yellow}
- {E orange}
- {X red}
- }
- variable _bigstr " "
- method build_win {}
- method _source_all {}
- method _clear {}
- method _mark_old {}
- method _save_contents {}
- method reconfig {}
- }
-
- protected {
- method _ignore_on_save {} { return 1 }
- }
-
- public {
- method constructor {args}
- method destructor {}
- method puts {level cls func msg}
- method put_trace {enter level func ar}
- method loadlog {}
- }
-}
-
-# -----------------------------------------------------------------------------
-# NAME:
-# class DebugWinDOpts
-#
-# DESC:
-# This class implements a debug options dialog for the DebugWin.
-# Currently this consists os a selection dialog to choose which
-# messages to print. Eventually it could also include a filter
-# for different priorities and color selections.
-#
-# NOTES:
-# This window is for developers.
-#
-# -----------------------------------------------------------------------------
-itcl::class DebugWinDOpts {
- inherit ManagedWin
-
- public {
- method constructor {args} {}
- method destructor {}
- }
-
- protected {
- method _ignore_on_save { return 1 }
- }
-
- private {
- variable _classes
- method build_win {}
- method _all {}
- method _apply {done}
- }
-}
diff --git a/gdb/gdbtk/library/download.itb b/gdb/gdbtk/library/download.itb
deleted file mode 100644
index f20aecf07f3..00000000000
--- a/gdb/gdbtk/library/download.itb
+++ /dev/null
@@ -1,303 +0,0 @@
-# Download class implementation for Insight.
-# Copyright (C) 1999, 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Download window and associated procs
-#
-# ----------------------------------------------------------------------
-
-itcl::body Download::constructor {args} {
- global gdb_pretty_name
- debug $args
- eval itk_initialize $args
- window_name "Download Status" "Download"
- add_hook download_progress_hook "$this update_download"
-
- label $itk_interior.dload -text "Downloading $filename to $gdb_pretty_name"
-
- label $itk_interior.stat
- set f [frame $itk_interior.f]
-
- set i 0
- while {$i <$num_sections} {
- iwidgets::feedback $f.meter$i -steps $num_steps
- grid forget [$f.meter$i component percentage]
- label $f.sec$i -text [lindex $section(names) $i] -anchor w
- label $f.num$i -text $bytes($i) -anchor e
- grid $f.sec$i $f.meter$i $f.num$i -padx 4 -pady 4 -sticky news
- incr i
- }
- grid columnconfigure $f 1 -weight 1
-
- button $itk_interior.cancel -text Cancel -command "$this cancel" \
- -state active -width 10
-
- pack $itk_interior.dload -padx 5 -pady 5 -side top -fill x -expand yes
- pack $itk_interior.stat -padx 5 -pady 5 -expand yes
- pack $itk_interior.f -padx 5 -pady 5 -fill x -expand yes
-
- pack $itk_interior.cancel -padx 5 -pady 5 -side bottom
- ::update idletasks
-}
-
-# ------------------------------------------------------------------
-# METHOD: update_download - update the download meters
-# ------------------------------------------------------------------
-itcl::body Download::update_download { sec num tot } {
-
- # Loop through all the sections, marking each as either done or
- # updating its meter. This will mark all previous sections prior to
- # SEC as complete.
- foreach s $section(names) {
- set i $section($s)
-
- if {$s == $sec} {
- # Advance feedback meter. The iwidgets meter leaves a lot to
- # be desired. No way to query the current setting. No way to
- # set the state of the meter by percentage. It only understands
- # steps, and we must be careful not to step the widget past the
- # the configured number of steps, or else the meter will be
- # set wrong. How lame.
- set steps [expr {$num / $bytes($i) * $num_steps}]
- if {[expr {$completed_steps($s) + $steps}] > $num_steps} {
- set steps [expr {$num_steps - $completed_steps($s)}]
- }
- incr completed_steps($s) $steps
- $itk_interior.f.meter$i step $steps
- break
- } else {
- # Section already loaded. Make sure meter is at 100%.
- if {$completed_steps($s) < $num_steps} {
- set steps [expr {$num_steps - $completed_steps($s)}]
- set completed_steps($s) $num_steps
- $itk_interior.f.meter$i step $steps
- }
- }
- }
-
- ::update
-}
-
-# ------------------------------------------------------------------
-# METHOD: done - notification that the download is really complete
-# ------------------------------------------------------------------
-itcl::body Download::done { {msg ""} } {
- bell
-
- if {$msg == ""} {
- # download finished
- set secs [expr {[clock seconds] - $::download_start_time}]
- if {$secs == 0} { incr secs }
- $itk_interior.cancel config -state disabled
- set bps [expr {8 * $total_bytes / $secs / 1000}]
- $itk_interior.stat config -text "$total_bytes bytes in $secs seconds ($bps kbps)"
-
- # set all indicators to FULL
- foreach sec $section(names) {
- set i $section($sec)
- if {$completed_steps($sec) < $num_steps} {
- set steps [expr {$num_steps - $completed_steps($sec)}]
- set completed_steps($sec) $num_steps
- $itk_interior.f.meter$i step $steps
- }
- }
- } else {
- # download failed
- if {$msg != "CANCEL"} {
- $itk_interior.stat config -text $msg
- }
- }
-
- # enable OK button
- $itk_interior.cancel config -state active -text OK -command "delete object $this"
- ::update
-}
-
-# ------------------------------------------------------------------
-# METHOD: cancel - cancel the download
-# ------------------------------------------------------------------
-itcl::body Download::cancel {} {
- debug "canceling the download"
- set ::download_cancel_ok 1
-}
-
-# ------------------------------------------------------------------
-# DESTRUCTOR - destroy window containing widget
-# ------------------------------------------------------------------
-itcl::body Download::destructor {} {
- remove_hook download_progress_hook "$this update_download"
-}
-
-itcl::body Download::do_download_hooks {} {
- set ::download_timer(ok) 1
-}
-
-itcl::body Download::download_hash { section num } {
- global download_timer
- debug "sec=$section num=$num tot=$total_bytes ok=$::download_cancel_ok"
- ::update
- # Only run the timer at discrete times...
- if {[info exists download_timer(timer)]} {
- after cancel $download_timer(timer)
- }
-
- set download_timer(timer) [after 100 Download::do_download_hooks]
- if {![info exists download_timer(ok)] || $download_timer(ok)} {
- run_hooks download_progress_hook $section $num $total_bytes
- ::update
- unset download_timer(timer)
- set download_timer(ok) 0
- }
-
- return $::download_cancel_ok
-}
-
-# Download the executable. Return zero for success, and non-zero for error.
-itcl::body Download::download_it { } {
- global gdb_exe_name gdb_downloading gdb_loaded
- global gdb_target_name gdb_pretty_name
- global gdb_running gdbtk_platform
-
- debug "exe=$gdb_exe_name downloading=$gdb_downloading"
- debug " loaded=$gdb_loaded target=$gdb_target_name running=$gdb_running"
-
- if {$gdb_downloading || $gdb_exe_name == ""} {
- return 0
- }
-
- set gdb_downloading 1
- set gdb_loaded 0
- # Make sure the source window has had time to be created
- ::update
-
- gdbtk_busy
-
- # Only places that load files should do set_exe
- #set_exe
- switch [set_target] {
- ERROR {
- # target command failed
- set gdb_downloading 0
- gdbtk_idle
- return 0
- }
- CANCELED {
- # command cancelled by user
- set gdb_downloading 0
- if {$gdb_running} {
- # Run the idle hooks (free the UI)
- gdbtk_update
- gdbtk_idle
- } else {
- gdbtk_idle
- }
- return 1
- }
- }
-
- if {[string compare $gdbtk_platform(os) "cygwin"] == 0} {
- set f [ide_cygwin_path to_win32 $gdb_exe_name]
- } else {
- set f $gdb_exe_name
- }
- if {! [file exists $f]} {
- tk_messageBox -icon error -title GDB -type ok \
- -message "Request to download non-existent executable $gdb_exe_name"
- set gdb_downloading 0
- gdbtk_idle
- return 0
- }
-
- debug "downloading $gdb_exe_name"
-
- set target $gdb_target_name
-
- # get load info and total up number of bytes
- if {[catch {gdb_load_info $gdb_exe_name} val]} {
- set result "$gdb_exe_name: $val"
- tk_dialog .load_warn "" "$result" error 0 Ok
- return 0
- }
- set i 0
- set total_bytes 0
- set section(names) {}
- foreach x $val {
- set s [lindex $x 0]
- lappend section(names) $s
- set section($s) $i
- set b [lindex $x 1]
- set bytes($i) [expr {double($b)}]
- incr total_bytes $b
- set completed_steps($s) 0
- incr i
- }
- set num_sections $i
-
- set ::download_cancel_ok 0
- set ::download_start_time [clock seconds]
-
- if {[pref getd gdb/load/$target-verbose] == "1"} {
- # open a detailed download dialog window
- set download_dialog [ManagedWin::open Download -transient -filename $gdb_exe_name]
- } else {
- # raise source windows
- foreach src [ManagedWin::find SrcWin] {
- $src reveal
- $src toolbar downloading
- }
- set download_dialog ""
- }
-
- set download_error ""
- debug "starting load"
- ::update idletasks
- if {[catch {gdb_cmd "load $gdb_exe_name"} errTxt]} {
- debug "load returned $errTxt"
- if {[regexp -nocase cancel $errTxt]} {
- set download_error "CANCEL"
- } else {
- set download_error $errTxt
- }
- set ::download_cancel_ok 1
- }
-
- debug "Done loading"
-
- set gdb_downloading 0
- if {$::download_cancel_ok} {
- set gdb_loaded 0
- if {$download_dialog != ""} {
- catch {$download_dialog done $download_error}
- }
- } else {
- set gdb_loaded 1
- if {$download_dialog != ""} {
- catch {$download_dialog done}
- }
- }
-
- foreach src [ManagedWin::find SrcWin] {
- if {$download_error == "CANCEL"} {
- $src download_progress CANCEL 1 1
- } else {
- $src download_progress DONE 0 $total_bytes $download_error
- }
- }
-
- set ::download_cancel_ok 0
- set download_dialog ""
-
- gdbtk_idle
- return 0
-}
diff --git a/gdb/gdbtk/library/download.ith b/gdb/gdbtk/library/download.ith
deleted file mode 100644
index a7ac2ad0fc9..00000000000
--- a/gdb/gdbtk/library/download.ith
+++ /dev/null
@@ -1,45 +0,0 @@
-# Download class definition for Insight
-# Copyright (C) 1999, 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class Download {
- inherit ManagedWin
-
- protected {
- common total_bytes
- common section
- common bytes
- common num_sections
- common num_steps 100
-
- # completed steps in feedback meter (iwidget::feedback is lame)
- common completed_steps
-
- method _ignore_on_save {} { return 1 }
- proc dont_remember_size {} { return 1}
- }
- public {
- variable filename
-
- method constructor {args}
- method destructor {}
- method update_download { sec num tot }
- method done { {msg ""} }
- method cancel {}
-
- proc download_it { }
- proc do_download_hooks {}
- proc download_hash { section num }
-
- }
-}
diff --git a/gdb/gdbtk/library/editor.tcl b/gdb/gdbtk/library/editor.tcl
deleted file mode 100644
index 12d291e0527..00000000000
--- a/gdb/gdbtk/library/editor.tcl
+++ /dev/null
@@ -1,47 +0,0 @@
-# Editor
-# Copyright (C) 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ----------------------------------------------------------------------
-# Implements a set of editor commands
-# ----------------------------------------------------------------------
-
-namespace eval Editor {
- namespace export edit
-
- proc edit {loc_info} {
- global external_editor_command
-
- if {[info exists external_editor_command]} {
- if {[catch {uplevel \#0 "$external_editor_command edit $loc_info"} \
- err]} {
- tk_dialog .warn-sn "Edit" $err error 0 Ok
- }
- return
- }
-
- lassign $loc_info baseName fnName fileName lineNum addr pc
-
- set newCmd [pref get gdb/editor]
- if {! [string compare $newCmd ""]} {
- tk_dialog .warn "Edit" "No editor command specified" error 0 Ok
- }
-
- # Replace %s with file name and %d with line number.
- regsub -all -- %s $newCmd $fileName newCmd
- regsub -all -- %d $newCmd $lineNum newCmd
-
- if {[catch "exec $newCmd &" err]} {
- tk_dialog .warn "Edit" $err error 0 Ok
- }
- }
-}
diff --git a/gdb/gdbtk/library/ehandler.itb b/gdb/gdbtk/library/ehandler.itb
deleted file mode 100644
index 26f20234cad..00000000000
--- a/gdb/gdbtk/library/ehandler.itb
+++ /dev/null
@@ -1,31 +0,0 @@
-# GDBEventHandler class implementation for Insight.
-# Copyright (C) 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ------------------------------------------------------------
-# PUBLIC PROC: dispatch - Dispatch the given event to all
-# event handlers. The name of the handler
-# method to call is stored in the event's
-# "handler" method.
-# ------------------------------------------------------------
-itcl::body GDBEventHandler::dispatch {event} {
-
- set handler [$event handler]
-
- # invoke event handlers
- foreach w [itcl::find objects -isa GDBEventHandler] {
- dbug I "posting event \"$handler\" to \"$w\""
- if {[catch {$w $handler $event}]} {
- dbug E "On $handler event, $w errored:\n$::errorInfo"
- }
- }
-}
diff --git a/gdb/gdbtk/library/ehandler.ith b/gdb/gdbtk/library/ehandler.ith
deleted file mode 100644
index f66a1239ae1..00000000000
--- a/gdb/gdbtk/library/ehandler.ith
+++ /dev/null
@@ -1,48 +0,0 @@
-# GDBEventHandler class definition for Insight.
-# Copyright (C) 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-itcl::class GDBEventHandler {
-
- constructor {args} {}
- destructor {}
-
- # Dispatching proc. ALL events should be funneled through this
- # procedure.
- public proc dispatch {event}
-
- #
- # Events
- #
-
- # See gdbevent.ith for descriptions of event
- public {
- # Breakpiont/tracepoint events
- method breakpoint {event} {}
- method tracepoint {event} {}
-
- # Set variable
- method set_variable {event} {}
-
- # Busy event
- method busy {event} {}
-
- # Idle event
- method idle {event} {}
-
- # Update event
- method update {event} {}
-
- # Architecture changed event
- method arch_changed {event} {}
- }
-}
diff --git a/gdb/gdbtk/library/embeddedwin.ith b/gdb/gdbtk/library/embeddedwin.ith
deleted file mode 100644
index 2cda6af6e08..00000000000
--- a/gdb/gdbtk/library/embeddedwin.ith
+++ /dev/null
@@ -1,25 +0,0 @@
-# EmbeddedWin class definition for GDBtk.
-# Copyright (C) 1998, 1999, 2001 Red Hat
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class EmbeddedWin {
- inherit ManagedWin
-
- constructor {args} {
- debug "$args"
- }
-
- destructor {
- debug
- }
-}
diff --git a/gdb/gdbtk/library/gdbevent.itb b/gdb/gdbtk/library/gdbevent.itb
deleted file mode 100644
index 630f4604569..00000000000
--- a/gdb/gdbtk/library/gdbevent.itb
+++ /dev/null
@@ -1,205 +0,0 @@
-# GDB event class implementations for Insight.
-# Copyright (C) 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: get - Retrieve data about the event
-# ------------------------------------------------------------
-itcl::body BreakpointEvent::get {what} {
-
- switch $what {
- action { return $action }
- number { return $number }
- file { return $_file }
- function { return $_function }
- line { return $_line }
- address { return $_address }
- type { return $_type }
- enabled { return $_enabled }
- disposition { return $_disposition }
- ignore_count { return $_ignore_count }
- commands { return $_commands }
- condition { return $_condition }
- thread { return $_thread }
- hit_count { return $_hit_count }
- user_specification { return $_user_specification }
-
- default { error "unknown event data \"$what\": should be: action|number|file|function|line|address|type|enabled|disposition|ignore_count|commands|condition|thread|hit_count|user_specification" }
- }
-}
-
-# ------------------------------------------------------------
-# PRIVATE METHOD: _init - Initialize all private data
-# ------------------------------------------------------------
-itcl::body BreakpointEvent::_init {} {
- if {[catch {gdb_get_breakpoint_info $number} bpinfo]} {
- set _file {}
- set _function {}
- set _line {}
- set _address {}
- set _type {}
- set _enabled {}
- set _disposition {}
- set _ignore_count {}
- set _commands {}
- set _condition {}
- set _thread {}
- set _hit_count {}
- set _user_specification {}
- } else {
- lassign $bpinfo \
- _file \
- _function \
- _line \
- _address \
- _type \
- _enabled \
- _disposition \
- _ignore_count \
- _commands \
- _condition \
- _thread \
- _hit_count \
- _user_specification
- }
-}
-
-# When the breakpoint number for the event changes,
-# update the private data in the event.
-itcl::configbody BreakpointEvent::number {
- _init
-}
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: get - Retrieve data about the event
-# ------------------------------------------------------------
-itcl::body TracepointEvent::get {what} {
-
- switch $what {
- action { return $action }
- number { return $number }
- file { return $_file }
- function { return $_function }
- line { return $_line }
- address { return $_address }
- enabled { return $_enabled }
- pass_count { return $_pass_count }
- step_count { return $_step_count }
- thread { return $_thread }
- hit_count { return $_hit_count }
- actions { return $_actions }
-
- default { error "unknown event data \"$what\": should be: action|number|file|function|line|address|pass_count|step_count|thread|hit_count|actions" }
- }
-}
-
-# ------------------------------------------------------------
-# PRIVATE METHOD: _init - Initialize all private data
-# ------------------------------------------------------------
-itcl::body TracepointEvent::_init {} {
- if {[catch {gdb_get_tracepoint_info $number} tpinfo]} {
- set _file {}
- set _function {}
- set _line {}
- set _address {}
- set _enabled {}
- set _pass_count {}
- set _step_count {}
- set _thread {}
- set _hit_count {}
- set _actions {}
- } else {
- lassign $tpinfo \
- _file \
- _function \
- _line \
- _address \
- _enabled \
- _pass_count \
- _step_count \
- _thread \
- _hit_count \
- _actions
- }
-}
-
-# When the tracepoint number for the event changes,
-# update the private data in the event.
-itcl::configbody TracepointEvent::number {
- _init
-}
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: get - Retrieve data about the event
-# ------------------------------------------------------------
-itcl::body TracepointEvent::get {what} {
-
- switch $what {
- action { return $action }
- number { return $number }
- file { return $_file }
- function { return $_function }
- line { return $_line }
- address { return $_address }
- enabled { return $_enabled }
- pass_count { return $_pass_count }
- step_count { return $_step_count }
- thread { return $_thread }
- hit_count { return $_hit_count }
- actions { return $_actions }
-
- default { error "unknown event data \"$what\": should be: action|number|file|function|line|address|pass_count|step_count|thread|hit_count|actions" }
- }
-}
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: get - Retrieve data about the event
-# ------------------------------------------------------------
-itcl::body SetVariableEvent::get {what} {
-
- switch $what {
- variable { return $variable }
- value { return $value }
-
- default { error "unknown event data \"$what\": should be: variable|value" }
- }
-}
-
-# ------------------------------------------------------------
-# CONSTRUCTOR: Create an UpdateEvent
-# ------------------------------------------------------------
-itcl::body UpdateEvent::constructor {args} {
- if {[catch {gdb_loc} loc]} {
- dbug E "could not get current location: $loc"
- } else {
- lassign $loc _compile_filename _function _full_filename \
- _line _frame_pc _pc _shlib
- }
-}
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: get - Retrieve data about the event
-# ------------------------------------------------------------
-itcl::body UpdateEvent::get {what} {
-
- switch $what {
- compile_filename { return $_compile_filename }
- full_filename { return $_full_filename }
- function { return $_function }
- line { return $_line }
- frame_pc { return $_frame_pc }
- pc { return $_pc }
- shlib { return $_shlib }
-
- default { error "unknown event data \"$what\": should be: variable|value" }
- }
-}
diff --git a/gdb/gdbtk/library/gdbevent.ith b/gdb/gdbtk/library/gdbevent.ith
deleted file mode 100644
index 2d1e16a4124..00000000000
--- a/gdb/gdbtk/library/gdbevent.ith
+++ /dev/null
@@ -1,220 +0,0 @@
-# GDBEvent class definitions for Insight.
-# Copyright (C) 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# For reasons unknown to me, I cannot put any of the constructors
-# in the implementation files. The very first instance of the class
-# will call the (empty) constructor in here instead of the one
-# defined in the implementation file. Sigh.
-
-itcl::class GDBEvent {
- public method get {what} { return "" }
- public method handler {} { return "unknown" }
-}
-
-# BREAKPOINT EVENT
-#
-# This event is created/dispatched whenever a breakpoint is created,
-# deleted, or modified.
-#
-# action ....... what type of BP event ("create", "delete", "modify")
-# number ....... gdb's internal token for the BP
-# file ......... filename in which event occurred
-# function ..... function in which event occurred
-# line ......... line number in file
-# address ...... address of BP
-# type ......... breakpoint type ("breakpoint", "hw breakpoint", "step resume", etc)
-# enabled ...... BP enabled?
-# disposition .. BP's disposition ("delete", "delstop", "disable", "donttouch")
-# ignore_count . BP's ignore count
-# commands ..... list of commands to run when BP hit
-# condition .... BP condition
-# thread ....... thread in which BP is set (or -1 for all threads)
-# hit_count .... number of times BP has been hit
-# user_specification
-# .. text the user initially used to set this breakpoint
-itcl::class BreakpointEvent {
- inherit GDBEvent
-
- public variable action {}
- public variable number {}
-
- #constructor {args} {}
- constructor {args} {
- eval configure $args
-
- # If creating/modifying a breakpoint, then get
- # all info about it and save it away.
- _init
- }
- #destructor { dbug I "" }
-
- public method get {what}
- public method handler {} { return "breakpoint" }
-
- private variable _file {}
- private variable _function {}
- private variable _line {}
- private variable _address {}
- private variable _type {}
- private variable _enabled {}
- private variable _disposition {}
- private variable _ignore_count {}
- private variable _commands {}
- private variable _condition {}
- private variable _thread {}
- private variable _hit_count {}
- private variable _user_specification {}
-
- private method _init {}
-}
-
-# TRACEPOINT EVENT
-#
-# This event is created/dispatched whenever a tracepoint is created,
-# deleted, or modified.
-#
-# action ....... what type of BP event ("create", "delete", "modify")
-# number ....... gdb's internal token for the BP
-# file ......... filename in which event occurred
-# function ..... function in which event occurred
-# line ......... line number in file
-# address ...... address of BP
-# enabled ...... BP enabled?
-# pass_count ...
-# step_count ...
-# thread ....... thread in which BP is set (or -1 for all threads)
-# hit_count .... number of times BP has been hit
-# actions ...... a list of actions to be performed when the tracepoint is hit
-itcl::class TracepointEvent {
- inherit GDBEvent
-
- public variable action {}
- public variable number {}
-
- # For reasons unknown to me, I cannot put this in the implementation
- # file. The very first instance of the class will call this empty
- # constructor instead of the one defined in the implementation file.
- #constructor {args} {}
- constructor {args} {
- eval configure $args
-
- # If creating/modifying a tracepoint, then get
- # all info about it and save it away.
- _init
- }
- #destructor { dbug I "" }
- public method get {what}
- public method handler {} { return "tracepoint" }
-
- private variable _file {}
- private variable _function {}
- private variable _line {}
- private variable _address {}
- private variable _enabled {}
- private variable _pass_count {}
- private variable _step_count {}
- private variable _thread {}
- private variable _hit_count {}
- private variable _actions {}
-
- private method _init {}
-}
-
-# SET VARIABLE EVENT
-#
-# This event is created/dispatched whenever a "set" command successfully
-# completes in gdb's command interpreter.
-#
-# variable ..... the variable that was changed
-# value ........ the variable's new value
-itcl::class SetVariableEvent {
- inherit GDBEvent
-
- public variable variable
- public variable value
-
- constructor {args} {
- eval configure $args
- }
- #destructor { dbug I "" }
- public method get {what}
- public method handler {} { return "set_variable" }
-}
-
-# BUSY EVENT
-#
-# This event is created/dispatched whenever the GUI or GDB is "busy".
-# This could happen when the inferior is executing or when the GUI
-# is, for example, fetching memory from the target.
-
-itcl::class BusyEvent {
- inherit GDBEvent
-
- public method handler {} { return "busy" }
-}
-
-# IDLE EVENT
-#
-# This event is created/dispatched whenever the GUI and GDB is not
-# "busy". Receipt of this event means that the GUI should be put into
-# a state to accept input by the user.
-
-itcl::class IdleEvent {
- inherit GDBEvent
-
- public method handler {} { return "idle" }
-}
-
-# UPDATE EVENT
-#
-# This event is created/dispatched whenever the target's state
-# has changed. When an UpdateEvent is received, widgets should
-# update their contents to reflect the inferior's new state.
-#
-# Right now, this just holds the output of gdb_loc...
-#
-# compile_filename - Filename stored in the symtab
-# full_filename - Full filename of file, if found in source search dir
-# function - Function name
-# line - Line number
-# frame_pc - Frame's PC
-# pc - Real stop PC
-# shlib - Shared library stopped in
-#
-# FIXME: Should probably put frame_pc and pc into different
-# types of update events...
-itcl::class UpdateEvent {
- inherit GDBEvent
-
- constructor {args} {}
- public method get {what}
- public method handler {} { return "update" }
-
- private variable _compile_filename {}
- private variable _function {}
- private variable _full_filename {}
- private variable _line {}
- private variable _frame_pc {}
- private variable _pc {}
- private variable _shlib {}
-}
-
-# ARCHITECTURE CHANGED EVENT
-#
-# This event is posted whenever the target architecture changes
-
-itcl::class ArchChangedEvent {
- inherit GDBEvent
-
- public method handler {} { return "arch_changed" }
-}
diff --git a/gdb/gdbtk/library/gdbmenubar.itcl b/gdb/gdbtk/library/gdbmenubar.itcl
deleted file mode 100644
index cdeecff29e5..00000000000
--- a/gdb/gdbtk/library/gdbmenubar.itcl
+++ /dev/null
@@ -1,332 +0,0 @@
-# GDBMenuBar
-# Copyright (C) 2000, 2004 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ----------------------------------------------------------------------
-# Implements a GDB menubar.
-#
-# PUBLIC ATTRIBUTES:
-#
-#
-# METHODS:
-#
-# configure ....... used to change public attributes
-#
-# PRIVATE METHODS
-#
-# X11 OPTION DATABASE ATTRIBUTES
-#
-#
-# ----------------------------------------------------------------------
-
-itcl::class GDBMenuBar {
- inherit itk::Widget
-
- # ------------------------------------------------------------------
- # CONSTRUCTOR - create widget
- # ------------------------------------------------------------------
- constructor {args} {
-
- set Menu [menu $itk_interior.m -tearoff 0]
-
- eval itk_initialize $args
- }
-
- # ------------------------------------------------------------------
- # DESTRUCTOR - destroy window containing widget
- # ------------------------------------------------------------------
- destructor {
-
- #destroy $this
- }
-
- # ------------------------------------------------------------------
- # METHOD: show - attach menu to the toplevel window
- # ------------------------------------------------------------------
- public method show {} {
- [winfo toplevel $itk_interior] configure -menu $Menu
- }
-
- # ------------------------------------------------------------------
- # METHOD: set_class_state - standard method to control state by class
- # ------------------------------------------------------------------
- public method set_class_state {enable_list} {
- debug "Enable list is: $enable_list"
-
- foreach {type state} $enable_list {
- # debug $type
- if {[info exists menu_classes($type)]} {
- set class_list $menu_classes($type)
- if {[llength $class_list]} {
- # debug "$type $state \{$class_list\}"
- foreach menu $class_list {
- # debug "$type $menu $state"
- menubar_change_menu_state $menu $state
- }
- }
- }
- }
- }
-
- ####################################################################
- # Methods that deal with menus.
- #
- # The next set of methods control the menubar associated with the
- # toolbar. Currently, only sequential addition of submenu's and menu
- # entries is allowed. Here's what you do. First, create a submenu
- # with the "new_menu" command. This submenu is the targeted menu.
- # Subsequent calls to add_menu_separator, and add_menu_command add
- # separators and commands to the end of this submenu.
- # If you need to edit a submenu, call clear_menu and then add all the
- # items again.
- #
- # Each menu command also has a class list. Transitions between states
- # of gdb will enable and disable different classes of menus.
- #
- # FIXME - support insert_command, and also cascade menus, whenever
- # we need it...
- ####################################################################
-
- # ------------------------------------------------------------------
- # METHOD: add - Add something.
- # It can be a menubutton for the main menu,
- # a separator or a command.
- #
- # type - what we want to add
- # args - arguments appropriate to what is being added
- #
- # RETURNS: the cascade menu widget path.
- # ------------------------------------------------------------------
- method add {type args} {
-
- switch $type {
- menubutton {
- eval menubar_new_menu $args
- }
- command {
- eval menubar_add_menu_command $args
- }
- separator {
- menubar_add_menu_separator
- }
- cascade {
- eval menubar_add_cascade $args
- }
- default {
- error "Invalid item type: $type"
- }
- }
-
- return $current_menu
- }
-
- # ------------------------------------------------------------------
- # NAME: private method GDBMenuBar::menubar_add_cascade
- # DESCRIPTION: Create a new cascading menu in the current menu
- #
- # ARGUMENTS: menu_name - the name of the menu to be created
- # label - label to be displayed for the menu
- # underline - which element to underline for shortcuts
- # RETURNS: Nothing
- # ------------------------------------------------------------------
- private method menubar_add_cascade {menu_name class label underline} {
- set m [menu $current_menu.$menu_name -tearoff false]
- $current_menu add cascade -menu $m -label $label \
- -underline $underline
- incr item_number
- switch $class {
- None {}
- default {
- foreach elem $class {
- lappend menu_classes($elem) [list $current_menu $item_number]
- }
- }
- }
- set current_menu $m
- }
-
- # ------------------------------------------------------------------
- # PRIVATE METHOD: menubar_new_menu - Add a new menu to the main
- # menu.
- # Also target this menu for subsequent
- # menubar_add_menu_command calls.
- #
- # name - the token for the new menu
- # label - The label used for the label
- # underline - the index of the underlined character for this menu item.
- #
- # ------------------------------------------------------------------
- private method menubar_new_menu {name label underline args} {
-
- set current_menu $Menu.$name
- $Menu add cascade -menu $current_menu -label $label \
- -underline $underline
- eval menu $current_menu -tearoff 0 $args
-
- # Save the index number of this menu. It is always the last one.
- set menu_list($name) [$Menu index end]
- set menu_list($name,label) $label
- set item_number -1
- }
-
- # ------------------------------------------------------------------
- # PRIVATE METHOD: menubar_add_menu_command - Adds a menu command item
- # to the currently targeted submenu of the main menu.
- #
- # class - The class of the command, used for disabling entries.
- # label - The text for the command.
- # command - The command for the menu entry
- # args - Passed to the menu entry creation command (eval'ed)
- # ------------------------------------------------------------------
- private method menubar_add_menu_command {class label command args} {
-
- eval $current_menu add command -label \$label -command \$command \
- $args
-
- incr item_number
-
- switch $class {
- None {}
- default {
- foreach elem $class {
- lappend menu_classes($elem) [list $current_menu $item_number]
- }
- }
- }
- }
-
- # ------------------------------------------------------------------
- # PRIVATE METHOD: menubar_add_menu_separator - Adds a menu separator
- # to the currently targeted submenu of the main menu.
- #
- # ------------------------------------------------------------------
- private method menubar_add_menu_separator {} {
- incr item_number
- $current_menu add separator
- }
-
- # ------------------------------------------------------------------
- # METHOD: exists - Report whether a menu keyed by NAME exists.
- #
- # name - the token for the menu sought
- #
- # RETURNS: 1 if the menu exists, 0 otherwise.
- # ------------------------------------------------------------------
- method exists {name} {
- return [info exists menu_list($name)]
-
- }
-
- # ------------------------------------------------------------------
- # METHOD: clear - Deletes the items from one of the
- # main menu cascade menus. Also makes this menu
- # the target menu.
- #
- # name - the token for the new menu
- #
- # RETURNS: then item number of the menu, or "" if the menu is not found.
- #
- # FIXME: Does not remove the deleted menus from their class lists.
- # ------------------------------------------------------------------
- method clear {name} {
- if {[info exists menu_list($name)]} {
- set current_menu [$Menu entrycget $menu_list($name) -menu]
- $current_menu delete 0 end
- set item_number -1
- return $current_menu
- } else {
- return ""
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: delete - Deletes one of the main menu
- # cascade menus. Also makes the previous menu the
- # target menu.
- #
- # name - the token for the new menu
- #
- # RETURNS: then item number of the menu, or "" if the menu is not found.
- #
- # FIXME: Does not remove the deleted menus from their class lists.
- # ------------------------------------------------------------------
- method delete {name} {
- if {[info exists menu_list($name)]} {
- $Menu delete $menu_list($name,label)
- set current_menu {}
- unset menu_list($name,label)
- unset menu_list($name)
- }
- }
-
- # ------------------------------------------------------------------
- # PRIVATE METHOD: menubar_change_menu_state - Does the actual job of
- # enabling menus...
- #
- # INPUT: Pass normal or disabled for the state.
- # ------------------------------------------------------------------
- private method menubar_change_menu_state {menu state} {
-
- [lindex $menu 0] entryconfigure [lindex $menu 1] -state $state
- }
-
- # ------------------------------------------------------------------
- # METHOD: menubar_set_current_menu - Change the current_menu pointer.
- # Returns the current value so it can be restored.
- # ------------------------------------------------------------------
- method menubar_set_current_menu {menup} {
- set saved_menu $current_menu
- set current_menu $menup
- return $saved_menu
- }
-
- # ------------------------------------------------------------------
- # METHOD: menubar_get_current_menu - Get the current_menu pointer.
- # Returns the current value so it can be restored.
- # ------------------------------------------------------------------
- method menubar_get_current_menu {} {
- return $current_menu
- }
-
- ####################################################################
- #
- # PRIVATE DATA
- #
- ####################################################################
-
- # This array holds the menu classes. The key is the class name,
- # and the value is the list of menus belonging to this class.
- private variable menu_classes
-
- # This array holds the pathname that corresponds to a menu name
- private variable menu_list
-
- private variable item_number -1
- private variable current_menu {}
-
- ####################################################################
- #
- # PROTECTED DATA
- #
- ####################################################################
-
- # The menu Tk widget
- protected variable Menu
-
- ####################################################################
- #
- # PUBLIC DATA
- #
- ####################################################################
-
- # None
-}
diff --git a/gdb/gdbtk/library/gdbtoolbar.itcl b/gdb/gdbtk/library/gdbtoolbar.itcl
deleted file mode 100644
index 1e164b82b1c..00000000000
--- a/gdb/gdbtk/library/gdbtoolbar.itcl
+++ /dev/null
@@ -1,396 +0,0 @@
-# GDBToolBar
-# Copyright (C) 2000 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ----------------------------------------------------------------------
-# Implements a toolbar.
-#
-# PUBLIC ATTRIBUTES:
-#
-#
-# METHODS:
-#
-# configure ....... used to change public attributes
-#
-# PRIVATE METHODS
-#
-# X11 OPTION DATABASE ATTRIBUTES
-#
-#
-# ----------------------------------------------------------------------
-
-itcl::class GDBToolBar {
- inherit itk::Widget
-
- # ------------------------------------------------------------------
- # CONSTRUCTOR - create widget
- # ------------------------------------------------------------------
- constructor {args} {
-
- # Make a subframe so that the menu can't accidentally conflict
- # with a name created by some subclass.
- set ButtonFrame [frame $itk_interior.t]
-
- pack $ButtonFrame $itk_interior -fill both -expand true
-
- eval itk_initialize $args
- }
-
- # ------------------------------------------------------------------
- # DESTRUCTOR - destroy window containing widget
- # ------------------------------------------------------------------
- destructor {
-
- #destroy $this
- }
-
- # ------------------------------------------------------------------
- # METHOD: show - show the toolbar
- # ------------------------------------------------------------------
- public method show {} {
-
- if {[llength $button_list]} {
- eval standard_toolbar $ButtonFrame $button_list
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: set_class_state - standard method to control state by class
- # ------------------------------------------------------------------
- public method set_class_state {enable_list} {
- debug "Enable list is: $enable_list"
-
- foreach {type state} $enable_list {
- # debug $type
- if {[info exists button_classes($type)]} {
- set class_list $button_classes($type)
- if {[llength $class_list]} {
- # debug "$type $state \{$class_list\}"
- foreach button $class_list {
- # debug "$type $button $state"
- itemconfigure $button -state $state
- }
- }
- }
- }
- }
-
- ####################################################################
- # Methods that deal with buttons.
- ####################################################################
-
- # ------------------------------------------------------------------
- # METHOD: add - Add something.
- # It can be a button a separator or a label.
- #
- # type - what we want to add
- # args - arguments appropriate to what is being added
- #
- # ------------------------------------------------------------------
- method add {type args} {
-
- switch $type {
- button {
- eval toolbar_add_button $args
- }
- label {
- eval toolbar_add_label $args
- }
- separator {
- toolbar_add_button_separator
- }
- custom {
- eval toolbar_add_custom $args
- }
- default {
- error "Invalid item type: $type"
- }
- }
- }
-
- # ------------------------------------------------------------------
- # PRIVATE METHOD: toolbar_add_button - Creates a button, and inserts
- # it at the end of the button list. Call this when
- # the toolbar is being set up, but has not yet been
- # made.
- # ------------------------------------------------------------------
- private method toolbar_add_button {name class command balloon args} {
-
- lappend button_list \
- [eval _register_button 1 \$name \$class \$command \$balloon $args]
-
- }
-
- # ------------------------------------------------------------------
- # PRIVATE METHOD: toolbar_add_label - Create a label to be inserted
- # in the toolbar.
- # ------------------------------------------------------------------
-
- private method toolbar_add_label {name text balloon args} {
- set lname $ButtonFrame.$name
- set Buttons($name) $lname
- set Buttons($lname,align) $button_align
- eval label $lname -text \$text $args
- balloon register $lname $balloon
- lappend button_list $lname
- }
-
- # ------------------------------------------------------------------
- # PRIVATE METHOD: toolbar_add_custom - Create a user defined widget
- # to be inserted in the toolbar.
- # ------------------------------------------------------------------
-
- private method toolbar_add_custom {name createCmd balloon args} {
- set wname $ButtonFrame.$name
- set Buttons($name) $wname
- set Buttons($wname,align) $button_align
-
- eval $createCmd $wname $args
- balloon register $wname $balloon
-
- lappend button_list $wname
- }
-
- # ------------------------------------------------------------------
- # PRIVATE METHOD: toolbar_add_button_separator -
- # ------------------------------------------------------------------
-
- private method toolbar_add_button_separator {} {
- lappend button_list -
- }
-
- # ------------------------------------------------------------------
- # PRIVATE METHOD: _register_button - Creates all the bookkeeping
- # for a button, without actually inserting it in the toolbar.
- # If the button will not be immediately inserted (INS == 0),
- # sets its bindings and appearences to the same of a
- # standard_toolbar button.
- # ------------------------------------------------------------------
- private method _register_button {ins name class command balloon args} {
- set bname $ButtonFrame.$name
- set Buttons($name) $bname
- set Buttons($bname,align) $button_align
-
- eval button $bname -command \$command $args
- balloon register $bname $balloon
- foreach elem $class {
- switch $elem {
- None {}
- default {
- lappend button_classes($elem) $name
- }
- }
- }
-
- # If the button is not going to be inserted now...
- if {! $ins} {
- # This is a bit of a hack, but I need to bind the standard_toolbar bindings
- # and appearances to these externally, since I am not inserting them in
- # the original toolbar...
- # FIXME: Have to add a method to the libgui toolbar to do this.
-
- # Make sure the button acts the way we want, not the default Tk way.
- $bname configure -takefocus 0 -highlightthickness 0 \
- -relief flat -borderwidth 1
- set index [lsearch -exact [bindtags $bname] Button]
- bindtags $bname [lreplace [bindtags $bname] $index $index ToolbarButton]
- }
-
- return $bname
- }
-
- # ------------------------------------------------------------------
- # METHOD: create - Creates all the bookkeeping for a button,
- # without actually inserting it in the toolbar.
- # ------------------------------------------------------------------
- method create {name class command balloon args} {
-
- return [eval _register_button 0 \$name \$class \$command \$balloon $args]
- }
-
- # ------------------------------------------------------------------
- # METHOD: itemconfigure -
- # ------------------------------------------------------------------
-
- method itemconfigure {button args} {
- eval $Buttons($button) configure $args
- }
-
- # ------------------------------------------------------------------
- # METHOD: itembind -
- # ------------------------------------------------------------------
-
- method itembind {button key cmd} {
- eval [list bind $Buttons($button) $key $cmd]
- }
-
- # ------------------------------------------------------------------
- # METHOD: itemballoon -
- # ------------------------------------------------------------------
-
- method itemballoon {button text} {
- eval [list balloon register $Buttons($button) $text]
- }
-
- # ------------------------------------------------------------------
- # PRIVATE METHOD: toolbar_insert_button - Inserts button "name" before
- # button "before".
- # The toolbar must be made, and the buttons must have been
- # created before you run this.
- # ------------------------------------------------------------------
- private method toolbar_insert_button {name before} {
-
- if {[string first "-" $name] == 0} {
- set name [string range $name 1 end]
- set add_sep 1
- } else {
- set add_sep 0
- }
-
- if {![info exists Buttons($name)] || ![info exists Buttons($before)]} {
- error "toolbar_insert_buttons called with non-existant button"
- }
-
- set before_col [gridCGet $Buttons($before) -column]
- set before_row [gridCGet $Buttons($before) -row]
-
- set slaves [grid slaves $ButtonFrame]
-
- set incr [expr 1 + $add_sep]
- foreach slave $slaves {
- set slave_col [gridCGet $slave -column]
- if {$slave_col >= $before_col} {
- grid configure $slave -column [expr $slave_col + $incr]
- }
- }
- if {$add_sep} {
- grid $Buttons(-$name) -column $before_col -row $before_row
- }
-
- # Now grid our button. Have to put in the pady since this button
- # may not have been originally inserted by the libgui toolbar
- # proc.
-
- grid $Buttons($name) -column [expr $before_col + $add_sep] \
- -row $before_row -pady 2
-
- }
-
- # ------------------------------------------------------------------
- # PRIVATE METHOD: toolbar_remove_button -
- # ------------------------------------------------------------------
-
- private method toolbar_remove_button {name} {
-
- if {[string first "-" $name] == 0} {
- set name [string range $name 1 end]
- set remove_sep 1
- } else {
- set remove_sep 0
- }
-
- if {![info exists Buttons($name)] } {
- error "toolbar_remove_buttons called with non-existant button $name"
- }
-
- set name_col [gridCGet $Buttons($name) -column]
- set name_row [gridCGet $Buttons($name) -row]
-
- grid remove $Buttons($name)
- if {$remove_sep} {
- set Buttons(-$name) [grid slaves $ButtonFrame \
- -column [expr $name_col - 1] \
- -row $name_row]
- grid remove $Buttons(-$name)
- }
-
- set slaves [grid slaves $ButtonFrame -row $name_row]
- foreach slave $slaves {
- set slave_col [gridCGet $slave -column]
- if {($slave_col > $name_col)
- && ! ([info exists Buttons($slave,align)]
- && $Buttons($slave,align) == "right")} {
- grid configure $slave -column [expr $slave_col - 1 - $remove_sep]
- }
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: toolbar_button_right_justify -
- # ------------------------------------------------------------------
-
- method toolbar_button_right_justify {} {
- lappend button_list --
- set button_align "right"
- }
-
- # ------------------------------------------------------------------
- # METHOD: toolbar_swap_button_lists -
- # ------------------------------------------------------------------
-
- method toolbar_swap_button_lists {in_list out_list} {
- # Now swap out the buttons...
- set first_out [lindex $out_list 0]
- if {[info exists Buttons($first_out)] && [grid info $Buttons($first_out)] != ""} {
- foreach button $in_list {
- toolbar_insert_button $button $first_out
- }
- foreach button $out_list {
- toolbar_remove_button $button
- }
- } elseif {[info exists Buttons($first_out)]} {
- debug "Error in swap_button_list - $first_out not gridded..."
- } else {
- debug "Button $first_out is not in button list"
- }
- }
-
- ####################################################################
- #
- # PRIVATE DATA
- #
- ####################################################################
-
- # This is the list of buttons that are being built up
- #
- private variable button_list {}
-
- # This is an array of buttons names -> Tk Window names
- # and also of Tk Window names -> column position in grid
- private variable Buttons
-
- # This array holds the button classes. The key is the class name,
- # and the value is the list of buttons belonging to this class.
- private variable button_classes
-
- # Tell if we are inserting buttons left or right justified
- private variable button_align "left"
-
- #The frame to contain the buttons:
- private variable ButtonFrame
-
- ####################################################################
- #
- # PROTECTED DATA
- #
- ####################################################################
-
- # None.
-
- ####################################################################
- #
- # PUBLIC DATA
- #
- ####################################################################
-
- # None.
-}
diff --git a/gdb/gdbtk/library/gdbwin.ith b/gdb/gdbtk/library/gdbwin.ith
deleted file mode 100644
index 99895a09ab6..00000000000
--- a/gdb/gdbtk/library/gdbwin.ith
+++ /dev/null
@@ -1,25 +0,0 @@
-# GDBwin class definition for Insight.
-# Copyright (C) 1998, 1999, 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class GDBWin {
- inherit GDBEventHandler
-
- constructor {args} {
- debug "$args"
- }
-
- destructor {
- debug
- }
-}
diff --git a/gdb/gdbtk/library/globalpref.itb b/gdb/gdbtk/library/globalpref.itb
deleted file mode 100644
index 303b91be0f8..00000000000
--- a/gdb/gdbtk/library/globalpref.itb
+++ /dev/null
@@ -1,482 +0,0 @@
-# Global preference class implementation for Insight.
-# Copyright (C) 1997, 1998, 1999, 2002, 2003, 2004, 2008 Red Hat
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements Global preferences dialog
-#
-# ----------------------------------------------------------------------
-
-# ------------------------------------------------------------------
-# METHOD: _init - set up the tracing labels info
-# ------------------------------------------------------------------
-itcl::body GlobalPref::_init {} {
- if {$inited} {
- return
- }
-
- set inited 1
-
- array set tracing_labels {
- 0 "Tracing features disabled"
- 1 "Tracing features enabled"
- max_len 0
- }
-
- foreach elem [array names tracing_labels] {
- set len [string length $tracing_labels($elem)]
- set tracing_labels(max_len) \
- [expr $len > $tracing_labels(max_len) ? $len : $tracing_labels(max_len) ]
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: init_var - initialize preference variables
-# ------------------------------------------------------------------
-itcl::body GlobalPref::_init_var {} {
- set vlist {gdb/ImageDir gdb/console/wrap gdb/mode gdb/use_icons gdb/compat gdb/use_color_schemes}
-
- foreach var $vlist {
- set _saved($var) [pref get $var]
- set _new($var) $_saved($var)
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: constructor - create the Global Preferences object
-# ------------------------------------------------------------------
-itcl::body GlobalPref::constructor {args} {
- window_name "Global Preferences"
- _init
- _init_var
- _build_win
- eval itk_initialize $args
-}
-
-# ------------------------------------------------------------------
-# METHOD: destructor - destroy the Global Preferences object
-# ------------------------------------------------------------------
-itcl::body GlobalPref::destructor {} {
- foreach thunk $_fonts {
- font delete test-$thunk-font
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _build_win - build the dialog
-# ------------------------------------------------------------------
-itcl::body GlobalPref::_build_win {} {
- global gdbtk_platform GDBTK_LIBRARY
- debug
- frame $itk_interior.f
- frame $itk_interior.x
- set frame $itk_interior.f
-
- # Icons
- frame $frame.icons
- label $frame.icons.lab -text "Icons "
- combobox::combobox $frame.icons.cb -editable 0 -maxheight 10\
- -command [code $this _change_icons] -bg $::Colors(textbg)
-
- # get list of icon directories
- set curdir [pwd]
- set _icondirlist ""
- cd $GDBTK_LIBRARY
- foreach foo [glob -- *] {
- if {[file isdirectory $foo] && [file exists [file join $foo "icons.txt"]]} {
- lappend _icondirlist $foo
- }
- }
-
- set width 14
- # load combobox
- foreach dir $_icondirlist {
- if {![string compare $dir $_saved(gdb/ImageDir)]} {
- set cdir 1
- } else {
- set cdir 0
- }
- set foo [file join $dir "icons.txt"]
- if {[catch {::open $foo r} fid]} {
- # failed
- dbug E "couldn't open $foo:$fid"
- if {$cdir} {$frame.icons.cb entryset "unknown icons"}
- $frame.icons.cb list insert end "unknown icons"
- } else {
- if {[gets $fid txt] >= 0} {
- if {$cdir} {$frame.icons.cb entryset $txt}
- if {[string length $txt] > $width} {set width [string length $txt]}
- $frame.icons.cb list insert end $txt
- } else {
- if {$cdir} {$frame.icons.cb entryset "unknown icons"}
- $frame.icons.cb list insert end "unknown icons"
- }
- close $fid
- }
- }
- $frame.icons.cb configure -width $width
- cd $curdir
-
- # searching for fixed font families take a long time
- # therefore, we cache the font names. The font cache
- # can be saved in the init file. A way should be provided
- # to rescan the font list, without deleting the entry from the
- # init file.
- set font_cache [pref get gdb/font_cache]
-
- # get list of fonts, removing some that typically
- # are not useful or cause tk problems
- set fam [lremove [font families] "open look glyph"]
- set fam [lremove $fam "open look cursor"]
- set fam [lremove $fam "song ti"]
- set fam [lremove $fam "clearlyu"]
- set fam [lremove $fam "clearlyu alternate glyphs"]
- set fam [lremove $fam "clearlyu arabic extra"]
- set fam [lremove $fam "clearlyu ligature"]
- set fam [lremove $fam "clearlyu pua"]
- set fam [lremove $fam "fangsong ti"]
- set fam [lremove $fam "newspaper"]
- set fam [lremove $fam "palatino linotype"]
- set fam [lsort $fam]
-
- if {$font_cache == ""} {
- if {$gdbtk_platform(platform) == "unix"} {
- toplevel .c
- wm title .c "Scanning for fonts"
- message .c.m -width 3i -text "Scanning system for fonts\n\nPlease wait..." \
- -relief flat -padx 30 -pady 30 \
- -bg [pref get gdb/global_prefs/message_bg] \
- -fg [pref get gdb/global_prefs/message_fg]
- ::update
- pack .c.m
- focus .c
- ::raise .c
- ::update
- }
-
- foreach fn $fam {
- if {[font metrics [list $fn] -fixed] == 1} {
- lappend font_cache $fn
- }
- }
- pref set gdb/font_cache $font_cache
- if {[winfo exists .c]} { destroy .c }
- }
-
- set f [Labelledframe $frame.d]
- $f configure -text "Fonts"
- set f [$frame.d get_frame]
-
- _make_font_item $f fixed "Fixed Font:" $font_cache
-
- if {$gdbtk_platform(platform) != "windows"} {
- # Cannot change the windows menu font ourselves
- _make_font_item $f menu "Menu Font:" $fam
- }
-
- _make_font_item $f default "Default Font:" $fam
- _make_font_item $f status "Status Bar Font:" $fam
-
-
- iwidgets::Labeledframe $frame.misc -labelpos nw -labeltext "Misc"
- set f [$frame.misc childsite]
-
- # This is the tracing preference
- set tracing_cb [pref get gdb/mode]
- if { ![info exists tracing_labels($tracing_cb)]} {
- dbug E "Got unknown mode value: $tracing_cb"
- set tracing_labels($tracing_cb) "Unknown gdb mode..."
- }
-
- checkbutton $f.tracing -variable [scope _new(gdb/mode)] \
- -text $tracing_labels($tracing_cb) \
- -command [code $this _toggle_tracing $f.tracing] \
- -width $tracing_labels(max_len) -anchor w
-
- # use_icons
- if {$gdbtk_platform(platform) == "unix"} {
- checkbutton $f.use_icons \
- -text "Use builtin image as icon." -variable [scope _new(gdb/use_icons)]
- }
-
- # console wrap
- checkbutton $f.consolewrap -text "Wrap text in console window" \
- -variable [scope _new(gdb/console/wrap)]
-
- # colored backgrounds
- checkbutton $f.use_cs -text "Enable Color Schemes" \
- -variable [scope _new(gdb/use_color_schemes)]
-
- grid $f.tracing -sticky w -padx 5 -pady 5
-
- if {$gdbtk_platform(platform) == "unix"} {
- grid $f.use_icons -sticky w -padx 5 -pady 5
- }
- grid $f.consolewrap -sticky w -padx 5 -pady 5
- grid $f.use_cs -sticky w -padx 5 -pady 5
-
- if {$gdbtk_platform(platform) == "unix"} {
- # Compatibility frame
- iwidgets::Labeledframe $frame.compat -labelpos nw -labeltext "OS Compatibility"
- set fc [$frame.compat childsite]
- radiobutton $fc.0 -text "GNOME" -value "GNOME" -variable [scope _new(gdb/compat)]
- radiobutton $fc.1 -text "KDE" -value "KDE" -variable [scope _new(gdb/compat)]
- radiobutton $fc.2 -text "default" -value "default" -variable [scope _new(gdb/compat)]
- grid $fc.0 -sticky w -padx 5 -pady 5
- grid $fc.1 -sticky w -padx 5 -pady 5
- grid $fc.2 -sticky w -padx 5 -pady 5
- grid [label $fc.warn -text "Restart required for all\nchanges to take effect"] -sticky w
- }
-
- # pack it all
- pack $frame.icons.lab $frame.icons.cb -side left
- grid $frame.icons x -sticky w -pady 10
- grid $frame.d -columnspan 2 -sticky w
- if {$gdbtk_platform(platform) == "unix"} {
- grid $frame.compat $frame.misc -sticky we
- } else {
- grid $frame.misc x -sticky we
- }
-
- # make buttons
- button $itk_interior.x.ok -text OK -underline 0 -width 7 -command [code $this _ok]
- button $itk_interior.x.apply -text Apply -width 7 -underline 0 -command [code $this _apply]
- button $itk_interior.x.cancel -text Cancel -width 7 -underline 0 -command [code $this _cancel]
- pack $itk_interior.x.ok $itk_interior.x.apply $itk_interior.x.cancel -side left
- standard_button_box $itk_interior.x
-
- pack $itk_interior.x -fill x -padx 5 -pady 5 -side bottom
- pack $itk_interior.f -fill both -expand yes -padx 5 -pady 5
-
- bind $itk_interior.x.ok <Return> \
- "$itk_interior.x.ok flash; $itk_interior.x.ok invoke"
- focus $itk_interior.x.ok
-
- # We don't want the window flashing around as we change the fonts...
-
- ::update idletasks
-
- _resize_font_item_height
- pack propagate $itk_interior.f 0
-
-}
-# ------------------------------------------------------------------
-# PRIVATE METHOD: _make_font_item
-# ------------------------------------------------------------------
-itcl::body GlobalPref::_make_font_item {f name label font_list} {
-
- # create ComboBox with font name
- lappend _fonts $name
-
- set _original($name,family) [font actual global/$name -family]
- set _original($name,size) [font actual global/$name -size]
- font create test-$name-font -family $_original($name,family) \
- -size $_original($name,size)
- label $f.${name}x -text $label
-
- combobox::combobox $f.${name}n -editable 0 -value $_original($name,family) \
- -command [code $this _change_font $name] -bg $::Colors(textbg)
-
- foreach a $font_list {
- $f.${name}n list insert end $a
- }
-
- itk_component add $name-size {
- iwidgets::spinint $f.${name}s -labeltext "Size:" -range {6 18} -step 1 \
- -fixed 2 -width 2 -textvariable [scope _size($name)] -wrap 0 \
- -increment [code $this _change_size up $name] \
- -decrement [code $this _change_size down $name] \
- -textbackground $::Colors(textbg)
- } {}
- label $f.${name}l -text ABCDEFabcdef0123456789 -font test-$name-font
- set _size($name) $_original($name,size)
-
- grid $f.${name}x $f.${name}n $f.${name}s $f.${name}l -sticky we -padx 5 -pady 5
- grid columnconfigure $f 3 -weight 1
-}
-
-# ------------------------------------------------------------------
-# PRIVATE METHOD: _resize_font_item_height
-# ------------------------------------------------------------------
-itcl::body GlobalPref::_resize_font_item_height {} {
- foreach font $_fonts {
- set master [$itk_interior.f.d get_frame]
- set row [gridCGet $master.${font}l -row]
- grid rowconfigure $master $row -minsize [lindex [grid bbox $master 0 $row 3 $row ] 3]
- }
-}
-
-# ------------------------------------------------------------------
-# PRIVATE METHOD: _change_icons
-# ------------------------------------------------------------------
-itcl::body GlobalPref::_change_icons {w args} {
- set index [$w curselection]
- if {$index != ""} {
- set _new(gdb/ImageDir) [lindex $_icondirlist $index]
- }
-}
-
-# ------------------------------------------------------------------
-# NAME: private method GlobalPref::_change_font
-# DESCRIPTION: Change the given font's family
-#
-# ARGUMENTS:
-# font - the font whose family is to be
-# changed
-# stupid - the comobox widget which changed
-# implementation - the new value of the combobox
-# RETURNS: Nothing
-#
-# NOTES: The combobox has a really non-standard callback
-# mechanism: it always adds two args to the callback.
-# ------------------------------------------------------------------
-itcl::body GlobalPref::_change_font {font stupid implementation} {
- font configure test-$font-font -family $implementation
-}
-
-# ------------------------------------------------------------------
-# NAME: private method GlobalPref::_change_size
-# DESCRIPTION: Change the given font's size
-#
-# ARGUMENTS:
-# direction - the direction of the change (up/down)
-# font - the font that is changing
-# RETURNS: Nothing
-#
-# NOTES: See comments for purpose of "direction". Sigh.
-# ------------------------------------------------------------------
-itcl::body GlobalPref::_change_size {direction font} {
-
- # Almost as stupid as the comobox, the iwidgets::spinint class
- # will not treat its -increment and -decrement commands
- # as command callbacks. Instead it OVERRIDES all behavior.
- # Thus, we need to call the stupid spinint's callback.
- $itk_component($font-size) $direction
- font configure test-$font-font -size $_size($font)
-}
-
-
-itcl::body GlobalPref::_toggle_tracing {win} {
- debug
- $win configure -text $tracing_labels($_new(gdb/mode))
-}
-
-# ------------------------------------------------------------------
-# METHOD: _ok - called to accept settings and close dialog
-# ------------------------------------------------------------------
-itcl::body GlobalPref::_ok {} {
- _apply 1
-}
-
-# ------------------------------------------------------------------
-# METHOD: _apply - apply current settings to the screen
-# ------------------------------------------------------------------
-itcl::body GlobalPref::_apply {{deleteMe 0}} {
- debug
- set changed_something 0
-
- # If you are not destroying the window, then make sure to
- # propagate the geometry info from the font frame, so that changing
- # the fonts IN the window don't cause some of the buttons to
- # get obscured...
-
- if {!$deleteMe} {
- pack propagate $itk_interior.f 1
- }
-
- foreach thunk $_fonts {
- set font [font configure test-$thunk-font]
- if {[pref get global/font/$thunk] != $font} {
- pref set global/font/$thunk $font
- }
- }
-
- foreach var [array names _new] {
- if {$_new($var) != [pref get $var]} {
- debug "$var = $_new($var)"
-
- if {$var == "gdb/mode"} {
- if {!$_new(gdb/mode)} { pref set gdb/B1_behavior 1 }
- } elseif {$var == "gdb/ImageDir"} {
- set ::gdb_ImageDir [file join $::GDBTK_LIBRARY $_new($var)]
- }
- pref set $var $_new($var)
- set changed_something 1
- }
- }
-
- if {$changed_something} {
- if {$deleteMe} { unpost }
- ManagedWin::restart
- return
- }
- if {$deleteMe} {
- unpost
- } else {
- after idle "
- update idletasks
- [code $this _resize_font_item_height]
- pack propagate $itk_interior.f 0
- "
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _cancel - forget current settings -- reset to original
-# state and close preferences
-# ------------------------------------------------------------------
-itcl::body GlobalPref::_cancel {} {
- debug
- set changed_something 0
-
- # Reset fonts if different
- foreach thunk $_fonts {
- set family [font configure global/$thunk -family]
- set size [font configure global/$thunk -size]
- if {$_original($thunk,family) != $family || $_original($thunk,size) != $size} {
- pref set global/font/$thunk \
- [list -family $_original($thunk,family) -size $_original($thunk,size)]
- set changed_something 1
- }
- }
-
- foreach var [array names _saved] {
- if {$_saved($var) != [pref get $var]} {
- debug "$var = $_saved($var)"
-
- if {$var == "gdb/mode"} {
- if {!$_saved(gdb/mode)} { pref set gdb/B1_behavior 1 }
- } elseif {$var == "gdb/ImageDir"} {
- set ::gdb_ImageDir [file join $::GDBTK_LIBRARY $_saved($var)]
- }
- pref set $var $_saved($var)
- set changed_something 1
- }
- }
-
- if {$changed_something} {
- ManagedWin::restart
- }
- unpost
-}
-
-# ------------------------------------------------------------------
-# METHOD: cancel - override modal dialog cancel method.
-# The cancel method is actually called when
-# the window is closed. Name needs fixed.
-# ------------------------------------------------------------------
-itcl::body GlobalPref::cancel {} {
- # when the window is closed, we want the preferences selected to
- # be applied.
- _apply 1
-}
diff --git a/gdb/gdbtk/library/globalpref.ith b/gdb/gdbtk/library/globalpref.ith
deleted file mode 100644
index 2f89a70ce88..00000000000
--- a/gdb/gdbtk/library/globalpref.ith
+++ /dev/null
@@ -1,47 +0,0 @@
-# Global preference class definition for GDBtk.
-# Copyright (C) 1998, 1999 Cygnus Solutions
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class GlobalPref {
- inherit ManagedWin ModalDialog
-
- private {
- variable _new
- variable _saved
- variable _icondirlist ""
- variable _original ;# Original font settings
- variable _size ;# Array tracking spinint values
- variable _fonts ;# List of all available fonts for editing
- common tracing_labels
- common inited 0
-
- method _init {}
- method _init_var {}
- method _build_win {}
- method _make_font_item {f name label font_list}
- method _resize_font_item_height {}
- method _change_icons {w args}
- method _change_font {font stupid implementation}
- method _change_size {direction font}
- method _ok {}
- method _apply {{deleteMe 0}}
- method _cancel {}
- method cancel {}
- method _toggle_tracing {win}
- }
-
- public {
- method constructor {args}
- method destructor {}
- }
-}
diff --git a/gdb/gdbtk/library/help/breakpoint.html b/gdb/gdbtk/library/help/breakpoint.html
deleted file mode 100644
index 443237a6970..00000000000
--- a/gdb/gdbtk/library/help/breakpoint.html
+++ /dev/null
@@ -1,107 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.06 [en] (X11; I; Linux 2.0.35 i686) [Netscape]">
- <TITLE>Breakpoint Window Help</TITLE>
-</HEAD>
-<BODY>
-
-<H1>The Breakpoint Window</H1>
-The Breakpoint Window lists all the various breakpoints that exist in the
-program. It facilitates modifying breakpoints (make them temporary or normal,
-disabled or enabled) and removing breakpoints.
-<UL>
-<LI><A HREF="#menus_bp">Breakpoint Menu</A></LI>
-<LI><A HREF="#menus_global">Global Menu</A></LI>
-<LI><A HREF="#display">Breakpoint Display</A></LI>
-</UL>
-
-<HR SIZE=4 WIDTH="100%">
-
-<H2>
-<A NAME="menus_bp"></A>Breakpoint Menu</H2>
-The Breakpoint Menu operates on the selected breakpoint only.&nbsp; If
-no breakpoint is selected the menu items will be disabled. The type and
-state of a breakpoint may be changed by selecting the desired type or state
-from the menu.
-<DL>
-<DT>Normal</DT>
-<DD>The selected breakpoint is a normal breakpoint</DD>
-<DT>Temporary</DT>
-<DD>Indicates that the breakpoint is temporary</DD>
-<DT>Enabled</DT>
-<DD>The breakpoint is active and will stop the debugger when it is hit.</DD>
-<DT>Disabled</DT>
-<DD>The breakpoint is being ignored. A disabled breakpoint will never get hit.</DD>
-<DT>Remove</DT>
-<DD>Deletes the breakpoint</DD>
-</DL>
-
-<HR SIZE=4 WIDTH="100%">
-<H2>
-<A NAME="menus_global"></A>Global Menu</H2>
-Items on the Global Menu affect all defined breakpoints. Users may:
-<DL>
-<DT>Show Threads</DT>
-<DD>Toggle on/off the thread column</DD>
-<DT>Enable All</DT>
-<DD>Enable all breakpoints</DD>
-<DT>Disable All</DT>
-<DD>Disable all breakpoints</DD>
-<DT>Remove All</DT>
-<DD>Delete all breakpoints</DD>
-</DL>
-
-<HR SIZE=4 WIDTH="100%">
-
-<H2><A NAME="display"></A>Breakpoint Display</H2>
-The Breakpoint Display is a table of breakpoints. The first column of the
-table (unlabeled) shows a checkbutton, indicating whether the breakpoint
-is enabled (checked) or disabled (unchecked). Disabled breakpoints are
-ignored and will not cause the program to stop.
-<P>To use the Breakpoint Menu or the Breakpoint Pop-up Menu, first use
-the left mouse button to select a breakpoint from the list, then make the
-menu selection.
-
-<H4>Modifying Breakpoints</H4>
-To&nbsp;<A NAME="display_state"></A>enable a breakpoint, simply click the
-checkbutton in the first column of the desired breakpoint so that it is
-selected (checked). To disable a breakpoint, "uncheck" the checkbutton.
-<P>To change a breakpoint's&nbsp;<A NAME="display_temp"></A>type, select
-the desired type from either the Breakpoint Menu or the Breakpoint Pop-up
-Menu.
-<P>To remove a&nbsp;<A NAME="display_remove"></A>breakpoint, use the left
-mouse button to select the breakpoint to remove and use either the Breakpoint
-Menu or the Breakpoint Pop-up Menu to select "remove". To re-install a
-breakpoint, use the <A HREF="source.html#setting_a_breakpoint">Source Window
-Display</A>.
-
-<H4><A NAME="display_popup"></A>Breakpoint Pop-up Menu</H4>
-The Breakpoint Pop-up Menu is accessed by using the mouse cursor to select
-a breakpoint from the Breakpoint Display and then clicking the right button
-on the mouse. The Pop-up allows expert users quicker access to the functions
-of the Breakpoint Menu:
-<DL>
-<DT>Normal</DT>
-<DD>The selected breakpoint is a normal breakpoint</DD>
-<DT>Temporary</DT>
-<DD>Indicates that the breakpoint is temporary</DD>
-<DT>Enabled</DT>
-<DD>The breakpoint is active and will stop the debugger when it is hit.</DD>
-<DT>Disabled</DT>
-<DD>The breakpoint is being ignored. A disabled breakpoint will never get hit.</DD>
-<DT>Remove</DT>
-<DD>Deletes the breakpoint</DD>
-<DT>Global, Show Threads</DT>
-<DD>Toggle on/off the thread column</DD>
-<DT>Global, Enable All</DT>
-<DD>Enable all breakpoints</DD>
-<DT>Global, Disable All</DT>
-<DD>Disable all breakpoints</DD>
-<DT>Global, Remove All</DT>
-<DD>Delete all breakpoints</DD>
-</DL>
-
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/browser.html b/gdb/gdbtk/library/help/browser.html
deleted file mode 100644
index df9203beedc..00000000000
--- a/gdb/gdbtk/library/help/browser.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Function Browser Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Function Browser</H1>
-<img src="images/browser1.png" alt="layout1" width=164 height=171 align="right" border=0>
-<img src="images/browser2.png" alt="layout2" width=164 height=170 align="right" border=0>
-
-<h2>Overview</h2>
-<p>The Function Browser may be used to search for specific functions
-in the executable, allowing the user to easily browse through source
-code and set and clear breakpoints at anywhere in the executable
-with ease. Its powerful regular expression searches allow the user
-to easily set breakpoints on multiple functions at once.</p>
-<p>The Function Browser has two different layouts. Both layouts contain the same four sections;
-Files, Function Filter, Functions, and Source Display.</p>
-
-<h3>Files</h3>
-<p>The Files section displays a list of all the source files. The files are
-read from the debug information in the program being debugged. To see
-the list of functions in a file, click on it. The function list should appear
-in the Functions Display and the source should appear in the Source Display.
-You can select multiple files by using the Control or Shift keys while
-clicking the left mouse button. When multiple files are selected, all the functions in those files
-are displayed in the Functions Display.
-</p>
-<p>At the bottom of the Files Display, you should see a checkbutton labelled "Hide .h files"
-and a button labelled "Select All". Checking "Hide .h files" will remove all
-files ending in ".h" from the Files Display. Clicking "Select All" will select all files
-in the Files Display.</p>
-
-<h3>Function Filter</h3>
-<p>Above the Function Display you should see a section labelled "Function Filter".
-The purpose of this section is to apply a filter to the list of functions in the Functions Display.
-For example, if you click "Select All" in the Files Display, then many hundreds of functions
-could appear in the Functions Display. To see all functions containing the string "print", for example, click on the combobox in the Function Filter and select "contains".
-Then type "print" into the box to the right and hit the enter or return key. You should see the Function
-Display updated with a list of all functions containing "print".</p>
-
-<p>Insight remember what the last filter you used was and will always open the Function
-Browser window with the last filter settings.
-</p>
-
-<h3>Function Display</h3>
-<p>The Function Display contains the list of functions in the files that have been
-selected in the Files Display, after running them through any filter settings in the Filter Display.
-There are two buttons at the bottom of the display that allow you so set or delete breakpoints on every function
-in the Function Display in one operation.
-</p>
-<p>For example, to set a breakpoint of every function name containing "print", follow the example in the Function Filter section to
-get a list of all functions containing "print". Then simply click the "Set BP" button.</p>
-
-<h3>Source Display</h3>
-<p>The Source Display shows the source code for any file selected in the File Display. If a function
-is selected in the Function Display, the first line of that function containing
-executable code will be highlighted. If no source file is found, then the function will be
-displayed disassembled.</p>
-
-<p>At the bottom of the window are two comboboxes and a text field. The combobox on the far left
-contains the function name or file location to display. Normally this is just output for your information, however
-you can type the name of any function into this box to see its source.
-</p>
-<p>To the right of this is another combobox that allows you to toggle between source and assembly.
-</p>
-<p>To the far right is an empty field. You can type a string in it and hit enter to
-search the current source file for any string.</p>
-<p>In the source window itself, you can set breakpoints just like the source window.</p>
-<h3>Popup Menu</h3>
-<p>If you click the right mouse button while over the File Browser, you should get a simple menu
-with three options; <i>Toggle Layout</i>, <i>Help</i>, and <i>Close</i>. <i>Toggle Layout</i>
-switches you between the two different Browser Window layouts. Choose the one you like best;
-Insight will remember it between sessions. <i>Help</i> pops up this help window. <i>Close</i> closes the Function Browser.
-</p>
-
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/console.html b/gdb/gdbtk/library/help/console.html
deleted file mode 100644
index d0fdfba52e1..00000000000
--- a/gdb/gdbtk/library/help/console.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<HTML>
- <HEAD>
- <TITLE>Console Window Help</TITLE>
- </HEAD>
- <BODY>
- <CENTER><H2>The Console Window</H2></CENTER>
-
- <P>The Console Window provides the traditional command-line interface to GDB.
- It is very similar to the command-line you get when GDB is run with "-nw".</P>
-
- <UL>
- <LI><A HREF="#display">Console Display</A></LI>
- <LI><A HREF="#editing">Editing Commands</A></LI>
- <LI><A HREF="#history">History Commands</A></LI>
- <LI><A HREF="#display_hlp">Getting Help</A></LI>
- </UL>
-
- <H4><A NAME="display">Console Display</A></H4>
- The Console Display is simply a scrolled window in which the debugger prompt
- appears. By default, the prompt is set to "(gdb) ", but it may be changed via a
- command line option.
-
- <P>To execute commands in the console window, simply enter
- the command in the display. If the debugger is busy, the message "Error: The
- debugger is busy." appears informing the user that the command was not accepted.</P>
-
- <P>Whenever a command is executed, the debugger's windows will update to display
- any new state information. Any output from the command is also echoed to the Console
- Window for ease of use. If an error occurs, an error message is printed to the Console
- Window. All error messages appear in the Console Window using a red typeface.
- </P>
-
- <BR>
-
- <H4><A NAME="editing">Editing Commands</A></H4>
- <P>The Console Window shell has many powerful features to help edit commands.</P>
- <UL>
- <LI> Return or Enter causes the command to be executed.
-
- <LI> Control-A moves the cursor to the beginning of the line.</LI>
- <LI> Control-E moves the cursor to the end of the line.</LI>
- <LI> Control-D or DELETE delete the character to the right of the cursor.</LI>
- <LI> BACKSPACE deletes the character to the left of the cursor.</LI>
- <LI> Control-B or LeftArrow moves the cursor to the left.</LI>
- <LI> Control-F or RightArrow moves the cursor to the right.</LI>
- <LI> Control-K deletes everything to the right of the cursor.</LI>
- <LI> Control-U deletes the text between the cursor and the start of the line.</LI>
- <LI> Control-W deletes the previous word</LI>
- <LI> END deletes the whole line.</LI>
- <LI> The mouse may also be used to position the cursor and cut and paste.</LI>
- </UL>
-
- <H4><A NAME="history">History Commands</A></H4>
- <UL>
- <LI> Conrol-P or UpArrow recalls the previous command.</LI>
- <LI> Conrol-N or DownArrow recalls the next command.</LI>
- <LI> Shift-UpArrow or Control-UpArrow will search through previous commands
- for commands that start with the same characters as the current line. For
- example, if you type "pr" and hit Shift-UpArrow, it may find commands in the
- history such as "print foo" or "print sol[x]". Each time you search it will
- go back further in the history. If nothing is on the current line, it
- acts just like Control-P or UpArrow.</LI>
- <LI> Shift-DownArrow or Control-DownArrow work in the opposite direction of
- Shift-UpArrow and Control-DownArrow. </LI>
- </UL>
-
- <BR>
-
- <H4><A NAME="display_hlp">Getting Help</A></H4>
- The Console Window has its own online help system. To access the help system, enter
- "help" at the prompt and follow the on-screen instructions. For more help, please
- consult the <!-- What is this really called? --> <I>GDB User's Guide</I>.
- </BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/debug.html b/gdb/gdbtk/library/help/debug.html
deleted file mode 100644
index 528a868ff5f..00000000000
--- a/gdb/gdbtk/library/help/debug.html
+++ /dev/null
@@ -1,133 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Internal Debugging Help</TITLE>
-</HEAD>
-<BODY>
-<H2>Insight Internal Debugging Functions</H2>
-<H3>Overview</H3>
-<P> This describes the basic internal functions for debugging Insight.
-This information is for Insight developers trying to debug Insight,
-not for users trying to debug other programs.</P>
-
-<H3>Environment Variables</H3>
-<P><b>GDBTK_DEBUG</b> - Setting this variable controls the Debug
-window.</P>
-<P><b>GDBTK_DEBUG</b> may have the following values:</P>
-<DL>
-<DT>0 or unset</DT>
-<DD>The Debug window is not opened and not listed on the menu. (You
-may still open it by typing Ctrl-U in the source window.)</DD>
-<DT>1</DT>
-<DD>The Debug window is listed on the menu, but not opened.</DD>
-<DT>2</DT>
-<DD>The Debug window is opened at startup.</DD>
-</DL>
-
-<HR>
-<P><b>GDBTK_TRACE</b> - This variable determines if tracing is enabled.
-Tracing may only be enabled at GDBTK startup. Changing <b>GDBTK_TRACE</b>
-while GDBTK is running has no effect.</P>
-<P><b>GDBTK_TRACE</b> may have the following values:</P>
-<DL>
-<DT>0 or unset</DT>
-<DD>Tracing is not enabled.</DD>
-<DT>1</DT>
-<DD>Tracing is enabled, but not started. To start tracing, you need to do
-so in the Debug Window or from the console. (The command to do this is "tk
-::debug::trace_start).</DD>
-<DT>2</DT>
-<DD>Tracing is enabled and started immediately.</DD>
-</DL>
-
-<P><b>GDBTK_DEBUGFILE</b> - This variable contains an optional filename
-where GDBTK will write all debugging information. This information will include
-the output of all "debug" and "dbug" commands, as well as tracing, if it is
-enabled. The value of
-<b>GDBTK_DEBUGFILE</b> will not change what is displayed in the Debug
-Window, with one exception; when the Debug Window is opened, it will read
-the contents of <b>GDBTK_DEBUGFILE</b> (if it is set and not "stdout").
-<P><b>GDBTK_DEBUGFILE</b> may have the following values:</P>
-<DL>
-<DT>unset</DT>
-<DD>No information will be logged.</DD>
-<DT><i>filename</i></DT>
-<DD>Debugging information will be logged to <i>filename</i>.
-<DT>"stdout"</DT>
-<DD>Debugging information will be written to stdout</DD>
-</DL>
-<HR>
-<H3>Tcl Debugging Functions</H3>
-<P> All debugging functions have been moved into debug.tcl in the ::debug
-namespace. "debug" and "dbug" are imported into the global namespace.</P>
-<P> The following are the standard debug message functions.</P>
-<pre>
-# -----------------------------------------------------------------------------
-# NAME: debug::debug
-#
-# SYNOPSIS: debug { {msg ""} }
-#
-# DESC: Writes a message to the proper output. The priority of the
-# message is assumed to be "I" (informational). This function
-# is provided for compatibility with the previous debug function.
-# For higher priority messages, use dbug.
-#
-# ARGS: msg - Message to be displayed.
-# -----------------------------------------------------------------------------
-
-# -----------------------------------------------------------------------------
-# NAME: debug::dbug
-#
-# SYNOPSIS: dbug { level msg }
-#
-# DESC: Writes a message to the proper output. Unlike debug, this
-# function take a priority level.
-#
-# ARGS: msg - Message to be displayed.
-# level - One of the following:
-# "I" - Informational only
-# "W" - Warning
-# "E" - Error
-# "X" - Fatal Error
-# ----------------------------------------------------------------------------
-</pre>
-<P> These next functions are used to trace variables, which should not be
-confused with the functions tracing.<P>
-<pre>
-# ----------------------------------------------------------------------------
-# NAME: debug::trace_var
-# SYNOPSIS: debug::trace_var {varName mode}
-# DESC: Sets up variable trace. When the trace is activated,
-# debugging messages will be displayed.
-# ARGS: varName - the variable name
-# mode - one of more of the following letters
-# r - read
-# w - write
-# u - unset
-# ----------------------------------------------------------------------------
-# ----------------------------------------------------------------------------
-# NAME: debug::remove_trace
-# SYNOPSIS: debug::remove_trace {var mode}
-# DESC: Removes a trace set up with "trace_var".
-# ----------------------------------------------------------------------------
-# ----------------------------------------------------------------------------
-# NAME: debug::remove_all_traces
-# SYNOPSIS: debug::remove_all_traces
-# DESC: Removes all traces set up with "trace_var".
-# ----------------------------------------------------------------------------
-</pre>
-<P> The following two functions may be used to start and stop tracing
-programmatically.</P>
-<pre>
-# -----------------------------------------------------------------------------
-# NAME: ::debug::trace_start
-# SYNOPSIS: ::debug::trace_start
-# DESC: Starts logging of function trace information.
-# -----------------------------------------------------------------------------
-# -----------------------------------------------------------------------------
-# NAME: ::debug::trace_stop
-# SYNOPSIS: ::debug::trace_stop
-# DESC: Stops logging of function trace information.
-# -----------------------------------------------------------------------------
-</pre>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/gbl_pref.html b/gdb/gdbtk/library/help/gbl_pref.html
deleted file mode 100644
index 2760750c4e9..00000000000
--- a/gdb/gdbtk/library/help/gbl_pref.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Global Preferences Help</TITLE>
-</HEAD>
-<BODY>
-<H1>Global Preferences</H1>
-<H3>Overview</H3>
-<P>Not yet done.</P>
-
-<P>Global Preferences topics:
-<UL>
- <LI><UL><A HREF="#">stuff</A>
- <LI><A HREF="#">stuff</A>
- <LI><A HREF="#">stuff</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="">stuff</A></H3>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/help.html b/gdb/gdbtk/library/help/help.html
deleted file mode 100644
index 7cf93c3cedd..00000000000
--- a/gdb/gdbtk/library/help/help.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Help Window Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Help Window</H1>
-<H2>Overview</H2>
-<P>This is some nice text which describes the help window, its role
-in deugging, and perhaps some of the nifty things people can do with
-this window.</P>
-
-<P>Help Window topics:
-<UL>
- <LI><A HREF="#menus">Menus</A>
- <UL>
- <LI><A HREF="#menus_file">File Menu</A></LI>
- <LI><A HREF="#menus_topics">Topics Menu</A></LI>
- </LI>
- <LI><A HREF="#display">Help Display</A>
- <UL>
- <LI><A HREF="#display_nav">Navigating the Help Window</A></LI>
- <LI><A HREF="#display_link">Definition and Page Links</A></LI>
- </UL></LI>
-</UL></P>
-
-<H2><A NAME="menus">Menus</A></H2>
-<H3><A NAME="menus_file">File Menu</A></H3>
-<H3><A NAME="menus_topics">Topics Menu</A></H3>
-
-<H3><A NAME="display">Help Display</A></H3>
-<H3><A NAME="display_nav">Navigating the Help Window</A></H3>
-<H3><A NAME="display_link">Definition and Page Links</A></H3>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/images/browser1.png b/gdb/gdbtk/library/help/images/browser1.png
deleted file mode 100644
index c005cc3fce3..00000000000
--- a/gdb/gdbtk/library/help/images/browser1.png
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/browser2.png b/gdb/gdbtk/library/help/images/browser2.png
deleted file mode 100644
index 8fdddf8c307..00000000000
--- a/gdb/gdbtk/library/help/images/browser2.png
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/frame_info.gif b/gdb/gdbtk/library/help/images/frame_info.gif
deleted file mode 100644
index 3da109f84b6..00000000000
--- a/gdb/gdbtk/library/help/images/frame_info.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/insightbwr.png b/gdb/gdbtk/library/help/images/insightbwr.png
deleted file mode 100644
index 67618b56fef..00000000000
--- a/gdb/gdbtk/library/help/images/insightbwr.png
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/mem_menu.gif b/gdb/gdbtk/library/help/images/mem_menu.gif
deleted file mode 100644
index bf874f3d4ff..00000000000
--- a/gdb/gdbtk/library/help/images/mem_menu.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/mem_popup.gif b/gdb/gdbtk/library/help/images/mem_popup.gif
deleted file mode 100644
index a1387146934..00000000000
--- a/gdb/gdbtk/library/help/images/mem_popup.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/mem_pref.gif b/gdb/gdbtk/library/help/images/mem_pref.gif
deleted file mode 100644
index 4fc8a5aaa6e..00000000000
--- a/gdb/gdbtk/library/help/images/mem_pref.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/reg.png b/gdb/gdbtk/library/help/images/reg.png
deleted file mode 100644
index 251227da79e..00000000000
--- a/gdb/gdbtk/library/help/images/reg.png
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/reg_menu.png b/gdb/gdbtk/library/help/images/reg_menu.png
deleted file mode 100644
index 54e117b948e..00000000000
--- a/gdb/gdbtk/library/help/images/reg_menu.png
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/src_bal.gif b/gdb/gdbtk/library/help/images/src_bal.gif
deleted file mode 100644
index 51871bcc7f1..00000000000
--- a/gdb/gdbtk/library/help/images/src_bal.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/src_bp_bal.gif b/gdb/gdbtk/library/help/images/src_bp_bal.gif
deleted file mode 100644
index 1f6205ac2e5..00000000000
--- a/gdb/gdbtk/library/help/images/src_bp_bal.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/src_bpop.gif b/gdb/gdbtk/library/help/images/src_bpop.gif
deleted file mode 100644
index c9e4d099d28..00000000000
--- a/gdb/gdbtk/library/help/images/src_bpop.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/src_menu.gif b/gdb/gdbtk/library/help/images/src_menu.gif
deleted file mode 100644
index 8fba6aea810..00000000000
--- a/gdb/gdbtk/library/help/images/src_menu.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/src_pop.gif b/gdb/gdbtk/library/help/images/src_pop.gif
deleted file mode 100644
index 8794c0a5908..00000000000
--- a/gdb/gdbtk/library/help/images/src_pop.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/src_stat.gif b/gdb/gdbtk/library/help/images/src_stat.gif
deleted file mode 100644
index eab58188edc..00000000000
--- a/gdb/gdbtk/library/help/images/src_stat.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/src_thread.gif b/gdb/gdbtk/library/help/images/src_thread.gif
deleted file mode 100644
index 99203ccd8c8..00000000000
--- a/gdb/gdbtk/library/help/images/src_thread.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/src_toolbar.gif b/gdb/gdbtk/library/help/images/src_toolbar.gif
deleted file mode 100644
index d6801b3edf5..00000000000
--- a/gdb/gdbtk/library/help/images/src_toolbar.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/images/watch.png b/gdb/gdbtk/library/help/images/watch.png
deleted file mode 100644
index 3145de979ec..00000000000
--- a/gdb/gdbtk/library/help/images/watch.png
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/help/index.html b/gdb/gdbtk/library/help/index.html
deleted file mode 100644
index 9d7177cf259..00000000000
--- a/gdb/gdbtk/library/help/index.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
- <title>Insight Index</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Quanta Plus">
-</head>
-<body>
-<img src="images/insightbwr.png" width=300 height=120 border=0>
-<UL>
-<LI><A HREF="breakpoint.html">Breakpoint Window</A></LI>
-<LI><A HREF="console.html">Console Window</A></LI>
-<LI><A HREF="browser.html">Function Browser</A></LI>
-<LI><A HREF="locals.html">Locals Window</A></LI>
-<LI><A HREF="memory.html">Memory Window</A></LI>
-<LI><A HREF="register.html">Register Window</A></LI>
-<LI><A HREF="session.html">Sessions</A></LI>
-<LI><A HREF="source.html">Source Window</A></LI>
-<LI><A HREF="stack.html">Stack Window</A></LI>
-<LI><A HREF="target.html">Target Window</A></LI>
-<LI><A HREF="thread.html">Thread Window</A></LI>
-<LI><A HREF="watch.html">Watch Window</A></LI>
-</UL>
-<hr>
-<h2>For Developers Only</h2>
-<ul>
-<li><a href="debug.html">"Internal Debugging Functions</a></li>
-</ul>
-<hr>
-<br>
-<a href="http://sources.redhat.com/insight/" name="Insight Home Page">Insight Home Page</a>
-<br><br><hr><br>
-<A HREF="license.html">GNU General Public License</A>
-</body>
-</html>
diff --git a/gdb/gdbtk/library/help/license.html b/gdb/gdbtk/library/help/license.html
deleted file mode 100644
index 6ce6c431ca3..00000000000
--- a/gdb/gdbtk/library/help/license.html
+++ /dev/null
@@ -1,305 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>GNU General Public License</TITLE>
-</HEAD><BODY>
-<B>The GNU General Public License
-<P></P>
-</B>Version 2, June 1991
-<P></P>
-Copyright © 1989, 1991 Free Software Foundation, Inc.
-<BR>59 Temple Place / Suite 330, Boston, MA 02111-1307, USA
-<P></P>
-Everyone is permitted to copy and distribute verbatim copies of this license
-document, but changing it is not allowed.
-<P></P>
-<B>Preamble
-<P></P>
-</B>The licenses for most software are designed to take away your freedom to share
-and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and
-change free software to make sure the software is free for all its users. This General Public
-License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some
-other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs,
-too.
-<P></P>
-When we speak of free software, we are referring to freedom, not price. Our
-General Public Licenses are designed to make sure that you have the freedom to
-distribute copies of free software (and charge for this service if you wish),
-that you receive source code or can get it if you want it, that you can change the
-software or use pieces of it in new free programs; and that you know you can
-do these things.
-<P></P>
-To protect your rights, we need to make restrictions that forbid anyone to
-deny you these rights or to ask you to surrender the rights. These restrictions
-translate to certain responsibilities for you if you distribute copies of the
-software, or if you modify it.
-<P></P>
-For example, if you distribute copies of such a program, whether gratis or for
-a fee, you must give the recipients all the rights that you have. You must
-make sure that they, too, receive or can get the source code. And you must show
-them these terms so they know their rights.
-<P></P>
-We protect your rights with two steps: (1) copyright the software, and (2)
-offer you this license which gives you legal permission to copy, distribute and/or
-modify the software.
-<P></P>
-Also, for each author's protection and ours, we want to make certain that everyone understands that
-there is no warranty for this free software. If the software is modified by
-someone else and passed on, we want its recipients to know that what they have is
-not the original, so that any problems introduced by others will not reflect on
-the original authors' reputations.
-<P></P>
-Finally, any free program is threatened constantly by software patents. We
-wish to avoid the danger that redistributors of a free program will individually
-obtain patent licenses, in effect making the program proprietary. To prevent
-this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for
-copying, distribution and modification follow.
-<P></P>
-<B>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-<P></P>
-</B>0. This License applies to any program or other work which contains a notice
-placed by the copyright holder saying it may be distributed under the terms of this
-General Public License. The `Program”, below, refers to any such program or work, and a `work based on the Program' means either the Program or any derivative work under copyright law: that is
-to say, a work containing the Program or a portion of it, either verbatim or
-with modifications and/or translated into another language. (Hereinafter,
-translation is included without limitation in the term `modification'.) Each licensee is addressed as `you'.
-<P></P>
-Activities other than copying, distribution and modification are not covered
-by this License; they are outside its scope. The act of running the Program is
-not restricted, and the output from the Program is covered only if its contents
-constitute a work based on the Program (independent of having been made by
-running the Program). Whether that is true depends on what the Program does.
-<P></P>
-<OL><LI> You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate copyright notice and
-disclaimer of warranty; keep intact all the notices that refer to this License
-and to the absence of any warranty; and give any other recipients of the Program
-a copy of this License along with the Program.
-<P></P>
-</OL>You may charge a fee for the physical act of transferring a copy, and you may
-at your option offer warranty protection in exchange for a fee.
-<P></P>
-<OL START="2"><LI> You may modify your copy or copies of the Program or any portion of it, thus
-forming a work based on the Program, and copy and distribute such modifications
-or work under the terms of Section 1 above, provided that you also meet all of
-these conditions:
-<P></P>
-</OL>a) You must cause the modified files to carry prominent notices stating that you
-changed the files and the date of any change.
-<P></P>
-b) You must cause any work that you distribute or publish, that in whole or in
-part contains or is derived from the Program or any part thereof, to be licensed
-as a whole at no charge to all third parties under the terms of this License.
-<P></P>
-c) If the modified program normally reads commands interactively when run, you
-must cause it, when started running for such interactive use in the most ordinary
-way, to print or display an announcement including an appropriate copyright
-notice and a notice that there is no warranty (or else, saying that you provide a
-warranty) and that users may redistribute the program under these conditions,
-and telling the user how to view a copy of this License. (Exception: if the
-Program itself is interactive but does not normally print such an announcement,
-your work based on the Program is not required to print an announcement.)
-<P></P>
-These requirements apply to the modified work as a whole. If identifiable
-sections of that work are not derived from the Program, and can be reasonably
-considered independent and separate works in themselves, then this License, and its
-terms, do not apply to those sections when you distribute them as separate
-works. But when you distribute the same sections as part of a whole which is a work
-based on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the entire whole,
-and thus to each and every part regardless of who wrote it.
-<P></P>
-Thus, it is not the intent of this section to claim rights or contest your
-rights to work written entirely by you; rather, the intent is to exercise the
-right to control the distribution of derivative or collective works based on the
-Program.
-<P></P>
-In addition, mere aggregation of another work not based on the Program with
-the Program (or with a work based on the Program) on a volume of a storage or
-distribution medium does not bring the other work under the scope of this License.
-<P></P>
-<OL START="3"><LI> You may copy and distribute the Program (or a work based on it, under Section
-2) in object code or executable form under the terms of Sections 1 and 2 above
-provided that you also do one of the following:
-<P></P>
-</OL>a) Accompany it with the complete corresponding machine-readable source code,
-which must be distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-<P></P>
-b) Accompany it with a written offer, valid for at least three years, to give any
-third party, for a charge no more than your cost of physically performing
-source distribution, a complete machine-readable copy of the corresponding source
-code, to be distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-<P></P>
-c) Accompany it with the information you received as to the offer to distribute
-corresponding source code. (This alternative is allowed only for noncommercial
-distribution and only if you received the program in object code or executable
-form with such an offer, in accord with Subsection b above.)
-<P></P>
-The source code for a work means the preferred form of the work for making
-modifications to it. For an executable work, complete source code means all the
-source code for all modules it contains, plus any associated interface definition
-files, plus the scripts used to control compilation and installation of the
-executable. However, as a special exception, the source code distributed need not
-include anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the operating
-system on which the executable runs, unless that component itself accompanies the
-executable.
-<P></P>
-If distribution of executable or object code is made by offering access to
-copy from a designated place, then offering equivalent access to copy the source
-code from the same place counts as distribution of the source code, even though
-third parties are not compelled to copy the source along with the object code.
-<P></P>
-<OL START="4"><LI> You may not copy, modify, sublicense, or distribute the Program except as
-expressly provided under this License. Any attempt otherwise to copy, modify,
-sublicense or distribute the Program is void, and will automatically terminate your
-rights under this License. However, parties who have received copies, or
-rights, from you under this License will not have their licenses terminated so long
-as such parties remain in full compliance.
-<P></P>
-<LI> You are not required to accept this License, since you have not signed it.
-However, nothing else grants you permission to modify or distribute the Program or
-its derivative works. These actions are prohibited by law if you do not accept
-this License. Therefore, by modifying or distributing the Program (or any work
-based on the Program), you indicate your acceptance of this License to do so,
-and all its terms and conditions for copying, distributing or modifying the
-Program or works based on it.
-<P></P>
-<LI> Each time you redistribute the Program (or any work based on the Program), the
-recipient automatically receives a license from the original licensor to copy,
-distribute or modify the Program subject to these terms and conditions. You
-may not impose any further restrictions on the recipients' exercise of the rights granted herein.
-<P></P>
-</OL>You are not responsible for enforcing compliance by third parties to this
-License.
-<P></P>
-<OL START="7"><LI> If, as a consequence of a court judgment or allegation of patent infringement
-or for any other reason (not limited to patent issues), conditions are imposed
-on you (whether by court order, agreement or otherwise) that contradict the
-conditions of this License, they do not excuse you from the conditions of this
-License. If you cannot distribute so as to satisfy simultaneously your obligations
-under this License and any other pertinent obligations, then as a consequence
-you may not distribute the Program at all. For example, if a patent license
-would not permit royalty-free redistribution of the Program by all those who
-receive copies directly or indirectly through you, then the only way you could
-satisfy both it and this License would be to refrain entirely from distribution of
-the Program.
-<P></P>
-</OL>If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply and the
-section as a whole is intended to apply in other circumstances.
-<P></P>
-It is not the purpose of this section to induce you to infringe any patents or
-other property right claims or to contest validity of any such claims; this
-section has the sole purpose of protecting the integrity of the free software
-distribution system, which is implemented by public license practices. Many people
-have made generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that system; it is up
-to the author/donor to decide if he or she is willing to distribute software
-through any other system and a licensee cannot impose that choice.
-<P></P>
-This section is intended to make thoroughly clear what is believed to be a
-consequence of the rest of this License.
-<P></P>
-<OL START="8"><LI> If the distribution and/or use of the Program is restricted in certain
-countries either by patents or by copyrighted interfaces, the original copyright
-holder who places the Program under this License may add an explicit geographical
-distribution limitation excluding those countries, so that distribution is
-permitted only in or among countries not thus excluded. In such case, this License
-incorporates the limitation as if written in the body of this License.
-<P></P>
-<LI> The Free Software Foundation may publish revised and/or new versions of the
-General Public License from time to time. Such new versions will be similar in
-spirit to the present version, but may differ in detail to address new problems
-or concerns.
-<P></P>
-</OL>Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and `any later version', you have the option of following the terms and conditions either of that
-version or of any later version published by the Free Software Foundation. If the
-Program does not specify a version number of this License, you may choose any
-version ever published by the Free Software Foundation.
-<P></P>
-<OL><LI> If you wish to incorporate parts of the Program into other free programs whose
-distribution conditions are different, write to the author to ask for
-permission. For software which is copyrighted by the Free Software Foundation, write to
-the Free Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status of all
-derivatives of our free software and of promoting the sharing and reuse of software
-generally.
-<P></P>
-</OL>NO WARRANTY
-<P></P>
-<OL><LI> BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE
-PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED
-IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM `AS IS' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
-NECESSARY SERVICING, REPAIR OR CORRECTION.
-<P></P>
-<LI> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
-COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
-PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
-SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
-INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
-THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
-PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-<P></P>
-</OL>END OF TERMS AND CONDITIONS
-<P></P>
-<B>How to Apply These Terms to Your New Programs
-<P></P>
-</B>If you develop a new program, and you want it to be of the greatest possible
-use to the public, the best way to achieve this is to make it free software
-which everyone can redistribute and change under these terms.
-<P></P>
-To do so, attach the following notices to the program. It is safest to attach
-them to the start of each source file to most effectively convey the exclusion
-of warranty; and each file should have at least the `copyright' line and a pointer to where the full notice is found.
-<P></P>
-<I>one line for the program's name and a brief idea of what it does.
-<BR></I>Copyright (C) 19<I>yy</I> <I>name of author</I>
-<BR>
-<BR>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.
-<BR>
-<BR>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.
-<BR>
-<BR>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.
-<P></P>
-Also add information on how to contact you by electronic and paper mail.
-<P></P>
-If the program is interactive, make it output a short notice like the
-following example when it starts in an interactive mode:
-<P></P>
-Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes
-with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain
-conditions; type `show c' for details.
-<P></P>
-The hypothetical commands <B>show w</B> and <B>show c</B> should show the appropriate parts of the General Public License. Of course,
-the commands you use may be called something other than show w and show c; they can be mouse clicks or menu items—whatever suits your program.
-<P></P>
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a `copyright disclaimer' for the program, if necessary. The following is a sample (when copying, alter
-the names).
-<P></P>
-Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
-<BR>
-<BR>signature of Ty Coon, 1 April 1989
-<BR>Ty Coon, President of Vice
-<P></P>
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may consider
-it more useful to permit linking proprietary applications with the library. If
-this is what you want to do, use the GNU Library General Public License instead of this License.
-<P></P>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/locals.html b/gdb/gdbtk/library/help/locals.html
deleted file mode 100644
index 5612b7de296..00000000000
--- a/gdb/gdbtk/library/help/locals.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Local Variables Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Local Variables Window</H1>
-<H2>Overview</H2>
-<p>The Local Variables Window displays all local variables in scope. It may be used to
-visualize and edit local variables. To open the Local Variables window, click on
-small house icon on the toolbar, or select "Local Variables" under the View
-pulldown menu.</p>
-
-<H3>Locals Display</H3>
-
-<p>Pointers, structures, and classes appear in the display with small expansion
-box before their names. To dereference pointers or
-view the members of classes or structures, click
-the closed expansion box (which appears as a small plus sign, "+") to "expand"
-the listing. The expansion box changes to a minus sign, "-", indicating that the
-display is now open. Pointers, structures and classes may be expanded recursively
-to allow multiple pointer dereferences and embedded structure viewing.</p>
-
-<P>The Locals Display updates after every execution of the program and highlights
-in green those variables whose values have changed.</P>
-
-<P>The Locals Window will, by default, display all pointers in hexadecimal and all
-other variables in decimal. To change the display format for a variable, select
-the Format option from the popup-menu.</P>
-
-<H3>Editing a Variable</H3>
-<p>To edit a variable, either double-click the left mouse button on the value of the variable in
-the display or select the Edit option from the pop-up menu. To abort editing a variable's value,
-simply press the escape key on the keyboard. The variable's original value is restored.</p>
-
-<H3>Local Variable Pop-up Menu</H3>
-<p>The pop-up menu provides quick access to the functions of the Local Variables Window.
-To use the pop-up menu, click the right mouse button while over a variable.</p>
-<DL>
- <dt>Format<dd>Change the display format of the variable.</dd></dt>
- <dt>Edit<dd>Edit the variable's value.</dd></dt>
- <dt>Delete<dd>Remove the variable from the display.</dd></dt>
- <dt>Dump Memory<dd>Open a Memory Window with the variable's value as an aaddress.</dd></dt>
- <dt>Help<dd>Open this help page.</dd></dt>
- <dt>Close<dd>Close the Local Variables Window.</dd></dt>
-</DL>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/memory.html b/gdb/gdbtk/library/help/memory.html
deleted file mode 100644
index afa2fe8fb47..00000000000
--- a/gdb/gdbtk/library/help/memory.html
+++ /dev/null
@@ -1,240 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.06 [en] (X11; I; Linux 2.0.35 i686) [Netscape]">
- <TITLE>Memory Window Help</TITLE>
-</HEAD>
-<BODY>
-
-<H1>
-The Memory Window</H1>
-The Memory Window allows users to display and edit the contents of memory.
-The Memory Window Preferences controls all of the display characteristics
-of the Memory Window.
-<BR>&nbsp;
-<LI>
-<A HREF="#menus">Address Menu</A></LI>
-
-<LI>
-<A HREF="#display">Memory Display</A></LI>
-
-<LI>
-<A HREF="#prefs">Memory Window Preferences</A></LI>
-
-<H2>
-
-<HR WIDTH="100%"></H2>
-
-<H2>
-<A NAME="menus"></A>Address Menu</H2>
-<IMG SRC="images/mem_menu.gif" HEIGHT=66 WIDTH=160>
-<P>This pulldown menu contains the following three items.
-<DL>
-<DT>
-<A NAME="menus_auto"></A>Auto Update</DT>
-
-<DD>
-When selected, causes the Memory Window to update the display every.&nbsp;
-If it is not selected, the display will be frozen until it is selected
-or "Update Now" is selected.</DD>
-
-<DT>
-<A NAME="menus_now"></A>Update Now</DT>
-
-<DD>
-Forces the Memory Window to update the display immediately.</DD>
-
-<DT>
-<A NAME="menus_prefs"></A>Preferences</DT>
-
-<DD>
-Opens the <A HREF="#prefs">Memory Window Preferences</A> dialog.</DD>
-</DL>
-
-<H2>
-
-<HR WIDTH="100%"></H2>
-
-<H2>
-<A NAME="display"></A>Memory Display</H2>
-Like the <A HREF="register.html">Register Window</A>, the Memory Window
-display is organized into a spreadsheet. The address of any cell in the
-Display can be determined by appending the row and column headers for the
-cell. Optionally, an ASCII display of the memory appears at the right.
-Any non-ASCII-representable byte in memory will appear in the ASCII Display
-as a control character (a dot, ".", by default). The <A HREF="#pref">Memory
-Preferences Dialog</A> may be used to alter the appearance of the Memory
-Window.
-<P><A NAME="display_nav"></A>To navigate the Memory Window, use the mouse
-and click the cell of interest. As an alternative, pressing the arrow keys
-on the keyboard will focus successive cells, from left to right, top to
-bottom. The focus will wrap from left to right, so hitting the right arrow
-key will keep advancing the address of the cell selected.
-<H4>
-<A NAME="display_edit"></A>Editing Memory</H4>
-To edit memory, simply enter the new value of the memory into the cell
-and press the enter key on the keyboard. As with the
-<A HREF="register.html">Register
-Window</A>, be careful of the input format used to enter data -- the debugger
-is capable of parsing binary, octal, decimal, and hexadecimal values. All
-entries will be padded with leading zeroes, if necessary.&nbsp; After you
-hit enter, the memory window will automatically shift focus to the next
-cell.
-<P>To edit part of the value of a cell, you can use the mouse to poistion
-the cursor to the exact part of the value you want to change.&nbsp; You
-can also use the backspace key to delete part of the value without deleting
-the whole value.
-<P>Another way to edit memory is to edit the ASCII window.&nbsp; To do
-this, select a cell using the mouse.&nbsp; Then type in a new string.
-<H4>
-<A NAME="display_popup"></A>Memory Pop-up Menu</H4>
-Clicking the right mouse button while the mouse cursor lies within the
-bounds of any cell brings up the following menu:
-<P><IMG SRC="images/mem_popup.gif" HEIGHT=100 WIDTH=220>
-<DL>
-<DT>
-Auto Update</DT>
-
-<DL>
-<DT>
-When selected, the Memory Window will track changes in memory shown in
-the Display.&nbsp; When not selected, the Memory Window is "frozen", representing
-a "snapshot" of memory.</DT>
-</DL>
-
-<DT>
-Update Now</DT>
-
-<DL>
-<DT>
-&nbsp;Forces the Memory Window to update the display immediately.</DT>
-</DL>
-
-<DT>
-Go To <I>address</I></DT>
-
-<DD>
-The Memory Window Display is updated to show memory starting at address
-<I>address</I>.</DD>
-
-<DT>
-Open New Window at <I>address</I></DT>
-
-<DD>
-A new Memory Window is opened, displaying memory at address <I>address</I></DD>
-
-<DT>
-Preferences...</DT>
-
-<DD>
-Opens the Memory Window Preferences for editing the appearance of the Memory
-Window Display.</DD>
-</DL>
-
-<H2>
-
-<HR WIDTH="100%"></H2>
-
-<H2>
-<A NAME="prefs"></A>Memory Window Preferences</H2>
-Memory Window Preference Dialog governs the appearance of the Memory Window:
-the total number of bytes displayed, the size of each cell, ASCII control
-character.
-<P><IMG SRC="images/mem_pref.gif" HEIGHT=417 WIDTH=330>
-<H4>
-<A NAME="prefs_size"></A>Size of the Display Cells</H4>
-This attribute controls how many bytes appear in each cell. Valid cell
-sizes in the Memory Window may be:
-<DL>
-<DT>
-Byte</DT>
-
-<DD>
-Each cell is exactly one byte</DD>
-
-<DT>
-Half Word</DT>
-
-<DD>
-Cells are displayed with two bytes</DD>
-
-<DT>
-Word</DT>
-
-<DD>
-Each cell contains four bytes</DD>
-
-<DT>
-Double Word</DT>
-
-<DD>
-Cells contain eight bytes</DD>
-
-<DT>
-Float</DT>
-
-<DD>
-Each cell contains four bytes, displayed as a floating point number</DD>
-
-<DT>
-Double Float</DT>
-
-<DD>
-Cells are displayed as floating point, eight bytes each</DD>
-</DL>
-
-<H4>
-<A NAME="prefs_fmt"></A>Format of the Display Cells</H4>
-The Format option of the Memory Preferences Dialog governs how the debugger
-represents the memory. Possible representations include:
-<DL>
-<DT>
-Binary</DT>
-
-<DD>
-The values are shown as binary numbers</DD>
-
-<DT>
-Signed Decimal</DT>
-
-<DD>
-The values are shown as signed decimal numbers</DD>
-
-<DT>
-Octal</DT>
-
-<DD>
-Each cell is represented as an octal number</DD>
-
-<DT>
-Unsigned Decimal</DT>
-
-<DD>
-Values are displayed as unsigned decimals</DD>
-
-<DT>
-Hex</DT>
-
-<DD>
-Memory is displayed as a hexadecimal number. This is the default.</DD>
-</DL>
-
-<H4>
-<A NAME="prefs_bytes"></A>Size of the Memory Window</H4>
-The size of the memory window determines how much memory is actually presented
-to the user. The total number of bytes shown can either be determined by
-the size of the window, in which case resizing the Memory Window will cause
-more or less memory to be displayed, or fixed at some specified number
-of bytes. By default, the Memory Window shows 128 bytes of memory.
-<H4>
-<A NAME="prefs_misc"></A>Miscellaneous</H4>
-Miscellaneous memory preferences include the option to display the ASCII
-representation of the memory, including what character to use for non-ASCII
-bytes (the "control" character). Additionally, users may specify the number
-of bytes per row, either by typing a number into the box or by choosing one
-from the list. The default is sixteen bytes per row. If the entered value is
-not a multiple of the cell size then it will be automatically rounded up. The
-maximum permitted value is 150 (before rounding).
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/register.html b/gdb/gdbtk/library/help/register.html
deleted file mode 100644
index 06513445eee..00000000000
--- a/gdb/gdbtk/library/help/register.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Register Window Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Register Window</H1>
-<P>The Register Window lists registers and their contents for
-the selected stack frame. It permits viewing the contents of registers
-in different formats, editing register values, and some display
-customizations.</P>
-
-<img src="images/reg.png" alt="register window" width=387 height=370 align="middle" border=0>
-
-<p>In the image above, you can see all the registers on the left and their values on the right.
-At the top is an option menu to allow you to choose what group of registers to display.
-The groups names are preset according to the architecture being debugged. The default is "all".
-Registers highlighted in green have recently changed.
-</p>
-<P>The Register Window will update the register contents in the display
-to match the stack frame currently being viewed in the <A HREF="source.html">
-Source Window</A> and <A HREF="stack.html">Stack Window</A>.</P>
-<p>Each time the program stops, the register window will automatically update.
-Registers that have changed since the last stop will be displayed in green.</p>
-
-
-
-<H3>The Register Pop-up Menu</H3>
-<img src="images/reg_menu.png" alt="register popup menu" width=396 height=388 border=0>
-<P>
-To activate the pop-up menu, click the right mouse button over a register.
-This will allow you change the way the register is displayed, or to remove
-it from the display. Or you can add the register to the watch window.
-For integer registers, you can also open a memory window at the
-location pointed to by the register.</P>
-
-<H3>Editing a Register</H3>
-<P>
-To edit a register, simply click on it with the left mouse button. Type
-in the new value and hit enter. You can enter a decimal, hex, or float number and
-the type will be converted if possible. You may also enter an expression to be evaluated.
-For example, to set $r3 to the same as $r4, edit $r3 and enter "$r4" as the value. In the same
-way, you can set $pc to "main".
-The value of the register is set to the current value of the expression; it will not be reevaluated
-if the expression's value later changes.
-</P>
-<P>Press the escape key on the keyboard to cancel your edit.</P>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/session.html b/gdb/gdbtk/library/help/session.html
deleted file mode 100644
index 6c770e8f022..00000000000
--- a/gdb/gdbtk/library/help/session.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<html>
-<head>
-<title>Sessions</title>
-</head>
-<body>
-
-<center><h2>Sessions</h2></center>
-
-Insight will save your session for you automatically. The ``session''
-is essentially a group of settings which are keyed by the name of the
-inferior which you are debugging.<p>
-
-Insight will show a list of the five most recent previous sessions on
-the <tt>File</tt> menu. Choosing an item from this list will cause
-Insight to load the indicated executable and restore all the settings
-saved in the session.<p>
-
-The settings stored in a session are:
-<ul>
-<li> The name of the executable.
-
-<li> The inferior's command-line arguments.
-
-<li> The target.
-
-<li> The path used when searching for source files.
-
-<li> The current working directory.
-
-<li> The breakpoints and watchpoints, including conditions, actions,
- and the like.
-</ul>
-<p>
-
-More items may be added to this list as the need arises.<p>
-
-At present there is no way to disable session saving.<p>
-
-</body>
-</html>
diff --git a/gdb/gdbtk/library/help/source.html b/gdb/gdbtk/library/help/source.html
deleted file mode 100644
index 0e04eac6579..00000000000
--- a/gdb/gdbtk/library/help/source.html
+++ /dev/null
@@ -1,424 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.06 [en] (X11; I; Linux 2.0.35 i686) [Netscape]">
- <TITLE>Source Window Help</TITLE>
-</HEAD>
-<BODY>
-
-<CENTER>
-<H1>The Source Window</H1></CENTER>
-
-<BR>The Source Window is the primary interface between the user and
-the debugger; it is automatically opened when the debugger starts. The
-Source Window displays the status of the program, controls execution of
-the program, and allows visualization of the program execution.
-
-<H3><A HREF="#menus">Menus</A></H3>
-
-<UL>
-<LI><A HREF="#menus_file">File Menu</A></LI>
-<LI><A HREF="#menus_run">Run Menu</A></LI>
-<LI><A HREF="#menus_view">View Menu</A></LI>
-<LI><A HREF="#menus_control">Control Menu</A></LI>
-<LI><A HREF="#menus_prefs">Preferences Menu</A></LI>
-</UL>
-
-<H3><A HREF="#toolbar">Toolbar</A></H3>
-
-<UL>
-<LI><A HREF="#toolbar_exec">Execution Control Buttons</A></LI>
-<LI><A HREF="#toolbar_window">Window Buttons</A></LI>
-<LI><A HREF="#toolbar_frame">Frame Control</A></LI>
-</UL>
-
-<H3><A HREF="#display">Source Window Display</A></H3>
-
-<UL>
-<LI><A HREF="#setting_a_breakpoint">Setting a Breakpoint</A></LI>
-<LI><A HREF="#viewing_breakpoints">Viewing Breakpoints</A></LI>
-<LI><A HREF="#display_balloon">Variable Balloons</A></LI>
-<LI><A HREF="#display_popup">Source Pop-up Menus</A></LI>
-</UL>
-
-<H3><A HREF="#status">Source Window Status Bars</A></H3>
-
-<UL>
-<LI><A HREF="#status_bar">Program Status Bar</A></LI>
-<LI><A HREF="#status_mode">Source Display Status Bar</A></LI>
-</UL>
-
-<H3><A HREF="#search">Search Entry</A></H3>
-
-<HR>
-<H2><A NAME="menus"></A>Menus</H2>
-
-<IMG SRC="images/src_menu.gif">
-<H4><A NAME="menus_file"></A>File Menu</H4>
-
-<DL>
-<DT>Open</DT>
-<DD>Opens a file selection dialog to select the executable to debug</DD>
-<DT>Close</DT>
-<DD>Closes a previously opened executable file</DD>
-<DT>Source</DT>
-<DD>Reads and executes GDB commands from a text file</DD>
-<DT>Target Settings...</DT>
-<DD>Opens the <A HREF="target.html">Target Selection Dialog</A> to edit target
-settings</DD>
-<DT>Page Setup</DT>
-<DD>(Windows only) Opens the Windows Page Setup dialog to configure printing</DD>
-<DT>Print</DT>
-<DD>Print the contents of the Source Window Display</DD>
-<DT>Exit</DT>
-<DD>Exits the debugger</DD>
-</DL>
-
-<H4><A NAME="menus_run"></A>Run Menu</H4>
-<DL>
-<DT>Connect to target</DT>
-<DD>Connect to the target specified in the <A HREF="target.html">Target Selection Dialog</A>. Open the dialog if there are no current settings.</DD>
-<DT>Download</DT>
-<DD>Initiates download of the executable onto the target via the protocol specified
-in the <A HREF="target.html">Target Selection Dialog</A></DD>
-<DT>Run</DT>
-<DD>Runs or re-runs the program</DD>
-<DT>Disconnect</DT>
-<DD>Close a previously opened connection</DD>
-</DL>
-
-<H4><A NAME="menus_view"></A>View Menu</H4>
-<DL>
-<DT>Stack</DT>
-<DD>Open a <A HREF="stack.html">Stack Window</A></DD>
-<DT>Registers</DT>
-<DD>Open a <A HREF="register.html">Register Window</A></DD>
-<DT>Memory</DT>
-<DD>Open a <A HREF="memory.html">Memory Window</A></DD>
-<DT>Watch Expressions</DT>
-<DD>Open a <A HREF="watch.html">Watch Window</A></DD>
-<DT>Local Variables</DT>
-<DD>Open a <A HREF="locals.html">Locals Window</A></DD>
-<DT>Breakpoints</DT>
-<DD>Open a <A HREF="breakpoint.html">Breakpoint Window</A></DD>
-<DT>Console</DT>
-<DD>Open a <A HREF="console.html">Console Window</A></DD>
-<DT>Function Browser</DT>
-<DD>Open a window allowing the user to easily search for functions and
-set breakpoints.</DD>
-<DT>Thread List</DT>
-<DD>Open a window that displays all current threads and allows the user
-to change active threads</DD>
-</DL>
-
-<H4><A NAME="menus_control"></A>Control Menu</H4>
-<DL>
-<DT><A HREF="#step_button">Step</A></DT>
-<DD>Step program until it reaches a different source line</DD>
-<DT><A HREF="#next_button">Next</A></DT>
-<DD>Step program, proceeding through subroutine calls</DD>
-<DT><A HREF="#finish_button">Finish</A></DT>
-<DD>Execute until the current stack frame returns</DD>
-<DT><A HREF="#continue_button">Continue</A></DT>
-<DD>Continue program being debugged, after signal or breakpoint</DD>
-<DT><A HREF="#stepi_button">Step Asm Inst</A></DT>
-<DD>Step one instruction exactly</DD>
-<DT><A HREF="#nexti_button">Next Asm Inst</A></DT>
-<DD>Step one instruction, but proceed through subroutine calls</DD>
-<DT>Automatic Step</DT>
-<DD>Automatically step the program every two seconds</DD>
-</DL>
-
-<H4><A NAME="menus_prefs"></A>Preferences Menu</H4>
-<DL>
-<DT>Global</DT>
-<DD>Opens the <A HREF="gbl_pref.html">Global Preferences Dialog</A> and allows
-editing of global settings</DD>
-<DT>Source</DT>
-<DD>Opens the <A HREF="src_pref.html">Source Preferences Dialog</A> and allows
-editing of Source Window settings</DD>
-</DL>
-
-<HR>
-
-<H2><A NAME="toolbar"></A>Toolbar</H2>
-<IMG SRC="images/src_toolbar.gif">
-The Source Window toolbar consists of three functional sections: execution
-control buttons, debugger window buttons, and stack frame control buttons.
-
-<BR>
-<H4><A NAME="toolbar_exec"></A>Execution Control Buttons</H4>
-These convenience buttons provide on-screen access to the most important
-debugger execution control functions:
-<DL>
-<DT><A NAME="run_button"></A><IMG SRC="../images/run.gif"> or
-<IMG SRC="../images2/run.gif"> Run </DT>
-<DD>The Run Button will start execution of the program, including target selection
-and downloading, if necessary. If the program is already running, the Run
-Button will start the program from the beginning (re-run it).</DD>
-
-<DT><A NAME="stop_button"></A><IMG SRC="../images/stop.gif"> or
-<IMG SRC="../images2/stop.gif"> Stop</DT>
-<DD>The Stop Button will interrupt execution of the program (provided this
-feature is supported by the underlying debugging protocol and hardware)
-or cancel downloads. It is also used as an indication that the debugger
-is busy.</DD>
-<DT><A NAME="step_button"></A><IMG SRC="../images/step.gif"> or <IMG SRC="../images2/step.gif">Step</DT>
-<DD>Step the program until it reaches a different source line</DD>
-<DT><A NAME="next_button"></A><IMG SRC="../images/next.gif"> or <IMG SRC="../images2/next.gif">Next</DT>
-<DD>Step the program, proceeding through subroutine calls</DD>
-<DT><A NAME="finish_button"></A><IMG SRC="../images/finish.gif"> or <IMG SRC="../images2/finish.gif"> Finish</DT>
-<DD>Execute until the current stack frame returns</DD>
-<DT><A NAME="continue_button"></A><IMG SRC="../images/continue.gif"> or <IMG SRC="../images2/continue.gif"> Continue</DT>
-<DD>Continue the program being debugged, after signal or breakpoint</DD>
-<DT><A NAME="stepi_button"></A><IMG SRC="../images/stepi.gif"> or <IMG SRC="../images2/stepi.gif"> Step Asm Inst</DT>
-<DD>Step one instruction exactly. This function is only available when the
-Source Window is displaying assembler code.</DD>
-<DT><A NAME="nexti_button"></A><IMG SRC="../images/nexti.gif"> or <IMG SRC="../images2/nexti.gif"> Next Asm Inst</DT>
-<DD>Step one instruction, but proceed through subroutine calls. This function
-is only available when the Source Window is displaying assembler code.</DD>
-</DL>
-
-<H4>
-<A NAME="toolbar_window"></A>Window Buttons</H4>
-The Debugger Window buttons give instant access to the Debugger's auxiliary
-windows:
-<DL>
-<DT><A NAME="register_button"></A><IMG SRC="../images/reg.gif"> or <IMG SRC="../images2/reg.gif"> Registers</DT>
-<DD>Open a <A HREF="register.html">Register Window</A></DD>
-<DT><A NAME="memory_button"></A><IMG SRC="../images/memory.gif"> or <IMG SRC="../images2/memory.gif"> Memory</DT>
-<DD>Open a <A HREF="memory.html">Memory Window</A></DD>
-<DT><A NAME="stack_button"></A><IMG SRC="../images/stack.gif"> or <IMG SRC="../images2/stack.gif"> Stack</DT>
-<DD>Open a <A HREF="stack.html">Stack Window</A></DD>
-<DT><A NAME="watch_button"></A><IMG SRC="../images/watch.gif"> or <IMG SRC="../images2/watch.gif"> Watch Expressions</DT>
-<DD>Open a <A HREF="watch.html">Watch Window</A></DD>
-<DT><A NAME="locals_button"></A><IMG SRC="../images/vars.gif"> or <IMG SRC="../images2/vars.gif"> Local Variables</DT>
-<DD>Open a <A HREF="locals.html">Locals Window</A></DD>
-<DT><A NAME="breakpoints_button"></A><IMG SRC="../images/bp.gif"> or <IMG SRC="../images2/bp.gif"> Breakpoints</DT>
-<DD>Open a <A HREF="breakpoint.html">Breakpoint Window</A></DD>
-<DT><A NAME="console_button"></A><IMG SRC="../images/console.gif"> or <IMG SRC="../images2/console.gif"> Console</DT>
-<DD>Open a <A HREF="console.html">Console Window</A></DD>
-</DL>
-
-<H4><A NAME="toolbar_frame"></A>Frame Control</H4>
-The Frame Control area of the toolbar displays information about the PC
-of the current frame, and the frame control buttons may be used to navigate
-through the call stack. Whenever any of these buttons are used, both the
-Source Window Display and the <A HREF="stack.html">Stack Window</A> will
-show the selected frame.
-<DL>
-<DT><IMG SRC="images/frame_info.gif" > Frame Information Display</DT>
-<DD>The left half of the frame information display shows the value of the PC
-in the current frame. The right half shows the line number of the PC in
-the source file, if available.</DD>
-
-<DT><A NAME="up_button"></A><IMG SRC="../images/up.gif"> or <IMG SRC="../images2/up.gif"> Up</DT>
-<DD>Select and view the stack frame that called this one</DD>
-
-<DT><A NAME="down_button"></A><IMG SRC="../images/down.gif"> or <IMG SRC="../images2/down.gif"> Down</DT>
-<DD>Select and view the stack frame called by this one</DD>
-
-<DT><A NAME="bottom_button"></A><IMG SRC="../images/bottom.gif"> or <IMG SRC="../images2/bottom.gif"> Bottom</DT>
-<DD>Select and view the bottom-most stack frame</DD>
-</DL>
-
-<HR>
-
-<H2><A NAME="display"></A>Source Display</H2>
-The Source Display is used for many things: browsing source code, setting
-and clearing breakpoints, and a few other special functions. Executable
-lines (those for which executable code was generated by the compiler) are
-denoted with a marker (a dash, "-") in the first column of the display.
-<P>The debugger highlights the PC in the current frame in either green,
-indicating that the PC is in the bottom-most frame (i.e., it is being executed)
-or gold, indicating that the PC is contained in a frame that is not currently
-executing (because it has called another function). A blue highlight is
-used by the debugger to indicate a browsing position: the PC is contained
-in a frame that is not executing or on the call stack. All highlight colors
-are user selectable in the <A HREF="src_pref.html">Source Preferences</A>.
-
-<BR>
-<H4><A NAME="setting_a_breakpoint"></A>Setting a Breakpoint</H4>
-Moving the mouse pointer over the "hot spot" of an executable line will
-change the mouse cursor to a large dot. Clicking the left mouse button
-will then toggle a breakpoint at this line. If no breakpoint exists, one
-will be installed and the dash in the left margin will change into a red
-breakdot. If a breakpoint exists, it will be removed and the red breakdot
-will revert back to a dash. The executable line marker shows the status
-of each line: an empty marker (the dash) indicates that no breakpoints
-are set at the line. A colored breakdot indicates that a breakpoint exists
-at the line (see <A HREF="#display_popup">Source Pop-up Menus</A> for more
-information on setting different types of breakpoints and their representations
-in the Source Display).
-<P>Black breakdots in the Source Window display indicate that the breakpoint
-has been disabled. To re-enable the breakpoint, click the enable/disable
-checkbox in the Breakpoint Window (see <A HREF="breakpoint.html#display_state">
-Enabling/Disabling Breakpoints</A>).
-
-<BR>
-<H4><A NAME="viewing_breakpoints"></A>Viewing Breakpoints</H4>
-You can find out more information about a breakpoint by moving the cursor
-over a breakpoint. A balloon window will pop up with additional information.
-To get a list of all the active breakpoints, you will need to open a
-<A HREF="breakpoint.html">breakpoint window</A>.
-<IMG SRC="images/src_bp_bal.gif">
-
-<BR>
-<H4><A NAME="display_balloon"></A>Variable Balloons</H4>
-If the program to be debugged has started and is stopped, the display
-will show the value of variables in variable
-balloons. To activate a variable balloon, simply hold the mouse cursor
-over the name of a variable in the Source Display for a second or two:
-the debugger displays the name of the variable, its type, and its value
-in a pop-up balloon.
-<IMG SRC="images/src_bal.gif">
-
-<BR>
-<H4><A NAME="display_popup"></A>Source Pop-up Menus</H4>
-The Source Display has two pop-up menus. One is activated by clicking the
-right mouse button when the mouse cursor is over an executable line marker's
-hot spot. This pop-up menu looks like this:
-<P><IMG SRC="images/src_bpop.gif">
-<DL>
-<DT>Continue to Here</DT>
-<DD>Continue program execution until it reaches this point. All breakpoints
-will be ignored. Be aware that if the program never executes the line you selected,
-it will run until completion.</DD>
-<DT>Set Breakpoint</DT>
-<DD>Set a breakpoint at this line. This has the same effect as left clicking
-on this line. Breakpoints are shown as red breakdots in the Source Window
-Display.</DD>
-<DT>Set Temporary Breakpoint</DT>
-<DD>Set a temporary breakpoint at this line. Temporary breakpoints are shown
-as orange breakdots in the Source Window Display. The remove themselves automatically
-the first time they are hit.</DD>
-<A NAME="thread_bp"></A>
-<DT>Set Breakpoint on Thread(s)...</DT>
-<DD>GDB allows the user to set a breakpoint on a particular thread or threads. This
-menu item will display a dialog with a list of threads. The user can select a list
-of threads that will have breakpoints set at the selected line number. A warning
-will be displayed if there are no active threads.</DD>
-<IMG SRC="images/src_thread.gif">
-</DL>
-
-The other pop-up menu is activated by clicking the right mouse button anywhere
-else in the Source Display. It is only available when a variable or number
-in the display lies below the mouse cursor or is selected (by clicking
-the left mouse button and dragging the mouse to highlight the variable/number).
-The pop-up menu looks like this:
-<P><IMG SRC="images/src_pop.gif">
-<DL>
-<DT><A NAME="add_to_watch"></A>Add <I>expr</I> to Watch</DT>
-<DD>Adds the selected expression to the <A HREF="watch.html">Watch Window</A>,
-opening it, if necessary.</DD>
-<DT>Dump Memory at <I>expr</I></DT>
-<DD>Opens a new <A HREF="memory.html">Memory Window</A> at the selected expression.
-If the expression is a variable, then the Memory Window is opened with
-memory addresses starting at the value of the variable.</DD>
-<DT>Open Another SOurce Window</DT>
-<DD>GDB allows multiple source windows to co-exist. You can, for example, have
-one window in source mode and one in assembly mode. Or you can use one window
-to browse the stack or other files.</DD>
-</DL>
-
-<H4><A NAME="status"></A>Source Window Status Bars</H4>
-The Source Window has two status bars which inform the user of the status
-of the program (the "status bar") and the status of the Source Window.
-<P>The&nbsp;<A NAME="status_bar"></A>Program Status Bar (or simply "Status
-Bar") displays the status of the program. Common messages seen here include:
-<DL>
-<DT>No program loaded.</DT>
-<DD>No program has been loaded into target memory.</DD>
-<DT>Program is ready to run.</DT>
-<DD>A program has been loaded into target memory and may be executed. Start
-the program by hitting <A HREF="#run_button">Run</A>.</DD>
-<DT>Program stopped at <I>line/address</I></DT>
-<DD>The program stopped at line <I>line</I> or address <I>address</I>. Execution
-may continue by hitting any of the <A HREF="#toolbar_exec">execution control
-buttons</A> on the toolbar.</DD>
-<DT>Program terminated. 'Run' will restart.</DT>
-<DD>The program exited. Pressing <A HREF="#run_button">Run</A> will restart
-it.</DD>
-</DL>
-
-The Status Bar also displays some help information. For instance, the Status
-Bar will show the function of a button on the toolbar or the Source Display
-Status Bar as well as any keyboard shortcut for any button in the Source
-Window.
-
-<BR>
-<H4><A NAME="status_mode"></A>Source Display Status Bar</H4>
-<IMG SRC="images/src_stat.gif">
-The Source Display Status Bar shows the current state of the Source Window:
-the name of the file displayed in the Display, the name of the function
-in the Display which contains the PC for the current frame (if any), and
-the display mode.
-<P>The <A NAME="file_selector"></A>Source File Selector is a dropdown
-menu which contains the names of all the files that were compiled into
-the program being debugged.
-<P>Normally, the File Selector displays the name of the file currently
-being viewed, but any file from the dropdown menu may be selected for browsing.
-Simply select the file to view from the available choices (or type it directly
-into the File Selector) and the Source Window will load that file into
-the Display. To return to the PC of the program, simply press the
-<A HREF="#bottom_button">Bottom
-Frame Control Button</A>.
-<P>The <A NAME="function_selector"></A>Source Function Selector displays
-the name of the function containing the Source Window's PC, if one exists,
-but it may be used to browse any function in the current file. Simply type
-the name of the desired function into the Function Selector or select it
-from the dropdown menu. The Source Window's PC is updated to point at this
-function. To return to the PC of the program, simply press the
-<A HREF="#bottom_button">Bottom
-Frame Control Button</A>.
-<P>The <A NAME="mode_selector"></A>Source Display Mode Selector displays
-the viewing mode of the current file/function shown in the Source Window
-Display.
-<P>The function of the "step" keyboard shortcut will differ depending on
-the mode the Source Window Display. "Stepping" in Source Mode (or in the
-Source Pane of SRC+ASM Mode) will cause a source-level step. "Stepping"
-in Assembly or Mixed Mode (or in the Assembly Pane of the SRC+ASM Mode)
-will cause the debugger to step exactly one machine instruction. This also
-applies to the shortcut for "next".
-<P>The Display Mode Selector may be used to change the view of the current
-source file. The available display modes are
-<DL>
-<DT>SOURCE</DT>
-<DD>The contents of the Display are shown as source code. If source code is
-not available (either because no debugging information is available or
-the source file is not found), the Source Window will temporarily set the Display
-Mode to "ASSEMBLY".</DD>
-<DT>ASSEMBLY</DT>
-<DD>A disassembly of the target's memory is shown in the Display. Even assembly
-source files show a disassembly of target memory; to see the assembly source
-code, use the SOURCE mode. Note that the debugger can only display assembly
-code on a function-by-function basis. It cannot display all the instructions
-generated from a single source file.</DD>
-<DT>MIXED</DT>
-<DD>The Display shows source code mixed with the assembler instructions which
-were generated for those lines by the compiler for the current function.
-Note that the addresses of the assembly lines is not necessarily monotonically
-increasing. If the source file associated with the function cannot be found,
-the Source Window will revert to ASSEMBLY mode.</DD>
-<DT>SRC+ASM</DT>
-<DD>The Source Window Display is divided into two panes: an assembly pane and
-a source pane. Breakpoints may be set/cleared in either pane.</DD>
-</DL>
-
-<HR>
-
-<H2><A NAME="search"></A>Search Entry</H2>
-The Search Entry facilitates searching for text in the Source Window Display.
-Simply enter the text to be found into the Search Entry and press the Enter
-key on the keyboard to search forwards in the Source Window Display (hold
-down the Shift key to search backwards). If a match is found, it is highlighted
-in the Source Window and the Program Status Bar displays information about
-where the match was found.
-<P>The Search Entry can also jump the Source Window to a specific line.
-Enter the line number preceded by an "at" sign (@) into the Search Entry
-and press enter. If entered line number is greater than the total number
-of lines in the Source Window Display, the Display will jump to the end
-of the current file.
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/src_pref.html b/gdb/gdbtk/library/help/src_pref.html
deleted file mode 100644
index e8547964653..00000000000
--- a/gdb/gdbtk/library/help/src_pref.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Source Window Preferences Help</TITLE>
-</HEAD>
-<BODY>
-<H1>Source Window Preferences</H1>
-<H3>Overview</H3>
-<P>Not yet done.</P>
-
-<P>Source Preferences topics:
-<UL>
- <LI><UL><A HREF="#">stuff</A>
- <LI><A HREF="#">stuff</A>
- <LI><A HREF="#">stuff</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="">stuff</A></H3>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/stack.html b/gdb/gdbtk/library/help/stack.html
deleted file mode 100644
index 9229c17fa12..00000000000
--- a/gdb/gdbtk/library/help/stack.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<HTML>
- <HEAD>
- <TITLE>Stack Window Help</TITLE>
- </HEAD>
- <BODY>
-
- <CENTER>
- <H2>The Stack Window</H2>
- </CENTER>
-
-
- <BR>The Stack Window allows users to view the call stack and jump between
- levels of the stack.
-
- <UL>
- <LI><A HREF="#display">Stack Display</A></LI>
- <LI><A HREF="#display_nav">Navigating the Stack Window</A></LI>
- <LI><A HREF="#display_lvl">Changing the Stack Level</A></LI>
- </UL>
-
- <H2><A NAME="display">Stack Display</A></H2>
- The Stack Display consists of a listbox which displays levels of the call stack
- on per line. Each line contains the level number (useful when using the
- <A HREF="console.html">Console Window</A>) and a description of the function executing
- in that level. Typically, the function name and either the address of the function
- or the file and line number where the function is defined are displayed. The
- Stack Window may also be used to jump between levels of the stack.
- <BR>
-
- <H2><A NAME="display_nav">Navigating the Stack Window</A></H2>
- Navigation of the Stack Window is accomplished by clicking on the desired level
- with the left mouse button. The <A HREF="source.html#display">Source Window
- Display</A> updates to show the selected frame. All other secondary windows,
- <A HREF="register.html">Registers</A>, <A HREF="watch.html">Watch</A>, and
- <A HREF="locals.html">Locals</A> update their displays for the selected frame.
- <BR>
-
- <H2><A NAME="display_lvl">Changing Stack Levels</A></H2>
- To switch frames, simply click the left mouse button on the desired frame and the
- debugger will switch contexts, updating all windows. The selected frame is highlighted
- (in gold, by default).
-
- <P>As an alternative, changing stack levels may be accomplished via the
- <A HREF="source.html#toolbar_frame">Frame Control Buttons</A> on the Source Window's
- Toolbar. These buttons may be used to change frames one level at a time (either
- immediately up or immediately down) or to jump to the bottom-most stack frame.
- See <A HREF="source.html#toolbar_frame">Source Frame Control Buttons</A> for more
- information.</P>
- </BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/target.html b/gdb/gdbtk/library/help/target.html
deleted file mode 100644
index b56821b0cff..00000000000
--- a/gdb/gdbtk/library/help/target.html
+++ /dev/null
@@ -1,110 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Target Selection Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Target Selection Dialog</H1>
-<h2>Overview</h2>
-<P>The Target Selection Dialog allows users to specify the debug target,
-the interface used to connect to the target, and some useful run
-options.</P>
-
-<P>
-<h3><A HREF="#select">Selecting a Target</A></h3>
-<UL>
-<LI><A HREF="#select">Specifying a Target</A></LI>
-<LI><A HREF="#select_int">Choosing a Connection Interface</A></LI>
-</UL>
-
-<h3><A HREF="#options">Options</A></h3>
-<UL>
-<LI><A HREF="#options_run_until_main">Run until 'main'</A></LI>
-<LI><A HREF="#options_bp_at_exit">Set breakpoint at 'exit'</A></LI>
-<LI><A HREF="#options_set_bp_at">Set user-specifid breakpoint</A></LI>
-<LI><A HREF="#options_download_dialog">Display Download Dialog</A></LI>
-<LI><A HREF="#options_use_xterm">Use xterm for inferior's tty (unix only)
- </A></LI>
-</UL>
-
-<h3><A HREF="#more_options">More Options</A></h3>
-<UL>
-<LI><A HREF="#more_options_attach">Attach to Target</A></LI>
-<LI><A HREF="#more_options_load">Download Program</A></LI>
-<LI><A HREF="#more_options_run">Run Program</A></LI>
-<LI><A HREF="#more_options_cont">Continue from Last Stop</A></LI>
-</UL></P>
-
-<H3><A NAME="select">Selecting a Target</A></H3>
-Selecting a target involves choosing a target for debugging and setting connection
-interface options for the target.
-
-<P>Common targets include: "Exec" for native debuggers, "Remote/Serial" for establishing
-a connection to a target board via a serial line, "Remote/TCP" for TCP connections,
-and "Simulator" for connections to the simulator. There may be more depending on the
-configuration of the debugger being used.</P>
-
-<P>In general, "remote" targets are always serial connections which require the user
-to specify the serial port and baud rate to be used for the connection and
-"remote/tcp" targets are always TCP connections which require specifying the hostname
-and port number of the machine to which to connect. Depending upon configuration,
-there may be numerous serial- and TCP-based connections. These always follow the
-naming convention <I>target</I>/Serial and <I>target</I>/TCP.</P>
-
-<P>To select a target, choose one of the available targets
-from the dropdown menu in the Connection Frame. Then <A NAME="#select_int">specify
-the interface options</A> for this target: selecting the baudrate and serial port
-from the dropdown menus (serial targets only) or entering the hostname and port number
-(TCP targets only).</P>
-
-<H3><A NAME="options">Options</A></H3>
-Three run options which may be selected include:
-<DL>
- <DT><A NAME="options_run_until_main">Run until 'main'</A>
- <DD>Sets a breakpoint at main()
- <DT><A NAME="options_bp_at_exit">Set breakpoint at 'exit'</A>
- <DD>Sets a breakpoint at exit()
- <DT><A NAME="options_set_bp_at">Set breakpoint at</A>
- <DD>Sets a breakpoint at a user-specified locaiton</A>
- <DT><A NAME="options_download_dialog">Display Download Dialog</A>
- <DD>Displays a dialog showing the progress of the download to
- the target section by section
- <DT><A NAME="options_use_xterm">Use xterm as inferior's tty</A>
- <DD>Causes insight to open a tty for inferior I/O (unix versions
- only)
-</DL>
-<BR>
-<H3><A NAME="more_options">More Options</A></H3>
-Several additional run options may be set for each target from the Target Selection
-Dialog. These options govern the behavior of the debugger's
-<A NAME="source.html#run_button">Run Button</A>. The debugger automatically selects
-default values for these options whenever a target is selected with the dropdown menu
-in the Connection Frame. To modify this default behavior, click the small triangle
-next to "More Options" at the bottom of the dialog. The Run Options for the current
-target are displayed, allowing modification of the actions for the target. When the
-"OK" button is selected, these settings are saved and will be used as the default
-for the target in future sessions.
-
-<DL>
- <DT><A NAME="more_options_attach">Attach to Target</A>
- <DD>Establish a connection to the target board.
- <DT><A NAME="more_options_load">Download Program</A>
- <DD>Download the program to the target board.
- <DT><A NAME="more_options_run">Run Program</A>
- <DD>Run the program on the target board, creating a new
- "process". This option may not be specified along with
- the continue option. See note below.
- <DT><A NAME="more_options_cont">Continue from Last Stop</A>
- <DD>Continue the program on the target board from where
- it last stopped. This option may not be specified
- along with the "run" option. See note below.
-</DL>
-
-<P>Note that all remote targets typically do not "run" programs. Since target
-boards are usually incapable of creating a new "process", these targets
-seldom "Run". The defaults for all remote targets reflect this distinction: they
-are all set to "Continue".</P>
-
-<P>Only one of the options "Run Program" and "Continue from Last Stop" may be used.
-Typically, the default behavior of this setting should not be altered.</P>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/thread.html b/gdb/gdbtk/library/help/thread.html
deleted file mode 100644
index dacc0646125..00000000000
--- a/gdb/gdbtk/library/help/thread.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<HTML>
- <HEAD>
- <TITLE>Thread Window Help</TITLE>
- </HEAD>
- <BODY>
-
- <CENTER>
- <H2>The Thread Window</H2>
- </CENTER>
-
-
- <BR>The Thread Window displays a list of threads and/or processes. The exact
- contents are OS-specific.
-
- <UL>
- <LI><A HREF="#display">Thread Display</A></LI>
- <LI><A HREF="#current">Changing the Current Thread</A></LI>
- <LI><A HREF="#bp">Setting Breakpoints on Thread(s)</A></LI>
- </UL>
-
- <H2><A NAME="display">Thread Display</A></H2>
- The Thread Display consists of a listbox which displays information on
- threads and/or processes that are part of the executable being debugged.
- The first column is the GDB thread number, which is used internally by GDB
- to track the thread. The rest of the columns are OS-dependent. The output is identical
- to the output of the console command "info threads".
- <BR>
-
- <H2><A NAME="current">Changing the Current Thread</A></H2>
- The source window can only display the current location and source for one thread
- at a time. That thread is called the "current thread".
- To change the current thread, simply click the left mouse button on the desired
- line and the
- debugger will switch contexts, updating all windows. The current thread will
- be highlighted.
- <BR>
-
- <H2><A NAME="bp">Setting Breakpoints on Thread(s)</A></H2>
- Normally if you set a breakpoint on a line or function, every thread that hits
- that location will stop execution and return to the debugger. To set a breakpoint
- or a specific thread or threads, you need to use the source window. See
- <A HREF="source.html#thread_bp">Set Breakpoint on Threads</A>
-
-
- </BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/console.html b/gdb/gdbtk/library/help/trace/console.html
deleted file mode 100644
index fdce956afec..00000000000
--- a/gdb/gdbtk/library/help/trace/console.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Console Window Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Console Window</H1>
-<H3>Overview</H3>
-<P>The Console Window is perhaps the most powerful tool in the debugger. It
-provides functionality equivalent to almost all of the debugger's secondary
-windows, macro definitions, and other more advanced features.</P>
-
-<P>Console Window topics:
-<UL>
- <LI><UL><A HREF="#display">Console Display</A>
- <LI><A HREF="#display_cmd">Executing Commands</A>
- <LI><A HREF="#display_hlp">Getting Help</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="display">Console Display</A></H3>
-The Console Display is simply a scrolled window in which the debugger prompt
-appears. By default, the prompt is set to "(gdb) ", but it may be changed via a
-command line option.
-
-<P>To <A NAME="display_cmd">execute commands</A> in the console window, simply enter
-the command in the display. If the debugger is busy, the message "Error: The
-debugger is busy." appears informing the user that the command was not accepted.</P>
-
-<P>Whenever a command is executed, the debugger's windows will update to display
-any new state information. Any output from the command is also echoed to the Console
-Window for ease of use. If an error occurs, an error message is printed to the Console
-Window. All error messages appear in the Console Window using a red colored typeface.
-</P>
-
-<P>The Console Window responds to special character commands just as a shell window
-does: it has a history mechanism which allows the user to scan previously used commands
-by pressing the up and down arrow keys on the keyboard, jumping to the beginning or
-end of a line by entering Ctrl-A or Ctrl-E, erasing a line by pressing Ctrl-K, and
-more. Users familiar with GNU Emacs will recognize these keys as commonly used
-keystrokes from that editor.</P>
-
-<H3><A NAME="display_hlp">Getting Help</A></H3>
-The Console Window has its own online help system. To access the help system, enter
-"help" at the prompt and follow the on-screen instructions. For more help, please
-consult the <!-- What is this really called? --> <I>GDB User's Guide</I>.
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/gbl_pref.html b/gdb/gdbtk/library/help/trace/gbl_pref.html
deleted file mode 100644
index 2760750c4e9..00000000000
--- a/gdb/gdbtk/library/help/trace/gbl_pref.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Global Preferences Help</TITLE>
-</HEAD>
-<BODY>
-<H1>Global Preferences</H1>
-<H3>Overview</H3>
-<P>Not yet done.</P>
-
-<P>Global Preferences topics:
-<UL>
- <LI><UL><A HREF="#">stuff</A>
- <LI><A HREF="#">stuff</A>
- <LI><A HREF="#">stuff</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="">stuff</A></H3>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/help.html b/gdb/gdbtk/library/help/trace/help.html
deleted file mode 100644
index 3a3640da1a1..00000000000
--- a/gdb/gdbtk/library/help/trace/help.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Help Window Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Help Window</H1>
-<H2>Overview</H2>
-<P>This is some nice text which describes the help window, its role
-in deugging, and perhaps some of the nifty things people can do with
-this window.</P>
-
-<P>Help Window topics:
-<UL>
- <LI><UL><A HREF="#menus">Menus</A>
- <LI><A HREF="#menus_file">File Menu</A>
- <LI><A HREF="#menus_topics">Topics Menu</A>
- </UL>
- <LI><UL><A HREF="#display">Help Display</A>
- <LI><A HREF="#display_nav">Navigating the Help Window</A>
- <LI><A HREF="#display_link">Definition and Page Links</A>
- </UL>
-</UL></P>
-
-<H2><A NAME="menus">Menus</A></H2>
-<H3><A NAME="menus_file">File Menu</A></H3>
-<H3><A NAME="menus_topics">Topics Menu</A></H3>
-
-<H3><A NAME="display">Help Display</A></H3>
-<H3><A NAME="display_nav">Navigating the Help Window</A></H3>
-<H3><A NAME="display_link">Definition and Page Links</A></H3>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/index.toc b/gdb/gdbtk/library/help/trace/index.toc
deleted file mode 100644
index 3559d66350e..00000000000
--- a/gdb/gdbtk/library/help/trace/index.toc
+++ /dev/null
@@ -1,10 +0,0 @@
-{Source Window} {source.html} {The Source Window}
-{Register Window} {register.html} {The Register Window}
-{Memory Window} {memory.html} {The Memory Window}
-{Locals Window} {locals.html} {The Locals Window}
-{Watch Window} {watch.html} {The Watch Window}
-{Tracepoint Window} {tp.html} {The Tracepoint Window}
-{Console Window} {console.html} {The Console Window}
-{Stack Window} {stack.html} {The Stack Window}
-{TDump Window} {tdump.html} {The Tracepoint Dump Window}
-{GPL} {license.html} {The GNU Public License}
diff --git a/gdb/gdbtk/library/help/trace/license.html b/gdb/gdbtk/library/help/trace/license.html
deleted file mode 100644
index b43da4cb3a4..00000000000
--- a/gdb/gdbtk/library/help/trace/license.html
+++ /dev/null
@@ -1,305 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>GNU General Public License</TITLE>
-</HEAD><BODY>
-<B>The GNU General Public License
-<P></P>
-</B>Version 2, June 1991
-<P></P>
-Copyright © 1989, 1991 Free Software Foundation, Inc.
-<BR>59 Temple Place / Suite 330, Boston, MA 02111-1307, USA
-<P></P>
-Everyone is permitted to copy and distribute verbatim copies of this license
-document, but changing it is not allowed.
-<P></P>
-<B>Preamble
-<P></P>
-</B>The licenses for most software are designed to take away your freedom to share
-and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and
-change free software to make sure the software is free for all its users. This General Public
-License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some
-other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs,
-too.
-<P></P>
-When we speak of free software, we are referring to freedom, not price. Our
-General Public Licenses are designed to make sure that you have the freedom to
-distribute copies of free software (and charge for this service if you wish),
-that you receive source code or can get it if you want it, that you can change the
-software or use pieces of it in new free programs; and that you know you can
-do these things.
-<P></P>
-To protect your rights, we need to make restrictions that forbid anyone to
-deny you these rights or to ask you to surrender the rights. These restrictions
-translate to certain responsibilities for you if you distribute copies of the
-software, or if you modify it.
-<P></P>
-For example, if you distribute copies of such a program, whether gratis or for
-a fee, you must give the recipients all the rights that you have. You must
-make sure that they, too, receive or can get the source code. And you must show
-them these terms so they know their rights.
-<P></P>
-We protect your rights with two steps: (1) copyright the software, and (2)
-offer you this license which gives you legal permission to copy, distribute and/or
-modify the software.
-<P></P>
-Also, for each author's protection and ours, we want to make certain that everyone understands that
-there is no warranty for this free software. If the software is modified by
-someone else and passed on, we want its recipients to know that what they have is
-not the original, so that any problems introduced by others will not reflect on
-the original authors' reputations.
-<P></P>
-Finally, any free program is threatened constantly by software patents. We
-wish to avoid the danger that redistributors of a free program will individually
-obtain patent licenses, in effect making the program proprietary. To prevent
-this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for
-copying, distribution and modification follow.
-<P></P>
-<B>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-<P></P>
-</B>0. This License applies to any program or other work which contains a notice
-placed by the copyright holder saying it may be distributed under the terms of this
-General Public License. The `Program”, below, refers to any such program or work, and a `work based on the Program' means either the Program or any derivative work under copyright law: that is
-to say, a work containing the Program or a portion of it, either verbatim or
-with modifications and/or translated into another language. (Hereinafter,
-translation is included without limitation in the term `modification'.) Each licensee is addressed as `you'.
-<P></P>
-Activities other than copying, distribution and modification are not covered
-by this License; they are outside its scope. The act of running the Program is
-not restricted, and the output from the Program is covered only if its contents
-constitute a work based on the Program (independent of having been made by
-running the Program). Whether that is true depends on what the Program does.
-<P></P>
-<OL><LI> You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate copyright notice and
-disclaimer of warranty; keep intact all the notices that refer to this License
-and to the absence of any warranty; and give any other recipients of the Program
-a copy of this License along with the Program.
-<P></P>
-</OL>You may charge a fee for the physical act of transferring a copy, and you may
-at your option offer warranty protection in exchange for a fee.
-<P></P>
-<OL START="2"><LI> You may modify your copy or copies of the Program or any portion of it, thus
-forming a work based on the Program, and copy and distribute such modifications
-or work under the terms of Section 1 above, provided that you also meet all of
-these conditions:
-<P></P>
-</OL>a) You must cause the modified files to carry prominent notices stating that you
-changed the files and the date of any change.
-<P></P>
-b) You must cause any work that you distribute or publish, that in whole or in
-part contains or is derived from the Program or any part thereof, to be licensed
-as a whole at no charge to all third parties under the terms of this License.
-<P></P>
-c) If the modified program normally reads commands interactively when run, you
-must cause it, when started running for such interactive use in the most ordinary
-way, to print or display an announcement including an appropriate copyright
-notice and a notice that there is no warranty (or else, saying that you provide a
-warranty) and that users may redistribute the program under these conditions,
-and telling the user how to view a copy of this License. (Exception: if the
-Program itself is interactive but does not normally print such an announcement,
-your work based on the Program is not required to print an announcement.)
-<P></P>
-These requirements apply to the modified work as a whole. If identifiable
-sections of that work are not derived from the Program, and can be reasonably
-considered independent and separate works in themselves, then this License, and its
-terms, do not apply to those sections when you distribute them as separate
-works. But when you distribute the same sections as part of a whole which is a work
-based on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the entire whole,
-and thus to each and every part regardless of who wrote it.
-<P></P>
-Thus, it is not the intent of this section to claim rights or contest your
-rights to work written entirely by you; rather, the intent is to exercise the
-right to control the distribution of derivative or collective works based on the
-Program.
-<P></P>
-In addition, mere aggregation of another work not based on the Program with
-the Program (or with a work based on the Program) on a volume of a storage or
-distribution medium does not bring the other work under the scope of this License.
-<P></P>
-<OL START="3"><LI> You may copy and distribute the Program (or a work based on it, under Section
-2) in object code or executable form under the terms of Sections 1 and 2 above
-provided that you also do one of the following:
-<P></P>
-</OL>a) Accompany it with the complete corresponding machine-readable source code,
-which must be distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-<P></P>
-b) Accompany it with a written offer, valid for at least three years, to give any
-third party, for a charge no more than your cost of physically performing
-source distribution, a complete machine-readable copy of the corresponding source
-code, to be distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-<P></P>
-c) Accompany it with the information you received as to the offer to distribute
-corresponding source code. (This alternative is allowed only for noncommercial
-distribution and only if you received the program in object code or executable
-form with such an offer, in accord with Subsection b above.)
-<P></P>
-The source code for a work means the preferred form of the work for making
-modifications to it. For an executable work, complete source code means all the
-source code for all modules it contains, plus any associated interface definition
-files, plus the scripts used to control compilation and installation of the
-executable. However, as a special exception, the source code distributed need not
-include anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the operating
-system on which the executable runs, unless that component itself accompanies the
-executable.
-<P></P>
-If distribution of executable or object code is made by offering access to
-copy from a designated place, then offering equivalent access to copy the source
-code from the same place counts as distribution of the source code, even though
-third parties are not compelled to copy the source along with the object code.
-<P></P>
-<OL START="4"><LI> You may not copy, modify, sublicense, or distribute the Program except as
-expressly provided under this License. Any attempt otherwise to copy, modify,
-sublicense or distribute the Program is void, and will automatically terminate your
-rights under this License. However, parties who have received copies, or
-rights, from you under this License will not have their licenses terminated so long
-as such parties remain in full compliance.
-<P></P>
-<LI> You are not required to accept this License, since you have not signed it.
-However, nothing else grants you permission to modify or distribute the Program or
-its derivative works. These actions are prohibited by law if you do not accept
-this License. Therefore, by modifying or distributing the Program (or any work
-based on the Program), you indicate your acceptance of this License to do so,
-and all its terms and conditions for copying, distributing or modifying the
-Program or works based on it.
-<P></P>
-<LI> Each time you redistribute the Program (or any work based on the Program), the
-recipient automatically receives a license from the original licensor to copy,
-distribute or modify the Program subject to these terms and conditions. You
-may not impose any further restrictions on the recipients' exercise of the rights granted herein.
-<P></P>
-</OL>You are not responsible for enforcing compliance by third parties to this
-License.
-<P></P>
-<OL START="7"><LI> If, as a consequence of a court judgment or allegation of patent infringement
-or for any other reason (not limited to patent issues), conditions are imposed
-on you (whether by court order, agreement or otherwise) that contradict the
-conditions of this License, they do not excuse you from the conditions of this
-License. If you cannot distribute so as to satisfy simultaneously your obligations
-under this License and any other pertinent obligations, then as a consequence
-you may not distribute the Program at all. For example, if a patent license
-would not permit royalty-free redistribution of the Program by all those who
-receive copies directly or indirectly through you, then the only way you could
-satisfy both it and this License would be to refrain entirely from distribution of
-the Program.
-<P></P>
-</OL>If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply and the
-section as a whole is intended to apply in other circumstances.
-<P></P>
-It is not the purpose of this section to induce you to infringe any patents or
-other property right claims or to contest validity of any such claims; this
-section has the sole purpose of protecting the integrity of the free software
-distribution system, which is implemented by public license practices. Many people
-have made generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that system; it is up
-to the author/donor to decide if he or she is willing to distribute software
-through any other system and a licensee cannot impose that choice.
-<P></P>
-This section is intended to make thoroughly clear what is believed to be a
-consequence of the rest of this License.
-<P></P>
-<OL START="8"><LI> If the distribution and/or use of the Program is restricted in certain
-countries either by patents or by copyrighted interfaces, the original copyright
-holder who places the Program under this License may add an explicit geographical
-distribution limitation excluding those countries, so that distribution is
-permitted only in or among countries not thus excluded. In such case, this License
-incorporates the limitation as if written in the body of this License.
-<P></P>
-<LI> The Free Software Foundation may publish revised and/or new versions of the
-General Public License from time to time. Such new versions will be similar in
-spirit to the present version, but may differ in detail to address new problems
-or concerns.
-<P></P>
-</OL>Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and `any later version', you have the option of following the terms and conditions either of that
-version or of any later version published by the Free Software Foundation. If the
-Program does not specify a version number of this License, you may choose any
-version ever published by the Free Software Foundation.
-<P></P>
-<OL START="a"><LI> If you wish to incorporate parts of the Program into other free programs whose
-distribution conditions are different, write to the author to ask for
-permission. For software which is copyrighted by the Free Software Foundation, write to
-the Free Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status of all
-derivatives of our free software and of promoting the sharing and reuse of software
-generally.
-<P></P>
-</OL>NO WARRANTY
-<P></P>
-<OL START="b"><LI> BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE
-PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED
-IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM `AS IS' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
-NECESSARY SERVICING, REPAIR OR CORRECTION.
-<P></P>
-<LI> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
-COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
-PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
-SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
-INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
-THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
-PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-<P></P>
-</OL>END OF TERMS AND CONDITIONS
-<P></P>
-<B>How to Apply These Terms to Your New Programs
-<P></P>
-</B>If you develop a new program, and you want it to be of the greatest possible
-use to the public, the best way to achieve this is to make it free software
-which everyone can redistribute and change under these terms.
-<P></P>
-To do so, attach the following notices to the program. It is safest to attach
-them to the start of each source file to most effectively convey the exclusion
-of warranty; and each file should have at least the `copyright' line and a pointer to where the full notice is found.
-<P></P>
-<I>one line for the program's name and a brief idea of what it does.
-<BR></I>Copyright (C) 19<I>yy</I> <I>name of author</I>
-<BR>
-<BR>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.
-<BR>
-<BR>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.
-<BR>
-<BR>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.
-<P></P>
-Also add information on how to contact you by electronic and paper mail.
-<P></P>
-If the program is interactive, make it output a short notice like the
-following example when it starts in an interactive mode:
-<P></P>
-Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes
-with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain
-conditions; type `show c' for details.
-<P></P>
-The hypothetical commands <B>show w</B> and <B>show c</B> should show the appropriate parts of the General Public License. Of course,
-the commands you use may be called something other than show w and show c; they can be mouse clicks or menu items—whatever suits your program.
-<P></P>
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a `copyright disclaimer' for the program, if necessary. The following is a sample (when copying, alter
-the names).
-<P></P>
-Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
-<BR>
-<BR>signature of Ty Coon, 1 April 1989
-<BR>Ty Coon, President of Vice
-<P></P>
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may consider
-it more useful to permit linking proprietary applications with the library. If
-this is what you want to do, use the GNU Library General Public License instead of this License.
-<P></P>
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/gdb/gdbtk/library/help/trace/locals.html b/gdb/gdbtk/library/help/trace/locals.html
deleted file mode 100644
index 05998244d96..00000000000
--- a/gdb/gdbtk/library/help/trace/locals.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Locals Window Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Locals Window</H1>
-<H2>Overview</H2>
-<P>The Locals Window displays all local variables in scope. It may be used to
-visualize local variables. Local variables need to be collected
-before they can be viewed. See <A HREF="tracedlg.html#t_actions_add">Adding
-an Action</A> in the Tracepoint Dialog for more information.</P>
-
-<P>Locals Window topics:
-<UL>
- <LI><UL><A HREF="#menus">Variable Menu</A>
- <LI><A HREF="#menus_fmt">Format</A>
- </UL>
- <LI><UL><A HREF="#display">Locals Display</A>
- <LI><A HREF="#display_deref">Dereferencing Pointers</A>
- <LI><A HREF="#display_struct">Viewing a Structure or Class</A>
- <LI><A HREF="#display_popup">Locals Pop-up Menu</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="menus">Variable Menu</A></H3>
-The Variable Menu gives on-screen access to the funtions of the Locals Window.
-To use any of these functions, first use the left mouse button to select a
-variable from the display. Then select:
-
-<DL>
- <DT><A NAME="menus_fmt">Format</A>
- <DD>Change the display format of the variable
-</DL>
-
-<H3><A NAME="display">Locals Display</A></H4>
-The Locals Window Display consists of a scrolled listbox which contains all
-local variables, one per line. Locals which were not collected at the current
-tracepoint will display a memory-access error. To use any of the functions of
-the Locals Window, use the left mouse button to select any element from the
-Display.
-
-<P>Pointers, structures, and classes appear in the display with small exapansion
-box before their names. To <A NAME="display_deref">dereference pointers</A> or
-<A NAME="display_struct">view the members of classes or structures</A>, click
-the closed expansion box (which appears as a small plus sign, "+") to "expand"
-the listing. The expansion box changes to a minus sign, "-", indicating that the
-display is now open. Pointers, structures and classes may be expanded recursively
-to allow multiple pointer dereferences and embedded structure viewing.
-
-<P>The Locals Display updates as the trace buffer is navigated, highlighting
-in blue those variables whose values have changed.</P>
-
-<P>The Locals Window will, by default, display all pointers in hexadecimal and all
-other variables in decimal. To change the default display of variables, use the
-"set output-radix" command in the console window. (Type "help set output-radix" in the
-console window for help. To make this change permanent, it must be added to the user's
-init file -- .gdbinit.) To change the display format for a variable,
-select the Format option from either the Variable Menu or the
-<A HREF="#display_popup">Locals Pop-up Menu</A>.
-<BR>
-
-<H4><A NAME="display_popup">Locals Pop-up Menu</A></H4>
-The Locals Pop-up Menu provides quick access to the functions of the Locals Window.
-To use the Locals Pop-up Menu, first select a variable from the Display (by clicking
-the left mouse button on it) and click the right mouse button, choosing from the
-pop-up:
-<DL>
- <DT>Format
- <DD>Change the display format of the variable. The variable may be displayed
- as:
- <DL>
- <DT>Hex
- <DD>hexadecimal (base 16)
- <DT>Decimal
- <DD>decimal (base 10)
- <DT>Binary
- <DD>binary (base 2)
- <DT>Octal
- <DD>octal (base 8)
- </DL>
-</DL>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/memory.html b/gdb/gdbtk/library/help/trace/memory.html
deleted file mode 100644
index ad1cb36b9d1..00000000000
--- a/gdb/gdbtk/library/help/trace/memory.html
+++ /dev/null
@@ -1,142 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Memory Window Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Memory Window</H1>
-<H2>Overview</H2>
-<P>The Memory Window allows users to display the contents of collected
-memory. The Memory Window Preferences controls all of the display
-characteristics of the Memory Window.</P>
-
-<P>Memory Window topics:
-<UL>
- <LI><UL><A HREF="#menus">Address Menu</A>
- <LI><A HREF="#menus_auto">Auto Update</A>
- <LI><A HREF="#menus_now">Update Now</A>
- <LI><A HREF="#menus_prefs">Preferences</A>
- </UL>
- <LI><UL><A HREF="#display">Memory Display</A>
- <LI><A HREF="#display_nav">Navigating the Memory Window</A>
- <LI><A HREF="#display_popup">Memory Pop-up Menu</A>
- </UL>
- <LI><UL><A HREF="#prefs">Memory Window Preferences</A>
- <LI><A HREF="#prefs_size">Size of the Display Cell</A>
- <LI><A HREF="#prefs_fmt">Format of the Display Cell</A>
- <LI><A HREF="#prefs_bytes">Size of the Memory Window</A>
- <LI><A HREF="#prefs_misc">Miscellaneous</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="menus">Address Menu</A></H3>
-<DL>
- <DT><A NAME="menus_auto">Auto Update</A>
- <DD>When selected, casues the Memory Window to update the Display.
- <DT><A NAME="menus_now">Update Now</A>
- <DD>Forces the Memory Window to update the Display.
- <DT><A NAME="menus_prefs">Preferences</A>
- <DD>Opens the Memory Window Preferences dialog.
-</DL>
-
-<H3><A NAME="display">Memory Display</A></H3>
-Like the <A HREF="register.html">Register Window</A>, the Memory Window
-Display is organized into a spreadsheet. The address of any cell in the
-Display can be determined by appeding the row and column headers for the
-cell. Optionally, an ASCII display of the memory appears at the right.
-Any non-ASCII-representable byte in memory will appear in the ASCII Display
-as a control character (a dot, ".", by default). The <A HREF="#pref">Memory
-Preferences Dialog</A> may be used to alter the appearance of the
-Memory Window. Any uncollected memory will appear as "N/A", indicating that
-this memory was not collected when the trace experiment was run.
-
-<P><A NAME="display_nav">To navigate the Memory Window</A>, use the mouse
-and click the cell of interest. As an alternative, pressing the TAB key on
-the keyboard will focus successive cells, from left to right, top to bottom.
-The focus will wrap from the bottom of the Display to the top.</P>
-<BR>
-
-<H4><A NAME="display_popup">Memory Pop-up Menu</A></H4>
-Clicking the right mouse button while the mouse cursor lies within the
-bounds of any cell will allow users to:
-<DL>
- <DT>Auto Update
- <DD>When selected, the Memory Window will track changes in
- memory shown in the Display. Cells in which changes have
- occured will be highlighted. When not selected, the Memory
- Window is "frozen", representing a "snapshot" of memory.
- <DT>Update Now
- <DD>Causes the Memory Window to update all the cells shown.
- <DT>Go To <I>address</I>
- <DD>The Memory Window Display is updated to show memory starting
- at address <I>address</I>.
- <DT>Open New Window at <I>address</I>
- <DD>A new Memory Window is opened, displaying memory at address
- <I>address</I>
- <DT>Memory Preferences...
- <DD>Opens the Memory Window Preferences for editing the appearance
- of the Memory Window Display.
-</DL>
-<BR>
-
-<H3><A NAME="prefs">Memory Window Preferences</A></H3>
-Memory Window Preference Dialog governs the appearance of the Memory Window:
-the total number of bytes displayed, the size of each cell, ASCII control
-character.
-<BR>
-
-<H4><A NAME="prefs_size">Size of the Display Cells</A></H4>
-This attribute controls how many bytes appear in each cell. Valid cell
-sizes in the Memory Window may be:
-<DL>
- <DT>Byte
- <DD>Each cell is exactly one byte
- <DT>Half Word
- <DD>Cells are displayed with two bytes
- <DT>Word
- <DD>Each cell contains four bytes
- <DT>Double Word
- <DD>Cells contain eight bytes
- <DT>Float
- <DD>Each cell contains four bytes, displayed as a floating point
- number
- <DT>Double Float
- <DD>Cells are displayed as floating point, eight bytes each
-</DL>
-<BR>
-
-<H4><A NAME="prefs_fmt">Format of the Display Cells</A></H4>
-The Format option of the Memory Preferences Dialog governs how the debugger
-represents the memory. Possible representations include:
-
-<DL>
- <DT>Binary
- <DD>The values are shown as binary numbers
- <DT>Signed Decimal
- <DD>The values are shown as signed decimal numbers
- <DT>Octal
- <DD>Each cell is represented as an octal number
- <DT>Unsigned Decimal
- <DD>Values are displayed as unsigned decimals
- <DT>Hex
- <DD>Memory is displayed as a hexadecimal number. This is
- the default.
-</DL>
-<BR>
-
-<H4><A NAME="prefs_bytes">Size of the Memory Window</A></H4>
-The size of the memory window determines how much memory is actually
-presented to the user. The total number of bytes shown can either be
-determined by the size of the window, in which case resizing the Memory
-Window will cause more or less memory to be displayed, or fixed at some
-specified number of bytes. By default, the Memory Window shows 128 bytes
-of memory.
-<BR>
-
-<H4><A NAME="prefs_misc">Miscellaneous</A></H4>
-Miscellaneous memory preferences include the option to display the ASCII
-representation of the memory, including what character to use for non-ASCII
-bytes (the "control" character). Additionally, users may specify the number
-of bytes per row, either four, eight, sixteen, or thirty-two. The default is
-sixteen bytes per row.
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/reg_pref.html b/gdb/gdbtk/library/help/trace/reg_pref.html
deleted file mode 100644
index b21a5747df2..00000000000
--- a/gdb/gdbtk/library/help/trace/reg_pref.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Register Window Preferences Help</TITLE>
-</HEAD>
-<BODY>
-<H1>Register Window Preferences</H1>
-<H3>Overview</H3>
-<P>Not yet done.</P>
-
-<P>Register Window Preferences topics:
-<UL>
- <LI><UL><A HREF="#">stuff</A>
- <LI><A HREF="#">stuff</A>
- <LI><A HREF="#">stuff</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="">stuff</A></H3>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/register.html b/gdb/gdbtk/library/help/trace/register.html
deleted file mode 100644
index d0735593a12..00000000000
--- a/gdb/gdbtk/library/help/trace/register.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Register Window Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Register Window</H1>
-<H2>Overview</H2>
-<P>The Register Window lists all the registers and their contents for
-the selected stack frame. It permits viewing the contents of registers
-in different formats and some display customizations.</P>
-
-<P>Any register that was not collected will be displayed as having a value
-of "0x0". To collect registers, add them to the collection action in the
-<A HREF="tracedlg.html">Tracepoint Dialog</A>.
-
-<P>The Register Window will update the register contents in the display
-to match the stack frame currently being viewed in the <A HREF="source.html">
-Source Window</A> and <A HREF="stack.html">Stack Winodw</A>.</P>
-
-<P>Register Window topics:
-<UL>
- <LI><UL><A HREF="#menus">Register Menu</A>
- <LI><A HREF="#menus_fmt">Format</A>
- <LI><A HREF="#menus_remove">Remove from Display</A>
- <LI><A HREF="#menus_all">Display All Registers</A>
- </UL>
- <LI><UL><A HREF="#display">Register Display</A>
- <LI><A HREF="#display_nav">Navigating the Register Display</A>
- <LI><A HREF="#display_popup">Register Pop-up Menu</A>
- <LI><A HREF="#display_format">Changing the Display Format of
- a Register</A>
- <LI><A HREF="#display_remove">Removing a Register
- from the display</A>
- <LI><A HREF="#display_all">Displaying all Registers</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="menus">Register Menu</A></H3>
-The Register Menu provides on-screen access to the functionality of the
-Register Window. To use any item from this menu, first use the mouse and
-select (click the left mouse button) on any register cell. Users may then
-select:
-<BR>
-<DL>
- <DT><A NAME="menus_fmt"><A HREF="#display_format">Format</A></A>
- <DD>Change the display format of the selected register
- <DT><A NAME="menus_remove"><A HREF="#display_remove">Remove
- from Display</A></A>
- <DD>Remove the selected register from the Register
- Window Display
- <DT><A NAME="menus_all"><A HREF="#display_all">Display All
- Registers</A></A>
- <DD>Display all registers in the Display. This item
- is only available when a register was previously
- removed from the Display.
-</DL>
-
-<H3><A NAME="display">Register Display</A></H3>
-The Register Display contains name and value pairs for each register
-available on the target hardware. These "cells" are layed out as a
-spreadsheet for ease of use.
-
-<P><A NAME="display_nav"></A>To navigate the Register Display, use either
-the mouse and left mouse button or the arrow keys on the keyboard to
-highlight the appropriate cell. Users may then use the <A HREF="#menus">
-Register Menu</A> or use the Register Pop-up Menu to access special display
-options for the Register Window.</P>
-<BR>
-
-<H4><A NAME="display_popup">The Register Pop-up Menu</A></H4>
-All of the special functions of the register window are accessed through
-the Register Pop-up Menu. To use the Menu, simply select a register (see
-<A HREF="#display_nav">Navigating the Register Display</A>) and click the
-right mouse button. The Menu offers:
-<DL>
- <DT><A NAME="display_format">Format</A>
- <DD><DL>Change the display format of the register. Valid display types
- are:
- <DT>Hex
- <DD>The register's contents are displayed in
- hexadecimal (base 16).
- <DT>Decimal
- <DD>The value is shown as
- a decimal number (base 10).
- <DT>Natural
- <DD>The register is displayed in its natural format.
- <DT>Binary
- <DD>The contents of the register are displayed
- as a binary number (base 2).
- <DT>Octal
- <DD>The register's contents are shown in octal (base 8).
- <DT>Raw
- <DD>The raw contents of the register are shown.
- </DL>
- <DT><A NAME="display_remove">Remove</A>
- <DD>Remove the selected register from the display. To display
- the removed register again, select the "Display All Registers"
- option from the Register Menu or the Register Pop-up Menu.
- <DT><A NAME="display_all">Display All Registers</A>
- <DD>Causes the Register Window Display to show all registers,
- including those which were previously "removed". This menu
- item is only available when removed registers exist.
-</DL>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/source.html b/gdb/gdbtk/library/help/trace/source.html
deleted file mode 100644
index 9ec0005227b..00000000000
--- a/gdb/gdbtk/library/help/trace/source.html
+++ /dev/null
@@ -1,371 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Source Window Help</TITLE>
-</HEAD>
-<BODY>
-<CENTER><H1>The Source Window</H1></CENTER>
-<H3>Overview</H3>
-<BR>
-The Source Window is the primary interface between the user and the
-debugger; it is automatically opened when the debugger starts.
-The Source Window displays the status of the trace experiment, controls
-navigation of the trace buffer, and allows visualization of the program
-execution.
-
-<P>Source Window topics:
-<UL>
- <LI><UL><A HREF="#menus">Menus</A>
- <LI><A HREF="#menus_file">File Menu</A>
- <LI><A HREF="#menus_run">Run Menu</A>
- <LI><A HREF="#menus_view">View Menu</A>
- <LI><A HREF="#menus_trace">Trace Menu</A>
- <LI><A HREF="#menus_prefs">Preferences Menu</A>
- </UL>
- <LI><UL><A HREF="#toolbar">Toolbar</A>
- <LI><A HREF="#toolbar_exec">Trace Control Buttons</A>
- <LI><A HREF="#toolbar_window">Window Buttons</A>
- <LI><A HREF="#toolbar_frame">Frame Control</A>
- </UL>
- <LI><UL><A HREF="#display">Source Window Display</A>
- <LI><A HREF="#display_balloon">Variable Balloons</A>
- <LI><A HREF="#display_popup">Source Pop-up Mens</A>
- </UL>
- <LI><UL><A HREF="#status">Source Window Status Bars</A>
- <LI><A HREF="#status_bar">Program Status Bar</A>
- <LI><A HREF="#status_mode">Source Display Status Bar</A>
- </UL>
- <LI><A HREF="#search">Search Entry</A>
-</UL></P>
-
-<H3><A NAME="menus">Menus</A></H3>
-<H4><A NAME="menus_file">File Menu</A></H4>
-The File menu contains the following items:
-<DL>
- <DT>Open
- <DD>Opens a file selection dialog to select the executable to debug
- <DT>Target Settings...
- <DD>Opens the <A HREF="target.html">Target Selection Dialog</A>
- to edit target settings
- <DT>Page Setup
- <DD>(Windows only) Opens the Windows Page Setup dialog to
- configure printing
- <DT>Print
- <DD>(Windows only) Print the contents of the Source Window Display
- <DT>Exit
- <DD>Exits the debugger
-</DL>
-
-<H4><A NAME="menus_run">Run Menu</A></H4>
-The Run menu contains the following items:
-<DL>
- <DT>Connect to target
- <DD>Establish a connection to a target. This option will open
- the <A HREF="target.html">Target Selection Dialog</A> if no
- previous connection has been established in the current
- session.
- <DT>Begin Collection
- <DD>Start collecting trace data on the target
- <DT>End Collection
- <DD>Stop collecting trace data on the target
- <DT>Disconnect
- <DD>Disconnect the debugger from the target
-</DL>
-
-<H4><A NAME="menus_view">View Menu</A></H4>
-The View menu contains the following items:
-<DL>
- <DT>Stack
- <DD>Open a <A HREF="stack.html">Stack Window</A>
- <DT>Registers
- <DD>Open a <A HREF="register.html">Register Window</A>
- <DT>Memory
- <DD>Open a <A HREF="memory.html">Memory Window</A>
- <DT>Watch Expressions
- <DD>Open a <A HREF="watch.html">Watch Window</A>
- <DT>Local Variables
- <DD>Open a <A HREF="locals.html">Locals Window</A>
- <DT>Tracepoints
- <DD>Open a <A HREF="tp.html">Tracepoint Window</A>
- <DT>Tdump
- <DD>Open a <A HREF="tdump.html">Tracepoint Dump Window</A>
- <DT>Console
- <DD>Open a <A HREF="console.html">Console Window</A>
-</DL>
-
-<H4><A NAME="menus_trace">Trace Menu</A></H4>
-The Trace Menu contains the following items:
-<DL>
- <DT>Next Hit
- <DD>Update all displays with the next tracepoint in the
- tracepoint buffer
- <DT>Previous Hit
- <DD>Go to the previous tracepoint in the buffer
- <DT>First Hit
- <DD>View the first tracepoint in the buffer
- <DT>Next Line Hit
- <DD>Go to the next tracepoint in the buffer in the same
- frame as the current tracepoint
- <DT>Next Hit Here
- <DD>Jump to the next reference of the current tracepoint
- in the buffer
- <DT>Tfind Line...
- <DD>Opens a dialog allowing the user to specify which source
- line to inpect in the tracepoint buffer
- <DT>Tfind PC...
- <DD>Opens a dialog allowing the user to specify the PC of the
- tracepoint to view
- <DT>Tfind Tracepoint...
- <DD>Opens a dialog allowing the user to specify which tracepoint
- to view (by number). This option is most commonly used in
- conjunction with the <A HREF="console.html">Console Window</A>.
-</DL>
-
-<H4><A NAME="menus_prefs">Preferences Menu</A></H4>
-The Preferences menu contains the following items:
-<DL>
- <DT>Global
- <DD>Opens the <A HREF="gbl_pref.html">Global Preferences Dialog</A>
- and allows editing of global settings
- <DT>Source
- <DD>Opens the <A HREF="src_pref.html">Source Preferences Dialog</A>
- and allows editing of Source Window settings
- <DT>Register
- <DD>Opens the <A HREF="reg_pref.html">Register Preferences Dialog</A>
- and allows editing of Register Window settings
-</DL>
-
-<H3><A NAME="toolbar">Toolbar</A></H3>
-The Source Window toolbar consists of three functional sections: trace
-control buttons, debugger window buttons, and stack frame control buttons.
-<BR>
-
-<H4><A NAME="toolbar_exec">Tracing Control Buttons</A></H4>
-These convenience buttons provide on-screen access to the most important
-debugger tracing control functions:
-<DL>
- <DT><A NAME="run_button"><IMG SRC="%run"> TStart</A> or
- <A NAME="stop_button"><IMG SRC="%stop"></A> TStop
- <DD>The TStart Button causes the target to start collecting trace data
- <DD>The TStop Button causes the target to stop collecting trace data
- <DT>Next Hit
- <DD>Update all displays with the next tracepoint in the
- tracepoint buffer
- <DT>Previous Hit
- <DD>Go to the previous tracepoint in the buffer
- <DT>First Hit
- <DD>View the first tracepoint in the buffer
- <DT>Next Line Hit
- <DD>Go to the next tracepoint in the buffer in the same
- frame as the current tracepoint
- <DT>Next Hit Here
- <DD>Jump to the next reference of the current tracepoint
- in the buffer
-</DL>
-
-<H4><A NAME="toolbar_window">Window Buttons</A></H4>
-The Debugger Window buttons give instant access to the Debugger's
-auxillary windows:
-<DL>
- <DT><A NAME="register_button"><IMG SRC="%register"></A> Registers
- <DD>Open a <A HREF="register.html">Register Window</A>
- <DT><A NAME="memory_button"><IMG SRC="%memory"></A> Memory
- <DD>Open a <A HREF="memory.html">Memory Window</A>
- <DT><A NAME="stack_button"><IMG SRC="%stack"></A> Stack
- <DD>Open a <A HREF="stack.html">Stack Window</A>
- <DT><A NAME="watch_button"><IMG SRC="%watch"></A> Watch Expressions
- <DD>Open a <A HREF="watch.html">Watch Window</A>
- <DT><A NAME="locals_button"><IMG SRC="%locals"></A> Local Variables
- <DD>Open a <A HREF="locals.html">Locals Window</A>
- <DT><A NAME="tracepoints_button">Tracepoints</A>
- <DD>Open a <A HREF="tp.html">Tracepoint Window</A>
- <DT>Tracepoint Dump Window
- <DD>Open a <A HREF="tdump.html">Tdump Window</A>
- <DT><A NAME="console_button"><IMG SRC="%console"></A> Console
- <DD>Open a <A HREF="console.html">Console Window</A>
-</DL>
-
-<H4><A NAME="toolbar_frame">Frame Control</A></H4>
-The Frame Control area of the toolbar displays information about the PC of
-the current frame, and the frame control buttons may be used to navigate
-through the call stack. Whenever any of these buttons are used, both the
-Source Window Display and the <A HREF="stack.html">Stack Window</A> will
-show the selected frame. In order to use the Stack Window in tracing mode,
-the stack pointer must be collected.
-<DL>
- <!-- is this a problem for windows? no file join? -->
- <DT><IMG SRC="images/frame_info.gif"> Frame Information Display
- <DD>The left half of the frame information display shows the
- value of the PC in the current frame. The right half shows
- the line number of the PC in the source file, if available.
- <DT><A NAME="up_button"><IMG SRC="%up"></A> Up
- <DD>Select and view the stack frame that called this one
- <DT><A NAME="down_button"><IMG SRC="%down"></A> Down
- <DD>Select and view the stack frame called by this one
- <DT><A NAME="bottom_button"><IMG SRC="%bottom"></A> Bottom
- <DD>Select and view the bottom-most stack frame
-</DL>
-
-<H3><A NAME="display">Source Display</A></H3>
-The Source Display is used for many things: browsing source code, setting,
-editing, and deleting tracepoints, and a few other special functions.
-Executable lines (those for which executable code was generated by the
-compiler) are denoted with a marker (a dash, "-") in the first column of
-the display.
-
-<P>The debugger highlights the PC in the current frame in either green,
-indicating that the PC is in the current tracepoint, or gold, indicating
-that the PC is contained in a frame that is not the current tracepoint, i.e.,
-as part of a stack backtrace. A blue highlight is used by the debugger to
-indicate a browsing position. All highlight colors
-are user-selectable in the <A HREF="src_pref.html">Source Preferences</A>.</P>
-<BR>
-
-<H4><A NAME="setting_a_tracepoint">Setting a Tracepoint</A></H4>
-Moving the mouse pointer over the "hot spot" of an executable line will change
-the mouse cursor to a large dot. Clicking the left mouse button will then allow
-tracepoint to be inserted at this line. If no tracepoint exists, the
-<A HREF="tracedlg.html">Add Tracepoint Dialog</A> will appear. If a tracepoint
-is installed, the dash in the left margin will change into a magenta breakdot.
-If a tracepoint exists, the <A HREF="tracedlg.html">Edit Tracepoint Dialog</A>
-appears, allowing either modification of the tracepoint or deletion of the
-tracepoint. If the tracepoint is deleted, the breakdot will revert to a dash.</P>
-
-<P>The executable line marker shows the status of each line: an empty marker
-(the dash) indicates that no tracepoint is set at the line. A colored breakdot
-indicates that a tracepoint exists at the line.</P>
-
-<P>The display will attempt to show the value of variables in
-<A NAME="display_balloon">variable balloons</A>. To activate a
-variable balloon, simply hold the mouse cursor over the name of
-a variable in the Source Display for a second or two: the debugger displays the
-name of the variable, its type, and its value in a pop-up balloon. If the
-variable was not collected, the Variable Balloon will show a memory-access error.</P>
-<BR>
-
-<H4><A NAME="display_popup">Source Pop-up Menus</A></H4>
-The Source Display has two pop-up menus. One is activated by clicking the
-right mouse button when the mouse cursor is over an executable line marker's
-hot spot. This pop-up menu provides access to:
-<DL>
- <DT>Set Tracepoint
- <DD>Opens the <A HREF="#tracedlg">Add/Edit Tracepoint Dialog</A>,
- which allows new tracepoints to be set and modification and
- deletion of existing tracepoints.
-</DL>
-
-<P>The other pop-up menu is activated by clicking the right mouse button
-anywhere else in the Source Display. It is only available when a variable
-or number in the display lies below the mouse cursor or is selected
-(by clicking the left mouse button and dragging the mouse to highlight
-the variable/number). The pop-up menu allows users to:
-<DL>
- <DT><A NAME="add_to_watch">Add <I>expr</I> to Watch</A>
- <DD>Adds the selected expression to the <A HREF="watch.html">Watch
- Window</A>, opening it, if necessary.
- <DT>Dump Memory at <I>expr</I>
- <DD>Opens a new <A HREF="memory.html">Memory Window</A> at the
- selected expression. If the expression is a variable, then
- the Memory Window is opened with memory addresses starting
- at the value of the variable.
- <DT>Set Tracepoint Range
- <DD>This option is only available when a range of lines is highlighted
- in the Source Display. It allows tracepoints with the same
- properties to be set at every executable line in the range. If
- any tracepoints exist in the range already, the debugger will
- ask if the properties of the existing tracepoint should be
- replaced with the properties of the range.
-</DL>
-</P>
-
-<H4><A NAME="status">Source Window Status Bars</A></H4>
-The Source Window has two status bars which inform the user of the
-status of the program (the "status bar") and the status of the Source
-Window.
-
-<P>The <A NAME="status_bar">Program Status Bar</A> (or simply "Status Bar")
-displays the status of the program. Common messages seen here include:
-<DL>
- <DT>No program loaded.
- <DD>No program has been loaded into target memory.
- <DT>Inspecting trace at <I>line/address</I>
- <DD>The debugger is inspecting the tracepoint at line
- <I>line</I> or address <I>address</I>. Use the
- <A HREF="#toolbar_exec">Tracing Control Buttons</A>
- to navigate through the trace buffer.
-</DL>
-<P>The Status Bar also displays some help information. For instance,
-the Status Bar will show the function of a button on the toolbar or
-the Source Display Status Bar as well as any keyboard shortcut for this
-button.</P>
-<BR>
-
-<H4><A NAME="status_mode">Source Display Status Bar</A></H4>
-current state of the Source Window: the name of the file displayed in
-the Display, the name of the function in the Display which contains
-the PC for the current frame (if any), and the display mode.
-
-<P>The <A NAME="file_selector">Source File Selector</A> is a dropdown
-menu which contains the names of all the files that were compiled into
-the program being debugged.</P>
-
-<P>Normally, the File Selector displays the name of the file currently being
-viewed, but any file from the dropdown menu may be selected for browsing.
-Simply select the file to view from the available choices (or type it directly
-into the File Selector) and the Source Window will load that file into
-the Display. To return to the current tracepoint, simply press the
-<A HREF="#bottom_button">Bottom Frame Control Button</A>.</P>
-
-<P>The <A NAME="function_selector">Source Function Selector</A> displays the
-name of the function containing the Source Window's PC, if one exists, but it
-may be used to browse any function in the current file. Simply type the name
-of the desired function into the Function Selector or select it from the
-dropdown menu. The Source Window's PC is updated to point at this function.
-To return to the current tracepoint, simply press the
-<A HREF="#bottom_button">Bottom Frame Control Button</A>.</P>
-
-<P>The <A NAME="mode_selector">Source Display Mode Selector</A> displays
-the viewing mode of the current file/function shown in the Source
-Window Display.</P>
-
-<P>The Display Mode Selector may be used to change the view of the current
-source file. The available display modes are
-<DL>
- <DT>SOURCE
- <DD>The contents of the Display are shown as source code.
- If source code is not available (either because no debugging
- information is available or the source file is not found),
- the Source Window will revert the Display Mode to "ASSEMBLY".
- <DT>ASSEMBLY
- <DD>A disassembly of the target's memory is shown in the Display.
- Even assembly source files show a disassembly of target memory;
- to see the assembly source code, use the SOURCE mode. Note that the
- debugger can only display assmebly code on a function-by-function
- basis. It cannot display all the instructions generated from a single
- source file.
- <DT>MIXED
- <DD>The Display shows source code mixed with the assembler
- instructions which were generated for those lines by the
- compiler for the current funtion. Note that the addresses
- of the assembly lines is not necessarily monotonically
- increasing. If the source file associated with the function
- cannot be found, the Source Window will revert to ASSEMBLY mode.
- <DT>SRC+ASM
- <DD>The Source Window Display is divided into two panes: an
- assembly pane and a source pane. Tracepoints may be set/cleared
- in either pane.
-</DL>
-<BR>
-
-<H3><A NAME="search">Search Entry</A></H3>
-The Search Entry facilitates searching for text in the Source Window Display. Simply enter the
-text to be found into the Search Entry and press the Enter key on the keyboard to search
-forwards in the Source Window Display (hold down ths Shift key to search backwards). If
-a match is found, it is highlighted in the Source Window and the Program Status Bar
-displays information about where the match was found.
-
-<P>The Search Entry can also jump the Source Window to a specific line. Enter the line
-number preceeded by an at-sign (@) into the Search Entry and press enter. If entered
-line number is greater than the total number of lines in the Source Window Display,
-the Display will jump to the end of the current file.</P>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/src_pref.html b/gdb/gdbtk/library/help/trace/src_pref.html
deleted file mode 100644
index e8547964653..00000000000
--- a/gdb/gdbtk/library/help/trace/src_pref.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Source Window Preferences Help</TITLE>
-</HEAD>
-<BODY>
-<H1>Source Window Preferences</H1>
-<H3>Overview</H3>
-<P>Not yet done.</P>
-
-<P>Source Preferences topics:
-<UL>
- <LI><UL><A HREF="#">stuff</A>
- <LI><A HREF="#">stuff</A>
- <LI><A HREF="#">stuff</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="">stuff</A></H3>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/stack.html b/gdb/gdbtk/library/help/trace/stack.html
deleted file mode 100644
index 25bbf0b54f4..00000000000
--- a/gdb/gdbtk/library/help/trace/stack.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Stack Window Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Stack Window</H1>
-<H3>Overview</H3>
-<P>The Stack Window allows users to view the call stack and jump between
-levels of the stack. To use the Stack Window in tracepoint mode, the
-stack pointer must be collected. See
-<A HREF="tracedlg.html#t_actions_add">Adding an Action</A> in the Tracepoint
-Dialog for more information on collecting registers.</P>
-
-<P>Stack Window topics:
-<UL>
- <LI><UL><A HREF="#display">Stack Display</A>
- <LI><A HREF="#display_nav">Navigating the Stack Window</A>
- <LI><A HREF="#display_lvl">Changing the Stack Level</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="display">Stack Display</A></H3>
-The Stack Display consists of a listbox which displays levels of the call stack
-one per line. Each line contains the level number (useful when using the <A
-HREF="console.html">Console Window</A>) and a description of the function executing
-in that level. Typically, the function name and either the address of the function
-or the file and line number where the function is defined are displayed. The
-Stack Window may also be used to jump between levels of the stack.
-<BR>
-
-<H4><A NAME="display_nav">Navigating the Stack Window</A></H4>
-Navigation of the Stack Window is accomplished by clicking on the desired level
-with the left mouse button. The <A HREF="source.html#display">Source Window
-Display</A> updates to show the selected frame. All other secondary windows,
-<A HREF="register.html">Registers</A>, <A HREF="watch.html">Watch</A>, and
-<A HREF="locals.html">Locals</A> update their displays for the selected frame.
-<BR>
-
-<H4><A NAME="display_lvl">Changing Stack Levels</A></H4>
-To switch frames, simply click the left mouse button on the desired frame and the
-debugger will switch contexts, updating all windows. The selected frame is highlighted
-(in gold, by default).
-
-<P>As an alternative, changing stack levels may be accomplished via the
-<A HREF="source.html#toolbar_frame">Frame Control Buttons</A> on the Source Window's
-Toolbar. These buttons may be used to change frames one level at a time (either
-immediately up or immediately down) or to jump to the bottom-most stack frame.
-See <A HREF="source.html#toolbar_frame">Source Frame Control Buttons</A> for more
-information.</P>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/target.html b/gdb/gdbtk/library/help/trace/target.html
deleted file mode 100644
index 83c6420a138..00000000000
--- a/gdb/gdbtk/library/help/trace/target.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Target Selection Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Target Selection Dialog</H1>
-<H3>Overview</H3>
-<P>The Target Selection Dialog allows users to specify the debug target,
-the interface used to connect to the target, and some useful run
-options.</P>
-
-<P>Target Selection topics:
-<UL>
- <LI><UL><A HREF="#select">Selecting a Target</A>
- <LI><A HREF="#select_tar">Specifying a Target</A>
- <LI><A HREF="#select_int">Choosing a Connection Interface</A>
- </UL>
- <LI><UL><A HREF="#options">Run Options</A>
- <LI><A HREF="#options_run_until_main">Run until 'main'</A>
- <LI><A HREF="#options_bp_at_exit">Set breakpoint at 'exit'</A>
- <LI><A HREF="#options_download_dialog">Display Download Dialog</A>
- <LI><A HREF="#options_compare_to_remote_executable">Compare to
- remote executable</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="select">Selecting a Target</A></H3>
-Selecting a target involves choosing a target for debugging and setting connection
-interface options for the target.
-
-<P>Common targets include: "exec" for native debuggers, "remote" for establishing
-a connection to a target board via a serial line, "remotetcp" for TCP connections,
-and "sim" for connections to the simulator. There may be more depending on the
-configuration of the debugger being used.</P>
-
-<P>In general, "remote" targets are always serial connections which require the user
-to specify the serial port and baud rate to be used for the connection and
-"remotetcp" targets are always TCP connections which require specifying the hostname
-and port number of the machine to which to connect. Depending upon configuration,
-there may be numerous serial- and TCP-based connections. These always follow the
-naming convention <I>target</I> and <I>target</I>tcp.</P>
-
-<P>To <A NAME="select_tar"> select a target</A>, choose one of the available targets
-from the dropdown menu in the Connection Frame. Then <A NAME="#select_int">specify
-the interface options</A> for this target: selecting the baudrate and serial port
-from the dropdown menus (serial targets only) or entering the hostname and port number
-(TCP targets only).</P>
-
-<H3><A NAME="options">Run Options</A></H3>
-Three run options which may be selected include:
-<DL>
- <DT><A NAME="options_run_until_main">Run until 'main'
- <DD>Sets a breakpoint at main(). This has no effect when using
- GDB in tracing mode.
- <DT><A NAME="options_bp_at_exit">Set breakpoint at 'exit'
- <DD>Sets a breakpoint at exit(). This has no effect when using
- GDB in tracing mode.
- <DT><A NAME="options_download_dialog">Display Download Dialog
- <DD>Displays a dialog showing the progress of the download to
- the target section by section. This has no effect when using
- GDB in tracing mode.
- <DT><A NAME="options_compare_to_remote_executable">
- Compare to remote executable</A>
- <DD>When attaching to a tracing target, compare the host's and target's
- executable by computing the checksum of each loadable section.
-</DL>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/tdump.html b/gdb/gdbtk/library/help/trace/tdump.html
deleted file mode 100644
index 1850cb00373..00000000000
--- a/gdb/gdbtk/library/help/trace/tdump.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Trace Dump Window Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The TDump Window</H1>
-<H3>Overview</H3>
-<P>The Tdump Window displays all of the information contained in the
-trace buffer for the current tracepoint. To view the contents of the
-trace buffer for a specific tracepoint, use the <A HREF="source.html#toolbar_exec">
-Tracing Control Buttons</A> on the <A HREF="source.html#toolbar">Source Window Toolbar
-</A>, or jump to the tracepoint using one of the Tfind Dialogs accessible
-through the Source Window's <A HREF="source.html#menus_trace">Trace Menu</A>.
-</P>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/tp.html b/gdb/gdbtk/library/help/trace/tp.html
deleted file mode 100644
index 471e1d545e9..00000000000
--- a/gdb/gdbtk/library/help/trace/tp.html
+++ /dev/null
@@ -1,111 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Tracepoint Window Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Tracepoint Window</H1>
-<H3>Overview</H3>
-<P>The Tracepoint Window lists all the various tracepoints that exist in
-the program. It facilitates modifying tracepoints (make them
-temporary or normal, disabled or enabled) and removing tracepoints.</P>
-
-<P>Tracepoint Window topics:
-<UL>
- <LI><UL><A HREF="#menus">Menus</A>
- <LI><A HREF="#menus_bp">Tracepoint Menu</A>
- <LI><A HREF="#menus_global">Global Menu</A>
- </UL>
- <LI><UL><A HREF="#display">Tracepoint Display</A>
- <LI><A HREF="#display_state">Enabling/Disabling Tracepoints</A>
- <LI><A HREF="#display_remove">Removing Tracepoints</A>
- <LI><A HREF="#display_popup">Tracepoint Pop-up Menu</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="menus">Menus</A></H3>
-The Tracepoint Window contains two menus, one which deals specifically with
-the individual tracepoints selected in the window, and one whose commands
-affect all tracepoints.
-<BR>
-
-<H4><A NAME="menus_bp">Tracepoint Menu</A></H4>
-The Tracepoint Menu operates on the selected tracepoint only. The
-state of a tracepoint may be changed by selecting the desired state
-from the menu:
-<DL>
- <DT>Actions
- <DD><A HREF="tracedlg.html">Display the Tracepoint Dialog</A> for
- this tracepoint.
- <DT>Enabled
- <DD>The tracepoint is active and will stop the debugger
- when it is hit.
- <DT>Disabled
- <DD>The tracepoint is being ignored. A disabled tracepoint
- will never get hit.
- <DT>Remove
- <DD>Deletes the tracepoint
-</DL>
-<BR>
-
-<H4><A NAME="menus_global">Global Menu</A></H4>
-Items on the Global Menu affect all defined tracepoints. Users may:
-<DL>
- <DT>Enable All
- <DD>Enable all tracepoints
- <DT>Disable All
- <DD>Disable all tracepoints
- <DT>Remove All
- <DD>Delete all tracepoints
-</DL>
-<BR>
-
-<H4><A NAME="display">Tracepoint Display</A></H4>
-The Tracepoint Display is a table of tracepoints. The first column of the
-table (unlabeled) shows a checkbutton, indicating whether the tracepoint
-is enabled (checked) or disabled (unchecked). Disabled tracepoints are
-ignored and will not cause any actions to be performed on the target.
-
-<P>To use the Tracepoint Menu or the Tracepoint Pop-up Menu, first use
-the left mouse button to select a tracepoint from the list, then make the
-menu selection.</P>
-
-<H3>Modifying Tracepoints</H3>
-To <A NAME="display_state">enable</A> a tracepoint, simply click the
-checkbutton in the first column of the desired tracepoint so that it is
-selected (checked). To disable a tracepoint, "uncheck" the checkbutton.
-
-<P>To remove a <A NAME="display_remove">tracepoint</A>, use the left mouse
-button to select the tracepoint to remove and use either the tracepoint Menu
-or the Tracepoint Pop-up Menu to select "remove". To re-install a tracepoint,
-use the <A HREF="source.html#setting_a_tracepoint">Source Window Display</A>.
-</P>
-<BR>
-
-<H4><A NAME="display_popup">Tracepoint Pop-up Menu</A></H4>
-The Tracepoint Pop-up Menu is accessed by using the mouse cursor to select
-a tracepoint from the Tracepoint Display and then clicking the right button
-on the mouse. The Pop-up allows expert users quicker access to the functions
-of the Tracepoint Menu:
-<DL>
- <DT>Actions
- <DD>Display the <A HREF="tracedlg.html">Tracepoint Dialog</A> for
- the selected tracepoint. This allows the tracepoint's actions
- to viewed or edited.
- <DT>Enabled
- <DD>The tracepoint is active and will causes actions to be
- performed on the target when it is hit
- <DT>Disabled
- <DD>The tracepoint is being ignored. A disabled tracepoint
- will never perform any actions or be recorded in the trace
- buffer.
- <DT>Remove
- <DD>Deletes the tracepoint
- <DT>Global, Enable All
- <DD>Enable all tracepoints
- <DT>Global, Disable All
- <DD>Disable all tracepoints
- <DT>Global, Remove All
- <DD>Delete all tracepoints
-</DL>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/tracedlg.html b/gdb/gdbtk/library/help/trace/tracedlg.html
deleted file mode 100644
index 0ad9504471b..00000000000
--- a/gdb/gdbtk/library/help/trace/tracedlg.html
+++ /dev/null
@@ -1,134 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Tracepoint Dialogs Help</TITLE>
-</HEAD>
-<BODY>
-<H1>Tracepoint Dialogs</H1>
-<H3>Overview</H3>
-<P>There are two Tracepoint Dialogs which help users set tracepoints:
-The Tracepoint Dialog is used to view and add actions and The Actions
-Dialog is used to edit a particular action specified in the
-tracepoint's Action List.</P>
-
-<P>Tracepoint Dialogs topics:
-<UL>
- <LI><A HREF="#tracedlg">The Tracepoint Dialog</A>
- <UL>
- <LI><A HREF="#t_experiment">Experiment Frame</A>
- <LI><A HREF="#t_actions">Actions Frame</A>
- <UL>
- <LI><A HREF="#t_actions_passcount">Number of Passes</A>
- <LI><A HREF="#t_actions_add">Adding Actions</A>
- <LI><A HREF="#t_actions_modify">Modifying Actions</A>
- </UL>
- </UL>
- <LI><A HREF="#actionsdlg">The Actions Dialog</A>
- <UL>
- <LI><A HREF="#a_variables">Variables List</A>
- <LI><A HREF="#a_collect">Collection List</A>
- <LI><A HREF="#a_other">Other Entry</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="tracedlg">The Tracepoint Dialog</H3>
-The Tracepoint Dialog is the gateway to viewing and editing
-the properties of any tracepoint. The same dialog is used
-to add new tracepoints and edit and delete existing tracepoints,
-for both single tracepoints and ranges of tracepoints.
-
-<H4><A NAME="t_experiment">Experiment Frame</A></H4>
-The Experiment Frame displays information about the tracepoint's
-location in the program and its status. Specifically,
-<DL>
- <DT>Number
- <DD>The internal number for this tracepoint. New tracepoints
- all have the number "-1". This number may be used to
- refer to specific tracepoints when using the
- <A HREF="console.html">Console Window</A>
- <DT>Hit Count
- <DD>The number of times the tracepoint has been hit
- <DT>Thread
- <DD>The thread in which the tracepoint exists. This
- feature is not currently implemented.
- <DT>Function
- <DD>The function in which the tracepoint is set
- <DT>File
- <DD>The file in which the tracepoint is set
- <DT>Line(s)
- <DD>The line at which the tracepoint is set or the
- lines which the tracepoint range affects
-</DL>
-<BR>
-
-<H4><A NAME="t_actions">Actions Frame</A></H4>
-The Actions Frame displays the user-settable properties of the
-tracepoint, including all actions and a pass count.
-
-<P>A pass count specifies the number of times that the tracepoint
-can be hit on the target before the tracing experiment ceases. A
-pass count of five means that this tracepoint will issue a silent
-"tstop" when it is hit the fifth time (after it has performed all
-it actions). A pass count of zero (0) means that the tracepoint
-will never causes the trace experiment to terminate on the target.</P>
-
-<P>To <A NAME="t_actions_add">add an action</A> for the tracepoint,
-select the appropriate action from the Action ComboBox and click
-"Add". The <A HREF="#actionsdlg">Action Dialog</A> appears to
-allow editing the action's properties.</P>
-
-<P>Currently, there are two actions: collect and while-stepping.
-Any number of collect actions may be added to specify that the
-target should collect variables, registers, and memory when
-it is hit. The while-stepping action may be used to collect
-data for a specified number of machine instructions. Only one
-while-stepping action may be specified for any tracepoint.</P>
-
-<P>To <A NAME="t_actions_modify">modify the actions</A> associated
-with a tracepoint, double-click the left mouse button on the action
-listed in the Action Frame, and the <A HREF="#actionsdlg">Actions
-Dialog</A> will appear.</P>
-
-<P>To accept the tracepoint as displayed, click the OK button. To abort
-installing or editing the tracepoint, click the CANCEL button. To delete
-the tracepoint (if it is not a new tracepoint), click the DELETE button.</P>
-
-<H3><A NAME="actionsdlg">The Actions Dialog</A></H3>
-The Actions Dialog is used to edit an action for the tracepoint. It
-consists of two lists, one containing all (uncollected) local variables
-(including function arguments) and registers, and one containing everything
-being collected.
-
-<P>The <A NAME="#a_variables">Variables List</A> lists all uncollected local variables,
-function arguments, and registers and may also display the special indentifiers
-"All Locals", "All Arguments", and "All Registers". Global variables (and file static
-variables) do not appear on the Variable List.</P>
-
-<P>To move a variable from the Variables List to the Collection List, double-click
-the variable in the Variables List or select the variable in the Variable
-List and press the "<<< Collect" button. To specify a range of variables to be
-collected, select them in the Variables list and click the "<<< Collect" button.</P>
-
-<P><A NAME="a_collect">The Collection List displays all data being collected
-by the action, including the special types "All Locals", "All Registers", and
-"All Arguments", which specify that every local variable, every register, and
-every function argument will be collected, respectively. Specifying a local
-variable, for example, and "All Locals" will cause only the special identifier
-"All Locals" to be sent to the target. Analogously, "All Registers" and "All
-Arguments" also override any register or function argument specifically listed
-in the Collection List.</P>
-
-<P>To remove data from the Collection List, double-click any of the entries listed
-in the List, or select a range of data to be removed and press the "Ignore >>>"
-button. All local variables, function arguments, registers, and special identifiers
-will be returned to the Variable List, while any expression (memory ranges, globals)
-will simply "disappear". To add these again, use the <A HREF="#a_other">Other Entry</A>
-at the bottom of the display.</P>
-
-<P>The <A NAME="#a_other">Other Entry</A> can be used to move any variable listed in
-either the Collection List or the Variable List to the other list. It can also
-be used to specify expressions for collection, such as memory ranges and global variables.
-Simply enter the name of the global variable or the expression and press the enter key on
-the keyboard. If the expression is valid, it will be added/removed from the Collection
-List.</P>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/trace/watch.html b/gdb/gdbtk/library/help/trace/watch.html
deleted file mode 100644
index d980327ed74..00000000000
--- a/gdb/gdbtk/library/help/trace/watch.html
+++ /dev/null
@@ -1,118 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Watch Window Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Watch Window</H1>
-<H3>Overview</H3>
-<P>The Watch Window may be used to inspect any collected expression, including
-global variables, static variables, local variables, function arguments,
-and registers.</P>
-
-<P>Watch Window topics:
-<UL>
- <LI><UL><A HREF="#menus">Watch Menu</A>
- <LI><A HREF="#menus_fmt">Format</A>
- <LI><A HREF="#menus_remove">Remove</A>
- </UL>
- <LI><UL><A HREF="#new">Adding Watch Expressions</A>
- <LI><A HREF="#new_ent">In the Watch Window</A>
- <LI><A HREF="#new_src">In the Source Window</A>
- <LI><A HREF="#new_cast">Casting Pointers</A>
- </UL>
- <LI><UL><A HREF="#display">Watch Display</A>
- <LI><A HREF="#display_deref">Dereferencing Pointers</A>
- <LI><A HREF="#display_struct">Viewing a Structure or Class</A>
- <LI><A HREF="#display_popup">Watch Pop-up Menu</A>
- </UL>
-</UL></P>
-
-<H3><A NAME="menus">Watch Menu</A></H3>
-The Watch Menu gives on-screen access to the funtions of the Watch Window.
-To use any of these functions, first use the left mouse button to select an
-expression from the display. Then select:
-
-<DL>
- <DT><A NAME="menus_fmt">Format</A>
- <DD>Change the display format of the expression
- <DT><A NAME="menus_remove">Remove</A>
- <DD>Remove the expression from the Watch Window
-</DL>
-
-<H3><A NAME="new">Adding Watch Expressions</A></H3>
-<A NAME="new_ent">To add an expression to the Watch Window</A>, simply enter
-the expression into the entry at the bottom of the window and press return
-or click the "Add Watch" button. The expression is validated and added to the
-Watch Window Display.
-
-<P><A NAME="new_src">To add an expression to the Watch Window from the
-<A HREF="source.html">Source Window</A></A>, use the
-"<A HREF="source.html#add_to_watch">Add to Watch</A>" option of the
-<A HREF="source.html#display_popup">Source Window Pop-up Menu</A>.</P>
-
-<P>Any legal expression may be added to the Watch Window, which will
-evaluate each of its expressions everytime the program runs. Be cautious
-adding expressions which cause assignments, such as "<CODE>i++</CODE>".</P>
-
-<P>Adding a register to the Watch Window can be advantages when debugging
-via a slow serial line. In this case, keeping the entire Register Window open
-may be inefficient. Consider adding the register to the Watch Window. Simply
-enter the name of the register preceded with a dollar sign ($) into the
-Entry. For example, to watch the PC register, enter "<CODE>$pc</CODE>" into
-the Watch Window Entry. The program counter is added to the Display.</P>
-
-<P><A NAME="new_cast">To cast pointers</A>, simply enter the cast into the
-Watch Window Entry at the bottom of the window. Use the same syntax for the
-cast that the source file uses. If the source file uses C, the a simple
-cast of "<CODE>ptr</CODE>" of type "<CODE>void *</CODE>" can be cast to type
-"<CODE>my_struct</CODE>" by entering "<CODE>(my_struct *) ptr</CODE>" into
-the Entry.</P>
-
-<H3><A NAME="display">Watch Display</A></H3>
-The Watch Window Display consists of a scrolled listbox which contains all
-watch expressions, one per line. To use any of the functions of the Watch
-Window, use the left mouse button to select any element from the Display.
-
-<P>Pointers, structures, and classes appear in the display with a small
-exapansion box before their names. To <A NAME="display_deref">dereference
-pointers</A> or <A NAME="display_struct">view the members of classes or
-structures</A>, click the closed expansion box (which appears as a small
-plus sign, "+") to "expand" the listing. The expansion box changes to a
-minus sign, "-", indicating that the display is now open. Pointers,
-structures and classes may be expanded recursively to allow multiple pointer
-dereferences and embedded structure viewing.
-
-<P>The Locals Display updates as the trace buffer is navigated, highlighting
-in blue those variables whose values have changed.</P>
-
-<P>The Watch Window will, by default, display all pointers in hexadecimal and all
-other variables in decimal. To change the default display of variables, use the
-"set output-radix" command in the console window. (Type "help set output-radix" in the
-console window for help. To make this change permanent, it must be added to the user's
-init file -- .gdbinit.) To change the display
-format for a variable, select the Format option from either the Variable Menu or the
-<A HREF="#display_popup">Watch Pop-up Menu</A>.
-<BR>
-
-<H4><A NAME="display_popup">Watch Pop-up Menu</A></H4>
-The Watch Pop-up Menu provides quick access to the functions of the Watch Window.
-To use the Locals Pop-up Menu, first select an expression from the Display (by
-clicking the left mouse button on it) and click the right mouse button, choosing
-from the pop-up:
-<DL>
- <DT>Format
- <DD>Change the display format of the expression. The expression may be
- displayed as:
- <DL>
- <DT>Hex
- <DD>hexadecimal (base 16)
- <DT>Decimal
- <DD>decimal (base 10)
- <DT>Binary
- <DD>binary (base 2)
- <DT>Octal
- <DD>octal (base 8)
- </DL>
-</DL>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/help/watch.html b/gdb/gdbtk/library/help/watch.html
deleted file mode 100644
index 01e253b1883..00000000000
--- a/gdb/gdbtk/library/help/watch.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Watch Window Help</TITLE>
-</HEAD>
-<BODY>
-<H1>The Watch Window</H1>
-<img src="images/watch.png" alt="Watch Window Image" width=545 height=308 border=0>
-<H2>Overview</H2>
-
-<P>The Watch Window may be used to inspect and edit any expression, including
-global variables, static variables, local variables, function arguments,
-and registers. All expressions in scope are displayed with the expression in
-blue, the expression type in red, and the expression value in black. When an
-expression value changes, it is displayed in green. Expressions that are not
-in scope are all gray.</P>
-
-
-<H3>Adding Watch Expressions</H3>
-<p>To add an expression to the Watch Window, simply enter
-the expression into the entry at the bottom of the window and press return
-or click the "Add Watch" button. The expression is validated and added to the
-Watch Window Display.</p>
-
-<P>To add an expression to the Watch Window from the
-<A HREF="source.html">Source Window</A>, use the
-"<A HREF="source.html#add_to_watch">Add to Watch</A>" option of the
-<A HREF="source.html#display_popup">Source Window Pop-up Menu</A>.</P>
-
-<P>Any legal expression may be added to the Watch Window, which will
-evaluate each of its expressions everytime the program runs. Be cautious
-adding expressions which cause assignments, such as "<CODE>i++</CODE>".</P>
-
-<P>Adding a register to the Watch Window can be advantages when debugging
-via a slow serial line. In this case, keeping the entire Register Window open
-may be inefficient. Consider adding the register to the Watch Window. Simply
-enter the name of the register preceded with a dollar sign ($) into the
-Entry. For example, to watch the PC register, enter "<CODE>$pc</CODE>" into
-the Watch Window Entry. The program counter is added to the Display.</P>
-
-<P>To cast pointers, simply enter the cast into the
-Watch Window Entry at the bottom of the window. Use the same syntax for the
-cast that the source file uses. If the source file uses C, the a simple
-cast of "<CODE>ptr</CODE>" of type "<CODE>void *</CODE>" can be cast to type
-"<CODE>my_struct</CODE>" by entering "<CODE>(my_struct *) ptr</CODE>" into
-the Entry.</P>
-
-<H3>Watch Display</H3>
-<p>The Watch Window Display consists of a scrolled listbox which contains all
-watch expressions, one per line. To use any of the functions of the Watch
-Window, use the left mouse button to select any element from the Display.</p>
-
-<P>Pointers, structures, and classes appear in the display with a small
-exapansion box before their names. To dereference
-pointers or view the members of classes or
-structures, click the closed expansion box (which appears as a small
-plus sign, "+") to "expand" the listing. The expansion box changes to a
-minus sign, "-", indicating that the display is now open. Pointers,
-structures and classes may be expanded recursively to allow multiple pointer
-derefernces and embedded structure viewing.</P>
-
-<P>The Watch Display updates after every execution of the program and
-highlights in green those expressions whose values have changed.</P>
-
-<P>The Watch Window will, by default, display all pointers and registers in
-hexadecimal and all other expressions in decimal. To change the display
-format for an expression, select the Format option from the pop-up menu.</P>
-
-<H3>Editing an Expression</H3>
-<p>To edit an expression, either double-click the left mouse button on the expression
-in the Display or select the Edit option from the popup-menu. To abort editing
-an expression's value, simply press
-the escape key on the keyboard. The expression's original value is restored.</p>
-
-<H3>Watch Pop-up Menu</H3>
-<p>The pop-up menu provides quick access to the functions of the Watch Window.
-To use the pop-up menu, click the right mouse button while over a variable.</p>
-<DL>
- <dt>Format<dd>Change the display format of the variable.</dd></dt>
- <dt>Edit<dd>Edit the variable's value.</dd></dt>
- <dt>Delete<dd>Remove the variable from the display.</dd></dt>
- <dt>Dump Memory<dd>Open a Memory Window with the variable's value as an aaddress.</dd></dt>
- <dt>Help<dd>Open this help page.</dd></dt>
- <dt>Close<dd>Close the Local Variables Window.</dd></dt>
-</DL>
-</BODY>
-</HTML>
diff --git a/gdb/gdbtk/library/helpviewer.tcl b/gdb/gdbtk/library/helpviewer.tcl
deleted file mode 100644
index 12eec6a9731..00000000000
--- a/gdb/gdbtk/library/helpviewer.tcl
+++ /dev/null
@@ -1,98 +0,0 @@
-# Open a viewer for HTML help info
-# Copyright (C) 2002, 2008, Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ------------------------------------------------------------------------------
-# NAME: public proc open_help
-# SYNOPSIS: open_help file
-# DESC: Opens html help file using an appropriate
-# browser.
-# ------------------------------------------------------------------------------
-
-proc open_help {hfile} {
- debug $hfile
- # create full pathname link
- set link file://[file join $::GDBTK_LIBRARY help $hfile]
-
- # windows is easy
- if {$::gdbtk_platform(platform) == "windows"} {
- ide_shell_execute open $link
- return
- }
-
- #
- # for Unix, we never know what is installed
- #
-
- # set list of viewer apps to try
- switch [pref get gdb/compat] {
- "KDE" {
- set apps {htmlview khelpcenter firefox opera mozilla}
- }
- "GNOME" {
- set apps {htmlview firefox opera mozilla gnome-help khelpcenter}
- }
- default {
- set apps {htmlview firefox opera mozilla gnome-help khelpcenter netscape}
- }
- }
-
- # If the user has previously entered a browser name, append it
- # to the list. Should it go first or last?
- set bname [pref get gdb/help/browsername]
- if {$bname != ""} {
- lappend apps $bname
- }
-
- # now loop through list checking each application
- foreach app $apps {
- debug "app=$app"
- if {[catch "exec $app $link &" result]} {
- debug "$app failed: $result"
- } else {
- return
- }
- }
-
- # if we reached here, nothing worked, so prompt for a name
- set text "No help browser was found on your system.\n\
-Please enter the name of an HTML viewer application."
- while {[set app [prompt_helpname $text]] != "0"} {
- if {$app != ""} {
- if {[catch "exec $app $link &" result]} {
- dbug W "$app failed: $result"
- set text "Could not run application $app.\n\
-Please enter the name of an HTML viewer application."
- } else {
- pref set gdb/help/browsername $app
- return
- }
- }
- }
-}
-
-# displays an entry dialog and asks for the name of an application
-# returns 0 on cancel
-# name on success
-proc prompt_helpname {text} {
- iwidgets::promptdialog .pd -title "Browser Query" -modality application \
- -labeltext $text
- if {[.pd activate]} {
- set app [string trim [.pd get]]
- destroy .pd
- return $app
- }
- destroy .pd
- debug "cancelled"
- return 0
-}
-
diff --git a/gdb/gdbtk/library/images/Movie_off.gif b/gdb/gdbtk/library/images/Movie_off.gif
deleted file mode 100644
index 7fce569189e..00000000000
--- a/gdb/gdbtk/library/images/Movie_off.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/Movie_on.gif b/gdb/gdbtk/library/images/Movie_on.gif
deleted file mode 100644
index 51e29d679b2..00000000000
--- a/gdb/gdbtk/library/images/Movie_on.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/bottom.gif b/gdb/gdbtk/library/images/bottom.gif
deleted file mode 100644
index 82fe7ab0d2a..00000000000
--- a/gdb/gdbtk/library/images/bottom.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/bp.gif b/gdb/gdbtk/library/images/bp.gif
deleted file mode 100644
index 55a153d3e94..00000000000
--- a/gdb/gdbtk/library/images/bp.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/check.gif b/gdb/gdbtk/library/images/check.gif
deleted file mode 100644
index 37ff7d3ce81..00000000000
--- a/gdb/gdbtk/library/images/check.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/console.gif b/gdb/gdbtk/library/images/console.gif
deleted file mode 100644
index e9412b20540..00000000000
--- a/gdb/gdbtk/library/images/console.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/continue.gif b/gdb/gdbtk/library/images/continue.gif
deleted file mode 100644
index c3babce52ee..00000000000
--- a/gdb/gdbtk/library/images/continue.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/down.gif b/gdb/gdbtk/library/images/down.gif
deleted file mode 100644
index 0a591f4ac29..00000000000
--- a/gdb/gdbtk/library/images/down.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/edit.gif b/gdb/gdbtk/library/images/edit.gif
deleted file mode 100644
index bc033dbc066..00000000000
--- a/gdb/gdbtk/library/images/edit.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/finish.gif b/gdb/gdbtk/library/images/finish.gif
deleted file mode 100644
index d717238c335..00000000000
--- a/gdb/gdbtk/library/images/finish.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/gdbtk_icon.gif b/gdb/gdbtk/library/images/gdbtk_icon.gif
deleted file mode 100644
index 46f69e62852..00000000000
--- a/gdb/gdbtk/library/images/gdbtk_icon.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/help.gif b/gdb/gdbtk/library/images/help.gif
deleted file mode 100644
index 061e2c600cc..00000000000
--- a/gdb/gdbtk/library/images/help.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/home.gif b/gdb/gdbtk/library/images/home.gif
deleted file mode 100644
index ac71cd53388..00000000000
--- a/gdb/gdbtk/library/images/home.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/icons.txt b/gdb/gdbtk/library/images/icons.txt
deleted file mode 100644
index 2a15b5b4994..00000000000
--- a/gdb/gdbtk/library/images/icons.txt
+++ /dev/null
@@ -1 +0,0 @@
-Basic Icon Set
diff --git a/gdb/gdbtk/library/images/insight.gif b/gdb/gdbtk/library/images/insight.gif
deleted file mode 100644
index fa5cfe19617..00000000000
--- a/gdb/gdbtk/library/images/insight.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/less.gif b/gdb/gdbtk/library/images/less.gif
deleted file mode 100644
index 045025a8062..00000000000
--- a/gdb/gdbtk/library/images/less.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/memory.gif b/gdb/gdbtk/library/images/memory.gif
deleted file mode 100644
index 1f62949d7d5..00000000000
--- a/gdb/gdbtk/library/images/memory.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/more.gif b/gdb/gdbtk/library/images/more.gif
deleted file mode 100644
index 67cb020014e..00000000000
--- a/gdb/gdbtk/library/images/more.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/next.gif b/gdb/gdbtk/library/images/next.gif
deleted file mode 100644
index 99d1ea62ea7..00000000000
--- a/gdb/gdbtk/library/images/next.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/next_check.gif b/gdb/gdbtk/library/images/next_check.gif
deleted file mode 100644
index 4488f04c76b..00000000000
--- a/gdb/gdbtk/library/images/next_check.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/next_frame.gif b/gdb/gdbtk/library/images/next_frame.gif
deleted file mode 100644
index 1bbc97932c5..00000000000
--- a/gdb/gdbtk/library/images/next_frame.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/next_hit.gif b/gdb/gdbtk/library/images/next_hit.gif
deleted file mode 100644
index d65295c099a..00000000000
--- a/gdb/gdbtk/library/images/next_hit.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/next_line.gif b/gdb/gdbtk/library/images/next_line.gif
deleted file mode 100644
index 96b374f65e3..00000000000
--- a/gdb/gdbtk/library/images/next_line.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/nexti.gif b/gdb/gdbtk/library/images/nexti.gif
deleted file mode 100644
index d2b65d4a551..00000000000
--- a/gdb/gdbtk/library/images/nexti.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/open.gif b/gdb/gdbtk/library/images/open.gif
deleted file mode 100644
index 173290a2b9d..00000000000
--- a/gdb/gdbtk/library/images/open.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/prev_hit.gif b/gdb/gdbtk/library/images/prev_hit.gif
deleted file mode 100644
index 17ed5686ff9..00000000000
--- a/gdb/gdbtk/library/images/prev_hit.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/reg.gif b/gdb/gdbtk/library/images/reg.gif
deleted file mode 100644
index 8efac2fd28f..00000000000
--- a/gdb/gdbtk/library/images/reg.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/rewind.gif b/gdb/gdbtk/library/images/rewind.gif
deleted file mode 100644
index 60b3d6135b1..00000000000
--- a/gdb/gdbtk/library/images/rewind.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/run.gif b/gdb/gdbtk/library/images/run.gif
deleted file mode 100644
index 6f45f3a2a4d..00000000000
--- a/gdb/gdbtk/library/images/run.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/run_expt.gif b/gdb/gdbtk/library/images/run_expt.gif
deleted file mode 100644
index 1c5c37cbef3..00000000000
--- a/gdb/gdbtk/library/images/run_expt.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/src.gif b/gdb/gdbtk/library/images/src.gif
deleted file mode 100644
index a1890ef8759..00000000000
--- a/gdb/gdbtk/library/images/src.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/stack.gif b/gdb/gdbtk/library/images/stack.gif
deleted file mode 100644
index e17824a3592..00000000000
--- a/gdb/gdbtk/library/images/stack.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/step.gif b/gdb/gdbtk/library/images/step.gif
deleted file mode 100644
index 776c8c3466a..00000000000
--- a/gdb/gdbtk/library/images/step.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/stepi.gif b/gdb/gdbtk/library/images/stepi.gif
deleted file mode 100644
index d721c13e548..00000000000
--- a/gdb/gdbtk/library/images/stepi.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/stop.gif b/gdb/gdbtk/library/images/stop.gif
deleted file mode 100644
index d863aba7859..00000000000
--- a/gdb/gdbtk/library/images/stop.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/tdump.gif b/gdb/gdbtk/library/images/tdump.gif
deleted file mode 100644
index 87db34c06c6..00000000000
--- a/gdb/gdbtk/library/images/tdump.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/tp.gif b/gdb/gdbtk/library/images/tp.gif
deleted file mode 100644
index 6ddf743a3fa..00000000000
--- a/gdb/gdbtk/library/images/tp.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/up.gif b/gdb/gdbtk/library/images/up.gif
deleted file mode 100644
index df280098ebd..00000000000
--- a/gdb/gdbtk/library/images/up.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/vars.gif b/gdb/gdbtk/library/images/vars.gif
deleted file mode 100644
index 608fa9337b8..00000000000
--- a/gdb/gdbtk/library/images/vars.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/watch.gif b/gdb/gdbtk/library/images/watch.gif
deleted file mode 100644
index 077444d5fe1..00000000000
--- a/gdb/gdbtk/library/images/watch.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images/watch_movie.gif b/gdb/gdbtk/library/images/watch_movie.gif
deleted file mode 100644
index 855f703ac3f..00000000000
--- a/gdb/gdbtk/library/images/watch_movie.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/Movie_off.gif b/gdb/gdbtk/library/images2/Movie_off.gif
deleted file mode 100644
index 7fce569189e..00000000000
--- a/gdb/gdbtk/library/images2/Movie_off.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/Movie_on.gif b/gdb/gdbtk/library/images2/Movie_on.gif
deleted file mode 100644
index 51e29d679b2..00000000000
--- a/gdb/gdbtk/library/images2/Movie_on.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/bottom.gif b/gdb/gdbtk/library/images2/bottom.gif
deleted file mode 100644
index 1190cd2d2ad..00000000000
--- a/gdb/gdbtk/library/images2/bottom.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/bp.gif b/gdb/gdbtk/library/images2/bp.gif
deleted file mode 100644
index 55a153d3e94..00000000000
--- a/gdb/gdbtk/library/images2/bp.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/check.gif b/gdb/gdbtk/library/images2/check.gif
deleted file mode 100644
index 37ff7d3ce81..00000000000
--- a/gdb/gdbtk/library/images2/check.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/console.gif b/gdb/gdbtk/library/images2/console.gif
deleted file mode 100644
index e9412b20540..00000000000
--- a/gdb/gdbtk/library/images2/console.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/continue.gif b/gdb/gdbtk/library/images2/continue.gif
deleted file mode 100644
index 99c0673cdec..00000000000
--- a/gdb/gdbtk/library/images2/continue.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/down.gif b/gdb/gdbtk/library/images2/down.gif
deleted file mode 100644
index 09ae742f225..00000000000
--- a/gdb/gdbtk/library/images2/down.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/edit.gif b/gdb/gdbtk/library/images2/edit.gif
deleted file mode 100644
index 6ff9082861e..00000000000
--- a/gdb/gdbtk/library/images2/edit.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/finish.gif b/gdb/gdbtk/library/images2/finish.gif
deleted file mode 100644
index 3e4a077185c..00000000000
--- a/gdb/gdbtk/library/images2/finish.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/function.gif b/gdb/gdbtk/library/images2/function.gif
deleted file mode 100644
index c61f38a2724..00000000000
--- a/gdb/gdbtk/library/images2/function.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/gdbtk_icon.gif b/gdb/gdbtk/library/images2/gdbtk_icon.gif
deleted file mode 100644
index 46f69e62852..00000000000
--- a/gdb/gdbtk/library/images2/gdbtk_icon.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/help.gif b/gdb/gdbtk/library/images2/help.gif
deleted file mode 100644
index 1e127d6c0bb..00000000000
--- a/gdb/gdbtk/library/images2/help.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/home.gif b/gdb/gdbtk/library/images2/home.gif
deleted file mode 100644
index ac71cd53388..00000000000
--- a/gdb/gdbtk/library/images2/home.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/icons.txt b/gdb/gdbtk/library/images2/icons.txt
deleted file mode 100644
index eefb6d2c6e3..00000000000
--- a/gdb/gdbtk/library/images2/icons.txt
+++ /dev/null
@@ -1 +0,0 @@
-Windows-style Icon Set
diff --git a/gdb/gdbtk/library/images2/insight.gif b/gdb/gdbtk/library/images2/insight.gif
deleted file mode 100644
index fa5cfe19617..00000000000
--- a/gdb/gdbtk/library/images2/insight.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/less.gif b/gdb/gdbtk/library/images2/less.gif
deleted file mode 100644
index 045025a8062..00000000000
--- a/gdb/gdbtk/library/images2/less.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/memory.gif b/gdb/gdbtk/library/images2/memory.gif
deleted file mode 100644
index 1f62949d7d5..00000000000
--- a/gdb/gdbtk/library/images2/memory.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/more.gif b/gdb/gdbtk/library/images2/more.gif
deleted file mode 100644
index 67cb020014e..00000000000
--- a/gdb/gdbtk/library/images2/more.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/next.gif b/gdb/gdbtk/library/images2/next.gif
deleted file mode 100644
index 9675812ce9c..00000000000
--- a/gdb/gdbtk/library/images2/next.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/next_check.gif b/gdb/gdbtk/library/images2/next_check.gif
deleted file mode 100644
index 4488f04c76b..00000000000
--- a/gdb/gdbtk/library/images2/next_check.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/next_frame.gif b/gdb/gdbtk/library/images2/next_frame.gif
deleted file mode 100644
index 1bbc97932c5..00000000000
--- a/gdb/gdbtk/library/images2/next_frame.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/next_hit.gif b/gdb/gdbtk/library/images2/next_hit.gif
deleted file mode 100644
index d65295c099a..00000000000
--- a/gdb/gdbtk/library/images2/next_hit.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/next_line.gif b/gdb/gdbtk/library/images2/next_line.gif
deleted file mode 100644
index 96b374f65e3..00000000000
--- a/gdb/gdbtk/library/images2/next_line.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/nexti.gif b/gdb/gdbtk/library/images2/nexti.gif
deleted file mode 100644
index d05248fc6e1..00000000000
--- a/gdb/gdbtk/library/images2/nexti.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/open.gif b/gdb/gdbtk/library/images2/open.gif
deleted file mode 100644
index 173290a2b9d..00000000000
--- a/gdb/gdbtk/library/images2/open.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/prev_hit.gif b/gdb/gdbtk/library/images2/prev_hit.gif
deleted file mode 100644
index 17ed5686ff9..00000000000
--- a/gdb/gdbtk/library/images2/prev_hit.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/reg.gif b/gdb/gdbtk/library/images2/reg.gif
deleted file mode 100644
index 9f314a9bcf8..00000000000
--- a/gdb/gdbtk/library/images2/reg.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/rewind.gif b/gdb/gdbtk/library/images2/rewind.gif
deleted file mode 100644
index 60b3d6135b1..00000000000
--- a/gdb/gdbtk/library/images2/rewind.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/run.gif b/gdb/gdbtk/library/images2/run.gif
deleted file mode 100644
index 3a91e8efd37..00000000000
--- a/gdb/gdbtk/library/images2/run.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/run_expt.gif b/gdb/gdbtk/library/images2/run_expt.gif
deleted file mode 100644
index 1c5c37cbef3..00000000000
--- a/gdb/gdbtk/library/images2/run_expt.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/src.gif b/gdb/gdbtk/library/images2/src.gif
deleted file mode 100644
index 2b78909b2e9..00000000000
--- a/gdb/gdbtk/library/images2/src.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/stack.gif b/gdb/gdbtk/library/images2/stack.gif
deleted file mode 100644
index e17824a3592..00000000000
--- a/gdb/gdbtk/library/images2/stack.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/step.gif b/gdb/gdbtk/library/images2/step.gif
deleted file mode 100644
index 00caaf8fccd..00000000000
--- a/gdb/gdbtk/library/images2/step.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/stepi.gif b/gdb/gdbtk/library/images2/stepi.gif
deleted file mode 100644
index a7217659018..00000000000
--- a/gdb/gdbtk/library/images2/stepi.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/stop.gif b/gdb/gdbtk/library/images2/stop.gif
deleted file mode 100644
index 92ce1afa7d8..00000000000
--- a/gdb/gdbtk/library/images2/stop.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/target.gif b/gdb/gdbtk/library/images2/target.gif
deleted file mode 100644
index 9aa9c3ac25c..00000000000
--- a/gdb/gdbtk/library/images2/target.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/tdump.gif b/gdb/gdbtk/library/images2/tdump.gif
deleted file mode 100644
index 87db34c06c6..00000000000
--- a/gdb/gdbtk/library/images2/tdump.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/tp.gif b/gdb/gdbtk/library/images2/tp.gif
deleted file mode 100644
index 6ddf743a3fa..00000000000
--- a/gdb/gdbtk/library/images2/tp.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/up.gif b/gdb/gdbtk/library/images2/up.gif
deleted file mode 100644
index 262dbbf21c8..00000000000
--- a/gdb/gdbtk/library/images2/up.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/vars.gif b/gdb/gdbtk/library/images2/vars.gif
deleted file mode 100644
index 608fa9337b8..00000000000
--- a/gdb/gdbtk/library/images2/vars.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/watch.gif b/gdb/gdbtk/library/images2/watch.gif
deleted file mode 100644
index 077444d5fe1..00000000000
--- a/gdb/gdbtk/library/images2/watch.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/images2/watch_movie.gif b/gdb/gdbtk/library/images2/watch_movie.gif
deleted file mode 100644
index 855f703ac3f..00000000000
--- a/gdb/gdbtk/library/images2/watch_movie.gif
+++ /dev/null
Binary files differ
diff --git a/gdb/gdbtk/library/interface.tcl b/gdb/gdbtk/library/interface.tcl
deleted file mode 100644
index e2287438025..00000000000
--- a/gdb/gdbtk/library/interface.tcl
+++ /dev/null
@@ -1,1829 +0,0 @@
-# Interface between GDB and Insight.
-# Copyright (C) 1997, 1998, 1999, 2001, 2002, 2004, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) as published by
-# the Free Software Foundation; either version 2 of the License, or (at
-# your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-
-# This variable is reserved for this module. Ensure it is an array.
-global gdbtk_state
-set gdbtk_state(busyCount) 0
-
-# *** DEPRECATED: Use GDBEventHandler::breakpoint instead.
-# This is run when a breakpoint changes. The arguments are the
-# action, the breakpoint number, and the breakpoint info.
-#define_hook gdb_breakpoint_change_hook
-
-# *** DEPRECATED: Use GDBEventHandler::set_variable instead.
-# This is run when a `set' command successfully completes in gdb. The
-# first argument is the gdb variable name (as a Tcl list). The second
-# argument is the new value.
-#define_hook gdb_set_hook
-
-# ------------------------------------------------------------
-# PROC: gdbtk_tcl_set_variable - A "set" command was issued
-# in gdb to change an internal variable. Notify
-# gui.
-# ------------------------------------------------------------
-proc gdbtk_tcl_set_variable {var val} {
- set e [SetVariableEvent \#auto -variable $var -value $val]
- GDBEventHandler::dispatch $e
- delete object $e
-}
-
-####################################################################
-# #
-# GUI STATE HOOKS #
-# #
-####################################################################
-# !!!!! NOTE !!!!!
-# For debugging purposes, please put debug statements at the very
-# beginning and ends of all GUI state hooks.
-
-# *** DEPRECATED: Use GDBEventHandler::busy instead.
-# GDB_BUSY_HOOK
-# This hook is used to register a callback when the UI should
-# be disabled because the debugger is either busy or talking
-# to the target.
-#
-# All callbacks should disable ALL user input which could cause
-# any state changes in either the target or the debugger.
-#define_hook gdb_busy_hook
-
-# *** DEPRECATED: Use GDBEventHandler::idle instead.
-# GDB_IDLE_HOOK
-# This hook is used to register a callback when the UI should
-# be enabled because the debugger is no longer busy.
-#
-# All callbacks should enable user input. These callbacks
-# should also be as fast as possible to avoid any significant
-# time delays when enabling the UI.
-define_hook gdb_idle_hook
-
-# *** DEPRECATED: Use GDBEventHandler::update instead.
-# GDB_UPDATE_HOOK
-# This hook is used to register a callback to update the widget
-# when debugger state has changed.
-#define_hook gdb_update_hook
-
-# GDB_NO_INFERIOR_HOOK
-# This hook is used to register a callback which should be invoked
-# whenever there is no inferior (either at startup time or when
-# an inferior is killed).
-#
-# All callbacks should reset their windows to a known, "startup"
-# state.
-define_hook gdb_no_inferior_hook
-
-# GDB_DISPLAY_CHANGE_HOOK
-# This is run when a display changes. The arguments are the action,
-# the breakpoint number, and (optionally) the value.
-define_hook gdb_display_change_hook
-
-# GDB_TRACE_FIND_HOOK
-# This hook is run by the trace find command. It is used to switch
-# from control to browse mode when the user runs tfind commands...
-#
-define_hook gdb_trace_find_hook
-
-# ------------------------------------------------------------------
-# gdbtk_tcl_preloop - This function is called after gdb is initialized
-# but before the mainloop is started. It sets the app name, and
-# opens the first source window.
-# ------------------------------------------------------------------
-
-proc gdbtk_tcl_preloop { } {
- global gdb_exe_name gdb_current_directory
-
- set_baud
-
- tk appname gdbtk
- # If there was an error loading an executible specified on the command line
- # then we will have called pre_add_symbol, which would set us to busy,
- # but not the corresponding post_add_symbol. Do this here just in case...
- after idle gdbtk_idle
- ManagedWin::startup
-
- if {$gdb_exe_name != ""} {
- # At startup, file_changed_hook is called too late for us, so we
- # must notice the initial session by hand. If the arguments exist
- # -- if the user used `gdb --args' -- then we want the new
- # arguments and pwd to override what is set in the session.
- set current_args [gdb_get_inferior_args]
- set current_dir $gdb_current_directory
- Session::notice_file_change
- set_baud
- if {[string length $current_args] > 0} {
- gdb_set_inferior_args $current_args
- gdb_cmd "cd $current_dir"
- }
- }
-
- gdbtk_update
-}
-
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_busy - Dispatch a busy event
-#
-# Use this procedure from within GUI code to indicate that
-# the debugger is busy, either running the inferior or
-# talking to the target.
-# ------------------------------------------------------------------
-proc gdbtk_busy {} {
-
- set e [BusyEvent \#auto]
- GDBEventHandler::dispatch $e
- delete object $e
-
- # Force the screen to update
- update
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_update - run all update hooks
-#
-# Use this procedure to force all widgets to update
-# themselves. This hook is usually run after command
-# that could change target state.
-# ------------------------------------------------------------------
-proc gdbtk_update {} {
-
- set e [UpdateEvent \#auto]
- GDBEventHandler::dispatch $e
- delete object $e
-
- # Force the screen to update
- update
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_update_safe - run all update hooks in a safe way
-#
-# Use this procedure to force all widgets to update
-# themselves. This hook is usually run after command
-# that could change target state.
-# Like gdbtk_update but safe to be used in "after idle"
-# which is used in update hooks.
-# ------------------------------------------------------------------
-proc gdbtk_update_safe {} {
- global gdb_running
-
- # Fencepost: Do not update if we are running the target
- # We get here because script commands may have changed memory or
- # registers and "after idle" events registered as a consequence
- # If we try to update while the target is running we are doomed.
- if {!$gdb_running} {
- gdbtk_update
- }
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_idle - dispatch IdleEvent
-#
-# Use this procedure to free the UI for more user input.
-# This should only be run AFTER all communication with
-# the target has halted, otherwise the risk of two (or
-# more) widgets talking to the target arises.
-# ------------------------------------------------------------------
-proc gdbtk_idle {} {
- global gdb_running
-
- # Put the unfiltered hook back in place, just in case
- # somebody swapped it out, and then died before they
- # could replace it.
- gdb_restore_fputs
-
- set err [catch {run_hooks gdb_idle_hook}]
- if {$err} {
- dbug E "Error running gdb_idle_hook: $::errorInfo"
- }
-
- set e [IdleEvent \#auto]
- GDBEventHandler::dispatch $e
- delete object $e
-
- if {!$gdb_running} {
- set err [catch {run_hooks gdb_no_inferior_hook} txt]
- if {$err} {
- dbug E "no_inferior_hook error: $txt"
- }
- }
-
- # Force the screen to update
- update
-}
-
-define_hook download_progress_hook
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_quit_check - Ask if the user really wants to quit.
-# ------------------------------------------------------------------
-proc gdbtk_quit_check {} {
- global gdb_downloading gdb_running gdb_exe_name
-
- if {$gdb_downloading} {
- set msg "Downloading to target,\n really close the debugger?"
- if {![gdbtk_tcl_query $msg no]} {
- return 0
- }
- } elseif {$gdb_running} {
- # While we are running the inferior, gdb_cmd is fenceposted and
- # returns immediately. Therefore, we need to ask here. Do we need
- # to stop the target, too?
- set msg "A debugging session is active.\n"
- append msg "Do you still want to close the debugger?"
- if {![gdbtk_tcl_query $msg no]} {
- return 0
- }
- }
-
- return 1
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_quit - Quit the debugger
-# Call this procedure anywhere the user can request to quit.
-# This procedure will ask all the right questions before
-# exiting.
-# ------------------------------------------------------------------
-proc gdbtk_quit {} {
- if {[gdbtk_quit_check]} {
- gdbtk_force_quit
- }
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_force_quit - Quit the debugger immediately
-# ------------------------------------------------------------------
-proc gdbtk_force_quit {} {
- # If we don't delete source windows, GDB hooks will
- # try to update them as we exit
- foreach win [ManagedWin::find SrcWin] {
- delete object $win
- }
- # Calling gdb_force_quit is probably not necessary here
- # because it should have been called when the source window(s)
- # were deleted, but just in case...
- gdb_force_quit
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_cleanup - called by GDB immediately
-# before exiting. Last chance to cleanup!
-# ------------------------------------------------------------------
-proc gdbtk_cleanup {} {
- global gdb_exe_name
-
- # Save the session
- if {$gdb_exe_name != ""} {
- Session::save
- }
-
- # This is a sign that it is too late to be doing updates, etc...
- set ::gdb_shutting_down 1
-
- # Shutdown the window manager and save all preferences
- # This way a "quit" in the console window will cause
- # preferences to be saved.
- ManagedWin::shutdown
- pref_save
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_query -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_query {message {default yes}} {
- global gdb_checking_for_exit gdbtk_state gdbtk_platform
-
- # FIXME We really want a Help button here. But Tk's brain-damaged
- # modal dialogs won't really allow it. Should have async dialog
- # here.
-
- set title "GDB"
- set modal "task"
-
- # If we are checking whether to exit gdb, we want a system modal
- # box. Otherwise it may be hidden by some other program, and the
- # user will have no idea what is going on.
- if {[info exists gdb_checking_for_exit] && $gdb_checking_for_exit} {
- set modal "system"
- }
-
- if {$gdbtk_platform(platform) == "windows"} {
- # On Windows, we want to only ask each question once.
- # If we're already asking the question, just wait for the answer
- # to come back.
- set ans [list answer $message]
- set pending [list pending $message]
-
- if {[info exists gdbtk_state($pending)]} {
- incr gdbtk_state($pending)
- } else {
- set gdbtk_state($pending) 1
- set gdbtk_state($ans) {}
-
- ide_messageBox [list set gdbtk_state($ans)] -icon warning \
- -default $default -message $message -title $title \
- -type yesno -modal $modal -parent .
- }
-
- vwait gdbtk_state($ans)
- set r $gdbtk_state($ans)
- if {[incr gdbtk_state($pending) -1] == 0} {
- # Last call waiting for this answer, so clear it.
- unset gdbtk_state($pending)
- unset gdbtk_state($ans)
- }
- } else {
- # On Unix, apparently it doesn't matter how many times we ask a
- # question.
- set r [tk_messageBox -icon warning -default $default \
- -message $message -title $title \
- -type yesno -parent .]
- }
-
- update idletasks
- return [expr {$r == "yes"}]
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_warning -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_warning {message} {
- debug "$message"
-
-# ADD a warning message here if the gui must NOT display it
-# add the message at the beginning of the switch followed by -
-
- switch -regexp $message {
- "Unable to find dynamic linker breakpoint function.*" {return}
- "Internal error.*" { gdbtk_tcl_fputs_error $message }
- "incomplete CFI.*" { gdbtk_tcl_fputs_error $message }
- "RTTI symbol not found for class.*" { gdbtk_tcl_fputs_error $message }
- default {show_warning $message}
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: show_warning -
-# ------------------------------------------------------------------
-proc show_warning {message} {
- global gdbtk_platform
-
- # FIXME We really want a Help button here. But Tk's brain-damaged
- # modal dialogs won't really allow it. Should have async dialog
- # here.
- set title "GDB"
- set modal "task"
-
-# On Windows, we use ide_messageBox which runs the Win32 MessageBox function
-# in another thread. This permits a program which handles IDE requests from
-# other programs to not return from the request until the MessageBox completes.
-# This is not possible without using another thread, since the MessageBox
-# function call will be running its own event loop, and will be higher on the
-# stack than the IDE request.
-#
-# On Unix tk_messageBox runs in the regular Tk event loop, so
-# another thread is not required.
-
-
- if {$gdbtk_platform(platform) == "windows"} {
- ide_messageBox [list set r] -icon warning \
- -default ok -message $message -title $title \
- -type ok -modal $modal -parent .
- } else {
- set r [tk_messageBox -icon warning -default ok \
- -message $message -title $title \
- -type ok -parent .]
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_ignorable_warning -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_ignorable_warning {class message} {
- catch {ManagedWin::open WarningDlg -center -transient \
- -message [list $message] -ignorable $class}
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_fputs -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_fputs {message} {
- global gdbtk_state
- # Restore the fputs hook, in case anyone forgot to put it back...
- gdb_restore_fputs
-
- if {[info exists gdbtk_state(console)] && $gdbtk_state(console) != ""} {
- $gdbtk_state(console) insert $message
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: echo -
-# ------------------------------------------------------------------
-proc echo {args} {
- gdbtk_tcl_fputs [concat $args]\n
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_fputs_error - write an error message
-# ------------------------------------------------------------------
-proc gdbtk_tcl_fputs_error {message} {
- if {[info exists ::gdbtk_state(console)] && $::gdbtk_state(console) != ""} {
- $::gdbtk_state(console) insert $message err_tag
- update
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_fputs_log - write a log message
-# ------------------------------------------------------------------
-proc gdbtk_tcl_fputs_log {message} {
- if {[info exists ::gdbtk_state(console)] && $::gdbtk_state(console) != ""} {
- $::gdbtk_state(console) insert $message log_tag
- update
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_fputs_target - write target output
-# ------------------------------------------------------------------
-proc gdbtk_tcl_fputs_target {message} {
- if {$::gdbtk_state(console) == ""} {
- ManagedWin::open Console -force
- }
- $::gdbtk_state(console) insert $message target_tag
- update
-}
-
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_fputs_target_err - write target error output
-# ------------------------------------------------------------------
-proc gdbtk_tcl_fputs_target_err {message} {
- if {$::gdbtk_state(console) == ""} {
- ManagedWin::open Console -force
- }
- $::gdbtk_state(console) insert $message err_tag
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_flush -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_flush {} {
- debug [info level 0]
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_start_variable_annotation -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_start_variable_annotation {valaddr ref_type stor_cl
- cum_expr field type_cast} {
- debug [info level 0]
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_end_variable_annotation -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_end_variable_annotation {} {
- debug [info level 0]
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_breakpoint - A breakpoint was changed -- notify
-# gui.
-# ------------------------------------------------------------------
-proc gdbtk_tcl_breakpoint {action bpnum} {
-# debug "BREAKPOINT: $action $bpnum"
- set e [BreakpointEvent \#auto -action $action -number $bpnum]
- GDBEventHandler::dispatch $e
- delete object $e
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_tracepoint - A tracepoint was changed -- notify
-# gui.
-# ------------------------------------------------------------------
-proc gdbtk_tcl_tracepoint {action tpnum} {
-# debug "TRACEPOINT: $action $tpnum"
- set e [TracepointEvent \#auto -action $action -number $tpnum]
- GDBEventHandler::dispatch $e
- delete object $e
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_trace_find_hook -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_trace_find_hook {arg from_tty} {
-# debug "$arg $from_tty"
- run_hooks gdb_trace_find_hook $arg $from_tty
-}
-
-################################################################
-#
-# Handle `readline' interface.
-#
-
-# Run a command that is known to use the "readline" interface. We set
-# up the appropriate buffer, and then run the actual command via
-# gdb_cmd. Calls into the "readline" callbacks just return values
-# from our list.
-
-# ------------------------------------------------------------------
-# PROC: gdb_run_readline_command -
-# ------------------------------------------------------------------
-proc gdb_run_readline_command {command args} {
- global gdbtk_state
- debug "$command $args"
- set gdbtk_state(readlineArgs) $args
- set gdbtk_state(readlineShowUser) 1
- gdb_cmd $command
-}
-
-# ------------------------------------------------------------------
-# PROC: gdb_run_readline_command_no_output
-# Run a readline command, but don't show the commands to the user.
-# ------------------------------------------------------------------
-proc gdb_run_readline_command_no_output {command args} {
- global gdbtk_state
- debug "$command $args"
- set gdbtk_state(readlineArgs) $args
- set gdbtk_state(readlineShowUser) 0
- gdb_cmd $command
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_readline_begin -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_readline_begin {message} {
- global gdbtk_state
-# debug
- set gdbtk_state(readline) 0
- if {$gdbtk_state(console) != "" && $gdbtk_state(readlineShowUser)} {
- $gdbtk_state(console) insert $message
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_readline -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_readline {prompt} {
- global gdbtk_state
-# debug "prompt=$prompt"
- if {[info exists gdbtk_state(readlineArgs)]} {
- # Not interactive, so pop the list, and print element.
- set cmd [lvarpop gdbtk_state(readlineArgs)]
- if {$gdbtk_state(console) != "" && $gdbtk_state(readlineShowUser)} {
- $gdbtk_state(console) insert $cmd
- }
- } else {
- # Interactive.
-# debug "interactive"
- set gdbtk_state(readline) 1
- $gdbtk_state(console) activate $prompt
- vwait gdbtk_state(readline_response)
- set cmd $gdbtk_state(readline_response)
-# debug "got response: $cmd"
- unset gdbtk_state(readline_response)
- set gdbtk_state(readline) 0
- }
- return $cmd
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_readline_end -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_readline_end {} {
- global gdbtk_state
-# debug
- catch {unset gdbtk_state(readlineArgs)}
- catch {unset gdbtk_state(readlineActive)}
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_busy - this is called immediately before gdb
-# executes a command.
-#
-# ------------------------------------------------------------------
-proc gdbtk_tcl_busy {} {
- global gdbtk_state
- if {[incr gdbtk_state(busyCount)] == 1} {
- gdbtk_busy
- }
-}
-
-################################################################
-#
-#
-#
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_idle - this is called immediately after gdb
-# executes a command.
-# ------------------------------------------------------------------
-proc gdbtk_tcl_idle {} {
- global gdbtk_state
- if {$gdbtk_state(busyCount) > 0
- && [incr gdbtk_state(busyCount) -1] == 0} {
- gdbtk_update
- gdbtk_idle
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_tstart -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_tstart {} {
- set srcwin [lindex [manage find src] 0]
- $srcwin.toolbar do_tstop 0
-
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_tstop -
-# ------------------------------------------------------------------
-proc gdbtk_tcl_tstop {} {
- set srcwin [lindex [manage find src] 0]
- $srcwin.toolbar do_tstop 0
-
-}
-
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_tcl_display -
-#
-# A display changed. ACTION is `enable', `disable', `delete',
-# `create', or `update'. VALUE is only meaningful in the `update'
-# case.
-# ------------------------------------------------------------------
-proc gdbtk_tcl_display {action number {value {}}} {
- # Handle create explicitly.
- if {$action == "create"} {
- manage create_if_never data
- }
- run_hooks gdb_display_change_hook $action $number $value
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_register_changed
-# This hook is called from value_assign to inform us that
-# the user has changed the contents of a register.
-# ------------------------------------------------------------------
-proc gdbtk_register_changed {} {
- after idle gdbtk_update_safe
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_memory_changed
-# This hook is called from value_assign to inform us that
-# the user has changed the contents of memory (including
-# the program's variables).
-# ------------------------------------------------------------------
-proc gdbtk_memory_changed {} {
- after idle gdbtk_update_safe
-}
-
-####################################################################
-# #
-# FILE HOOKS #
-# #
-# There are a number of hooks that are installed in gdb to #
-# aid with file-like commands (selecting an exectuable and #
-# loading symbols): #
-# - exec_file_display_hook #
-# Called in exec_file_command. The tcl hook is #
-# "gdbtk_tcl_exec_file_display" #
-# - file_changed_hook #
-# Called in file_command. The tcl hook is #
-# "gdbtk_tcl_file_changed" #
-# - deprecated_pre_add_symbol_hook #
-# Called in symbol_file_add before loading. The tcl #
-# hook is "gdbtk_tcl_pre_add_symbol" #
-# - deprecated_post_add_symbol_hook #
-# Called in symbol_file_add when finished loading #
-# a symbol file. The tcl hook is #
-# "gdbtk_tcl_post_add_symbol" #
-# #
-# Together, these hooks should give the gui enough information #
-# to cover the two most common uses of file commands: #
-# 1. executable with symbols #
-# 2. separate executable and symbol file(s) #
-# #
-####################################################################
-define_hook file_changed_hook
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_tcl_pre_add_symbol
-# This hook is called before any symbol files
-# are loaded so that we can inform the user.
-# ------------------------------------------------------------------
-proc gdbtk_tcl_pre_add_symbol {file} {
-
- gdbtk_busy
-
- # Display some feedback to the user
- set srcs [ManagedWin::find SrcWin]
- foreach w $srcs {
- $w set_status "Reading symbols from $file..."
- }
- update idletasks
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_tcl_post_add_symbol
-# This hook is called after we finish reading a symbol
-# file, so the source windows' combo boxes need filling.
-# ------------------------------------------------------------------
-proc gdbtk_tcl_post_add_symbol {} {
-
- set srcs [ManagedWin::find SrcWin]
- foreach w $srcs {
- $w fillNameCB
- }
- gdbtk_idle
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_tcl_file_changed
-# This hook is called whenever the exec file changes.
-# This is called AFTER symbol reading, so it is
-# ok to point to main when we get called.
-# ------------------------------------------------------------------
-proc gdbtk_tcl_file_changed {filename} {
-
- if {$filename == ""} {
- gdb_clear_file
- catch {run_hooks gdb_clear_file_hook}
- set ::gdb_exe_name ""
- set ::gdb_loaded 0
- set ::gdb_running 0
- gdbtk_update
- } else {
- SrcWin::point_to_main
- run_hooks file_changed_hook
- }
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_tcl_exec_file_display
-# This hook is called from exec_file_command. It's purpose
-# is to setup the gui for a new file. Note that we cannot
-# look for main, since this hook is called BEFORE we
-# read symbols. If the user used the "file" command,
-# gdbtk_tcl_file_changed will set the source window to
-# look at main. If the user used "exec-file" and "add-symbol"
-# commands, then we cannot look for main.
-# ------------------------------------------------------------------
-proc gdbtk_tcl_exec_file_display {filename} {
- global gdb_exe_changed
-
- # DO NOT CALL set_exe here!
-
- # Clear out the GUI, don't do it if filename is "" so that
- # you avoid distracting flashes in the source window.
-
- if {$filename != ""} {
- gdbtk_clear_file
- }
-
- # set_exe calls file command with the filename in
- # quotes, so we need to strip them here.
- # We need to make sure that we turn filename into
- # an absolute path or sessions won't work.
- if {[file tail $filename] == $filename} {
- # want full pathname
- set filename [file join $::gdb_current_directory $filename]
- }
- set_exe_name $filename
- set gdb_exe_changed 0
-
- SrcWin::point_to_main
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_locate_main
-# This proc tries to locate a suitable main function from
-# a list of names defined in the gdb/main_names preference;
-# returns the linespec (see below) if found, or a null string
-# if not.
-#
-# The return linespec looks like this:
-# 0: basename of the file
-# 1: function name
-# 2: full filename
-# 3: source line number
-# 4: address
-# 5: current PC - which will often be the same as address, but not when
-# we are browsing, or walking the stack.
-# 6: shared library name if the pc is in a shared lib
-#
-# ------------------------------------------------------------------
-proc gdbtk_locate_main {{init ""}} {
- global _main_cache gdb_exe_name
- debug
-
- if {$init == "" && $_main_cache != ""} {
- #debug "returning $_main_cache from cache"
- return $_main_cache
- }
- set _main_cache {}
-
- set main_names [pref get gdb/main_names]
- foreach main $main_names {
- if {![catch {gdb_loc $main} linespec]} {
- set _main_cache $linespec
- break
- }
- }
- if {$_main_cache == {}
- && ![catch gdb_entry_point entry_point]
- && ![catch {gdb_loc "*$entry_point"} linespec]} {
- set _main_cache $linespec
- }
-
- # need to see if result is valid
- lassign $_main_cache file func ffile line addr rest
- if {$addr == 0x0 && $func == {}} { set _main_cache {} }
-
- #debug "returning $_main_cache"
- return $_main_cache
-}
-
-##############################################
-# The rest of this file is an assortment of Tcl wrappers
-# for various bits of gdb functionality.
-#
-#############################################
-
-# ------------------------------------------------------------------
-# PROC: set_exe_name - Update the executable name
-# ------------------------------------------------------------------
-proc set_exe_name {exe} {
- global gdb_exe_name gdb_exe_changed
- #debug "exe=$exe gdb_exe_name=$gdb_exe_name"
-
- set gdb_exe_name $exe
- set gdb_exe_changed 1
-}
-
-
-# ------------------------------------------------------------------
-# PROC: set_exe -
-# ------------------------------------------------------------------
-proc set_exe {} {
- global gdb_exe_name gdb_exe_changed gdb_target_changed gdb_loaded file_done
-# debug "gdb_exe_changed=$gdb_exe_changed gdb_exe_name=$gdb_exe_name"
- if {$gdb_exe_changed} {
- set gdb_exe_changed 0
- if {$gdb_exe_name == ""} { return }
- set err [catch {gdb_cmd "file '$gdb_exe_name'" 1} msg]
- if {$err} {
- dbug E "$msg"
- set l [split $msg :]
- set errtxt [join [lrange $l 1 end] :]
- set msg "Error loading \"$gdb_exe_name\":\n"
- append msg $errtxt
- tk_messageBox -title "Error" -message $msg -icon error \
- -type ok
- set gdb_exe_name {}
- set file_done 0
- return
- } elseif {[string match {*no debugging symbols found*} $msg]} {
- tk_messageBox -icon error -default ok \
- -title "GDB" -type ok \
- -message "This executable has no debugging information."
- }
-
- # force new target command
- set gdb_target_changed 1
- set gdb_loaded 0
- set file_done 1
- }
-}
-
-# ------------------------------------------------------------------
-# _open_file - open a file dialog to select a file for debugging.
-# If filename is not "", then open this file.
-# ------------------------------------------------------------------
-
-proc _open_file {{file ""}} {
- global gdb_running gdb_downloading gdbtk_platform
-
- if {$gdb_running || $gdb_downloading} {
- # We are already running/downloading something..
- if {$gdb_running} {
- set msg "A debugging session is active.\nAbort session and load new file?"
- } else {
- set msg "A download is in progress.\nAbort download and load new file?"
- }
- if {![gdbtk_tcl_query $msg no]} {
- return 0
- }
- }
-
- if {[string compare $file ""] == 0} {
- set curFocus [focus]
-
- # Make sure that this is really a modal dialog...
- # FIXME: Add a disable_all to ide_grab_support.
-
- ide_grab_support disable_except {}
-
- set file [tk_getOpenFile -parent . -title "Load New Executable"]
-
- ide_grab_support enable_all
-
- # If no one had the focus before, leave it that way (since I
- # am not sure how this could happen... Also, the vwait in
- # tk_getOpenFile could have allowed the curFocus window to actually
- # be destroyed, so make sure it is still around.
-
- if {$curFocus != "" && [winfo exists $curFocus]} {
- raise [winfo toplevel $curFocus]
- focus $curFocus
- }
- } elseif {![file exists $file]} {
- tk_messageBox -message "File \"$file\" does not exist"
- return 0
- }
-
-
- if {$file == ""} {
- return 0
- }
- # Add the base dir for this file to the source search path.
- set root [file dirname $file]
- if {$gdbtk_platform(os) == "cygwin"} {
- set root [ide_cygwin_path to_posix $root]
- set file [ide_cygwin_path to_posix $file]
- }
-
- catch {gdb_cmd "cd $root"}
-
- # Clear out gdb's internal state, so that it will allow us
- # (the gui) to ask the user questions.
- gdb_clear_file
-
- # The gui needs to set this...
- set_exe_name $file
-
- # set_exe needs to be called anywhere the gui does a file_command...
- if {[set_exe] == "cancel"} {
- gdbtk_update
- gdbtk_idle
- return 0
- }
-
- return 1
-}
-
-# ------------------------------------------------------------------
-# _close_file - close the current executable and prepare for
-# another executable.
-# ------------------------------------------------------------------
-proc _close_file {} {
-
- # If there is already an inferior, ask him if he wants to close
- # the file. If there is already an exec file loaded (and not run)
- # also ask, but don't ask twice.
- set okay 1
- if {[gdb_target_has_execution]} {
- set okay [gdbtk_tcl_query "Program is already running.\nClose file anyway?"]
- } elseif {$::gdb_exe_name != ""} {
- set okay [gdbtk_tcl_query "Program already loaded.\nClose file anyway?"]
- } else {
- # No exec file yet
- return
- }
-
- if {$okay} {
- Session::save
- gdb_clear_file
- gdbtk_tcl_file_changed ""
-
- # Print out a little message to all console windows
- foreach cw [ManagedWin::find Console] {
- $cw insert "No executable file now.\n"
- }
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: set_target_name - Update the target name.
-#
-# This function will prompt for a new target and update
-# all variables.
-#
-# If $prompt is 0 it will just update gdb_target_cmd from gdb_target.
-#
-# RETURN:
-# 1 if successful,
-# 0 if the not (the user canceled the target selection dialog)
-# ------------------------------------------------------------------
-proc set_target_name {{prompt 1}} {
- global gdb_target_name gdb_target_changed gdb_exe_changed
- global gdb_target_cmd gdb_pretty_name
-# debug
- set cmd_tmp $gdb_target_cmd
- set name_tmp $gdb_target_name
-
-# debug "gdb_target_name=$gdb_target_name; name_tmp=$name_tmp"
- if {$prompt} {
- set win [ManagedWin::open TargetSelection -exportcancel 1 -center \
- -transient]
- # need to call update here so the target selection dialog can take over
- update idletasks
- }
-
-# debug "gdb_target_name=$gdb_target_name"
- if {$gdb_target_name == "CANCEL"} {
- set gdb_target_cmd $cmd_tmp
- set gdb_target_name $name_tmp
- return 0
- }
- set target $gdb_target_name
- set targ [TargetSelection::getname $target cmd]
- set gdb_target_cmd $cmd_tmp
- set gdb_pretty_name [TargetSelection::getname $target pretty-name]
-
-# debug "target=$target pretty_name=$gdb_pretty_name"
- set targ_opts ""
- switch -regexp -- $gdb_target_name {
- sim|ice {
- set targ $gdb_target_name
- set targ_opts [pref getd gdb/load/${gdb_target_name}-opts]
- }
- default {
- set port [pref getd gdb/load/$target-port]
- if {$port == ""} {
- set port [pref get gdb/load/default-port]
- }
- set portnum [pref getd gdb/load/$target-portname]
- if {$portnum == ""} {
- set portnum [pref get gdb/load/default-portname]
- }
- set hostname [pref getd gdb/load/$target-hostname]
- if {$hostname == ""} {
- set hostname [pref getd gdb/load/default-hostname]
- }
- # replace "com1" with the real port name
- set targ [lrep $targ "com1" $port]
- # replace "tcpX" with hostname:portnum
- set targ [lrep $targ "tcpX" ${hostname}:${portnum}]
- # replace "ethX" with hostname
- set targ [lrep $targ "ethX" e=${hostname}]
- }
- }
-
-# debug "targ=$targ gdb_target_cmd=$gdb_target_cmd"
- if {$gdb_target_cmd != $targ || $gdb_target_changed} {
- set gdb_target_changed 1
- set gdb_target_cmd "$targ $targ_opts"
- }
- return 1
-}
-
-# ------------------------------------------------------------------
-# PROC: set_target - Change the target
-# ------------------------------------------------------------------
-proc set_target {} {
- global gdb_target_cmd gdb_target_changed gdb_pretty_name gdb_target_name
- #debug "gdb_target_changed=$gdb_target_changed gdb_target_cmd=\"$gdb_target_cmd\""
- #debug "gdb_target_name=$gdb_target_name"
- if {$gdb_target_cmd == "" && ![TargetSelection::native_debugging]} {
- if {$gdb_target_name == ""} {
- set prompt 1
-
- # get the default
- #set gdb_target_name [pref getd gdb/load/target]
- } else {
- set prompt 0
- }
- if {![set_target_name $prompt]} {
- set gdb_target_name ""
- return CANCELED
- }
- }
-
- if {$gdb_target_changed} {
- set srcWin [lindex [ManagedWin::find SrcWin] 0]
-
- $srcWin set_status "Trying to communicate with target $gdb_pretty_name" 1
- update
- catch {gdb_cmd "detach"}
- debug "CONNECTING TO TARGET: $gdb_target_cmd"
- gdbtk_busy
- set err [catch {gdb_immediate "target $gdb_target_cmd"} msg ]
- $srcWin set_status
- gdbtk_idle
-
- if {$err} {
- if {[string first "Program not killed" $msg] != -1} {
- return CANCELED
- }
- update
- set dialog_title "GDB"
- set debugger_name "GDB"
- tk_messageBox -icon error -title $dialog_title -type ok \
- -message "$msg\n\n$debugger_name cannot connect to the target board\
-using [lindex $gdb_target_cmd 1].\nVerify that the board is securely connected and, if\
-necessary,\nmodify the port setting with the debugger preferences."
- return ERROR
- }
-
- if {![catch {pref get gdb/load/$gdb_target_name-after_attaching} aa] && $aa != ""} {
- if {[catch {gdb_cmd $aa} err]} {
- catch {[ManagedWin::find Console] insert $err err_tag}
- }
- }
- set gdb_target_changed 0
- return TARGET_CHANGED
- }
- return TARGET_UNCHANGED
-}
-
-# ------------------------------------------------------------------
-# PROC: run_executable -
-#
-# This procedure is used to run an executable. It is called when the
-# run button is used.
-# ------------------------------------------------------------------
-proc run_executable { {auto_start 1} } {
- global gdb_loaded gdb_downloading gdb_target_name
- global gdb_exe_changed gdb_target_changed gdb_program_has_run
- global gdb_running gdb_exe_name gdbtk_platform
-
-# debug "auto_start=$auto_start gdb_target_name=$gdb_target_name"
-
- set gdb_running_saved $gdb_running
- set gdb_running 0
-
- # No executable was specified. Prompt the user for one.
- if {$gdb_exe_name == ""} {
- if {[_open_file]} {
- run_executable $auto_start
- return
- } else {
- # The user canceled the load of a new executable.
- return
- }
- }
-
- if {$gdb_downloading} { return }
- if {[pref get gdb/control_target]} {
- # Breakpoint mode
- set_exe
-
- # Attach
- if {$gdb_target_name == "" || [pref get gdb/src/run_attach]} {
- set r [gdbtk_attach_remote]
- if {$r == "ATTACH_CANCELED" || $r == "ATTACH_ERROR"} {
- return
- }
- }
-
- # Download
- if {[pref get gdb/src/run_load] && $gdb_target_name != "exec"} {
- debug "Downloading..."
- set gdb_loaded 0
-
- # if the app has not been downloaded or the app has already
- # started, we need to redownload before running
- if {!$gdb_loaded} {
- if {[Download::download_it]} {
- # user cancelled the command
-# debug "user cancelled the command $gdb_running"
- set gdb_loaded 0
- gdbtk_update
- gdbtk_idle
- }
- if {!$gdb_loaded} {
- # The user cancelled the download after it started
-# debug "User cancelled the download after it started $gdb_running"
- gdbtk_update
- gdbtk_idle
- return
- }
- }
- }
-
- # _Now_ set/clear breakpoints
- if {[pref get gdb/load/exit] && ![TargetSelection::native_debugging]} {
- debug "Setting new BP at exit"
- catch {gdb_cmd "clear exit"}
- catch {gdb_cmd "break exit"}
- }
-
- if {[pref get gdb/load/main]} {
- set main "main"
- if {[set linespec [gdbtk_locate_main]] != ""} {
- set main [lindex $linespec 1]
- }
- debug "Setting new BP at $main"
- catch {gdb_cmd "clear $main"}
- catch {gdb_cmd "break $main"}
- }
-
- # set BP at user-specified function
- if {[pref get gdb/load/bp_at_func]} {
- foreach bp [pref get gdb/load/bp_func] {
- debug "Setting BP at $bp"
- catch {gdb_cmd "clear $bp"}
- catch {gdb_cmd "break $bp"}
- }
- }
-
- # This is a hack. If the target is "sim" the opts are appended
- # to the target command. Otherwise they are assumed to be command line
- # args. What about simulators that accept command line args?
- if {$gdb_target_name != "sim"} {
- # set args
- set gdb_args [pref getd gdb/load/$gdb_target_name-opts]
- if { $gdb_args != ""} {
- debug "set args $gdb_args"
- gdb_set_inferior_args $gdb_args
- }
- }
-
- # If the user requested it, start an xterm for use as the
- # inferior's tty.
- if {$gdbtk_platform(platform) != "windows"
- && [pref getd gdb/process/xtermtty] == "yes"} {
- tty::create
- }
-
- #
- # Run
-
- if {$auto_start} {
- if {[pref get gdb/src/run_run]} {
- debug "Runnning target..."
- set run run
- } else {
- debug "Continuing target..."
- set run cont
- }
- if {$gdb_target_name == "exec"} {
- set run run
- }
- if {[catch {gdb_immediate $run} msg]} {
- dbug W "msg=$msg"
- gdbtk_idle
- if {[string match "*help target*" $msg]} {
- set_target_name
- run_executable $auto_start
- return
- }
- if {[string match "No executable*" $msg]} {
- # No executable was specified. Prompt the user for one.
- if {[_open_file]} {
- run_executable $auto_start
- } else {
- debug "CANCELLED"
- }
- return
- }
- set gdb_running $gdb_running_saved
- } else {
- debug RUNNING
- set gdb_running 1
- }
- } else {
- SrcWin::point_to_main
- }
-
- gdbtk_update
- gdbtk_idle
- } elseif {[pref get gdb/mode]} {
- # tracepoint -- need to tstart
- set gdb_running 1
- tstart
- }
- return
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_attach_remote - attach to the target
-# This proc returns the following status messages:
-#
-# ATTACH_ERROR: An error occurred connecting to target.
-# ATTACH_CANCELED: The attach was canceled.
-# ATTACH_TARGET_CHANGED: Successfully attached, target changed.
-# ATTACH_TARGET_UNCHANGED: Successfully attached, target unchanged.
-# UNKNOWN: An unknown error occurred.
-# ------------------------------------------------------------------
-proc gdbtk_attach_remote {} {
- global gdb_loaded
-
- debug "Attaching...."
- set r UNKNOWN
- while {1} {
-
- switch [set_target] {
-
- ERROR {
- # target command failed, ask for a new target name
- if {![set_target_name]} {
- # canceled again
- set r ATTACH_ERROR
- break
- }
- }
-
- TARGET_CHANGED {
- # success -- target changed
- set gdb_loaded 0
- set r ATTACH_TARGET_CHANGED
- break
- }
-
- CANCELED {
- # command cancelled by user
- set r ATTACH_CANCELED
- break
- }
-
- TARGET_UNCHANGED {
- # success -- target NOT changed (i.e., rerun)
- set r ATTACH_TARGET_UNCHANGED
- break
- }
- }
- }
-
-# debug "Attach returning: \"$r\""
- return $r
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_connect: connect to a remote target
-# in asynch mode if async is 1
-# ------------------------------------------------------------------
-proc gdbtk_connect {{async 0}} {
- global file_done
-
- debug "async=$async"
-
- gdbtk_busy
-
- set result [gdbtk_attach_remote]
- switch $result {
- ATTACH_ERROR {
- set successful 0
- }
-
- ATTACH_TARGET_CHANGED {
- if {[pref get gdb/load/check] && $file_done} {
- set err [catch {gdb_cmd "compare-sections"} errTxt]
- if {$err} {
- set successful 0
- tk_messageBox -title "Error" -message $errTxt \
- -icon error -type ok
- break
- }
- }
-
- tk_messageBox -title "GDB" -message "Successfully connected" \
- -icon info -type ok
- set successful 1
- }
-
- ATTACH_CANCELED {
- tk_messageBox -title "GDB" -message "Connection Canceled" -icon info \
- -type ok
- set successful 0
- }
-
- ATTACH_TARGET_UNCHANGED {
- tk_messageBox -title "GDB" -message "Successfully connected" \
- -icon info -type ok
- set successful 1
- }
-
- default {
- dbug E "Unhandled response from gdbtk_attach_remote: \"$result\""
- set successful 0
- }
- }
-
- gdbtk_idle
-
- # Whenever we attach, we need to do an update
- if {$successful} {
- gdbtk_attached
- }
- return $successful
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_step - step the target
-# ------------------------------------------------------------------
-proc gdbtk_step {} {
- catch {gdb_immediate step}
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_next
-# ------------------------------------------------------------------
-proc gdbtk_next {} {
- catch {gdb_immediate next}
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_finish
-# ------------------------------------------------------------------
-proc gdbtk_finish {} {
- catch {gdb_immediate finish}
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_continue
-# ------------------------------------------------------------------
-proc gdbtk_continue {} {
- catch {gdb_immediate continue}
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_stepi
-# ------------------------------------------------------------------
-proc gdbtk_stepi {} {
- catch {gdb_immediate stepi}
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_nexti
-# ------------------------------------------------------------------
-proc gdbtk_nexti {} {
- catch {gdb_immediate nexti}
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_attached
-# ------------------------------------------------------------------
-#
-# This is called AFTER gdb has successfully done an attach. Use it to
-# bring the GUI up to a current state...
-proc gdbtk_attached {} {
- gdbtk_update
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_detached
-# ------------------------------------------------------------------
-#
-# This is called AFTER gdb has successfully done an detach. Use it to
-# bring the GUI up to a current state...
-proc gdbtk_detached {} {
- if {!$::gdb_shutting_down} {
- run_hooks gdb_no_inferior_hook
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_stop
-# ------------------------------------------------------------------
-#
-# The stop button is tricky. In order to use the stop button,
-# the debugger must be able to keep gui alive while target_wait is
-# blocking (so that the user can interrupt or detach from it).
-#
-# The best solution for this is to capture gdb deep down where it can
-# block. For _any_ target board, this will be in either serial or
-# socket code. These places call deprecated_ui_loop_hook to keep us
-# alive. For native unix, we use an interval timer. Simulators either
-# call deprecated_ui_loop_hook directly (older sims, at least) or they
-# call gdb's os_poll_quit callback, where we insert a call to
-# deprecated_ui_loop_hook. Some targets (like v850ice and windows
-# native) require a call to deprecated_ui_loop_hook directly in
-# target_wait. See comments before gdb_stop and x_event to find out
-# more about how this is accomplished.
-#
-# The stop button's behavior:
-# Pressing the stop button should attempt to stop the target. If, after
-# some time (like 3 seconds), gdb fails to fall out of target_wait (i.e.,
-# the gui's idle hooks are run), then open a dialog asking the user if
-# he'd like to detach.
-proc gdbtk_stop {} {
- global _gdbtk_stop
-
- if {$_gdbtk_stop(timer) == ""} {
- add_hook gdb_idle_hook gdbtk_stop_idle_callback
- set _gdbtk_stop(timer) [after 15000 gdbtk_detach]
- catch {gdb_stop}
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_stop_idle_callback
-# ------------------------------------------------------------------
-# This callback normally does nothing. When the stop button has
-# been pressed, though, and gdb has successfully stopped the target,
-# this callback will clean up after gdbtk_stop, removing the "Detach"
-# dialog (if it's open) and gettingg rid of any outstanding timers
-# and hooks.
-proc gdbtk_stop_idle_callback {} {
- global _gdbtk_stop gdbtk_state
-
- # Check if the dialog asking if user wants to detach is open
- # and unpost it if it exists.
- if {$_gdbtk_stop(msg) != ""} {
- set ans [list answer $_gdbtk_stop(msg)]
- set gdbtk_state($ans) no
- }
-
- if {$_gdbtk_stop(timer) != ""} {
- # Cancel the timer callback
- after cancel $_gdbtk_stop(timer)
- set _gdbtk_stop(timer) ""
- catch {remove_hook gdb_idle_hook gdbtk_stop_idle_callback}
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_detach
-# ------------------------------------------------------------------
-# This proc is installed as a timer event when the stop button
-# is pressed. If target_wait doesn't return (we were unable to stop
-# the target), then this proc is called.
-#
-# Open a dialog box asking if the user would like to detach. If so,
-# try to detach. If not, do nothing and go away.
-proc gdbtk_detach {} {
- global _gdbtk_stop
-
- set _gdbtk_stop(msg) "No response from target. Detach from target\n(and stop debugging it)?"
- if {[gdbtk_tcl_query $_gdbtk_stop(msg) no]} {
- catch {gdb_stop detach}
- }
-
- set _gdbtk_stop(timer) ""
- set _gdbtk_stop(msg) ""
- remove_hook gdb_idle_hook gdbtk_stop_idle_callback
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_run
-# ------------------------------------------------------------------
-proc gdbtk_run {} {
- if {$::gdb_running == 1} {
- set msg "A program is currently being debugged.\n"
- append msg "Do you want to restart?"
- if {![gdbtk_tcl_query $msg no]} {
- # NO
- return
- }
- }
- run_executable
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_attach_native: attach to a running target
-# ------------------------------------------------------------------
-proc gdbtk_attach_native {} {
- ManagedWin::open_dlg AttachDlg ;#-transient
-
- debug "ManagedWin got [AttachDlg::last_button] [AttachDlg::pid]"
-
- if {[AttachDlg::last_button]} {
- set pid [AttachDlg::pid]
- set symbol_file [AttachDlg::symbol_file]
- if {$symbol_file != "" && ![_open_file $symbol_file]} {
- ManagedWin::open WarningDlg -transient \
- -message "Could not load symbols from $symbol_file."
- return
- }
-
- if {[catch {gdb_cmd "attach $pid"} result]} {
- ManagedWin::open WarningDlg -transient \
- -message [list "Could not attach to $pid:\n$result"]
- return
- }
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: set_baud - Tell GDB the baud rate.
-# ------------------------------------------------------------------
-proc set_baud {} {
- global gdb_target_name
- #set target [ide_property get target-internal-name]
- set baud [pref getd gdb/load/${gdb_target_name}-baud]
- if {$baud == ""} {
- set baud [pref get gdb/load/baud]
- }
-# debug "setting baud to $baud"
- catch {gdb_cmd "set remotebaud $baud"}
-}
-
-# ------------------------------------------------------------------
-# PROC: do_state_hook -
-# ------------------------------------------------------------------
-proc do_state_hook {varname ind op} {
- run_hooks state_hook $varname
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_disconnect -
-# ------------------------------------------------------------------
-proc gdbtk_disconnect {{async 0}} {
- global gdb_loaded gdb_target_changed
- catch {gdb_cmd "detach"}
- # force a new target command to do something
- set gdb_loaded 0
- set gdb_target_changed 1
- set gdb_running 0
- gdbtk_idle
- gdbtk_update
- }
-
-# ------------------------------------------------------------------
-# PROC: tstart -
-# ------------------------------------------------------------------
-proc tstart {} {
- if {[catch {gdb_cmd "tstart"} errTxt]} {
- tk_messageBox -title "Error" -message $errTxt -icon error \
- -type ok
- gdbtk_idle
- return 0
- }
- return 1
-}
-
-# ------------------------------------------------------------------
-# PROC: tstop -
-# ------------------------------------------------------------------
-proc tstop {} {
-
- if {[catch {gdb_cmd "tstop"} errTxt]} {
- tk_messageBox -title "Error" -message $errTxt -icon error \
- -type ok
- gdbtk_idle
- return 0
- }
- return 1
- }
-
-# ------------------------------------------------------------------
-# PROC: source_file -
-# ------------------------------------------------------------------
-proc source_file {} {
- set file_name [tk_getOpenFile -title "Choose GDB Command file"]
- if {$file_name != ""} {
- gdb_cmd "source $file_name"
- }
-}
-
-
-# -----------------------------------------------------------------------------
-# NAME: gdbtk_signal
-#
-# SYNOPSIS: gdbtk_signal {name longname}
-#
-# DESC: This procedure is called from GDB when a signal
-# is generated, for example, a SIGSEGV.
-#
-# ARGS: name - The name of the signal, as returned by
-# target_signal_to_name().
-# longname - A description of the signal.
-# -----------------------------------------------------------------------------
-proc gdbtk_signal {name {longname ""}} {
- dbug W "caught signal $name $longname"
- set longname
- set message "Program received signal $name, $longname"
- set srcs [ManagedWin::find SrcWin]
- foreach w $srcs {
- $w set_status $message
- }
- gdbtk_tcl_ignorable_warning signal $message
- update idletasks
-}
-
-# Hook for clearing out executable state. Widgets should register a callback
-# for this hook if they have anything that may need cleaning if the user
-# requests to re-load an executable.
-define_hook gdb_clear_file_hook
-
-# -----------------------------------------------------------------------------
-# NAME: gdbtk_clear_file
-#
-# SYNOPSIS: gdbtk_clear_file
-#
-# DESC: This procedure is called when the user requests a new exec
-# file load. It runs the gdb_clear_file_hook, which tells
-# all widgets to clear state. It CANNOT call gdb_clear_file,
-# since this hook runs AFTER we load a new exec file (i.e.,
-# gdb_clear_file would clear the file name).
-#
-# ARGS: none
-# -----------------------------------------------------------------------------
-proc gdbtk_clear_file {} {
- global gdb_target_name
-
- debug
- # Give widgets a chance to clean up
- catch {run_hooks gdb_clear_file_hook}
-
- # Save the target name in case the user has already selected a
- # target. No need to force the user to select it again.
- set old_target $gdb_target_name
-
- # Finally, reset our state
- initialize_gdbtk
-
- set gdb_target_name $old_target
-}
-
-# ------------------------------------------------------------------
-# PROC: intialize_gdbtk - (re)initialize gdbtk's state
-# ------------------------------------------------------------------
-proc initialize_gdbtk {} {
- global gdb_exe_changed gdb_target_changed gdb_running gdb_downloading \
- gdb_loaded gdb_program_has_run file_done gdb_pretty_name gdb_exec \
- gdb_target_cmd download_dialog gdb_pretty_name gdb_exe_name _gdbtk_stop \
- gdb_target_name gdb_target_changed gdbtk_state gdb_kod_cmd gdb_shutting_down
-
- # initialize state variables
- set gdb_exe_changed 0
- set gdb_target_changed 0
- set gdb_running 0
- set gdb_downloading 0
- set gdb_loaded 0
- set gdb_program_has_run 0
- set file_done 0
- set gdb_pretty_name {}
- set gdb_exec {}
- set gdb_target_cmd ""
- set gdb_running 0
- set gdb_shutting_down 0
-
- set download_dialog ""
-
- # gdb_pretty_name is the name of the GDB target as it should be
- # displayed to the user.
- set gdb_pretty_name ""
-
- # gdb_exe_name is the name of the executable we are debugging.
- set gdb_exe_name ""
-
- # Initialize readline
- if {![info exists gdbtk_state(readline)]} {
- # Only do this once...
- set gdbtk_state(readline) 0
- set gdbtk_state(console) ""
- set gdbtk_state(readlineShowUser) 1
- }
-
- # flush cache for gdbtk_locate_main
- gdbtk_locate_main 1
-
- # check for existence of a kod command and get it's name and
- # text for menu entry
- set gdb_kod_cmd ""
- set msg ""
- if {![catch {gdb_cmd "show os"} msg] && ($msg != "")} {
- set line1 [string range $msg 0 [expr [string first \n $msg] -1]]
- if {[regexp -- \"(.*)\" $line1 dummy cmd]} {
- set gdb_kod_cmd $cmd
- }
- }
-# debug "kod_cmd=$gdb_kod_cmd"
-
- # setup stop button
- set _gdbtk_stop(timer) ""
- set _gdbtk_stop(msg) ""
-
- # gdb_target_name is the name of the GDB target; that is, the argument
- # to the GDB target command.
- set gdb_target_name ""
-
- # By setting gdb_target_changed, we force a target dialog
- # to be displayed on the first "run"
- set gdb_target_changed 1
-}
-
-# The architecture changed. Inform the UI.
-proc gdbtk_tcl_architecture_changed {} {
- set e [ArchChangedEvent \#auto]
- GDBEventHandler::dispatch $e
- delete object $e
-}
-
-proc gdbtk_console_read {} {
- if {$::gdbtk_state(console) == ""} {
- ManagedWin::open Console -force
- } else {
- raise [namespace tail $::gdbtk_state(console)]
- }
- set result [$::gdbtk_state(console) gets]
- debug "result=$result"
- return $result
-}
diff --git a/gdb/gdbtk/library/ipc.tcl b/gdb/gdbtk/library/ipc.tcl
deleted file mode 100755
index 10ce7765907..00000000000
--- a/gdb/gdbtk/library/ipc.tcl
+++ /dev/null
@@ -1,135 +0,0 @@
-# ipc.tcl
-# Copyright (C) 2004 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ----------------------------------------------------------------------
-# Implements IPC for multiple Insight instances, allowing any Insight
-# to send commands to all other Insights on the same host.
-#
-# PUBLIC METHODS:
-#
-# send $cmd - sends $cmd to all Insights
-#
-# ----------------------------------------------------------------------
-
-itcl::class Iipc {
-
- private variable socklist
- private variable portnum 9909
- private variable serversock
-
- constructor {} {
- init
- }
-
- destructor {
- debug
- foreach sock $socklist {
- catch {::close $sock}
- }
-
- if {$serversock != "0"} {
- catch {::close $serversock}
- }
- set ::iipc 0
- }
-
- private method init {} {
- debug "iipc init"
- set socklist {}
- set serversock 0
- set portnum [pref get gdb/ipc/port]
- if {[catch {socket -server [code $this accept] $portnum} serversock]} {
- debug "server already exists. Connecting to it."
- set socklist [socket localhost $portnum]
- fconfigure $socklist -buffering line -blocking 0
- fileevent $socklist readable [code $this read $socklist]
- }
- set ::iipc 1
- }
-
- # accept new connection to server
- private method accept {sock addr port} {
- debug "accepting connecting from $sock -> $addr:$port"
- fconfigure $sock -buffering line -blocking 0
- lappend socklist $sock
- fileevent $sock readable [code $this sread $sock]
- }
-
- private method read {s} {
- if [eof $s] {
- debug "The server died on $s!!"
- catch {::close $s}
- init
- return
- }
- gets $s res
- debug "Server: $res"
- switch $res {
- quit { gdb_force_quit }
- stop { gdbtk_stop }
- run { gdbtk_run }
- default {
- catch {gdb_immediate "$res"}
- }
- }
- }
-
- # server read method. Reads data then forwards
- # it to all listening sockets.
- private method sread {s} {
- if [eof $s] {
- close $s
- return
- }
- gets $s res
- if {$res != ""} {
- debug "Got: $res"
- foreach sock $socklist {
- if {$s != $sock} {
- if {[catch {puts $sock $res}]} {
- close $sock
- }
- }
- }
- switch $res {
- quit { gdb_force_quit }
- stop { gdbtk_stop }
- run { gdbtk_run }
- default {
- catch {gdb_immediate "$res"}
- }
- }
- }
- }
-
- # send data to all sockets.
- public method send {cmd} {
- debug "send $cmd"
- foreach sock $socklist {
- if {[catch {puts $sock $cmd}]} {
- close $sock
- }
- }
- }
-
- private method close {s} {
- debug "closing socket $s"
- set socklist [lremove $socklist $s]
- catch {::close $s}
- }
-}
-
-
-
-
-
diff --git a/gdb/gdbtk/library/ipcpref.itb b/gdb/gdbtk/library/ipcpref.itb
deleted file mode 100644
index 6906b9ba47a..00000000000
--- a/gdb/gdbtk/library/ipcpref.itb
+++ /dev/null
@@ -1,135 +0,0 @@
-# IPC preferences dialog for Insight.
-# Copyright (C) 2004 Red Hat
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ------------------------------------------------------------------
-# CONSTRUCTOR - create new IPC preferences window
-# ------------------------------------------------------------------
-itcl::body IPCPref::constructor {args} {
- window_name "Insight IPC Preferences"
- _init_var
- _build_win
-}
-
-# ------------------------------------------------------------------
-# METHOD: init_var - initialize preference variables
-# ------------------------------------------------------------------
-itcl::body IPCPref::_init_var {} {
- set vlist [list gdb/ipc/enabled gdb/ipc/port gdb/ipc/step_button gdb/ipc/stop_button \
- gdb/ipc/cont_button gdb/ipc/exit gdb/ipc/run_button]
-
- foreach var $vlist {
- set _saved($var) [pref get $var]
- set _new($var) $_saved($var)
- }
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: build_win - build the dialog
-# ------------------------------------------------------------------
-itcl::body IPCPref::_build_win {} {
- frame $itk_interior.f
- frame $itk_interior.f.a
- frame $itk_interior.f.b
- set f $itk_interior.f.a
-
- # Description frame
- set d [labelframe $f.desc -text "Description"]
- label $d.txt -justify left -wraplength 6i -background $::Colors(textbg) \
- -text "Some multiprocessor systems use multiple instances of Insight \
-for debugging different CPUs. In these cases it may be desirable to have \
-all the instances stop, start, or continue at the same time. The IPC \
-feature can do that and more.\n\nThe IPC uses local TCP connections to the\
-port number specified below."
-
- pack $d.txt -side top
-
- checkbutton $f.enabled -text "Enable IPC" -variable [scope _new(gdb/ipc/enabled)]
- frame $f.port
- spinbox $f.port.box -from 0 -to 65535 -wrap 0\
- -width 6 -textvariable [scope _new(gdb/ipc/port)] -validate key \
- -vcmd {string is integer %P}
- label $f.port.label -text "TCP Port Number"
- pack $f.desc -expand yes -fill both
- pack $f.enabled -anchor w -pady 10
- pack $f.port.box $f.port.label -side left -pady 10
- pack $f.port -anchor w -pady 10
-
- set w [labelframe $f.buttons -text "Enable IPC on these buttons"]
- checkbutton $w.0 -text "Run" -variable [scope _new(gdb/ipc/run_button)]
- checkbutton $w.1 -text "Stop" -variable [scope _new(gdb/ipc/stop_button)]
- checkbutton $w.2 -text "Continue" -variable [scope _new(gdb/ipc/cont_button)]
- checkbutton $w.3 -text "Step" -variable [scope _new(gdb/ipc/step_button)]
- checkbutton $w.4 -text "Exit" -variable [scope _new(gdb/ipc/exit)]
- grid $w.0 $w.1 -padx 10 -pady 10 -sticky w
- grid $w.2 $w.3 -padx 10 -pady 10 -sticky w
- grid $w.4 -padx 10 -pady 10 -sticky w
- pack $w -fill both -expand yes
- pack $f.buttons -fill both -expand yes
-
- button $itk_interior.f.b.ok -text OK -width 7 -underline 0 -command [code $this _save]
- button $itk_interior.f.b.quit -text Cancel -width 7 -underline 0 -command [code $this _cancel]
- standard_button_box $itk_interior.f.b
- pack $itk_interior.f.a $itk_interior.f.b $itk_interior.f -expand yes -fill both -padx 5 -pady 5
-}
-
-# ------------------------------------------------------------------
-# METHOD: apply - apply changes
-# ------------------------------------------------------------------
-itcl::body IPCPref::_apply {} {
- set enable_changed 0
- if {[pref get gdb/ipc/enabled] != $_new(gdb/ipc/enabled)} {
- set enable_changed 1
- }
- if {$_new(gdb/ipc/enabled) && [pref get gdb/ipc/port] != $_new(gdb/ipc/port)} {
- set enable_changed 1
- }
-
- foreach var [array names _new] {
- if {$_new($var) != [pref get $var]} {
- pref set $var $_new($var)
- }
- }
-
- if {$enable_changed} {
- if {$_new(gdb/ipc/enabled)} {
- # must start up ipc
- catch {delete object $::insight_ipc}
- set ::insight_ipc [Iipc \#auto]
- } else {
- delete object $::insight_ipc
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _cancel
-# ------------------------------------------------------------------
-itcl::body IPCPref::_cancel {} {
- foreach elem [array names _saved] {
- set cur_val [pref get $elem]
- if {[string compare $cur_val $_saved($elem)] != 0} {
- pref set $elem $_saved($elem)
- }
- }
- unpost
-}
-
-# ------------------------------------------------------------------
-# METHOD: save - apply changes and quit
-# ------------------------------------------------------------------
-itcl::body IPCPref::_save {} {
- _apply
- unpost
-}
diff --git a/gdb/gdbtk/library/ipcpref.ith b/gdb/gdbtk/library/ipcpref.ith
deleted file mode 100644
index b973c8905aa..00000000000
--- a/gdb/gdbtk/library/ipcpref.ith
+++ /dev/null
@@ -1,33 +0,0 @@
-# IPC preferences dialog class definition for Insight.
-# Copyright (C) 2004, Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class IPCPref {
- inherit ManagedWin ModalDialog
-
- private {
- variable _saved ;# These are the saved values...
- variable _new ;# These are the changed values
- variable w
- method _apply {}
- method _build_win {}
- method _cancel {}
- method _init_var {}
- method _save {}
- }
-
- public {
- method constructor {args}
- method reconfig {}
- }
-}
diff --git a/gdb/gdbtk/library/kod.itb b/gdb/gdbtk/library/kod.itb
deleted file mode 100644
index 3140733d483..00000000000
--- a/gdb/gdbtk/library/kod.itb
+++ /dev/null
@@ -1,474 +0,0 @@
-# Kernel Object Display Window for Insight.
-# Copyright (C) 1998, 1999, 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-#
-# AUTHOR: Fernando Nasser <fnasser@cygnus.com>
-#
-
-
-# ------------------------------------------------------------------
-# CONSTRUCTOR - create new process window
-# ------------------------------------------------------------------
-itcl::body KodWin::constructor {args} {
- #
- # Create a window with the same name as this object
- #
- global gdb_kod_cmd
-
- # initialize local variables
- set LevelCmd(0) "info $gdb_kod_cmd "
- debug "Level 0 kod command is $LevelCmd(0)"
-
- gdbtk_busy
- build_win
- gdbtk_idle
-}
-
-# ------------------------------------------------------------------
-# METHOD: build_win - build the main KOD window
-# ------------------------------------------------------------------
-itcl::body KodWin::build_win {} {
- # FIXME: rename this variable.
- global kodActivePane
-
- debug "Will build KOD window"
-
- cyg::PanedWindow $itk_interior.pw -orient horizontal
- $itk_interior.pw add titlepane
- # We would like to use a fixed pane for the buttons. However,
- # this feature of PanedWindow doesn't work.
- # $itk_interior.pw add buttonpane -resizable 0
- $itk_interior.pw add pane1
- $itk_interior.pw add pane2
-
- # Now a frame for what is being listed, headers and list
- set tp [$itk_interior.pw childsite titlepane]
- Labelledframe $tp.tf -text "No Kernel Objects Known" \
- -anchor nw
- set titl $tp.tf
- set lf [$tp.tf get_frame]
-
- set p1 [$itk_interior.pw childsite pane1]
- set p2 [$itk_interior.pw childsite pane2]
- $p1 configure -height 120 -bd 2
- $p2 configure -height 120 -bd 2
- Labelledframe $p1.d1 -text "Details" -anchor nw
- Labelledframe $p2.d2 -text "Details" -anchor nw
- set d1 [$p1.d1 get_frame]
- set d2 [$p2.d2 get_frame]
- pack $p1.d1 $p2.d2 -side top -expand yes -fill both -padx 5 -pady 5
- set pl1 $p1.d1
- set pl2 $p2.d2
-
- # Setup the button box
- set bf [frame $tp.bf]
- set BTop [button $bf.top -height 1 -text Top -command [code $this top]]
- set BUp [button $bf.up -height 1 -text Up -command [code $this up]]
- set BClear [button $bf.clear -height 1 -text Clear \
- -command [code $this clear]]
- set BDisplay [button $bf.display -height 1 -text Display \
- -command [code $this display]]
- set kodActivePane pane1
- set BPane1 [radiobutton $bf.pane1 -variable kodActivePane \
- -height 1 -text "Pane 1" -value pane1]
- set BPane2 [radiobutton $bf.pane2 -variable kodActivePane \
- -height 1 -text "Pane 2" -value pane2]
- balloon register $bf.top "Return to List of Kernel Objects"
- balloon register $bf.up "Return to previous List of Objects"
- balloon register $bf.clear "Clear Object Detail Panes\nand Active setting"
- balloon register $bf.display \
- "Display Object or\nList of Objects of this type"
- balloon register $bf.pane1 "Make Pane 1 Active"
- balloon register $bf.pane2 "Make Pane 2 Active"
- pack $bf.top $bf.up -side left -padx 5
- pack $bf.display $bf.clear -side right -padx 5
- pack $bf.pane2 $bf.pane1 -side bottom -padx 5 -fill both
-
- # The list of objects
- table $lf.s -titlerows 1 \
- -colstretch last -rowstretch last -selectmode single \
- -selecttype row -variable $this \
- -yscrollcommand "$lf.sb set" -resizeborders none \
- -state disabled
- scrollbar $lf.sb -orient vertical -command "$lf.s yview"
- bind $lf.s <Double-1> [code $this display]
- $lf.s tag configure coltag -anchor nw
-
- grid $lf.s -row 0 -column 0 -sticky nsew
- grid $lf.sb -row 0 -column 1 -sticky nsw
- grid columnconfigure $lf 0 -weight 1
- grid rowconfigure $lf 0 -weight 1
-
- # Areas to display object details
- set t1 [table $d1.t1 -titlerows 1 -colstretch last -rowstretch last \
- -selectmode single -selecttype row -variable $this-pane1 \
- -yscrollcommand "$d1.s1 set" -resizeborders none \
- -rows 1 -cols 1 -state disabled]
- scrollbar $d1.s1 -orient vertical -command "$d1.t1 yview"
- set t2 [table $d2.t2 -titlerows 1 -colstretch last -rowstretch last \
- -selectmode single -selecttype row -variable $this-pane2 \
- -yscrollcommand "$d2.s2 set" -resizeborders none \
- -rows 1 -cols 1 -state disabled]
- scrollbar $d2.s2 -orient vertical -command "$d2.t2 yview"
-
- grid $d1.t1 -row 0 -column 0 -sticky nsew
- grid $d1.s1 -row 0 -column 1 -sticky nsw
- grid columnconfigure $d1 0 -weight 1
- grid rowconfigure $d1 0 -weight 1
- grid $d2.t2 -row 0 -column 0 -sticky nsew
- grid $d2.s2 -row 0 -column 1 -sticky nsw
- grid columnconfigure $d2 0 -weight 1
- grid rowconfigure $d2 0 -weight 1
-
- debug "Will pack KOD window"
- pack $tp.tf -side top -expand yes -fill both -padx 5 -pady 5
- pack $tp.bf -side top -expand no -fill x -padx 5 -pady 5
- pack $itk_interior.pw -side bottom -expand yes -fill both
- wm minsize $_top 450 500
-
- # Initialize button state variables for idle (called before update)
- set BState(BDisplay) disabled
- set BState(BClear) disabled
- set BState(BTop) disabled
- set BState(BUp) disabled
-
- # window_name "Kernel Objects"
-
- update dummy
-}
-
-# ------------------------------------------------------------------
-# METHOD: update - update widget when something changes
-# ------------------------------------------------------------------
-itcl::body KodWin::update {event} {
-
- debug "updating kod window"
-
- _disable_buttons
-
- display_list
- display_object
-
- _restore_buttons
-
-}
-
-# ------------------------------------------------------------------
-# METHOD: display - update the display based on the selection
-# it can be a list or an actual object
-# We get here from a press on the Display button or
-# from a <Double-1> on a line of the list of objects
-# ------------------------------------------------------------------
-itcl::body KodWin::display {} {
- upvar \#0 $this table_vals
- if {!$Running && [$lf.s cget -rows] > 1} {
- gdbtk_busy
- set linenum [$lf.s index active row]
- set object $table_vals($linenum,0)
- debug "display selection on line $linenum $object"
- incr level
- set LevelCmd($level) $LevelCmd([expr $level-1])
- append LevelCmd($level) $object
- debug "kod command for level $level is now: $LevelCmd($level)"
- update dummy
- # Run idle hooks and cause all other widgets to update
- gdbtk_idle
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: display_list - display list of objects
-# ------------------------------------------------------------------
-itcl::body KodWin::display_list {} {
- upvar \#0 $this table_vals
-
- debug "displaying list of objects"
-
- $lf.s configure -state normal
- set cmd $LevelCmd($level)
- debug "new kod command is $cmd"
- if {[catch "gdb_cmd \"$cmd\"" objects]} {
- # failed. leave window blank
- $titl configure -text "Kernel Object Display Failed"
- $lf.s delete rows 0 [$lf.s index end row]
- $lf.s configure -state disabled
- set BState(BDisplay) disabled
- return
- }
-
- debug "KodWin update: \n$objects"
- if {[llength $objects] == 0} {
- $titl configure -text "No Kernel Objects Known"
- # no objects listed.
- $lf.s delete rows 0 [$lf.s index end row]
- $lf.s configure -state disabled
- set BState(BDisplay) disabled
- return
- }
-
- # insert each line one at a time
- set num_lines -1
- foreach line [split $objects \n] {
- if {$num_lines == -1} {
- if {![string match List* $line]} {
- if {($level > 0)} {
- display_object $cmd objects
- incr level -1
- $lf.s configure -state disabled
- return
- } else {
- # if level 0 first line does not start with List ignore it
- $titl configure -text "List of Kernel Objects"
- }
- } else {
- $titl configure -text $line
- }
- # Clear listbox and headers to get new stuff.
- $lf.s delete rows 0 [$lf.s index end row]
- } elseif {$line == ""} {
- break
- } else {
- set col 0
- set list [split [string trim $line] \t]
- if {$num_lines == 0} {
- $lf.s configure -cols [llength $list] -titlerows 1
- }
- foreach item $list {
- debug "inserting $item at $num_lines,$col"
- set table_vals($num_lines,$col) $item
- incr col
- }
- }
- incr num_lines
- }
- $lf.s configure -rows [expr {$num_lines + 1}]
-
- if {$num_lines > 0} {
- set BState(BDisplay) active
- }
-
- if {$level == 0} {
- set BState(BTop) disabled
- set BState(BUp) disabled
- } else {
- set BState(BTop) active
- set BState(BUp) active
- }
-
- $lf.s configure -state disabled
- $lf.s see 0,0
- $lf.s activate 1,0
-
- _restore_buttons
-}
-
-# ------------------------------------------------------------------
-# METHOD: display_object - display information about an object
-# When called from update we have to reissue the gdb
-# command to get fresh data
-# ------------------------------------------------------------------
-itcl::body KodWin::display_object {{cmd ""} {obj ""}} {
- debug "Displaying object details..."
- upvar $obj objects
- global kodActivePane
- debug "Active Pane is $kodActivePane"
-
- # Determine which frame to use
- if {$kodActivePane == "pane2"} {
- set curpan $t2
- upvar \#0 $this-pane2 pane_values
- if {$cmd != ""} {
- # save command for update
- set pane2command $cmd
- } else {
- # reuse saved command
- set cmd $pane2command
- }
- } else {
- set curpan $t1
- upvar \#0 $this-pane1 pane_values
- if {$cmd != ""} {
- # save command for update
- set pane1command $cmd
- } else {
- # reuse saved command
- set cmd $pane1command
- }
- }
- debug "curpan $curpan"
-
- # here we must take care of the case where the user has activated a window
- # but it does not have been filled yet. We just return.
- if {$cmd == ""} {
- return
- }
-
- $curpan configure -state normal
- $curpan delete rows 0 [$curpan index end row]
- if {$obj == ""} {
- debug "pane kod command is $cmd"
- if {[catch "gdb_cmd \"$cmd\"" objects]
- || $objects == ""} {
- # Failed. Tell user object no longer there.
- $curpan configure -state disabled
- return
- }
- }
-
- set num_lin 0
- foreach line [split $objects \n] {
- set col 0
- set list [split [string trim $line] \t]
- if {$num_lin == 0} {
- $curpan configure -cols [llength $list]
- }
- foreach item $list {
- set pane_values($num_lin,$col) $item
- incr col
- }
- incr num_lin
- }
- $curpan configure -rows $num_lin -state disabled
-}
-
-# ------------------------------------------------------------------
-# METHOD: clear - clear detail panes and reset pane selection
-# ------------------------------------------------------------------
-itcl::body KodWin::clear {} {
- debug "going to clear detail panes and pane selection"
- $t1 configure -state normal
- $t2 configure -state normal
- $t1 delete rows 0 [$t1 index end row]
- $t2 delete rows 0 [$t2 index end row]
- $t1 configure -state disabled
- $t2 configure -state disabled
- # Default to pane 1 again.
- global kodActivePane
- set kodActivePane pane1
- set pane1command ""
- set pane2command ""
-}
-
-# ------------------------------------------------------------------
-# METHOD: top - go to the list of types of objects (top level)
-# ------------------------------------------------------------------
-itcl::body KodWin::top {} {
- debug "going to top from level $level"
- if {$level > 0} {
- set level 0
- update dummy
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: up - go to the list of objects which led to the current one
-# ------------------------------------------------------------------
-itcl::body KodWin::up {} {
- debug "going up from level $level..."
- if {$level > 0} {
- incr level -1
- debug "...to level $level"
- update dummy
- }
-}
-
-# ------------------------------------------------------------------
-# DESTRUCTOR - destroy window containing widget
-# ------------------------------------------------------------------
-itcl::body KodWin::destructor {} {
- upvar \#0 $this table_vals $this-pane1 pane1_vals $this-pane2 pane2_vals
- global kodActivePane
-
- catch {unset table_vals}
- catch {unset pane1_vals}
- catch {unset pane2_vals}
- catch {unset kodActivePane}
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: set_variable - called when user runs `set os'
-# command
-# ------------------------------------------------------------------
-itcl::body KodWin::set_variable {event} {
-
- set value [$event get value]
- if {[$event get variable] == "os" && $value != ""} {
- set LevelCmd(0) "info $value "
- set level 0
- update dummy
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: reconfig - used when preferences change
-# ------------------------------------------------------------------
-itcl::body KodWin::reconfig {} {
- destroy $itk_interior.bf
- destroy $titl
- build_win
-}
-
-# ------------------------------------------------------------------
-# METHOD: busy - BusyEvent handler
-#
-# This method should accomplish blocking
-# - clicks in the window
-# - change mouse pointer
-# ------------------------------------------------------------------
-itcl::body KodWin::busy {event} {
- set Running 1
- _disable_buttons
- cursor watch
-}
-
-# ------------------------------------------------------------------
-# METHOD: idle - idle event handler. Run when the target is not
-# running
-# ------------------------------------------------------------------
-itcl::body KodWin::idle {event} {
- set Running 0
- _restore_buttons
- cursor {}
-}
-
-# ------------------------------------------------------------------
-# METHOD: cursor - set the window cursor
-# This is a convenience method which simply sets the mouse
-# pointer to the given glyph.
-# ------------------------------------------------------------------
-itcl::body KodWin::cursor {glyph} {
- $_top configure -cursor $glyph
-}
-
-# ------------------------------------------------------------------
-# PRIVATE METHOD: _disable_buttons - disable all buttons
-# Used when we are busy and can't take another event
-# ------------------------------------------------------------------
-itcl::body KodWin::_disable_buttons {} {
- $BTop configure -state disabled
- $BUp configure -state disabled
- $BDisplay configure -state disabled
- $BClear configure -state disabled
-}
-
-# ------------------------------------------------------------------
-# PRIVATE METHOD: _restore_buttons - restore all buttons to their
-# previous states.
-# Used when we are busy and can't take another event
-# ------------------------------------------------------------------
-itcl::body KodWin::_restore_buttons {} {
- $BTop configure -state $BState(BTop)
- $BUp configure -state $BState(BUp)
- $BDisplay configure -state $BState(BDisplay)
- # CLEAR is always active, except when busy
- $BClear configure -state active
-}
diff --git a/gdb/gdbtk/library/kod.ith b/gdb/gdbtk/library/kod.ith
deleted file mode 100644
index f2dfefb3cdf..00000000000
--- a/gdb/gdbtk/library/kod.ith
+++ /dev/null
@@ -1,63 +0,0 @@
-# Kernel Object Display Window definition for Insight.
-# Copyright (C) 1999, 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-itcl::class KodWin {
- inherit EmbeddedWin GDBWin
-
- private {
- variable bf
- variable lf
- variable titl
- variable BTop
- variable BUp
- variable BClear
- variable BDisplay
- variable lb
- variable t1
- variable t2
- variable pl1
- variable pl2
- variable pane1command ""
- variable pane2command ""
- variable BPane1
- variable BPane2
- variable level 0
- common LevelCmd
- variable BState
- variable Running 0
- method build_win {}
- method display {}
- method display_list {}
- method display_object {{cmd ""} {obj ""}}
- method clear {}
- method top {}
- method up {}
- method cursor {glyph}
- method _disable_buttons {}
- method _restore_buttons {}
- }
-
- public {
- method constructor {args}
- method destructor {}
- method reconfig {}
-
- #
- # Gdb Events
- #
- method set_variable {event}
- method busy {event}
- method idle {event}
- method update {event}
- }
-}
diff --git a/gdb/gdbtk/library/locals.tcl b/gdb/gdbtk/library/locals.tcl
deleted file mode 100644
index 8d7fde949a4..00000000000
--- a/gdb/gdbtk/library/locals.tcl
+++ /dev/null
@@ -1,170 +0,0 @@
-# Local Variable Window for Insight.
-# Copyright (C) 2002, 2003, 2006 Red Hat
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements local variables windows for gdb.
-# ----------------------------------------------------------------------
-
-itcl::class LocalsWin {
- inherit EmbeddedWin GDBWin
- # ------------------------------------------------------------------
- # CONSTRUCTOR - create new locals window
- # ------------------------------------------------------------------
- constructor {args} {
- debug
-
- gdbtk_busy
- build_win $itk_interior
- gdbtk_idle
-
- add_hook gdb_no_inferior_hook "$this no_inferior"
- add_hook gdb_clear_file_hook [code $this clear_file]
- add_hook file_changed_hook [code $this clear_file]
-
- update dummy
- }
-
-
- # ------------------------------------------------------------------
- # PUBLIC METHOD: busy - BusyEvent handler
- # Disable all ui elements that could affect gdb's state
- # ------------------------------------------------------------------
- method busy {event} {
- debug
- cursor watch
- }
-
- # Re-enable the UI
- method idle {event} {
- debug
- cursor {}
- }
-
- # ------------------------------------------------------------------
- # METHOD: no_inferior
- # Reset this object.
- # ------------------------------------------------------------------
- method no_inferior {} {
- debug
- cursor {}
- catch {delete object $_frame}
- set _frame {}
- $tree remove all
- }
-
- # ------------------------------------------------------------------
- # METHOD: cursor - change the toplevel's cursor
- # ------------------------------------------------------------------
- method cursor {what} {
- [winfo toplevel [namespace tail $this]] configure -cursor $what
- ::update idletasks
- }
-
-
- # ------------------------------------------------------------------
- # METHOD: build_win - build window for variables.
- # ------------------------------------------------------------------
- method build_win {f} {
- #debug "$f"
-
- set tree [VarTree $f.tree -type "local"]
- pack $f.tree -expand yes -fill both
- pack $f -expand yes -fill both
-
- window_name "Local Variables"
- ::update idletasks
- }
-
-
- # ------------------------------------------------------------------
- # METHOD: clear_file - Clear out state so that a new executable
- # can be loaded. For LocalWins, this means doing
- # everything that no_inferior does.
- # ------------------------------------------------------------------
- method clear_file {} {
- no_inferior
- }
-
- # ------------------------------------------------------------------
- # DESTRUCTOR - delete locals window
- # ------------------------------------------------------------------
- destructor {
- debug
- set tree {}
-
- # Remove this window and all hooks
- remove_hook gdb_no_inferior_hook "$this no_inferior"
- remove_hook gdb_clear_file_hook [code $this clear_file]
- remove_hook file_changed_hook [code $this clear_file]
- }
-
- method context_switch {} {
- debug
-
- set err [catch {gdb_selected_frame} current_frame]
- #debug "1: err=$err; _frame=\"$_frame\"; current_frame=\"$current_frame\""
-
- if {$err && $_frame != ""} {
- # No current frame
- debug "no current frame"
- catch {delete object $_frame}
- set _frame {}
- return 1
- } elseif {$current_frame == "" && $_frame == ""} {
- #debug "2"
- return 0
- } elseif {$_frame == "" || $current_frame != [$_frame address]} {
- # We've changed frames. If we knew something about
- # the stack layout, we could be more intelligent about
- # destroying variables, but we don't know that here (yet).
- debug "switching to frame at $current_frame"
-
- # Destroy the old frame and create the new one
- catch {destroy $_frame}
- set _frame [Frame ::\#auto $current_frame]
- debug "created new frame: $_frame at [$_frame address]"
- return 1
- }
-
- # Nothing changed
- #debug "3"
- return 0
- }
-
-
- method update {event} {
- debug
-
- # Check that a context switch has not occured
- if {[context_switch]} {
- debug "CONTEXT SWITCH"
-
- # delete variables in tree
- $tree remove all
-
- if {$_frame != ""} {
- $tree add [$_frame variables]
- }
- } else {
- if {$_frame == ""} {return}
- # check for any new variables in the same frame
- $tree add [$_frame new]
- }
- after idle [code $tree update]
- }
-
- protected variable Entry
- protected variable tree
- protected variable _frame {}
-}
diff --git a/gdb/gdbtk/library/main.tcl b/gdb/gdbtk/library/main.tcl
deleted file mode 100644
index 7c70f2758d7..00000000000
--- a/gdb/gdbtk/library/main.tcl
+++ /dev/null
@@ -1,195 +0,0 @@
-# GDBtk (Insight) entry point
-# Copyright (C) 1997, 1998, 1999, 2002, 2003, 2004, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# State is controlled by 5 global boolean variables.
-#
-# gdb_target_changed
-# gdb_exe_changed
-# gdb_running
-# gdb_downloading
-# gdb_loaded
-
-################### Initialization code #########################
-
-# If GDBtk fails to start at all, you might want to uncomment one or
-# both of these.
-#set tcl_traceExec 2
-#set tcl_traceCompile 1
-
-# Add gdb's Tcl library directory to the end of the auto-load search path, if
-# it isn't already on the path.
-# Also, add the plugins directory if it exists.
-# Note: GDBTK_LIBRARY will be set in tcl_findLibrary before main.tcl is called.
-
-set gdb_plugins ""
-if {[info exists auto_path]} {
- if {[lsearch -exact $auto_path $GDBTK_LIBRARY] < 0} {
- lappend auto_path $GDBTK_LIBRARY
- }
-
- # Add default plugins directory, which will be [name of exe]/../../lib/insight1.0
- set exename [info nameofexecutable]
- set dir [file join [file dirname [file dirname $exename]] lib insight1.0]
- if {[file exists $dir]} {
- lappend gdb_plugins $dir
- lappend auto_path $dir
- }
- # Add any user-specified plugins directories
- if {[info exists env(INSIGHT_PLUGINS)]} {
- set dirs [split $env(INSIGHT_PLUGINS) :]
- lappend gdb_plugins $dirs
- lappend auto_path $dirs
- }
-}
-
-# Require the packages we need. Most are loaded already, but this will catch
-# any odd errors... :
-
-foreach p {{Tcl 8.4} {Tk 8.4} {Itcl 3.3} {Itk 3.3} {Iwidgets 4.0} {Gdbtk 1.0} {combobox 2.2} {debug 1.0}} {
- if {[catch {package require [lindex $p 0] [lindex $p 1]} msg]} {
- if {![info exists ::env(GDBTK_TEST_RUNNING)] || $::env(GDBTK_TEST_RUNNING) == 0} {
- if {$::tcl_platform(platform) != "windows"} {
- puts stderr "Error: $msg"
- }
- catch {tk_messageBox -title Error -message $msg -icon error -type ok}
- }
- exit -1
- } else {
- #puts "Loaded [lindex $p 0] $msg"
- }
-}
-
-namespace import itcl::*
-namespace import debug::*
-
-# Environment variables controlling debugging:
-# GDBTK_TRACE
-# unset or 0 no tracing
-# 1 tracing initialized but not started
-# 2 tracing initialized and started
-#
-# GDBTK_DEBUGFILE - filename to write debugging messages and
-# trace information (if tracing is enabled).
-#
-if {[info exists env(GDBTK_TRACE)] && $env(GDBTK_TRACE) != 0} {
- # WARNING: the tracing code must not trace into itself or
- # infinite recursion will result. As currently configured
- # the tracing code will not trace basic tcl functions or anything defined
- # before debug::init. For this reason we must source the DebugWin
- # code before debug::init is called.
- source [file join $GDBTK_LIBRARY debugwin.ith]
- source [file join $GDBTK_LIBRARY debugwin.itb]
-
- # Calling this installs our hooks for tracing and profiling.
- # This WILL slow things down.
- ::debug::init
-
- if {$env(GDBTK_TRACE) == 2} {
- ::debug::trace_start
- }
-}
-
-if {[info exists env(GDBTK_DEBUG)] && $env(GDBTK_DEBUG) != 0} {
- if {[info exists env(GDBTK_DEBUGFILE)]} {
- ::debug::logfile $env(GDBTK_DEBUGFILE)
- } else {
- ::debug::logfile "insight.log"
- }
-}
-
-# For testing
-set _test(interactive) 0
-
-# Set up platform globals. We replace Tcl's tcl_platform with
-# our own version which knows the difference between cygwin and
-# mingw.
-global gdbtk_platform
-set gdbtk_platform(platform) $tcl_platform(platform)
-switch $tcl_platform(platform) {
- windows {
- if {[llength [info commands ide_cygwin_path]] == 0} {
- set gdbtk_platform(os) "mingw"
- } else {
- set gdbtk_platform(os) "cygwin"
- }
- }
-
- default {
- set gdbtk_platform(os) $tcl_platform(os)
- }
-}
-set gdbtk_platform(osVersion) $tcl_platform(osVersion)
-
-# set traces on state variables
-trace variable gdb_running w do_state_hook
-trace variable gdb_downloading w do_state_hook
-trace variable gdb_loaded w do_state_hook
-define_hook state_hook
-
-# set up preferences
-pref init
-
-# let libgui tell us how to feel
-standard_look_and_feel
-
-# now let GDB set its default preferences
-pref_set_defaults
-
-# read in preferences
-pref_read
-
-init_disassembly_flavor
-
-# initialize state variables
-initialize_gdbtk
-
-# Arrange for session code to notice when file changes.
-add_hook file_changed_hook Session::notice_file_change
-
-ManagedWin::init
-
-# This stuff will help us play nice with WindowMaker's AppIcons.
-# Can't do the first bit yet, since we don't get this from gdb...
-# wm command . [concat $argv0 $argv]
-wm group . .
-
-# some initial commands to get gdb in the right mode
-gdb_cmd {set height 0}
-gdb_cmd {set width 0}
-
-if {[info exists env(GDBTK_TEST_RUNNING)] && $env(GDBTK_TEST_RUNNING)} {
- set gdb_target_name "exec"
-} else {
- # gdb_target_name is the name of the GDB target; that is, the argument
- # to the GDB target command.
- set gdb_target_name ""
- # By setting gdb_target_changed, we force a target dialog
- # to be displayed on the first "run"
- set gdb_target_changed 1
-}
-
-update
-
-# Uncomment the next line if you want a splash screen at startup...
-# ManagedWin::open About -transient -expire 5000
-
-# initialize IPC to enable multiple Insight's to communicate
-# with each other.
-set iipc 0
-if {[pref get gdb/ipc/enabled]} {
- set ::insight_ipc [Iipc \#auto]
-}
-
-gdbtk_idle
-
diff --git a/gdb/gdbtk/library/managedwin.itb b/gdb/gdbtk/library/managedwin.itb
deleted file mode 100644
index 62667b75b1a..00000000000
--- a/gdb/gdbtk/library/managedwin.itb
+++ /dev/null
@@ -1,419 +0,0 @@
-# Managed window for Insight.
-# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: constructor
-# ------------------------------------------------------------
-itcl::body ManagedWin::constructor {args} {
- #debug "$this args=$args"
- set _top [winfo toplevel $itk_interior]
-}
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: destructor
-# ------------------------------------------------------------
-itcl::body ManagedWin::destructor {} {
- # If no toplevels remain, quit. However, check the quit_if_last
- # flag since we might be doing something like displaying a
- # splash screen at startup...
-
- if {!$numTopWins && [quit_if_last]} {
- if {$::iipc && [pref get gdb/ipc/exit]} {
- $::insight_ipc send quit
- }
- gdb_force_quit
- } else {
- destroy_toplevel
- }
-}
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: window_name - Set the name of the window
-# (and optionally its icon's name).
-# ------------------------------------------------------------
-itcl::body ManagedWin::window_name {wname {iname ""}} {
-
- if {$wname != ""} {
- set _wname $wname
- } else {
- set wname $_wname
- }
- if {$iname != ""} {
- set _iname $iname
- } else {
- set iname $_iname
- }
-
- if {$win_instance != ""} {
- append wname " \[$win_instance\]"
- if {$iname != ""} {
- append iname " \[$win_instance\]"
- }
- }
- wm title $_top $wname
- if {$iname != ""} {
- wm iconname $_top $iname
- } else {
- wm iconname $_top $wname
- }
-}
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: window_instance - Set the string to be
-# appended to each window title for this instance of Insight
-# ------------------------------------------------------------
-itcl::body ManagedWin::window_instance {ins} {
- set win_instance $ins
- foreach obj [itcl::find objects -isa ManagedWin] {
- debug "$obj ManagedWin::_wname"
- $obj window_name ""
- }
-}
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: pickle - This is the base class pickle
-# method. It returns a command that can be used to recreate
-# this particular window.
-# ------------------------------------------------------------
-itcl::body ManagedWin::pickle {} {
- return [list ManagedWin::open [namespace tail [info class]]]
-}
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: reveal
-# ------------------------------------------------------------
-itcl::body ManagedWin::reveal {} {
- # Do this update to flush all changes before deiconifying the window.
- update idletasks
-
- raise $_top
- wm deiconify $_top
-
- # Some window managers (on unix) fail to honor the geometry unless
- # the window is visible.
- if {[info exists ::$_top._init_geometry]} {
- upvar ::$_top._init_geometry gm
- if {$::gdbtk_platform(platform) == "unix"} {
- wm geometry $_top $gm
- }
- unset ::$_top._init_geometry
- }
-
- # There used to be a `focus -force' here, but using -force is
- # unfriendly, so it was removed. It was then replaced with a simple
- # `focus $top'. However, this has no useful effect -- it just
- # resets the subwindow of $top which has the `potential' focus.
- # This can actually be confusing to the user.
-
- # NOT for Windows, though. Without the focus, we get, eg. a
- # register window on top of the source window, but the source window
- # will have the focus. This is not the proper model for Windows.
- if {$::gdbtk_platform(platform) == "windows"} {
- focus -force [focus -lastfor $_top]
- }
-}
-
-# ------------------------------------------------------------
-# PUBLIC PROC: restart
-# ------------------------------------------------------------
-itcl::body ManagedWin::restart {} {
- # This is needed in case we've called "gdbtk_busy" before the restart.
- # This will configure the stop/run button as necessary
- after idle gdbtk_idle
-
- # call the reconfig method for each object
- foreach obj [itcl::find objects -isa ManagedWin] {
- if {[catch {$obj reconfig} msg]} {
- dbug W "reconfig failed for $obj - $msg"
- }
- }
-}
-
-# ------------------------------------------------------------------
-# PUBLIC PROC: shutdown - This writes all the active windows to
-# the preferences file, so they can be restored at startup.
-# FIXME: Currently assumes only ONE window per type...
-# ------------------------------------------------------------------
-itcl::body ManagedWin::shutdown {} {
- set activeWins {}
- foreach win [itcl::find objects -isa ManagedWin] {
- if {![$win isa ModalDialog] && ![$win _ignore_on_save]} {
- set g [wm geometry [winfo toplevel [namespace tail $win]]]
- pref setd gdb/geometry/[namespace tail $win] $g
- lappend activeWins [$win pickle]
- }
- }
- pref set gdb/window/active $activeWins
-}
-
-# ------------------------------------------------------------------
-# PUBLIC PROC: startup - This restores all the windows that were
-# opened at shutdown.
-# FIXME: Currently assumes only ONE window per type...
-# ------------------------------------------------------------------
-itcl::body ManagedWin::startup {} {
- debug "Got active list [pref get gdb/window/active]"
-
- foreach cmd [pref get gdb/window/active] {
- eval $cmd
- }
- # If we open the source window, and a source window already exists,
- # then we end up raising it twice during startup. This yields an
- # annoying effect for the user: if the user tries the bury the
- # source window during startup, it will raise itself again. This
- # explains why we first check to see if a source window exists
- # before trying to create it -- raising the window is an inevitable
- # side effect of the creation process.
- if {[llength [find SrcWin]] == 0} {
- ManagedWin::open SrcWin
- }
-}
-
-# ------------------------------------------------------------
-# PUBLIC PROC: open_dlg
-# ------------------------------------------------------------
-itcl::body ManagedWin::open_dlg {class args} {
-
- set newwin [eval _open $class $args]
- if {$newwin != ""} {
- $newwin reveal
- $newwin post
- }
-}
-
-# ------------------------------------------------------------
-# PUBLIC PROC: open
-# ------------------------------------------------------------
-itcl::body ManagedWin::open {class args} {
-
- set newwin [eval _open $class $args]
- if {$newwin != ""} {
- if {[$newwin isa ModalDialog]} {
- parse_args [list {expire 0}]
- after idle "$newwin reveal; $newwin post 0 $expire"
- } else {
- after idle "$newwin reveal"
- }
- }
-
- return $newwin
-}
-
-# ------------------------------------------------------------
-# PRIVATE PROC: _open
-# ------------------------------------------------------------
-itcl::body ManagedWin::_open { class args } {
- debug "$class $args"
-
- parse_args force
-
- if {!$force} {
- # check all windows for one of this type
- foreach obj [itcl::find objects -isa ManagedWin] {
- if {[$obj isa $class]} {
- $obj reveal
- return $obj
- }
- }
-
- }
- # need to create a new window
- return [eval _create $class $args]
-}
-
-# ------------------------------------------------------------
-# PRIVATE PROC: _create
-# ------------------------------------------------------------
-itcl::body ManagedWin::_create { class args } {
-
- set win [string tolower $class]
- debug "win=$win args=$args"
-
- parse_args {center transient {over ""}}
-
- # increment window numbers until we get an unused one
- set i 0
- while {[winfo exists .$win$i]} { incr i }
-
- while { 1 } {
- set top [toplevel .$win$i]
- wm withdraw $top
- wm protocol $top WM_DELETE_WINDOW "destroy $top"
- wm group $top .
- set newwin $top.$win
- if {[catch {uplevel \#0 eval $class $newwin $args} msg]} {
- dbug E "object creation of $class failed: $msg"
- dbug E $::errorInfo
- if {[string first "object already exists" $msg] != -1} {
- # sometimes an object is still really around even though
- # [winfo exists] said it didn't exist. Check for this case
- # and increment the window number again.
- catch {destroy $top}
- incr i
- } else {
- return ""
- }
- } else {
- break
- }
- }
-
- if {[catch {pack $newwin -expand yes -fill both}]} {
- dbug W "packing of $newwin failed: $::errorInfo"
- return ""
- }
-
- wm maxsize $top $_screenwidth $_screenheight
- wm minsize $top 20 20
- update idletasks
-
- if {$over != ""} {
- # center new window
- center_window $top -over [winfo toplevel [namespace tail $over]]
- } elseif {$center} {
- center_window $top
- }
-
- if {$transient} {
- wm resizable $top 0 0
-
- # If a SrcWin is around, use its toplevel as the master for
- # the transient. Otherwise use ".". (The splash screen will
- # need ".", for example.)
- set srcs [ManagedWin::find SrcWin]
- if {[llength $srcs] > 0} {
- set w [winfo toplevel [namespace tail [lindex $srcs 0]]]
- } else {
- set w .
- }
- wm transient $top $w
- } elseif {$::gdbtk_platform(platform) == "unix"} {
- # Modal dialogs DONT get Icons...
- if {[pref get gdb/use_icons] && ![$newwin isa ModalDialog]} {
- set icon [_make_icon_window ${top}_icon]
- wm iconwindow $top $icon
- bind $icon <Double-1> "$newwin reveal"
- }
- }
-
- if {[info exists ::env(GDBTK_TEST_RUNNING)] && $::env(GDBTK_TEST_RUNNING)} {
- set g "+100+100"
- wm geometry $top $g
- wm positionfrom $top user
- } else {
- set g [pref getd gdb/geometry/$newwin]
- if {$g == "1x1+0+0"} {
- dbug E "bad geometry"
- set g ""
- }
- if {$g != ""} {
- # OK. We have a requested geometry. We know that it fits on the screen
- # because we set the maxsize. Now we have to make sure it will not be
- # displayed off the screen.
- set w 0; set h 0; set x 0; set y 0
- if {![catch {scan $g "%dx%d%d%d" w h x y} res]} {
- if {$x < 0} {
- set x [expr $_screenwidth + $x]
- }
- if {$y < 0} {
- set y [expr $_screenheight + $y]
- }
-
- # If the window is transient, then don't reset its size, since
- # the user didn't set this anyway, and in some cases where the
- # size can change dynamically, like the Global Preferences
- # dialog, this can hide parts of the dialog with no recourse...
-
- # if dont_remember_size is true, don't set size, just like
- # transients
-
- if {$transient || [dont_remember_size]} {
- set g "+${x}+${y}"
- } else {
- set g "${w}x${h}+${x}+${y}"
- }
- if {[expr $x+50] < $_screenwidth && [expr $y+20] < $_screenheight} {
- wm positionfrom $top user
- wm geometry $top $g
- set ::$top._init_geometry $g
- }
- }
- }
- }
-
- bind $top <Alt-F4> [list delete object $newwin]
-
- return $newwin
-}
-
-# ------------------------------------------------------------
-# PUBLIC PROC: find
-# ------------------------------------------------------------
-itcl::body ManagedWin::find { win } {
- debug "$win"
- set res ""
- foreach obj [itcl::find objects -isa ManagedWin] {
- if {[$obj isa $win]} {
- lappend res $obj
- }
- }
- return $res
-}
-
-# ------------------------------------------------------------
-# PUBLIC PROC: init
-# ------------------------------------------------------------
-itcl::body ManagedWin::init {} {
- wm withdraw .
- set _screenheight [winfo screenheight .]
- set _screenwidth [winfo screenwidth .]
-}
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: destroy_toplevel
-# ------------------------------------------------------------
-itcl::body ManagedWin::destroy_toplevel {} {
- after idle "update idletasks;destroy $_top"
-}
-
-# ------------------------------------------------------------
-# PROTECTED METHOD: _freeze_me
-# ------------------------------------------------------------
-itcl::body ManagedWin::_freeze_me {} {
- $_top configure -cursor watch
- ::update idletasks
-}
-
-# ------------------------------------------------------------
-# PROTECTED METHOD: _thaw_me
-# ------------------------------------------------------------
-itcl::body ManagedWin::_thaw_me {} {
-
- $_top configure -cursor {}
- ::update idletasks
-}
-
-# ------------------------------------------------------------------
-# PRIVATE PROC: _make_icon_window - create a small window with an
-# icon in it for use by certain Unix window managers.
-# ------------------------------------------------------------------
-itcl::body ManagedWin::_make_icon_window {name {file "gdbtk_icon"}} {
- if {![winfo exists $name]} {
- toplevel $name
- label $name.im -image \
- [image create photo icon_photo -file [file join $::gdb_ImageDir $file.gif]]
- }
- pack $name.im
- return $name
-}
diff --git a/gdb/gdbtk/library/managedwin.ith b/gdb/gdbtk/library/managedwin.ith
deleted file mode 100644
index aae0a676108..00000000000
--- a/gdb/gdbtk/library/managedwin.ith
+++ /dev/null
@@ -1,72 +0,0 @@
-# Managed window class definition for GDBtk.
-# Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class ManagedWin {
- inherit itk::Widget
-
- public {
- method constructor {args}
- method destructor {}
-
- method reconfig {} {}
- method destroy_toplevel {}
- method quit_if_last {} {return 1}
- method pickle {}
- method reveal {}
- method window_name {wname {iname ""}}
- proc window_instance {ins}
-
- proc find {win}
- proc open {class args}
- proc open_dlg {class args}
- proc init {}
- proc restart {}
- proc startup {}
- proc shutdown {}
-
- common win_instance ""
- }
-
- protected {
- # The Tk's toplevel window for this ManagedWin
- variable _top
-
- # Variable which holds the geometry of this window
- variable _geometry {}
-
- # this is the counter of TopLevelWins open
- # when it hits 0, exit.
- common numTopWins 0
-
- common _screenwidth
- common _screenheight
-
- method _freeze_me {}
- method _thaw_me {}
-
- # Should this window be reopened when we startup?
- method _ignore_on_save {} { return 0 }
-
- # Should this window's size be remembered?
- proc dont_remember_size {} { return 0 }
- }
-
- private {
- proc _create {class args}
- proc _open {class args}
- proc _make_icon_window {name {file "gdbtk_icon"}}
- variable _wname {}
- variable _iname {}
- }
-}
diff --git a/gdb/gdbtk/library/mempref.itb b/gdb/gdbtk/library/mempref.itb
deleted file mode 100644
index 85937c7aabd..00000000000
--- a/gdb/gdbtk/library/mempref.itb
+++ /dev/null
@@ -1,424 +0,0 @@
-# Memory display preferences window for Insight.
-# Copyright (C) 1998, 1999, 2002, 2003, 2006 Red Hat
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ------------------------------------------------------------------
-# METHOD: constructor - build the dialog
-# ------------------------------------------------------------------
-itcl::body MemPref::constructor {args} {
-
- window_name "Memory Preferences"
-
- eval itk_initialize $args
-
- if {$float_size == ""} {
- set float_size [gdb_eval sizeof(float)]
- set double_size [gdb_eval sizeof(double)]
- }
-
- if {[string compare $format f] == 0} {
- set gformat x
- set format_disabled 1
- if {$size == $float_size} {
- set gsize 3
- } elseif {$size == $double_size} {
- set gsize 5
- }
- } else {
- set gsize $size
- set gformat $format
- }
-
- set gnumbytes $numbytes
- set gbpr $bpr
- set gbprlist [list 4 8 16 32 64 128]
- set gascii $ascii
- set gascii_char $ascii_char
-
- build_win
-
- if {$format_disabled} {
- set format_disabled 0
- disable_format
- }
-
- wm resizable [winfo toplevel $itk_interior] 0 0
-}
-
-# ------------------------------------------------------------------
-# METHOD: destructor - destroy the dialog
-# ------------------------------------------------------------------
-itcl::body MemPref::destructor {} {
- trace vdelete [scope gnumbytes] w [code $this check_numbytes]
-}
-
-# ------------------------------------------------------------------
-# METHOD: build_win - build the dialog
-# ------------------------------------------------------------------
-itcl::body MemPref::build_win {} {
-
- frame $itk_interior.f
- set f [frame $itk_interior.f.a]
- frame $itk_interior.f.b
-
- # SIZE
- Labelledframe $f.f1 -anchor nw -text Size
- set fr [$f.f1 get_frame]
-
- set Widgets(rb-Byte) [radiobutton $fr.1 -variable [scope gsize] -text Byte \
- -value 1 -command [code $this enable_format]]
- set Widgets(rb-half_word) [radiobutton $fr.2 -variable [scope gsize] -text "Half Word" \
- -value 2 -command [code $this enable_format]]
- set Widgets(rb-word) [radiobutton $fr.4 -variable [scope gsize] -text Word \
- -value 4 -command [code $this enable_format]]
- set Widgets(rb-d_word) [radiobutton $fr.8 -variable [scope gsize] -text "Double Word" \
- -value 8 -command [code $this enable_format]]
- set Widgets(rb-float) [radiobutton $fr.f -variable [scope gsize] -text Float \
- -value 3 -command [code $this disable_format]]
- set Widgets(rb-d_float) [radiobutton $fr.d -variable [scope gsize] -text "Double Float" \
- -value 5 -command [code $this disable_format]]
- grid $fr.1 $fr.4 $fr.f -sticky w -padx 4
- grid $fr.2 $fr.8 $fr.d -sticky w -padx 4
-
- # FORMAT
- Labelledframe $f.f2 -anchor nw -text Format
- set fr [$f.f2 get_frame]
- set Widgets(rb-binary) [radiobutton $fr.1 -variable [scope gformat] \
- -text Binary -value t]
- set Widgets(rb-octal) [radiobutton $fr.2 -variable [scope gformat] \
- -text Octal -value o]
- set Widgets(rb-hex) [radiobutton $fr.3 -variable [scope gformat] \
- -text Hex -value x]
- set Widgets(rb-signed_dec) [radiobutton $fr.4 -variable [scope gformat] \
- -text "Signed Decimal" -value d]
- set Widgets(rb-unsign_dec) [radiobutton $fr.5 -variable [scope gformat] \
- -text "Unsigned Decimal" -value u]
-
- grid $fr.1 $fr.2 $fr.3 -sticky w -padx 4
- grid $fr.4 $fr.5 x -sticky w -padx 4
-
- # TOTAL BYTES
- Labelledframe $f.fx -anchor nw -text "Number of Bytes"
-
- if {$gnumbytes == 0} {
- set gnumbytes $default_numbytes
- set gvar 0
- } else {
- set gvar 1
- }
-
- set fr [$f.fx get_frame]
- set Widgets(rb-win_size) [radiobutton $fr.1 -variable [scope gvar] -text "Depends on window size" \
- -value 0 -command [code $this toggle_size_control]]
- frame $fr.2
- set Widgets(rb-fixed) [radiobutton $fr.2.b -variable [scope gvar] -text Fixed \
- -value 1 -command [code $this toggle_size_control]]
-
- set old_numbytes $default_numbytes
- set Widgets(e-numbytes) [entry $fr.2.e -textvariable [scope gnumbytes] -width 3]
- set normal_background [$Widgets(e-numbytes) cget -background]
-
- #
- # Trace gnumbytes so it will always be a +'ve integer... Have to set this
- # trace AFTER the widget's textvariable is set so this trace will fire
- # BEFORE the widget's trace.
- #
-
- trace variable [scope gnumbytes] w [code $this check_numbytes]
-
- label $fr.2.l -text bytes
- grid $fr.2.b $fr.2.e $fr.2.l -sticky we
- grid $fr.1 x -sticky w -padx 4
- grid $fr.2 x -sticky w -padx 4
- grid columnconfigure $fr 1 -weight 1
-
- # MISC
- Labelledframe $f.1 -anchor nw -text "Miscellaneous"
- set fr [$f.1 get_frame]
- frame $fr.1
- label $fr.1.plabel -height 1 -width 1 -bg $color -relief raised
- set Widgets(b-color) [button $fr.1.pc -text "Change color..." \
- -command [code $this pick $fr.1.plabel]]
- grid $fr.1.plabel $fr.1.pc
- frame $fr.2
- label $fr.2.l -text "Bytes Per Row "
- set Widgets(b-bytes_per_row) [::combobox::combobox $fr.2.c \
- -command [code $this set_bytes_per_row] \
- -width 4 -editable 1 -font global/fixed \
- -bg $::Colors(textbg)]
- foreach item $gbprlist {
- $fr.2.c list insert end $item
- }
- $fr.2.c configure -value $gbpr
-
- pack $fr.2.l -side left -anchor e
- pack $fr.2.c -side right
-
- set Widgets(cb-display_ascii) [checkbutton $fr.3 -variable [scope gascii] -text "Display ASCII"]
- frame $fr.4
- set Widgets(e-ascii_char) [entry $fr.4.e -textvariable [scope gascii_char] -width 1]
- label $fr.4.l -text "Control Char"
- grid $fr.4.e $fr.4.l -sticky we
- grid $fr.2 x $fr.3 -sticky w -padx 4
- grid $fr.4 -sticky w -padx 4
- grid columnconfigure $fr 1 -weight 1
-
- grid $f.f1 -padx 5 -pady 6 -sticky news
- grid $f.f2 -padx 5 -pady 6 -sticky news
- grid $f.fx -padx 5 -pady 6 -sticky news
- grid $f.1 -padx 5 -pady 6 -sticky we
-
-
- set Widgets(b-ok) [button $itk_interior.f.b.ok -text OK -command [code $this ok] -width 7 -default active]
- focus $Widgets(b-ok)
-
- # If there is an OK button, set Return in the entry field to invoke it...
-
- bind $Widgets(e-numbytes) <KeyPress-Return> "$Widgets(b-ok) flash ; $Widgets(b-ok) invoke"
-
- set Widgets(b-cancel) [button $itk_interior.f.b.quit -text Cancel -command [code $this cancel] -width 7]
- set Widgets(b-apply) [button $itk_interior.f.b.apply -text Apply -command [code $this apply] -width 7]
- standard_button_box $itk_interior.f.b
-
- grid $itk_interior.f.a
- grid $itk_interior.f.b -sticky news
- grid $itk_interior.f
-
- #
- # Set the state of the window size entry here...
- #
- toggle_size_control
-
-}
-
-# ------------------------------------------------------------------
-# METHOD: busy - make the widget unusable
-# ------------------------------------------------------------------
-itcl::body MemPref::busy {} {
- set top [winfo toplevel $itk_interior]
- $top configure -cursor watch
-
- # Disable all the radiobuttons and what not
- foreach w [array names Widgets] {
- set WidgetState($w) [$Widgets($w) cget -state]
- }
- foreach w [array names Widgets] {
- $Widgets($w) configure -state disabled
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: idle - make the widget useable
-# ------------------------------------------------------------------
-itcl::body MemPref::idle {} {
- set top [winfo toplevel $itk_interior]
- $top configure -cursor {}
-
- # Re-enable all widgets
- foreach w [array names Widgets] {
- $Widgets($w) configure -state $WidgetState($w)
- }
-}
-# ------------------------------------------------------------------
-# METHOD: ok - apply and quit
-# ------------------------------------------------------------------
-itcl::body MemPref::ok {} {
- apply
- unpost
-}
-
-# ------------------------------------------------------------------
-# METHOD: cancel - just close the dialog w/o saving changes
-# ------------------------------------------------------------------
-itcl::body MemPref::cancel {} {
- unpost
-}
-
-# ------------------------------------------------------------------
-# METHOD: check_numbytes - a trace to make sure gnumbytes is an int > 0
-# ------------------------------------------------------------------
-itcl::body MemPref::check_numbytes {var index mode} {
- upvar \#0 $var true
- if {($true != "") && ([catch {expr {(int($true) != double($true)) || $true <= 0}} val]
- || $val)} {
- bell
- set true $old_numbytes
- } else {
- set old_numbytes $true
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: set_bytes_per_row - combobox callback to set the bytes per row
-# ------------------------------------------------------------------
-itcl::body MemPref::set_bytes_per_row {w value} {
- if {[string is integer -strict $value] && [expr {$value != 0}]} {
- # The input is a value number.
- set gbpr $value
- set gbpr [string trim $gbpr]
-
- # Too high a number will cause a Segmentation fault.
- if {[expr {$gbpr > 150}]} {set gbpr 150}
-
- # Insert the value into the combo box list, if it isn't there already.
- set found [lsearch $gbprlist $gbpr]
-
- if {$found == -1} {
- lappend gbprlist $gbpr
- $Widgets(b-bytes_per_row) list insert end $gbpr
- }
-
- set s $gsize
- if {$s == 3} {set s 4}
- if {$s == 5} {set s 8}
- set rem [expr {$gbpr % $s}]
- if {$rem != 0} {
- # The bytes-per-row is not a multiple of the size.
- set gbpr [expr {$gbpr + ($s - $rem)}]
- }
- }
-
- # Set the display to the new value. This may be different if the input
- # was zero or not a number, or if the user entered any whitespace.
- $Widgets(b-bytes_per_row) delete 0 end
- $Widgets(b-bytes_per_row) insert end $gbpr
-}
-
-# ------------------------------------------------------------------
-# METHOD: toggle_size_control - toggle the state of the entry box as the
-# control method changes
-# ------------------------------------------------------------------
-itcl::body MemPref::toggle_size_control {} {
-
- if {$gvar} {
- $Widgets(e-numbytes) configure -state normal \
- -background $normal_background
- } else {
- $Widgets(e-numbytes) configure -state disabled -background lightgray
- if {[info exists Widgets(b-ok)]} {
- focus $Widgets(b-ok)
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: apply - apply changes to the parent window
-# ------------------------------------------------------------------
-itcl::body MemPref::apply {} {
-
- busy
- gdbtk_busy
-
- if {$gvar == 0} {
- set numbytes 0
- } elseif {$gnumbytes == "" || $gnumbytes == 0} {
- # Protect against the case where someone sets the
- # entry field to an empty string, or pastes in a 0...
- bell
- set gnumbytes $default_numbytes
- set numbytes $gnumbytes
- } else {
- set numbytes $gnumbytes
- }
- switch $gsize {
- 3 {
- set size $float_size
- set format f
- }
- 5 {
- set size $double_size
- set format f
- }
- default {
- set size $gsize
- set format $gformat
- }
- }
-
- # Ensure the value has been read from the text field.
- set_bytes_per_row "" [$Widgets(b-bytes_per_row) get]
-
- # pass all the changed values back to parent
- debug "$win configChange -size $size -numbytes $numbytes \
- -format $format -ascii $gascii \
- -ascii_char $gascii_char -bytes_per_row $gbpr \
- -color $color"
- eval $win configure -size $size -numbytes $numbytes \
- -format $format -ascii $gascii \
- -ascii_char $gascii_char -bytes_per_row $gbpr \
- -color $color
-
- $win reconfig
-
- gdbtk_idle
- idle
-}
-
-# ------------------------------------------------------------------
-# METHOD: enable_format - turn on the format radio buttons
-# ------------------------------------------------------------------
-itcl::body MemPref::enable_format {} {
- # First ensure bytes per row is a multiple of the size.
- # Use the value of the widget, not $gbpr to ensure the typed value is kept.
- set_bytes_per_row "" [$Widgets(b-bytes_per_row) get]
-
- if {!$format_disabled} {
- return
- }
-
- foreach widget {rb-binary rb-octal rb-hex rb-signed_dec rb-unsign_dec} {
- $Widgets($widget) configure -state normal
- }
- set format_disabled 0
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: disable_format - turn off the format radio buttons
-# ------------------------------------------------------------------
-itcl::body MemPref::disable_format {} {
- # First ensure bytes per row is a multiple of the size.
- # Use the value of the widget, not $gbpr to ensure the typed value is kept.
- set_bytes_per_row "" [$Widgets(b-bytes_per_row) get]
-
- if {$format_disabled} {
- return
- }
-
- foreach widget {rb-binary rb-octal rb-hex rb-signed_dec rb-unsign_dec} {
- $Widgets($widget) configure -state disabled
- }
- set format_disabled 1
-}
-
-# ------------------------------------------------------------------
-# METHOD: pick - pick colors
-# ------------------------------------------------------------------
-itcl::body MemPref::pick {lab} {
- set new_color [tk_chooseColor -initialcolor $color -title "Choose color"]
- if {$new_color != $color && $new_color != ""} {
- set color $new_color
- $lab configure -bg $color
- }
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: reconfig - used when preferences change
-# ------------------------------------------------------------------
-itcl::body MemPref::reconfig {} {
- # for now, just delete and recreate
- destroy $itk_interior.f
- build_win
-}
-
diff --git a/gdb/gdbtk/library/mempref.ith b/gdb/gdbtk/library/mempref.ith
deleted file mode 100644
index d1f5f723949..00000000000
--- a/gdb/gdbtk/library/mempref.ith
+++ /dev/null
@@ -1,70 +0,0 @@
-# Memory display preferences window class definition for GDBtk.
-# Copyright (C) 1998, 1999 Cygnus Solutions
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class MemPref {
- inherit ModalDialog ManagedWin
-
- public {
- variable win
- variable size
- variable format
- variable numbytes
- variable bpr
- variable ascii
- variable ascii_char
- variable color
-
- method constructor {args}
- method destructor {}
- method busy {}
- method idle {}
- method cancel {}
- method set_bytes_per_row {w value}
- method check_numbytes {var index mode}
- method toggle_size_control {}
- method apply {}
- method enable_format {}
- method disable_format {}
- method pick {lab}
- method reconfig {}
- }
-
- private {
- # The next seven variables are all used in the radio-buttons
- # and checkbuttons of the display.
- variable gsize
- variable gformat
- variable gnumbytes
- variable gbpr
- variable gbprlist
- variable gascii
- variable gascii_char
- variable gvar
-
- variable Widgets
- variable WidgetState
- variable format_disabled 0
- variable old_numbytes
- variable normal_background
- method build_win {}
- method ok {}
- }
-
- protected {
- common float_size ""
- common double_size ""
- common default_numbytes 128
- }
-
-}
diff --git a/gdb/gdbtk/library/memwin.itb b/gdb/gdbtk/library/memwin.itb
deleted file mode 100644
index fb9f578d898..00000000000
--- a/gdb/gdbtk/library/memwin.itb
+++ /dev/null
@@ -1,776 +0,0 @@
-# Memory display window class definition for Insight.
-# Copyright (C) 1998, 1999, 2001, 2002, 2005, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ------------------------------------------------------------------
-# METHOD: constructor - build the dialog
-# ------------------------------------------------------------------
-itcl::body MemWin::constructor {args} {
- global _mem
- debug $args
- eval itk_initialize $args
-
- set top [winfo toplevel $itk_interior]
- gdbtk_busy
-
- set _mem($this,enabled) 1
-
- if {![info exists type(1)]} {
- set type(1) char
- set type(2) short
- set type(4) int
- set type(8) "long long"
- }
-
- if {[pref getd gdb/mem/menu] != ""} {
- set mbar 0
- }
-
- # Load defaults from preferences.
- set size [pref getd gdb/mem/size]
- set numbytes [pref getd gdb/mem/numbytes]
- set format [pref getd gdb/mem/format]
- set ascii [pref getd gdb/mem/ascii]
- set ascii_char [pref getd gdb/mem/ascii_char]
- set bytes_per_row [pref getd gdb/mem/bytes_per_row]
- set color [pref getd gdb/mem/color]
-
- init_addr_exp
- build_win
- gdbtk_idle
-}
-
-# ------------------------------------------------------------------
-# METHOD: destructor - destroy the dialog
-# ------------------------------------------------------------------
-itcl::body MemWin::destructor {} {
- if {[winfo exists $prefs_win]} {
- $prefs_win cancel
- }
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: build_win - build the main memory window
-# ------------------------------------------------------------------
-itcl::body MemWin::build_win {} {
- global gdb_ImageDir _mem ${this}_memval
-
- set maxlen 0
- set maxalen 0
- set saved_value ""
-
- if { $mbar } {
- menu $itk_interior.m -tearoff 0
- $top configure -menu $itk_interior.m
- $itk_interior.m add cascade -menu $itk_interior.m.addr \
- -label "Addresses" -underline 0
- set m [menu $itk_interior.m.addr]
- $m add check -label " Auto Update" -variable _mem($this,enabled) \
- -underline 1 -command "after idle $this toggle_enabled"
- $m add command -label " Update Now" -underline 1 \
- -command [code $this _update_address 1] -accelerator {Ctrl+U}
- $m add separator
- $m add command -label " Preferences..." -underline 1 \
- -command "$this create_prefs"
- }
-
- # Numcols = number of columns of data
- # numcols = number of columns in table (data plus headings plus ASCII)
- # if numbytes are 0, then use window size to determine how many to read
- if {$numbytes == 0} {
- set Numrows 8
- } else {
- set Numrows [expr {$numbytes / $bytes_per_row}]
- }
- set numrows [expr {$Numrows + 1}]
-
- set Numcols [expr {$bytes_per_row / $size}]
- if {$ascii} {
- set numcols [expr {$Numcols + 2}]
- } else {
- set numcols [expr {$Numcols + 1}]
- }
-
- itk_component add table {
- ::table $itk_interior.t -titlerows 1 -titlecols 1 -variable ${this}_memval \
- -roworigin -1 -colorigin -1 -bg $::Colors(textbg) -fg $::Colors(textfg) \
- -browsecmd "$this changed_cell %s %S" -font global/fixed\
- -colstretch unset -rowstretch unset -selectmode single \
- -xscrollcommand "$itk_interior.sx set" -resizeborders none \
- -cols $numcols -rows $numrows -autoclear 1
- } {
- keep -foreground
- keep -insertbackground
- keep -highlightcolor
- keep -highlightbackground
- }
-
- if {$numbytes} {
- $itk_component(table) configure -yscrollcommand "$itk_interior.sy set"
- scrollbar $itk_interior.sy -command [list $itk_component(table) yview]
- } else {
- $itk_component(table) configure -rowstretchmode none
- }
- scrollbar $itk_interior.sx -command [list $itk_component(table) xview] -orient horizontal
- $itk_component(table) tag config sel -bg [$itk_component(table) cget -bg] -relief sunken
- $itk_component(table) tag config active -relief sunken -wrap 0 \
- -bg $::Colors(sbg) -fg $::Colors(sfg)
- $itk_component(table) tag config title -bg $::Colors(bg) -fg $::Colors(fg)
-
- # rebind all events that use tkTableMoveCell to our local version
- # because we don't want to move into the ASCII column if it exists
- bind $itk_component(table) <Up> "$this memMoveCell %W -1 0; break"
- bind $itk_component(table) <Down> "$this memMoveCell %W 1 0; break"
- bind $itk_component(table) <Left> "$this memMoveCell %W 0 -1; break"
- bind $itk_component(table) <Right> "$this memMoveCell %W 0 1; break"
- bind $itk_component(table) <Return> "$this memMoveCell %W 0 1; break"
- bind $itk_component(table) <KP_Enter> "$this memMoveCell %W 0 1; break"
-
- # bind button 3 to popup
- bind $itk_component(table) <3> "$this do_popup %X %Y"
-
- # bind Paste and button2 to the paste function
- # this is necessary because we want to not just paste the
- # data into the cell, but we also have to write it
- # out to real memory
- bind $itk_component(table) <ButtonRelease-2> [format {after idle %s paste %s %s} $this %x %y]
- bind $itk_component(table) <<Paste>> [format {after idle %s paste %s %s} $this %x %y]
-
- menu $itk_component(table).menu -tearoff 0
- bind_plain_key $top Control-u [code $this _update_address 1]
-
- # bind resize events
- bind $itk_interior <Configure> "$this newsize %h"
-
- frame $itk_interior.f
- iwidgets::spinint $itk_interior.f.cntl -labeltext " Address " -width 20 \
- -command "after idle $this update_address_cb" \
- -increment "after idle $this incr_addr -1" \
- -decrement "after idle $this incr_addr 1" -foreground $::Colors(textfg) \
- -validate {} -textbackground $::Colors(textbg)
- $itk_interior.f.cntl delete 0 end
- $itk_interior.f.cntl insert end $addr_exp
-
- label $itk_interior.f.endian -text "Target is [gdbtk_endian] endian"
-
- balloon register [$itk_interior.f.cntl childsite].uparrow \
- "Scroll Up (Decrement Address)"
- balloon register [$itk_interior.f.cntl childsite].downarrow \
- "Scroll Down (Increment Address)"
- if {!$mbar} {
- button $itk_interior.f.upd -command [code $this _update_address 1] \
- -image [image create photo -file [::file join $gdb_ImageDir check.gif]]
- balloon register $itk_interior.f.upd "Update Now"
- checkbutton $itk_interior.cb -variable _mem($this,enabled) -command "$this toggle_enabled"
- balloon register $itk_interior.cb "Toggles Automatic Display Updates"
- grid $itk_interior.f.upd $itk_interior.f.cntl $itk_interior.f.endian -sticky ew -padx 5
- } else {
- grid $itk_interior.f.cntl x $itk_interior.f.endian -sticky e
- grid columnconfigure $itk_interior.f 1 -weight 1
- }
-
- # draw top border
- set col 0
- for {set i 0} {$i < $bytes_per_row} { incr i $size} {
- set ${this}_memval(-1,$col) [format " %X" $i]
- incr col
- }
-
- if {$ascii} {
- set ${this}_memval(-1,$col) ASCII
- }
-
- # fill initial display
- if {$nb} {
- _update_address 0
- }
-
- if {!$mbar} {
- grid $itk_interior.f x -row 0 -column 0 -sticky nws
- grid $itk_interior.cb -row 0 -column 1 -sticky news
- } else {
- grid $itk_interior.f -row 0 -column 0 -sticky news
- }
- grid $itk_component(table) -row 1 -column 0 -sticky news
- if {$numbytes} { grid $itk_interior.sy -row 1 -column 1 -sticky ns }
- grid $itk_interior.sx -sticky ew
- grid columnconfig $itk_interior 0 -weight 1
- grid rowconfig $itk_interior 1 -weight 1
- focus $itk_interior.f.cntl
-
- window_name "Memory"
-}
-
-# ------------------------------------------------------------------
-# METHOD: paste - paste callback. Update cell contents after paste
-# ------------------------------------------------------------------
-itcl::body MemWin::paste {x y} {
- edit [$itk_component(table) index @$x,$y]
-}
-
-# ------------------------------------------------------------------
-# METHOD: validate - because the control widget wants this
-# ------------------------------------------------------------------
-itcl::body MemWin::validate {val} {
- return $val
-}
-
-# ------------------------------------------------------------------
-# METHOD: create_prefs - create memory preferences dialog
-# ------------------------------------------------------------------
-itcl::body MemWin::create_prefs {} {
- if {$Running} { return }
-
- # make sure row height is set
- if {$rheight == ""} {
- set rheight [lindex [$itk_component(table) bbox 0,0] 3]
- }
-
- set prefs_win [ManagedWin::open MemPref -force -over $this\
- -transient -win $this \
- -size $size -format $format -numbytes $numbytes \
- -bpr $bytes_per_row -ascii $ascii \
- -ascii_char $ascii_char -color $color]
-}
-
-# ------------------------------------------------------------------
-# METHOD: changed_cell - called when moving from one cell to another
-# ------------------------------------------------------------------
-itcl::body MemWin::changed_cell {from to} {
- #debug "moved from $from to $to"
- #debug "value = [$itk_component(table) get $from]"
- if {$saved_value != ""} {
- if {$saved_value != [$itk_component(table) get $from]} {
- edit $from
- }
- }
- set saved_value [$itk_component(table) get $to]
-}
-
-# ------------------------------------------------------------------
-# METHOD: edit - edit a cell
-# ------------------------------------------------------------------
-itcl::body MemWin::edit { cell } {
- global _mem ${this}_memval
-
- #debug "edit $cell"
-
- if {$Running || $cell == ""} { return }
- set rc [split $cell ,]
- set row [lindex $rc 0]
- set col [lindex $rc 1]
- set val [$itk_component(table) get $cell]
-
- if {$col == $Numcols} {
- # editing the ASCII field
- set addr [gdb_incr_addr $current_addr [expr {$bytes_per_row * $row}]]
- set start_addr $addr
-
- # calculate number of rows to modify
- set len [string length $val]
- set rows 0
- while {$len > 0} {
- incr rows
- set len [expr {$len - $bytes_per_row}]
- }
- set nb [expr {$rows * $bytes_per_row}]
-
- # now process each char, one at a time
- foreach c [split $val ""] {
- if {$c != $ascii_char} {
- scan $c %c char
- if {[catch {gdb_set_mem $addr [format %02x $char] 1} res]} {
- error_dialog $res
-
- # reset value
- set ${this}_memval($row,$col) $saved_value
- return
- }
- }
- set addr [gdb_incr_addr $addr]
- }
- set addr $start_addr
- set nextval 0
- # now read back the data and update the widget
- catch {gdb_update_mem ${this}_memval $addr $format $size $nb $bytes_per_row $ascii_char} vals
- return
- }
-
- # calculate address based on row and column
- set addr [gdb_incr_addr $current_addr [expr {$bytes_per_row * $row + $size * $col}]]
- #debug " edit $row,$col $addr = $val"
-
- # Pad the value with zeros, if necessary
- set s [expr {$size * 2}]
- set val [format "0x%0${s}x" $val]
-
- # set memory
- #debug "set_mem $addr $val $size"
- if {[catch {gdb_set_mem $addr $val $size} res]} {
- error_dialog $res
-
- # reset value
- set ${this}_memval($row,$col) $saved_value
- return
- }
-
- # read it back
- # FIXME - HACK ALERT - This call causes trouble with remotes on Windows.
- # This routine is in fact called from within an idle handler triggered by
- # memMoveCell. Something evil happens in that handler that causes gdb to
- # start writing this changed value into all the visible cells...
- # I have not figured out the cause of this, so for now I commented this
- # line out. It will only matter if the write did not succeed, and this was
- # not a very good way to tell the user about that anyway...
- #
- # catch {gdb_update_mem $addr $format $size $size $size ""} val
- # delete whitespace in response
- set val [string trimright $val]
- set val [string trimleft $val]
- set ${this}_memval($row,$col) $val
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: toggle_enabled - called when enable is toggled
-# ------------------------------------------------------------------
-itcl::body MemWin::toggle_enabled {} {
- global _mem
-
- if {$Running} { return }
- if {$_mem($this,enabled)} {
- _update_address 1
- set state normal
- set bg $::Colors(textbg)
- } else {
- set bg $::Colors(bg)
- set state disabled
- }
- $itk_component(table) config -background $bg -state $state
-}
-
-# ------------------------------------------------------------------
-# METHOD: update - update widget after every PC change
-# ------------------------------------------------------------------
-itcl::body MemWin::update {event} {
- global _mem
- if {$_mem($this,enabled)} {
- _update_address 0
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: idle - memory window is idle, so enable menus
-# ------------------------------------------------------------------
-itcl::body MemWin::idle {event} {
- # Fencepost
- set Running 0
-
- # Cursor
- cursor {}
-
- if {[winfo exists $itk_interior.m.addr]} {
- # Enable menus
- if {$mbar} {
- for {set i 0} {$i <= [$itk_interior.m.addr index last]} {incr i} {
- if {[$itk_interior.m.addr type $i] != "separator"} {
- $itk_interior.m.addr entryconfigure $i -state normal
- }
- }
- }
-
- # Enable control
- $itk_interior.f.cntl configure -state normal
- }
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: busy - BusyEvent handler
-# Disable menus 'cause we're busy updating things.
-# ------------------------------------------------------------------
-itcl::body MemWin::busy {event} {
- # Fencepost
- set Running 1
-
- # cursor
- cursor watch
-
- # go away if window is not finished drawing
- if {![winfo exists $itk_interior.f.cntl]} { return }
-
- # Disable menus
- if {$mbar} {
- for {set i 0} {$i <= [$itk_interior.m.addr index last]} {incr i} {
- if {[$itk_interior.m.addr type $i] != "separator"} {
- $itk_interior.m.addr entryconfigure $i -state disabled
- }
- }
- }
-
- # Disable control
- $itk_interior.f.cntl configure -state disabled
-}
-
-# ------------------------------------------------------------------
-# METHOD: newsize - calculate how many rows to display when the
-# window is resized.
-# ------------------------------------------------------------------
-itcl::body MemWin::newsize {height} {
-
- if {$dont_size || $Running} {
- return
- }
-
- # only add rows if numbytes is zero
- if {$numbytes == 0} {
- ::update idletasks
-
- # make sure row height is set
- if {$rheight == ""} {
- set rheight [lindex [$itk_component(table) bbox 0,0] 3]
- }
-
- set theight [winfo height $itk_component(table)]
- set Numrows [expr {$theight / $rheight}]
- $itk_component(table) configure -rows $Numrows
- _update_address 1
- }
-}
-
-itcl::body MemWin::_update_address {make_busy} {
- if {$make_busy} {
- gdbtk_busy
- }
- update_address [string trimleft [$itk_interior.f.cntl get]]
- if {$make_busy} {
- gdbtk_idle
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: update_address_cb - address entry widget callback
-# ------------------------------------------------------------------
-itcl::body MemWin::update_address_cb {} {
- set new_entry 1
- _update_address 1
-}
-
-# ------------------------------------------------------------------
-# METHOD: update_address - update address and data displayed
-# ------------------------------------------------------------------
-itcl::body MemWin::update_address {addr} {
-
- set bad_expr 0
- set saved_addr $current_addr
- if {[string match {[a-zA-Z_&0-9\*]*} $addr]} {
- # Looks like an expression
- set retVal [catch {gdb_eval "$addr" x} current_addr]
- #debug "retVal=$retVal current_addr=$current_addr"
- if {$retVal || [string match "No symbol*" $current_addr] || \
- [string match "Invalid *" $current_addr]} {
- BadExpr $current_addr
- return
- }
- if {[string match {\{*} $current_addr]} {
- set current_addr [lindex $current_addr 1]
- if {$current_addr == ""} {
- return
- }
- }
- } elseif {[regexp {\$[a-zA-Z_]} $addr]} {
- # Looks like a local variable
- set retVal [catch {gdb_eval "$addr" x} current_addr]
- #debug "retVal=$retVal current_addr=$current_addr"
- if {$retVal} {
- BadExpr $current_addr
- return
- }
- if {$current_addr == "void"} {
- BadExpr "No Local Variable Named \"$addr\""
- return
- }
- } else {
- # something really strange, like "0.1" or ""
- BadExpr "Can't Evaluate \"$addr\""
- return
- }
-
- # Check for spaces - this can happen with gdb_eval and $pc, for example.
- set index [string first \ $current_addr]
- if {$index != -1} {
- incr index -1
- set current_addr [string range $current_addr 0 $index]
- }
-
- set addr_exp $addr
-
- # set table background
- $itk_component(table) config -bg $::Colors(textbg) -state normal
- catch {update_addr}
-}
-
-# ------------------------------------------------------------------
-# METHOD: BadExpr - handle a bad expression
-# ------------------------------------------------------------------
-itcl::body MemWin::BadExpr {errTxt} {
- if {$new_entry} {
- tk_messageBox -type ok -icon error -message $errTxt
- set new_entry 0
- }
- # set table background to gray
- $itk_component(table) config -bg $::Colors(bg) -state disabled
- set current_addr $saved_addr
- set saved_addr ""
- set bad_expr 1
-}
-
-# ------------------------------------------------------------------
-# METHOD: incr_addr - callback from control widget to increment
-# the current address.
-# ------------------------------------------------------------------
-itcl::body MemWin::incr_addr {num} {
- if {$current_addr == ""} {
- return
- }
- set old_addr $current_addr
- set current_addr [gdb_incr_addr $current_addr [expr {$bytes_per_row * $num}]]
-
- # A memory address less than zero is probably not a good thing...
- #
-
- if {($num < 0 && [gdb_eval "$current_addr > $old_addr"]) \
- ||($num > 0 && [gdb_eval "$current_addr < $old_addr"]) } {
- bell
- set current_addr $old_addr
- return
- }
- $itk_component(table) config -bg $::Colors(textbg) -state normal
- $itk_interior.f.cntl clear
- $itk_interior.f.cntl insert 0 $current_addr
- _update_address 1
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: update_addr - read in data starting at $current_addr
-# This is just a helper function for update_address.
-# ------------------------------------------------------------------
-itcl::body MemWin::update_addr {} {
- global _mem ${this}_memval
-
- set row 0
-
- if {$numbytes == 0} {
- set nb [expr {$Numrows * $bytes_per_row}]
- } else {
- set nb $numbytes
- }
- if {$ascii} {
- set retVal [catch {gdb_update_mem ${this}_memval $current_addr $format $size $nb $bytes_per_row $ascii_char} vals]
-
- } else {
- set retVal [catch {gdb_update_mem ${this}_memval $current_addr $format $size $nb $bytes_per_row} vals]
- }
-
-
- if {$retVal || [llength $vals] != 3} {
- BadExpr "Couldn't get memory at address: \"$addr\""
- debug "gdb_update_mem returned return code: $retVal and value: \"$vals\""
- return
- }
- # set default column width to the max in the data columns
- $itk_component(table) configure -colwidth [lindex $vals 1]
-
- # set border column width
- $itk_component(table) width -1 [lindex $vals 0]
-
- # set ascii column width
- if {$ascii} {
- $itk_component(table) width $Numcols [lindex $vals 2]
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: hidemb - hide the menubar. NOT CURRENTLY USED
-# ------------------------------------------------------------------
-itcl::body MemWin::hidemb {} {
- set mbar 0
- reconfig
-}
-
-# ------------------------------------------------------------------
-# METHOD: reconfig - used when preferences change
-# ------------------------------------------------------------------
-itcl::body MemWin::reconfig {} {
- debug
- set addr_exp [string trimright [string trimleft $addr_exp]]
- set wh [winfo height $top]
-
- if [winfo exists $itk_interior.m] { destroy $itk_interior.m }
- if [winfo exists $itk_interior.cb] { destroy $itk_interior.cb }
- if [winfo exists $itk_interior.f.upd] { destroy $itk_interior.f.upd }
- if [winfo exists $itk_interior.sy] { destroy $itk_interior.sy }
- destroy $itk_interior.f.cntl $itk_interior.f $itk_component(table) \
- $itk_interior.sx
-
- set dont_size 1
-
- # If the fonts change, then you will need to recompute the
- # row height. Ditto for switch from fixed number of rows to
- # depends on size.
-
- set rheight ""
-
- # Update preferences to reflect new reality
- pref setd gdb/mem/size $size
- pref setd gdb/mem/numbytes $numbytes
- pref setd gdb/mem/format $format
- pref setd gdb/mem/ascii $ascii
- pref setd gdb/mem/ascii_char $ascii_char
- pref setd gdb/mem/bytes_per_row $bytes_per_row
- pref setd gdb/mem/color $color
-
- build_win
- set dont_size 0
- ::update
-
- if {$numbytes == 0} {
- newsize $wh
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: do_popup - Display popup menu
-# ------------------------------------------------------------------
-itcl::body MemWin::do_popup {X Y} {
- if {$Running} { return }
- $itk_component(table).menu delete 0 end
- $itk_component(table).menu add check -label "Auto Update" -variable _mem($this,enabled) \
- -underline 0 -command "$this toggle_enabled"
- $itk_component(table).menu add command -label "Update Now" -underline 0 \
- -command [code $this _update_address 1]
- $itk_component(table).menu add command -label "Go To [$itk_component(table) curvalue]" -underline 0 \
- -command "$this goto [$itk_component(table) curvalue]"
- $itk_component(table).menu add command -label "Open New Window at [$itk_component(table) curvalue]" -underline 0 \
- -command [list ManagedWin::open MemWin -force -addr_exp [$itk_component(table) curvalue]]
- $itk_component(table).menu add separator
- $itk_component(table).menu add command -label "Preferences..." -underline 0 \
- -command "$this create_prefs"
- tk_popup $itk_component(table).menu $X $Y
-}
-
-# ------------------------------------------------------------------
-# METHOD: goto - change the address of the current memory window
-# ------------------------------------------------------------------
-itcl::body MemWin::goto { addr } {
- set current_addr $addr
- $itk_interior.f.cntl delete 0 end
- $itk_interior.f.cntl insert end $addr
- _update_address 1
-}
-
-# ------------------------------------------------------------------
-# METHOD: init_addr_exp - initialize address expression
-# On startup, if the public variable "addr_exp" was not set,
-# then set it to the start of ".data" if found, otherwise "$pc"
-# ------------------------------------------------------------------
-itcl::body MemWin::init_addr_exp {} {
- if {$addr_exp == ""} {
- set err [catch {gdb_cmd "info file"} result]
- if {!$err} {
- foreach line [split [string trim $result] \n] {
- if {[scan $line {%x - %x is %s} start stop section] == 3} {
- if {$section == ".data"} {
- set addr_exp [format "%#08x" $start]
- break
- }
- }
- }
- }
- if {$addr_exp == ""} {
- set addr_exp \$pc
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: cursor - set the cursor
-# ------------------------------------------------------------------
-itcl::body MemWin::cursor {glyph} {
- # Set cursor for all labels
- # for {set i 0} {$i < $bytes_per_row} {incr i $size} {
- # $itk_component(table).h.$i configure -cursor $glyph
- # }
- $top configure -cursor $glyph
-}
-
-# memMoveCell --
-#
-# Moves the location cursor (active element) by the specified number
-# of cells and changes the selection if we're in browse or extended
-# selection mode.
-#
-# Don't allow movement into the ASCII column.
-#
-# Arguments:
-# w - The table widget.
-# x - +1 to move down one cell, -1 to move up one cell.
-# y - +1 to move right one cell, -1 to move left one cell.
-
-itcl::body MemWin::memMoveCell {w x y} {
- if {[catch {$w index active row} r]} return
- set c [$w index active col]
- if {$ascii && ($c == $Numcols)} {
- # we're in the ASCII column so behave differently
- if {$y == 1} {set x 1}
- if {$y == -1} {set x -1}
- incr r $x
- } else {
- incr r $x
- incr c $y
- if { $c < 0 } {
- if {$r == 0} {
- set c 0
- } else {
- set c [expr {$Numcols - 1}]
- incr r -1
- }
- } elseif { $c >= $Numcols } {
- if {$r >= [expr {$Numrows - 1}]} {
- set c [expr {$Numcols - 1}]
- } else {
- set c 0
- incr r
- }
- }
- }
- if { $r < 0 } { set r 0 }
- $w activate $r,$c
- $w see active
-}
-
-# ------------------------------------------------------------
-# PUBLIC METHOD: error_dialog - Open and error dialog.
-# Arguments:
-# msg - The message to display in the dialog
-# modality - The dialog modailty. Default: task
-# type - The dialog type (tk_messageBox).
-# Default: ok
-# ------------------------------------------------------------
-itcl::body MemWin::error_dialog {msg {modality task} {type ok}} {
- set parent [winfo toplevel [namespace tail $this]]
- tk_messageBox -icon error -title Error -type $type \
- -message $msg -parent $parent
-}
-
diff --git a/gdb/gdbtk/library/memwin.ith b/gdb/gdbtk/library/memwin.ith
deleted file mode 100644
index c7ec92d17c9..00000000000
--- a/gdb/gdbtk/library/memwin.ith
+++ /dev/null
@@ -1,85 +0,0 @@
-# Memory display window class definition for Insight.
-# Copyright (C) 1998, 1999, 2001, 2002 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class MemWin {
- inherit EmbeddedWin GDBWin
-
- private {
- variable saved_addr ""
- variable bad_expr 0
- variable current_addr ""
- variable dont_size 0
- variable mbar 1
- variable bg
- variable top
- variable nb 128
- variable prefs_win ""
- variable Running 0
- variable Numrows 0
- variable Numcols 0
- variable saved_value
- variable maxlen
- variable maxalen
- variable rheight ""
- variable new_entry 0
-
- method build_win {}
- method init_addr_exp {}
- method cursor {glyph}
- method _update_address {make_busy}
- }
-
- public {
- variable addr_exp ""
- variable size 4
- variable format x
- variable bytes_per_row 16
- variable numbytes 0
- variable ascii 1
- variable ascii_char "."
- variable color green
- }
-
- protected common type
-
- public {
- method constructor {args}
- method destructor {}
- method paste {x y}
- method validate {val}
- method create_prefs {}
- method changed_cell {from to}
- method edit {cell}
- method toggle_enabled {}
- method newsize {height}
- method update_address_cb {}
- method update_address {addr_exp}
- method BadExpr {errTxt}
- method incr_addr {num}
- method update_addr
- method hidemb {}
- method reconfig {}
- method do_popup {x y}
- method goto {addr}
- method memMoveCell {w x y}
- method error_dialog {msg {modality task} {type ok}}
-
- #
- # GDB Events
- #
- method busy {event}
- method idle {event}
- method update {event}
- }
-}
diff --git a/gdb/gdbtk/library/modal.tcl b/gdb/gdbtk/library/modal.tcl
deleted file mode 100644
index ecaafe6928a..00000000000
--- a/gdb/gdbtk/library/modal.tcl
+++ /dev/null
@@ -1,105 +0,0 @@
-# Modal dialog class for GDBtk.
-# Copyright (C) 1998, 1999 Cygnus Solutions
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements the post and unpost behavior of a Modal Dialog.
-#
-# For now the point behind this is to control calling
-# ide_grab_support. If you call disable all the windows of an
-# application but one, destroy that window, THEN re-enable the
-# windows, Windows brings the last enabled window in the last
-# active application to the foreground (Doh!).
-#
-# ----------------------------------------------------------------------
-
-itcl::class ModalDialog {
- # This is the variable we vwait on when the dialog is posted.
- # It is set to 1 in the unpost method, and to -1 in the destructor.
-
- private variable unpost_notification 0
-
- destructor {
- debug " UNPOST $this"
- set unpost_notification -1
- }
-
- # ------------------------------------------------------------------
- # METHOD: unpost - unposts the dialog box...
- # ------------------------------------------------------------------
- public method unpost {} {
- after idle [list set [scope unpost_notification] 1]
- }
-
- # ------------------------------------------------------------------
- # METHOD: cancel - This just unposts the dialog box...
- # If you want to programatically cancel a dialog
- # selection, for instance if the app is going away
- # use this rather than unpost. That way a sub-class
- # that actually has to do some work can override it.
- # ------------------------------------------------------------------
- public method cancel {} {
- ModalDialog::unpost
- }
-
-
- # ------------------------------------------------------------------
- # METHOD: post - posts the dialog box...
- # ------------------------------------------------------------------
- public method post {{on_top 0} {expire 0}} {
-
- debug "POST $this"
- set top [winfo toplevel [namespace tail $this]]
- wm protocol $top WM_DELETE_WINDOW [code $this cancel]
-
- if {$on_top} {
- after 500 keep_raised $top
- }
-
- ide_grab_support disable_except $top
- focus $top
- grab set $top
-
- if {$expire > 0} {
- set afterID [after $expire [code $this cancel]]
- }
-
- vwait [scope unpost_notification]
-
- if {$afterID != ""} {
- after cancel $afterID
- set afterID ""
- }
-
- grab release $top
-
- # Enable all the windows in the application BEFORE
- # you destroy this one, or Windows will bring another
- # app to the foreground.
-
- ide_grab_support enable_all
-
- # We can get here either by someone calling unpost (if an OK button
- # is clicked or whatever), or by someone destroying the dialog (for
- # instance by using the Window Manager.) Only delete the object if
- # we are not already in the process of doing this.
-
- if {$unpost_notification == 1} {
- ::delete object $this
- }
- }
-
- public variable expire -1 ;# If this is set to a number > 0, the
- # dialog will time out after this interval.
- private variable afterID ""; # The id for the expiration after event.
-}
diff --git a/gdb/gdbtk/library/pluginwin.itcl b/gdb/gdbtk/library/pluginwin.itcl
deleted file mode 100644
index e856a5314cd..00000000000
--- a/gdb/gdbtk/library/pluginwin.itcl
+++ /dev/null
@@ -1,184 +0,0 @@
-# PluginWindow
-# Copyright (C) 2001, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ----------------------------------------------------------------------
-# Implements a menu and a toolbar that are attached to a source window.
-#
-# PUBLIC ATTRIBUTES:
-#
-#
-# METHODS:
-#
-# configure ....... used to change public attributes
-#
-# PRIVATE METHODS
-#
-# X11 OPTION DATABASE ATTRIBUTES
-#
-#
-# ----------------------------------------------------------------------
-
-itcl::class PluginWindow {
- inherit ManagedWin GDBEventHandler
-
- # ------------------------------------------------------------------
- # CONSTRUCTOR - create widget
- # ------------------------------------------------------------------
- constructor {args} {
-
- # Create a menu widget for the plug-in window
- set menubar [GDBMenuBar $itk_interior.menubar]
-
- # Create a toolbar widget for the plug-in window
- set toolbar [GDBToolBar $itk_interior.toolbar]
-
- # Pack the toolbar
- pack $toolbar -expand 1 -fill both
-
- # Create a frame for the subclass to use
- set child [frame $itk_interior.child]
-
- # Pack the childsite
- pack $child -expand 1 -fill both
-
- eval itk_initialize $args
- add_hook gdb_no_inferior_hook [code $this no_inferior]
- }
-
- # ------------------------------------------------------------------
- # DESTRUCTOR - destroy window containing widget
- # ------------------------------------------------------------------
- destructor {
- remove_hook gdb_no_inferior_hook [code $this no_inferior]
-
- #destroy $this
- }
-
- # ------------------------------------------------------------------
- # ACCESSOR METHOD - Retrieve childsite
- # ------------------------------------------------------------------
- public method childsite {} {
- return $child
- }
-
- # Don't automatically reload plugins.
- protected method _ignore_on_save {} { return 1 }
-
- ####################################################################
- #
- # State control methods used by both the menu and the toolbar
- #
- ####################################################################
-
- # ------------------------------------------------------------------
- # METHOD: idle - handle IdleEvent
- # ------------------------------------------------------------------
- protected method idle {event} {
- debug "PluginWindow::idle"
- enable_ui 1
- }
-
- # ------------------------------------------------------------------
- # METHOD: busy - BusyEvent handler
- # Invoked when gdb is going to run the inferior
- # ------------------------------------------------------------------
- public method busy {event} {
- debug "PluginWindow::busy"
- enable_ui 0
- }
-
- # ------------------------------------------------------------------
- # METHOD: no_inferior
- # Invoked when gdb detects the inferior is gone
- # ------------------------------------------------------------------
- protected method no_inferior {} {
- debug
- enable_ui 2
- }
-
- ####################################################################
- # The following method enables/disables both menus and buttons.
- ####################################################################
-
- # ------------------------------------------------------------------
- # METHOD: enable_ui - enable/disable the appropriate buttons and menus
- # Called from the busy, idle, and no_inferior hooks.
- #
- # on must be:
- # value Control Other State
- # 0 off off gdb is busy
- # 1 on on gdb has inferior, and is idle
- # 2 off on gdb has no inferior, and is idle
- # ------------------------------------------------------------------
- public method enable_ui {on} {
- debug "$on"
-
- # Do the enabling so that all the disabling happens first, this way if a
- # button belongs to two groups, enabling takes precedence, which is
- # probably right.
-
- switch $on {
- 0 {
- # Busy
- set enable_list {Control disabled \
- Other disabled}
- }
- 1 {
- # Idle, with inferior
- set enable_list {Control normal \
- Other normal}
- }
- 2 {
- # Idle, no inferior
- set enable_list {Control disabled \
- Other normal}
- }
- default {
- debug "Unknown type: $on in enable_ui"
- return
- }
- }
-
- $menubar set_class_state $enable_list
- $toolbar set_class_state $enable_list
- }
-
- ####################################################################
- #
- # PRIVATE DATA
- #
- ####################################################################
-
- # The childsite
- private variable child
-
- ####################################################################
- #
- # PROTECTED DATA
- #
- ####################################################################
-
- # The GdbMenuBar component
- protected variable menubar
-
- # The GdbToolBar component
- protected variable toolbar
-
- ####################################################################
- #
- # PUBLIC DATA
- #
- ####################################################################
-
- # None.
-}
diff --git a/gdb/gdbtk/library/prefs.tcl b/gdb/gdbtk/library/prefs.tcl
deleted file mode 100644
index 2a709248b2c..00000000000
--- a/gdb/gdbtk/library/prefs.tcl
+++ /dev/null
@@ -1,764 +0,0 @@
-# Local preferences functions for Insight.
-# Copyright (C) 1997, 1998, 1999, 2002, 2003, 2004, 2008 Red Hat
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# On STARTUP:
-# 1. Options database (.Xdefaults on Unix or ? on Windows) is read
-# 2. GDB prefs file is read ("gdbtk.ini" on Windows; ".gdbtkinit" on Unix)
-# 3. GDB init script is read
-#
-# Normally all preferences will be set in the prefs file, which is
-# a generated file. Hand-editing, if necessary, should be done to the
-# GDB init script.
-#
-# when "save options" is selected, the contents of the
-# preferences array is written out to the GDB prefs file.
-#
-# Usage:
-# pref_save
-# pref_read
-# ----------------------------------------------------------------------
-#
-
-proc pref_read {} {
- global prefs_init_filename env gdb_ImageDir GDBTK_LIBRARY GDBStartup
- global gdbtk_platform
-
- if {[info exists env(HOME)]} {
- if {$gdbtk_platform(os) == "cygwin"} {
- set home [ide_cygwin_path to_win32 $env(HOME)]
- } else {
- set home $env(HOME)
- }
- } else {
- set home ""
- }
-
- if {$gdbtk_platform(platform) == "windows"} {
- set prefs_init_filename "gdbtk.ini"
- } else {
- set prefs_init_filename ".gdbtkinit"
- }
-
- if {!$GDBStartup(inhibit_prefs) \
- || [info exists env(INSIGHT_FORCE_READ_PREFERENCES)]} {
- set file_opened 0
- if {[file exists $prefs_init_filename]} {
- if {[catch {open $prefs_init_filename r} fd]} {
- dbug E "$fd"
- return
- }
- set file_opened 1
- } elseif {$home != ""} {
- set name [file join $home $prefs_init_filename]
- if {[file exists $name]} {
- if {[catch {open $name r} fd]} {
- dbug E "$fd"
- return
- }
- set prefs_init_filename $name
- set file_opened 1
- }
- }
-
- if {$file_opened == "1"} {
- set section gdb
- set version 0
- while {[gets $fd line] >= 0} {
- switch -regexp -- $line {
- {^[ \t\n]*#.*} {
- # Comment. We recognize one magic comment that includes
- # the version number.
- if {[regexp -- "^# GDBtkInitVersion: (\[0-9\]+)\$" $line \
- dummy v]} {
- set version $v
- }
- }
-
- {^[ \t\n]*$} {
- ;# empty line; ignore it
- }
-
- {^[ \t\n]*\[.*\]} {
- regexp {\[(.*)\]} $line match section
- }
-
- {^[ \t\n]*option.*} {
- set line [string trimleft $line]
- eval $line
- }
-
- default {
- set a ""
- set name ""
- set val ""
- regexp "\[ \t\n\]*\(.+\)=\(.+\)" $line a name val
- if {$a == "" || $name == ""} {
- dbug W "Cannot parse line: $line"
- } else {
- # Must unescape equal signs in val
- set val [unescape_value $val $version]
- if {$section == "gdb"} {
- pref setd gdb/$name $val
- } elseif {$section == "global" && [regexp "^font/" $name]} {
- set name [split $name /]
- set f global/
- append f [join [lrange $name 1 end] /]
- if {[lsearch [font names] $f] == -1} {
- # new font
- eval define_font $f $val
- } else {
- # existing font
- pref set global/font/[join [lrange $name 1 end] /] $val
- }
- } elseif {$section == "global"} {
- pref setd $section/$name $val
- } else {
- # backwards compatibility. recognize old src-font name
- if {$val == "src-font"} {set val "global/fixed"}
- pref setd gdb/$section/$name $val
- }
- }
- }
- }
- }
- close $fd
- } elseif {$home != ""} {
- set prefs_init_filename [file join $home $prefs_init_filename]
- }
-
- # now set global options
- set gdb_ImageDir [file join $GDBTK_LIBRARY [pref get gdb/ImageDir]]
-
- }
-
- # finally set colors, from system if possible
- if {[pref get gdb/use_color_schemes] != "1"} {
- pref_set_colors $home
- } else {
- global Colors
- # These colors are the same for all schemes
- set Colors(textfg) black
- set Colors(fg) black
- set Colors(sbg) \#4c59a5
- set Colors(sfg) white
- set_bg_colors
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: pref_save - save preferences to a file and delete window
-# ------------------------------------------------------------------
-proc pref_save {{win {}}} {
- global prefs_init_filename GDBStartup env
-
- if {!$GDBStartup(inhibit_prefs)
- || [info exists env(INSIGHT_FORCE_READ_PREFERENCES)]} {
- debug "pref_save $prefs_init_filename"
-
- if {[catch {open $prefs_init_filename w} fd]} {
- debug "ERROR: $fd"
- return
- }
-
- puts $fd "\# GDBtk Init file"
- puts $fd {# GDBtkInitVersion: 1}
-
- set plist [pref list]
- # write out global options
- puts $fd "\[global\]"
- foreach var $plist {
- set t [split $var /]
- if {[lindex $t 0] == "global"} {
- set x [join [lrange $t 1 end] /]
- set v [escape_value [pref get $var]]
-
- if {$x != "" && $v != ""} {
- puts $fd "\t$x=$v"
- }
- }
- }
-
- # write out gdb-global options
- puts $fd "\[gdb\]"
- foreach var $plist {
- set t [split $var /]
- # We use the funny join/lreplace code because the session code
- # can generate a key where [lindex $t 2] is empty but there is
- # still stuff after that. This happens because the session code
- # uses filenames, which can start with `/'.
- if {[lindex $t 0] == "gdb"
- && [string compare [join [lreplace $t 0 1] /] ""] == 0} {
- set x [lindex $t 1]
- set v [escape_value [pref get $var]]
- if {$x != "" && $v != ""} {
- puts $fd "\t$x=$v"
- }
- }
- }
-
- # now loop through all sections writing out values
- # FIXME: this is broken. We should discover the list
- # dynamically.
- lappend secs load console src reg stack locals watch bp search \
- process geometry help browser kod window session mem bg ipc
-
- foreach section $secs {
- puts $fd "\[$section\]"
- foreach var $plist {
- set t [split $var /]
- if {[lindex $t 0] == "gdb" && [lindex $t 1] == $section} {
- set x [join [lrange $t 2 end] /]
- set v [escape_value [pref get $var]]
- if {$x != "" && $v != ""} {
- puts $fd "\t$x=$v"
- }
- }
- }
- }
- close $fd
- }
-
- if {$win != ""} {
- $win delete
- }
-}
-
-# -------------------------------------------------------
-# PROC: escape_value - escape all equal signs for saving
-# prefs to a file
-# -------------------------------------------------------
-proc escape_value {val} {
- # We use a URL-style quoting. We encode `=', `%', the `[]'
- # characters and newlines. We use a cute trick here: we regsub in
- # command expressions which we then expand using subst.
- if {[info tclversion] >= 8.1} {
- set expr {([\[\]=%\n])}
- } else {
- set expr "(\[\]\[=%\n\])"
- }
- regsub -all -- $expr $val \
- {[format "%%%02x" [scan {\1} %c x; set x]]} newval
- return [subst -nobackslashes -novariables $newval]
-}
-
-# -------------------------------------------------------
-# PROC: unescape_value - unescape all equal signs for
-# reading prefs from a file. VERSION is the version
-# number of the encoding.
-# version 0 only encoded `='.
-# version 1 correctly encoded more values
-# -------------------------------------------------------
-proc unescape_value {val version} {
- switch -exact -- $version {
- 0 {
- # Old-style encoding.
- if {[regsub -all -- {!%} $val = newval]} {
- return $newval
- }
- }
-
- 1 {
- # Version 1 uses URL encoding.
- regsub -all -- "%(..)" $val \
- {[format %c 0x\1]} newval
- return [subst -nobackslashes -novariables $newval]
- }
-
- default {
- error "Unknown encoding version $version"
- }
- }
-
- return $val
-}
-
-# ------------------------------------------------------------------
-# PROC: pref_set_defaults - set up default values
-# ------------------------------------------------------------------
-proc pref_set_defaults {} {
- global GDBTK_LIBRARY gdbtk_platform gdb_ImageDir
- debug
-
- # Gdb global defaults
- pref define gdb/ImageDir images2
- set gdb_ImageDir [file join $GDBTK_LIBRARY [pref get gdb/ImageDir]]
- pref define gdb/font_cache ""
- pref define gdb/mode 0; # 0 no tracing, 1 tracing enabled
- pref define gdb/control_target 1; # 0 can't control target (EMC), 1 can
- pref define gdb/B1_behavior 1; # 0 means set/clear breakpoints,
- # 1 means set/clear tracepoints.
- pref define gdb/use_icons 1; # For Unix, use gdbtk_icon.gif as an icon
- # some window managers can't deal with it.
-
- # OS compatibility. Valid values are "Windows", "GNOME", "KDE", and "default"
- if {$gdbtk_platform(platform) == "windows"} {
- pref define gdb/compat "Windows"
- } elseif {$gdbtk_platform(platform) == "unix"} {
- pref define gdb/compat "GNOME"
- } else {
- pref define gdb/compat "default"
- }
-
- # set download and execution options
- pref define gdb/load/verbose 0
- pref define gdb/load/main 1
- pref define gdb/load/exit 1
- pref define gdb/load/check 0
- pref define gdb/load/bp_at_func 0
- pref define gdb/load/bp_func ""
- pref define gdb/load/baud 38400
- if {$gdbtk_platform(platform) == "windows"} {
- pref define gdb/load/port com1
- } else {
- pref define gdb/load/port "/dev/ttyS0"
- }
-
- # The list of active windows:
- pref define gdb/window/active {}
-
- # Console defaults
- pref define gdb/console/prompt "(gdb) "
- pref define gdb/console/deleteLeft 1
- pref define gdb/console/wrap 0
- pref define gdb/console/prompt_fg DarkGreen
- pref define gdb/console/error_fg red
- pref define gdb/console/log_fg green
- pref define gdb/console/target_fg blue
- pref define gdb/console/font global/fixed
-
- # Source window defaults
- pref define gdb/src/PC_TAG green
- pref define gdb/src/STACK_TAG gold
- pref define gdb/src/BROWSE_TAG \#9595e2
- pref define gdb/src/handlebg red
- pref define gdb/src/bp_fg red
- pref define gdb/src/temp_bp_fg orange
- pref define gdb/src/disabled_fg black
- pref define gdb/src/font global/fixed
- pref define gdb/src/break_fg black
- pref define gdb/src/source2_fg navy
- pref define gdb/src/variableBalloons 1
- pref define gdb/src/trace_fg magenta
- pref define gdb/src/tab_size 8
- pref define gdb/src/linenums 1
- pref define gdb/src/thread_fg pink
- pref define gdb/src/top_control 1; # 1 srctextwin controls on top, 0 bottom
-
- # Define the run button's functions. These are defined here in case
- # we do a "run" with an exec target (which never causes target.tcl to
- # source)...
- pref define gdb/src/run_attach 0
- pref define gdb/src/run_load 0
- pref define gdb/src/run_run 1
- pref define gdb/src/run_cont 0
-
- # This is the disassembly flavor. For now this is only supported on x86
- # machines.
-
- pref define gdb/src/disassembly-flavor ""
-
- # Variable Window defaults
- pref define gdb/variable/font global/fixed
- pref define gdb/variable/disabled_fg gray
-
- # Stack Window
- pref define gdb/stack/font global/fixed
-
- # Register Window
- pref define gdb/reg/rows 16
-
- # Global Prefs Dialogs
- pref define gdb/global_prefs/save_fg red
- pref define gdb/global_prefs/message_fg white
- pref define gdb/global_prefs/message_bg red
-
- # Browser Window Search
- pref define gdb/search/last_symbol ""
- pref define gdb/search/filter_mode "starts with"
-
- pref define gdb/browser/hide_h 0
- pref define gdb/browser/layout 2
-
- # BP (breakpoint)
- pref define gdb/bp/show_threads 0
-
- # Help
- pref define gdb/help/browsername ""
-
- # Kernel Objects (kod)
- pref define gdb/kod/show_icon 0
-
- # Various possible "main" functions. What's for Java?
- pref define gdb/main_names [list main MAIN___ MAIN__ cyg_user_start cyg_start ]
-
- # These are the classes of warning dialogs, and whether the user plans
- # to ignore them.
- pref define gdb/warnings/signal 0
-
- # Memory window.
- pref define gdb/mem/size 4
- pref define gdb/mem/numbytes 0
- pref define gdb/mem/format x
- pref define gdb/mem/ascii 1
- pref define gdb/mem/ascii_char .
- pref define gdb/mem/bytes_per_row 16
- pref define gdb/mem/color green
-
- # External editor.
- pref define gdb/editor ""
-
- # background colors
- set ::gdb_bg_num 0
- pref define gdb/use_color_schemes 1
- pref define gdb/bg/0 \#ffffff
- pref define gdb/bg/1 \#ffffd0
- pref define gdb/bg/2 \#ffd0ff
- pref define gdb/bg/3 \#ffd0d0
- pref define gdb/bg/4 \#d0ffff
- pref define gdb/bg/5 \#d0ffd0
- pref define gdb/bg/6 \#d0d0ff
- pref define gdb/bg/7 \#d0d0d0
- pref define gdb/bg/8 \#ffffb0
- pref define gdb/bg/9 \#ffb0ff
- pref define gdb/bg/10 \#ffb0b0
- pref define gdb/bg/11 \#b0ffff
- pref define gdb/bg/12 \#b0ffb0
- pref define gdb/bg/13 \#b0b0ff
- pref define gdb/bg/14 \#b0b0b0
- pref define gdb/bg/15 \#d0b0d0
-
- # IPC prefs
- # set prefs based on GDB version?
- #set vers [lindex [split [lindex [split [gdb_cmd "show version"]] end-1 ] \"] 1]
- pref define gdb/ipc/enabled 0
- pref define gdb/ipc/port 9909
- pref define gdb/ipc/stop_button 1
- pref define gdb/ipc/step_button 1
- pref define gdb/ipc/cont_button 1
- pref define gdb/ipc/run_button 1
- pref define gdb/ipc/exit 1
-}
-
-
-##########################################################################
-#
-# Everything below this point is code to try to determine the current OS
-# color scheme and use that. It mostly works, but is not very compatible
-# with the use of multiple color schemes for different instances of Insight.
-#
-##########################################################################
-proc pref_set_colors {home} {
- # set color palette
-
- # In the past, tk widgets got their color information from Windows or
- # the X resource database. Unfortunately Insight is a mixture of widgets
- # from all over and was coded first in tcl and later in itcl. So lots of
- # color inheritance is broken or wrong. And Insight has some special color
- # requirements. We also have to deal with new Unix desktops that don't use the Xrdb.
- # To enable us to fix that without hardcoding colors, we create a color
- # array here and use it as needed to force widgets to the correct colors.
-
- global Colors
- debug
-
- # UNIX colors
-
- # For KDE3 (and probably earlier versions) when the user sets
- # a color scheme from the KDE control center, the appropriate color
- # information is set in the X resource database. Well, most of it
- # is there but it is missing some settings, so we will carefully
- # adjust things.
- #
- # For GNOME, we read .gtkrc or .gtkrc-1.2-gnome2 and parse it
- # for the color information. We cannot really get this right,
- # but with luck we can read enough to get the colors to mostly match.
-
- # If there is no information, we provide reasonable defaults.
-
- # If some theme sets the text foreground and background to something unusual
- # then Insight won't be able to display sources and highlight things properly.
- # Therefore we will not change the textfg and textbg.
-
- switch [pref get gdb/compat] {
-
- "Windows" {
- debug "loading OS colors for Windows"
- set Colors(fg) SystemButtonText
- set Colors(bg) SystemButtonFace
- #set Colors(textfg) SystemWindowText
- #set Colors(textbg) SystemWindow
- set Colors(textfg) black
- set Colors(textbg) white
- set Colors(sfg) SystemHighlightText
- set Colors(sbg) SystemHighlight
- pref_set_option_db 0
- }
-
- "KDE" {
- debug "loading OS colors for KDE"
-
- pref_load_default
- # try loading "~/.gtkrc-kde"
- if {[pref_load_gnome $home [list .gtkrc-kde]]} {
- debug "loaded gnome file"
- pref_set_option_db 0
- debug "loaded option file"
- } else {
- # no .gtkrc-kde so assume X defaults have been set
-
- # create an empty entry widget so we can query its colors
- entry .e
-
- # text background
- # set Colors(textbg) [option get .e background {}]
- set Colors(textbg) white
-
- # text foreground
- #set Colors(textfg) [option get .e foreground {}]
- set Colors(textfg) black
-
- # background
- set Colors(bg) [option get . background {}]
- if {$Colors(bg) == ""} {set Colors(bg) lightgray}
-
- # foreground
- set Colors(fg) [option get . foreground {}]
- if {$Colors(fg) == ""} {set Colors(fg) black}
-
- # selectBackground
- set Colors(sbg) [option get .e selectBackground {}]
- if {$Colors(sbg) == ""} {set Colors(sbg) blue}
-
- # selectForeground
- set Colors(sfg) [option get .e selectForeground {}]
- if {$Colors(sfg) == ""} {set Colors(sfg) white}
-
- destroy .e
- pref_set_option_db 1
- }
- }
-
- "GNOME" {
- pref_load_default
- pref_load_gnome $home
- pref_set_option_db 0
- }
-
- "default" {
- pref_load_default
- pref_set_option_db 1
- }
- }
-}
-
-proc pref_load_default {} {
- global Colors
- debug "loading default colors"
-
- set Colors(textbg) white
- set Colors(textfg) black
- set Colors(bg) lightgray
- set Colors(fg) black
-
- # selectBackground
- set Colors(sbg) blue
-
- # selectForeground
- set Colors(sfg) white
-}
-
-
-# load GNOME colors and fonts, if possible.
-proc pref_load_gnome {home {possible_names {}}} {
- debug "loading OS colors for GNOME"
-
- if {$possible_names == ""} {
- set possible_names {.gtkrc .gtkrc-1.2-gnome2}
- }
-
- set found 0
- foreach name $possible_names {
- debug "home=$home name=$name"
- set fname [file join $home $name]
- debug "fname=$fname"
- if {[file exists $fname]} {
- if {[catch {open $fname r} fd]} {
- dbug W "cannot open $fname: $fd"
- return 0
- }
- set found 1
- break
- }
- }
- if {$found} {
- set found [load_gnome_file $fd]
- close $fd
- }
- return $found
-}
-
-proc load_gnome_file {fd} {
- global Colors
- set found 0
-
- while {[gets $fd line] >= 0} {
- if {[regexp {include \"([^\"]*)} $line foo incname]} {
- debug "include $incname $found"
- if {$found == 0 && [file exists $incname]} {
- if {[catch {open $incname r} fd2]} {
- dbug W "cannot open $incname: $fd2"
- } else {
- set found [load_gnome_file $fd2]
- close $fd2
- if {$found} {
- return $found
- }
- }
- }
- continue
- } elseif {[regexp "\[ \t\n\]*\(.+\) = \(.+\)" $line a name val] == 0} {
- continue
- }
-
- if {[regexp "\"#......\"" $val a] == 1} {
- set val [lindex $a 0]
- } else {
- set res [scan $val "\{ %f, %f, %f \}" r g b]
- if {$res != 3} {
- continue
- }
- set r [expr int($r*255)]
- set g [expr int($g*255)]
- set b [expr int($b*255)]
- set val [format "\#%02x%02x%02x" $r $g $b]
- }
-
- debug "name=\"$name\" val=\"$val\""
-
- # This is a bit of a hack and probably only
- # works for trivial cases. Scan for colors and
- # use the first one found.
- switch [string trimright $name] {
- {bg[NORMAL]} {
- set found 1
- if {![info exists new(bg)]} {
- debug "setting bg to $val"
- set new(bg) $val
- }
- }
- {base[NORMAL]} {
- #if {![info exists new(textbg)]} {
- # set new(textbg) $val
- #}
- }
- {text[NORMAL]} {
- #if {![info exists new(textfg)]} {
- # set new(textfg) $val
- #}
- }
- {fg[NORMAL]} {
- if {![info exists new(fg)]} {
- set new(fg) $val
- }
- }
- {fg[ACTIVE]} {
- if {![info exists new(afg)]} {
- set new(afg) $val
- }
- }
- {bg[SELECTED]} {
- if {![info exists new(sbg)]} {
- set new(sbg) $val
- }
- }
- {base[SELECTED]} {
- if {![info exists new(sbg)]} {
- set new(sbg) $val
- }
- }
- {fg[SELECTED]} {
- if {![info exists new(sfg)]} {
- set new(sfg) $val
- }
- }
- {fg[INSENSITIVE]} {
- if {![info exists new(dfg)]} {
- set new(dfg) $val
- }
- }
- {bg[PRELIGHT]} {
- set Colors(prelight) $val
- }
- {base[PRELIGHT]} {
- set Colors(prelight) $val
- }
- }
- }
-
- foreach c {fg bg sfg sbg dfg} {
- if {[info exists new($c)]} {
- set Colors($c) $new($c)
- }
- }
- return 1
-}
-
-
-# load the colors into the tcl option database
-proc pref_set_option_db {makebg} {
- global Colors
-
- # The color of text that indicates changed items
- # We standardize on one color here so that changed
- # items don't blend into any OS color scheme
- set Colors(change) "green"
-
- option add *background $Colors(bg)
- option add *buttonBackground $Colors(bg)
- option add *Text*background $Colors(textbg)
- option add *Entry*background $Colors(textbg)
- option add *foreground $Colors(fg)
- option add *Text*foreground $Colors(textfg)
- option add *Entry*foreground $Colors(textfg)
-
- option add *highlightBackground $Colors(bg)
- option add *selectBackground $Colors(sbg)
-
- if {$::gdbtk_platform(platform) == "unix"} {
- option add *activeBackground $Colors(sbg)
- }
-
- option add *selectForeground $Colors(sfg)
- option add *Menu*activeForeground $Colors(sfg)
-
- if {[info exists Colors(prelight)]} {
- option add *Button*activeBackground $Colors(prelight)
- }
- if {[info exists Colors(dfg)]} {
- option add *disabledForeground $Colors(dfg)
- }
-
- if {$makebg} {
- # calculate trough and activebackground as 90% of background
- set dbg [recolor $::Colors(bg) 90]
- option add *activeBackground $dbg
- option add *troughColor $dbg
- }
-
- # Change the default select color for checkbuttons, etc to match
- # selectBackground.
- if {$::gdbtk_platform(platform) == "unix"} {
- option add *selectColor $Colors(sbg)
- }
-}
diff --git a/gdb/gdbtk/library/process.itb b/gdb/gdbtk/library/process.itb
deleted file mode 100644
index 2670b055dfb..00000000000
--- a/gdb/gdbtk/library/process.itb
+++ /dev/null
@@ -1,161 +0,0 @@
-# Process window for Insight.
-# Copyright (C) 1998, 1999, 2001, 2002, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements a process window with a list of threads, tasks, and/or
-# processes to debug.
-#
-# ----------------------------------------------------------------------
-
-itcl::body ProcessWin::constructor {args} {
-
- window_name "Processes"
- gdbtk_busy
- build_win
- gdbtk_idle
-
- # Add hooks for this object
- add_hook gdb_no_inferior_hook [code $this idle]
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: build_win - build the main process window
-# ------------------------------------------------------------------
-itcl::body ProcessWin::build_win {} {
-
- itk_component add slbox {
- iwidgets::scrolledlistbox $itk_interior.slbox \
- -background $::Colors(bg) \
- -selectbackground $::Colors(sbg) -selectforeground $::Colors(sfg) \
- -textfont global/fixed \
- -exportselection false \
- -selectioncommand [code $this change_context]
- } {}
- [$itk_component(slbox) component listbox] configure \
- -bg $::Colors(textbg) -fg $::Colors(textfg)
- update dummy
-
- pack $itk_component(slbox) -side left -expand yes -fill both
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: update - update widget when something changes
-# ------------------------------------------------------------------
-itcl::body ProcessWin::update {event} {
- if {!$protect_me} {
-
- $itk_component(slbox) delete 0 end
- if {[catch {gdb_cmd "info thread"} threads]} {
- # failed. leave window blank
- return
- }
-
- set threads [split $threads \n]
- debug "processWin update: \n$threads"
- if {[llength $threads] == 0} {
- # no processes/threads listed.
- return
- }
-
- # insert each line one at a time
- set active -1
- set num_threads 0
- foreach line $threads {
- # Active line starts with "*"
- if {[string index $line 0] == "*"} {
- # strip off leading "*"
- set line " [string trimleft $line "*"]"
- set active $num_threads
- }
- # scan for GDB ID number at start of line
- if {[scan $line "%d" id($num_threads)] == 1} {
- $itk_component(slbox) insert end $line
- incr num_threads
- }
- }
-
- # highlight the active thread
- if {$active >= 0} {
- set active_thread $id($active)
- $itk_component(slbox) selection set $active
- $itk_component(slbox) see $active
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: change_context - change the current context (active thread)
-# This method is currently ONLY called from the mouse binding
-# ------------------------------------------------------------------
-itcl::body ProcessWin::change_context {} {
- if {!$Running && [$itk_component(slbox) size] != 0} {
- gdbtk_busy
- set sel [$itk_component(slbox) curselection]
- set idnum $id($sel)
- #debug "change_context to line $sel id=$idnum"
- catch {gdb_cmd "thread $idnum"}
- # Run idle hooks and cause all widgets to update
- set protect_me 1
- gdbtk_update
- set protect_me 0
- gdbtk_idle
- }
-}
-
-# ------------------------------------------------------------------
-# DESTRUCTOR - destroy window containing widget
-# ------------------------------------------------------------------
-itcl::body ProcessWin::destructor {} {
- remove_hook gdb_no_inferior_hook [code $this no_inferior]
-}
-
-# ------------------------------------------------------------------
-# METHOD: reconfig - used when preferences change
-# ------------------------------------------------------------------
-itcl::body ProcessWin::reconfig {} {
- destroy $itk_interior.s
- if {[winfo exists $itk_interior.slbox]} { destroy $itk_interior.slbox }
- build_win
-}
-
-# ------------------------------------------------------------------
-# METHOD: busy - BusyEvent handler
-#
-# This method should accomplish blocking
-# - clicks in the window
-# - change mouse pointer
-# ------------------------------------------------------------------
-itcl::body ProcessWin::busy {event} {
- set Running 1
- cursor watch
-}
-
-# ------------------------------------------------------------------
-# METHOD: idle - handle IdleEvent
-# ------------------------------------------------------------------
-itcl::body ProcessWin::idle {event} {
- set Running 0
- cursor {}
-}
-
-# ------------------------------------------------------------------
-# METHOD: cursor - set the window cursor
-# This is a convenience method which simply sets the mouse
-# pointer to the given glyph.
-# ------------------------------------------------------------------
-itcl::body ProcessWin::cursor {glyph} {
- $_top configure -cursor $glyph
-}
diff --git a/gdb/gdbtk/library/process.ith b/gdb/gdbtk/library/process.ith
deleted file mode 100644
index 5e1106ac92f..00000000000
--- a/gdb/gdbtk/library/process.ith
+++ /dev/null
@@ -1,41 +0,0 @@
-# Process window class definition for Insight.
-# Copyright (C) 1998, 1999, 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class ProcessWin {
- inherit EmbeddedWin GDBWin
-
- private {
- variable id
- variable Running 0
- variable protect_me 0
-
-
- method build_win {}
- method change_context {}
- method cursor {glyph}
- }
-
- public {
- method reconfig {}
- method constructor {args}
- method destructor {}
-
- #
- # GDB Events
- #
- method busy {event}
- method idle {event}
- method update {event}
- }
-}
diff --git a/gdb/gdbtk/library/regwin.itb b/gdb/gdbtk/library/regwin.itb
deleted file mode 100644
index 54e515f41b8..00000000000
--- a/gdb/gdbtk/library/regwin.itb
+++ /dev/null
@@ -1,1051 +0,0 @@
-# Register display window for Insight.
-# Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2007 Red Hat, Inc.
-#
-# Written by Keith Seitz (keiths@redhat.com)
-# and Martin Hunt (hunt@redhat.com)
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# TODO
-#
-# Must fix:
-# o Edit menus -- weirdo interaction with tkTable. Seems okay on windows.
-# Needs more testing on unix (popup edit menu item).
-#
-# Want really badly:
-# o Multiple selections
-# o Multiple displays
-# o Better resizing
-# o Register groups (gdb and user-defined)
-# o format register values before inserting into table?
-# (Instead of displaying "0x0", we should use "0x00000000" on
-# machines with 32-bit regs, "0x0000000000000000" on machines
-# with 64-bit regs, etc. Maybe user-defined formats, i.e.,
-# "0x0000 0000 0000 0000 0000 0000"?)
-
-# ------------------------------------------------------------------
-# NAME: RegWin::constructor
-# DESCRIPTION: Create a new register window
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::constructor {args} {
-
- eval itk_initialize $args
-
- gdbtk_busy
-
- window_name "Registers" "Regs"
- _build_win
- _layout_table
-
- # Clear gdb's changed list
- catch {gdb_reginfo changed}
-
- gdbtk_idle
-}
-
-# ------------------------------------------------------------------
-# NAME: RegWin::destructor
-# DESCRIPTION: Destroys the register window
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::destructor {} {
- debug
-}
-
-# ------------------------------------------------------------------
-# NAME: RegWin::_load_prefs
-# DESCRIPTION: Load register preferences
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::_load_prefs {} {
- debug
-
- # Find out largest register name length.
- set _max_label_width 0; # for reg labels
- set _reg_display_list {}
- set _register(hidden) {}
-
- set regs [gdb_reginfo group $_group]
- foreach r [gdb_reginfo name -numbers $regs] {
- set nm [lindex $r 0]
- set rn [lindex $r 1]
- set size [string length $nm]
- if {$size > $_max_label_width} {
- set _max_label_width $size
- }
-
- # Set type from prefs or default to first in list of types
- set _types($rn) [gdb_reginfo type $rn]
- set tp [pref getd gdb/reg/${nm}-type]
- set _type($rn,name) ""
- if {$tp != ""} {
- foreach t $_types($rn) {
- if {[lindex $t 0] == $tp} {
- set _type($rn,name) $tp
- set _type($rn,addr) [lindex $t 1]
- set _type($rn,code) [lindex $t 2]
- break
- }
- }
- }
- if {$_type($rn,name) == ""} {
- # either not set or couldn't find it in list of types
- set _type($rn,name) [lindex [lindex $_types($rn) 0] 0]
- set _type($rn,addr) [lindex [lindex $_types($rn) 0] 1]
- set _type($rn,code) [lindex [lindex $_types($rn) 0] 2]
- }
-
- # Check preferences for format
- set _format($rn) [pref getd gdb/reg/${nm}-format]
- if {$_format($rn) == ""} {
- # no preference set. Set it to hex or float
- if {$_type($rn,code) == "int"} {
- set _format($rn) "x"
- } else {
- set _format($rn) "f"
- }
- pref setd gdb/reg/${nm}-format $_format($rn)
- }
-
- gdb_reginfo format $rn $_type($rn,addr) $_format($rn)
-
- # Check if the user prefers not to show this register
- if {[pref getd gdb/reg/$nm] == "no"} {
- set _cell($rn) hidden
- lappend _register(hidden) $rn
- } else {
- lappend _reg_display_list $rn
- }
-
- # assume editable, for now
- set _editable($rn) 1
- }
-
- incr _max_label_width 2; # padding
-}
-
-
-#
-# Table layout/display methods
-#
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_build_win
-# DESCRIPTION: Builds the register window from widgets
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-#
-# NOTES: This method should only be called once for
-# each RegWin. To change the layout of the table
-# in the window, use RegWin::_layout_table.
-# ------------------------------------------------------------------
-itcl::body RegWin::_build_win {} {
-
- # Create scrollbars and table
- itk_component add vscroll {
- scrollbar $itk_interior.vs -orient vertical
- }
- itk_component add hscroll {
- scrollbar $itk_interior.hs -orient horizontal
- }
-
- itk_component add table {
- ::table $itk_interior.tbl -variable [scope _data] \
- -browsecmd [code $this _select_cell %S] -font global/fixed \
- -colstretch unset -rowstretch unset -selectmode single \
- -resizeborders none -multiline false -colwidth 18 \
- -autoclear 0 -bg $::Colors(bg) \
- -padx 5 -xscrollcommand [code $itk_component(hscroll) set] \
- -yscrollcommand [code $itk_component(vscroll) set]
- } {
- keep -foreground
- keep -insertbackground
- keep -highlightcolor
- keep -highlightbackground
- }
- bind $itk_component(table) <Up> \
- [format "%s; break" [code $this _move up]]
- bind $itk_component(table) <Down> \
- [format "%s; break" [code $this _move down]]
- bind $itk_component(table) <Left> \
- [format "%s; break" [code $this _move left]]
- bind $itk_component(table) <Right> \
- [format "%s; break" [code $this _move right]]
- bind $itk_component(table) <3> \
- [code $this _but3 %x %y %X %Y]
- bind $itk_component(table) <Double-1> break
- bind $itk_component(table) <1> \
- [code $this _edit %x %y]
- bind $itk_component(table) <Return> \
- [format "%s; break" [code $this _accept_edit]]
- bind $itk_component(table) <KP_Enter> \
- [format "%s; break" [code $this _accept_edit]]
- bind $itk_component(table) <Escape> \
- [code $this _unedit]
-
- $itk_component(hscroll) configure -command [code $itk_component(table) xview]
- $itk_component(vscroll) configure -command [code $itk_component(table) yview]
-
-
- # Create/configure tags for various display styles
- # normal - the "normal" display style
- # highlight - changed registers are highlighted
- # sel - the selection fg/bg should conform to standard
- # header - used on the register name cells and empty cells
- # edit - used on a cell being edited
- $itk_component(table) tag configure normal \
- -state disabled -bg $::Colors(textbg) -fg $::Colors(textfg)
- $itk_component(table) tag configure sel -bg $::Colors(sbg) -fg $::Colors(sfg)
- $itk_component(table) tag configure highlight -bg $::Colors(change) -fg black
- $itk_component(table) tag raise highlight
- $itk_component(table) tag configure header \
- -anchor w -state disabled -relief raised
- $itk_component(table) tag configure disabled \
- -state disabled
- $itk_component(table) tag raise active
- $itk_component(table) tag configure edit \
- -state normal
- $itk_component(table) tag raise edit
- $itk_component(table) tag raise sel
-
- itk_component add frame {
- frame $itk_interior.m
- }
- iwidgets::optionmenu $itk_component(frame).opt -labeltext "Group:" \
- -labelpos w -command [code $this _select_group]
- eval $itk_component(frame).opt insert end [gdb_reginfo grouplist]
- $itk_component(frame).opt select "all"
-
- pack $itk_component(frame).opt -anchor nw
- grid $itk_component(frame) -row 0 -columnspan 2 -sticky news
- grid $itk_component(table) -row 1 -column 0 -sticky news
- grid $itk_component(vscroll) -row 1 -column 1 -sticky ns
- grid $itk_component(hscroll) -row 2 -column 0 -sticky ew
- grid columnconfigure $itk_interior 0 -weight 1
- grid rowconfigure $itk_interior 0 -weight 0
- grid rowconfigure $itk_interior 1 -weight 1
-
- # Add popup menu - we populate it in the event handler
- itk_component add popup {
- menu $itk_interior.pop -tearoff 0
- } {}
-}
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_layout_table
-# DESCRIPTION: Configures and lays out the table
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-#
-# NOTES: Uses preferences to determine if/how a register
-# is displayed
-# ------------------------------------------------------------------
-itcl::body RegWin::_layout_table {} {
- debug
-
- if {[info exists _cell]} {
- unset _cell
- unset _register
- }
- # Clear any column spans
- foreach span [$itk_component(table) spans] {
- $itk_component(table) spans $span 0,0
- }
-
- _load_prefs
-
- # Fill data array with register names.
- #
- # The table is indexed by (row,col). All odd columns will contain
- # register values and all even columns will contain the labels.
- #
- set x 0
- set y 0
-
- # get register list
- set regs [gdb_reginfo name -numbers $_reg_display_list]
-
- # Set table dimensions
- set num [llength $regs]
- set _rows [pref get gdb/reg/rows]
- set _cols [expr $num / $_rows]
- if {[expr $num % $_rows] != 0} { incr _cols }
- set _cols [expr 2 * $_cols]
- $itk_component(table) configure -cols $_cols -rows $_rows
-
- # get values
- if {[catch {gdb_reginfo value $_reg_display_list} values]} {
- dbug W "values=$values"
- set values ""
- }
- set i 0
-
- # now build table
- foreach r $regs {
- set name [lindex $r 0]
- set rn [lindex $r 1]
-
- set _cell($rn) "$y,[expr {$x+1}]"
- set _register($_cell($rn)) $rn
- set _data($y,$x) $name
- set _data($_cell($rn)) [lindex $values $i]
- incr i
-
- # Go to next row/column
- incr y
- if {$y == $_rows} {
- set _col_size([expr {$x+1}]) 0
-
- # Size the column
- if {$::gdb_running} {
- _size_column [expr {$x+1}] 1
- }
-
- $itk_component(table) width $x $_max_label_width
- $itk_component(table) tag col header $x
- $itk_component(table) tag col normal [expr {$x+1}]
-
- set y 0
- incr x 2
- }
- }
-
- # Mark empty cells
- while {$y != $_rows && $x != $_cols} {
- set _data($y,$x) ""
- set _data($y,[expr {$x+1}]) ""
- $itk_component(table) spans $y,$x 0,1
- $itk_component(table) tag cell header $y,$x
- set _col_size([expr {$x+1}]) 0
-
- incr y
- if {$y == $_rows} {
- # Size the column
- if {$::gdb_running} {
- _size_column [expr {$x+1}] 1
- }
- $itk_component(table) width $x $_max_label_width
- $itk_component(table) tag col header $x
- $itk_component(table) tag col normal [expr {$x+1}]
-
- set y 0
- incr x 2
- }
- }
-}
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_size_cell_column
-# DESCRIPTION: Resize the column for a given cell.
-#
-# ARGUMENTS:
-# cell - the cell whose column is to be resized
-# down - whether the resizing should size the column
-# down or just up.
-# RETURNS: Nothing
-#
-# NOTES: See _size_column for the reasoning for the "down"
-# option.
-# ------------------------------------------------------------------
-itcl::body RegWin::_size_cell_column {cell down} {
-
- set col [string trim [lindex [split $cell ,] 1] ()]
- _size_column $col $down
-}
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_size_column
-# DESCRIPTION: Resize the given column
-#
-# ARGUMENTS:
-# col - the column to be resized
-# down - whether the resizing should size the column
-# RETURNS: down or just up.
-#
-# NOTES: The down option allows column sizes to change down
-# as well as up. For most cases, this is what is
-# wanted. However, when the user is stepping, it is
-# really annoying to see the column sizes changing.
-# It's bad enough we must size up, but going down
-# is just too much. Consequently, when updating the
-# contents of the table, we specify that the columns
-# should not downsize. This helps mitigate the
-# annoyance.
-# ------------------------------------------------------------------
-itcl::body RegWin::_size_column {col down} {
-
- set max 0
- foreach cell [array names _data *,$col] {
- set len [string length $_data($cell)]
- if {$len > $max} { set max $len }
- }
-
- if {($down && $max != $_col_size($col))
- || (!$down && $max > $_col_size($col))} {
- set _col_size($col) $max
- $itk_component(table) width $col [expr {$max + 2}]
-
- # Force the table to update itself
- after idle event generate $itk_component(table) <Configure> \
- -width [winfo width $itk_component(table)]
- }
-}
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::reconfig
-# DESCRIPTION: Reconfigures register window when a preference
-# changes.
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-#
-# ------------------------------------------------------------------
-itcl::body RegWin::reconfig {} {
- $itk_component(table) tag configure normal \
- -state disabled -bg $::Colors(textbg) -fg $::Colors(textfg)
-}
-
-
-#
-# Table event handlers and related methods
-#
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_accept_edit
-# DESCRIPTION: Change a register's value
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-#
-# NOTES: Event handler for <Enter> and <KP_Enter>
-# in table
-# ------------------------------------------------------------------
-itcl::body RegWin::_accept_edit {} {
- debug
- set cell [$itk_component(table) tag cell edit]
- if {[llength $cell] == 1 && [info exists _register($cell)]} {
- # Select the same cell again. This forces the table
- # to keep this value. Otherwise, we'll never see it...
- _select_cell $cell
- set rn $_register($cell)
- set n [gdb_reginfo name $rn]
- if {[llength $_types($rn)] > 1} {
- append n ".$_type($rn,name)"
- }
- set v [string trim [$itk_component(table) curvalue] \ \r\n]
- debug "n=$n v=$v"
- if {$v != ""} {
- if {[catch {gdb_cmd "set \$${n}=$v"} result]} {
- tk_messageBox -icon error -type ok -message $result \
- -title "Error in Expression" -parent $_top
- }
- }
-
- # Always update the register, even for error conditions. This
- # will ensure that the cell's old value is restored to the table.
- _update_register $_register($cell)
- _size_cell_column $cell 1
- }
-
- _unedit
-}
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_add_to_watch
-# DESCRIPTION: Add a register to the watch window
-#
-# ARGUMENTS: rn - the register number to add to the WatchWin
-# RETURNS: Nothing
-#
-# NOTES: Only works with one WatchWin...
-# ------------------------------------------------------------------
-itcl::body RegWin::_add_to_watch {rn} {
- [ManagedWin::open WatchWin] add "\$[gdb_reginfo name $rn]"
-}
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_add_to_watch
-# DESCRIPTION: Add a register to the watch window
-#
-# ARGUMENTS: rn - the register number to add to the WatchWin
-# RETURNS: Nothing
-#
-# NOTES: Only works with one WatchWin...
-# ------------------------------------------------------------------
-itcl::body RegWin::_open_memory {rn} {
- ManagedWin::open MemWin -force -addr_exp $_data($_cell($rn))
-}
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_but3
-# DESCRIPTION: Configure the popup menu before posting it
-#
-# ARGUMENTS: x - x-coordinate of buttonpress
-# y - y-coordinate
-# X - x-root coordinate
-# Y - y-root coordinate
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::_but3 {x y X Y} {
-
- # Only post the menu when we're not executing the inferior,
- # the inferior is in a runnable state, and we're not in a disabled
- # cell.
- if {!$_running && $::gdb_running} {
-
- # Select the register
- set cell [_select_cell [$itk_component(table) index @$x,$y]]
- if {[info exists _register($cell)]} {
- set rn $_register($cell)
- set name [gdb_reginfo name $rn]
- $itk_component(popup) delete 0 end
- $itk_component(popup) add command -label $name -state disabled
- $itk_component(popup) add separator
- if {[llength $_types($rn)] > 1} {
- foreach t $_types($rn) {
- $itk_component(popup) add radio -label [lindex $t 0] \
- -variable [scope _type($rn,addr)] \
- -value [lindex $t 1] \
- -command [code $this _change_format $rn [lindex $t 0]]
- }
- $itk_component(popup) add separator
- }
-
- $itk_component(popup) add radio -label "Hex" \
- -variable [scope _format($rn)] -value x \
- -command [code $this _change_format $rn]
-
- if {$_type($rn,code) == "int"} {
- $itk_component(popup) add radio -label "Decimal" \
- -variable [scope _format($rn)] -value d \
- -command [code $this _change_format $rn]
- $itk_component(popup) add radio -label "Unsigned" \
- -variable [scope _format($rn)] -value u \
- -command [code $this _change_format $rn]
- } elseif {$_type($rn,code) == "float"} {
- $itk_component(popup) add radio -label "Floating Point" \
- -variable [scope _format($rn)] -value f \
- -command [code $this _change_format $rn]
- }
- $itk_component(popup) add separator
-
- if {$_editable($rn)} {
- set state normal
- } else {
- set state disabled
- }
-
- if {$_type($rn,code) == "int"} {
- $itk_component(popup) add command \
- -label "Open Memory Window" -command [code $this _open_memory $rn]
- }
- $itk_component(popup) add command \
- -label "Add to Watch" -command [code $this _add_to_watch $rn]
- $itk_component(popup) add separator
- $itk_component(popup) add command \
- -label "Remove from Display" \
- -command [code $this _delete_from_display $rn]
- if {[llength $_register(hidden)] != 0} {
- $itk_component(popup) add command -label "Display all Registers" \
- -command [code $this _display_all]
- }
-
- # Help
- $itk_component(popup) add separator
- $itk_component(popup) add command \
- -label "Help" -command {open_help register.html}
-
- # Close
- $itk_component(popup) add separator
- $itk_component(popup) add command -label "Close" \
- -underline 0 -command [code delete object $this]
-
- tk_popup $itk_component(popup) $X $Y
- }
- }
-}
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_delete_from_display
-# DESCRIPTION: Remove a register from the display
-#
-# ARGUMENTS: rn - the register number to remove
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::_delete_from_display {rn} {
-
- # Mark the cell as hidden
- set index [lsearch $_reg_display_list $rn]
- if {$index != -1} {
- pref setd gdb/reg/[gdb_reginfo name $rn] no
- set _reg_display_list [lreplace $_reg_display_list $index $index]
-
- # Relayout table
- _layout_table
- }
-}
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_display_all
-# DESCRIPTION: Display all registers in the window
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::_display_all {} {
-
- # Unhide all hidden registers
- foreach r $_register(hidden) {
- pref setd gdb/reg/[gdb_reginfo name $r] {}
- }
-
- # Note which register is active and restore it
- if {[catch {$itk_component(table) index active} cell]} {
- set active {}
- } else {
- set active $_register($cell)
- }
- _layout_table
- if {$active != ""} {
- $itk_component(table) activate $_cell($active)
- }
-}
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_edit
-# DESCRIPTION: Enables a cell for editing
-#
-# ARGUMENTS:
-# x - the x coordinate of the button press
-# y - the y coordinate of the button press
-# RETURNS: Nothing
-#
-# NOTES: Event handler for <1> in table.
-#
-# ------------------------------------------------------------------
-itcl::body RegWin::_edit {x y} {
- _select_cell [$itk_component(table) index @$x,$y]
-}
-
-
-# ------------------------------------------------------------------
-# NAME: private method _move
-# DESCRIPTION: Handle arrow key events in table
-#
-# ARGUMENTS: direction - "up", "down", "left", "right"
-# RETURNS: Nothing
-#
-# NOTES: Event handler for <Up>, <Down>, <Left>, <Right>
-# in table. This is needed because the table
-# has some rather strange bindings for moving
-# the insertion cursor when editing a cell.
-# This method will move to the next cell when
-# we're not editing, or it will move the icursor
-# if we are editing.
-# ------------------------------------------------------------------
-itcl::body RegWin::_move {direction} {
-
- debug $direction
-
- # If there is no active cell, the table will call error
- if {[catch {$itk_component(table) index active row} row]} {
- return
- }
-
- if {[$itk_component(table) tag cell edit] != ""} {
- # Editing
-
- switch $direction {
- up {
- # Go to beginning
- $itk_component(table) icursor 0
- }
-
- down {
- # Go to end
- $itk_component(table) icursor end
- }
-
- left {
- # Go left one character
- set ic [$itk_component(table) icursor]
- if {$ic > 0} {
- $itk_component(table) icursor [expr {$ic - 1}]
- }
- }
-
- right {
- # Go right one character
- set ic [$itk_component(table) icursor]
- if {$ic < [$itk_component(table) icursor end] } {
- $itk_component(table) icursor [expr {$ic + 1}]
- }
- }
- }
-
- } else {
- # Not editing
-
- set col [$itk_component(table) index active col]
-
- switch $direction {
- up {
- incr row -1
- if {$row < 0} {
- # go to bottom
- set row $_rows
- }
- }
-
- down {
- incr row 1
- if {$row == $_rows} {
- # go to top
- set row 0
- }
- }
-
- left {
- incr col -2
- if {$col < 0} {
- # go to right
- set col [expr {$_cols -1}]
- }
- }
-
- right {
- incr col 2
- if {$col > $_cols} {
- # go to left
- set col 0
- }
- }
- }
-
- # clear the selection
- # FIXME: multiple selections?
- $itk_component(table) selection clear all
-
- _select_cell $row,$col
- }
-}
-
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_select_cell
-# DESCRIPTION: Selects a given cell in the table
-#
-# ARGUMENTS:
-# cell - the table index to select
-# RETURNS: The actual cell selected
-#
-# NOTES: Adjusts the cell index so that it always
-# selects the value cell for a register
-# ------------------------------------------------------------------
-itcl::body RegWin::_select_cell {cell} {
-
- # Abort an edit
- _unedit
-
- # check if going to label. If so, highlight next
- set row [lindex [split $cell ,] 0]
- set col [lindex [split $cell ,] 1]
- if {[expr {$col % 2}] == 0} {
- # going onto a label
- incr col 1
- }
- set cell "$row,$col"
-
- # Make the selected cell the active one
- $itk_component(table) activate $row,$col
- $itk_component(table) see active
-
- # Select this cell and its label
- # FIXME: multiple selections?
- $itk_component(table) selection clear all
- $itk_component(table) selection set $cell $row,[expr {$col-1}]
-
- # Now mark the cell as being edited.
- if {$::gdb_running && [info exists _register($cell)]} {
- $itk_component(table) tag cell edit $cell
- }
-
- focus $itk_component(table)
-
- return $cell
-}
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_unedit
-# DESCRIPTION: Cancels an edit
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::_unedit {} {
-
- # clear the tag
- set cell [$itk_component(table) tag cell edit]
-
- if {$cell != ""} {
- $itk_component(table) selection clear all
- $itk_component(table) tag cell normal $cell
- focus $itk_component(table)
- }
-}
-
-#
-# Register operations
-#
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_get_value
-# DESCRIPTION: Get the value of a register
-#
-# ARGUMENTS: rn - the register number whose value should be
-# fetched
-# RETURNS: The register's value or ""
-#
-# NOTES:
-# ------------------------------------------------------------------
-itcl::body RegWin::_get_value {rn} {
- if {[catch {gdb_reginfo value $rn} value]} {
- dbug W "\"gdb_reginfo value $rn\" returned $value"
- set value ""
- } else {
- set value [string trim $value \ ]
- }
- return $value
-}
-
-# ------------------------------------------------------------------
-# NAME: private method RegWin::_change_format
-# DESCRIPTION: Change the display format of the register
-#
-# ARGUMENTS: rn - the register number to change
-# newtype - type name (optional if just format changed)
-#
-# RETURNS: Nothing
-#
-# NOTES:
-# ------------------------------------------------------------------
-itcl::body RegWin::_change_format {rn {newtype {}}} {
-
- set name [gdb_reginfo name $rn]
-
- if {$newtype != ""} {
- set _type($rn,name) $newtype
- pref setd gdb/reg/${name}-type $newtype
- }
-
- gdb_reginfo format $rn $_type($rn,addr) $_format($rn)
-
- # Set the new format in prefs.
- pref setd gdb/reg/${name}-format $_format($rn)
-
- _update_register $rn
- _size_cell_column $_cell($rn) 1
-
- # Show the active cell in case it's moved as a result
- # of resizing the columns.
- $itk_component(table) see active
-}
-
-# ------------------------------------------------------------------
-# NAME: private_method RegWin::_update_register
-# DESCRIPTION: Updates the value of a register and refreshes
-# the table
-#
-# ARGUMENTS:
-# rn - the register number to update
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::_update_register {rn} {
- set _data($_cell($rn)) [_get_value $rn]
-}
-
-# ------------------------------------------------------------------
-# NAME: private_method RegWin::_select_group
-# DESCRIPTION: Changes the register group. Callback
-#
-# ARGUMENTS:
-#
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::_select_group {} {
- set gr [$itk_component(frame).opt get]
- debug $gr
- if {$gr == ""} {
- return
- }
-
- # Change anything on the old change list back to normal
- foreach r $_change_list {
- if {[info exists _cell($r)] && $_cell($r) != "hidden"} {
- $itk_component(table) tag cell normal $_cell($r)
- }
- }
-
- set _group $gr
- _layout_table
-
- # highlight changed registers if they still exist in the new group
- foreach r $_change_list {
- if {[info exists _cell($r)] && $_cell($r) != "hidden" && $_data($_cell($r)) != ""} {
- $itk_component(table) tag cell highlight $_cell($r)
- }
- }
-
- # Clear gdb's change list
- catch {gdb_reginfo changed}
-}
-
-
-#
-# Gdb Events
-#
-
-# ------------------------------------------------------------------
-# NAME: public method RegWin::arch_changed
-# DESCRIPTION: ArchChangedEvent handler
-#
-# ARGUMENTS: event - the ArchChangedEvent (not used)
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::arch_changed {event} {
-
- # Update internal register caches
- gdb_reg_arch_changed
-
- # Relayout the table
- _layout_table
-
- # Clear gdb's change list
- catch {gdb_reginfo changed}
-}
-
-# ------------------------------------------------------------------
-# NAME: public method RegWin::busy
-# DESCRIPTION: BusyEvent handler
-#
-# ARGUMENTS: event - the BusyEvent (not used)
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::busy {event} {
-
- # Abort any edit. Need to check if the table is constructed,
- # since we call gdbtk_busy when we're created...
- if {[info exists itk_component(table)]} {
- _unedit
- }
-
- # Set fencepost
- set _running 1
-
- # Set cursor
- $_top configure -cursor watch
-}
-
-# ------------------------------------------------------------------
-# NAME: public method RegWin::idle
-# DESCRIPTION: IdleEvent handler
-#
-# ARGUMENTS: event - the IdleEvent (not used)
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::idle {event} {
-
- # Clear fencepost
- set _running 0
-
- # Reset cursor
- $_top configure -cursor {}
-}
-
-# ------------------------------------------------------------------
-# NAME: public method RegWin::set_variable
-# DESCRIPTION: SetVariableEvent handler
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::set_variable {event} {
- switch [$event get variable] {
- disassembly-flavor {
- _layout_table
- }
- }
-}
-
-# ------------------------------------------------------------------
-# NAME: public method RegWin::update
-# DESCRIPTION: UpdateEvent handler
-#
-# ARGUMENTS: event - the UpdateEvent (not used)
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-itcl::body RegWin::update {event} {
- debug
-
- # Change anything on the old change list back to normal
- foreach r $_change_list {
- if {[info exists _cell($r)] && $_cell($r) != "hidden"} {
- $itk_component(table) tag cell normal $_cell($r)
- }
- }
-
- # Now update and highlight the newly changed values
- set _change_list {}
- if {![catch {gdb_reginfo changed $_reg_display_list} changed]} {
- set _change_list $changed
- }
-
- # Problem: if the register was invalid (i.e, we were not running),
- # its old value will probably be "0x0". Now if we run and its real
- # value is "0x0", then it will appear as a blank in the register
- # window. Safegaurd against that here by adding any such register
- # which is not already in the change list.
- foreach r $_reg_display_list {
- if {$_data($_cell($r)) == "" && [lsearch $_change_list $r] == -1} {
- lappend _change_list $r
- }
- }
-
- # Tag the changed cells and resize the columns
- set cols {}
- foreach r $_change_list {
- _update_register $r
-
- if {$_data($_cell($r)) != ""} {
- $itk_component(table) tag cell highlight $_cell($r)
- }
- set col [lindex [split $_cell($r) ,] 1]
- if {[lsearch $cols $col] == -1} {
- lappend cols $col
- }
- }
-
- foreach col $cols {
- set col [string trim $col ()]
- _size_column $col 0
- }
-
- debug "END REGISTER UPDATE CALLBACK"
-}
diff --git a/gdb/gdbtk/library/regwin.ith b/gdb/gdbtk/library/regwin.ith
deleted file mode 100644
index 4a7faf81125..00000000000
--- a/gdb/gdbtk/library/regwin.ith
+++ /dev/null
@@ -1,103 +0,0 @@
-# Register display window class definition for Insight.
-# Copyright (C) 1998, 1999, 2001 Red Hat, Inc.
-#
-# Written by Keith Seitz (keiths@redhat.com)
-# based on work by Martin Hunt (hunt@redhat.com)
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class RegWin {
- inherit EmbeddedWin GDBWin
-
- private {
- variable _change_list {}
- variable _menuitems
-
- # Display data for the table
- variable _data
-
- # Mapping of table cell index to register number
- variable _register
-
- # the register group that is displayed
- variable _group "all"
-
- # Mapping of register number to table cell index. "hidden" if
- # the register was "removed" from the display.
- variable _cell
-
- # Is REGNUM editable?
- variable _editable
-
- # List of possible display types for the registers (indexed by regnum)
- variable _types
- # The display type to use for each register (indexed by regnum)
- variable _type
- # The display format to use for each register (indexed by regnum)
- variable _format
-
- # The list of registers we're displaying
- variable _reg_display_list {}
-
- # Size of columns
- variable _col_size
- variable _max_label_width
-
- # Dimensions
- variable _rows
- variable _cols
-
- # Fencepost
- variable _running 0
-
-
- # Table layout/display methods
- method _build_win {}
- method _layout_table {}
- method _load_prefs {}
- method _size_cell_column {cell down}
- method _size_column {col down}
-
- # Table event handlers and related methods
- method _accept_edit {}
- method _add_to_watch {rn}
- method _but3 {x y X Y}
- method _delete_from_display {rn}
- method _display_all {}
- method _edit {x y}
- method _move {direction}
- method _open_memory {rn}
- method _select_group {}
- method _select_cell {cell}
- method _unedit {}
-
- # Register operations
- method _get_value {rn}
- method _change_format {rn {t {}}}
- method _update_register {rn}
- }
-
- public {
- method constructor {args}
- method destructor {}
-
- #
- # Gdb Events
- #
- method busy {event}
- method idle {event}
- method set_variable {event}
- method update {event}
- method arch_changed {event}
- method reconfig {}
- }
-}
diff --git a/gdb/gdbtk/library/session.tcl b/gdb/gdbtk/library/session.tcl
deleted file mode 100644
index e73978052a0..00000000000
--- a/gdb/gdbtk/library/session.tcl
+++ /dev/null
@@ -1,335 +0,0 @@
-# Local preferences functions for Insight.
-# Copyright (C) 2000, 2001, 2002, 2004, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-namespace eval Session {
- namespace export save load notice_file_change delete list_names
-
- # An internal function for canonicalizing path names. This probably
- # should use `realpath', but that is more work. So for now we neglect
- # the possibility of symlinks.
- proc _exe_name {path} {
-
- # Get real directory.
- if {[string compare $::gdbtk_platform(os) "cygwin"] == 0} {
- set path [ide_cygwin_path to_win32 $path]
- }
- set save [pwd]
- cd [file dirname $path]
- set dir [pwd]
- cd $save
- return [file join $dir [file tail $path]]
- }
-
- # An internal function used when saving sessions. Returns a string
- # that can be used to recreate all pertinent breakpoint state.
- proc _serialize_bps {} {
- set result {}
-
- # HACK. When debugging gdb with itself in the build
- # directory, there is a ".gdbinit" file that will set
- # breakpoints on internal_error() and info_command().
- # If we then save and set them, they will accumulate.
- # Possible fixes are to modify GDB so we can tell which
- # breakpoints were set from .gdbinit, or modify
- # _recreate_bps to record which breakpoints were
- # set before it was called. For now, we simply detect the
- # most common case and fix it.
- set basename [string tolower [file tail $::gdb_exe_name]]
- if {[string match "gdb*" $basename]
- || [string match "insight*" $basename]} {
- set debugging_gdb 1
- } else {
- set debugging_gdb 0
- }
-
- foreach bp_num [gdb_get_breakpoint_list] {
- lassign [gdb_get_breakpoint_info $bp_num] file function line_number \
- address type enabled disposition ignore_count command_list \
- condition thread hit_count user_specification
-
- # These breakpoints are set when debugging GDB with itself.
- # Ignore them so they don't accumulate. They get set again
- # by .gdbinit anyway.
- if {$debugging_gdb} {
- if {$function == "internal_error" || $function == "info_command"} {
- continue
- }
- }
-
- switch -glob -- $type {
- "breakpoint" -
- "hw breakpoint" {
- if {$disposition == "delete"} {
- set cmd tbreak
- } else {
- set cmd break
- }
-
- append cmd " "
- if {$user_specification != ""} {
- append cmd "$user_specification"
- } elseif {$file != ""} {
- # BpWin::bp_store uses file tail here, but I think that is
- # wrong.
- append cmd "$file:$line_number"
- } else {
- append cmd "*$address"
- }
- }
- "watchpoint" -
- "hw watchpoint" {
- set cmd watch
- if {$user_specification != ""} {
- append cmd " $user_specification"
- } else {
- # There's nothing sensible to do.
- continue
- }
- }
-
- "catch*" {
- # FIXME: Don't know what to do.
- continue
- }
-
- default {
- # Can't serialize anything other than those listed above.
- continue
- }
- }
-
- lappend result [list $cmd $enabled $condition $command_list]
- }
-
- return $result
- }
-
- # An internal function used when loading sessions. It takes a
- # breakpoint string and recreates all the breakpoints.
- proc _recreate_bps {specs} {
- foreach spec $specs {
- lassign $spec create enabled condition commands
-
- # Create the breakpoint
- if {[catch {gdb_cmd $create} txt]} {
- dbug W $txt
- }
-
- # Below we use `\$bpnum'. This means we don't have to figure out
- # the number of the breakpoint when doing further manipulations.
-
- if {! $enabled} {
- gdb_cmd "disable \$bpnum"
- }
-
- if {$condition != ""} {
- gdb_cmd "cond \$bpnum $condition"
- }
-
- if {[llength $commands]} {
- lappend commands end
- eval gdb_run_readline_command_no_output [list "commands \$bpnum"] \
- $commands
- }
- }
- }
-
- #
- # This procedure decides what makes up a gdb `session'. Roughly a
- # session is whatever the user found useful when debugging a certain
- # executable.
- #
- # Eventually we should expand this procedure to know how to save
- # window placement and contents. That requires more work.
- #
- proc save {} {
- global gdb_exe_name gdb_target_name
- global gdb_current_directory gdb_source_path
-
- # gdb sessions are named after the executable.
- set name [_exe_name $gdb_exe_name]
- set key gdb/session/$name
-
- # We fill a hash and then use that to set the actual preferences.
-
- # Always set the exe. name in case we later decide to change the
- # interpretation of the session key. Use the full path to the
- # executable.
- set values(executable) $name
-
- # Some simple state the user wants.
- set values(args) [gdb_get_inferior_args]
- set values(dirs) $gdb_source_path
- set values(pwd) $gdb_current_directory
- set values(target) $gdb_target_name
- set values(hostname) [pref getd gdb/load/$gdb_target_name-hostname]
- set values(port) [pref getd gdb/load/$gdb_target_name-portname]
- set values(target_cmd) $::gdb_target_cmd
- set values(bg) $::gdb_bg_num
-
- # these prefs need to be made session-dependent
- set values(run_attach) [pref get gdb/src/run_attach]
- set values(run_load) [pref get gdb/src/run_load]
- set values(run_run) [pref get gdb/src/run_run]
- set values(run_cont) [pref get gdb/src/run_cont]
-
- # Breakpoints.
- set values(breakpoints) [_serialize_bps]
-
- # Recompute list of recent sessions. Trim to no more than 20 sessions.
- set recent [concat [list $name] \
- [lremove [pref getd gdb/recent-projects] $name]]
- if {[llength $recent] > 20} {
- set recent [lreplace $recent 20 end]
- }
- pref setd gdb/recent-projects $recent
-
- foreach k [array names values] {
- pref setd $key/$k $values($k)
- }
- pref setd $key/all-keys [array names values]
- }
-
- #
- # Load a session saved with Session::save. NAME is the pretty name of
- # the session, as returned by Session::list_names.
- #
- proc load {name} {
- # gdb sessions are named after the executable.
- set key gdb/session/$name
-
- # Fetch all keys for this session into an array.
- foreach k [pref getd $key/all-keys] {
- set values($k) [pref getd $key/$k]
- }
-
- if {[info exists values(executable)]} {
- gdb_clear_file
- set_exe_name $values(executable)
- set_exe
- }
- }
-
- #
- # This is called from file_changed_hook. It does all the work of
- # loading a session, if one exists with the same name as the current
- # executable.
- #
- proc notice_file_change {} {
- global gdb_exe_name gdb_target_name
-
- debug "noticed file change event for $gdb_exe_name"
-
- # gdb sessions are named after the executable.
- set name [_exe_name $gdb_exe_name]
- set key gdb/session/$name
-
- # Fetch all keys for this session into an array.
- foreach k [pref getd $key/all-keys] {
- set values($k) [pref getd $key/$k]
- }
-
- # reset these back to their defaults
- pref set gdb/src/run_attach 0
- pref set gdb/src/run_load 0
- pref set gdb/src/run_run 1
- pref set gdb/src/run_cont 0
-
- if {! [info exists values(executable)] || $values(executable) != $name} {
- # No such session.
- return
- }
-
- debug "reloading session for $name"
-
- if {[info exists values(dirs)]} {
- # FIXME: short-circuit confirmation.
- gdb_cmd "directory"
- gdb_cmd "directory $values(dirs)"
- }
-
- if {[info exists values(pwd)]} {
- catch {gdb_cmd "cd $values(pwd)"}
- }
-
- if {[info exists values(args)]} {
- gdb_set_inferior_args $values(args)
- }
-
- if {[info exists values(breakpoints)]} {
- _recreate_bps $values(breakpoints)
- }
-
- if {[info exists values(target)]} {
- #debug "Restoring Target: $values(target)"
- set gdb_target_name $values(target)
-
- if {[info exists values(hostname)]} {
- pref setd gdb/load/$gdb_target_name-hostname $values(hostname)
- #debug "Restoring Hostname: $values(hostname)"
- }
-
- if {[info exists values(port)]} {
- pref setd gdb/load/$gdb_target_name-portname $values(port)
- #debug "Restoring Port: $values(port)"
- }
-
- #debug "Restoring Target_Cmd: $values(target_cmd)"
- set ::gdb_target_cmd $values(target_cmd)
- set_baud
- }
-
- if {[info exists values(run_attach)]} {
- pref set gdb/src/run_attach $values(run_attach)
- pref set gdb/src/run_load $values(run_load)
- pref set gdb/src/run_run $values(run_run)
- pref set gdb/src/run_cont $values(run_cont)
- }
-
- if {[info exists values(bg)] && [pref get gdb/use_color_schemes]} {
- set_bg_colors $values(bg)
- }
- }
-
- #
- # Delete a session. NAME is the internal name of the session.
- #
- proc delete {name} {
- # FIXME: we can't yet fully define this because the libgui
- # preference code doesn't supply a delete method.
- set recent [lremove [pref getd gdb/recent-projects] $name]
- pref setd gdb/recent-projects $recent
- }
-
- #
- # Return a list of all known sessions. This returns the `pretty name'
- # of the session -- something suitable for a menu.
- #
- proc list_names {} {
- set newlist {}
- set result {}
- foreach name [pref getd gdb/recent-projects] {
- set exe [pref getd gdb/session/$name/executable]
- # Take this opportunity to prune the list.
- if {[file exists $exe]} then {
- lappend newlist $name
- lappend result $exe
- } else {
- # FIXME: if we could delete keys we would delete all keys
- # associated with NAME now.
- }
- }
- pref setd gdb/recent-projects $newlist
- return $result
- }
-}
diff --git a/gdb/gdbtk/library/srcbar.itcl b/gdb/gdbtk/library/srcbar.itcl
deleted file mode 100644
index a8fa71788a2..00000000000
--- a/gdb/gdbtk/library/srcbar.itcl
+++ /dev/null
@@ -1,1245 +0,0 @@
-# SrcBar
-# Copyright (C) 2001, 2002, 2004, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ----------------------------------------------------------------------
-# Implements a menu and a toolbar that are attached to a source window.
-#
-# PUBLIC ATTRIBUTES:
-#
-#
-# METHODS:
-#
-# configure ....... used to change public attributes
-#
-# PRIVATE METHODS
-#
-# X11 OPTION DATABASE ATTRIBUTES
-#
-#
-# ----------------------------------------------------------------------
-
-itcl::class SrcBar {
- inherit itk::Widget GDBEventHandler
-
- # ------------------------------------------------------------------
- # CONSTRUCTOR - create widget
- # ------------------------------------------------------------------
- constructor {src args} {
- set source $src
-
- # Load the images to be used in toolbar buttons
- _load_images
- _load_src_images
-
- # Create a menu widget for the Source Window
- set Menu [GDBMenuBar $itk_interior.menubar]
-
- # Fill it with the initial set of entries
- if {! [create_menu_items]} {
- destroy $this
- } else {
- # We do not pack the menu, but make it the menu of the toplevel window
- $Menu show
- }
-
- # Create a toolbar widget for the Source Window
- set Tool [GDBToolBar $itk_interior.toolbar]
-
- # Now create the Source Window initial set of toolbar buttons
- # First give the necessary info about each button and their position
- create_buttons
- # Then effectively create the tollbar widget
- $Tool show
-
- # Pack the toolbar
- pack $Tool -expand 1 -fill both
-
- # Set the srcbar's initial state
- enable_ui 2
-
- eval itk_initialize $args
- add_hook gdb_no_inferior_hook "$this enable_ui 2"
- add_hook gdb_trace_find_hook "$this handle_trace_find_hook"
- }
-
- # ------------------------------------------------------------------
- # DESTRUCTOR - destroy window containing widget
- # ------------------------------------------------------------------
- destructor {
- global GDBSrcBar_state
-
- unset GDBSrcBar_state($this)
- remove_hook gdb_no_inferior_hook "$this enable_ui 2"
- remove_hook gdb_trace_find_hook "$this handle_trace_find_hook"
-
- #destroy $this
- }
-
- # ------------------------------------------------------------------
- # NAME: private method SrcBar::_post
- # DESCRIPTION: Post the given menu
- #
- # ARGUMENTS:
- # what - which menu to post
- # RETURNS: Nothing
- # ------------------------------------------------------------------
- private method _post {what} {
-
- switch $what {
- file {
- _update_file_menu
- }
- }
- }
-
-
- ####################################################################
- # The next set of functions create the common menu groupings that
- # are used in gdb menus.
- # Private. Used at contruction time.
- # These were previously at the GDBToolBar...
- ####################################################################
-
- # ------------------------------------------------------------------
- # METHOD: create_menu_items - Add some menu items to the menubar.
- # Returns 1 if any items added.
- # ------------------------------------------------------------------
- private method create_menu_items {} {
-
- create_file_menu
-
- create_run_menu
-
- create_view_menu
-
- if {[pref get gdb/control_target]} {
- create_control_menu
- }
-
- if {[pref get gdb/mode]} {
- create_trace_menu
- }
-
- create_plugin_menu
-
- create_pref_menu
-
- create_help_menu
-
- return 1
- }
-
- # ------------------------------------------------------------------
- # PRIVATE METHOD: _update_file_menu - update the file menu
- # Used really only to update the session list.
- # ------------------------------------------------------------------
- private method _update_file_menu {} {
- global enable_external_editor gdbtk_platform gdb_exe_name
-
- # Clear the File menu
- $Menu clear file
-
- if {[info exists enable_external_editor] && $enable_external_editor} {
- $Menu add command None "Edit Source" \
- [code $source edit]
- }
-
- $Menu add command Other "Open..." \
- "_open_file" -underline 0 -accelerator "Ctrl+O"
-
- if {$gdb_exe_name == ""} {
- set state disabled
- } else {
- set state normal
- }
- $Menu add command Other "Close" \
- "_close_file" -underline 0 -accelerator "Ctrl+W" -state $state
-
- $Menu add command Other "Source..." \
- "source_file" -underline 0
-
- set sessions [Session::list_names]
- if {[llength $sessions]} {
- $Menu add separator
- set i 1
- foreach item $sessions {
- $Menu add command Other "$i $item" \
- [list Session::load $item] \
- -underline 0
- incr i
- }
- }
-
- $Menu add separator
-
- if {$gdbtk_platform(platform) == "windows"} {
- $Menu add command None "Page Setup..." \
- [format {
- set top %s
- ide_winprint page_setup -parent $top
- } [winfo toplevel [namespace tail $this]]] \
- -underline 8
- }
-
- $Menu add command None "Print Source..." \
- [code $source print] \
- -underline 0 -accelerator "Ctrl+P"
-
- $Menu add separator
-
- $Menu add command Other "Target Settings..." \
- "set_target_name" -underline 0
-
- $Menu add separator
-
- $Menu add command None "Exit" gdbtk_quit -underline 1
- }
-
- # ------------------------------------------------------------------
- # METHOD: create_file_menu - Creates the standard file menu.
- # ------------------------------------------------------------------
-
- private method create_file_menu {} {
-
- $Menu add menubutton file "File" 0 -postcommand [code $this _post file]
- _update_file_menu
- }
-
- # ------------------------------------------------------------------
- # METHOD: create_run_menu - Creates the standard run menu,
- # or reconfigures it if it already exists.
- # ------------------------------------------------------------------
-
- private method create_run_menu {} {
-
- if {![$Menu exists Run]} {
- set run_menu [$Menu add menubutton run "Run" 0]
- } else {
- set run_menu [$Menu clear Run]
- }
-
- set is_native [TargetSelection::native_debugging]
-
- # If we are on a Unix target, put in the attach options. "ps" doesn't
- # give me the Windows PID yet, and the attach also seems flakey, so
- # I will hold off on the Windows implementation for now.
-
- if {$is_native} {
- if {[string compare $::gdbtk_platform(platform) windows] != 0} {
- $Menu add command Attach "Attach to process" \
- [code $this do_attach $run_menu] \
- -underline 0 -accelerator "Ctrl+A"
- }
- } else {
- $Menu add command Other "Connect to target" \
- "$this do_connect $run_menu" -underline 0
- }
-
- if {[pref get gdb/control_target]} {
- if {!$is_native} {
- $Menu add command Other "Download" Download::download_it \
- -underline 0 -accelerator "Ctrl+D"
- }
- $Menu add command Other "Run" [code $source inferior run] \
- -underline 0 -accelerator R
- }
-
- if {$is_native} {
- if {[string compare $::gdbtk_platform(platform) windows] != 0} {
- $Menu add command Detach "Detach" \
- [code $this do_detach $run_menu] \
- -underline 0 -state disabled
- }
- } else {
- $Menu add command Other "Disconnect" \
- [code $this do_disconnect $run_menu] -underline 0 -state disabled
- }
-
- if {$is_native} {
- $Menu add separator
- $Menu add command Control "Kill" \
- [code $this do_kill $run_menu] \
- -underline 0 -state disabled
- }
-
- if { [pref get gdb/mode] } {
- $Menu add separator
-
- $Menu add command Other "Start collection" "$this do_tstop" \
- -underline 0 -accelerator "Ctrl+B"
-
- $Menu add command Other "Stop collection" "$this do_tstop" \
- -underline 0 -accelerator "Ctrl+E" -state disabled
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: create_view_menu - Creates the standard view menu
- # ------------------------------------------------------------------
-
- private method create_view_menu {} {
-
- $Menu add menubutton view "View" 0
-
- $Menu add command Other "Stack" {ManagedWin::open StackWin} \
- -underline 0 -accelerator "Ctrl+S"
-
- $Menu add command Other "Registers" {ManagedWin::open RegWin} \
- -underline 0 -accelerator "Ctrl+R"
-
- $Menu add command Other "Memory" {ManagedWin::open MemWin} \
- -underline 0 -accelerator "Ctrl+M"
-
- $Menu add command Other "Watch Expressions" \
- {ManagedWin::open WatchWin} \
- -underline 0 -accelerator "Ctrl+T"
- $Menu add command Other "Local Variables" \
- {ManagedWin::open LocalsWin} \
- -underline 0 -accelerator "Ctrl+L"
-
- if {[pref get gdb/control_target]} {
- $Menu add command Other "Breakpoints" \
- {ManagedWin::open BpWin -tracepoints 0} \
- -underline 0 -accelerator "Ctrl+B"
- }
-
- if {[pref get gdb/mode]} {
- $Menu add command Other "Tracepoints" \
- {ManagedWin::open BpWin -tracepoints 1} \
- -underline 0 -accelerator "Ctrl+T"
- $Menu add command Other "Tdump" {ManagedWin::open TdumpWin} \
- -underline 2 -accelerator "Ctrl+U"
- }
-
- $Menu add command Other "Console" {ManagedWin::open Console} \
- -underline 2 -accelerator "Ctrl+N"
-
- $Menu add command Other "Function Browser" \
- {ManagedWin::open BrowserWin} \
- -underline 1 -accelerator "Ctrl+F"
- $Menu add command Other "Thread List" \
- {ManagedWin::open ProcessWin} \
- -underline 0 -accelerator "Ctrl+H"
- if {[info exists ::env(GDBTK_DEBUG)] && $::env(GDBTK_DEBUG)} {
- $Menu add separator
- $Menu add command Other "Debug Window" \
- {ManagedWin::open DebugWin} \
- -underline 3 -accelerator "Ctrl+U"
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: create_control_menu - Creates the standard control menu
- # ------------------------------------------------------------------
-
- private method create_control_menu {} {
-
- $Menu add menubutton cntrl "Control" 0
-
- $Menu add command Control "Step" [code $source inferior step] \
- -underline 0 -accelerator S
-
- $Menu add command Control "Next" [code $source inferior next] \
- -underline 0 -accelerator N
-
- $Menu add command Control "Finish" \
- [code $source inferior finish] \
- -underline 0 -accelerator F
-
- $Menu add command Control "Continue" \
- [code $source inferior continue] \
- -underline 0 -accelerator C
-
- $Menu add separator
- $Menu add command Control "Step Asm Inst" \
- [code $source inferior stepi] \
- -underline 1 -accelerator S
-
- $Menu add command Control "Next Asm Inst" \
- [code $source inferior nexti] \
- -underline 1 -accelerator N
-
- # $Menu add separator
- # $Menu add command Other "Automatic Step" auto_step
- }
-
- # ------------------------------------------------------------------
- # METHOD: create_trace_menu - Creates the standard trace menu
- # ------------------------------------------------------------------
-
- private method create_trace_menu {} {
-
- $Menu add menubutton trace "Trace" 0
-
- $Menu add command Other "Save Trace Commands..." \
- "save_trace_commands" \
- -underline 0
-
- $Menu add separator
-
- $Menu add command Trace "Next Hit" {tfind_cmd tfind} \
- -underline 0 -accelerator N
-
- $Menu add command Trace "Previous Hit" {tfind_cmd "tfind -"} \
- -underline 0 -accelerator P
-
- $Menu add command Trace "First Hit" {tfind_cmd "tfind start"} \
- -underline 0 -accelerator F
-
- $Menu add command Trace "Next Line Hit" \
- {tfind_cmd "tfind line"} \
- -underline 5 -accelerator L
-
- $Menu add command Trace "Next Hit Here" \
- {tfind_cmd "tfind tracepoint"} \
- -underline 9 -accelerator H
-
- $Menu add separator
- $Menu add command Trace "Tfind Line..." \
- "ManagedWin::open TfindArgs -Type LN" \
- -underline 9 -accelerator E
-
- $Menu add command Trace "Tfind PC..." \
- "ManagedWin::open TfindArgs -Type PC" \
- -underline 7 -accelerator C
-
- $Menu add command Trace "Tfind Tracepoint..." \
- "ManagedWin::open TfindArgs -Type TP" \
- -underline 6 -accelerator T
-
- $Menu add command Trace "Tfind Frame..." \
- "ManagedWin::open TfindArgs -Type FR" \
- -underline 6 -accelerator F
- }
-
- # ------------------------------------------------------------------
- # METHOD: create_plugin_menu - Creates the optional plugin menu
- # ------------------------------------------------------------------
- private method create_plugin_menu {} {
- global gdb_plugins
-
- $Menu add menubutton plugin "PlugIn" 4
- set plugins_available 0
- foreach plugin_dir $gdb_plugins {
- if {[catch {source [file join $plugin_dir plugins.tcl]} txt]} {
- dbug E $txt
- }
- }
-
- if {! $plugins_available} {
- # No plugins are available for this configuration,
- # so remove the menu
- debug "No plugins configured, go remove the PlugIn menu..."
- $Menu delete plugin
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: create_pref_menu - Creates the standard preferences menu
- # ------------------------------------------------------------------
- private method create_pref_menu {} {
-
- $Menu add menubutton pref "Preferences" 0
-
- $Menu add command Other "Global..." \
- "ManagedWin::open GlobalPref -transient" -underline 0
-
- $Menu add command Other "Source..." \
- "ManagedWin::open SrcPref -transient" -underline 0
-
- set save_menu [$Menu menubar_get_current_menu]
-
- set advanced_menu [$Menu add cascade adv Advanced "Advanced" 0]
-
- $advanced_menu add command -label "Edit Color Schemes..." -underline 0 \
- -command "ManagedWin::open CSPref -transient" -underline 0
-
- $advanced_menu add command -label "IPC Support..." -underline 0 \
- -command "ManagedWin::open IPCPref -transient" -underline 0
-
- $Menu menubar_set_current_menu $save_menu
-
- $Menu add separator
-
- set color_menu [$Menu add cascade use_cs Color "Use Color Scheme" 0]
- for {set i 0} {$i < 16} {incr i} {
- set dbg [recolor [pref get gdb/bg/$i] 80]
- $color_menu add command -label $i -background [pref get gdb/bg/$i] \
- -activebackground $dbg -command "set_bg_colors $i" -underline 0
- }
-
- if {[pref get gdb/use_color_schemes] == "1"} {
- set cs_state normal
- } else {
- set cs_state disabled
- }
- $Menu set_class_state "Color $cs_state"
- }
-
- # ------------------------------------------------------------------
- # METHOD: create_help_menu - Creates the standard help menu
- # ------------------------------------------------------------------
- private method create_help_menu {} {
- # KDE and GNOME like the help menu to be the last item in the menubar.
- # The default Unix behavior is to be at the far right of the menubar.
- set os [pref get gdb/compat]
- if {$os == "KDE" || $os == "GNOME"} {
- set helpmenu "_help"
- } else {
- set helpmenu "help"
- }
- $Menu add menubutton $helpmenu "Help" 0
- $Menu add command Other "Help Topics" {open_help index.html} \
- -underline 0
- $Menu add separator
- $Menu add command Other "About GDB..." \
- {ManagedWin::open About -transient} \
- -underline 0
- }
-
- ####################################################################
- # The next set of functions are the generic button groups that gdb uses.
- # Private. Used at contruction time.
- # These were previously at the GDBToolBar...
- ####################################################################
-
- # ------------------------------------------------------------------
- # METHOD: create_buttons - Add some buttons to the toolbar.
- # Returns list of buttons in form acceptable
- # to standard_toolbar.
- # ------------------------------------------------------------------
- private method create_buttons {} {
- global enable_external_editor
-
- $Tool add button stop None {} {}
- _set_runstop
-
- if {[pref get gdb/mode]} {
- $Tool add button tstop Control \
- [list $this do_tstop] "Start Collection" \
- -image Movie_on_img
-
- $Tool add button view Other [list $this set_control_mode 1] \
- "Switch to Browse Mode" -image watch_movie_img
-
- $Tool add separator
-
- }
-
- if {[pref get gdb/control_target]} {
- create_control_buttons
- if {[pref get gdb/mode]} {
- create_trace_buttons 0
- }
- } elseif {[get pref gdb/mode]} {
-
- #
- # If we don't control the target, then we might as well
- # put a copy of the trace controls on the source window.
- #
- create_trace_buttons 1
- }
-
- $Tool add separator
-
- create_window_buttons
-
- # Random bits of obscurity...
- $Tool itembind reg <Button-3> "ManagedWin::open RegWin -force"
- $Tool itembind mem <Button-3> "ManagedWin::open MemWin -force"
- $Tool itembind watch <Button-3> \
- "ManagedWin::open WatchWin -force"
- $Tool itembind vars <Button-3> \
- "ManagedWin::open LocalsWin -force"
-
- $Tool add separator
-
- if {[info exists enable_external_editor] && $enable_external_editor} {
- $Tool add button edit Other [code $source edit] "Edit Source" \
- -image edit_img
-
- $Tool add separator
- }
-
- # Add find in file entry box.
- $Tool add label findlabel "Find:" "" -anchor e -font global/fixed
- $Tool add custom searchbox entry "Search in editor" \
- -bd 3 -font global/fixed -width 10
-
- set callback [code $source search]
- $Tool itembind searchbox <Return> \
- "$callback forwards \[eval %W get\]"
- $Tool itembind searchbox <Shift-Return> \
- "$callback backwards \[eval %W get\]"
-
- $Tool add separator
-
- $Tool toolbar_button_right_justify
-
- create_stack_buttons
-
- # This feature has been disabled for now.
- # checkbutton $ButtonFrame.upd -command "$this _toggle_updates" \
- # -variable GDBSrcBar_state($this)
- # lappend button_list $ButtonFrame.upd
- # global GDBSrcBar_state
- # ::set GDBSrcBar_state($this) $updatevalue
- # balloon register $ButtonFrame.upd "Toggle Window Updates"
- }
-
- # ------------------------------------------------------------------
- # METHOD: create_control_buttons - Creates the step, continue, etc buttons.
- # ------------------------------------------------------------------
-
- private method create_control_buttons {} {
- $Tool add button step Control [code $source inferior step] \
- "Step (S)" -image step_img
-
- $Tool add button next Control [code $source inferior next] \
- "Next (N)" -image next_img
-
- $Tool add button finish Control [code $source inferior finish] \
- "Finish (F)" -image finish_img
-
- $Tool add button continue Control [code $source inferior continue] \
- "Continue (C)" -image continue_img
-
- # A spacer before the assembly-level items looks good. It helps
- # to indicate that these are somehow different.
- $Tool add separator
-
- $Tool add button stepi Control [code $source inferior stepi] \
- "Step Asm Inst (S)" -image stepi_img
-
- $Tool add button nexti Control [code $source inferior nexti] \
- "Next Asm Inst (N)" -image nexti_img
-
- _set_stepi
-
- set Run_control_buttons {step next finish continue -stepi nexti}
-
- }
-
- # ------------------------------------------------------------------
- # METHOD: create_trace_buttons - Creates the next hit, etc.
- # ------------------------------------------------------------------
-
- private method create_trace_buttons {{show 0}} {
-
- if {$show} {
- set command "add button"
- } else {
- set command "create"
- }
-
- $Tool $command tfindstart Trace {tfind_cmd "tfind start"} "First Hit <F>" \
- -image rewind_img
-
- $Tool $command tfind Trace {tfind_cmd tfind} "Next Hit <N>" -image next_hit_img
-
- $Tool $command tfindprev Trace {tfind_cmd "tfind -"} "Previous Hit <P>" \
- -image prev_hit_img
-
- $Tool $command tfindline Trace {tfind_cmd "tfind line"} "Next Line Hit <L>" \
- -image next_line_img
-
- $Tool $command tfindtp Trace { tfind_cmd "tfind tracepoint"} \
- "Next Hit Here <H>" -image next_check_img
-
- set Trace_control_buttons {tfindstart tfind tfindprev tfindline tfindtp}
- }
-
- # ------------------------------------------------------------------
- # METHOD: create_window_buttons - Creates the registers, etc, buttons
- # ------------------------------------------------------------------
-
- private method create_window_buttons {} {
- $Tool add button reg Other {ManagedWin::open RegWin} \
- "Registers (Ctrl+R)" -image reg_img
-
- $Tool add button mem Other {ManagedWin::open MemWin} \
- "Memory (Ctrl+M)" -image memory_img
-
- $Tool add button stack Other {ManagedWin::open StackWin} \
- "Stack (Ctrl+S)" -image stack_img
-
- $Tool add button watch Other {ManagedWin::open WatchWin} \
- "Watch Expressions (Ctrl+W)" -image watch_img
-
- $Tool add button vars Other {ManagedWin::open LocalsWin} \
- "Local Variables (Ctrl+L)" -image vars_img
-
- if {[pref get gdb/control_target]} {
- $Tool add button bp Other {ManagedWin::open BpWin} \
- "Breakpoints (Ctrl+B)" -image bp_img
- }
-
- if {[pref get gdb/mode]} {
- $Tool add button tp Other \
- {ManagedWin::open BpWin -tracepoints 1} \
- "Tracepoints (Ctrl+T)" -image tp_img
-
- $Tool add button tdump Trace {ManagedWin::open TdumpWin} \
- "Tdump (Ctrl+D)" -image tdump_img
- }
-
- $Tool add button con Other {ManagedWin::open Console} \
- "Console (Ctrl+N)" -image console_img
- }
-
- # ------------------------------------------------------------------
- # METHOD: create_stack_buttons - Creates the up down bottom stack buttons
- # ------------------------------------------------------------------
-
- private method create_stack_buttons {} {
-
- $Tool add button down {Trace Control} \
- [code $source stack down] \
- "Down Stack Frame" -image down_img
-
- $Tool add button up {Trace Control} \
- [code $source stack up] \
- "Up Stack Frame" -image up_img
-
- $Tool add button bottom {Trace Control} \
- [code $source stack bottom] \
- "Go to Bottom of Stack" -image bottom_img
-
- }
-
- ####################################################################
- #
- # Auxiliary methods used by the toolbar
- #
- ####################################################################
-
- # ------------------------------------------------------------------
- # METHOD: _load_images - Load standard images. Private method.
- # ------------------------------------------------------------------
- public method _load_images { {reconfig 0} } {
- global gdb_ImageDir
- if {!$reconfig && $_loaded_images} {
- return
- }
- set _loaded_images 1
-
- lappend imgs console reg stack vars watch memory bp
- foreach name $imgs {
- image create photo ${name}_img -file [file join $gdb_ImageDir ${name}.gif]
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: _load_src_images - Load standard images. Private method.
- # ------------------------------------------------------------------
- method _load_src_images { {reconf 0} } {
- global gdb_ImageDir
-
- if {!$reconf && $_loaded_src_images} {
- return
- }
- set _loaded_src_images 1
-
- foreach name {run stop step next finish continue edit \
- stepi nexti up down bottom Movie_on Movie_off \
- next_line next_check next_hit rewind prev_hit \
- watch_movie run_expt tdump tp} {
- image create photo ${name}_img -file [file join $gdb_ImageDir ${name}.gif]
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: _set_runstop - Set state of run/stop button.
- #
- # busy - Run button becomes disabled
- # running - Stop button appears, allowing user to stop executing target
- # downloading - Stop button appears, allowing user to interrupt downloading
- # normal - Run button appears, allowing user to run/re-run exe
- # ------------------------------------------------------------------
- public method _set_runstop {} {
- dbug I $runstop
-
- switch $runstop {
- busy {
- $Tool itemconfigure stop -state disabled
- }
- downloading {
- $Tool itemconfigure stop -state normal -image stop_img \
- -command [code $this cancel_download]
- $Tool itemballoon stop "Stop"
- }
- running {
- $Tool itemconfigure stop -state normal -image stop_img \
- -command [code $source inferior stop]
- $Tool itemballoon stop "Stop"
- }
- normal {
- $Tool itemconfigure stop -state normal -image run_img \
- -command [code $source inferior run]
- $Tool itemballoon stop "Run (R)"
- }
- default {
- dbug W "unknown state $runstop"
- }
- }
- }
-
-
- # ------------------------------------------------------------------
- # METHOD: _set_stepi - Set state of stepi/nexti buttons.
- # ------------------------------------------------------------------
- public method _set_stepi {} {
-
- # Only do this in synchronous mode
- if {!$Tracing} {
- # In source-only mode, disable these buttons. Otherwise, enable
- # them.
- if {$displaymode == "SOURCE"} {
- set state disabled
- } else {
- set state normal
- }
- $Tool itemconfigure stepi -state $state
- $Tool itemconfigure nexti -state $state
- }
- }
-
-
- ####################################################################
- #
- # State control methods used by both the menu and the toolbar
- #
- ####################################################################
-
- # ------------------------------------------------------------------
- # METHOD: handle_trace_find_hook - response to the tfind command.
- # If the command puts us in a new mode, then switch modes...
- # ------------------------------------------------------------------
- method handle_trace_find_hook {mode from_tty} {
- debug "mode: $mode, from_tty: $from_tty, Browsing: $Browsing"
- if {[string compare $mode -1] == 0} {
- if {$Browsing} {
- set_control_mode 0
- }
- } else {
- if {!$Browsing} {
- set_control_mode 1
- }
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: set_control_mode - sets up the srcbar for browsing
- # a trace experiment.
- # mode: 1 => browse mode
- # 0 => control mode
- # ------------------------------------------------------------------
- method set_control_mode {mode} {
- debug "set_control_mode called with mode $mode"
- if {$mode} {
- set Browsing 1
- $Tool itemconfigure view -image run_expt_img \
- -command "$this set_control_mode 0"
- $Tool itemballoon view "Switch to Control mode"
- # Now swap out the buttons...
- $Tool toolbar_swap_button_lists $Trace_control_buttons \
- $Run_control_buttons
- enable_ui 1
- } else {
- if {$Browsing} {
- tfind_cmd {tfind none}
- }
- set Browsing 0
- $Tool itemconfigure view -image watch_movie_img \
- -command "$this set_control_mode 1"
- $Tool itemballoon view "Switch to Browse mode"
- # Now swap out the buttons...
- $Tool toolbar_swap_button_lists $Run_control_buttons \
- $Trace_control_buttons
- enable_ui 1
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: reconfig - reconfigure the srcbar
- # used when preferences change
- # ------------------------------------------------------------------
- public method reconfig {} {
- debug
- _load_src_images 1
- _load_images 1
-
- if {[pref get gdb/use_color_schemes] == "1"} {
- set cs_state normal
- } else {
- set cs_state disabled
- }
- $Menu set_class_state "Color $cs_state"
- for {set i 0} {$i < 16} {incr i} {
- set dbg [recolor [pref get gdb/bg/$i] 80]
- $color_menu entryconfigure $i -activebackground $dbg -background [pref get gdb/bg/$i]
- }
- # FIXME: Must Check if we are Tracing and set the buttons accordingly.
- }
-
- # ------------------------------------------------------------------
- # METHOD: set_variable - run when user enters a `set' command.
- #
- # FIXME: Should not be accessing the base class internal data
- # As the spec says, one must clear the menu and recreate it.
- # ------------------------------------------------------------------
- public method set_variable {event} {
- set varname [$event get variable]
- set value [$event get value]
- debug "Got $varname = $value"
-
- if {$varname == "os"} {
- # Make current_menu pointer point to the View Menu.
- # FIXME: Should not be accessing the base class internal data directly
- set view_menu [menu_find View]
- # Restore the current_menu pointer.
- set save_menu [$Menu menubar_set_current_menu $view_menu]
- set title "Kernel Objects"
-
- # Look for the KOD menu entry...
- if {[catch {$view_menu index $title} index]} {
- set index none
- }
-
- # FIXME: This assumes that the KOD menu is the last one as it does not
- # adjust the index information kept by the GDBMenuBar class.
- if {$value == ""} {
- # No OS, so remove KOD from View menu.
- if {$index != "none"} {
- # FIXME: Should not be accessing the base class internal data
- $view_menu delete $index
- }
- } else {
- # Add KOD to View menu, but only if it isn't already there.
- if {$index == "none"} {
- $Menu add command Other $title \
- {ManagedWin::open KodWin} \
- -underline 0 -accelerator "Ctrl+K"
- }
- }
-
- # Restore the current_menu pointer.
- $Menu menubar_set_current_menu $save_menu
-
- global gdb_kod_cmd
- set gdb_kod_cmd $value
- }
- }
-
- ####################################################################
- # The following method enables/disables both menus and buttons.
- ####################################################################
-
- # ------------------------------------------------------------------
- # METHOD: enable_ui - enable/disable the appropriate buttons and menus
- # Called from the busy, idle, and no_inferior hooks.
- #
- # on must be:
- # value Control Other Trace State
- # 0 off off off gdb is busy
- # 1 on on off gdb has inferior, and is idle
- # 2 off on off gdb has no inferior, and is idle
- # ------------------------------------------------------------------
- public method enable_ui {on} {
- debug "$on - Browsing=$Browsing"
-
- # Do the enabling so that all the disabling happens first, this way if a
- # button belongs to two groups, enabling takes precedence, which is
- # probably right.
-
- switch $on {
- 0 {
- # Busy
- set enable_list {Control disabled \
- Other disabled \
- Trace disabled \
- Attach disabled \
- Detach disabled}
- }
- 1 {
- # Idle, with inferior
- if {!$Browsing} {
- set enable_list {Trace disabled \
- Control normal \
- Other normal \
- Attach disabled \
- Detach normal }
- # set the states of stepi and nexti correctly
- _set_stepi
- } else {
- set enable_list {Control disabled Other normal Trace normal}
- }
-
- }
- 2 {
- # Idle, no inferior
- set enable_list {Control disabled \
- Trace disabled \
- Other normal \
- Attach normal \
- Detach disabled }
- }
- default {
- debug "Unknown type: $on in enable_ui"
- return
- }
- }
-
- $Menu set_class_state $enable_list
- $Tool set_class_state $enable_list
- }
-
- ####################################################################
- #
- # Execute actions corresponding to menu events
- #
- ####################################################################
-
- # ------------------------------------------------------------------
- # METHOD: do_attach: attach to a running target
- # ------------------------------------------------------------------
- method do_attach {menu} {
- gdbtk_attach_native
- }
-
- # ------------------------------------------------------------------
- # METHOD: do_detach: detach from a running target
- # ------------------------------------------------------------------
- method do_detach {menu} {
- gdbtk_disconnect
- gdbtk_idle
- }
-
- # ------------------------------------------------------------------
- # METHOD: do_kill: kill the current target
- # ------------------------------------------------------------------
- method do_kill {menu} {
- gdb_cmd "kill"
- run_hooks gdb_no_inferior_hook
- }
-
- # ------------------------------------------------------------------
- # METHOD: do_connect: connect to a remote target
- # in asynch mode if async is 1
- # ------------------------------------------------------------------
- method do_connect {menu {async 0}} {
-
- set successful [gdbtk_connect $async]
-
- if {$successful} {
- $menu entryconfigure "Connect to target" -state disabled
- $menu entryconfigure "Disconnect" -state normal
- } else {
- $menu entryconfigure "Connect to target" -state normal
- $menu entryconfigure "Disconnect" -state disabled
- }
-
- # Make the menu reflect this change
- ::update idletasks
- }
-
- # ------------------------------------------------------------------
- # METHOD: do_disconnect: disconnect from a remote target
- # in asynch mode if async is 1.
- #
- # ------------------------------------------------------------------
- method do_disconnect {menu {async 0}} {
- debug "$menu $async"
- #
- # For now, these are the same, but they might be different...
- #
-
- gdbtk_disconnect $async
-
- $menu entryconfigure "Connect to target" -state normal
- $menu entryconfigure "Disconnect" -state disabled
- }
-
- ####################################################################
- #
- # Execute actions corresponding to toolbar events
- #
- ####################################################################
-
- # ------------------------------------------------------------------
- # METHOD: _toggle_updates - Run when the update checkbutton is
- # toggled. Private method.
- # ------------------------------------------------------------------
- public method _toggle_updates {} {
- global GDBSrcBar_state
- if {$updatecommand != ""} {
- uplevel \#0 $updatecommand $GDBSrcBar_state($this)
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: cancel_download
- # ------------------------------------------------------------------
- public method cancel_download {} {
- global download_dialog download_cancel_ok
-
- if {"$download_dialog" != ""} {
- $download_dialog cancel
- } else {
- set download_cancel_ok 1
- }
- }
-
- ####################################################################
- #
- # Execute actions that can be activated by both menu entries and
- # toolbar buttons
- #
- ####################################################################
-
- # ------------------------------------------------------------------
- # METHOD: do_tstop: Change the GUI state, then do the tstop or
- # tstart command, whichever is appropriate.
- #
- # ------------------------------------------------------------------
- method do_tstop {} {
- debug "do_tstop called... Collecting is $Collecting"
-
- if {!$Collecting} {
- #
- # Start the trace experiment
- #
-
- if {$Browsing} {
- set ret [tk_messageBox -title "Warning" -message \
-"You are currently browsing a trace experiment.
-This command will clear the results of that experiment.
-Do you want to continue?" \
- -icon warning -type okcancel -default ok]
- if {[string compare $ret cancel] == 0} {
- return
- }
- set_control_mode 1
- }
- if {[tstart]} {
- # FIXME: Must enable the Stop Collection menu item and
- # disable the Start Collection item
- $Tool itemconfigure tstop -image Movie_off_img
- $Tool itemballoon tstop "End Collection"
- set Collecting 1
- } else {
- tk_messageBox -title Error \
- -message "Error downloading tracepoint info" \
- -icon error -type ok
- }
- } else {
- #
- # Stop the trace experiment
- #
-
- if {[tstop]} {
- # FIXME: Must enable the Stop Collection menu item and
- # disable the Start Collection item
- $Tool itemconfigure tstop -image Movie_on_img
- $Tool itemballoon tstop "Start Collection"
- set Collecting 0
- }
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: busy - BusyEvent handler
- # ------------------------------------------------------------------
- method busy {event} {
- enable_ui 0
- }
-
- # ------------------------------------------------------------------
- # METHOD: idle - IdleEvent handler
- # ------------------------------------------------------------------
- method idle {event} {
- enable_ui 1
- }
-
- ####################################################################
- #
- # PRIVATE DATA
- #
- ####################################################################
-
- # This is a handle on our parent source window.
- private variable source {}
-
- # The GdbMenuBar component
- private variable Menu
- private variable color_menu
-
- # The GdbToolBar component
- private variable Tool
-
- # FIXME - Need to break the images into the sets needed for
- # each button group, and load them when the button group is
- # created.
-
- # This is set if we've already loaded the standard images.
- private common _loaded_images 0
-
- # This is set if we've already loaded the standard images. Private
- # variable.
- private common _loaded_src_images 0
-
- # These buttons go in the control area when we are browsing
- protected variable Trace_control_buttons
-
- # And these go in the control area when we are running
- protected variable Run_control_buttons
-
- ####################################################################
- #
- # PUBLIC DATA
- #
- ####################################################################
-
- # This is the command that should be run when the `update'
- # checkbutton is toggled. The current value of the checkbutton is
- # appended to the command.
- public variable updatecommand {}
-
- # This controls whether the `update' checkbutton is turned on or
- # off.
- public variable updatevalue 0 {
- global GDBSrcBar_state
- ::set GDBSrcBar_state($this) $updatevalue
- }
-
- # This holds the source window's display mode. Valid values are
- # SOURCE, ASSEMBLY, SRC+ASM, and MIXED.
- public variable displaymode SOURCE {
- _set_stepi
- }
-
- # This indicates what is the inferior state.
- # Possible values are: {busy running downloading normal}
- public variable runstop normal {
- dbug I "configuring runstop $runstop"
-
- # Set the Run/Stop button accordingly
- _set_runstop
- }
-
- # The next three determine the state of the application when Tracing is enabled.
-
- public variable Tracing 0 ;# Is tracing enabled for this gdb?
- public variable Browsing 0 ;# Are we currently browsing a trace experiment?
- public variable Collecting 0 ;# Are we currently collecting a trace experiment?
-}
diff --git a/gdb/gdbtk/library/srcpref.itb b/gdb/gdbtk/library/srcpref.itb
deleted file mode 100644
index d892385bf23..00000000000
--- a/gdb/gdbtk/library/srcpref.itb
+++ /dev/null
@@ -1,281 +0,0 @@
-# Source preferences dialog for Insight.
-# Copyright (C) 1998, 1999, 2002, 2003, 2008 Red Hat
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ------------------------------------------------------------------
-# CONSTRUCTOR - create new source preferences window
-# ------------------------------------------------------------------
-itcl::body SrcPref::constructor {args} {
- window_name "Source Preferences"
- _init_var
- _build_win
-}
-
-# ------------------------------------------------------------------
-# METHOD: init_var - initialize preference variables
-# ------------------------------------------------------------------
-itcl::body SrcPref::_init_var {} {
- set vlist {gdb/src/PC_TAG gdb/src/STACK_TAG gdb/src/BROWSE_TAG
- gdb/src/run_attach gdb/src/run_load gdb/src/run_run
- gdb/src/run_cont gdb/src/bp_fg gdb/src/temp_bp_fg
- gdb/src/trace_fg gdb/src/thread_fg gdb/src/variableBalloons
- gdb/src/source2_fg gdb/src/tab_size gdb/mode gdb/editor
- gdb/B1_behavior}
-
- foreach var $vlist {
- set _saved($var) [pref get $var]
- set _new($var) $_saved($var)
- }
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: build_win - build the dialog
-# ------------------------------------------------------------------
-itcl::body SrcPref::_build_win {} {
- frame $itk_interior.f
- frame $itk_interior.f.a
- frame $itk_interior.f.b
- set f $itk_interior.f.a
-
- # Colors frame
- set a [Labelledframe $f.colors]
- $a configure -anchor nw -text {Colors}
- set w [$f.colors get_frame]
-
- set color [pref get gdb/src/PC_TAG]
- label $w.pcl -text {PC}
- button $w.pcb -text { } -activebackground $color -bg $color \
- -command [code $this _pick $color $w.pcb PC_TAG]
-
- set color [pref get gdb/src/STACK_TAG]
- label $w.stl -text {Stack}
- button $w.stb -text { } -activebackground $color -bg $color \
- -command [code $this _pick $color $w.stb STACK_TAG]
-
- set color [pref get gdb/src/BROWSE_TAG]
- label $w.brl -text {Browse}
- button $w.brb -text { } -activebackground $color -bg $color\
- -command [code $this _pick $color $w.brb BROWSE_TAG]
-
- set color [pref get gdb/src/source2_fg]
- label $w.s2l -text {Mixed Source}
- button $w.s2b -text { } -activebackground $color -bg $color \
- -command [code $this _pick $color $w.s2b source2_fg]
-
- set color [pref get gdb/src/bp_fg]
- label $w.nbpl -text {Normal Breakpoint}
- button $w.nbpb -text { } -activebackground $color -bg $color\
- -command [code $this _pick $color $w.nbpb bp_fg]
-
- set color [pref get gdb/src/temp_bp_fg]
- label $w.tbpl -text {Temporary Breakpoint}
- button $w.tbpb -text { } -activebackground $color -bg $color \
- -command [code $this _pick $color $w.tbpb temp_bp_fg]
-
- set color [pref get gdb/src/thread_fg]
- label $w.dbpl -text {Thread Breakpoint}
- button $w.dbpb -text { } -activebackground $color -bg $color \
- -command [code $this _pick $color $w.dbpb thread_fg]
-
- set color [pref get gdb/src/trace_fg]
- label $w.tpl -text {Tracepoint}
- button $w.tpb -text { } -activebackground $color -bg $color \
- -command [code $this _pick $color $w.tpb trace_fg]
-
- grid $w.pcl $w.pcb $w.nbpl $w.nbpb -padx 10 -pady 2 -sticky w
- grid $w.stl $w.stb $w.tbpl $w.tbpb -padx 10 -pady 2 -sticky w
- grid $w.brl $w.brb $w.dbpl $w.dbpb -padx 10 -pady 2 -sticky w
- grid $w.s2l $w.s2b $w.tpl $w.tpb -padx 10 -pady 2 -sticky w
-
- frame $f.rmv
-
- # Debug Mode frame
- set a [Labelledframe $f.rmv.mode]
- $a configure -anchor nw -text "Mouse Button-1 Behavior"
- set w [$f.rmv.mode get_frame]
-
- if {[pref get gdb/mode]} {
- set state normal
- } else {
- pref set gdb/B1_behavior 1
- set state disabled
- }
-
- radiobutton $w.async -text "Set/Clear Tracepoints" \
- -variable [scope _new(gdb/B1_behavior)] -value 0 -state $state
- radiobutton $w.sync -text "Set/Clear Breakpoints" \
- -variable [scope _new(gdb/B1_behavior)] -value 1 -state $state
-
- pack $w.async $w.sync -side top
-
- # Variable Balloons
- set a [Labelledframe $f.rmv.var]
- $a configure -anchor nw -text "Variable Balloons"
- set w [$f.rmv.var get_frame]
- set var _new(gdb/src/variableBalloons)
- radiobutton $w.var_on -text "On " -variable [scope $var] -value 1
- radiobutton $w.var_off -text "Off" -variable [scope $var] -value 0
- pack $w.var_on $w.var_off -side top
- grid $f.rmv.mode -sticky nsew -pady 5 -row 0 -column 0
- grid $f.rmv.var -sticky nsew -pady 5 -row 0 -column 2
- grid columnconfigure $f.rmv 0 -weight 1
- grid columnconfigure $f.rmv 1 -minsize 4
- grid columnconfigure $f.rmv 2 -weight 1
- grid rowconfigure $f.rmv 0 -weight 1
-
-
- frame $f.x
- # Tab size
- itk_component add size {
- iwidgets::spinint $f.x.size -labeltext "Tab Size" -range {1 16} \
- -step 1 -fixed 2 -width 2 -textvariable [scope _new(gdb/src/tab_size)] \
- -wrap 0 -textbackground $::Colors(textbg)
- }
- $f.x.size delete 0 end
- $f.x.size insert end $_saved(gdb/src/tab_size)
-
- # Linenumbers
- # commented out because this option isn't really useful
-# checkbutton $f.x.linenum -text "Line Numbers" \
-# -variable [pref varname gdb/src/linenums]
-# pack $f.x.size $f.x.linenum -side left -padx 5 -pady 5
- pack $f.x.size -side left -padx 5 -pady 5
-
- # Disassembly flavor - We tell whether this architecture supports
- # the flag by checking whether the flag exists.
-
- set have_disassembly_flavor 0
- set vals [list_disassembly_flavors]
- if {[llength $vals] != 0} {
- set have_disassembly_flavor 1
- frame $f.dis
- label $f.dis.l -text "Disassembly Flavor: "
- combobox::combobox $f.dis.combo -maxheight 15 -width 15 \
- -font global/fixed -editable 0 -command [code $this _set_flavor] \
- -bg $::Colors(textbg)
-
- foreach elem $vals {
- $f.dis.combo list insert end $elem
- }
-
- set _saved_disassembly_flavor [get_disassembly_flavor]
- $f.dis.combo entryset $_saved_disassembly_flavor
-
- pack $f.dis.l -side left
- pack $f.dis.combo -side left -padx 4
-
- } else {
- set _saved_disassembly_flavor ""
- }
-
- # External editor.
- frame $f.exted
- label $f.exted.l -text "External Editor: "
- entry $f.exted.e -width 40 -textvariable [scope _new(gdb/editor)]
- pack $f.exted.l -side left
- pack $f.exted.e -side left -padx 4
-
- pack $f.colors -fill both -expand 1
- pack $f.rmv -fill both -expand yes
- pack $f.x -fill x -expand yes
-
- if {$have_disassembly_flavor} {
- pack $f.dis -side top -fill x -padx 4
- }
-
- pack $f.exted -side top -fill x -padx 4 -pady 4
-
- button $itk_interior.f.b.ok -text OK -width 7 -underline 0 -command [code $this _save]
- button $itk_interior.f.b.apply -text Apply -width 7 -underline 0 -command [code $this _apply]
- button $itk_interior.f.b.quit -text Cancel -width 7 -underline 0 -command [code $this _cancel]
- standard_button_box $itk_interior.f.b
- pack $itk_interior.f.a $itk_interior.f.b $itk_interior.f -expand yes -fill both -padx 5 -pady 5
-}
-
-# ------------------------------------------------------------------
-# METHOD: apply - apply changes
-# ------------------------------------------------------------------
-itcl::body SrcPref::_apply {} {
- foreach var [array names _new] {
- if {$_new($var) != [pref get $var]} {
- #debug "$var = $_new($var)"
- pref set $var $_new($var)
- }
- }
- if {$_new_disassembly_flavor != ""} {
- gdb_cmd "set disassembly-flavor $_new_disassembly_flavor"
- pref set gdb/src/disassembly-flavor $_new_disassembly_flavor
- }
- ManagedWin::restart
-}
-
-itcl::body SrcPref::cancel {} {
- _save
-}
-
-# ------------------------------------------------------------------
-# METHOD: _cancel
-# ------------------------------------------------------------------
-itcl::body SrcPref::_cancel {} {
- set any_changed 0
-
- foreach elem [array names _saved] {
- set cur_val [pref get $elem]
- if {[string compare $cur_val $_saved($elem)] != 0} {
- set any_changed 1
- pref set $elem $_saved($elem)
- }
- }
-
- if {$_new_disassembly_flavor != ""} {
- set any_changed 1
- gdb_cmd "set disassembly-flavor $_saved_disassembly_flavor"
- pref set gdb/src/disassembly-flavor $_saved_disassembly_flavor
- }
-
- if {$any_changed} {
- ManagedWin::restart
- }
- unpost
-}
-
-# ------------------------------------------------------------------
-# METHOD: save - apply changes and quit
-# ------------------------------------------------------------------
-itcl::body SrcPref::_save {} {
- _apply
- unpost
-}
-
-# ------------------------------------------------------------------
-# METHOD: _set_flavor - sets the disassembly flavor. The set disassembly-flavor
-# gdb command is already known to exist, so I don't have to check...
-# ------------------------------------------------------------------
-itcl::body SrcPref::_set_flavor {w new_mode} {
- $w entryset $new_mode
- set _new_disassembly_flavor $new_mode
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: pick - pick colors
-# ------------------------------------------------------------------
-itcl::body SrcPref::_pick {color win tag} {
- set new_color [tk_chooseColor -initialcolor $color -title "Choose color"]
- if {$new_color != $color && $new_color != {}} {
- set _new(gdb/src/$tag) $new_color
- $win configure -activebackground $new_color -bg $new_color
- }
-}
-
diff --git a/gdb/gdbtk/library/srcpref.ith b/gdb/gdbtk/library/srcpref.ith
deleted file mode 100644
index a42f7ba7fde..00000000000
--- a/gdb/gdbtk/library/srcpref.ith
+++ /dev/null
@@ -1,38 +0,0 @@
-# Source preferences dialog class definition for GDBtk.
-# Copyright (C) 1998, 1999 Cygnus Solutions
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class SrcPref {
- inherit ManagedWin ModalDialog
-
- private {
- variable _saved ;# These are the saved values...
- variable _new ;# These are the changed values
- variable _saved_disassembly_flavor
- variable _new_disassembly_flavor ""
-
- method _apply {}
- method _build_win {}
- method _cancel {}
- method _init_var {}
- method _pick {color win tag}
- method _save {}
- method _set_flavor {w new_mode}
- method cancel {}
- }
-
- public {
- method constructor {args}
- }
-}
-
diff --git a/gdb/gdbtk/library/srctextwin.itb b/gdb/gdbtk/library/srctextwin.itb
deleted file mode 100644
index 7e4acb38d6c..00000000000
--- a/gdb/gdbtk/library/srctextwin.itb
+++ /dev/null
@@ -1,2971 +0,0 @@
-# Paned text widget for source code, for Insight
-# Copyright (C) 1997, 1998, 1999, 2001, 2002, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements the paned text widget with the source code in it.
-# This widget is typically embedded in a SrcWin widget.
-#
-# ----------------------------------------------------------------------
-
-# ------------------------------------------------------------------
-# CONSTRUCTOR - create new source text window
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::constructor {args} {
- eval itk_initialize $args
- set top [winfo toplevel $itk_interior]
- if {$parent == {}} {
- set parent [winfo parent $itk_interior]
- }
-
- if {![info exists break_images(bp)]} {
- set size [font measure [pref get gdb/src/font] "W"]
- set break_images(bp) [makeBreakDot $size \
- [pref get gdb/src/bp_fg]]
- set break_images(temp_bp) [makeBreakDot $size \
- [pref get gdb/src/temp_bp_fg]]
- set break_images(disabled_bp) [makeBreakDot $size \
- [pref get gdb/src/disabled_fg]]
- set break_images(tp) [makeBreakDot $size \
- [pref get gdb/src/trace_fg]]
- set break_images(thread_bp) [makeBreakDot $size \
- [pref get gdb/src/thread_fg]]
- set break_images(bp_and_tp) [makeBreakDot $size \
- [list [pref get gdb/src/trace_fg] \
- [pref get gdb/src/bp_fg]]]
- }
-
- if {$ignore_var_balloons} {
- set UseVariableBalloons 0
- } else {
- set UseVariableBalloons [pref get gdb/src/variableBalloons]
- }
-
- set Linenums [pref get gdb/src/linenums]
-
- #Initialize state variables
- _initialize_srctextwin
-
- build_popups
- build_win
-
- # add hooks
- if {$Tracing} {
- add_hook control_mode_hook "$this set_control_mode"
- add_hook gdb_trace_find_hook "$this trace_find_hook"
- }
-
- if {$UseVariableBalloons} {
- add_hook gdb_idle_hook "$this updateBalloon"
- }
- global ${this}_balloon
- trace variable ${this}_balloon w "$this trace_help"
-
-}
-
-# ------------------------------------------------------------------
-# DESTRUCTOR - destroy window containing widget
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::destructor {} {
- if {$Tracing} {
- remove_hook control_mode_hook "$this set_control_mode"
- }
- if {$UseVariableBalloons} {
- remove_hook gdb_idle_hook "$this updateBalloon"
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: trace_find_hook - response to the tfind command. All we
-# need to do here is to remove the trace tags, if we are exiting
-# trace mode
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::trace_find_hook {mode from_tty} {
- if {[string compare $mode -1] == 0} {
- if {$Browsing} {
- $twin tag remove STACK_TAG 1.0 end
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: set_control_mode- switches the src window between
-# browsing -> mode = 1
-# controlling -> mode = 0
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::set_control_mode {mode} {
-# debug "Setting control mode of $twin to $mode"
- if {$mode} {
- set Browsing 1
- } else {
- set Browsing 0
- }
-
- switch $current(mode) {
- SOURCE {
- config_win $twin
- }
- ASSEMBLY {
- config_win $twin A
- }
- MIXED {
- config_win $twin M
- }
- SRC+ASM {
- config_win $twin
- config_win $bwin A
- }
- }
-
-}
-
-# ------------------------------------------------------------------
-# METHOD: build_popups - build the popups for the source window(s)
-# ------------------------------------------------------------------
-#
-# The popups array holds the data for the breakpoint & tracepoint popup menus.
-# The elements are:
-# Menus:
-# break_rgn - the popup for clicking in a bare break region
-# bp - the popup for clicking on a set breakpoint
-# tp - the popup for clicking on a set tracepoint
-# bp_and_tp - the popup for clicking on the break_region when the
-# line contains both a bp & a tp
-# source - the popup for clicking on the source region of the window
-#
-# State:
-# saved_y - the y value of the mouse click that posted the popup
-# saved_win- the Tk window which recieved the posting click
-#
-# Disable info:
-# run_disabled - a list of {menu entry} pairs for all the menus that
-# should be disabled when you are not running
-# browse_disabled - a similar list for menus that should be disabled
-# when you are browsing a trace expt.
-#
-itcl::body SrcTextWin::build_popups {} {
-
- set popups(bp) $itk_interior.bp_menu
- set popups(tp) $itk_interior.tp_menu
- set popups(bp_and_tp) $itk_interior.tp_bp_menu
- set popups(tp_browse) $itk_interior.tp_browse_menu
- set popups(break_rgn) $itk_interior.break_menu
- set popups(source) $itk_interior.src_menu
- set popups(disabled_bp) $itk_interior.disabled_bp_menu
-
- # This is a scratch popup menu we use when we are not over a bp...
- if {![winfo exists $popups(source)]} {
- menu $popups(source) -tearoff 0
- }
-
- if {![winfo exists $popups(break_rgn)]} {
- # breakpoint popup menu
- # don't enable hardware or conditional breakpoints until they are tested
- menu $popups(break_rgn) -tearoff 0
-
- set bp_fg [pref get gdb/src/bp_fg]
- set tp_fg [pref get gdb/src/trace_fg]
-
- if {[pref get gdb/control_target]} {
-
- addPopup break_rgn "Continue to Here" "$this continue_to_here" \
- [pref get gdb/src/PC_TAG] 0 0
- addPopup break_rgn "Jump to Here" "$this jump_to_here" \
- [pref get gdb/src/PC_TAG] 0 0
- $popups(break_rgn) add separator
-
- addPopup break_rgn "Set Breakpoint" "$this set_bp_at_line" $bp_fg
-
- lappend popups(break_rgn-browse) 1
- lappend popups(break_rgn-control) 1
-
- addPopup break_rgn "Set Temporary Breakpoint" "$this set_bp_at_line T" \
- [pref get gdb/src/temp_bp_fg]
-
- addPopup break_rgn "Set Breakpoint on Thread(s)..." \
- "$this ask_thread_bp" [pref get gdb/src/thread_fg] 0 0
- }
-
- if {$Tracing} {
- $popups(break_rgn) add separator
- addPopup break_rgn "Set Tracepoint" "$this set_tp_at_line" $tp_fg
- }
-
- }
-
- if {![winfo exists $popups(bp)]} {
- # this popup is used when the line contains a set breakpoint
- menu $popups(bp) -tearoff 0
-
- if {!$Browsing && [pref get gdb/control_target]} {
- addPopup bp "Continue to Here" "$this continue_to_here" {} 0 0
- addPopup bp "Jump to Here" "$this jump_to_here" {} 0 0
- $popups(bp) add separator
-
- addPopup bp "Disable Breakpoint" "$this enable_disable_at_line disable" \
- $bp_fg
- $popups(bp) add separator
- }
-
- addPopup bp "Delete Breakpoint" "$this remove_bp_at_line"
-
- # Currently you cannot set a tracepoint and a breakpoint at the same line...
- #
- # if {$Tracing} {
- # addPopup bp "Set Tracepoint" "$this set_tp_at_line" $tp_fg
- # }
- }
-
- if {![winfo exists $popups(tp)]} {
- # This is the popup to use when the line contains a set tracepoint
-
- menu $popups(tp) -tearoff 0
-
- if {[pref get gdb/control_target]} {
-
- addPopup tp "Continue to Here" "$this continue_to_here" green 0 0
- addPopup tp "Jump to Here" "$this jump_to_here" {} 0 0
- # $popups(tp) add separator
-
- # Currently you cannot set a tracepoint and a breakpoint at the same line...
- #
- # addPopup tp "Set Breakpoint" "$this set_bp_at_line" $bp_fg
-
- # addPopup tp "Set Temporary Breakpoint" "$this set_bp_at_line T" \
- # [pref get gdb/src/temp_bp_fg]
-
- # addPopup tp "Set Breakpoint on Thread(s)..." \
- # "$this ask_thread_bp" \
- # [pref get gdb/src/thread_fg] 0 0
- }
-
- if {$Tracing} {
- $popups(tp) add separator
- addPopup tp "Modify Tracepoint" "$this set_tp_at_line" $tp_fg
- addPopup tp "Delete Tracepoint" "$this remove_tp_at_line" $tp_fg
- }
- }
-
- # This is not currently used, since you can't set a bp & a tp on the same line.
- # N.B. however, we don't exclude this on the command line, but...
-
- if {![winfo exists $popups(bp_and_tp)]} {
-
- # this popup is used when the line contains a set breakpoint & tracepoint
- menu $popups(bp_and_tp) -tearoff 0
-
- if {!$Browsing && [pref get gdb/control_target]} {
- addPopup bp_and_tp "Continue to Here" "$this continue_to_here" \
- green 0 0
- addPopup bp_and_tp "Jump to Here" "$this jump_to_here" \
- green 0 0
- $popups(bp_and_tp) add separator
- }
-
- addPopup bp_and_tp "Delete Breakpoint" "$this remove_bp_at_line" $bp_fg
- if {$Tracing} {
- addPopup bp_and_tp "Modify Tracepoint" "$this set_tp_at_line" $tp_fg
- addPopup bp_and_tp "Delete Tracepoint" \
- "$this remove_tp_at_line" $tp_fg
- }
- }
-
- if {![winfo exists $popups(disabled_bp)]} {
- menu $popups(disabled_bp) -tearoff 0
-
- addPopup disabled_bp "Enable Breakpoint" \
- "$this enable_disable_at_line enable" $bp_fg
-
- $popups(disabled_bp) add separator
- addPopup disabled_bp "Delete Breakpoint" "$this remove_bp_at_line"
- }
-
- if {![winfo exists $popups(tp_browse)]} {
-
- # this popup is on a tracepoint when browsing.
-
- menu $popups(tp_browse) -tearoff 0
- addPopup tp_browse "Next hit Here" "$this next_hit_at_line" \
- green
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: build_win - build the main source paned window
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::build_win {} {
- cyg::panedwindow $itk_interior.p
-
- set _tpane pane$filenum
- incr filenum
-
- $itk_interior.p add $_tpane
- set pane1 [$itk_interior.p childsite $_tpane]
- set Stwc(gdbtk_scratch_widget:pane) $_tpane
- set Stwc(gdbtk_scratch_widget:dirty) 0
-
- set twinp [iwidgets::scrolledtext $pane1.st \
- -hscrollmode dynamic -vscrollmode dynamic]
- set twin [$twinp component text]
- pack $twinp -fill both -expand yes
- pack $itk_interior.p -fill both -expand yes
- config_win $twin
-}
-
-# ------------------------------------------------------------------
-# METHOD: SetRunningState - set state based on if GDB is running or not.
-# This disables the popup menus when GDB is not running yet.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::SetRunningState {state} {
-# debug "$state"
- foreach elem $popups(run_disabled) {
- $popups([lindex $elem 0]) entryconfigure [lindex $elem 1] -state $state
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: enable - enable or disable bindings and change cursor
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::enable {on} {
- if {$on} {
- set Running 0
- set glyph ""
- set bnd ""
- set status normal
- } else {
- set Running 1
- set glyph watch
- set bnd "break"
- set status disabled
- }
-
- if {[winfo exists $twin]} {
- bind $twin <B1-Motion> $bnd
- bind $twin <Double-1> $bnd
- bind $twin <Triple-1> $bnd
- enable_disable_src_tags $twin $status
- $twin configure -cursor $glyph
- }
-
- if {$bwin != ""} {
- bind $bwin <B1-Motion> $bnd
- bind $bwin <Double-1> $bnd
- bind $bwin <Triple-1> $bnd
- enable_disable_src_tags $bwin $status
- $bwin configure -cursor $glyph
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: makeBreakDot - make the break dot for the screen
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::makeBreakDot {size colorList {image {}}} {
- if {$size > 32} {
- set size 32
- } elseif {$size < 1} {
- set size 1
- }
-
- if {$image == ""} {
- set image [image create photo -width $size -height $size]
- } else {
- $image blank
- $image configure -width $size -height $size
- }
-
- if {[llength $colorList] == 1} {
- set x1 1
- set x2 [expr {1 + $size}]
- set y1 1
- set y2 $x2
- $image put $colorList -to 1 1 $x2 $y2
- } else {
- set x1 1
- set x3 [expr {1 + $size}]
- set x2 [expr int((1 + $size)/2)]
- set y1 1
- set y2 $x3
- $image put [lindex $colorList 0] -to 1 1 $x2 $y2
- $image put [lindex $colorList 1] -to [expr $x2 + 1] 1 $x3 $y2
- }
-
- return $image
-}
-
-# ------------------------------------------------------------------
-# METHOD: setTabs - set the tabs for the assembly/src windows
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::setTabs {win {asm S}} {
- set fsize [font measure [pref get gdb/src/font] "W"]
- set tsize [pref get gdb/src/tab_size]
- set rest ""
-
- if {[string compare $asm "S"] != 0} {
- set first [expr {$fsize * 12}]
- set second [expr {$fsize * 13}]
- set third [expr {$fsize * 34}]
- for {set i 1} {$i < 8} {incr i} {
- lappend rest [expr {(34 + ($i * $tsize)) * $fsize}] left
- }
- set tablist [concat [list $first right $second left $third left] $rest]
- } else {
- # SOURCE window
- # The first tab right-justifies the line numbers and the second
- # tab is the left margin for the start on the source code. The remaining
- # tabs should be regularly spaced depending on prefs.
- if {$Linenums} {
- set first [expr {$fsize * 6}] ;# "- " plus 4 digit line number
- set second [expr {$fsize * 7}] ;# plus a space after the number
- for {set i 1} {$i < 8} {incr i} {
- lappend rest [expr {(7 + ($i * $tsize)) * $fsize}] left
- }
- set tablist [concat [list $first right $second left] $rest]
- } else {
- set first [expr {$fsize * 2}]
- for {set i 1} {$i < 8} {incr i} {
- lappend rest [expr {(2 + ($i * $tsize)) * $fsize}] left
- }
- set tablist [concat [list $first left] $rest]
- }
- }
- $win configure -tabs $tablist
-}
-
-itcl::body SrcTextWin::enable_disable_src_tags {win how} {
-
- switch $how {
- normal {
- set cur1 dot
- set cur2 xterm
- }
- disabled {
- set cur1 watch
- set cur2 $cur1
- }
- browse {
- set cur1 dot
- set cur2 xterm
- }
- }
-
- if {[string compare $how browse] == 0} {
-
- $win tag bind break_rgn_tag <Enter> { }
- $win tag bind break_rgn_tag <Leave> { }
-
- foreach type $bp_types {
- $win tag bind ${type}_tag <Enter> { }
- $win tag bind ${type}_tag <Motion> { }
- $win tag bind ${type}_tag <Leave> { }
- }
-
- } else {
-
- $win tag bind break_rgn_tag <Enter> "$win config -cursor $cur1"
- $win tag bind break_rgn_tag <Leave> "$win config -cursor $cur2"
-
- foreach type $bp_types {
- $win tag bind ${type}_tag <Enter> "$win config -cursor $cur1"
- $win tag bind ${type}_tag <Motion> "$this motion bp %W %x %y"
- $win tag bind ${type}_tag <Leave> \
- "$this cancelMotion;$win config -cursor $cur2"
- }
- }
-
- $win tag bind tp_tag <Enter> "$win config -cursor $cur1"
- $win tag bind tp_tag <Motion> "$this motion bp %W %x %y"
- $win tag bind tp_tag <Leave> "$this cancelMotion;$win config -cursor $cur2"
-}
-
-# ------------------------------------------------------------------
-# METHOD: config_win - configure the source or assembly text window
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::config_win {win {asm S}} {
-# debug "$win $asm Tracing=$Tracing Browsing=$Browsing"
-
- $win config -borderwidth 2 -insertwidth 0 -wrap none
-
- # font
- set font [pref get gdb/src/font]
- $win configure -font $font -bg $::Colors(textbg) -fg $::Colors(textfg)
-
- setTabs $win $asm
-
- # set up some tags. should probably be done differently
- # !! change bg?
-
- $win tag configure break_rgn_tag
- foreach type $bp_types {
- $win tag configure ${type}_tag
- }
- $win tag configure tp_tag
- $win tag configure source_tag2 -foreground [pref get gdb/src/source2_fg]
- $win tag configure PC_TAG -background [pref get gdb/src/PC_TAG]
- $win tag configure STACK_TAG -background [pref get gdb/src/STACK_TAG]
- $win tag configure BROWSE_TAG -background [pref get gdb/src/BROWSE_TAG]
-
- # search tag used to highlight searches
- foreach option [$win tag configure sel] {
- set op [lindex $option 0]
- set val [lindex $option 4]
- eval $win tag configure search $op $val
- }
-
- # bind mouse button 3 to the popup men
- $win tag bind source_tag <Button-3> "$this do_source_popup %X %Y %x %y"
- $win tag bind source_tag2 <Button-3> "$this do_source_popup %X %Y %x %y"
-
- # bind mouse button 3 to the popup menus
- if {!$Browsing} {
-
- $win tag bind break_rgn_tag <Button-3> \
- "$this do_tag_popup break_rgn %X %Y %y; break"
- foreach type $bp_types {
- if {$type == "disabled_bp"} then {
- set tag disabled_bp
- } else {
- set tag bp
- }
- $win tag bind ${type}_tag <Button-3> \
- "$this do_tag_popup $tag %X %Y %y; break"
- }
- $win tag bind tp_tag <Button-3> "$this do_tag_popup tp %X %Y %y; break"
- $win tag bind bp_and_tp_tag <Button-3> "$this do_tag_popup bp_and_tp %X %Y %y; break"
- } else {
- $win tag bind tp_tag <Button-3> "$this do_tag_popup tp_browse %X %Y %y; break"
- $win tag bind break_rgn_tag <Button-3> { }
- foreach type $bp_types {
- $win tag bind ${type}_tag <Button-3> { }
- }
- $win tag bind bp_and_tp_tag <Button-3> "$this do_tag_popup tp_browse %X %Y %y; break"
-
- }
-
- # Disable printing and cut and paste keys; makes the window readonly
- # We do this so we don't have to enable and disable the
- # text widget everytime we want to modify it.
-
- bind $win <Key> {if {"%A" != "{}"} {break}}
- bind $win <Delete> break
- bind $win <ButtonRelease-2> {break}
-
- # GDB key bindings
- # We need to explicitly ignore keys with the Alt modifier, since
- # otherwise they will interfere with selecting menus on Windows.
-
- if {!$Browsing && [pref get gdb/control_target]} {
- bind_plain_key $win c "$this do_key continue; break"
- bind_plain_key $win r "$this do_key run; break"
- bind_plain_key $win f "$this do_key finish; break"
- } else {
- bind_plain_key $win n "$this do_key tfind_next; break"
- bind_plain_key $win p "$this do_key tfind_prev; break"
- bind_plain_key $win f "$this do_key tfind_start; break"
- bind_plain_key $win l "$this do_key tfind_line; break"
- bind_plain_key $win h "$this do_key tfind_tp; break"
- }
- bind_plain_key $win u "$this do_key up; break"
- bind_plain_key $win d "$this do_key down; break"
- bind_plain_key $win x "$this do_key quit; break"
-
- if {!$Browsing && [pref get gdb/control_target]} {
- if {[string compare $asm "S"] != 0} {
- bind_plain_key $win s "$this do_key stepi; break"
- bind_plain_key $win n "$this do_key nexti; break"
- } else {
- bind_plain_key $win s "$this do_key step; break"
- bind_plain_key $win n "$this do_key next; break"
- }
- }
-
- bind_plain_key $win Control-h "$this do_key thread_list; break"
- bind_plain_key $win Control-f "$this do_key browser; break"
- bind_plain_key $win Control-d "$this do_key download; break"
- bind_plain_key $win Control-p "$this do_key print"
- bind_plain_key $win Control-u "$this do_key debug; break"
- bind_plain_key $win Control-o [list $this do_key open]
- bind_plain_key $win Control-a [list $this do_key attach]
- bind_plain_key $win Control-w [code $this do_key close]
-
- if {!$Browsing && [pref get gdb/control_target]} {
- # Ctrl+F5 is another accelerator for Run
- bind_plain_key $win Control-F5 "$this do_key run"
- }
-
- bind_plain_key $win Control-F11 "$this do_key debug"
- bind_plain_key $win Alt-v "$win yview scroll -1 pages"
- bind_plain_key $win Control-v [format {
- %s yview scroll 1 pages
- break
- } $win]
-
- # bind mouse button 1 to the breakpoint method or tracepoint,
- # depending on the settings of the B1_behavior setting. We don't
- # have to bind to bp_and_tp because that will fall through to either
- # the tp or the bp tag. We have to put in the break so that we don't
- # both remove & reinsert a BP when we have both a tp & a bp on the same line.
- # If we are browsing, then disable Button-1
-
- if {!$Browsing} {
- if {[pref get gdb/B1_behavior]} {
- $win tag bind break_rgn_tag <Button-1> "$this set_bp_at_line N $win %y; break"
- foreach type $bp_types {
- $win tag bind ${type}_tag <Button-1> "$this remove_bp_at_line $win %y; break"
- }
- $win tag bind tp_tag <Button-1> "$this set_bp_at_line N $win %y; break"
- } else {
- $win tag bind break_rgn_tag <Button-1> "$this set_tp_at_line $win %y; break"
- foreach type $bp_types {
- $win tag bind ${type}_tag <Button-1> "$this set_tp_at_line $win %y; break"
- }
- $win tag bind tp_tag <Button-1> "$this set_tp_at_line $win %y; break"
- }
- } else {
- $win tag bind break_rgn_tag <Button-1> { }
- foreach type $bp_types {
- $win tag bind ${type}_tag <Button-1> { }
- }
- $win tag bind tp_tag <Button-1> { }
- }
-
-
- # avoid special handling of double and triple clicks in break area
- bind $win <Double-1> [format {
- if {[lsearch [%s tag names @%%x,%%y] break_rgn_tag] >= 0} {
- break
- }
- } $win $win]
- bind $win <Triple-1> [format {
- if {[lsearch [%s tag names @%%x,%%y] break_rgn_tag] >= 0} {
- break
- }
- } $win $win]
-
- # bind window shortcuts
- bind_plain_key $win Control-s "$this do_key stack"
- bind_plain_key $win Control-r "$this do_key registers"
- bind_plain_key $win Control-m "$this do_key memory"
- bind_plain_key $win Control-t "$this do_key watch"
- bind_plain_key $win Control-l "$this do_key locals"
- bind_plain_key $win Control-k "$this do_key kod"
- if { !$Tracing } {
- bind_plain_key $win Control-b "$this do_key breakpoints"
- } else {
- bind_plain_key $win Control-t "$this do_key tracepoints"
- bind_plain_key $win Control-u "$this do_key tdump"
- }
- bind_plain_key $win Control-n "$this do_key console"
-
- if {$Browsing} {
- enable_disable_src_tags $win browse
- } else {
- enable_disable_src_tags $win normal
- }
-
- if {$UseVariableBalloons} {
- $win tag bind source_tag <Motion> "$this motion var %W %x %y"
- $win tag bind source_tag <Leave> "$this cancelMotion"
- }
-
- # Up/Down arrow key bindings
- bind_plain_key $win Up [list %W yview scroll -1 units]
- bind_plain_key $win Down [list %W yview scroll +1 units]
-
- # After loading a new file, focus sometimes gets lost
- # so point it back to this window if it doesn't already
- # point elsewhere.
- if {[focus -displayof $win] == ""} {focus $win}
-}
-
-# ------------------------------------------------------------------
-# METHOD: addPopup - adds a popup to one of the source popup menus
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::addPopup {menu label command {abg {}} {browse 1} {run 1}} {
-
- if {$abg == ""} {
- $popups($menu) add command -label $label -command $command
- } else {
- $popups($menu) add command -label $label -command $command \
- -activebackground $abg
- }
-
- set index [$popups($menu) index last]
- if {!$run} {
- lappend popups(run_disabled) [list $menu $index]
- }
- if {!$browse} {
- lappend popups(browse_disabled) [list $menu $index]
- }
-
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: set_variable - Handle changes in the gdb variables
-# changed through the "set" gdb command.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::set_variable {event} {
- set var [$event get variable]
- set val [$event get value]
- debug "Set hook got called with $var $val"
- switch $var {
- disassembly-flavor {
- disassembly_changed
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: disassembly_changed - The disassembly flavor has changed,
-# mark all the cached assembly windows dirty, and force the
-# visible window to be redisplayed.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::disassembly_changed {} {
- foreach name [array names Stwc *:pane] {
- debug "Looking at $name"
- set vals [split $name ,]
- if {([string compare [lindex $vals 1] "A"] == 0)
- || ([string compare [lindex $vals 1] "M"] == 0)} {
- debug "Setting $name to dirty"
- set Stwc([lindex $vals 0]:dirty) 1
- }
- }
-
- if {[string compare $current(mode) "SOURCE"] != 0} {
- location $current(tag) $current(filename) $current(funcname) $current(line) \
- $current(addr) $pc(addr) $current(lib)
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: reconfig - used when preferences change
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::reconfig {} {
-# debug
-
- # Make sure we redo the break images when we reconfigure
- set size [font measure [pref get gdb/src/font] "W"]
- makeBreakDot $size [pref get gdb/src/bp_fg] $break_images(bp)
- makeBreakDot $size [pref get gdb/src/temp_bp_fg] $break_images(temp_bp)
- makeBreakDot $size [pref get gdb/src/disabled_fg] $break_images(disabled_bp)
- makeBreakDot $size [pref get gdb/src/trace_fg] $break_images(tp)
- makeBreakDot $size \
- [list [pref get gdb/src/trace_fg] [pref get gdb/src/bp_fg]] \
- $break_images(bp_and_tp)
- makeBreakDot $size [pref get gdb/src/thread_fg] $break_images(thread_bp)
-
- # Tags
- $twin tag configure PC_TAG -background [pref get gdb/src/PC_TAG]
- $twin tag configure STACK_TAG -background [pref get gdb/src/STACK_TAG]
- $twin tag configure BROWSE_TAG -background [pref get gdb/src/BROWSE_TAG]
- switch $current(mode) {
- SOURCE {
- setTabs $twin
- }
- SRC+ASM {
- setTabs $twin
- setTabs $bwin A
- }
- default {
- setTabs $twin A
- }
- }
-
- # Variable Balloons
- if {$ignore_var_balloons} {
- set balloons 0
- } else {
- set balloons [pref get gdb/src/variableBalloons]
- }
- if {$UseVariableBalloons != $balloons} {
- set UseVariableBalloons $balloons
- if {$UseVariableBalloons} {
- $twin tag bind source_tag <Motion> "$this motion var %W %x %y"
- $twin tag bind source_tag <Leave> "$this cancelMotion"
- add_hook gdb_idle_hook [list $this updateBalloon]
- } else {
- cancelMotion
- $twin tag bind source_tag <Motion> {}
- $twin tag bind source_tag <Leave> {}
- $twin tag remove _show_variable 1.0 end
- remove_hook gdb_idle_hook [list $this updateBalloon]
- }
- }
-
- # Tracing Hooks
- catch {remove_hook control_mode_hook "$this set_control_mode"}
- catch {remove_hook gdb_trace_find_hook "$this trace_find_hook"}
- if {$Tracing} {
- add_hook control_mode_hook "$this set_control_mode"
- add_hook gdb_trace_find_hook "$this trace_find_hook"
- }
-
- # Popup colors
-
- # need to rewrite because of the new addPopup function
- # if {$Tracing} {
- # $twin.bmenu entryconfigure 0 -activebackground [pref get gdb/src/trace_fg]
- # } else {
- # $twin.bmenu entryconfigure 0 -activebackground [pref get gdb/src/PC_TAG]
- # $twin.bmenu entryconfigure 1 -activebackground [pref get gdb/src/bp_fg]
- # $twin.bmenu entryconfigure 2 -activebackground \
- # [pref get gdb/src/temp_bp_fg]
- # $twin.bmenu entryconfigure 3 -activebackground \
- # [pref get gdb/src/thread_fg]
- # }
-}
-
-# ------------------------------------------------------------------
-# METHOD: updateBalloon - we have gone idle, update the balloon
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::updateBalloon {} {
-
- set err [catch {$_balloon_var update} changed]
- catch {$_balloon_var name} var
-
- if {!$err} {
- if {$changed != ""} {
- # The variable's value has changed, so update the
- # balloon with its new value
- balloon register $twin "$var=[balloon_value $_balloon_var]" _show_variable
- }
- }
- }
-
-itcl::body SrcTextWin::balloon_value {variable} {
-
- catch {$variable value} value
- set value [string trim $value \ \r\t\n]
-
- # Insert the variable's type for things like ptrs, etc.
- catch {$variable type} type
- if {$value == "{...}"} {
- set val "$type $value"
- } elseif {[regexp -- {0x([0-9a-fA-F]+) <[a-zA-Z_].*} $value str]} {
- set val $str
- } elseif {[string first * $type] != -1} {
- set val "($type) $value"
- } elseif {[string first \[ $type] != -1} {
- set val "$type"
- } else {
- set val "$value"
- }
-
- return $val
-}
-
-# ------------------------------------------------------------------
-# METHOD: ClearTags - clear all tags
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::ClearTags {} {
- foreach tag {PC_TAG BROWSE_TAG STACK_TAG} {
- catch {
- $twin tag remove $tag $current(line).2 $current(line).end
- $twin tag remove $tag $pc(line).2 $pc(line).end
- $twin tag remove $tag $current(asm_line).2 $current(asm_line).end
- if {$bwin != ""} {
- $bwin tag remove $tag $current(asm_line).2 $current(asm_line).end
- }
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _mtime_changed - check if the modtime for a file
-# has changed.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::_mtime_changed {filename} {
- global gdbtk_platform
-
- if [catch {gdb_find_file $filename} f] {
- set r 1
- } elseif {$f == ""} {
- set r 1
- } else {
- if {[string compare $gdbtk_platform(os) "cygwin"] == 0} {
- set f [ide_cygwin_path to_win32 $f]
- }
- if {[catch {file mtime $f} mtime]} {
- debug "Could not stat file \"$f\" - \"$mtime\""
- # The return code is not of much significance in this case
- return 1
- }
- if {![info exists Stwc($filename:mtime)]} {
- debug "no mtime. resetting to zero"
- set Stwc($filename:mtime) 0
- }
- # debug "Stwc($filename:mtime)=$Stwc($filename:mtime); mtime=$mtime"
-
- if {$mtime == $Stwc($filename:mtime)} {
- set r 0
- } else {
- set r 1
- set Stwc($filename:mtime) $mtime
- set Stwc($filename:dirty) 1
- }
- }
-
- return $r
-}
-
-# ------------------------------------------------------------------
-# METHOD: FillSource - fill a window with source
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::FillSource {w tagname filename funcname line addr pc_addr lib} {
- global gdb_running
- upvar ${w}win win
-
-# debug "$gdb_running $tagname line=$line pc(line)=$pc(line)"
-# debug "current(filename)=$current(filename) filename=$filename"
-
- if {$filename != ""} {
- # load new file if necessary
- set mtime [_mtime_changed $filename]
- if {[string compare $filename $current(filename)] != 0 \
- || $mode_changed || $mtime} {
- if {![LoadFile $w $filename $lib $mtime]} {
- # failed to find source file
- dbug W "Changing to ASSEMBLY"
-
- # We have to update this data here (it is also done by the caller)
- # because we want to call mode, which calls mode_set, which calls
- # location using these values.
- set current(line) $line
- set current(tag) $tagname
- set current(addr) $addr
- set current(funcname) $funcname
- set current(filename) $filename
- set current(lib) $lib
-
- set oldmode SOURCE
- $parent mode "" ASSEMBLY
- return
- }
- if {$current(mode) != "SRC+ASM"} {
- # reset this flag in FillAssembly for SRC+ASM mode
- set mode_changed 0
- }
- }
-
-# debug "cf=$current(filename) pc=$pc(filename) filename=$filename"
- if {$current(filename) != ""} {
- if {$gdb_running && $pc(filename) == $filename} {
- # set the PC tag in this file
- $win tag add PC_TAG $pc(line).2 $pc(line).end
- }
- if {$tagname != "PC_TAG"} {
- if {$gdb_running && ($pc(filename) == $filename) \
- && ($pc(line) == $line)} {
- # if the tag is on the same line as the PC, set a PC tag
- $win tag add PC_TAG $line.2 $line.end
- } else {
- $win tag add $tagname $line.2 $line.end
- }
- }
- if {$pc(filename) == $filename && $line == 0} {
- # no line specified, so show line with PC
- display_line $win $pc(line)
- } else {
- display_line $win $line
- }
- }
- return
- }
- # no source; switch to assembly
- dbug W "no source file; switch to assembly"
-
- # We have to update this data here (it is also done by the caller)
- # because we want to call mode, which calls mode_set, which calls
- # location using these values.
- set current(line) $line
- set current(tag) $tagname
- set current(addr) $addr
- set current(funcname) $funcname
- set current(filename) $filename
- set current(lib) $lib
-
- set oldmode $current(mode)
- $parent mode "" ASSEMBLY
-}
-
-# ------------------------------------------------------------------
-# METHOD: FillAssembly - fill a window with disassembled code
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::FillAssembly {w tagname filename funcname line addr pc_addr lib} {
- global gdb_running
- upvar ${w}win win
- upvar _${w}pane pane
-# debug "$win $tagname $filename $funcname $line $addr $pc_addr"
-# debug "mode_changed=$mode_changed"
-# debug "funcname=$funcname"
-# debug "current(funcname)=$current(funcname)"
- if {$funcname == ""} {
- set oldpane $pane
- set pane $Stwc(gdbtk_scratch_widget:pane)
- set win [[$itk_interior.p childsite $pane].st component text]
- $win delete 0.0 end
- $win insert 0.0 "Select function name to disassemble"
- if {$oldpane != "" && $oldpane != $pane} {
- $itk_interior.p replace $oldpane $pane
- } else {
- $itk_interior.p show $pane
- }
- return
- } elseif {$funcname != $current(funcname) || $mode_changed
- || ([info exists Stwc($addr:dirty)] && $Stwc($addr:dirty))} {
- set mode_changed 0
- set oldpane $pane
- set result [LoadFromCache $w $addr A $lib]
- if {$result == 1} {
- #debug "Disassembling at $addr"
- #debug "cf=$current(filename) name=$filename"
- if {[catch {gdb_load_disassembly $win nosource \
- [scope _map] $Cname $addr} mess]} {
- # print some intelligent error message?
- dbug E "Disassemble failed: $mess"
- UnLoadFromCache $w $oldpane $addr A $lib
- set pane $Stwc(gdbtk_scratch_widget:pane)
- set win [[$itk_interior.p childsite $pane].st component text]
- $win delete 0.0 end
- $win insert 0.0 "$mess"
- if {$oldpane != "" && $oldpane != $pane} {
- $itk_interior.p replace $oldpane $pane
- } else {
- $itk_interior.p show $pane
- }
- } else {
- debug "address range is $mess"
- }
- } elseif {$result == 0} {
- debug "LoadFromCache returned 0"
- } else {
- # This branch should not ever happen. In assembly mode, there
- # are no checks in LoadFromCache that can fail.
- debug "LoadFromCache returned -1"
- }
- set current(filename) $filename
- set do_display_breaks 1
- }
-
- # highlight proper line number
- _highlightAsmLine $win $addr $pc_addr $tagname $filename $funcname
-
- display_line $win $current(asm_line)
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: FillMixed - fill a window with mixed source and assembly
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::FillMixed {w tagname filename funcname line addr pc_addr lib} {
- global gdb_running
- upvar ${w}win win
- upvar _${w}pane pane
-# debug "$win $tagname $filename $funcname $line $addr $pc_addr"
-
- if {$funcname == ""} {
- set oldpane $pane
- set pane $Stwc(gdbtk_scratch_widget:pane)
- set win [[$itk_interior.p childsite $pane].st component text]
- $win delete 0.0 end
- $win insert 0.0 "Select function name to disassemble"
- if {$oldpane != ""} {
- $itk_interior.p replace $oldpane $pane
- } else {
- $itk_interior.p show $pane
- }
- } elseif {$funcname != $current(funcname) || $mode_changed
- || ([info exists Stwc($funcname:dirty)] && $Stwc($funcname:dirty))} {
- set mode_changed 0
- set oldpane $pane
- if {[LoadFromCache $w $funcname M $lib]} {
- # debug "Disassembling at $addr"
- if {[catch {gdb_load_disassembly $win source \
- [scope _map] $Cname $addr} mess] } {
- # print some intelligent error message
- dbug W "Disassemble Failed: $mess"
- UnLoadFromCache $w $oldpane $funcname M $lib
- set current(line) $line
- set current(tag) $tagname
- set current(addr) $addr
- set current(funcname) $funcname
- set current(filename) $filename
- set current(lib) $lib
- set oldmode MIXED
- $parent mode "" ASSEMBLY
- return
- } else {
- debug "address range is $mess"
- }
- }
- set current(filename) $filename
- # now set the breakpoints
- set do_display_breaks 1
- }
-
- # highlight proper line number
- _highlightAsmLine $win $addr $pc_addr $tagname $filename $funcname
- display_line $win $current(asm_line)
-}
-
-# ------------------------------------------------------------------
-# METHOD: _highlightAsmLine - highlight the current execution line
-# in one of the assembly modes
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::_highlightAsmLine {win addr pc_addr \
- tagname filename funcname} {
- global gdb_running
-
- # Some architectures allow multiple instructions in each asm source
- # line...
- if {[info exists _map($Cname,pc=$addr)]} {
- set current(asm_line) $_map($Cname,pc=$addr)
- } else {
- set x [gdb_incr_addr $current(addr) -2]
- if {[info exists _map($Cname,pc=$x)]} {
- set current(asm_line) $_map($Cname,pc=$x)
- }
- }
-
- # if current file has PC, highlight that too
- if {$gdb_running && $tagname != "PC_TAG" && $pc(filename) == $filename
- && $pc(func) == $funcname} {
- set pc(asm_line) $_map($Cname,pc=$pc_addr)
- $win tag add PC_TAG $pc(asm_line).2 $pc(asm_line).end
- }
-
- # don't set browse tag if it is at PC
- if {$pc_addr != $addr || $tagname == "PC_TAG"} {
- # HACK. In STACK mode we usually want the previous instruction
- # but not when we are browsing a trace experiment.
- if {[string compare $tagname "STACK_TAG"] == 0 && !$Browsing} {
- incr current(asm_line) -1
- }
- $win tag add $tagname $current(asm_line).2 $current(asm_line).end
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: set_tag - update tag to STACK without making other changes
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::set_tag_to_stack {} {
- foreach window [list $twin $bwin] {
- if {$window == ""} then {
- continue
- }
- foreach {start end} [$window tag ranges PC_TAG] {
- $window tag remove PC_TAG $start $end
- $window tag add STACK_TAG $start $end
- }
- }
- set current(tag) STACK_TAG
-}
-
-# ------------------------------------------------------------------
-# METHOD: location - display a location in a file
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::location {tagname filename funcname line addr pc_addr lib} {
-# debug "$tagname $filename $line $addr $pc_addr, mode=$current(mode) oldmode=$oldmode cf=$current(filename) lib=$lib"
-
- ClearTags
-
- # It seems odd to do this as a string compare, but on the Alpha,
- # where ints are 32 bit but addresses are 64, a numerical compare
- # will overflow Tcl's ints.
-
- if {$tagname == "PC_TAG" && [string compare $addr $pc_addr] == 0} {
- set pc(filename) $filename
- set pc(line) $line
- set pc(addr) $addr
- set pc(func) $funcname
- set pc(lib) $lib
- }
-
- if {$oldmode != "" \
- && [string compare $filename $current(filename)] != 0} {
-
- if [catch {gdb_find_file $filename} fullname] {
- dbug W "$filename: $fullname"
- set fullname ""
- }
-
- if {$fullname != ""} {
- set tmp $oldmode
- set oldmode ""
- $parent mode "" $tmp 0
- }
- }
-
- set oldpane $_tpane
-
- switch $current(mode) {
- SOURCE {
- FillSource t $tagname $filename $funcname $line $addr $pc_addr $lib
- }
- ASSEMBLY {
- FillAssembly t $tagname $filename $funcname $line $addr $pc_addr $lib
- }
- MIXED {
- FillMixed t $tagname $filename $funcname $line $addr $pc_addr $lib
- }
- SRC+ASM {
- FillSource t $tagname $filename $funcname $line $addr $pc_addr $lib
- # This may seem redundant, but it is NOT. FillSource can change
- # the mode from SOURCE to ASSEMBLY if sources were not found. If
- # this happens, then MIXED mode is pointless, so forget the bottom
- # pane.
- if {$current(mode) == "SRC+ASM"} {
- FillAssembly b $tagname $filename $funcname $line $addr $pc_addr $lib
- }
- }
- }
-
- # After switching panes, clear the previous pane's cursor so that it isn't
- # used as the default when no other cursors are set.
- if { "$oldpane" != "$_tpane" } {
- $twin configure -cursor ""
- }
-
- set current(line) $line
- set current(tag) $tagname
- set current(addr) $addr
- set current(funcname) $funcname
- set current(filename) $filename
- set current(lib) $lib
- if {$do_display_breaks} {
- display_breaks
- set do_display_breaks 0
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: LoadFile - loads in a new source file
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::LoadFile {w name lib mtime_changed} {
- debug "$name $current(filename) $current(mode)"
- upvar ${w}win win
- upvar _${w}pane pane
-
- set oldpane $pane
- set result [LoadFromCache $w $name "S" $lib]
- if {$result == -1} {
- # This is a source file we could not find the source for...
- return 0
- } elseif {$result == 1 || $mtime_changed} {
- $win delete 0.0 end
- debug "READING $name"
- if {[catch {gdb_loadfile $win $name $Linenums} msg]} {
- dbug W "Error opening $name: $msg"
- #if {$msg != ""} {
- # tk_messageBox -icon error -title "GDB" -type ok \
- # -modal task -message $msg
- #}
- UnLoadFromCache $w $oldpane $name "" $lib
- return 0
- }
- }
- set current(filename) $name
- # Display all breaks/traces
- set do_display_breaks 1
- return 1
-}
-
-# ------------------------------------------------------------------
-# METHOD: display_line - make sure a line is displayed and near the center
-# ------------------------------------------------------------------
-
-itcl::body SrcTextWin::display_line { win line } {
- ::update idletasks
- # keep line near center of display
- set pixHeight [winfo height $win]
- set topLine [lindex [split [$win index @0,0] .] 0]
- set botLine [lindex [split [$win index @0,${pixHeight}] .] 0]
- set margin [expr {int(0.2*($botLine - $topLine))}]
- if {$line < [expr {$topLine + $margin}]} {
- set num [expr {($topLine - $botLine) / 2}]
- } elseif {$line > [expr {$botLine - $margin}]} {
- set num [expr {($botLine - $topLine) / 2}]
- } else {
- set num 0
- }
- $win yview scroll $num units
- $win see $line.0
-}
-
-# ------------------------------------------------------------------
-# METHOD: display_breaks - insert all breakpoints and tracepoints
-# uses current(filename) in SOURCE mode
-# ------------------------------------------------------------------
-
-itcl::body SrcTextWin::display_breaks {} {
-# debug
-
- # clear any previous breakpoints
- foreach type "$bp_types tp" {
- foreach {start stop} [$twin tag ranges ${type}_tag] {
- scan $start "%d." linenum
- removeBreakTag $twin $linenum ${type}_tag
- }
- }
-
- # now do second pane if it exists
- if {[info exists bwin]} {
- foreach type "$bp_types tp" {
- foreach {start stop} [$twin tag ranges ${type}_tag] {
- scan $start "%d." linenum
- removeBreakTag $twin $linenum ${type}_tag
- }
- }
- }
-
- # Display any existing breakpoints.
- foreach bpnum [gdb_get_breakpoint_list] {
- set info [gdb_get_breakpoint_info $bpnum]
- set addr [lindex $info 3]
- set line [lindex $info 2]
- set file [lindex $info 0]
- set type [lindex $info 6]
- set enabled [lindex $info 5]
- bp create $bpnum $addr $line $file $type $enabled
- }
- # Display any existing tracepoints.
- foreach bpnum [gdb_get_tracepoint_list] {
- set info [gdb_get_tracepoint_info $bpnum]
- set addr [lindex $info 3]
- set line [lindex $info 2]
- set file [lindex $info 0]
- bp create $bpnum $addr $line $file tracepoint
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: insertBreakTag - insert the right amount of tag chars
-# into the text window WIN, at line linenum.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::insertBreakTag {win linenum tag} {
-# debug "$win $linenum $tag"
-
- # Get the tags at the current line.
-
- # If there is a "break_rgn_tag", then there are currently no other
- # break/trace points at this line. So replace the break_rgn_tag
- # with this tag. Otherwise, add the new tag, and then the joint
- # tag. We will query the length of the previous tag, so we don't have
- # to hard code it here.
-
- set tag_list [$win tag names $linenum.0]
- set img_name [string range $tag 0 [expr [string length $tag] - 5]]
-
- if {[lsearch $tag_list break_rgn_tag] != -1} {
- set stop [lindex [$win tag nextrange break_rgn_tag \
- $linenum.0 "$linenum.0 lineend"] 1]
- $win tag remove break_rgn_tag $linenum.0 "$linenum.0 lineend"
- $win delete $linenum.0
-
- # Strip the "_tag" off the end of the tag to get the image name.
- $win image create $linenum.0 -image $break_images($img_name)
- $win tag add $tag $linenum.0 $stop
- } else {
- set other_tag [lindex $tag_list \
- [lsearch -glob $tag_list {*[bt]p_tag}]]
- if {$other_tag == ""} {
- set stop 4
- } else {
- set stop [lindex [$win tag nextrange $other_tag \
- $linenum.0 "$linenum.0 lineend"] 1]
- }
-
- $win tag add $tag $linenum.0 $stop
- $win image configure $linenum.0 -image $break_images($img_name)
-
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: removeBreakTag - remove a break tag (breakpoint or tracepoint)
-# from the given line. If this is the last break tag on the
-# line reinstall the break_rgn_tag
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::removeBreakTag {win linenum tag } {
-# debug "$win $linenum $tag"
-
- set tag_list [$win tag names $linenum.0]
-
- if {[set pos [lsearch -exact $tag_list $tag]] == -1} {
- debug "Tried to remove non-existant tag $tag"
- return
- } else {
- set tag_list [lreplace $tag_list $pos $pos]
- }
-
- # Use the range of the removed tag for any insertions, so we don't
- # have to hard code it here.
-
- set stop [lindex [$win tag nextrange $tag \
- $linenum.0 "$linenum.0 lineend"] 1]
-
- $win tag remove $tag $linenum.0 "$linenum.0 lineend"
-
- # Now check what other tags are on this line. If there are both bp & tp
- # tags, also remove the joint tag, otherwise install the break_rgn_tag.
-
- switch -glob $tag {
- *bp_tag {
- set only_one_tag [expr [set next_tag_index \
- [lsearch -glob $tag_list tp_tag]] == -1]
- }
- tp_tag {
- # Got to find out what kind of tag is here...
- set only_one_tag [expr [set next_tag_index \
- [lsearch -glob $tag_list *bp_tag]] == -1]
- }
- }
-
- if {$only_one_tag} {
- catch {$win image configure $linenum.0 -image {}}
- $win delete $linenum.0
- $win insert $linenum.0 "-"
- $win tag add break_rgn_tag $linenum.0 $stop
- } else {
- set other_tag [lindex $tag_list $next_tag_index]
- set img_name [string range $other_tag 0 \
- [expr [string length $other_tag] - 5]]
- $win image configure $linenum.0 -image $break_images($img_name)
- $win tag remove bp_and_tp_tag $linenum.0 "$linenum.0 lineend"
- }
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: breakpoint - Handle a breakpoint create, delete,
-# or modify event from the backend.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::breakpoint {bp_event} {
-
- bp [$bp_event get action] [$bp_event get number] [$bp_event get address] \
- [$bp_event get line] [$bp_event get file] [$bp_event get disposition] \
- [$bp_event get enabled] [$bp_event get thread]
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: tracepoint - Handle a tracepoint create, delete,
-# modify event from the backend.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::tracepoint {tp_event} {
-
- bp [$tp_event get action] [$tp_event get number] [$tp_event get address] \
- [$tp_event get line] [$tp_event get file] tracepoint \
- [$tp_event get pass_count]
-}
-
-# ------------------------------------------------------------------
-# METHOD: bp - set and remove breakpoints
-#
-# if $addr is valid, the breakpoint will be set in the assembly or
-# mixed window at that address. If $line and $file are valid,
-# a breakpoint will be set in the source window if appropriate.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::bp {action bpnum addr {linenum {}} {file {}} {type 0} {enabled 0} {thread -1}} {
-# debug "$action addr=$addr line=$linenum file=$file type=$type current(filename)=$current(filename)"
-
- switch $current(mode) {
- SOURCE {
- if {[string compare $file $current(filename)] == 0 && $linenum != {}} {
- do_bp $twin $action $linenum $type $bpnum $enabled $thread 0
- }
- }
-
- SRC+ASM {
- if {$addr != {} && [info exists _map($Cname,pc=$addr)]} {
- do_bp $bwin $action $_map($Cname,pc=$addr) $type $bpnum \
- $enabled $thread 1
- }
- if {[string compare $file $current(filename)] == 0 && $linenum != {}} {
- do_bp $twin $action $linenum $type $bpnum $enabled $thread 0
- }
- }
-
- ASSEMBLY {
- if {$addr != {} &&[info exists _map($Cname,pc=$addr)]} {
- do_bp $twin $action $_map($Cname,pc=$addr) $type $bpnum \
- $enabled $thread 1
- }
- }
-
- MIXED {
- if {$addr != {} && [info exists _map($Cname,pc=$addr)]} {
- do_bp $twin $action $_map($Cname,pc=$addr) $type $bpnum \
- $enabled $thread 1
- }
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: do_bp - bp helper function
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::do_bp { win action linenum type bpnum enabled thread asm} {
-# debug "$action line=$linenum type=$type bpnum=$bpnum enabled=$enabled thread=$thread"
-
- if {$dont_change_appearance} {
- return
- }
-
- if {$action == "delete" && [string compare $type tracepoint] != 0} {
- # make sure there are no more breakpoints on
- # this line.
- if {!$asm} {
- set bps [gdb_find_bp_at_line $current(filename) $linenum]
- } else {
- if {[info exists _map($Cname,line=$linenum)]} {
- set bps [gdb_find_bp_at_addr $_map($Cname,line=$linenum)]
- } else {
- set bps {}
- }
- }
- if {[llength $bps] > 0} {
- foreach b $bps {
- if {$b != $bpnum} {
- # OK we found another BP on this line.
- # So we really just want to modify whats
- # displayed on the line instead of deleting it.
- # Also, for lack of a better solution, we will
- # just display an image corresponding to the
- # first found BP. If you have a temporary and
- # a perm BP on the same line, the image for the one
- # with the lower bpnum will be displayed.
- set inf [gdb_get_breakpoint_info $b]
- set action "modify"
- set type [lindex $inf 6]
- set bpnum $b
- break
- }
- }
- }
- }
-
- if {[string compare $type "tracepoint"] == 0} {
- if {[string compare $action "delete"] != 0
- && [lindex [gdb_get_tracepoint_info $bpnum] 4] == 0} {
- set type disabled_tracepoint
- }
- } else {
- if {$enabled == "0" } {
- set type disabled_bp
- } elseif {$thread != "-1"} {
- set type thread
- }
- }
-
- switch $type {
- donttouch {
- set tag_type bp_tag
- set remove_type disabled_bp_tag
- }
- delete {
- set tag_type temp_bp_tag
- }
- disabled_bp {
- set tag_type disabled_bp_tag
- set remove_type bp_tag
- }
- tracepoint {
- set tag_type tp_tag
- set remove_type disabled_tp_tag
- }
- disabled_tracepoint {
- set tag_type disabled_tp_tag
- set remove_type tp_tag
- }
- thread {
- set tag_type thread_bp_tag
- }
- default {
- dbug E "UNKNOWN BP TYPE action=\"$action\" type=\"$type\""
- $win insert $linenum.0 "X" bp_tag
- set tag_type bp_tag
- }
- }
-
- if {[string compare $action "delete"] == 0} {
- removeBreakTag $win $linenum $tag_type
- } else {
- if {[string compare $action "modify"] == 0 && $remove_type != ""} {
- removeBreakTag $win $linenum $remove_type
- }
- insertBreakTag $win $linenum $tag_type
- }
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: hasBP - see if a line number has a breakpoint set
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::hasBP {win line} {
- if {$win == ""} {
- set win $popups(saved_win)
- }
-
- if {[lsearch -glob [$win tag names $line.0] *bp_tag] >= 0} {
- return 1
- }
- return 0
-}
-
-# ------------------------------------------------------------------
-# METHOD: hasTP - see if a line number has a tracepoint set
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::hasTP {win line} {
- if {$win == ""} {
- set win $popups(saved_win)
- }
-
- if {[lsearch -exact [$win tag names $line.0] tp_tag] == 1} {
- return 1
- }
- return 0
-}
-
-# ------------------------------------------------------------------
-# METHOD: report_source_location
-#
-# This function reports the "current" location in the source
-# window, where current means what gdb_loc would return, if
-# that point is actually visible in the window, or the middle
-# of the current window, if that point is not visible.
-#
-# Return:
-# The gdb_loc result for the location found
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::report_source_location {} {
-
- if {$current(filename) == ""} {
- error "No source file in window"
- }
-
- # Figure out if the return from gdb_loc is visible.
-
- set not_visible 1
- if {![catch {gdb_loc} loc_info]} {
- set loc_long_name [lindex $loc_info 2]
- set loc_line [lindex $loc_info 3]
-# debug "Got loc_info: \"$loc_info\" and filename $current(filename) long_name: $loc_long_name"
- if {[string compare $current(filename) $loc_long_name] != 0} {
- set not_visible 1
- } else {
- foreach {name line} [lookup_line $twin 1] {
- break
- }
- if {$line < $loc_line} {
- foreach {name line} [lookup_line $twin [winfo height $twin]] {
- break
- }
- if {$line > $loc_line} {
- set not_visible 0
- }
- }
- }
- } else {
- debug "gdb_loc returned $loc_info"
- }
-
- if {$not_visible} {
- set y [expr int([winfo height $twin] / 2)]
- foreach {name line addr type} [lookup_line $twin $y] {
- break
- }
- switch $type {
- src {
- return [gdb_loc $name:$addr]
- }
- asm {
- return [gdb_loc *$addr]
- }
- }
- } else {
- return $loc_info
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: lookup_line - translated win & y position line info
-#
-# If win is {}, or y is -1, then the saved values from the popup
-# array are used.
-#
-# Return:
-# name - the fileName
-# line - the line number in the text widget
-# addr - the source line number, if in source mode, the
-# address if in assembly mode, and if in mixed mode,
-# the line if it is a source line, or the address if it
-# is an assembly line
-# type - src if it is a source line, asm if an assembly line.
-# set_cmd - for convenience, this is the command needed to set a
-# breakpoint at this address.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::lookup_line {win y} {
- #debug "$win $y"
- if {$y == -1} {
- set y $popups(saved_y)
- }
-
- if {$win == {}} {
- set win $popups(saved_win)
- }
-
- scan [$win index @0,$y] "%d." line
- set name [lindex [::file split $current(filename)] end]
-
- # If we are in the SOURCE window (either because the mode is SOURCE,
- # or SRC+ASM, and we are in the upper pane, then return the
- if {([string compare $current(mode) SOURCE] == 0)
- || ([string compare $current(mode) SRC+ASM] == 0
- && [string compare $win $twin] == 0)} {
- set addr $line
- set type "src"
- } else {
- if {[info exists _map($Cname,line=$line)]} {
- set addr $_map($Cname,line=$line)
- set type "asm"
- } else {
- # This is a source line in MIXED mode
- set line_contents [$win get $line.0 "$line.0 lineend"]
- #debug "Looking at line: $line contents: \"$line_contents\""
- regexp "^\t(\[0-9\]*)" $line_contents match srcline
- set addr $srcline
- set type "src"
- }
- }
-
- switch $type {
- asm {
- set set_cmd [list gdb_set_bp_addr $addr]
- }
- src {
- set set_cmd [list gdb_set_bp $current(filename) $addr]
- }
- }
-
- #debug "Lookup line returning [list $name $line $addr $type $set_cmd]"
- return [list $name $line $addr $type $set_cmd]
-}
-
-# ------------------------------------------------------------------
-# METHOD: continue_to_here - Advance to the line pointed to by the
-# y coordinate in the window win. If win is {} or y is -1, the values
-# saved in the popups array are used.
-#
-# The threads parameter is not currently used.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::continue_to_here {{win {}} {y -1} {threads -1}} {
-
- # Look up the line... This foreach is an lassign...
- foreach {name line addr type set_cmd} [lookup_line $win $y] {
- break
- }
-
- set dont_change_appearance 1
- foreach i [gdb_get_breakpoint_list] {
- set enabled($i) [lindex [gdb_get_breakpoint_info $i] 5]
- }
- gdb_cmd "disable"
- eval $set_cmd temp $threads
- gdb_immediate "continue"
- gdb_cmd "enable"
- foreach i [gdb_get_breakpoint_list] {
- if {![info exists enabled($i)]} {
- gdb_cmd "delete $i"
- } elseif {!$enabled($i)} {
- gdb_cmd "disable $i"
- }
- }
- set dont_change_appearance 0
-}
-
-# ------------------------------------------------------------------
-# METHOD: jump_to_here - Advance to the line pointed to by the
-# y coordinate in the window win. If win is {} or y is -1, the values
-# saved in the popups array are used.
-#
-# The threads parameter is not currently used.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::jump_to_here {{win {}} {y -1} {threads -1}} {
-
- # Look up the line... This foreach is an lassign...
- foreach {name line addr type set_cmd} [lookup_line $win $y] {
- break
- }
-
- # Unfortunately we cant set the pc to a linespec and we have to do a
- # trick with a temporary breakpoint and the jump command.
- # FIXME: Get the address from the linespec.
- # FIXME: Even in the case we do have an address, I was not able to just
- # change the PC and get things updated wright. While I work on that,
- # I will use the temp breakpoint and jump trick for that case as well.
-
- set dont_change_appearance 1
-
- foreach i [gdb_get_breakpoint_list] {
- set enabled($i) [lindex [gdb_get_breakpoint_info $i] 5]
- }
- gdb_cmd "disable"
-
- if {$type == "asm"} {
- gdb_immediate "tbreak *$addr"
- gdb_immediate "jump *$addr"
- } else {
- eval $set_cmd temp $threads
- gdb_immediate "jump $name:$line"
- }
- gdb_cmd "enable"
- foreach i [gdb_get_breakpoint_list] {
- if {![info exists enabled($i)]} {
- gdb_cmd "delete $i"
- } elseif {!$enabled($i)} {
- gdb_cmd "disable $i"
- }
- }
- set dont_change_appearance 0
-}
-
-# ------------------------------------------------------------------
-# METHOD: set_bp_at_line - called when an empty break tag is clicked on
-#
-# When "threads" is set it means to set a bp on each thread in the list.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::set_bp_at_line {{type N} {win {}} {y -1} {threads "-1"}} {
-# debug "$win $y $type $current(filename) Tracing=$Tracing"
- if {$Running} {return}
-
- # Look up the line... This foreach is an lassign...
-
- foreach {name line addr addr_type set_cmd} [lookup_line $win $y] {
- break
- }
-
- foreach th $threads {
- switch $type {
- N {
- if {[catch {eval $set_cmd normal $th} msg]} {
- dbug W $msg
- }
- }
- T {
- if {[catch {eval $set_cmd temp $th} msg]} {
- dbug W $msg
- }
- }
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: enable_disable_at_line - Enable or disable breakpoint
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::enable_disable_at_line {action} {
- if {$Running} {
- return
- }
-
- # FIXME: should this work on $bwin as well? In that case we'd need
- # a `win' argument...
-
- set y $popups(saved_y)
-
- $twin tag remove _show_variable 1.0 end
- set line [lindex [split [$twin index @0,$y] .] 0]
- set bps ""
-
- switch $current(mode) {
- SRC+ASM {
- }
- ASSEMBLY {
- if {[info exists _map($Cname,line=$line)]} {
- set addr $_map($Cname,line=$line)
- set bps [gdb_find_bp_at_addr $addr]
- } else {
- return
- }
- }
- MIXED {
- if {[info exists _map($Cname,line=$line)]} {
- set addr $_map($Cname,line=$line)
- set bps [gdb_find_bp_at_addr $addr]
- } else {
- return
- }
- }
- }
-
- if {$bps == ""} {
- set bps [gdb_find_bp_at_line $current(filename) $line]
- }
-
- # ACTION is `enable' or `disable'
- gdb_cmd "$action $bps"
-}
-
-# ------------------------------------------------------------------
-# METHOD: remove_bp_at_line - called when a bp tag is clicked on
-#
-# when "threads" is set it means to set a bp on each thread in the list.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::remove_bp_at_line {{win {}} {y -1}} {
-
- if {$Running} {return}
-
- # Look up the line... This foreach is an lassign...
-
- foreach {name line addr type} [lookup_line $win $y] {
- break
- }
-
- # FIXME: if there are multiple bp/tp at a single line,
- # we will (right now) always take the first one we find...
- switch $type {
- src { set bps [gdb_find_bp_at_line $name $addr] }
- asm { set bps [gdb_find_bp_at_addr $addr] }
- }
-
- set number [lindex $bps 0]
- gdb_cmd "delete $number"
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: set_tp_at_line - called when an empty break region tag is clicked on
-#
-# when "threads" is set it means to set a bp on each thread in the list.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::set_tp_at_line {{win {}} {y -1}} {
-# debug "$win $y $current(filename) Tracing=$Tracing"
-
- if {$Running} {return}
-
- # Look up the line... This foreach is an lassign...
-
- foreach {name line addr type} [lookup_line $win $y] {
- break
- }
-
- switch $type {
- src {
- after idle [list ManagedWin::open TraceDlg -File $name -Lines $addr]
- }
- asm {
- after idle [list ManagedWin::open TraceDlg -File $name -Addresses [list $addr]]
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: next_hit_at_line - Finds the next trace hit at the line
-# given by win & y...
-#
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::next_hit_at_line {{win {}} {y -1}} {
-# debug "$win $y $current(filename) Tracing=$Tracing"
-
- if {!$Browsing} {return}
-
- # Look up the line... This foreach is an lassign...
-
- foreach {name line addr type} [lookup_line $win $y] {
- break
- }
-
- # If the line and the addr are the same, then the specification was
- # given by line. Otherwise is was a memory address.
-
- switch $type {
- src {
- tfind_cmd "tfind line $name:$addr"
- }
- asm {
- tfind_cmd "tfind line *$addr"
- }
- }
-
-}
-
-# ------------------------------------------------------------------
-# METHOD: remove_tp_at_line - called when a tp tag is clicked on
-#
-# when "threads" is set it means to set a bp on each thread in the list.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::remove_tp_at_line {{win {}} {y -1}} {
-
- if {$Running} {return}
-
- # Look up the line... This foreach is an lassign...
-
- foreach {name line addr type} [lookup_line $win $y] {
- break
- }
- switch $type {
- src {
- set tp_num [gdb_tracepoint_exists $name:$addr]
- }
- asm {
- set tp_num [gdb_tracepoint_exists *$addr]
- }
- }
-
- if {$tp_num != -1} {
- if {[catch {gdb_cmd "delete tracepoints $tp_num"} errTxt]} {
- tk_messageBox -type error -message "Could not delete tracepoint number $tp_num
-Error was: $errTxt"
- }
- }
-
-}
-
-# ------------------------------------------------------------------
-# METHOD: do_tag_popup - The tag bind function for breakpoint popups
-# ------------------------------------------------------------------
-
-itcl::body SrcTextWin::do_tag_popup {name X Y y} {
-
-# debug "$name $X $Y $y"
-
- if {$Running || [winfo ismapped $popups($name)]} {
- return
- }
-
- set popups(saved_y) $y
- set popups(saved_win) [winfo containing -displayof $itk_interior $X $Y]
-
- # Hide variable balloons before showing the popup
- $twin tag remove _show_variable 1.0 end
- balloon withdraw $twin
-
- tk_popup $popups($name) $X $Y
-
-}
-
-# ------------------------------------------------------------------
-# METHOD: do_source_popup - tag bind function for source popups
-# ------------------------------------------------------------------
-
-itcl::body SrcTextWin::do_source_popup { X Y x y } {
- if {$Running || [winfo ismapped $popups(source)]} {
- return
- }
-
- # Figure out what window we are over...
- set win [winfo containing -displayof $itk_interior $X $Y]
-
- # Hide variable balloons before showing the popup
- $win tag remove _show_variable 1.0 end
- balloon withdraw $win
- catch {$_balloon_var delete}
-
-
- # Try to get the selection. If you fail, get the word around the
- # click point.
- # Note that we don't have to worry about the user clicking over the
- # break area, since the break_rgn_tag will override this...
-
- set hit_point [$win index @$x,$y]
- if {([$win tag ranges sel] != "")
- && ([$win compare sel.first < $hit_point]
- && [$win compare $hit_point < sel.last])} {
- set sel_first [$win index sel.first]
- set sel_last [$win index sel.last]
-
- # If there was a selection, see if it spans multiple lines.
- scan $sel_first "%d.%d" range_low sel_start_char
- scan $sel_last "%d.%d" range_high sel_end_char
-
- if {$range_low == $range_high} {
- set range -1
- set target_range [$win get sel.first sel.last]
- } else {
- # If the selection encompasses multiple lines, we only care about
- # the start and ending line numbers
- set range 1
- }
- } else {
- set target_range [$win get "$hit_point wordstart" "$hit_point wordend"]
- set range 0
- }
-
- $popups(source) delete 0 end
-
- if {$range && $Tracing} {
- # If the selection spans more than one line, it can't be a variable name...
- # So just insert the tracepoint range item
- $popups(source) add command -label "Set Tracepoint Range" \
- -command "$this tracepoint_range $win $range_low $range_high"
- $popups(source) add separator
- } elseif {$range != 1} {
- # RANGE = -1 means that we have already found the word we want (it was
- # a selection)...
- # RANGE = 1 means we got the word around the point, and we are just saving
- # getVariable the trouble of parsing it again.
- if {$range == -1} {
- set variable $target_range
- } else {
- set variable [lindex [getVariable -1 -1 $target_range] 0]
- }
-
- if {$variable != ""} {
- # LAME: check to see if VARIABLE is really a number (constants??)
- set is_var [catch {expr {$variable+1}}]
-
- if {$is_var} {
- $popups(source) add command -label "Add $variable to Watch" \
- -command [list $this addToWatch $variable]
- $popups(source) add command -label "Dump Memory at $variable" \
- -command [list ManagedWin::open MemWin -force -addr_exp $variable]
- $popups(source) add command -label "Set Breakpoint at $variable" \
- -command [list gdb_cmd "break $variable"]
- $popups(source) add separator
- }
- }
- }
-
- $popups(source) add command -label "Open Another Source Window" \
- -command {ManagedWin::open SrcWin -force}
- $popups(source) add command -label "Open Source in external editor" \
- -command [code $parent edit]
-
- tk_popup $popups(source) $X $Y
-}
-
-# ------------------------------------------------------------------
-# METHOD: addToWatch - add a variable to the watch window
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::addToWatch {var} {
- [ManagedWin::open WatchWin] add $var
-}
-
-# ------------------------------------------------------------------
-# METHOD: do_key -- wrapper for all key bindings
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::do_key {key} {
- if {!$Running} {
- switch $key {
- print { print $top }
- download { Download::download_it }
- run { $parent inferior run }
- stack { ManagedWin::open StackWin }
- registers { ManagedWin::open RegWin }
- memory { ManagedWin::open MemWin }
- watch { ManagedWin::open WatchWin }
- locals { ManagedWin::open LocalsWin }
- breakpoints { ManagedWin::open BpWin }
- console { ManagedWin::open Console }
- step { $parent inferior step }
- next { $parent inferior next }
- finish { $parent inferior finish }
- continue { $parent inferior continue }
- stepi { $parent inferior stepi }
- nexti { $parent inferior nexti }
- up { catch {gdb_cmd up} }
- down { catch {gdb_cmd down} }
- quit { gdbtk_quit }
- tdump { ManagedWin::open TdumpWin }
- tracepoints { ManagedWin::open BpWin -tracepoints 1}
- tfind_next { catch {gdb_immediate tfind} }
- tfind_prev { catch {gdb_immediate "tfind -"} }
- tfind_start { catch {gdb_immediate "tfind start"} }
- tfind_line { catch {gdb_immediate "tfind line"} }
- tfind_tp { catch {gdb_immediate "tfind tracepoint"} }
- open { catch {_open_file} }
- close { catch {_close_file} }
- browser { catch {ManagedWin::open BrowserWin} }
- thread_list { catch {ManagedWin::open ProcessWin} }
- debug { catch {ManagedWin::open DebugWin} }
- kod { catch {ManagedWin::open KodWin} }
- attach { catch {gdbtk_attach_native} }
- default {
- dbug E "Unknown key binding: \"$key\""
- }
- }
- } else {
-# debug "ignoring keypress -- running"
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: mode_get - get the source mode
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::mode_get {} {
- return $current(mode)
-}
-
-# ------------------------------------------------------------------
-# METHOD: mode_set - change the source mode
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::mode_set {new_mode {go 1}} {
- debug "$new_mode"
-
- if {$new_mode != $current(mode)} {
-
- if {$current(mode) == "SRC+ASM"} {
- if {$_bpane != ""} {$itk_interior.p hide $_bpane}
- set _bpane ""
- set _bwin ""
- }
-
- set current(mode) $new_mode
- set mode_changed 1
-
- if {$go} {
- location $current(tag) $current(filename) $current(funcname) \
- $current(line) $current(addr) $pc(addr) $current(lib)
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: cancelMotion - cancel any pending motion callbacks for
-# the source window's variable balloons
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::cancelMotion {} {
- catch {after cancel $timeoutID}
-}
-
-# ------------------------------------------------------------------
-# METHOD: motion - callback for mouse motion within the source
-# window's text widget
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::motion {type win x y} {
- global gdb_running
- cancelMotion
-
- # The showBalloon method can sometimes raise errors (for instance in
- # assembly code with no sources, and when gdb coughs over a path
- # that contains a space. These functions should error quietly.
- # but write to the debug window so we can trace problems.
-
- if {$type == "var"} {
- set cmd_bit ""
- } else {
- set cmd_bit BP
- }
- set cmd_line [format {
- if {[catch {%s show%sBalloon %s %d %d} err]} {
- debug "show%sBalloon got error: $err"
- }
- } $this $cmd_bit $win $x $y $cmd_bit]
- set timeoutID [after $TimeOut $cmd_line]
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: showBPBalloon - show BP information in a balloon
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::showBPBalloon {win x y} {
- if {$Running} { return }
- $win tag remove _show_variable 1.0 end
- set line [lindex [split [$win index @0,$y] .] 0]
- set bps ""
-
- switch $current(mode) {
- SRC+ASM {
- if {$win == $bwin} {
- if {[info exists _map($Cname,line=$line)]} {
- set addr $_map($Cname,line=$line)
- set bps [gdb_find_bp_at_addr $addr]
- } else {
- return
- }
- }
- }
- ASSEMBLY {
- if {[info exists _map($Cname,line=$line)]} {
- set addr $_map($Cname,line=$line)
- set bps [gdb_find_bp_at_addr $addr]
- } else {
- return
- }
- }
- MIXED {
- if {[info exists _map($Cname,line=$line)]} {
- set addr $_map($Cname,line=$line)
- set bps [gdb_find_bp_at_addr $addr]
- } else {
- return
- }
- }
- }
-
- if {$bps == ""} {
- set bps [gdb_find_bp_at_line $current(filename) $line]
- }
-
- set str ""
- set need_lf 0
- foreach b $bps {
- set bpinfo [gdb_get_breakpoint_info $b]
- lassign $bpinfo file func linenum addr type enabled disposition \
- ignore_count commands cond thread hit_count user_specification
- set file [lindex [file split $file] end]
- if {$enabled} {
- set enabled "ENA"
- } else {
- set enabled "DIS"
- }
-
- if {$need_lf} {append str \n}
-
- append str [format "breakpoint %d at %s:%d (%s)\n %s %s %s" \
- $b $file $linenum $addr $enabled $type $disposition]
-
- if {$thread != "-1"} {
- append str "\n threads: $thread"
- }
-
- if {$ignore_count != 0} {
- append str "\n ignore: $ignore_count"
- }
-
- if {$cond != ""} {
- append str "\n condition: $cond"
- }
-
- if {$commands != ""} {
- if {[string length $commands] > 50} {
- append str "\n commands: [string range $commands 0 50] ..."
- } else {
- append str "\n commands: $commands"
- }
- }
- set need_lf 1
- }
-
- # Scope out which break type is set here, and use the tag to get
- # the break region range...
-
- set tag_list [$win tag names $line.0]
- set break_tag [lindex $tag_list [lsearch -glob $tag_list *bp_tag]]
- set end [lindex [$win tag nextrange $break_tag $line.0 $line.end] 1]
-
- if {$end != ""} {
- $win tag add _show_variable $line.0 $end
- balloon register $win $str _show_variable
- balloon show $win _show_variable 1
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: showBalloon - (possibly) show a variable's value in
-# a balloon-help widget
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::showBalloon {win x y} {
- if {$Running} { return }
-
- $twin tag remove _show_variable 1.0 end
- catch {tmp delete}
-
-
- if {[catch {getVariable $x $y} variable]} {
- return
- }
-
- if {[llength $variable] != 3} {
- return
- }
-
- # We get the variable name, and its start and stop indices in the text
- # widget, so all we need to do is set the tag and register the balloon help
- set varName [lindex $variable 0]
- set start [lindex $variable 1]
- set stop [lindex $variable 2]
-
- # Get the address associated with this line
- foreach {file text_line source_line type} [lookup_line $twin $y] {
- break
- }
-
- # Reduce the areas over which we will show balloons.
- # 1) Only pop up a balloon if we are over the function in
- # the currently selected frame, or in the static data for
- # the file.
- # 2) We would also like to exclude cases where the line that
- # under the mouse cursor does not contain executable code,
- # but we can't since gdb considers continuation lines to not
- # have executible code so we would lose on these...
-
- set cur_fn [lindex [gdb_loc $file:$source_line] 1]
- set selected_frame_fn [lindex [gdb_loc] 1]
-
- if {[string compare $cur_fn $selected_frame_fn] == 0} {
- # Create the variable object
- catch {$_balloon_var delete}
- set err [catch {gdb_variable create -expr $varName} _balloon_var]
- if {!$err} {
- set value [balloon_value $_balloon_var]
- if {$value != ""} {
- $win tag add _show_variable $start $stop
-
- # display variable's value
- balloon register $twin "$varName=$value" _show_variable
- balloon show $win _show_variable
- } else {
- # No value/error. Don't show it.
- catch {$_balloon_var delete}
- set _balloon_var {}
- }
- } else {
- set _balloon_var {}
- }
- } else {
- set _balloon_var {}
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: getVariable - get the name of the 'variable' under the
-# mouse pointer in the text widget
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::getVariable {x y {line {}}} {
- #debug "$x $y $line"
- set hit_point [$twin index @$x,$y]
-
- if {$x != -1 && $y != -1} {
- # If we are over a selection, just report that:
- if {([$twin tag ranges sel] != "")
- && ([$twin compare sel.first < $hit_point]
- && [$twin compare $hit_point < sel.last])} {
- return [list [$twin get sel.first sel.last] [$twin index sel.first] [$twin index sel.last]]
- }
- # Since we will only be concerned with this line, get it
- set line [$twin get "$hit_point linestart" "$hit_point lineend"]
- # debug "new line=$line"
- set simple 0
- } else {
- # This is not quite right -- still want constants to appear...
- set simple 1
- }
-
- # The index into LINE that contains the char at which the pointer hangs
- set a [split [$twin index @$x,$y] .]
- set lineNo [lindex $a 0]
- set index [lindex $a 1]
- set s [string range $line $index end]
- set last {}
- foreach char [split $s {}] {
- if {[regexp -- {([^a-zA-Z0-9_>.-])} $char dummy]} {
- break
- }
- lappend last $char
- }
- set last [string trimright [join $last {}] ->]
-
- # Decrement index for string -- will need to increment it later
- incr index -1
- set tmp [string range $line 0 $index]
- set s {}
- foreach char [split $tmp {}] {
- set s [linsert $s 0 $char]
- }
-
- set first {}
- foreach char $s {
- if {[regexp -- {([^a-zA-Z0-9_>.-])} $char dummy]} {
- break
- }
- set first [linsert $first 0 $char]
- }
- #set first [string trimleft [join $first {}] ->]
- set first [join $first {}]
- #debug "FIRST=$first\nLAST=$last"
-
- # Validate the variable
- set variable [string trim $first$last \ ]
- if {!$simple && ![regexp {^[a-zA-Z_]} $variable dummy]} {
- #debug "Rejecting: $variable"
- return {}
- }
-
- incr index
- # Find the boundaries of this word in the text box
- set a [string length $first]
- set b [string length $last]
-
- # Gag! If there is a breakpoint at a line, this is off by one!
- if {[hasBP $twin $lineNo] || [hasTP $twin $lineNo]} {
- incr a -1
- incr b 1
- }
- set start "$lineNo.[expr {$index - $a}]"
- set end "$lineNo.[expr {$index + $b}]"
- return [list $variable $start $end]
-}
-
-# ------------------------------------------------------------------
-# METHOD: trace_help - update statusbar with ballon help message
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::trace_help {args} {
- upvar #0 ${this}_balloon a
- if {$a == ""} {
- $parent set_status
- } else {
- $parent set_status $a 1
- }
-}
-
-itcl::body SrcTextWin::line_is_executable {win line} {
- # there should be an image or a "-" on the line
- set res [catch {$win image cget $line.0 -image}]
- if {!$res || [$win get $line.0] == "-"} {
- return 1
- }
- return 0
-}
-
-# ------------------------------------------------------------------
-# METHOD: tracepoint_range - create tracepoints at every line in
-# a range of lines on the screen
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::tracepoint_range {win low high} {
-# debug "$win $low $high"
-
- switch $current(mode) {
- SOURCE {
- set lines {}
- for {set i $low} {$i <= $high} {incr i} {
- if {[line_is_executable $win $i]} {
- lappend lines $i
- }
- }
- }
-
- ASSEMBLY {
- set addrs {}
- for {set i $low} {$i <= $high} {incr i} {
- lappend addrs $_map($Cname,line=$i)
- }
- }
-
- MIXED {
- set addrs {}
- for {set i $low} {$i <= $high} {incr i} {
- if {[line_is_executable $win $i]} {
- lappend addrs $_map($Cname,line=$i)
- }
- }
- }
-
- SRC+ASM {
- if {$win == $awin} {
- # Assembly
- set addrs {}
- for {set i $low} {$i <= $high} {incr i} {
- lappend addrs $_map($Cname,line=$i)
- }
- } else {
- # Source
- set lines {}
- for {set i $low} {$i <= $high} {incr i} {
- if {[line_is_executable $win $i]} {
- lappend lines $i
- }
- }
- }
- }
- }
-
- if {[info exists lines]} {
-# debug "Got executible lines: $lines"
- if {[llength $lines]} {
- set name [::file tail $current(filename)]
- ManagedWin::open TraceDlg -File $name -Lines $lines
- }
- } elseif {[info exists addrs]} {
-# debug "Got executible addresses: $addrs"
- if {[llength $addrs]} {
- set name [::file tail $current(filename)]
- ManagedWin::open TraceDlg -File $name -Addresses $addrs
- }
- } else {
-# debug "Got no executible lines in the selected range..."
- }
-
- # Clear the selection -- it looks a lot better.
- $twin tag remove sel 1.0 end
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: search - search for text or jump to a specific line
-# in source window, going in the specified DIRECTION.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::search {exp direction} {
- if {$exp != ""} {
- set result {}
- if {[regexp {^@([0-9]+)} $exp dummy index]} {
- append index .0
- set end [$twin index "$index lineend"]
- } else {
- set index [$twin search -exact -count len -$direction -- $exp $SearchIndex]
-
- if {$index != ""} {
- set end [split $index .]
- set line [lindex $end 0]
- set char [lindex $end 1]
- set char [expr {$char + $len}]
- set end $line.$char
- set result "Match of \"$exp\" found on line $line"
- if {$direction == "forwards"} {
- set SearchIndex $end
- } else {
- set SearchIndex $index
- }
- }
- }
- if {$index != ""} {
- # Highlight word and save index
- $twin tag remove search 1.0 end
- $twin tag add search $index $end
- $twin see $index
- } else {
- set result "No match for \"$exp\" found"
- }
- return $result
- } else {
- $twin tag remove search 1.0 end
- }
-}
-
-# -----------------------------------------------------------------------------
-# NAME: SrcTextWin::LoadFromCache
-#
-# SYNOPSIS: LoadFromCache {w name asm lib}
-#
-# DESC: Looks up $name in the cache. If $name is cached, replace the
-# pane $w with the cached pane. Otherwise create a new
-# pane and scrolledtext widget and set _${w}pane and _${w}win.
-#
-# ARGS: w "t" or "b" (for Top and Bottom pane)
-# name name to look for in cache. This will be a filename if
-# we are filling in a source window, or an address
-# otherwise.
-# asm 'S' for source,
-# 'A' for assembly mode
-# 'M' for mixed mode.
-# lib library name
-#
-# RETURNS: 0 - read from cache
-# 1 - created new (blank) widget
-# -1 - could not find the contents you are trying to load,
-# so far this only happens for "Source" files.
-#
-# NOTES: If you call this and a new widget is created which cannot be
-# filled in later due to errors, call UnLoadFromCache.
-# -----------------------------------------------------------------------------
-
-itcl::body SrcTextWin::LoadFromCache {w name asm lib} {
- debug "LoadFromCache $w $name $asm"
- global gdbtk_platform
- upvar ${w}win win
- upvar _${w}pane pane
-
- if {[string compare gdbtk_scratch_widget $name]} {
- append full_name $name "," $asm "," $lib
- } else {
- set full_name $name
- }
-
- set loadingSource [expr ![string compare $asm "S"]]
-
- set oldpane $pane
- if {[info exists Stwc($full_name:pane)]} {
- debug "READING CACHE $full_name->$Stwc($full_name:pane)"
- set pane $Stwc($full_name:pane)
- if {$oldpane != ""} {
- $itk_interior.p replace $oldpane $pane
- } else {
- $itk_interior.p show $pane
- }
- set win [[$itk_interior.p childsite $pane].st component text]
- if {!$loadingSource} {
- set Cname $full_name
- }
-
- # If the text in this cache file is dirty, clean the window, and
- # return 1, which will tell the caller to refill it. Otherwise
- # return 0, and the caller will just display the window.
-
- if {$Stwc($name:dirty)} {
- $win delete 0.0 end
- set res 1
- set Stwc($name:dirty) 0
- } else {
- set res 0
- }
-
- } else {
- debug "name=$name"
- # If we are trying to load a source file, check the time
- # to see if we need to update it. If we can't stat the
- # file then we probably can't open it either, so error
- # out.
-
- if {$loadingSource} {
- if {[string compare $gdbtk_platform(os) "cygwin"] == 0} {
- set f [ide_cygwin_path to_win32 $name]
- } else {
- set f $name
- }
- if {[catch {file mtime $f} file_time]} {
- debug "Could not stat file \"$f\" - \"$file_time\""
- return -1
- } else {
- set Stwc($full_name:pane) pane$filenum
- set Stwc($name:mtime) $file_time
- }
- } else {
- # FIXME: This is wrong. For Assembly files we need to
- # check whether the executable is newer than the cached
- # disassembly. For mixed files, we need to check BOTH
- # the source file mtime, and the executable time.
-
- set Stwc($full_name:pane) pane$filenum
- set Stwc($name:mtime) 0
- }
-
- set Stwc($full_name:pane) pane$filenum
-
- set Stwc($name:dirty) 0
- incr filenum
-
- set pane $Stwc($full_name:pane)
- debug "pane=$pane"
- if {$oldpane != ""} {$itk_interior.p hide $oldpane}
- $itk_interior.p add $pane
- set p [$itk_interior.p childsite $pane]
- set st [iwidgets::scrolledtext $p.st \
- -hscrollmode dynamic -vscrollmode dynamic]
- set win [$st component text]
-
- if {!$loadingSource} {
- set Cname $full_name
- }
- pack $st -expand yes -fill both
- set res 1
- }
-
- # reconfigure in case some preferences have changed
- config_win $win $asm
- return $res
-}
-
-# ------------------------------------------------------------------
-# METHOD: UnLoadFromCache - revert back to previously cached widget
-# This is used when a new widget is created with LoadFromCache but
-# there is a problem with filling the widget.
-# ------------------------------------------------------------------
-
-itcl::body SrcTextWin::UnLoadFromCache {w oldpane name asm lib} {
-# debug "$w $oldpane $name"
- upvar ${w}win win
- upvar _${w}pane pane
-# debug "pane=$pane win=$win"
-
-
- set full_name ${name},${asm},${lib}
- $itk_interior.p delete $pane
- foreach elem [array names Stwc $full_name:*] {
- unset Stwc($elem)
- }
- foreach elem [array names Stwc $name:*] {
- unset Stwc($elem)
- }
-
- if {$oldpane != ""} {
- $itk_interior.p show $oldpane
- set pane $oldpane
- set win [[$itk_interior.p childsite $pane].st component text]
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: print - print the contents of the text widget
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::print {top} {
- # FIXME
- send_printer -ascii [$twin get 1.0 end] -parent $top
-}
-
-# ------------------------------------------------------------------
-# METHOD: ask_thread_bp - prompt for thread(s) for BP
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::ask_thread_bp {} {
-# debug
- if {[catch {gdb_cmd "info thread"} threads]} {
- # failed. Just leave
- return
- }
- set threads [split $threads \n]
- set num_threads [expr {[llength $threads] - 1}]
- if {$num_threads <= 0} {
- show_warning "No threads were found.\nYou may only set breakpoints on threads\nthat have already been created."
- return
- }
-
- set a [toplevel .[gensym]]
- wm title $a "Thread Selection"
-
- iwidgets::scrolledlistbox $a.slb \
- -vscrollmode dynamic -hscrollmode dynamic \
- -selectmode multiple -textfont global/fixed
-
- set i [expr $num_threads - 1]
- set width 0
- foreach line $threads {
- # Active line starts with "*"
- if {[string index $line 0] == "*"} {
- # strip off leading "*"
- set line " [string trimleft $line "*"]"
- }
- # scan for GDB ID number at start of line
- if {[scan $line "%d" id($i)] == 1} {
- if {[string length $line] > $width} {
- set width [string length $line]
- }
- $a.slb insert 0 $line
- incr i -1
- }
- }
- $a.slb configure -visibleitems ${width}x$num_threads
- [$a.slb component listbox] configure -bg $::Colors(textbg) -fg $::Colors(textfg)
-
- frame $a.b
- button $a.b.ok -text OK -underline 0 -width 7 \
- -command "$this do_thread_bp $a.slb"
- button $a.b.cancel -text Cancel -width 7 -underline 0 -command "destroy $a"
- pack $a.b.ok $a.b.cancel -side left
- standard_button_box $a.b
- pack $a.b -fill x -expand yes -side bottom -padx 5 -pady 5
- center_window $a -over [winfo toplevel [namespace tail $this]]
- pack $a.slb -side top -fill both -expand yes
- bind $a.b.ok <Return> "$a.b.ok flash; $a.b.ok invoke"
- focus $a.b.ok
-}
-
-# ------------------------------------------------------------------
-# METHOD: do_thread_bp - callback from thread selection
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::do_thread_bp {listbox} {
-# debug "$listbox [$listbox curselection]"
- set x ""
- foreach i [$listbox curselection] {
- lappend x $id($i)
- }
- $this set_bp_at_line N {} -1 $x
- destroy [winfo toplevel $listbox]
-}
-
-
-# public method for testing use only!
-itcl::body SrcTextWin::test_get {var} {
- if {[array exists $var]} {
- return [array get $var]
- } else {
- return [set $var]
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: get_file - Return name of current file.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::get_file {} {
- return $current(filename)
-}
-
-# ------------------------------------------------------------------
-# METHOD: clear_file - Clear out state so that user may load
-# new executable. For the SrcTextWin class, this means:
-#
-# Delete all srctextwin caches
-# Delete the variable balloon if it exists.
-# Clear the screen.
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::clear_file {} {
-
- debug "In clear_file"
- # delete all caches
- _clear_cache
-
- set oldpane {}
-
- # clear window
- # FIXME - We don't do this here, because is causes a wierd error
- # where the "Source file more recent than executible" error gets
- # for no apparent reason. This only effects the case where the
- # user types just "file" in the command line, then the window will
- # not get cleared.
-
- # delete variable balloon
- catch {$_balloon_var delete}
- set _balloon_var {}
-
- # reinit state
- _initialize_srctextwin
-
- # update the screen
- update idletasks
-
-}
-
-itcl::body SrcTextWin::_initialize_srctextwin {} {
- set pc(filename) ""
- set pc(func) ""
- set pc(line) 0
- set pc(addr) ""
- set pc(asm_line) 0
- set pc(lib) ""
- set current(filename) ""
- set current(funcname) ""
- set current(line) 0
- set current(addr) ""
- set current(asm_line) 0
- set current(tag) "BROWSE_TAG"
- set current(mode) "SOURCE"
- set current(lib) ""
-}
-
-# ------------------------------------------------------------------
-# METHOD: _clear_cache - Clear the cache
-# ------------------------------------------------------------------
-itcl::body SrcTextWin::_clear_cache {} {
-
- # display empty scratch frame
- set pane $Stwc(gdbtk_scratch_widget:pane)
- set win [[$itk_interior.p childsite $pane].st component text]
- $win delete 0.0 end
- $itk_interior.p show $pane
-
- # delete all cached frames
- foreach p [array names Stwc *:pane] {
- set p [lindex [split $p :] 0]
- if {$p != "gdbtk_scratch_widget"} {
- catch {
- #debug "clearing cache: \"$p\""
- $itk_interior.p delete $Stwc($p:pane)
- unset Stwc($p:pane)
- unset Stwc($p:mtime)
- }
- }
- }
-
- _initialize_srctextwin
- set filenum 0
- set Cname ""
- set _tpane pane$filenum
- incr filenum
- set _bpane ""
-}
diff --git a/gdb/gdbtk/library/srctextwin.ith b/gdb/gdbtk/library/srctextwin.ith
deleted file mode 100644
index fae89ad294b..00000000000
--- a/gdb/gdbtk/library/srctextwin.ith
+++ /dev/null
@@ -1,163 +0,0 @@
-# SrcTextWin class definition, for Insight
-# Copyright (C) 1997, 1998, 1999, 2001 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class SrcTextWin {
- inherit itk::Widget GDBWin
-
- public {
- variable Tracing ;# 1 if we are running in trace mode
- variable Browsing 0 ;# 1 if we are browsing a trace experiment
- variable parent {} ;# the parent SrcWin
- variable ignore_var_balloons 0; # ignore all variable balloons
-
- # Set the height of the src window
- variable textheight 5i {
- catch {$itk_interior.p configure -height $itk_option(-textheight)}
- }
-
- method constructor {args}
- method destructor {}
- method disassembly_changed {}
- method reconfig {}
- method trace_find_hook {mode from_tty}
- method set_control_mode {mode}
- method build_popups {}
- method build_win {}
- method SetRunningState {state}
- method enable {on}
- method setTabs {win {asm S}}
- method enable_disable_src_tags {win how}
- method config_win {win {asm S}}
- method addPopup {menu label command {abg {}} {browse 1} {run 1}}
- method updateBalloon {}
- method ClearTags {}
- method FillSource {winname tagname filename funcname line addr pc_addr lib}
- method FillAssembly {winname tagname filename funcname line addr pc_addr lib}
- method FillMixed {winname tagname filename funcname line addr pc_addr lib}
- method location {tagname filename funcname line addr pc_addr lib}
- method LoadFile {winname name lib mtime_changed}
- method display_line { win line }
- method display_breaks {}
- method insertBreakTag {win linenum tag}
- method removeBreakTag {win linenum tag }
- method bp {action bpnum addr {linenum {}} {file {}} {type 0} {enabled 0} {thread -1}}
- method do_bp { win action linenum type bpnum enabled thread asm}
- method hasBP {win line}
- method hasTP {win line}
- method report_source_location {}
- method lookup_line {win y}
- method continue_to_here {{win {}} {y -1} {threads -1}}
- method jump_to_here {{win {}} {y -1} {threads -1}}
- method set_bp_at_line {{type N} {win {}} {y -1} {threads "-1"}}
- method remove_bp_at_line {{win {}} {y -1}}
- method enable_disable_at_line {action}
- method set_tp_at_line {{win {}} {y -1}}
- method next_hit_at_line {{win {}} {y -1}}
- method remove_tp_at_line {{win {}} {y -1}}
- method do_tag_popup {name X Y y}
- method do_source_popup { X Y x y }
- method addToWatch {var}
- method do_key {key}
- method mode_get {}
- method mode_set {new_mode {go 1}}
- method cancelMotion {}
- method motion {type win x y}
- method showBPBalloon {win x y}
- method showBalloon {win x y}
- method getVariable {x y {line {}}}
- method trace_help {args}
- method line_is_executable {win line}
- method tracepoint_range {win low high}
- method search {exp direction}
- method LoadFromCache {pname name asm lib}
- method UnLoadFromCache {pname oldpane name asm lib}
- method print {top}
- method ask_thread_bp {}
- method do_thread_bp {listbox}
- method test_get {var}
- method clear_file {}
- method get_file {}
- method set_tag_to_stack {}
-
- # GDB Events
- method breakpoint {event}
- method tracepoint {event}
- method set_variable {event}
- }
-
- private {
- variable top ;# toplevel window
- variable twin ;# top text window of pane
- variable _tpane ;# top pane name
- variable bwin "" ;# bottom text window of pane
- variable _bpane "" ;# bottom pane name
-
- variable do_display_breaks 0 ;# flag
- variable popups
-
- variable timeoutID {} ;# The timeout ID for the variable balloon help
- variable UseVariableBalloons
-
- variable mode_changed 0
- variable current ;# our current state
- variable pc ;# where the PC is now
- variable oldmode "" ;# remember the mode we want, even if we can't have it
-
- variable Running 0 ;# another way to disable things while target is active
- variable Linenums ;# use linenumbers?
- variable SearchIndex 1.0 ;# static
- variable id ;#thread id to line mapping
- # needed for assembly support
- variable _map
- variable Cname "" ;# cache index name for _map
- # cache is not shared among windows yet. That could be a later
- # optimization
- variable Stwc ;# Source Text Window Cache
- variable filenum 0
-
- # The variable object which the variable balloon describes
- variable _balloon_var {}
-
- method balloon_value {variable}
- method _mtime_changed {filename}
- method _initialize_srctextwin {}
- method _clear_cache {}
- method _highlightAsmLine {win addr pc_addr tagname filename funcname} {}
-
- proc makeBreakDot {size colorList {image {}}}
- }
-
-
-
- # common variables are shared among all objects of this type
- # break_images stores the images associated with the break dot.
- # bp
- # temp_bp
- # disabled_bp
- # tp
- # thread_bp
- protected common break_images
-
- # This is the list of bp types. Be nice, and don't put spaces in
- # any of the elements of this list...
- protected common bp_types {bp temp_bp disabled_bp thread_bp}
-
- # This variable is used in the "Continue to here" case, where we are
- # disabling then reenabling breakpoints behind the user's back to
- # implement this feature, but we don't want the user to see this...
- protected common dont_change_appearance 0
-
- protected common TimeOut 100 ;# The timeout value for variable balloon help
-
-}
diff --git a/gdb/gdbtk/library/srcwin.itb b/gdb/gdbtk/library/srcwin.itb
deleted file mode 100644
index 0f42852f2ed..00000000000
--- a/gdb/gdbtk/library/srcwin.itb
+++ /dev/null
@@ -1,1058 +0,0 @@
-# Source window for Insight.
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2008,
-# 2006 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ------------------------------------------------------------------
-# CONSTRUCTOR - create new source window
-# ------------------------------------------------------------------
-itcl::body SrcWin::constructor {args} {
- debug "$args"
- eval itk_initialize $args
- set top [winfo toplevel $itk_interior]
-
- _update_title ""
-
- set Tracing [pref get gdb/mode]
- set current(filename) ""
-
- if {[catch {_build_win} mssg]} {
- dbug E "_build_win returned: $::errorInfo"
- }
-
- # add special delete handler
- wm protocol $top WM_DELETE_WINDOW "[code $this _exit]"
-
- # add hooks
- add_hook gdb_no_inferior_hook "$this no_inferior"
- add_hook download_progress_hook "$this download_progress"
- add_hook state_hook [code $this _set_state]
- add_hook gdb_clear_file_hook [code $this clear_file]
- after idle "
- update idletasks
- $this sizeWinByChild toolbar"
-
- lappend window_list $this
-}
-
-# ------------------------------------------------------------------
-# DESTRUCTOR - destroy window containing widget
-# ------------------------------------------------------------------
-itcl::body SrcWin::destructor {} {
- debug
- remove_hook gdb_no_inferior_hook "$this no_inferior"
- remove_hook download_progress_hook "$this download_progress"
- remove_hook state_hook [code $this _set_state]
- remove_hook gdb_clear_file_hook [code $this clear_file]
- set window_list [lremove $window_list $this]
- if {$pc_window == $this} then {
- set pc_window ""
- }
-}
-
-# ------------------------------------------------------------------
-# PRIVATE METHOD: _build_win - build the main source window
-# ------------------------------------------------------------------
-itcl::body SrcWin::_build_win {} {
- global gdb_downloading gdb_running gdb_loaded
-
- # build source toolbar
- set _toolbar [conAdd toolbar -resizable 0]
- SrcBar $_toolbar $this \
- -updatecommand [list $this toggle_updates] \
- -updatevalue $do_updates
- pack $_toolbar -expand 1 -fill both
-
- # if user likes control on bottom...
- if {! [pref get gdb/src/top_control]} {
-
- # add a SrcTextWin container
- set srcwin [conAdd src]
- set twin [SrcTextWin $srcwin -Tracing $Tracing -parent $this]
- pack $srcwin -expand 1 -fill both
-
- # add status line
- set _status [conAdd status -resizable 0]
- label $_status -relief sunken -bd 3 -font global/status -height 1
- pack $_status -expand 1 -fill both
- }
-
- # add a status bar container
- set _statbar [conAdd stat -resizable 0]
- frame $_statbar
- pack $_statbar -expand 1 -fill both
-
- combobox::combobox $_statbar.name -maxheight 15 -font global/fixed\
- -command [code $this _name] -bg $::Colors(textbg)
-
- set need_files 1
-
- combobox::combobox $_statbar.func -maxheight 15 -font global/fixed\
- -command [code $this goto_func] -bg $::Colors(textbg)
- combobox::combobox $_statbar.mode -width 9 -editable false \
- -font global/fixed -command [code $this mode] -bg $::Colors(textbg)
-
- $_statbar.mode list insert end SOURCE
- $_statbar.mode list insert end ASSEMBLY
- $_statbar.mode list insert end MIXED
- $_statbar.mode list insert end SRC+ASM
-
- # Workaround: the three comboboxes above sometimes display with
- # height of one pixel. Inserting an invisible frame with the required
- # height "fixes" this...
- frame $_statbar.strut -height 24 -width 10
-
- pack $_statbar.mode -side right -padx 10 -pady 4
- pack $_statbar.name $_statbar.func $_statbar.strut \
- -side left -pady 4 -padx 10
-
- # if user likes control on top...
- if {[pref get gdb/src/top_control]} {
-
- # add a SrcTextWin container
- set srcwin [conAdd src]
- set twin [SrcTextWin $srcwin -Tracing $Tracing -parent $this]
- pack $srcwin -expand 1 -fill both
-
- # add status line
- set _status [conAdd status -resizable 0]
- set _statusframe [frame $_status]
- set _status $_statusframe.con
- label $_status -relief sunken -bd 3 -font global/status -height 1 \
- -anchor w
-
- # add download progress meter
- canvas $_statusframe.progress -relief sunken -borderwidth 2 \
- -highlightthickness 0 -takefocus 0 -width 100 -height 0 -confine 1
- $_statusframe.progress create rectangle 0 0 0 \
- [winfo height $_statusframe.progress] -outline blue -fill blue -tags rect
-
- # add address and line number indicators
- label $_statusframe.addr -text "" -width 10 -relief sunken \
- -bd 1 -anchor e -font global/fixed
- label $_statusframe.line -text "" -width 6 -relief sunken \
- -bd 1 -anchor e -font global/fixed
-
- balloon register $_statusframe.addr "Address"
- balloon register $_statusframe.line "Line number"
-
- pack $_statusframe -expand 1 -fill both
- grid $_status -row 0 -column 1 -sticky news -pady 2 -padx 2
- grid $_statusframe.addr -row 0 -column 3 -sticky nes -pady 4
- grid $_statusframe.line -row 0 -column 4 -sticky nws -pady 4
- grid columnconfigure $_statusframe 1 -weight 10
- grid columnconfigure $_statusframe 2 -minsize 5
- grid columnconfigure $_statusframe 5 -minsize 5
- }
-
- set_execution_status
-
- # balloon help
- foreach i {entry button} {
- balloon register $_statbar.name.$i "Current file name"
- balloon register $_statbar.func.$i "Current function name"
- balloon register $_statbar.mode.$i "Source mode"
- }
- balloon variable $_status ${twin}_balloon
-
- $_statbar.mode entryset [$twin mode_get]
-
- # time to load the widget with a file.
- # If this is a new widget and the program is
- # not yet being debugged, load the file with "main" in it.
- if {$gdb_running} {
- if {[catch {gdb_loc} loc]} {
- # Nothing we can do but leave the window empty.
- } else {
- _update $loc
- }
- }
-}
-
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: _set_state - do things when program state changes
-# ------------------------------------------------------------------
-itcl::body SrcWin::_set_state {varname} {
- global gdb_running gdb_downloading gdb_loaded gdb_program_has_run
- debug "$varname l=$gdb_loaded d=$gdb_downloading r=$gdb_running"
-
- if {$varname == "gdb_loaded" && $gdb_loaded == 1} {
- set gdb_program_has_run 0
- #set current(filename) ""
- return
- }
-
- if {$gdb_running} {
- set state normal
- set gdb_program_has_run 1
- } else {
- set state disabled
- }
- if {!$Tracing} {
- $twin SetRunningState $state
- }
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: download_progress - update the progress meter when downloading
-# ------------------------------------------------------------------
-itcl::body SrcWin::download_progress { section num tot {msg ""} } {
- global download_start_time download_cancel_ok gdb_loaded
-
- #debug "$section $num $tot $msg"
- if {$last_section_start == 0} {
- grid forget $_statusframe.addr $_statusframe.line
- grid $_statusframe.progress -row 0 -column 4 -padx 4 -sticky news
- ::update idletasks
- }
-
- if {$section == "DONE"} {
- set last_done $tot
- if {$gdb_loaded} {
- # loaded something
- set secs [expr {[clock seconds] - $download_start_time}]
- if {$secs} {
- set bps [expr {8 * $tot / $secs}]
- set_status "DOWNLOAD FINISHED: $tot bytes in $secs seconds ($bps bits per second)"
- } else {
- set_status "DOWNLOAD FINISHED"
- }
- }
- } elseif {$section != "CANCEL"} {
- if {$section != $last_section} {
- set last_section $section
- set last_section_start $last_done
- }
- set last_done [expr {$last_section_start + $num}]
- set_status "Downloading section $section - $num bytes"
- }
-
- set canvas $_statusframe.progress
- set height [winfo height $canvas]
- if {$last_done} {
- set width [winfo width $canvas]
- set rw [expr {double ($last_done) * $width / $tot}]
- $canvas coords rect 0 0 $rw $height
- ::update
- }
-
- if {$last_done == $tot || $section == "CANCEL"} {
- $_toolbar configure -runstop normal
- if {!$gdb_loaded} {
- ::update
- # errored or canceled
- if {$msg != ""} {
- set_status "DOWNLOAD FAILED: $msg"
- } else {
- set_status "DOWNLOAD CANCELLED"
- }
- $canvas coords rect 0 0 0 $height
- ::update idletasks
- }
-
- set last_section ""
- set last_done 0
- set last_section_start 0
-
- grid forget $_statusframe.progress
- grid $_statusframe.addr -row 0 -column 3 -sticky new -pady 4
- grid $_statusframe.line -row 0 -column 4 -sticky nws -pady 4
- ::update idletasks
- }
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: reconfig - used when preferences change
-# ------------------------------------------------------------------
-itcl::body SrcWin::reconfig {} {
- debug
- $_toolbar reconfig
- $twin reconfig
-}
-
-
-# ------------------------------------------------------------------
-# PRIVATE METHOD: _name - filename combobox callback
-# This is only called when the user edits the name combobox.
-# It is the only way that files can be inserted into the file list
-# once the debugger is started.
-# ------------------------------------------------------------------
-itcl::body SrcWin::_name {w {val ""}} {
- global _files
- debug "$w $val"
- if {$val != ""} {
- if {![info exists _files(short,$val)]} {
- if {![info exists _files(full,$val)]} {
- if [catch {gdb_find_file $val} full] {
- set_status "Cannot find source file \"$val\": $full"
- $_statbar.name entryset [lindex [file split $current(filename)] end]
- return
- }
- if {$full == ""} {
- set_status "Cannot find source file \"$val\""
- $_statbar.name entryset [lindex [file split $current(filename)] end]
- return
- }
- set _files(short,$full) $val
- set _files(full,$val) $full
- }
- set full $_files(full,$val)
- } else {
- set full $val
- set val $_files(short,$full)
- }
- $_statbar.name entryset $val
- location BROWSE_TAG [list $val "" $full 0 0 0 {}]
- }
-}
-
-# ------------------------------------------------------------------
-# PRIVATE PUBLIC METHOD: toggle_updates - update toggle callback
-# ------------------------------------------------------------------
-itcl::body SrcWin::toggle_updates {value} {
- # save state in do_updates so it will be preserved
- # in window reconfigs
- set do_updates $value
-}
-
-# ------------------------------------------------------------------
-# PRIVATE PUBLIC METHOD: goto_func - function combobox callback
-# ------------------------------------------------------------------
-itcl::body SrcWin::goto_func {w {val ""}} {
- if {$val != ""} {
- set mang 0
- if {[info exists _mangled_func($val)]} {
- set mang $_mangled_func($val)
- }
- if {$mang} {
- set loc $val
- } else {
- set fn [lindex [::file split $current(filename)] end]
- if {$fn == ""} {
- set loc $val
- } else {
- set loc $fn:$val
- }
- }
- debug "GOTO $loc"
- if {![catch {gdb_loc $loc} result]} {
- location BROWSE_TAG $result
- } else {
- dbug W "gdb_loc returned \"$result\""
- }
- }
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: fillNameCB - fill the name combobox
-#
-# This method needs to be public, since other parts of
-# the gui can cause new symbols to be read.
-# ------------------------------------------------------------------
-itcl::body SrcWin::fillNameCB {} {
- global _files
- set allfiles [gdb_listfiles]
- foreach f $allfiles {
- # FIXME: If you reactivate this code add a catch as gdb_find_file can err
- # (P.S.: I don't know why this is commented out)
- #set fullname [gdb_find_file $f]
- #set _files(full,$f) $fullname
- #set _files(short,$fullname) $f
- $_statbar.name list insert end $f
- }
- set need_files 0
-}
-
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: fillFuncCB - fill the function combobox
-#
-# This method needs to be public, since other parts of
-# the gui can cause new symbols to be read.
-# ------------------------------------------------------------------
-itcl::body SrcWin::fillFuncCB {name} {
- $_statbar.func list delete 0 end
- if {$name != ""} {
- set maxlen 10
- if {[catch {gdb_listfuncs $name} listfuncs]} {
- tk_messageBox -icon error -default ok \
- -title "GDB" -type ok \
- -message "This file can not be found or does not contain\ndebugging information."
- _set_name ""
- return
- }
- foreach f [lsort -increasing $listfuncs] {
- lassign $f func mang
- set _mangled_func($func) $mang
- $_statbar.func list insert end $func
- if {[string length $func] > $maxlen} {
- set maxlen [string length $func]
- }
- }
- $_statbar.func configure -width [expr $maxlen + 1]
- }
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: location - update the location displayed
-#
-# a linespec looks like this:
-# 0: basename of the file
-# 1: function name
-# 2: full filename
-# 3: source line number
-# 4: address
-# 5: current PC - which will often be the same as address, but not when
-# we are browsing, or walking the stack.
-# 6: shared library name if the pc is in a shared lib
-#
-# linespec will be "{} {} {} 0 0x0 0x0" when GDB has not started debugging.
-# ------------------------------------------------------------------
-itcl::body SrcWin::location {tag linespec} {
- global gdb_running gdb_exe_name _files
-
- # We need to keep track of changes to the line, filename, function name
- # and address so we can keep the widgets up-to-date. Otherwise we
- # basically pass things through to the SrcTextWin location public method.
-
- debug "running=$gdb_running tag=$tag linespec=$linespec"
- lassign $linespec foo funcname name line addr pc_addr lib
-
- # need to call this to update running state
- set_execution_status $line $addr
-
- # "update" doesn't set the tag so we do it here
- if {$tag == ""} {
- if {$addr == $pc_addr} {
- set tag PC_TAG
- } else {
- set tag STACK_TAG
- }
- }
-
- if {!$gdb_running} {
- # When we are not yet debugging, we need to force something
- # to be displayed, so we choose to find function "main" and
- # display the file with it.
- set tag BROWSE_TAG
- debug "not running: name=$name funcname=$funcname line=$line"
- if {$name == ""} {
- if {[set linespec [gdbtk_locate_main]] == ""} {
- # no "main" function found
- return
- }
- lassign $linespec foo funcname name line addr pc_addr lib
- debug "new linespec=$linespec"
- }
- }
-
- # update file and function combobox
- if {$name != $current(filename)} {
- _set_name $name
- fillFuncCB $name
- }
-
- # get a proper address string to display
- set textaddr [gdb_CA_to_TAS $addr]
-
- # set address and line widgets
- if {[string length $textaddr] > 8} {
- # 64-bit address
- set width 16
- } else {
- # 32-bit address
- set width 8
- }
- $_statusframe.addr configure -text $textaddr -font global/fixed -width $width
- $_statusframe.line configure -text $line
-
- # set function combobox
- $_statbar.func entryset $funcname
-
- # call SrcTextWin::location
- $twin location $tag $name $funcname $line $addr $pc_addr $lib
-
- set current(filename) $name
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: stack - handle stack commands
-# ------------------------------------------------------------------
-itcl::body SrcWin::stack {cmd} {
- if {$cmd == "bottom"} {
- set cmd "frame 0"
- }
- gdbtk_busy
- if {[catch {gdb_cmd "$cmd"} message]} {
- dbug E "STACK ERROR: $message"
- }
- gdbtk_update
- gdbtk_idle
-}
-
-# ------------------------------------------------------------------
-# METHOD: _update - update widget when PC changes
-# ------------------------------------------------------------------
-itcl::body SrcWin::_update {loc} {
- debug "loc=$loc"
- # See if name combobox needs filled.
- if {$need_files} {
- fillNameCB
- }
- location "" $loc
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: idle - callback for gdbtk_idle
-# Called when the target is idle, so enable all buttons.
-# ------------------------------------------------------------------
-itcl::body SrcWin::idle {event} {
- $_toolbar configure -runstop normal
- enable_ui 1
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: mode - set mode to SOURCE, ASSEMBLY, MIXED, SRC+ASM
-# ------------------------------------------------------------------
-itcl::body SrcWin::mode {w new_mode {go 1}} {
- gdbtk_busy
- $_statbar.mode entryset $new_mode
- catch {$twin mode_set $new_mode $go} errorVal
- $_toolbar configure -displaymode $new_mode
- gdbtk_idle
-}
-
-# ------------------------------------------------------------------
-# PRIVATE METHOD: _update_title - update title bar
-# ------------------------------------------------------------------
-itcl::body SrcWin::_update_title {name} {
- set fn [lindex [::file split $name] end]
- if {$fn == ""} {
- set prefix ""
- } else {
- set prefix "$fn - "
- }
- window_name "${prefix}Source Window" $fn
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: busy - disable things when gdb is busy
-# ------------------------------------------------------------------
-itcl::body SrcWin::busy {event} {
- global gdb_loaded gdb_target_name
-# debug "gdb_loaded=$gdb_loaded, gdb_target_name=$gdb_target_name"
-
- if {$do_updates} {
- enable_ui 0
- if {$Running} {
- $_toolbar configure -runstop running
- if {$gdb_loaded || \
- ([TargetSelection::native_debugging] && $gdb_target_name != "remote")} {
- set_status "Program is running."
- }
- } else {
- $_toolbar configure -runstop busy
- }
- }
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: update - The inferior's state has changed.
-# ------------------------------------------------------------------
-itcl::body SrcWin::update {event} {
-
- # FIXME: This is kinda lame. We need to run this only once
- # as it is now written, so only the first window in the list
- # will actually call choose_and_update.
- # This is still better than before, since it will not
- # matter if this window is destroyed: as long as _a_
- # SrcWin exists, this will get called.
- if {[lindex $window_list 0] == $this} {
- choose_and_update
- }
-}
-
-# ------------------------------------------------------------------
-# PRIVATE METHOD: _set_name - set the name in the name combobox and in the title
-# ------------------------------------------------------------------
-itcl::body SrcWin::_set_name { val {found 1} } {
- global _files
- _update_title $val
- if {![info exists _files(short,$val)]} {
- if {![info exists _files(full,$val)]} {
- # not in our list; just display basename
- $_statbar.name entryset [lindex [::file split $val] end]
- return
- }
- } else {
- set val $_files(short,$val)
- }
- if {$found} {
- $_statbar.name entryset $val
- } else {
- $_statbar.name entryset "$val (not found)"
- }
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: set_status - write a message to the status line.
-# If "tmp" is set, the status change will not be saved.
-# ------------------------------------------------------------------
-
-itcl::body SrcWin::set_status { {msg ""} {tmp 0} } {
- set msg [lindex [split $msg \n] 0]
- if {$tmp} {
- $_status configure -text $msg
- return
- }
- if {$msg != ""} {
- set saved_msg $msg
- }
- $_status configure -text $saved_msg
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: set_execution_status - write the current execution state
-# to the status line
-# ------------------------------------------------------------------
-itcl::body SrcWin::set_execution_status { {line ""} {pc ""}} {
- global gdb_running gdb_loaded gdb_program_has_run gdb_target_changed
- #debug "line=$line pc=$pc [gdb_target_has_execution] running=$gdb_running loaded=$gdb_loaded"
- set message ""
-
- if {![gdb_target_has_execution]} {
- if {$gdb_running} {
- set gdb_running 0
- # tell text window program is no longer running
- $twin ClearTags
- }
- if {$gdb_loaded} {
- if {$gdb_program_has_run} {
- set message "Program terminated. 'Run' will restart."
- # Need to set gdb_target_changed because most
- # remote targets detach when they are finished,
- # and this will force it to reattach.
- set gdb_target_changed 1
- set gdb_running 0
- } else {
- set message "Program is ready to run."
- }
- } else {
- set message "Program not running. Click on run icon to start."
- }
- } else {
-
- # gdb_target_has_execution has returned true, so we must be running.
- #
- # This can cause problems on targets which do not set inferior_pid.
- # Although this is bogus, much of gdb (and gdbtk) relies on
- # gdb_target_has_execution (and thus inferior_pid), so we should
- # not try to second guess it and fix those targets which do not set
- # inferior_pid when opened.
- set gdb_running 1
-
- # only do a gdb_loc if we have to
- if {$line == "" && $pc == ""} {
- if {[catch {gdb_loc} loc] == 0} {
- set line [lindex $loc 3]
- set pc [lindex $loc 4]
- }
- }
-
- set pc [gdb_CA_to_TAS $pc]
-
- if {$line == "" || $line == 0} {
- if {$pc == "" || $pc == 0} {
- if {$Tracing} {
- set message "Ready."
- } else {
- set message "Program stopped."
- }
- } else {
- set message "Program stopped at 0x$pc"
- }
- } else {
- if {$Tracing} {
- set msg "Inspecting trace"
- } else {
- set msg "Program stopped"
- }
- switch [$twin mode_get] {
- ASSEMBLY {set message "$msg at 0x$pc" }
- MIXED {set message "$msg at line $line, 0x$pc" }
- SRC+ASM {set message "$msg at line $line, 0x$pc" }
- default {set message "$msg at line $line" }
- }
- }
- }
- set_status $message
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: edit - invoke external editor
-# ------------------------------------------------------------------
-itcl::body SrcWin::edit {} {
- global external_editor_command
- # If external editor is enabled, pass the file to the specified command
-
- if {$current(filename) == ""} {
- tk_dialog .warn {Edit} {No file is loaded in the source window.} error 0 Ok
- return
- }
-
- if {[catch {$twin report_source_location} loc_info]} {
- tk_dialog .warn "Edit" "No source file selected" error 0 Ok
- return
- }
-
- Editor::edit $loc_info
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: print - print the contents of the text widget
-# ------------------------------------------------------------------
-itcl::body SrcWin::print {} {
- # Call the SrcTextWin's print public method
- $twin print $top
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: enable_ui
-# Enable all UI elements for user interaction.
-# ------------------------------------------------------------------
-itcl::body SrcWin::enable_ui { on } {
- #debug "$on"
- if {$on} {
- set Running 0
- set state normal
- set glyph ""
- } else {
- if {!$NoRun} {set Running 1}
- set state disabled
- set glyph watch
- }
- # combo boxes
- $_statbar.mode configure -state $state
- $_statbar.name configure -state $state
- $_statbar.func configure -state $state
-
- $twin enable $on
- $top configure -cursor $glyph
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: no_inferior
-# Put the UI elements of this object into a state
-# appropriate for an inferior which is not executing.
-# For this object, this means:
-# Disable:
-# - key binding for all inferior control (not needed -- gdb does this
-# for us)
-#
-# Enable:
-# - file/func/mode selectors
-# - right-click popups, since gdb DOES allow looking at exe fil
-# - selections
-#
-# Change mouse pointer to normal
-# ------------------------------------------------------------------
-itcl::body SrcWin::no_inferior {} {
- #debug
- set_execution_status
- enable_ui 1
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: reset - reset the source window
-# ------------------------------------------------------------------
-itcl::body SrcWin::reset {} {
- set current(filename) ""
- set need_files 1
- set do_updates 1
- set last_section ""
- set last_section_start 0
- set last_done 0
- set saved_msg ""
-
- # do we need to flush the cache or clear the source windows?
-
- # Empty combo boxes
- $_statbar.name list delete 0 end
- $_statbar.name configure -value {}
- $_statbar.func list delete 0 end
- $_statbar.func configure -value {}
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: search - search for a STRING or jump to a specific line
-# in source window, going in the specified DIRECTION.
-# ------------------------------------------------------------------
-itcl::body SrcWin::search {direction string} {
- set_status
- set_status [$twin search $string $direction] 1
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: point_to_main
-# Proc that may be called to point some source window to
-# main (or an entry point?). (see gdbtk_tcl_exec_file_changed)
-# ------------------------------------------------------------------
-itcl::body SrcWin::point_to_main {} {
- # We need to force this to some default location. Assume main and
- # if that fails, let the source window guess (via gdb_loc using stop_pc).
- set src [lindex [ManagedWin::find SrcWin] 0]
- if {[set linespec [gdbtk_locate_main]] == ""} {
- gdbtk_update
- debug "could not find main"
- } else {
- $src location BROWSE_TAG [list $linespec]
- }
-}
-
-itcl::body SrcWin::_exit {} {
- debug
- if {[llength [ManagedWin::find SrcWin]] == 1} {
- if {![gdbtk_quit_check]} {
- return
- }
- }
- after idle [delete object $this]
-}
-
-# public method for testing use only!
-itcl::body SrcWin::test_get {var {private_func 0}} {
- debug $var
- if {$private_func} {
- return [code $this $var]
- }
- return [set $var]
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: toolbar - configure the toolbar's "state"
-# ------------------------------------------------------------------
-#
-# This method is used to configure the toolbar's running state.
-# Valid states include anything that the "runtest" variable of
-# the GDBSrcBar may accept. Specifically,
-#
-# busy - Run button becomes disabled
-# running - Stop button appears, allowing user to stop executing target
-# downloading - Stop button appears, allowing user to interrupt downloading
-# normal - Run button appears, allowing user to run/re-run exe
-itcl::body SrcWin::toolbar {state} {
- $_toolbar configure -runstop $state
-}
-
-# ------------------------------------------------------------------
-# METHOD: inferior - change execution state of inferior
-# ------------------------------------------------------------------
-#
-# ACTION may be:
-# step - step the inferior one source line (stepping into functions)
-# next - step the inferior one source line (stepping over functions)
-# finish - finish the current frame of execution
-# continue - continue executing the inferior
-# stepi - step one machine instruction (stepping into calls)
-# nexti - step one machine instruction (stepping over calls)
-# run - run/re-run the inferior
-# stop - stop or detach from target
-#
-# FIXME: This should really be in an object which describes gdb's state.
-# Unfortunately, this doesn't exist, so it's here for now.
-itcl::body SrcWin::inferior {action} {
-
- # Check to see if this action is forwarded to other Insight instances
- if {$::iipc} {
- switch $action {
- step -
- next -
- stepi -
- nexti -
- finish {
- if {[pref get gdb/ipc/step_button]} {
- $::insight_ipc send $action
- }
- }
- continue {
- if {[pref get gdb/ipc/cont_button]} {
- $::insight_ipc send $action
- }
- }
- run {
- if {[pref get gdb/ipc/run_button]} {
- $::insight_ipc send $action
- }
- }
- stop {
- if {[pref get gdb/ipc/stop_button]} {
- $::insight_ipc send $action
- }
- }
- }
- }
-
- switch $action {
- step { gdbtk_step }
- next { gdbtk_next }
- finish { gdbtk_finish }
- continue { gdbtk_continue }
- stepi { gdbtk_stepi }
- nexti { gdbtk_nexti }
- run { gdbtk_run }
- stop { gdbtk_stop }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: clear_file
-# Tasks for SrcWin to clear file:
-#
-# - clear window
-# - reset to src mode
-# - clear func/file comboboxes
-# - clear status (done by no_inferior)
-# - allow SrcTextWin to clear_file
-# ------------------------------------------------------------------
-itcl::body SrcWin::clear_file {} {
-
- # Reset to Source mode
- if {[$twin mode_get] != "SOURCE"} {
- mode {} SOURCE 0
- }
-
- no_inferior
- reset
-
- # run srctextwin clear_file
- $twin clear_file
-}
-
-# ------------------------------------------------------------------
-# METHOD: get_file
-# Return name of displayed file, or empty string if no file.
-# ------------------------------------------------------------------
-itcl::body SrcWin::get_file {} {
- if {$twin == ""} {
- return ""
- } else {
- return [$twin get_file]
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: is_fixed
-# Return boolean indicating whether this window is fixed.
-# ------------------------------------------------------------------
-itcl::body SrcWin::is_fixed {} {
- return 0
-}
-
-# ------------------------------------------------------------------
-# METHOD: get_top
-# Return toplevel
-# ------------------------------------------------------------------
-itcl::body SrcWin::get_top {} {
- return $top
-}
-
-# ------------------------------------------------------------------
-# METHOD: _set_tag_to_stack
-# Set tag to `stack' and update the underlying window.
-# ------------------------------------------------------------------
-itcl::body SrcWin::_set_tag_to_stack {} {
- set tag STACK_TAG
- if {$twin != ""} then {
- $twin set_tag_to_stack
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: _choose_window
-# Choose the right source window.
-# ------------------------------------------------------------------
-itcl::body SrcWin::_choose_window {file} {
- # Find the next available source window. The rules are:
- # 1. LRU overall
- # 2. Skip iconified windows
- # 3. If a window already shows the file, use it. Prefer the
- # window currently showing the PC
- # 4. If the window is fixed, skip it
- if {$pc_window != ""} then {
- if {[$pc_window get_file] == $file} then {
- return $pc_window
- }
- }
-
- set choice ""
- foreach win $window_list {
- if {[wm state [$win get_top]] != "normal"} then {
- continue
- }
-
- if {[$win get_file] == ""
- || [$win get_file] == $file
- || ! [$win is_fixed]} then {
- set choice $win
- break
- }
- }
-
- # If we didn't find an available window, then pick the current PC
- # window.
- if {$choice == ""} then {
- set choice $pc_window
- }
-
- set window_list [lremove $window_list $choice]
- lappend window_list $choice
-
- return $choice
-}
-
-# ------------------------------------------------------------------
-# METHOD: choose_and_update
-# Choose the right source window and then cause it to be updated
-# ------------------------------------------------------------------
-itcl::body SrcWin::choose_and_update {} {
- if {$pc_window == ""} then {
- set pc_window [lindex $window_list 0]
- }
-
- if {$pc_window == ""} then {
- # Nothing.
- } elseif {[catch {gdb_loc} loc]} {
- $pc_window set_execution_status
- } else {
- set prev $pc_window
- set file [lindex $loc 2]
- set pc_window [_choose_window $file]
- debug "chose window $pc_window"
- $pc_window _update $loc
- if {$pc_window != $prev} then {
- $pc_window reveal
- $prev _set_tag_to_stack
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: choose_and_display
-# Choose the right source window for a given file
-# ------------------------------------------------------------------
-itcl::body SrcWin::choose_and_display {tag linespec} {
- set file [lindex $linespec 2]
- set window [_choose_window $file]
- $window location $tag $linespec
-}
diff --git a/gdb/gdbtk/library/srcwin.ith b/gdb/gdbtk/library/srcwin.ith
deleted file mode 100644
index 03e9b4ee8e4..00000000000
--- a/gdb/gdbtk/library/srcwin.ith
+++ /dev/null
@@ -1,106 +0,0 @@
-# Source window class definition for GDBtk.
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements a source display widget using primitive widgets as the
-# building blocks.
-#
-# The main display for SrcWin is a SrcTextWin widget. This file
-# should contain all the code for controlling the SrcTextWin.
-# SrcTextWin should just display the requested file and lines, without
-# having to be very intelligent. If there are problems, error codes
-# should be returned and SrcWin should figure out what to do.
-# ----------------------------------------------------------------------
-
-itcl::class SrcWin {
- inherit TopLevelWin GDBWin
-
- public {
- method constructor {args}
- method destructor {}
- method download_progress { section num tot {msg ""} }
- method edit {}
- method enable_ui { on }
- method fillNameCB {}
- method fillFuncCB {name}
- method goto_func {w {val ""}}
- method location {tag linespec}
- method mode {w new_mode {go 1}}
- method no_inferior {}
- method print {}
- method reconfig {}
- method reset {}
- method set_status { {msg ""} {tmp 0} }
- method set_execution_status { {line ""} {pc ""}}
- method stack {cmd}
- method test_get {var {private_func 0}}
- method toggle_updates {value}
- method toolbar {state}
- method inferior {action}
- method clear_file {}
- method get_file {}
- method is_fixed {}
- method search {direction string}
-
- proc choose_and_update {}
- proc choose_and_display {tag linespec}
- proc point_to_main {}
-
- #
- # GDB Events
- #
- method busy {event}
- method idle {event}
- method update {event}
- }
-
- private {
- method _build_win {}
- method _exit {}
- method _name {w {val ""}}
- method _set_name { val {found 1} }
- method _set_state {varname}
- method _update_title {name}
- method _update {loc}
- method get_top {}
- method _set_tag_to_stack {}
- proc _choose_window {file}
- variable _statbar
- variable _status
- variable _toolbar
- variable _statusframe
- variable top
- variable twin
- variable current
- variable need_files 0
- variable do_updates 1 ;# if the window does updates
- variable _mangled_func
- variable Tracing
- variable saved_msg "" ;# static
-
- # statics used for downloads
- variable last_section ""
- variable last_section_start 0
- variable last_done 0
-
- # These keep track of the current PC window and the list of all
- # source windows.
- common window_list ""
- common pc_window ""
-
- # fenceposts
- variable Running 0
- variable NoRun 0
- }
-}
diff --git a/gdb/gdbtk/library/stackwin.itb b/gdb/gdbtk/library/stackwin.itb
deleted file mode 100644
index 4fc18ca37a8..00000000000
--- a/gdb/gdbtk/library/stackwin.itb
+++ /dev/null
@@ -1,158 +0,0 @@
-# Stack window for Insight.
-# Copyright (C) 1997, 1998, 1999, 2002, 2003, 2008 Red Hat
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ------------------------------------------------------------------
-# CONSTRUCTOR - create new stack window
-# ------------------------------------------------------------------
-itcl::body StackWin::constructor {args} {
- gdbtk_busy
- build_win
- gdbtk_idle
-
- add_hook gdb_no_inferior_hook [code $this no_inferior]
-}
-
-# ------------------------------------------------------------------
-# DESTRUCTOR - destroy window containing widget
-# ------------------------------------------------------------------
-itcl::body StackWin::destructor {} {
- remove_hook gdb_no_inferior_hook [code $this no_inferior]
-}
-
-# ------------------------------------------------------------------
-# METHOD: build_win - build the main register window
-# ------------------------------------------------------------------
-itcl::body StackWin::build_win {} {
-
- itk_component add slb {
- iwidgets::scrolledlistbox $itk_interior.s \
- -vscrollmode dynamic -hscrollmode dynamic \
- -selectmode single -exportselection false -visibleitems 30x15 \
- -textfont global/fixed -selectioncommand [code $this change_frame]
- }
-
- [$itk_component(slb) component listbox] configure \
- -bg $::Colors(textbg) -fg $::Colors(textfg)
-
- update dummy
-
- pack $itk_interior.s -side left -expand yes -fill both
-
- window_name "Stack"
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: update - update widget when PC changes
-# ------------------------------------------------------------------
-itcl::body StackWin::update {event} {
- global gdb_selected_frame_level
-
- if {!$protect_me} {
- # The gdb_stack command might fail, for instance if you are browsing
- # a trace experiment, and the stack has not been collected.
-
- if {[catch {gdb_stack 0 -1} frames]} {
- dbug W "Error in stack collection $frames"
- set frames {}
- }
-
- if {[llength $frames] == 0} {
- $itk_component(slb) delete 0 end
- $itk_component(slb) insert end {NO STACK}
- return
- }
-
- $itk_component(slb) delete 0 end
- set levels 0
- foreach frame $frames {
- set len [string length $frame]
-
- if {$len > $maxwidth} {
- set maxwidth $len
- }
- $itk_component(slb) insert end $frame
- incr levels
- }
-
- # this next section checks to see if the source
- # window is looking at some location other than the
- # bottom of the stack. If so, highlight the stack frame
- set level [expr {$levels - $gdb_selected_frame_level - 1}]
- $itk_component(slb) selection set $level
- $itk_component(slb) see $level
- }
-}
-
-itcl::body StackWin::idle {event} {
- set Running 0
- cursor {}
-}
-
-# ------------------------------------------------------------------
-# METHOD: change_frame - change the current frame
-# This method is currently ONLY called from the mouse binding
-# ------------------------------------------------------------------
-itcl::body StackWin::change_frame {} {
-
- if {!$Running && [$itk_component(slb) size] != 0} {
- gdbtk_busy
- set sel [$itk_component(slb) curselection]
- set size [$itk_component(slb) size]
- set frame_num [expr {$size - $sel - 1}]
- catch {gdb_cmd "frame $frame_num"}
-
- # Run idle hooks and cause all widgets to update
- set protect_me 1
- gdbtk_update
- set protect_me 0
- gdbtk_idle
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: reconfig - used when preferences change
-# ------------------------------------------------------------------
-itcl::body StackWin::reconfig {} {
- destroy $itk_interior.s
- build_win
-}
-
-# ------------------------------------------------------------------
-# PUBLIC METHOD: busy - BusyEvent handler
-# This method should cause blocking of clicks in
-# the window and change mouse pointer.
-# ------------------------------------------------------------------
-itcl::body StackWin::busy {event} {
- set Running 1
- cursor watch
-}
-
-# ------------------------------------------------------------------
-# METHOD: no_inferior - gdb_no_inferior_hook
-# ------------------------------------------------------------------
-itcl::body StackWin::no_inferior {} {
- set Running 0
- cursor {}
-}
-
-# ------------------------------------------------------------------
-# METHOD: cursor - set the window cursor
-# This is a convenience method which simply sets the mouse
-# pointer to the given glyph.
-# ------------------------------------------------------------------
-itcl::body StackWin::cursor {glyph} {
- set top [winfo toplevel $itk_interior]
- $top configure -cursor $glyph
-}
diff --git a/gdb/gdbtk/library/stackwin.ith b/gdb/gdbtk/library/stackwin.ith
deleted file mode 100644
index b639746175d..00000000000
--- a/gdb/gdbtk/library/stackwin.ith
+++ /dev/null
@@ -1,46 +0,0 @@
-# Stack window class definition for GDBtk.
-# Copyright (C) 1997, 1998, 1999 Cygnus Solutions
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements stack window for gdb
-# ----------------------------------------------------------------------
-
-itcl::class StackWin {
- inherit EmbeddedWin GDBWin
-
- private {
- variable maxwidth 40
- variable Running 0
- variable protect_me 0
- method build_win {}
- method cursor {glyph}
- method change_frame {}
- method no_inferior {}
- }
-
- public {
- method reconfig {}
- method constructor {args}
- method destructor {}
-
- #
- # GDB Events
- #
- method busy {event}
- method idle {event}
- method update {event}
- }
-
-}
-
diff --git a/gdb/gdbtk/library/targetselection.itb b/gdb/gdbtk/library/targetselection.itb
deleted file mode 100644
index 7f9d531ff45..00000000000
--- a/gdb/gdbtk/library/targetselection.itb
+++ /dev/null
@@ -1,1100 +0,0 @@
-# Target selection dialog for Insight.
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements GDB TargetSelection dialog
-# ----------------------------------------------------------------------
-
-# ------------------------------------------------------------------
-# CONSTRUCTOR - create new target selection window
-# ------------------------------------------------------------------
-itcl::body TargetSelection::constructor {args} {
- eval itk_initialize $args
- _init
- build_win
-}
-
-itcl::body TargetSelection::getname {target name} {
-
- # Init target database if we haven't already done so
- init_target_db
-
- if {[info exists gdb_target($target,$name)]} {
- return $gdb_target($target,$name)
- } else {
- return ""
- }
-}
-
-itcl::body TargetSelection::init_target_db {} {
- # check to see if we already initialized this database
- if {$db_inited} {
- return
- }
- set db_inited 1
-
- # We really need to have the preferences defined, too,
- # otherwise set_target and company won't work properly
- # unless the user has first opened a TargetSelection dialog.
- _init_prefs
-
- # Target Database
- # Set the following members:
- # TARGET,pretty-name: Name to display to user
- # TARGET,debaud: Default baudrate
- # TARGET,baud-rates: Permissible baudrates
- # TARGET,cmd: Abstracted command to run for this target (tcpX and com1 are
- # replaced with the real port and host/port in set_target)
- # TARGET,runlist: List of preferences for the target: {attach download run cont}
- # TARGET,after_attaching: a command to run after attaching to the target
-
- # Default target
- set gdb_target(default,pretty-name) "Default"
- set gdb_target(default,defbaud) ""
- set gdb_target(default,baud-rates) {}
- set gdb_target(default,cmd) ""
- set gdb_target(default,runlist) {0 0 1 0}
- set gdb_target(default,options) ""
- set gdb_target(default,after_attaching) {}
-
- # Exec target
- set gdb_target(exec,pretty-name) "Exec"
- set gdb_target(exec,defbaud) ""
- set gdb_target(exec,baud-rates) {}
- set gdb_target(exec,cmd) ""
- set gdb_target(exec,runlist) {0 0 1 0}
- set gdb_target(exec,options) ""
- set gdb_target(exec,after_attaching) {}
-
- # ADS board w/SDS protocol
- set gdb_target(sds,pretty-name) "SDS"
- set gdb_target(sds,defbaud) "38400"
- set gdb_target(sds,baud-rates) {9600 38400}
- set gdb_target(sds,cmd) "sds com1"
- set gdb_target(sds,runlist) {1 1 0 1}
- set gdb_target(sds,after_attaching) {}
-
- # Simulator
- set gdb_target(sim,pretty-name) "Simulator"
- set gdb_target(sim,defbaud) ""
- set gdb_target(sim,baud-rates) {}
- set gdb_target(sim,cmd) "sim"
- set gdb_target(sim,runlist) {1 1 1 0}
- set gdb_target(sim,options) ""
- set gdb_target(sim,after_attaching) {}
-
- # Remote
- set gdb_target(remote,pretty-name) "Remote/Serial"
- set gdb_target(remote,defbaud) "9600"
- set gdb_target(remote,baud-rates) {9600 19200 38400 57600 115200}
- set gdb_target(remote,cmd) "remote com1"
- set gdb_target(remote,runlist) {1 1 0 1}
- set gdb_target(remote,after_attaching) {}
- set gdb_target(remotetcp,pretty-name) "Remote/TCP"
- set gdb_target(remotetcp,defbaud) "TCP"
- set gdb_target(remotetcp,baud-rates) {}
- set gdb_target(remotetcp,cmd) "remote tcpX"
- set gdb_target(remotetcp,runlist) {1 1 0 1}
- set gdb_target(remotetcp,after_attaching) {}
-
- # ARM Angel
- set gdb_target(rdi,pretty-name) "ARM Angel/Serial"
- set gdb_target(rdi,defbaud) "9600"
- set gdb_target(rdi,baud-rates) {9600 19200 38400 57600 115200}
- set gdb_target(rdi,cmd) "rdi com1"
- set gdb_target(rdi,runlist) {1 1 0 1}
- set gdb_target(rdi,after_attaching) {}
-
- # ARM Angel/Ethernet
- set gdb_target(rditcp,pretty-name) "ARM Angel/Ethernet"
- set gdb_target(rditcp,defbaud) "ETH"
- set gdb_target(rditcp,baud-rates) {}
- set gdb_target(rditcp,cmd) "rdi ethX"
- set gdb_target(rditcp,runlist) {1 1 0 1}
- set gdb_target(rditcp,after_attaching) {}
-
- # ARM Remote
- set gdb_target(rdp,pretty-name) "ARM Remote/Serial"
- set gdb_target(rdp,defbaud) "9600"
- set gdb_target(rdp,baud-rates) {9600}
- set gdb_target(rdp,cmd) "rdp com1"
- set gdb_target(rdp,runlist) {1 1 0 1}
- set gdb_target(rdp,after_attaching) {}
- set gdb_target(rdptcp,pretty-name) "ARM Remote/TCP"
- set gdb_target(rdptcp,defbaud) "TCP"
- set gdb_target(rdptcp,baud-rates) {}
- set gdb_target(rdptcp,cmd) "rdp tcpX"
- set gdb_target(rdptcp,runlist) {1 1 0 1}
- set gdb_target(rdptcp,after_attaching) {}
-
- # m32r rev C
- set gdb_target(m32r,pretty-name) "M32R/Serial"
- set gdb_target(m32r,defbaud) "9600"
- set gdb_target(m32r,baud-rates) {9600}
- set gdb_target(m32r,cmd) "m32r com1"
- set gdb_target(m32r,runlist) {1 1 0 1}
- set gdb_target(m32r,after_attaching) {}
- set gdb_target(m32rtcp,pretty-name) "M32R/TCP"
- set gdb_target(m32rtcp,defbaud) "TCP"
- set gdb_target(m32rtcp,baud-rates) {}
- set gdb_target(m32rtcp,cmd) "m32r tcpX"
- set gdb_target(m32rtcp,runlist) {1 1 0 1}
- set gdb_target(m32rtcp,after_attaching) {}
-
- # m32r msa2000
- set gdb_target(mon2000,pretty-name) "MON2000/Serial"
- set gdb_target(mon2000,defbaud) "9600"
- set gdb_target(mon2000,baud-rates) {9600}
- set gdb_target(mon2000,cmd) "mon2000 com1"
- set gdb_target(mon2000,runlist) {1 1 0 1}
- set gdb_target(mon2000,after_attaching) {}
- set gdb_target(mon2000tcp,pretty-name) "MON2000/TCP"
- set gdb_target(mon2000tcp,defbaud) "TCP"
- set gdb_target(mon2000tcp,baud-rates) {}
- set gdb_target(mon2000tcp,cmd) "mon2000 tcpX"
- set gdb_target(mon2000tcp,runlist) {1 1 0 1}
- set gdb_target(mon2000tcp,after_attaching) {}
-
- # sparclite
- set gdb_target(sparclite,pretty-name) "SPARClite/Serial"
- set gdb_target(sparclite,defbaud) "9600"
- set gdb_target(sparclite,baud-rates) {9600}
- set gdb_target(sparclite,cmd) "sparclite com1"
- set gdb_target(sparclite,runlist) {1 1 0 1}
- set gdb_target(sparclite,after_attaching) {}
- set gdb_target(sparclitetcp,pretty-name) "SPARClite/TCP"
- set gdb_target(sparclitetcp,defbaud) "TCP"
- set gdb_target(sparclitetcp,baud-rates) {}
- set gdb_target(sparclitetcp,cmd) "sparclite tcpX"
- set gdb_target(sparclitetcp,runlist) {1 1 0 1}
- set gdb_target(sparclitetcp,after_attaching) {}
-
- # V850 ICE
- set gdb_target(ice,pretty-name) "V850 ICE"
- set gdb_target(ice,defbaud) ""
- set gdb_target(ice,baud-rates) {}
- set gdb_target(ice,cmd) "ice"
- set gdb_target(ice,runlist) {1 1 0 1}
- set gdb_target(ice,after_attaching) {}
-
- # MIPS
- set gdb_target(mips,pretty-name) "MIPS/Serial"
- set gdb_target(mips,defbaud) "9600"
- set gdb_target(mips,baud-rates) {9600}
- set gdb_target(mips,cmd) "mips com1"
- set gdb_target(mips,runlist) {1 1 0 1}
- set gdb_target(mips,after_attaching) {}
- set gdb_target(mipstcp,pretty-name) "MIPS/TCP"
- set gdb_target(mipstcp,defbaud) "TCP"
- set gdb_target(mipstcp,baud-rates) {}
- set gdb_target(mipstcp,cmd) "mips tcpX"
- set gdb_target(mipstcp,runlist) {1 1 0 1}
- set gdb_target(mipstcp,after_attaching) {}
-
- # PMON
- set gdb_target(pmon,pretty-name) "PMON/Serial"
- set gdb_target(pmon,defbaud) "9600"
- set gdb_target(pmon,baud-rates) {9600 19200 38400}
- set gdb_target(pmon,cmd) "pmon com1"
- set gdb_target(pmon,runlist) {1 1 0 1}
- set gdb_target(pmon,after_attaching) {}
- set gdb_target(pmontcp,pretty-name) "PMON/TCP"
- set gdb_target(pmontcp,defbaud) "TCP"
- set gdb_target(pmontcp,baud-rates) {}
- set gdb_target(pmontcp,cmd) "pmon tcpX"
- set gdb_target(pmontcp,runlist) {1 1 0 1}
- set gdb_target(pmontcp,after_attaching) {}
-
- # DDB
- set gdb_target(ddb,pretty-name) "DDB/Serial"
- set gdb_target(ddb,defbaud) "19200"
- set gdb_target(ddb,baud-rates) {9600 19200 38400}
- set gdb_target(ddb,cmd) "ddb com1"
- set gdb_target(ddb,runlist) {1 1 0 1}
- set gdb_target(ddb,after_attaching) {}
- set gdb_target(ddbtcp,pretty-name) "DDB/TCP"
- set gdb_target(ddbtcp,defbaud) "TCP"
- set gdb_target(ddbtcp,baud-rates) {}
- set gdb_target(ddbtcp,cmd) "ddb tcpX"
- set gdb_target(ddbtcp,runlist) {1 1 0 1}
- set gdb_target(ddbtcp,after_attaching) {}
-
- # Picobug
- set gdb_target(picobug,pretty-name) "Picobug/Serial"
- set gdb_target(picobug,defbaud) "19200"
- set gdb_target(picobug,baud-rates) {19200}
- set gdb_target(picobug,cmd) "picobug com1"
- set gdb_target(picobug,runlist) {1 1 0 1}
- set gdb_target(picobug,after_attaching) {}
- set gdb_target(picobugtcp,pretty-name) "Picobug/TCP"
- set gdb_target(picobugtcp,defbaud) "TCP"
- set gdb_target(picobugtcp,baud-rates) {}
- set gdb_target(picobugtcp,cmd) "picobug tcpX"
- set gdb_target(picobugtcp,runlist) {1 1 0 1}
- set gdb_target(picobugtcp,after_attaching) {}
-
- # Cisco.
- set gdb_target(cisco,pretty-name) "Cisco/Serial"
- set gdb_target(cisco,defbaud) "38400"
- set gdb_target(cisco,baud-rates) {9600 19200 38400 56000}
- set gdb_target(cisco,cmd) "cisco com1"
- set gdb_target(cisco,runlist) {1 0 0 0}
- set gdb_target(cisco,after_attaching) "set os cisco"
- set gdb_target(ciscotcp,pretty-name) "Cisco/TCP"
- set gdb_target(ciscotcp,defbaud) "TCP"
- set gdb_target(ciscotcp,baud-rates) {}
- set gdb_target(ciscotcp,cmd) "cisco tcpX"
- set gdb_target(ciscotcp,runlist) {1 0 0 0}
- set gdb_target(ciscotcp,after_attaching) "set os cisco"
-
- # VxWorks
- set gdb_target(vxworks,pretty-name) "VxWorks RDB"
- set gdb_target(vxworks,defbaud) "ETH"
- set gdb_target(vxworks,baud-rates) {}
- set gdb_target(vxworks,cmd) "vxworks ethX"
- set gdb_target(vxworks,runlist) { 1 0 1 1}
- set gdb_target(vxworks,after_attaching) { sym vxWorks.st }
-
- # GDBServer, libremote, rda, etc
- set gdb_target(gdbserver,pretty-name) "GDBserver"
- set gdb_target(gdbserver,pretty-name) "GDBserver/Serial"
- set gdb_target(gdbserver,defbaud) "9600"
- set gdb_target(gdbserver,baud-rates) {9600 19200 38400 57600 115200}
- set gdb_target(gdbserver,cmd) "remote com1"
- set gdb_target(gdbserver,runlist) {1 0 0 1}
- set gdb_target(gdbserver,after_attaching) {}
- set gdb_target(gdbservertcp,pretty-name) "GDBserver/TCP"
- set gdb_target(gdbservertcp,defbaud) "TCP"
- set gdb_target(gdbservertcp,baud-rates) {}
- set gdb_target(gdbservertcp,cmd) "remote tcpX"
- set gdb_target(gdbservertcp,runlist) {1 0 0 1}
- set gdb_target(gdbservertcp,after_attaching) {}
-}
-
-itcl::body TargetSelection::default_port {} {
- global gdbtk_platform
- switch -regexp $gdbtk_platform(os) {
- cygwin { set port /dev/com1 }
- mingw { set port COM1 }
- Linux { set port /dev/ttyS0 }
- SunOS { set port /dev/ttya }
- AIX { set port /dev/foo1 }
- ULTRIX { set port /dev/foo1 }
- IRIX { set port /dev/foo1 }
- OSF1 { set port /dev/foo1 }
- NetBSD { set port /dev/foo1 }
- HP-UX {
- # Special case...
- switch -regexp $gdbtk_platform(osVersion) {
- A.09 { set port /dev/tty00 }
- B.10 -
- B.11 { set port /dev/tty0p0 }
- }
- }
- default { set port /dev/ttya }
- }
-
- return $port
-}
-
-
-itcl::body TargetSelection::_init_prefs {} {
-
- if {$prefs_inited} {
- return
- }
- set prefs_inited 1
-
- # these are not target-specific
-
- pref define gdb/load/main 1
- pref define gdb/load/exit 1
- pref define gdb/load/check 0
-
- # these are target-specific
- # set up the defaults
- pref define gdb/load/default-verbose 0
- pref define gdb/load/default-port [default_port]
- pref define gdb/load/default-hostname ""
- pref define gdb/load/default-after_attaching {}
- pref define gdb/load/default-portname 32767
-}
-
-itcl::body TargetSelection::_init_target {} {
- global gdb_target_name
- set target_list [get_target_list]
- set target $gdb_target_name
-
- # target = CANCEL should never come into here. If the target was
- # returned as CANCEL, it should be fixed by the caller... But it
- # should not be harmful if it gets in here.
-
- if {$target == "" || [string compare $target CANCEL] == 0} {
- set target default
- }
-
- set defbaud $gdb_target($target,defbaud)
- pref define gdb/load/$target-baud $defbaud
- pref define gdb/load/$target-port [pref get gdb/load/default-port]
- pref define gdb/load/$target-verbose [pref get gdb/load/default-verbose]
- pref define gdb/load/$target-portname 1000
- pref define gdb/load/$target-hostname [pref get gdb/load/default-hostname]
-
- set err [catch {pref get gdb/load/$target-runlist} run_list]
- if {$err} {
- set run_list $gdb_target($target,runlist)
- pref setd gdb/load/$target-runlist $run_list
- }
- pref set gdb/src/run_attach [lindex $run_list 0]
- pref set gdb/src/run_load [lindex $run_list 1]
- pref set gdb/src/run_run [lindex $run_list 2]
- pref set gdb/src/run_cont [lindex $run_list 3]
-
- set err [catch {pref get gdb/load/$target-after_attaching} aa]
- if {$err} {
- set aa $gdb_target($target,after_attaching)
- pref setd gdb/load/$target-after_attaching $aa
- }
-}
-
-itcl::body TargetSelection::_init {} {
-
- if {!$trace_inited} {
- # Trace all gdb_loaded changes based on target
- trace variable gdb_loaded w [code TargetSelection::target_trace]
- }
- set trace_inited 1
-
- init_target_db ;# initialize database
- _init_target ;# initialize target prefs
- set_saved
-
- # This tells us that the target system is inited. Some of these
- # init functions need to be called every time the target dialog is
- # posted, some only once. The latter functions can check inited to
- # see what they should do.
-
-}
-
-# ------------------------------------------------------------------
-# METHOD: build_win - build the dialog
-# ------------------------------------------------------------------
-itcl::body TargetSelection::build_win {} {
- global gdbtk_platform PREFS_state gdb_ImageDir gdb_target_name
-
- set f [frame $itk_interior.f]
- set opts [frame $itk_interior.moreoptions]
- frame $itk_interior.moreoptionsframe
- set btns [frame $itk_interior.buttons]
-
- #labelled frame "Connection"
- iwidgets::Labeledframe $f.lab -labelpos nw -labeltext [gettext "Connection"]
- set fr [$f.lab childsite]
-
- # target name
- label $fr.tarl -text [gettext "Target:"]
- combobox::combobox $fr.tar -editable 0 -command [code $this change_target] \
- -width $Width -maxheight 10 -bg $::Colors(textbg)
-
- # baud rate combobox
- label $fr.cbl -text [gettext "Baud Rate:"]
- combobox::combobox $fr.cb -editable 0 -command [code $this change_baud] \
- -textvariable [pref varname gdb/load/$target-baud] -width $Width \
- -maxheight 10 -bg $::Colors(textbg)
-
- if {[catch {gdb_cmd "show remotebaud"} res]} {
- set baud [pref get gdb/load/$target-baud]
- } else {
- set baud [lindex $res end]
- set baud [string trimright $baud "."]
- # When uninitialized, GDB returns a baud rate of 2^32
- # Detect this and ignore it.
- if {$baud > 4000000000} {
- set baud [pref get gdb/load/$target-baud]
- } else {
- pref setd gdb/load/$target-baud $baud
- }
- }
-
- # host entry widget
- entry $fr.host -textvariable [pref varname gdb/load/$target-hostname] \
- -width $Width
-
- # port combobox
- if {$gdbtk_platform(platform) == "windows"} {
- set editable 0
- } else {
- set editable 1
- }
-
- label $fr.portl -text [gettext "Port:"]
- combobox::combobox $fr.port -editable $editable \
- -textvariable [pref varname gdb/load/$target-port] \
- -width $Width -maxheight 10 -bg $::Colors(textbg)
-
- # load baud rates into combobox
- fill_rates
-
- # load port combobox
- if {$gdbtk_platform(platform) == "windows"} {
- foreach val [port_list] {
- $fr.port list insert end $val
- }
- } else {
- # fixme: how do I find valid values for these????
- switch $gdbtk_platform(os) {
- Linux { set ports [list /dev/cua0 /dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyS3]}
- SunOS { set ports [list /dev/ttya /dev/ttyb] }
- AIX { set ports [list /dev/foo1 /dev/foo2] }
- ULTRIX { set ports [list /dev/foo1 /dev/foo2] }
- IRIX { set ports [list /dev/foo1 /dev/foo2] }
- OSF1 { set ports [list /dev/foo1 /dev/foo2] }
- NetBSD { set ports [list /dev/foo1 /dev/foo2] }
- HP-UX {
- # Special case...
- switch -regexp $gdbtk_platform(osVersion) {
- A.09 { set ports [list /dev/tty00 /dev/tty01] }
- B.10 -
- B.11 { set ports [list /dev/tty0p0 /dev/tty1p0] }
- }
- }
- default { set ports [list UNKNOWN UNKNOWN] }
- }
- foreach val $ports {
- $fr.port list insert end $val
- }
- }
-
- # Port entry widget
- entry $fr.porte -textvariable [pref varname gdb/load/$target-port] -width $Width
-
- frame $f.fr
- checkbutton $f.fr.main -text [gettext "Set breakpoint at 'main'"] \
- -variable [pref varname gdb/load/main]
- checkbutton $f.fr.exit -text [gettext "Set breakpoint at 'exit'"] \
- -variable [pref varname gdb/load/exit]
- frame $f.fr.bp
- checkbutton $f.fr.bp.at_func -text [gettext "Set breakpoint at"] \
- -variable [pref varname gdb/load/bp_at_func]
- entry $f.fr.bp.func -textvariable [pref varname gdb/load/bp_func] -width 20
- checkbutton $f.fr.verb -text [gettext "Display Download Dialog"] \
- -variable [pref varname gdb/load/$target-verbose]
-
- if {$gdbtk_platform(platform) == "unix"} {
- checkbutton $f.fr.xterm -text [gettext "Use xterm as inferior's tty"] \
- -variable [pref varname gdb/process/xtermtty] \
- -onvalue yes -offvalue no
- }
-
- if {![pref get gdb/control_target]} {
- $f.fr.main configure -state disabled
- $f.fr.exit configure -state disabled
- $f.fr.verb configure -state disabled
- $f.fr.bp.at_func configure -state disabled
- $f.fr.bp.func configure -state disabled
- checkbutton $f.fr.check -text [gettext "Compare to remote executable"] \
- -variable [pref varname gdb/load/check]
- if { $gdb_target_name == "exec" } {
- $f.fr.check configure -state disabled
- }
- }
-
- grid $fr.tarl $fr.tar -sticky w -padx 5 -pady 5
- grid $fr.cbl $fr.cb -sticky w -padx 5 -pady 5
- grid $fr.portl $fr.port -sticky w -padx 5 -pady 5
- set mapped1 $fr.cb
- set mapped2 $fr.port
-
- grid $f.fr.main -sticky w -padx 5 -pady 5
- grid $f.fr.exit -sticky w -padx 5 -pady 5
- pack $f.fr.bp.at_func $f.fr.bp.func -side left
- grid $f.fr.bp -sticky w -padx 5 -pady 5
- grid $f.fr.verb -sticky w -padx 5 -pady 5
- if {$gdbtk_platform(platform) == "unix"} {
- grid $f.fr.xterm -sticky w -padx 5 -pady 5
- }
- if {![pref get gdb/control_target]} {
- grid $f.fr.check -sticky w -padx 5 -pady 5
- }
-
- grid $f.lab $f.fr -sticky w -padx 5 -pady 5
-
- # Create the "More Options" thingy
- if {[lsearch [image names] _MORE_] == -1} {
- image create photo _MORE_ -file [file join $gdb_ImageDir more.gif]
- image create photo _LESS_ -file [file join $gdb_ImageDir less.gif]
- }
-
- set MoreButton [button $opts.button -image _MORE_ \
- -relief flat -command [code $this toggle_more_options]]
- set MoreLabel [label $opts.lbl -text {More Options}]
- frame $opts.frame -relief raised -bd 1
- pack $opts.button $opts.lbl -side left
- place $opts.frame -relx 1 -x -10 -rely 0.5 -relwidth 0.73 -height 2 -anchor e
-
- # Create the (hidden) more options frame
- set MoreFrame [iwidgets::Labeledframe $itk_interior.moreoptionsframe.frame \
- -labelpos nw -labeltext {Run Options}]
- set frame [$MoreFrame childsite]
-
- set var [pref varname gdb/src/run_attach]
- checkbutton $frame.attach -text {Attach to Target} -variable $var
-
- set var [pref varname gdb/src/run_load]
- checkbutton $frame.load -text {Download Program} -variable $var
-
- set rm_frame [iwidgets::labeledframe $frame.run_method -labelpos nw -labeltext "Run Method" ]
- set RunMethod [ $rm_frame childsite ]
-
- set var [pref varname gdb/src/run_cont]
- radiobutton $RunMethod.cont -text {Continue from Last Stop} -value 1 -variable $var \
- -command [code $this set_run run]
-
- set var [pref varname gdb/src/run_run]
- radiobutton $RunMethod.run -text {Run Program} -value 1 -variable $var \
- -command [code $this set_run cont]
-
- # The after attaching command entry
- set _after_entry [entry $frame.aftere]
- label $frame.afterl -text {Command to issue after attaching:}
-
- grid $frame.attach -column 0 -row 1 -padx 10 -sticky w
- grid $frame.load -column 0 -row 2 -padx 10 -sticky w
-
- grid $RunMethod.run -column 0 -row 1 -sticky w -ipady 2
- grid $RunMethod.cont -column 0 -row 2 -sticky w -ipady 2
-
- grid $rm_frame -column 1 -row 1 -rowspan 2 -sticky nsew -ipady 2
-
- grid $frame.afterl -row 4 -sticky we -columnspan 2 -ipady 2
- grid $frame.aftere -sticky we -columnspan 2 -ipady 2
- grid columnconfigure $frame 0 -weight 1
- grid columnconfigure $frame 1 -weight 1
-
- # Map everything onto the screen
- # This looks like a possible packing bug -- our topmost frame
- # will not resize itself. So, instead, use the topmost frame.
- #pack $f $opts $itk_interior.moreoptionsframe -side top -fill x
- pack $MoreFrame -fill x -expand yes
- pack $f $opts -side top -fill x
-
- change_target $gdb_target($target,pretty-name)
-
- button $btns.ok -text [gettext OK] -width 7 -command [code $this save] \
- -default active
- button $btns.cancel -text [gettext Cancel] -width 7 \
- -command [code $this cancel]
- button $btns.help -text [gettext Help] -width 7 -command [code $this help]
-
- standard_button_box $btns
- bind $btns.ok <Return> "$btns.ok flash; $btns.ok invoke"
- bind $btns.cancel <Return> "$btns.cancel flash; $btns.cancel invoke"
- bind $btns.help <Return> "$btns.help flash; $btns.help invoke"
-
- pack $btns -side bottom -anchor e
- focus $btns.ok
-
- # set up balloon help
- balloon register $f.fr.bp.at_func "Set User-Speficied Breakpoints at Run Time"
- balloon register $f.fr.bp.func "Enter a List of Functions for Breakpoints"
-
- window_name "Target Selection"
-
- if {[valid_target $target]} {
- $fr.tar configure -value $gdb_target($target,pretty-name)
- }
- fill_targets
-
-
-}
-
-# ------------------------------------------------------------------
-# METHOD: set_saved - set saved values
-# ------------------------------------------------------------------
-itcl::body TargetSelection::set_saved {} {
- set saved_baud [pref get gdb/load/$target-baud]
- set saved_port [pref get gdb/load/$target-port]
- set saved_main [pref get gdb/load/main]
- set saved_exit [pref get gdb/load/exit]
- set saved_check [pref get gdb/load/check]
- set saved_verb [pref get gdb/load/$target-verbose]
- set saved_portname [pref get gdb/load/$target-portname]
- set saved_hostname [pref get gdb/load/$target-hostname]
- set saved_attach [pref get gdb/src/run_attach]
- set saved_load [pref get gdb/src/run_load]
- set saved_run [pref get gdb/src/run_run]
- set saved_cont [pref get gdb/src/run_cont]
- if {[info exists gdb_target($target,options)]} {
- if {[catch {pref get gdb/load/$target-opts} saved_options]} {
- set saved_options ""
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: write_saved - write saved values to preferences
-# ------------------------------------------------------------------
-itcl::body TargetSelection::write_saved {} {
- pref setd gdb/load/$target-baud $saved_baud
- pref setd gdb/load/$target-port $saved_port
- pref setd gdb/load/main $saved_main
- pref setd gdb/load/exit $saved_exit
- pref setd gdb/load/check $saved_check
- pref setd gdb/load/$target-verbose $saved_verb
- pref setd gdb/load/$target-portname $saved_portname
- pref setd gdb/load/$target-hostname $saved_hostname
- pref setd gdb/load/$target-runlist [list $saved_attach $saved_load $saved_run $saved_cont]
- if {[info exists gdb_target($target,options)]} {
- pref setd gdb/load/$target-opts $saved_options
- }
- if {[catch {$_after_entry get} saved_after_attaching]} {
- set saved_after_attaching ""
- }
- pref setd gdb/load/$target-after_attaching $saved_after_attaching
-}
-
-# ------------------------------------------------------------------
-# METHOD: fill_rates - fill baud rate combobox
-# ------------------------------------------------------------------
-itcl::body TargetSelection::fill_rates {} {
- $fr.cb list delete 0 end
-
- if {$gdb_target($target,baud-rates) != ""} {
- foreach val $gdb_target($target,baud-rates) {
- $fr.cb list insert end $val
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: fill_targets - fill target combobox
-# ------------------------------------------------------------------
-itcl::body TargetSelection::fill_targets {} {
- #[$fr.tar subwidget listbox] delete 0 end
- $fr.tar list delete 0 end
-
- foreach val $target_list {
- if {[info exists gdb_target($val,pretty-name)]} {
- $fr.tar list insert end $gdb_target($val,pretty-name)
-
- # Insert TCP target, if it exists
- if {[info exists gdb_target(${val}tcp,pretty-name)]} {
- $fr.tar list insert end $gdb_target(${val}tcp,pretty-name)
- }
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: config_dialog - Convenience method to map/unmap/rename
-# components onto the screen based on target T.
-# ------------------------------------------------------------------
-itcl::body TargetSelection::config_dialog {t} {
- pref define gdb/load/$t-verbose [pref get gdb/load/verbose]
- $f.fr.verb config -variable [pref varname gdb/load/$t-verbose]
- # Map the correct entries and comboboxes onto the screen
- if {$gdb_target($t,defbaud) == "TCP"} {
- # we have a tcp target
- # map host and porte
- if {$mapped1 != "$fr.host"} {
- grid forget $mapped1
- set mapped1 $fr.host
- grid $mapped1 -row 1 -column 1 -sticky w -padx 5 -pady 5
- }
- $fr.cbl configure -text "Hostname:"
- $fr.host config -textvariable [pref varname gdb/load/$t-hostname]
-
- if {$mapped2 != "$fr.porte"} {
- grid forget $mapped2
- set mapped2 $fr.porte
- grid $mapped2 -row 2 -column 1 -sticky w -padx 5 -pady 5
- }
- $fr.portl configure -text {Port:}
- $fr.porte config -textvariable [pref varname gdb/load/$t-portname] -fg black
-
- $mapped1 configure -state normal
- $mapped2 configure -state normal
- } elseif {$gdb_target($t,defbaud) == "ETH"} {
- # we have a udp target
- # map host and porte
- if {$mapped1 != "$fr.host"} {
- grid forget $mapped1
- set mapped1 $fr.host
- grid $mapped1 -row 1 -column 1 -sticky w -padx 5 -pady 5
- }
- $fr.cbl configure -text "Hostname:"
- $fr.host config -textvariable [pref varname gdb/load/$t-hostname]
-
- if {$mapped2 != "$fr.porte"} {
- grid forget $mapped2
- }
- $fr.portl configure -text {Port: N/A (fixed)}
-
- $mapped1 configure -state normal
- $mapped2 configure -state disabled
- } elseif {$gdb_target($t,defbaud) != ""} {
- # we have a serial target
- # map port and cb
- if {$mapped1 != "$fr.cb"} {
- grid forget $mapped1
- set mapped1 $fr.cb
- grid $mapped1 -row 1 -column 1 -sticky w -padx 5 -pady 5
- }
- $fr.cbl configure -text "Baud Rate:"
- $fr.cb configure -textvariable [pref varname gdb/load/$t-baud]
-
- if {$mapped2 != "$fr.port"} {
- grid forget $mapped2
- set mapped2 $fr.port
- grid $mapped2 -row 2 -column 1 -sticky w -padx 5 -pady 5
- }
- $fr.portl configure -text {Port:}
- $fr.port configure -textvariable [pref varname gdb/load/$t-port]
-
- $mapped1 configure -state normal
- $mapped2 configure -state normal
- } else {
- # we have a non-remote(-like) target
- # disable all (except tar) and check for
- # options
- $mapped1 configure -state disabled
- $mapped2 configure -state disabled
- $fr.porte configure -fg gray
-
- if {[info exists gdb_target($t,options)]} {
- if {$mapped1 != "$fr.host"} {
- grid forget $mapped1
- set mapped1 $fr.host
- grid $mapped1 -row 1 -column 1 -sticky w -padx 5 -pady 5
- }
- $mapped1 configure -state normal
- $fr.host config -textvariable [pref varname gdb/load/$t-opts]
-
- # We call options "arguments" for the exec target
- # FIXME: this is really overloaded!!
- if {$t == "exec"} {
- set text "Arguments:"
- } else {
- set text "Options:"
- }
- $fr.cbl configure -text $text
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: change_target - callback for target combobox
-# ------------------------------------------------------------------
-itcl::body TargetSelection::change_target {w {name ""}} {
- if {$name == ""} {return}
- set target [get_target $name]
-
- if { "$target" == "exec" } {
- $RunMethod.run configure -state disabled -value 1
- $RunMethod.cont configure -state disabled
- } else {
- $RunMethod.run configure -state normal
- $RunMethod.cont configure -state normal
- }
-
- debug "$target"
- set defbaud $gdb_target($target,defbaud)
- pref define gdb/load/$target-baud $defbaud
- pref define gdb/load/$target-portname 1000
- pref define gdb/load/$target-hostname [pref get gdb/load/default-hostname]
- if {$defbaud == ""} {
- pref define gdb/load/$target-port ""
- } else {
- pref define gdb/load/$target-port [pref get gdb/load/default-port]
- }
-
- config_dialog $target
- fill_rates
-
- # Configure the default run options for this target
- set err [catch {pref get gdb/load/$target-runlist} run_list]
- if {$err} {
- set run_list $gdb_target($target,runlist)
- pref setd gdb/load/$target-runlist $run_list
- }
-
- pref set gdb/src/run_attach [lindex $run_list 0]
- pref set gdb/src/run_load [lindex $run_list 1]
- pref set gdb/src/run_run [lindex $run_list 2]
- pref set gdb/src/run_cont [lindex $run_list 3]
- set_check_button $name
-
- set err [catch {pref get gdb/load/$target-after_attaching} aa]
- if {$err} {
- set aa $gdb_target($target,after_attaching)
- pref setd gdb/load/$target-after_attaching $aa
- }
-
- $_after_entry delete 0 end
- $_after_entry insert 0 $aa
-
- set_saved
-
- set changes 0
-}
-
-# ------------------------------------------------------------------
-# PRIVATE METHOD: change_baud - called when the baud rate is changed.
-# If GDB is running, set baud rate in GDB and read it back.
-# ------------------------------------------------------------------
-itcl::body TargetSelection::change_baud {w {baud ""}} {
- if {$baud != ""} {
- if {([string compare $baud "TCP"] != 0)
- && ([string compare $baud "ETH"] != 0)} {
- gdb_cmd "set remotebaud $baud"
- if {[catch {gdb_cmd "show remotebaud"} res]} {
- set newbaud 0
- } else {
- set newbaud [lindex $res end]
- set newbaud [string trimright $newbaud "."]
- if {$newbaud > 4000000} {
- set newbaud 0
- }
- }
- if {$newbaud != $baud} {
- pref set gdb/load/$target-baud $newbaud
- }
- }
- }
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: port_list - return a list of valid ports for Windows
-# ------------------------------------------------------------------
-itcl::body TargetSelection::port_list {} {
- global gdbtk_platform
- if {[string compare $gdbtk_platform(os) "cygwin"] == 0} {
- set device "/dev/com"
- } else {
- set device "COM"
- }
- set plist ""
- # Scan com1 - com8 trying to open each one.
- # If permission is denied that means it is in use,
- # which is OK because we may be using it or the user
- # may be setting up the remote target manually with
- # a terminal program.
- set quit 0
- for {set i 1} {!$quit} {incr i} {
- if {[catch { set fd [::open COM$i: RDWR] } msg]} {
- # Failed. Find out why.
- if {[string first "permission denied" $msg] != -1} {
- # Port is there, but busy right now. That's OK.
- lappend plist $device$i
- } elseif {$i > 4} {
- # if we've scanned the first 4 ports, then quit when we find no more
- set quit 1
- }
- } else {
- # We got it. Now close it and add to list.
- close $fd
- lappend plist $device$i
- }
- }
- return $plist
-}
-
-# ------------------------------------------------------------------
-# METHOD: get_target_list - return a list of targets supported
-# by this GDB. Parses the output of "help target"
-# ------------------------------------------------------------------
-itcl::body TargetSelection::get_target_list {} {
- set native [native_debugging]
- set names ""
- set res [gdb_cmd "help target"]; # this just screams MI...
-
- # targets are listed with lines like "target NAME -- DESCRIPTION"
- foreach line [split $res \n] {
- if {[scan $line "target %s --" name] == 1} {
- # For cross debuggers, do not allow the target "exec"
- if {$name == "exec" && !$native} {
- continue
- }
-
- lappend names $name
- }
- }
-
- lappend names gdbserver
- return [lsort $names]
-}
-
-# ------------------------------------------------------------------
-# METHOD: save - save values
-# ------------------------------------------------------------------
-itcl::body TargetSelection::save {} {
- global gdb_target_name
- set err [catch {
- set_saved
- write_saved
- set gdb_target_name $target
- pref setd gdb/load/target $target
- } errtxt]
- if {$err} {debug "target: $errtxt"}
- if {[valid_target $gdb_target_name]} {
- # Dismiss the dialog box
- unpost
- } else {
- tk_messageBox -message "The current target is not valid."
- }
-
-}
-
-
-# ------------------------------------------------------------------
-# METHOD: cancel - restore previous values
-# ------------------------------------------------------------------
-itcl::body TargetSelection::cancel {} {
- global gdb_target_name
- catch {gdb_cmd "set remotebaud $saved_baud"}
-
- $fr.cb configure -value $saved_baud
- write_saved
- if {$exportcancel} {
- set gdb_target_name CANCEL
- }
-
- # Now dismiss the dialog
- unpost
-}
-
-# ------------------------------------------------------------------
-# METHOD: set_check_button - enable/disable compare-section command
-# ------------------------------------------------------------------
-itcl::body TargetSelection::set_check_button {name} {
- if {[winfo exists $itk_interior.f.fr.check]} {
- if { $name == "exec" } {
- $itk_interior.f.fr.check configure -state disabled
- } else {
- $itk_interior.f.fr.check configure -state normal
- }
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: help - launches context sensitive help.
-# ------------------------------------------------------------------
-itcl::body TargetSelection::help {} {
- open_help target.html
-}
-
-# ------------------------------------------------------------------
-# METHOD: reconfig - used when preferences change
-# ------------------------------------------------------------------
-itcl::body TargetSelection::reconfig {} {
- # for now, just delete and recreate
- destroy $itk_interior.f
- build_win
-}
-
-# ------------------------------------------------------------------
-# METHOD: get_target - get the internal name of a target from the
-# pretty-name
-# ------------------------------------------------------------------
-itcl::body TargetSelection::get_target {name} {
- set t {}
- set list [array get gdb_target *,pretty-name]
- set i [lsearch -exact $list $name]
- if {$i != -1} {
- incr i -1
- set t [lindex [split [lindex $list $i] ,] 0]
- } else {
- debug "unknown pretty-name \"$name\""
- }
- return $t
-}
-
-# ------------------------------------------------------------------
-# METHOD: toggle_more_options -- toggle displaying the More/Fewer
-# Options pane
-# ------------------------------------------------------------------
-itcl::body TargetSelection::toggle_more_options {} {
- if {[$MoreLabel cget -text] == "More Options"} {
- $MoreLabel configure -text "Fewer Options"
- $MoreButton configure -image _LESS_
- # Bug in Tk? The top-most frame does not shrink...
- #pack $MoreFrame
- pack $itk_interior.moreoptionsframe -after $itk_interior.moreoptions -fill both -padx 5 -pady 5
- } else {
- $MoreLabel configure -text "More Options"
- $MoreButton configure -image _MORE_
- #pack forget $MoreFrame
- pack forget $itk_interior.moreoptionsframe
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: set_run - set the run button. Make sure not both run and
-# continue are selected.
-# ------------------------------------------------------------------
-itcl::body TargetSelection::set_run {check_which} {
- global PREFS_state
- set var [pref varname gdb/src/run_$check_which]
- global $var
- if {[set $var]} {
- set $var 0
- }
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: target_trace
-# This procedure is used to configure gdb_loaded
-# and possible more) whenever the value of gdb_loaded
-# is changed based on the current target.
-# ------------------------------------------------------------------
-itcl::body TargetSelection::target_trace {variable index op} {
- global gdb_target_name gdb_loaded
-
- switch $gdb_target_name {
-
- exec {
- # The exec target is always loaded.
- set gdb_loaded 1
- }
- }
-}
-
-# Returns 1 if TARGET is a _runnable_ target for this gdb.
-itcl::body TargetSelection::valid_target {target} {
-
- # always allow gdbserver
- if {$target == "gdbserver"} {return 1}
-
- set err [catch {gdb_cmd "help target $target"}]
- if {$target == "exec" && ![native_debugging]} {
- set err 1
- }
-
- if {[regexp "tcp$" $target]} {
- # Special case (of course)
- regsub tcp$ $target {} foo
- return [valid_target $foo]
- }
-
- return [expr {$err == 0}]
-}
-
-# Returns 1 if this is not a cross debugger.
-itcl::body TargetSelection::native_debugging {} {
- global GDBStartup
-
- set r [string compare $GDBStartup(host_name) $GDBStartup(target_name)]
- return [expr {!$r}]
-}
diff --git a/gdb/gdbtk/library/targetselection.ith b/gdb/gdbtk/library/targetselection.ith
deleted file mode 100644
index a7c9182491d..00000000000
--- a/gdb/gdbtk/library/targetselection.ith
+++ /dev/null
@@ -1,100 +0,0 @@
-# Target selection dialog class definition for GDBtk.
-# Copyright (C) 1997, 1998, 1999 Cygnus Solutions
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class TargetSelection {
- inherit ModalDialog ManagedWin
-
- private {
- variable f
- variable fr
- variable target
- variable saved_baud
- variable saved_port
- variable saved_main
- variable saved_exit
- variable saved_check
- variable saved_verb
- variable saved_portname
- variable saved_hostname
- variable saved_attach
- variable saved_load
- variable saved_run
- variable saved_cont
- variable saved_options
- variable saved_after_attaching
- variable _after_entry
- variable changes 0
- variable target_list ""
-
- common db_inited 0
- common prefs_inited 0
- common trace_inited 0
-
- # The Connection frame has three "sections"; the first contains
- # a combobox with all the targets. The second can either be
- # a combobox listing available baud rates or an entry for specifying
- # the hostname of a TCP connection. The actual widget mapped onto the
- # screen is saved in MAPPED1. The third section contains either a
- # combobox for the serial port or an entry for the portnumber. The
- # widget actually mapped onto the screen is saved in MAPPED2.
- variable mapped1
- variable mapped2
-
- variable Width 20
- variable MoreButton
- variable MoreFrame
- variable MoreLabel
-
- variable RunMethod
-
- proc _init_prefs {}
- proc default_port {}
-
- method build_win {}
- method cancel {}
- method change_baud {w {baud ""}}
- method change_target {w {name ""}}
- method config_dialog {t}
- method fill_rates {}
- method fill_targets {}
- method get_target {name}
- method help {}
- method _init {}
- method _init_target {}
- method port_list {}
- method save {}
- method set_check_button {name}
- method set_run {check_which}
- method set_saved {}
- method target_trace {variable index op}
- method toggle_more_options {}
- method valid_target {target}
- method write_saved {}
- }
-
- public {
- variable exportcancel 0
-
- method constructor {args}
- method reconfig {}
-
- proc get_target_list {}
- proc native_debugging {}
- proc getname {target name}
- proc init_target_db {}
- }
-
- protected common gdb_target
-
-}
diff --git a/gdb/gdbtk/library/tclIndex b/gdb/gdbtk/library/tclIndex
deleted file mode 100644
index 03ad77e86a5..00000000000
--- a/gdb/gdbtk/library/tclIndex
+++ /dev/null
@@ -1,639 +0,0 @@
-# Tcl autoload index file, version 2.0
-# This file is generated by the "auto_mkindex" command
-# and sourced to set up indexing information for one or
-# more commands. Typically each line is a command that
-# sets an element in the auto_index array, where the
-# element name is the name of a command and the value is
-# a script that loads the command.
-
-set auto_index(About) [list source [file join $dir about.tcl]]
-set auto_index(ActionDlg) [list source [file join $dir actiondlg.tcl]]
-set auto_index(::Editor::edit) [list source [file join $dir editor.tcl]]
-set auto_index(open_help) [list source [file join $dir helpviewer.tcl]]
-set auto_index(prompt_helpname) [list source [file join $dir helpviewer.tcl]]
-set auto_index(gdbtk_tcl_set_variable) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_preloop) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_busy) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_update) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_update_safe) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_idle) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_quit_check) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_quit) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_force_quit) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_cleanup) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_query) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_warning) [list source [file join $dir interface.tcl]]
-set auto_index(show_warning) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_ignorable_warning) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_fputs) [list source [file join $dir interface.tcl]]
-set auto_index(echo) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_fputs_error) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_fputs_log) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_fputs_target) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_fputs_target_err) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_flush) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_start_variable_annotation) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_end_variable_annotation) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_breakpoint) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_tracepoint) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_trace_find_hook) [list source [file join $dir interface.tcl]]
-set auto_index(gdb_run_readline_command) [list source [file join $dir interface.tcl]]
-set auto_index(gdb_run_readline_command_no_output) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_readline_begin) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_readline) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_readline_end) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_busy) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_idle) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_tstart) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_tstop) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_display) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_register_changed) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_memory_changed) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_pre_add_symbol) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_post_add_symbol) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_file_changed) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_exec_file_display) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_locate_main) [list source [file join $dir interface.tcl]]
-set auto_index(set_exe_name) [list source [file join $dir interface.tcl]]
-set auto_index(set_exe) [list source [file join $dir interface.tcl]]
-set auto_index(_open_file) [list source [file join $dir interface.tcl]]
-set auto_index(_close_file) [list source [file join $dir interface.tcl]]
-set auto_index(set_target_name) [list source [file join $dir interface.tcl]]
-set auto_index(set_target) [list source [file join $dir interface.tcl]]
-set auto_index(run_executable) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_attach_remote) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_connect) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_step) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_next) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_finish) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_continue) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_stepi) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_nexti) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_attached) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_detached) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_stop) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_stop_idle_callback) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_detach) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_run) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_attach_native) [list source [file join $dir interface.tcl]]
-set auto_index(set_baud) [list source [file join $dir interface.tcl]]
-set auto_index(do_state_hook) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_disconnect) [list source [file join $dir interface.tcl]]
-set auto_index(tstart) [list source [file join $dir interface.tcl]]
-set auto_index(tstop) [list source [file join $dir interface.tcl]]
-set auto_index(source_file) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_signal) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_clear_file) [list source [file join $dir interface.tcl]]
-set auto_index(initialize_gdbtk) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_tcl_architecture_changed) [list source [file join $dir interface.tcl]]
-set auto_index(gdbtk_console_read) [list source [file join $dir interface.tcl]]
-set auto_index(Iipc) [list source [file join $dir ipc.tcl]]
-set auto_index(LocalsWin) [list source [file join $dir locals.tcl]]
-set auto_index(ModalDialog) [list source [file join $dir modal.tcl]]
-set auto_index(pref_read) [list source [file join $dir prefs.tcl]]
-set auto_index(pref_save) [list source [file join $dir prefs.tcl]]
-set auto_index(escape_value) [list source [file join $dir prefs.tcl]]
-set auto_index(unescape_value) [list source [file join $dir prefs.tcl]]
-set auto_index(pref_set_defaults) [list source [file join $dir prefs.tcl]]
-set auto_index(pref_set_colors) [list source [file join $dir prefs.tcl]]
-set auto_index(pref_load_default) [list source [file join $dir prefs.tcl]]
-set auto_index(pref_load_gnome) [list source [file join $dir prefs.tcl]]
-set auto_index(load_gnome_file) [list source [file join $dir prefs.tcl]]
-set auto_index(pref_set_option_db) [list source [file join $dir prefs.tcl]]
-set auto_index(::Session::_exe_name) [list source [file join $dir session.tcl]]
-set auto_index(::Session::_serialize_bps) [list source [file join $dir session.tcl]]
-set auto_index(::Session::_recreate_bps) [list source [file join $dir session.tcl]]
-set auto_index(::Session::save) [list source [file join $dir session.tcl]]
-set auto_index(::Session::load) [list source [file join $dir session.tcl]]
-set auto_index(::Session::notice_file_change) [list source [file join $dir session.tcl]]
-set auto_index(::Session::delete) [list source [file join $dir session.tcl]]
-set auto_index(::Session::list_names) [list source [file join $dir session.tcl]]
-set auto_index(TdumpWin) [list source [file join $dir tdump.tcl]]
-set auto_index(TraceDlg) [list source [file join $dir tracedlg.tcl]]
-set auto_index(gdb_add_tracepoint) [list source [file join $dir tracedlg.tcl]]
-set auto_index(gdb_edit_tracepoint) [list source [file join $dir tracedlg.tcl]]
-set auto_index(::tty::create) [list source [file join $dir tty.tcl]]
-set auto_index(::tty::destroy) [list source [file join $dir tty.tcl]]
-set auto_index(keep_raised) [list source [file join $dir util.tcl]]
-set auto_index(sleep) [list source [file join $dir util.tcl]]
-set auto_index(auto_step) [list source [file join $dir util.tcl]]
-set auto_index(auto_step_cancel) [list source [file join $dir util.tcl]]
-set auto_index(tfind_cmd) [list source [file join $dir util.tcl]]
-set auto_index(save_trace_commands) [list source [file join $dir util.tcl]]
-set auto_index(do_test) [list source [file join $dir util.tcl]]
-set auto_index(gdbtk_read_defs) [list source [file join $dir util.tcl]]
-set auto_index(bp_exists) [list source [file join $dir util.tcl]]
-set auto_index(gridCGet) [list source [file join $dir util.tcl]]
-set auto_index(get_disassembly_flavor) [list source [file join $dir util.tcl]]
-set auto_index(list_disassembly_flavors) [list source [file join $dir util.tcl]]
-set auto_index(init_disassembly_flavor) [list source [file join $dir util.tcl]]
-set auto_index(list_element_strcmp) [list source [file join $dir util.tcl]]
-set auto_index(gdbtk_endian) [list source [file join $dir util.tcl]]
-set auto_index(set_bg_colors) [list source [file join $dir util.tcl]]
-set auto_index(r_setcolors) [list source [file join $dir util.tcl]]
-set auto_index(recolor) [list source [file join $dir util.tcl]]
-set auto_index(WarningDlg) [list source [file join $dir warning.tcl]]
-set auto_index(::WarningDlg::constructor) [list source [file join $dir warning.tcl]]
-set auto_index(WatchWin) [list source [file join $dir watch.tcl]]
-set auto_index(GDBMenuBar) [list source [file join $dir gdbmenubar.itcl]]
-set auto_index(GDBToolBar) [list source [file join $dir gdbtoolbar.itcl]]
-set auto_index(PluginWindow) [list source [file join $dir pluginwin.itcl]]
-set auto_index(SrcBar) [list source [file join $dir srcbar.itcl]]
-set auto_index(AttachDlg) [list source [file join $dir attachdlg.ith]]
-set auto_index(Block) [list source [file join $dir blockframe.ith]]
-set auto_index(Frame) [list source [file join $dir blockframe.ith]]
-set auto_index(BpWin) [list source [file join $dir bpwin.ith]]
-set auto_index(BrowserWin) [list source [file join $dir browserwin.ith]]
-set auto_index(Console) [list source [file join $dir console.ith]]
-set auto_index(CSPref) [list source [file join $dir cspref.ith]]
-set auto_index(DebugWin) [list source [file join $dir debugwin.ith]]
-set auto_index(DebugWinDOpts) [list source [file join $dir debugwin.ith]]
-set auto_index(Download) [list source [file join $dir download.ith]]
-set auto_index(GDBEventHandler) [list source [file join $dir ehandler.ith]]
-set auto_index(::GDBEventHandler::dispatch) [list source [file join $dir ehandler.ith]]
-set auto_index(EmbeddedWin) [list source [file join $dir embeddedwin.ith]]
-set auto_index(GDBEvent) [list source [file join $dir gdbevent.ith]]
-set auto_index(BreakpointEvent) [list source [file join $dir gdbevent.ith]]
-set auto_index(TracepointEvent) [list source [file join $dir gdbevent.ith]]
-set auto_index(SetVariableEvent) [list source [file join $dir gdbevent.ith]]
-set auto_index(BusyEvent) [list source [file join $dir gdbevent.ith]]
-set auto_index(IdleEvent) [list source [file join $dir gdbevent.ith]]
-set auto_index(UpdateEvent) [list source [file join $dir gdbevent.ith]]
-set auto_index(ArchChangedEvent) [list source [file join $dir gdbevent.ith]]
-set auto_index(GDBWin) [list source [file join $dir gdbwin.ith]]
-set auto_index(GlobalPref) [list source [file join $dir globalpref.ith]]
-set auto_index(IPCPref) [list source [file join $dir ipcpref.ith]]
-set auto_index(KodWin) [list source [file join $dir kod.ith]]
-set auto_index(ManagedWin) [list source [file join $dir managedwin.ith]]
-set auto_index(MemPref) [list source [file join $dir mempref.ith]]
-set auto_index(MemWin) [list source [file join $dir memwin.ith]]
-set auto_index(ProcessWin) [list source [file join $dir process.ith]]
-set auto_index(RegWin) [list source [file join $dir regwin.ith]]
-set auto_index(SrcPref) [list source [file join $dir srcpref.ith]]
-set auto_index(SrcTextWin) [list source [file join $dir srctextwin.ith]]
-set auto_index(SrcWin) [list source [file join $dir srcwin.ith]]
-set auto_index(StackWin) [list source [file join $dir stackwin.ith]]
-set auto_index(TargetSelection) [list source [file join $dir targetselection.ith]]
-set auto_index(TopLevelWin) [list source [file join $dir toplevelwin.ith]]
-set auto_index(VarTree) [list source [file join $dir vartree.ith]]
-set auto_index(::AttachDlg::constructor) [list source [file join $dir attachdlg.itb]]
-set auto_index(::AttachDlg::build_win) [list source [file join $dir attachdlg.itb]]
-set auto_index(::AttachDlg::doit) [list source [file join $dir attachdlg.itb]]
-set auto_index(::AttachDlg::cancel) [list source [file join $dir attachdlg.itb]]
-set auto_index(::AttachDlg::choose_symbol_file) [list source [file join $dir attachdlg.itb]]
-set auto_index(::AttachDlg::list_pids) [list source [file join $dir attachdlg.itb]]
-set auto_index(::AttachDlg::select_pid) [list source [file join $dir attachdlg.itb]]
-set auto_index(::AttachDlg::clear_pid_selection) [list source [file join $dir attachdlg.itb]]
-set auto_index(::AttachDlg::filter_pid_selection) [list source [file join $dir attachdlg.itb]]
-set auto_index(::Block::constructor) [list source [file join $dir blockframe.itb]]
-set auto_index(::Block::destructor) [list source [file join $dir blockframe.itb]]
-set auto_index(::Block::variables) [list source [file join $dir blockframe.itb]]
-set auto_index(::Block::_findVariables) [list source [file join $dir blockframe.itb]]
-set auto_index(::Block::update) [list source [file join $dir blockframe.itb]]
-set auto_index(::Block::info) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::constructor) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::destructor) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::_removeBlock) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::_addBlock) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::_createBlocks) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::update) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::variables) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::new) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::deleteOld) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::_oldBlocks) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::old) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::_findBlock) [list source [file join $dir blockframe.itb]]
-set auto_index(::Frame::_findBlockIndex) [list source [file join $dir blockframe.itb]]
-set auto_index(::BpWin::constructor) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::destructor) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::build_win) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::bp_add) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::bp_store) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::bp_restore) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::bp_select) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::_select_and_popup) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::bp_modify) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::bp_able) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::bp_remove) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::bp_type) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::bp_delete) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::breakpoint) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::tracepoint) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::bp_all) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::get_actions) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::toggle_threads) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::reconfig) [list source [file join $dir bpwin.itb]]
-set auto_index(::BpWin::goto_bp) [list source [file join $dir bpwin.itb]]
-set auto_index(::BrowserWin::constructor) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::destructor) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_build_win) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_filter_trace_proc) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_filter_trace_after) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_search_src) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::search) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_process_file_selection) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_process_func_selection) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::do_all_bp) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_toggle_bp) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_select) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_set_filter_mode) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_file_hide_h) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_fill_source) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::mode) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_goto_func) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_fill_file_box) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_fill_funcs_combo) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_build_filter_frame) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_build_file_frame) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_build_function_frame) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_build_view_frame) [list source [file join $dir browserwin.itb]]
-set auto_index(::BrowserWin::_switch_layout) [list source [file join $dir browserwin.itb]]
-set auto_index(::Console::constructor) [list source [file join $dir console.itb]]
-set auto_index(::Console::destructor) [list source [file join $dir console.itb]]
-set auto_index(::Console::_build_win) [list source [file join $dir console.itb]]
-set auto_index(::Console::idle) [list source [file join $dir console.itb]]
-set auto_index(::Console::busy) [list source [file join $dir console.itb]]
-set auto_index(::Console::insert) [list source [file join $dir console.itb]]
-set auto_index(::Console::_operate_and_get_next) [list source [file join $dir console.itb]]
-set auto_index(::Console::_previous) [list source [file join $dir console.itb]]
-set auto_index(::Console::_search_history) [list source [file join $dir console.itb]]
-set auto_index(::Console::_rsearch_history) [list source [file join $dir console.itb]]
-set auto_index(::Console::_next) [list source [file join $dir console.itb]]
-set auto_index(::Console::_last) [list source [file join $dir console.itb]]
-set auto_index(::Console::_first) [list source [file join $dir console.itb]]
-set auto_index(::Console::_setprompt) [list source [file join $dir console.itb]]
-set auto_index(::Console::gets) [list source [file join $dir console.itb]]
-set auto_index(::Console::_cancel) [list source [file join $dir console.itb]]
-set auto_index(::Console::activate) [list source [file join $dir console.itb]]
-set auto_index(::Console::invoke) [list source [file join $dir console.itb]]
-set auto_index(::Console::_delete) [list source [file join $dir console.itb]]
-set auto_index(::Console::_insertion) [list source [file join $dir console.itb]]
-set auto_index(::Console::_paste) [list source [file join $dir console.itb]]
-set auto_index(::Console::_find_lcp) [list source [file join $dir console.itb]]
-set auto_index(::Console::_find_completion) [list source [file join $dir console.itb]]
-set auto_index(::Console::_complete) [list source [file join $dir console.itb]]
-set auto_index(::Console::_reset_tab) [list source [file join $dir console.itb]]
-set auto_index(::Console::_set_wrap) [list source [file join $dir console.itb]]
-set auto_index(::Console::_update_option) [list source [file join $dir console.itb]]
-set auto_index(::Console::test) [list source [file join $dir console.itb]]
-set auto_index(::CSPref::constructor) [list source [file join $dir cspref.itb]]
-set auto_index(::CSPref::_init_var) [list source [file join $dir cspref.itb]]
-set auto_index(::CSPref::_build_win) [list source [file join $dir cspref.itb]]
-set auto_index(::CSPref::_apply) [list source [file join $dir cspref.itb]]
-set auto_index(::CSPref::_cancel) [list source [file join $dir cspref.itb]]
-set auto_index(::CSPref::_save) [list source [file join $dir cspref.itb]]
-set auto_index(::CSPref::reconfig) [list source [file join $dir cspref.itb]]
-set auto_index(::CSPref::_pick) [list source [file join $dir cspref.itb]]
-set auto_index(::DebugWin::constructor) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWin::destructor) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWin::reconfig) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWin::build_win) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWin::puts) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWin::put_trace) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWin::loadlog) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWin::_source_all) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWin::_clear) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWin::_mark_old) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWin::_save_contents) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWinDOpts::constructor) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWinDOpts::destructor) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWinDOpts::build_win) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWinDOpts::_all) [list source [file join $dir debugwin.itb]]
-set auto_index(::DebugWinDOpts::_apply) [list source [file join $dir debugwin.itb]]
-set auto_index(::Download::constructor) [list source [file join $dir download.itb]]
-set auto_index(::Download::update_download) [list source [file join $dir download.itb]]
-set auto_index(::Download::done) [list source [file join $dir download.itb]]
-set auto_index(::Download::cancel) [list source [file join $dir download.itb]]
-set auto_index(::Download::destructor) [list source [file join $dir download.itb]]
-set auto_index(::Download::do_download_hooks) [list source [file join $dir download.itb]]
-set auto_index(::Download::download_hash) [list source [file join $dir download.itb]]
-set auto_index(::Download::download_it) [list source [file join $dir download.itb]]
-set auto_index(::GDBEventHandler::dispatch) [list source [file join $dir ehandler.itb]]
-set auto_index(::BreakpointEvent::get) [list source [file join $dir gdbevent.itb]]
-set auto_index(::BreakpointEvent::_init) [list source [file join $dir gdbevent.itb]]
-set auto_index(::BreakpointEvent::number) [list source [file join $dir gdbevent.itb]]
-set auto_index(::TracepointEvent::get) [list source [file join $dir gdbevent.itb]]
-set auto_index(::TracepointEvent::_init) [list source [file join $dir gdbevent.itb]]
-set auto_index(::TracepointEvent::number) [list source [file join $dir gdbevent.itb]]
-set auto_index(::TracepointEvent::get) [list source [file join $dir gdbevent.itb]]
-set auto_index(::SetVariableEvent::get) [list source [file join $dir gdbevent.itb]]
-set auto_index(::UpdateEvent::constructor) [list source [file join $dir gdbevent.itb]]
-set auto_index(::UpdateEvent::get) [list source [file join $dir gdbevent.itb]]
-set auto_index(::GlobalPref::_init) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::_init_var) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::constructor) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::destructor) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::_build_win) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::_make_font_item) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::_resize_font_item_height) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::_change_icons) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::_change_font) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::_change_size) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::_toggle_tracing) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::_ok) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::_apply) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::_cancel) [list source [file join $dir globalpref.itb]]
-set auto_index(::GlobalPref::cancel) [list source [file join $dir globalpref.itb]]
-set auto_index(::IPCPref::constructor) [list source [file join $dir ipcpref.itb]]
-set auto_index(::IPCPref::_init_var) [list source [file join $dir ipcpref.itb]]
-set auto_index(::IPCPref::_build_win) [list source [file join $dir ipcpref.itb]]
-set auto_index(::IPCPref::_apply) [list source [file join $dir ipcpref.itb]]
-set auto_index(::IPCPref::_cancel) [list source [file join $dir ipcpref.itb]]
-set auto_index(::IPCPref::_save) [list source [file join $dir ipcpref.itb]]
-set auto_index(::KodWin::constructor) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::build_win) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::update) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::display) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::display_list) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::display_object) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::clear) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::top) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::up) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::destructor) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::set_variable) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::reconfig) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::busy) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::idle) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::cursor) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::_disable_buttons) [list source [file join $dir kod.itb]]
-set auto_index(::KodWin::_restore_buttons) [list source [file join $dir kod.itb]]
-set auto_index(::ManagedWin::constructor) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::destructor) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::window_name) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::window_instance) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::pickle) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::reveal) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::restart) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::shutdown) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::startup) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::open_dlg) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::open) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::_open) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::_create) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::find) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::init) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::destroy_toplevel) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::_freeze_me) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::_thaw_me) [list source [file join $dir managedwin.itb]]
-set auto_index(::ManagedWin::_make_icon_window) [list source [file join $dir managedwin.itb]]
-set auto_index(::MemPref::constructor) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::destructor) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::build_win) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::busy) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::idle) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::ok) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::cancel) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::check_numbytes) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::set_bytes_per_row) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::toggle_size_control) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::apply) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::enable_format) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::disable_format) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::pick) [list source [file join $dir mempref.itb]]
-set auto_index(::MemPref::reconfig) [list source [file join $dir mempref.itb]]
-set auto_index(::MemWin::constructor) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::destructor) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::build_win) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::paste) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::validate) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::create_prefs) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::changed_cell) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::edit) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::toggle_enabled) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::update) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::idle) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::busy) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::newsize) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::_update_address) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::update_address_cb) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::update_address) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::BadExpr) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::incr_addr) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::update_addr) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::hidemb) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::reconfig) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::do_popup) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::goto) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::init_addr_exp) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::cursor) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::memMoveCell) [list source [file join $dir memwin.itb]]
-set auto_index(::MemWin::error_dialog) [list source [file join $dir memwin.itb]]
-set auto_index(::ProcessWin::constructor) [list source [file join $dir process.itb]]
-set auto_index(::ProcessWin::build_win) [list source [file join $dir process.itb]]
-set auto_index(::ProcessWin::update) [list source [file join $dir process.itb]]
-set auto_index(::ProcessWin::change_context) [list source [file join $dir process.itb]]
-set auto_index(::ProcessWin::destructor) [list source [file join $dir process.itb]]
-set auto_index(::ProcessWin::reconfig) [list source [file join $dir process.itb]]
-set auto_index(::ProcessWin::busy) [list source [file join $dir process.itb]]
-set auto_index(::ProcessWin::idle) [list source [file join $dir process.itb]]
-set auto_index(::ProcessWin::cursor) [list source [file join $dir process.itb]]
-set auto_index(::RegWin::constructor) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::destructor) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_load_prefs) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_build_win) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_layout_table) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_size_cell_column) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_size_column) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::reconfig) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_accept_edit) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_add_to_watch) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_open_memory) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_but3) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_delete_from_display) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_display_all) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_edit) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_move) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_select_cell) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_unedit) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_get_value) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_change_format) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_update_register) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::_select_group) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::arch_changed) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::busy) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::idle) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::set_variable) [list source [file join $dir regwin.itb]]
-set auto_index(::RegWin::update) [list source [file join $dir regwin.itb]]
-set auto_index(::SrcPref::constructor) [list source [file join $dir srcpref.itb]]
-set auto_index(::SrcPref::_init_var) [list source [file join $dir srcpref.itb]]
-set auto_index(::SrcPref::_build_win) [list source [file join $dir srcpref.itb]]
-set auto_index(::SrcPref::_apply) [list source [file join $dir srcpref.itb]]
-set auto_index(::SrcPref::cancel) [list source [file join $dir srcpref.itb]]
-set auto_index(::SrcPref::_cancel) [list source [file join $dir srcpref.itb]]
-set auto_index(::SrcPref::_save) [list source [file join $dir srcpref.itb]]
-set auto_index(::SrcPref::_set_flavor) [list source [file join $dir srcpref.itb]]
-set auto_index(::SrcPref::_pick) [list source [file join $dir srcpref.itb]]
-set auto_index(::SrcTextWin::constructor) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::destructor) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::trace_find_hook) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::set_control_mode) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::build_popups) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::build_win) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::SetRunningState) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::enable) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::makeBreakDot) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::setTabs) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::enable_disable_src_tags) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::config_win) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::addPopup) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::set_variable) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::disassembly_changed) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::reconfig) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::updateBalloon) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::balloon_value) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::ClearTags) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::_mtime_changed) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::FillSource) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::FillAssembly) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::FillMixed) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::_highlightAsmLine) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::set_tag_to_stack) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::location) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::LoadFile) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::display_line) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::display_breaks) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::insertBreakTag) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::removeBreakTag) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::breakpoint) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::tracepoint) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::bp) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::do_bp) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::hasBP) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::hasTP) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::report_source_location) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::lookup_line) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::continue_to_here) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::jump_to_here) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::set_bp_at_line) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::enable_disable_at_line) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::remove_bp_at_line) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::set_tp_at_line) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::next_hit_at_line) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::remove_tp_at_line) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::do_tag_popup) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::do_source_popup) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::addToWatch) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::do_key) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::mode_get) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::mode_set) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::cancelMotion) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::motion) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::showBPBalloon) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::showBalloon) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::getVariable) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::trace_help) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::line_is_executable) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::tracepoint_range) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::search) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::LoadFromCache) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::UnLoadFromCache) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::print) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::ask_thread_bp) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::do_thread_bp) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::test_get) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::get_file) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::clear_file) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::_initialize_srctextwin) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcTextWin::_clear_cache) [list source [file join $dir srctextwin.itb]]
-set auto_index(::SrcWin::constructor) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::destructor) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::_build_win) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::_set_state) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::download_progress) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::reconfig) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::_name) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::toggle_updates) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::goto_func) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::fillNameCB) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::fillFuncCB) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::location) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::stack) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::_update) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::idle) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::mode) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::_update_title) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::busy) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::update) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::_set_name) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::set_status) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::set_execution_status) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::edit) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::print) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::enable_ui) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::no_inferior) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::reset) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::search) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::point_to_main) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::_exit) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::test_get) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::toolbar) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::inferior) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::clear_file) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::get_file) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::is_fixed) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::get_top) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::_set_tag_to_stack) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::_choose_window) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::choose_and_update) [list source [file join $dir srcwin.itb]]
-set auto_index(::SrcWin::choose_and_display) [list source [file join $dir srcwin.itb]]
-set auto_index(::StackWin::constructor) [list source [file join $dir stackwin.itb]]
-set auto_index(::StackWin::destructor) [list source [file join $dir stackwin.itb]]
-set auto_index(::StackWin::build_win) [list source [file join $dir stackwin.itb]]
-set auto_index(::StackWin::update) [list source [file join $dir stackwin.itb]]
-set auto_index(::StackWin::idle) [list source [file join $dir stackwin.itb]]
-set auto_index(::StackWin::change_frame) [list source [file join $dir stackwin.itb]]
-set auto_index(::StackWin::reconfig) [list source [file join $dir stackwin.itb]]
-set auto_index(::StackWin::busy) [list source [file join $dir stackwin.itb]]
-set auto_index(::StackWin::no_inferior) [list source [file join $dir stackwin.itb]]
-set auto_index(::StackWin::cursor) [list source [file join $dir stackwin.itb]]
-set auto_index(::TargetSelection::constructor) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::getname) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::init_target_db) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::default_port) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::_init_prefs) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::_init_target) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::_init) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::build_win) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::set_saved) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::write_saved) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::fill_rates) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::fill_targets) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::config_dialog) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::change_target) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::change_baud) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::port_list) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::get_target_list) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::save) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::cancel) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::set_check_button) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::help) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::reconfig) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::get_target) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::toggle_more_options) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::set_run) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::target_trace) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::valid_target) [list source [file join $dir targetselection.itb]]
-set auto_index(::TargetSelection::native_debugging) [list source [file join $dir targetselection.itb]]
-set auto_index(::VarTree::constructor) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::destructor) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::build) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::buildlayer) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::add) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::remove) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::update_var) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::update) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::drawselection) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::clicked) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::setselection) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::closed) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::open) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::close) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::edit) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::unedit) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::changeValue) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::_change_format) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::_but3) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::_do_default_menu) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::_sort) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::_compare) [list source [file join $dir vartree.itb]]
-set auto_index(::VarTree::_init_data) [list source [file join $dir vartree.itb]]
diff --git a/gdb/gdbtk/library/tdump.tcl b/gdb/gdbtk/library/tdump.tcl
deleted file mode 100644
index 9086d2223bf..00000000000
--- a/gdb/gdbtk/library/tdump.tcl
+++ /dev/null
@@ -1,93 +0,0 @@
-# Trace dump window for Insight
-# Copyright (C) 1998, 1999, 2001, 2002, 2004, 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements Tdump window for gdb
-#
-# PUBLIC ATTRIBUTES:
-#
-#
-# METHODS:
-#
-# reconfig ....... called when preferences change
-#
-#
-# X11 OPTION DATABASE ATTRIBUTES
-#
-#
-# ----------------------------------------------------------------------
-
-itcl::class TdumpWin {
- inherit ManagedWin GDBWin
-
- # ------------------------------------------------------------------
- # CONSTRUCTOR - create new tdump window
- # ------------------------------------------------------------------
- constructor {args} {
- window_name "Trace Dump"
- build_win
- eval itk_initialize $args
- }
-
-
- # ------------------------------------------------------------------
- # METHOD: build_win - build the main tdump window
- # ------------------------------------------------------------------
- method build_win {} {
- itk_component add stext {
- iwidgets::scrolledtext $itk_interior.stext -hscrollmode dynamic \
- -vscrollmode dynamic -textfont global/fixed \
- -background $::Colors(bg)
- } {}
- [$itk_component(stext) component text] configure \
- -background $::Colors(bg)
- pack $itk_component(stext) -side left -expand yes -fill both
- update dummy
- }
-
-
- # ------------------------------------------------------------------
- # METHOD: update - update widget when PC changes
- # ------------------------------------------------------------------
- method update {event} {
- #debug "tdump: update"
- gdbtk_busy
- set tframe_num [gdb_get_trace_frame_num]
-
- if { $tframe_num!=-1 } {
- debug "doing tdump"
- $itk_component(stext) delete 1.0 end
-
- if {[catch {gdb_cmd "tdump $tframe_num" 0} tdump_output]} {
- tk_messageBox -title "Error" -message $tdump_output -icon error \
- -type ok
- } else {
- #debug "tdum output is $tdump_output"
-
- $itk_component(stext) insert end $tdump_output
- $itk_component(stext) see insert
- }
- }
- gdbtk_idle
- }
-
- # ------------------------------------------------------------------
- # METHOD: reconfig - used when preferences change
- # ------------------------------------------------------------------
- method reconfig {} {
- if {[winfo exists $itk_interior.stext]} { destroy $itk_interior.stext }
- build_win
- }
-}
-
diff --git a/gdb/gdbtk/library/tfind_args.tcl b/gdb/gdbtk/library/tfind_args.tcl
deleted file mode 100644
index 67e00e7ed54..00000000000
--- a/gdb/gdbtk/library/tfind_args.tcl
+++ /dev/null
@@ -1,139 +0,0 @@
-# TfindArgs
-# Copyright (C) 1998, 1999 Cygnus Solutions
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements tfind arguments dialogs
-#
-# PUBLIC ATTRIBUTES:
-#
-# Type .........Type of dialog (tfind pc, tfind line, tfind tracepoint)
-#
-# config ....... used to change public attributes
-#
-# PRIVATE METHODS
-#
-# X11 OPTION DATABASE ATTRIBUTES
-#
-#
-# ----------------------------------------------------------------------
-
-itcl_class TfindArgs {
- # ------------------------------------------------------------------
- # CONSTRUCTOR - create new tfind arguments dialog
- # ------------------------------------------------------------------
- constructor {config} {
- #
- # Create a window with the same name as this object
- #
- set class [$this info class]
- set hull [namespace tail $this]
- set old_name $this
- ::rename $this $this-tmp-
- ::frame $hull -class $class
- ::rename $hull $old_name-win-
- ::rename $this $old_name
- build_win
- }
-
- # ------------------------------------------------------------------
- # METHOD: build_win - build the dialog
- # ------------------------------------------------------------------
- method build_win {} {
-
- frame $hull.f
- frame $hull.f.a
- frame $hull.f.b
- set f $hull.f.a
-
- switch $Type {
- LN {
- set text "Enter argument: "
- }
- PC {
- set text "Enter PC value: "
- }
- TP {
- set text "Enter Tracepoint No.: "
- }
- FR {
- set text "Enter Frame No.:"
- }
-
- if {[string compare $Type $last_type]} != 0} {
- global argument
- set argument ""
- }
-
- set last_type $Type
-
- label $f.1 -text $text
- entry $f.2 -textvariable argument -width 10
- $f.2 selection range 0 end
- grid $f.1 $f.2 -padx 4 -pady 4 -sticky nwe
-
- button $hull.f.b.ok -text OK -command "$this ok" -width 7 -default active
- button $hull.f.b.quit -text Cancel -command "delete object $this" -width 7
- grid $hull.f.b.ok $hull.f.b.quit -padx 4 -pady 4 -sticky ews
-
- pack $hull.f.a $hull.f.b
- grid $hull.f
-
- focus $f.2
- bind $f.2 <Return> "$this.f.b.ok flash; $this.f.b.ok invoke"
-
- }
-
- # ------------------------------------------------------------------
- # DESTRUCTOR - destroy window containing widget
- # ------------------------------------------------------------------
- destructor {
- set top [winfo toplevel $hull]
- manage delete $this 1
- destroy $this
- destroy $top
- }
-
-
-
- # ------------------------------------------------------------------
- # METHOD: ok - do it and quit
- # ------------------------------------------------------------------
- method ok {} {
- do_it
- delete
- }
-
-
- # ------------------------------------------------------------------
- # METHOD: do_it - call the gdb command
- # ------------------------------------------------------------------
- method do_it {} {
- global argument
-
-
- switch $Type {
- LN { tfind_cmd "tfind line $argument"}
- PC { tfind_cmd "tfind pc $argument"}
- TP { tfind_cmd "tfind tracepoint $argument"}
- FR { tfind_cmd "tfind $argument"}
- }
- }
-
-
- public Type
- common last_type {}
- private hull
-
-
-}
diff --git a/gdb/gdbtk/library/toplevelwin.ith b/gdb/gdbtk/library/toplevelwin.ith
deleted file mode 100644
index 3cd8f93b373..00000000000
--- a/gdb/gdbtk/library/toplevelwin.ith
+++ /dev/null
@@ -1,64 +0,0 @@
-# TopLevelWin class definition for GDBtk.
-# Copyright (C) 1998, 1999 Cygnus Solutions
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-itcl::class TopLevelWin {
- inherit ManagedWin
-
- private variable frame ""
-
- constructor {args} {
- debug $itk_interior
-
- # create a container frame
- conFrame $itk_interior.container
- pack $itk_interior.container -fill both -expand 1
-
- # set up bindings for group iconification/deiconification
- # NOT IMPLEMENTED YET
- #set top [winfo toplevel [namespace tail $this]]
- #bind_for_toplevel_only $top <Unmap> {
- # manage_iconify iconify
- #}
- #bind_for_toplevel_only $top <Map> {
- # manage_iconify deiconify
- #}
- incr numTopWins
- }
-
- public method conFrame {win} {
- set frame [cyg::panedwindow $win -height 5i]
- return $frame.con
- }
-
- public method conAdd {child args} {
- parse_args {{resizable 1}}
- $frame add $child -margin 0 -resizable $resizable
- return [$frame childsite $child].con
- }
-
- public method sizeWinByChild {child} {
- if {[catch {$frame childsite $child} childWin]} {
- debug "Could not find child $child"
- return
- }
- set width [winfo reqwidth $childWin]
- $frame configure -width $width
-
- }
-
- destructor {
- debug
- incr numTopWins -1
- }
-}
diff --git a/gdb/gdbtk/library/tracedlg.tcl b/gdb/gdbtk/library/tracedlg.tcl
deleted file mode 100644
index 1a84b41c8b8..00000000000
--- a/gdb/gdbtk/library/tracedlg.tcl
+++ /dev/null
@@ -1,800 +0,0 @@
-# Trace configuration dialog for Insight
-# Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# -----------------------------------------------------------------
-# Implements the Tracepoint configuration dialog box. This (modal)
-# dialog will be called upon to interact with gdb's tracepoint routines
-# allowing the user to add/edit tracepoints. Specifically, user can
-# specify:
-#
-# - What data to collect: locals, registers, "all registers", "all locals",
-# user-defined (globals)
-# - Number of passes which we should collect the data
-# - An ignore count after which data will start being collected
-# This method will destroy itself when the dialog is released. It returns
-# either one if a tracepoint was set/edited successfully or zero if
-# the user bails out (cancel or destroy buttons).
-
-itcl::class TraceDlg {
- inherit ManagedWin
-
- # ------------------------------------------------------------------
- # CONSTRUCTOR: create new trace dialog
- # ------------------------------------------------------------------
- constructor {args} {
-
- eval itk_initialize $args
- build_win
- title
- }
-
- # ------------------------------------------------------------------
- # DESTRUCTOR - destroy window containing widget
- # ------------------------------------------------------------------
- destructor {
-
- # Remove this window and all hooks
- if {$ActionsDlg != ""} {
- catch {delete object $ActionsDlg}
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: build_win - build the Trace dialog box (cache this?)
- # ------------------------------------------------------------------
- method build_win {} {
-
- set f $itk_interior
-
- # Need to set the title to either "Add Tracepoint" or "Edit Tracepoint",
- # depending on the location of the given tracepoint.
- # !! Why can I not do this?
-
- # If we have multiple lines, we "add" if we have any new ones ONLY..
- set nums {}
- set lown -1
- set highn -1
- set lowl -1
- set highl 0
- set functions {}
- set last_function {}
- set display_lines {}
- set display_number {}
-
- # Look at all lines
- foreach line $Lines {
- set num [gdb_tracepoint_exists "$File:$line"]
- if {$num == -1} {
- set New 1
- } else {
- set Exists 1
- }
-
- set function [gdb_get_function "$File:$line"]
- if {"$last_function" != "$function"} {
- lappend functions $function
- set last_function $function
- }
-
- if {$lown == -1 && $num != -1} {
- set lown $num
- }
- if {$lowl == -1} {
- set lowl $line
- }
-
- lappend Number $num
- if {$num > $highn} {
- set highn $num
- }
- if {$num != -1 && $num < $lown} {
- set lown $num
- }
- if {$line > $highl} {
- set highl $line
- }
- if {$line < $lowl} {
- set lowl $line
- }
- }
-
- # Look at all addresses
- foreach addr $Addresses {
- set num [gdb_tracepoint_exists "*$addr"]
- if {$num == -1} {
- set New 1
- } else {
- set Exists 1
- }
-
- set function [gdb_get_function "*$addr"]
- if {"$last_function" != "$function"} {
- lappend functions $function
- set last_function $function
- }
-
- if {$lown == -1 && $num != -1} {
- set lown $num
- }
- if {$lowl == -1} {
- set lowl $addr
- }
-
- lappend Number $num
- if {$num > $highn} {
- set highn $num
- }
- if {$num != -1 && $num < $lown} {
- set lown $num
- }
- if {$addr > $highl} {
- set highl $addr
- }
- if {$addr < $lowl} {
- set lowl $addr
- }
- }
-
- if {$Lines != {}} {
- if {[llength $Lines] == 1} {
- set Number $lown
- set display_number [concat $Number]
- set display_lines [concat $Lines]
- set multiline 0
- } else {
- # range of numbers
- set display_number "$lown-$highn"
- set display_lines "$lowl-$highl"
- set multiline 1
- }
- } elseif {$Addresses != {}} {
- if {[llength $Addresses] == 1} {
- set Number $lown
- set display_number [concat $Number]
- set display_lines [concat $Addresses]
- set multiline 0
- } else {
- # range of numbers
- set display_number "$lown-$highn"
- set display_lines "$lowl-$highl"
- set multiline 1
- }
- } elseif {$Number != {}} {
- set New 0
- set multiline 0
- set display_number $Number
- }
-
- # The three frames of this dialog
- set bbox [frame $f.bbox]; # for holding OK,CANCEL DELETE buttons
- Labelledframe $f.exp -text "Experiment"
- set exp [$f.exp get_frame]; # the "Experiment" frame
- Labelledframe $f.act -text "Actions"
- set act [$f.act get_frame]; # the "Actions" frame
-
- # Setup the button box
- button $bbox.ok -text OK -command "$this ok" -width 6
- button $bbox.cancel -text CANCEL -command "$this cancel"
- set Delete [button $bbox.delete -text DELETE -command "$this delete_tp"]
- pack $bbox.ok $bbox.cancel -side left -padx 10 -expand yes
- pack $bbox.delete -side right -padx 10 -expand yes
-
- # Setup the "Experiment" frame
- if {$New} {
- set hit_count "N/A"
- set thread "N/A"
- set _TPassCount 0
- if {!$Exists} {
- $Delete configure -state disabled
- }
- } else {
- if {!$multiline} {
- set stuff [gdb_get_tracepoint_info $Number]
- # 0=file 1=func 2=line 3=addr 4=disposition 5=passCount 6=stepCount
- # 7=thread 8=hitCount 9=actions
- set enabled [lindex $stuff 4]
- set _TPassCount [lindex $stuff 5]
- set thread [lindex $stuff 7]
- set hit_count [lindex $stuff 8]
- set actions [lindex $stuff 9]
- if {$File == {}} {
- set File [lindex $stuff 0]
- }
- if {$Lines == {} && $Addresses == {}} {
- set Addresses [lindex $stuff 3]
- set display_lines $Addresses
- }
- if {$functions == {}} {
- set functions [lindex $stuff 1]
- }
- } else {
- # ummm...
- set hit_count "N/A"
- set thread "N/A"
-
- # !! Assumptions...
- set stuff [gdb_get_tracepoint_info [lindex $Number 0]]
- set _TPassCount [lindex $stuff 5]
- set actions [lindex $stuff 9]
- }
- }
-
- # Number
- label $exp.numlbl -text {Number:}
- label $exp.number -text $display_number
-
- # File
- label $exp.fillbl -text {File:}
- label $exp.file -text $File
- # Line
- if {$Lines != {}} {
- label $exp.linlbl -text {Line(s):}
- } else {
- label $exp.linlbl -text {Address(es):}
- }
- label $exp.line -text $display_lines
-
- # Function
- if {[llength $functions] > 1} {
- # Do not allow this until we clean up the action dialog...
- tk_messageBox -type ok -icon error \
- -message "Cannot set tracepoint ranges across functions!"
- after idle [code delete object $this]
- }
- #set functions [join $functions ,]
- label $exp.funlbl -text {Function:}
- label $exp.funct -text [concat $functions]
-
- # Hit count
- label $exp.hitlbl -text {Hit Count:}
- label $exp.hit -text $hit_count
-
- # Thread
- label $exp.thrlbl -text {Thread:}
- label $exp.thread -text $thread
-
- # Place these onto the screen
- grid $exp.numlbl -row 0 -column 0 -sticky w -padx 10 -pady 1
- grid $exp.number -row 0 -column 1 -sticky w -padx 10 -pady 1
- grid $exp.funlbl -row 0 -column 2 -sticky w -padx 10 -pady 1
- grid $exp.funct -row 0 -column 3 -sticky w -padx 10 -pady 1
- grid $exp.hitlbl -row 1 -column 0 -sticky w -padx 10 -pady 1
- grid $exp.hit -row 1 -column 1 -sticky w -padx 10 -pady 1
- grid $exp.fillbl -row 1 -column 2 -sticky w -padx 10 -pady 1
- grid $exp.file -row 1 -column 3 -sticky w -padx 10 -pady 1
- grid $exp.thrlbl -row 2 -column 0 -sticky w -padx 10 -pady 1
- grid $exp.thread -row 2 -column 1 -sticky w -padx 10 -pady 1
- grid $exp.linlbl -row 2 -column 2 -sticky w -padx 10 -pady 1
- grid $exp.line -row 2 -column 3 -sticky w -padx 10 -pady 1
-
- # Configure columns
- grid columnconfigure $exp 0 -weight 1
- grid columnconfigure $exp 1 -weight 1
- grid columnconfigure $exp 2 -weight 1
- grid columnconfigure $exp 3 -weight 1
-
- # The "Actions" Frame
- set pass_frame [frame $act.pass]
- set act_frame [frame $act.actions]
- set new_frame [frame $act.new]
-
- # Pack these frames
- pack $pass_frame -fill x
- pack $act_frame -fill both -expand 1
- pack $new_frame -side top -fill x
-
- # Passes
- label $pass_frame.lbl -text {Number of Passes:}
- entry $pass_frame.ent -textvariable _TPassCount -width 5
- pack $pass_frame.lbl -side left -padx 10 -pady 5
- pack $pass_frame.ent -side right -padx 10 -pady 5
-
- # Actions
- set ActionLB $act_frame.lb
- iwidgets::scrolledlistbox $act_frame.lb -hscrollmode dynamic \
- -vscrollmode dynamic -selectmode multiple -exportselection 0 \
- -dblclickcommand [code $this edit] \
- -selectioncommand [code $this set_delete_action_state $ActionLB $new_frame.del_but] \
- -background $::Colors(bg)
- [$ActionLB component listbox] configure -background $::Colors(bg)
- label $act_frame.lbl -text {Actions}
- pack $act_frame.lbl -side top
- pack $act_frame.lb -side bottom -fill both -expand 1 -padx 5 -pady 5
-
- # New actions
- combobox::combobox $new_frame.combo -maxheight 15 -editable 0 \
- -font global/fixed -command [code $this set_action_type] \
- -bg $::Colors(textbg)
- $new_frame.combo list insert end collect while-stepping
- $new_frame.combo entryset collect
-
- button $new_frame.add_but -text {Add} -command "$this add_action"
- pack $new_frame.combo $new_frame.add_but -side left -fill x \
- -padx 5 -pady 5
-
- button $new_frame.del_but -text {Delete} -state disabled \
- -command "$this delete_action"
- pack $new_frame.del_but -side right -fill x \
- -padx 5 -pady 5
-
- # Pack the main frames
- pack $bbox -side bottom -padx 5 -pady 8 -fill x
- pack $f.exp -side top -padx 5 -pady 2 -fill x
- pack $f.act -side top -padx 5 -pady 2 -expand yes -fill both
-
- # If we are not new, add all actions
- if {!$New} {
- add_all_actions $actions
- }
-
- # !! FOR SOME REASON, THE *_FRAMES DO NOT GET MAPPED WHENEVER THE USER
- # WAITS A FEW SECONDS TO PLACE THIS DIALOG ON THE SCREEN. This is here
- # as a workaround so that the action-related widgets don't disappear...
- #update idletasks
- }
-
- method set_action_type {widget action} {
- set ActionType $action
- }
-
- method add_action {} {
-
- if {"$ActionType" == "while-stepping"} {
- if {$WhileStepping} {
- # We are only allowed on of these...
- tk_messageBox -icon error -type ok \
- -message "A tracepoint may only have one while-stepping action."
- return
- }
- set whilestepping 1
- set step_args "-Steps 1"
- } else {
- set whilestepping 0
- set step_args {}
- }
-
- #debug "ADDING ACTION FOR $File:[lindex $Lines 0]"
- if {$Lines != {}} {
- set ActionsDlg [eval ManagedWin::open ActionDlg -File $File \
- -Line [lindex $Lines 0] \
- -WhileStepping $whilestepping -Number [lindex $Number 0]\
- -Callback "\\\{$this done\\\}" $step_args]
- } else {
- set ActionsDlg [eval ManagedWin::open ActionDlg -File $File \
- -Address [lindex $Addresses 0] \
- -WhileStepping $whilestepping -Number [lindex $Number 0]\
- -Callback "\\\{$this done\\\}" $step_args]
- }
- }
-
- method delete_action {} {
- # If we just delete these from the action list, they will get deleted
- # when the user presses OK.
-
- set selected_elem [lsort -integer -decreasing [$ActionLB curselection]]
- foreach elem $selected_elem {
- $ActionLB delete $elem
- }
- }
-
- method set_delete_action_state {list but} {
- if {[$list curselection] == ""} {
- $but configure -state disabled
- } else {
- $but configure -state normal
- }
- }
-
- method done {status {steps 0} {data {}}} {
-
- # We have just returned from the ActionDlg: must reinstall our grab
-# after idle grab $this
-
- switch $status {
- cancel {
- # Don't do anything
- set ActionsDlg {}
- return
- }
- add {
- add_action_to_list $steps $data
- set ActionsDlg {}
- }
- delete {
- # do something
- set ActionsDlg {}
- }
- modify {
- # Delete the current selection and insert the new one in its place
- $ActionLB delete $Selection
- add_action_to_list $steps $data $Selection
- set ActionsDlg {}
- }
- default {
- debug "Unknown status from ActionDlg : \"$status\""
- }
- }
- }
-
- method add_action_to_list {steps data {index {}}} {
-
- set data [join $data ,]
-
- if {$steps > 0} {
- if {"$index" == ""} {
- set index "end"
- }
- $ActionLB insert $index "while-stepping ($steps): $data"
- set WhileStepping 1
- } else {
- if {"$index" == ""} {
- set index 0
- }
- $ActionLB insert $index "collect: $data"
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: cancel - cancel the dialog and do not set the trace
- # ------------------------------------------------------------------
- method cancel {} {
- ::delete object $this
- }
-
- # ------------------------------------------------------------------
- # METHOD: ok - validate the tracepoint and install it
- # ------------------------------------------------------------------
- method ok {} {
-
- # We "dismiss" the dialog here...
- wm withdraw [winfo toplevel [namespace tail $this]]
-
- set actions [get_actions]
- # Check that we are collecting data
-
- # This is silly, but, hey, it works.
- # Lines is the line number where the tp is
- # in case of a tp-range it is the set of lines for that range
- if {$Lines != {}} {
- for {set i 0} {$i < [llength $Number]} {incr i} {
- set number [lindex $Number $i]
- set line [lindex $Lines $i]
-
- if {$number == -1} {
- #debug "Adding new tracepoint at $File:$line $_TPassCount $actions"
- set err [catch {gdb_add_tracepoint $File:$line $_TPassCount $actions} errTxt]
- } else {
- if {$New && $Exists} {
- set result [tk_messageBox -icon error -type yesno \
- -message "Overwrite actions for tracepoint \#$number at $File:$line?" \
- -title "Query"]
- if {"$result" == "no"} {
- continue
- }
- }
- if {$New == 0 && $Exists == 1} {
- set tpnum [gdb_tracepoint_exists "$File:$line"]
- if {$tpnum == -1} {
- tk_messageBox -type ok -icon error -message "Tracepoint was deleted"
- ::delete object $this
- return
- }
- }
-
- #debug "Editing tracepoint \#$Number: $_TPassCount $actions"
- set err [catch {gdb_edit_tracepoint $number $_TPassCount $actions} errTxt]
- }
-
- if {$err} {
- if {$number == -1} {
- set str "adding new tracepoint at $File:$line"
- } else {
- set str "editing tracepoint $number at $File:$line"
- }
- tk_messageBox -type ok -icon error -message "Error $str: $errTxt"
- }
- }
- } else {
- # Async
- for {set i 0} {$i < [llength $Number]} {incr i} {
- set number [lindex $Number $i]
- set addr [lindex $Addresses $i]
- if {$number == -1} {
- #debug "Adding new tracepoint at $addr in $File; $_TPassCount $actions"
- set err [catch {gdb_add_tracepoint {} $_TPassCount $actions $addr} errTxt]
- } else {
- if {$New && $Exists} {
- set result [tk_messageBox -icon error -type yesno \
- -message "Overwrite actions for tracepoint \#$number at $File:$line?" \
- -title "Query"]
- if {"$result" == "no"} {
- continue
- }
- }
- if {$New == 0 && $Exists == 1} {
- set num [gdb_tracepoint_exists "$File:$Line"]
- if {$num == -1} {
- tk_messageBox -type ok -icon error -message "Tracepoint was deleted"
- ::delete object $this
- return
- }
- }
-
- #debug "Editing tracepoint \#$Number: $_TPassCount $actions"
- set err [catch {gdb_edit_tracepoint $number $_TPassCount $actions} errTxt]
- }
-
- if {$err} {
- if {$number == -1} {
- set str "adding new tracepoint at $addr in $File"
- } else {
- set str "editing tracepoint $number at $addr in $File"
- }
- tk_messageBox -type ok -icon error -message "Error $str: $errTxt"
- }
- }
- }
-
- ::delete object $this
- }
-
- method cmd {line} {
- $line
- }
-
- method delete_tp {} {
- debug "deleting tracepoint $Number"
- set err [catch {gdb_cmd "delete tracepoints $Number"} errTxt]
- debug "done deleting tracepoint $Number"
- ::delete object $this
- }
-
- method get_data {action} {
-
- set data {}
- foreach a $action {
- set datum [string trim $a \ \r\n\t,]
- if {"$datum" == "collect" || "$datum" == ""} {
- continue
- }
-
- lappend data $datum
- }
-
- return $data
- }
-
- method add_all_actions {actions} {
-
- set length [llength $actions]
- for {set i 0} {$i < $length} {incr i} {
- set action [lindex $actions $i]
-
- if {[regexp "collect" $action]} {
- set steps 0
- set data [get_data $action]
- } elseif {[regexp "while-stepping" $action]} {
- scan $action "while-stepping %d" steps
- incr i
- set action [lindex $actions $i]
- set data [get_data $action]
- } elseif {[regexp "end" $action]} {
- continue
- }
-
- # Now have an action: data and steps
- add_action_to_list $steps $data
- }
- }
-
- method get_actions {} {
-
- set actions {}
- set list [$ActionLB get 0 end]
- foreach action $list {
- if {[regexp "collect" $action]} {
- scan $action "collect: %s" data
- set steps 0
- set whilestepping 0
- } elseif {[regexp "while-stepping" $action]} {
- scan $action "while-stepping (%d): %s" steps data
- set whilestepping 1
- } else {
- debug "unknown action: $action"
- continue
- }
-
- lappend actions [list $steps $data]
- }
-
- return $actions
- }
-
- method edit {} {
-
- set Selection [$ActionLB curselection]
- if {$Selection != ""} {
- set action [$ActionLB get $Selection]
- if [regexp "collect" $action] {
- scan $action "collect: %s" data
- set steps 0
- set whilestepping 0
- } elseif [regexp "while-stepping" $action] {
- scan $action "while-stepping (%d): %s" steps data
- set whilestepping 1
- } else {
- debug "unknown action: $action"
- return
- }
-
- set data [split $data ,]
- set len [llength $data]
- set real_data {}
- set special 0
- for {set i 0} {$i < $len} {incr i} {
- set a [lindex $data $i]
- if {[string range $a 0 1] == "\$("} {
- set special 1
- set b $a
- } elseif {$special} {
- lappend b $a
- if {[string index $a [expr {[string length $a]-1}]] == ")"} {
- lappend real_data [join $b ,]
- set special 0
- }
- } else {
- lappend real_data $a
- }
- }
-
- # !! lindex $Lines 0 -- better way?
- if {$Lines != {}} {
- ManagedWin::open ActionDlg -File $File -Line [lindex $Lines 0] \
- -WhileStepping $whilestepping -Number [lindex $Number 0] \
- -Callback [list [code $this done]] -Data $real_data -Steps $steps
- } else {
- ManagedWin::open ActionDlg -File $File -Address [lindex $Addresses 0] \
- -WhileStepping $whilestepping -Number [lindex $Number 0] \
- -Callback [list [code $this done]] -Data $real_data -Steps $steps
- }
- }
- }
-
- method get_selection {} {
-
- set action [$ActionLB curselection]
- return [$ActionLB get $action]
- }
-
- # ------------------------------------------------------------------
- # METHOD: title - Title the trace dialog.
- #
- # This is needed to title the window after the dialog has
- # been created. The window manager actually sets our title
- # after we've been created, so we need to do this in an
- # "after idle".
- # ------------------------------------------------------------------
- method title {} {
- if {$New} {
- set display_number "N/A"
- wm title [winfo toplevel [namespace tail $this]] "Add Tracepoint"
- } else {
- wm title [winfo toplevel [namespace tail $this]] "Edit Tracepoint"
- }
- }
-
- # PUBLIC DATA
- public variable File {}
- public variable Lines {}
- public variable Addresses {}
- public variable Number {}
-
- # PROTECTED DATA
- protected variable Delete
- protected variable _TPassCount
- protected variable ActionType {}
- protected variable ActionLB
- protected variable Actions
- protected variable WhileStepping 0
- protected variable Selection {}
- protected variable New 0; # set whenever there is a new tp to add
- protected variable Exists 0; # set whenever a tracepoint in the range exists
- protected variable Dismissed 0; # has this dialog been dismissed already?
- protected variable ActionsDlg {}
-}
-
-proc gdb_add_tracepoint {where passes actions {addr {}}} {
- #debug "gdb_add_tracepoint $where $passes $actions $addr"
-
- # Install the tracepoint
- if {$where == "" && $addr != ""} {
- set where "*$addr"
- }
-
- #debug "trace $where"
- set err [catch {gdb_cmd "trace $where"} errTxt]
-
- if {$err} {
- tk_messageBox -type ok -icon error -message $errTxt
- return
- }
-
- # Get the number for this tracepoint
- set number [gdb_tracepoint_exists $where]
-
- # If there is a pass count, add that, too
- set err [catch {gdb_cmd "passcount $passes $number"} errTxt]
-
- if {$err} {
- tk_messageBox -type ok -icon error -message $errTxt
- return
- }
-
- set real_actions {}
- foreach action $actions {
- set steps [lindex $action 0]
- set data [lindex $action 1]
-
- if {$steps} {
- lappend real_actions "while-stepping $steps"
- lappend real_actions "collect $data"
- lappend real_actions "end"
- } else {
- lappend real_actions "collect $data"
- }
- }
-
- if {[llength $real_actions] > 0} {
- lappend real_actions "end"
- }
-
- set err [catch {gdb_actions $number $real_actions} errTxt]
- if $err {
- set errTxt "$errTxt Tracepoint will be installed with no actions"
- tk_messageBox -type ok -icon error -message $errTxt
- return
- }
-}
-
-proc gdb_edit_tracepoint {number passes actions} {
- #debug "gdb_edit_tracepoint $number $passes $actions"
-
- # If there is a pass count, add that, too
- set err [catch {gdb_cmd "passcount $passes $number"} errTxt]
-
- if $err {
- tk_messageBox -type ok -icon error -message $errTxt
- return
- }
-
- set real_actions {}
- foreach action $actions {
- set steps [lindex $action 0]
- set data [lindex $action 1]
-
- if $steps {
- lappend real_actions "while-stepping $steps"
- lappend real_actions "collect $data"
- lappend real_actions "end"
- } else {
- lappend real_actions "collect $data"
- }
- }
-
- if {[llength $real_actions] > 0} {
- lappend real_actions "end"
- }
-
- gdb_actions $number $real_actions
-}
diff --git a/gdb/gdbtk/library/tty.tcl b/gdb/gdbtk/library/tty.tcl
deleted file mode 100644
index d7eff97879d..00000000000
--- a/gdb/gdbtk/library/tty.tcl
+++ /dev/null
@@ -1,55 +0,0 @@
-# tty.tcl - xterm as tty for the inferior
-# Copyright (C) 1996, 2000 Red Hat, Inc
-# Written by Tom Tromey <tromey@cygnus.com>
-#
-# Interface to the inferior's terminal. This is very rough, and is
-# guaranteed to only work on Unix machines (if even there).
-#
-
-namespace eval tty {
- namespace export create
-
- variable _xterm_fd {}
-
- proc create {} {
- variable _xterm_fd
-
- destroy
-
- # Tricky: we exec /bin/cat so that the xterm will exit whenever we
- # close the write end of the pipe. Note that the stdin
- # redirection must come after tty is run; tty looks at its stdin.
- set shcmd {/bin/sh -c 'exec 1>&7; tty; exec /bin/cat 0<&6'}
-
- set fg [option get . foreground Foreground]
- if {$fg == ""} then {
- set fg black
- }
-
- set bg [. cget -background]
- if {$bg == ""} then {
- set bg [lindex [. configure -background] 3]
- }
-
- set xterm [list /bin/sh -c "exec xterm -T 'Gdb Child' -n Gdb -bg '$bg' -fg '$fg' -e $shcmd 6<&0 7>&1"]
-
- # Need both read and write access to xterm process.
- set _xterm_fd [open "| $xterm" w+]
- set tty [gets $_xterm_fd]
-
- # On failure we don't try the tty command.
- if {$tty != ""} {
- gdb_cmd "tty $tty"
- }
- }
-
- proc destroy {} {
- variable _xterm_fd
-
- if {$_xterm_fd != ""} then {
- # We don't care if this fails.
- catch {close $_xterm_fd}
- }
- set _xterm_fd {}
- }
-}
diff --git a/gdb/gdbtk/library/util.tcl b/gdb/gdbtk/library/util.tcl
deleted file mode 100644
index 764ce62b08e..00000000000
--- a/gdb/gdbtk/library/util.tcl
+++ /dev/null
@@ -1,331 +0,0 @@
-# Utilities for Insight.
-# Copyright (C) 1997, 1998, 1999, 2004 Red Hat
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Misc routines
-#
-# PROCS:
-#
-# keep_raised - keep a window raised
-# sleep - wait a certain number of seconds and return
-# toggle_debug_mode - turn debugging on and off
-# freeze - make a window modal
-# bp_exists - does a breakpoint exist on linespec?
-#
-# ----------------------------------------------------------------------
-#
-
-
-# A helper procedure to keep a window on top.
-proc keep_raised {top} {
- if {[winfo exists $top]} {
- raise $top
- wm deiconify $top
- after 1000 [info level 0]
- }
-}
-
-# sleep - wait a certain number of seconds then return
-proc sleep {sec} {
- global __sleep_timer
- set __sleep_timer 0
- after [expr {1000 * $sec}] set __sleep_timer 1
- vwait __sleep_timer
-}
-
-
-# ------------------------------------------------------------------
-# PROC: auto_step - automatically step through a program
-# ------------------------------------------------------------------
-
-# FIXME FIXME
-proc auto_step {} {
- global auto_step_id
-
- set auto_step_id [after 2000 auto_step]
- gdb_cmd next
-}
-
-# ------------------------------------------------------------------
-# PROC: auto_step_cancel - cancel auto-stepping
-# ------------------------------------------------------------------
-
-proc auto_step_cancel {} {
- global auto_step_id
-
- if {[info exists auto_step_id]} {
- after cancel $auto_step_id
- unset auto_step_id
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: tfind_cmd -- to execute a tfind command on the target
-# ------------------------------------------------------------------
-proc tfind_cmd {command} {
- gdbtk_busy
- # need to call gdb_cmd because we want to ignore the output
- set err [catch {gdb_cmd $command} msg]
- if {$err || [regexp "Target failed to find requested trace frame" $msg]} {
- tk_messageBox -icon error -title "GDB" -type ok \
- -message $msg
- gdbtk_idle
- return
- } else {
- gdbtk_update
- gdbtk_idle
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: save_trace_command -- Saves the current trace settings to a file
-# ------------------------------------------------------------------
-proc save_trace_commands {} {
-
- set out_file [tk_getSaveFile -title "Enter output file for trace commands"]
- debug "Got outfile: $out_file"
- if {$out_file != ""} {
- gdb_cmd "save-tracepoints $out_file"
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: do_test - invoke the test passed in
-# This proc is provided for convenience. For any test
-# that uses the console window (like the console window
-# tests), the file cannot be sourced directly using the
-# 'tk' command because it will block the console window
-# until the file is done executing. This proc assures
-# that the console window is free for input by wrapping
-# the source call in an after callback.
-# Users may also pass in the verbose and tests globals
-# used by the testsuite.
-# ------------------------------------------------------------------
-proc do_test {{file {}} {verbose {}} {tests {}}} {
- global _test
-
- if {$file == {}} {
- error "wrong \# args: should be: do_test file ?verbose? ?tests ...?"
- }
-
- if {$verbose != {}} {
- set _test(verbose) $verbose
- } elseif {![info exists _test(verbose)]} {
- set _test(verbose) 0
- }
-
- if {$tests != {}} {
- set _test(tests) $tests
- }
-
- set _test(interactive) 1
- after 500 [list source $file]
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: gdbtk_read_defs
-# Reads in the defs file for the testsuite. This is usually
-# the first procedure called by a test file. It returns
-# 1 if it was successful and 0 if not (if run interactively
-# from the console window) or exits (if running via dejagnu).
-# ------------------------------------------------------------------
-proc gdbtk_read_defs {} {
- global _test env
-
- if {[info exists env(DEFS)]} {
- set err [catch {source $env(DEFS)} errTxt]
- } else {
- set err [catch {source defs} errTxt]
- }
-
- if {$err} {
- if {$_test(interactive)} {
- tk_messageBox -icon error -message "Cannot load defs file:\n$errTxt" -type ok
- return 0
- } else {
- puts stderr "cannot load defs files: $errTxt\ntry setting DEFS"
- exit 1
- }
- }
-
- return 1
-}
-
-# ------------------------------------------------------------------
-# PROCEDURE: bp_exists
-# Returns BPNUM if a breakpoint exists at LINESPEC or
-# -1 if no breakpoint exists there
-# ------------------------------------------------------------------
-proc bp_exists {linespec} {
-
- lassign $linespec foo function filename line_number addr pc_addr
-
- set bps [gdb_get_breakpoint_list]
- foreach bpnum $bps {
- set bpinfo [gdb_get_breakpoint_info $bpnum]
- lassign $bpinfo file func line pc type enabled disposition \
- ignore_count commands cond thread hit_count user_specification
- if {$filename == $file && $function == $func && $addr == $pc} {
- return $bpnum
- }
- }
-
- return -1
-}
-
-
-# gridCGet - This provides the missing grid cget
-# command.
-
-proc gridCGet {slave option} {
- set config_list [grid info $slave]
- return [lindex $config_list [expr [lsearch $config_list $option] + 1]]
-}
-
-# ------------------------------------------------------------------
-# PROC: get_disassembly_flavor - gets the current disassembly flavor.
-# The set disassembly-flavor command is assumed to exist. This
-# will error out if it does not.
-# ------------------------------------------------------------------
-proc get_disassembly_flavor {} {
- if {[catch {gdb_cmd "show disassembly-flavor"} ret]} {
- return ""
- } else {
- regexp {\"([^\"]*)\"\.} $ret dummy gdb_val
- return $gdb_val
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: list_disassembly_flavors - Lists the current disassembly flavors.
-# Returns an empty list if the set disassembly-flavor is not supported.
-# ------------------------------------------------------------------
-proc list_disassembly_flavors {} {
- catch {gdb_cmd "set disassembly-flavor"} ret_val
- if {[regexp {Requires an argument\. Valid arguments are (.*)\.} \
- $ret_val dummy list]} {
- foreach elem [split $list ","] {
- lappend vals [string trim $elem]
- }
- return [lsort $vals]
- } else {
- return {}
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: init_disassembly_flavor - Synchs up gdb's internal disassembly
-# flavor with the value in the preferences file.
-# ------------------------------------------------------------------
-proc init_disassembly_flavor {} {
- set gdb_val [get_disassembly_flavor]
- if {$gdb_val != ""} {
- set def_val [pref get gdb/src/disassembly-flavor]
- if {[string compare $def_val ""] != 0} {
- if {[catch "gdb_cmd \"set disassembly-flavor $def_val\""]} {
- pref set gdb/src/disassembly-flavor $gdb_val
- }
- } else {
- pref set gdb/src/disassembly-flavor $gdb_val
- }
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: list_element_strcmp - to be used in lsort -command when the
-# elements are themselves lists, and you always want to look at
-# a particular item.
-# ------------------------------------------------------------------
-proc list_element_strcmp {index first second} {
- set theFirst [lindex $first $index]
- set theSecond [lindex $second $index]
-
- return [string compare $theFirst $theSecond]
-}
-
-# ------------------------------------------------------------------
-# PROC: gdbtk_endian - returns BIG or LITTLE depending on target
-# endianess
-# ------------------------------------------------------------------
-
-proc gdbtk_endian {} {
- if {[catch {gdb_cmd "show endian"} result]} {
- return "UNKNOWN"
- }
- if {[regexp {.*big endian} $result]} {
- set result "BIG"
- } elseif {[regexp {.*little endian} $result]} {
- set result "LITTLE"
- } else {
- set result "UNKNOWN"
- }
- return $result
-}
-
-# ------------------------------------------------------------------
-# PROC: set_bg_colors - set background and text background for
-# all windows.
-# ------------------------------------------------------------------
-proc set_bg_colors {{num ""}} {
- debug $num
-
- if {$num != ""} {
- set ::gdb_bg_num $num
- }
- set ::Colors(textbg) [pref get gdb/bg/$::gdb_bg_num]
-
- # calculate background as 80% of textbg
- set ::Colors(bg) [recolor $::Colors(textbg) 80]
-
- # calculate trough and activebackground as 90% of background
- set dbg [recolor $::Colors(bg) 90]
-
- r_setcolors . -background $::Colors(bg)
- r_setcolors . -highlightbackground $::Colors(bg)
- r_setcolors . -textbackground $::Colors(textbg)
- r_setcolors . -troughcolor $dbg
- r_setcolors . -activebackground $dbg
-
- pref_set_option_db 1
- ManagedWin::restart
-}
-
-# ------------------------------------------------------------------
-# PROC: r_setcolors - recursively set background and text background for
-# all windows.
-# ------------------------------------------------------------------
-proc r_setcolors {w option color} {
- debug "$w $option $color"
-
- # exception(s)
- if {![catch {$w isa Balloon} result] && $result == "1"} {
- return
- }
- catch {$w config $option $color}
-
- foreach child [winfo children $w] {
- r_setcolors $child $option $color
- }
-}
-
-# ------------------------------------------------------------------
-# PROC: recolor - returns a darker or lighter color
-# ------------------------------------------------------------------
-proc recolor {color percent} {
- set c [winfo rgb . $color]
- return [format #%02x%02x%02x [expr {($percent * [lindex $c 0]) / 25600}] \
- [expr {($percent * [lindex $c 1]) / 25600}] [expr {($percent * [lindex $c 2]) / 25600}]]
-}
-
-
diff --git a/gdb/gdbtk/library/vartree.itb b/gdb/gdbtk/library/vartree.itb
deleted file mode 100644
index e28733d37b8..00000000000
--- a/gdb/gdbtk/library/vartree.itb
+++ /dev/null
@@ -1,431 +0,0 @@
-# Variable tree implementation for Insight.
-# Copyright (C) 2002 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-itcl::body VarTree::constructor {args} {
- debug $args
- if {!$initialized} {
- _init_data
- }
- eval itk_initialize $args
-
- itk_component add canvas {
- iwidgets::scrolledcanvas $itk_interior.c -autoresize 1 -hscrollmode dynamic -vscrollmode dynamic \
- -background $::Colors(textbg) -borderwidth 0 -highlightthickness 0
- }
- set c [$itk_component(canvas) childsite]
- pack $itk_component(canvas) -side top -fill both -expand 1
- bind $c <1> "[code $this clicked %W %x %y 0]"
-
- # Add popup menu - we populate it in _but3
- itk_component add popup {
- menu $itk_interior.pop -tearoff 0
- } {}
- set pop $itk_component(popup)
- $pop configure -disabledforeground $::Colors(fg)
- bind $c <3> [code $this _but3 %x %y %X %Y]
-
- set selection {}
- set selidx {}
- after idle [code $this build]
-}
-
-itcl::body VarTree::destructor {} {
- debug
-}
-
-itcl::body VarTree::build {} {
- debug
- $c delete all
- catch {unset var_to_items}
- catch {unset item_to_var}
- set _y 30
- buildlayer $rootlist 10
- $c config -scrollregion [$c bbox all] -background $::Colors(textbg) -borderwidth 0 -highlightthickness 0
- update 1
- drawselection
-}
-
-itcl::body VarTree::buildlayer {tlist in} {
- set start [expr $_y - 10]
-
- foreach var $tlist {
- set y $_y
- incr _y 17
-
- if {$in > 10} {
- $c create line $in $y [expr $in+10] $y -fill $colors(line)
- }
- set x [expr $in + 12]
-
- set j1 [$c create text $x $y -text "[$var name] = " -fill $colors(name) -anchor w -font global/fixed]
- set x [expr [lindex [$c bbox $j1] 2] + 5]
- set j2 [$c create text $x $y -text "([$var type])" -fill $colors(type) -anchor w -font global/fixed]
- set x [expr [lindex [$c bbox $j2] 2] + 5]
- if {[catch {$var value} val]} {
- # error accessing memory, etc.
- set j3 [$c create text $x $y -text $val -fill $colors(error) -anchor w -font global/fixed]
- } else {
- set j3 [$c create text $x $y -text $val -fill $colors(value) -anchor w -font global/fixed]
- }
-
- set var_to_items($var) [list $j1 $j2 $j3]
- set item_to_var($j1) $var
- set item_to_var($j2) $var
- set item_to_var($j3) $var
-
- $c bind $j1 <Double-1> "[code $this clicked %W %x %y 1]"
- $c bind $j2 <Double-1> "[code $this clicked %W %x %y 1]"
- $c bind $j3 <Double-1> "[code $this edit $j3];break"
-
- if {[$var numChildren]} {
- if {[closed $var]} {
- set j [$c create image $in $y -image closedbm]
- $c bind $j <1> "[code $this open $var]"
- } else {
- set j [$c create image $in $y -image openbm]
- $c bind $j <1> "[code $this close $var]"
- buildlayer [$var children] [expr $in+18]
- }
- }
- }
- if {$in > 10} {
- $c lower [$c create line $in $start $in [expr $y+1] -fill $colors(line) ]
- }
-}
-
-# add: add a list of varobj to the tree
-itcl::body VarTree::add {var} {
- debug $var
- if {$var == ""} {return}
- set rootlist [concat $rootlist $var]
- after idle [code $this build]
-}
-
-# remove: remove a varobj from the tree
-# if the name is "all" then remove all
-itcl::body VarTree::remove {name} {
- debug $name
- if {$name == ""} {return}
- if {$name == "all"} {
- set rootlist {}
- } else {
- set rootlist [lremove $rootlist $name]
- }
- after idle [code $this build]
-}
-
-# update a var
-itcl::body VarTree::update_var {var enabled check} {
- if {$enabled && $check} {return}
- lassign $var_to_items($var) nam typ val
- if {$enabled} {
- $c itemconfigure $nam -fill $colors(name)
- $c itemconfigure $typ -fill $colors(type)
-
- if {[catch {$var value} value]} {
- set color $colors(error)
- } elseif {[$c itemcget $val -text] != $value} {
- set color $colors(change)
- } else {
- set color $colors(value)
- }
- $c itemconfigure $val -text $value -fill $color
- } else {
- $c itemconfigure $nam -fill $colors(disabled)
- $c itemconfigure $typ -fill $colors(disabled)
- $c itemconfigure $val -fill $colors(disabled)
- }
-
- if {![closed $var] && [$var numChildren]} {
- foreach child [$var children] {
- update_var $child $enabled $check
- }
- }
-}
-
-# update: update the values of the vars in the tree.
-# The "check" argument is a hack we have to do because
-# [$varobj value] does not return an error; only [$varobj update]
-# does. So after changing the tree layout in build, we must then
-# do an update. The "check" argument just optimizes things a bit over
-# a normal update by not fetching values, just calling update.
-itcl::body VarTree::update {{check 0}} {
- debug
-
- # delete selection box if it is visible
- if {$selidx != ""} {
- $c delete $selidx
- }
-
- # update all the root variables
- foreach var $rootlist {
- if {[$var update] == "-1"} {
- set enabled 0
- } else {
- set enabled 1
- }
- update_var $var $enabled $check
- }
-}
-
-# Draw the selection highlight
-itcl::body VarTree::drawselection {} {
- #debug "selidx=$selidx selection=$selection"
- if {$selidx != ""} {
- $c delete $selidx
- }
- if {$selection == ""} return
- if {![info exists var_to_items($selection)]} return
- set bbox [eval "$c bbox $var_to_items($selection)"]
- if {[llength $bbox] == 4} {
- set selidx [eval $c create rectangle $bbox -fill $::Colors(sbg) -outline {{}}]
- $c lower $selidx
- } else {
- set selidx {}
- }
-}
-
-# button 1 callback
-itcl::body VarTree::clicked {w x y open} {
- #debug "clicked $w $x $y $open"
- set x [$w canvasx $x]
- set y [$w canvasy $y]
- foreach m [$w find overlapping $x $y $x $y] {
- if {[info exists item_to_var($m)]} {
- if {$open} {
- set var $item_to_var($m)
- if {[closed $var]} {
- set closed($var) 0
- } else {
- set closed($var) 1
- }
- after idle [code $this build]
- } else {
- setselection $item_to_var($m)
- }
- return
- }
- }
- if {!$open} {
- setselection ""
- }
-}
-
-
-#
-# Change the selection to the indicated item
-#
-itcl::body VarTree::setselection {var} {
- #debug "setselection $var"
- set selection $var
- drawselection
-}
-
-# Check if a node is closed.
-# If it is a new node, set it to closed
-itcl::body VarTree::closed {name} {
- if {![info exists closed($name)]} {
- set closed($name) 1
- }
- return $closed($name)
-}
-
-# mark a node open
-itcl::body VarTree::open {name} {
- set closed($name) 0
- after idle [code $this build]
-}
-
-# mark a node closed
-itcl::body VarTree::close {name} {
- set closed($name) 1
- after idle [code $this build]
-}
-
-# edit a varobj.
-# creates an entry widget in place of the current value
-itcl::body VarTree::edit {j} {
- #debug "$j"
-
- # if another edit is in progress, cancel it
- if {$entry != ""} { unedit $j }
-
- set entryobj $item_to_var($j)
- set entry [entry $c.entry -bg $::Colors(bg) -fg $::Colors(fg) -font global/fixed]
- set entrywin [$c create window [$c coords $j] -window $entry -anchor w]
- focus $entry
- bind $entry <Return> [code $this changeValue $j]
- bind $entry <Escape> [code $this unedit $j]
-}
-
-# cancel or clean up after an edit
-itcl::body VarTree::unedit {j} {
- #debug
- # cancel the edit
- $c delete $entrywin
- destroy $entry
- set entry ""
- $c raise $j
-}
-
-# change the value of a varobj.
-itcl::body VarTree::changeValue {j} {
- #debug "value = [$entry get]"
- set new [string trim [$entry get] \ \r\n]
- if {$new == ""} {
- unedit $j
- return
- }
- if {[catch {$entryobj value $new} errTxt]} {
- # gdbtk-varobj doesn't actually return meaningful error messages
- # so use a generic one.
- set errTxt "GDB could not evaluate that expression"
- tk_messageBox -icon error -type ok -message $errTxt \
- -title "Error in Expression" -parent [winfo toplevel $itk_interior]
- focus $entry
- $entry selection to end
- } else {
- unedit $j
-
- # We may have changed a register or something else that is
- # being displayed in another window
- gdbtk_update
- }
-}
-
-# change the format for a var
-itcl::body VarTree::_change_format {var} {
- #debug "$var $popup_temp"
- catch {$var format $popup_temp}
- after idle [code $this update]
-}
-
-# button 3 callback. Pops up a menu.
-itcl::body VarTree::_but3 {x y X Y} {
- set x [$c canvasx $x]
- set y [$c canvasy $y]
- catch {destroy $pop.format}
-
- set var ""
- foreach item [$c find overlapping $x $y $x $y] {
- if {![catch {set var $item_to_var($item)}]} {
- break
- }
- }
- setselection $var
- if {$var == ""} {
- _do_default_menu $X $Y
- return
- }
- set popup_temp [$var format]
- set j3 [lindex $var_to_items($var) 2]
- #debug "var=$var [$var name] format=$popup_temp this=$this"
- $pop delete 0 end
- $pop add command -label [$var name] -state disabled
- $pop add separator
- $pop add cascade -menu $pop.format -label "Format" -underline 0
- set f [menu $pop.format -tearoff 0]
- $f add radio -label "Natural" -variable [scope popup_temp] -value "natural" -command [code $this _change_format $var]
- $f add radio -label "Decimal" -variable [scope popup_temp] -value "decimal" -command [code $this _change_format $var]
- $f add radio -label "Hex" -variable [scope popup_temp] -value "hexadecimal" -command [code $this _change_format $var]
- $f add radio -label "Octal" -variable [scope popup_temp] -value "octal" -command [code $this _change_format $var]
- $f add radio -label "Binary" -variable [scope popup_temp] -value "binary" -command [code $this _change_format $var]
- $pop add command -label "Edit" -command [code $this edit $j3]
- $pop add command -label "Delete" -command [code $this remove $var]
- if {![catch {$var value} value]} {
- $pop add separator
- $pop add command -label "Dump Memory at [$var name]" -command [list ManagedWin::open MemWin -force -addr_exp [$var name]]
- }
- $pop add separator
- if {$type == "local"} {
- $pop add command -label "Help" -command "open_help watch.html"
- } else {
- $pop add command -label "Help" -command "open_help locals.html"
- }
- $pop add separator
- $pop add command -label "Close" -command "destroy [winfo toplevel $itk_interior]"
- tk_popup $pop $X $Y
-}
-
-# popup menu over empty space
-itcl::body VarTree::_do_default_menu {X Y} {
- #debug
- $pop delete 0 end
- if {$type == "local"} {
- $pop add command -label "Local Variables" -state disabled
- } else {
- $pop add command -label "Watch Window" -state disabled
- }
- $pop add separator
- $pop add command -label "Sort" -command [code $this _sort]
- if {$type == "local"} {
- $pop add command -label "Help" -command "open_help watch.html"
- } else {
- $pop add command -label "Help" -command "open_help locals.html"
- }
- $pop add separator
- $pop add command -label "Close" -command "destroy [winfo toplevel $itk_interior]"
- tk_popup $pop $X $Y
-}
-
-# alphabetize the variable names in the list
-itcl::body VarTree::_sort {} {
- #debug $rootlist
- set rootlist [lsort -command [code $this _compare] $rootlist]
- after idle [code $this build]
-}
-
-# comparison function for lsort.
-itcl::body VarTree::_compare {a b} {
- return [string compare [$a name] [$b name]]
-}
-
-# ititialize common data
-itcl::body VarTree::_init_data {} {
- set colors(name) "\#0000C0"
- set colors(type) "red"
- set colors(error) "red"
- set colors(value) "black"
- set colors(change) $::Colors(change)
- set colors(disabled) "gray50"
- set colors(line) "gray50"
-
- set maskdata "#define solid_width 9\n#define solid_height 9"
- append maskdata {
- static unsigned char solid_bits[] = {
- 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0xff, 0x01,
- 0xff, 0x01, 0xff, 0x01, 0xff, 0x01
- };
- }
- set data "#define open_width 9\n#define open_height 9"
- append data {
- static unsigned char open_bits[] = {
- 0xff, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x7d, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0xff, 0x01
- };
- }
- image create bitmap openbm -data $data -maskdata $maskdata \
- -foreground black -background white
- set data "#define closed_width 9\n#define closed_height 9"
- append data {
- static unsigned char closed_bits[] = {
- 0xff, 0x01, 0x01, 0x01, 0x11, 0x01, 0x11, 0x01, 0x7d, 0x01, 0x11, 0x01,
- 0x11, 0x01, 0x01, 0x01, 0xff, 0x01
- };
- }
- image create bitmap closedbm -data $data -maskdata $maskdata \
- -foreground black -background white
-
- set initialized 1
-}
-
diff --git a/gdb/gdbtk/library/vartree.ith b/gdb/gdbtk/library/vartree.ith
deleted file mode 100644
index 2a185063726..00000000000
--- a/gdb/gdbtk/library/vartree.ith
+++ /dev/null
@@ -1,77 +0,0 @@
-# Variable tree class definition for Insight.
-# Copyright (C) 2002 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-itcl::class VarTree {
- inherit itk::Widget
-
- public variable type "watch"
-
- private {
- # list of root variables in tree
- variable rootlist {}
-
- # mapping of varobj to canvas items
- variable var_to_items
- variable item_to_var
-
- variable c ;#the canvas
- variable pop ;#popup menu
- variable _y 0
- variable selection
- variable selidx
- variable closed
-
- variable popup_temp
-
- # when editing, these contain the entry widget and edited varobj
- variable entry ""
- variable entryobj
- variable entrywin
- }
-
- common maskdata
- common data
- common openbm
- common closedbm
- common initialized 0
- common colors
-
- private {
- method _init_data {}
- method build {}
- method buildlayer {tlist n}
- method drawselection {}
- method clicked {w x y open}
- method setselection {var}
- method closed {name}
- method open {name}
- method close {name}
- method edit {j}
- method unedit {j}
- method changeValue {j}
- method update_var {var ena check}
- method _but3 {x y X Y}
- method _change_format {var}
- method _do_default_menu {X Y}
- method _sort {}
- method _compare {a b}
- }
-
- public {
- method constructor {args}
- method destructor {}
- method add {varobj}
- method remove {varobj}
- method update {{check 0}}
- }
-}
diff --git a/gdb/gdbtk/library/warning.tcl b/gdb/gdbtk/library/warning.tcl
deleted file mode 100644
index 0b510594645..00000000000
--- a/gdb/gdbtk/library/warning.tcl
+++ /dev/null
@@ -1,102 +0,0 @@
-# Warning dialog for GDBtk.
-# Copyright (C) 1998, 1999 Cygnus Solutions
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# -----------------------------------------------------------------------------
-# NAME:
-# class WarningDlg
-#
-# DESC:
-# This class implements a warning dialog. It has an optional checkbox
-# that the user can select to disable all warnings of the same type.
-#
-# ARGS:
-# -ignorable "class" - Causes an ignorable dialog to be created.
-# "class" is the warning class that will be either
-# displayed or ignored. It may be any string, so
-# long as the same string is used for all related
-# warning messages.
-#
-# -message "msg" - Message to be displayed.
-# -----------------------------------------------------------------------------
-#
-
-itcl::class WarningDlg {
- inherit ManagedWin ModalDialog
-
- public {
- variable ignorable ""
- variable message ""
- method constructor {args}
- }
-
- protected common ignore
-}
-
-# -----------------------------------------------------------------------------
-# NAME:
-# WarningDlg::constructor
-#
-# DESC:
-# Creates the warning dialog.
-# -----------------------------------------------------------------------------
-itcl::body WarningDlg::constructor {args} {
- debug $args
- window_name "Warning"
- eval itk_initialize $args
-
- if {$ignorable == ""} {
- tk_messageBox -message $message -type ok -icon warning -default ok \
- -parent [winfo toplevel $itk_interior]
- delete
- return
- } else {
- if {[info exists ignore($ignorable)]} {
- if {$ignore($ignorable)} {
- delete
- return
- }
- } else {
- set ignore($ignorable) 0
- }
- }
-
- frame $itk_interior.f
- frame $itk_interior.f.a -relief raised -bd 1
- frame $itk_interior.f.b -relief raised -bd 1
- set f $itk_interior.f.a
-
-
- label $f.bitmap -bitmap warning
- label $f.lab -text $message
- pack $f.bitmap $f.lab -side left -padx 10 -pady 10
-
- if {$ignorable != ""} {
- checkbutton $itk_interior.f.b.ignore -text "Don't show this warning again" \
- -variable [scope ignore($ignorable)] -anchor w
- }
-
- button $itk_interior.f.b.ok -text OK -underline 0 -command [code $this unpost]
- bind $itk_interior.f.b.ok <Return> \
- "$itk_interior.f.b.ok flash; $itk_interior.f.b.ok invoke"
- focus $itk_interior.f.b.ok
-
- if {$ignorable != ""} {
- pack $itk_interior.f.b.ignore
- }
-
- pack $itk_interior.f.b.ok -expand yes -side left
- pack $itk_interior.f.a
- pack $itk_interior.f.b -fill x
- pack $itk_interior.f
-}
diff --git a/gdb/gdbtk/library/watch.tcl b/gdb/gdbtk/library/watch.tcl
deleted file mode 100644
index 33fb5ee25c6..00000000000
--- a/gdb/gdbtk/library/watch.tcl
+++ /dev/null
@@ -1,218 +0,0 @@
-# Watch window for Insight.
-# Copyright (C) 2002, 2003, 2006 Red Hat
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-
-# ----------------------------------------------------------------------
-# Implements watch windows for gdb.
-# ----------------------------------------------------------------------
-
-itcl::class WatchWin {
- inherit EmbeddedWin GDBWin
- # ------------------------------------------------------------------
- # CONSTRUCTOR - create new watch window
- # ------------------------------------------------------------------
- constructor {args} {
- debug
-
- gdbtk_busy
- build_win $itk_interior
- gdbtk_idle
-
- add_hook gdb_no_inferior_hook "$this no_inferior"
- add_hook gdb_clear_file_hook [code $this clear_file]
- add_hook file_changed_hook [code $this clear_file]
- }
-
-
- # ------------------------------------------------------------------
- # PUBLIC METHOD: busy - BusyEvent handler
- # Disable all ui elements that could affect gdb's state
- # ------------------------------------------------------------------
- method busy {event} {
- debug
- set Running 1
- cursor watch
- }
-
- # Re-enable the UI
- method idle {event} {
- debug
- set Running 0
- cursor {}
- }
-
- # ------------------------------------------------------------------
- # METHOD: no_inferior
- # Reset this object.
- # ------------------------------------------------------------------
- method no_inferior {} {
- debug
- cursor {}
- set Running 0
- foreach var $Watched {
- $var delete
- }
- $tree remove all
- }
-
- # ------------------------------------------------------------------
- # METHOD: cursor - change the toplevel's cursor
- # ------------------------------------------------------------------
- method cursor {what} {
- [winfo toplevel [namespace tail $this]] configure -cursor $what
- ::update idletasks
- }
-
-
- # ------------------------------------------------------------------
- # METHOD: build_win - build window for watch.
- # ------------------------------------------------------------------
- method build_win {f} {
- #debug "$f"
-
- set f [::frame $f.f]
- set treeFrame [frame $f.top]
- set entryFrame [frame $f.expr]
-
- set tree [VarTree $treeFrame.tree]
- pack $tree -expand yes -fill both
-
- set Entry [entry $entryFrame.ent -font global/fixed]
- button $entryFrame.but -text "Add Watch" -command [code $this validateEntry]
- pack $f -fill both -expand yes
- grid $entryFrame.ent -row 0 -column 0 -sticky news -padx 2
- grid $entryFrame.but -row 0 -column 1 -padx 2
- grid columnconfigure $entryFrame 0 -weight 1
- grid columnconfigure $entryFrame 1
-
- grid $treeFrame -row 0 -column 0 -sticky news
- grid $entryFrame -row 1 -column 0 -padx 5 -pady 5 -sticky news
- grid columnconfigure $f 0 -weight 1
- grid rowconfigure $f 0 -weight 1
- window_name "Watch"
- ::update idletasks
- # Binding for the entry
- bind $entryFrame.ent <Return> "$entryFrame.but flash; $entryFrame.but invoke"
- }
-
- method validateEntry {} {
- if {!$Running} {
- debug "Getting entry value...."
- set variable [$Entry get]
- debug "Got $variable, going to add"
- set ok [add $variable]
- debug "Added... with ok: $ok"
- $Entry delete 0 end
- }
- }
-
- # ------------------------------------------------------------------
- # METHOD: clear_file - Clear out state so that a new executable
- # can be loaded. For WatchWins, this means doing
- # everything that no_inferior does.
- # ------------------------------------------------------------------
- method clear_file {} {
- debug
- no_inferior
- }
-
- # ------------------------------------------------------------------
- # DESTRUCTOR - delete watch window
- # ------------------------------------------------------------------
- destructor {
- debug
- set tree {}
-
- # Remove this window and all hooks
- remove_hook gdb_no_inferior_hook "$this no_inferior"
- remove_hook gdb_clear_file_hook [code $this clear_file]
- remove_hook file_changed_hook [code $this clear_file]
-
- foreach var $Watched {
- $var delete
- }
- }
-
- method remove {entry} {
- debug $entry
-
- # Remove this entry from the list of watched variables
- set Watched [lremove $Watched $entry]
-
- $entry remove
- $entry delete
- }
-
-
- method update {event} {
- $tree update
- }
-
-
- # ------------------------------------------------------------------
- # METHOD: add - add a variable to the watch window
- # ------------------------------------------------------------------
- method add {name} {
- debug "Trying to add \"$name\" to watch"
-
- # Strip all the junk after the first \n
- set var [split $name \n]
- set var [lindex $var 0]
- set var [split $var =]
- set var [lindex $var 0]
-
- # Strip out leading/trailing +, -, ;, spaces, commas
- set var [string trim $var +-\;\ \r\n,]
-
- # Make sure that we have a valid variable
- set err [catch {gdb_cmd "set variable $var"} errTxt]
- if {$err} {
- dbug W "ERROR adding variable: $errTxt"
- ManagedWin::open WarningDlg -transient \
- -over $this -message [list $errTxt] -ignorable "watchvar"
- } else {
- if {[string index $var 0] == "\$"} {
- # We must make a special attempt at verifying convenience
- # variables.. Specifically, these are printed as "void"
- # when they are not defined. So if a user type "$_I_made_tbis_up",
- # gdb responds with the value "void" instead of an error
- catch {gdb_cmd "p $var"} msg
- set msg [split $msg =]
- set msg [string trim [lindex $msg 1] \ \r\n]
- if {$msg == "void"} {
- return 0
- }
- }
-
- debug "In add, going to add $name"
- # make one last attempt to get errors
- set err [catch {set foo($name) 1}]
- debug "err1=$err"
- set err [expr {$err + [catch {expr {$foo($name) + 1}}]}]
- debug "err2=$err"
- if {!$err} {
- set var [gdb_variable create -expr $name]
- debug "var=$var"
- $tree add $var
- lappend Watched $var
- return 1
- }
- }
- return 0
- }
-
- protected variable Entry
- protected variable Watched {}
- protected variable tree
- protected variable Running
-}
diff --git a/gdb/gdbtk/plugins/ChangeLog b/gdb/gdbtk/plugins/ChangeLog
deleted file mode 100644
index f52e6e062a2..00000000000
--- a/gdb/gdbtk/plugins/ChangeLog
+++ /dev/null
@@ -1,22 +0,0 @@
-2007-07-26 Maciej W. Rozycki <macro@mips.com>
-
- * Make-rules (html): Add goal.
-
-2006-09-28 Keith Seitz <keiths@redhat.com>
-
- * aclocal.m4: Regenerate.
- * configure: Regenerate.
- * Makefile.in: Regenerate.
-
-2005-12-23 Eli Zaretskii <eliz@gnu.org>
-
- * aclocal.m4: Update the FSF address.
-
-2002-08-14 Keith Seitz <keiths@redhat.com>
-
- * acinclude.m4, aclocal.m4, configure, configure.in,
- HOW-TO, Makefile.am, Makefile.in, Make-rules,
- plugins.tcl: New files adding improved support for plugins.
- * rhabout/: Add new sample plugin.
- * intel-pentium/: Add new Intel Pentium plugin.
-
diff --git a/gdb/gdbtk/plugins/HOW-TO b/gdb/gdbtk/plugins/HOW-TO
deleted file mode 100644
index 6d7ebc158f9..00000000000
--- a/gdb/gdbtk/plugins/HOW-TO
+++ /dev/null
@@ -1,414 +0,0 @@
-INSIGHT PLUG-INS HOW-TO
-=======================
-
-This text describes the technical aspects of adding a plug-in window
-to Insight, the graphical front-end to the GNU Debugger, GDB.
-
-
-1) INTRODUCTION
-
-The plug-in facility allows for the addition of custom windows to
-Insight. These windows are not to become part of the Insight
-distribution, but rather to be distributed separately. They can be
-downloaded from the author's web site, may accompany some development
-board or embedded OS, or come with anything else that can benefit from
-a custom window being added to the standard Insight. Plug-ins
-will be loaded into Insight/GDB for execution, so the terms of the GPL
-also apply to the plug-in code. Also, Red Hat provides this facility
-as-is and accepts no responsibility from its use. Please refer to the
-text of the GPL for more details.
-
-The facilities described here provide support for custom
-visualizations (custom windows for displaying information retrieved
-from the target). By writing a plug-in, it is possible to visualize
-target-specific data that is not shown in the standard Insight
-windows.
-
-The plug-in facility cannot be used to control target execution. The
-current implementation of Insight assumes that only the Source Window
-issues commands related to target execution control. There is no
-mechanism to prevent one to call the commands that control execution,
-but its use may result in inconsistent GUI states. This restriction
-may be lifted in future versions of Insight.
-
-The facility works as follows: A plugins subdirectory is added under
-the "EXEC-PREFIX/lib" directory where Insight is installed. The custom
-plug-in code will be installed in a subdirectory of this plugins
-directory. The plug-in window will be written as an [incr Tcl/Tk]
-class which inherits from the provided PluginWindow class and
-implements the methods necessary to display the desired custom
-data. GDB will read plug-in files on start-up and add a menu item to
-the PlugIn menu of the Insight Source Window. When the menu item is
-chosen, GDB instantiates the custom plug-in class.
-
-The PluginWindow base class constructor creates a toplevel window (an
-Insight ManagedWin) which contains a "childsite". In this case, the
-"childsite" is a frame in which the derived class (the custom plug-in)
-can draw. The PluginWindow class also provides facilities to add a
-menu and a toolbar. Among the methods provided by this class, the
-"running" method is called every time the debugger starts the target
-and the "stopped" method is called every time the target stops. In the
-"stopped" method, information can be gathered from the target and
-displayed. The "running" method indicates that GDB is busy running
-the target. No activities should be initiated by any GUI component
-while in this state (except for the STOP button in the Source Window).
-
-The remainder of this document describes how to install a custom
-plug-in and some details of the PluginWindow class. Writing Tcl
-extensions (technically what plug-ins are) is beyond the scope of
-this document, but a simple example is given and some documentation
-references are provided.
-
-Please see the file CONTRIBUTE in this directory for some
-administrative details before you start developing your plug-in.
-
-
-2) HOW TO ADD A PLUG-IN WINDOW TO INSIGHT
-
-Once you have your plug-in class ready, here is how to make it show up
-in the Insight Source Window "PlugIn" menu. You may perform these
-steps manually, but if you are distributing your plug-in, it may be
-convenient to provide an installation script with it that automates
-this steps.
-
-The examples in this section refer to the sample plug-in code provided
-with the Insight sources, located in the
-$(SOURCE)/gdb/gdbtk/plugins and $(SOURCE)/gdb/gdbtk/plugins/rhabout
-directories.
-
-Custom plug-ins are provided as "packages" (see [Welch 2000] and
-[Smith 2000]). The following setup will cause your plug-in package to
-be loaded.
-
-** FIXME: don't need to create the directory -- install will do it **
-i) First, locate the $(EXEC-PREFIX)/lib/insight1.0 directory. This is the
-directory which contains the plug-in code used by Insight. Create a
-this directory if it does not exist yet (i.e., if your plug-in
-is the first to be installed).
-
-ii) Create a subdirectory for your plug-in code (named in accordance to
-the conventions set forth in the CONTRIBUTE file). Add all your code
-to that directory. Make sure you have a tclIndex file or use
-auto_mkindex to create it. For instance, in the sample case we would
-have:
-
- $(EXEC-PREFIX)/lib/insight1.0/rhabout
-
-** FIXME: this shows unix. show cygwin, too. **
-and it would contain:
-
- rhabout.itcl rhabout.so rhabout.tcl pkgIndex.tcl tclIndex
-
-iii) In your plug-in's directory, create a file that will actually load your
-plug-in package (named accordingly to the CONTRIBUTE conventions). In
-the provided sample, this file is "rhabout.tcl" and would contain the
-following lines:
-
- package provide RHABOUT 1.0
- set dirname [file dirname [info script]]
- lappend auto_path [file join $dirname]
- catch {load [file join $dirname rhabout@TCL_SHLIB_SUFFIX@]}
-
-The first line states what package the sample plug-in code is
-providing. Note that the subdirectory "rhabout" which contains the
-sample plug-in is added to the auto_path in the third line and there
-is a tclIndex file in that directory (that is how plug-in classes and
-methods are found).
-
-The last line is only necessary if your plug-in contains Tcl command
-procedures written in C. Loading Tcl libraries is described in [Welch
-2000] and the [incr Tcl/Tk] bits can be found in [Smith 2000]. It is
-recommended that the reader also refer to the "load" Tcl man page if
-these dynamic libraries are to be loaded.
-
-iv) Add a pkgIndex.tcl file to your plug-in's directory. Do not use
-Tcl to generate this file, since it will not work properly. Instead,
-just add a line like:
-
- package ifneeded RHABOUT 1.0 [list source [file join $dir rhabout.tcl]]
-
-This roughly corresponds to what would be created by a pkg_mkIndex
-command with the "-direct" option.
-
-** FIXME: install will do this, too. ALL plugins should be mentioned
- in the global plugins.tcl file **
-v) Create/append the file "plugins.tcl" in the plugins directory
-($(EXEC-PREFIX/lib/insight1.0) if it does not yet exist. This is a file
-shared by all plug-ins so make sure your install script does not overwrite,
-but append to it.
-
-This is a Tcl code fragment that will be sourced by the Insight Source
-Window constructor to add menu entries to the "PlugIn" menu that will
-instantiate the plug-in classes. If there is any error in this few
-lines of code Insight will not start and a Tcl stack trace will be
-shown. So test it in your build directory before installing in a
-system shared by others.
-
-For the sample plug-in, this lines would be:
-
- # Add your window to the PlugIn menu here
- # Don't forget to add your packet as well
-
- if {1} { #test here if your target is configured
- # Uncomment this when the PlugIn class is ready
- #package require LIBGDB 1.0
- package require RHABOUT 1.0
- $Menu add command Other "About Red Hat" \
- {ManagedWin::open RHAbout} \
- -underline 0
- # To activate the PlugIn sample, uncomment the next line
- set plugins_available 1
- }
-
-You can ignore the LIBGDB "package require" command for now. LIBGDB
-is under construction and not yet available. But do not forget to
-add a "package require" command for your plug-in package. Otherwise,
-when someone choses your plug-in menu entry a stack trace will be
-produced.
-
-The Tcl command starting with "$Menu" is similar to the ones provided
-by the "menubar" component of the PluginWindow class (described later
-in this document), but all one needs to do is to copy the above
-replacing the menu entry text "About Red Hat", the plug-in class name
-"RHAbout" and the underline index with the appropriate values.
-
-The "set plugins_available 1" command is important. If the variable
-"plugins_available" is not set to 1 by any of the plug-in code
-fragments, the Source Window will not have a "PlugIn" menu.
-
-This brings us to the "if" statement in the first line. The sample
-plug-in is generic, it works with any target. However, a custom
-plug-in may be written for a specific target and be of no generic
-use. Furthermore, a target-specific plug-in may not even work with
-other host and target configurations different from the one for which
-it was designed.
-
-The plugins.tcl file used by Insight is shared by all configurations on a
-given host, and adding a plug-in incorrectly could render Insight unusable.
-To avoid this, test for the right configuration before adding your plug-in
-to the plug-in menu entry (the "package require" must also be protected).
-
-Insight has a global variable which contains configuration
-information. The array "GDBStartup" has the elements:
-
- host_name - host configuration triplet
- target_name - target configuration triplet
-
-Use the values $GDBStartup(host_name) and $GDBStartup(target_name)
-to verify that your plug-in code is supported. Since these are global
-variables, you must either add "global GDBStartup" somewhere before using
-it, or simply specify GDBStartup in the global space, e.g.,
-"$::GDBStartup(host_name)".
-
-For instance, if the sample code could only be used with Linux hosts,
-the sample code above would look like this:
-
- # Add your window to the PlugIn menu here
- # Don't forget to add your packet as well
-
- global GDBStartup
- if {[string first "linux" $GDBStartup(host_name)] != -1} {
- #package require LIBGDB 1.0
- package require RHABOUT 1.0
- $Menu add command Other "About Red Hat" \
- {ManagedWin::open RHAbout} \
- -underline 0
- set plugins_available 1
- }
-
-
-3) DEVELOPING AN INSIGHT PLUG-IN
-
-Only itcl-based windows will work. They must also be derived (i.e.,
-inherit) from the PluginWindow class described in the next section.
-You must also follow the name conventions described in the CONTRIBUTE
-file to avoid class name clashes.
-
-The PluginWindow base class has facilities for adding a menu and a
-toolbar. It already provides the code to deactivate buttons and menu
-entries when GDB is busy (running the target) and reactivate them when
-the target stops. Your job usually consists of calling a method to
-redraw your window with updated information when the target stops.
-You can do this simply by adding a call to this method inside the
-"stopped" method provided.
-
-The Insight Tcl source file gdb/gdbtk/library/interface.tcl and the C
-file gdb/gdbtk/generic/gdbtk-cmds.c contain a (quite volatile) set of
-Tcl commands that can be used to retrieve information from and about
-the target. Examples of the use of such commands exist all around the
-Insight source code and details are usually given near the procedure
-or function definitions. Please refrain from using commands that
-control the target execution or change the GDB state in any way, they
-are reserved for use by the Source Window only. Remember, plug-ins are
-a visualization facility only.
-
-A special remark is necessary about the gdb_cmd and gdb_immediate
-commands. These are deprecated and will disappear (stop working) soon.
-The GDB maintainers have asked the Insight maintainers to stop using
-the hooks in GDB code that make them possible. Conversion is already
-under way. You can use them for prototyping (for now), but be
-prepared to write Tcl command procedures instead of parsing console text
-output.
-
-If you need to issue target-dependent commands to retrieve information
-from your target (that cannot be retrieved with the standard register
-and memory access operations), you can write Tcl command procedures
-and add them to your target dependent file enclosed in
- #ifdef GDBTK
- #endif
-The target-dependent Tcl code will move to a subdirectory of gdbtk in
-the future, but for now, just add it to your existent target-dependent
-file.
-
-If you must access gdb functions that are not yet available in
-gdbtk-cmds.c (or in any of the spun-offs that will soon exist in the
-gdb/gdbtk/generic directory), consider writing to the Insight
-maintainers. They will be able to tell you what command should be
-implemented and, if they have the time, add it to Insight. As they
-may be busy, consider offering to write the code yourself and
-submitting it for approval (see CONTRIBUTE). You can see how these
-Tcl command procedures in C are written by looking at what it is done
-in the gdbtk-cmds.c file and others in the gdb/gdbtk/generic
-subdirectory. Again, you can use the gdb_cmd and gdb_immediate
-commands to invoke a GDB command line interface command, but they will
-not be available for long.
-
-Please refer to the sample source code located in the files:
- gdb/gdbtk/library/plugins/rhabout/rhabout.itcl
- gdb/gdbtk/library/plugins/rhabout/rhabout.c
-
-The comments in these files provide a basic framework for a Insight
-plug-in.
-
-
-4) THE "PluginWindow" BASE CLASS
-
-The PluginWindow base class provides the following methods:
-
-childsite - returns the path of the frame component that can be used
-by the plug-in code to pack its custom display components.
-
-stopped - called when the target stops. It should be overloaded and
-call the plug-in procedure that updates the display. The child
-version must call the base class method implementation if it wants
-menu items and/or buttons to be automatically controlled.
-
-running - called when GDB becomes busy by running the target. No
-commands shall be issued by a plug-in while GDB is busy. The child
-version must call the base class method implementation if it wants
-menu items and/or buttons to be automatically controlled.
-
-no_inferior - called when GDB disconnects from the target. The
-plug-in may want to forget some context information in this case,
-depending on the specifics of its implementation. The child
-version must call the base class method implementation if it wants
-menu items and/or buttons to be automatically controlled.
-
-
-The PluginWindow base class contains two components which can be
-optionally used:
-
-menubar - allows a menu to be added to the plug-in window. This
-facility is implemented by the GDBMenuBar class (gdbmenubar.itcl).
-
-toolbar - allows a toolbar to be added to the plug-in window. This
-facility is implemented by the GDBToolBar class (gdbtoolbar.itcl).
-
-
-Both buttons and menu entries have "class" attributes. Button classes
-and Menu entry classes are specified when they are created and are
-used for the automatic control of button and menu entry states.
-If the class is specified as "None", the menu entry or button will
-remain always active. The classes "Control" and "Other" follow the
-following convention:
-
- Control Other State
- off off gdb is busy
- on on gdb has inferior, and is idle
- off on gdb has no inferior, and is idle
-
-
-The "menubutton" component offers the following supported commands:
-
-add menubutton - add a menu button to the window menu bar.
-add command - add an entry to the last menu created.
-add separator - add a separator to the last menu created.
-show - attach the created menu to the window.
-
-If the show command is not issued, the plug-in window will have no
-menu bar. There are other methods and commands defined in the
-GDBMenuBar class. They are for Insight internal use only and should
-not be used by plug-in windows.
-
-A menu named "help" will automatically be aligned to the right.
-
-The sample plug-in code creates a simple menu with the following commands:
-
- $menubar add menubutton file "File" 0
- $menubar add command None "Close" \
- [code $this destroy_toplevel] \
- -underline 1
- $menubar add menubutton help "Help" 0
- $menubar add command Other "Help Topics" \
- {HtmlViewer::open_help index.html} \
- -underline 0
- $menubar add separator
- $menubar add command Other "About GDB..." \
- {ManagedWin::open About -transient} \
- -underline 0
-
- # The menu only shows up if you do this:
- $menubar show
-
-
-The "toolbar" component offers the following supported commands:
-
-add button - add a button to the window tool bar.
-add label - add an label widget to the tool bar.
-add separator - add a separator to the tool bar.
-itemconfigure - configure a tool bar element.
-show - make the toolbar visible.
-
-If the show command is not issued, the plug-in window will have no
-tool bar. There are other methods and commands defined in the
-GDBToolBar class. They are for Insight internal use only and should
-not be used by plug-in windows.
-
-Use the "itemconfigure" command to fill the label elements with the
-current data as necessary.
-
-The sample plug-in code creates a single button with the following commands:
-
- $toolbar add button con Other {ManagedWin::open Console} \
- "Console (Ctrl+N)" -image console_img
-
- # The toolbar will only show up if you do this:
- $toolbar show
-
-
-The complete Tcl code of the sample plug-in can be found in the file
- gdb/gdbtk/library/plugins/rhabout/rhabout.itcl
-and the PluginWindow class definition and implementation is in the file
- gdb/gdbtk/library/pluginwin.itcl
-
-Please refer to the files
- gdb/gdbtk/library/gdbmenubar.itcl
-and
- gdb/gdbtk/library/gdbtoolbar.itcl
-for the current arguments accepted by the menubar and toolbar commands
-respectively.
-
-REQUIRED FILES
-gdbtk/plugins/PLUGIN
-gdbtk/plugins/PLGUIN/PLUGIN.tcl.in
-gdbtk/plugins/PLUGIN/Makefile.in
-gdbtk/plugins/PLUGIN/pkgIndex.tcl
-gdbtk/plugins/PLUGIN/tclIndex
-
-REFERENCES
-
-[Smith 2000] Chad Smith, "[incr Tcl/Tk] from the Ground Up".
-Chapters 9 and 10. Osborne/McGraw-Hill, 2000.
-
-[Welch 2000] Brent B. Welch, "Practical Programming in Tcl and Tk",
-3/e. Chapters 12, 14, 44, 45, 46 and 47. Prentice Hall PTR, 2000.
diff --git a/gdb/gdbtk/plugins/Make-rules b/gdb/gdbtk/plugins/Make-rules
deleted file mode 100644
index 1e5113fdcbe..00000000000
--- a/gdb/gdbtk/plugins/Make-rules
+++ /dev/null
@@ -1,166 +0,0 @@
-# Variables to be defined by plugin's Makefile.in:
-#
-# PLUGIN (required)
-# PLUGIN_CFLAGS - CFLAGS to use for build
-# PLUGIN_SHLIB_LIBS - shared libs to link against
-# PLUGIN_INSTALL - anything to install from builddir
-# PLUGIN_INSTALL_SRCDIR - anything to install from srcdir
-# PLUGIN_INSTALL_TARGET - install target (overrides default)
-# PLUGIN_TARGETS - targets to build
-# PLUGIN_CLEAN - clean targets (overrides default)
-# PLUGIN_DISTCLEAN - distclean targets (overrides default)
-#
-# Cygwin-specific variables
-# PLUGIN_DLL_ENTRY - cygwin DLL entry point default _DllMain@12)
-# PLUGIN_IMAGE_BASE (required) - DLL image base
-# PLUGIN_CYGWIN_LIBS - any additional cygwin libs to link against
-# PLUGIN_OBJS - objects to put in DLL (hack)
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-srcdir = @srcdir@
-datadir = @datadir@
-libdir = @libdir@
-mandir = @mandir@
-plugin_srcdir = @top_srcdir@
-plugin_builddir = @plugin_builddir@
-
-SHELL = @SHELL@
-CC = @CC@
-CFLAGS = @CFLAGS@
-
-OBJEXT = @OBJEXT@
-TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
-TCL_SHLIB_LD = @TCL_SHLIB_LD@
-TCL_DBGX = @TCL_DBGX@
-TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
-TCL_INCLUDES = @TCL_INCLUDES@
-TCL_LIBRARY = @TCL_LIBRARY@
-
-mkinstalldirs = $(srcdir)/../../../../mkinstalldirs
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-
-PLUGIN_MODULE = $(PLUGIN)$(TCL_SHLIB_SUFFIX)
-
-# Must include a path to tclWinInt.h on cygwin
-ifeq ($(TCL_SHLIB_SUFFIX),.dll)
-CYGWIN_CFLAGS=-I$(srcdir)/../../../../tcl/win
-else
-CYGWIN_CFLAGS=
-endif
-GENERIC_CFLAGS = $(CFLAGS) $(TCL_SHLIB_CFLAGS) $(TCL_INCLUDES) $(CYGWIN_CFLAGS)
-ALL_CFLAGS = $(GENERIC_CFLAGS) $(PLUGIN_CFLAGS)
-
-# It would be nice to copy all the plugin's files to the build dir so
-# that we can use the plugin without installing it...
-#GENERIC_TARGETS = tclIndex pkgIndex.tcl
-ifeq ($(PLUGIN_OBJS),)
-ALL_TARGETS = $(GENERIC_TARGETS) $(PLUGIN_TARGETS)
-else
-ALL_TARGETS = $(PLUGIN_MODULE) $(GENERIC_TARGETS) $(PLUGIN_TARGETS)
-endif
-
-GENERIC_SHLIB_LIBS = $(TCL_LIBRARY)
-CYGWIN_DLL_LIBS = $(PLUGIN_CYGWIN_LIBS) @LIBCYGWIN_A@
-ALL_SHLIB_LIBS = $(GENERIC_SHLIB_LIBS) $(PLUGIN_SHLIB_LIBS)
-
-GENERIC_INSTALL = $(PLUGIN).tcl
-ifeq ($(PLUGIN_OBJS),)
-ALL_INSTALL = $(GENERIC_INSTALL) $(PLUGIN_INSTALL)
-else
-ALL_INSTALL = $(PLUGIN_MODULE) $(GENERIC_INSTALL) $(PLUGIN_INSTALL)
-endif
-
-ifeq ($(PLUGIN_INSTALL_TARGET),)
-INSTALL_TARGET = install-generic
-else
-INSTALL_TARGET = $(PLUGIN_INSTALL_TARGET)
-endif
-
-ifeq ($(PLUGIN_CLEAN),)
-CLEAN_TARGET = clean-generic
-else
-CLEAN_TARGET = $(PLUGIN_CLEAN)
-endif
-
-ifeq ($(PLUGIN_DISTCLEAN),)
-DISTCLEAN_TARGET = distclean-generic
-else
-DISTCLEAN_TARGET = $(PLUGIN_DISTCLEAN)
-endif
-
-# Makefile dependencies
-Makefile: $(plugin_srcdir)/Make-rules $(plugin_builddir)/config.status
- cd $(plugin_builddir) \
- && CONFIG_FILES=$(PLUGIN)/Makefile:$(PLUGIN)/Makefile.in:Make-rules CONFIG_HEADERS= $(SHELL) ./config.status
-
-all: $(ALL_TARGETS)
-
-%.$(OBJEXT): $(srcdir)/%.c
- $(CC) -c $(ALL_CFLAGS) $<
-
-install: $(INSTALL_TARGET)
-
-install-generic:
- $(mkinstalldirs) $(libdir)/insight1.0/$(PLUGIN)
- for i in $(ALL_INSTALL); do \
- $(INSTALL_DATA) $$i $(libdir)/insight1.0/$(PLUGIN)/$$i ; \
- done ;
- for i in pkgIndex.tcl tclIndex $(PLUGIN_INSTALL_SRCDIR) ; do \
- $(INSTALL_DATA) $(srcdir)/$$i $(libdir)/insight1.0/$(PLUGIN)/$$i ; \
- done ;
-
-html:
-info:
-install-info:
-clean: $(CLEAN_TARGET)
-
-clean-generic:
- rm -f *.$(OBJEXT) *.base *.def *.exp $(PLUGIN_MODULE) $(PLUGIN_CLEAN)
-
-distclean-generic: $(CLEAN_TARGET)
-
-distclean: $(DISTCLEAN_TARGET)
-
-#
-# Build rules for the DLL/shlib
-#
-
-ifeq ($(TCL_SHLIB_SUFFIX),.dll)
-
-# cygwin stuff
-DLLTOOL = @DLLTOOL@
-LD = @LD@
-AS = @AS@
-NM = @NM@
-
-PLUGIN_DEFS = $(PLUGIN).def
-PLUGIN_BASE = $(PLUGIN).base
-PLUGIN_EXP = $(PLUGIN).exp
-ifeq ($(PLUGIN_DLL_ENTRY),)
-PLUGIN_DLL_ENTRY = _DllMain@12
-endif
-
-$(PLUGIN_DEFS): $(PLUGIN_OBJS)
- echo 'EXPORTS' > tmp.def
- -for o in $(PLUGIN_OBJS) ; do \
- $(NM) --extern-only --defined-only $$o | sed -e 's/[^ ]* [^ ]* //' -e 's/^_//' | fgrep -v DllMain | fgrep -v impure_ptr >> tmp.def ; \
- done
- mv tmp.def $(PLUGIN_DEFS)
-
-$(PLUGIN_MODULE): $(PLUGIN_OBJS) $(PLUGIN_DEFS)
- $(LD) -s --base-file $(PLUGIN_BASE) -dll -o $(PLUGIN_MODULE) $(PLUGIN_OBJS) $(ALL_SHLIB_LIBS) $(CYGWIN_DLL_LIBS) -e $(PLUGIN_DLL_ENTRY) --image-base $(PLUGIN_IMAGE_BASE)
- $(DLLTOOL) --as=$(AS) --dllname $(PLUGIN_MODULE) --def $(PLUGIN_DEFS) --base-file $(PLUGIN_DEFS) --output-exp $(PLUGIN_EXP)
- $(LD) -s --base-file $(PLUGIN_BASE) $(PLUGIN_EXP) -dll -o $(PLUGIN_MODULE) $(PLUGIN_OBJS) $(ALL_SHLIB_LIBS) $(CYGWIN_DLL_LIBS) -e $(PLUGIN_DLL_ENTRY) --image-base $(PLUGIN_IMAGE_BASE)
- $(DLLTOOL) --as=$(AS) --dllname $(PLUGIN_MODULE) --def $(PLUGIN_DEFS) --base-file $(PLUGIN_BASE) --output-exp $(PLUGIN_EXP)
- $(LD) $(PLUGIN_EXP) -dll -o $(PLUGIN_MODULE) $(PLUGIN_OBJS) $(ALL_SHLIB_LIBS) $(CYGWIN_DLL_LIBS) -e $(PLUGIN_DLL_ENTRY) --image-base $(PLUGIN_IMAGE_BASE)
-
-else
-
-# For unixen only
-$(PLUGIN_MODULE): $(PLUGIN_OBJS)
- $(TCL_SHLIB_LD) -o $(PLUGIN_MODULE) $(PLUGIN_OBJS) $(ALL_SHLIB_LIBS)
-
-endif
diff --git a/gdb/gdbtk/plugins/Makefile.am b/gdb/gdbtk/plugins/Makefile.am
deleted file mode 100644
index 03fabe7c4d9..00000000000
--- a/gdb/gdbtk/plugins/Makefile.am
+++ /dev/null
@@ -1,4 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = cygnus
-SUBDIRS = @make_subdirs@
diff --git a/gdb/gdbtk/plugins/Makefile.in b/gdb/gdbtk/plugins/Makefile.in
deleted file mode 100644
index e7d9c288c36..00000000000
--- a/gdb/gdbtk/plugins/Makefile.in
+++ /dev/null
@@ -1,460 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 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.
-
-@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-DIST_COMMON = $(srcdir)/../../../config.guess \
- $(srcdir)/../../../config.sub ChangeLog $(srcdir)/Makefile.in \
- $(srcdir)/Makefile.am $(top_srcdir)/configure \
- $(am__configure_deps) $(srcdir)/../../../mkinstalldirs \
- $(top_srcdir)/rhabout/Makefile.in $(srcdir)/Make-rules \
- $(top_srcdir)/rhabout/rhabout.tcl.in \
- $(top_srcdir)/intel-pentium/Makefile.in $(srcdir)/Make-rules \
- $(top_srcdir)/intel-pentium/intel-pentium.tcl.in
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/../../../config/tcl.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../../../mkinstalldirs
-CONFIG_CLEAN_FILES = rhabout/Makefile rhabout/rhabout.tcl \
- intel-pentium/Makefile intel-pentium/intel-pentium.tcl
-depcomp =
-am__depfiles_maybe =
-SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EXEEXT = @EXEEXT@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBCYGWIN_A = @LIBCYGWIN_A@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-NM = @NM@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TCL_BIN_DIR = @TCL_BIN_DIR@
-TCL_DBGX = @TCL_DBGX@
-TCL_INCLUDES = @TCL_INCLUDES@
-TCL_LIBRARY = @TCL_LIBRARY@
-TCL_LIB_FILE = @TCL_LIB_FILE@
-TCL_LIB_FLAG = @TCL_LIB_FLAG@
-TCL_LIB_SPEC = @TCL_LIB_SPEC@
-TCL_PATCH_LEVEL = @TCL_PATCH_LEVEL@
-TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
-TCL_SHLIB_LD = @TCL_SHLIB_LD@
-TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
-TCL_SRC_DIR = @TCL_SRC_DIR@
-TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@
-TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@
-TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@
-TCL_VERSION = @TCL_VERSION@
-TK_BIN_DIR = @TK_BIN_DIR@
-TK_LIB_FILE = @TK_LIB_FILE@
-TK_LIB_FLAG = @TK_LIB_FLAG@
-TK_LIB_SPEC = @TK_LIB_SPEC@
-TK_SRC_DIR = @TK_SRC_DIR@
-TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@
-TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@
-TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@
-TK_VERSION = @TK_VERSION@
-VERSION = @VERSION@
-ac_ct_AS = @ac_ct_AS@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
-ac_ct_LD = @ac_ct_LD@
-ac_ct_NM = @ac_ct_NM@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-make_subdirs = @make_subdirs@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-plugin_builddir = @plugin_builddir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-AUTOMAKE_OPTIONS = cygnus
-SUBDIRS = @make_subdirs@
-all: all-recursive
-
-.SUFFIXES:
-am--refresh:
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
- cd $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-rhabout/Makefile: $(top_builddir)/config.status $(top_srcdir)/rhabout/Makefile.in $(srcdir)/Make-rules
- cd $(top_builddir) && $(SHELL) ./config.status $@
-rhabout/rhabout.tcl: $(top_builddir)/config.status $(top_srcdir)/rhabout/rhabout.tcl.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-intel-pentium/Makefile: $(top_builddir)/config.status $(top_srcdir)/intel-pentium/Makefile.in $(srcdir)/Make-rules
- cd $(top_builddir) && $(SHELL) ./config.status $@
-intel-pentium/intel-pentium.tcl: $(top_builddir)/config.status $(top_srcdir)/intel-pentium/intel-pentium.tcl.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-uninstall-info-am:
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-am:
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
- check-am clean clean-generic clean-recursive ctags \
- ctags-recursive distclean distclean-generic \
- distclean-recursive distclean-tags dvi dvi-am html html-am \
- info info-am install install-am install-data install-data-am \
- install-exec install-exec-am install-info install-info-am \
- install-man install-strip installcheck installcheck-am \
- installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic maintainer-clean-recursive \
- mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
- pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
- uninstall-info-am
-
-# 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:
diff --git a/gdb/gdbtk/plugins/acinclude.m4 b/gdb/gdbtk/plugins/acinclude.m4
deleted file mode 100644
index 2b011eb39cf..00000000000
--- a/gdb/gdbtk/plugins/acinclude.m4
+++ /dev/null
@@ -1 +0,0 @@
-"sinclude(../../../config/tcl.m4)"
diff --git a/gdb/gdbtk/plugins/aclocal.m4 b/gdb/gdbtk/plugins/aclocal.m4
deleted file mode 100644
index a93606763fa..00000000000
--- a/gdb/gdbtk/plugins/aclocal.m4
+++ /dev/null
@@ -1,880 +0,0 @@
-# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005 Free Software Foundation, Inc.
-# This file 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.
-
-# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
- [AM_AUTOMAKE_VERSION([1.9.6])])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 7
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 8
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-#serial 3
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 12
-
-# 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.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.58])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])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
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-])
-])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $1 | $1:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
-# From Jim Meyering
-
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 4
-
-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
-]
-)
-
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 3
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 4
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-#
-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
-# created by `make install' are always world readable, even if the
-# installer happens to have an overly restrictive umask (e.g. 077).
-# This was a mistake. There are at least two reasons why we must not
-# use `-m 0755':
-# - it causes special bits like SGID to be ignored,
-# - it may be too restrictive (some setups expect 775 directories).
-#
-# Do not use -m 0755 and let people choose whatever they expect by
-# setting umask.
-#
-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
-# Some implementations (such as Solaris 8's) are not thread-safe: if a
-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
-# concurrently, both version can detect that a/ is missing, but only
-# one can create it and the other will error out. Consequently we
-# restrict ourselves to GNU make (using the --version option ensures
-# this.)
-AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-AC_SUBST([mkdir_p])])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 3
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 4
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# 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 conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $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]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
- [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
-m4_include([acinclude.m4])
diff --git a/gdb/gdbtk/plugins/configure b/gdb/gdbtk/plugins/configure
deleted file mode 100755
index f7b6fb24957..00000000000
--- a/gdb/gdbtk/plugins/configure
+++ /dev/null
@@ -1,4974 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59.
-#
-# Copyright (C) 2003 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-exec 6>&1
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_config_libobj_dir=.
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete. It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_unique_file="Make-rules"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TCL_DBGX TCL_SHLIB_CFLAGS TCL_SHLIB_LD TCL_SHLIB_SUFFIX TCL_INCLUDES TCL_LIBRARY NM ac_ct_NM AS ac_ct_AS LD ac_ct_LD LIBCYGWIN_A DLLTOOL ac_ct_DLLTOOL make_subdirs plugin_builddir LIBOBJS LTLIBOBJS'
-ac_subst_files=''
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-ac_prev=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_option in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval "enable_$ac_feature=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_$ac_feature='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "with_$ac_package='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval "with_$ac_package=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
- eval "$ac_envvar='$ac_optarg'"
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
- { (exit 1); exit 1; }; }
- else
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
- fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
- { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
- cat <<_ACEOF
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-tcl directory containing tcl configuration (tclConfig.sh)
- --with-tk directory containing tk configuration (tkConfig.sh)
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
- headers in a nonstandard directory <include dir>
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- ac_popdir=`pwd`
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d $ac_dir || continue
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
- cd $ac_dir
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- echo
- $SHELL $ac_srcdir/configure.gnu --help=recursive
- elif test -f $ac_srcdir/configure; then
- echo
- $SHELL $ac_srcdir/configure --help=recursive
- elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
- echo
- $ac_configure --help
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
- cd $ac_popdir
- done
-fi
-
-test -n "$ac_init_help" && exit 0
-if $ac_init_version; then
- cat <<\_ACEOF
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit 0
-fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_sep=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-{
- (set) 2>&1 |
- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
- ;;
- *)
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-}
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- sed "/^$/d" confdefs.h | sort
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core &&
- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
- ' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . $cache_file;;
- *) . ./$cache_file;;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
- eval ac_new_val="\$ac_env_${ac_var}_value"
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_aux_dir=
-for ac_dir in ../../.. $srcdir/../../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f $ac_dir/shtool; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../.. $srcdir/../../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in ../../.. $srcdir/../../.." >&2;}
- { (exit 1); exit 1; }; }
-fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
-
-am__api_version="1.9"
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL=$ac_install_sh
- fi
-fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# 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 conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $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".
- { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
-Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
-Check your system clock" >&2;}
- { (exit 1); exit 1; }; }
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-test "$program_prefix" != NONE &&
- program_transform_name="s,^,$program_prefix,;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s,\$,$program_suffix,;$program_transform_name"
-# Double any \ or $. echo might interpret backslashes.
-# By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AWK+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AWK="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$AWK" && break
-done
-
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.make <<\_ACEOF
-all:
- @echo 'ac_maketemp="$(MAKE)"'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftest.make
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- SET_MAKE=
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE=insight
- VERSION=1.0
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- STRIP=$ac_ct_STRIP
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
-
-
-
-
-echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
-echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
- # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then
- enableval="$enable_maintainer_mode"
- USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
-fi;
- echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
-echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
-
-
-if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.make <<\_ACEOF
-all:
- @echo 'ac_maketemp="$(MAKE)"'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftest.make
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- SET_MAKE=
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-# Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
- { (exit 1); exit 1; }; }
-
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
- ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
-build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
- ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
-host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$ac_ct_CC" && break
-done
-
- CC=$ac_ct_CC
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
- "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
- (eval $ac_compiler --version </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
- (eval $ac_compiler -v </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
- (eval $ac_compiler -V </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
- (eval $ac_link_default) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Find the output, starting from the most likely. This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
- conftest.$ac_ext )
- # This is the source file.
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
- break;;
- * )
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std1 is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std1. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_stdc=$ac_arg
-break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
- x|xno)
- echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
- *)
- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
- CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-# Some people use a C++ compiler to compile C. Since we use `exit',
-# in C++ we need to declare it. In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
- choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- for ac_declaration in \
- '' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);'
-do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-DEPDIR="${am__leading_dot}deps"
-
- ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-
-
-echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
- enableval="$enable_dependency_tracking"
-
-fi;
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-
-depcc="$CC" am_compiler_list=
-
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-
-
-if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-
-
-
-# Find Tcl, Tk, etc
-
- #
- # Ok, lets find the tcl configuration
- # First, look for one uninstalled.
- # the alternative search directory is invoked by --with-tcl
- #
-
- if test x"${no_tcl}" = x ; then
- # we reset no_tcl in case something fails here
- no_tcl=true
-
-# Check whether --with-tcl or --without-tcl was given.
-if test "${with_tcl+set}" = set; then
- withval="$with_tcl"
- with_tclconfig=${withval}
-fi;
- echo "$as_me:$LINENO: checking for Tcl configuration" >&5
-echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6
- if test "${ac_cv_c_tclconfig+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
- # First check to see if --with-tcl was specified.
- if test x"${with_tclconfig}" != x ; then
- if test -f "${with_tclconfig}/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
- else
- { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5
-echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-
- # then check for a private Tcl installation
- if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in \
- ../tcl \
- `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \
- ../../tcl \
- `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \
- ../../../tcl \
- `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do
- if test -f "$i/unix/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
- break
- fi
- done
- fi
-
- # on Darwin, check in Framework installation locations
- if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
- for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
- `ls -d /Library/Frameworks 2>/dev/null` \
- `ls -d /Network/Library/Frameworks 2>/dev/null` \
- `ls -d /System/Library/Frameworks 2>/dev/null` \
- ; do
- if test -f "$i/Tcl.framework/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)`
- break
- fi
- done
- fi
-
- # check in a few common install locations
- if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in `ls -d ${libdir} 2>/dev/null` \
- `ls -d ${exec_prefix}/lib 2>/dev/null` \
- `ls -d ${prefix}/lib 2>/dev/null` \
- `ls -d /usr/local/lib 2>/dev/null` \
- `ls -d /usr/contrib/lib 2>/dev/null` \
- `ls -d /usr/lib 2>/dev/null` \
- ; do
- if test -f "$i/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i; pwd)`
- break
- fi
- done
- fi
-
- # check in a few other private locations
- if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in \
- ${srcdir}/../tcl \
- `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \
- `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do
- if test -f "$i/unix/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
- break
- fi
- done
- fi
-
-fi
-
-
- if test x"${ac_cv_c_tclconfig}" = x ; then
- TCL_BIN_DIR="# no Tcl configs found"
- { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5
-echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;}
- exit 0
- else
- no_tcl=
- TCL_BIN_DIR=${ac_cv_c_tclconfig}
- echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5
-echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6
- fi
- fi
-
-
- echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5
-echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6
-
- if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
- echo "$as_me:$LINENO: result: loading" >&5
-echo "${ECHO_T}loading" >&6
- . ${TCL_BIN_DIR}/tclConfig.sh
- else
- echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5
-echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6
- fi
-
- # eval is required to do the TCL_DBGX substitution
- eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
- eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
-
- # If the TCL_BIN_DIR is the build directory (not the install directory),
- # then set the common variable name to the value of the build variables.
- # For example, the variable TCL_LIB_SPEC will be set to the value
- # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
- # instead of TCL_BUILD_LIB_SPEC since it will work with both an
- # installed and uninstalled version of Tcl.
- if test -f ${TCL_BIN_DIR}/Makefile ; then
- TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
- TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
- TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
- elif test "`uname -s`" = "Darwin"; then
- # If Tcl was built as a framework, attempt to use the libraries
- # from the framework at the given location so that linking works
- # against Tcl.framework installed in an arbitary location.
- case ${TCL_DEFS} in
- *TCL_FRAMEWORK*)
- if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then
- for i in "`cd ${TCL_BIN_DIR}; pwd`" \
- "`cd ${TCL_BIN_DIR}/../..; pwd`"; do
- if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
- TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}"
- break
- fi
- done
- fi
- if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then
- TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
- TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
- fi
- ;;
- esac
- fi
-
- # eval is required to do the TCL_DBGX substitution
- eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
- eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
- eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
- eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #
- # Ok, lets find the tk configuration
- # First, look for one uninstalled.
- # the alternative search directory is invoked by --with-tk
- #
-
- if test x"${no_tk}" = x ; then
- # we reset no_tk in case something fails here
- no_tk=true
-
-# Check whether --with-tk or --without-tk was given.
-if test "${with_tk+set}" = set; then
- withval="$with_tk"
- with_tkconfig=${withval}
-fi;
- echo "$as_me:$LINENO: checking for Tk configuration" >&5
-echo $ECHO_N "checking for Tk configuration... $ECHO_C" >&6
- if test "${ac_cv_c_tkconfig+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
- # First check to see if --with-tkconfig was specified.
- if test x"${with_tkconfig}" != x ; then
- if test -f "${with_tkconfig}/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
- else
- { { echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5
-echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-
- # then check for a private Tk library
- if test x"${ac_cv_c_tkconfig}" = x ; then
- for i in \
- ../tk \
- `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \
- ../../tk \
- `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \
- ../../../tk \
- `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do
- if test -f "$i/unix/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
- break
- fi
- done
- fi
-
- # on Darwin, check in Framework installation locations
- if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
- for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
- `ls -d /Library/Frameworks 2>/dev/null` \
- `ls -d /Network/Library/Frameworks 2>/dev/null` \
- `ls -d /System/Library/Frameworks 2>/dev/null` \
- ; do
- if test -f "$i/Tk.framework/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)`
- break
- fi
- done
- fi
-
- # check in a few common install locations
- if test x"${ac_cv_c_tkconfig}" = x ; then
- for i in `ls -d ${libdir} 2>/dev/null` \
- `ls -d ${exec_prefix}/lib 2>/dev/null` \
- `ls -d ${prefix}/lib 2>/dev/null` \
- `ls -d /usr/local/lib 2>/dev/null` \
- `ls -d /usr/contrib/lib 2>/dev/null` \
- `ls -d /usr/lib 2>/dev/null` \
- ; do
- if test -f "$i/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i; pwd)`
- break
- fi
- done
- fi
- # check in a few other private locations
- if test x"${ac_cv_c_tkconfig}" = x ; then
- for i in \
- ${srcdir}/../tk \
- `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \
- `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do
- if test -f "$i/unix/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
- break
- fi
- done
- fi
-
-fi
-
-
- if test x"${ac_cv_c_tkconfig}" = x ; then
- TK_BIN_DIR="# no Tk configs found"
- { echo "$as_me:$LINENO: WARNING: Can't find Tk configuration definitions" >&5
-echo "$as_me: WARNING: Can't find Tk configuration definitions" >&2;}
- exit 0
- else
- no_tk=
- TK_BIN_DIR=${ac_cv_c_tkconfig}
- echo "$as_me:$LINENO: result: found ${TK_BIN_DIR}/tkConfig.sh" >&5
-echo "${ECHO_T}found ${TK_BIN_DIR}/tkConfig.sh" >&6
- fi
- fi
-
-
- echo "$as_me:$LINENO: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5
-echo $ECHO_N "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... $ECHO_C" >&6
-
- if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
- echo "$as_me:$LINENO: result: loading" >&5
-echo "${ECHO_T}loading" >&6
- . ${TK_BIN_DIR}/tkConfig.sh
- else
- echo "$as_me:$LINENO: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5
-echo "${ECHO_T}could not find ${TK_BIN_DIR}/tkConfig.sh" >&6
- fi
-
- # eval is required to do the TK_DBGX substitution
- eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
- eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
-
- # If the TK_BIN_DIR is the build directory (not the install directory),
- # then set the common variable name to the value of the build variables.
- # For example, the variable TK_LIB_SPEC will be set to the value
- # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
- # instead of TK_BUILD_LIB_SPEC since it will work with both an
- # installed and uninstalled version of Tcl.
- if test -f ${TK_BIN_DIR}/Makefile ; then
- TK_LIB_SPEC=${TK_BUILD_LIB_SPEC}
- TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC}
- TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH}
- elif test "`uname -s`" = "Darwin"; then
- # If Tk was built as a framework, attempt to use the libraries
- # from the framework at the given location so that linking works
- # against Tk.framework installed in an arbitary location.
- case ${TK_DEFS} in
- *TK_FRAMEWORK*)
- if test -f ${TK_BIN_DIR}/${TK_LIB_FILE}; then
- for i in "`cd ${TK_BIN_DIR}; pwd`" \
- "`cd ${TK_BIN_DIR}/../..; pwd`"; do
- if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
- TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}"
- break
- fi
- done
- fi
- if test -f ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}; then
- TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}"
- TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
- fi
- ;;
- esac
- fi
-
- # eval is required to do the TK_DBGX substitution
- eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
- eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
- eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
- eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Special in-tree hackery
-here=`pwd`
-cd ${srcdir}/../../..
-topdir=`pwd`
-cd ${here}
-
-if test "${TCL_SRC_DIR}" = "${topdir}/tcl"; then
- TCL_INCLUDES="-I${TCL_SRC_DIR}/generic"
- TCL_LIBRARY="${TCL_BUILD_LIB_SPEC}"
-else
- TCL_INCLUDES="${TCL_INCLUDE_SPEC}"
- TCL_LIBRARY="${TCL_LIB_SPEC}"
-fi
-
-
-
-
-
-
-
-
-# Make sure TCL_SHLIB_SUFFIX is set
-if test x$TCL_SHLIB_SUFFIX = x ; then
- case "${host}" in
- *cygwin*) TCL_SHLIB_SUFFIX=".dll" ;;
- *) TCL_SHILB_SUFFIX=".so" ;;
- esac
-fi
-
-
-# Since we're not using autoconf > 2.1x, we cannot use AC_CONFIG_FILES.
-make_subdirs=""
-
-# See if -mwin32 works for cygwin
-case "${host}" in
- *cygwin*)
- ocflags=${CFLAGS}
- CFLAGS="${CFLAGS} -mwin32"
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-CFLAGS="${ocflags}"
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- ;;
- *) ;;
-esac
-
-# note toplevel plugin build directory
-plugin_builddir=`pwd`
-
-#
-# Plugins
-#
-
-# Supported hosts
-
-# Only supported/tested on linux, solaris, cygwin
-supported=yes
-case "${host}" in
- *cygwin*) ;;
- *solaris*) ;;
- *linux*) ;;
- *) supported=no ;;
-esac
-
-# Host-specific configury
-case "${host}" in
- *cygwin*)
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nm; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_NM+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$NM"; then
- ac_cv_prog_NM="$NM" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_NM="${ac_tool_prefix}nm"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-NM=$ac_cv_prog_NM
-if test -n "$NM"; then
- echo "$as_me:$LINENO: result: $NM" >&5
-echo "${ECHO_T}$NM" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_NM"; then
- ac_ct_NM=$NM
- # Extract the first word of "nm", so it can be a program name with args.
-set dummy nm; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_NM+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_NM"; then
- ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_NM="nm"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_NM" && ac_cv_prog_ac_ct_NM="nm"
-fi
-fi
-ac_ct_NM=$ac_cv_prog_ac_ct_NM
-if test -n "$ac_ct_NM"; then
- echo "$as_me:$LINENO: result: $ac_ct_NM" >&5
-echo "${ECHO_T}$ac_ct_NM" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- NM=$ac_ct_NM
-else
- NM="$ac_cv_prog_NM"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
-set dummy ${ac_tool_prefix}as; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AS+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AS"; then
- ac_cv_prog_AS="$AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AS="${ac_tool_prefix}as"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-AS=$ac_cv_prog_AS
-if test -n "$AS"; then
- echo "$as_me:$LINENO: result: $AS" >&5
-echo "${ECHO_T}$AS" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_AS"; then
- ac_ct_AS=$AS
- # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_AS+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_AS"; then
- ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AS="as"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_AS" && ac_cv_prog_ac_ct_AS="as"
-fi
-fi
-ac_ct_AS=$ac_cv_prog_ac_ct_AS
-if test -n "$ac_ct_AS"; then
- echo "$as_me:$LINENO: result: $ac_ct_AS" >&5
-echo "${ECHO_T}$ac_ct_AS" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- AS=$ac_ct_AS
-else
- AS="$ac_cv_prog_AS"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ld; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$LD"; then
- ac_cv_prog_LD="$LD" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_LD="${ac_tool_prefix}ld"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-LD=$ac_cv_prog_LD
-if test -n "$LD"; then
- echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_LD"; then
- ac_ct_LD=$LD
- # Extract the first word of "ld", so it can be a program name with args.
-set dummy ld; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_LD"; then
- ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_LD="ld"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
-fi
-fi
-ac_ct_LD=$ac_cv_prog_ac_ct_LD
-if test -n "$ac_ct_LD"; then
- echo "$as_me:$LINENO: result: $ac_ct_LD" >&5
-echo "${ECHO_T}$ac_ct_LD" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- LD=$ac_ct_LD
-else
- LD="$ac_cv_prog_LD"
-fi
-
- echo "$as_me:$LINENO: checking \"for libcygwin.a\"" >&5
-echo $ECHO_N "checking \"for libcygwin.a\"... $ECHO_C" >&6
- LIBCYGWIN_A=`$CC -print-file-name=libcygwin.a`
- echo "$as_me:$LINENO: result: $LIBCYGWIN_A" >&5
-echo "${ECHO_T}$LIBCYGWIN_A" >&6
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_DLLTOOL+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$DLLTOOL"; then
- ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
- echo "$as_me:$LINENO: result: $DLLTOOL" >&5
-echo "${ECHO_T}$DLLTOOL" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
- ac_ct_DLLTOOL=$DLLTOOL
- # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_DLLTOOL"; then
- ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DLLTOOL="dlltool"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
- echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5
-echo "${ECHO_T}$ac_ct_DLLTOOL" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- DLLTOOL=$ac_ct_DLLTOOL
-else
- DLLTOOL="$ac_cv_prog_DLLTOOL"
-fi
-
- ;;
-esac
-
-# Plugins supported by this configuration
-if test x${supported} = xyes; then
- plugins="rhabout"
- case "${target}" in
- *cygwin*) ;;
- *linux*) ;;
- *i?86*)
- plugins="${plugins} intel-pentium"
- ;;
- esac
-
- for i in $plugins ; do
- make_subdirs="${make_subdirs} $i"
- done
-fi
-
-
-
-
- ac_config_files="$ac_config_files Makefile rhabout/Makefile:rhabout/Makefile.in:Make-rules rhabout/rhabout.tcl intel-pentium/Makefile:intel-pentium/Makefile.in:Make-rules intel-pentium/intel-pentium.tcl"
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
- (set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-} |
- sed '
- t clear
- : clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
- if test -w $cache_file; then
- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
- cat confcache >$cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ ]*$//;
-}'
-fi
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
-t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
-t quote
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
-t quote
-d
-: quote
-s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output. A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
-
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-_ACEOF
-
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Configuration commands:
-$config_commands
-
-Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.59,
- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- -*)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
- esac
-
- case $ac_option in
- # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1" ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# INIT-COMMANDS section.
-#
-
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_config_target in $ac_config_targets
-do
- case "$ac_config_target" in
- # Handling of arguments.
- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "rhabout/Makefile" ) CONFIG_FILES="$CONFIG_FILES rhabout/Makefile:rhabout/Makefile.in:Make-rules" ;;
- "rhabout/rhabout.tcl" ) CONFIG_FILES="$CONFIG_FILES rhabout/rhabout.tcl" ;;
- "intel-pentium/Makefile" ) CONFIG_FILES="$CONFIG_FILES intel-pentium/Makefile:intel-pentium/Makefile.in:Make-rules" ;;
- "intel-pentium/intel-pentium.tcl" ) CONFIG_FILES="$CONFIG_FILES intel-pentium/intel-pentium.tcl" ;;
- "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@CYGPATH_W@,$CYGPATH_W,;t t
-s,@PACKAGE@,$PACKAGE,;t t
-s,@VERSION@,$VERSION,;t t
-s,@ACLOCAL@,$ACLOCAL,;t t
-s,@AUTOCONF@,$AUTOCONF,;t t
-s,@AUTOMAKE@,$AUTOMAKE,;t t
-s,@AUTOHEADER@,$AUTOHEADER,;t t
-s,@MAKEINFO@,$MAKEINFO,;t t
-s,@install_sh@,$install_sh,;t t
-s,@STRIP@,$STRIP,;t t
-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
-s,@mkdir_p@,$mkdir_p,;t t
-s,@AWK@,$AWK,;t t
-s,@SET_MAKE@,$SET_MAKE,;t t
-s,@am__leading_dot@,$am__leading_dot,;t t
-s,@AMTAR@,$AMTAR,;t t
-s,@am__tar@,$am__tar,;t t
-s,@am__untar@,$am__untar,;t t
-s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
-s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
-s,@MAINT@,$MAINT,;t t
-s,@build@,$build,;t t
-s,@build_cpu@,$build_cpu,;t t
-s,@build_vendor@,$build_vendor,;t t
-s,@build_os@,$build_os,;t t
-s,@host@,$host,;t t
-s,@host_cpu@,$host_cpu,;t t
-s,@host_vendor@,$host_vendor,;t t
-s,@host_os@,$host_os,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@DEPDIR@,$DEPDIR,;t t
-s,@am__include@,$am__include,;t t
-s,@am__quote@,$am__quote,;t t
-s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
-s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
-s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
-s,@CCDEPMODE@,$CCDEPMODE,;t t
-s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
-s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
-s,@TCL_VERSION@,$TCL_VERSION,;t t
-s,@TCL_PATCH_LEVEL@,$TCL_PATCH_LEVEL,;t t
-s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t
-s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t
-s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t
-s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t
-s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t
-s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t
-s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t
-s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t
-s,@TK_VERSION@,$TK_VERSION,;t t
-s,@TK_BIN_DIR@,$TK_BIN_DIR,;t t
-s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t
-s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t
-s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t
-s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t
-s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t
-s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t
-s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t
-s,@TCL_DBGX@,$TCL_DBGX,;t t
-s,@TCL_SHLIB_CFLAGS@,$TCL_SHLIB_CFLAGS,;t t
-s,@TCL_SHLIB_LD@,$TCL_SHLIB_LD,;t t
-s,@TCL_SHLIB_SUFFIX@,$TCL_SHLIB_SUFFIX,;t t
-s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t
-s,@TCL_LIBRARY@,$TCL_LIBRARY,;t t
-s,@NM@,$NM,;t t
-s,@ac_ct_NM@,$ac_ct_NM,;t t
-s,@AS@,$AS,;t t
-s,@ac_ct_AS@,$ac_ct_AS,;t t
-s,@LD@,$LD,;t t
-s,@ac_ct_LD@,$ac_ct_LD,;t t
-s,@LIBCYGWIN_A@,$LIBCYGWIN_A,;t t
-s,@DLLTOOL@,$DLLTOOL,;t t
-s,@ac_ct_DLLTOOL@,$ac_ct_DLLTOOL,;t t
-s,@make_subdirs@,$make_subdirs,;t t
-s,@plugin_builddir@,$plugin_builddir,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
- cat >>$CONFIG_STATUS <<\_ACEOF
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
- fi
-fi # test -n "$CONFIG_FILES"
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
- esac
-
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
-
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
- ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
- ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_dest" : 'X\(//\)[^/]' \| \
- X"$ac_dest" : 'X\(//\)$' \| \
- X"$ac_dest" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
- { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
- case $ac_dest in
- depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`(dirname "$mf") 2>/dev/null ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`(dirname "$file") 2>/dev/null ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p $dirpart/$fdir
- else
- as_dir=$dirpart/$fdir
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
- { (exit 1); exit 1; }; }; }
-
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
- ;;
- esac
-done
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
diff --git a/gdb/gdbtk/plugins/configure.ac b/gdb/gdbtk/plugins/configure.ac
deleted file mode 100644
index c55973f3061..00000000000
--- a/gdb/gdbtk/plugins/configure.ac
+++ /dev/null
@@ -1,111 +0,0 @@
-AC_INIT(Make-rules)
-AC_CONFIG_AUX_DIR(../../..)
-AM_INIT_AUTOMAKE(insight, 1.0)
-AM_MAINTAINER_MODE
-AC_PROG_MAKE_SET
-AC_CANONICAL_HOST
-AC_PROG_CC
-AC_OBJEXT
-AC_EXEEXT
-
-# Find Tcl, Tk, etc
-SC_PATH_TCLCONFIG
-SC_LOAD_TCLCONFIG
-SC_PATH_TKCONFIG
-SC_LOAD_TKCONFIG
-
-# Special in-tree hackery
-here=`pwd`
-cd ${srcdir}/../../..
-topdir=`pwd`
-cd ${here}
-
-if test "${TCL_SRC_DIR}" = "${topdir}/tcl"; then
- TCL_INCLUDES="-I${TCL_SRC_DIR}/generic"
- TCL_LIBRARY="${TCL_BUILD_LIB_SPEC}"
-else
- TCL_INCLUDES="${TCL_INCLUDE_SPEC}"
- TCL_LIBRARY="${TCL_LIB_SPEC}"
-fi
-
-AC_SUBST(TCL_DBGX)
-AC_SUBST(TCL_SHLIB_CFLAGS)
-AC_SUBST(TCL_SHLIB_LD)
-AC_SUBST(TCL_SHLIB_SUFFIX)
-AC_SUBST(TCL_INCLUDES)
-AC_SUBST(TCL_LIBRARY)
-
-# Make sure TCL_SHLIB_SUFFIX is set
-if test x$TCL_SHLIB_SUFFIX = x ; then
- case "${host}" in
- *cygwin*) TCL_SHLIB_SUFFIX=".dll" ;;
- *) TCL_SHILB_SUFFIX=".so" ;;
- esac
-fi
-AC_SUBST(TCL_SHLIB_SUFFIX)
-
-# Since we're not using autoconf > 2.1x, we cannot use AC_CONFIG_FILES.
-make_subdirs=""
-
-# See if -mwin32 works for cygwin
-case "${host}" in
- *cygwin*)
- ocflags=${CFLAGS}
- CFLAGS="${CFLAGS} -mwin32"
- AC_TRY_COMPILE(,,,CFLAGS="${ocflags}")
- ;;
- *) ;;
-esac
-
-# note toplevel plugin build directory
-plugin_builddir=`pwd`
-
-#
-# Plugins
-#
-
-# Supported hosts
-
-# Only supported/tested on linux, solaris, cygwin
-supported=yes
-case "${host}" in
- *cygwin*) ;;
- *solaris*) ;;
- *linux*) ;;
- *) supported=no ;;
-esac
-
-# Host-specific configury
-case "${host}" in
- *cygwin*)
- AC_CHECK_TOOL(NM, nm, nm)
- AC_CHECK_TOOL(AS, as, as)
- AC_CHECK_TOOL(LD, ld, ld)
- AC_MSG_CHECKING("for libcygwin.a")
- LIBCYGWIN_A=`$CC -print-file-name=libcygwin.a`
- AC_MSG_RESULT($LIBCYGWIN_A)
- AC_SUBST(LIBCYGWIN_A)
- AC_CHECK_TOOL(DLLTOOL, dlltool)
- ;;
-esac
-
-# Plugins supported by this configuration
-if test x${supported} = xyes; then
- plugins="rhabout"
- case "${target}" in
- *cygwin*) ;;
- *linux*) ;;
- *i?86*)
- plugins="${plugins} intel-pentium"
- ;;
- esac
-
- for i in $plugins ; do
- make_subdirs="${make_subdirs} $i"
- done
-fi
-
-AC_SUBST(make_subdirs)
-AC_SUBST(plugin_builddir)
-
-AC_OUTPUT(Makefile rhabout/Makefile:rhabout/Makefile.in:Make-rules rhabout/rhabout.tcl intel-pentium/Makefile:intel-pentium/Makefile.in:Make-rules intel-pentium/intel-pentium.tcl)
diff --git a/gdb/gdbtk/plugins/intel-pentium/ChangeLog b/gdb/gdbtk/plugins/intel-pentium/ChangeLog
deleted file mode 100644
index 67f84af825d..00000000000
--- a/gdb/gdbtk/plugins/intel-pentium/ChangeLog
+++ /dev/null
@@ -1,43 +0,0 @@
-2005-12-23 Eli Zaretskii <eliz@gnu.org>
-
- * msrselection.ith:
- * msrselection.itb:
- * cpuinfo.tcl: Put (C) after Copyright.
-
-2002-08-14 Keith Seitz <keiths@redhat.com>
-
- Merged from Red Hat internal branch:
-
- 2001-11-30 Keith Seitz <keith@redhat.com>
- * Makefile.in: New file.
- * intel-pentium.tcl: Renamed to intel-pentium.tcl.in.
- * plugins.tcl: This plugin is only available on non-native targets.
- Append to ../plugins.tcl and remove.
-
- 2001-11-28 Ian Roxborough <irox@redhat.com>
- * cpuinfo.tcl (display_cpu_info): exec the gdb command
- "info cpu" to get the extra cpuinformation (CPU ID).
- * library/plugins/intel-pentium/msrselection.itb
- (MsrSelDlg::build_win): Switch the OK and Cancel buttons
- around to improve ease of use.
- * plugins.tcl: Use "$::GDBStartup" rather than "$GDBStartup".
- Create a sub menu in the plugins menu called "Intel Pentium"
- and place the menu items in it.
-
- 2001-11-21 Ian Roxborough <irox@redhat.com>
- * msrselection.itb (MsrSelDlg::list_msrs): Use
- "set msr-pointer" instead of "set msr".
- (MsrSelDlg::doit): Set the msr-pointer before calling
- unpost. Display an error message is we can't set the
- msr-pointer.
-
- 2001-11-16 Ian Roxborough <irox@redhat.com>
- * cpuinfo.tcl: New file.
- * intel-pentium.tcl: Ditto.
- * cpuinfo.tcl: Ditto.
- * msrselection.itb: Ditto.
- * msrselection.ith: Ditto.
- * pkgIndex.tcl: Ditto.
- * plugins.tcl: Ditto.
- * tclIndex: Ditto.
-
diff --git a/gdb/gdbtk/plugins/intel-pentium/Makefile.in b/gdb/gdbtk/plugins/intel-pentium/Makefile.in
deleted file mode 100644
index 79613d9f1da..00000000000
--- a/gdb/gdbtk/plugins/intel-pentium/Makefile.in
+++ /dev/null
@@ -1,6 +0,0 @@
-# Plugin definitions
-PLUGIN = intel-pentium
-PLUGIN_INSTALL_SRCDIR = cpuinfo.tcl \
- msrselection.ith \
- msrselection.itb
-
diff --git a/gdb/gdbtk/plugins/intel-pentium/cpuinfo.tcl b/gdb/gdbtk/plugins/intel-pentium/cpuinfo.tcl
deleted file mode 100644
index 1864c436b2c..00000000000
--- a/gdb/gdbtk/plugins/intel-pentium/cpuinfo.tcl
+++ /dev/null
@@ -1,33 +0,0 @@
-# Display CPU information.
-# Copyright (C) 1999, 2000, 2001 Red Hat, Inc.
-#
-# Written by Fernando Nasser <fnasser@redhat.com>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ------------------------------------------------------------------
-# NAME: proc display_cpu_info
-# DESCRIPTION: display what we know about the target CPU
-# if the information is available.
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-#
-# NOTES:
-# ------------------------------------------------------------------
-proc display_cpu_info {} {
- global gdb_cpuid_info
- if {[catch {gdb_cmd "info cpu"} result]} {
- tk_messageBox -message "CPU information not available"
- } else {
- tk_messageBox -message "$result"
- }
-}
diff --git a/gdb/gdbtk/plugins/intel-pentium/intel-pentium.tcl.in b/gdb/gdbtk/plugins/intel-pentium/intel-pentium.tcl.in
deleted file mode 100644
index 77b737647af..00000000000
--- a/gdb/gdbtk/plugins/intel-pentium/intel-pentium.tcl.in
+++ /dev/null
@@ -1,4 +0,0 @@
-package provide INTELPENTIUM 1.0
-set dirname [file dirname [info script]]
-lappend auto_path $dirname
-#catch {load [file join $dirname intel-pentium@TCL_SHLIB_SUFFIX@]}
diff --git a/gdb/gdbtk/plugins/intel-pentium/msrselection.itb b/gdb/gdbtk/plugins/intel-pentium/msrselection.itb
deleted file mode 100644
index f8fda1996bd..00000000000
--- a/gdb/gdbtk/plugins/intel-pentium/msrselection.itb
+++ /dev/null
@@ -1,192 +0,0 @@
-# Implements MSR selection dialog class for Insight.
-# Copyright (C) 1999, 2000, 2001 Red Hat, Inc.
-#
-# Written by Fernando Nasser <fnasser@redhat.com>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-# ------------------------------------------------------------------
-# NAME: MsrSelDlg::constructor
-# DESCRIPTION: Create a new MSR Selection dialog window.
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-# ------------------------------------------------------------------
-body MsrSelDlg::constructor {args} {
-
- window_name "MSR Selection"
- build_win
- eval itk_initialize $args
-
-}
-
-# ------------------------------------------------------------------
-# NAME: protected method MsrSelDlg::build_win
-# DESCRIPTION: Builds the MSR dialog window from widgets.
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-#
-# NOTES: This method should only be called once for
-# each MsrSelDlg.
-# ------------------------------------------------------------------
-body MsrSelDlg::build_win {} {
-
- # CHOOSE_MSR: the list box with list of MSRs. Also an entry
- # for typing in the MSR by hand.
-
- itk_component add choose_msr {
- iwidgets::scrolledlistbox $itk_interior.cmsr -visibleitems 30x15 \
- -labeltext "Choose MSR" -labelpos nw \
- -labelrelief groove -labelborderwidth 2 \
- -ipadx 8 -ipady 6 -childsitepos s -hscrollmode none \
- -textbackground white -exportselection 0 \
- -selectioncommand [code $this select_msr] \
- -dblclickcommand [code $this doit]
- }
-
- # MSR_ENTRY: this is the MSR entry box. You can enter the MSR register name
- # by hand here, or click on the listbox to have it entered for you.
-
- itk_component add msr_entry {
- iwidgets::entryfield [$itk_component(choose_msr) childsite].lab \
- -labeltext MSR: -textbackground white \
- -focuscommand [code $this clear_msr_selection] \
- -command [code $this doit]
- }
- pack $itk_component(msr_entry) -fill x -side bottom -pady 4
-
- itk_component add button_box {
- frame $itk_interior.b
- }
-
- itk_component add ok {
- button $itk_component(button_box).ok -text OK -command [code $this doit]
- }
- $itk_component(ok) configure -state disabled
-
- itk_component add cancel {
- button $itk_component(button_box).cancel -text Cancel \
- -command [code $this cancel]
- }
-
- ::standard_button_box $itk_component(button_box)
-
- pack $itk_component(button_box) -side bottom -fill x \
- -pady 4 -padx 4
- pack $itk_component(choose_msr) -fill both -expand 1 -pady 4 -padx 4
-
- after idle [list update idletasks; $this list_msrs]
-
-}
-
-# ------------------------------------------------------------------
-# NAME: protected method MsrSelDlg::doit
-# DESCRIPTION: Selects the MSR to view and unposts window.
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-#
-# NOTES:
-# ------------------------------------------------------------------
-body MsrSelDlg::doit {} {
- set MsrSelDlg::last_button 1
- set msr [$itk_component(msr_entry) get]
- set MsrSelDlg::last_msr $msr
-
- if {[catch {gdb_cmd "set msr-pointer $msr"} result]} {
- ManagedWin::open WarningDlg -transient \
- -message [list "Could not select this $msr:\n$result"]
- }
-
- debug "About to unpost"
- unpost
-}
-
-# ------------------------------------------------------------------
-# NAME: protected method MsrSelDlg::cancel
-# DESCRIPTION: Unposts the window without selecting
-# the MSR to view.
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-#
-# NOTES:
-# ------------------------------------------------------------------
-body MsrSelDlg::cancel {} {
- set MsrSelDlg::last_button 0
- set MsrSelDlg::last_msr {}
- unpost
-}
-
-# ------------------------------------------------------------------
-# NAME: protected method MsrSelDlg::list_msrs
-# DESCRIPTION: List the known MSR names.
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-#
-# NOTES:
-# ------------------------------------------------------------------
-body MsrSelDlg::list_msrs {{expr {}}} {
- set err [catch {gdb_cmd "set msr-pointer" 1} msg ]
- set msg [string trimright $msg "."]
- set msrnames [split $msg ,]
- set msrnames [lrange $msrnames 1 end]
-
- $itk_component(choose_msr) clear
- set msr_list {}
-
- foreach name $msrnames {
- lappend msr_list [list $name {set msr $name}]
- $itk_component(choose_msr) insert end $name
- }
-
- $itk_component(choose_msr) selection set 0
- select_msr
-}
-
-# ------------------------------------------------------------------
-# NAME: protected method MsrSelDlg::select_msrs
-# DESCRIPTION: Grab the selected element from the MSR listbox
-# and insert the associated MSR into the entry form.
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-#
-# NOTES:
-# ------------------------------------------------------------------
-body MsrSelDlg::select_msr {} {
- set hit [$itk_component(choose_msr) curselection]
- if {$hit != ""} {
- $itk_component(msr_entry) clear
- $itk_component(msr_entry) insert 0 [lindex [lindex $msr_list $hit] 0]
- $itk_component(ok) configure -state normal
- }
-}
-
-# ------------------------------------------------------------------
-# METHOD: clear_msr_selection - Clear the current MSR selection.
-# ------------------------------------------------------------------
-# ------------------------------------------------------------------
-# NAME: protected method MsrSelDlg::clear_msrs_selection
-# DESCRIPTION: Clear the current MSR selection.
-#
-# ARGUMENTS: None
-# RETURNS: Nothing
-#
-# NOTES:
-# ------------------------------------------------------------------
-body MsrSelDlg::clear_msr_selection {} {
- $itk_component(choose_msr) selection clear 0 end
- $itk_component(msr_entry) selection range 0 end
-}
-
diff --git a/gdb/gdbtk/plugins/intel-pentium/msrselection.ith b/gdb/gdbtk/plugins/intel-pentium/msrselection.ith
deleted file mode 100644
index 88f4a45aada..00000000000
--- a/gdb/gdbtk/plugins/intel-pentium/msrselection.ith
+++ /dev/null
@@ -1,38 +0,0 @@
-# Implements MSR selection dialog class for Insight.
-# Copyright (C) 1999, 2000, 2001 Red Hat, Inc.
-#
-# Written by Fernando Nasser <fnasser@redhat.com>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) 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.
-
-class MsrSelDlg {
- inherit ModalDialog PluginWindow
-
- public {
- method constructor {args}
- proc last_button {} {return $last_button}
- proc msr {} {return $last_msr}
- }
-
- protected {
- method build_win {args}
- method cancel {}
- method doit {}
- method list_msrs {{expr {}}}
- method select_msr {}
- method clear_msr_selection {}
-
- variable msr_list
-
- common last_button 0
- common last_msr {}
- }
-}
diff --git a/gdb/gdbtk/plugins/intel-pentium/pkgIndex.tcl b/gdb/gdbtk/plugins/intel-pentium/pkgIndex.tcl
deleted file mode 100644
index 58182a9676c..00000000000
--- a/gdb/gdbtk/plugins/intel-pentium/pkgIndex.tcl
+++ /dev/null
@@ -1 +0,0 @@
-package ifneeded INTELPENTIUM 1.0 [list source [file join $dir intel-pentium.tcl]]
diff --git a/gdb/gdbtk/plugins/intel-pentium/tclIndex b/gdb/gdbtk/plugins/intel-pentium/tclIndex
deleted file mode 100644
index 8b7e117e667..00000000000
--- a/gdb/gdbtk/plugins/intel-pentium/tclIndex
+++ /dev/null
@@ -1,17 +0,0 @@
-# Tcl autoload index file, version 2.0
-# This file is generated by the "auto_mkindex" command
-# and sourced to set up indexing information for one or
-# more commands. Typically each line is a command that
-# sets an element in the auto_index array, where the
-# element name is the name of a command and the value is
-# a script that loads the command.
-
-set auto_index(MsrSelDlg) [list source [file join $dir msrselection.ith]]
-set auto_index(::MsrSelDlg::constructor) [list source [file join $dir msrselection.itb]]
-set auto_index(::MsrSelDlg::build_win) [list source [file join $dir msrselection.itb]]
-set auto_index(::MsrSelDlg::doit) [list source [file join $dir msrselection.itb]]
-set auto_index(::MsrSelDlg::cancel) [list source [file join $dir msrselection.itb]]
-set auto_index(::MsrSelDlg::list_msrs) [list source [file join $dir msrselection.itb]]
-set auto_index(::MsrSelDlg::select_msr) [list source [file join $dir msrselection.itb]]
-set auto_index(::MsrSelDlg::clear_msr_selection) [list source [file join $dir msrselection.itb]]
-set auto_index(display_cpu_info) [list source [file join $dir cpuinfo.tcl]]
diff --git a/gdb/gdbtk/plugins/plugins.tcl b/gdb/gdbtk/plugins/plugins.tcl
deleted file mode 100644
index b9b1f926713..00000000000
--- a/gdb/gdbtk/plugins/plugins.tcl
+++ /dev/null
@@ -1,30 +0,0 @@
-# Only load the rhabout plugin if it was installed.
-foreach dir $::gdb_plugins {
- if {[file exists [file join $dir rhabout]]} {
- package require RHABOUT 1.0
- $Menu add command Other "About Red Hat" \
- {ManagedWin::open RHAbout} -underline 0
-
- # To activate the PlugIn sample, uncomment the next line
- set plugins_available 1
- }
-}
-
-# Only load the Intel Pentium plugin for x86 targets.
-if {[string match "i?86-*" $::GDBStartup(target_name)] && ![TargetSelection::native_debugging]} {
- package require INTELPENTIUM 1.0
-
- # Add a new cascading-style menu to plugin menu
- $Menu add cascade intel "Intel Pentium" 0
-
- # Add MSR selection dialog menu item.
- $Menu add command None "MSR Selection..." \
- {ManagedWin::open_dlg MsrSelDlg} -underline 0
-
- # Add CPU info menu item.
- $Menu add command None "CPU Information..." \
- display_cpu_info -underline 0
-
- # Activate the PlugIn.
- set plugins_available 1
-}
diff --git a/gdb/gdbtk/plugins/rhabout/ChangeLog b/gdb/gdbtk/plugins/rhabout/ChangeLog
deleted file mode 100644
index f87b23b37ca..00000000000
--- a/gdb/gdbtk/plugins/rhabout/ChangeLog
+++ /dev/null
@@ -1,24 +0,0 @@
-2004-12-08 Keith Seitz <kseitz@sources.redhat.com>
-
- From Ben Elliston (bje@gnu.org):
- * rhabout.c (extra_text): Convert to object interface.
- (Rhabout_Init): Use Tcl_CreateObjCommand instead of older argc/argv
- Tcl_CreateCommand.
-
-2003-03-12 Martin M. Hunt <hunt@redhat.com>
-
- * rhabout.itcl (RHAbout): Fix call
- to open_help. We no longer use HTMLViewer.
-
-2002-08-14 Keith Seitz <keiths@redhat.com>
-
- Merged from Red Hat internal branch:
- 2001-11-30 Keith Seitz <keiths@redhat.com>
- * rhabout.c: Update for building a DLL on cygwin.
- (DllMain): New function.
- * rhabout.tcl: Moved from ../ and renamed to
- rhabout.tcl.in: configure needs to tweak the shared library name.
- * rhabout.tcl.in: "New" file.
- * Makefile.in: New (template) file.
- * Makefile: Remove.
- * pkgIndex.tcl: Moved from ../ here.
diff --git a/gdb/gdbtk/plugins/rhabout/Makefile.in b/gdb/gdbtk/plugins/rhabout/Makefile.in
deleted file mode 100644
index e63e568d6f4..00000000000
--- a/gdb/gdbtk/plugins/rhabout/Makefile.in
+++ /dev/null
@@ -1,9 +0,0 @@
-# Plugin definitions
-PLUGIN = rhabout
-PLUGIN_OBJS = rhabout.$(OBJEXT)
-PLUGIN_IMAGE_BASE = 0x65000000
-PLUGIN_INSTALL_SRCDIR = rhabout.itcl
-# Comment out this to install the example plugin
-PLUGIN_INSTALL_TARGET = nothing
-
-nothing:
diff --git a/gdb/gdbtk/plugins/rhabout/pkgIndex.tcl b/gdb/gdbtk/plugins/rhabout/pkgIndex.tcl
deleted file mode 100644
index b56e703e31f..00000000000
--- a/gdb/gdbtk/plugins/rhabout/pkgIndex.tcl
+++ /dev/null
@@ -1,2 +0,0 @@
-package ifneeded RHABOUT 1.0 [list source [file join $dir rhabout.tcl]]
-
diff --git a/gdb/gdbtk/plugins/rhabout/rhabout.c b/gdb/gdbtk/plugins/rhabout/rhabout.c
deleted file mode 100644
index fd043dc355a..00000000000
--- a/gdb/gdbtk/plugins/rhabout/rhabout.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Sample command procedure library for a plug-in. */
-
-/* You have to include the Tcl headers, of course. */
-#include <tcl.h>
-
-/* Define the functions that implement your commands as required by Tcl */
-#ifdef __CYGWIN__
-# define EXPORT __declspec(dllexport)
-#else
-# define EXPORT /* nothing */
-#endif
-
-int extra_text (ClientData clientData,
- Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
-
-/* Here you actually do whatever you want, like calling your target
- libraries etc. Here we just return a string. */
-
-int
-extra_text (ClientData clientData,
- Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[])
-{
- interp->result = "\nThis is a sample plug-in\n";
- return TCL_OK;
-}
-
-/* Initialization function required in Tcl libraries. */
-
-int EXPORT
-Rhabout_Init (Tcl_Interp *interp)
-{
- /* Register your command as a Tcl command with this interpreter. */
- Tcl_CreateObjCommand (interp, "rhabout_extra_text", extra_text,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
-
- /* Register this package */
- Tcl_PkgProvide (interp, "RHABOUT", "1.0");
- return TCL_OK;
-}
-
-/* This is REQUIRED for cygwin */
-#ifdef __CYGWIN__
-#include <windows.h>
-#include <tclInt.h>
-
-struct _reent *_impure_ptr;
-extern struct _reent *_imp__reent_data;
-
-BOOL APIENTRY
-DllMain (HINSTANCE hInstance, DWORD reason, LPVOID reserved)
-{
- _impure_ptr = _imp__reent_data;
- return TRUE;
-}
-#endif
diff --git a/gdb/gdbtk/plugins/rhabout/rhabout.itcl b/gdb/gdbtk/plugins/rhabout/rhabout.itcl
deleted file mode 100644
index 02a83517dfd..00000000000
--- a/gdb/gdbtk/plugins/rhabout/rhabout.itcl
+++ /dev/null
@@ -1,87 +0,0 @@
-class RHAbout {
- inherit PluginWindow
- constructor {args} {
- global gdb_ImageDir
-
- # What about a menu?
- $menubar add menubutton file "File" 0
- $menubar add command None "Close" \
- [code $this destroy_toplevel] \
- -underline 1
- $menubar add menubutton help "Help" 0
- $menubar add command Other "Help Topics" \
- {open_help index.html} \
- -underline 0
- $menubar add separator
- $menubar add command Other "About GDB..." \
- {ManagedWin::open About -transient} \
- -underline 0
-
- # The menu only shows up if you do this:
- $menubar show
-
- # Do you want a toolbar?
- $toolbar add button con Other {ManagedWin::open Console} \
- "Console (Ctrl+N)" -image console_img
-
- # The toolbar will only show up if you do this:
- $toolbar show
-
- # Now, fill the childsite with some graphics and text
-
- # Remember to use the childsite, do not pack in the widget hull
- set f [childsite]
-
- # Put in some graphics
- label $f.image1 -bg white -image \
- [image create photo -file [file join $gdb_ImageDir insight.gif]]
-
- # Here we call an interface function provided by GDBTCL
- set text [gdb_cmd {show version}]
-
- # Here we call a command procedure that we created, if it exists
- catch {append text [rhabout_extra_text]}
-
- # Now add the text
- message $f.m -bg white -fg black -text $text -aspect 500 -relief flat
-
- # Add a status bar so we can show some dynamic information
- set _status [label $f.stat -relief sunken -bd 3 \
- -font global/status -height 1]
-
- # pack everything
- pack $f.image1 $f.m -fill both -expand yes
- pack $f.stat -expand 1 -fill both
- pack $itk_interior
-
- # Give our sample window a name
- window_name "About Red Hat Insight Plug-In"
- }
-
- # You can overload the base class busy method, but make sure
- # to call it as well or the menu and button status will not be updated
- # (unless this is what you want)
- public method busy {event} {
- debug
- # Call the baseclass version
- PluginWindow::busy $event
-
- # Display something in the status area
- $_status configure -text "Running..."
- }
-
- # You can overload the base class idle method, but make sure
- # to call it as well or the menu and button status will not be updated
- # (unless this is what you want)
- private method idle {} {
- debug
- # First call the baseclass version
- PluginWindow::idle
-
- # Display something in the status area
- $_status configure -text "Stopped."
- }
-
- # Path to the status area
- private variable _status
-}
diff --git a/gdb/gdbtk/plugins/rhabout/rhabout.tcl.in b/gdb/gdbtk/plugins/rhabout/rhabout.tcl.in
deleted file mode 100644
index 61533da7501..00000000000
--- a/gdb/gdbtk/plugins/rhabout/rhabout.tcl.in
+++ /dev/null
@@ -1,5 +0,0 @@
-package provide RHABOUT 1.0
-set dirname [file dirname [info script]]
-lappend auto_path $dirname
-set TCL_DBGX "@TCL_DBGX@" ; # needed for cygwin
-catch {load [file join $dirname rhabout@TCL_SHLIB_SUFFIX@]}
diff --git a/gdb/gdbtk/plugins/rhabout/tclIndex b/gdb/gdbtk/plugins/rhabout/tclIndex
deleted file mode 100644
index 6a7b8a87329..00000000000
--- a/gdb/gdbtk/plugins/rhabout/tclIndex
+++ /dev/null
@@ -1,9 +0,0 @@
-# Tcl autoload index file, version 2.0
-# This file is generated by the "auto_mkindex" command
-# and sourced to set up indexing information for one or
-# more commands. Typically each line is a command that
-# sets an element in the auto_index array, where the
-# element name is the name of a command and the value is
-# a script that loads the command.
-
-set auto_index(RHAbout) [list source [file join $dir rhabout.itcl]]
diff --git a/gold/ChangeLog b/gold/ChangeLog
deleted file mode 100644
index 9b491a2f35e..00000000000
--- a/gold/ChangeLog
+++ /dev/null
@@ -1,1884 +0,0 @@
-2008-08-04 Ian Lance Taylor <iant@google.com>
-
- * symtab.h (Symbol::use_plt_offset): New function.
- * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
- * powerpc.cc (Relocate::relocate): Likewise.
- * sparc.cc (Relocate::relocate): Likewise.
- * x86_64.cc (Relocate::relocate): Likewise.
- * testsuite/weak_plt.sh: New test.
- * testsuite/weak_plt_main.cc: New test.
- * testsuite/weak_plt_shared.cc: New test.
- * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
- (check_PROGRAMS): Add weak_plt.
- (check_DATA): Add weak_plt_shared.so.
- (weak_plt_main_pic.o, weak_plt): New targets.
- (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
- * testsuite/Makefile.in: Rebuild.
-
- * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
- gcctestdir/ld.
- (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
- * testsuite/Makefile.in: Rebuild.
-
-2008-08-04 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am (POTFILES.in): Set LC_ALL=C.
- * Makefile.in: Regenerate.
- * po/POTFILES.in: Regenerate.
-
-2008-07-29 Ian Lance Taylor <iant@google.com>
-
- * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
- symbols before other symbols.
- * testsuite/script_test_2.cc (test_addr): Declare.
- (test_addr_alias): Declare.
- (main): Check that test_addr and test_addr_alias have the right
- values.
- * testsuite/script_test_2.t: Define test_addr_alias and
- test_addr.
-
-2008-07-24 Ian Lance Taylor <iant@google.com>
-
- PR 5990
- * descriptors.cc: New file.
- * descriptors.h: New file.
- * gold-threads.h (class Hold_optional_lock): New class.
- * fileread.cc: Include "descriptors.h".
- (File_read::~File_read): Release descriptor rather than closing
- it.
- (File_read::open) [file]: Call open_descriptor rather than open.
- Set is_descriptor_opened_.
- (File_read::open) [memory]: Assert that descriptor is not open.
- (File_read::reopen_descriptor): New function.
- (File_read::release): Release descriptor.
- (File_read::do_read): Make non-const. Reopen descriptor.
- (File_read::read): Make non-const.
- (File_read::make_view): Reopen descriptor.
- (File_read::do_readv): Likewise.
- * fileread.h (class File_read): Add is_descriptor_opened_ field.
- Update declarations.
- * layout.cc: Include "descriptors.h".
- (Layout::create_build_id): Use open_descriptor rather than open.
- * output.cc: Include "descriptors.h".
- (Output_file::open): Use open_descriptor rather than open.
- * archive.cc (Archive::const_iterator): Change Archive to be
- non-const.
- (Archive::begin, Archive::end): Make non-const.
- (Archive::count_members): Likewise.
- * archive.h (class Archive): Update declarations.
- * object.h (Object::read): Make non-const.
- * Makefile.am (CCFILES): Add descriptors.cc.
- (HFILES): Add descriptors.h.
- * Makefile.in: Rebuild.
-
- PR 6716
- * gold.h: Always include <clocale>. Add Solaris workarounds
- following code in binutils/sysdep.h.
-
- PR 6048
- * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
- this->eh_frame_hdr_ is NULL before using it.
-
- * dynobj.cc (Versions::Versions): Update comment.
-
- * dynobj.cc (Versions::Versions): If there is an soname, use it as
- the base version name.
-
- * stringpool.cc (Stringpool_template::add_with_length): Set key to
- array size plus one.
- (Stringpool_template::set_string_offsets): Subtract one from key
- before using it as an array index.
- (Stringpool_template::get_offset_with_length): Likewise.
- (Stringpool_template::write_to_buffer): Likewise.
- * stringpool.h (Stringpool_template::get_offset_from_key):
- Likewise.
-
-2008-07-23 Ian Lance Taylor <iant@google.com>
-
- PR 6658
- * object.h (Merged_symbol_value::value): Do our best to handle a
- negative addend.
-
- PR 6647
- * script.cc (Version_script_info::get_versions): Don't add empty
- version tag to return value.
- (Version_script_info::get_symbol_version_helper): Change return
- type to bool. Add pversion parameter. Change all callers.
- (script_register_vers_node): Don't require a non-NULL tag.
- * script.h (class Version_script_info): Update declarations.
- (Version_script_info::get_symbol_version): Change return type to
- bool. Add version parameter. Change all callers.
- * symtab.cc (Sized_symbol::add_from_relobj): Rework version
- handling. Handle an empty version from a version script.
- (Symbol_table::define_special_symbol): Likewise.
- * testsuite/ver_test_10.script: New file.
- * testsuite/ver_test_10.sh: New file.
- * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
- (check_DATA): Add ver_test_10.syms.
- (ver_test_10.syms, ver_test_10.so): New target.
- * testsuite/Makefile.in: Rebuild.
-
-2008-07-23 Simon Baldwin <simonb@google.com>
-
- * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
- to zero for undefined symbols from dynamic libraries.
-
-2008-07-23 Ian Lance Taylor <iant@google.com>
-
- * symtab.cc (Symbol_table::resolve): Remove version parameter.
- Change all callers.
- * symtab.h (class Symbol_table): Update declaration.
- * testsuite/ver_test_9.cc: New file.
- * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
- (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
- (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
- (ver_test_9.so, ver_test_9.o): New targets.
- * testsuite/Makefile.in: Rebuild.
-
-2008-07-22 Ian Lance Taylor <iant@google.com>
-
- * options.h (class General_options): Define --check-sections.
- * layout.cc (Layout::set_segment_offsets): Handle
- --check-sections.
-
- * options.h (class General_options): Define -n/--nmagic and
- -N/--omagic.
- * options.cc (General_options::finalize): For -n/--nmagic or
- -N/--omagic, set -static.
- * layout.cc (Layout::attach_allocated_section_to_segment): If
- -N/--omagic, don't put read-only and read-write sections in
- different segments.
- (Layout::find_first_load_seg): If -N/--omagic, don't insist on
- finding a read-only segment.
- (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
- don't set the minimum segment alignment to the common page size,
- and don't set the file offset to the address modulo the page size.
- * script-sections.cc (Script_sections::create_segments): If
- -n/--omagic, don't put read-only and read-write sections in
- different segments.
-
- * cref.cc: New file.
- * cref.h: New file.
- * options.h (class General_options): Add --print-symbol-counts.
- * main.cc (main): Issue defined symbol report if requested.
- * archive.cc (Archive::interpret_header): Make into a const member
- function.
- (Archive::add_symbols): Call Input_objects::archive_start and
- archive_stop.
- (Archive::const_iterator): Define new class.
- (Archive::begin, Archive::end): New functions.
- (Archive::include_all_members): Rewrite to use iterator.
- (Archive::count_members): New function.
- * archive.h (class Archive): Update declarations.
- (Archive::filename): New function.
- * object.cc: Include "cref.h".
- (Sized_relobj::Sized_relobj): Initialize defined_count_.
- (Sized_relobj::do_get_global_symbol_counts): New function.
- (Input_objects::add_object): Add object to cross-referencer.
- (Input_objects::archive_start): New function.
- (Input_objects::archive_stop): New function.
- (Input_objects::print_symbol_counts): New function.
- * object.h: Declare Cref and Archive.
- (Object::get_global_symbol_counts): New function.
- (Object::do_get_global_symbol_counts): New pure virtual function.
- (class Sized_relobj): Add defined_count_ field. Update
- declarations.
- (class Input_objects): Add cref_ field. Update constructor.
- Update declarations.
- * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
- defined_count_.
- (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
- symbol counts.
- (Sized_dynobj::do_get_global_symbol_counts): New function.
- * dynobj.h (class Sized_dynobj): Add fields symbols_ and
- defined_count_. Update declarations. Define Symbols typedef.
- * symtab.cc (Symbol_table::add_from_relobj): Add defined
- parameter. Change all callers.
- (Symbol_table::add_from_dynobj): Add sympointers and defined
- parameters. Change all callers.
- * symtab.h (class Symbol_table): Update declarations.
- * Makefile.am (CCFILES): Add cref.cc.
- (HFILES): Add cref.h.
- * Makefile.in: Rebuild.
-
-2008-07-22 Simon Baldwin <simonb@google.com>
-
- * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
- to zero when writing undefined symbols.
-
-2008-07-22 Ian Lance Taylor <iant@google.com>
-
- * output.cc (Output_section::add_input_section): Don't try to
- merge empty merge sections.
-
-2008-07-21 Craig Silverstein <csilvers@google.com>
-
- * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
- Include symbol version in error message.
-
-2008-07-20 Chris Demetriou <cgd@google.com>
-
- * configure.ac (gold_cv_c_random_seed): New configured variable.
- (RANDOM_SEED_CFLAGS): New substituted variable.
- * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
- * configure: Rebuild.
- * Makefile.in: Likewise.
- * testsuite/Makefile.in: Likewise.
-
-2008-07-18 Ian Lance Taylor <iant@google.com>
-
- * symtab.cc (Symbol_table::add_from_object): Rewrite the case
- where we see NAME/NULL and NAME/VERSION as separate symbols.
- * testsuite/ver_test_main.cc (main): Call t4.
- (t4, t4_2a): Define.
- * testsuite/ver_test_2.cc (t4_2): Define.
- * testsuite/ver_test_2.script: Put t4_2a in VER2.
- * testsuite/ver_test_4.cc (t4_2a): Define.
- * testsuite/ver_test_4.script: Put t4_2a in VER2.
- * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
-
-2008-07-17 Ian Lance Taylor <iant@google.com>
-
- * dynobj.cc (Versions::add_def): If we give an error about a
- missing version, go ahead and create the version anyhow.
-
-2008-07-10 Ian Lance Taylor <iant@google.com>
-
- Handle output sections with more than 0x7fffffff bytes.
- * object.h (class Relobj): Change map_to_output_ to
- output_sections_, and just keep a section pointer. Change all
- uses. Move comdat group support to Sized_relobj.
- (Relobj::is_section_specially_mapped): Remove.
- (Relobj::output_section): Remove poff parameter. Change all
- callers.
- (Relobj::output_section_offset): New function.
- (Relobj::set_section_offset): Rewrite.
- (Relobj::map_to_output): Remove.
- (Relobj::output_sections): New function.
- (Relobj::do_output_section_offset): New pure virtual function.
- (Relobj::do_set_section_offset): Likewise.
- (class Sized_relobj): Add section_offsets_ field. Add comdat
- group support from Relobj. Update declarations.
- (Sized_relobj::get_output_section_offset): New function.
- (Sized_relobj::do_output_section_offset): New function.
- (Sized_relobj::do_set_section_offset): New function.
- * object.cc (Relobj::output_section_address): Remove.
- (Sized_relobj::Sized_relobj): Initialize new fields.
- (Sized_relobj::include_section_group): Cast find_kept_object to
- Sized_relobj.
- (Sized_relobj::include_linkonce_section): Likewise.
- (Sized_relobj::do_layout): Use separate arrays for output section
- and output offset.
- (Sized_relobj::do_count_local_symbols): Change map_to_output to
- output_sections.
- (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
- output_sections and section_offsets.
- (Sized_relobj::write_local_symbols): Likewise.
- (map_to_kept_section): Compute output address directly.
- * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
- output_sections and section_offsets.
- (Sized_relobj::write_sections): Likewise.
- (Sized_relobj::relocate_sections): Likewise.
- * symtab.cc (sized_finalize_symbol): Use output_section_offset.
- * output.h (class Output_reloc): Update declarations. Change
- u2_.relobj to Sized_relobj*.
- (class Output_data_reloc): Change add functions to use
- Sized_relobj*.
- * output.cc (Output_reloc::Output_reloc): Change relobj to
- Sized_relobj*.
- (Output_reloc::local_section_offset): Change return type to
- Elf_Addr. Use get_output_section_offset.
- (Output_reloc::get_address): Likewise.
- (Output_section::is_input_address_mapped): Don't call
- is_section_specially_mapped.
- (Output_section::output_offset): Likewise.
- (Output_section::output_address): Likewise.
- (Output_section::starting_output_address): Likewise.
- * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
- parameter to Sized_relobj*.
- (Copy_relocs::need_copy_reloc): Likewise.
- (Copy_relocs::save): Likewise.
- * copy-relocs.h (class Copy_relocs): Update declarations.
- (class Copy_relocs::Copy_reloc_entry): Change constructor to use
- Sized_relobj*. Change relobj_ field to Sized_relobj*.
- * target-reloc.h (relocate_for_relocatable): Change
- offset_in_output_section type to Elf_Addr. Change code that uses
- it as well.
- * layout.cc (Layout::layout): Always set *off.
- * mapfile.cc (Mapfile::print_input_section): Use
- output_section_offset.
- * i386.cc (Target_i386::copy_reloc): Change object parameter to
- Sized_relobj*.
- * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
- * sparc.cc (Target_sparc::copy_reloc): Likewise.
- * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
-
-2008-07-03 Ian Lance Taylor <iant@google.com>
-
- * layout.cc (Layout::include_section): Do not discard unrecognized
- SHT_STRTAB sections.
-
-2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
-
- * script.cc (Lex::can_continue_name): Make '?' allowable in
- version-script names.
- * testsuite/version_script.map: Change glob pattern to use '?'
-
-2008-06-30 Manish Singh <yosh@gimp.org>
-
- PR 6585
- * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
- Correct typo.
-
-2008-06-30 Ian Lance Taylor <iant@google.com>
-
- PR 6660
- PR 6682
- * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
- versions]: Don't try to read the value in the contents, since we
- don't use it. Use the template endianness when writing.
-
-2008-06-25 Cary Coutant <ccoutant@google.com>
-
- * fileread.cc (File_read::make_view): Assert on zero-length view.
- * object.cc (Sized_relobj::do_read_symbols): Don't try to read
- symbol table when there are no symbols to read.
-
-2008-06-23 Craig Silverstein <csilvers@google.com>
-
- * version.cc (version_string): Bump to 1.7
-
-2008-06-18 Craig Silverstein <csilvers@google.com>
-
- * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
- constant 0xFFFF to type Valtype.
- (Powerpc_relocate_functions::rel16_ha): Likewise.
-
-2008-06-17 Ian Lance Taylor <iant@google.com>
-
- * output.h (Output_section::Input_section): Initialize p2align_ to
- zero for Output_section_data constructors.
- (Output_section::Input_section::addralign): If not an input
- section, return the alignment of the Output_section_data.
- * testsuite/copy_test.cc: New file.
- * testsuite/copy_test_1.cc: New file.
- * testsuite/copy_test_2.cc: New file.
- * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
- (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
- (copy_test_LDFLAGS, copy_test_LDADD): New variables.
- (copy_test_1_pic.o, copy_test_1.so): New targets.
- (copy_test_2_pic.o, copy_test_2.so): New targets.
- * testsuite/Makefile.in: Rebuild.
-
- * script-sections.cc (Script_sections::place_orphan): Initialize
- local variable exact.
-
-2008-06-13 David Edelsohn <edelsohn@gnu.org>
-
- * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
-
-2008-06-12 David Edelsohn <edelsohn@gnu.org>
- David S. Miller <davem@davemloft.net>
-
- * powerpc.cc: New file.
- * Makefile.am (TARGETSOURCES): Add powerpc.cc
- (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
- * configure.tgt: Add entries for powerpc-* and powerpc64-*.
- * Makefile.in: Rebuild.
-
-2008-06-09 Ian Lance Taylor <iant@google.com>
-
- * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
- <exception>.
- (throwing, orig_terminate): New static variables.
- (terminate_handler): New static function.
- (t2): Set terminate handler.
-
-2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
-
- PR 6584
- * binary.cc (Binary_to_elf::sized_convert): Fix .data
- alignment.
-
-2008-05-30 Cary Coutant <ccoutant@google.com>
-
- * archive.cc (Archive::include_all_members) Correct to step
- over symbol table and extended name table in thin archives.
-
-2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
-
- PR 6407
- * target-reloc.h (relocate_for_relocatable): Fix new_offset
- calculation.
-
-2008-05-28 Caleb Howe <cshowe@google.com>
-
- * reduced_debug_output.cc: New file.
- * reduced_debug_output.h: New file.
- * options.h (class General_options): Add --strip-debug-non-line.
- * options.cc (General_options::finalize): Add strip_debug_non_line
- to the strip heirarchy.
- * layout.h (class Layout): Add debug_abbrev_ and debug_info_
- fields.
- * layout.cc: Include "reduced_debug_output.h".
- (Layout::Layout): Initialize new fields.
- (line_only_debug_sections): New static array.
- (is_lines_only_debug_sections): New static inline function.
- (Layout::include_section): Handle --strip-debug-non-line.
- (Layout::make_output_section): If --strip-debug-non-line, build
- new output sections for .debug_abbrev and .debug_info.
- * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
- gold. Warn about possible overflow.
- (read_signed_LEB_128): Likewise.
- * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
- (read_signed_LEB_128): Declare.
- * Makefile.am (CCFILES): Add reduced_debug_output.cc.
- (HFILES): Add reduced_debug_output.h.
- * Makefile.in: Rebuild.
-
-2008-05-21 Ian Lance Taylor <iant@google.com>
-
- * mapfile.cc: New file.
- * mapfile.h: New file.
- * options.h (class General_options): Add -M/--print-map and -Map.
- * options.cc (General_options::finalize): Make -M equivalent to
- -Map -.
- * main.cc: Include <cstdio> and "mapfile.h".
- (main): Open mapfile if requested.
- * gold.cc (class Middle_runner): Add mapfile_ field. Update
- constructor. Change caller.
- (queue_initial_tasks): Add mapfile parameter. Change caller.
- (queue_middle_tasks): Likewise.
- * gold.h (queue_initial_tasks, queue_middle_tasks): Update
- declarations.
- * archive.cc: Include "mapfile.h".
- (Archive::add_symbols): Add mapfile parameter. Change all
- callers. Pass mapfile, symbol, and reason to include_member.
- (Archive::include_all_members): Add mapfile parameter. Change all
- callers.
- (Archive::include_member): Add mapfile, sym, and why parameters.
- Change all callers. Report inclusion to map file.
- * archive.h: Include "fileread.h".
- (class Archive): Update declarations.
- (Archive::file): New const method.
- (class Add_archive_symbols): Add mapfile_ field. Update
- constructor. Change all callers.
- * readsyms.h (class Read_symbols): Likewise.
- (class Finish_group): Likewise.
- (class Read_script): Likewise.
- * common.cc: Include "mapfile.h".
- (Symbol_table::allocate_commons): Add mapfile parameter. Change
- all callers.
- (Symbol_table::do_allocate_commons): Likewise.
- (Symbol_table::do_allocate_commons_list): Likewise. Report common
- symbol allocation to mapfile.
- * common.h (class Allocate_commons_task): Add mapfile_ field.
- Update constructor. Change all callers.
- * symtab.h (class Symbol_table): Update declarations.
- * layout.cc: Include "mapfile.h".
- (Layout_task_runner::run): Print information to mapfile.
- (Layout::create_gold_note): Change Output_data_fixed_space to
- Output_data_zero_fill.
- (Layout::create_build_id): Likewise.
- (Layout::print_to_mapfile): New function.
- * layout.h (class Layout_task_runner): Add mapfile_ field. Update
- constructor. Change caller.
- (class Layout): Declare print_to_mapfile.
- * output.cc (Output_section::Input_section::print_to_mapfile): New
- function.
- (Output_section::add_input_section): If producing a map, always
- add to input_sections_ list.
- (Output_section::do_print_to_mapfile): New function.
- (Output_segment::print_sections_to_mapfile): New function.
- (Output_segment::print_section_list_to_mapfile): New function.
- * output.h: Include "mapfile.h".
- (Output_data::print_to_mapfile): New function.
- (Output_data::do_print_to_mapfile): New virtual function.
- (Output_segment_headers::do_print_to_mapfile): New function.
- (Output_file_header::do_print_to_mapfile): New function.
- (Output_data_const::do_print_to_mapfile): New function.
- (class Output_data_const_buffer): Add map_name_ field. Update
- constructor. Change all callers. Add do_print_to_mapfile
- function.
- (class Output_data_fixed_space): Likewise.
- (class Output_data_space): Likewise.
- (class Output_data_zero_fill): New class.
- (Output_data_strtab::do_print_to_mapfile): New function.
- (Output_data_reloc_base::do_print_to_mapfile): New function.
- (Output_relocatable_relocs::do_print_to_mapfile): New function.
- (Output_data_group::do_print_to_mapfile): New function.
- (Output_data_got::do_print_to_mapfile): New function.
- (Output_data_dynamic::do_print_to_mapfile): New function.
- (Output_symtab_xindex::do_print_to_mapfile): New function.
- (class Output_section): Declare do_print_to_mapflie. Declare
- print_to_mapfile in Input_section.
- (class Output_segment): Declare new functions.
- * object.h (Sized_relobj::symbol_count): New function.
- * script-sections.cc
- (Output_section_element_dot_assignment::set_section_addresses):
- Change Output_data_fixed_space to Output_data_zero_fill.
- (Output_data_expression::do_print_to_mapfile): New function.
- * script.cc (read_input_script): Add mapfile parameter. Change
- all callers.
- * script.h (read_input_script): Update declaration.
- * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
- (Eh_frame::do_print_to_mapfile): New function.
- * merge.h (Output_merge_data::do_print_to_mapfile): New function.
- (Output_merge_string::do_print_to_mapfile): New function.
- * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
- function.
- * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
- function.
- * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
- function.
- * Makefile.am (CCFILES): Add mapfile.cc.
- (HFILES): Add mapfile.h.
- * Makefile.in: Rebuild.
-
-2008-05-19 Ian Lance Taylor <iant@google.com>
-
- * options.h (class General_options): Add -z relro.
- * layout.cc (Layout::Layout): Initialize relro_segment_.
- (Layout::add_output_section_data): Return the output section.
- (Layout::make_output_section): Rcognize relro sections and mark
- them appropriately.
- (Layout::attach_allocated_section_to_segment): Put relro sections
- in a PT_GNU_RELRO segment.
- (Layout::create_initial_dynamic_sections): Mark the .dynamic
- section as relro.
- (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
- PT_TLS segments.
- (Layout::linkonce_mapping): Map d.rel.ro.local to
- .data.rel.ro.local.
- (Layout::output_section_name): Us .data.rel.ro.local for any
- section which begins with that.
- * layout.h (class Layout): Update add_output_section_data
- declaration. Add relro_segment_ field.
- * output.cc (Output_section::Output_section): Initialize is_relro_
- and is_relro_local_ fields.
- (Output_segment::add_output_section): Group relro sections.
- (Output_segment::is_first_section_relro): New function.
- (Output_segment::maximum_alignment): If there is a relro section,
- align the segment to the common page size.
- (Output_segment::set_section_addresses): Track whether we are
- looking at relro sections. If the last section is a relro
- section, align to the common page size.
- (Output_segment::set_section_list_addresses): Add in_relro
- parameter. Change all callers. Align to the page size when
- moving from relro to non-relro section.
- (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
- segment.
- * output.h (class Output_section): Add is_relro_ and
- is_relro_local_ fields.
- (Output_section::is_relro): New function.
- (Output_section::set_is_relro): New function.
- (Output_section::is_relro_local): New function.
- (Output_section::set_is_relro_local): New function.
- (class Output_segment): Update declarations.
- * i386.cc (Target_i386::got_section): Mark .got section as relro.
- * sparc.cc (Target_sparc::got_section): Likewise.
- * x86_64.cc (Target_x86_64::got_section): Likewise.
- * testsuite/relro_test_main.cc: New file.
- * testsuite/relro_test.cc: New file.
- * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
- (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
- (relro_test_LDFLAGS, relro_test_LDADD): New variables.
- (relro_test.so, relro_test_pic.o): New targets.
- * testsuite/Makefile.in: Rebuild.
-
-2008-05-16 Ian Lance Taylor <iant@google.com>
-
- * output.cc (Output_segment::add_output_section): Remove front
- parameter.
- * output.h (class Output_segment): Remove
- add_initial_output_section and overloaded add_output_section.
- Update declaration of remaining add_output_section.
- * layout.cc (Layout::create_interp): Call add_output_section
- rather than add_initial_output_section.
- (Layout::finish_dynamic_section): Likewise.
-
- * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
- for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
- know the dynamic type.
- * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
- field. Initialize it in constructor.
- (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
- block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
- Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
- reloc.
-
- * output.cc (Output_reloc::get_address): Change return type to
- Elf_Addr.
- * output.h (class Output_reloc): Update get_address declaration.
- * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
- for section addresses.
-
-2008-05-09 Ian Lance Taylor <iant@google.com>
-
- PR 6493
- * gold.cc (gold_nomem): Use return value of write.
-
-2008-05-08 Ian Lance Taylor <iant@google.com>
-
- * symtab.c (Symbol::init_base_output_data): Add version
- parameter. Change all callers.
- (Symbol::init_base_output_segment): Likewise.
- (Symbol::init_base_constant): Likewise.
- (Symbol::init_base_undefined): Likewise.
- (Sized_symbol::init_output_data): Likewise.
- (Sized_symbol::init_output_segment): Likewise.
- (Sized_symbol::init_constant): Likewise.
- (Sized_symbol::init_undefined): Likewise.
- (Symbol_table::do_define_in_output_data): If the new symbol has a
- version, mark it as the default.
- (Symbol_table::do_define_in_output_segment): Likewise.
- (Symbol_table::do_define_as_constant): Likewise.
- * symtab.h (class Symbol): Update declarations.
- (class Sized_symbol): Likewise.
- * resolve.cc (Symbol::override_version): New function.
- (Symbol::override_base): Call override_version.
- (Symbol::override_base_with_special): Likewise.
- * testsuite/ver_script_8.script: New file.
- * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
- (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
- (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
- (ver_test_8_1.so, ver_test_8_2.so): New targets.
-
-2008-05-06 Ian Lance Taylor <iant@google.com>
-
- PR 6049
- * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
- functions.
- (class General_options): Remove existing --undefined, and add
- --no-undefined instead. Add new --undefined as synonym for -u.
- * archive.cc (Archive::add_symbols): Check whether symbol was
- named with -u.
- * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
- * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
- all uses. Add IS_UNDEFINED. Update declarations to split
- different versions of init_base. Declare init_base_undefined.
- (Symbol::is_defined): Handle IS_UNDEFINED.
- (Symbol::is_undefined): Likewise.
- (Symbol::is_weak_undefined): Call is_undefined.
- (Symbol::is_absolute): Handle IS_CONSTANT.
- (class Sized_symbol): Update declarations to split different
- versions of init. Declare init_undefined.
- (class Symbol_table): Declare new functions.
- * symtab.cc (Symbol::init_base_object): Rename from init_base.
- Change all callers.
- (Symbol::init_base_output_data): Likewise.
- (Symbol::init_base_output_segment): Likewise.
- (Symbol::init_base_constant): Likewise.
- (Symbol::init_base_undefined): New function.
- (Sized_symbol::init_object): Rename from init. Change all
- callers.
- (Sized_symbol::init_output_data): Likewise.
- (Sized_symbol::init_output_segment): Likewise.
- (Sized_symbol::init_constant): Likewise.
- (Sized_symbol::init_undefined): New function.
- (Symbol_table::add_undefined_symbols_from_command_line): New
- function.
- (Symbol_table::do_add_undefined_symbols_from_command_line): New
- function.
- (Symbol::final_value_is_known): Handle IS_UNDEFINED.
- (Symbol::output_section): Likewise.
- (Symbol::set_output_section): Likewise.
- (Symbol_table::sized_finalize_symbol): Likewise.
- (Symbol_table::sized_write_globals): Likewise.
- * resolve.cc (Symbol_table::should_override): Likewise.
- (Symbol::override_base_with_special): Likewise.
-
- * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
- symbol, change it to have default visibility.
- * testsuite/protected_1.cc: New file.
- * testsuite/protected_2.cc: New file.
- * testsuite/protected_3.cc: New file.
- * testsuite/protected_main_1.cc: New file.
- * testsuite/protected_main_2.cc: New file.
- * testsuite/protected_main_3.cc: New file.
- * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
- (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
- (protected_1_LDFLAGS, protected_1_LDADD): Define.
- (protected_1.so): New target.
- (protected_1_pic.o, protected_2_pic.o): New targets.
- (protected_3_pic.o): New target.
- (check_PROGRAMS): Add protected_2.
- (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
- (protected_2_LDFLAGS, protected_2_LDADD): Define.
- * testsuite/Makefile.in: Rebuild.
-
- * options.h (DEFINE_var): Add set_user_set_##varname__.
- (DEFINE_bool_alias): New macro.
- (class General_options): Define -Bstatic using DEFINE_bool_alias
- rather than DEFINE_special. Add --undefined as an alias for -z
- defs.
- * options.cc (General_options::parse_Bstatic): Remove.
-
- * options.h (class General_options): Add --fatal-warnings.
- * main.cc (main): Implement --fatal-warnings.
- * errors.h (Errors::warning_count): New function.
-
- * options.h (class General_options): Add -Bsymbolic-functions.
- * symtab.h (Symbol::is_preemptible): Check for
- -Bsymbolic-functions.
-
-2008-05-05 Ian Lance Taylor <iant@google.com>
-
- * options.h (DEFINE_bool): For DASH_Z, create the negative option
- as noVARNAME rather than no-VARNAME.
- (class General_options): Add option -z combreloc.
- * output.h (class Output_reloc) [SHT_REL]: Declare compare and
- get_address.
- (Output_reloc::sort_before) [SHT_REL]: New function.
- (Output_reloc::sort_before) [SHT_RELA]: New function.
- (class Output_data_reloc_base): Add sort_relocs_ field. Define
- Sort_relocs_comparison.
- (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
- parameter. Change all callers.
- (Output_data_reloc::Output_data_reloc) [both versions]: Add
- sort_relocs parameter. Change all callers.
- * output.cc (Output_reloc::get_address): New function, broken out
- of write_rel.
- (Output_reloc::write_rel): Call it.
- (Output_reloc::compare): New function.
- (Output_data_reloc_base::do_write): Optionally sort relocs.
-
- * configure.ac: If targ_extra_obj is set, link it in.
- * configure.tgt: Initialize all variables.
- (x86_64*): Set targ_extra_obj and targ_extra_size.
- * configure: Rebuild.
-
- * object.cc (Sized_relobj::include_section_group): Adjust section
- indexes read from group data. Build vector to pass to
- layout_group.
- * layout.cc (Layout::layout_group): Add flags and shndxes
- parameters. Remove contents parameter. Change caller. Update
- explicit instantiations.
- * layout.h (class Layout): Update layout_group declaration.
- * output.cc (Output_data_group::Output_data_group): Add flags and
- input_shndxes parameters. Remove contents parameter. Change
- caller.
- (Output_data_group::do_write): Change input_sections_ to
- input_shndxes_.
- * output.h (class Output_data_group): Update constructor
- declaration. Rename input_sections_ to input_shndxes_.
- * testsuite/many_sections_test.cc: Add template.
-
-2008-04-30 Cary Coutant <ccoutant@google.com>
-
- * target-reloc.h (relocate_section): Fix dead-pointer bug.
-
- * layout.cc (Layout::include_section): Refactored check for debug
- info section.
- (Layout::add_comdat): Add new parameters. Change type
- of signature parameter. Add object and shndx to signatures table.
- (Layout::find_kept_object): New function.
- * layout.h: Include <cstring>.
- (Layout::is_debug_info_section): New function.
- (Layout::add_comdat): Add new parameters.
- (Layout::find_kept_object): New function.
- (Layout::Kept_section): New struct.
- (Layout::Signatures): Change type of map range.
- * object.cc (Relobj::output_section_address): New function.
- (Sized_relobj::include_section_group): Add new parameters. Change
- calls to Layout::add_comdat. Change to build table of kept comdat
- groups and table mapping discarded sections to kept sections.
- (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
- (Sized_relobj::do_layout): Change calls to include_section_group and
- include_linkonce_section.
- (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
- value to zero when section is discarded.
- (Sized_relobj::map_to_kept_section): New function.
- * object.h (Relobj::output_section_address): New function.
- (Relobj::Comdat_group): New type.
- (Relobj::find_comdat_group): New function.
- (Relobj::Comdat_group_table): New type.
- (Relobj::Kept_comdat_section): New type.
- (Relobj::Kept_comdat_section_table): New type.
- (Relobj::add_comdat_group): New function.
- (Relobj::set_kept_comdat_section): New function.
- (Relobj::get_kept_comdat_section): New function.
- (Relobj::comdat_groups_): New field.
- (Relobj::kept_comdat_sections_): New field.
- (Symbol_value::input_value): Update comment.
- (Sized_relobj::map_to_kept_section) New function.
- (Sized_relobj::include_linkonce_section): Add new parameter.
- * target-reloc.h (Comdat_behavior): New type.
- (get_comdat_behavior): New function.
- (relocate_section): Add code to map a discarded section to the
- corresponding kept section when applying a relocation.
-
-2008-04-30 Craig Silverstein <csilvers@google.com>
-
- * dwarf_reader.cc (next_generation_count): New static var.
- (Addr2line_cache_entry): New struct.
- (addr2line_cache): New static var.
- (Dwarf_line_info::one_addr2line): Added caching.
- (Dwarf_line_info::clear_addr2line_cache): New function.
- * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
- cache-size parameter.
- (Dwarf_line_info::one_addr2line_cache): New function.
- * symtab.cc (Symbol_table::detect_odr_violations): Pass
- new cache-size argument to one_addr2line(), and clear cache.
-
-2008-04-28 Cary Coutant <ccoutant@google.com>
-
- * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
- R_386_PC8 relocations.
-
-2008-04-23 Ian Lance Taylor <iant@google.com>
-
- * object.cc (Sized_relobj::include_section_group): Check for
- invalid section group.
-
- * object.cc (make_elf_object): Correct test for 64-bit ELF file
- header size.
-
- * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
- than read for file header.
- * archive.cc (Archive::include_member): Likewise.
-
-2008-04-23 Paolo Bonzini <bonzini@gnu.org>
-
- * aclocal.m4: Regenerate.
- * configure: Regenerate.
-
-2008-04-19 Ian Lance Taylor <iant@google.com>
-
- * version.cc (version_string): Bump to 1.6.
-
- * testsuite/Makefile.am (many_sections_r_test): New target.
- (many_sections_r_test_SOURCES): Remove.
- (many_sections_r_test_DEPENDENCIES): Remove.
- (many_sections_r_test_LDFLAGS): Remove.
- (many_sections_r_test_LDADD): Remove.
-
- * object.cc (Sized_relobj::do_add_symbols): Always pass
- local_symbol_count_ to add_from_relobj.
-
- * testsuite/Makefile.am (many_sections_check.h): Only check one in
- every thousand variables.
- * testsuite/Makefile.in: Rebuild.
-
- * object.cc (Xindex::initialize_symtab_xindex): New function.
- (Xindex::read_symtab_xindex): New function.
- (Xindex::sym_xindex_to_shndx): New function.
- (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
- available.
- (Sized_relobj::do_initialize_xindex): New function.
- (Sized_relobj::do_read_symbols): Adjust section links.
- (Sized_relobj::symbol_section_and_value): Add is_ordinary
- parameter. Change all callers.
- (Sized_relobj::include_section_group): Adjust section links and
- symbol section indexes.
- (Sized_relobj::do_layout): Adjust section links.
- (Sized_relobj::do_count_local_symbols): Adjust section links and
- symbol section indexes.
- (Sized_relobj::do_finalize_local_symbols): Distinguish between
- ordinary and special symbols.
- (Sized_relobj::write_local_symbols): Add symtab_xindex and
- dynsym_xindex parameters. Change all callers. Adjust section
- links. Use SHN_XINDEX when needed.
- (Sized_relobj::get_symbol_location_info): Adjust section links.
- Don't get fooled by special symbols.
- * object.h (class Xindex): Define.
- (class Object): Add xindex_ parameter. Declare virtual functoin
- do_initialize_xindex.
- (Object::adjust_sym_shndx): New function.
- (Object::set_xindex): New protected function.
- (class Symbol_value): Add is_ordinary_shndx_ field.
- (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
- (Symbol_value::value): Assert ordinary section.
- (Symbol_value::initialize_input_to_output_map): Likewise.
- (Symbol_value::set_input_shndx): Add is_ordinary parameter.
- Change all callers.
- (Symbol_value::input_shndx): Add is_ordinary parameter. Change
- all callers.
- (class Sized_relobj): Update declarations.
- (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
- parameter. Change all callers.
- (Sized_relobj::adjust_shndx): New function.
- * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
- field.
- (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
- parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
- for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
- (Sized_dynobj::read_dynsym_section): Adjust section links.
- (Sized_dynobj::read_dynamic): Likewise.
- (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
- section links.
- (Sized_dynobj::do_initialize_xindex): New function.
- * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
- do_initialize_xindex.
- (Sized_dynobj::adjust_shndx): New function.
- * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
- dynsym_xindex_ fields.
- (Layout::finalize): Add a call to set_section_indexes before
- creating the symtab sections.
- (Layout::set_section_indexes): Don't do anything if the section
- already has a section index.
- (Layout::create_symtab_sections): Add shnum parameter. Change
- caller. Create .symtab_shndx section if needed.
- (Layout::create_shdrs): Add shstrtab_section parameter. Change
- caller.
- (Layout::allocated_output_section_count): New function.
- (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
- needed.
- * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
- fields. Update declarations.
- (Layout::symtab_xindex): New function.
- (Layout::dynsym_xindex): New function.
- (class Write_symbols_task): Add layout_ field.
- (Write_symbols_task::Write_symbols_task): Add layout parameter.
- Change caller.
- * output.cc (Output_section_headers::Output_section_headers): Add
- shstrtab_section parameter. Change all callers.
- (Output_section_headers::do_sized_write): Store overflow values
- for section count and section string table section index in
- section header zero.
- (Output_file_header::do_sized_write): Check for overflow of
- section count and section string table section index.
- (Output_symtab_xindex::do_write): New function.
- (Output_symtab_xindex::endian_do_write): New function.
- * output.h (class Output_section_headers): Add shstrtab_section_.
- Update declarations.
- (class Output_symtab_xindex): Define.
- (Output_section::has_out_shndx): New function.
- * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
- field.
- (Symbol::init_base): Add st_shndx and is_ordinary parameters.
- Change all callers.
- (Sized_symbol::init): Likewise.
- (Symbol::output_section): Check for ordinary symbol.
- (Symbol_table::add_from_object): Remove orig_sym parameter. Add
- st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
- callers.
- (Symbol_table::add_from_relobj): Add symndx_offset parameter.
- Change all callers. Simplify handling of symbols from sections
- not included in the link.
- (Symbol_table::add_from_dynobj): Handle ordinary symbol
- distinction.
- (Weak_alias_sorter::operator()): Assert that symbols are
- ordinary.
- (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
- distinction.
- (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
- parameters. Change all callers.
- (Symbol_table::sized_write_globals): Likewise. Handle ordinary
- symbol distinction. Use SHN_XINDEX when needed.
- (Symbol_table::write_section_symbol): Add symtab_xindex
- parameter. Change all callers.
- (Symbol_table::sized_write_section_symbol): Likewise. Use
- SHN_XINDEX when needed.
- * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
- declarations.
- (Symbol::shndx): Add is_ordinary parameter. Change all callers.
- (Symbol::is_defined): Check is_ordinary.
- (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
- (Symbol::is_absolute, Symbol::is_common): Likewise.
- (class Sized_symbol): Update declarations.
- (class Symbol_table): Update declarations.
- * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
- parameters. Change all callers.
- (Sized_symbol::override): Likewise.
- (Symbol_table::override): Likewise.
- (symbol_to_bits): Add is_ordinary parameter. Change all callers.
- (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
- is_ordinary, and orig_st_shndx parameters. Change all callers.
- * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
- to be in an ordinary section.
- * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
- object and is_ordinary parameters. Change all callers.
- (Sized_dwarf_line_info::read_relocs): Add object parameter.
- Change all callers. Don't add undefined or non-ordinary symbols
- to reloc_map_.
- (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
- Change all callers.
- * dwarf_reader.h (class Sized_dwarf_line_info): Update
- declarations.
- * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
- * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
- (Sized_relobj::relocate_sections): Likewise.
- * target-reloc.h (scan_relocs): Adjust section symbol index.
- (scan_relocatable_relocs): Likewise.
- * i386.cc (Scan::local): Check for ordinary symbols.
- * sparc.cc (Scan::local): Likewise.
- * x86_64.cc (Scan::local): Likewise.
- * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
- to symbol_section_and_value.
- * testsuite/many_sections_test.cc: New file.
- * testsuite/Makefile.am (BUILT_SOURCES): Define.
- (check_PROGRAMS): Add many_sections_test.
- (many_sections_test_SOURCES): Define.
- (many_sections_test_DEPENDENCIES): Define.
- (many_sections_test_LDFLAGS): Define.
- (BUILT_SOURCES): Add many_sections_define.h.
- (many_sections_define.h): New target.
- (BUILT_SOURCES): Add many_sections_check.h.
- (many_sections_check.h): New target.
- (check_PROGRAMS): Add many_sections_r_test.
- (many_sections_r_test_SOURCES): Define.
- (many_sections_r_test_DEPENDENCIES): Define.
- (many_sections_r_test_LDFLAGS): Define.
- (many_sections_r_test_LDADD): Define.
- (many_sections_r_test.o): New target.
- * testsuite/Makefile.in: Rebuild.
-
-2008-04-17 Cary Coutant <ccoutant@google.com>
-
- * errors.cc (Errors::info): New function.
- (gold_info): New function.
- * errors.h (Errors::info): New function.
- * gold.h (gold_info): New function.
- * object.cc (Input_objects::add_object): Print trace output.
- * options.cc (options::parse_set): New function.
- (General_options::parse_wrap): Deleted.
- (General_options::General_options): Deleted initializer.
- * options.h (options::String_set): New typedef.
- (options::parse_set): New function.
- (DEFINE_set): New macro.
- (General_options::wrap): Changed to use DEFINE_set. Changed
- callers of any_wrap_symbols and is_wrap_symbol.
- (General_options::trace, General_options::trace_symbol):
- New options.
- (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
- (General_options::wrap_symbols_): Deleted.
- * symtab.cc (Symbol_table::add_from_object): Print trace output.
-
-2008-04-17 David S. Miller <davem@davemloft.net>
-
- * options.cc (General_options::parse_V): New function.
- * options.h: Add entries for -V and -Qy.
-
-2008-04-17 Ian Lance Taylor <iant@google.com>
-
- * common.cc (Symbol_table::allocate_commons): Remove options
- parameter. Change caller.
- (Symbol_table::do_allocate_commons): Remove options parameter.
- Change caller. Just call do_allocate_commons_list twice.
- (Symbol_table::do_allocate_commons_list): New function, broken out
- of do_allocate_commons.
- * common.h (class Allocate_commons_task): Remove options_ field.
- Update constructor.
- * symtab.cc (Symbol_table::Symbol_table): Initialize
- tls_commons_.
- (Symbol_table::add_from_object): Put TLS common symbols on
- tls_commons_ list.
- (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
- which are IN_OUTPUT_DATA.
- * symtab.h (class Symbol_table): Add tls_commons_ field. Update
- allocate_commons and do_allocate_commons declarations. Declare
- do_allocate_commons_list.
- * gold.cc (queue_middle_tasks): Update creation of
- Allocate_commons_task to not pass options.
- * testsuite/Makefile.am (INCLUDES): Add -I.. .
- (TLS_TEST_C_FLAGS): New variable.
- (tls_test_c_pic.o): New target.
- (tls_test_shared.so): Link in tls_test_c_pic.o.
- (tls_test_c_pic_ie.o): New target.
- (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
- (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
- (tls_test_c.o): New target.
- (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
- (tls_pic_test_LDADD): Likewise.
- (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
- (tls_shared_gd_to_ie_test_LDADD): Likewise.
- (tls_test_c_gnu2.o): New target.
- (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
- tls_test_c_gnu2.o.
- (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
- (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
- (tls_test_shared_nonpic.so): Link in tls_test_c.o.
- * testsuite/tls_test.cc: Include "config.h".
- (t_last): Call t11_last.
- * testsuite/tls_test.h (t11, t11_last): Declare.
- * testsuite/tls_test_c.c: New file.
- * testsuite/tls_test_main.cc (thread_routine): Call t11.
- * configure.ac: Check for OpenMP support.
- * configure, config.in, Makefile.in: Rebuild.
- * testsuite/Makefile.in: Rebuild.
-
-2008-04-16 Cary Coutant <ccoutant@google.com>
-
- * i386.cc (Target_i386::define_tls_base_symbol): New function.
- (Target_i386::tls_base_symbol_defined_): New field.
- (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
- (Target_i386::Scan::global): Likewise.
- * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
- * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
- (Target_x86_64::tls_base_symbol_defined_): New field.
- (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
- (Target_x86_64::Scan::global): Likewise.
-
-2008-04-16 Cary Coutant <ccoutant@google.com>
-
- * symtab.h (Symbol::is_strong_undefined): Removed unused function.
- (Symbol::needs_plt_entry): Allow weak undefined symbols.
- (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
- building shared libraries.
- * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
- (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
- (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
- * testsuite/Makefile.in: Rebuild.
- * testsuite/weak_undef.h: New file.
- * testsuite/weak_undef_file1.cc: Add extra test cases.
- * testsuite/weak_undef_file2.cc: Likewise.
- * testsuite/weak_undef_test.cc: Likewise.
-
-2008-04-16 David S. Miller <davem@davemloft.net>
-
- * sparc.cc (Target_sparc::Scan): Change from struct to class.
- Add issued_non_pic_error_ field. Declare check_non_pic.
- (Target_sparc::Scan::check_non_pic): New function.
- (Target_sparc::Scan::local): Call check_non_pic as appropriate.
- (Target_sparc::Scan::global): Likewise.
-
- * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
- * configure: Rebuild.
-
- * options.h (DEFINE_enable): New macro.
- (new_dtags): New enable option.
- (initfirst, interpose, loadfltr, nodefaultlib,
- nodelete, nodlopen, nodump): New -z options.
- * layout.cc (Layout:finish_dynamic_section): If new
- dtags enabled, emit DT_RUNPATH. Also, emit a
- DT_FLAGS_1 containing any specified -z flags.
-
-2008-04-16 Ian Lance Taylor <iant@google.com>
-
- * copy-relocs.cc: New file.
- * copy-relocs.h: New file.
- * reloc.cc: Remove Copy_relocs code.
- * reloc.h: Likewise.
- * reloc-types.h (struct Reloc_types) [both versions]: Add
- get_reloc_addend_noerror.
- * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
- variants of add_global which take an addend which must be zero.
- * i386.cc: Include "copy-relocs.h".
- (class Target_i386): Change type of copy_relocs_ to variable,
- update initializer.
- (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
- Change all callers.
- (Target_i386::do_finalize_sections): Change handling of
- copy_relocs_.
- * sparc.cc: Include "copy-relocs.h".
- (class Target_sparc): Change type of copy_relocs_ to variable,
- update initializer.
- (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
- Change all callers.
- (Target_sparc::do_finalize_sections): Change handling of
- copy_relocs_.
- * x86_64.cc: Include "copy-relocs.h".
- (class Target_x86_64): Change type of copy_relocs_ to variable,
- update initializer.
- (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
- class. Change all callers.
- (Target_x86_64::do_finalize_sections): Change handling of
- copy_relocs_.
- * Makefile.am (CCFILES): Add copy-relocs.cc.
- (HFILES): Add copy-relocs.h.
-
- * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
-
- * testsuite/script_test_4.sh: Permit leading zeroes.
-
-2008-04-15 Ian Lance Taylor <iant@google.com>
-
- * script-sections.cc (Script_sections::create_segments): Use
- header_size_adjustment even when there is enough room for the
- headers.
- * testsuite/script_test_4.sh: New file.
- * testsuite/script_test_4.t: New file.
- * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
- (check_DATA): Add script_test_4.stdout.
- (MOSTLYCLEANFILES): Likewise.
- (script_test_4): New target.
- (script_test_4.stdout): New target.
- * testsuite/Makefile.in: Rebuild.
-
- * sparc.cc: Add definitions for Output_data_plt_sparc class
- constants.
-
-2008-04-14 David S. Miller <davem@davemloft.net>
-
- * sparc.cc: New file.
- * Makefile.am (TARGETSOURCES): Add sparc.cc
- (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
- * configure.tgt: Document targ_extra_size and
- targ_extra_big_endian. Add entries for sparc-* and
- sparc64-*.
- * configure.ac: Handle targ_extra_size and
- targ_extra_big_endian.
- * Makefile.in: Rebuild.
- * configure: Likewise.
- * po/POTFILES.in: Likewise.
- * po/gold.pot: Likewise.
-
-2008-04-14 Ian Lance Taylor <iant@google.com>
-
- * layout.cc (Layout::Layout): Initialize sections_are_attached_.
- (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
- in the name/type/flags to section mapping. Don't call
- allocate_output_section.
- (Layout::choose_output_section): Change parameter from adjust_name
- to is_input_section. Don't permit input sections after sections
- are attached to segments. Don't call allocate_output_section.
- (Layout::layout_eh_frame): Call update_flags_for_input_section,
- not write_enable_output_section.
- (Layout::make_output_section): Don't push to
- unattached_section_list_ nor call attach_to_segment. Call
- attach_section_to_segment if sections are attached.
- (Layout::attach_sections_to_segments): New function.
- (Layout::attach_section_to_segment): New function.
- (Layout::attach_allocated_section_to_segment): Rename from
- attach_to_segment. Remove flags parameter.
- (Layout::allocate_output_section): Remove function.
- (Layout::write_enable_output_section): Remove function.
- * layout.h (class Layout): Update for above changes. Add new
- field sections_are_attached_.
- * output.h (Output_section::update_flags_for_input_section): New
- function.
- * output.cc (Output_section::add_input_section): Call
- update_flags_for_input_section.
- * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
-
-2008-04-11 Cary Coutant <ccoutant@google.com>
-
- * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
- thought unnecessary.
- * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
-
-2008-04-11 Ian Lance Taylor <iant@google.com>
-
- * output.h (class Output_section_data): Remove inline definition
- of set_addralign.
- * output.cc (Output_section_data::set_addralign): New function.
-
-2008-04-11 Cary Coutant <ccoutant@google.com>
-
- Add support for TLS descriptors for i386 and x86_64.
- * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
- (Target_i386::Relocate::tls_desc_gd_to_le): New function.
- (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
- GOT_TYPE_TLS_DESC.
- (Target_i386::got_mod_index_entry): Remove unnecessary code.
- (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
- R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
- relocations.
- (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
- Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
- Fix problem with initial-exec relocations.
- (Target_i386::Relocate::relocate_tls): Likewise.
- (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
- relaxation.
- * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
- support for section-plus-offset dynamic table entries.
- * output.h (Output_data_dynamic::add_section_plus_offset): New function.
- (Output_data_dynamic::Dynamic_entry): Add support for
- section-plus-offset dynamic table entries.
- (Output_data_dynamic::Classification): Likewise.
- (Output_data_dynamic::classification_): Renamed offset_.
- * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
- (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
- (Target_x86_64::make_plt_section): New function.
- (Target_x86_64::reserve_tlsdesc_entries): New function.
- (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
- (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
- (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
- (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
- (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
- (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
- (Output_data_plt_x86_64::set_final_data_size): Move out of line;
- add extra PLT entry for TLS descriptors.
- (Output_data_plt_x86_64::got_): New field.
- (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
- (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
- fields.
- (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
- descriptors.
- (Target_x86_64::make_plt_entry): Factor out make_plt_section.
- (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
- (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
- R_386_TLS_DESC_CALL relocations.
- (Target_x86_64::Scan::global): Likewise.
- (Target_x86_64::do_finalize_sections): Add dynamic table entries
- for TLS descriptors.
- (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
- Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
- (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
- GD-to-IE relaxation.
- * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
- and TLS_DESCRIPTORS.
- * Makefile.in: Rebuild.
- * configure: Rebuild.
- * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
- (tls_test_shared2.so): New target.
- (tls_shared_gd_to_ie_test_SOURCES): New variable.
- (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
- (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
- (tls_shared_gd_to_ie_test_LDADD): New variable.
- (tls_shared_gnu2_gd_to_ie_test): New target.
- (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
- New targets.
- (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
- (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
- (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
- (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
- (tls_shared_gnu2_test): New target.
- (tls_test_gnu2_shared.so): New target.
- (tls_shared_gnu2_test_SOURCES): New variable.
- (tls_shared_gnu2_test_DEPENDENCIES): New variable.
- (tls_shared_gnu2_test_LDFLAGS): New variable.
- (tls_shared_gnu2_test_LDADD): New variable.
- * testsuite/Makefile.in: Rebuild.
- * testsuite/Makefile.
-
-2008-04-11 Ian Lance Taylor <iant@google.com>
-
- * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
- justsyms.t.
- * testsuite/Makefile.in: Rebuild.
-
- * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
- long.
- * testsuite/script_test_2.cc (main): Adjust test.
-
-2008-04-11 David S. Miller <davem@davemloft.net>
- Ian Lance Taylor <iant@google.com>
-
- * options.h (General_options): Add entries for '-Y' and
- '-relax'.
- * options.cc (General_options:finalize): If -Y was used, add those
- entries to the library path instead of the default "/lib" and
- "/usr/lib".
-
-2008-04-11 David S. Miller <davem@davemloft.net>
-
- * testsuite/justsyms.t: Start at 0x100.
- * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
- * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
- long.
- * testsuite/script_test_2.cc: Adjust string and section length
- checks.
-
-2008-04-09 Ian Lance Taylor <iant@google.com>
-
- PR gold/5996
- * script-sections.cc (Sections_element::allocate_to_segment): Add
- orphan parameter.
- (Output_section_definition::allocate_to_segment): Likewise.
- (Orphan_output_section::allocate_to_segment): Likewise.
- (Script_sections::attach_sections_using_phdrs_clause): Don't
- propagate non-PT_LOAD segments to orphan sections.
- * testsuite/Makefile.am (script_test_3.stdout): Generate using
- readelf rather than objdump.
- * testsuite/script_test_3.sh: Adjust accordingly. Test that
- .interp section and PT_INTERP segment are the same size.
- * testsuite/Makefile.in: Rebuild.
-
- * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
- aliases for symbols defined in the same object.
- * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
- (weak_alias_test_SOURCES): New variable.
- (weak_alias_test_DEPENDENCIES): New variable.
- (weak_alias_test_LDFLAGS): New variable.
- (weak_alias_test_LDADD): New variable.
- (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
- (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
- (weak_alias_test_3.o): New target.
- (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
- * testsuite/weak_alias_test_main.cc: New file.
- * testsuite/weak_alias_test_1.cc: New file.
- * testsuite/weak_alias_test_2.cc: New file.
- * testsuite/weak_alias_test_3.cc: New file.
-
-2008-04-08 Ian Lance Taylor <iant@google.com>
-
- * options.h (class General_options): Add --noinhibit-exec option.
- * main.cc (main): Check --noinhibit-exec.
-
- * options.h (class General_options): Define --wrap as a special
- option. Add wrap_symbols_ field.
- (General_options::any_wrap_symbols): New function.
- (General_options::is_wrap_symbol): New function.
- * options.cc (General_options::parse_wrap): New function.
- (General_options::General_options): Initialize wrap_symbols_.
- * symtab.cc (Symbol_table::wrap_symbol): New function.
- (Symbol_table::add_from_object): Handle --wrap.
- * symtab.h (class Symbol_table): Declare wrap_symbol.
- * target.h (Target::wrap_char): New function.
- (Target::Target_info): Add wrap_char field.
- * i386.cc (Target_i386::i386_info): Initialize wrap_char.
- * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
- * testsuite/testfile.cc (Target_test::test_target_info):
- Likewise.
-
- * errors.cc (Errors::undefined_symbol): Mention symbol version if
- there is one.
-
- * layout.h (class Layout): Add added_eh_frame_data_ field.
- * layout.cc (Layout::Layout): Initialize new field.
- (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
- output section until we find a section we merged successfully.
- * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
- that the size be non-zero.
-
- * merge.cc (Object_merge_map::get_output_offset): Remove inline
- qualifier.
-
-2008-04-08 Craig Silverstein <csilvers@google.com>
-
- * configure.ac: Export new conditional variable HAVE_ZLIB.
- * testsuite/Makefile.am (flagstest_o_specialfile): Condition
- on HAVE_ZLIB.
- (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
- * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
-
-2008-04-07 Ian Lance Taylor <iant@google.com>
-
- * version.cc (version_string): Set to "1.5".
-
- * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
- Add issued_non_pic_error_ field. Declare check_non_pic.
- (Target_x86_64::Scan::check_non_pic): New function.
- (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
- (Target_x86_64::Scan::global): Likewise.
-
- * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
- addend parameter. Change caller. Handle merge sections.
- (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
- Address to Addend. Don't add in the result of
- local_section_offset, pass down the addend and use the returned
- value.
- * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
- Update declarations of local_section_offset and symbol_value.
- * testsuite/two_file_test_1.cc (t18): New function.
- * testsuite/two_file_test_2.cc (f18): New function.
- * testsuite/two_file_test_main.cc (main): Call t18.
- * testsuite/two_file_test.h (t18, f18): Declare.
-
- * configure.ac: Don't test for objdump, c++filt, or readelf.
- * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
- conditionals.
- (TEST_READELF): New variable.
- (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
- (check_PROGRAMS): Add two_file_strip_test.
- (two_file_strip_test): New target.
- (check_PROGRAMS): Add two_file_same_shared_strip_test.
- (two_file_same_shared_strip_test_SOURCES): New variable.
- (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
- (two_file_same_shared_strip_test_LDFLAGS): New variable.
- (two_file_same_shared_strip_test_LDADD): New variable.
- (two_file_shared_strip.so): New target.
- (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
- (ver_test_5.syms, ver_test_7.syms): Likewise.
- (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
- (strip_test_3.stdout): Use TEST_OBJDUMP.
- * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
-
-2008-04-04 Cary Coutant <ccoutant@google.com>
-
- * symtab.h (Symbol::is_weak_undefined): New function.
- (Symbol::is_strong_undefined): New function.
- (Symbol::is_absolute): New function.
- (Symbol::needs_plt_entry): Exclude weak undefined symbols.
- (Symbol::needs_dynamic_reloc): Exclude weak undefined and
- absolute symbols.
- * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
- (weak_undef_test): New target.
- * testsuite/Makefile.in: Rebuild.
- * testsuite/weak_undef_file1.cc: New file.
- * testsuite/weak_undef_file2.cc: New file.
- * testsuite/weak_undef_test.cc: New file.
-
-2008-04-03 Craig Silverstein <csilvers@google.com>
-
- * compressed_output.h (class Output_compressed_section): Use
- unsigned buffer.
- * compressed_output.cc (zlib_compress): Use unsigned buffers,
- add zlib header.
- (zlib_compressed_suffix): Removed.
- (Output_compressed_section::set_final_data_size): Use unsigned
- buffers.
- * testsuite/Makefile.am (flagstest_compress_debug_sections):
- Fix linker invocation.
- (flagstest_o_specialfile_and_compress_debug_sections):
- Likewise.
- * testsuite/Makefile.in: Regenerated.
-
-2008-04-02 David S. Miller <davem@davemloft.net>
-
- * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
- Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
-
-2008-04-02 Craig Silverstein <csilvers@google.com>
-
- * TODO: New file.
-
-2008-04-02 Ian Lance Taylor <iant@google.com>
-
- * fileread.cc (File_read::find_view): Add byteshift and vshifted
- parameters. Update for new key type to views_. Change all
- callers.
- (File_read::read): Adjust for byteshift in returned view.
- (File_read::add_view): New function, broken out of
- find_and_make_view.
- (File_read::make_view): New function, broken out of
- find_and_make_view.
- (File_read::find_or_make_view): Add offset and aligned
- parameters. Rewrite accordingly. Change all callers.
- (File_read::get_view): Add offset and aligned parameters. Adjust
- for byteshift in return value.
- (File_read::get_lasting_view): Likewise.
- * fileread.h (class File_read): Update declarations.
- (class File_read::View): Add byteshift_ field. Add byteshift to
- constructor. Add byteshift method.
- * archive.h (Archive::clear_uncached_views): New function.
- (Archive::get_view): Add aligned parameter. Change all callers.
- * object.h (Object::get_view): Add aligned parameter. Change all
- callers.
- (Object::get_lasting_view): Likewise.
-
- * fileread.cc (File_read::release): Don't call clear_views if
- there are multiple objects.
- * fileread.h (File_read::clear_uncached_views): New function.
- * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
- on the archive.
-
-2008-03-31 Cary Coutant <ccoutant@google.com>
-
- Add thin archive support.
- * archive.cc (Archive::armagt): New const.
- (Archive::setup): Remove task parameter and calls to unlock.
- (Archive::unlock_nested_archives): New function.
- (Archive::read_header): Add nested_off parameter. Change
- all callers.
- (Archive::interpret_header): Likewise.
- (Archive::include_all_members): Change to handle thin
- archives.
- (Archive::include_member): Likewise.
- * archive.h (Archive::Archive): Add new parameters and
- initializers.
- (Archive::armagt): New const.
- (Archive::setup): Remove task parameter.
- (Archive::unlock_nested_archives): New function.
- (Archive::read_header): Add nested_off parameter.
- (Archive::interpret_header): Likewise.
- (Archive::Nested_archive_table): New typedef.
- (Archive::is_thin_archive_): New field.
- (Archive::nested_archives_): New field.
- (Archive::options_): New field.
- (Archive::dirpath_): New field.
- (Archive::task_): New field.
- * readsyms.cc (Read_symbols::do_read_symbols): Add check
- for thin archives. Pass additional parameters to
- Archive::Archive. Unlock the archive file after calling
- Archive::setup.
-
-2008-03-29 Ian Lance Taylor <iant@google.com>
-
- * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
- version symbol to be local.
- * testsuite/ver_test_4.sh: New file.
- * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
- (check_DATA): Add ver_test_4.syms.
- (ver_test_4.syms): New target.
- * testsuite/Makefile.in: Rebuild.
-
- * output.cc
- (Output_section::Input_section_sort_entry::has_priority): New
- function.
- (Output_section::Input_section_sort_entry::match_file_name): New
- function.
- (Output_section::Input_section_sort_entry::match_section_name):
- Remove.
- (Output_section::Input_section_sort_entry::match_section_name_prefix):
- Remove.
- (Output_section::Input_section_sort_entry::match_section_file):
- Remove.
- (Output_section::Input_section_sort_compare::operator()): Rewrite
- using new Input_section_sort_entry functions. Sort crtbegin and
- crtend first. Sort sections with no priority before sections with
- a priority.
- * testsuite/initpri1.c (d3): Check j != 4.
- (cd5): New constructor/destructor function.
- (main): Check j != 2.
-
- * symtab.cc (Symbol_table::add_from_object): If we don't use the
- new symbol when resolving, don't call set_is_default.
- * testsuite/ver_test_7.cc: New file.
- * testsuite/ver_test_7.sh: New file.
- * testsuite/Makefile.am (ver_test_7.so): New target.
- (ver_test_7.o): New target.
- (check_SCRIPTS): Add ver_test_7.sh.
- (check_DATA): Add ver_test_7.syms.
- (ver_test_7.syms): New target.
-
-2008-03-28 Ian Lance Taylor <iant@google.com>
-
- * layout.cc (Layout::layout): If we see an input section with a
- name that needs sorting, set the must_sort flag for the output
- section.
- (Layout::make_output_section): If the name of the output section
- indicates that it might require sorting, set the may_sort flag.
- * output.h (Output_section::may_sort_attached_input_sections): New
- function.
- (Output_section::set_may_sort_attached_input_sections): New
- function.
- (Output_section::must_sort_attached_input_sections): New
- function.
- (Output_section::set_must_sort_attached_input_sections): New
- function.
- (class Output_section): Declare Input_section_sort_entry. Define
- Input_section_sort_compare. Declare
- sort_attached_input_sections. Add new fields:
- may_sort_attached_input_sections_,
- must_sort_attached_input_sections_,
- attached_input_sections_are_sorted_.
- * output.cc (Output_section::Output_section): Initialize new
- fields.
- (Output_section::add_input_section): Add an entry to
- input_sections_ if may_sort or must_sort are true.
- (Output_section::set_final_data_size): Call
- sort_attached_input_sections if necessary.
- (Output_section::Input_section_sort_entry): Define new class.
- (Output_section::Input_section_sort_compare::operator()): New
- function.
- (Output_section::sort_attached_input_sections): New function.
- * configure.ac: Check whether the compiler supports constructor
- priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
- * testsuite/initpri1.c: New file.
- * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
- CONSTRUCTOR_PRIORITY.
- (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
- (initpri1_LDFLAGS): New variable.
- * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
-
-2008-03-27 Ian Lance Taylor <iant@google.com>
-
- * common.cc (Sort_commons::operator): Correct sorting algorithm.
- * testsuite/common_test_1.c: New file.
- * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
- (common_test_1_SOURCES): New variable.
- (common_test_1_DEPENDENCIES): New variable.
- (common_test_1_LDFLAGS): New variable.
-
- * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
- and commons_ correctly when NAME/VERSION does not override
- NAME/NULL.
- * testsuite/ver_test_6.c: New file.
- * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
- (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
- (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
-
-2008-03-26 Ian Lance Taylor <iant@google.com>
-
- * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
- of an undefined symbol from a version script.
- * testsuite/Makefile.am (ver_test_5.so): New target.
- (ver_test_5.o): New target.
- (check_SCRIPTS): Add ver_test_5.sh.
- (check_DATA): Add ver_test_5.syms.
- (ver_test_5.syms): New target.
- * testsuite/ver_test_5.cc: New file.
- * testsuite/ver_test_5.script: New file.
- * testsuite/ver_test_5.sh: New file.
- * Makefile.in, testsuite/Makefile.in: Rebuild.
-
- PR gold/5986
- Fix problems building gold with gcc 4.3.0.
- * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
- (gold_error_at_location, gold_warning_at_location): Use it.
- * configure.ac: Check whether we can compile and use a template
- function with a printf attribute.
- * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
- when jumping over bytes.
- * object.cc: Instantiate Object::read_section_data.
- * debug.h: Include <cstring>
- * dwarf_reader.cc: Include <algorithm>
- * main.cc: Include <cstring>.
- * options.cc: Include <cstring>.
- * output.cc: Include <cstring>.
- * script.cc: Include <cstring>.
- * script.h: Include <string>.
- * symtab.cc: Include <cstring> and <algorithm>.
- * target-select.cc: Include <cstring>.
- * version.cc: Include <string>.
- * testsuite/testmain.cc: Include <cstdlib>.
- * configure, config.in: Rebuild.
-
-2008-03-25 Ian Lance Taylor <iant@google.com>
-
- * options.cc: Include "../bfd/bfdver.h".
- (options::help): Print bug reporting address.
-
- * version.cc (print_version): Adjust output for current value of
- BFD_VERSION_STRING.
-
- * NEWS: New file.
-
- * options.cc (options::help): Print list of supported targets.
- * target-select.h: Include <vector>.
- (class Target_selector): Make machine_, size_, and is_big_endian_
- fields const. Add bfd_name_ and instantiated_target_ fields.
- (Target_selector::Target_selector): Add bfd_name parameter.
- (Target_selector::recognize): Make non-virtual, call
- do_recognize.
- (Target_selector::recognize_by_name): Make non-virtual, call
- do_recognize_by_name.
- (Target_selector::supported_names): New function.
- (Target_selector::bfd_name): New function.
- (Target_selector::do_instantiate_target): New pure virtual
- function.
- (Target_selector::do_recognize): New virtual function.
- (Target_selector::do_recognize_by_name): New virtual function.
- (Target_selector::instantiate_target): New private function.
- (supported_target_names): Declare.
- * target-select.cc (Target_selector::Target_selector): Update for
- new parameter and fields.
- (select_target_by_name): Check that the name matches before
- calling recognize_by_name.
- (supported_target_names): New function.
- * i386.cc (class Target_selector_i386): Update Target_selector
- constructor call. Remove recognize and recognize_by_name. Add
- do_instantiate_target.
- * x86_64.cc (class Target_selector_x86_64): Likewise.
- * testsuite/testfile.cc (class Target_selector_test): Update for
- changes to Target_selector.
-
- * README: Rewrite, with some notes on unsupported features.
-
-2008-03-24 Cary Coutant <ccoutant@google.com>
-
- * i386.cc (Target_i386::Got_type): New enum declaration.
- (Target_i386::Scan::local): Updated callers of Output_data_got
- member functions.
- (Target_i386::Scan::global): Likewise.
- (Target_i386::Relocate::relocate): Likewise.
- (Target_i386::Relocate::relocate_tls): Likewise.
- * object.h (Got_offset_list): New class.
- (Sized_relobj::local_has_got_offset): Added got_type parameter.
- (Sized_relobj::local_got_offset): Likewise.
- (Sized_relobj::set_local_got_offset): Likewise.
- (Sized_relobj::local_has_tls_got_offset): Removed.
- (Sized_relobj::local_tls_got_offset): Removed.
- (Sized_relobj::set_local_tls_got_offset): Removed.
- (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
- * output.cc (Output_data_got::add_global): Added got_type parameter.
- (Output_data_got::add_global_with_rel): Likewise.
- (Output_data_got::add_global_with_rela): Likewise.
- (Output_data_got::add_global_pair_with_rel): New function.
- (Output_data_got::add_global_pair_with_rela): New function.
- (Output_data_got::add_local): Added got_type parameter.
- (Output_data_got::add_local_with_rel): Likewise.
- (Output_data_got::add_local_with_rela): Likewise.
- (Output_data_got::add_local_pair_with_rel): New function.
- (Output_data_got::add_local_pair_with_rela): New function.
- (Output_data_got::add_global_tls): Removed.
- (Output_data_got::add_global_tls_with_rel): Removed.
- (Output_data_got::add_global_tls_with_rela): Removed.
- (Output_data_got::add_local_tls): Removed.
- (Output_data_got::add_local_tls_with_rel): Removed.
- (Output_data_got::add_local_tls_with_rela): Removed.
- * output.h (Output_data_got::add_global): Added got_type parameter.
- (Output_data_got::add_global_with_rel): Likewise.
- (Output_data_got::add_global_with_rela): Likewise.
- (Output_data_got::add_global_pair_with_rel): New function.
- (Output_data_got::add_global_pair_with_rela): New function.
- (Output_data_got::add_local): Added got_type parameter.
- (Output_data_got::add_local_with_rel): Likewise.
- (Output_data_got::add_local_with_rela): Likewise.
- (Output_data_got::add_local_pair_with_rel): New function.
- (Output_data_got::add_local_pair_with_rela): New function.
- (Output_data_got::add_global_tls): Removed.
- (Output_data_got::add_global_tls_with_rel): Removed.
- (Output_data_got::add_global_tls_with_rela): Removed.
- (Output_data_got::add_local_tls): Removed.
- (Output_data_got::add_local_tls_with_rel): Removed.
- (Output_data_got::add_local_tls_with_rela): Removed.
- * resolve.cc (Symbol::override_base_with_special): Removed
- reference to has_got_offset_ field.
- * symtab.cc (Symbol::init_fields): Replaced initialization
- of got_offset_ with got_offsets_. Removed initialization
- of has_got_offset_
- * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
- (Symbol::got_offset): Likewise.
- (Symbol::set_got_offset): Likewise.
- (Symbol::has_tls_got_offset): Removed.
- (Symbol::tls_got_offset): Removed.
- (Symbol::set_tls_got_offset): Removed.
- (Symbol::got_offset_): Removed.
- (Symbol::tls_mod_got_offset_): Removed.
- (Symbol::tls_pair_got_offset_): Removed.
- (Symbol::got_offsets_): New field.
- (Symbol::has_got_offset): Removed.
- (Symbol::has_tls_mod_got_offset): Removed.
- (Symbol::has_tls_pair_got_offset): Removed.
- * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
- (Target_x86_64::Scan::local): Updated callers of Output_data_got
- member functions.
- (Target_x86_64::Scan::global): Likewise.
- (Target_x86_64::Relocate::relocate): Likewise.
- (Target_x86_64::Relocate::relocate_tls): Likewise.
-
-2008-03-25 Ben Elliston <bje@au.ibm.com>
-
- * yyscript.y: Fix spelling error in comment.
-
-2008-03-24 Ian Lance Taylor <iant@google.com>
-
- * options.h (class General_options): Define build_id option.
- * layout.h (class Layout): Declare write_build_id, create_note,
- create_build_id. Add build_id_note_ member.
- * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
- "libiberty.h", "md5.h", "sha1.h".
- (Layout::Layout): Initialize eh_frame_data_,
- eh_frame_hdr_section_, and build_id_note_.
- (Layout::finalize): Call create_build_id.
- (Layout::create_note): New function, broken out of
- Layout::create_gold_note.
- (Layout::create_gold_note): Call create_note.
- (Layout::create_build_id): New function.
- (Layout::write_build_id): New function.
- (Close_task_runner::run): Call write_build_id.
-
- * x86_64.cc: Correct license to GPLv3.
-
-2008-03-23 Ian Lance Taylor <iant@google.com>
-
- * options.cc: Include "demangle.h".
- (parse_optional_string): New function.
- (parse_long_option): Handle takes_optional_argument.
- (parse_short_option): Update dash_z initializer. Handle
- takes_optional_argument.
- (General_options::General_options): Initialize do_demangle_.
- (General_options::finalize): Set do_demangle_. Handle demangling
- style.
- * options.h (parse_optional_string): Declare.
- (struct One_option): Add optional_arg field. Update constructor.
- Update call constructor calls. Add takes_optional_argument
- function.
- (DEFINE_var): Add optional_arg__ parameter. Change all callers.
- (DEFINE_optional_string): Define.
- (General_options::demangle): Change from DEFINE_bool to
- DEFINE_optional_string.
- (General_options::no_demangle): New function.
- (General_options::do_demangle): New function.
- (General_options::set_do_demangle): New function.
- (General_options::execstack_status_): Move definition to end of
- class definition.
- (General_options::static_): Likewise.
- (General_options::do_demangle_): New field.
- * object.cc (big_endian>::get_symbol_location_info): Call
- Options::do_demangle, not Options::demangle.
- * symtab.cc (demangle): Likewise.
-
-2008-03-22 Ian Lance Taylor <iant@google.com>
-
- * gold.h: Include <cstddef> and <sys/types.h>
- * options.h: Include <cstring>.
-
-2008-03-21 Ian Lance Taylor <iant@google.com>
-
- * Added source code to GNU binutils.
-
diff --git a/gold/Makefile.am b/gold/Makefile.am
deleted file mode 100644
index e706703303b..00000000000
--- a/gold/Makefile.am
+++ /dev/null
@@ -1,227 +0,0 @@
-# Process this file with automake to generate Makefile.in
-
-AUTOMAKE_OPTIONS =
-
-SUBDIRS = po testsuite
-
-tooldir = $(exec_prefix)/$(target_alias)
-
-ACLOCAL_AMFLAGS = -I ../bfd -I ../config
-
-AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS)
-AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS)
-
-INCLUDES = \
- -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../elfcpp \
- -DLOCALEDIR="\"$(datadir)/locale\"" \
- -DBINDIR="\"$(bindir)\"" -DTOOLBINDIR="\"$(tooldir)/bin\"" \
- @INCINTL@
-
-LIBIBERTY = ../libiberty/libiberty.a
-
-if THREADS
-THREADSLIB = -lpthread
-endif
-
-AM_YFLAGS = -d
-
-noinst_PROGRAMS = ld-new
-noinst_LIBRARIES = libgold.a
-
-CCFILES = \
- archive.cc \
- binary.cc \
- common.cc \
- compressed_output.cc \
- copy-relocs.cc \
- cref.cc \
- defstd.cc \
- descriptors.cc \
- dirsearch.cc \
- dynobj.cc \
- dwarf_reader.cc \
- ehframe.cc \
- errors.cc \
- expression.cc \
- fileread.cc \
- gold.cc \
- gold-threads.cc \
- layout.cc \
- mapfile.cc \
- merge.cc \
- object.cc \
- options.cc \
- output.cc \
- parameters.cc \
- readsyms.cc \
- reduced_debug_output.cc \
- reloc.cc \
- resolve.cc \
- script-sections.cc \
- script.cc \
- stringpool.cc \
- symtab.cc \
- target-select.cc \
- version.cc \
- workqueue.cc \
- workqueue-threads.cc
-
-HFILES = \
- archive.h \
- binary.h \
- common.h \
- compressed_output.h \
- copy-relocs.h \
- cref.h \
- defstd.h \
- dirsearch.h \
- descriptors.h \
- dynobj.h \
- dwarf_reader.h \
- ehframe.h \
- errors.h \
- fileread.h \
- gold.h \
- gold-threads.h \
- layout.h \
- mapfile.h \
- merge.h \
- object.h \
- options.h \
- output.h \
- parameters.h \
- readsyms.h \
- reduced_debug_output.h \
- reloc.h \
- reloc-types.h \
- script-c.h \
- script-sections.h \
- script.h \
- stringpool.h \
- symtab.h \
- target.h \
- target-reloc.h \
- target-select.h \
- tls.h \
- token.h \
- workqueue.h \
- workqueue-internal.h
-
-YFILES = \
- yyscript.y
-
-EXTRA_DIST = yyscript.c yyscript.h
-
-TARGETSOURCES = \
- i386.cc x86_64.cc sparc.cc powerpc.cc
-
-ALL_TARGETOBJS = \
- i386.$(OBJEXT) x86_64.$(OBJEXT) sparc.$(OBJEXT) powerpc.$(OBJEXT)
-
-libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES)
-
-sources_var = main.cc
-deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
-ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) $(THREADSLIB)
-
-ld_new_SOURCES = $(sources_var)
-ld_new_DEPENDENCIES = $(deps_var) $(LIBOBJS)
-ld_new_LDADD = $(ldadd_var) $(LIBOBJS)
-
-EXTRA_ld_new_SOURCES = $(TARGETSOURCES)
-
-# Use an explicit dependency for the bison generated header file.
-expression.$(OBJEXT): yyscript.h
-script-sections.$(OBJEXT): yyscript.h
-script.$(OBJEXT): yyscript.h
-
-# We have to build libgold.a before we run the tests.
-check: libgold.a
-
-.PHONY: install-exec-local
-
-install-exec-local: ld-new$(EXEEXT)
- $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
- n=`echo ld | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
- if test "$(bindir)" != "$(tooldir)/bin"; then \
- rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
- ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
- || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
- fi
-
-# We want install to imply install-info as per GNU standards, despite
-# the cygnus option.
-install-data-local: install-info
-
-POTFILES= $(CCFILES) $(HFILES) $(TARGETSOURCES)
-
-po/POTFILES.in: @MAINT@ Makefile
- for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
- && mv tmp $(srcdir)/po/POTFILES.in
-
-# Bootstrap test support. We use ld-new to build ld1, then use ld1 to
-# build ld2. ld1 and ld2 should be identical. ld-new need not be
-# identical to ld1, since it was linked with the host linker.
-
-if GCC
-if NATIVE_LINKER
-
-gcctestdir1/ld: ld-new
- test -d gcctestdir1 || mkdir -p gcctestdir1
- rm -f gcctestdir1/ld
- (cd gcctestdir1 && $(LN_S) ../ld-new ld)
-
-ld1_SOURCES = $(sources_var)
-ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
-ld1_LDADD = $(ldadd_var)
-ld1_LDFLAGS = -Bgcctestdir1/
-
-gcctestdir2/ld: ld1
- test -d gcctestdir2 || mkdir -p gcctestdir2
- rm -f gcctestdir2/ld
- (cd gcctestdir2 && $(LN_S) ../ld1 ld)
-
-ld2_SOURCES = $(sources_var)
-ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
-ld2_LDADD = $(ldadd_var)
-ld2_LDFLAGS = -Bgcctestdir2/
-
-bootstrap-test: ld2
- rm -f $@
- echo "#!/bin/sh" > $@
- echo "cmp ld1 ld2" > $@
- chmod +x $@
-
-libgold-1-r.o: gcctestdir1/ld libgold.a
- gcctestdir1/ld -o $@ -r --whole-archive libgold.a
-
-ld1_r_SOURCES = $(sources_var)
-ld1_r_DEPENDENCIES = libgold-1-r.o $(deps_var) gcctestdir1/ld
-ld1_r_LDADD = libgold-1-r.o $(ldadd_var)
-ld1_r_LDFLAGS = -Bgcctestdir1/
-
-gcctestdir2-r/ld: ld1-r
- test -d gcctestdir2-r || mkdir -p gcctestdir2-r
- rm -f gcctestdir2-r/ld
- (cd gcctestdir2-r && $(LN_S) ../ld1-r ld)
-
-libgold-2-r.o: gcctestdir2-r/ld libgold.a
- gcctestdir2-r/ld -o $@ -r --whole-archive libgold.a
-
-ld2_r_SOURCES = $(sources_var)
-ld2_r_DEPENDENCIES = libgold-2-r.o $(deps_var) gcctestdir2-r/ld
-ld2_r_LDADD = libgold-2-r.o $(ldadd_var)
-ld2_r_LDFLAGS = -Bgcctestdir2-r/
-
-bootstrap-test-r: ld2-r
- rm -f $@
- echo "#!/bin/sh" > $@
- echo "cmp ld1-r ld2-r" > $@
- chmod +x $@
-
-check_PROGRAMS = ld1 ld2 ld1-r ld2-r
-TESTS = bootstrap-test bootstrap-test-r
-
-endif
-endif
diff --git a/gold/Makefile.in b/gold/Makefile.in
deleted file mode 100644
index bbc54171f2d..00000000000
--- a/gold/Makefile.in
+++ /dev/null
@@ -1,1139 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 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.
-
-@SET_MAKE@
-
-# Process this file with automake to generate Makefile.in
-
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-noinst_PROGRAMS = ld-new$(EXEEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@check_PROGRAMS = ld1$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ld2$(EXEEXT) ld1-r$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ld2-r$(EXEEXT)
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/../config.guess \
- $(srcdir)/../config.sub $(srcdir)/../depcomp \
- $(srcdir)/../install-sh $(srcdir)/../missing \
- $(srcdir)/../mkinstalldirs $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(srcdir)/config.in \
- $(top_srcdir)/configure $(top_srcdir)/po/Make-in ChangeLog \
- NEWS TODO pread.c yyscript.c yyscript.h
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
- $(top_srcdir)/../config/gettext-sister.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
- $(top_srcdir)/../config/nls.m4 \
- $(top_srcdir)/../config/override.m4 \
- $(top_srcdir)/../config/po.m4 \
- $(top_srcdir)/../config/proginstall.m4 \
- $(top_srcdir)/../config/progtest.m4 \
- $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = po/Makefile.in
-LIBRARIES = $(noinst_LIBRARIES)
-AR = ar
-ARFLAGS = cru
-libgold_a_AR = $(AR) $(ARFLAGS)
-libgold_a_LIBADD =
-am__objects_1 = archive.$(OBJEXT) binary.$(OBJEXT) common.$(OBJEXT) \
- compressed_output.$(OBJEXT) copy-relocs.$(OBJEXT) \
- cref.$(OBJEXT) defstd.$(OBJEXT) descriptors.$(OBJEXT) \
- dirsearch.$(OBJEXT) dynobj.$(OBJEXT) dwarf_reader.$(OBJEXT) \
- ehframe.$(OBJEXT) errors.$(OBJEXT) expression.$(OBJEXT) \
- fileread.$(OBJEXT) gold.$(OBJEXT) gold-threads.$(OBJEXT) \
- layout.$(OBJEXT) mapfile.$(OBJEXT) merge.$(OBJEXT) \
- object.$(OBJEXT) options.$(OBJEXT) output.$(OBJEXT) \
- parameters.$(OBJEXT) readsyms.$(OBJEXT) \
- reduced_debug_output.$(OBJEXT) reloc.$(OBJEXT) \
- resolve.$(OBJEXT) script-sections.$(OBJEXT) script.$(OBJEXT) \
- stringpool.$(OBJEXT) symtab.$(OBJEXT) target-select.$(OBJEXT) \
- version.$(OBJEXT) workqueue.$(OBJEXT) \
- workqueue-threads.$(OBJEXT)
-am__objects_2 =
-am__objects_3 = yyscript.$(OBJEXT)
-am_libgold_a_OBJECTS = $(am__objects_1) $(am__objects_2) \
- $(am__objects_3)
-libgold_a_OBJECTS = $(am_libgold_a_OBJECTS)
-PROGRAMS = $(noinst_PROGRAMS)
-am__objects_4 = main.$(OBJEXT)
-am_ld_new_OBJECTS = $(am__objects_4)
-ld_new_OBJECTS = $(am_ld_new_OBJECTS)
-am__DEPENDENCIES_1 =
-am__DEPENDENCIES_2 = ../libiberty/libiberty.a
-am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) libgold.a \
- $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-am__DEPENDENCIES_4 = @LIBOBJS@
-am__ld1_SOURCES_DIST = main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_ld1_OBJECTS = $(am__objects_4)
-ld1_OBJECTS = $(am_ld1_OBJECTS)
-am__ld1_r_SOURCES_DIST = main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_ld1_r_OBJECTS = $(am__objects_4)
-ld1_r_OBJECTS = $(am_ld1_r_OBJECTS)
-am__ld2_SOURCES_DIST = main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_ld2_OBJECTS = $(am__objects_4)
-ld2_OBJECTS = $(am_ld2_OBJECTS)
-am__ld2_r_SOURCES_DIST = main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_ld2_r_OBJECTS = $(am__objects_4)
-ld2_r_OBJECTS = $(am_ld2_r_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
-depcomp = $(SHELL) $(top_srcdir)/../depcomp
-am__depfiles_maybe = depfiles
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
-SOURCES = $(libgold_a_SOURCES) $(ld_new_SOURCES) \
- $(EXTRA_ld_new_SOURCES) $(ld1_SOURCES) $(ld1_r_SOURCES) \
- $(ld2_SOURCES) $(ld2_r_SOURCES)
-DIST_SOURCES = $(libgold_a_SOURCES) $(ld_new_SOURCES) \
- $(EXTRA_ld_new_SOURCES) $(am__ld1_SOURCES_DIST) \
- $(am__ld1_r_SOURCES_DIST) $(am__ld2_SOURCES_DIST) \
- $(am__ld2_r_SOURCES_DIST)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
- { test ! -d $(distdir) \
- || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -fr $(distdir); }; }
-DIST_ARCHIVES = $(distdir).tar.gz
-GZIP_ENV = --best
-distuninstallcheck_listfiles = find . -type f -print
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CONSTRUCTOR_PRIORITY_FALSE = @CONSTRUCTOR_PRIORITY_FALSE@
-CONSTRUCTOR_PRIORITY_TRUE = @CONSTRUCTOR_PRIORITY_TRUE@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATADIRNAME = @DATADIRNAME@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FN_PTRS_IN_SO_WITHOUT_PIC_FALSE = @FN_PTRS_IN_SO_WITHOUT_PIC_FALSE@
-FN_PTRS_IN_SO_WITHOUT_PIC_TRUE = @FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@
-GCC_FALSE = @GCC_FALSE@
-GCC_TRUE = @GCC_TRUE@
-GENCAT = @GENCAT@
-GMSGFMT = @GMSGFMT@
-HAVE_ZLIB_FALSE = @HAVE_ZLIB_FALSE@
-HAVE_ZLIB_TRUE = @HAVE_ZLIB_TRUE@
-INCINTL = @INCINTL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INSTOBJEXT = @INSTOBJEXT@
-LDFLAGS = @LDFLAGS@
-LFS_CFLAGS = @LFS_CFLAGS@
-LIBINTL = @LIBINTL@
-LIBINTL_DEP = @LIBINTL_DEP@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-MSGMERGE = @MSGMERGE@
-NATIVE_LINKER_FALSE = @NATIVE_LINKER_FALSE@
-NATIVE_LINKER_TRUE = @NATIVE_LINKER_TRUE@
-NO_WERROR = @NO_WERROR@
-OBJEXT = @OBJEXT@
-OMP_SUPPORT_FALSE = @OMP_SUPPORT_FALSE@
-OMP_SUPPORT_TRUE = @OMP_SUPPORT_TRUE@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POSUB = @POSUB@
-RANDOM_SEED_CFLAGS = @RANDOM_SEED_CFLAGS@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STATIC_TLS_FALSE = @STATIC_TLS_FALSE@
-STATIC_TLS_TRUE = @STATIC_TLS_TRUE@
-STRIP = @STRIP@
-TARGETOBJS = @TARGETOBJS@
-THREADS_FALSE = @THREADS_FALSE@
-THREADS_TRUE = @THREADS_TRUE@
-TLS_DESCRIPTORS_FALSE = @TLS_DESCRIPTORS_FALSE@
-TLS_DESCRIPTORS_TRUE = @TLS_DESCRIPTORS_TRUE@
-TLS_FALSE = @TLS_FALSE@
-TLS_GNU2_DIALECT_FALSE = @TLS_GNU2_DIALECT_FALSE@
-TLS_GNU2_DIALECT_TRUE = @TLS_GNU2_DIALECT_TRUE@
-TLS_TRUE = @TLS_TRUE@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-WARN_CFLAGS = @WARN_CFLAGS@
-WARN_CXXFLAGS = @WARN_CXXFLAGS@
-XGETTEXT = @XGETTEXT@
-YACC = @YACC@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-AUTOMAKE_OPTIONS =
-SUBDIRS = po testsuite
-tooldir = $(exec_prefix)/$(target_alias)
-ACLOCAL_AMFLAGS = -I ../bfd -I ../config
-AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS)
-AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS)
-INCLUDES = \
- -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../elfcpp \
- -DLOCALEDIR="\"$(datadir)/locale\"" \
- -DBINDIR="\"$(bindir)\"" -DTOOLBINDIR="\"$(tooldir)/bin\"" \
- @INCINTL@
-
-LIBIBERTY = ../libiberty/libiberty.a
-@THREADS_TRUE@THREADSLIB = -lpthread
-AM_YFLAGS = -d
-noinst_LIBRARIES = libgold.a
-CCFILES = \
- archive.cc \
- binary.cc \
- common.cc \
- compressed_output.cc \
- copy-relocs.cc \
- cref.cc \
- defstd.cc \
- descriptors.cc \
- dirsearch.cc \
- dynobj.cc \
- dwarf_reader.cc \
- ehframe.cc \
- errors.cc \
- expression.cc \
- fileread.cc \
- gold.cc \
- gold-threads.cc \
- layout.cc \
- mapfile.cc \
- merge.cc \
- object.cc \
- options.cc \
- output.cc \
- parameters.cc \
- readsyms.cc \
- reduced_debug_output.cc \
- reloc.cc \
- resolve.cc \
- script-sections.cc \
- script.cc \
- stringpool.cc \
- symtab.cc \
- target-select.cc \
- version.cc \
- workqueue.cc \
- workqueue-threads.cc
-
-HFILES = \
- archive.h \
- binary.h \
- common.h \
- compressed_output.h \
- copy-relocs.h \
- cref.h \
- defstd.h \
- dirsearch.h \
- descriptors.h \
- dynobj.h \
- dwarf_reader.h \
- ehframe.h \
- errors.h \
- fileread.h \
- gold.h \
- gold-threads.h \
- layout.h \
- mapfile.h \
- merge.h \
- object.h \
- options.h \
- output.h \
- parameters.h \
- readsyms.h \
- reduced_debug_output.h \
- reloc.h \
- reloc-types.h \
- script-c.h \
- script-sections.h \
- script.h \
- stringpool.h \
- symtab.h \
- target.h \
- target-reloc.h \
- target-select.h \
- tls.h \
- token.h \
- workqueue.h \
- workqueue-internal.h
-
-YFILES = \
- yyscript.y
-
-EXTRA_DIST = yyscript.c yyscript.h
-TARGETSOURCES = \
- i386.cc x86_64.cc sparc.cc powerpc.cc
-
-ALL_TARGETOBJS = \
- i386.$(OBJEXT) x86_64.$(OBJEXT) sparc.$(OBJEXT) powerpc.$(OBJEXT)
-
-libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES)
-sources_var = main.cc
-deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
-ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) $(THREADSLIB)
-ld_new_SOURCES = $(sources_var)
-ld_new_DEPENDENCIES = $(deps_var) $(LIBOBJS)
-ld_new_LDADD = $(ldadd_var) $(LIBOBJS)
-EXTRA_ld_new_SOURCES = $(TARGETSOURCES)
-POTFILES = $(CCFILES) $(HFILES) $(TARGETSOURCES)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_SOURCES = $(sources_var)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_LDADD = $(ldadd_var)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_LDFLAGS = -Bgcctestdir1/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_SOURCES = $(sources_var)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_LDADD = $(ldadd_var)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_LDFLAGS = -Bgcctestdir2/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_r_SOURCES = $(sources_var)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_r_DEPENDENCIES = libgold-1-r.o $(deps_var) gcctestdir1/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_r_LDADD = libgold-1-r.o $(ldadd_var)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_r_LDFLAGS = -Bgcctestdir1/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_r_SOURCES = $(sources_var)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_r_DEPENDENCIES = libgold-2-r.o $(deps_var) gcctestdir2-r/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_r_LDADD = libgold-2-r.o $(ldadd_var)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_r_LDFLAGS = -Bgcctestdir2-r/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@TESTS = bootstrap-test bootstrap-test-r
-all: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .c .cc .o .obj .y
-am--refresh:
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
- cd $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-
-config.h: stamp-h1
- @if test ! -f $@; then \
- rm -f stamp-h1; \
- $(MAKE) stamp-h1; \
- else :; fi
-
-stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_srcdir) && $(AUTOHEADER)
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f config.h stamp-h1
-po/Makefile.in: $(top_builddir)/config.status $(top_srcdir)/po/Make-in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-yyscript.h: yyscript.c
- @if test ! -f $@; then \
- rm -f yyscript.c; \
- $(MAKE) yyscript.c; \
- else :; fi
-libgold.a: $(libgold_a_OBJECTS) $(libgold_a_DEPENDENCIES)
- -rm -f libgold.a
- $(libgold_a_AR) libgold.a $(libgold_a_OBJECTS) $(libgold_a_LIBADD)
- $(RANLIB) libgold.a
-
-clean-checkPROGRAMS:
- -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
-
-clean-noinstPROGRAMS:
- -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES)
- @rm -f ld-new$(EXEEXT)
- $(CXXLINK) $(ld_new_LDFLAGS) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS)
-ld1$(EXEEXT): $(ld1_OBJECTS) $(ld1_DEPENDENCIES)
- @rm -f ld1$(EXEEXT)
- $(CXXLINK) $(ld1_LDFLAGS) $(ld1_OBJECTS) $(ld1_LDADD) $(LIBS)
-ld1-r$(EXEEXT): $(ld1_r_OBJECTS) $(ld1_r_DEPENDENCIES)
- @rm -f ld1-r$(EXEEXT)
- $(CXXLINK) $(ld1_r_LDFLAGS) $(ld1_r_OBJECTS) $(ld1_r_LDADD) $(LIBS)
-ld2$(EXEEXT): $(ld2_OBJECTS) $(ld2_DEPENDENCIES)
- @rm -f ld2$(EXEEXT)
- $(CXXLINK) $(ld2_LDFLAGS) $(ld2_OBJECTS) $(ld2_LDADD) $(LIBS)
-ld2-r$(EXEEXT): $(ld2_r_OBJECTS) $(ld2_r_DEPENDENCIES)
- @rm -f ld2-r$(EXEEXT)
- $(CXXLINK) $(ld2_r_LDFLAGS) $(ld2_r_OBJECTS) $(ld2_r_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pread.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/archive.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binary.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compressed_output.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copy-relocs.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cref.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defstd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/descriptors.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirsearch.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynobj.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ehframe.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errors.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expression.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileread.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gold-threads.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gold.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layout.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mapfile.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/merge.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parameters.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/powerpc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readsyms.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reduced_debug_output.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reloc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/script-sections.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/script.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stringpool.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symtab.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/target-select.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/workqueue-threads.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/workqueue.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x86_64.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yyscript.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.cc.o:
-@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
-
-.cc.obj:
-@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.y.c:
- $(YACCCOMPILE) $<
- if test -f y.tab.h; then \
- to=`echo "$*_H" | sed \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
- -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \
- sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|$*.h|" \
- y.tab.h >$*.ht; \
- rm -f y.tab.h; \
- if cmp -s $*.ht $*.h; then \
- rm -f $*.ht ;\
- else \
- mv $*.ht $*.h; \
- fi; \
- fi
- if test -f y.output; then \
- mv y.output $*.output; \
- fi
- sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@t && mv $@t $@
- rm -f y.tab.c
-uninstall-info-am:
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-check-TESTS: $(TESTS)
- @failed=0; all=0; xfail=0; xpass=0; skip=0; \
- srcdir=$(srcdir); export srcdir; \
- list='$(TESTS)'; \
- if test -n "$$list"; then \
- for tst in $$list; do \
- if test -f ./$$tst; then dir=./; \
- elif test -f $$tst; then dir=; \
- else dir="$(srcdir)/"; fi; \
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *" $$tst "*) \
- xpass=`expr $$xpass + 1`; \
- failed=`expr $$failed + 1`; \
- echo "XPASS: $$tst"; \
- ;; \
- *) \
- echo "PASS: $$tst"; \
- ;; \
- esac; \
- elif test $$? -ne 77; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *" $$tst "*) \
- xfail=`expr $$xfail + 1`; \
- echo "XFAIL: $$tst"; \
- ;; \
- *) \
- failed=`expr $$failed + 1`; \
- echo "FAIL: $$tst"; \
- ;; \
- esac; \
- else \
- skip=`expr $$skip + 1`; \
- echo "SKIP: $$tst"; \
- fi; \
- done; \
- if test "$$failed" -eq 0; then \
- if test "$$xfail" -eq 0; then \
- banner="All $$all tests passed"; \
- else \
- banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
- fi; \
- else \
- if test "$$xpass" -eq 0; then \
- banner="$$failed of $$all tests failed"; \
- else \
- banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
- fi; \
- fi; \
- dashes="$$banner"; \
- skipped=""; \
- if test "$$skip" -ne 0; then \
- skipped="($$skip tests were not run)"; \
- test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$skipped"; \
- fi; \
- report=""; \
- if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
- report="Please report to $(PACKAGE_BUGREPORT)"; \
- test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$report"; \
- fi; \
- dashes=`echo "$$dashes" | sed s/./=/g`; \
- echo "$$dashes"; \
- echo "$$banner"; \
- test -z "$$skipped" || echo "$$skipped"; \
- test -z "$$report" || echo "$$report"; \
- echo "$$dashes"; \
- test "$$failed" -eq 0; \
- else :; fi
-
-distdir: $(DISTFILES)
- $(am__remove_distdir)
- mkdir $(distdir)
- $(mkdir_p) $(distdir)/.. $(distdir)/../bfd $(distdir)/../config $(distdir)/po
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test -d "$(distdir)/$$subdir" \
- || $(mkdir_p) "$(distdir)/$$subdir" \
- || exit 1; \
- distdir=`$(am__cd) $(distdir) && pwd`; \
- top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
- (cd $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$top_distdir" \
- distdir="$$distdir/$$subdir" \
- distdir) \
- || exit 1; \
- fi; \
- done
- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r $(distdir)
-dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
-
-dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
- $(am__remove_distdir)
-
-dist-tarZ: distdir
- tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__remove_distdir)
-
-dist-shar: distdir
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- $(am__remove_distdir)
-
-dist-zip: distdir
- -rm -f $(distdir).zip
- zip -rq $(distdir).zip $(distdir)
- $(am__remove_distdir)
-
-dist dist-all: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- case '$(DIST_ARCHIVES)' in \
- *.tar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
- *.tar.bz2*) \
- bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.Z*) \
- uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
- *.shar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
- *.zip*) \
- unzip $(distdir).zip ;;\
- esac
- chmod -R a-w $(distdir); chmod a+w $(distdir)
- mkdir $(distdir)/_build
- mkdir $(distdir)/_inst
- chmod a-w $(distdir)
- dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
- && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && cd $(distdir)/_build \
- && ../configure --srcdir=.. --prefix="$$dc_install_base" \
- $(DISTCHECK_CONFIGURE_FLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
- distuninstallcheck \
- && chmod -R a-w "$$dc_install_base" \
- && ({ \
- (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
- distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
- } || { rm -rf "$$dc_destdir"; exit 1; }) \
- && rm -rf "$$dc_destdir" \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
- $(am__remove_distdir)
- @(echo "$(distdir) archives ready for distribution: "; \
- list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
-distuninstallcheck:
- @cd $(distuninstallcheck_dir) \
- && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
- || { echo "ERROR: files left after uninstall:" ; \
- if test -n "$(DESTDIR)"; then \
- echo " (check DESTDIR support)"; \
- fi ; \
- $(distuninstallcheck_listfiles) ; \
- exit 1; } >&2
-distcleancheck: distclean
- @if test '$(srcdir)' = . ; then \
- echo "ERROR: distcleancheck can only run from a VPATH build" ; \
- exit 1 ; \
- fi
- @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left in build directory after distclean:" ; \
- $(distcleancheck_listfiles) ; \
- exit 1; } >&2
-check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
- $(MAKE) $(AM_MAKEFLAGS) check-TESTS
-check: check-recursive
-all-am: Makefile $(LIBRARIES) $(PROGRAMS) config.h
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -rm -f yyscript.c
- -rm -f yyscript.h
-clean: clean-recursive
-
-clean-am: clean-checkPROGRAMS clean-generic clean-noinstLIBRARIES \
- clean-noinstPROGRAMS mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(DEPDIR) ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-hdr distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-info: info-recursive
-
-info-am:
-
-install-data-am: install-data-local
-
-install-exec-am: install-exec-local
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf $(DEPDIR) ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-info-am
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
- check-TESTS check-am clean clean-checkPROGRAMS clean-generic \
- clean-noinstLIBRARIES clean-noinstPROGRAMS clean-recursive \
- ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
- dist-shar dist-tarZ dist-zip distcheck distclean \
- distclean-compile distclean-generic distclean-hdr \
- distclean-recursive distclean-tags distcleancheck distdir \
- distuninstallcheck dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am \
- install-data-local install-exec install-exec-am \
- install-exec-local install-info install-info-am install-man \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- maintainer-clean-recursive mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \
- tags tags-recursive uninstall uninstall-am uninstall-info-am
-
-
-# Use an explicit dependency for the bison generated header file.
-expression.$(OBJEXT): yyscript.h
-script-sections.$(OBJEXT): yyscript.h
-script.$(OBJEXT): yyscript.h
-
-# We have to build libgold.a before we run the tests.
-check: libgold.a
-
-.PHONY: install-exec-local
-
-install-exec-local: ld-new$(EXEEXT)
- $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
- n=`echo ld | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
- if test "$(bindir)" != "$(tooldir)/bin"; then \
- rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
- ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
- || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
- fi
-
-# We want install to imply install-info as per GNU standards, despite
-# the cygnus option.
-install-data-local: install-info
-
-po/POTFILES.in: @MAINT@ Makefile
- for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
- && mv tmp $(srcdir)/po/POTFILES.in
-
-# Bootstrap test support. We use ld-new to build ld1, then use ld1 to
-# build ld2. ld1 and ld2 should be identical. ld-new need not be
-# identical to ld1, since it was linked with the host linker.
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gcctestdir1/ld: ld-new
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ test -d gcctestdir1 || mkdir -p gcctestdir1
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f gcctestdir1/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ (cd gcctestdir1 && $(LN_S) ../ld-new ld)
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gcctestdir2/ld: ld1
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ test -d gcctestdir2 || mkdir -p gcctestdir2
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f gcctestdir2/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ (cd gcctestdir2 && $(LN_S) ../ld1 ld)
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@bootstrap-test: ld2
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "#!/bin/sh" > $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "cmp ld1 ld2" > $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ chmod +x $@
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@libgold-1-r.o: gcctestdir1/ld libgold.a
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir1/ld -o $@ -r --whole-archive libgold.a
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gcctestdir2-r/ld: ld1-r
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ test -d gcctestdir2-r || mkdir -p gcctestdir2-r
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f gcctestdir2-r/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ (cd gcctestdir2-r && $(LN_S) ../ld1-r ld)
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@libgold-2-r.o: gcctestdir2-r/ld libgold.a
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir2-r/ld -o $@ -r --whole-archive libgold.a
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@bootstrap-test-r: ld2-r
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "#!/bin/sh" > $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "cmp ld1-r ld2-r" > $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ chmod +x $@
-# 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:
diff --git a/gold/i386.cc b/gold/i386.cc
deleted file mode 100644
index 54f123333b7..00000000000
--- a/gold/i386.cc
+++ /dev/null
@@ -1,2610 +0,0 @@
-// i386.cc -- i386 target support for gold.
-
-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
-// Written by Ian Lance Taylor <iant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-#include "gold.h"
-
-#include <cstring>
-
-#include "elfcpp.h"
-#include "parameters.h"
-#include "reloc.h"
-#include "i386.h"
-#include "object.h"
-#include "symtab.h"
-#include "layout.h"
-#include "output.h"
-#include "copy-relocs.h"
-#include "target.h"
-#include "target-reloc.h"
-#include "target-select.h"
-#include "tls.h"
-
-namespace
-{
-
-using namespace gold;
-
-class Output_data_plt_i386;
-
-// The i386 target class.
-// TLS info comes from
-// http://people.redhat.com/drepper/tls.pdf
-// http://www.lsd.ic.unicamp.br/~oliva/writeups/TLS/RFC-TLSDESC-x86.txt
-
-class Target_i386 : public Sized_target<32, false>
-{
- public:
- typedef Output_data_reloc<elfcpp::SHT_REL, true, 32, false> Reloc_section;
-
- Target_i386()
- : Sized_target<32, false>(&i386_info),
- got_(NULL), plt_(NULL), got_plt_(NULL), rel_dyn_(NULL),
- copy_relocs_(elfcpp::R_386_COPY), dynbss_(NULL),
- got_mod_index_offset_(-1U), tls_base_symbol_defined_(false)
- { }
-
- // Scan the relocations to look for symbol adjustments.
- void
- scan_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<32, false>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols);
-
- // Finalize the sections.
- void
- do_finalize_sections(Layout*);
-
- // Return the value to use for a dynamic which requires special
- // treatment.
- uint64_t
- do_dynsym_value(const Symbol*) const;
-
- // Relocate a section.
- void
- relocate_section(const Relocate_info<32, false>*,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- unsigned char* view,
- elfcpp::Elf_types<32>::Elf_Addr view_address,
- section_size_type view_size);
-
- // Scan the relocs during a relocatable link.
- void
- scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<32, false>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols,
- Relocatable_relocs*);
-
- // Relocate a section during a relocatable link.
- void
- relocate_for_relocatable(const Relocate_info<32, false>*,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- off_t offset_in_output_section,
- const Relocatable_relocs*,
- unsigned char* view,
- elfcpp::Elf_types<32>::Elf_Addr view_address,
- section_size_type view_size,
- unsigned char* reloc_view,
- section_size_type reloc_view_size);
-
- // Return a string used to fill a code section with nops.
- std::string
- do_code_fill(section_size_type length) const;
-
- // Return whether SYM is defined by the ABI.
- bool
- do_is_defined_by_abi(Symbol* sym) const
- { return strcmp(sym->name(), "___tls_get_addr") == 0; }
-
- // Return the size of the GOT section.
- section_size_type
- got_size()
- {
- gold_assert(this->got_ != NULL);
- return this->got_->data_size();
- }
-
- private:
- // The class which scans relocations.
- struct Scan
- {
- inline void
- local(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_i386* target,
- Sized_relobj<32, false>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rel<32, false>& reloc, unsigned int r_type,
- const elfcpp::Sym<32, false>& lsym);
-
- inline void
- global(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_i386* target,
- Sized_relobj<32, false>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rel<32, false>& reloc, unsigned int r_type,
- Symbol* gsym);
-
- static void
- unsupported_reloc_local(Sized_relobj<32, false>*, unsigned int r_type);
-
- static void
- unsupported_reloc_global(Sized_relobj<32, false>*, unsigned int r_type,
- Symbol*);
- };
-
- // The class which implements relocation.
- class Relocate
- {
- public:
- Relocate()
- : skip_call_tls_get_addr_(false),
- local_dynamic_type_(LOCAL_DYNAMIC_NONE)
- { }
-
- ~Relocate()
- {
- if (this->skip_call_tls_get_addr_)
- {
- // FIXME: This needs to specify the location somehow.
- gold_error(_("missing expected TLS relocation"));
- }
- }
-
- // Return whether the static relocation needs to be applied.
- inline bool
- should_apply_static_reloc(const Sized_symbol<32>* gsym,
- int ref_flags,
- bool is_32bit);
-
- // Do a relocation. Return false if the caller should not issue
- // any warnings about this relocation.
- inline bool
- relocate(const Relocate_info<32, false>*, Target_i386*, size_t relnum,
- const elfcpp::Rel<32, false>&,
- unsigned int r_type, const Sized_symbol<32>*,
- const Symbol_value<32>*,
- unsigned char*, elfcpp::Elf_types<32>::Elf_Addr,
- section_size_type);
-
- private:
- // Do a TLS relocation.
- inline void
- relocate_tls(const Relocate_info<32, false>*, Target_i386* target,
- size_t relnum, const elfcpp::Rel<32, false>&,
- unsigned int r_type, const Sized_symbol<32>*,
- const Symbol_value<32>*,
- unsigned char*, elfcpp::Elf_types<32>::Elf_Addr,
- section_size_type);
-
- // Do a TLS General-Dynamic to Initial-Exec transition.
- inline void
- tls_gd_to_ie(const Relocate_info<32, false>*, size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rel<32, false>&, unsigned int r_type,
- elfcpp::Elf_types<32>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size);
-
- // Do a TLS General-Dynamic to Local-Exec transition.
- inline void
- tls_gd_to_le(const Relocate_info<32, false>*, size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rel<32, false>&, unsigned int r_type,
- elfcpp::Elf_types<32>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size);
-
- // Do a TLS_GOTDESC or TLS_DESC_CALL General-Dynamic to Initial-Exec
- // transition.
- inline void
- tls_desc_gd_to_ie(const Relocate_info<32, false>*, size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rel<32, false>&, unsigned int r_type,
- elfcpp::Elf_types<32>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size);
-
- // Do a TLS_GOTDESC or TLS_DESC_CALL General-Dynamic to Local-Exec
- // transition.
- inline void
- tls_desc_gd_to_le(const Relocate_info<32, false>*, size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rel<32, false>&, unsigned int r_type,
- elfcpp::Elf_types<32>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size);
-
- // Do a TLS Local-Dynamic to Local-Exec transition.
- inline void
- tls_ld_to_le(const Relocate_info<32, false>*, size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rel<32, false>&, unsigned int r_type,
- elfcpp::Elf_types<32>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size);
-
- // Do a TLS Initial-Exec to Local-Exec transition.
- static inline void
- tls_ie_to_le(const Relocate_info<32, false>*, size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rel<32, false>&, unsigned int r_type,
- elfcpp::Elf_types<32>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size);
-
- // We need to keep track of which type of local dynamic relocation
- // we have seen, so that we can optimize R_386_TLS_LDO_32 correctly.
- enum Local_dynamic_type
- {
- LOCAL_DYNAMIC_NONE,
- LOCAL_DYNAMIC_SUN,
- LOCAL_DYNAMIC_GNU
- };
-
- // This is set if we should skip the next reloc, which should be a
- // PLT32 reloc against ___tls_get_addr.
- bool skip_call_tls_get_addr_;
- // The type of local dynamic relocation we have seen in the section
- // being relocated, if any.
- Local_dynamic_type local_dynamic_type_;
- };
-
- // A class which returns the size required for a relocation type,
- // used while scanning relocs during a relocatable link.
- class Relocatable_size_for_reloc
- {
- public:
- unsigned int
- get_size_for_reloc(unsigned int, Relobj*);
- };
-
- // Adjust TLS relocation type based on the options and whether this
- // is a local symbol.
- static tls::Tls_optimization
- optimize_tls_reloc(bool is_final, int r_type);
-
- // Get the GOT section, creating it if necessary.
- Output_data_got<32, false>*
- got_section(Symbol_table*, Layout*);
-
- // Get the GOT PLT section.
- Output_data_space*
- got_plt_section() const
- {
- gold_assert(this->got_plt_ != NULL);
- return this->got_plt_;
- }
-
- // Create a PLT entry for a global symbol.
- void
- make_plt_entry(Symbol_table*, Layout*, Symbol*);
-
- // Define the _TLS_MODULE_BASE_ symbol at the end of the TLS segment.
- void
- define_tls_base_symbol(Symbol_table*, Layout*);
-
- // Create a GOT entry for the TLS module index.
- unsigned int
- got_mod_index_entry(Symbol_table* symtab, Layout* layout,
- Sized_relobj<32, false>* object);
-
- // Get the PLT section.
- const Output_data_plt_i386*
- plt_section() const
- {
- gold_assert(this->plt_ != NULL);
- return this->plt_;
- }
-
- // Get the dynamic reloc section, creating it if necessary.
- Reloc_section*
- rel_dyn_section(Layout*);
-
- // Return true if the symbol may need a COPY relocation.
- // References from an executable object to non-function symbols
- // defined in a dynamic object may need a COPY relocation.
- bool
- may_need_copy_reloc(Symbol* gsym)
- {
- return (!parameters->options().shared()
- && gsym->is_from_dynobj()
- && gsym->type() != elfcpp::STT_FUNC);
- }
-
- // Add a potential copy relocation.
- void
- copy_reloc(Symbol_table* symtab, Layout* layout,
- Sized_relobj<32, false>* object,
- unsigned int shndx, Output_section* output_section,
- Symbol* sym, const elfcpp::Rel<32, false>& reloc)
- {
- this->copy_relocs_.copy_reloc(symtab, layout,
- symtab->get_sized_symbol<32>(sym),
- object, shndx, output_section, reloc,
- this->rel_dyn_section(layout));
- }
-
- // Information about this specific target which we pass to the
- // general Target structure.
- static const Target::Target_info i386_info;
-
- // The types of GOT entries needed for this platform.
- enum Got_type
- {
- GOT_TYPE_STANDARD = 0, // GOT entry for a regular symbol
- GOT_TYPE_TLS_NOFFSET = 1, // GOT entry for negative TLS offset
- GOT_TYPE_TLS_OFFSET = 2, // GOT entry for positive TLS offset
- GOT_TYPE_TLS_PAIR = 3, // GOT entry for TLS module/offset pair
- GOT_TYPE_TLS_DESC = 4 // GOT entry for TLS_DESC pair
- };
-
- // The GOT section.
- Output_data_got<32, false>* got_;
- // The PLT section.
- Output_data_plt_i386* plt_;
- // The GOT PLT section.
- Output_data_space* got_plt_;
- // The dynamic reloc section.
- Reloc_section* rel_dyn_;
- // Relocs saved to avoid a COPY reloc.
- Copy_relocs<elfcpp::SHT_REL, 32, false> copy_relocs_;
- // Space for variables copied with a COPY reloc.
- Output_data_space* dynbss_;
- // Offset of the GOT entry for the TLS module index.
- unsigned int got_mod_index_offset_;
- // True if the _TLS_MODULE_BASE_ symbol has been defined.
- bool tls_base_symbol_defined_;
-};
-
-const Target::Target_info Target_i386::i386_info =
-{
- 32, // size
- false, // is_big_endian
- elfcpp::EM_386, // machine_code
- false, // has_make_symbol
- false, // has_resolve
- true, // has_code_fill
- true, // is_default_stack_executable
- '\0', // wrap_char
- "/usr/lib/libc.so.1", // dynamic_linker
- 0x08048000, // default_text_segment_address
- 0x1000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000 // common_pagesize (overridable by -z common-page-size)
-};
-
-// Get the GOT section, creating it if necessary.
-
-Output_data_got<32, false>*
-Target_i386::got_section(Symbol_table* symtab, Layout* layout)
-{
- if (this->got_ == NULL)
- {
- gold_assert(symtab != NULL && layout != NULL);
-
- this->got_ = new Output_data_got<32, false>();
-
- Output_section* os;
- os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
- (elfcpp::SHF_ALLOC
- | elfcpp::SHF_WRITE),
- this->got_);
- os->set_is_relro();
-
- // The old GNU linker creates a .got.plt section. We just
- // create another set of data in the .got section. Note that we
- // always create a PLT if we create a GOT, although the PLT
- // might be empty.
- this->got_plt_ = new Output_data_space(4, "** GOT PLT");
- os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
- (elfcpp::SHF_ALLOC
- | elfcpp::SHF_WRITE),
- this->got_plt_);
- os->set_is_relro();
-
- // The first three entries are reserved.
- this->got_plt_->set_current_data_size(3 * 4);
-
- // Define _GLOBAL_OFFSET_TABLE_ at the start of the PLT.
- symtab->define_in_output_data("_GLOBAL_OFFSET_TABLE_", NULL,
- this->got_plt_,
- 0, 0, elfcpp::STT_OBJECT,
- elfcpp::STB_LOCAL,
- elfcpp::STV_HIDDEN, 0,
- false, false);
- }
-
- return this->got_;
-}
-
-// Get the dynamic reloc section, creating it if necessary.
-
-Target_i386::Reloc_section*
-Target_i386::rel_dyn_section(Layout* layout)
-{
- if (this->rel_dyn_ == NULL)
- {
- gold_assert(layout != NULL);
- this->rel_dyn_ = new Reloc_section(parameters->options().combreloc());
- layout->add_output_section_data(".rel.dyn", elfcpp::SHT_REL,
- elfcpp::SHF_ALLOC, this->rel_dyn_);
- }
- return this->rel_dyn_;
-}
-
-// A class to handle the PLT data.
-
-class Output_data_plt_i386 : public Output_section_data
-{
- public:
- typedef Output_data_reloc<elfcpp::SHT_REL, true, 32, false> Reloc_section;
-
- Output_data_plt_i386(Layout*, Output_data_space*);
-
- // Add an entry to the PLT.
- void
- add_entry(Symbol* gsym);
-
- // Return the .rel.plt section data.
- const Reloc_section*
- rel_plt() const
- { return this->rel_; }
-
- protected:
- void
- do_adjust_output_section(Output_section* os);
-
- // Write to a map file.
- void
- do_print_to_mapfile(Mapfile* mapfile) const
- { mapfile->print_output_data(this, _("** PLT")); }
-
- private:
- // The size of an entry in the PLT.
- static const int plt_entry_size = 16;
-
- // The first entry in the PLT for an executable.
- static unsigned char exec_first_plt_entry[plt_entry_size];
-
- // The first entry in the PLT for a shared object.
- static unsigned char dyn_first_plt_entry[plt_entry_size];
-
- // Other entries in the PLT for an executable.
- static unsigned char exec_plt_entry[plt_entry_size];
-
- // Other entries in the PLT for a shared object.
- static unsigned char dyn_plt_entry[plt_entry_size];
-
- // Set the final size.
- void
- set_final_data_size()
- { this->set_data_size((this->count_ + 1) * plt_entry_size); }
-
- // Write out the PLT data.
- void
- do_write(Output_file*);
-
- // The reloc section.
- Reloc_section* rel_;
- // The .got.plt section.
- Output_data_space* got_plt_;
- // The number of PLT entries.
- unsigned int count_;
-};
-
-// Create the PLT section. The ordinary .got section is an argument,
-// since we need to refer to the start. We also create our own .got
-// section just for PLT entries.
-
-Output_data_plt_i386::Output_data_plt_i386(Layout* layout,
- Output_data_space* got_plt)
- : Output_section_data(4), got_plt_(got_plt), count_(0)
-{
- this->rel_ = new Reloc_section(false);
- layout->add_output_section_data(".rel.plt", elfcpp::SHT_REL,
- elfcpp::SHF_ALLOC, this->rel_);
-}
-
-void
-Output_data_plt_i386::do_adjust_output_section(Output_section* os)
-{
- // UnixWare sets the entsize of .plt to 4, and so does the old GNU
- // linker, and so do we.
- os->set_entsize(4);
-}
-
-// Add an entry to the PLT.
-
-void
-Output_data_plt_i386::add_entry(Symbol* gsym)
-{
- gold_assert(!gsym->has_plt_offset());
-
- // Note that when setting the PLT offset we skip the initial
- // reserved PLT entry.
- gsym->set_plt_offset((this->count_ + 1) * plt_entry_size);
-
- ++this->count_;
-
- section_offset_type got_offset = this->got_plt_->current_data_size();
-
- // Every PLT entry needs a GOT entry which points back to the PLT
- // entry (this will be changed by the dynamic linker, normally
- // lazily when the function is called).
- this->got_plt_->set_current_data_size(got_offset + 4);
-
- // Every PLT entry needs a reloc.
- gsym->set_needs_dynsym_entry();
- this->rel_->add_global(gsym, elfcpp::R_386_JUMP_SLOT, this->got_plt_,
- got_offset);
-
- // Note that we don't need to save the symbol. The contents of the
- // PLT are independent of which symbols are used. The symbols only
- // appear in the relocations.
-}
-
-// The first entry in the PLT for an executable.
-
-unsigned char Output_data_plt_i386::exec_first_plt_entry[plt_entry_size] =
-{
- 0xff, 0x35, // pushl contents of memory address
- 0, 0, 0, 0, // replaced with address of .got + 4
- 0xff, 0x25, // jmp indirect
- 0, 0, 0, 0, // replaced with address of .got + 8
- 0, 0, 0, 0 // unused
-};
-
-// The first entry in the PLT for a shared object.
-
-unsigned char Output_data_plt_i386::dyn_first_plt_entry[plt_entry_size] =
-{
- 0xff, 0xb3, 4, 0, 0, 0, // pushl 4(%ebx)
- 0xff, 0xa3, 8, 0, 0, 0, // jmp *8(%ebx)
- 0, 0, 0, 0 // unused
-};
-
-// Subsequent entries in the PLT for an executable.
-
-unsigned char Output_data_plt_i386::exec_plt_entry[plt_entry_size] =
-{
- 0xff, 0x25, // jmp indirect
- 0, 0, 0, 0, // replaced with address of symbol in .got
- 0x68, // pushl immediate
- 0, 0, 0, 0, // replaced with offset into relocation table
- 0xe9, // jmp relative
- 0, 0, 0, 0 // replaced with offset to start of .plt
-};
-
-// Subsequent entries in the PLT for a shared object.
-
-unsigned char Output_data_plt_i386::dyn_plt_entry[plt_entry_size] =
-{
- 0xff, 0xa3, // jmp *offset(%ebx)
- 0, 0, 0, 0, // replaced with offset of symbol in .got
- 0x68, // pushl immediate
- 0, 0, 0, 0, // replaced with offset into relocation table
- 0xe9, // jmp relative
- 0, 0, 0, 0 // replaced with offset to start of .plt
-};
-
-// Write out the PLT. This uses the hand-coded instructions above,
-// and adjusts them as needed. This is all specified by the i386 ELF
-// Processor Supplement.
-
-void
-Output_data_plt_i386::do_write(Output_file* of)
-{
- const off_t offset = this->offset();
- const section_size_type oview_size =
- convert_to_section_size_type(this->data_size());
- unsigned char* const oview = of->get_output_view(offset, oview_size);
-
- const off_t got_file_offset = this->got_plt_->offset();
- const section_size_type got_size =
- convert_to_section_size_type(this->got_plt_->data_size());
- unsigned char* const got_view = of->get_output_view(got_file_offset,
- got_size);
-
- unsigned char* pov = oview;
-
- elfcpp::Elf_types<32>::Elf_Addr plt_address = this->address();
- elfcpp::Elf_types<32>::Elf_Addr got_address = this->got_plt_->address();
-
- if (parameters->options().shared())
- memcpy(pov, dyn_first_plt_entry, plt_entry_size);
- else
- {
- memcpy(pov, exec_first_plt_entry, plt_entry_size);
- elfcpp::Swap_unaligned<32, false>::writeval(pov + 2, got_address + 4);
- elfcpp::Swap<32, false>::writeval(pov + 8, got_address + 8);
- }
- pov += plt_entry_size;
-
- unsigned char* got_pov = got_view;
-
- memset(got_pov, 0, 12);
- got_pov += 12;
-
- const int rel_size = elfcpp::Elf_sizes<32>::rel_size;
-
- unsigned int plt_offset = plt_entry_size;
- unsigned int plt_rel_offset = 0;
- unsigned int got_offset = 12;
- const unsigned int count = this->count_;
- for (unsigned int i = 0;
- i < count;
- ++i,
- pov += plt_entry_size,
- got_pov += 4,
- plt_offset += plt_entry_size,
- plt_rel_offset += rel_size,
- got_offset += 4)
- {
- // Set and adjust the PLT entry itself.
-
- if (parameters->options().shared())
- {
- memcpy(pov, dyn_plt_entry, plt_entry_size);
- elfcpp::Swap_unaligned<32, false>::writeval(pov + 2, got_offset);
- }
- else
- {
- memcpy(pov, exec_plt_entry, plt_entry_size);
- elfcpp::Swap_unaligned<32, false>::writeval(pov + 2,
- (got_address
- + got_offset));
- }
-
- elfcpp::Swap_unaligned<32, false>::writeval(pov + 7, plt_rel_offset);
- elfcpp::Swap<32, false>::writeval(pov + 12,
- - (plt_offset + plt_entry_size));
-
- // Set the entry in the GOT.
- elfcpp::Swap<32, false>::writeval(got_pov, plt_address + plt_offset + 6);
- }
-
- gold_assert(static_cast<section_size_type>(pov - oview) == oview_size);
- gold_assert(static_cast<section_size_type>(got_pov - got_view) == got_size);
-
- of->write_output_view(offset, oview_size, oview);
- of->write_output_view(got_file_offset, got_size, got_view);
-}
-
-// Create a PLT entry for a global symbol.
-
-void
-Target_i386::make_plt_entry(Symbol_table* symtab, Layout* layout, Symbol* gsym)
-{
- if (gsym->has_plt_offset())
- return;
-
- if (this->plt_ == NULL)
- {
- // Create the GOT sections first.
- this->got_section(symtab, layout);
-
- this->plt_ = new Output_data_plt_i386(layout, this->got_plt_);
- layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
- (elfcpp::SHF_ALLOC
- | elfcpp::SHF_EXECINSTR),
- this->plt_);
- }
-
- this->plt_->add_entry(gsym);
-}
-
-// Define the _TLS_MODULE_BASE_ symbol at the end of the TLS segment.
-
-void
-Target_i386::define_tls_base_symbol(Symbol_table* symtab, Layout* layout)
-{
- if (this->tls_base_symbol_defined_)
- return;
-
- Output_segment* tls_segment = layout->tls_segment();
- if (tls_segment != NULL)
- {
- symtab->define_in_output_segment("_TLS_MODULE_BASE_", NULL,
- tls_segment, 0, 0,
- elfcpp::STT_TLS,
- elfcpp::STB_LOCAL,
- elfcpp::STV_HIDDEN, 0,
- Symbol::SEGMENT_END, true);
- }
- this->tls_base_symbol_defined_ = true;
-}
-
-// Create a GOT entry for the TLS module index.
-
-unsigned int
-Target_i386::got_mod_index_entry(Symbol_table* symtab, Layout* layout,
- Sized_relobj<32, false>* object)
-{
- if (this->got_mod_index_offset_ == -1U)
- {
- gold_assert(symtab != NULL && layout != NULL && object != NULL);
- Reloc_section* rel_dyn = this->rel_dyn_section(layout);
- Output_data_got<32, false>* got = this->got_section(symtab, layout);
- unsigned int got_offset = got->add_constant(0);
- rel_dyn->add_local(object, 0, elfcpp::R_386_TLS_DTPMOD32, got,
- got_offset);
- got->add_constant(0);
- this->got_mod_index_offset_ = got_offset;
- }
- return this->got_mod_index_offset_;
-}
-
-// Optimize the TLS relocation type based on what we know about the
-// symbol. IS_FINAL is true if the final address of this symbol is
-// known at link time.
-
-tls::Tls_optimization
-Target_i386::optimize_tls_reloc(bool is_final, int r_type)
-{
- // If we are generating a shared library, then we can't do anything
- // in the linker.
- if (parameters->options().shared())
- return tls::TLSOPT_NONE;
-
- switch (r_type)
- {
- case elfcpp::R_386_TLS_GD:
- case elfcpp::R_386_TLS_GOTDESC:
- case elfcpp::R_386_TLS_DESC_CALL:
- // These are General-Dynamic which permits fully general TLS
- // access. Since we know that we are generating an executable,
- // we can convert this to Initial-Exec. If we also know that
- // this is a local symbol, we can further switch to Local-Exec.
- if (is_final)
- return tls::TLSOPT_TO_LE;
- return tls::TLSOPT_TO_IE;
-
- case elfcpp::R_386_TLS_LDM:
- // This is Local-Dynamic, which refers to a local symbol in the
- // dynamic TLS block. Since we know that we generating an
- // executable, we can switch to Local-Exec.
- return tls::TLSOPT_TO_LE;
-
- case elfcpp::R_386_TLS_LDO_32:
- // Another type of Local-Dynamic relocation.
- return tls::TLSOPT_TO_LE;
-
- case elfcpp::R_386_TLS_IE:
- case elfcpp::R_386_TLS_GOTIE:
- case elfcpp::R_386_TLS_IE_32:
- // These are Initial-Exec relocs which get the thread offset
- // from the GOT. If we know that we are linking against the
- // local symbol, we can switch to Local-Exec, which links the
- // thread offset into the instruction.
- if (is_final)
- return tls::TLSOPT_TO_LE;
- return tls::TLSOPT_NONE;
-
- case elfcpp::R_386_TLS_LE:
- case elfcpp::R_386_TLS_LE_32:
- // When we already have Local-Exec, there is nothing further we
- // can do.
- return tls::TLSOPT_NONE;
-
- default:
- gold_unreachable();
- }
-}
-
-// Report an unsupported relocation against a local symbol.
-
-void
-Target_i386::Scan::unsupported_reloc_local(Sized_relobj<32, false>* object,
- unsigned int r_type)
-{
- gold_error(_("%s: unsupported reloc %u against local symbol"),
- object->name().c_str(), r_type);
-}
-
-// Scan a relocation for a local symbol.
-
-inline void
-Target_i386::Scan::local(const General_options&,
- Symbol_table* symtab,
- Layout* layout,
- Target_i386* target,
- Sized_relobj<32, false>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rel<32, false>& reloc,
- unsigned int r_type,
- const elfcpp::Sym<32, false>& lsym)
-{
- switch (r_type)
- {
- case elfcpp::R_386_NONE:
- case elfcpp::R_386_GNU_VTINHERIT:
- case elfcpp::R_386_GNU_VTENTRY:
- break;
-
- case elfcpp::R_386_32:
- // If building a shared library (or a position-independent
- // executable), we need to create a dynamic relocation for
- // this location. The relocation applied at link time will
- // apply the link-time value, so we flag the location with
- // an R_386_RELATIVE relocation so the dynamic loader can
- // relocate it easily.
- if (parameters->options().output_is_position_independent())
- {
- Reloc_section* rel_dyn = target->rel_dyn_section(layout);
- unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
- rel_dyn->add_local_relative(object, r_sym, elfcpp::R_386_RELATIVE,
- output_section, data_shndx,
- reloc.get_r_offset());
- }
- break;
-
- case elfcpp::R_386_16:
- case elfcpp::R_386_8:
- // If building a shared library (or a position-independent
- // executable), we need to create a dynamic relocation for
- // this location. Because the addend needs to remain in the
- // data section, we need to be careful not to apply this
- // relocation statically.
- if (parameters->options().output_is_position_independent())
- {
- Reloc_section* rel_dyn = target->rel_dyn_section(layout);
- unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
- if (lsym.get_st_type() != elfcpp::STT_SECTION)
- rel_dyn->add_local(object, r_sym, r_type, output_section,
- data_shndx, reloc.get_r_offset());
- else
- {
- gold_assert(lsym.get_st_value() == 0);
- unsigned int shndx = lsym.get_st_shndx();
- bool is_ordinary;
- shndx = object->adjust_sym_shndx(r_sym, shndx,
- &is_ordinary);
- if (!is_ordinary)
- object->error(_("section symbol %u has bad shndx %u"),
- r_sym, shndx);
- else
- rel_dyn->add_local_section(object, shndx,
- r_type, output_section,
- data_shndx, reloc.get_r_offset());
- }
- }
- break;
-
- case elfcpp::R_386_PC32:
- case elfcpp::R_386_PC16:
- case elfcpp::R_386_PC8:
- break;
-
- case elfcpp::R_386_PLT32:
- // Since we know this is a local symbol, we can handle this as a
- // PC32 reloc.
- break;
-
- case elfcpp::R_386_GOTOFF:
- case elfcpp::R_386_GOTPC:
- // We need a GOT section.
- target->got_section(symtab, layout);
- break;
-
- case elfcpp::R_386_GOT32:
- {
- // The symbol requires a GOT entry.
- Output_data_got<32, false>* got = target->got_section(symtab, layout);
- unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
- if (got->add_local(object, r_sym, GOT_TYPE_STANDARD))
- {
- // If we are generating a shared object, we need to add a
- // dynamic RELATIVE relocation for this symbol's GOT entry.
- if (parameters->options().output_is_position_independent())
- {
- Reloc_section* rel_dyn = target->rel_dyn_section(layout);
- unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
- rel_dyn->add_local_relative(
- object, r_sym, elfcpp::R_386_RELATIVE, got,
- object->local_got_offset(r_sym, GOT_TYPE_STANDARD));
- }
- }
- }
- break;
-
- // These are relocations which should only be seen by the
- // dynamic linker, and should never be seen here.
- case elfcpp::R_386_COPY:
- case elfcpp::R_386_GLOB_DAT:
- case elfcpp::R_386_JUMP_SLOT:
- case elfcpp::R_386_RELATIVE:
- case elfcpp::R_386_TLS_TPOFF:
- case elfcpp::R_386_TLS_DTPMOD32:
- case elfcpp::R_386_TLS_DTPOFF32:
- case elfcpp::R_386_TLS_TPOFF32:
- case elfcpp::R_386_TLS_DESC:
- gold_error(_("%s: unexpected reloc %u in object file"),
- object->name().c_str(), r_type);
- break;
-
- // These are initial TLS relocs, which are expected when
- // linking.
- case elfcpp::R_386_TLS_GD: // Global-dynamic
- case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva url)
- case elfcpp::R_386_TLS_DESC_CALL:
- case elfcpp::R_386_TLS_LDM: // Local-dynamic
- case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
- case elfcpp::R_386_TLS_IE: // Initial-exec
- case elfcpp::R_386_TLS_IE_32:
- case elfcpp::R_386_TLS_GOTIE:
- case elfcpp::R_386_TLS_LE: // Local-exec
- case elfcpp::R_386_TLS_LE_32:
- {
- bool output_is_shared = parameters->options().shared();
- const tls::Tls_optimization optimized_type
- = Target_i386::optimize_tls_reloc(!output_is_shared, r_type);
- switch (r_type)
- {
- case elfcpp::R_386_TLS_GD: // Global-dynamic
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a pair of GOT entries for the module index and
- // dtv-relative offset.
- Output_data_got<32, false>* got
- = target->got_section(symtab, layout);
- unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
- unsigned int shndx = lsym.get_st_shndx();
- bool is_ordinary;
- shndx = object->adjust_sym_shndx(r_sym, shndx, &is_ordinary);
- if (!is_ordinary)
- object->error(_("local symbol %u has bad shndx %u"),
- r_sym, shndx);
- else
- got->add_local_pair_with_rel(object, r_sym, shndx,
- GOT_TYPE_TLS_PAIR,
- target->rel_dyn_section(layout),
- elfcpp::R_386_TLS_DTPMOD32, 0);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_local(object, r_type);
- break;
-
- case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva)
- target->define_tls_base_symbol(symtab, layout);
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a double GOT entry with an R_386_TLS_DESC reloc.
- Output_data_got<32, false>* got
- = target->got_section(symtab, layout);
- unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
- unsigned int shndx = lsym.get_st_shndx();
- bool is_ordinary;
- shndx = object->adjust_sym_shndx(r_sym, shndx, &is_ordinary);
- if (!is_ordinary)
- object->error(_("local symbol %u has bad shndx %u"),
- r_sym, shndx);
- else
- got->add_local_pair_with_rel(object, r_sym, shndx,
- GOT_TYPE_TLS_DESC,
- target->rel_dyn_section(layout),
- elfcpp::R_386_TLS_DESC, 0);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_local(object, r_type);
- break;
-
- case elfcpp::R_386_TLS_DESC_CALL:
- break;
-
- case elfcpp::R_386_TLS_LDM: // Local-dynamic
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a GOT entry for the module index.
- target->got_mod_index_entry(symtab, layout, object);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_local(object, r_type);
- break;
-
- case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
- break;
-
- case elfcpp::R_386_TLS_IE: // Initial-exec
- case elfcpp::R_386_TLS_IE_32:
- case elfcpp::R_386_TLS_GOTIE:
- layout->set_has_static_tls();
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // For the R_386_TLS_IE relocation, we need to create a
- // dynamic relocation when building a shared library.
- if (r_type == elfcpp::R_386_TLS_IE
- && parameters->options().shared())
- {
- Reloc_section* rel_dyn = target->rel_dyn_section(layout);
- unsigned int r_sym
- = elfcpp::elf_r_sym<32>(reloc.get_r_info());
- rel_dyn->add_local_relative(object, r_sym,
- elfcpp::R_386_RELATIVE,
- output_section, data_shndx,
- reloc.get_r_offset());
- }
- // Create a GOT entry for the tp-relative offset.
- Output_data_got<32, false>* got
- = target->got_section(symtab, layout);
- unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
- unsigned int dyn_r_type = (r_type == elfcpp::R_386_TLS_IE_32
- ? elfcpp::R_386_TLS_TPOFF32
- : elfcpp::R_386_TLS_TPOFF);
- unsigned int got_type = (r_type == elfcpp::R_386_TLS_IE_32
- ? GOT_TYPE_TLS_OFFSET
- : GOT_TYPE_TLS_NOFFSET);
- got->add_local_with_rel(object, r_sym, got_type,
- target->rel_dyn_section(layout),
- dyn_r_type);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_local(object, r_type);
- break;
-
- case elfcpp::R_386_TLS_LE: // Local-exec
- case elfcpp::R_386_TLS_LE_32:
- layout->set_has_static_tls();
- if (output_is_shared)
- {
- // We need to create a dynamic relocation.
- gold_assert(lsym.get_st_type() != elfcpp::STT_SECTION);
- unsigned int r_sym = elfcpp::elf_r_sym<32>(reloc.get_r_info());
- unsigned int dyn_r_type = (r_type == elfcpp::R_386_TLS_LE_32
- ? elfcpp::R_386_TLS_TPOFF32
- : elfcpp::R_386_TLS_TPOFF);
- Reloc_section* rel_dyn = target->rel_dyn_section(layout);
- rel_dyn->add_local(object, r_sym, dyn_r_type, output_section,
- data_shndx, reloc.get_r_offset());
- }
- break;
-
- default:
- gold_unreachable();
- }
- }
- break;
-
- case elfcpp::R_386_32PLT:
- case elfcpp::R_386_TLS_GD_32:
- case elfcpp::R_386_TLS_GD_PUSH:
- case elfcpp::R_386_TLS_GD_CALL:
- case elfcpp::R_386_TLS_GD_POP:
- case elfcpp::R_386_TLS_LDM_32:
- case elfcpp::R_386_TLS_LDM_PUSH:
- case elfcpp::R_386_TLS_LDM_CALL:
- case elfcpp::R_386_TLS_LDM_POP:
- case elfcpp::R_386_USED_BY_INTEL_200:
- default:
- unsupported_reloc_local(object, r_type);
- break;
- }
-}
-
-// Report an unsupported relocation against a global symbol.
-
-void
-Target_i386::Scan::unsupported_reloc_global(Sized_relobj<32, false>* object,
- unsigned int r_type,
- Symbol* gsym)
-{
- gold_error(_("%s: unsupported reloc %u against global symbol %s"),
- object->name().c_str(), r_type, gsym->demangled_name().c_str());
-}
-
-// Scan a relocation for a global symbol.
-
-inline void
-Target_i386::Scan::global(const General_options&,
- Symbol_table* symtab,
- Layout* layout,
- Target_i386* target,
- Sized_relobj<32, false>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rel<32, false>& reloc,
- unsigned int r_type,
- Symbol* gsym)
-{
- switch (r_type)
- {
- case elfcpp::R_386_NONE:
- case elfcpp::R_386_GNU_VTINHERIT:
- case elfcpp::R_386_GNU_VTENTRY:
- break;
-
- case elfcpp::R_386_32:
- case elfcpp::R_386_16:
- case elfcpp::R_386_8:
- {
- // Make a PLT entry if necessary.
- if (gsym->needs_plt_entry())
- {
- target->make_plt_entry(symtab, layout, gsym);
- // Since this is not a PC-relative relocation, we may be
- // taking the address of a function. In that case we need to
- // set the entry in the dynamic symbol table to the address of
- // the PLT entry.
- if (gsym->is_from_dynobj() && !parameters->options().shared())
- gsym->set_needs_dynsym_value();
- }
- // Make a dynamic relocation if necessary.
- if (gsym->needs_dynamic_reloc(Symbol::ABSOLUTE_REF))
- {
- if (target->may_need_copy_reloc(gsym))
- {
- target->copy_reloc(symtab, layout, object,
- data_shndx, output_section, gsym, reloc);
- }
- else if (r_type == elfcpp::R_386_32
- && gsym->can_use_relative_reloc(false))
- {
- Reloc_section* rel_dyn = target->rel_dyn_section(layout);
- rel_dyn->add_global_relative(gsym, elfcpp::R_386_RELATIVE,
- output_section, object,
- data_shndx, reloc.get_r_offset());
- }
- else
- {
- Reloc_section* rel_dyn = target->rel_dyn_section(layout);
- rel_dyn->add_global(gsym, r_type, output_section, object,
- data_shndx, reloc.get_r_offset());
- }
- }
- }
- break;
-
- case elfcpp::R_386_PC32:
- case elfcpp::R_386_PC16:
- case elfcpp::R_386_PC8:
- {
- // Make a PLT entry if necessary.
- if (gsym->needs_plt_entry())
- {
- // These relocations are used for function calls only in
- // non-PIC code. For a 32-bit relocation in a shared library,
- // we'll need a text relocation anyway, so we can skip the
- // PLT entry and let the dynamic linker bind the call directly
- // to the target. For smaller relocations, we should use a
- // PLT entry to ensure that the call can reach.
- if (!parameters->options().shared()
- || r_type != elfcpp::R_386_PC32)
- target->make_plt_entry(symtab, layout, gsym);
- }
- // Make a dynamic relocation if necessary.
- int flags = Symbol::NON_PIC_REF;
- if (gsym->type() == elfcpp::STT_FUNC)
- flags |= Symbol::FUNCTION_CALL;
- if (gsym->needs_dynamic_reloc(flags))
- {
- if (target->may_need_copy_reloc(gsym))
- {
- target->copy_reloc(symtab, layout, object,
- data_shndx, output_section, gsym, reloc);
- }
- else
- {
- Reloc_section* rel_dyn = target->rel_dyn_section(layout);
- rel_dyn->add_global(gsym, r_type, output_section, object,
- data_shndx, reloc.get_r_offset());
- }
- }
- }
- break;
-
- case elfcpp::R_386_GOT32:
- {
- // The symbol requires a GOT entry.
- Output_data_got<32, false>* got = target->got_section(symtab, layout);
- if (gsym->final_value_is_known())
- got->add_global(gsym, GOT_TYPE_STANDARD);
- else
- {
- // If this symbol is not fully resolved, we need to add a
- // GOT entry with a dynamic relocation.
- Reloc_section* rel_dyn = target->rel_dyn_section(layout);
- if (gsym->is_from_dynobj()
- || gsym->is_undefined()
- || gsym->is_preemptible())
- got->add_global_with_rel(gsym, GOT_TYPE_STANDARD,
- rel_dyn, elfcpp::R_386_GLOB_DAT);
- else
- {
- if (got->add_global(gsym, GOT_TYPE_STANDARD))
- rel_dyn->add_global_relative(
- gsym, elfcpp::R_386_RELATIVE, got,
- gsym->got_offset(GOT_TYPE_STANDARD));
- }
- }
- }
- break;
-
- case elfcpp::R_386_PLT32:
- // If the symbol is fully resolved, this is just a PC32 reloc.
- // Otherwise we need a PLT entry.
- if (gsym->final_value_is_known())
- break;
- // If building a shared library, we can also skip the PLT entry
- // if the symbol is defined in the output file and is protected
- // or hidden.
- if (gsym->is_defined()
- && !gsym->is_from_dynobj()
- && !gsym->is_preemptible())
- break;
- target->make_plt_entry(symtab, layout, gsym);
- break;
-
- case elfcpp::R_386_GOTOFF:
- case elfcpp::R_386_GOTPC:
- // We need a GOT section.
- target->got_section(symtab, layout);
- break;
-
- // These are relocations which should only be seen by the
- // dynamic linker, and should never be seen here.
- case elfcpp::R_386_COPY:
- case elfcpp::R_386_GLOB_DAT:
- case elfcpp::R_386_JUMP_SLOT:
- case elfcpp::R_386_RELATIVE:
- case elfcpp::R_386_TLS_TPOFF:
- case elfcpp::R_386_TLS_DTPMOD32:
- case elfcpp::R_386_TLS_DTPOFF32:
- case elfcpp::R_386_TLS_TPOFF32:
- case elfcpp::R_386_TLS_DESC:
- gold_error(_("%s: unexpected reloc %u in object file"),
- object->name().c_str(), r_type);
- break;
-
- // These are initial tls relocs, which are expected when
- // linking.
- case elfcpp::R_386_TLS_GD: // Global-dynamic
- case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva url)
- case elfcpp::R_386_TLS_DESC_CALL:
- case elfcpp::R_386_TLS_LDM: // Local-dynamic
- case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
- case elfcpp::R_386_TLS_IE: // Initial-exec
- case elfcpp::R_386_TLS_IE_32:
- case elfcpp::R_386_TLS_GOTIE:
- case elfcpp::R_386_TLS_LE: // Local-exec
- case elfcpp::R_386_TLS_LE_32:
- {
- const bool is_final = gsym->final_value_is_known();
- const tls::Tls_optimization optimized_type
- = Target_i386::optimize_tls_reloc(is_final, r_type);
- switch (r_type)
- {
- case elfcpp::R_386_TLS_GD: // Global-dynamic
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a pair of GOT entries for the module index and
- // dtv-relative offset.
- Output_data_got<32, false>* got
- = target->got_section(symtab, layout);
- got->add_global_pair_with_rel(gsym, GOT_TYPE_TLS_PAIR,
- target->rel_dyn_section(layout),
- elfcpp::R_386_TLS_DTPMOD32,
- elfcpp::R_386_TLS_DTPOFF32);
- }
- else if (optimized_type == tls::TLSOPT_TO_IE)
- {
- // Create a GOT entry for the tp-relative offset.
- Output_data_got<32, false>* got
- = target->got_section(symtab, layout);
- got->add_global_with_rel(gsym, GOT_TYPE_TLS_NOFFSET,
- target->rel_dyn_section(layout),
- elfcpp::R_386_TLS_TPOFF);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_global(object, r_type, gsym);
- break;
-
- case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (~oliva url)
- target->define_tls_base_symbol(symtab, layout);
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a double GOT entry with an R_386_TLS_DESC reloc.
- Output_data_got<32, false>* got
- = target->got_section(symtab, layout);
- got->add_global_pair_with_rel(gsym, GOT_TYPE_TLS_DESC,
- target->rel_dyn_section(layout),
- elfcpp::R_386_TLS_DESC, 0);
- }
- else if (optimized_type == tls::TLSOPT_TO_IE)
- {
- // Create a GOT entry for the tp-relative offset.
- Output_data_got<32, false>* got
- = target->got_section(symtab, layout);
- got->add_global_with_rel(gsym, GOT_TYPE_TLS_NOFFSET,
- target->rel_dyn_section(layout),
- elfcpp::R_386_TLS_TPOFF);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_global(object, r_type, gsym);
- break;
-
- case elfcpp::R_386_TLS_DESC_CALL:
- break;
-
- case elfcpp::R_386_TLS_LDM: // Local-dynamic
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a GOT entry for the module index.
- target->got_mod_index_entry(symtab, layout, object);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_global(object, r_type, gsym);
- break;
-
- case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
- break;
-
- case elfcpp::R_386_TLS_IE: // Initial-exec
- case elfcpp::R_386_TLS_IE_32:
- case elfcpp::R_386_TLS_GOTIE:
- layout->set_has_static_tls();
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // For the R_386_TLS_IE relocation, we need to create a
- // dynamic relocation when building a shared library.
- if (r_type == elfcpp::R_386_TLS_IE
- && parameters->options().shared())
- {
- Reloc_section* rel_dyn = target->rel_dyn_section(layout);
- rel_dyn->add_global_relative(gsym, elfcpp::R_386_RELATIVE,
- output_section, object,
- data_shndx,
- reloc.get_r_offset());
- }
- // Create a GOT entry for the tp-relative offset.
- Output_data_got<32, false>* got
- = target->got_section(symtab, layout);
- unsigned int dyn_r_type = (r_type == elfcpp::R_386_TLS_IE_32
- ? elfcpp::R_386_TLS_TPOFF32
- : elfcpp::R_386_TLS_TPOFF);
- unsigned int got_type = (r_type == elfcpp::R_386_TLS_IE_32
- ? GOT_TYPE_TLS_OFFSET
- : GOT_TYPE_TLS_NOFFSET);
- got->add_global_with_rel(gsym, got_type,
- target->rel_dyn_section(layout),
- dyn_r_type);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_global(object, r_type, gsym);
- break;
-
- case elfcpp::R_386_TLS_LE: // Local-exec
- case elfcpp::R_386_TLS_LE_32:
- layout->set_has_static_tls();
- if (parameters->options().shared())
- {
- // We need to create a dynamic relocation.
- unsigned int dyn_r_type = (r_type == elfcpp::R_386_TLS_LE_32
- ? elfcpp::R_386_TLS_TPOFF32
- : elfcpp::R_386_TLS_TPOFF);
- Reloc_section* rel_dyn = target->rel_dyn_section(layout);
- rel_dyn->add_global(gsym, dyn_r_type, output_section, object,
- data_shndx, reloc.get_r_offset());
- }
- break;
-
- default:
- gold_unreachable();
- }
- }
- break;
-
- case elfcpp::R_386_32PLT:
- case elfcpp::R_386_TLS_GD_32:
- case elfcpp::R_386_TLS_GD_PUSH:
- case elfcpp::R_386_TLS_GD_CALL:
- case elfcpp::R_386_TLS_GD_POP:
- case elfcpp::R_386_TLS_LDM_32:
- case elfcpp::R_386_TLS_LDM_PUSH:
- case elfcpp::R_386_TLS_LDM_CALL:
- case elfcpp::R_386_TLS_LDM_POP:
- case elfcpp::R_386_USED_BY_INTEL_200:
- default:
- unsupported_reloc_global(object, r_type, gsym);
- break;
- }
-}
-
-// Scan relocations for a section.
-
-void
-Target_i386::scan_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<32, false>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols)
-{
- if (sh_type == elfcpp::SHT_RELA)
- {
- gold_error(_("%s: unsupported RELA reloc section"),
- object->name().c_str());
- return;
- }
-
- gold::scan_relocs<32, false, Target_i386, elfcpp::SHT_REL,
- Target_i386::Scan>(
- options,
- symtab,
- layout,
- this,
- object,
- data_shndx,
- prelocs,
- reloc_count,
- output_section,
- needs_special_offset_handling,
- local_symbol_count,
- plocal_symbols);
-}
-
-// Finalize the sections.
-
-void
-Target_i386::do_finalize_sections(Layout* layout)
-{
- // Fill in some more dynamic tags.
- Output_data_dynamic* const odyn = layout->dynamic_data();
- if (odyn != NULL)
- {
- if (this->got_plt_ != NULL)
- odyn->add_section_address(elfcpp::DT_PLTGOT, this->got_plt_);
-
- if (this->plt_ != NULL)
- {
- const Output_data* od = this->plt_->rel_plt();
- odyn->add_section_size(elfcpp::DT_PLTRELSZ, od);
- odyn->add_section_address(elfcpp::DT_JMPREL, od);
- odyn->add_constant(elfcpp::DT_PLTREL, elfcpp::DT_REL);
- }
-
- if (this->rel_dyn_ != NULL)
- {
- const Output_data* od = this->rel_dyn_;
- odyn->add_section_address(elfcpp::DT_REL, od);
- odyn->add_section_size(elfcpp::DT_RELSZ, od);
- odyn->add_constant(elfcpp::DT_RELENT,
- elfcpp::Elf_sizes<32>::rel_size);
- }
-
- if (!parameters->options().shared())
- {
- // The value of the DT_DEBUG tag is filled in by the dynamic
- // linker at run time, and used by the debugger.
- odyn->add_constant(elfcpp::DT_DEBUG, 0);
- }
- }
-
- // Emit any relocs we saved in an attempt to avoid generating COPY
- // relocs.
- if (this->copy_relocs_.any_saved_relocs())
- this->copy_relocs_.emit(this->rel_dyn_section(layout));
-}
-
-// Return whether a direct absolute static relocation needs to be applied.
-// In cases where Scan::local() or Scan::global() has created
-// a dynamic relocation other than R_386_RELATIVE, the addend
-// of the relocation is carried in the data, and we must not
-// apply the static relocation.
-
-inline bool
-Target_i386::Relocate::should_apply_static_reloc(const Sized_symbol<32>* gsym,
- int ref_flags,
- bool is_32bit)
-{
- // For local symbols, we will have created a non-RELATIVE dynamic
- // relocation only if (a) the output is position independent,
- // (b) the relocation is absolute (not pc- or segment-relative), and
- // (c) the relocation is not 32 bits wide.
- if (gsym == NULL)
- return !(parameters->options().output_is_position_independent()
- && (ref_flags & Symbol::ABSOLUTE_REF)
- && !is_32bit);
-
- // For global symbols, we use the same helper routines used in the
- // scan pass. If we did not create a dynamic relocation, or if we
- // created a RELATIVE dynamic relocation, we should apply the static
- // relocation.
- bool has_dyn = gsym->needs_dynamic_reloc(ref_flags);
- bool is_rel = (ref_flags & Symbol::ABSOLUTE_REF)
- && gsym->can_use_relative_reloc(ref_flags
- & Symbol::FUNCTION_CALL);
- return !has_dyn || is_rel;
-}
-
-// Perform a relocation.
-
-inline bool
-Target_i386::Relocate::relocate(const Relocate_info<32, false>* relinfo,
- Target_i386* target,
- size_t relnum,
- const elfcpp::Rel<32, false>& rel,
- unsigned int r_type,
- const Sized_symbol<32>* gsym,
- const Symbol_value<32>* psymval,
- unsigned char* view,
- elfcpp::Elf_types<32>::Elf_Addr address,
- section_size_type view_size)
-{
- if (this->skip_call_tls_get_addr_)
- {
- if (r_type != elfcpp::R_386_PLT32
- || gsym == NULL
- || strcmp(gsym->name(), "___tls_get_addr") != 0)
- gold_error_at_location(relinfo, relnum, rel.get_r_offset(),
- _("missing expected TLS relocation"));
- else
- {
- this->skip_call_tls_get_addr_ = false;
- return false;
- }
- }
-
- // Pick the value to use for symbols defined in shared objects.
- Symbol_value<32> symval;
- if (gsym != NULL
- && gsym->use_plt_offset(r_type == elfcpp::R_386_PC8
- || r_type == elfcpp::R_386_PC16
- || r_type == elfcpp::R_386_PC32))
- {
- symval.set_output_value(target->plt_section()->address()
- + gsym->plt_offset());
- psymval = &symval;
- }
-
- const Sized_relobj<32, false>* object = relinfo->object;
-
- // Get the GOT offset if needed.
- // The GOT pointer points to the end of the GOT section.
- // We need to subtract the size of the GOT section to get
- // the actual offset to use in the relocation.
- bool have_got_offset = false;
- unsigned int got_offset = 0;
- switch (r_type)
- {
- case elfcpp::R_386_GOT32:
- if (gsym != NULL)
- {
- gold_assert(gsym->has_got_offset(GOT_TYPE_STANDARD));
- got_offset = (gsym->got_offset(GOT_TYPE_STANDARD)
- - target->got_size());
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
- gold_assert(object->local_has_got_offset(r_sym, GOT_TYPE_STANDARD));
- got_offset = (object->local_got_offset(r_sym, GOT_TYPE_STANDARD)
- - target->got_size());
- }
- have_got_offset = true;
- break;
-
- default:
- break;
- }
-
- switch (r_type)
- {
- case elfcpp::R_386_NONE:
- case elfcpp::R_386_GNU_VTINHERIT:
- case elfcpp::R_386_GNU_VTENTRY:
- break;
-
- case elfcpp::R_386_32:
- if (should_apply_static_reloc(gsym, Symbol::ABSOLUTE_REF, true))
- Relocate_functions<32, false>::rel32(view, object, psymval);
- break;
-
- case elfcpp::R_386_PC32:
- {
- int ref_flags = Symbol::NON_PIC_REF;
- if (gsym != NULL && gsym->type() == elfcpp::STT_FUNC)
- ref_flags |= Symbol::FUNCTION_CALL;
- if (should_apply_static_reloc(gsym, ref_flags, true))
- Relocate_functions<32, false>::pcrel32(view, object, psymval, address);
- }
- break;
-
- case elfcpp::R_386_16:
- if (should_apply_static_reloc(gsym, Symbol::ABSOLUTE_REF, false))
- Relocate_functions<32, false>::rel16(view, object, psymval);
- break;
-
- case elfcpp::R_386_PC16:
- {
- int ref_flags = Symbol::NON_PIC_REF;
- if (gsym != NULL && gsym->type() == elfcpp::STT_FUNC)
- ref_flags |= Symbol::FUNCTION_CALL;
- if (should_apply_static_reloc(gsym, ref_flags, false))
- Relocate_functions<32, false>::pcrel16(view, object, psymval, address);
- }
- break;
-
- case elfcpp::R_386_8:
- if (should_apply_static_reloc(gsym, Symbol::ABSOLUTE_REF, false))
- Relocate_functions<32, false>::rel8(view, object, psymval);
- break;
-
- case elfcpp::R_386_PC8:
- {
- int ref_flags = Symbol::NON_PIC_REF;
- if (gsym != NULL && gsym->type() == elfcpp::STT_FUNC)
- ref_flags |= Symbol::FUNCTION_CALL;
- if (should_apply_static_reloc(gsym, ref_flags, false))
- Relocate_functions<32, false>::pcrel8(view, object, psymval, address);
- }
- break;
-
- case elfcpp::R_386_PLT32:
- gold_assert(gsym == NULL
- || gsym->has_plt_offset()
- || gsym->final_value_is_known()
- || (gsym->is_defined()
- && !gsym->is_from_dynobj()
- && !gsym->is_preemptible()));
- Relocate_functions<32, false>::pcrel32(view, object, psymval, address);
- break;
-
- case elfcpp::R_386_GOT32:
- gold_assert(have_got_offset);
- Relocate_functions<32, false>::rel32(view, got_offset);
- break;
-
- case elfcpp::R_386_GOTOFF:
- {
- elfcpp::Elf_types<32>::Elf_Addr value;
- value = (psymval->value(object, 0)
- - target->got_plt_section()->address());
- Relocate_functions<32, false>::rel32(view, value);
- }
- break;
-
- case elfcpp::R_386_GOTPC:
- {
- elfcpp::Elf_types<32>::Elf_Addr value;
- value = target->got_plt_section()->address();
- Relocate_functions<32, false>::pcrel32(view, value, address);
- }
- break;
-
- case elfcpp::R_386_COPY:
- case elfcpp::R_386_GLOB_DAT:
- case elfcpp::R_386_JUMP_SLOT:
- case elfcpp::R_386_RELATIVE:
- // These are outstanding tls relocs, which are unexpected when
- // linking.
- case elfcpp::R_386_TLS_TPOFF:
- case elfcpp::R_386_TLS_DTPMOD32:
- case elfcpp::R_386_TLS_DTPOFF32:
- case elfcpp::R_386_TLS_TPOFF32:
- case elfcpp::R_386_TLS_DESC:
- gold_error_at_location(relinfo, relnum, rel.get_r_offset(),
- _("unexpected reloc %u in object file"),
- r_type);
- break;
-
- // These are initial tls relocs, which are expected when
- // linking.
- case elfcpp::R_386_TLS_GD: // Global-dynamic
- case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva url)
- case elfcpp::R_386_TLS_DESC_CALL:
- case elfcpp::R_386_TLS_LDM: // Local-dynamic
- case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
- case elfcpp::R_386_TLS_IE: // Initial-exec
- case elfcpp::R_386_TLS_IE_32:
- case elfcpp::R_386_TLS_GOTIE:
- case elfcpp::R_386_TLS_LE: // Local-exec
- case elfcpp::R_386_TLS_LE_32:
- this->relocate_tls(relinfo, target, relnum, rel, r_type, gsym, psymval,
- view, address, view_size);
- break;
-
- case elfcpp::R_386_32PLT:
- case elfcpp::R_386_TLS_GD_32:
- case elfcpp::R_386_TLS_GD_PUSH:
- case elfcpp::R_386_TLS_GD_CALL:
- case elfcpp::R_386_TLS_GD_POP:
- case elfcpp::R_386_TLS_LDM_32:
- case elfcpp::R_386_TLS_LDM_PUSH:
- case elfcpp::R_386_TLS_LDM_CALL:
- case elfcpp::R_386_TLS_LDM_POP:
- case elfcpp::R_386_USED_BY_INTEL_200:
- default:
- gold_error_at_location(relinfo, relnum, rel.get_r_offset(),
- _("unsupported reloc %u"),
- r_type);
- break;
- }
-
- return true;
-}
-
-// Perform a TLS relocation.
-
-inline void
-Target_i386::Relocate::relocate_tls(const Relocate_info<32, false>* relinfo,
- Target_i386* target,
- size_t relnum,
- const elfcpp::Rel<32, false>& rel,
- unsigned int r_type,
- const Sized_symbol<32>* gsym,
- const Symbol_value<32>* psymval,
- unsigned char* view,
- elfcpp::Elf_types<32>::Elf_Addr,
- section_size_type view_size)
-{
- Output_segment* tls_segment = relinfo->layout->tls_segment();
-
- const Sized_relobj<32, false>* object = relinfo->object;
-
- elfcpp::Elf_types<32>::Elf_Addr value = psymval->value(object, 0);
-
- const bool is_final =
- (gsym == NULL
- ? !parameters->options().output_is_position_independent()
- : gsym->final_value_is_known());
- const tls::Tls_optimization optimized_type
- = Target_i386::optimize_tls_reloc(is_final, r_type);
- switch (r_type)
- {
- case elfcpp::R_386_TLS_GD: // Global-dynamic
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- gold_assert(tls_segment != NULL);
- this->tls_gd_to_le(relinfo, relnum, tls_segment,
- rel, r_type, value, view,
- view_size);
- break;
- }
- else
- {
- unsigned int got_type = (optimized_type == tls::TLSOPT_TO_IE
- ? GOT_TYPE_TLS_NOFFSET
- : GOT_TYPE_TLS_PAIR);
- unsigned int got_offset;
- if (gsym != NULL)
- {
- gold_assert(gsym->has_got_offset(got_type));
- got_offset = gsym->got_offset(got_type) - target->got_size();
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
- gold_assert(object->local_has_got_offset(r_sym, got_type));
- got_offset = (object->local_got_offset(r_sym, got_type)
- - target->got_size());
- }
- if (optimized_type == tls::TLSOPT_TO_IE)
- {
- gold_assert(tls_segment != NULL);
- this->tls_gd_to_ie(relinfo, relnum, tls_segment, rel, r_type,
- got_offset, view, view_size);
- break;
- }
- else if (optimized_type == tls::TLSOPT_NONE)
- {
- // Relocate the field with the offset of the pair of GOT
- // entries.
- Relocate_functions<32, false>::rel32(view, got_offset);
- break;
- }
- }
- gold_error_at_location(relinfo, relnum, rel.get_r_offset(),
- _("unsupported reloc %u"),
- r_type);
- break;
-
- case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva url)
- case elfcpp::R_386_TLS_DESC_CALL:
- this->local_dynamic_type_ = LOCAL_DYNAMIC_GNU;
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- gold_assert(tls_segment != NULL);
- this->tls_desc_gd_to_le(relinfo, relnum, tls_segment,
- rel, r_type, value, view,
- view_size);
- break;
- }
- else
- {
- unsigned int got_type = (optimized_type == tls::TLSOPT_TO_IE
- ? GOT_TYPE_TLS_NOFFSET
- : GOT_TYPE_TLS_DESC);
- unsigned int got_offset;
- if (gsym != NULL)
- {
- gold_assert(gsym->has_got_offset(got_type));
- got_offset = gsym->got_offset(got_type) - target->got_size();
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
- gold_assert(object->local_has_got_offset(r_sym, got_type));
- got_offset = (object->local_got_offset(r_sym, got_type)
- - target->got_size());
- }
- if (optimized_type == tls::TLSOPT_TO_IE)
- {
- gold_assert(tls_segment != NULL);
- this->tls_desc_gd_to_ie(relinfo, relnum, tls_segment, rel, r_type,
- got_offset, view, view_size);
- break;
- }
- else if (optimized_type == tls::TLSOPT_NONE)
- {
- if (r_type == elfcpp::R_386_TLS_GOTDESC)
- {
- // Relocate the field with the offset of the pair of GOT
- // entries.
- Relocate_functions<32, false>::rel32(view, got_offset);
- }
- break;
- }
- }
- gold_error_at_location(relinfo, relnum, rel.get_r_offset(),
- _("unsupported reloc %u"),
- r_type);
- break;
-
- case elfcpp::R_386_TLS_LDM: // Local-dynamic
- if (this->local_dynamic_type_ == LOCAL_DYNAMIC_SUN)
- {
- gold_error_at_location(relinfo, relnum, rel.get_r_offset(),
- _("both SUN and GNU model "
- "TLS relocations"));
- break;
- }
- this->local_dynamic_type_ = LOCAL_DYNAMIC_GNU;
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- gold_assert(tls_segment != NULL);
- this->tls_ld_to_le(relinfo, relnum, tls_segment, rel, r_type,
- value, view, view_size);
- break;
- }
- else if (optimized_type == tls::TLSOPT_NONE)
- {
- // Relocate the field with the offset of the GOT entry for
- // the module index.
- unsigned int got_offset;
- got_offset = (target->got_mod_index_entry(NULL, NULL, NULL)
- - target->got_size());
- Relocate_functions<32, false>::rel32(view, got_offset);
- break;
- }
- gold_error_at_location(relinfo, relnum, rel.get_r_offset(),
- _("unsupported reloc %u"),
- r_type);
- break;
-
- case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
- // This reloc can appear in debugging sections, in which case we
- // won't see the TLS_LDM reloc. The local_dynamic_type field
- // tells us this.
- if (optimized_type == tls::TLSOPT_TO_LE
- && this->local_dynamic_type_ != LOCAL_DYNAMIC_NONE)
- {
- gold_assert(tls_segment != NULL);
- value -= tls_segment->memsz();
- }
- Relocate_functions<32, false>::rel32(view, value);
- break;
-
- case elfcpp::R_386_TLS_IE: // Initial-exec
- case elfcpp::R_386_TLS_GOTIE:
- case elfcpp::R_386_TLS_IE_32:
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- gold_assert(tls_segment != NULL);
- Target_i386::Relocate::tls_ie_to_le(relinfo, relnum, tls_segment,
- rel, r_type, value, view,
- view_size);
- break;
- }
- else if (optimized_type == tls::TLSOPT_NONE)
- {
- // Relocate the field with the offset of the GOT entry for
- // the tp-relative offset of the symbol.
- unsigned int got_type = (r_type == elfcpp::R_386_TLS_IE_32
- ? GOT_TYPE_TLS_OFFSET
- : GOT_TYPE_TLS_NOFFSET);
- unsigned int got_offset;
- if (gsym != NULL)
- {
- gold_assert(gsym->has_got_offset(got_type));
- got_offset = gsym->got_offset(got_type);
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<32>(rel.get_r_info());
- gold_assert(object->local_has_got_offset(r_sym, got_type));
- got_offset = object->local_got_offset(r_sym, got_type);
- }
- // For the R_386_TLS_IE relocation, we need to apply the
- // absolute address of the GOT entry.
- if (r_type == elfcpp::R_386_TLS_IE)
- got_offset += target->got_plt_section()->address();
- // All GOT offsets are relative to the end of the GOT.
- got_offset -= target->got_size();
- Relocate_functions<32, false>::rel32(view, got_offset);
- break;
- }
- gold_error_at_location(relinfo, relnum, rel.get_r_offset(),
- _("unsupported reloc %u"),
- r_type);
- break;
-
- case elfcpp::R_386_TLS_LE: // Local-exec
- // If we're creating a shared library, a dynamic relocation will
- // have been created for this location, so do not apply it now.
- if (!parameters->options().shared())
- {
- gold_assert(tls_segment != NULL);
- value -= tls_segment->memsz();
- Relocate_functions<32, false>::rel32(view, value);
- }
- break;
-
- case elfcpp::R_386_TLS_LE_32:
- // If we're creating a shared library, a dynamic relocation will
- // have been created for this location, so do not apply it now.
- if (!parameters->options().shared())
- {
- gold_assert(tls_segment != NULL);
- value = tls_segment->memsz() - value;
- Relocate_functions<32, false>::rel32(view, value);
- }
- break;
- }
-}
-
-// Do a relocation in which we convert a TLS General-Dynamic to a
-// Local-Exec.
-
-inline void
-Target_i386::Relocate::tls_gd_to_le(const Relocate_info<32, false>* relinfo,
- size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rel<32, false>& rel,
- unsigned int,
- elfcpp::Elf_types<32>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size)
-{
- // leal foo(,%reg,1),%eax; call ___tls_get_addr
- // ==> movl %gs:0,%eax; subl $foo@tpoff,%eax
- // leal foo(%reg),%eax; call ___tls_get_addr
- // ==> movl %gs:0,%eax; subl $foo@tpoff,%eax
-
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, -2);
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, 9);
-
- unsigned char op1 = view[-1];
- unsigned char op2 = view[-2];
-
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- op2 == 0x8d || op2 == 0x04);
- tls::check_tls(relinfo, relnum, rel.get_r_offset(), view[4] == 0xe8);
-
- int roff = 5;
-
- if (op2 == 0x04)
- {
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, -3);
- tls::check_tls(relinfo, relnum, rel.get_r_offset(), view[-3] == 0x8d);
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- ((op1 & 0xc7) == 0x05 && op1 != (4 << 3)));
- memcpy(view - 3, "\x65\xa1\0\0\0\0\x81\xe8\0\0\0", 12);
- }
- else
- {
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- (op1 & 0xf8) == 0x80 && (op1 & 7) != 4);
- if (rel.get_r_offset() + 9 < view_size
- && view[9] == 0x90)
- {
- // There is a trailing nop. Use the size byte subl.
- memcpy(view - 2, "\x65\xa1\0\0\0\0\x81\xe8\0\0\0", 12);
- roff = 6;
- }
- else
- {
- // Use the five byte subl.
- memcpy(view - 2, "\x65\xa1\0\0\0\0\x2d\0\0\0", 11);
- }
- }
-
- value = tls_segment->memsz() - value;
- Relocate_functions<32, false>::rel32(view + roff, value);
-
- // The next reloc should be a PLT32 reloc against __tls_get_addr.
- // We can skip it.
- this->skip_call_tls_get_addr_ = true;
-}
-
-// Do a relocation in which we convert a TLS General-Dynamic to an
-// Initial-Exec.
-
-inline void
-Target_i386::Relocate::tls_gd_to_ie(const Relocate_info<32, false>* relinfo,
- size_t relnum,
- Output_segment*,
- const elfcpp::Rel<32, false>& rel,
- unsigned int,
- elfcpp::Elf_types<32>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size)
-{
- // leal foo(,%ebx,1),%eax; call ___tls_get_addr
- // ==> movl %gs:0,%eax; addl foo@gotntpoff(%ebx),%eax
-
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, -2);
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, 9);
-
- unsigned char op1 = view[-1];
- unsigned char op2 = view[-2];
-
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- op2 == 0x8d || op2 == 0x04);
- tls::check_tls(relinfo, relnum, rel.get_r_offset(), view[4] == 0xe8);
-
- int roff = 5;
-
- // FIXME: For now, support only the first (SIB) form.
- tls::check_tls(relinfo, relnum, rel.get_r_offset(), op2 == 0x04);
-
- if (op2 == 0x04)
- {
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, -3);
- tls::check_tls(relinfo, relnum, rel.get_r_offset(), view[-3] == 0x8d);
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- ((op1 & 0xc7) == 0x05 && op1 != (4 << 3)));
- memcpy(view - 3, "\x65\xa1\0\0\0\0\x03\x83\0\0\0", 12);
- }
- else
- {
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- (op1 & 0xf8) == 0x80 && (op1 & 7) != 4);
- if (rel.get_r_offset() + 9 < view_size
- && view[9] == 0x90)
- {
- // FIXME: This is not the right instruction sequence.
- // There is a trailing nop. Use the size byte subl.
- memcpy(view - 2, "\x65\xa1\0\0\0\0\x81\xe8\0\0\0", 12);
- roff = 6;
- }
- else
- {
- // FIXME: This is not the right instruction sequence.
- // Use the five byte subl.
- memcpy(view - 2, "\x65\xa1\0\0\0\0\x2d\0\0\0", 11);
- }
- }
-
- Relocate_functions<32, false>::rel32(view + roff, value);
-
- // The next reloc should be a PLT32 reloc against __tls_get_addr.
- // We can skip it.
- this->skip_call_tls_get_addr_ = true;
-}
-
-// Do a relocation in which we convert a TLS_GOTDESC or TLS_DESC_CALL
-// General-Dynamic to a Local-Exec.
-
-inline void
-Target_i386::Relocate::tls_desc_gd_to_le(
- const Relocate_info<32, false>* relinfo,
- size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rel<32, false>& rel,
- unsigned int r_type,
- elfcpp::Elf_types<32>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size)
-{
- if (r_type == elfcpp::R_386_TLS_GOTDESC)
- {
- // leal foo@TLSDESC(%ebx), %eax
- // ==> leal foo@NTPOFF, %eax
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, -2);
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, 4);
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- view[-2] == 0x8d && view[-1] == 0x83);
- view[-1] = 0x05;
- value -= tls_segment->memsz();
- Relocate_functions<32, false>::rel32(view, value);
- }
- else
- {
- // call *foo@TLSCALL(%eax)
- // ==> nop; nop
- gold_assert(r_type == elfcpp::R_386_TLS_DESC_CALL);
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, 2);
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- view[0] == 0xff && view[1] == 0x10);
- view[0] = 0x66;
- view[1] = 0x90;
- }
-}
-
-// Do a relocation in which we convert a TLS_GOTDESC or TLS_DESC_CALL
-// General-Dynamic to an Initial-Exec.
-
-inline void
-Target_i386::Relocate::tls_desc_gd_to_ie(
- const Relocate_info<32, false>* relinfo,
- size_t relnum,
- Output_segment*,
- const elfcpp::Rel<32, false>& rel,
- unsigned int r_type,
- elfcpp::Elf_types<32>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size)
-{
- if (r_type == elfcpp::R_386_TLS_GOTDESC)
- {
- // leal foo@TLSDESC(%ebx), %eax
- // ==> movl foo@GOTNTPOFF(%ebx), %eax
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, -2);
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, 4);
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- view[-2] == 0x8d && view[-1] == 0x83);
- view[-2] = 0x8b;
- Relocate_functions<32, false>::rel32(view, value);
- }
- else
- {
- // call *foo@TLSCALL(%eax)
- // ==> nop; nop
- gold_assert(r_type == elfcpp::R_386_TLS_DESC_CALL);
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, 2);
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- view[0] == 0xff && view[1] == 0x10);
- view[0] = 0x66;
- view[1] = 0x90;
- }
-}
-
-// Do a relocation in which we convert a TLS Local-Dynamic to a
-// Local-Exec.
-
-inline void
-Target_i386::Relocate::tls_ld_to_le(const Relocate_info<32, false>* relinfo,
- size_t relnum,
- Output_segment*,
- const elfcpp::Rel<32, false>& rel,
- unsigned int,
- elfcpp::Elf_types<32>::Elf_Addr,
- unsigned char* view,
- section_size_type view_size)
-{
- // leal foo(%reg), %eax; call ___tls_get_addr
- // ==> movl %gs:0,%eax; nop; leal 0(%esi,1),%esi
-
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, -2);
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, 9);
-
- // FIXME: Does this test really always pass?
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- view[-2] == 0x8d && view[-1] == 0x83);
-
- tls::check_tls(relinfo, relnum, rel.get_r_offset(), view[4] == 0xe8);
-
- memcpy(view - 2, "\x65\xa1\0\0\0\0\x90\x8d\x74\x26\0", 11);
-
- // The next reloc should be a PLT32 reloc against __tls_get_addr.
- // We can skip it.
- this->skip_call_tls_get_addr_ = true;
-}
-
-// Do a relocation in which we convert a TLS Initial-Exec to a
-// Local-Exec.
-
-inline void
-Target_i386::Relocate::tls_ie_to_le(const Relocate_info<32, false>* relinfo,
- size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rel<32, false>& rel,
- unsigned int r_type,
- elfcpp::Elf_types<32>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size)
-{
- // We have to actually change the instructions, which means that we
- // need to examine the opcodes to figure out which instruction we
- // are looking at.
- if (r_type == elfcpp::R_386_TLS_IE)
- {
- // movl %gs:XX,%eax ==> movl $YY,%eax
- // movl %gs:XX,%reg ==> movl $YY,%reg
- // addl %gs:XX,%reg ==> addl $YY,%reg
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, -1);
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, 4);
-
- unsigned char op1 = view[-1];
- if (op1 == 0xa1)
- {
- // movl XX,%eax ==> movl $YY,%eax
- view[-1] = 0xb8;
- }
- else
- {
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, -2);
-
- unsigned char op2 = view[-2];
- if (op2 == 0x8b)
- {
- // movl XX,%reg ==> movl $YY,%reg
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- (op1 & 0xc7) == 0x05);
- view[-2] = 0xc7;
- view[-1] = 0xc0 | ((op1 >> 3) & 7);
- }
- else if (op2 == 0x03)
- {
- // addl XX,%reg ==> addl $YY,%reg
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- (op1 & 0xc7) == 0x05);
- view[-2] = 0x81;
- view[-1] = 0xc0 | ((op1 >> 3) & 7);
- }
- else
- tls::check_tls(relinfo, relnum, rel.get_r_offset(), 0);
- }
- }
- else
- {
- // subl %gs:XX(%reg1),%reg2 ==> subl $YY,%reg2
- // movl %gs:XX(%reg1),%reg2 ==> movl $YY,%reg2
- // addl %gs:XX(%reg1),%reg2 ==> addl $YY,$reg2
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, -2);
- tls::check_range(relinfo, relnum, rel.get_r_offset(), view_size, 4);
-
- unsigned char op1 = view[-1];
- unsigned char op2 = view[-2];
- tls::check_tls(relinfo, relnum, rel.get_r_offset(),
- (op1 & 0xc0) == 0x80 && (op1 & 7) != 4);
- if (op2 == 0x8b)
- {
- // movl %gs:XX(%reg1),%reg2 ==> movl $YY,%reg2
- view[-2] = 0xc7;
- view[-1] = 0xc0 | ((op1 >> 3) & 7);
- }
- else if (op2 == 0x2b)
- {
- // subl %gs:XX(%reg1),%reg2 ==> subl $YY,%reg2
- view[-2] = 0x81;
- view[-1] = 0xe8 | ((op1 >> 3) & 7);
- }
- else if (op2 == 0x03)
- {
- // addl %gs:XX(%reg1),%reg2 ==> addl $YY,$reg2
- view[-2] = 0x81;
- view[-1] = 0xc0 | ((op1 >> 3) & 7);
- }
- else
- tls::check_tls(relinfo, relnum, rel.get_r_offset(), 0);
- }
-
- value = tls_segment->memsz() - value;
- if (r_type == elfcpp::R_386_TLS_IE || r_type == elfcpp::R_386_TLS_GOTIE)
- value = - value;
-
- Relocate_functions<32, false>::rel32(view, value);
-}
-
-// Relocate section data.
-
-void
-Target_i386::relocate_section(const Relocate_info<32, false>* relinfo,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- unsigned char* view,
- elfcpp::Elf_types<32>::Elf_Addr address,
- section_size_type view_size)
-{
- gold_assert(sh_type == elfcpp::SHT_REL);
-
- gold::relocate_section<32, false, Target_i386, elfcpp::SHT_REL,
- Target_i386::Relocate>(
- relinfo,
- this,
- prelocs,
- reloc_count,
- output_section,
- needs_special_offset_handling,
- view,
- address,
- view_size);
-}
-
-// Return the size of a relocation while scanning during a relocatable
-// link.
-
-unsigned int
-Target_i386::Relocatable_size_for_reloc::get_size_for_reloc(
- unsigned int r_type,
- Relobj* object)
-{
- switch (r_type)
- {
- case elfcpp::R_386_NONE:
- case elfcpp::R_386_GNU_VTINHERIT:
- case elfcpp::R_386_GNU_VTENTRY:
- case elfcpp::R_386_TLS_GD: // Global-dynamic
- case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva url)
- case elfcpp::R_386_TLS_DESC_CALL:
- case elfcpp::R_386_TLS_LDM: // Local-dynamic
- case elfcpp::R_386_TLS_LDO_32: // Alternate local-dynamic
- case elfcpp::R_386_TLS_IE: // Initial-exec
- case elfcpp::R_386_TLS_IE_32:
- case elfcpp::R_386_TLS_GOTIE:
- case elfcpp::R_386_TLS_LE: // Local-exec
- case elfcpp::R_386_TLS_LE_32:
- return 0;
-
- case elfcpp::R_386_32:
- case elfcpp::R_386_PC32:
- case elfcpp::R_386_GOT32:
- case elfcpp::R_386_PLT32:
- case elfcpp::R_386_GOTOFF:
- case elfcpp::R_386_GOTPC:
- return 4;
-
- case elfcpp::R_386_16:
- case elfcpp::R_386_PC16:
- return 2;
-
- case elfcpp::R_386_8:
- case elfcpp::R_386_PC8:
- return 1;
-
- // These are relocations which should only be seen by the
- // dynamic linker, and should never be seen here.
- case elfcpp::R_386_COPY:
- case elfcpp::R_386_GLOB_DAT:
- case elfcpp::R_386_JUMP_SLOT:
- case elfcpp::R_386_RELATIVE:
- case elfcpp::R_386_TLS_TPOFF:
- case elfcpp::R_386_TLS_DTPMOD32:
- case elfcpp::R_386_TLS_DTPOFF32:
- case elfcpp::R_386_TLS_TPOFF32:
- case elfcpp::R_386_TLS_DESC:
- object->error(_("unexpected reloc %u in object file"), r_type);
- return 0;
-
- case elfcpp::R_386_32PLT:
- case elfcpp::R_386_TLS_GD_32:
- case elfcpp::R_386_TLS_GD_PUSH:
- case elfcpp::R_386_TLS_GD_CALL:
- case elfcpp::R_386_TLS_GD_POP:
- case elfcpp::R_386_TLS_LDM_32:
- case elfcpp::R_386_TLS_LDM_PUSH:
- case elfcpp::R_386_TLS_LDM_CALL:
- case elfcpp::R_386_TLS_LDM_POP:
- case elfcpp::R_386_USED_BY_INTEL_200:
- default:
- object->error(_("unsupported reloc %u in object file"), r_type);
- return 0;
- }
-}
-
-// Scan the relocs during a relocatable link.
-
-void
-Target_i386::scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<32, false>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols,
- Relocatable_relocs* rr)
-{
- gold_assert(sh_type == elfcpp::SHT_REL);
-
- typedef gold::Default_scan_relocatable_relocs<elfcpp::SHT_REL,
- Relocatable_size_for_reloc> Scan_relocatable_relocs;
-
- gold::scan_relocatable_relocs<32, false, elfcpp::SHT_REL,
- Scan_relocatable_relocs>(
- options,
- symtab,
- layout,
- object,
- data_shndx,
- prelocs,
- reloc_count,
- output_section,
- needs_special_offset_handling,
- local_symbol_count,
- plocal_symbols,
- rr);
-}
-
-// Relocate a section during a relocatable link.
-
-void
-Target_i386::relocate_for_relocatable(
- const Relocate_info<32, false>* relinfo,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- off_t offset_in_output_section,
- const Relocatable_relocs* rr,
- unsigned char* view,
- elfcpp::Elf_types<32>::Elf_Addr view_address,
- section_size_type view_size,
- unsigned char* reloc_view,
- section_size_type reloc_view_size)
-{
- gold_assert(sh_type == elfcpp::SHT_REL);
-
- gold::relocate_for_relocatable<32, false, elfcpp::SHT_REL>(
- relinfo,
- prelocs,
- reloc_count,
- output_section,
- offset_in_output_section,
- rr,
- view,
- view_address,
- view_size,
- reloc_view,
- reloc_view_size);
-}
-
-// Return the value to use for a dynamic which requires special
-// treatment. This is how we support equality comparisons of function
-// pointers across shared library boundaries, as described in the
-// processor specific ABI supplement.
-
-uint64_t
-Target_i386::do_dynsym_value(const Symbol* gsym) const
-{
- gold_assert(gsym->is_from_dynobj() && gsym->has_plt_offset());
- return this->plt_section()->address() + gsym->plt_offset();
-}
-
-// Return a string used to fill a code section with nops to take up
-// the specified length.
-
-std::string
-Target_i386::do_code_fill(section_size_type length) const
-{
- if (length >= 16)
- {
- // Build a jmp instruction to skip over the bytes.
- unsigned char jmp[5];
- jmp[0] = 0xe9;
- elfcpp::Swap_unaligned<32, false>::writeval(jmp + 1, length - 5);
- return (std::string(reinterpret_cast<char*>(&jmp[0]), 5)
- + std::string(length - 5, '\0'));
- }
-
- // Nop sequences of various lengths.
- const char nop1[1] = { 0x90 }; // nop
- const char nop2[2] = { 0x66, 0x90 }; // xchg %ax %ax
- const char nop3[3] = { 0x8d, 0x76, 0x00 }; // leal 0(%esi),%esi
- const char nop4[4] = { 0x8d, 0x74, 0x26, 0x00}; // leal 0(%esi,1),%esi
- const char nop5[5] = { 0x90, 0x8d, 0x74, 0x26, // nop
- 0x00 }; // leal 0(%esi,1),%esi
- const char nop6[6] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
- 0x00, 0x00 };
- const char nop7[7] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi
- 0x00, 0x00, 0x00 };
- const char nop8[8] = { 0x90, 0x8d, 0xb4, 0x26, // nop
- 0x00, 0x00, 0x00, 0x00 }; // leal 0L(%esi,1),%esi
- const char nop9[9] = { 0x89, 0xf6, 0x8d, 0xbc, // movl %esi,%esi
- 0x27, 0x00, 0x00, 0x00, // leal 0L(%edi,1),%edi
- 0x00 };
- const char nop10[10] = { 0x8d, 0x76, 0x00, 0x8d, // leal 0(%esi),%esi
- 0xbc, 0x27, 0x00, 0x00, // leal 0L(%edi,1),%edi
- 0x00, 0x00 };
- const char nop11[11] = { 0x8d, 0x74, 0x26, 0x00, // leal 0(%esi,1),%esi
- 0x8d, 0xbc, 0x27, 0x00, // leal 0L(%edi,1),%edi
- 0x00, 0x00, 0x00 };
- const char nop12[12] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
- 0x00, 0x00, 0x8d, 0xbf, // leal 0L(%edi),%edi
- 0x00, 0x00, 0x00, 0x00 };
- const char nop13[13] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
- 0x00, 0x00, 0x8d, 0xbc, // leal 0L(%edi,1),%edi
- 0x27, 0x00, 0x00, 0x00,
- 0x00 };
- const char nop14[14] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi
- 0x00, 0x00, 0x00, 0x8d, // leal 0L(%edi,1),%edi
- 0xbc, 0x27, 0x00, 0x00,
- 0x00, 0x00 };
- const char nop15[15] = { 0xeb, 0x0d, 0x90, 0x90, // jmp .+15
- 0x90, 0x90, 0x90, 0x90, // nop,nop,nop,...
- 0x90, 0x90, 0x90, 0x90,
- 0x90, 0x90, 0x90 };
-
- const char* nops[16] = {
- NULL,
- nop1, nop2, nop3, nop4, nop5, nop6, nop7,
- nop8, nop9, nop10, nop11, nop12, nop13, nop14, nop15
- };
-
- return std::string(nops[length], length);
-}
-
-// The selector for i386 object files.
-
-class Target_selector_i386 : public Target_selector
-{
-public:
- Target_selector_i386()
- : Target_selector(elfcpp::EM_386, 32, false, "elf32-i386")
- { }
-
- Target*
- do_instantiate_target()
- { return new Target_i386(); }
-};
-
-Target_selector_i386 target_selector_i386;
-
-} // End anonymous namespace.
diff --git a/gold/po/POTFILES.in b/gold/po/POTFILES.in
deleted file mode 100644
index 4d6122c0a5b..00000000000
--- a/gold/po/POTFILES.in
+++ /dev/null
@@ -1,79 +0,0 @@
-archive.cc
-archive.h
-binary.cc
-binary.h
-common.cc
-common.h
-compressed_output.cc
-compressed_output.h
-copy-relocs.cc
-copy-relocs.h
-cref.cc
-cref.h
-defstd.cc
-defstd.h
-descriptors.cc
-descriptors.h
-dirsearch.cc
-dirsearch.h
-dwarf_reader.cc
-dwarf_reader.h
-dynobj.cc
-dynobj.h
-ehframe.cc
-ehframe.h
-errors.cc
-errors.h
-expression.cc
-fileread.cc
-fileread.h
-gold-threads.cc
-gold-threads.h
-gold.cc
-gold.h
-i386.cc
-layout.cc
-layout.h
-mapfile.cc
-mapfile.h
-merge.cc
-merge.h
-object.cc
-object.h
-options.cc
-options.h
-output.cc
-output.h
-parameters.cc
-parameters.h
-powerpc.cc
-readsyms.cc
-readsyms.h
-reduced_debug_output.cc
-reduced_debug_output.h
-reloc-types.h
-reloc.cc
-reloc.h
-resolve.cc
-script-c.h
-script-sections.cc
-script-sections.h
-script.cc
-script.h
-sparc.cc
-stringpool.cc
-stringpool.h
-symtab.cc
-symtab.h
-target-reloc.h
-target-select.cc
-target-select.h
-target.h
-tls.h
-token.h
-version.cc
-workqueue-internal.h
-workqueue-threads.cc
-workqueue.cc
-workqueue.h
-x86_64.cc
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
deleted file mode 100644
index 421cfdb206a..00000000000
--- a/gold/powerpc.cc
+++ /dev/null
@@ -1,1973 +0,0 @@
-// powerpc.cc -- powerpc target support for gold.
-
-// Copyright 2008 Free Software Foundation, Inc.
-// Written by David S. Miller <davem@davemloft.net>
-// and David Edelsohn <edelsohn@gnu.org>
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-#include "gold.h"
-
-#include "elfcpp.h"
-#include "parameters.h"
-#include "reloc.h"
-#include "powerpc.h"
-#include "object.h"
-#include "symtab.h"
-#include "layout.h"
-#include "output.h"
-#include "copy-relocs.h"
-#include "target.h"
-#include "target-reloc.h"
-#include "target-select.h"
-#include "tls.h"
-#include "errors.h"
-
-namespace
-{
-
-using namespace gold;
-
-template<int size, bool big_endian>
-class Output_data_plt_powerpc;
-
-template<int size, bool big_endian>
-class Target_powerpc : public Sized_target<size, big_endian>
-{
- public:
- typedef Output_data_reloc<elfcpp::SHT_RELA, true, size, big_endian> Reloc_section;
-
- Target_powerpc()
- : Sized_target<size, big_endian>(&powerpc_info),
- got_(NULL), got2_(NULL), toc_(NULL),
- plt_(NULL), rela_dyn_(NULL),
- copy_relocs_(elfcpp::R_POWERPC_COPY),
- dynbss_(NULL), got_mod_index_offset_(-1U)
- {
- }
-
- // Scan the relocations to look for symbol adjustments.
- void
- scan_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols);
- // Finalize the sections.
- void
- do_finalize_sections(Layout*);
-
- // Return the value to use for a dynamic which requires special
- // treatment.
- uint64_t
- do_dynsym_value(const Symbol*) const;
-
- // Relocate a section.
- void
- relocate_section(const Relocate_info<size, big_endian>*,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr view_address,
- section_size_type view_size);
-
- // Scan the relocs during a relocatable link.
- void
- scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols,
- Relocatable_relocs*);
-
- // Relocate a section during a relocatable link.
- void
- relocate_for_relocatable(const Relocate_info<size, big_endian>*,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- off_t offset_in_output_section,
- const Relocatable_relocs*,
- unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr view_address,
- section_size_type view_size,
- unsigned char* reloc_view,
- section_size_type reloc_view_size);
-
- // Return whether SYM is defined by the ABI.
- bool
- do_is_defined_by_abi(Symbol* sym) const
- {
- return strcmp(sym->name(), "___tls_get_addr") == 0;
- }
-
- // Return the size of the GOT section.
- section_size_type
- got_size()
- {
- gold_assert(this->got_ != NULL);
- return this->got_->data_size();
- }
-
- private:
-
- // The class which scans relocations.
- class Scan
- {
- public:
- Scan()
- : issued_non_pic_error_(false)
- { }
-
- inline void
- local(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_powerpc* target,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rela<size, big_endian>& reloc, unsigned int r_type,
- const elfcpp::Sym<size, big_endian>& lsym);
-
- inline void
- global(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_powerpc* target,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rela<size, big_endian>& reloc, unsigned int r_type,
- Symbol* gsym);
-
- private:
- static void
- unsupported_reloc_local(Sized_relobj<size, big_endian>*,
- unsigned int r_type);
-
- static void
- unsupported_reloc_global(Sized_relobj<size, big_endian>*,
- unsigned int r_type, Symbol*);
-
- static void
- generate_tls_call(Symbol_table* symtab, Layout* layout,
- Target_powerpc* target);
-
- void
- check_non_pic(Relobj*, unsigned int r_type);
-
- // Whether we have issued an error about a non-PIC compilation.
- bool issued_non_pic_error_;
- };
-
- // The class which implements relocation.
- class Relocate
- {
- public:
- // Do a relocation. Return false if the caller should not issue
- // any warnings about this relocation.
- inline bool
- relocate(const Relocate_info<size, big_endian>*, Target_powerpc*,
- size_t relnum, const elfcpp::Rela<size, big_endian>&,
- unsigned int r_type, const Sized_symbol<size>*,
- const Symbol_value<size>*,
- unsigned char*,
- typename elfcpp::Elf_types<size>::Elf_Addr,
- section_size_type);
-
- private:
- // Do a TLS relocation.
- inline void
- relocate_tls(const Relocate_info<size, big_endian>*,
- Target_powerpc* target,
- size_t relnum, const elfcpp::Rela<size, big_endian>&,
- unsigned int r_type, const Sized_symbol<size>*,
- const Symbol_value<size>*,
- unsigned char*,
- typename elfcpp::Elf_types<size>::Elf_Addr,
- section_size_type);
- };
-
- // A class which returns the size required for a relocation type,
- // used while scanning relocs during a relocatable link.
- class Relocatable_size_for_reloc
- {
- public:
- unsigned int
- get_size_for_reloc(unsigned int, Relobj*);
- };
-
- // Get the GOT section, creating it if necessary.
- Output_data_got<size, big_endian>*
- got_section(Symbol_table*, Layout*);
-
- Output_data_space*
- got2_section() const
- {
- gold_assert (this->got2_ != NULL);
- return this->got2_;
- }
-
- // Get the TOC section.
- Output_data_space*
- toc_section() const
- {
- gold_assert (this->toc_ != NULL);
- return this->toc_;
- }
-
- // Create a PLT entry for a global symbol.
- void
- make_plt_entry(Symbol_table*, Layout*, Symbol*);
-
- // Create a GOT entry for the TLS module index.
- unsigned int
- got_mod_index_entry(Symbol_table* symtab, Layout* layout,
- Sized_relobj<size, big_endian>* object);
-
- // Get the PLT section.
- const Output_data_plt_powerpc<size, big_endian>*
- plt_section() const
- {
- gold_assert(this->plt_ != NULL);
- return this->plt_;
- }
-
- // Get the dynamic reloc section, creating it if necessary.
- Reloc_section*
- rela_dyn_section(Layout*);
-
- // Return true if the symbol may need a COPY relocation.
- // References from an executable object to non-function symbols
- // defined in a dynamic object may need a COPY relocation.
- bool
- may_need_copy_reloc(Symbol* gsym)
- {
- return (!parameters->options().shared()
- && gsym->is_from_dynobj()
- && gsym->type() != elfcpp::STT_FUNC);
- }
-
- // Copy a relocation against a global symbol.
- void
- copy_reloc(Symbol_table* symtab, Layout* layout,
- Sized_relobj<size, big_endian>* object,
- unsigned int shndx, Output_section* output_section,
- Symbol* sym, const elfcpp::Rela<size, big_endian>& reloc)
- {
- this->copy_relocs_.copy_reloc(symtab, layout,
- symtab->get_sized_symbol<size>(sym),
- object, shndx, output_section,
- reloc, this->rela_dyn_section(layout));
- }
-
- // Information about this specific target which we pass to the
- // general Target structure.
- static Target::Target_info powerpc_info;
-
- // The types of GOT entries needed for this platform.
- enum Got_type
- {
- GOT_TYPE_STANDARD = 0, // GOT entry for a regular symbol
- GOT_TYPE_TLS_OFFSET = 1, // GOT entry for TLS offset
- GOT_TYPE_TLS_PAIR = 2, // GOT entry for TLS module/offset pair
- };
-
- // The GOT section.
- Output_data_got<size, big_endian>* got_;
- // The GOT2 section.
- Output_data_space* got2_;
- // The TOC section.
- Output_data_space* toc_;
- // The PLT section.
- Output_data_plt_powerpc<size, big_endian>* plt_;
- // The dynamic reloc section.
- Reloc_section* rela_dyn_;
- // Relocs saved to avoid a COPY reloc.
- Copy_relocs<elfcpp::SHT_RELA, size, big_endian> copy_relocs_;
- // Space for variables copied with a COPY reloc.
- Output_data_space* dynbss_;
- // Offset of the GOT entry for the TLS module index;
- unsigned int got_mod_index_offset_;
-};
-
-template<>
-Target::Target_info Target_powerpc<32, true>::powerpc_info =
-{
- 32, // size
- true, // is_big_endian
- elfcpp::EM_PPC, // machine_code
- false, // has_make_symbol
- false, // has_resolve
- false, // has_code_fill
- true, // is_default_stack_executable
- '\0', // wrap_char
- "/usr/lib/ld.so.1", // dynamic_linker
- 0x10000000, // default_text_segment_address
- 64 * 1024, // abi_pagesize (overridable by -z max-page-size)
- 4 * 1024 // common_pagesize (overridable by -z common-page-size)
-};
-
-template<>
-Target::Target_info Target_powerpc<32, false>::powerpc_info =
-{
- 32, // size
- false, // is_big_endian
- elfcpp::EM_PPC, // machine_code
- false, // has_make_symbol
- false, // has_resolve
- false, // has_code_fill
- true, // is_default_stack_executable
- '\0', // wrap_char
- "/usr/lib/ld.so.1", // dynamic_linker
- 0x10000000, // default_text_segment_address
- 64 * 1024, // abi_pagesize (overridable by -z max-page-size)
- 4 * 1024 // common_pagesize (overridable by -z common-page-size)
-};
-
-template<>
-Target::Target_info Target_powerpc<64, true>::powerpc_info =
-{
- 64, // size
- true, // is_big_endian
- elfcpp::EM_PPC64, // machine_code
- false, // has_make_symbol
- false, // has_resolve
- false, // has_code_fill
- true, // is_default_stack_executable
- '\0', // wrap_char
- "/usr/lib/ld.so.1", // dynamic_linker
- 0x10000000, // default_text_segment_address
- 64 * 1024, // abi_pagesize (overridable by -z max-page-size)
- 8 * 1024 // common_pagesize (overridable by -z common-page-size)
-};
-
-template<>
-Target::Target_info Target_powerpc<64, false>::powerpc_info =
-{
- 64, // size
- false, // is_big_endian
- elfcpp::EM_PPC64, // machine_code
- false, // has_make_symbol
- false, // has_resolve
- false, // has_code_fill
- true, // is_default_stack_executable
- '\0', // wrap_char
- "/usr/lib/ld.so.1", // dynamic_linker
- 0x10000000, // default_text_segment_address
- 64 * 1024, // abi_pagesize (overridable by -z max-page-size)
- 8 * 1024 // common_pagesize (overridable by -z common-page-size)
-};
-
-template<int size, bool big_endian>
-class Powerpc_relocate_functions
-{
-private:
- // Do a simple relocation with the addend in the relocation.
- template<int valsize>
- static inline void
- rela(unsigned char* view,
- unsigned int right_shift,
- elfcpp::Elf_Xword dst_mask,
- typename elfcpp::Swap<size, big_endian>::Valtype value,
- typename elfcpp::Swap<size, big_endian>::Valtype addend)
- {
- typedef typename elfcpp::Swap<valsize, big_endian>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<valsize, big_endian>::readval(wv);
- Valtype reloc = ((value + addend) >> right_shift);
-
- val &= ~dst_mask;
- reloc &= dst_mask;
-
- elfcpp::Swap<valsize, big_endian>::writeval(wv, val | reloc);
- }
-
- // Do a simple relocation using a symbol value with the addend in
- // the relocation.
- template<int valsize>
- static inline void
- rela(unsigned char* view,
- unsigned int right_shift,
- elfcpp::Elf_Xword dst_mask,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Swap<valsize, big_endian>::Valtype addend)
- {
- typedef typename elfcpp::Swap<valsize, big_endian>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<valsize, big_endian>::readval(wv);
- Valtype reloc = (psymval->value(object, addend) >> right_shift);
-
- val &= ~dst_mask;
- reloc &= dst_mask;
-
- elfcpp::Swap<valsize, big_endian>::writeval(wv, val | reloc);
- }
-
- // Do a simple relocation using a symbol value with the addend in
- // the relocation, unaligned.
- template<int valsize>
- static inline void
- rela_ua(unsigned char* view, unsigned int right_shift,
- elfcpp::Elf_Xword dst_mask,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Swap<size, big_endian>::Valtype addend)
- {
- typedef typename elfcpp::Swap_unaligned<valsize,
- big_endian>::Valtype Valtype;
- unsigned char* wv = view;
- Valtype val = elfcpp::Swap_unaligned<valsize, big_endian>::readval(wv);
- Valtype reloc = (psymval->value(object, addend) >> right_shift);
-
- val &= ~dst_mask;
- reloc &= dst_mask;
-
- elfcpp::Swap_unaligned<valsize, big_endian>::writeval(wv, val | reloc);
- }
-
- // Do a simple PC relative relocation with a Symbol_value with the
- // addend in the relocation.
- template<int valsize>
- static inline void
- pcrela(unsigned char* view, unsigned int right_shift,
- elfcpp::Elf_Xword dst_mask,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Swap<size, big_endian>::Valtype addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- typedef typename elfcpp::Swap<valsize, big_endian>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<valsize, big_endian>::readval(wv);
- Valtype reloc = ((psymval->value(object, addend) - address)
- >> right_shift);
-
- val &= ~dst_mask;
- reloc &= dst_mask;
-
- elfcpp::Swap<valsize, big_endian>::writeval(wv, val | reloc);
- }
-
- template<int valsize>
- static inline void
- pcrela_unaligned(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Swap<size, big_endian>::Valtype addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- typedef typename elfcpp::Swap_unaligned<valsize,
- big_endian>::Valtype Valtype;
- unsigned char* wv = view;
- Valtype reloc = (psymval->value(object, addend) - address);
-
- elfcpp::Swap_unaligned<valsize, big_endian>::writeval(wv, reloc);
- }
-
- typedef Powerpc_relocate_functions<size, big_endian> This;
- typedef Relocate_functions<size, big_endian> This_reloc;
-public:
- // R_POWERPC_REL32: (Symbol + Addend - Address)
- static inline void
- rel32(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- { This_reloc::pcrela32(view, object, psymval, addend, address); }
-
- // R_POWERPC_REL24: (Symbol + Addend - Address) & 0x3fffffc
- static inline void
- rel24(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This::template pcrela<32>(view, 0, 0x03fffffc, object,
- psymval, addend, address);
- }
-
- // R_POWERPC_REL14: (Symbol + Addend - Address) & 0xfffc
- static inline void
- rel14(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This::template pcrela<32>(view, 0, 0x0000fffc, object,
- psymval, addend, address);
- }
-
- // R_POWERPC_ADDR16: (Symbol + Addend) & 0xffff
- static inline void
- addr16(unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- { This_reloc::rela16(view, value, addend); }
-
- static inline void
- addr16(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- { This_reloc::rela16(view, object, psymval, addend); }
-
- // R_POWERPC_ADDR16_DS: (Symbol + Addend) & 0xfffc
- static inline void
- addr16_ds(unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This::template rela<16>(view, 0, 0xfffc, value, addend);
- }
-
- // R_POWERPC_ADDR16_LO: (Symbol + Addend) & 0xffff
- static inline void
- addr16_lo(unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- { This_reloc::rela16(view, value, addend); }
-
- static inline void
- addr16_lo(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- { This_reloc::rela16(view, object, psymval, addend); }
-
- // R_POWERPC_ADDR16_HI: ((Symbol + Addend) >> 16) & 0xffff
- static inline void
- addr16_hi(unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This::template rela<16>(view, 16, 0xffff, value, addend);
- }
-
- static inline void
- addr16_hi(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This::template rela<16>(view, 16, 0xffff, object, psymval, addend);
- }
-
- // R_POWERPC_ADDR16_HA: Same as R_POWERPC_ADDR16_HI except that if the
- // final value of the low 16 bits of the
- // relocation is negative, add one.
- static inline void
- addr16_ha(unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- typename elfcpp::Elf_types<size>::Elf_Addr reloc;
-
- reloc = value + addend;
-
- if (reloc & 0x8000)
- reloc += 0x10000;
- reloc >>= 16;
-
- elfcpp::Swap<16, big_endian>::writeval(view, reloc);
- }
-
- static inline void
- addr16_ha(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- typename elfcpp::Elf_types<size>::Elf_Addr reloc;
-
- reloc = psymval->value(object, addend);
-
- if (reloc & 0x8000)
- reloc += 0x10000;
- reloc >>= 16;
-
- elfcpp::Swap<16, big_endian>::writeval(view, reloc);
- }
-
- // R_PPC_REL16: (Symbol + Addend - Address) & 0xffff
- static inline void
- rel16(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- { This_reloc::pcrela16(view, object, psymval, addend, address); }
-
- // R_PPC_REL16_LO: (Symbol + Addend - Address) & 0xffff
- static inline void
- rel16_lo(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- { This_reloc::pcrela16(view, object, psymval, addend, address); }
-
- // R_PPC_REL16_HI: ((Symbol + Addend - Address) >> 16) & 0xffff
- static inline void
- rel16_hi(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This::template pcrela<16>(view, 16, 0xffff, object,
- psymval, addend, address);
- }
-
- // R_PPC_REL16_HA: Same as R_PPC_REL16_HI except that if the
- // final value of the low 16 bits of the
- // relocation is negative, add one.
- static inline void
- rel16_ha(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- typedef typename elfcpp::Swap<16, true>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<16, true>::readval(wv);
- typename elfcpp::Elf_types<size>::Elf_Addr reloc;
-
- reloc = (psymval->value(object, addend) - address);
- if (reloc & 0x8000)
- reloc += 0x10000;
- reloc >>= 16;
-
- val &= ~static_cast<Valtype>(0xffff);
- reloc &= static_cast<Valtype>(0xffff);
-
- elfcpp::Swap<16, true>::writeval(wv, val | reloc);
- }
-};
-
-// Get the GOT section, creating it if necessary.
-
-template<int size, bool big_endian>
-Output_data_got<size, big_endian>*
-Target_powerpc<size, big_endian>::got_section(Symbol_table* symtab,
- Layout* layout)
-{
- if (this->got_ == NULL)
- {
- gold_assert(symtab != NULL && layout != NULL);
-
- this->got_ = new Output_data_got<size, big_endian>();
-
- layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
- elfcpp::SHF_ALLOC | elfcpp::SHF_WRITE,
- this->got_);
-
- // Create the GOT2 or TOC in the .got section.
- if (size == 32)
- {
- this->got2_ = new Output_data_space(4, "** GOT2");
- layout->add_output_section_data(".got2", elfcpp::SHT_PROGBITS,
- elfcpp::SHF_ALLOC
- | elfcpp::SHF_WRITE,
- this->got2_);
- }
- else
- {
- this->toc_ = new Output_data_space(8, "** TOC");
- layout->add_output_section_data(".toc", elfcpp::SHT_PROGBITS,
- elfcpp::SHF_ALLOC
- | elfcpp::SHF_WRITE,
- this->toc_);
- }
-
- // Define _GLOBAL_OFFSET_TABLE_ at the start of the .got section.
- symtab->define_in_output_data("_GLOBAL_OFFSET_TABLE_", NULL,
- this->got_,
- 0, 0, elfcpp::STT_OBJECT,
- elfcpp::STB_LOCAL,
- elfcpp::STV_HIDDEN, 0,
- false, false);
- }
-
- return this->got_;
-}
-
-// Get the dynamic reloc section, creating it if necessary.
-
-template<int size, bool big_endian>
-typename Target_powerpc<size, big_endian>::Reloc_section*
-Target_powerpc<size, big_endian>::rela_dyn_section(Layout* layout)
-{
- if (this->rela_dyn_ == NULL)
- {
- gold_assert(layout != NULL);
- this->rela_dyn_ = new Reloc_section(parameters->options().combreloc());
- layout->add_output_section_data(".rela.dyn", elfcpp::SHT_RELA,
- elfcpp::SHF_ALLOC, this->rela_dyn_);
- }
- return this->rela_dyn_;
-}
-
-// A class to handle the PLT data.
-
-template<int size, bool big_endian>
-class Output_data_plt_powerpc : public Output_section_data
-{
- public:
- typedef Output_data_reloc<elfcpp::SHT_RELA, true,
- size, big_endian> Reloc_section;
-
- Output_data_plt_powerpc(Layout*);
-
- // Add an entry to the PLT.
- void add_entry(Symbol* gsym);
-
- // Return the .rela.plt section data.
- const Reloc_section* rel_plt() const
- {
- return this->rel_;
- }
-
- protected:
- void do_adjust_output_section(Output_section* os);
-
- private:
- // The size of an entry in the PLT.
- static const int base_plt_entry_size = (size == 32 ? 16 : 24);
-
- // Set the final size.
- void
- set_final_data_size()
- {
- unsigned int full_count = this->count_ + 4;
-
- this->set_data_size(full_count * base_plt_entry_size);
- }
-
- // Write out the PLT data.
- void
- do_write(Output_file*);
-
- // The reloc section.
- Reloc_section* rel_;
- // The number of PLT entries.
- unsigned int count_;
-};
-
-// Create the PLT section. The ordinary .got section is an argument,
-// since we need to refer to the start.
-
-template<int size, bool big_endian>
-Output_data_plt_powerpc<size, big_endian>::Output_data_plt_powerpc(Layout* layout)
- : Output_section_data(size == 32 ? 4 : 8), count_(0)
-{
- this->rel_ = new Reloc_section(false);
- layout->add_output_section_data(".rela.plt", elfcpp::SHT_RELA,
- elfcpp::SHF_ALLOC, this->rel_);
-}
-
-template<int size, bool big_endian>
-void
-Output_data_plt_powerpc<size, big_endian>::do_adjust_output_section(Output_section* os)
-{
- os->set_entsize(0);
-}
-
-// Add an entry to the PLT.
-
-template<int size, bool big_endian>
-void
-Output_data_plt_powerpc<size, big_endian>::add_entry(Symbol* gsym)
-{
- gold_assert(!gsym->has_plt_offset());
- unsigned int index = this->count_+ + 4;
- section_offset_type plt_offset;
-
- if (index < 8192)
- plt_offset = index * base_plt_entry_size;
- else
- gold_unreachable();
-
- gsym->set_plt_offset(plt_offset);
-
- ++this->count_;
-
- gsym->set_needs_dynsym_entry();
- this->rel_->add_global(gsym, elfcpp::R_POWERPC_JMP_SLOT, this,
- plt_offset, 0);
-}
-
-static const unsigned int addis_11_11 = 0x3d6b0000;
-static const unsigned int addis_11_30 = 0x3d7e0000;
-static const unsigned int addis_12_12 = 0x3d8c0000;
-static const unsigned int addi_11_11 = 0x396b0000;
-static const unsigned int add_0_11_11 = 0x7c0b5a14;
-static const unsigned int add_11_0_11 = 0x7d605a14;
-static const unsigned int b = 0x48000000;
-static const unsigned int bcl_20_31 = 0x429f0005;
-static const unsigned int bctr = 0x4e800420;
-static const unsigned int lis_11 = 0x3d600000;
-static const unsigned int lis_12 = 0x3d800000;
-static const unsigned int lwzu_0_12 = 0x840c0000;
-static const unsigned int lwz_0_12 = 0x800c0000;
-static const unsigned int lwz_11_11 = 0x816b0000;
-static const unsigned int lwz_11_30 = 0x817e0000;
-static const unsigned int lwz_12_12 = 0x818c0000;
-static const unsigned int mflr_0 = 0x7c0802a6;
-static const unsigned int mflr_12 = 0x7d8802a6;
-static const unsigned int mtctr_0 = 0x7c0903a6;
-static const unsigned int mtctr_11 = 0x7d6903a6;
-static const unsigned int mtlr_0 = 0x7c0803a6;
-static const unsigned int nop = 0x60000000;
-static const unsigned int sub_11_11_12 = 0x7d6c5850;
-
-static const unsigned int addis_r12_r2 = 0x3d820000; /* addis %r12,%r2,xxx@ha */
-static const unsigned int std_r2_40r1 = 0xf8410028; /* std %r2,40(%r1) */
-static const unsigned int ld_r11_0r12 = 0xe96c0000; /* ld %r11,xxx+0@l(%r12) */
-static const unsigned int ld_r2_0r12 = 0xe84c0000; /* ld %r2,xxx+8@l(%r12) */
- /* ld %r11,xxx+16@l(%r12) */
-
-
-// Write out the PLT.
-
-template<int size, bool big_endian>
-void
-Output_data_plt_powerpc<size, big_endian>::do_write(Output_file* of)
-{
- const off_t offset = this->offset();
- const section_size_type oview_size =
- convert_to_section_size_type(this->data_size());
- unsigned char* const oview = of->get_output_view(offset, oview_size);
- unsigned char* pov = oview;
-
- memset(pov, 0, base_plt_entry_size * 4);
- pov += base_plt_entry_size * 4;
-
- unsigned int plt_offset = base_plt_entry_size * 4;
- const unsigned int count = this->count_;
-
- if (size == 64)
- {
- for (unsigned int i = 0; i < count; i++)
- {
- }
- }
- else
- {
- for (unsigned int i = 0; i < count; i++)
- {
- elfcpp::Swap<32, true>::writeval(pov + 0x00,
- lwz_11_30 + plt_offset);
- elfcpp::Swap<32, true>::writeval(pov + 0x04, mtctr_11);
- elfcpp::Swap<32, true>::writeval(pov + 0x08, bctr);
- elfcpp::Swap<32, true>::writeval(pov + 0x0c, nop);
- pov += base_plt_entry_size;
- plt_offset += base_plt_entry_size;
- }
- }
-
- gold_assert(static_cast<section_size_type>(pov - oview) == oview_size);
-
- of->write_output_view(offset, oview_size, oview);
-}
-
-// Create a PLT entry for a global symbol.
-
-template<int size, bool big_endian>
-void
-Target_powerpc<size, big_endian>::make_plt_entry(Symbol_table* symtab,
- Layout* layout,
- Symbol* gsym)
-{
- if (gsym->has_plt_offset())
- return;
-
- if (this->plt_ == NULL)
- {
- // Create the GOT section first.
- this->got_section(symtab, layout);
-
- this->plt_ = new Output_data_plt_powerpc<size, big_endian>(layout);
- layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
- (elfcpp::SHF_ALLOC
- | elfcpp::SHF_EXECINSTR
- | elfcpp::SHF_WRITE),
- this->plt_);
-
- // Define _PROCEDURE_LINKAGE_TABLE_ at the start of the .plt section.
- symtab->define_in_output_data("_PROCEDURE_LINKAGE_TABLE_", NULL,
- this->plt_,
- 0, 0, elfcpp::STT_OBJECT,
- elfcpp::STB_LOCAL,
- elfcpp::STV_HIDDEN, 0,
- false, false);
- }
-
- this->plt_->add_entry(gsym);
-}
-
-// Create a GOT entry for the TLS module index.
-
-template<int size, bool big_endian>
-unsigned int
-Target_powerpc<size, big_endian>::got_mod_index_entry(Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<size, big_endian>* object)
-{
- if (this->got_mod_index_offset_ == -1U)
- {
- gold_assert(symtab != NULL && layout != NULL && object != NULL);
- Reloc_section* rela_dyn = this->rela_dyn_section(layout);
- Output_data_got<size, big_endian>* got;
- unsigned int got_offset;
-
- got = this->got_section(symtab, layout);
- got_offset = got->add_constant(0);
- rela_dyn->add_local(object, 0, elfcpp::R_POWERPC_DTPMOD, got,
- got_offset, 0);
- got->add_constant(0);
- this->got_mod_index_offset_ = got_offset;
- }
- return this->got_mod_index_offset_;
-}
-
-// Optimize the TLS relocation type based on what we know about the
-// symbol. IS_FINAL is true if the final address of this symbol is
-// known at link time.
-
-static tls::Tls_optimization
-optimize_tls_reloc(bool /* is_final */, int r_type)
-{
- // If we are generating a shared library, then we can't do anything
- // in the linker.
- if (parameters->options().shared())
- return tls::TLSOPT_NONE;
- switch (r_type)
- {
- // XXX
- default:
- gold_unreachable();
- }
-}
-
-// Report an unsupported relocation against a local symbol.
-
-template<int size, bool big_endian>
-void
-Target_powerpc<size, big_endian>::Scan::unsupported_reloc_local(
- Sized_relobj<size, big_endian>* object,
- unsigned int r_type)
-{
- gold_error(_("%s: unsupported reloc %u against local symbol"),
- object->name().c_str(), r_type);
-}
-
-// We are about to emit a dynamic relocation of type R_TYPE. If the
-// dynamic linker does not support it, issue an error.
-
-template<int size, bool big_endian>
-void
-Target_powerpc<size, big_endian>::Scan::check_non_pic(Relobj* object,
- unsigned int r_type)
-{
- gold_assert(r_type != elfcpp::R_POWERPC_NONE);
-
- // These are the relocation types supported by glibc for both 32-bit
- // and 64-bit powerpc.
- switch (r_type)
- {
- case elfcpp::R_POWERPC_RELATIVE:
- case elfcpp::R_POWERPC_GLOB_DAT:
- case elfcpp::R_POWERPC_DTPMOD:
- case elfcpp::R_POWERPC_DTPREL:
- case elfcpp::R_POWERPC_TPREL:
- case elfcpp::R_POWERPC_JMP_SLOT:
- case elfcpp::R_POWERPC_COPY:
- case elfcpp::R_POWERPC_ADDR32:
- case elfcpp::R_POWERPC_ADDR24:
- case elfcpp::R_POWERPC_REL24:
- return;
-
- default:
- break;
- }
-
- if (size == 64)
- {
- switch (r_type)
- {
- // These are the relocation types supported only on 64-bit.
- case elfcpp::R_PPC64_ADDR64:
- case elfcpp::R_PPC64_TPREL16_LO_DS:
- case elfcpp::R_PPC64_TPREL16_DS:
- case elfcpp::R_POWERPC_TPREL16:
- case elfcpp::R_POWERPC_TPREL16_LO:
- case elfcpp::R_POWERPC_TPREL16_HI:
- case elfcpp::R_POWERPC_TPREL16_HA:
- case elfcpp::R_PPC64_TPREL16_HIGHER:
- case elfcpp::R_PPC64_TPREL16_HIGHEST:
- case elfcpp::R_PPC64_TPREL16_HIGHERA:
- case elfcpp::R_PPC64_TPREL16_HIGHESTA:
- case elfcpp::R_PPC64_ADDR16_LO_DS:
- case elfcpp::R_POWERPC_ADDR16_LO:
- case elfcpp::R_POWERPC_ADDR16_HI:
- case elfcpp::R_POWERPC_ADDR16_HA:
- case elfcpp::R_POWERPC_ADDR30:
- case elfcpp::R_PPC64_UADDR64:
- case elfcpp::R_POWERPC_UADDR32:
- case elfcpp::R_POWERPC_ADDR16:
- case elfcpp::R_POWERPC_UADDR16:
- case elfcpp::R_PPC64_ADDR16_DS:
- case elfcpp::R_PPC64_ADDR16_HIGHER:
- case elfcpp::R_PPC64_ADDR16_HIGHEST:
- case elfcpp::R_PPC64_ADDR16_HIGHERA:
- case elfcpp::R_PPC64_ADDR16_HIGHESTA:
- case elfcpp::R_POWERPC_ADDR14_BRTAKEN:
- case elfcpp::R_POWERPC_ADDR14_BRNTAKEN:
- case elfcpp::R_POWERPC_REL32:
- case elfcpp::R_PPC64_REL64:
- return;
-
- default:
- break;
- }
- }
- else
- {
- switch (r_type)
- {
- // These are the relocation types supported only on 32-bit.
-
- default:
- break;
- }
- }
-
- // This prevents us from issuing more than one error per reloc
- // section. But we can still wind up issuing more than one
- // error per object file.
- if (this->issued_non_pic_error_)
- return;
- object->error(_("requires unsupported dynamic reloc; "
- "recompile with -fPIC"));
- this->issued_non_pic_error_ = true;
- return;
-}
-
-// Scan a relocation for a local symbol.
-
-template<int size, bool big_endian>
-inline void
-Target_powerpc<size, big_endian>::Scan::local(
- const General_options&,
- Symbol_table* symtab,
- Layout* layout,
- Target_powerpc<size, big_endian>* target,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rela<size, big_endian>& reloc,
- unsigned int r_type,
- const elfcpp::Sym<size, big_endian>& lsym)
-{
- switch (r_type)
- {
- case elfcpp::R_POWERPC_NONE:
- case elfcpp::R_POWERPC_GNU_VTINHERIT:
- case elfcpp::R_POWERPC_GNU_VTENTRY:
- break;
-
- case elfcpp::R_PPC64_ADDR64:
- case elfcpp::R_POWERPC_ADDR32:
- case elfcpp::R_POWERPC_ADDR16_HA:
- case elfcpp::R_POWERPC_ADDR16_LO:
- // If building a shared library (or a position-independent
- // executable), we need to create a dynamic relocation for
- // this location.
- if (parameters->options().output_is_position_independent())
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
-
- check_non_pic(object, r_type);
- if (lsym.get_st_type() != elfcpp::STT_SECTION)
- {
- unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
- rela_dyn->add_local(object, r_sym, r_type, output_section,
- data_shndx, reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
- gold_assert(lsym.get_st_value() == 0);
- rela_dyn->add_local_relative(object, r_sym, r_type,
- output_section, data_shndx,
- reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- }
- break;
-
- case elfcpp::R_POWERPC_REL24:
- case elfcpp::R_PPC_LOCAL24PC:
- case elfcpp::R_POWERPC_REL32:
- case elfcpp::R_PPC_REL16_LO:
- case elfcpp::R_PPC_REL16_HA:
- break;
-
- case elfcpp::R_POWERPC_GOT16:
- case elfcpp::R_POWERPC_GOT16_LO:
- case elfcpp::R_POWERPC_GOT16_HI:
- case elfcpp::R_POWERPC_GOT16_HA:
- case elfcpp::R_PPC64_TOC16:
- case elfcpp::R_PPC64_TOC16_LO:
- case elfcpp::R_PPC64_TOC16_HI:
- case elfcpp::R_PPC64_TOC16_HA:
- case elfcpp::R_PPC64_TOC16_DS:
- case elfcpp::R_PPC64_TOC16_LO_DS:
- {
- // The symbol requires a GOT entry.
- Output_data_got<size, big_endian>* got;
- unsigned int r_sym;
-
- got = target->got_section(symtab, layout);
- r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
-
- // If we are generating a shared object, we need to add a
- // dynamic relocation for this symbol's GOT entry.
- if (parameters->options().output_is_position_independent())
- {
- if (!object->local_has_got_offset(r_sym, GOT_TYPE_STANDARD))
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- unsigned int off;
-
- off = got->add_constant(0);
- object->set_local_got_offset(r_sym, GOT_TYPE_STANDARD, off);
- rela_dyn->add_local_relative(object, r_sym,
- elfcpp::R_POWERPC_RELATIVE,
- got, off, 0);
- }
- }
- else
- got->add_local(object, r_sym, GOT_TYPE_STANDARD);
- }
- break;
-
- case elfcpp::R_PPC64_TOC:
- // We need a GOT section.
- target->got_section(symtab, layout);
- break;
-
- // These are relocations which should only be seen by the
- // dynamic linker, and should never be seen here.
- case elfcpp::R_POWERPC_COPY:
- case elfcpp::R_POWERPC_GLOB_DAT:
- case elfcpp::R_POWERPC_JMP_SLOT:
- case elfcpp::R_POWERPC_RELATIVE:
- case elfcpp::R_POWERPC_DTPMOD:
- gold_error(_("%s: unexpected reloc %u in object file"),
- object->name().c_str(), r_type);
- break;
-
- default:
- unsupported_reloc_local(object, r_type);
- break;
- }
-}
-
-// Report an unsupported relocation against a global symbol.
-
-template<int size, bool big_endian>
-void
-Target_powerpc<size, big_endian>::Scan::unsupported_reloc_global(
- Sized_relobj<size, big_endian>* object,
- unsigned int r_type,
- Symbol* gsym)
-{
- gold_error(_("%s: unsupported reloc %u against global symbol %s"),
- object->name().c_str(), r_type, gsym->demangled_name().c_str());
-}
-
-// Scan a relocation for a global symbol.
-
-template<int size, bool big_endian>
-inline void
-Target_powerpc<size, big_endian>::Scan::global(
- const General_options&,
- Symbol_table* symtab,
- Layout* layout,
- Target_powerpc<size, big_endian>* target,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rela<size, big_endian>& reloc,
- unsigned int r_type,
- Symbol* gsym)
-{
- switch (r_type)
- {
- case elfcpp::R_POWERPC_NONE:
- case elfcpp::R_POWERPC_GNU_VTINHERIT:
- case elfcpp::R_POWERPC_GNU_VTENTRY:
- break;
-
- case elfcpp::R_PPC_PLTREL24:
- // If the symbol is fully resolved, this is just a PC32 reloc.
- // Otherwise we need a PLT entry.
- if (gsym->final_value_is_known())
- break;
- // If building a shared library, we can also skip the PLT entry
- // if the symbol is defined in the output file and is protected
- // or hidden.
- if (gsym->is_defined()
- && !gsym->is_from_dynobj()
- && !gsym->is_preemptible())
- break;
- target->make_plt_entry(symtab, layout, gsym);
- break;
-
- case elfcpp::R_POWERPC_ADDR16:
- case elfcpp::R_POWERPC_ADDR16_LO:
- case elfcpp::R_POWERPC_ADDR16_HI:
- case elfcpp::R_POWERPC_ADDR16_HA:
- case elfcpp::R_POWERPC_ADDR32:
- case elfcpp::R_PPC64_ADDR64:
- {
- // Make a PLT entry if necessary.
- if (gsym->needs_plt_entry())
- {
- target->make_plt_entry(symtab, layout, gsym);
- // Since this is not a PC-relative relocation, we may be
- // taking the address of a function. In that case we need to
- // set the entry in the dynamic symbol table to the address of
- // the PLT entry.
- if (gsym->is_from_dynobj() && !parameters->options().shared())
- gsym->set_needs_dynsym_value();
- }
- // Make a dynamic relocation if necessary.
- if (gsym->needs_dynamic_reloc(Symbol::ABSOLUTE_REF))
- {
- if (target->may_need_copy_reloc(gsym))
- {
- target->copy_reloc(symtab, layout, object,
- data_shndx, output_section, gsym, reloc);
- }
- else if ((r_type == elfcpp::R_POWERPC_ADDR32
- || r_type == elfcpp::R_PPC64_ADDR64)
- && gsym->can_use_relative_reloc(false))
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- rela_dyn->add_global_relative(gsym, elfcpp::R_POWERPC_RELATIVE,
- output_section, object,
- data_shndx, reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- else
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
-
- check_non_pic(object, r_type);
- if (gsym->is_from_dynobj()
- || gsym->is_undefined()
- || gsym->is_preemptible())
- rela_dyn->add_global(gsym, r_type, output_section,
- object, data_shndx,
- reloc.get_r_offset(),
- reloc.get_r_addend());
- else
- rela_dyn->add_global_relative(gsym, r_type,
- output_section, object,
- data_shndx,
- reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- }
- }
- break;
-
- case elfcpp::R_POWERPC_REL24:
- case elfcpp::R_PPC_LOCAL24PC:
- case elfcpp::R_PPC_REL16:
- case elfcpp::R_PPC_REL16_LO:
- case elfcpp::R_PPC_REL16_HI:
- case elfcpp::R_PPC_REL16_HA:
- {
- if (gsym->needs_plt_entry())
- target->make_plt_entry(symtab, layout, gsym);
- // Make a dynamic relocation if necessary.
- int flags = Symbol::NON_PIC_REF;
- if (gsym->type() == elfcpp::STT_FUNC)
- flags |= Symbol::FUNCTION_CALL;
- if (gsym->needs_dynamic_reloc(flags))
- {
- if (target->may_need_copy_reloc(gsym))
- {
- target->copy_reloc(symtab, layout, object,
- data_shndx, output_section, gsym,
- reloc);
- }
- else
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- check_non_pic(object, r_type);
- rela_dyn->add_global(gsym, r_type, output_section, object,
- data_shndx, reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- }
- }
- break;
-
- case elfcpp::R_POWERPC_GOT16:
- case elfcpp::R_POWERPC_GOT16_LO:
- case elfcpp::R_POWERPC_GOT16_HI:
- case elfcpp::R_POWERPC_GOT16_HA:
- case elfcpp::R_PPC64_TOC16:
- case elfcpp::R_PPC64_TOC16_LO:
- case elfcpp::R_PPC64_TOC16_HI:
- case elfcpp::R_PPC64_TOC16_HA:
- case elfcpp::R_PPC64_TOC16_DS:
- case elfcpp::R_PPC64_TOC16_LO_DS:
- {
- // The symbol requires a GOT entry.
- Output_data_got<size, big_endian>* got;
-
- got = target->got_section(symtab, layout);
- if (gsym->final_value_is_known())
- got->add_global(gsym, GOT_TYPE_STANDARD);
- else
- {
- // If this symbol is not fully resolved, we need to add a
- // dynamic relocation for it.
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- if (gsym->is_from_dynobj()
- || gsym->is_undefined()
- || gsym->is_preemptible())
- got->add_global_with_rela(gsym, GOT_TYPE_STANDARD, rela_dyn,
- elfcpp::R_POWERPC_GLOB_DAT);
- else if (!gsym->has_got_offset(GOT_TYPE_STANDARD))
- {
- unsigned int off = got->add_constant(0);
-
- gsym->set_got_offset(GOT_TYPE_STANDARD, off);
- rela_dyn->add_global_relative(gsym, elfcpp::R_POWERPC_RELATIVE,
- got, off, 0);
- }
- }
- }
- break;
-
- case elfcpp::R_PPC64_TOC:
- // We need a GOT section.
- target->got_section(symtab, layout);
- break;
-
- case elfcpp::R_POWERPC_GOT_TPREL16:
- case elfcpp::R_POWERPC_TLS:
- // XXX TLS
- break;
-
- // These are relocations which should only be seen by the
- // dynamic linker, and should never be seen here.
- case elfcpp::R_POWERPC_COPY:
- case elfcpp::R_POWERPC_GLOB_DAT:
- case elfcpp::R_POWERPC_JMP_SLOT:
- case elfcpp::R_POWERPC_RELATIVE:
- case elfcpp::R_POWERPC_DTPMOD:
- gold_error(_("%s: unexpected reloc %u in object file"),
- object->name().c_str(), r_type);
- break;
-
- default:
- unsupported_reloc_global(object, r_type, gsym);
- break;
- }
-}
-
-// Scan relocations for a section.
-
-template<int size, bool big_endian>
-void
-Target_powerpc<size, big_endian>::scan_relocs(
- const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols)
-{
- typedef Target_powerpc<size, big_endian> Powerpc;
- typedef typename Target_powerpc<size, big_endian>::Scan Scan;
- static Output_data_space* sdata;
-
- if (sh_type == elfcpp::SHT_REL)
- {
- gold_error(_("%s: unsupported REL reloc section"),
- object->name().c_str());
- return;
- }
-
- // Define _SDA_BASE_ at the start of the .sdata section.
- if (sdata == NULL)
- {
- // layout->find_output_section(".sdata") == NULL
- sdata = new Output_data_space(4, "** sdata");
- Output_section* os = layout->add_output_section_data(".sdata", 0,
- elfcpp::SHF_ALLOC
- | elfcpp::SHF_WRITE,
- sdata);
- symtab->define_in_output_data("_SDA_BASE_", NULL,
- os,
- 32768, 0,
- elfcpp::STT_OBJECT,
- elfcpp::STB_LOCAL,
- elfcpp::STV_HIDDEN, 0,
- false, false);
- }
-
- gold::scan_relocs<size, big_endian, Powerpc, elfcpp::SHT_RELA, Scan>(
- options,
- symtab,
- layout,
- this,
- object,
- data_shndx,
- prelocs,
- reloc_count,
- output_section,
- needs_special_offset_handling,
- local_symbol_count,
- plocal_symbols);
-}
-
-// Finalize the sections.
-
-template<int size, bool big_endian>
-void
-Target_powerpc<size, big_endian>::do_finalize_sections(Layout* layout)
-{
- // Fill in some more dynamic tags.
- Output_data_dynamic* const odyn = layout->dynamic_data();
- if (odyn != NULL)
- {
- if (this->plt_ != NULL)
- {
- const Output_data* od = this->plt_->rel_plt();
- odyn->add_section_size(elfcpp::DT_PLTRELSZ, od);
- odyn->add_section_address(elfcpp::DT_JMPREL, od);
- odyn->add_constant(elfcpp::DT_PLTREL, elfcpp::DT_RELA);
-
- odyn->add_section_address(elfcpp::DT_PLTGOT, this->plt_);
- }
-
- if (this->rela_dyn_ != NULL)
- {
- const Output_data* od = this->rela_dyn_;
- odyn->add_section_address(elfcpp::DT_RELA, od);
- odyn->add_section_size(elfcpp::DT_RELASZ, od);
- odyn->add_constant(elfcpp::DT_RELAENT,
- elfcpp::Elf_sizes<size>::rela_size);
- }
-
- if (!parameters->options().shared())
- {
- // The value of the DT_DEBUG tag is filled in by the dynamic
- // linker at run time, and used by the debugger.
- odyn->add_constant(elfcpp::DT_DEBUG, 0);
- }
- }
-
- // Emit any relocs we saved in an attempt to avoid generating COPY
- // relocs.
- if (this->copy_relocs_.any_saved_relocs())
- this->copy_relocs_.emit(this->rela_dyn_section(layout));
-}
-
-// Perform a relocation.
-
-template<int size, bool big_endian>
-inline bool
-Target_powerpc<size, big_endian>::Relocate::relocate(
- const Relocate_info<size, big_endian>* relinfo,
- Target_powerpc* target,
- size_t relnum,
- const elfcpp::Rela<size, big_endian>& rela,
- unsigned int r_type,
- const Sized_symbol<size>* gsym,
- const Symbol_value<size>* psymval,
- unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr address,
- section_size_type /* view_size */)
-{
- const unsigned int toc_base_offset = 0x8000;
- typedef Powerpc_relocate_functions<size, big_endian> Reloc;
-
- // Pick the value to use for symbols defined in shared objects.
- Symbol_value<size> symval;
- if (gsym != NULL
- && gsym->use_plt_offset(r_type == elfcpp::R_POWERPC_REL24
- || r_type == elfcpp::R_PPC_LOCAL24PC
- || r_type == elfcpp::R_PPC_REL16
- || r_type == elfcpp::R_PPC_REL16_LO
- || r_type == elfcpp::R_PPC_REL16_HI
- || r_type == elfcpp::R_PPC_REL16_HA))
- {
- elfcpp::Elf_Xword value;
-
- value = target->plt_section()->address() + gsym->plt_offset();
-
- symval.set_output_value(value);
-
- psymval = &symval;
- }
-
- const Sized_relobj<size, big_endian>* object = relinfo->object;
- elfcpp::Elf_Xword addend = rela.get_r_addend();
-
- // Get the GOT offset if needed. Unlike i386 and x86_64, our GOT
- // pointer points to the beginning, not the end, of the table.
- // So we just use the plain offset.
- bool have_got_offset = false;
- unsigned int got_offset = 0;
- unsigned int got2_offset = 0;
- switch (r_type)
- {
- case elfcpp::R_PPC64_TOC16:
- case elfcpp::R_PPC64_TOC16_LO:
- case elfcpp::R_PPC64_TOC16_HI:
- case elfcpp::R_PPC64_TOC16_HA:
- case elfcpp::R_PPC64_TOC16_DS:
- case elfcpp::R_PPC64_TOC16_LO_DS:
- // Subtract the TOC base address.
- addend -= target->toc_section()->address() + toc_base_offset;
- /* FALLTHRU */
-
- case elfcpp::R_POWERPC_GOT16:
- case elfcpp::R_POWERPC_GOT16_LO:
- case elfcpp::R_POWERPC_GOT16_HI:
- case elfcpp::R_POWERPC_GOT16_HA:
- case elfcpp::R_PPC64_GOT16_DS:
- case elfcpp::R_PPC64_GOT16_LO_DS:
- if (gsym != NULL)
- {
- gold_assert(gsym->has_got_offset(GOT_TYPE_STANDARD));
- got_offset = gsym->got_offset(GOT_TYPE_STANDARD);
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info());
- gold_assert(object->local_has_got_offset(r_sym, GOT_TYPE_STANDARD));
- got_offset = object->local_got_offset(r_sym, GOT_TYPE_STANDARD);
- }
- have_got_offset = true;
- break;
-
- // R_PPC_PLTREL24 is rather special. If non-zero,
- // the addend specifies the GOT pointer offset within .got2.
- case elfcpp::R_PPC_PLTREL24:
- if (addend >= 32768)
- {
- Output_data_space* got2;
- got2 = target->got2_section();
- got2_offset = got2->offset();
- addend += got2_offset;
- }
- have_got_offset = true;
- break;
-
- default:
- break;
- }
-
- switch (r_type)
- {
- case elfcpp::R_POWERPC_NONE:
- case elfcpp::R_POWERPC_GNU_VTINHERIT:
- case elfcpp::R_POWERPC_GNU_VTENTRY:
- break;
-
- case elfcpp::R_POWERPC_REL32:
- Reloc::rel32(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_POWERPC_REL24:
- Reloc::rel24(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_POWERPC_REL14:
- Reloc::rel14(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_PPC_PLTREL24:
- Reloc::rel24(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_PPC_LOCAL24PC:
- Reloc::rel24(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_PPC64_ADDR64:
- if (!parameters->options().output_is_position_independent())
- Relocate_functions<size, big_endian>::rela64(view, object,
- psymval, addend);
- break;
-
- case elfcpp::R_POWERPC_ADDR32:
- if (!parameters->options().output_is_position_independent())
- Relocate_functions<size, big_endian>::rela32(view, object,
- psymval, addend);
- break;
-
- case elfcpp::R_POWERPC_ADDR16_LO:
- Reloc::addr16_lo(view, object, psymval, addend);
- break;
-
- case elfcpp::R_POWERPC_ADDR16_HI:
- Reloc::addr16_hi(view, object, psymval, addend);
- break;
-
- case elfcpp::R_POWERPC_ADDR16_HA:
- Reloc::addr16_ha(view, object, psymval, addend);
- break;
-
- case elfcpp::R_PPC_REL16_LO:
- Reloc::rel16_lo(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_PPC_REL16_HI:
- Reloc::rel16_lo(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_PPC_REL16_HA:
- Reloc::rel16_lo(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_POWERPC_GOT16:
- Reloc::addr16(view, got_offset, addend);
- break;
-
- case elfcpp::R_POWERPC_GOT16_LO:
- Reloc::addr16_lo(view, got_offset, addend);
- break;
-
- case elfcpp::R_POWERPC_GOT16_HI:
- Reloc::addr16_hi(view, got_offset, addend);
- break;
-
- case elfcpp::R_POWERPC_GOT16_HA:
- Reloc::addr16_ha(view, got_offset, addend);
- break;
-
- case elfcpp::R_PPC64_TOC16:
- Reloc::addr16(view, got_offset, addend);
- break;
-
- case elfcpp::R_PPC64_TOC16_LO:
- Reloc::addr16_lo(view, got_offset, addend);
- break;
-
- case elfcpp::R_PPC64_TOC16_HI:
- Reloc::addr16_hi(view, got_offset, addend);
- break;
-
- case elfcpp::R_PPC64_TOC16_HA:
- Reloc::addr16_ha(view, got_offset, addend);
- break;
-
- case elfcpp::R_PPC64_TOC16_DS:
- case elfcpp::R_PPC64_TOC16_LO_DS:
- Reloc::addr16_ds(view, got_offset, addend);
- break;
-
- case elfcpp::R_PPC64_TOC:
- {
- elfcpp::Elf_types<64>::Elf_Addr value;
- value = target->toc_section()->address() + toc_base_offset;
- Relocate_functions<64, false>::rela64(view, value, addend);
- }
- break;
-
- case elfcpp::R_POWERPC_COPY:
- case elfcpp::R_POWERPC_GLOB_DAT:
- case elfcpp::R_POWERPC_JMP_SLOT:
- case elfcpp::R_POWERPC_RELATIVE:
- // This is an outstanding tls reloc, which is unexpected when
- // linking.
- case elfcpp::R_POWERPC_DTPMOD:
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unexpected reloc %u in object file"),
- r_type);
- break;
-
- default:
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unsupported reloc %u"),
- r_type);
- break;
- }
-
- return true;
-}
-
-// Perform a TLS relocation.
-
-template<int size, bool big_endian>
-inline void
-Target_powerpc<size, big_endian>::Relocate::relocate_tls(
- const Relocate_info<size, big_endian>* relinfo,
- Target_powerpc<size, big_endian>* target,
- size_t relnum,
- const elfcpp::Rela<size, big_endian>& rela,
- unsigned int r_type,
- const Sized_symbol<size>* gsym,
- const Symbol_value<size>* psymval,
- unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr address,
- section_size_type)
-{
- Output_segment* tls_segment = relinfo->layout->tls_segment();
- typedef Powerpc_relocate_functions<size, big_endian> Reloc;
- const Sized_relobj<size, big_endian>* object = relinfo->object;
-
- const elfcpp::Elf_Xword addend = rela.get_r_addend();
- typename elfcpp::Elf_types<size>::Elf_Addr value = psymval->value(object, 0);
-
- const bool is_final =
- (gsym == NULL
- ? !parameters->options().output_is_position_independent()
- : gsym->final_value_is_known());
- const tls::Tls_optimization optimized_type
- = optimize_tls_reloc(is_final, r_type);
-
- switch (r_type)
- {
- // XXX
- }
-}
-
-// Relocate section data.
-
-template<int size, bool big_endian>
-void
-Target_powerpc<size, big_endian>::relocate_section(
- const Relocate_info<size, big_endian>* relinfo,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr address,
- section_size_type view_size)
-{
- typedef Target_powerpc<size, big_endian> Powerpc;
- typedef typename Target_powerpc<size, big_endian>::Relocate Powerpc_relocate;
-
- gold_assert(sh_type == elfcpp::SHT_RELA);
-
- gold::relocate_section<size, big_endian, Powerpc, elfcpp::SHT_RELA,
- Powerpc_relocate>(
- relinfo,
- this,
- prelocs,
- reloc_count,
- output_section,
- needs_special_offset_handling,
- view,
- address,
- view_size);
-}
-
-// Return the size of a relocation while scanning during a relocatable
-// link.
-
-template<int size, bool big_endian>
-unsigned int
-Target_powerpc<size, big_endian>::Relocatable_size_for_reloc::get_size_for_reloc(
- unsigned int,
- Relobj*)
-{
- // We are always SHT_RELA, so we should never get here.
- gold_unreachable();
- return 0;
-}
-
-// Scan the relocs during a relocatable link.
-
-template<int size, bool big_endian>
-void
-Target_powerpc<size, big_endian>::scan_relocatable_relocs(
- const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols,
- Relocatable_relocs* rr)
-{
- gold_assert(sh_type == elfcpp::SHT_RELA);
-
- typedef gold::Default_scan_relocatable_relocs<elfcpp::SHT_RELA,
- Relocatable_size_for_reloc> Scan_relocatable_relocs;
-
- gold::scan_relocatable_relocs<size, big_endian, elfcpp::SHT_RELA,
- Scan_relocatable_relocs>(
- options,
- symtab,
- layout,
- object,
- data_shndx,
- prelocs,
- reloc_count,
- output_section,
- needs_special_offset_handling,
- local_symbol_count,
- plocal_symbols,
- rr);
-}
-
-// Relocate a section during a relocatable link.
-
-template<int size, bool big_endian>
-void
-Target_powerpc<size, big_endian>::relocate_for_relocatable(
- const Relocate_info<size, big_endian>* relinfo,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- off_t offset_in_output_section,
- const Relocatable_relocs* rr,
- unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr view_address,
- section_size_type view_size,
- unsigned char* reloc_view,
- section_size_type reloc_view_size)
-{
- gold_assert(sh_type == elfcpp::SHT_RELA);
-
- gold::relocate_for_relocatable<size, big_endian, elfcpp::SHT_RELA>(
- relinfo,
- prelocs,
- reloc_count,
- output_section,
- offset_in_output_section,
- rr,
- view,
- view_address,
- view_size,
- reloc_view,
- reloc_view_size);
-}
-
-// Return the value to use for a dynamic which requires special
-// treatment. This is how we support equality comparisons of function
-// pointers across shared library boundaries, as described in the
-// processor specific ABI supplement.
-
-template<int size, bool big_endian>
-uint64_t
-Target_powerpc<size, big_endian>::do_dynsym_value(const Symbol* gsym) const
-{
- gold_assert(gsym->is_from_dynobj() && gsym->has_plt_offset());
- return this->plt_section()->address() + gsym->plt_offset();
-}
-
-// The selector for powerpc object files.
-
-template<int size, bool big_endian>
-class Target_selector_powerpc : public Target_selector
-{
-public:
- Target_selector_powerpc()
- : Target_selector(elfcpp::EM_NONE, size, big_endian,
- (size == 64 ?
- (big_endian ? "elf64-powerpc" : "elf64-powerpcle") :
- (big_endian ? "elf32-powerpc" : "elf32-powerpcle")))
- { }
-
- Target* instantiated_target_;
-
- Target* do_recognize(int machine, int, int)
- {
- switch (size)
- {
- case 64:
- if (machine != elfcpp::EM_PPC64)
- return NULL;
- break;
-
- case 32:
- if (machine != elfcpp::EM_PPC)
- return NULL;
- break;
-
- default:
- return NULL;
- }
-
- return do_instantiate_target();
- }
-
- Target* do_instantiate_target()
- {
- if (this->instantiated_target_ == NULL)
- this->instantiated_target_ = new Target_powerpc<size, big_endian>();
- return this->instantiated_target_;
- }
-};
-
-Target_selector_powerpc<32, true> target_selector_ppc32;
-Target_selector_powerpc<32, false> target_selector_ppc32le;
-Target_selector_powerpc<64, true> target_selector_ppc64;
-Target_selector_powerpc<64, false> target_selector_ppc64le;
-
-} // End anonymous namespace.
diff --git a/gold/script.cc b/gold/script.cc
deleted file mode 100644
index f6e4a396f2c..00000000000
--- a/gold/script.cc
+++ /dev/null
@@ -1,2517 +0,0 @@
-// script.cc -- handle linker scripts for gold.
-
-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
-// Written by Ian Lance Taylor <iant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-#include "gold.h"
-
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <fnmatch.h>
-#include <string>
-#include <vector>
-#include "filenames.h"
-
-#include "elfcpp.h"
-#include "demangle.h"
-#include "dirsearch.h"
-#include "options.h"
-#include "fileread.h"
-#include "workqueue.h"
-#include "readsyms.h"
-#include "parameters.h"
-#include "layout.h"
-#include "symtab.h"
-#include "script.h"
-#include "script-c.h"
-
-namespace gold
-{
-
-// A token read from a script file. We don't implement keywords here;
-// all keywords are simply represented as a string.
-
-class Token
-{
- public:
- // Token classification.
- enum Classification
- {
- // Token is invalid.
- TOKEN_INVALID,
- // Token indicates end of input.
- TOKEN_EOF,
- // Token is a string of characters.
- TOKEN_STRING,
- // Token is a quoted string of characters.
- TOKEN_QUOTED_STRING,
- // Token is an operator.
- TOKEN_OPERATOR,
- // Token is a number (an integer).
- TOKEN_INTEGER
- };
-
- // We need an empty constructor so that we can put this STL objects.
- Token()
- : classification_(TOKEN_INVALID), value_(NULL), value_length_(0),
- opcode_(0), lineno_(0), charpos_(0)
- { }
-
- // A general token with no value.
- Token(Classification classification, int lineno, int charpos)
- : classification_(classification), value_(NULL), value_length_(0),
- opcode_(0), lineno_(lineno), charpos_(charpos)
- {
- gold_assert(classification == TOKEN_INVALID
- || classification == TOKEN_EOF);
- }
-
- // A general token with a value.
- Token(Classification classification, const char* value, size_t length,
- int lineno, int charpos)
- : classification_(classification), value_(value), value_length_(length),
- opcode_(0), lineno_(lineno), charpos_(charpos)
- {
- gold_assert(classification != TOKEN_INVALID
- && classification != TOKEN_EOF);
- }
-
- // A token representing an operator.
- Token(int opcode, int lineno, int charpos)
- : classification_(TOKEN_OPERATOR), value_(NULL), value_length_(0),
- opcode_(opcode), lineno_(lineno), charpos_(charpos)
- { }
-
- // Return whether the token is invalid.
- bool
- is_invalid() const
- { return this->classification_ == TOKEN_INVALID; }
-
- // Return whether this is an EOF token.
- bool
- is_eof() const
- { return this->classification_ == TOKEN_EOF; }
-
- // Return the token classification.
- Classification
- classification() const
- { return this->classification_; }
-
- // Return the line number at which the token starts.
- int
- lineno() const
- { return this->lineno_; }
-
- // Return the character position at this the token starts.
- int
- charpos() const
- { return this->charpos_; }
-
- // Get the value of a token.
-
- const char*
- string_value(size_t* length) const
- {
- gold_assert(this->classification_ == TOKEN_STRING
- || this->classification_ == TOKEN_QUOTED_STRING);
- *length = this->value_length_;
- return this->value_;
- }
-
- int
- operator_value() const
- {
- gold_assert(this->classification_ == TOKEN_OPERATOR);
- return this->opcode_;
- }
-
- uint64_t
- integer_value() const
- {
- gold_assert(this->classification_ == TOKEN_INTEGER);
- // Null terminate.
- std::string s(this->value_, this->value_length_);
- return strtoull(s.c_str(), NULL, 0);
- }
-
- private:
- // The token classification.
- Classification classification_;
- // The token value, for TOKEN_STRING or TOKEN_QUOTED_STRING or
- // TOKEN_INTEGER.
- const char* value_;
- // The length of the token value.
- size_t value_length_;
- // The token value, for TOKEN_OPERATOR.
- int opcode_;
- // The line number where this token started (one based).
- int lineno_;
- // The character position within the line where this token started
- // (one based).
- int charpos_;
-};
-
-// This class handles lexing a file into a sequence of tokens.
-
-class Lex
-{
- public:
- // We unfortunately have to support different lexing modes, because
- // when reading different parts of a linker script we need to parse
- // things differently.
- enum Mode
- {
- // Reading an ordinary linker script.
- LINKER_SCRIPT,
- // Reading an expression in a linker script.
- EXPRESSION,
- // Reading a version script.
- VERSION_SCRIPT
- };
-
- Lex(const char* input_string, size_t input_length, int parsing_token)
- : input_string_(input_string), input_length_(input_length),
- current_(input_string), mode_(LINKER_SCRIPT),
- first_token_(parsing_token), token_(),
- lineno_(1), linestart_(input_string)
- { }
-
- // Read a file into a string.
- static void
- read_file(Input_file*, std::string*);
-
- // Return the next token.
- const Token*
- next_token();
-
- // Return the current lexing mode.
- Lex::Mode
- mode() const
- { return this->mode_; }
-
- // Set the lexing mode.
- void
- set_mode(Mode mode)
- { this->mode_ = mode; }
-
- private:
- Lex(const Lex&);
- Lex& operator=(const Lex&);
-
- // Make a general token with no value at the current location.
- Token
- make_token(Token::Classification c, const char* start) const
- { return Token(c, this->lineno_, start - this->linestart_ + 1); }
-
- // Make a general token with a value at the current location.
- Token
- make_token(Token::Classification c, const char* v, size_t len,
- const char* start)
- const
- { return Token(c, v, len, this->lineno_, start - this->linestart_ + 1); }
-
- // Make an operator token at the current location.
- Token
- make_token(int opcode, const char* start) const
- { return Token(opcode, this->lineno_, start - this->linestart_ + 1); }
-
- // Make an invalid token at the current location.
- Token
- make_invalid_token(const char* start)
- { return this->make_token(Token::TOKEN_INVALID, start); }
-
- // Make an EOF token at the current location.
- Token
- make_eof_token(const char* start)
- { return this->make_token(Token::TOKEN_EOF, start); }
-
- // Return whether C can be the first character in a name. C2 is the
- // next character, since we sometimes need that.
- inline bool
- can_start_name(char c, char c2);
-
- // If C can appear in a name which has already started, return a
- // pointer to a character later in the token or just past
- // it. Otherwise, return NULL.
- inline const char*
- can_continue_name(const char* c);
-
- // Return whether C, C2, C3 can start a hex number.
- inline bool
- can_start_hex(char c, char c2, char c3);
-
- // If C can appear in a hex number which has already started, return
- // a pointer to a character later in the token or just past
- // it. Otherwise, return NULL.
- inline const char*
- can_continue_hex(const char* c);
-
- // Return whether C can start a non-hex number.
- static inline bool
- can_start_number(char c);
-
- // If C can appear in a decimal number which has already started,
- // return a pointer to a character later in the token or just past
- // it. Otherwise, return NULL.
- inline const char*
- can_continue_number(const char* c)
- { return Lex::can_start_number(*c) ? c + 1 : NULL; }
-
- // If C1 C2 C3 form a valid three character operator, return the
- // opcode. Otherwise return 0.
- static inline int
- three_char_operator(char c1, char c2, char c3);
-
- // If C1 C2 form a valid two character operator, return the opcode.
- // Otherwise return 0.
- static inline int
- two_char_operator(char c1, char c2);
-
- // If C1 is a valid one character operator, return the opcode.
- // Otherwise return 0.
- static inline int
- one_char_operator(char c1);
-
- // Read the next token.
- Token
- get_token(const char**);
-
- // Skip a C style /* */ comment. Return false if the comment did
- // not end.
- bool
- skip_c_comment(const char**);
-
- // Skip a line # comment. Return false if there was no newline.
- bool
- skip_line_comment(const char**);
-
- // Build a token CLASSIFICATION from all characters that match
- // CAN_CONTINUE_FN. The token starts at START. Start matching from
- // MATCH. Set *PP to the character following the token.
- inline Token
- gather_token(Token::Classification,
- const char* (Lex::*can_continue_fn)(const char*),
- const char* start, const char* match, const char** pp);
-
- // Build a token from a quoted string.
- Token
- gather_quoted_string(const char** pp);
-
- // The string we are tokenizing.
- const char* input_string_;
- // The length of the string.
- size_t input_length_;
- // The current offset into the string.
- const char* current_;
- // The current lexing mode.
- Mode mode_;
- // The code to use for the first token. This is set to 0 after it
- // is used.
- int first_token_;
- // The current token.
- Token token_;
- // The current line number.
- int lineno_;
- // The start of the current line in the string.
- const char* linestart_;
-};
-
-// Read the whole file into memory. We don't expect linker scripts to
-// be large, so we just use a std::string as a buffer. We ignore the
-// data we've already read, so that we read aligned buffers.
-
-void
-Lex::read_file(Input_file* input_file, std::string* contents)
-{
- off_t filesize = input_file->file().filesize();
- contents->clear();
- contents->reserve(filesize);
-
- off_t off = 0;
- unsigned char buf[BUFSIZ];
- while (off < filesize)
- {
- off_t get = BUFSIZ;
- if (get > filesize - off)
- get = filesize - off;
- input_file->file().read(off, get, buf);
- contents->append(reinterpret_cast<char*>(&buf[0]), get);
- off += get;
- }
-}
-
-// Return whether C can be the start of a name, if the next character
-// is C2. A name can being with a letter, underscore, period, or
-// dollar sign. Because a name can be a file name, we also permit
-// forward slash, backslash, and tilde. Tilde is the tricky case
-// here; GNU ld also uses it as a bitwise not operator. It is only
-// recognized as the operator if it is not immediately followed by
-// some character which can appear in a symbol. That is, when we
-// don't know that we are looking at an expression, "~0" is a file
-// name, and "~ 0" is an expression using bitwise not. We are
-// compatible.
-
-inline bool
-Lex::can_start_name(char c, char c2)
-{
- switch (c)
- {
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'Q': case 'P': case 'R':
- case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'q': case 'p': case 'r':
- case 's': case 't': case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- case '_': case '.': case '$':
- return true;
-
- case '/': case '\\':
- return this->mode_ == LINKER_SCRIPT;
-
- case '~':
- return this->mode_ == LINKER_SCRIPT && can_continue_name(&c2);
-
- case '*': case '[':
- return (this->mode_ == VERSION_SCRIPT
- || (this->mode_ == LINKER_SCRIPT
- && can_continue_name(&c2)));
-
- default:
- return false;
- }
-}
-
-// Return whether C can continue a name which has already started.
-// Subsequent characters in a name are the same as the leading
-// characters, plus digits and "=+-:[],?*". So in general the linker
-// script language requires spaces around operators, unless we know
-// that we are parsing an expression.
-
-inline const char*
-Lex::can_continue_name(const char* c)
-{
- switch (*c)
- {
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'Q': case 'P': case 'R':
- case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'q': case 'p': case 'r':
- case 's': case 't': case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- case '_': case '.': case '$':
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- return c + 1;
-
- case '/': case '\\': case '~':
- case '=': case '+':
- case ',':
- if (this->mode_ == LINKER_SCRIPT)
- return c + 1;
- return NULL;
-
- case '[': case ']': case '*': case '?': case '-':
- if (this->mode_ == LINKER_SCRIPT || this->mode_ == VERSION_SCRIPT)
- return c + 1;
- return NULL;
-
- case '^':
- if (this->mode_ == VERSION_SCRIPT)
- return c + 1;
- return NULL;
-
- case ':':
- if (this->mode_ == LINKER_SCRIPT)
- return c + 1;
- else if (this->mode_ == VERSION_SCRIPT && (c[1] == ':'))
- {
- // A name can have '::' in it, as that's a c++ namespace
- // separator. But a single colon is not part of a name.
- return c + 2;
- }
- return NULL;
-
- default:
- return NULL;
- }
-}
-
-// For a number we accept 0x followed by hex digits, or any sequence
-// of digits. The old linker accepts leading '$' for hex, and
-// trailing HXBOD. Those are for MRI compatibility and we don't
-// accept them. The old linker also accepts trailing MK for mega or
-// kilo. FIXME: Those are mentioned in the documentation, and we
-// should accept them.
-
-// Return whether C1 C2 C3 can start a hex number.
-
-inline bool
-Lex::can_start_hex(char c1, char c2, char c3)
-{
- if (c1 == '0' && (c2 == 'x' || c2 == 'X'))
- return this->can_continue_hex(&c3);
- return false;
-}
-
-// Return whether C can appear in a hex number.
-
-inline const char*
-Lex::can_continue_hex(const char* c)
-{
- switch (*c)
- {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- return c + 1;
-
- default:
- return NULL;
- }
-}
-
-// Return whether C can start a non-hex number.
-
-inline bool
-Lex::can_start_number(char c)
-{
- switch (c)
- {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- return true;
-
- default:
- return false;
- }
-}
-
-// If C1 C2 C3 form a valid three character operator, return the
-// opcode (defined in the yyscript.h file generated from yyscript.y).
-// Otherwise return 0.
-
-inline int
-Lex::three_char_operator(char c1, char c2, char c3)
-{
- switch (c1)
- {
- case '<':
- if (c2 == '<' && c3 == '=')
- return LSHIFTEQ;
- break;
- case '>':
- if (c2 == '>' && c3 == '=')
- return RSHIFTEQ;
- break;
- default:
- break;
- }
- return 0;
-}
-
-// If C1 C2 form a valid two character operator, return the opcode
-// (defined in the yyscript.h file generated from yyscript.y).
-// Otherwise return 0.
-
-inline int
-Lex::two_char_operator(char c1, char c2)
-{
- switch (c1)
- {
- case '=':
- if (c2 == '=')
- return EQ;
- break;
- case '!':
- if (c2 == '=')
- return NE;
- break;
- case '+':
- if (c2 == '=')
- return PLUSEQ;
- break;
- case '-':
- if (c2 == '=')
- return MINUSEQ;
- break;
- case '*':
- if (c2 == '=')
- return MULTEQ;
- break;
- case '/':
- if (c2 == '=')
- return DIVEQ;
- break;
- case '|':
- if (c2 == '=')
- return OREQ;
- if (c2 == '|')
- return OROR;
- break;
- case '&':
- if (c2 == '=')
- return ANDEQ;
- if (c2 == '&')
- return ANDAND;
- break;
- case '>':
- if (c2 == '=')
- return GE;
- if (c2 == '>')
- return RSHIFT;
- break;
- case '<':
- if (c2 == '=')
- return LE;
- if (c2 == '<')
- return LSHIFT;
- break;
- default:
- break;
- }
- return 0;
-}
-
-// If C1 is a valid operator, return the opcode. Otherwise return 0.
-
-inline int
-Lex::one_char_operator(char c1)
-{
- switch (c1)
- {
- case '+':
- case '-':
- case '*':
- case '/':
- case '%':
- case '!':
- case '&':
- case '|':
- case '^':
- case '~':
- case '<':
- case '>':
- case '=':
- case '?':
- case ',':
- case '(':
- case ')':
- case '{':
- case '}':
- case '[':
- case ']':
- case ':':
- case ';':
- return c1;
- default:
- return 0;
- }
-}
-
-// Skip a C style comment. *PP points to just after the "/*". Return
-// false if the comment did not end.
-
-bool
-Lex::skip_c_comment(const char** pp)
-{
- const char* p = *pp;
- while (p[0] != '*' || p[1] != '/')
- {
- if (*p == '\0')
- {
- *pp = p;
- return false;
- }
-
- if (*p == '\n')
- {
- ++this->lineno_;
- this->linestart_ = p + 1;
- }
- ++p;
- }
-
- *pp = p + 2;
- return true;
-}
-
-// Skip a line # comment. Return false if there was no newline.
-
-bool
-Lex::skip_line_comment(const char** pp)
-{
- const char* p = *pp;
- size_t skip = strcspn(p, "\n");
- if (p[skip] == '\0')
- {
- *pp = p + skip;
- return false;
- }
-
- p += skip + 1;
- ++this->lineno_;
- this->linestart_ = p;
- *pp = p;
-
- return true;
-}
-
-// Build a token CLASSIFICATION from all characters that match
-// CAN_CONTINUE_FN. Update *PP.
-
-inline Token
-Lex::gather_token(Token::Classification classification,
- const char* (Lex::*can_continue_fn)(const char*),
- const char* start,
- const char* match,
- const char **pp)
-{
- const char* new_match = NULL;
- while ((new_match = (this->*can_continue_fn)(match)))
- match = new_match;
- *pp = match;
- return this->make_token(classification, start, match - start, start);
-}
-
-// Build a token from a quoted string.
-
-Token
-Lex::gather_quoted_string(const char** pp)
-{
- const char* start = *pp;
- const char* p = start;
- ++p;
- size_t skip = strcspn(p, "\"\n");
- if (p[skip] != '"')
- return this->make_invalid_token(start);
- *pp = p + skip + 1;
- return this->make_token(Token::TOKEN_QUOTED_STRING, p, skip, start);
-}
-
-// Return the next token at *PP. Update *PP. General guideline: we
-// require linker scripts to be simple ASCII. No unicode linker
-// scripts. In particular we can assume that any '\0' is the end of
-// the input.
-
-Token
-Lex::get_token(const char** pp)
-{
- const char* p = *pp;
-
- while (true)
- {
- if (*p == '\0')
- {
- *pp = p;
- return this->make_eof_token(p);
- }
-
- // Skip whitespace quickly.
- while (*p == ' ' || *p == '\t')
- ++p;
-
- if (*p == '\n')
- {
- ++p;
- ++this->lineno_;
- this->linestart_ = p;
- continue;
- }
-
- // Skip C style comments.
- if (p[0] == '/' && p[1] == '*')
- {
- int lineno = this->lineno_;
- int charpos = p - this->linestart_ + 1;
-
- *pp = p + 2;
- if (!this->skip_c_comment(pp))
- return Token(Token::TOKEN_INVALID, lineno, charpos);
- p = *pp;
-
- continue;
- }
-
- // Skip line comments.
- if (*p == '#')
- {
- *pp = p + 1;
- if (!this->skip_line_comment(pp))
- return this->make_eof_token(p);
- p = *pp;
- continue;
- }
-
- // Check for a name.
- if (this->can_start_name(p[0], p[1]))
- return this->gather_token(Token::TOKEN_STRING,
- &Lex::can_continue_name,
- p, p + 1, pp);
-
- // We accept any arbitrary name in double quotes, as long as it
- // does not cross a line boundary.
- if (*p == '"')
- {
- *pp = p;
- return this->gather_quoted_string(pp);
- }
-
- // Check for a number.
-
- if (this->can_start_hex(p[0], p[1], p[2]))
- return this->gather_token(Token::TOKEN_INTEGER,
- &Lex::can_continue_hex,
- p, p + 3, pp);
-
- if (Lex::can_start_number(p[0]))
- return this->gather_token(Token::TOKEN_INTEGER,
- &Lex::can_continue_number,
- p, p + 1, pp);
-
- // Check for operators.
-
- int opcode = Lex::three_char_operator(p[0], p[1], p[2]);
- if (opcode != 0)
- {
- *pp = p + 3;
- return this->make_token(opcode, p);
- }
-
- opcode = Lex::two_char_operator(p[0], p[1]);
- if (opcode != 0)
- {
- *pp = p + 2;
- return this->make_token(opcode, p);
- }
-
- opcode = Lex::one_char_operator(p[0]);
- if (opcode != 0)
- {
- *pp = p + 1;
- return this->make_token(opcode, p);
- }
-
- return this->make_token(Token::TOKEN_INVALID, p);
- }
-}
-
-// Return the next token.
-
-const Token*
-Lex::next_token()
-{
- // The first token is special.
- if (this->first_token_ != 0)
- {
- this->token_ = Token(this->first_token_, 0, 0);
- this->first_token_ = 0;
- return &this->token_;
- }
-
- this->token_ = this->get_token(&this->current_);
-
- // Don't let an early null byte fool us into thinking that we've
- // reached the end of the file.
- if (this->token_.is_eof()
- && (static_cast<size_t>(this->current_ - this->input_string_)
- < this->input_length_))
- this->token_ = this->make_invalid_token(this->current_);
-
- return &this->token_;
-}
-
-// class Symbol_assignment.
-
-// Add the symbol to the symbol table. This makes sure the symbol is
-// there and defined. The actual value is stored later. We can't
-// determine the actual value at this point, because we can't
-// necessarily evaluate the expression until all ordinary symbols have
-// been finalized.
-
-// The GNU linker lets symbol assignments in the linker script
-// silently override defined symbols in object files. We are
-// compatible. FIXME: Should we issue a warning?
-
-void
-Symbol_assignment::add_to_table(Symbol_table* symtab)
-{
- elfcpp::STV vis = this->hidden_ ? elfcpp::STV_HIDDEN : elfcpp::STV_DEFAULT;
- this->sym_ = symtab->define_as_constant(this->name_.c_str(),
- NULL, // version
- 0, // value
- 0, // size
- elfcpp::STT_NOTYPE,
- elfcpp::STB_GLOBAL,
- vis,
- 0, // nonvis
- this->provide_,
- true); // force_override
-}
-
-// Finalize a symbol value.
-
-void
-Symbol_assignment::finalize(Symbol_table* symtab, const Layout* layout)
-{
- this->finalize_maybe_dot(symtab, layout, false, 0, NULL);
-}
-
-// Finalize a symbol value which can refer to the dot symbol.
-
-void
-Symbol_assignment::finalize_with_dot(Symbol_table* symtab,
- const Layout* layout,
- uint64_t dot_value,
- Output_section* dot_section)
-{
- this->finalize_maybe_dot(symtab, layout, true, dot_value, dot_section);
-}
-
-// Finalize a symbol value, internal version.
-
-void
-Symbol_assignment::finalize_maybe_dot(Symbol_table* symtab,
- const Layout* layout,
- bool is_dot_available,
- uint64_t dot_value,
- Output_section* dot_section)
-{
- // If we were only supposed to provide this symbol, the sym_ field
- // will be NULL if the symbol was not referenced.
- if (this->sym_ == NULL)
- {
- gold_assert(this->provide_);
- return;
- }
-
- if (parameters->target().get_size() == 32)
- {
-#if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_32_BIG)
- this->sized_finalize<32>(symtab, layout, is_dot_available, dot_value,
- dot_section);
-#else
- gold_unreachable();
-#endif
- }
- else if (parameters->target().get_size() == 64)
- {
-#if defined(HAVE_TARGET_64_LITTLE) || defined(HAVE_TARGET_64_BIG)
- this->sized_finalize<64>(symtab, layout, is_dot_available, dot_value,
- dot_section);
-#else
- gold_unreachable();
-#endif
- }
- else
- gold_unreachable();
-}
-
-template<int size>
-void
-Symbol_assignment::sized_finalize(Symbol_table* symtab, const Layout* layout,
- bool is_dot_available, uint64_t dot_value,
- Output_section* dot_section)
-{
- Output_section* section;
- uint64_t final_val = this->val_->eval_maybe_dot(symtab, layout, true,
- is_dot_available,
- dot_value, dot_section,
- &section);
- Sized_symbol<size>* ssym = symtab->get_sized_symbol<size>(this->sym_);
- ssym->set_value(final_val);
- if (section != NULL)
- ssym->set_output_section(section);
-}
-
-// Set the symbol value if the expression yields an absolute value.
-
-void
-Symbol_assignment::set_if_absolute(Symbol_table* symtab, const Layout* layout,
- bool is_dot_available, uint64_t dot_value)
-{
- if (this->sym_ == NULL)
- return;
-
- Output_section* val_section;
- uint64_t val = this->val_->eval_maybe_dot(symtab, layout, false,
- is_dot_available, dot_value,
- NULL, &val_section);
- if (val_section != NULL)
- return;
-
- if (parameters->target().get_size() == 32)
- {
-#if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_32_BIG)
- Sized_symbol<32>* ssym = symtab->get_sized_symbol<32>(this->sym_);
- ssym->set_value(val);
-#else
- gold_unreachable();
-#endif
- }
- else if (parameters->target().get_size() == 64)
- {
-#if defined(HAVE_TARGET_64_LITTLE) || defined(HAVE_TARGET_64_BIG)
- Sized_symbol<64>* ssym = symtab->get_sized_symbol<64>(this->sym_);
- ssym->set_value(val);
-#else
- gold_unreachable();
-#endif
- }
- else
- gold_unreachable();
-}
-
-// Print for debugging.
-
-void
-Symbol_assignment::print(FILE* f) const
-{
- if (this->provide_ && this->hidden_)
- fprintf(f, "PROVIDE_HIDDEN(");
- else if (this->provide_)
- fprintf(f, "PROVIDE(");
- else if (this->hidden_)
- gold_unreachable();
-
- fprintf(f, "%s = ", this->name_.c_str());
- this->val_->print(f);
-
- if (this->provide_ || this->hidden_)
- fprintf(f, ")");
-
- fprintf(f, "\n");
-}
-
-// Class Script_assertion.
-
-// Check the assertion.
-
-void
-Script_assertion::check(const Symbol_table* symtab, const Layout* layout)
-{
- if (!this->check_->eval(symtab, layout, true))
- gold_error("%s", this->message_.c_str());
-}
-
-// Print for debugging.
-
-void
-Script_assertion::print(FILE* f) const
-{
- fprintf(f, "ASSERT(");
- this->check_->print(f);
- fprintf(f, ", \"%s\")\n", this->message_.c_str());
-}
-
-// Class Script_options.
-
-Script_options::Script_options()
- : entry_(), symbol_assignments_(), version_script_info_(),
- script_sections_()
-{
-}
-
-// Add a symbol to be defined.
-
-void
-Script_options::add_symbol_assignment(const char* name, size_t length,
- Expression* value, bool provide,
- bool hidden)
-{
- if (length != 1 || name[0] != '.')
- {
- if (this->script_sections_.in_sections_clause())
- this->script_sections_.add_symbol_assignment(name, length, value,
- provide, hidden);
- else
- {
- Symbol_assignment* p = new Symbol_assignment(name, length, value,
- provide, hidden);
- this->symbol_assignments_.push_back(p);
- }
- }
- else
- {
- if (provide || hidden)
- gold_error(_("invalid use of PROVIDE for dot symbol"));
- if (!this->script_sections_.in_sections_clause())
- gold_error(_("invalid assignment to dot outside of SECTIONS"));
- else
- this->script_sections_.add_dot_assignment(value);
- }
-}
-
-// Add an assertion.
-
-void
-Script_options::add_assertion(Expression* check, const char* message,
- size_t messagelen)
-{
- if (this->script_sections_.in_sections_clause())
- this->script_sections_.add_assertion(check, message, messagelen);
- else
- {
- Script_assertion* p = new Script_assertion(check, message, messagelen);
- this->assertions_.push_back(p);
- }
-}
-
-// Create sections required by any linker scripts.
-
-void
-Script_options::create_script_sections(Layout* layout)
-{
- if (this->saw_sections_clause())
- this->script_sections_.create_sections(layout);
-}
-
-// Add any symbols we are defining to the symbol table.
-
-void
-Script_options::add_symbols_to_table(Symbol_table* symtab)
-{
- for (Symbol_assignments::iterator p = this->symbol_assignments_.begin();
- p != this->symbol_assignments_.end();
- ++p)
- (*p)->add_to_table(symtab);
- this->script_sections_.add_symbols_to_table(symtab);
-}
-
-// Finalize symbol values. Also check assertions.
-
-void
-Script_options::finalize_symbols(Symbol_table* symtab, const Layout* layout)
-{
- // We finalize the symbols defined in SECTIONS first, because they
- // are the ones which may have changed. This way if symbol outside
- // SECTIONS are defined in terms of symbols inside SECTIONS, they
- // will get the right value.
- this->script_sections_.finalize_symbols(symtab, layout);
-
- for (Symbol_assignments::iterator p = this->symbol_assignments_.begin();
- p != this->symbol_assignments_.end();
- ++p)
- (*p)->finalize(symtab, layout);
-
- for (Assertions::iterator p = this->assertions_.begin();
- p != this->assertions_.end();
- ++p)
- (*p)->check(symtab, layout);
-}
-
-// Set section addresses. We set all the symbols which have absolute
-// values. Then we let the SECTIONS clause do its thing. This
-// returns the segment which holds the file header and segment
-// headers, if any.
-
-Output_segment*
-Script_options::set_section_addresses(Symbol_table* symtab, Layout* layout)
-{
- for (Symbol_assignments::iterator p = this->symbol_assignments_.begin();
- p != this->symbol_assignments_.end();
- ++p)
- (*p)->set_if_absolute(symtab, layout, false, 0);
-
- return this->script_sections_.set_section_addresses(symtab, layout);
-}
-
-// This class holds data passed through the parser to the lexer and to
-// the parser support functions. This avoids global variables. We
-// can't use global variables because we need not be called by a
-// singleton thread.
-
-class Parser_closure
-{
- public:
- Parser_closure(const char* filename,
- const Position_dependent_options& posdep_options,
- bool in_group, bool is_in_sysroot,
- Command_line* command_line,
- Script_options* script_options,
- Lex* lex)
- : filename_(filename), posdep_options_(posdep_options),
- in_group_(in_group), is_in_sysroot_(is_in_sysroot),
- command_line_(command_line), script_options_(script_options),
- version_script_info_(script_options->version_script_info()),
- lex_(lex), lineno_(0), charpos_(0), lex_mode_stack_(), inputs_(NULL)
- {
- // We start out processing C symbols in the default lex mode.
- language_stack_.push_back("");
- lex_mode_stack_.push_back(lex->mode());
- }
-
- // Return the file name.
- const char*
- filename() const
- { return this->filename_; }
-
- // Return the position dependent options. The caller may modify
- // this.
- Position_dependent_options&
- position_dependent_options()
- { return this->posdep_options_; }
-
- // Return whether this script is being run in a group.
- bool
- in_group() const
- { return this->in_group_; }
-
- // Return whether this script was found using a directory in the
- // sysroot.
- bool
- is_in_sysroot() const
- { return this->is_in_sysroot_; }
-
- // Returns the Command_line structure passed in at constructor time.
- // This value may be NULL. The caller may modify this, which modifies
- // the passed-in Command_line object (not a copy).
- Command_line*
- command_line()
- { return this->command_line_; }
-
- // Return the options which may be set by a script.
- Script_options*
- script_options()
- { return this->script_options_; }
-
- // Return the object in which version script information should be stored.
- Version_script_info*
- version_script()
- { return this->version_script_info_; }
-
- // Return the next token, and advance.
- const Token*
- next_token()
- {
- const Token* token = this->lex_->next_token();
- this->lineno_ = token->lineno();
- this->charpos_ = token->charpos();
- return token;
- }
-
- // Set a new lexer mode, pushing the current one.
- void
- push_lex_mode(Lex::Mode mode)
- {
- this->lex_mode_stack_.push_back(this->lex_->mode());
- this->lex_->set_mode(mode);
- }
-
- // Pop the lexer mode.
- void
- pop_lex_mode()
- {
- gold_assert(!this->lex_mode_stack_.empty());
- this->lex_->set_mode(this->lex_mode_stack_.back());
- this->lex_mode_stack_.pop_back();
- }
-
- // Return the current lexer mode.
- Lex::Mode
- lex_mode() const
- { return this->lex_mode_stack_.back(); }
-
- // Return the line number of the last token.
- int
- lineno() const
- { return this->lineno_; }
-
- // Return the character position in the line of the last token.
- int
- charpos() const
- { return this->charpos_; }
-
- // Return the list of input files, creating it if necessary. This
- // is a space leak--we never free the INPUTS_ pointer.
- Input_arguments*
- inputs()
- {
- if (this->inputs_ == NULL)
- this->inputs_ = new Input_arguments();
- return this->inputs_;
- }
-
- // Return whether we saw any input files.
- bool
- saw_inputs() const
- { return this->inputs_ != NULL && !this->inputs_->empty(); }
-
- // Return the current language being processed in a version script
- // (eg, "C++"). The empty string represents unmangled C names.
- const std::string&
- get_current_language() const
- { return this->language_stack_.back(); }
-
- // Push a language onto the stack when entering an extern block.
- void push_language(const std::string& lang)
- { this->language_stack_.push_back(lang); }
-
- // Pop a language off of the stack when exiting an extern block.
- void pop_language()
- {
- gold_assert(!this->language_stack_.empty());
- this->language_stack_.pop_back();
- }
-
- private:
- // The name of the file we are reading.
- const char* filename_;
- // The position dependent options.
- Position_dependent_options posdep_options_;
- // Whether we are currently in a --start-group/--end-group.
- bool in_group_;
- // Whether the script was found in a sysrooted directory.
- bool is_in_sysroot_;
- // May be NULL if the user chooses not to pass one in.
- Command_line* command_line_;
- // Options which may be set from any linker script.
- Script_options* script_options_;
- // Information parsed from a version script.
- Version_script_info* version_script_info_;
- // The lexer.
- Lex* lex_;
- // The line number of the last token returned by next_token.
- int lineno_;
- // The column number of the last token returned by next_token.
- int charpos_;
- // A stack of lexer modes.
- std::vector<Lex::Mode> lex_mode_stack_;
- // A stack of which extern/language block we're inside. Can be C++,
- // java, or empty for C.
- std::vector<std::string> language_stack_;
- // New input files found to add to the link.
- Input_arguments* inputs_;
-};
-
-// FILE was found as an argument on the command line. Try to read it
-// as a script. Return true if the file was handled.
-
-bool
-read_input_script(Workqueue* workqueue, const General_options& options,
- Symbol_table* symtab, Layout* layout,
- Dirsearch* dirsearch, Input_objects* input_objects,
- Mapfile* mapfile, Input_group* input_group,
- const Input_argument* input_argument,
- Input_file* input_file, Task_token* next_blocker,
- bool* used_next_blocker)
-{
- *used_next_blocker = false;
-
- std::string input_string;
- Lex::read_file(input_file, &input_string);
-
- Lex lex(input_string.c_str(), input_string.length(), PARSING_LINKER_SCRIPT);
-
- Parser_closure closure(input_file->filename().c_str(),
- input_argument->file().options(),
- input_group != NULL,
- input_file->is_in_sysroot(),
- NULL,
- layout->script_options(),
- &lex);
-
- if (yyparse(&closure) != 0)
- return false;
-
- if (!closure.saw_inputs())
- return true;
-
- Task_token* this_blocker = NULL;
- for (Input_arguments::const_iterator p = closure.inputs()->begin();
- p != closure.inputs()->end();
- ++p)
- {
- Task_token* nb;
- if (p + 1 == closure.inputs()->end())
- nb = next_blocker;
- else
- {
- nb = new Task_token(true);
- nb->add_blocker();
- }
- workqueue->queue_soon(new Read_symbols(options, input_objects, symtab,
- layout, dirsearch, mapfile, &*p,
- input_group, this_blocker, nb));
- this_blocker = nb;
- }
-
- *used_next_blocker = true;
-
- return true;
-}
-
-// Helper function for read_version_script() and
-// read_commandline_script(). Processes the given file in the mode
-// indicated by first_token and lex_mode.
-
-static bool
-read_script_file(const char* filename, Command_line* cmdline,
- int first_token, Lex::Mode lex_mode)
-{
- // TODO: if filename is a relative filename, search for it manually
- // using "." + cmdline->options()->search_path() -- not dirsearch.
- Dirsearch dirsearch;
-
- // The file locking code wants to record a Task, but we haven't
- // started the workqueue yet. This is only for debugging purposes,
- // so we invent a fake value.
- const Task* task = reinterpret_cast<const Task*>(-1);
-
- // We don't want this file to be opened in binary mode.
- Position_dependent_options posdep = cmdline->position_dependent_options();
- if (posdep.format_enum() == General_options::OBJECT_FORMAT_BINARY)
- posdep.set_format_enum(General_options::OBJECT_FORMAT_ELF);
- Input_file_argument input_argument(filename, false, "", false, posdep);
- Input_file input_file(&input_argument);
- if (!input_file.open(cmdline->options(), dirsearch, task))
- return false;
-
- std::string input_string;
- Lex::read_file(&input_file, &input_string);
-
- Lex lex(input_string.c_str(), input_string.length(), first_token);
- lex.set_mode(lex_mode);
-
- Parser_closure closure(filename,
- cmdline->position_dependent_options(),
- false,
- input_file.is_in_sysroot(),
- cmdline,
- &cmdline->script_options(),
- &lex);
- if (yyparse(&closure) != 0)
- {
- input_file.file().unlock(task);
- return false;
- }
-
- input_file.file().unlock(task);
-
- gold_assert(!closure.saw_inputs());
-
- return true;
-}
-
-// FILENAME was found as an argument to --script (-T).
-// Read it as a script, and execute its contents immediately.
-
-bool
-read_commandline_script(const char* filename, Command_line* cmdline)
-{
- return read_script_file(filename, cmdline,
- PARSING_LINKER_SCRIPT, Lex::LINKER_SCRIPT);
-}
-
-// FILE was found as an argument to --version-script. Read it as a
-// version script, and store its contents in
-// cmdline->script_options()->version_script_info().
-
-bool
-read_version_script(const char* filename, Command_line* cmdline)
-{
- return read_script_file(filename, cmdline,
- PARSING_VERSION_SCRIPT, Lex::VERSION_SCRIPT);
-}
-
-// Implement the --defsym option on the command line. Return true if
-// all is well.
-
-bool
-Script_options::define_symbol(const char* definition)
-{
- Lex lex(definition, strlen(definition), PARSING_DEFSYM);
- lex.set_mode(Lex::EXPRESSION);
-
- // Dummy value.
- Position_dependent_options posdep_options;
-
- Parser_closure closure("command line", posdep_options, false, false, NULL,
- this, &lex);
-
- if (yyparse(&closure) != 0)
- return false;
-
- gold_assert(!closure.saw_inputs());
-
- return true;
-}
-
-// Print the script to F for debugging.
-
-void
-Script_options::print(FILE* f) const
-{
- fprintf(f, "%s: Dumping linker script\n", program_name);
-
- if (!this->entry_.empty())
- fprintf(f, "ENTRY(%s)\n", this->entry_.c_str());
-
- for (Symbol_assignments::const_iterator p =
- this->symbol_assignments_.begin();
- p != this->symbol_assignments_.end();
- ++p)
- (*p)->print(f);
-
- for (Assertions::const_iterator p = this->assertions_.begin();
- p != this->assertions_.end();
- ++p)
- (*p)->print(f);
-
- this->script_sections_.print(f);
-
- this->version_script_info_.print(f);
-}
-
-// Manage mapping from keywords to the codes expected by the bison
-// parser. We construct one global object for each lex mode with
-// keywords.
-
-class Keyword_to_parsecode
-{
- public:
- // The structure which maps keywords to parsecodes.
- struct Keyword_parsecode
- {
- // Keyword.
- const char* keyword;
- // Corresponding parsecode.
- int parsecode;
- };
-
- Keyword_to_parsecode(const Keyword_parsecode* keywords,
- int keyword_count)
- : keyword_parsecodes_(keywords), keyword_count_(keyword_count)
- { }
-
- // Return the parsecode corresponding KEYWORD, or 0 if it is not a
- // keyword.
- int
- keyword_to_parsecode(const char* keyword, size_t len) const;
-
- private:
- const Keyword_parsecode* keyword_parsecodes_;
- const int keyword_count_;
-};
-
-// Mapping from keyword string to keyword parsecode. This array must
-// be kept in sorted order. Parsecodes are looked up using bsearch.
-// This array must correspond to the list of parsecodes in yyscript.y.
-
-static const Keyword_to_parsecode::Keyword_parsecode
-script_keyword_parsecodes[] =
-{
- { "ABSOLUTE", ABSOLUTE },
- { "ADDR", ADDR },
- { "ALIGN", ALIGN_K },
- { "ALIGNOF", ALIGNOF },
- { "ASSERT", ASSERT_K },
- { "AS_NEEDED", AS_NEEDED },
- { "AT", AT },
- { "BIND", BIND },
- { "BLOCK", BLOCK },
- { "BYTE", BYTE },
- { "CONSTANT", CONSTANT },
- { "CONSTRUCTORS", CONSTRUCTORS },
- { "CREATE_OBJECT_SYMBOLS", CREATE_OBJECT_SYMBOLS },
- { "DATA_SEGMENT_ALIGN", DATA_SEGMENT_ALIGN },
- { "DATA_SEGMENT_END", DATA_SEGMENT_END },
- { "DATA_SEGMENT_RELRO_END", DATA_SEGMENT_RELRO_END },
- { "DEFINED", DEFINED },
- { "ENTRY", ENTRY },
- { "EXCLUDE_FILE", EXCLUDE_FILE },
- { "EXTERN", EXTERN },
- { "FILL", FILL },
- { "FLOAT", FLOAT },
- { "FORCE_COMMON_ALLOCATION", FORCE_COMMON_ALLOCATION },
- { "GROUP", GROUP },
- { "HLL", HLL },
- { "INCLUDE", INCLUDE },
- { "INHIBIT_COMMON_ALLOCATION", INHIBIT_COMMON_ALLOCATION },
- { "INPUT", INPUT },
- { "KEEP", KEEP },
- { "LENGTH", LENGTH },
- { "LOADADDR", LOADADDR },
- { "LONG", LONG },
- { "MAP", MAP },
- { "MAX", MAX_K },
- { "MEMORY", MEMORY },
- { "MIN", MIN_K },
- { "NEXT", NEXT },
- { "NOCROSSREFS", NOCROSSREFS },
- { "NOFLOAT", NOFLOAT },
- { "ONLY_IF_RO", ONLY_IF_RO },
- { "ONLY_IF_RW", ONLY_IF_RW },
- { "OPTION", OPTION },
- { "ORIGIN", ORIGIN },
- { "OUTPUT", OUTPUT },
- { "OUTPUT_ARCH", OUTPUT_ARCH },
- { "OUTPUT_FORMAT", OUTPUT_FORMAT },
- { "OVERLAY", OVERLAY },
- { "PHDRS", PHDRS },
- { "PROVIDE", PROVIDE },
- { "PROVIDE_HIDDEN", PROVIDE_HIDDEN },
- { "QUAD", QUAD },
- { "SEARCH_DIR", SEARCH_DIR },
- { "SECTIONS", SECTIONS },
- { "SEGMENT_START", SEGMENT_START },
- { "SHORT", SHORT },
- { "SIZEOF", SIZEOF },
- { "SIZEOF_HEADERS", SIZEOF_HEADERS },
- { "SORT", SORT_BY_NAME },
- { "SORT_BY_ALIGNMENT", SORT_BY_ALIGNMENT },
- { "SORT_BY_NAME", SORT_BY_NAME },
- { "SPECIAL", SPECIAL },
- { "SQUAD", SQUAD },
- { "STARTUP", STARTUP },
- { "SUBALIGN", SUBALIGN },
- { "SYSLIB", SYSLIB },
- { "TARGET", TARGET_K },
- { "TRUNCATE", TRUNCATE },
- { "VERSION", VERSIONK },
- { "global", GLOBAL },
- { "l", LENGTH },
- { "len", LENGTH },
- { "local", LOCAL },
- { "o", ORIGIN },
- { "org", ORIGIN },
- { "sizeof_headers", SIZEOF_HEADERS },
-};
-
-static const Keyword_to_parsecode
-script_keywords(&script_keyword_parsecodes[0],
- (sizeof(script_keyword_parsecodes)
- / sizeof(script_keyword_parsecodes[0])));
-
-static const Keyword_to_parsecode::Keyword_parsecode
-version_script_keyword_parsecodes[] =
-{
- { "extern", EXTERN },
- { "global", GLOBAL },
- { "local", LOCAL },
-};
-
-static const Keyword_to_parsecode
-version_script_keywords(&version_script_keyword_parsecodes[0],
- (sizeof(version_script_keyword_parsecodes)
- / sizeof(version_script_keyword_parsecodes[0])));
-
-// Comparison function passed to bsearch.
-
-extern "C"
-{
-
-struct Ktt_key
-{
- const char* str;
- size_t len;
-};
-
-static int
-ktt_compare(const void* keyv, const void* kttv)
-{
- const Ktt_key* key = static_cast<const Ktt_key*>(keyv);
- const Keyword_to_parsecode::Keyword_parsecode* ktt =
- static_cast<const Keyword_to_parsecode::Keyword_parsecode*>(kttv);
- int i = strncmp(key->str, ktt->keyword, key->len);
- if (i != 0)
- return i;
- if (ktt->keyword[key->len] != '\0')
- return -1;
- return 0;
-}
-
-} // End extern "C".
-
-int
-Keyword_to_parsecode::keyword_to_parsecode(const char* keyword,
- size_t len) const
-{
- Ktt_key key;
- key.str = keyword;
- key.len = len;
- void* kttv = bsearch(&key,
- this->keyword_parsecodes_,
- this->keyword_count_,
- sizeof(this->keyword_parsecodes_[0]),
- ktt_compare);
- if (kttv == NULL)
- return 0;
- Keyword_parsecode* ktt = static_cast<Keyword_parsecode*>(kttv);
- return ktt->parsecode;
-}
-
-// The following structs are used within the VersionInfo class as well
-// as in the bison helper functions. They store the information
-// parsed from the version script.
-
-// A single version expression.
-// For example, pattern="std::map*" and language="C++".
-// pattern and language should be from the stringpool
-struct Version_expression {
- Version_expression(const std::string& pattern,
- const std::string& language,
- bool exact_match)
- : pattern(pattern), language(language), exact_match(exact_match) {}
-
- std::string pattern;
- std::string language;
- // If false, we use glob() to match pattern. If true, we use strcmp().
- bool exact_match;
-};
-
-
-// A list of expressions.
-struct Version_expression_list {
- std::vector<struct Version_expression> expressions;
-};
-
-
-// A list of which versions upon which another version depends.
-// Strings should be from the Stringpool.
-struct Version_dependency_list {
- std::vector<std::string> dependencies;
-};
-
-
-// The total definition of a version. It includes the tag for the
-// version, its global and local expressions, and any dependencies.
-struct Version_tree {
- Version_tree()
- : tag(), global(NULL), local(NULL), dependencies(NULL) {}
-
- std::string tag;
- const struct Version_expression_list* global;
- const struct Version_expression_list* local;
- const struct Version_dependency_list* dependencies;
-};
-
-Version_script_info::~Version_script_info()
-{
- this->clear();
-}
-
-void
-Version_script_info::clear()
-{
- for (size_t k = 0; k < dependency_lists_.size(); ++k)
- delete dependency_lists_[k];
- this->dependency_lists_.clear();
- for (size_t k = 0; k < version_trees_.size(); ++k)
- delete version_trees_[k];
- this->version_trees_.clear();
- for (size_t k = 0; k < expression_lists_.size(); ++k)
- delete expression_lists_[k];
- this->expression_lists_.clear();
-}
-
-std::vector<std::string>
-Version_script_info::get_versions() const
-{
- std::vector<std::string> ret;
- for (size_t j = 0; j < version_trees_.size(); ++j)
- if (!this->version_trees_[j]->tag.empty())
- ret.push_back(this->version_trees_[j]->tag);
- return ret;
-}
-
-std::vector<std::string>
-Version_script_info::get_dependencies(const char* version) const
-{
- std::vector<std::string> ret;
- for (size_t j = 0; j < version_trees_.size(); ++j)
- if (version_trees_[j]->tag == version)
- {
- const struct Version_dependency_list* deps =
- version_trees_[j]->dependencies;
- if (deps != NULL)
- for (size_t k = 0; k < deps->dependencies.size(); ++k)
- ret.push_back(deps->dependencies[k]);
- return ret;
- }
- return ret;
-}
-
-// Look up SYMBOL_NAME in the list of versions. If CHECK_GLOBAL is
-// true look at the globally visible symbols, otherwise look at the
-// symbols listed as "local:". Return true if the symbol is found,
-// false otherwise. If the symbol is found, then if PVERSION is not
-// NULL, set *PVERSION to the version.
-
-bool
-Version_script_info::get_symbol_version_helper(const char* symbol_name,
- bool check_global,
- std::string* pversion) const
-{
- for (size_t j = 0; j < version_trees_.size(); ++j)
- {
- // Is it a global symbol for this version?
- const Version_expression_list* explist =
- check_global ? version_trees_[j]->global : version_trees_[j]->local;
- if (explist != NULL)
- for (size_t k = 0; k < explist->expressions.size(); ++k)
- {
- const char* name_to_match = symbol_name;
- const struct Version_expression& exp = explist->expressions[k];
- char* demangled_name = NULL;
- if (exp.language == "C++")
- {
- demangled_name = cplus_demangle(symbol_name,
- DMGL_ANSI | DMGL_PARAMS);
- // This isn't a C++ symbol.
- if (demangled_name == NULL)
- continue;
- name_to_match = demangled_name;
- }
- else if (exp.language == "Java")
- {
- demangled_name = cplus_demangle(symbol_name,
- (DMGL_ANSI | DMGL_PARAMS
- | DMGL_JAVA));
- // This isn't a Java symbol.
- if (demangled_name == NULL)
- continue;
- name_to_match = demangled_name;
- }
- bool matched;
- if (exp.exact_match)
- matched = strcmp(exp.pattern.c_str(), name_to_match) == 0;
- else
- matched = fnmatch(exp.pattern.c_str(), name_to_match,
- FNM_NOESCAPE) == 0;
- if (demangled_name != NULL)
- free(demangled_name);
- if (matched)
- {
- if (pversion != NULL)
- *pversion = this->version_trees_[j]->tag;
- return true;
- }
- }
- }
- return false;
-}
-
-struct Version_dependency_list*
-Version_script_info::allocate_dependency_list()
-{
- dependency_lists_.push_back(new Version_dependency_list);
- return dependency_lists_.back();
-}
-
-struct Version_expression_list*
-Version_script_info::allocate_expression_list()
-{
- expression_lists_.push_back(new Version_expression_list);
- return expression_lists_.back();
-}
-
-struct Version_tree*
-Version_script_info::allocate_version_tree()
-{
- version_trees_.push_back(new Version_tree);
- return version_trees_.back();
-}
-
-// Print for debugging.
-
-void
-Version_script_info::print(FILE* f) const
-{
- if (this->empty())
- return;
-
- fprintf(f, "VERSION {");
-
- for (size_t i = 0; i < this->version_trees_.size(); ++i)
- {
- const Version_tree* vt = this->version_trees_[i];
-
- if (vt->tag.empty())
- fprintf(f, " {\n");
- else
- fprintf(f, " %s {\n", vt->tag.c_str());
-
- if (vt->global != NULL)
- {
- fprintf(f, " global :\n");
- this->print_expression_list(f, vt->global);
- }
-
- if (vt->local != NULL)
- {
- fprintf(f, " local :\n");
- this->print_expression_list(f, vt->local);
- }
-
- fprintf(f, " }");
- if (vt->dependencies != NULL)
- {
- const Version_dependency_list* deps = vt->dependencies;
- for (size_t j = 0; j < deps->dependencies.size(); ++j)
- {
- if (j < deps->dependencies.size() - 1)
- fprintf(f, "\n");
- fprintf(f, " %s", deps->dependencies[j].c_str());
- }
- }
- fprintf(f, ";\n");
- }
-
- fprintf(f, "}\n");
-}
-
-void
-Version_script_info::print_expression_list(
- FILE* f,
- const Version_expression_list* vel) const
-{
- std::string current_language;
- for (size_t i = 0; i < vel->expressions.size(); ++i)
- {
- const Version_expression& ve(vel->expressions[i]);
-
- if (ve.language != current_language)
- {
- if (!current_language.empty())
- fprintf(f, " }\n");
- fprintf(f, " extern \"%s\" {\n", ve.language.c_str());
- current_language = ve.language;
- }
-
- fprintf(f, " ");
- if (!current_language.empty())
- fprintf(f, " ");
-
- if (ve.exact_match)
- fprintf(f, "\"");
- fprintf(f, "%s", ve.pattern.c_str());
- if (ve.exact_match)
- fprintf(f, "\"");
-
- fprintf(f, "\n");
- }
-
- if (!current_language.empty())
- fprintf(f, " }\n");
-}
-
-} // End namespace gold.
-
-// The remaining functions are extern "C", so it's clearer to not put
-// them in namespace gold.
-
-using namespace gold;
-
-// This function is called by the bison parser to return the next
-// token.
-
-extern "C" int
-yylex(YYSTYPE* lvalp, void* closurev)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- const Token* token = closure->next_token();
- switch (token->classification())
- {
- default:
- gold_unreachable();
-
- case Token::TOKEN_INVALID:
- yyerror(closurev, "invalid character");
- return 0;
-
- case Token::TOKEN_EOF:
- return 0;
-
- case Token::TOKEN_STRING:
- {
- // This is either a keyword or a STRING.
- size_t len;
- const char* str = token->string_value(&len);
- int parsecode = 0;
- switch (closure->lex_mode())
- {
- case Lex::LINKER_SCRIPT:
- parsecode = script_keywords.keyword_to_parsecode(str, len);
- break;
- case Lex::VERSION_SCRIPT:
- parsecode = version_script_keywords.keyword_to_parsecode(str, len);
- break;
- default:
- break;
- }
- if (parsecode != 0)
- return parsecode;
- lvalp->string.value = str;
- lvalp->string.length = len;
- return STRING;
- }
-
- case Token::TOKEN_QUOTED_STRING:
- lvalp->string.value = token->string_value(&lvalp->string.length);
- return QUOTED_STRING;
-
- case Token::TOKEN_OPERATOR:
- return token->operator_value();
-
- case Token::TOKEN_INTEGER:
- lvalp->integer = token->integer_value();
- return INTEGER;
- }
-}
-
-// This function is called by the bison parser to report an error.
-
-extern "C" void
-yyerror(void* closurev, const char* message)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- gold_error(_("%s:%d:%d: %s"), closure->filename(), closure->lineno(),
- closure->charpos(), message);
-}
-
-// Called by the bison parser to add a file to the link.
-
-extern "C" void
-script_add_file(void* closurev, const char* name, size_t length)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
-
- // If this is an absolute path, and we found the script in the
- // sysroot, then we want to prepend the sysroot to the file name.
- // For example, this is how we handle a cross link to the x86_64
- // libc.so, which refers to /lib/libc.so.6.
- std::string name_string(name, length);
- const char* extra_search_path = ".";
- std::string script_directory;
- if (IS_ABSOLUTE_PATH(name_string.c_str()))
- {
- if (closure->is_in_sysroot())
- {
- const std::string& sysroot(parameters->options().sysroot());
- gold_assert(!sysroot.empty());
- name_string = sysroot + name_string;
- }
- }
- else
- {
- // In addition to checking the normal library search path, we
- // also want to check in the script-directory.
- const char *slash = strrchr(closure->filename(), '/');
- if (slash != NULL)
- {
- script_directory.assign(closure->filename(),
- slash - closure->filename() + 1);
- extra_search_path = script_directory.c_str();
- }
- }
-
- Input_file_argument file(name_string.c_str(), false, extra_search_path,
- false, closure->position_dependent_options());
- closure->inputs()->add_file(file);
-}
-
-// Called by the bison parser to start a group. If we are already in
-// a group, that means that this script was invoked within a
-// --start-group --end-group sequence on the command line, or that
-// this script was found in a GROUP of another script. In that case,
-// we simply continue the existing group, rather than starting a new
-// one. It is possible to construct a case in which this will do
-// something other than what would happen if we did a recursive group,
-// but it's hard to imagine why the different behaviour would be
-// useful for a real program. Avoiding recursive groups is simpler
-// and more efficient.
-
-extern "C" void
-script_start_group(void* closurev)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- if (!closure->in_group())
- closure->inputs()->start_group();
-}
-
-// Called by the bison parser at the end of a group.
-
-extern "C" void
-script_end_group(void* closurev)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- if (!closure->in_group())
- closure->inputs()->end_group();
-}
-
-// Called by the bison parser to start an AS_NEEDED list.
-
-extern "C" void
-script_start_as_needed(void* closurev)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->position_dependent_options().set_as_needed(true);
-}
-
-// Called by the bison parser at the end of an AS_NEEDED list.
-
-extern "C" void
-script_end_as_needed(void* closurev)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->position_dependent_options().set_as_needed(false);
-}
-
-// Called by the bison parser to set the entry symbol.
-
-extern "C" void
-script_set_entry(void* closurev, const char* entry, size_t length)
-{
- // We'll parse this exactly the same as --entry=ENTRY on the commandline
- // TODO(csilvers): FIXME -- call set_entry directly.
- std::string arg("--entry=");
- arg.append(entry, length);
- script_parse_option(closurev, arg.c_str(), arg.size());
-}
-
-// Called by the bison parser to set whether to define common symbols.
-
-extern "C" void
-script_set_common_allocation(void* closurev, int set)
-{
- const char* arg = set != 0 ? "--define-common" : "--no-define-common";
- script_parse_option(closurev, arg, strlen(arg));
-}
-
-// Called by the bison parser to define a symbol.
-
-extern "C" void
-script_set_symbol(void* closurev, const char* name, size_t length,
- Expression* value, int providei, int hiddeni)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- const bool provide = providei != 0;
- const bool hidden = hiddeni != 0;
- closure->script_options()->add_symbol_assignment(name, length, value,
- provide, hidden);
-}
-
-// Called by the bison parser to add an assertion.
-
-extern "C" void
-script_add_assertion(void* closurev, Expression* check, const char* message,
- size_t messagelen)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->script_options()->add_assertion(check, message, messagelen);
-}
-
-// Called by the bison parser to parse an OPTION.
-
-extern "C" void
-script_parse_option(void* closurev, const char* option, size_t length)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- // We treat the option as a single command-line option, even if
- // it has internal whitespace.
- if (closure->command_line() == NULL)
- {
- // There are some options that we could handle here--e.g.,
- // -lLIBRARY. Should we bother?
- gold_warning(_("%s:%d:%d: ignoring command OPTION; OPTION is only valid"
- " for scripts specified via -T/--script"),
- closure->filename(), closure->lineno(), closure->charpos());
- }
- else
- {
- bool past_a_double_dash_option = false;
- const char* mutable_option = strndup(option, length);
- gold_assert(mutable_option != NULL);
- closure->command_line()->process_one_option(1, &mutable_option, 0,
- &past_a_double_dash_option);
- // The General_options class will quite possibly store a pointer
- // into mutable_option, so we can't free it. In cases the class
- // does not store such a pointer, this is a memory leak. Alas. :(
- }
-}
-
-// Called by the bison parser to handle SEARCH_DIR. This is handled
-// exactly like a -L option.
-
-extern "C" void
-script_add_search_dir(void* closurev, const char* option, size_t length)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- if (closure->command_line() == NULL)
- gold_warning(_("%s:%d:%d: ignoring SEARCH_DIR; SEARCH_DIR is only valid"
- " for scripts specified via -T/--script"),
- closure->filename(), closure->lineno(), closure->charpos());
- else
- {
- std::string s = "-L" + std::string(option, length);
- script_parse_option(closurev, s.c_str(), s.size());
- }
-}
-
-/* Called by the bison parser to push the lexer into expression
- mode. */
-
-extern "C" void
-script_push_lex_into_expression_mode(void* closurev)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->push_lex_mode(Lex::EXPRESSION);
-}
-
-/* Called by the bison parser to push the lexer into version
- mode. */
-
-extern "C" void
-script_push_lex_into_version_mode(void* closurev)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->push_lex_mode(Lex::VERSION_SCRIPT);
-}
-
-/* Called by the bison parser to pop the lexer mode. */
-
-extern "C" void
-script_pop_lex_mode(void* closurev)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->pop_lex_mode();
-}
-
-// Register an entire version node. For example:
-//
-// GLIBC_2.1 {
-// global: foo;
-// } GLIBC_2.0;
-//
-// - tag is "GLIBC_2.1"
-// - tree contains the information "global: foo"
-// - deps contains "GLIBC_2.0"
-
-extern "C" void
-script_register_vers_node(void*,
- const char* tag,
- int taglen,
- struct Version_tree *tree,
- struct Version_dependency_list *deps)
-{
- gold_assert(tree != NULL);
- tree->dependencies = deps;
- if (tag != NULL)
- tree->tag = std::string(tag, taglen);
-}
-
-// Add a dependencies to the list of existing dependencies, if any,
-// and return the expanded list.
-
-extern "C" struct Version_dependency_list *
-script_add_vers_depend(void* closurev,
- struct Version_dependency_list *all_deps,
- const char *depend_to_add, int deplen)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- if (all_deps == NULL)
- all_deps = closure->version_script()->allocate_dependency_list();
- all_deps->dependencies.push_back(std::string(depend_to_add, deplen));
- return all_deps;
-}
-
-// Add a pattern expression to an existing list of expressions, if any.
-// TODO: In the old linker, the last argument used to be a bool, but I
-// don't know what it meant.
-
-extern "C" struct Version_expression_list *
-script_new_vers_pattern(void* closurev,
- struct Version_expression_list *expressions,
- const char *pattern, int patlen, int exact_match)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- if (expressions == NULL)
- expressions = closure->version_script()->allocate_expression_list();
- expressions->expressions.push_back(
- Version_expression(std::string(pattern, patlen),
- closure->get_current_language(),
- static_cast<bool>(exact_match)));
- return expressions;
-}
-
-// Attaches b to the end of a, and clears b. So a = a + b and b = {}.
-
-extern "C" struct Version_expression_list*
-script_merge_expressions(struct Version_expression_list *a,
- struct Version_expression_list *b)
-{
- a->expressions.insert(a->expressions.end(),
- b->expressions.begin(), b->expressions.end());
- // We could delete b and remove it from expressions_lists_, but
- // that's a lot of work. This works just as well.
- b->expressions.clear();
- return a;
-}
-
-// Combine the global and local expressions into a a Version_tree.
-
-extern "C" struct Version_tree *
-script_new_vers_node(void* closurev,
- struct Version_expression_list *global,
- struct Version_expression_list *local)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- Version_tree* tree = closure->version_script()->allocate_version_tree();
- tree->global = global;
- tree->local = local;
- return tree;
-}
-
-// Handle a transition in language, such as at the
-// start or end of 'extern "C++"'
-
-extern "C" void
-version_script_push_lang(void* closurev, const char* lang, int langlen)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->push_language(std::string(lang, langlen));
-}
-
-extern "C" void
-version_script_pop_lang(void* closurev)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->pop_language();
-}
-
-// Called by the bison parser to start a SECTIONS clause.
-
-extern "C" void
-script_start_sections(void* closurev)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->script_options()->script_sections()->start_sections();
-}
-
-// Called by the bison parser to finish a SECTIONS clause.
-
-extern "C" void
-script_finish_sections(void* closurev)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->script_options()->script_sections()->finish_sections();
-}
-
-// Start processing entries for an output section.
-
-extern "C" void
-script_start_output_section(void* closurev, const char* name, size_t namelen,
- const struct Parser_output_section_header* header)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->script_options()->script_sections()->start_output_section(name,
- namelen,
- header);
-}
-
-// Finish processing entries for an output section.
-
-extern "C" void
-script_finish_output_section(void* closurev,
- const struct Parser_output_section_trailer* trail)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->script_options()->script_sections()->finish_output_section(trail);
-}
-
-// Add a data item (e.g., "WORD (0)") to the current output section.
-
-extern "C" void
-script_add_data(void* closurev, int data_token, Expression* val)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- int size;
- bool is_signed = true;
- switch (data_token)
- {
- case QUAD:
- size = 8;
- is_signed = false;
- break;
- case SQUAD:
- size = 8;
- break;
- case LONG:
- size = 4;
- break;
- case SHORT:
- size = 2;
- break;
- case BYTE:
- size = 1;
- break;
- default:
- gold_unreachable();
- }
- closure->script_options()->script_sections()->add_data(size, is_signed, val);
-}
-
-// Add a clause setting the fill value to the current output section.
-
-extern "C" void
-script_add_fill(void* closurev, Expression* val)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- closure->script_options()->script_sections()->add_fill(val);
-}
-
-// Add a new input section specification to the current output
-// section.
-
-extern "C" void
-script_add_input_section(void* closurev,
- const struct Input_section_spec* spec,
- int keepi)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- bool keep = keepi != 0;
- closure->script_options()->script_sections()->add_input_section(spec, keep);
-}
-
-// Create a new list of string/sort pairs.
-
-extern "C" String_sort_list_ptr
-script_new_string_sort_list(const struct Wildcard_section* string_sort)
-{
- return new String_sort_list(1, *string_sort);
-}
-
-// Add an entry to a list of string/sort pairs. The way the parser
-// works permits us to simply modify the first parameter, rather than
-// copy the vector.
-
-extern "C" String_sort_list_ptr
-script_string_sort_list_add(String_sort_list_ptr pv,
- const struct Wildcard_section* string_sort)
-{
- if (pv == NULL)
- return script_new_string_sort_list(string_sort);
- else
- {
- pv->push_back(*string_sort);
- return pv;
- }
-}
-
-// Create a new list of strings.
-
-extern "C" String_list_ptr
-script_new_string_list(const char* str, size_t len)
-{
- return new String_list(1, std::string(str, len));
-}
-
-// Add an element to a list of strings. The way the parser works
-// permits us to simply modify the first parameter, rather than copy
-// the vector.
-
-extern "C" String_list_ptr
-script_string_list_push_back(String_list_ptr pv, const char* str, size_t len)
-{
- if (pv == NULL)
- return script_new_string_list(str, len);
- else
- {
- pv->push_back(std::string(str, len));
- return pv;
- }
-}
-
-// Concatenate two string lists. Either or both may be NULL. The way
-// the parser works permits us to modify the parameters, rather than
-// copy the vector.
-
-extern "C" String_list_ptr
-script_string_list_append(String_list_ptr pv1, String_list_ptr pv2)
-{
- if (pv1 == NULL)
- return pv2;
- if (pv2 == NULL)
- return pv1;
- pv1->insert(pv1->end(), pv2->begin(), pv2->end());
- return pv1;
-}
-
-// Add a new program header.
-
-extern "C" void
-script_add_phdr(void* closurev, const char* name, size_t namelen,
- unsigned int type, const Phdr_info* info)
-{
- Parser_closure* closure = static_cast<Parser_closure*>(closurev);
- bool includes_filehdr = info->includes_filehdr != 0;
- bool includes_phdrs = info->includes_phdrs != 0;
- bool is_flags_valid = info->is_flags_valid != 0;
- Script_sections* ss = closure->script_options()->script_sections();
- ss->add_phdr(name, namelen, type, includes_filehdr, includes_phdrs,
- is_flags_valid, info->flags, info->load_address);
-}
-
-// Convert a program header string to a type.
-
-#define PHDR_TYPE(NAME) { #NAME, sizeof(#NAME) - 1, elfcpp::NAME }
-
-static struct
-{
- const char* name;
- size_t namelen;
- unsigned int val;
-} phdr_type_names[] =
-{
- PHDR_TYPE(PT_NULL),
- PHDR_TYPE(PT_LOAD),
- PHDR_TYPE(PT_DYNAMIC),
- PHDR_TYPE(PT_INTERP),
- PHDR_TYPE(PT_NOTE),
- PHDR_TYPE(PT_SHLIB),
- PHDR_TYPE(PT_PHDR),
- PHDR_TYPE(PT_TLS),
- PHDR_TYPE(PT_GNU_EH_FRAME),
- PHDR_TYPE(PT_GNU_STACK),
- PHDR_TYPE(PT_GNU_RELRO)
-};
-
-extern "C" unsigned int
-script_phdr_string_to_type(void* closurev, const char* name, size_t namelen)
-{
- for (unsigned int i = 0;
- i < sizeof(phdr_type_names) / sizeof(phdr_type_names[0]);
- ++i)
- if (namelen == phdr_type_names[i].namelen
- && strncmp(name, phdr_type_names[i].name, namelen) == 0)
- return phdr_type_names[i].val;
- yyerror(closurev, _("unknown PHDR type (try integer)"));
- return elfcpp::PT_NULL;
-}
diff --git a/gold/sparc.cc b/gold/sparc.cc
deleted file mode 100644
index 7da59dd3f84..00000000000
--- a/gold/sparc.cc
+++ /dev/null
@@ -1,3200 +0,0 @@
-// sparc.cc -- sparc target support for gold.
-
-// Copyright 2008 Free Software Foundation, Inc.
-// Written by David S. Miller <davem@davemloft.net>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-#include "gold.h"
-
-#include <cstdlib>
-#include <cstdio>
-#include <cstring>
-
-#include "elfcpp.h"
-#include "parameters.h"
-#include "reloc.h"
-#include "sparc.h"
-#include "object.h"
-#include "symtab.h"
-#include "layout.h"
-#include "output.h"
-#include "copy-relocs.h"
-#include "target.h"
-#include "target-reloc.h"
-#include "target-select.h"
-#include "tls.h"
-#include "errors.h"
-
-namespace
-{
-
-using namespace gold;
-
-template<int size, bool big_endian>
-class Output_data_plt_sparc;
-
-template<int size, bool big_endian>
-class Target_sparc : public Sized_target<size, big_endian>
-{
- public:
- typedef Output_data_reloc<elfcpp::SHT_RELA, true, size, big_endian> Reloc_section;
-
- Target_sparc()
- : Sized_target<size, big_endian>(&sparc_info),
- got_(NULL), plt_(NULL), rela_dyn_(NULL),
- copy_relocs_(elfcpp::R_SPARC_COPY), dynbss_(NULL),
- got_mod_index_offset_(-1U), tls_get_addr_sym_(NULL)
- {
- }
-
- // Scan the relocations to look for symbol adjustments.
- void
- scan_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols);
- // Finalize the sections.
- void
- do_finalize_sections(Layout*);
-
- // Return the value to use for a dynamic which requires special
- // treatment.
- uint64_t
- do_dynsym_value(const Symbol*) const;
-
- // Relocate a section.
- void
- relocate_section(const Relocate_info<size, big_endian>*,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr view_address,
- section_size_type view_size);
-
- // Scan the relocs during a relocatable link.
- void
- scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols,
- Relocatable_relocs*);
-
- // Relocate a section during a relocatable link.
- void
- relocate_for_relocatable(const Relocate_info<size, big_endian>*,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- off_t offset_in_output_section,
- const Relocatable_relocs*,
- unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr view_address,
- section_size_type view_size,
- unsigned char* reloc_view,
- section_size_type reloc_view_size);
- // Return whether SYM is defined by the ABI.
- bool
- do_is_defined_by_abi(Symbol* sym) const
- {
- // XXX Really need to support this better...
- if (sym->type() == elfcpp::STT_SPARC_REGISTER)
- return 1;
-
- return strcmp(sym->name(), "___tls_get_addr") == 0;
- }
-
- // Return the size of the GOT section.
- section_size_type
- got_size()
- {
- gold_assert(this->got_ != NULL);
- return this->got_->data_size();
- }
-
- private:
-
- // The class which scans relocations.
- class Scan
- {
- public:
- Scan()
- : issued_non_pic_error_(false)
- { }
-
- inline void
- local(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_sparc* target,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rela<size, big_endian>& reloc, unsigned int r_type,
- const elfcpp::Sym<size, big_endian>& lsym);
-
- inline void
- global(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_sparc* target,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rela<size, big_endian>& reloc, unsigned int r_type,
- Symbol* gsym);
-
- private:
- static void
- unsupported_reloc_local(Sized_relobj<size, big_endian>*,
- unsigned int r_type);
-
- static void
- unsupported_reloc_global(Sized_relobj<size, big_endian>*,
- unsigned int r_type, Symbol*);
-
- static void
- generate_tls_call(Symbol_table* symtab, Layout* layout,
- Target_sparc* target);
-
- void
- check_non_pic(Relobj*, unsigned int r_type);
-
- // Whether we have issued an error about a non-PIC compilation.
- bool issued_non_pic_error_;
- };
-
- // The class which implements relocation.
- class Relocate
- {
- public:
- Relocate()
- : ignore_gd_add_(false)
- { }
-
- ~Relocate()
- {
- if (this->ignore_gd_add_)
- {
- // FIXME: This needs to specify the location somehow.
- gold_error(_("missing expected TLS relocation"));
- }
- }
-
- // Do a relocation. Return false if the caller should not issue
- // any warnings about this relocation.
- inline bool
- relocate(const Relocate_info<size, big_endian>*, Target_sparc*,
- size_t relnum, const elfcpp::Rela<size, big_endian>&,
- unsigned int r_type, const Sized_symbol<size>*,
- const Symbol_value<size>*,
- unsigned char*,
- typename elfcpp::Elf_types<size>::Elf_Addr,
- section_size_type);
-
- private:
- // Do a TLS relocation.
- inline void
- relocate_tls(const Relocate_info<size, big_endian>*, Target_sparc* target,
- size_t relnum, const elfcpp::Rela<size, big_endian>&,
- unsigned int r_type, const Sized_symbol<size>*,
- const Symbol_value<size>*,
- unsigned char*,
- typename elfcpp::Elf_types<size>::Elf_Addr,
- section_size_type);
-
- // Ignore the next relocation which should be R_SPARC_TLS_GD_ADD
- bool ignore_gd_add_;
- };
-
- // A class which returns the size required for a relocation type,
- // used while scanning relocs during a relocatable link.
- class Relocatable_size_for_reloc
- {
- public:
- unsigned int
- get_size_for_reloc(unsigned int, Relobj*);
- };
-
- // Get the GOT section, creating it if necessary.
- Output_data_got<size, big_endian>*
- got_section(Symbol_table*, Layout*);
-
- // Create a PLT entry for a global symbol.
- void
- make_plt_entry(Symbol_table*, Layout*, Symbol*);
-
- // Create a GOT entry for the TLS module index.
- unsigned int
- got_mod_index_entry(Symbol_table* symtab, Layout* layout,
- Sized_relobj<size, big_endian>* object);
-
- // Return the gsym for "__tls_get_addr". Cache if not already
- // cached.
- Symbol*
- tls_get_addr_sym(Symbol_table* symtab)
- {
- if (!this->tls_get_addr_sym_)
- this->tls_get_addr_sym_ = symtab->lookup("__tls_get_addr", NULL);
- gold_assert(this->tls_get_addr_sym_);
- return this->tls_get_addr_sym_;
- }
-
- // Get the PLT section.
- const Output_data_plt_sparc<size, big_endian>*
- plt_section() const
- {
- gold_assert(this->plt_ != NULL);
- return this->plt_;
- }
-
- // Get the dynamic reloc section, creating it if necessary.
- Reloc_section*
- rela_dyn_section(Layout*);
-
- // Return true if the symbol may need a COPY relocation.
- // References from an executable object to non-function symbols
- // defined in a dynamic object may need a COPY relocation.
- bool
- may_need_copy_reloc(Symbol* gsym)
- {
- return (!parameters->options().shared()
- && gsym->is_from_dynobj()
- && gsym->type() != elfcpp::STT_FUNC);
- }
-
- // Copy a relocation against a global symbol.
- void
- copy_reloc(Symbol_table* symtab, Layout* layout,
- Sized_relobj<size, big_endian>* object,
- unsigned int shndx, Output_section* output_section,
- Symbol* sym, const elfcpp::Rela<size, big_endian>& reloc)
- {
- this->copy_relocs_.copy_reloc(symtab, layout,
- symtab->get_sized_symbol<size>(sym),
- object, shndx, output_section,
- reloc, this->rela_dyn_section(layout));
- }
-
- // Information about this specific target which we pass to the
- // general Target structure.
- static Target::Target_info sparc_info;
-
- // The types of GOT entries needed for this platform.
- enum Got_type
- {
- GOT_TYPE_STANDARD = 0, // GOT entry for a regular symbol
- GOT_TYPE_TLS_OFFSET = 1, // GOT entry for TLS offset
- GOT_TYPE_TLS_PAIR = 2, // GOT entry for TLS module/offset pair
- };
-
- // The GOT section.
- Output_data_got<size, big_endian>* got_;
- // The PLT section.
- Output_data_plt_sparc<size, big_endian>* plt_;
- // The dynamic reloc section.
- Reloc_section* rela_dyn_;
- // Relocs saved to avoid a COPY reloc.
- Copy_relocs<elfcpp::SHT_RELA, size, big_endian> copy_relocs_;
- // Space for variables copied with a COPY reloc.
- Output_data_space* dynbss_;
- // Offset of the GOT entry for the TLS module index;
- unsigned int got_mod_index_offset_;
- // Cached pointer to __tls_get_addr symbol
- Symbol* tls_get_addr_sym_;
-};
-
-template<>
-Target::Target_info Target_sparc<32, true>::sparc_info =
-{
- 32, // size
- true, // is_big_endian
- elfcpp::EM_SPARC, // machine_code
- false, // has_make_symbol
- false, // has_resolve
- false, // has_code_fill
- true, // is_default_stack_executable
- '\0', // wrap_char
- "/usr/lib/ld.so.1", // dynamic_linker
- 0x00010000, // default_text_segment_address
- 64 * 1024, // abi_pagesize (overridable by -z max-page-size)
- 8 * 1024 // common_pagesize (overridable by -z common-page-size)
-};
-
-template<>
-Target::Target_info Target_sparc<64, true>::sparc_info =
-{
- 64, // size
- true, // is_big_endian
- elfcpp::EM_SPARCV9, // machine_code
- false, // has_make_symbol
- false, // has_resolve
- false, // has_code_fill
- true, // is_default_stack_executable
- '\0', // wrap_char
- "/usr/lib/sparcv9/ld.so.1", // dynamic_linker
- 0x100000, // default_text_segment_address
- 64 * 1024, // abi_pagesize (overridable by -z max-page-size)
- 8 * 1024 // common_pagesize (overridable by -z common-page-size)
-};
-
-// We have to take care here, even when operating in little-endian
-// mode, sparc instructions are still big endian.
-template<int size, bool big_endian>
-class Sparc_relocate_functions
-{
-private:
- // Do a simple relocation with the addend in the relocation.
- template<int valsize>
- static inline void
- rela(unsigned char* view,
- unsigned int right_shift,
- typename elfcpp::Elf_types<valsize>::Elf_Addr dst_mask,
- typename elfcpp::Swap<size, big_endian>::Valtype value,
- typename elfcpp::Swap<size, big_endian>::Valtype addend)
- {
- typedef typename elfcpp::Swap<valsize, big_endian>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<valsize, big_endian>::readval(wv);
- Valtype reloc = ((value + addend) >> right_shift);
-
- val &= ~dst_mask;
- reloc &= dst_mask;
-
- elfcpp::Swap<valsize, big_endian>::writeval(wv, val | reloc);
- }
-
- // Do a simple relocation using a symbol value with the addend in
- // the relocation.
- template<int valsize>
- static inline void
- rela(unsigned char* view,
- unsigned int right_shift,
- typename elfcpp::Elf_types<valsize>::Elf_Addr dst_mask,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Swap<valsize, big_endian>::Valtype addend)
- {
- typedef typename elfcpp::Swap<valsize, big_endian>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<valsize, big_endian>::readval(wv);
- Valtype reloc = (psymval->value(object, addend) >> right_shift);
-
- val &= ~dst_mask;
- reloc &= dst_mask;
-
- elfcpp::Swap<valsize, big_endian>::writeval(wv, val | reloc);
- }
-
- // Do a simple relocation using a symbol value with the addend in
- // the relocation, unaligned.
- template<int valsize>
- static inline void
- rela_ua(unsigned char* view,
- unsigned int right_shift, elfcpp::Elf_Xword dst_mask,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Swap<size, big_endian>::Valtype addend)
- {
- typedef typename elfcpp::Swap_unaligned<valsize,
- big_endian>::Valtype Valtype;
- unsigned char* wv = view;
- Valtype val = elfcpp::Swap_unaligned<valsize, big_endian>::readval(wv);
- Valtype reloc = (psymval->value(object, addend) >> right_shift);
-
- val &= ~dst_mask;
- reloc &= dst_mask;
-
- elfcpp::Swap_unaligned<valsize, big_endian>::writeval(wv, val | reloc);
- }
-
- // Do a simple PC relative relocation with a Symbol_value with the
- // addend in the relocation.
- template<int valsize>
- static inline void
- pcrela(unsigned char* view,
- unsigned int right_shift,
- typename elfcpp::Elf_types<valsize>::Elf_Addr dst_mask,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Swap<size, big_endian>::Valtype addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- typedef typename elfcpp::Swap<valsize, big_endian>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<valsize, big_endian>::readval(wv);
- Valtype reloc = ((psymval->value(object, addend) - address)
- >> right_shift);
-
- val &= ~dst_mask;
- reloc &= dst_mask;
-
- elfcpp::Swap<valsize, big_endian>::writeval(wv, val | reloc);
- }
-
- template<int valsize>
- static inline void
- pcrela_unaligned(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Swap<size, big_endian>::Valtype addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- typedef typename elfcpp::Swap_unaligned<valsize,
- big_endian>::Valtype Valtype;
- unsigned char* wv = view;
- Valtype reloc = (psymval->value(object, addend) - address);
-
- elfcpp::Swap_unaligned<valsize, big_endian>::writeval(wv, reloc);
- }
-
- typedef Sparc_relocate_functions<size, big_endian> This;
- typedef Sparc_relocate_functions<size, true> This_insn;
-
-public:
- // R_SPARC_WDISP30: (Symbol + Addend - Address) >> 2
- static inline void
- wdisp30(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This_insn::template pcrela<32>(view, 2, 0x3fffffff, object,
- psymval, addend, address);
- }
-
- // R_SPARC_WDISP22: (Symbol + Addend - Address) >> 2
- static inline void
- wdisp22(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This_insn::template pcrela<32>(view, 2, 0x003fffff, object,
- psymval, addend, address);
- }
-
- // R_SPARC_WDISP19: (Symbol + Addend - Address) >> 2
- static inline void
- wdisp19(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This_insn::template pcrela<32>(view, 2, 0x0007ffff, object,
- psymval, addend, address);
- }
-
- // R_SPARC_WDISP16: (Symbol + Addend - Address) >> 2
- static inline void
- wdisp16(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- typedef typename elfcpp::Swap<32, true>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<32, true>::readval(wv);
- Valtype reloc = ((psymval->value(object, addend) - address)
- >> 2);
-
- // The relocation value is split between the low 14 bits,
- // and bits 20-21.
- val &= ~((0x3 << 20) | 0x3fff);
- reloc = (((reloc & 0xc000) << (20 - 14))
- | (reloc & 0x3ffff));
-
- elfcpp::Swap<32, true>::writeval(wv, val | reloc);
- }
-
- // R_SPARC_PC22: (Symbol + Addend - Address) >> 10
- static inline void
- pc22(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This_insn::template pcrela<32>(view, 10, 0x003fffff, object,
- psymval, addend, address);
- }
-
- // R_SPARC_PC10: (Symbol + Addend - Address) & 0x3ff
- static inline void
- pc10(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This_insn::template pcrela<32>(view, 0, 0x000003ff, object,
- psymval, addend, address);
- }
-
- // R_SPARC_HI22: (Symbol + Addend) >> 10
- static inline void
- hi22(unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 10, 0x003fffff, value, addend);
- }
-
- // R_SPARC_HI22: (Symbol + Addend) >> 10
- static inline void
- hi22(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 10, 0x003fffff, object, psymval, addend);
- }
-
- // R_SPARC_PCPLT22: (Symbol + Addend - Address) >> 10
- static inline void
- pcplt22(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This_insn::template pcrela<32>(view, 10, 0x003fffff, object,
- psymval, addend, address);
- }
-
- // R_SPARC_LO10: (Symbol + Addend) & 0x3ff
- static inline void
- lo10(unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 0, 0x000003ff, value, addend);
- }
-
- // R_SPARC_LO10: (Symbol + Addend) & 0x3ff
- static inline void
- lo10(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 0, 0x000003ff, object, psymval, addend);
- }
-
- // R_SPARC_LO10: (Symbol + Addend) & 0x3ff
- static inline void
- lo10(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This_insn::template pcrela<32>(view, 0, 0x000003ff, object,
- psymval, addend, address);
- }
-
- // R_SPARC_OLO10: ((Symbol + Addend) & 0x3ff) + Addend2
- static inline void
- olo10(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr addend2)
- {
- typedef typename elfcpp::Swap<32, true>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<32, true>::readval(wv);
- Valtype reloc = psymval->value(object, addend);
-
- val &= ~0x1fff;
- reloc &= 0x3ff;
- reloc += addend2;
- reloc &= 0x1fff;
-
- elfcpp::Swap<32, true>::writeval(wv, val | reloc);
- }
-
- // R_SPARC_22: (Symbol + Addend)
- static inline void
- rela32_22(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 0, 0x003fffff, object, psymval, addend);
- }
-
- // R_SPARC_13: (Symbol + Addend)
- static inline void
- rela32_13(unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 0, 0x00001fff, value, addend);
- }
-
- // R_SPARC_13: (Symbol + Addend)
- static inline void
- rela32_13(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 0, 0x00001fff, object, psymval, addend);
- }
-
- // R_SPARC_UA16: (Symbol + Addend)
- static inline void
- ua16(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This::template rela_ua<16>(view, 0, 0xffff, object, psymval, addend);
- }
-
- // R_SPARC_UA32: (Symbol + Addend)
- static inline void
- ua32(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This::template rela_ua<32>(view, 0, 0xffffffff, object, psymval, addend);
- }
-
- // R_SPARC_UA64: (Symbol + Addend)
- static inline void
- ua64(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This::template rela_ua<64>(view, 0, ~(elfcpp::Elf_Xword) 0,
- object, psymval, addend);
- }
-
- // R_SPARC_DISP8: (Symbol + Addend - Address)
- static inline void
- disp8(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This::template pcrela_unaligned<8>(view, object, psymval,
- addend, address);
- }
-
- // R_SPARC_DISP16: (Symbol + Addend - Address)
- static inline void
- disp16(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This::template pcrela_unaligned<16>(view, object, psymval,
- addend, address);
- }
-
- // R_SPARC_DISP32: (Symbol + Addend - Address)
- static inline void
- disp32(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This::template pcrela_unaligned<32>(view, object, psymval,
- addend, address);
- }
-
- // R_SPARC_DISP64: (Symbol + Addend - Address)
- static inline void
- disp64(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- elfcpp::Elf_Xword addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This::template pcrela_unaligned<64>(view, object, psymval,
- addend, address);
- }
-
- // R_SPARC_H44: (Symbol + Addend) >> 22
- static inline void
- h44(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 22, 0x003fffff, object, psymval, addend);
- }
-
- // R_SPARC_M44: ((Symbol + Addend) >> 12) & 0x3ff
- static inline void
- m44(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 12, 0x000003ff, object, psymval, addend);
- }
-
- // R_SPARC_L44: (Symbol + Addend) & 0xfff
- static inline void
- l44(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 0, 0x00000fff, object, psymval, addend);
- }
-
- // R_SPARC_HH22: (Symbol + Addend) >> 42
- static inline void
- hh22(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 42, 0x003fffff, object, psymval, addend);
- }
-
- // R_SPARC_PC_HH22: (Symbol + Addend - Address) >> 42
- static inline void
- pc_hh22(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This_insn::template pcrela<32>(view, 42, 0x003fffff, object,
- psymval, addend, address);
- }
-
- // R_SPARC_HM10: ((Symbol + Addend) >> 32) & 0x3ff
- static inline void
- hm10(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 32, 0x000003ff, object, psymval, addend);
- }
-
- // R_SPARC_PC_HM10: ((Symbol + Addend - Address) >> 32) & 0x3ff
- static inline void
- pc_hm10(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend,
- typename elfcpp::Elf_types<size>::Elf_Addr address)
- {
- This_insn::template pcrela<32>(view, 32, 0x000003ff, object,
- psymval, addend, address);
- }
-
- // R_SPARC_11: (Symbol + Addend)
- static inline void
- rela32_11(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 0, 0x000007ff, object, psymval, addend);
- }
-
- // R_SPARC_10: (Symbol + Addend)
- static inline void
- rela32_10(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 0, 0x000003ff, object, psymval, addend);
- }
-
- // R_SPARC_7: (Symbol + Addend)
- static inline void
- rela32_7(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 0, 0x0000007f, object, psymval, addend);
- }
-
- // R_SPARC_6: (Symbol + Addend)
- static inline void
- rela32_6(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 0, 0x0000003f, object, psymval, addend);
- }
-
- // R_SPARC_5: (Symbol + Addend)
- static inline void
- rela32_5(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::template rela<32>(view, 0, 0x0000001f, object, psymval, addend);
- }
-
- // R_SPARC_TLS_LDO_HIX22: @dtpoff(Symbol + Addend) >> 10
- static inline void
- ldo_hix22(unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- This_insn::hi22(view, value, addend);
- }
-
- // R_SPARC_TLS_LDO_LOX10: @dtpoff(Symbol + Addend) & 0x3ff
- static inline void
- ldo_lox10(unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- typedef typename elfcpp::Swap<32, true>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<32, true>::readval(wv);
- Valtype reloc = (value + addend);
-
- val &= ~0x1fff;
- reloc &= 0x3ff;
-
- elfcpp::Swap<32, true>::writeval(wv, val | reloc);
- }
-
- // R_SPARC_TLS_LE_HIX22: (@tpoff(Symbol + Addend) ^ 0xffffffffffffffff) >> 10
- static inline void
- hix22(unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- typedef typename elfcpp::Swap<32, true>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<32, true>::readval(wv);
- Valtype reloc = (value + addend);
-
- val &= ~0x3fffff;
-
- reloc ^= ~(Valtype)0;
- reloc >>= 10;
-
- reloc &= 0x3fffff;
-
- elfcpp::Swap<32, true>::writeval(wv, val | reloc);
- }
-
- // R_SPARC_HIX22: ((Symbol + Addend) ^ 0xffffffffffffffff) >> 10
- static inline void
- hix22(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- typedef typename elfcpp::Swap<32, true>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<32, true>::readval(wv);
- Valtype reloc = psymval->value(object, addend);
-
- val &= ~0x3fffff;
-
- reloc ^= ~(Valtype)0;
- reloc >>= 10;
-
- reloc &= 0x3fffff;
-
- elfcpp::Swap<32, true>::writeval(wv, val | reloc);
- }
-
-
- // R_SPARC_TLS_LE_LOX10: (@tpoff(Symbol + Addend) & 0x3ff) | 0x1c00
- static inline void
- lox10(unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- typedef typename elfcpp::Swap<32, true>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<32, true>::readval(wv);
- Valtype reloc = (value + addend);
-
- val &= ~0x1fff;
- reloc &= 0x3ff;
- reloc |= 0x1c00;
-
- elfcpp::Swap<32, true>::writeval(wv, val | reloc);
- }
-
- // R_SPARC_LOX10: ((Symbol + Addend) & 0x3ff) | 0x1c00
- static inline void
- lox10(unsigned char* view,
- const Sized_relobj<size, big_endian>* object,
- const Symbol_value<size>* psymval,
- typename elfcpp::Elf_types<size>::Elf_Addr addend)
- {
- typedef typename elfcpp::Swap<32, true>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<32, true>::readval(wv);
- Valtype reloc = psymval->value(object, addend);
-
- val &= ~0x1fff;
- reloc &= 0x3ff;
- reloc |= 0x1c00;
-
- elfcpp::Swap<32, true>::writeval(wv, val | reloc);
- }
-};
-
-// Get the GOT section, creating it if necessary.
-
-template<int size, bool big_endian>
-Output_data_got<size, big_endian>*
-Target_sparc<size, big_endian>::got_section(Symbol_table* symtab,
- Layout* layout)
-{
- if (this->got_ == NULL)
- {
- gold_assert(symtab != NULL && layout != NULL);
-
- this->got_ = new Output_data_got<size, big_endian>();
-
- Output_section* os;
- os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
- (elfcpp::SHF_ALLOC
- | elfcpp::SHF_WRITE),
- this->got_);
- os->set_is_relro();
-
- // Define _GLOBAL_OFFSET_TABLE_ at the start of the .got section.
- symtab->define_in_output_data("_GLOBAL_OFFSET_TABLE_", NULL,
- this->got_,
- 0, 0, elfcpp::STT_OBJECT,
- elfcpp::STB_LOCAL,
- elfcpp::STV_HIDDEN, 0,
- false, false);
- }
-
- return this->got_;
-}
-
-// Get the dynamic reloc section, creating it if necessary.
-
-template<int size, bool big_endian>
-typename Target_sparc<size, big_endian>::Reloc_section*
-Target_sparc<size, big_endian>::rela_dyn_section(Layout* layout)
-{
- if (this->rela_dyn_ == NULL)
- {
- gold_assert(layout != NULL);
- this->rela_dyn_ = new Reloc_section(parameters->options().combreloc());
- layout->add_output_section_data(".rela.dyn", elfcpp::SHT_RELA,
- elfcpp::SHF_ALLOC, this->rela_dyn_);
- }
- return this->rela_dyn_;
-}
-
-// A class to handle the PLT data.
-
-template<int size, bool big_endian>
-class Output_data_plt_sparc : public Output_section_data
-{
- public:
- typedef Output_data_reloc<elfcpp::SHT_RELA, true,
- size, big_endian> Reloc_section;
-
- Output_data_plt_sparc(Layout*);
-
- // Add an entry to the PLT.
- void add_entry(Symbol* gsym);
-
- // Return the .rela.plt section data.
- const Reloc_section* rel_plt() const
- {
- return this->rel_;
- }
-
- protected:
- void do_adjust_output_section(Output_section* os);
-
- // Write to a map file.
- void
- do_print_to_mapfile(Mapfile* mapfile) const
- { mapfile->print_output_data(this, _("** PLT")); }
-
- private:
- // The size of an entry in the PLT.
- static const int base_plt_entry_size = (size == 32 ? 12 : 32);
-
- static const unsigned int plt_entries_per_block = 160;
- static const unsigned int plt_insn_chunk_size = 24;
- static const unsigned int plt_pointer_chunk_size = 8;
- static const unsigned int plt_block_size =
- (plt_entries_per_block
- * (plt_insn_chunk_size + plt_pointer_chunk_size));
-
- // Set the final size.
- void
- set_final_data_size()
- {
- unsigned int full_count = this->count_ + 4;
- unsigned int extra = (size == 32 ? 4 : 0);
-
- if (size == 32 || full_count < 32768)
- this->set_data_size((full_count * base_plt_entry_size) + extra);
- else
- {
- unsigned int ext_cnt = full_count - 32768;
-
- this->set_data_size((32768 * base_plt_entry_size)
- + (ext_cnt
- * (plt_insn_chunk_size
- + plt_pointer_chunk_size)));
- }
- }
-
- // Write out the PLT data.
- void
- do_write(Output_file*);
-
- // The reloc section.
- Reloc_section* rel_;
- // The number of PLT entries.
- unsigned int count_;
-};
-
-// Define the constants as required by C++ standard.
-
-template<int size, bool big_endian>
-const int Output_data_plt_sparc<size, big_endian>::base_plt_entry_size;
-
-template<int size, bool big_endian>
-const unsigned int
-Output_data_plt_sparc<size, big_endian>::plt_entries_per_block;
-
-template<int size, bool big_endian>
-const unsigned int Output_data_plt_sparc<size, big_endian>::plt_insn_chunk_size;
-
-template<int size, bool big_endian>
-const unsigned int
-Output_data_plt_sparc<size, big_endian>::plt_pointer_chunk_size;
-
-template<int size, bool big_endian>
-const unsigned int Output_data_plt_sparc<size, big_endian>::plt_block_size;
-
-// Create the PLT section. The ordinary .got section is an argument,
-// since we need to refer to the start.
-
-template<int size, bool big_endian>
-Output_data_plt_sparc<size, big_endian>::Output_data_plt_sparc(Layout* layout)
- : Output_section_data(size == 32 ? 4 : 8), count_(0)
-{
- this->rel_ = new Reloc_section(false);
- layout->add_output_section_data(".rela.plt", elfcpp::SHT_RELA,
- elfcpp::SHF_ALLOC, this->rel_);
-}
-
-template<int size, bool big_endian>
-void
-Output_data_plt_sparc<size, big_endian>::do_adjust_output_section(Output_section* os)
-{
- os->set_entsize(0);
-}
-
-// Add an entry to the PLT.
-
-template<int size, bool big_endian>
-void
-Output_data_plt_sparc<size, big_endian>::add_entry(Symbol* gsym)
-{
- gold_assert(!gsym->has_plt_offset());
-
- unsigned int index = this->count_ + 4;
- section_offset_type plt_offset;
-
- if (size == 32 || index < 32768)
- plt_offset = index * base_plt_entry_size;
- else
- {
- unsigned int ext_index = index - 32768;
-
- plt_offset = (32768 * base_plt_entry_size)
- + ((ext_index / plt_entries_per_block)
- * plt_block_size)
- + ((ext_index % plt_entries_per_block)
- * plt_insn_chunk_size);
- }
-
- gsym->set_plt_offset(plt_offset);
-
- ++this->count_;
-
- // Every PLT entry needs a reloc.
- gsym->set_needs_dynsym_entry();
- this->rel_->add_global(gsym, elfcpp::R_SPARC_JMP_SLOT, this,
- plt_offset, 0);
-
- // Note that we don't need to save the symbol. The contents of the
- // PLT are independent of which symbols are used. The symbols only
- // appear in the relocations.
-}
-
-static const unsigned int sparc_nop = 0x01000000;
-static const unsigned int sparc_sethi_g1 = 0x03000000;
-static const unsigned int sparc_branch_always = 0x30800000;
-static const unsigned int sparc_branch_always_pt = 0x30680000;
-static const unsigned int sparc_mov = 0x80100000;
-static const unsigned int sparc_mov_g0_o0 = 0x90100000;
-static const unsigned int sparc_mov_o7_g5 = 0x8a10000f;
-static const unsigned int sparc_call_plus_8 = 0x40000002;
-static const unsigned int sparc_ldx_o7_imm_g1 = 0xc25be000;
-static const unsigned int sparc_jmpl_o7_g1_g1 = 0x83c3c001;
-static const unsigned int sparc_mov_g5_o7 = 0x9e100005;
-
-// Write out the PLT.
-
-template<int size, bool big_endian>
-void
-Output_data_plt_sparc<size, big_endian>::do_write(Output_file* of)
-{
- const off_t offset = this->offset();
- const section_size_type oview_size =
- convert_to_section_size_type(this->data_size());
- unsigned char* const oview = of->get_output_view(offset, oview_size);
- unsigned char* pov = oview;
-
- memset(pov, 0, base_plt_entry_size * 4);
- pov += base_plt_entry_size * 4;
-
- unsigned int plt_offset = base_plt_entry_size * 4;
- const unsigned int count = this->count_;
-
- if (size == 64)
- {
- unsigned int limit;
-
- limit = (count > 32768 ? 32768 : count);
-
- for (unsigned int i = 0; i < limit; ++i)
- {
- elfcpp::Swap<32, true>::writeval(pov + 0x00,
- sparc_sethi_g1 + plt_offset);
- elfcpp::Swap<32, true>::writeval(pov + 0x04,
- sparc_branch_always_pt +
- (((base_plt_entry_size -
- (plt_offset + 4)) >> 2) &
- 0x7ffff));
- elfcpp::Swap<32, true>::writeval(pov + 0x08, sparc_nop);
- elfcpp::Swap<32, true>::writeval(pov + 0x0c, sparc_nop);
- elfcpp::Swap<32, true>::writeval(pov + 0x10, sparc_nop);
- elfcpp::Swap<32, true>::writeval(pov + 0x14, sparc_nop);
- elfcpp::Swap<32, true>::writeval(pov + 0x18, sparc_nop);
- elfcpp::Swap<32, true>::writeval(pov + 0x1c, sparc_nop);
-
- pov += base_plt_entry_size;
- plt_offset += base_plt_entry_size;
- }
-
- if (count > 32768)
- {
- unsigned int ext_cnt = count - 32768;
- unsigned int blks = ext_cnt / plt_entries_per_block;
-
- for (unsigned int i = 0; i < blks; ++i)
- {
- unsigned int data_off = (plt_entries_per_block
- * plt_insn_chunk_size) - 4;
-
- for (unsigned int j = 0; j < plt_entries_per_block; ++j)
- {
- elfcpp::Swap<32, true>::writeval(pov + 0x00,
- sparc_mov_o7_g5);
- elfcpp::Swap<32, true>::writeval(pov + 0x04,
- sparc_call_plus_8);
- elfcpp::Swap<32, true>::writeval(pov + 0x08,
- sparc_nop);
- elfcpp::Swap<32, true>::writeval(pov + 0x0c,
- sparc_ldx_o7_imm_g1 +
- (data_off & 0x1fff));
- elfcpp::Swap<32, true>::writeval(pov + 0x10,
- sparc_jmpl_o7_g1_g1);
- elfcpp::Swap<32, true>::writeval(pov + 0x14,
- sparc_mov_g5_o7);
-
- elfcpp::Swap<64, big_endian>::writeval(
- pov + 0x4 + data_off,
- (elfcpp::Elf_Xword) (oview - (pov + 0x04)));
-
- pov += plt_insn_chunk_size;
- data_off -= 16;
- }
- }
-
- unsigned int sub_blk_cnt = ext_cnt % plt_entries_per_block;
- for (unsigned int i = 0; i < sub_blk_cnt; ++i)
- {
- unsigned int data_off = (sub_blk_cnt
- * plt_insn_chunk_size) - 4;
-
- for (unsigned int j = 0; j < plt_entries_per_block; ++j)
- {
- elfcpp::Swap<32, true>::writeval(pov + 0x00,
- sparc_mov_o7_g5);
- elfcpp::Swap<32, true>::writeval(pov + 0x04,
- sparc_call_plus_8);
- elfcpp::Swap<32, true>::writeval(pov + 0x08,
- sparc_nop);
- elfcpp::Swap<32, true>::writeval(pov + 0x0c,
- sparc_ldx_o7_imm_g1 +
- (data_off & 0x1fff));
- elfcpp::Swap<32, true>::writeval(pov + 0x10,
- sparc_jmpl_o7_g1_g1);
- elfcpp::Swap<32, true>::writeval(pov + 0x14,
- sparc_mov_g5_o7);
-
- elfcpp::Swap<64, big_endian>::writeval(
- pov + 0x4 + data_off,
- (elfcpp::Elf_Xword) (oview - (pov + 0x04)));
-
- pov += plt_insn_chunk_size;
- data_off -= 16;
- }
- }
- }
- }
- else
- {
- for (unsigned int i = 0; i < count; ++i)
- {
- elfcpp::Swap<32, true>::writeval(pov + 0x00,
- sparc_sethi_g1 + plt_offset);
- elfcpp::Swap<32, true>::writeval(pov + 0x04,
- sparc_branch_always +
- (((- (plt_offset + 4)) >> 2) &
- 0x003fffff));
- elfcpp::Swap<32, true>::writeval(pov + 0x08, sparc_nop);
-
- pov += base_plt_entry_size;
- plt_offset += base_plt_entry_size;
- }
-
- elfcpp::Swap<32, true>::writeval(pov, sparc_nop);
- pov += 4;
- }
-
- gold_assert(static_cast<section_size_type>(pov - oview) == oview_size);
-
- of->write_output_view(offset, oview_size, oview);
-}
-
-// Create a PLT entry for a global symbol.
-
-template<int size, bool big_endian>
-void
-Target_sparc<size, big_endian>::make_plt_entry(Symbol_table* symtab,
- Layout* layout,
- Symbol* gsym)
-{
- if (gsym->has_plt_offset())
- return;
-
- if (this->plt_ == NULL)
- {
- // Create the GOT sections first.
- this->got_section(symtab, layout);
-
- this->plt_ = new Output_data_plt_sparc<size, big_endian>(layout);
- layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
- (elfcpp::SHF_ALLOC
- | elfcpp::SHF_EXECINSTR
- | elfcpp::SHF_WRITE),
- this->plt_);
-
- // Define _PROCEDURE_LINKAGE_TABLE_ at the start of the .plt section.
- symtab->define_in_output_data("_PROCEDURE_LINKAGE_TABLE_", NULL,
- this->plt_,
- 0, 0, elfcpp::STT_OBJECT,
- elfcpp::STB_LOCAL,
- elfcpp::STV_HIDDEN, 0,
- false, false);
- }
-
- this->plt_->add_entry(gsym);
-}
-
-// Create a GOT entry for the TLS module index.
-
-template<int size, bool big_endian>
-unsigned int
-Target_sparc<size, big_endian>::got_mod_index_entry(Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<size, big_endian>* object)
-{
- if (this->got_mod_index_offset_ == -1U)
- {
- gold_assert(symtab != NULL && layout != NULL && object != NULL);
- Reloc_section* rela_dyn = this->rela_dyn_section(layout);
- Output_data_got<size, big_endian>* got;
- unsigned int got_offset;
-
- got = this->got_section(symtab, layout);
- got_offset = got->add_constant(0);
- rela_dyn->add_local(object, 0,
- (size == 64 ?
- elfcpp::R_SPARC_TLS_DTPMOD64 :
- elfcpp::R_SPARC_TLS_DTPMOD32), got,
- got_offset, 0);
- got->add_constant(0);
- this->got_mod_index_offset_ = got_offset;
- }
- return this->got_mod_index_offset_;
-}
-
-// Optimize the TLS relocation type based on what we know about the
-// symbol. IS_FINAL is true if the final address of this symbol is
-// known at link time.
-
-static tls::Tls_optimization
-optimize_tls_reloc(bool is_final, int r_type)
-{
- // If we are generating a shared library, then we can't do anything
- // in the linker.
- if (parameters->options().shared())
- return tls::TLSOPT_NONE;
-
- switch (r_type)
- {
- case elfcpp::R_SPARC_TLS_GD_HI22: // Global-dynamic
- case elfcpp::R_SPARC_TLS_GD_LO10:
- case elfcpp::R_SPARC_TLS_GD_ADD:
- case elfcpp::R_SPARC_TLS_GD_CALL:
- // These are General-Dynamic which permits fully general TLS
- // access. Since we know that we are generating an executable,
- // we can convert this to Initial-Exec. If we also know that
- // this is a local symbol, we can further switch to Local-Exec.
- if (is_final)
- return tls::TLSOPT_TO_LE;
- return tls::TLSOPT_TO_IE;
-
- case elfcpp::R_SPARC_TLS_LDM_HI22: // Local-dynamic
- case elfcpp::R_SPARC_TLS_LDM_LO10:
- case elfcpp::R_SPARC_TLS_LDM_ADD:
- case elfcpp::R_SPARC_TLS_LDM_CALL:
- // This is Local-Dynamic, which refers to a local symbol in the
- // dynamic TLS block. Since we know that we generating an
- // executable, we can switch to Local-Exec.
- return tls::TLSOPT_TO_LE;
-
- case elfcpp::R_SPARC_TLS_LDO_HIX22: // Alternate local-dynamic
- case elfcpp::R_SPARC_TLS_LDO_LOX10:
- case elfcpp::R_SPARC_TLS_LDO_ADD:
- // Another type of Local-Dynamic relocation.
- return tls::TLSOPT_TO_LE;
-
- case elfcpp::R_SPARC_TLS_IE_HI22: // Initial-exec
- case elfcpp::R_SPARC_TLS_IE_LO10:
- case elfcpp::R_SPARC_TLS_IE_LD:
- case elfcpp::R_SPARC_TLS_IE_LDX:
- // These are Initial-Exec relocs which get the thread offset
- // from the GOT. If we know that we are linking against the
- // local symbol, we can switch to Local-Exec, which links the
- // thread offset into the instruction.
- if (is_final)
- return tls::TLSOPT_TO_LE;
- return tls::TLSOPT_NONE;
-
- case elfcpp::R_SPARC_TLS_LE_HIX22: // Local-exec
- case elfcpp::R_SPARC_TLS_LE_LOX10:
- // When we already have Local-Exec, there is nothing further we
- // can do.
- return tls::TLSOPT_NONE;
-
- default:
- gold_unreachable();
- }
-}
-
-// Generate a PLT entry slot for a call to __tls_get_addr
-template<int size, bool big_endian>
-void
-Target_sparc<size, big_endian>::Scan::generate_tls_call(Symbol_table* symtab,
- Layout* layout,
- Target_sparc<size, big_endian>* target)
-{
- Symbol* gsym = target->tls_get_addr_sym(symtab);
-
- target->make_plt_entry(symtab, layout, gsym);
-}
-
-// Report an unsupported relocation against a local symbol.
-
-template<int size, bool big_endian>
-void
-Target_sparc<size, big_endian>::Scan::unsupported_reloc_local(
- Sized_relobj<size, big_endian>* object,
- unsigned int r_type)
-{
- gold_error(_("%s: unsupported reloc %u against local symbol"),
- object->name().c_str(), r_type);
-}
-
-// We are about to emit a dynamic relocation of type R_TYPE. If the
-// dynamic linker does not support it, issue an error.
-
-template<int size, bool big_endian>
-void
-Target_sparc<size, big_endian>::Scan::check_non_pic(Relobj* object, unsigned int r_type)
-{
- gold_assert(r_type != elfcpp::R_SPARC_NONE);
-
- if (size == 64)
- {
- switch (r_type)
- {
- // These are the relocation types supported by glibc for sparc 64-bit.
- case elfcpp::R_SPARC_RELATIVE:
- case elfcpp::R_SPARC_COPY:
- case elfcpp::R_SPARC_64:
- case elfcpp::R_SPARC_GLOB_DAT:
- case elfcpp::R_SPARC_JMP_SLOT:
- case elfcpp::R_SPARC_TLS_DTPMOD64:
- case elfcpp::R_SPARC_TLS_DTPOFF64:
- case elfcpp::R_SPARC_TLS_TPOFF64:
- case elfcpp::R_SPARC_TLS_LE_HIX22:
- case elfcpp::R_SPARC_TLS_LE_LOX10:
- case elfcpp::R_SPARC_8:
- case elfcpp::R_SPARC_16:
- case elfcpp::R_SPARC_DISP8:
- case elfcpp::R_SPARC_DISP16:
- case elfcpp::R_SPARC_DISP32:
- case elfcpp::R_SPARC_WDISP30:
- case elfcpp::R_SPARC_LO10:
- case elfcpp::R_SPARC_HI22:
- case elfcpp::R_SPARC_OLO10:
- case elfcpp::R_SPARC_H44:
- case elfcpp::R_SPARC_M44:
- case elfcpp::R_SPARC_L44:
- case elfcpp::R_SPARC_HH22:
- case elfcpp::R_SPARC_HM10:
- case elfcpp::R_SPARC_LM22:
- case elfcpp::R_SPARC_UA16:
- case elfcpp::R_SPARC_UA32:
- case elfcpp::R_SPARC_UA64:
- return;
-
- default:
- break;
- }
- }
- else
- {
- switch (r_type)
- {
- // These are the relocation types supported by glibc for sparc 32-bit.
- case elfcpp::R_SPARC_RELATIVE:
- case elfcpp::R_SPARC_COPY:
- case elfcpp::R_SPARC_GLOB_DAT:
- case elfcpp::R_SPARC_32:
- case elfcpp::R_SPARC_JMP_SLOT:
- case elfcpp::R_SPARC_TLS_DTPMOD32:
- case elfcpp::R_SPARC_TLS_DTPOFF32:
- case elfcpp::R_SPARC_TLS_TPOFF32:
- case elfcpp::R_SPARC_TLS_LE_HIX22:
- case elfcpp::R_SPARC_TLS_LE_LOX10:
- case elfcpp::R_SPARC_8:
- case elfcpp::R_SPARC_16:
- case elfcpp::R_SPARC_DISP8:
- case elfcpp::R_SPARC_DISP16:
- case elfcpp::R_SPARC_DISP32:
- case elfcpp::R_SPARC_LO10:
- case elfcpp::R_SPARC_WDISP30:
- case elfcpp::R_SPARC_HI22:
- case elfcpp::R_SPARC_UA16:
- case elfcpp::R_SPARC_UA32:
- return;
-
- default:
- break;
- }
- }
-
- // This prevents us from issuing more than one error per reloc
- // section. But we can still wind up issuing more than one
- // error per object file.
- if (this->issued_non_pic_error_)
- return;
- object->error(_("requires unsupported dynamic reloc; "
- "recompile with -fPIC"));
- this->issued_non_pic_error_ = true;
- return;
-}
-
-// Scan a relocation for a local symbol.
-
-template<int size, bool big_endian>
-inline void
-Target_sparc<size, big_endian>::Scan::local(
- const General_options&,
- Symbol_table* symtab,
- Layout* layout,
- Target_sparc<size, big_endian>* target,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rela<size, big_endian>& reloc,
- unsigned int r_type,
- const elfcpp::Sym<size, big_endian>& lsym)
-{
- unsigned int orig_r_type = r_type;
-
- r_type &= 0xff;
- switch (r_type)
- {
- case elfcpp::R_SPARC_NONE:
- case elfcpp::R_SPARC_REGISTER:
- case elfcpp::R_SPARC_GNU_VTINHERIT:
- case elfcpp::R_SPARC_GNU_VTENTRY:
- break;
-
- case elfcpp::R_SPARC_64:
- case elfcpp::R_SPARC_32:
- // If building a shared library (or a position-independent
- // executable), we need to create a dynamic relocation for
- // this location. The relocation applied at link time will
- // apply the link-time value, so we flag the location with
- // an R_SPARC_RELATIVE relocation so the dynamic loader can
- // relocate it easily.
- if (parameters->options().output_is_position_independent())
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
- rela_dyn->add_local_relative(object, r_sym, elfcpp::R_SPARC_RELATIVE,
- output_section, data_shndx,
- reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- break;
-
- case elfcpp::R_SPARC_HIX22:
- case elfcpp::R_SPARC_LOX10:
- case elfcpp::R_SPARC_H44:
- case elfcpp::R_SPARC_M44:
- case elfcpp::R_SPARC_L44:
- case elfcpp::R_SPARC_HH22:
- case elfcpp::R_SPARC_HM10:
- case elfcpp::R_SPARC_LM22:
- case elfcpp::R_SPARC_UA64:
- case elfcpp::R_SPARC_UA32:
- case elfcpp::R_SPARC_UA16:
- case elfcpp::R_SPARC_HI22:
- case elfcpp::R_SPARC_LO10:
- case elfcpp::R_SPARC_OLO10:
- case elfcpp::R_SPARC_16:
- case elfcpp::R_SPARC_11:
- case elfcpp::R_SPARC_10:
- case elfcpp::R_SPARC_8:
- case elfcpp::R_SPARC_7:
- case elfcpp::R_SPARC_6:
- case elfcpp::R_SPARC_5:
- // If building a shared library (or a position-independent
- // executable), we need to create a dynamic relocation for
- // this location.
- if (parameters->options().output_is_position_independent())
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
-
- check_non_pic(object, r_type);
- if (lsym.get_st_type() != elfcpp::STT_SECTION)
- {
- unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
- rela_dyn->add_local(object, r_sym, orig_r_type, output_section,
- data_shndx, reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
- gold_assert(lsym.get_st_value() == 0);
- rela_dyn->add_local_relative(object, r_sym, orig_r_type,
- output_section, data_shndx,
- reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- }
- break;
-
- case elfcpp::R_SPARC_WDISP30:
- case elfcpp::R_SPARC_WDISP22:
- case elfcpp::R_SPARC_WDISP19:
- case elfcpp::R_SPARC_WDISP16:
- case elfcpp::R_SPARC_DISP8:
- case elfcpp::R_SPARC_DISP16:
- case elfcpp::R_SPARC_DISP32:
- case elfcpp::R_SPARC_DISP64:
- case elfcpp::R_SPARC_PC10:
- case elfcpp::R_SPARC_PC22:
- break;
-
- case elfcpp::R_SPARC_GOT10:
- case elfcpp::R_SPARC_GOT13:
- case elfcpp::R_SPARC_GOT22:
- {
- // The symbol requires a GOT entry.
- Output_data_got<size, big_endian>* got;
- unsigned int r_sym;
-
- got = target->got_section(symtab, layout);
- r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
-
- // If we are generating a shared object, we need to add a
- // dynamic relocation for this symbol's GOT entry.
- if (parameters->options().output_is_position_independent())
- {
- if (!object->local_has_got_offset(r_sym, GOT_TYPE_STANDARD))
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- unsigned int off;
-
- off = got->add_constant(0);
- object->set_local_got_offset(r_sym, GOT_TYPE_STANDARD, off);
- rela_dyn->add_local_relative(object, r_sym,
- elfcpp::R_SPARC_RELATIVE,
- got, off, 0);
- }
- }
- else
- got->add_local(object, r_sym, GOT_TYPE_STANDARD);
- }
- break;
-
- // These are initial TLS relocs, which are expected when
- // linking.
- case elfcpp::R_SPARC_TLS_GD_HI22: // Global-dynamic
- case elfcpp::R_SPARC_TLS_GD_LO10:
- case elfcpp::R_SPARC_TLS_GD_ADD:
- case elfcpp::R_SPARC_TLS_GD_CALL:
- case elfcpp::R_SPARC_TLS_LDM_HI22 : // Local-dynamic
- case elfcpp::R_SPARC_TLS_LDM_LO10:
- case elfcpp::R_SPARC_TLS_LDM_ADD:
- case elfcpp::R_SPARC_TLS_LDM_CALL:
- case elfcpp::R_SPARC_TLS_LDO_HIX22: // Alternate local-dynamic
- case elfcpp::R_SPARC_TLS_LDO_LOX10:
- case elfcpp::R_SPARC_TLS_LDO_ADD:
- case elfcpp::R_SPARC_TLS_IE_HI22: // Initial-exec
- case elfcpp::R_SPARC_TLS_IE_LO10:
- case elfcpp::R_SPARC_TLS_IE_LD:
- case elfcpp::R_SPARC_TLS_IE_LDX:
- case elfcpp::R_SPARC_TLS_LE_HIX22: // Local-exec
- case elfcpp::R_SPARC_TLS_LE_LOX10:
- {
- bool output_is_shared = parameters->options().shared();
- const tls::Tls_optimization optimized_type
- = optimize_tls_reloc(!output_is_shared, r_type);
- switch (r_type)
- {
- case elfcpp::R_SPARC_TLS_GD_HI22: // Global-dynamic
- case elfcpp::R_SPARC_TLS_GD_LO10:
- case elfcpp::R_SPARC_TLS_GD_ADD:
- case elfcpp::R_SPARC_TLS_GD_CALL:
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a pair of GOT entries for the module index and
- // dtv-relative offset.
- Output_data_got<size, big_endian>* got
- = target->got_section(symtab, layout);
- unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
- unsigned int shndx = lsym.get_st_shndx();
- bool is_ordinary;
- shndx = object->adjust_sym_shndx(r_sym, shndx, &is_ordinary);
- if (!is_ordinary)
- object->error(_("local symbol %u has bad shndx %u"),
- r_sym, shndx);
- else
- got->add_local_pair_with_rela(object, r_sym,
- lsym.get_st_shndx(),
- GOT_TYPE_TLS_PAIR,
- target->rela_dyn_section(layout),
- (size == 64
- ? elfcpp::R_SPARC_TLS_DTPMOD64
- : elfcpp::R_SPARC_TLS_DTPMOD32),
- 0);
- if (r_type == elfcpp::R_SPARC_TLS_GD_CALL)
- generate_tls_call(symtab, layout, target);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_local(object, r_type);
- break;
-
- case elfcpp::R_SPARC_TLS_LDM_HI22 : // Local-dynamic
- case elfcpp::R_SPARC_TLS_LDM_LO10:
- case elfcpp::R_SPARC_TLS_LDM_ADD:
- case elfcpp::R_SPARC_TLS_LDM_CALL:
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a GOT entry for the module index.
- target->got_mod_index_entry(symtab, layout, object);
-
- if (r_type == elfcpp::R_SPARC_TLS_LDM_CALL)
- generate_tls_call(symtab, layout, target);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_local(object, r_type);
- break;
-
- case elfcpp::R_SPARC_TLS_LDO_HIX22: // Alternate local-dynamic
- case elfcpp::R_SPARC_TLS_LDO_LOX10:
- case elfcpp::R_SPARC_TLS_LDO_ADD:
- break;
-
- case elfcpp::R_SPARC_TLS_IE_HI22: // Initial-exec
- case elfcpp::R_SPARC_TLS_IE_LO10:
- case elfcpp::R_SPARC_TLS_IE_LD:
- case elfcpp::R_SPARC_TLS_IE_LDX:
- layout->set_has_static_tls();
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a GOT entry for the tp-relative offset.
- Output_data_got<size, big_endian>* got
- = target->got_section(symtab, layout);
- unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
-
- if (!object->local_has_got_offset(r_sym, GOT_TYPE_TLS_OFFSET))
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- unsigned int off = got->add_constant(0);
-
- object->set_local_got_offset(r_sym, GOT_TYPE_TLS_OFFSET,
- off);
- rela_dyn->add_local_relative(object, r_sym,
- (size == 64 ?
- elfcpp::R_SPARC_TLS_TPOFF64 :
- elfcpp::R_SPARC_TLS_TPOFF32),
- got, off, 0);
- }
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_local(object, r_type);
- break;
-
- case elfcpp::R_SPARC_TLS_LE_HIX22: // Local-exec
- case elfcpp::R_SPARC_TLS_LE_LOX10:
- layout->set_has_static_tls();
- if (output_is_shared)
- {
- // We need to create a dynamic relocation.
- gold_assert(lsym.get_st_type() != elfcpp::STT_SECTION);
- unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- rela_dyn->add_local_relative(object, r_sym, r_type,
- output_section, data_shndx,
- reloc.get_r_offset(), 0);
- }
- break;
- }
- }
- break;
-
- // These are relocations which should only be seen by the
- // dynamic linker, and should never be seen here.
- case elfcpp::R_SPARC_COPY:
- case elfcpp::R_SPARC_GLOB_DAT:
- case elfcpp::R_SPARC_JMP_SLOT:
- case elfcpp::R_SPARC_RELATIVE:
- case elfcpp::R_SPARC_TLS_DTPMOD64:
- case elfcpp::R_SPARC_TLS_DTPMOD32:
- case elfcpp::R_SPARC_TLS_DTPOFF64:
- case elfcpp::R_SPARC_TLS_DTPOFF32:
- case elfcpp::R_SPARC_TLS_TPOFF64:
- case elfcpp::R_SPARC_TLS_TPOFF32:
- gold_error(_("%s: unexpected reloc %u in object file"),
- object->name().c_str(), r_type);
- break;
-
- default:
- unsupported_reloc_local(object, r_type);
- break;
- }
-}
-
-// Report an unsupported relocation against a global symbol.
-
-template<int size, bool big_endian>
-void
-Target_sparc<size, big_endian>::Scan::unsupported_reloc_global(
- Sized_relobj<size, big_endian>* object,
- unsigned int r_type,
- Symbol* gsym)
-{
- gold_error(_("%s: unsupported reloc %u against global symbol %s"),
- object->name().c_str(), r_type, gsym->demangled_name().c_str());
-}
-
-// Scan a relocation for a global symbol.
-
-template<int size, bool big_endian>
-inline void
-Target_sparc<size, big_endian>::Scan::global(
- const General_options&,
- Symbol_table* symtab,
- Layout* layout,
- Target_sparc<size, big_endian>* target,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rela<size, big_endian>& reloc,
- unsigned int r_type,
- Symbol* gsym)
-{
- unsigned int orig_r_type = r_type;
-
- r_type &= 0xff;
- switch (r_type)
- {
- case elfcpp::R_SPARC_NONE:
- case elfcpp::R_SPARC_REGISTER:
- case elfcpp::R_SPARC_GNU_VTINHERIT:
- case elfcpp::R_SPARC_GNU_VTENTRY:
- break;
-
- case elfcpp::R_SPARC_PLT64:
- case elfcpp::R_SPARC_PLT32:
- case elfcpp::R_SPARC_HIPLT22:
- case elfcpp::R_SPARC_LOPLT10:
- case elfcpp::R_SPARC_PCPLT32:
- case elfcpp::R_SPARC_PCPLT22:
- case elfcpp::R_SPARC_PCPLT10:
- case elfcpp::R_SPARC_WPLT30:
- // If the symbol is fully resolved, this is just a PC32 reloc.
- // Otherwise we need a PLT entry.
- if (gsym->final_value_is_known())
- break;
- // If building a shared library, we can also skip the PLT entry
- // if the symbol is defined in the output file and is protected
- // or hidden.
- if (gsym->is_defined()
- && !gsym->is_from_dynobj()
- && !gsym->is_preemptible())
- break;
- target->make_plt_entry(symtab, layout, gsym);
- break;
-
- case elfcpp::R_SPARC_DISP8:
- case elfcpp::R_SPARC_DISP16:
- case elfcpp::R_SPARC_DISP32:
- case elfcpp::R_SPARC_DISP64:
- case elfcpp::R_SPARC_PC_HH22:
- case elfcpp::R_SPARC_PC_HM10:
- case elfcpp::R_SPARC_PC_LM22:
- case elfcpp::R_SPARC_PC10:
- case elfcpp::R_SPARC_PC22:
- case elfcpp::R_SPARC_WDISP30:
- case elfcpp::R_SPARC_WDISP22:
- case elfcpp::R_SPARC_WDISP19:
- case elfcpp::R_SPARC_WDISP16:
- {
- if (gsym->needs_plt_entry())
- target->make_plt_entry(symtab, layout, gsym);
- // Make a dynamic relocation if necessary.
- int flags = Symbol::NON_PIC_REF;
- if (gsym->type() == elfcpp::STT_FUNC)
- flags |= Symbol::FUNCTION_CALL;
- if (gsym->needs_dynamic_reloc(flags))
- {
- if (target->may_need_copy_reloc(gsym))
- {
- target->copy_reloc(symtab, layout, object,
- data_shndx, output_section, gsym,
- reloc);
- }
- else
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- check_non_pic(object, r_type);
- rela_dyn->add_global(gsym, orig_r_type, output_section, object,
- data_shndx, reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- }
- }
- break;
-
- case elfcpp::R_SPARC_UA64:
- case elfcpp::R_SPARC_64:
- case elfcpp::R_SPARC_HIX22:
- case elfcpp::R_SPARC_LOX10:
- case elfcpp::R_SPARC_H44:
- case elfcpp::R_SPARC_M44:
- case elfcpp::R_SPARC_L44:
- case elfcpp::R_SPARC_HH22:
- case elfcpp::R_SPARC_HM10:
- case elfcpp::R_SPARC_LM22:
- case elfcpp::R_SPARC_HI22:
- case elfcpp::R_SPARC_LO10:
- case elfcpp::R_SPARC_OLO10:
- case elfcpp::R_SPARC_UA32:
- case elfcpp::R_SPARC_32:
- case elfcpp::R_SPARC_UA16:
- case elfcpp::R_SPARC_16:
- case elfcpp::R_SPARC_11:
- case elfcpp::R_SPARC_10:
- case elfcpp::R_SPARC_8:
- case elfcpp::R_SPARC_7:
- case elfcpp::R_SPARC_6:
- case elfcpp::R_SPARC_5:
- {
- // Make a PLT entry if necessary.
- if (gsym->needs_plt_entry())
- {
- target->make_plt_entry(symtab, layout, gsym);
- // Since this is not a PC-relative relocation, we may be
- // taking the address of a function. In that case we need to
- // set the entry in the dynamic symbol table to the address of
- // the PLT entry.
- if (gsym->is_from_dynobj() && !parameters->options().shared())
- gsym->set_needs_dynsym_value();
- }
- // Make a dynamic relocation if necessary.
- if (gsym->needs_dynamic_reloc(Symbol::ABSOLUTE_REF))
- {
- if (target->may_need_copy_reloc(gsym))
- {
- target->copy_reloc(symtab, layout, object,
- data_shndx, output_section, gsym, reloc);
- }
- else if ((r_type == elfcpp::R_SPARC_32
- || r_type == elfcpp::R_SPARC_64)
- && gsym->can_use_relative_reloc(false))
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- rela_dyn->add_global_relative(gsym, elfcpp::R_SPARC_RELATIVE,
- output_section, object,
- data_shndx, reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- else
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
-
- check_non_pic(object, r_type);
- if (gsym->is_from_dynobj()
- || gsym->is_undefined()
- || gsym->is_preemptible())
- rela_dyn->add_global(gsym, orig_r_type, output_section,
- object, data_shndx,
- reloc.get_r_offset(),
- reloc.get_r_addend());
- else
- rela_dyn->add_global_relative(gsym, orig_r_type,
- output_section, object,
- data_shndx,
- reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- }
- }
- break;
-
- case elfcpp::R_SPARC_GOT10:
- case elfcpp::R_SPARC_GOT13:
- case elfcpp::R_SPARC_GOT22:
- {
- // The symbol requires a GOT entry.
- Output_data_got<size, big_endian>* got;
-
- got = target->got_section(symtab, layout);
- if (gsym->final_value_is_known())
- got->add_global(gsym, GOT_TYPE_STANDARD);
- else
- {
- // If this symbol is not fully resolved, we need to add a
- // dynamic relocation for it.
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- if (gsym->is_from_dynobj()
- || gsym->is_undefined()
- || gsym->is_preemptible())
- got->add_global_with_rela(gsym, GOT_TYPE_STANDARD, rela_dyn,
- elfcpp::R_SPARC_GLOB_DAT);
- else if (!gsym->has_got_offset(GOT_TYPE_STANDARD))
- {
- unsigned int off = got->add_constant(0);
-
- gsym->set_got_offset(GOT_TYPE_STANDARD, off);
- rela_dyn->add_global_relative(gsym, elfcpp::R_SPARC_RELATIVE,
- got, off, 0);
- }
- }
- }
- break;
-
- // These are initial tls relocs, which are expected when
- // linking.
- case elfcpp::R_SPARC_TLS_GD_HI22: // Global-dynamic
- case elfcpp::R_SPARC_TLS_GD_LO10:
- case elfcpp::R_SPARC_TLS_GD_ADD:
- case elfcpp::R_SPARC_TLS_GD_CALL:
- case elfcpp::R_SPARC_TLS_LDM_HI22: // Local-dynamic
- case elfcpp::R_SPARC_TLS_LDM_LO10:
- case elfcpp::R_SPARC_TLS_LDM_ADD:
- case elfcpp::R_SPARC_TLS_LDM_CALL:
- case elfcpp::R_SPARC_TLS_LDO_HIX22: // Alternate local-dynamic
- case elfcpp::R_SPARC_TLS_LDO_LOX10:
- case elfcpp::R_SPARC_TLS_LDO_ADD:
- case elfcpp::R_SPARC_TLS_LE_HIX22:
- case elfcpp::R_SPARC_TLS_LE_LOX10:
- case elfcpp::R_SPARC_TLS_IE_HI22: // Initial-exec
- case elfcpp::R_SPARC_TLS_IE_LO10:
- case elfcpp::R_SPARC_TLS_IE_LD:
- case elfcpp::R_SPARC_TLS_IE_LDX:
- {
- const bool is_final = gsym->final_value_is_known();
- const tls::Tls_optimization optimized_type
- = optimize_tls_reloc(is_final, r_type);
- switch (r_type)
- {
- case elfcpp::R_SPARC_TLS_GD_HI22: // Global-dynamic
- case elfcpp::R_SPARC_TLS_GD_LO10:
- case elfcpp::R_SPARC_TLS_GD_ADD:
- case elfcpp::R_SPARC_TLS_GD_CALL:
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a pair of GOT entries for the module index and
- // dtv-relative offset.
- Output_data_got<size, big_endian>* got
- = target->got_section(symtab, layout);
- got->add_global_pair_with_rela(gsym, GOT_TYPE_TLS_PAIR,
- target->rela_dyn_section(layout),
- (size == 64 ?
- elfcpp::R_SPARC_TLS_DTPMOD64 :
- elfcpp::R_SPARC_TLS_DTPMOD32),
- (size == 64 ?
- elfcpp::R_SPARC_TLS_DTPOFF64 :
- elfcpp::R_SPARC_TLS_DTPOFF32));
-
- // Emit R_SPARC_WPLT30 against "__tls_get_addr"
- if (r_type == elfcpp::R_SPARC_TLS_GD_CALL)
- generate_tls_call(symtab, layout, target);
- }
- else if (optimized_type == tls::TLSOPT_TO_IE)
- {
- // Create a GOT entry for the tp-relative offset.
- Output_data_got<size, big_endian>* got
- = target->got_section(symtab, layout);
- got->add_global_with_rela(gsym, GOT_TYPE_TLS_OFFSET,
- target->rela_dyn_section(layout),
- (size == 64 ?
- elfcpp::R_SPARC_TLS_TPOFF64 :
- elfcpp::R_SPARC_TLS_TPOFF32));
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_global(object, r_type, gsym);
- break;
-
- case elfcpp::R_SPARC_TLS_LDM_HI22: // Local-dynamic
- case elfcpp::R_SPARC_TLS_LDM_LO10:
- case elfcpp::R_SPARC_TLS_LDM_ADD:
- case elfcpp::R_SPARC_TLS_LDM_CALL:
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a GOT entry for the module index.
- target->got_mod_index_entry(symtab, layout, object);
-
- if (r_type == elfcpp::R_SPARC_TLS_LDM_CALL)
- generate_tls_call(symtab, layout, target);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_global(object, r_type, gsym);
- break;
-
- case elfcpp::R_SPARC_TLS_LDO_HIX22: // Alternate local-dynamic
- case elfcpp::R_SPARC_TLS_LDO_LOX10:
- case elfcpp::R_SPARC_TLS_LDO_ADD:
- break;
-
- case elfcpp::R_SPARC_TLS_LE_HIX22:
- case elfcpp::R_SPARC_TLS_LE_LOX10:
- layout->set_has_static_tls();
- if (parameters->options().shared())
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- rela_dyn->add_global_relative(gsym, orig_r_type,
- output_section, object,
- data_shndx, reloc.get_r_offset(),
- 0);
- }
- break;
-
- case elfcpp::R_SPARC_TLS_IE_HI22: // Initial-exec
- case elfcpp::R_SPARC_TLS_IE_LO10:
- case elfcpp::R_SPARC_TLS_IE_LD:
- case elfcpp::R_SPARC_TLS_IE_LDX:
- layout->set_has_static_tls();
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a GOT entry for the tp-relative offset.
- Output_data_got<size, big_endian>* got
- = target->got_section(symtab, layout);
- got->add_global_with_rela(gsym, GOT_TYPE_TLS_OFFSET,
- target->rela_dyn_section(layout),
- (size == 64 ?
- elfcpp::R_SPARC_TLS_TPOFF64 :
- elfcpp::R_SPARC_TLS_TPOFF32));
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_global(object, r_type, gsym);
- break;
- }
- }
- break;
-
- // These are relocations which should only be seen by the
- // dynamic linker, and should never be seen here.
- case elfcpp::R_SPARC_COPY:
- case elfcpp::R_SPARC_GLOB_DAT:
- case elfcpp::R_SPARC_JMP_SLOT:
- case elfcpp::R_SPARC_RELATIVE:
- case elfcpp::R_SPARC_TLS_DTPMOD64:
- case elfcpp::R_SPARC_TLS_DTPMOD32:
- case elfcpp::R_SPARC_TLS_DTPOFF64:
- case elfcpp::R_SPARC_TLS_DTPOFF32:
- case elfcpp::R_SPARC_TLS_TPOFF64:
- case elfcpp::R_SPARC_TLS_TPOFF32:
- gold_error(_("%s: unexpected reloc %u in object file"),
- object->name().c_str(), r_type);
- break;
-
- default:
- unsupported_reloc_global(object, r_type, gsym);
- break;
- }
-}
-
-// Scan relocations for a section.
-
-template<int size, bool big_endian>
-void
-Target_sparc<size, big_endian>::scan_relocs(
- const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols)
-{
- typedef Target_sparc<size, big_endian> Sparc;
- typedef typename Target_sparc<size, big_endian>::Scan Scan;
-
- if (sh_type == elfcpp::SHT_REL)
- {
- gold_error(_("%s: unsupported REL reloc section"),
- object->name().c_str());
- return;
- }
-
- gold::scan_relocs<size, big_endian, Sparc, elfcpp::SHT_RELA, Scan>(
- options,
- symtab,
- layout,
- this,
- object,
- data_shndx,
- prelocs,
- reloc_count,
- output_section,
- needs_special_offset_handling,
- local_symbol_count,
- plocal_symbols);
-}
-
-// Finalize the sections.
-
-template<int size, bool big_endian>
-void
-Target_sparc<size, big_endian>::do_finalize_sections(Layout* layout)
-{
- // Fill in some more dynamic tags.
- Output_data_dynamic* const odyn = layout->dynamic_data();
- if (odyn != NULL)
- {
- if (this->plt_ != NULL)
- {
- const Output_data* od = this->plt_->rel_plt();
- odyn->add_section_size(elfcpp::DT_PLTRELSZ, od);
- odyn->add_section_address(elfcpp::DT_JMPREL, od);
- odyn->add_constant(elfcpp::DT_PLTREL, elfcpp::DT_RELA);
-
- odyn->add_section_address(elfcpp::DT_PLTGOT, this->plt_);
- }
-
- if (this->rela_dyn_ != NULL)
- {
- const Output_data* od = this->rela_dyn_;
- odyn->add_section_address(elfcpp::DT_RELA, od);
- odyn->add_section_size(elfcpp::DT_RELASZ, od);
- odyn->add_constant(elfcpp::DT_RELAENT,
- elfcpp::Elf_sizes<size>::rela_size);
- }
-
- if (!parameters->options().shared())
- {
- // The value of the DT_DEBUG tag is filled in by the dynamic
- // linker at run time, and used by the debugger.
- odyn->add_constant(elfcpp::DT_DEBUG, 0);
- }
- }
-
- // Emit any relocs we saved in an attempt to avoid generating COPY
- // relocs.
- if (this->copy_relocs_.any_saved_relocs())
- this->copy_relocs_.emit(this->rela_dyn_section(layout));
-}
-
-// Perform a relocation.
-
-template<int size, bool big_endian>
-inline bool
-Target_sparc<size, big_endian>::Relocate::relocate(
- const Relocate_info<size, big_endian>* relinfo,
- Target_sparc* target,
- size_t relnum,
- const elfcpp::Rela<size, big_endian>& rela,
- unsigned int r_type,
- const Sized_symbol<size>* gsym,
- const Symbol_value<size>* psymval,
- unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr address,
- section_size_type view_size)
-{
- r_type &= 0xff;
-
- if (this->ignore_gd_add_)
- {
- if (r_type != elfcpp::R_SPARC_TLS_GD_ADD)
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("missing expected TLS relocation"));
- else
- {
- this->ignore_gd_add_ = false;
- return false;
- }
- }
-
- typedef Sparc_relocate_functions<size, big_endian> Reloc;
-
- // Pick the value to use for symbols defined in shared objects.
- Symbol_value<size> symval;
- if (gsym != NULL
- && gsym->use_plt_offset(r_type == elfcpp::R_SPARC_DISP8
- || r_type == elfcpp::R_SPARC_DISP16
- || r_type == elfcpp::R_SPARC_DISP32
- || r_type == elfcpp::R_SPARC_DISP64
- || r_type == elfcpp::R_SPARC_PC_HH22
- || r_type == elfcpp::R_SPARC_PC_HM10
- || r_type == elfcpp::R_SPARC_PC_LM22
- || r_type == elfcpp::R_SPARC_PC10
- || r_type == elfcpp::R_SPARC_PC22
- || r_type == elfcpp::R_SPARC_WDISP30
- || r_type == elfcpp::R_SPARC_WDISP22
- || r_type == elfcpp::R_SPARC_WDISP19
- || r_type == elfcpp::R_SPARC_WDISP16))
- {
- elfcpp::Elf_Xword value;
-
- value = target->plt_section()->address() + gsym->plt_offset();
-
- symval.set_output_value(value);
-
- psymval = &symval;
- }
-
- const Sized_relobj<size, big_endian>* object = relinfo->object;
- const elfcpp::Elf_Xword addend = rela.get_r_addend();
-
- // Get the GOT offset if needed. Unlike i386 and x86_64, our GOT
- // pointer points to the beginning, not the end, of the table.
- // So we just use the plain offset.
- bool have_got_offset = false;
- unsigned int got_offset = 0;
- switch (r_type)
- {
- case elfcpp::R_SPARC_GOT10:
- case elfcpp::R_SPARC_GOT13:
- case elfcpp::R_SPARC_GOT22:
- if (gsym != NULL)
- {
- gold_assert(gsym->has_got_offset(GOT_TYPE_STANDARD));
- got_offset = gsym->got_offset(GOT_TYPE_STANDARD);
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info());
- gold_assert(object->local_has_got_offset(r_sym, GOT_TYPE_STANDARD));
- got_offset = object->local_got_offset(r_sym, GOT_TYPE_STANDARD);
- }
- have_got_offset = true;
- break;
-
- default:
- break;
- }
-
- switch (r_type)
- {
- case elfcpp::R_SPARC_NONE:
- case elfcpp::R_SPARC_REGISTER:
- case elfcpp::R_SPARC_GNU_VTINHERIT:
- case elfcpp::R_SPARC_GNU_VTENTRY:
- break;
-
- case elfcpp::R_SPARC_8:
- Relocate_functions<size, big_endian>::rela8(view, object,
- psymval, addend);
- break;
-
- case elfcpp::R_SPARC_16:
- Relocate_functions<size, big_endian>::rela16(view, object,
- psymval, addend);
- break;
-
- case elfcpp::R_SPARC_32:
- if (!parameters->options().output_is_position_independent())
- Relocate_functions<size, big_endian>::rela32(view, object,
- psymval, addend);
- break;
-
- case elfcpp::R_SPARC_DISP8:
- Reloc::disp8(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_DISP16:
- Reloc::disp16(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_DISP32:
- Reloc::disp32(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_DISP64:
- Reloc::disp64(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_WDISP30:
- case elfcpp::R_SPARC_WPLT30:
- Reloc::wdisp30(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_WDISP22:
- Reloc::wdisp22(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_WDISP19:
- Reloc::wdisp19(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_WDISP16:
- Reloc::wdisp16(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_HI22:
- Reloc::hi22(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_22:
- Reloc::rela32_22(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_13:
- Reloc::rela32_13(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_LO10:
- Reloc::lo10(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_GOT10:
- Reloc::lo10(view, got_offset, addend);
- break;
-
- case elfcpp::R_SPARC_GOT13:
- Reloc::rela32_13(view, got_offset, addend);
- break;
-
- case elfcpp::R_SPARC_GOT22:
- Reloc::hi22(view, got_offset, addend);
- break;
-
- case elfcpp::R_SPARC_PC10:
- Reloc::pc10(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_PC22:
- Reloc::pc22(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_TLS_DTPOFF32:
- case elfcpp::R_SPARC_UA32:
- Reloc::ua32(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_PLT64:
- Relocate_functions<size, big_endian>::rela64(view, object,
- psymval, addend);
- break;
-
- case elfcpp::R_SPARC_PLT32:
- Relocate_functions<size, big_endian>::rela32(view, object,
- psymval, addend);
- break;
-
- case elfcpp::R_SPARC_HIPLT22:
- Reloc::hi22(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_LOPLT10:
- Reloc::lo10(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_PCPLT32:
- Reloc::disp32(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_PCPLT22:
- Reloc::pcplt22(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_PCPLT10:
- Reloc::lo10(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_64:
- if (!parameters->options().output_is_position_independent())
- Relocate_functions<size, big_endian>::rela64(view, object,
- psymval, addend);
- break;
-
- case elfcpp::R_SPARC_OLO10:
- {
- unsigned int addend2 = rela.get_r_info() & 0xffffffff;
- addend2 = ((addend2 >> 8) ^ 0x800000) - 0x800000;
- Reloc::olo10(view, object, psymval, addend, addend2);
- }
- break;
-
- case elfcpp::R_SPARC_HH22:
- Reloc::hh22(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_PC_HH22:
- Reloc::pc_hh22(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_HM10:
- Reloc::hm10(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_PC_HM10:
- Reloc::pc_hm10(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_LM22:
- Reloc::hi22(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_PC_LM22:
- Reloc::pcplt22(view, object, psymval, addend, address);
- break;
-
- case elfcpp::R_SPARC_11:
- Reloc::rela32_11(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_10:
- Reloc::rela32_10(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_7:
- Reloc::rela32_7(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_6:
- Reloc::rela32_6(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_5:
- Reloc::rela32_5(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_HIX22:
- Reloc::hix22(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_LOX10:
- Reloc::lox10(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_H44:
- Reloc::h44(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_M44:
- Reloc::m44(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_L44:
- Reloc::l44(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_TLS_DTPOFF64:
- case elfcpp::R_SPARC_UA64:
- Reloc::ua64(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_UA16:
- Reloc::ua16(view, object, psymval, addend);
- break;
-
- case elfcpp::R_SPARC_TLS_GD_HI22:
- case elfcpp::R_SPARC_TLS_GD_LO10:
- case elfcpp::R_SPARC_TLS_GD_ADD:
- case elfcpp::R_SPARC_TLS_GD_CALL:
- case elfcpp::R_SPARC_TLS_LDM_HI22:
- case elfcpp::R_SPARC_TLS_LDM_LO10:
- case elfcpp::R_SPARC_TLS_LDM_ADD:
- case elfcpp::R_SPARC_TLS_LDM_CALL:
- case elfcpp::R_SPARC_TLS_LDO_HIX22:
- case elfcpp::R_SPARC_TLS_LDO_LOX10:
- case elfcpp::R_SPARC_TLS_LDO_ADD:
- case elfcpp::R_SPARC_TLS_IE_HI22:
- case elfcpp::R_SPARC_TLS_IE_LO10:
- case elfcpp::R_SPARC_TLS_IE_LD:
- case elfcpp::R_SPARC_TLS_IE_LDX:
- case elfcpp::R_SPARC_TLS_LE_HIX22:
- case elfcpp::R_SPARC_TLS_LE_LOX10:
- this->relocate_tls(relinfo, target, relnum, rela,
- r_type, gsym, psymval, view,
- address, view_size);
- break;
-
- case elfcpp::R_SPARC_COPY:
- case elfcpp::R_SPARC_GLOB_DAT:
- case elfcpp::R_SPARC_JMP_SLOT:
- case elfcpp::R_SPARC_RELATIVE:
- // These are outstanding tls relocs, which are unexpected when
- // linking.
- case elfcpp::R_SPARC_TLS_DTPMOD64:
- case elfcpp::R_SPARC_TLS_DTPMOD32:
- case elfcpp::R_SPARC_TLS_TPOFF64:
- case elfcpp::R_SPARC_TLS_TPOFF32:
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unexpected reloc %u in object file"),
- r_type);
- break;
-
- default:
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unsupported reloc %u"),
- r_type);
- break;
- }
-
- return true;
-}
-
-// Perform a TLS relocation.
-
-template<int size, bool big_endian>
-inline void
-Target_sparc<size, big_endian>::Relocate::relocate_tls(
- const Relocate_info<size, big_endian>* relinfo,
- Target_sparc<size, big_endian>* target,
- size_t relnum,
- const elfcpp::Rela<size, big_endian>& rela,
- unsigned int r_type,
- const Sized_symbol<size>* gsym,
- const Symbol_value<size>* psymval,
- unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr address,
- section_size_type)
-{
- Output_segment* tls_segment = relinfo->layout->tls_segment();
- typedef Sparc_relocate_functions<size, big_endian> Reloc;
- const Sized_relobj<size, big_endian>* object = relinfo->object;
- typedef typename elfcpp::Swap<32, true>::Valtype Insntype;
-
- const elfcpp::Elf_Xword addend = rela.get_r_addend();
- typename elfcpp::Elf_types<size>::Elf_Addr value = psymval->value(object, 0);
-
- const bool is_final =
- (gsym == NULL
- ? !parameters->options().output_is_position_independent()
- : gsym->final_value_is_known());
- const tls::Tls_optimization optimized_type
- = optimize_tls_reloc(is_final, r_type);
-
- switch (r_type)
- {
- case elfcpp::R_SPARC_TLS_GD_HI22:
- case elfcpp::R_SPARC_TLS_GD_LO10:
- case elfcpp::R_SPARC_TLS_GD_ADD:
- case elfcpp::R_SPARC_TLS_GD_CALL:
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- Insntype* wv = reinterpret_cast<Insntype*>(view);
- Insntype val;
-
- value -= tls_segment->memsz();
-
- switch (r_type)
- {
- case elfcpp::R_SPARC_TLS_GD_HI22:
- // TLS_GD_HI22 --> TLS_LE_HIX22
- Reloc::hix22(view, value, addend);
- break;
-
- case elfcpp::R_SPARC_TLS_GD_LO10:
- // TLS_GD_LO10 --> TLS_LE_LOX10
- Reloc::lox10(view, value, addend);
- break;
-
- case elfcpp::R_SPARC_TLS_GD_ADD:
- // add %reg1, %reg2, %reg3 --> mov %g7, %reg2, %reg3
- val = elfcpp::Swap<32, true>::readval(wv);
- val = (val & ~0x7c000) | 0x1c000;
- elfcpp::Swap<32, true>::writeval(wv, val);
- break;
- case elfcpp::R_SPARC_TLS_GD_CALL:
- // call __tls_get_addr --> nop
- elfcpp::Swap<32, true>::writeval(wv, sparc_nop);
- break;
- }
- break;
- }
- else
- {
- unsigned int got_type = (optimized_type == tls::TLSOPT_TO_IE
- ? GOT_TYPE_TLS_OFFSET
- : GOT_TYPE_TLS_PAIR);
- if (gsym != NULL)
- {
- gold_assert(gsym->has_got_offset(got_type));
- value = gsym->got_offset(got_type);
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info());
- gold_assert(object->local_has_got_offset(r_sym, got_type));
- value = object->local_got_offset(r_sym, got_type);
- }
- if (optimized_type == tls::TLSOPT_TO_IE)
- {
- Insntype* wv = reinterpret_cast<Insntype*>(view);
- Insntype val;
-
- switch (r_type)
- {
- case elfcpp::R_SPARC_TLS_GD_HI22:
- // TLS_GD_HI22 --> TLS_IE_HI22
- Reloc::hi22(view, value, addend);
- break;
-
- case elfcpp::R_SPARC_TLS_GD_LO10:
- // TLS_GD_LO10 --> TLS_IE_LO10
- Reloc::lo10(view, value, addend);
- break;
-
- case elfcpp::R_SPARC_TLS_GD_ADD:
- // add %reg1, %reg2, %reg3 --> ld [%reg1 + %reg2], %reg3
- val = elfcpp::Swap<32, true>::readval(wv);
-
- if (size == 64)
- val |= 0xc0580000;
- else
- val |= 0xc0000000;
-
- elfcpp::Swap<32, true>::writeval(wv, val);
- break;
-
- case elfcpp::R_SPARC_TLS_GD_CALL:
- // The compiler can put the TLS_GD_ADD instruction
- // into the delay slot of the call. If so, we need
- // to transpose the two instructions so that the
- // the new sequence works properly.
- //
- // The test we use is if the instruction in the
- // delay slot is an add with destination register
- // equal to %o0
- val = elfcpp::Swap<32, true>::readval(wv + 1);
- if ((val & 0x81f80000) == 0x80000000
- && ((val >> 25) & 0x1f) == 0x8)
- {
- if (size == 64)
- val |= 0xc0580000;
- else
- val |= 0xc0000000;
-
- elfcpp::Swap<32, true>::writeval(wv, val);
-
- wv += 1;
- this->ignore_gd_add_ = true;
- }
-
- // call __tls_get_addr --> add %g7, %o0, %o0
- elfcpp::Swap<32, true>::writeval(wv, 0x9001c008);
- break;
- }
- break;
- }
- else if (optimized_type == tls::TLSOPT_NONE)
- {
- switch (r_type)
- {
- case elfcpp::R_SPARC_TLS_GD_HI22:
- Reloc::hi22(view, value, addend);
- break;
- case elfcpp::R_SPARC_TLS_GD_LO10:
- Reloc::lo10(view, value, addend);
- break;
- case elfcpp::R_SPARC_TLS_GD_ADD:
- break;
- case elfcpp::R_SPARC_TLS_GD_CALL:
- {
- Symbol_value<size> symval;
- elfcpp::Elf_Xword value;
- Symbol* tsym;
-
- tsym = target->tls_get_addr_sym_;
- gold_assert(tsym);
- value = (target->plt_section()->address() +
- tsym->plt_offset());
- symval.set_output_value(value);
- Reloc::wdisp30(view, object, &symval, addend, address);
- }
- break;
- }
- break;
- }
- }
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unsupported reloc %u"),
- r_type);
- break;
-
- case elfcpp::R_SPARC_TLS_LDM_HI22:
- case elfcpp::R_SPARC_TLS_LDM_LO10:
- case elfcpp::R_SPARC_TLS_LDM_ADD:
- case elfcpp::R_SPARC_TLS_LDM_CALL:
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- Insntype* wv = reinterpret_cast<Insntype*>(view);
-
- switch (r_type)
- {
- case elfcpp::R_SPARC_TLS_LDM_HI22:
- case elfcpp::R_SPARC_TLS_LDM_LO10:
- case elfcpp::R_SPARC_TLS_LDM_ADD:
- elfcpp::Swap<32, true>::writeval(wv, sparc_nop);
- break;
-
- case elfcpp::R_SPARC_TLS_LDM_CALL:
- elfcpp::Swap<32, true>::writeval(wv, sparc_mov_g0_o0);
- break;
- }
- break;
- }
- else if (optimized_type == tls::TLSOPT_NONE)
- {
- // Relocate the field with the offset of the GOT entry for
- // the module index.
- unsigned int got_offset;
-
- got_offset = target->got_mod_index_entry(NULL, NULL, NULL);
- switch (r_type)
- {
- case elfcpp::R_SPARC_TLS_LDM_HI22:
- Reloc::hi22(view, got_offset, addend);
- break;
- case elfcpp::R_SPARC_TLS_LDM_LO10:
- Reloc::lo10(view, got_offset, addend);
- break;
- case elfcpp::R_SPARC_TLS_LDM_ADD:
- break;
- case elfcpp::R_SPARC_TLS_LDM_CALL:
- {
- Symbol_value<size> symval;
- elfcpp::Elf_Xword value;
- Symbol* tsym;
-
- tsym = target->tls_get_addr_sym_;
- gold_assert(tsym);
- value = (target->plt_section()->address() +
- tsym->plt_offset());
- symval.set_output_value(value);
- Reloc::wdisp30(view, object, &symval, addend, address);
- }
- break;
- }
- break;
- }
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unsupported reloc %u"),
- r_type);
- break;
-
- // These relocs can appear in debugging sections, in which case
- // we won't see the TLS_LDM relocs. The local_dynamic_type
- // field tells us this.
- case elfcpp::R_SPARC_TLS_LDO_HIX22:
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- value -= tls_segment->memsz();
- Reloc::hix22(view, value, addend);
- }
- else
- Reloc::ldo_hix22(view, value, addend);
- break;
- case elfcpp::R_SPARC_TLS_LDO_LOX10:
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- value -= tls_segment->memsz();
- Reloc::lox10(view, value, addend);
- }
- else
- Reloc::ldo_lox10(view, value, addend);
- break;
- case elfcpp::R_SPARC_TLS_LDO_ADD:
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- Insntype* wv = reinterpret_cast<Insntype*>(view);
- Insntype val;
-
- // add %reg1, %reg2, %reg3 --> add %g7, %reg2, %reg3
- val = elfcpp::Swap<32, true>::readval(wv);
- val = (val & ~0x7c000) | 0x1c000;
- elfcpp::Swap<32, true>::writeval(wv, val);
- }
- break;
-
- // When optimizing IE --> LE, the only relocation that is handled
- // differently is R_SPARC_TLS_IE_LD, it is rewritten from
- // 'ld{,x} [rs1 + rs2], rd' into 'mov rs2, rd' or simply a NOP is
- // rs2 and rd are the same.
- case elfcpp::R_SPARC_TLS_IE_LD:
- case elfcpp::R_SPARC_TLS_IE_LDX:
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- Insntype* wv = reinterpret_cast<Insntype*>(view);
- Insntype val = elfcpp::Swap<32, true>::readval(wv);
- Insntype rs2 = val & 0x1f;
- Insntype rd = (val >> 25) & 0x1f;
-
- if (rs2 == rd)
- val = sparc_nop;
- else
- val = sparc_mov | (val & 0x3e00001f);
-
- elfcpp::Swap<32, true>::writeval(wv, val);
- }
- break;
-
- case elfcpp::R_SPARC_TLS_IE_HI22:
- case elfcpp::R_SPARC_TLS_IE_LO10:
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- value -= tls_segment->memsz();
- switch (r_type)
- {
- case elfcpp::R_SPARC_TLS_IE_HI22:
- // IE_HI22 --> LE_HIX22
- Reloc::hix22(view, value, addend);
- break;
- case elfcpp::R_SPARC_TLS_IE_LO10:
- // IE_LO10 --> LE_LOX10
- Reloc::lox10(view, value, addend);
- break;
- }
- break;
- }
- else if (optimized_type == tls::TLSOPT_NONE)
- {
- // Relocate the field with the offset of the GOT entry for
- // the tp-relative offset of the symbol.
- if (gsym != NULL)
- {
- gold_assert(gsym->has_got_offset(GOT_TYPE_TLS_OFFSET));
- value = gsym->got_offset(GOT_TYPE_TLS_OFFSET);
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info());
- gold_assert(object->local_has_got_offset(r_sym,
- GOT_TYPE_TLS_OFFSET));
- value = object->local_got_offset(r_sym,
- GOT_TYPE_TLS_OFFSET);
- }
- switch (r_type)
- {
- case elfcpp::R_SPARC_TLS_IE_HI22:
- Reloc::hi22(view, value, addend);
- break;
- case elfcpp::R_SPARC_TLS_IE_LO10:
- Reloc::lo10(view, value, addend);
- break;
- }
- break;
- }
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unsupported reloc %u"),
- r_type);
- break;
-
- case elfcpp::R_SPARC_TLS_LE_HIX22:
- // If we're creating a shared library, a dynamic relocation will
- // have been created for this location, so do not apply it now.
- if (!parameters->options().shared())
- {
- value -= tls_segment->memsz();
- Reloc::hix22(view, value, addend);
- }
- break;
-
- case elfcpp::R_SPARC_TLS_LE_LOX10:
- // If we're creating a shared library, a dynamic relocation will
- // have been created for this location, so do not apply it now.
- if (!parameters->options().shared())
- {
- value -= tls_segment->memsz();
- Reloc::lox10(view, value, addend);
- }
- break;
- }
-}
-
-// Relocate section data.
-
-template<int size, bool big_endian>
-void
-Target_sparc<size, big_endian>::relocate_section(
- const Relocate_info<size, big_endian>* relinfo,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr address,
- section_size_type view_size)
-{
- typedef Target_sparc<size, big_endian> Sparc;
- typedef typename Target_sparc<size, big_endian>::Relocate Sparc_relocate;
-
- gold_assert(sh_type == elfcpp::SHT_RELA);
-
- gold::relocate_section<size, big_endian, Sparc, elfcpp::SHT_RELA,
- Sparc_relocate>(
- relinfo,
- this,
- prelocs,
- reloc_count,
- output_section,
- needs_special_offset_handling,
- view,
- address,
- view_size);
-}
-
-// Return the size of a relocation while scanning during a relocatable
-// link.
-
-template<int size, bool big_endian>
-unsigned int
-Target_sparc<size, big_endian>::Relocatable_size_for_reloc::get_size_for_reloc(
- unsigned int,
- Relobj*)
-{
- // We are always SHT_RELA, so we should never get here.
- gold_unreachable();
- return 0;
-}
-
-// Scan the relocs during a relocatable link.
-
-template<int size, bool big_endian>
-void
-Target_sparc<size, big_endian>::scan_relocatable_relocs(
- const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols,
- Relocatable_relocs* rr)
-{
- gold_assert(sh_type == elfcpp::SHT_RELA);
-
- typedef gold::Default_scan_relocatable_relocs<elfcpp::SHT_RELA,
- Relocatable_size_for_reloc> Scan_relocatable_relocs;
-
- gold::scan_relocatable_relocs<size, big_endian, elfcpp::SHT_RELA,
- Scan_relocatable_relocs>(
- options,
- symtab,
- layout,
- object,
- data_shndx,
- prelocs,
- reloc_count,
- output_section,
- needs_special_offset_handling,
- local_symbol_count,
- plocal_symbols,
- rr);
-}
-
-// Relocate a section during a relocatable link.
-
-template<int size, bool big_endian>
-void
-Target_sparc<size, big_endian>::relocate_for_relocatable(
- const Relocate_info<size, big_endian>* relinfo,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- off_t offset_in_output_section,
- const Relocatable_relocs* rr,
- unsigned char* view,
- typename elfcpp::Elf_types<size>::Elf_Addr view_address,
- section_size_type view_size,
- unsigned char* reloc_view,
- section_size_type reloc_view_size)
-{
- gold_assert(sh_type == elfcpp::SHT_RELA);
-
- gold::relocate_for_relocatable<size, big_endian, elfcpp::SHT_RELA>(
- relinfo,
- prelocs,
- reloc_count,
- output_section,
- offset_in_output_section,
- rr,
- view,
- view_address,
- view_size,
- reloc_view,
- reloc_view_size);
-}
-
-// Return the value to use for a dynamic which requires special
-// treatment. This is how we support equality comparisons of function
-// pointers across shared library boundaries, as described in the
-// processor specific ABI supplement.
-
-template<int size, bool big_endian>
-uint64_t
-Target_sparc<size, big_endian>::do_dynsym_value(const Symbol* gsym) const
-{
- gold_assert(gsym->is_from_dynobj() && gsym->has_plt_offset());
- return this->plt_section()->address() + gsym->plt_offset();
-}
-
-// The selector for sparc object files.
-
-template<int size, bool big_endian>
-class Target_selector_sparc : public Target_selector
-{
-public:
- Target_selector_sparc()
- : Target_selector(elfcpp::EM_NONE, size, big_endian,
- (size == 64 ? "elf64-sparc" : "elf32-sparc"))
- { }
-
- Target* instantiated_target_;
-
- Target* do_recognize(int machine, int, int)
- {
- switch (size)
- {
- case 64:
- if (machine != elfcpp::EM_SPARCV9)
- return NULL;
- break;
-
- case 32:
- if (machine != elfcpp::EM_SPARC
- && machine != elfcpp::EM_SPARC32PLUS)
- return NULL;
- break;
-
- default:
- return NULL;
- }
-
- return do_instantiate_target();
- }
-
- Target* do_instantiate_target()
- {
- if (this->instantiated_target_ == NULL)
- this->instantiated_target_ = new Target_sparc<size, big_endian>();
- return this->instantiated_target_;
- }
-};
-
-Target_selector_sparc<32, true> target_selector_sparc32;
-Target_selector_sparc<64, true> target_selector_sparc64;
-
-} // End anonymous namespace.
diff --git a/gold/symtab.h b/gold/symtab.h
deleted file mode 100644
index 043fb50f228..00000000000
--- a/gold/symtab.h
+++ /dev/null
@@ -1,1603 +0,0 @@
-// symtab.h -- the gold symbol table -*- C++ -*-
-
-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
-// Written by Ian Lance Taylor <iant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-// Symbol_table
-// The symbol table.
-
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "elfcpp.h"
-#include "parameters.h"
-#include "stringpool.h"
-#include "object.h"
-
-#ifndef GOLD_SYMTAB_H
-#define GOLD_SYMTAB_H
-
-namespace gold
-{
-
-class Mapfile;
-class Object;
-class Relobj;
-template<int size, bool big_endian>
-class Sized_relobj;
-class Dynobj;
-template<int size, bool big_endian>
-class Sized_dynobj;
-class Versions;
-class Version_script_info;
-class Input_objects;
-class Output_data;
-class Output_section;
-class Output_segment;
-class Output_file;
-class Output_symtab_xindex;
-
-// The base class of an entry in the symbol table. The symbol table
-// can have a lot of entries, so we don't want this class to big.
-// Size dependent fields can be found in the template class
-// Sized_symbol. Targets may support their own derived classes.
-
-class Symbol
-{
- public:
- // Because we want the class to be small, we don't use any virtual
- // functions. But because symbols can be defined in different
- // places, we need to classify them. This enum is the different
- // sources of symbols we support.
- enum Source
- {
- // Symbol defined in a relocatable or dynamic input file--this is
- // the most common case.
- FROM_OBJECT,
- // Symbol defined in an Output_data, a special section created by
- // the target.
- IN_OUTPUT_DATA,
- // Symbol defined in an Output_segment, with no associated
- // section.
- IN_OUTPUT_SEGMENT,
- // Symbol value is constant.
- IS_CONSTANT,
- // Symbol is undefined.
- IS_UNDEFINED
- };
-
- // When the source is IN_OUTPUT_SEGMENT, we need to describe what
- // the offset means.
- enum Segment_offset_base
- {
- // From the start of the segment.
- SEGMENT_START,
- // From the end of the segment.
- SEGMENT_END,
- // From the filesz of the segment--i.e., after the loaded bytes
- // but before the bytes which are allocated but zeroed.
- SEGMENT_BSS
- };
-
- // Return the symbol name.
- const char*
- name() const
- { return this->name_; }
-
- // Return the (ANSI) demangled version of the name, if
- // parameters.demangle() is true. Otherwise, return the name. This
- // is intended to be used only for logging errors, so it's not
- // super-efficient.
- std::string
- demangled_name() const;
-
- // Return the symbol version. This will return NULL for an
- // unversioned symbol.
- const char*
- version() const
- { return this->version_; }
-
- // Return whether this version is the default for this symbol name
- // (eg, "foo@@V2" is a default version; "foo@V1" is not). Only
- // meaningful for versioned symbols.
- bool
- is_default() const
- {
- gold_assert(this->version_ != NULL);
- return this->is_def_;
- }
-
- // Set that this version is the default for this symbol name.
- void
- set_is_default()
- { this->is_def_ = true; }
-
- // Return the symbol source.
- Source
- source() const
- { return this->source_; }
-
- // Return the object with which this symbol is associated.
- Object*
- object() const
- {
- gold_assert(this->source_ == FROM_OBJECT);
- return this->u_.from_object.object;
- }
-
- // Return the index of the section in the input relocatable or
- // dynamic object file.
- unsigned int
- shndx(bool* is_ordinary) const
- {
- gold_assert(this->source_ == FROM_OBJECT);
- *is_ordinary = this->is_ordinary_shndx_;
- return this->u_.from_object.shndx;
- }
-
- // Return the output data section with which this symbol is
- // associated, if the symbol was specially defined with respect to
- // an output data section.
- Output_data*
- output_data() const
- {
- gold_assert(this->source_ == IN_OUTPUT_DATA);
- return this->u_.in_output_data.output_data;
- }
-
- // If this symbol was defined with respect to an output data
- // section, return whether the value is an offset from end.
- bool
- offset_is_from_end() const
- {
- gold_assert(this->source_ == IN_OUTPUT_DATA);
- return this->u_.in_output_data.offset_is_from_end;
- }
-
- // Return the output segment with which this symbol is associated,
- // if the symbol was specially defined with respect to an output
- // segment.
- Output_segment*
- output_segment() const
- {
- gold_assert(this->source_ == IN_OUTPUT_SEGMENT);
- return this->u_.in_output_segment.output_segment;
- }
-
- // If this symbol was defined with respect to an output segment,
- // return the offset base.
- Segment_offset_base
- offset_base() const
- {
- gold_assert(this->source_ == IN_OUTPUT_SEGMENT);
- return this->u_.in_output_segment.offset_base;
- }
-
- // Return the symbol binding.
- elfcpp::STB
- binding() const
- { return this->binding_; }
-
- // Return the symbol type.
- elfcpp::STT
- type() const
- { return this->type_; }
-
- // Return the symbol visibility.
- elfcpp::STV
- visibility() const
- { return this->visibility_; }
-
- // Return the non-visibility part of the st_other field.
- unsigned char
- nonvis() const
- { return this->nonvis_; }
-
- // Return whether this symbol is a forwarder. This will never be
- // true of a symbol found in the hash table, but may be true of
- // symbol pointers attached to object files.
- bool
- is_forwarder() const
- { return this->is_forwarder_; }
-
- // Mark this symbol as a forwarder.
- void
- set_forwarder()
- { this->is_forwarder_ = true; }
-
- // Return whether this symbol has an alias in the weak aliases table
- // in Symbol_table.
- bool
- has_alias() const
- { return this->has_alias_; }
-
- // Mark this symbol as having an alias.
- void
- set_has_alias()
- { this->has_alias_ = true; }
-
- // Return whether this symbol needs an entry in the dynamic symbol
- // table.
- bool
- needs_dynsym_entry() const
- {
- return (this->needs_dynsym_entry_
- || (this->in_reg() && this->in_dyn()));
- }
-
- // Mark this symbol as needing an entry in the dynamic symbol table.
- void
- set_needs_dynsym_entry()
- { this->needs_dynsym_entry_ = true; }
-
- // Return whether this symbol should be added to the dynamic symbol
- // table.
- bool
- should_add_dynsym_entry() const;
-
- // Return whether this symbol has been seen in a regular object.
- bool
- in_reg() const
- { return this->in_reg_; }
-
- // Mark this symbol as having been seen in a regular object.
- void
- set_in_reg()
- { this->in_reg_ = true; }
-
- // Return whether this symbol has been seen in a dynamic object.
- bool
- in_dyn() const
- { return this->in_dyn_; }
-
- // Mark this symbol as having been seen in a dynamic object.
- void
- set_in_dyn()
- { this->in_dyn_ = true; }
-
- // Return the index of this symbol in the output file symbol table.
- // A value of -1U means that this symbol is not going into the
- // output file. This starts out as zero, and is set to a non-zero
- // value by Symbol_table::finalize. It is an error to ask for the
- // symbol table index before it has been set.
- unsigned int
- symtab_index() const
- {
- gold_assert(this->symtab_index_ != 0);
- return this->symtab_index_;
- }
-
- // Set the index of the symbol in the output file symbol table.
- void
- set_symtab_index(unsigned int index)
- {
- gold_assert(index != 0);
- this->symtab_index_ = index;
- }
-
- // Return whether this symbol already has an index in the output
- // file symbol table.
- bool
- has_symtab_index() const
- { return this->symtab_index_ != 0; }
-
- // Return the index of this symbol in the dynamic symbol table. A
- // value of -1U means that this symbol is not going into the dynamic
- // symbol table. This starts out as zero, and is set to a non-zero
- // during Layout::finalize. It is an error to ask for the dynamic
- // symbol table index before it has been set.
- unsigned int
- dynsym_index() const
- {
- gold_assert(this->dynsym_index_ != 0);
- return this->dynsym_index_;
- }
-
- // Set the index of the symbol in the dynamic symbol table.
- void
- set_dynsym_index(unsigned int index)
- {
- gold_assert(index != 0);
- this->dynsym_index_ = index;
- }
-
- // Return whether this symbol already has an index in the dynamic
- // symbol table.
- bool
- has_dynsym_index() const
- { return this->dynsym_index_ != 0; }
-
- // Return whether this symbol has an entry in the GOT section.
- // For a TLS symbol, this GOT entry will hold its tp-relative offset.
- bool
- has_got_offset(unsigned int got_type) const
- { return this->got_offsets_.get_offset(got_type) != -1U; }
-
- // Return the offset into the GOT section of this symbol.
- unsigned int
- got_offset(unsigned int got_type) const
- {
- unsigned int got_offset = this->got_offsets_.get_offset(got_type);
- gold_assert(got_offset != -1U);
- return got_offset;
- }
-
- // Set the GOT offset of this symbol.
- void
- set_got_offset(unsigned int got_type, unsigned int got_offset)
- { this->got_offsets_.set_offset(got_type, got_offset); }
-
- // Return whether this symbol has an entry in the PLT section.
- bool
- has_plt_offset() const
- { return this->has_plt_offset_; }
-
- // Return the offset into the PLT section of this symbol.
- unsigned int
- plt_offset() const
- {
- gold_assert(this->has_plt_offset());
- return this->plt_offset_;
- }
-
- // Set the PLT offset of this symbol.
- void
- set_plt_offset(unsigned int plt_offset)
- {
- this->has_plt_offset_ = true;
- this->plt_offset_ = plt_offset;
- }
-
- // Return whether this dynamic symbol needs a special value in the
- // dynamic symbol table.
- bool
- needs_dynsym_value() const
- { return this->needs_dynsym_value_; }
-
- // Set that this dynamic symbol needs a special value in the dynamic
- // symbol table.
- void
- set_needs_dynsym_value()
- {
- gold_assert(this->object()->is_dynamic());
- this->needs_dynsym_value_ = true;
- }
-
- // Return true if the final value of this symbol is known at link
- // time.
- bool
- final_value_is_known() const;
-
- // Return whether this is a defined symbol (not undefined or
- // common).
- bool
- is_defined() const
- {
- bool is_ordinary;
- if (this->source_ != FROM_OBJECT)
- return this->source_ != IS_UNDEFINED;
- unsigned int shndx = this->shndx(&is_ordinary);
- return (is_ordinary
- ? shndx != elfcpp::SHN_UNDEF
- : shndx != elfcpp::SHN_COMMON);
- }
-
- // Return true if this symbol is from a dynamic object.
- bool
- is_from_dynobj() const
- {
- return this->source_ == FROM_OBJECT && this->object()->is_dynamic();
- }
-
- // Return whether this is an undefined symbol.
- bool
- is_undefined() const
- {
- bool is_ordinary;
- return ((this->source_ == FROM_OBJECT
- && this->shndx(&is_ordinary) == elfcpp::SHN_UNDEF
- && is_ordinary)
- || this->source_ == IS_UNDEFINED);
- }
-
- // Return whether this is a weak undefined symbol.
- bool
- is_weak_undefined() const
- { return this->is_undefined() && this->binding() == elfcpp::STB_WEAK; }
-
- // Return whether this is an absolute symbol.
- bool
- is_absolute() const
- {
- bool is_ordinary;
- return ((this->source_ == FROM_OBJECT
- && this->shndx(&is_ordinary) == elfcpp::SHN_ABS
- && !is_ordinary)
- || this->source_ == IS_CONSTANT);
- }
-
- // Return whether this is a common symbol.
- bool
- is_common() const
- {
- bool is_ordinary;
- return (this->source_ == FROM_OBJECT
- && ((this->shndx(&is_ordinary) == elfcpp::SHN_COMMON
- && !is_ordinary)
- || this->type_ == elfcpp::STT_COMMON));
- }
-
- // Return whether this symbol can be seen outside this object.
- bool
- is_externally_visible() const
- {
- return (this->visibility_ == elfcpp::STV_DEFAULT
- || this->visibility_ == elfcpp::STV_PROTECTED);
- }
-
- // Return true if this symbol can be preempted by a definition in
- // another link unit.
- bool
- is_preemptible() const
- {
- // It doesn't make sense to ask whether a symbol defined in
- // another object is preemptible.
- gold_assert(!this->is_from_dynobj());
-
- // It doesn't make sense to ask whether an undefined symbol
- // is preemptible.
- gold_assert(!this->is_undefined());
-
- // If a symbol does not have default visibility, it can not be
- // seen outside this link unit and therefore is not preemptible.
- if (this->visibility_ != elfcpp::STV_DEFAULT)
- return false;
-
- // If this symbol has been forced to be a local symbol by a
- // version script, then it is not visible outside this link unit
- // and is not preemptible.
- if (this->is_forced_local_)
- return false;
-
- // If we are not producing a shared library, then nothing is
- // preemptible.
- if (!parameters->options().shared())
- return false;
-
- // If the user used -Bsymbolic, then nothing is preemptible.
- if (parameters->options().Bsymbolic())
- return false;
-
- // If the user used -Bsymbolic-functions, then functions are not
- // preemptible. We explicitly check for not being STT_OBJECT,
- // rather than for being STT_FUNC, because that is what the GNU
- // linker does.
- if (this->type() != elfcpp::STT_OBJECT
- && parameters->options().Bsymbolic_functions())
- return false;
-
- // Otherwise the symbol is preemptible.
- return true;
- }
-
- // Return true if this symbol is a function that needs a PLT entry.
- // If the symbol is defined in a dynamic object or if it is subject
- // to pre-emption, we need to make a PLT entry. If we're doing a
- // static link, we don't create PLT entries.
- bool
- needs_plt_entry() const
- {
- return (!parameters->doing_static_link()
- && this->type() == elfcpp::STT_FUNC
- && (this->is_from_dynobj()
- || this->is_undefined()
- || this->is_preemptible()));
- }
-
- // When determining whether a reference to a symbol needs a dynamic
- // relocation, we need to know several things about the reference.
- // These flags may be or'ed together.
- enum Reference_flags
- {
- // Reference to the symbol's absolute address.
- ABSOLUTE_REF = 1,
- // A non-PIC reference.
- NON_PIC_REF = 2,
- // A function call.
- FUNCTION_CALL = 4
- };
-
- // Given a direct absolute or pc-relative static relocation against
- // the global symbol, this function returns whether a dynamic relocation
- // is needed.
-
- bool
- needs_dynamic_reloc(int flags) const
- {
- // No dynamic relocations in a static link!
- if (parameters->doing_static_link())
- return false;
-
- // A reference to a weak undefined symbol from an executable should be
- // statically resolved to 0, and does not need a dynamic relocation.
- // This matches gnu ld behavior.
- if (this->is_weak_undefined() && !parameters->options().shared())
- return false;
-
- // A reference to an absolute symbol does not need a dynamic relocation.
- if (this->is_absolute())
- return false;
-
- // An absolute reference within a position-independent output file
- // will need a dynamic relocation.
- if ((flags & ABSOLUTE_REF)
- && parameters->options().output_is_position_independent())
- return true;
-
- // A function call that can branch to a local PLT entry does not need
- // a dynamic relocation. A non-pic pc-relative function call in a
- // shared library cannot use a PLT entry.
- if ((flags & FUNCTION_CALL)
- && this->has_plt_offset()
- && !((flags & NON_PIC_REF) && parameters->options().shared()))
- return false;
-
- // A reference to any PLT entry in a non-position-independent executable
- // does not need a dynamic relocation.
- if (!parameters->options().output_is_position_independent()
- && this->has_plt_offset())
- return false;
-
- // A reference to a symbol defined in a dynamic object or to a
- // symbol that is preemptible will need a dynamic relocation.
- if (this->is_from_dynobj()
- || this->is_undefined()
- || this->is_preemptible())
- return true;
-
- // For all other cases, return FALSE.
- return false;
- }
-
- // Whether we should use the PLT offset associated with a symbol for
- // a relocation. IS_NON_PIC_REFERENCE is true if this is a non-PIC
- // reloc--the same set of relocs for which we would pass NON_PIC_REF
- // to the needs_dynamic_reloc function.
-
- bool
- use_plt_offset(bool is_non_pic_reference) const
- {
- // If the symbol doesn't have a PLT offset, then naturally we
- // don't want to use it.
- if (!this->has_plt_offset())
- return false;
-
- // If we are going to generate a dynamic relocation, then we will
- // wind up using that, so no need to use the PLT entry.
- if (this->needs_dynamic_reloc(FUNCTION_CALL
- | (is_non_pic_reference
- ? NON_PIC_REF
- : 0)))
- return false;
-
- // If the symbol is from a dynamic object, we need to use the PLT
- // entry.
- if (this->is_from_dynobj())
- return true;
-
- // If we are generating a shared object, and this symbol is
- // undefined or preemptible, we need to use the PLT entry.
- if (parameters->options().shared()
- && (this->is_undefined() || this->is_preemptible()))
- return true;
-
- // If this is a weak undefined symbol, we need to use the PLT
- // entry; the symbol may be defined by a library loaded at
- // runtime.
- if (this->is_weak_undefined())
- return true;
-
- // Otherwise we can use the regular definition.
- return false;
- }
-
- // Given a direct absolute static relocation against
- // the global symbol, where a dynamic relocation is needed, this
- // function returns whether a relative dynamic relocation can be used.
- // The caller must determine separately whether the static relocation
- // is compatible with a relative relocation.
-
- bool
- can_use_relative_reloc(bool is_function_call) const
- {
- // A function call that can branch to a local PLT entry can
- // use a RELATIVE relocation.
- if (is_function_call && this->has_plt_offset())
- return true;
-
- // A reference to a symbol defined in a dynamic object or to a
- // symbol that is preemptible can not use a RELATIVE relocaiton.
- if (this->is_from_dynobj()
- || this->is_undefined()
- || this->is_preemptible())
- return false;
-
- // For all other cases, return TRUE.
- return true;
- }
-
- // Return the output section where this symbol is defined. Return
- // NULL if the symbol has an absolute value.
- Output_section*
- output_section() const;
-
- // Set the symbol's output section. This is used for symbols
- // defined in scripts. This should only be called after the symbol
- // table has been finalized.
- void
- set_output_section(Output_section*);
-
- // Return whether there should be a warning for references to this
- // symbol.
- bool
- has_warning() const
- { return this->has_warning_; }
-
- // Mark this symbol as having a warning.
- void
- set_has_warning()
- { this->has_warning_ = true; }
-
- // Return whether this symbol is defined by a COPY reloc from a
- // dynamic object.
- bool
- is_copied_from_dynobj() const
- { return this->is_copied_from_dynobj_; }
-
- // Mark this symbol as defined by a COPY reloc.
- void
- set_is_copied_from_dynobj()
- { this->is_copied_from_dynobj_ = true; }
-
- // Return whether this symbol is forced to visibility STB_LOCAL
- // by a "local:" entry in a version script.
- bool
- is_forced_local() const
- { return this->is_forced_local_; }
-
- // Mark this symbol as forced to STB_LOCAL visibility.
- void
- set_is_forced_local()
- { this->is_forced_local_ = true; }
-
- protected:
- // Instances of this class should always be created at a specific
- // size.
- Symbol()
- { memset(this, 0, sizeof *this); }
-
- // Initialize the general fields.
- void
- init_fields(const char* name, const char* version,
- elfcpp::STT type, elfcpp::STB binding,
- elfcpp::STV visibility, unsigned char nonvis);
-
- // Initialize fields from an ELF symbol in OBJECT. ST_SHNDX is the
- // section index, IS_ORDINARY is whether it is a normal section
- // index rather than a special code.
- template<int size, bool big_endian>
- void
- init_base_object(const char *name, const char* version, Object* object,
- const elfcpp::Sym<size, big_endian>&, unsigned int st_shndx,
- bool is_ordinary);
-
- // Initialize fields for an Output_data.
- void
- init_base_output_data(const char* name, const char* version, Output_data*,
- elfcpp::STT, elfcpp::STB, elfcpp::STV,
- unsigned char nonvis, bool offset_is_from_end);
-
- // Initialize fields for an Output_segment.
- void
- init_base_output_segment(const char* name, const char* version,
- Output_segment* os, elfcpp::STT type,
- elfcpp::STB binding, elfcpp::STV visibility,
- unsigned char nonvis,
- Segment_offset_base offset_base);
-
- // Initialize fields for a constant.
- void
- init_base_constant(const char* name, const char* version, elfcpp::STT type,
- elfcpp::STB binding, elfcpp::STV visibility,
- unsigned char nonvis);
-
- // Initialize fields for an undefined symbol.
- void
- init_base_undefined(const char* name, const char* version, elfcpp::STT type,
- elfcpp::STB binding, elfcpp::STV visibility,
- unsigned char nonvis);
-
- // Override existing symbol.
- template<int size, bool big_endian>
- void
- override_base(const elfcpp::Sym<size, big_endian>&, unsigned int st_shndx,
- bool is_ordinary, Object* object, const char* version);
-
- // Override existing symbol with a special symbol.
- void
- override_base_with_special(const Symbol* from);
-
- // Override symbol version.
- void
- override_version(const char* version);
-
- // Allocate a common symbol by giving it a location in the output
- // file.
- void
- allocate_base_common(Output_data*);
-
- private:
- Symbol(const Symbol&);
- Symbol& operator=(const Symbol&);
-
- // Symbol name (expected to point into a Stringpool).
- const char* name_;
- // Symbol version (expected to point into a Stringpool). This may
- // be NULL.
- const char* version_;
-
- union
- {
- // This struct is used if SOURCE_ == FROM_OBJECT.
- struct
- {
- // Object in which symbol is defined, or in which it was first
- // seen.
- Object* object;
- // Section number in object_ in which symbol is defined.
- unsigned int shndx;
- } from_object;
-
- // This struct is used if SOURCE_ == IN_OUTPUT_DATA.
- struct
- {
- // Output_data in which symbol is defined. Before
- // Layout::finalize the symbol's value is an offset within the
- // Output_data.
- Output_data* output_data;
- // True if the offset is from the end, false if the offset is
- // from the beginning.
- bool offset_is_from_end;
- } in_output_data;
-
- // This struct is used if SOURCE_ == IN_OUTPUT_SEGMENT.
- struct
- {
- // Output_segment in which the symbol is defined. Before
- // Layout::finalize the symbol's value is an offset.
- Output_segment* output_segment;
- // The base to use for the offset before Layout::finalize.
- Segment_offset_base offset_base;
- } in_output_segment;
- } u_;
-
- // The index of this symbol in the output file. If the symbol is
- // not going into the output file, this value is -1U. This field
- // starts as always holding zero. It is set to a non-zero value by
- // Symbol_table::finalize.
- unsigned int symtab_index_;
-
- // The index of this symbol in the dynamic symbol table. If the
- // symbol is not going into the dynamic symbol table, this value is
- // -1U. This field starts as always holding zero. It is set to a
- // non-zero value during Layout::finalize.
- unsigned int dynsym_index_;
-
- // If this symbol has an entry in the GOT section (has_got_offset_
- // is true), this holds the offset from the start of the GOT section.
- // A symbol may have more than one GOT offset (e.g., when mixing
- // modules compiled with two different TLS models), but will usually
- // have at most one.
- Got_offset_list got_offsets_;
-
- // If this symbol has an entry in the PLT section (has_plt_offset_
- // is true), then this is the offset from the start of the PLT
- // section.
- unsigned int plt_offset_;
-
- // Symbol type (bits 0 to 3).
- elfcpp::STT type_ : 4;
- // Symbol binding (bits 4 to 7).
- elfcpp::STB binding_ : 4;
- // Symbol visibility (bits 8 to 9).
- elfcpp::STV visibility_ : 2;
- // Rest of symbol st_other field (bits 10 to 15).
- unsigned int nonvis_ : 6;
- // The type of symbol (bits 16 to 18).
- Source source_ : 3;
- // True if this symbol always requires special target-specific
- // handling (bit 19).
- bool is_target_special_ : 1;
- // True if this is the default version of the symbol (bit 20).
- bool is_def_ : 1;
- // True if this symbol really forwards to another symbol. This is
- // used when we discover after the fact that two different entries
- // in the hash table really refer to the same symbol. This will
- // never be set for a symbol found in the hash table, but may be set
- // for a symbol found in the list of symbols attached to an Object.
- // It forwards to the symbol found in the forwarders_ map of
- // Symbol_table (bit 21).
- bool is_forwarder_ : 1;
- // True if the symbol has an alias in the weak_aliases table in
- // Symbol_table (bit 22).
- bool has_alias_ : 1;
- // True if this symbol needs to be in the dynamic symbol table (bit
- // 23).
- bool needs_dynsym_entry_ : 1;
- // True if we've seen this symbol in a regular object (bit 24).
- bool in_reg_ : 1;
- // True if we've seen this symbol in a dynamic object (bit 25).
- bool in_dyn_ : 1;
- // True if the symbol has an entry in the PLT section (bit 26).
- bool has_plt_offset_ : 1;
- // True if this is a dynamic symbol which needs a special value in
- // the dynamic symbol table (bit 27).
- bool needs_dynsym_value_ : 1;
- // True if there is a warning for this symbol (bit 28).
- bool has_warning_ : 1;
- // True if we are using a COPY reloc for this symbol, so that the
- // real definition lives in a dynamic object (bit 29).
- bool is_copied_from_dynobj_ : 1;
- // True if this symbol was forced to local visibility by a version
- // script (bit 30).
- bool is_forced_local_ : 1;
- // True if the field u_.from_object.shndx is an ordinary section
- // index, not one of the special codes from SHN_LORESERVE to
- // SHN_HIRESERVE.
- bool is_ordinary_shndx_ : 1;
-};
-
-// The parts of a symbol which are size specific. Using a template
-// derived class like this helps us use less space on a 32-bit system.
-
-template<int size>
-class Sized_symbol : public Symbol
-{
- public:
- typedef typename elfcpp::Elf_types<size>::Elf_Addr Value_type;
- typedef typename elfcpp::Elf_types<size>::Elf_WXword Size_type;
-
- Sized_symbol()
- { }
-
- // Initialize fields from an ELF symbol in OBJECT. ST_SHNDX is the
- // section index, IS_ORDINARY is whether it is a normal section
- // index rather than a special code.
- template<bool big_endian>
- void
- init_object(const char *name, const char* version, Object* object,
- const elfcpp::Sym<size, big_endian>&, unsigned int st_shndx,
- bool is_ordinary);
-
- // Initialize fields for an Output_data.
- void
- init_output_data(const char* name, const char* version, Output_data*,
- Value_type value, Size_type symsize, elfcpp::STT,
- elfcpp::STB, elfcpp::STV, unsigned char nonvis,
- bool offset_is_from_end);
-
- // Initialize fields for an Output_segment.
- void
- init_output_segment(const char* name, const char* version, Output_segment*,
- Value_type value, Size_type symsize, elfcpp::STT,
- elfcpp::STB, elfcpp::STV, unsigned char nonvis,
- Segment_offset_base offset_base);
-
- // Initialize fields for a constant.
- void
- init_constant(const char* name, const char* version, Value_type value,
- Size_type symsize, elfcpp::STT, elfcpp::STB, elfcpp::STV,
- unsigned char nonvis);
-
- // Initialize fields for an undefined symbol.
- void
- init_undefined(const char* name, const char* version, elfcpp::STT,
- elfcpp::STB, elfcpp::STV, unsigned char nonvis);
-
- // Override existing symbol.
- template<bool big_endian>
- void
- override(const elfcpp::Sym<size, big_endian>&, unsigned int st_shndx,
- bool is_ordinary, Object* object, const char* version);
-
- // Override existing symbol with a special symbol.
- void
- override_with_special(const Sized_symbol<size>*);
-
- // Return the symbol's value.
- Value_type
- value() const
- { return this->value_; }
-
- // Return the symbol's size (we can't call this 'size' because that
- // is a template parameter).
- Size_type
- symsize() const
- { return this->symsize_; }
-
- // Set the symbol size. This is used when resolving common symbols.
- void
- set_symsize(Size_type symsize)
- { this->symsize_ = symsize; }
-
- // Set the symbol value. This is called when we store the final
- // values of the symbols into the symbol table.
- void
- set_value(Value_type value)
- { this->value_ = value; }
-
- // Allocate a common symbol by giving it a location in the output
- // file.
- void
- allocate_common(Output_data*, Value_type value);
-
- private:
- Sized_symbol(const Sized_symbol&);
- Sized_symbol& operator=(const Sized_symbol&);
-
- // Symbol value. Before Layout::finalize this is the offset in the
- // input section. This is set to the final value during
- // Layout::finalize.
- Value_type value_;
- // Symbol size.
- Size_type symsize_;
-};
-
-// A struct describing a symbol defined by the linker, where the value
-// of the symbol is defined based on an output section. This is used
-// for symbols defined by the linker, like "_init_array_start".
-
-struct Define_symbol_in_section
-{
- // The symbol name.
- const char* name;
- // The name of the output section with which this symbol should be
- // associated. If there is no output section with that name, the
- // symbol will be defined as zero.
- const char* output_section;
- // The offset of the symbol within the output section. This is an
- // offset from the start of the output section, unless start_at_end
- // is true, in which case this is an offset from the end of the
- // output section.
- uint64_t value;
- // The size of the symbol.
- uint64_t size;
- // The symbol type.
- elfcpp::STT type;
- // The symbol binding.
- elfcpp::STB binding;
- // The symbol visibility.
- elfcpp::STV visibility;
- // The rest of the st_other field.
- unsigned char nonvis;
- // If true, the value field is an offset from the end of the output
- // section.
- bool offset_is_from_end;
- // If true, this symbol is defined only if we see a reference to it.
- bool only_if_ref;
-};
-
-// A struct describing a symbol defined by the linker, where the value
-// of the symbol is defined based on a segment. This is used for
-// symbols defined by the linker, like "_end". We describe the
-// segment with which the symbol should be associated by its
-// characteristics. If no segment meets these characteristics, the
-// symbol will be defined as zero. If there is more than one segment
-// which meets these characteristics, we will use the first one.
-
-struct Define_symbol_in_segment
-{
- // The symbol name.
- const char* name;
- // The segment type where the symbol should be defined, typically
- // PT_LOAD.
- elfcpp::PT segment_type;
- // Bitmask of segment flags which must be set.
- elfcpp::PF segment_flags_set;
- // Bitmask of segment flags which must be clear.
- elfcpp::PF segment_flags_clear;
- // The offset of the symbol within the segment. The offset is
- // calculated from the position set by offset_base.
- uint64_t value;
- // The size of the symbol.
- uint64_t size;
- // The symbol type.
- elfcpp::STT type;
- // The symbol binding.
- elfcpp::STB binding;
- // The symbol visibility.
- elfcpp::STV visibility;
- // The rest of the st_other field.
- unsigned char nonvis;
- // The base from which we compute the offset.
- Symbol::Segment_offset_base offset_base;
- // If true, this symbol is defined only if we see a reference to it.
- bool only_if_ref;
-};
-
-// This class manages warnings. Warnings are a GNU extension. When
-// we see a section named .gnu.warning.SYM in an object file, and if
-// we wind using the definition of SYM from that object file, then we
-// will issue a warning for any relocation against SYM from a
-// different object file. The text of the warning is the contents of
-// the section. This is not precisely the definition used by the old
-// GNU linker; the old GNU linker treated an occurrence of
-// .gnu.warning.SYM as defining a warning symbol. A warning symbol
-// would trigger a warning on any reference. However, it was
-// inconsistent in that a warning in a dynamic object only triggered
-// if there was no definition in a regular object. This linker is
-// different in that we only issue a warning if we use the symbol
-// definition from the same object file as the warning section.
-
-class Warnings
-{
- public:
- Warnings()
- : warnings_()
- { }
-
- // Add a warning for symbol NAME in object OBJ. WARNING is the text
- // of the warning.
- void
- add_warning(Symbol_table* symtab, const char* name, Object* obj,
- const std::string& warning);
-
- // For each symbol for which we should give a warning, make a note
- // on the symbol.
- void
- note_warnings(Symbol_table* symtab);
-
- // Issue a warning for a reference to SYM at RELINFO's location.
- template<int size, bool big_endian>
- void
- issue_warning(const Symbol* sym, const Relocate_info<size, big_endian>*,
- size_t relnum, off_t reloffset) const;
-
- private:
- Warnings(const Warnings&);
- Warnings& operator=(const Warnings&);
-
- // What we need to know to get the warning text.
- struct Warning_location
- {
- // The object the warning is in.
- Object* object;
- // The warning text.
- std::string text;
-
- Warning_location()
- : object(NULL), text()
- { }
-
- void
- set(Object* o, const std::string& t)
- {
- this->object = o;
- this->text = t;
- }
- };
-
- // A mapping from warning symbol names (canonicalized in
- // Symbol_table's namepool_ field) to warning information.
- typedef Unordered_map<const char*, Warning_location> Warning_table;
-
- Warning_table warnings_;
-};
-
-// The main linker symbol table.
-
-class Symbol_table
-{
- public:
- // COUNT is an estimate of how many symbosl will be inserted in the
- // symbol table. It's ok to put 0 if you don't know; a correct
- // guess will just save some CPU by reducing hashtable resizes.
- Symbol_table(unsigned int count, const Version_script_info& version_script);
-
- ~Symbol_table();
-
- // Add COUNT external symbols from the relocatable object RELOBJ to
- // the symbol table. SYMS is the symbols, SYMNDX_OFFSET is the
- // offset in the symbol table of the first symbol, SYM_NAMES is
- // their names, SYM_NAME_SIZE is the size of SYM_NAMES. This sets
- // SYMPOINTERS to point to the symbols in the symbol table. It sets
- // *DEFINED to the number of defined symbols.
- template<int size, bool big_endian>
- void
- add_from_relobj(Sized_relobj<size, big_endian>* relobj,
- const unsigned char* syms, size_t count,
- size_t symndx_offset, const char* sym_names,
- size_t sym_name_size,
- typename Sized_relobj<size, big_endian>::Symbols*,
- size_t* defined);
-
- // Add COUNT dynamic symbols from the dynamic object DYNOBJ to the
- // symbol table. SYMS is the symbols. SYM_NAMES is their names.
- // SYM_NAME_SIZE is the size of SYM_NAMES. The other parameters are
- // symbol version data.
- template<int size, bool big_endian>
- void
- add_from_dynobj(Sized_dynobj<size, big_endian>* dynobj,
- const unsigned char* syms, size_t count,
- const char* sym_names, size_t sym_name_size,
- const unsigned char* versym, size_t versym_size,
- const std::vector<const char*>*,
- typename Sized_relobj<size, big_endian>::Symbols*,
- size_t* defined);
-
- // Define a special symbol based on an Output_data. It is a
- // multiple definition error if this symbol is already defined.
- Symbol*
- define_in_output_data(const char* name, const char* version,
- Output_data*, uint64_t value, uint64_t symsize,
- elfcpp::STT type, elfcpp::STB binding,
- elfcpp::STV visibility, unsigned char nonvis,
- bool offset_is_from_end, bool only_if_ref);
-
- // Define a special symbol based on an Output_segment. It is a
- // multiple definition error if this symbol is already defined.
- Symbol*
- define_in_output_segment(const char* name, const char* version,
- Output_segment*, uint64_t value, uint64_t symsize,
- elfcpp::STT type, elfcpp::STB binding,
- elfcpp::STV visibility, unsigned char nonvis,
- Symbol::Segment_offset_base, bool only_if_ref);
-
- // Define a special symbol with a constant value. It is a multiple
- // definition error if this symbol is already defined.
- Symbol*
- define_as_constant(const char* name, const char* version,
- uint64_t value, uint64_t symsize, elfcpp::STT type,
- elfcpp::STB binding, elfcpp::STV visibility,
- unsigned char nonvis, bool only_if_ref,
- bool force_override);
-
- // Define a set of symbols in output sections. If ONLY_IF_REF is
- // true, only define them if they are referenced.
- void
- define_symbols(const Layout*, int count, const Define_symbol_in_section*,
- bool only_if_ref);
-
- // Define a set of symbols in output segments. If ONLY_IF_REF is
- // true, only defined them if they are referenced.
- void
- define_symbols(const Layout*, int count, const Define_symbol_in_segment*,
- bool only_if_ref);
-
- // Define SYM using a COPY reloc. POSD is the Output_data where the
- // symbol should be defined--typically a .dyn.bss section. VALUE is
- // the offset within POSD.
- template<int size>
- void
- define_with_copy_reloc(Sized_symbol<size>* sym, Output_data* posd,
- typename elfcpp::Elf_types<size>::Elf_Addr);
-
- // Look up a symbol.
- Symbol*
- lookup(const char*, const char* version = NULL) const;
-
- // Return the real symbol associated with the forwarder symbol FROM.
- Symbol*
- resolve_forwards(const Symbol* from) const;
-
- // Return the sized version of a symbol in this table.
- template<int size>
- Sized_symbol<size>*
- get_sized_symbol(Symbol*) const;
-
- template<int size>
- const Sized_symbol<size>*
- get_sized_symbol(const Symbol*) const;
-
- // Return the count of undefined symbols seen.
- int
- saw_undefined() const
- { return this->saw_undefined_; }
-
- // Allocate the common symbols
- void
- allocate_commons(Layout*, Mapfile*);
-
- // Add a warning for symbol NAME in object OBJ. WARNING is the text
- // of the warning.
- void
- add_warning(const char* name, Object* obj, const std::string& warning)
- { this->warnings_.add_warning(this, name, obj, warning); }
-
- // Canonicalize a symbol name for use in the hash table.
- const char*
- canonicalize_name(const char* name)
- { return this->namepool_.add(name, true, NULL); }
-
- // Possibly issue a warning for a reference to SYM at LOCATION which
- // is in OBJ.
- template<int size, bool big_endian>
- void
- issue_warning(const Symbol* sym,
- const Relocate_info<size, big_endian>* relinfo,
- size_t relnum, off_t reloffset) const
- { this->warnings_.issue_warning(sym, relinfo, relnum, reloffset); }
-
- // Check candidate_odr_violations_ to find symbols with the same name
- // but apparently different definitions (different source-file/line-no).
- void
- detect_odr_violations(const Task*, const char* output_file_name) const;
-
- // Add any undefined symbols named on the command line to the symbol
- // table.
- void
- add_undefined_symbols_from_command_line();
-
- // SYM is defined using a COPY reloc. Return the dynamic object
- // where the original definition was found.
- Dynobj*
- get_copy_source(const Symbol* sym) const;
-
- // Set the dynamic symbol indexes. INDEX is the index of the first
- // global dynamic symbol. Pointers to the symbols are stored into
- // the vector. The names are stored into the Stringpool. This
- // returns an updated dynamic symbol index.
- unsigned int
- set_dynsym_indexes(unsigned int index, std::vector<Symbol*>*,
- Stringpool*, Versions*);
-
- // Finalize the symbol table after we have set the final addresses
- // of all the input sections. This sets the final symbol indexes,
- // values and adds the names to *POOL. *PLOCAL_SYMCOUNT is the
- // index of the first global symbol. OFF is the file offset of the
- // global symbol table, DYNOFF is the offset of the globals in the
- // dynamic symbol table, DYN_GLOBAL_INDEX is the index of the first
- // global dynamic symbol, and DYNCOUNT is the number of global
- // dynamic symbols. This records the parameters, and returns the
- // new file offset. It updates *PLOCAL_SYMCOUNT if it created any
- // local symbols.
- off_t
- finalize(off_t off, off_t dynoff, size_t dyn_global_index, size_t dyncount,
- Stringpool* pool, unsigned int *plocal_symcount);
-
- // Write out the global symbols.
- void
- write_globals(const Input_objects*, const Stringpool*, const Stringpool*,
- Output_symtab_xindex*, Output_symtab_xindex*,
- Output_file*) const;
-
- // Write out a section symbol. Return the updated offset.
- void
- write_section_symbol(const Output_section*, Output_symtab_xindex*,
- Output_file*, off_t) const;
-
- // Dump statistical information to stderr.
- void
- print_stats() const;
-
- // Return the version script information.
- const Version_script_info&
- version_script() const
- { return version_script_; }
-
- private:
- Symbol_table(const Symbol_table&);
- Symbol_table& operator=(const Symbol_table&);
-
- // The type of the list of common symbols.
- typedef std::vector<Symbol*> Commons_type;
-
- // Make FROM a forwarder symbol to TO.
- void
- make_forwarder(Symbol* from, Symbol* to);
-
- // Add a symbol.
- template<int size, bool big_endian>
- Sized_symbol<size>*
- add_from_object(Object*, const char *name, Stringpool::Key name_key,
- const char *version, Stringpool::Key version_key,
- bool def, const elfcpp::Sym<size, big_endian>& sym,
- unsigned int st_shndx, bool is_ordinary,
- unsigned int orig_st_shndx);
-
- // Resolve symbols.
- template<int size, bool big_endian>
- void
- resolve(Sized_symbol<size>* to,
- const elfcpp::Sym<size, big_endian>& sym,
- unsigned int st_shndx, bool is_ordinary,
- unsigned int orig_st_shndx,
- Object*, const char* version);
-
- template<int size, bool big_endian>
- void
- resolve(Sized_symbol<size>* to, const Sized_symbol<size>* from);
-
- // Record that a symbol is forced to be local by a version script.
- void
- force_local(Symbol*);
-
- // Adjust NAME and *NAME_KEY for wrapping.
- const char*
- wrap_symbol(Object* object, const char*, Stringpool::Key* name_key);
-
- // Whether we should override a symbol, based on flags in
- // resolve.cc.
- static bool
- should_override(const Symbol*, unsigned int, Object*, bool*);
-
- // Override a symbol.
- template<int size, bool big_endian>
- void
- override(Sized_symbol<size>* tosym,
- const elfcpp::Sym<size, big_endian>& fromsym,
- unsigned int st_shndx, bool is_ordinary,
- Object* object, const char* version);
-
- // Whether we should override a symbol with a special symbol which
- // is automatically defined by the linker.
- static bool
- should_override_with_special(const Symbol*);
-
- // Override a symbol with a special symbol.
- template<int size>
- void
- override_with_special(Sized_symbol<size>* tosym,
- const Sized_symbol<size>* fromsym);
-
- // Record all weak alias sets for a dynamic object.
- template<int size>
- void
- record_weak_aliases(std::vector<Sized_symbol<size>*>*);
-
- // Define a special symbol.
- template<int size, bool big_endian>
- Sized_symbol<size>*
- define_special_symbol(const char** pname, const char** pversion,
- bool only_if_ref, Sized_symbol<size>** poldsym);
-
- // Define a symbol in an Output_data, sized version.
- template<int size>
- Sized_symbol<size>*
- do_define_in_output_data(const char* name, const char* version, Output_data*,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_WXword ssize,
- elfcpp::STT type, elfcpp::STB binding,
- elfcpp::STV visibility, unsigned char nonvis,
- bool offset_is_from_end, bool only_if_ref);
-
- // Define a symbol in an Output_segment, sized version.
- template<int size>
- Sized_symbol<size>*
- do_define_in_output_segment(
- const char* name, const char* version, Output_segment* os,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_WXword ssize,
- elfcpp::STT type, elfcpp::STB binding,
- elfcpp::STV visibility, unsigned char nonvis,
- Symbol::Segment_offset_base offset_base, bool only_if_ref);
-
- // Define a symbol as a constant, sized version.
- template<int size>
- Sized_symbol<size>*
- do_define_as_constant(
- const char* name, const char* version,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- typename elfcpp::Elf_types<size>::Elf_WXword ssize,
- elfcpp::STT type, elfcpp::STB binding,
- elfcpp::STV visibility, unsigned char nonvis,
- bool only_if_ref, bool force_override);
-
- // Add any undefined symbols named on the command line to the symbol
- // table, sized version.
- template<int size>
- void
- do_add_undefined_symbols_from_command_line();
-
- // Allocate the common symbols, sized version.
- template<int size>
- void
- do_allocate_commons(Layout*, Mapfile*);
-
- // Allocate the common symbols from one list.
- template<int size>
- void
- do_allocate_commons_list(Layout*, bool is_tls, Commons_type*, Mapfile*);
-
- // Implement detect_odr_violations.
- template<int size, bool big_endian>
- void
- sized_detect_odr_violations() const;
-
- // Finalize symbols specialized for size.
- template<int size>
- off_t
- sized_finalize(off_t, Stringpool*, unsigned int*);
-
- // Finalize a symbol. Return whether it should be added to the
- // symbol table.
- template<int size>
- bool
- sized_finalize_symbol(Symbol*);
-
- // Add a symbol the final symtab by setting its index.
- template<int size>
- void
- add_to_final_symtab(Symbol*, Stringpool*, unsigned int* pindex, off_t* poff);
-
- // Write globals specialized for size and endianness.
- template<int size, bool big_endian>
- void
- sized_write_globals(const Input_objects*, const Stringpool*,
- const Stringpool*, Output_symtab_xindex*,
- Output_symtab_xindex*, Output_file*) const;
-
- // Write out a symbol to P.
- template<int size, bool big_endian>
- void
- sized_write_symbol(Sized_symbol<size>*,
- typename elfcpp::Elf_types<size>::Elf_Addr value,
- unsigned int shndx,
- const Stringpool*, unsigned char* p) const;
-
- // Possibly warn about an undefined symbol from a dynamic object.
- void
- warn_about_undefined_dynobj_symbol(const Input_objects*, Symbol*) const;
-
- // Write out a section symbol, specialized for size and endianness.
- template<int size, bool big_endian>
- void
- sized_write_section_symbol(const Output_section*, Output_symtab_xindex*,
- Output_file*, off_t) const;
-
- // The type of the symbol hash table.
-
- typedef std::pair<Stringpool::Key, Stringpool::Key> Symbol_table_key;
-
- struct Symbol_table_hash
- {
- size_t
- operator()(const Symbol_table_key&) const;
- };
-
- struct Symbol_table_eq
- {
- bool
- operator()(const Symbol_table_key&, const Symbol_table_key&) const;
- };
-
- typedef Unordered_map<Symbol_table_key, Symbol*, Symbol_table_hash,
- Symbol_table_eq> Symbol_table_type;
-
- // The type of the list of symbols which have been forced local.
- typedef std::vector<Symbol*> Forced_locals;
-
- // A map from symbols with COPY relocs to the dynamic objects where
- // they are defined.
- typedef Unordered_map<const Symbol*, Dynobj*> Copied_symbol_dynobjs;
-
- // A map from symbol name (as a pointer into the namepool) to all
- // the locations the symbols is (weakly) defined (and certain other
- // conditions are met). This map will be used later to detect
- // possible One Definition Rule (ODR) violations.
- struct Symbol_location
- {
- Object* object; // Object where the symbol is defined.
- unsigned int shndx; // Section-in-object where the symbol is defined.
- off_t offset; // Offset-in-section where the symbol is defined.
- bool operator==(const Symbol_location& that) const
- {
- return (this->object == that.object
- && this->shndx == that.shndx
- && this->offset == that.offset);
- }
- };
-
- struct Symbol_location_hash
- {
- size_t operator()(const Symbol_location& loc) const
- { return reinterpret_cast<uintptr_t>(loc.object) ^ loc.offset ^ loc.shndx; }
- };
-
- typedef Unordered_map<const char*,
- Unordered_set<Symbol_location, Symbol_location_hash> >
- Odr_map;
-
- // We increment this every time we see a new undefined symbol, for
- // use in archive groups.
- int saw_undefined_;
- // The index of the first global symbol in the output file.
- unsigned int first_global_index_;
- // The file offset within the output symtab section where we should
- // write the table.
- off_t offset_;
- // The number of global symbols we want to write out.
- unsigned int output_count_;
- // The file offset of the global dynamic symbols, or 0 if none.
- off_t dynamic_offset_;
- // The index of the first global dynamic symbol.
- unsigned int first_dynamic_global_index_;
- // The number of global dynamic symbols, or 0 if none.
- unsigned int dynamic_count_;
- // The symbol hash table.
- Symbol_table_type table_;
- // A pool of symbol names. This is used for all global symbols.
- // Entries in the hash table point into this pool.
- Stringpool namepool_;
- // Forwarding symbols.
- Unordered_map<const Symbol*, Symbol*> forwarders_;
- // Weak aliases. A symbol in this list points to the next alias.
- // The aliases point to each other in a circular list.
- Unordered_map<Symbol*, Symbol*> weak_aliases_;
- // We don't expect there to be very many common symbols, so we keep
- // a list of them. When we find a common symbol we add it to this
- // list. It is possible that by the time we process the list the
- // symbol is no longer a common symbol. It may also have become a
- // forwarder.
- Commons_type commons_;
- // This is like the commons_ field, except that it holds TLS common
- // symbols.
- Commons_type tls_commons_;
- // A list of symbols which have been forced to be local. We don't
- // expect there to be very many of them, so we keep a list of them
- // rather than walking the whole table to find them.
- Forced_locals forced_locals_;
- // Manage symbol warnings.
- Warnings warnings_;
- // Manage potential One Definition Rule (ODR) violations.
- Odr_map candidate_odr_violations_;
-
- // When we emit a COPY reloc for a symbol, we define it in an
- // Output_data. When it's time to emit version information for it,
- // we need to know the dynamic object in which we found the original
- // definition. This maps symbols with COPY relocs to the dynamic
- // object where they were defined.
- Copied_symbol_dynobjs copied_symbol_dynobjs_;
- // Information parsed from the version script, if any.
- const Version_script_info& version_script_;
-};
-
-// We inline get_sized_symbol for efficiency.
-
-template<int size>
-Sized_symbol<size>*
-Symbol_table::get_sized_symbol(Symbol* sym) const
-{
- gold_assert(size == parameters->target().get_size());
- return static_cast<Sized_symbol<size>*>(sym);
-}
-
-template<int size>
-const Sized_symbol<size>*
-Symbol_table::get_sized_symbol(const Symbol* sym) const
-{
- gold_assert(size == parameters->target().get_size());
- return static_cast<const Sized_symbol<size>*>(sym);
-}
-
-} // End namespace gold.
-
-#endif // !defined(GOLD_SYMTAB_H)
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
deleted file mode 100644
index df986770a09..00000000000
--- a/gold/testsuite/Makefile.am
+++ /dev/null
@@ -1,893 +0,0 @@
-# Process this file with automake to generate Makefile.in
-
-# As far as I can tell automake testing support assumes that the build
-# system and the host system are the same. So these tests will not
-# work when building with a cross-compiler.
-
-AUTOMAKE_OPTIONS =
-
-# The two_file_test tests -fmerge-constants, so we simply always turn
-# it on. This may need to be controlled by a configure option
-# eventually.
-AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) -fmerge-constants
-
-INCLUDES = \
- -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \
- -I$(srcdir)/../../elfcpp -I.. \
- -DLOCALEDIR="\"$(datadir)/locale\"" \
- @INCINTL@
-
-TEST_READELF = $(top_builddir)/../binutils/readelf
-TEST_OBJDUMP = $(top_builddir)/../binutils/objdump
-TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt
-TEST_STRIP = $(top_builddir)/../binutils/strip-new
-
-if THREADS
-THREADSLIB = -lpthread
-endif
-
-if OMP_SUPPORT
-TLS_TEST_C_CFLAGS = -fopenmp
-endif
-
-# 'make clean' is good about deleting some intermediate files (such as
-# .o's), but not all of them (such as .so's and .err files). We
-# improve on that here. automake-1.9 info docs say "mostlyclean" is
-# the right choice for files 'make' builds that people rebuild.
-MOSTLYCLEANFILES = *.so
-
-
-# We will add to these later, for each individual test. Note
-# that we add each test under check_SCRIPTS or check_PROGRAMS;
-# the TESTS variable is automatically populated from these.
-check_SCRIPTS =
-check_DATA =
-check_PROGRAMS =
-BUILT_SOURCES =
-
-TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
-
-# ---------------------------------------------------------------------
-# These tests test the internals of gold (unittests).
-
-# Infrastucture needed for the unittests
-check_LIBRARIES = libgoldtest.a
-libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc
-
-DEPENDENCIES = \
- libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP)
-LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \
- $(THREADSLIB)
-
-
-# The unittests themselves
-check_PROGRAMS += object_unittest
-object_unittest_SOURCES = object_unittest.cc
-
-check_PROGRAMS += binary_unittest
-binary_unittest_SOURCES = binary_unittest.cc
-
-
-# ---------------------------------------------------------------------
-# These tests test the output of gold (end-to-end tests). In
-# particular, they make sure that gold can link "difficult" object
-# files, and the resulting object files run correctly. These can only
-# run if we've built ld-new for the native architecture (that is,
-# we're not cross-compiling it), since we run ld-new as part of these
-# tests. We use the gcc-specific flag '-B' to use our linker instead
-# of the default linker, which is why we only run our tests under gcc.
-
-if NATIVE_LINKER
-if GCC
-
-# Infrastucture needed for the unittests: a directory where the linker
-# is named 'ld'. This is because the -B flag appends 'ld' to its arg.
-gcctestdir/ld: ../ld-new
- test -d gcctestdir || mkdir -p gcctestdir
- rm -f gcctestdir/ld
- (cd gcctestdir && $(LN_S) ../../ld-new ld)
-
-# Each of these .o's is a useful, small complete program. They're
-# particularly useful for making sure ld-new's flags do what they're
-# supposed to (hence their names), but are used for many tests that
-# don't actually involve analyzing input data.
-flagstest_debug.o: constructor_test.cc
- $(CXXCOMPILE) -O0 -g -c -o $@ $<
-flagstest_ndebug.o: constructor_test.cc
- $(CXXCOMPILE) -O0 -c -o $@ $<
-
-
-check_PROGRAMS += basic_test
-check_PROGRAMS += basic_static_test
-check_PROGRAMS += basic_pic_test
-check_PROGRAMS += basic_static_pic_test
-basic_test.o: basic_test.cc
- $(CXXCOMPILE) -O0 -c -o $@ $<
-basic_test: basic_test.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ basic_test.o
-basic_static_test: basic_test.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -static basic_test.o
-
-basic_pic_test.o: basic_test.cc
- $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
-basic_pic_test: basic_pic_test.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ basic_pic_test.o
-basic_static_pic_test: basic_pic_test.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
-
-
-check_PROGRAMS += constructor_test
-check_PROGRAMS += constructor_static_test
-constructor_test_SOURCES = constructor_test.cc
-constructor_test_DEPENDENCIES = gcctestdir/ld
-constructor_test_LDFLAGS = -Bgcctestdir/
-
-constructor_static_test_SOURCES = $(constructor_test_SOURCES)
-constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES)
-constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static
-
-
-check_PROGRAMS += two_file_test
-check_PROGRAMS += two_file_static_test
-check_PROGRAMS += two_file_pic_test
-two_file_test_SOURCES = \
- two_file_test_1.cc \
- two_file_test_1b.cc \
- two_file_test_2.cc \
- two_file_test_main.cc \
- two_file_test.h
-two_file_test_DEPENDENCIES = gcctestdir/ld
-two_file_test_LDFLAGS = -Bgcctestdir/
-
-two_file_static_test_SOURCES = $(two_file_test_SOURCES)
-two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES)
-two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static
-
-two_file_pic_test_SOURCES = two_file_test_main.cc
-two_file_pic_test_DEPENDENCIES = \
- gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
-two_file_pic_test_LDFLAGS = -Bgcctestdir/
-two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
-
-
-check_PROGRAMS += two_file_shared_1_test
-check_PROGRAMS += two_file_shared_2_test
-check_PROGRAMS += two_file_shared_1_pic_2_test
-check_PROGRAMS += two_file_shared_2_pic_1_test
-check_PROGRAMS += two_file_same_shared_test
-check_PROGRAMS += two_file_separate_shared_12_test
-check_PROGRAMS += two_file_separate_shared_21_test
-two_file_test_1_pic.o: two_file_test_1.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-two_file_test_1b_pic.o: two_file_test_1b.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-two_file_test_2_pic.o: two_file_test_2.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o
-two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o
-two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
-
-two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc
-two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so
-two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_shared_1_test_LDADD = two_file_shared_1.so
-
-two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
-two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so
-two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_shared_2_test_LDADD = two_file_shared_2.so
-
-two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc
-two_file_shared_1_pic_2_test_DEPENDENCIES = \
- gcctestdir/ld two_file_shared_1.so two_file_test_1_pic.o two_file_test_1b_pic.o
-two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_shared_1_pic_2_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_shared_2.so
-
-two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc
-two_file_shared_2_pic_1_test_DEPENDENCIES = \
- gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o
-two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so
-
-two_file_same_shared_test_SOURCES = two_file_test_main.cc
-two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so
-two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_same_shared_test_LDADD = two_file_shared.so
-
-two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc
-two_file_separate_shared_12_test_DEPENDENCIES = \
- gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
-two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_separate_shared_12_test_LDADD = \
- two_file_shared_1.so two_file_shared_2.so
-
-two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc
-two_file_separate_shared_21_test_DEPENDENCIES = \
- gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
-two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_separate_shared_21_test_LDADD = \
- two_file_shared_2.so two_file_shared_1.so
-
-check_PROGRAMS += two_file_relocatable_test
-two_file_relocatable_test_SOURCES = two_file_test_main.cc
-two_file_relocatable_test_DEPENDENCIES = \
- gcctestdir/ld two_file_relocatable.o
-two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_relocatable_test_LDADD = two_file_relocatable.o
-two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o
- gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
-
-# The nonpic tests will fail on platforms which can not put non-PIC
-# code into shared libraries, so we just don't run them in that case.
-if FN_PTRS_IN_SO_WITHOUT_PIC
-
-check_PROGRAMS += two_file_shared_1_nonpic_test
-check_PROGRAMS += two_file_shared_2_nonpic_test
-check_PROGRAMS += two_file_same_shared_nonpic_test
-check_PROGRAMS += two_file_separate_shared_12_nonpic_test
-check_PROGRAMS += two_file_separate_shared_21_nonpic_test
-check_PROGRAMS += two_file_mixed_shared_test
-check_PROGRAMS += two_file_mixed_2_shared_test
-two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o
-two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o
-two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o
-two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o
-two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so
-
-two_file_shared_1_nonpic_test_SOURCES = \
- two_file_test_2.cc two_file_test_main.cc
-two_file_shared_1_nonpic_test_DEPENDENCIES = \
- gcctestdir/ld two_file_shared_1_nonpic.so
-two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so
-
-two_file_shared_2_nonpic_test_SOURCES = \
- two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
-two_file_shared_2_nonpic_test_DEPENDENCIES = \
- gcctestdir/ld two_file_shared_2_nonpic.so
-two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so
-
-two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc
-two_file_same_shared_nonpic_test_DEPENDENCIES = \
- gcctestdir/ld two_file_shared_nonpic.so
-two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so
-
-two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc
-two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \
- gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
-two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_separate_shared_12_nonpic_test_LDADD = \
- two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
-
-two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc
-two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \
- gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
-two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_separate_shared_21_nonpic_test_LDADD = \
- two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so
-
-two_file_mixed_shared_test_SOURCES = two_file_test_main.cc
-two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so
-two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so
-
-two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc
-two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so
-two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
-
-endif FN_PTRS_IN_SO_WITHOUT_PIC
-
-check_PROGRAMS += two_file_strip_test
-two_file_strip_test: two_file_test
- $(TEST_STRIP) -o two_file_strip_test two_file_test
-
-check_PROGRAMS += two_file_same_shared_strip_test
-two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc
-two_file_same_shared_strip_test_DEPENDENCIES = \
- gcctestdir/ld two_file_shared_strip.so
-two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R.
-two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so
-two_file_shared_strip.so: two_file_shared.so
- $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so
-
-check_PROGRAMS += common_test_1
-common_test_1_SOURCES = common_test_1.c
-common_test_1_DEPENDENCIES = gcctestdir/ld
-common_test_1_LDFLAGS = -Bgcctestdir/
-
-check_PROGRAMS += exception_test
-check_PROGRAMS += exception_static_test
-check_PROGRAMS += exception_shared_1_test
-check_PROGRAMS += exception_shared_2_test
-check_PROGRAMS += exception_same_shared_test
-check_PROGRAMS += exception_separate_shared_12_test
-check_PROGRAMS += exception_separate_shared_21_test
-exception_test_1_pic.o: exception_test_1.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-exception_test_2_pic.o: exception_test_2.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o
-exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o
-exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o
-
-exception_test_SOURCES = \
- exception_test_main.cc \
- exception_test_1.cc \
- exception_test_2.cc \
- exception_test.h
-exception_test_DEPENDENCIES = gcctestdir/ld
-exception_test_LDFLAGS = -Bgcctestdir/
-
-exception_static_test_SOURCES = $(exception_test_SOURCES)
-exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES)
-exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static
-
-exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc
-exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so
-exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-exception_shared_1_test_LDADD = exception_shared_1.so
-
-exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc
-exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so
-exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-exception_shared_2_test_LDADD = exception_shared_2.so
-
-exception_same_shared_test_SOURCES = exception_test_main.cc
-exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so
-exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-exception_same_shared_test_LDADD = exception_shared.so
-
-exception_separate_shared_12_test_SOURCES = exception_test_main.cc
-exception_separate_shared_12_test_DEPENDENCIES = \
- gcctestdir/ld exception_shared_1.so exception_shared_2.so
-exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-exception_separate_shared_12_test_LDADD = \
- exception_shared_1.so exception_shared_2.so
-
-exception_separate_shared_21_test_SOURCES = exception_test_main.cc
-exception_separate_shared_21_test_DEPENDENCIES = \
- gcctestdir/ld exception_shared_1.so exception_shared_2.so
-exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-exception_separate_shared_21_test_LDADD = \
- exception_shared_2.so exception_shared_1.so
-
-
-check_PROGRAMS += weak_test
-weak_test_SOURCES = weak_test.cc
-weak_test_DEPENDENCIES = gcctestdir/ld
-weak_test_LDFLAGS = -Bgcctestdir/
-
-check_PROGRAMS += weak_undef_test
-weak_undef_test_SOURCES = weak_undef_test.cc
-weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so
-weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
-weak_undef_test_LDADD = -L . weak_undef_lib.so
-weak_undef_file1.o: weak_undef_file1.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-weak_undef_file2.o: weak_undef_file2.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-weak_undef_lib.so: weak_undef_file1.o
- $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o
-alt/weak_undef_lib.so: weak_undef_file2.o
- test -d alt || mkdir -p alt
- $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o
-
-if FN_PTRS_IN_SO_WITHOUT_PIC
-check_PROGRAMS += weak_undef_nonpic_test
-weak_undef_nonpic_test_SOURCES = weak_undef_test.cc
-weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so
-weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
-weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so
-weak_undef_file1_nonpic.o: weak_undef_file1.cc
- $(CXXCOMPILE) -c -o $@ $<
-weak_undef_file2_nonpic.o: weak_undef_file2.cc
- $(CXXCOMPILE) -c -o $@ $<
-weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o
- $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o
-alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o
- test -d alt || mkdir -p alt
- $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o
-endif FN_PTRS_IN_SO_WITHOUT_PIC
-
-
-check_PROGRAMS += weak_alias_test
-weak_alias_test_SOURCES = weak_alias_test_main.cc
-weak_alias_test_DEPENDENCIES = \
- gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \
- weak_alias_test_3.o weak_alias_test_4.so
-weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-weak_alias_test_LDADD = \
- weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \
- weak_alias_test_4.so
-weak_alias_test_1_pic.o: weak_alias_test_1.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o
-weak_alias_test_2_pic.o: weak_alias_test_2.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o
-weak_alias_test_3.o: weak_alias_test_3.cc
- $(CXXCOMPILE) -c -o $@ $<
-weak_alias_test_4_pic.o: weak_alias_test_4.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o
-
-check_SCRIPTS += weak_plt.sh
-check_PROGRAMS += weak_plt
-check_DATA += weak_plt_shared.so
-weak_plt_main_pic.o: weak_plt_main.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-weak_plt: weak_plt_main_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o
-weak_plt_shared_pic.o: weak_plt_shared.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o
-
-check_PROGRAMS += copy_test
-copy_test_SOURCES = copy_test.cc
-copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so
-copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-copy_test_LDADD = copy_test_1.so copy_test_2.so
-copy_test_1_pic.o: copy_test_1.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-copy_test_1.so: gcctestdir/ld copy_test_1_pic.o
- $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o
-copy_test_2_pic.o: copy_test_2.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-copy_test_2.so: gcctestdir/ld copy_test_2_pic.o
- $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o
-
-if TLS
-
-check_PROGRAMS += tls_test
-check_PROGRAMS += tls_pic_test
-check_PROGRAMS += tls_shared_test
-check_PROGRAMS += tls_shared_ie_test
-check_PROGRAMS += tls_shared_gd_to_ie_test
-tls_test_pic.o: tls_test.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-tls_test_file2_pic.o: tls_test_file2.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-tls_test_c_pic.o: tls_test_c.c
- $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
-tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o
-tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
-
-tls_test_pic_ie.o: tls_test.cc
- $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
-tls_test_file2_pic_ie.o: tls_test_file2.cc
- $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
-tls_test_c_pic_ie.o: tls_test_c.c
- $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $<
-tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o
-
-tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h
-tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o
-tls_test_LDFLAGS = -Bgcctestdir/
-tls_test_LDADD = tls_test_c.o -lpthread
-tls_test_c.o: tls_test_c.c
- $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $<
-
-tls_pic_test_SOURCES = tls_test_main.cc
-tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \
- tls_test_c_pic.o
-tls_pic_test_LDFLAGS = -Bgcctestdir/
-tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \
- -lpthread
-
-tls_shared_test_SOURCES = tls_test_main.cc
-tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so
-tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-tls_shared_test_LDADD = tls_test_shared.so -lpthread
-
-tls_shared_ie_test_SOURCES = tls_test_main.cc
-tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so
-tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread
-
-tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc
-tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \
- tls_test_c_pic.o tls_test_shared2.so
-tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \
- tls_test_shared2.so -lpthread
-
-if TLS_GNU2_DIALECT
-
-check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test
-
-tls_test_gnu2.o: tls_test.cc
- $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
-tls_test_file2_gnu2.o: tls_test_file2.cc
- $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
-tls_test_c_gnu2.o: tls_test_c.c
- $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $<
-tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o
-
-tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc
-tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \
- tls_test_c_gnu2.o tls_test_gnu2_shared2.so
-tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \
- tls_test_gnu2_shared2.so -lpthread
-
-if TLS_DESCRIPTORS
-
-check_PROGRAMS += tls_shared_gnu2_test
-
-tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o
-
-tls_shared_gnu2_test_SOURCES = tls_test_main.cc
-tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so
-tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread
-
-endif TLS_DESCRIPTORS
-
-endif TLS_GNU2_DIALECT
-
-if STATIC_TLS
-check_PROGRAMS += tls_static_test
-check_PROGRAMS += tls_static_pic_test
-
-tls_static_test_SOURCES = $(tls_test_SOURCES)
-tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES)
-tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static
-tls_static_test_LDADD = $(tls_test_LDADD)
-
-tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES)
-tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES)
-tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static
-tls_static_pic_test_LDADD = $(tls_pic_test_LDADD)
-endif
-
-if FN_PTRS_IN_SO_WITHOUT_PIC
-check_PROGRAMS += tls_shared_nonpic_test
-tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o
-
-tls_shared_nonpic_test_SOURCES = tls_test_main.cc
-tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so
-tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread
-endif FN_PTRS_IN_SO_WITHOUT_PIC
-
-endif TLS
-
-check_PROGRAMS += many_sections_test
-many_sections_test_SOURCES = many_sections_test.cc
-many_sections_test_DEPENDENCIES = gcctestdir/ld
-many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic
-
-BUILT_SOURCES += many_sections_define.h
-many_sections_define.h:
- (for i in `seq 1 70000`; do \
- echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \
- done) > $@.tmp
- mv -f $@.tmp $@
-
-BUILT_SOURCES += many_sections_check.h
-many_sections_check.h:
- (for i in `seq 1 1000 70000`; do \
- echo "assert(var_$$i == $$i);"; \
- done) > $@.tmp
- mv -f $@.tmp $@
-
-check_PROGRAMS += many_sections_r_test
-many_sections_r_test.o: many_sections_test.o gcctestdir/ld
- gcctestdir/ld -r -o $@ many_sections_test.o
-many_sections_r_test: many_sections_r_test.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS)
-
-if CONSTRUCTOR_PRIORITY
-
-check_PROGRAMS += initpri1
-initpri1_SOURCES = initpri1.c
-initpri1_DEPENDENCIES = gcctestdir/ld
-initpri1_LDFLAGS = -Bgcctestdir/
-
-endif
-
-
-# Test --detect-odr-violations
-check_SCRIPTS += debug_msg.sh
-
-# Create the data files that debug_msg.sh analyzes.
-check_DATA += debug_msg.err
-MOSTLYCLEANFILES += debug_msg.err
-debug_msg.o: debug_msg.cc
- $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc
-odr_violation1.o: odr_violation1.cc
- $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc
-odr_violation2.o: odr_violation2.cc
- $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation2.cc
-debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld
- @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@"
- @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \
- then \
- echo 1>&2 "Link of debug_msg should have failed"; \
- rm -f $@; \
- exit 1; \
- fi
-
-# See if we can also detect problems when we're linking .so's, not .o's.
-check_DATA += debug_msg_so.err
-MOSTLYCLEANFILES += debug_msg_so.err
-debug_msg.so: debug_msg.cc gcctestdir/ld
- $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
-odr_violation1.so: odr_violation1.cc gcctestdir/ld
- $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
-odr_violation2.so: odr_violation2.cc gcctestdir/ld
- $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
-debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld
- @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@"
- @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \
- then \
- echo 1>&2 "Link of debug_msg_so should have failed"; \
- rm -f $@; \
- exit 1; \
- fi
-
-# We also want to make sure we do something reasonable when there's no
-# debug info available. For the best test, we use .so's.
-check_DATA += debug_msg_ndebug.err
-MOSTLYCLEANFILES += debug_msg_ndebug.err
-debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld
- $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
-odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld
- $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
-odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld
- $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
-debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld
- @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@"
- @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \
- then \
- echo 1>&2 "Link of debug_msg_ndebug should have failed"; \
- rm -f $@; \
- exit 1; \
- fi
-
-
-# Similar to --detect-odr-violations: check for undefined symbols in .so's
-check_SCRIPTS += undef_symbol.sh
-check_DATA += undef_symbol.err
-MOSTLYCLEANFILES += undef_symbol.err
-undef_symbol.o: undef_symbol.cc
- $(CXXCOMPILE) -O0 -g -c -fPIC $<
-undef_symbol.so: undef_symbol.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o
-undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
- @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@"
- @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \
- then \
- echo 1>&2 "Link of undef_symbol_test should have failed"; \
- rm -f $@; \
- exit 1; \
- fi
-
-
-# Test -o when emitting to a special file (such as something in /dev).
-check_PROGRAMS += flagstest_o_specialfile
-flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
- chmod a+x $@
- test -s $@
-
-if HAVE_ZLIB
-
-# Test --compress-debug-sections. FIXME: check we actually compress.
-check_PROGRAMS += flagstest_compress_debug_sections
-flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
- test -s $@
-
-
-# The specialfile output has a tricky case when we also compress debug
-# sections, because it requires output-file resizing.
-check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
-flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
- gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
- chmod a+x $@
- test -s $@
-
-endif HAVE_ZLIB
-
-# Test symbol versioning.
-check_PROGRAMS += ver_test
-ver_test_SOURCES = ver_test_main.cc
-ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so
-ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so
-ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so
-ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script ver_test_2.o ver_test_4.so
-ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o
-ver_test_1.o: ver_test_1.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-ver_test_2.o: ver_test_2.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-ver_test_3.o: ver_test_3.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-ver_test_4.o: ver_test_4.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-
-check_PROGRAMS += ver_test_2
-ver_test_2_SOURCES = ver_test_main_2.cc
-ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so
-ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-ver_test_2_LDADD = ver_test_4.so ver_test_2.so
-
-check_SCRIPTS += ver_test_2.sh
-check_DATA += ver_test_2.syms
-ver_test_2.syms: ver_test_2
- $(TEST_READELF) -s $< >$@ 2>/dev/null
-
-check_SCRIPTS += ver_test_4.sh
-check_DATA += ver_test_4.syms
-ver_test_4.syms: ver_test_4.so
- $(TEST_READELF) -s $< >$@ 2>/dev/null
-
-ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so
-ver_test_5.o: ver_test_5.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-check_SCRIPTS += ver_test_5.sh
-check_DATA += ver_test_5.syms
-ver_test_5.syms: ver_test_5.so
- $(TEST_READELF) -s $< >$@ 2>/dev/null
-
-check_PROGRAMS += ver_test_6
-ver_test_6_SOURCES = ver_test_6.c
-ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so
-ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-ver_test_6_LDADD = ver_test_2.so
-
-ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o
-ver_test_7.o: ver_test_7.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-check_SCRIPTS += ver_test_7.sh
-check_DATA += ver_test_7.syms
-ver_test_7.syms: ver_test_7.so
- $(TEST_READELF) -s $< >$@ 2>/dev/null
-
-check_PROGRAMS += ver_test_8
-ver_test_8_SOURCES = two_file_test_main.cc
-ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so
-ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so
-ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so
-ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o
-
-check_PROGRAMS += ver_test_9
-ver_test_9_SOURCES = ver_test_main.cc
-ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so
-ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-ver_test_9_LDADD = ver_test_9.so
-ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld
- $(CXXLINK) -Bgcctestdir/ -shared ver_test_9.o ver_test_5.so ver_test_4.so
-ver_test_9.o: ver_test_9.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-
-check_SCRIPTS += ver_test_10.sh
-check_DATA += ver_test_10.syms
-ver_test_10.syms: ver_test_10.so
- $(TEST_READELF) -s $< >$@ 2>/dev/null
-ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script
- $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o
-
-check_PROGRAMS += protected_1
-protected_1_SOURCES = \
- protected_main_1.cc protected_main_2.cc protected_main_3.cc
-protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so
-protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-protected_1_LDADD = protected_1.so
-
-protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o
- $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o
-protected_1_pic.o: protected_1.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-protected_2_pic.o: protected_2.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-protected_3_pic.o: protected_3.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-
-check_PROGRAMS += protected_2
-protected_2_SOURCES = protected_main_1.cc protected_3.cc
-protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so
-protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-protected_2_LDADD = protected_1.so
-
-check_PROGRAMS += relro_test
-relro_test_SOURCES = relro_test_main.cc
-relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so
-relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-relro_test_LDADD = relro_test.so
-relro_test.so: gcctestdir/ld relro_test_pic.o
- $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o
-relro_test_pic.o: relro_test.cc
- $(CXXCOMPILE) -c -fpic -o $@ $<
-
-check_PROGRAMS += script_test_1
-script_test_1_SOURCES = script_test_1.cc
-script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t
-script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t
-
-check_PROGRAMS += script_test_2
-script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc
-script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t
-script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t
-
-check_PROGRAMS += justsyms
-justsyms_SOURCES = justsyms_1.cc
-justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o
-justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o
-justsyms_2.o: justsyms_2.cc
- $(CXXCOMPILE) -c -o $@ $<
-justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t
- gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o
-
-check_PROGRAMS += binary_test
-binary_test_SOURCES = binary_test.cc
-binary_test_DEPENDENCIES = gcctestdir/ld binary.txt
-binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf
-# Copy the file to the build directory to avoid worrying about the
-# full pathname in the generated symbols.
-binary.txt: $(srcdir)/binary.in
- rm -f $@
- $(LN_S) $< $@
-
-check_SCRIPTS += ver_matching_test.sh
-check_DATA += ver_matching_test.stdout
-MOSTLYCLEANFILES += ver_matching_test.stdout
-ver_matching_def.so: ver_matching_def.cc gcctestdir/ld
- $(CXXLINK) -O0 -Bgcctestdir/ -shared $(srcdir)/ver_matching_def.cc -Wl,--version-script=$(srcdir)/version_script.map
-ver_matching_test.stdout: ver_matching_def.so
- $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
-
-check_PROGRAMS += script_test_3
-check_SCRIPTS += script_test_3.sh
-check_DATA += script_test_3.stdout
-MOSTLYCLEANFILES += script_test_3.stdout
-script_test_3: basic_test.o gcctestdir/ld script_test_3.t
- $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t
-script_test_3.stdout: script_test_3
- $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout
-
-check_SCRIPTS += script_test_4.sh
-check_DATA += script_test_4.stdout
-MOSTLYCLEANFILES += script_test_4.stdout
-script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t
- $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t
-script_test_4.stdout: script_test_4
- $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout
-
-endif GCC
-endif NATIVE_LINKER
diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in
deleted file mode 100644
index c5e929a9cf3..00000000000
--- a/gold/testsuite/Makefile.in
+++ /dev/null
@@ -1,2300 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 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.
-
-@SET_MAKE@
-
-# Process this file with automake to generate Makefile.in
-
-# As far as I can tell automake testing support assumes that the build
-# system and the host system are the same. So these tests will not
-# work when building with a cross-compiler.
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-check_PROGRAMS = object_unittest$(EXEEXT) binary_unittest$(EXEEXT) \
- $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
- $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
- $(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_9) \
- $(am__EXEEXT_10) $(am__EXEEXT_11) $(am__EXEEXT_12) \
- $(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_1 = basic_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_static_test basic_pic_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_static_pic_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ constructor_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ constructor_static_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_static_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_pic_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_1_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_2_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_1_pic_2_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_2_pic_1_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_same_shared_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_12_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_21_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_relocatable_test
-@GCC_FALSE@constructor_test_DEPENDENCIES = libgoldtest.a ../libgold.a \
-@GCC_FALSE@ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
-@GCC_FALSE@ $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@constructor_test_DEPENDENCIES = libgoldtest.a \
-@NATIVE_LINKER_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-@GCC_FALSE@constructor_static_test_DEPENDENCIES = libgoldtest.a \
-@GCC_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@GCC_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@constructor_static_test_DEPENDENCIES = \
-@NATIVE_LINKER_FALSE@ libgoldtest.a ../libgold.a \
-@NATIVE_LINKER_FALSE@ ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-@GCC_FALSE@two_file_test_DEPENDENCIES = libgoldtest.a ../libgold.a \
-@GCC_FALSE@ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
-@GCC_FALSE@ $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@two_file_test_DEPENDENCIES = libgoldtest.a \
-@NATIVE_LINKER_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-@GCC_FALSE@two_file_static_test_DEPENDENCIES = libgoldtest.a \
-@GCC_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@GCC_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@two_file_static_test_DEPENDENCIES = \
-@NATIVE_LINKER_FALSE@ libgoldtest.a ../libgold.a \
-@NATIVE_LINKER_FALSE@ ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-
-# The nonpic tests will fail on platforms which can not put non-PIC
-# code into shared libraries, so we just don't run them in that case.
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_2 = two_file_shared_1_nonpic_test \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_2_nonpic_test \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_same_shared_nonpic_test \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_12_nonpic_test \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_21_nonpic_test \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_mixed_shared_test \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_mixed_2_shared_test
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_3 = two_file_strip_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_same_shared_strip_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ common_test_1 exception_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_static_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_shared_1_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_shared_2_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_same_shared_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_separate_shared_12_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_separate_shared_21_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_test weak_undef_test
-@GCC_FALSE@common_test_1_DEPENDENCIES = libgoldtest.a ../libgold.a \
-@GCC_FALSE@ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
-@GCC_FALSE@ $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@common_test_1_DEPENDENCIES = libgoldtest.a \
-@NATIVE_LINKER_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-@GCC_FALSE@exception_test_DEPENDENCIES = libgoldtest.a ../libgold.a \
-@GCC_FALSE@ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
-@GCC_FALSE@ $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@exception_test_DEPENDENCIES = libgoldtest.a \
-@NATIVE_LINKER_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-@GCC_FALSE@exception_static_test_DEPENDENCIES = libgoldtest.a \
-@GCC_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@GCC_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@exception_static_test_DEPENDENCIES = \
-@NATIVE_LINKER_FALSE@ libgoldtest.a ../libgold.a \
-@NATIVE_LINKER_FALSE@ ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-@GCC_FALSE@weak_test_DEPENDENCIES = libgoldtest.a ../libgold.a \
-@GCC_FALSE@ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
-@GCC_FALSE@ $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@weak_test_DEPENDENCIES = libgoldtest.a \
-@NATIVE_LINKER_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_4 = weak_undef_nonpic_test
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_5 = weak_alias_test weak_plt \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ copy_test
-
-# Test --detect-odr-violations
-
-# Similar to --detect-odr-violations: check for undefined symbols in .so's
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_6 = weak_plt.sh debug_msg.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ undef_symbol.sh ver_test_2.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_4.sh ver_test_5.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_7.sh ver_test_10.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_matching_test.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3.sh \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_4.sh
-
-# Create the data files that debug_msg.sh analyzes.
-
-# See if we can also detect problems when we're linking .so's, not .o's.
-
-# We also want to make sure we do something reasonable when there's no
-# debug info available. For the best test, we use .so's.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_7 = weak_plt_shared.so \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ debug_msg.err debug_msg_so.err \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ debug_msg_ndebug.err \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ undef_symbol.err ver_test_2.syms \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_4.syms ver_test_5.syms \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_7.syms ver_test_10.syms \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_matching_test.stdout \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3.stdout \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_4.stdout
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__append_8 = tls_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_pic_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_shared_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_shared_ie_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_shared_gd_to_ie_test
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@am__append_9 = tls_shared_gnu2_gd_to_ie_test
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_DESCRIPTORS_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@am__append_10 = tls_shared_gnu2_test
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@am__append_11 = tls_static_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@ tls_static_pic_test
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__append_12 = tls_shared_nonpic_test
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_13 = many_sections_test \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_r_test
-@GCC_FALSE@many_sections_test_DEPENDENCIES = libgoldtest.a \
-@GCC_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@GCC_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@many_sections_test_DEPENDENCIES = libgoldtest.a \
-@NATIVE_LINKER_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_14 = many_sections_define.h \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_check.h
-@CONSTRUCTOR_PRIORITY_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_15 = initpri1
-@CONSTRUCTOR_PRIORITY_FALSE@initpri1_DEPENDENCIES = libgoldtest.a \
-@CONSTRUCTOR_PRIORITY_FALSE@ ../libgold.a \
-@CONSTRUCTOR_PRIORITY_FALSE@ ../../libiberty/libiberty.a \
-@CONSTRUCTOR_PRIORITY_FALSE@ $(am__DEPENDENCIES_1) \
-@CONSTRUCTOR_PRIORITY_FALSE@ $(am__DEPENDENCIES_1)
-@GCC_FALSE@initpri1_DEPENDENCIES = libgoldtest.a ../libgold.a \
-@GCC_FALSE@ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
-@GCC_FALSE@ $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@initpri1_DEPENDENCIES = libgoldtest.a \
-@NATIVE_LINKER_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_16 = debug_msg.err \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ debug_msg_so.err \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ debug_msg_ndebug.err \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ undef_symbol.err \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_matching_test.stdout \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3.stdout \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_4.stdout
-
-# Test -o when emitting to a special file (such as something in /dev).
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_17 = flagstest_o_specialfile
-
-# Test --compress-debug-sections. FIXME: check we actually compress.
-
-# The specialfile output has a tricky case when we also compress debug
-# sections, because it requires output-file resizing.
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_18 = flagstest_compress_debug_sections \
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile_and_compress_debug_sections
-
-# Test symbol versioning.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_19 = ver_test ver_test_2 \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_6 ver_test_8 ver_test_9 \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ protected_1 protected_2 \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_test script_test_1 \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_2 justsyms \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ binary_test script_test_3
-@GCC_FALSE@script_test_1_DEPENDENCIES = libgoldtest.a ../libgold.a \
-@GCC_FALSE@ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
-@GCC_FALSE@ $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@script_test_1_DEPENDENCIES = libgoldtest.a \
-@NATIVE_LINKER_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-@GCC_FALSE@script_test_2_DEPENDENCIES = libgoldtest.a ../libgold.a \
-@GCC_FALSE@ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
-@GCC_FALSE@ $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@script_test_2_DEPENDENCIES = libgoldtest.a \
-@NATIVE_LINKER_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-@GCC_FALSE@justsyms_DEPENDENCIES = libgoldtest.a ../libgold.a \
-@GCC_FALSE@ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
-@GCC_FALSE@ $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@justsyms_DEPENDENCIES = libgoldtest.a \
-@NATIVE_LINKER_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-@GCC_FALSE@binary_test_DEPENDENCIES = libgoldtest.a ../libgold.a \
-@GCC_FALSE@ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
-@GCC_FALSE@ $(am__DEPENDENCIES_1)
-@NATIVE_LINKER_FALSE@binary_test_DEPENDENCIES = libgoldtest.a \
-@NATIVE_LINKER_FALSE@ ../libgold.a ../../libiberty/libiberty.a \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1) \
-@NATIVE_LINKER_FALSE@ $(am__DEPENDENCIES_1)
-subdir = testsuite
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
- $(top_srcdir)/../config/gettext-sister.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
- $(top_srcdir)/../config/nls.m4 \
- $(top_srcdir)/../config/override.m4 \
- $(top_srcdir)/../config/po.m4 \
- $(top_srcdir)/../config/proginstall.m4 \
- $(top_srcdir)/../config/progtest.m4 \
- $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-AR = ar
-ARFLAGS = cru
-libgoldtest_a_AR = $(AR) $(ARFLAGS)
-libgoldtest_a_LIBADD =
-am_libgoldtest_a_OBJECTS = test.$(OBJEXT) testmain.$(OBJEXT) \
- testfile.$(OBJEXT)
-libgoldtest_a_OBJECTS = $(am_libgoldtest_a_OBJECTS)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_1 = basic_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_static_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_pic_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_static_pic_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ constructor_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ constructor_static_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_static_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_pic_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_1_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_2_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_1_pic_2_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_2_pic_1_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_same_shared_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_12_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_21_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_relocatable_test$(EXEEXT)
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_2 = two_file_shared_1_nonpic_test$(EXEEXT) \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_2_nonpic_test$(EXEEXT) \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_same_shared_nonpic_test$(EXEEXT) \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_12_nonpic_test$(EXEEXT) \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_21_nonpic_test$(EXEEXT) \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_mixed_shared_test$(EXEEXT) \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_mixed_2_shared_test$(EXEEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_3 = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_strip_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_same_shared_strip_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ common_test_1$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_static_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_shared_1_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_shared_2_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_same_shared_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_separate_shared_12_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_separate_shared_21_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test$(EXEEXT)
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_4 = weak_undef_nonpic_test$(EXEEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_5 = weak_alias_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_plt$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ copy_test$(EXEEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__EXEEXT_6 = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_pic_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_shared_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_shared_ie_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_shared_gd_to_ie_test$(EXEEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@am__EXEEXT_7 = tls_shared_gnu2_gd_to_ie_test$(EXEEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_DESCRIPTORS_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@am__EXEEXT_8 = tls_shared_gnu2_test$(EXEEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@am__EXEEXT_9 = tls_static_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@ tls_static_pic_test$(EXEEXT)
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__EXEEXT_10 = tls_shared_nonpic_test$(EXEEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_11 = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_r_test$(EXEEXT)
-@CONSTRUCTOR_PRIORITY_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_12 = initpri1$(EXEEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_13 = flagstest_o_specialfile$(EXEEXT)
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_14 = flagstest_compress_debug_sections$(EXEEXT) \
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile_and_compress_debug_sections$(EXEEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_15 = ver_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_2$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_6$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_8$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_9$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ protected_1$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ protected_2$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_1$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_2$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ binary_test$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_3$(EXEEXT)
-basic_pic_test_SOURCES = basic_pic_test.c
-basic_pic_test_OBJECTS = basic_pic_test.$(OBJEXT)
-basic_pic_test_LDADD = $(LDADD)
-am__DEPENDENCIES_1 =
-basic_pic_test_DEPENDENCIES = libgoldtest.a ../libgold.a \
- ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-basic_static_pic_test_SOURCES = basic_static_pic_test.c
-basic_static_pic_test_OBJECTS = basic_static_pic_test.$(OBJEXT)
-basic_static_pic_test_LDADD = $(LDADD)
-basic_static_pic_test_DEPENDENCIES = libgoldtest.a ../libgold.a \
- ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-basic_static_test_SOURCES = basic_static_test.c
-basic_static_test_OBJECTS = basic_static_test.$(OBJEXT)
-basic_static_test_LDADD = $(LDADD)
-basic_static_test_DEPENDENCIES = libgoldtest.a ../libgold.a \
- ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-basic_test_SOURCES = basic_test.c
-basic_test_OBJECTS = basic_test.$(OBJEXT)
-basic_test_LDADD = $(LDADD)
-basic_test_DEPENDENCIES = libgoldtest.a ../libgold.a \
- ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-am__binary_test_SOURCES_DIST = binary_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_binary_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ binary_test.$(OBJEXT)
-binary_test_OBJECTS = $(am_binary_test_OBJECTS)
-binary_test_LDADD = $(LDADD)
-am_binary_unittest_OBJECTS = binary_unittest.$(OBJEXT)
-binary_unittest_OBJECTS = $(am_binary_unittest_OBJECTS)
-binary_unittest_LDADD = $(LDADD)
-binary_unittest_DEPENDENCIES = libgoldtest.a ../libgold.a \
- ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-am__common_test_1_SOURCES_DIST = common_test_1.c
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_common_test_1_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ common_test_1.$(OBJEXT)
-common_test_1_OBJECTS = $(am_common_test_1_OBJECTS)
-common_test_1_LDADD = $(LDADD)
-am__constructor_static_test_SOURCES_DIST = constructor_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__objects_1 = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ constructor_test.$(OBJEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_constructor_static_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(am__objects_1)
-constructor_static_test_OBJECTS = \
- $(am_constructor_static_test_OBJECTS)
-constructor_static_test_LDADD = $(LDADD)
-am__constructor_test_SOURCES_DIST = constructor_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_constructor_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ constructor_test.$(OBJEXT)
-constructor_test_OBJECTS = $(am_constructor_test_OBJECTS)
-constructor_test_LDADD = $(LDADD)
-am__copy_test_SOURCES_DIST = copy_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_copy_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ copy_test.$(OBJEXT)
-copy_test_OBJECTS = $(am_copy_test_OBJECTS)
-am__exception_same_shared_test_SOURCES_DIST = exception_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_same_shared_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT)
-exception_same_shared_test_OBJECTS = \
- $(am_exception_same_shared_test_OBJECTS)
-am__exception_separate_shared_12_test_SOURCES_DIST = \
- exception_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_separate_shared_12_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT)
-exception_separate_shared_12_test_OBJECTS = \
- $(am_exception_separate_shared_12_test_OBJECTS)
-am__exception_separate_shared_21_test_SOURCES_DIST = \
- exception_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_separate_shared_21_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT)
-exception_separate_shared_21_test_OBJECTS = \
- $(am_exception_separate_shared_21_test_OBJECTS)
-am__exception_shared_1_test_SOURCES_DIST = exception_test_2.cc \
- exception_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_shared_1_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_2.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT)
-exception_shared_1_test_OBJECTS = \
- $(am_exception_shared_1_test_OBJECTS)
-am__exception_shared_2_test_SOURCES_DIST = exception_test_1.cc \
- exception_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_shared_2_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_1.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT)
-exception_shared_2_test_OBJECTS = \
- $(am_exception_shared_2_test_OBJECTS)
-am__exception_static_test_SOURCES_DIST = exception_test_main.cc \
- exception_test_1.cc exception_test_2.cc exception_test.h
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__objects_2 = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_1.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_2.$(OBJEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_static_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(am__objects_2)
-exception_static_test_OBJECTS = $(am_exception_static_test_OBJECTS)
-exception_static_test_LDADD = $(LDADD)
-am__exception_test_SOURCES_DIST = exception_test_main.cc \
- exception_test_1.cc exception_test_2.cc exception_test.h
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_1.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_2.$(OBJEXT)
-exception_test_OBJECTS = $(am_exception_test_OBJECTS)
-exception_test_LDADD = $(LDADD)
-flagstest_compress_debug_sections_SOURCES = \
- flagstest_compress_debug_sections.c
-flagstest_compress_debug_sections_OBJECTS = \
- flagstest_compress_debug_sections.$(OBJEXT)
-flagstest_compress_debug_sections_LDADD = $(LDADD)
-flagstest_compress_debug_sections_DEPENDENCIES = libgoldtest.a \
- ../libgold.a ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-flagstest_o_specialfile_SOURCES = flagstest_o_specialfile.c
-flagstest_o_specialfile_OBJECTS = flagstest_o_specialfile.$(OBJEXT)
-flagstest_o_specialfile_LDADD = $(LDADD)
-flagstest_o_specialfile_DEPENDENCIES = libgoldtest.a ../libgold.a \
- ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-flagstest_o_specialfile_and_compress_debug_sections_SOURCES = \
- flagstest_o_specialfile_and_compress_debug_sections.c
-flagstest_o_specialfile_and_compress_debug_sections_OBJECTS = \
- flagstest_o_specialfile_and_compress_debug_sections.$(OBJEXT)
-flagstest_o_specialfile_and_compress_debug_sections_LDADD = $(LDADD)
-flagstest_o_specialfile_and_compress_debug_sections_DEPENDENCIES = \
- libgoldtest.a ../libgold.a ../../libiberty/libiberty.a \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-am__initpri1_SOURCES_DIST = initpri1.c
-@CONSTRUCTOR_PRIORITY_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am_initpri1_OBJECTS = initpri1.$(OBJEXT)
-initpri1_OBJECTS = $(am_initpri1_OBJECTS)
-initpri1_LDADD = $(LDADD)
-am__justsyms_SOURCES_DIST = justsyms_1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_justsyms_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms_1.$(OBJEXT)
-justsyms_OBJECTS = $(am_justsyms_OBJECTS)
-justsyms_LDADD = $(LDADD)
-many_sections_r_test_SOURCES = many_sections_r_test.c
-many_sections_r_test_OBJECTS = many_sections_r_test.$(OBJEXT)
-many_sections_r_test_LDADD = $(LDADD)
-many_sections_r_test_DEPENDENCIES = libgoldtest.a ../libgold.a \
- ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-am__many_sections_test_SOURCES_DIST = many_sections_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_many_sections_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_test.$(OBJEXT)
-many_sections_test_OBJECTS = $(am_many_sections_test_OBJECTS)
-many_sections_test_LDADD = $(LDADD)
-am_object_unittest_OBJECTS = object_unittest.$(OBJEXT)
-object_unittest_OBJECTS = $(am_object_unittest_OBJECTS)
-object_unittest_LDADD = $(LDADD)
-object_unittest_DEPENDENCIES = libgoldtest.a ../libgold.a \
- ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-am__protected_1_SOURCES_DIST = protected_main_1.cc protected_main_2.cc \
- protected_main_3.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_protected_1_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ protected_main_1.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ protected_main_2.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ protected_main_3.$(OBJEXT)
-protected_1_OBJECTS = $(am_protected_1_OBJECTS)
-am__protected_2_SOURCES_DIST = protected_main_1.cc protected_3.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_protected_2_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ protected_main_1.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ protected_3.$(OBJEXT)
-protected_2_OBJECTS = $(am_protected_2_OBJECTS)
-am__relro_test_SOURCES_DIST = relro_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_relro_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ relro_test_main.$(OBJEXT)
-relro_test_OBJECTS = $(am_relro_test_OBJECTS)
-am__script_test_1_SOURCES_DIST = script_test_1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_script_test_1_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_1.$(OBJEXT)
-script_test_1_OBJECTS = $(am_script_test_1_OBJECTS)
-script_test_1_LDADD = $(LDADD)
-am__script_test_2_SOURCES_DIST = script_test_2.cc script_test_2a.cc \
- script_test_2b.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_script_test_2_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_2.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_2a.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ script_test_2b.$(OBJEXT)
-script_test_2_OBJECTS = $(am_script_test_2_OBJECTS)
-script_test_2_LDADD = $(LDADD)
-script_test_3_SOURCES = script_test_3.c
-script_test_3_OBJECTS = script_test_3.$(OBJEXT)
-script_test_3_LDADD = $(LDADD)
-script_test_3_DEPENDENCIES = libgoldtest.a ../libgold.a \
- ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-am__tls_pic_test_SOURCES_DIST = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am_tls_pic_test_OBJECTS = tls_test_main.$(OBJEXT)
-tls_pic_test_OBJECTS = $(am_tls_pic_test_OBJECTS)
-am__tls_shared_gd_to_ie_test_SOURCES_DIST = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am_tls_shared_gd_to_ie_test_OBJECTS = tls_test_main.$(OBJEXT)
-tls_shared_gd_to_ie_test_OBJECTS = \
- $(am_tls_shared_gd_to_ie_test_OBJECTS)
-am__tls_shared_gnu2_gd_to_ie_test_SOURCES_DIST = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@am_tls_shared_gnu2_gd_to_ie_test_OBJECTS = tls_test_main.$(OBJEXT)
-tls_shared_gnu2_gd_to_ie_test_OBJECTS = \
- $(am_tls_shared_gnu2_gd_to_ie_test_OBJECTS)
-am__tls_shared_gnu2_test_SOURCES_DIST = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_DESCRIPTORS_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@am_tls_shared_gnu2_test_OBJECTS = tls_test_main.$(OBJEXT)
-tls_shared_gnu2_test_OBJECTS = $(am_tls_shared_gnu2_test_OBJECTS)
-am__tls_shared_ie_test_SOURCES_DIST = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am_tls_shared_ie_test_OBJECTS = tls_test_main.$(OBJEXT)
-tls_shared_ie_test_OBJECTS = $(am_tls_shared_ie_test_OBJECTS)
-am__tls_shared_nonpic_test_SOURCES_DIST = tls_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am_tls_shared_nonpic_test_OBJECTS = tls_test_main.$(OBJEXT)
-tls_shared_nonpic_test_OBJECTS = $(am_tls_shared_nonpic_test_OBJECTS)
-am__tls_shared_test_SOURCES_DIST = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am_tls_shared_test_OBJECTS = tls_test_main.$(OBJEXT)
-tls_shared_test_OBJECTS = $(am_tls_shared_test_OBJECTS)
-am__tls_static_pic_test_SOURCES_DIST = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__objects_3 = tls_test_main.$(OBJEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@am_tls_static_pic_test_OBJECTS = $(am__objects_3)
-tls_static_pic_test_OBJECTS = $(am_tls_static_pic_test_OBJECTS)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__DEPENDENCIES_2 = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_pic.o \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_file2_pic.o \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_c_pic.o
-am__tls_static_test_SOURCES_DIST = tls_test.cc tls_test_file2.cc \
- tls_test_main.cc tls_test.h
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__objects_4 = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_file2.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_main.$(OBJEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@am_tls_static_test_OBJECTS = $(am__objects_4)
-tls_static_test_OBJECTS = $(am_tls_static_test_OBJECTS)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am__DEPENDENCIES_3 = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_c.o
-am__tls_test_SOURCES_DIST = tls_test.cc tls_test_file2.cc \
- tls_test_main.cc tls_test.h
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@am_tls_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_file2.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_main.$(OBJEXT)
-tls_test_OBJECTS = $(am_tls_test_OBJECTS)
-am__two_file_mixed_2_shared_test_SOURCES_DIST = two_file_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_mixed_2_shared_test_OBJECTS = two_file_test_main.$(OBJEXT)
-two_file_mixed_2_shared_test_OBJECTS = \
- $(am_two_file_mixed_2_shared_test_OBJECTS)
-am__two_file_mixed_shared_test_SOURCES_DIST = two_file_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_mixed_shared_test_OBJECTS = two_file_test_main.$(OBJEXT)
-two_file_mixed_shared_test_OBJECTS = \
- $(am_two_file_mixed_shared_test_OBJECTS)
-am__two_file_pic_test_SOURCES_DIST = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_pic_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_pic_test_OBJECTS = $(am_two_file_pic_test_OBJECTS)
-am__two_file_relocatable_test_SOURCES_DIST = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_relocatable_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_relocatable_test_OBJECTS = \
- $(am_two_file_relocatable_test_OBJECTS)
-am__two_file_same_shared_nonpic_test_SOURCES_DIST = \
- two_file_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_same_shared_nonpic_test_OBJECTS = two_file_test_main.$(OBJEXT)
-two_file_same_shared_nonpic_test_OBJECTS = \
- $(am_two_file_same_shared_nonpic_test_OBJECTS)
-am__two_file_same_shared_strip_test_SOURCES_DIST = \
- two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_same_shared_strip_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_same_shared_strip_test_OBJECTS = \
- $(am_two_file_same_shared_strip_test_OBJECTS)
-am__two_file_same_shared_test_SOURCES_DIST = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_same_shared_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_same_shared_test_OBJECTS = \
- $(am_two_file_same_shared_test_OBJECTS)
-am__two_file_separate_shared_12_nonpic_test_SOURCES_DIST = \
- two_file_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_separate_shared_12_nonpic_test_OBJECTS = two_file_test_main.$(OBJEXT)
-two_file_separate_shared_12_nonpic_test_OBJECTS = \
- $(am_two_file_separate_shared_12_nonpic_test_OBJECTS)
-am__two_file_separate_shared_12_test_SOURCES_DIST = \
- two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_separate_shared_12_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_separate_shared_12_test_OBJECTS = \
- $(am_two_file_separate_shared_12_test_OBJECTS)
-am__two_file_separate_shared_21_nonpic_test_SOURCES_DIST = \
- two_file_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_separate_shared_21_nonpic_test_OBJECTS = two_file_test_main.$(OBJEXT)
-two_file_separate_shared_21_nonpic_test_OBJECTS = \
- $(am_two_file_separate_shared_21_nonpic_test_OBJECTS)
-am__two_file_separate_shared_21_test_SOURCES_DIST = \
- two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_separate_shared_21_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_separate_shared_21_test_OBJECTS = \
- $(am_two_file_separate_shared_21_test_OBJECTS)
-am__two_file_shared_1_nonpic_test_SOURCES_DIST = two_file_test_2.cc \
- two_file_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_shared_1_nonpic_test_OBJECTS = two_file_test_2.$(OBJEXT) \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_shared_1_nonpic_test_OBJECTS = \
- $(am_two_file_shared_1_nonpic_test_OBJECTS)
-am__two_file_shared_1_pic_2_test_SOURCES_DIST = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_shared_1_pic_2_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_shared_1_pic_2_test_OBJECTS = \
- $(am_two_file_shared_1_pic_2_test_OBJECTS)
-am__two_file_shared_1_test_SOURCES_DIST = two_file_test_2.cc \
- two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_shared_1_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_2.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_shared_1_test_OBJECTS = $(am_two_file_shared_1_test_OBJECTS)
-am__two_file_shared_2_nonpic_test_SOURCES_DIST = two_file_test_1.cc \
- two_file_test_1b.cc two_file_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_shared_2_nonpic_test_OBJECTS = two_file_test_1.$(OBJEXT) \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_1b.$(OBJEXT) \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_shared_2_nonpic_test_OBJECTS = \
- $(am_two_file_shared_2_nonpic_test_OBJECTS)
-am__two_file_shared_2_pic_1_test_SOURCES_DIST = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_shared_2_pic_1_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_shared_2_pic_1_test_OBJECTS = \
- $(am_two_file_shared_2_pic_1_test_OBJECTS)
-am__two_file_shared_2_test_SOURCES_DIST = two_file_test_1.cc \
- two_file_test_1b.cc two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_shared_2_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_1.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_1b.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_shared_2_test_OBJECTS = $(am_two_file_shared_2_test_OBJECTS)
-am__two_file_static_test_SOURCES_DIST = two_file_test_1.cc \
- two_file_test_1b.cc two_file_test_2.cc two_file_test_main.cc \
- two_file_test.h
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am__objects_5 = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_1.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_1b.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_2.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_static_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(am__objects_5)
-two_file_static_test_OBJECTS = $(am_two_file_static_test_OBJECTS)
-two_file_static_test_LDADD = $(LDADD)
-two_file_strip_test_SOURCES = two_file_strip_test.c
-two_file_strip_test_OBJECTS = two_file_strip_test.$(OBJEXT)
-two_file_strip_test_LDADD = $(LDADD)
-two_file_strip_test_DEPENDENCIES = libgoldtest.a ../libgold.a \
- ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-am__two_file_test_SOURCES_DIST = two_file_test_1.cc \
- two_file_test_1b.cc two_file_test_2.cc two_file_test_main.cc \
- two_file_test.h
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_1.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_1b.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_2.$(OBJEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-two_file_test_OBJECTS = $(am_two_file_test_OBJECTS)
-two_file_test_LDADD = $(LDADD)
-am__ver_test_SOURCES_DIST = ver_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_ver_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_main.$(OBJEXT)
-ver_test_OBJECTS = $(am_ver_test_OBJECTS)
-am__ver_test_2_SOURCES_DIST = ver_test_main_2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_ver_test_2_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_main_2.$(OBJEXT)
-ver_test_2_OBJECTS = $(am_ver_test_2_OBJECTS)
-am__ver_test_6_SOURCES_DIST = ver_test_6.c
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_ver_test_6_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_6.$(OBJEXT)
-ver_test_6_OBJECTS = $(am_ver_test_6_OBJECTS)
-am__ver_test_8_SOURCES_DIST = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_ver_test_8_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT)
-ver_test_8_OBJECTS = $(am_ver_test_8_OBJECTS)
-am__ver_test_9_SOURCES_DIST = ver_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_ver_test_9_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ ver_test_main.$(OBJEXT)
-ver_test_9_OBJECTS = $(am_ver_test_9_OBJECTS)
-am__weak_alias_test_SOURCES_DIST = weak_alias_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_weak_alias_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_alias_test_main.$(OBJEXT)
-weak_alias_test_OBJECTS = $(am_weak_alias_test_OBJECTS)
-weak_plt_SOURCES = weak_plt.c
-weak_plt_OBJECTS = weak_plt.$(OBJEXT)
-weak_plt_LDADD = $(LDADD)
-weak_plt_DEPENDENCIES = libgoldtest.a ../libgold.a \
- ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-am__weak_test_SOURCES_DIST = weak_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_weak_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_test.$(OBJEXT)
-weak_test_OBJECTS = $(am_weak_test_OBJECTS)
-weak_test_LDADD = $(LDADD)
-am__weak_undef_nonpic_test_SOURCES_DIST = weak_undef_test.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am_weak_undef_nonpic_test_OBJECTS = weak_undef_test.$(OBJEXT)
-weak_undef_nonpic_test_OBJECTS = $(am_weak_undef_nonpic_test_OBJECTS)
-am__weak_undef_test_SOURCES_DIST = weak_undef_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_weak_undef_test_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_undef_test.$(OBJEXT)
-weak_undef_test_OBJECTS = $(am_weak_undef_test_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/../depcomp
-am__depfiles_maybe = depfiles
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c \
- basic_static_pic_test.c basic_static_test.c basic_test.c \
- $(binary_test_SOURCES) $(binary_unittest_SOURCES) \
- $(common_test_1_SOURCES) $(constructor_static_test_SOURCES) \
- $(constructor_test_SOURCES) $(copy_test_SOURCES) \
- $(exception_same_shared_test_SOURCES) \
- $(exception_separate_shared_12_test_SOURCES) \
- $(exception_separate_shared_21_test_SOURCES) \
- $(exception_shared_1_test_SOURCES) \
- $(exception_shared_2_test_SOURCES) \
- $(exception_static_test_SOURCES) $(exception_test_SOURCES) \
- flagstest_compress_debug_sections.c flagstest_o_specialfile.c \
- flagstest_o_specialfile_and_compress_debug_sections.c \
- $(initpri1_SOURCES) $(justsyms_SOURCES) many_sections_r_test.c \
- $(many_sections_test_SOURCES) $(object_unittest_SOURCES) \
- $(protected_1_SOURCES) $(protected_2_SOURCES) \
- $(relro_test_SOURCES) $(script_test_1_SOURCES) \
- $(script_test_2_SOURCES) script_test_3.c \
- $(tls_pic_test_SOURCES) $(tls_shared_gd_to_ie_test_SOURCES) \
- $(tls_shared_gnu2_gd_to_ie_test_SOURCES) \
- $(tls_shared_gnu2_test_SOURCES) $(tls_shared_ie_test_SOURCES) \
- $(tls_shared_nonpic_test_SOURCES) $(tls_shared_test_SOURCES) \
- $(tls_static_pic_test_SOURCES) $(tls_static_test_SOURCES) \
- $(tls_test_SOURCES) $(two_file_mixed_2_shared_test_SOURCES) \
- $(two_file_mixed_shared_test_SOURCES) \
- $(two_file_pic_test_SOURCES) \
- $(two_file_relocatable_test_SOURCES) \
- $(two_file_same_shared_nonpic_test_SOURCES) \
- $(two_file_same_shared_strip_test_SOURCES) \
- $(two_file_same_shared_test_SOURCES) \
- $(two_file_separate_shared_12_nonpic_test_SOURCES) \
- $(two_file_separate_shared_12_test_SOURCES) \
- $(two_file_separate_shared_21_nonpic_test_SOURCES) \
- $(two_file_separate_shared_21_test_SOURCES) \
- $(two_file_shared_1_nonpic_test_SOURCES) \
- $(two_file_shared_1_pic_2_test_SOURCES) \
- $(two_file_shared_1_test_SOURCES) \
- $(two_file_shared_2_nonpic_test_SOURCES) \
- $(two_file_shared_2_pic_1_test_SOURCES) \
- $(two_file_shared_2_test_SOURCES) \
- $(two_file_static_test_SOURCES) two_file_strip_test.c \
- $(two_file_test_SOURCES) $(ver_test_SOURCES) \
- $(ver_test_2_SOURCES) $(ver_test_6_SOURCES) \
- $(ver_test_8_SOURCES) $(ver_test_9_SOURCES) \
- $(weak_alias_test_SOURCES) weak_plt.c $(weak_test_SOURCES) \
- $(weak_undef_nonpic_test_SOURCES) $(weak_undef_test_SOURCES)
-DIST_SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c \
- basic_static_pic_test.c basic_static_test.c basic_test.c \
- $(am__binary_test_SOURCES_DIST) $(binary_unittest_SOURCES) \
- $(am__common_test_1_SOURCES_DIST) \
- $(am__constructor_static_test_SOURCES_DIST) \
- $(am__constructor_test_SOURCES_DIST) \
- $(am__copy_test_SOURCES_DIST) \
- $(am__exception_same_shared_test_SOURCES_DIST) \
- $(am__exception_separate_shared_12_test_SOURCES_DIST) \
- $(am__exception_separate_shared_21_test_SOURCES_DIST) \
- $(am__exception_shared_1_test_SOURCES_DIST) \
- $(am__exception_shared_2_test_SOURCES_DIST) \
- $(am__exception_static_test_SOURCES_DIST) \
- $(am__exception_test_SOURCES_DIST) \
- flagstest_compress_debug_sections.c flagstest_o_specialfile.c \
- flagstest_o_specialfile_and_compress_debug_sections.c \
- $(am__initpri1_SOURCES_DIST) $(am__justsyms_SOURCES_DIST) \
- many_sections_r_test.c $(am__many_sections_test_SOURCES_DIST) \
- $(object_unittest_SOURCES) $(am__protected_1_SOURCES_DIST) \
- $(am__protected_2_SOURCES_DIST) $(am__relro_test_SOURCES_DIST) \
- $(am__script_test_1_SOURCES_DIST) \
- $(am__script_test_2_SOURCES_DIST) script_test_3.c \
- $(am__tls_pic_test_SOURCES_DIST) \
- $(am__tls_shared_gd_to_ie_test_SOURCES_DIST) \
- $(am__tls_shared_gnu2_gd_to_ie_test_SOURCES_DIST) \
- $(am__tls_shared_gnu2_test_SOURCES_DIST) \
- $(am__tls_shared_ie_test_SOURCES_DIST) \
- $(am__tls_shared_nonpic_test_SOURCES_DIST) \
- $(am__tls_shared_test_SOURCES_DIST) \
- $(am__tls_static_pic_test_SOURCES_DIST) \
- $(am__tls_static_test_SOURCES_DIST) \
- $(am__tls_test_SOURCES_DIST) \
- $(am__two_file_mixed_2_shared_test_SOURCES_DIST) \
- $(am__two_file_mixed_shared_test_SOURCES_DIST) \
- $(am__two_file_pic_test_SOURCES_DIST) \
- $(am__two_file_relocatable_test_SOURCES_DIST) \
- $(am__two_file_same_shared_nonpic_test_SOURCES_DIST) \
- $(am__two_file_same_shared_strip_test_SOURCES_DIST) \
- $(am__two_file_same_shared_test_SOURCES_DIST) \
- $(am__two_file_separate_shared_12_nonpic_test_SOURCES_DIST) \
- $(am__two_file_separate_shared_12_test_SOURCES_DIST) \
- $(am__two_file_separate_shared_21_nonpic_test_SOURCES_DIST) \
- $(am__two_file_separate_shared_21_test_SOURCES_DIST) \
- $(am__two_file_shared_1_nonpic_test_SOURCES_DIST) \
- $(am__two_file_shared_1_pic_2_test_SOURCES_DIST) \
- $(am__two_file_shared_1_test_SOURCES_DIST) \
- $(am__two_file_shared_2_nonpic_test_SOURCES_DIST) \
- $(am__two_file_shared_2_pic_1_test_SOURCES_DIST) \
- $(am__two_file_shared_2_test_SOURCES_DIST) \
- $(am__two_file_static_test_SOURCES_DIST) two_file_strip_test.c \
- $(am__two_file_test_SOURCES_DIST) $(am__ver_test_SOURCES_DIST) \
- $(am__ver_test_2_SOURCES_DIST) $(am__ver_test_6_SOURCES_DIST) \
- $(am__ver_test_8_SOURCES_DIST) $(am__ver_test_9_SOURCES_DIST) \
- $(am__weak_alias_test_SOURCES_DIST) weak_plt.c \
- $(am__weak_test_SOURCES_DIST) \
- $(am__weak_undef_nonpic_test_SOURCES_DIST) \
- $(am__weak_undef_test_SOURCES_DIST)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CONSTRUCTOR_PRIORITY_FALSE = @CONSTRUCTOR_PRIORITY_FALSE@
-CONSTRUCTOR_PRIORITY_TRUE = @CONSTRUCTOR_PRIORITY_TRUE@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATADIRNAME = @DATADIRNAME@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FN_PTRS_IN_SO_WITHOUT_PIC_FALSE = @FN_PTRS_IN_SO_WITHOUT_PIC_FALSE@
-FN_PTRS_IN_SO_WITHOUT_PIC_TRUE = @FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@
-GCC_FALSE = @GCC_FALSE@
-GCC_TRUE = @GCC_TRUE@
-GENCAT = @GENCAT@
-GMSGFMT = @GMSGFMT@
-HAVE_ZLIB_FALSE = @HAVE_ZLIB_FALSE@
-HAVE_ZLIB_TRUE = @HAVE_ZLIB_TRUE@
-INCINTL = @INCINTL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INSTOBJEXT = @INSTOBJEXT@
-LDFLAGS = @LDFLAGS@
-LFS_CFLAGS = @LFS_CFLAGS@
-LIBINTL = @LIBINTL@
-LIBINTL_DEP = @LIBINTL_DEP@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-MSGMERGE = @MSGMERGE@
-NATIVE_LINKER_FALSE = @NATIVE_LINKER_FALSE@
-NATIVE_LINKER_TRUE = @NATIVE_LINKER_TRUE@
-NO_WERROR = @NO_WERROR@
-OBJEXT = @OBJEXT@
-OMP_SUPPORT_FALSE = @OMP_SUPPORT_FALSE@
-OMP_SUPPORT_TRUE = @OMP_SUPPORT_TRUE@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POSUB = @POSUB@
-RANDOM_SEED_CFLAGS = @RANDOM_SEED_CFLAGS@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STATIC_TLS_FALSE = @STATIC_TLS_FALSE@
-STATIC_TLS_TRUE = @STATIC_TLS_TRUE@
-STRIP = @STRIP@
-TARGETOBJS = @TARGETOBJS@
-THREADS_FALSE = @THREADS_FALSE@
-THREADS_TRUE = @THREADS_TRUE@
-TLS_DESCRIPTORS_FALSE = @TLS_DESCRIPTORS_FALSE@
-TLS_DESCRIPTORS_TRUE = @TLS_DESCRIPTORS_TRUE@
-TLS_FALSE = @TLS_FALSE@
-TLS_GNU2_DIALECT_FALSE = @TLS_GNU2_DIALECT_FALSE@
-TLS_GNU2_DIALECT_TRUE = @TLS_GNU2_DIALECT_TRUE@
-TLS_TRUE = @TLS_TRUE@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-WARN_CFLAGS = @WARN_CFLAGS@
-WARN_CXXFLAGS = @WARN_CXXFLAGS@
-XGETTEXT = @XGETTEXT@
-YACC = @YACC@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-AUTOMAKE_OPTIONS =
-
-# The two_file_test tests -fmerge-constants, so we simply always turn
-# it on. This may need to be controlled by a configure option
-# eventually.
-AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) -fmerge-constants
-INCLUDES = \
- -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \
- -I$(srcdir)/../../elfcpp -I.. \
- -DLOCALEDIR="\"$(datadir)/locale\"" \
- @INCINTL@
-
-TEST_READELF = $(top_builddir)/../binutils/readelf
-TEST_OBJDUMP = $(top_builddir)/../binutils/objdump
-TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt
-TEST_STRIP = $(top_builddir)/../binutils/strip-new
-@THREADS_TRUE@THREADSLIB = -lpthread
-@OMP_SUPPORT_TRUE@TLS_TEST_C_CFLAGS = -fopenmp
-
-# 'make clean' is good about deleting some intermediate files (such as
-# .o's), but not all of them (such as .so's and .err files). We
-# improve on that here. automake-1.9 info docs say "mostlyclean" is
-# the right choice for files 'make' builds that people rebuild.
-MOSTLYCLEANFILES = *.so $(am__append_16)
-
-# We will add to these later, for each individual test. Note
-# that we add each test under check_SCRIPTS or check_PROGRAMS;
-# the TESTS variable is automatically populated from these.
-check_SCRIPTS = $(am__append_6)
-check_DATA = $(am__append_7)
-BUILT_SOURCES = $(am__append_14)
-TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
-
-# ---------------------------------------------------------------------
-# These tests test the internals of gold (unittests).
-
-# Infrastucture needed for the unittests
-check_LIBRARIES = libgoldtest.a
-libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc
-DEPENDENCIES = \
- libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP)
-
-LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \
- $(THREADSLIB)
-
-object_unittest_SOURCES = object_unittest.cc
-binary_unittest_SOURCES = binary_unittest.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@constructor_test_SOURCES = constructor_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@constructor_test_DEPENDENCIES = gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@constructor_test_LDFLAGS = -Bgcctestdir/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@constructor_static_test_SOURCES = $(constructor_test_SOURCES)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_SOURCES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_1.cc \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_1b.cc \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_2.cc \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.cc \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test.h
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_DEPENDENCIES = gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_LDFLAGS = -Bgcctestdir/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_static_test_SOURCES = $(two_file_test_SOURCES)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_pic_test_SOURCES = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_pic_test_DEPENDENCIES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_pic_test_LDFLAGS = -Bgcctestdir/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_test_LDADD = two_file_shared_1.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_test_LDADD = two_file_shared_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_pic_2_test_DEPENDENCIES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_shared_1.so two_file_test_1_pic.o two_file_test_1b_pic.o
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_pic_2_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_shared_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_pic_1_test_DEPENDENCIES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_same_shared_test_SOURCES = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_same_shared_test_LDADD = two_file_shared.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_12_test_DEPENDENCIES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_12_test_LDADD = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_1.so two_file_shared_2.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_21_test_DEPENDENCIES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_21_test_LDADD = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_2.so two_file_shared_1.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_relocatable_test_SOURCES = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_relocatable_test_DEPENDENCIES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_relocatable.o
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_relocatable_test_LDADD = two_file_relocatable.o
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_nonpic_test_SOURCES = \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_2.cc two_file_test_main.cc
-
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_nonpic_test_DEPENDENCIES = \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_shared_1_nonpic.so
-
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_nonpic_test_SOURCES = \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
-
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_nonpic_test_DEPENDENCIES = \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_shared_2_nonpic.so
-
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_same_shared_nonpic_test_DEPENDENCIES = \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_shared_nonpic.so
-
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
-
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_12_nonpic_test_LDADD = \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
-
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
-
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_21_nonpic_test_LDADD = \
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so
-
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_mixed_shared_test_SOURCES = two_file_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_same_shared_strip_test_DEPENDENCIES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld two_file_shared_strip.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@common_test_1_SOURCES = common_test_1.c
-@GCC_TRUE@@NATIVE_LINKER_TRUE@common_test_1_DEPENDENCIES = gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@common_test_1_LDFLAGS = -Bgcctestdir/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_test_SOURCES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.cc \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_1.cc \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_2.cc \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test.h
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_test_DEPENDENCIES = gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_test_LDFLAGS = -Bgcctestdir/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_static_test_SOURCES = $(exception_test_SOURCES)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_1_test_LDADD = exception_shared_1.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_2_test_LDADD = exception_shared_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_same_shared_test_SOURCES = exception_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_same_shared_test_LDADD = exception_shared.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_12_test_SOURCES = exception_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_12_test_DEPENDENCIES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld exception_shared_1.so exception_shared_2.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_12_test_LDADD = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_shared_1.so exception_shared_2.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_21_test_SOURCES = exception_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_21_test_DEPENDENCIES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld exception_shared_1.so exception_shared_2.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_21_test_LDADD = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_shared_2.so exception_shared_1.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_test_SOURCES = weak_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_test_DEPENDENCIES = gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_test_LDFLAGS = -Bgcctestdir/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_test_SOURCES = weak_undef_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_test_LDADD = -L . weak_undef_lib.so
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_nonpic_test_SOURCES = weak_undef_test.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_alias_test_SOURCES = weak_alias_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_alias_test_DEPENDENCIES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_alias_test_3.o weak_alias_test_4.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_alias_test_LDADD = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ weak_alias_test_4.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@copy_test_SOURCES = copy_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@copy_test_LDADD = copy_test_1.so copy_test_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_LDFLAGS = -Bgcctestdir/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_LDADD = tls_test_c.o -lpthread
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_pic_test_SOURCES = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_c_pic.o
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_pic_test_LDFLAGS = -Bgcctestdir/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ -lpthread
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_test_SOURCES = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_test_LDADD = tls_test_shared.so -lpthread
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_ie_test_SOURCES = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_c_pic.o tls_test_shared2.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ tls_test_shared2.so -lpthread
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@ tls_test_c_gnu2.o tls_test_gnu2_shared2.so
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@ tls_test_gnu2_shared2.so -lpthread
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_DESCRIPTORS_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_shared_gnu2_test_SOURCES = tls_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_DESCRIPTORS_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_DESCRIPTORS_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_DESCRIPTORS_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@tls_static_test_SOURCES = $(tls_test_SOURCES)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@tls_static_test_LDADD = $(tls_test_LDADD)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@STATIC_TLS_TRUE@@TLS_TRUE@tls_static_pic_test_LDADD = $(tls_pic_test_LDADD)
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_nonpic_test_SOURCES = tls_test_main.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread
-@GCC_TRUE@@NATIVE_LINKER_TRUE@many_sections_test_SOURCES = many_sections_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@many_sections_test_DEPENDENCIES = gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic
-@CONSTRUCTOR_PRIORITY_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri1_SOURCES = initpri1.c
-@CONSTRUCTOR_PRIORITY_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri1_DEPENDENCIES = gcctestdir/ld
-@CONSTRUCTOR_PRIORITY_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri1_LDFLAGS = -Bgcctestdir/
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_SOURCES = ver_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_2_SOURCES = ver_test_main_2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_2_LDADD = ver_test_4.so ver_test_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_6_SOURCES = ver_test_6.c
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_6_LDADD = ver_test_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_8_SOURCES = two_file_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_9_SOURCES = ver_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_9_LDADD = ver_test_9.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@protected_1_SOURCES = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ protected_main_1.cc protected_main_2.cc protected_main_3.cc
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@protected_1_LDADD = protected_1.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@protected_2_SOURCES = protected_main_1.cc protected_3.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@protected_2_LDADD = protected_1.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@relro_test_SOURCES = relro_test_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@relro_test_LDADD = relro_test.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@script_test_1_SOURCES = script_test_1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t
-@GCC_TRUE@@NATIVE_LINKER_TRUE@script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t
-@GCC_TRUE@@NATIVE_LINKER_TRUE@script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t
-@GCC_TRUE@@NATIVE_LINKER_TRUE@script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t
-@GCC_TRUE@@NATIVE_LINKER_TRUE@justsyms_SOURCES = justsyms_1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@binary_test_SOURCES = binary_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@binary_test_DEPENDENCIES = gcctestdir/ld binary.txt
-@GCC_TRUE@@NATIVE_LINKER_TRUE@binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf
-all: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .cc .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign testsuite/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign testsuite/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-clean-checkLIBRARIES:
- -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES)
-libgoldtest.a: $(libgoldtest_a_OBJECTS) $(libgoldtest_a_DEPENDENCIES)
- -rm -f libgoldtest.a
- $(libgoldtest_a_AR) libgoldtest.a $(libgoldtest_a_OBJECTS) $(libgoldtest_a_LIBADD)
- $(RANLIB) libgoldtest.a
-
-clean-checkPROGRAMS:
- -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
-@GCC_FALSE@basic_pic_test$(EXEEXT): $(basic_pic_test_OBJECTS) $(basic_pic_test_DEPENDENCIES)
-@GCC_FALSE@ @rm -f basic_pic_test$(EXEEXT)
-@GCC_FALSE@ $(LINK) $(basic_pic_test_LDFLAGS) $(basic_pic_test_OBJECTS) $(basic_pic_test_LDADD) $(LIBS)
-@NATIVE_LINKER_FALSE@basic_pic_test$(EXEEXT): $(basic_pic_test_OBJECTS) $(basic_pic_test_DEPENDENCIES)
-@NATIVE_LINKER_FALSE@ @rm -f basic_pic_test$(EXEEXT)
-@NATIVE_LINKER_FALSE@ $(LINK) $(basic_pic_test_LDFLAGS) $(basic_pic_test_OBJECTS) $(basic_pic_test_LDADD) $(LIBS)
-@GCC_FALSE@basic_static_pic_test$(EXEEXT): $(basic_static_pic_test_OBJECTS) $(basic_static_pic_test_DEPENDENCIES)
-@GCC_FALSE@ @rm -f basic_static_pic_test$(EXEEXT)
-@GCC_FALSE@ $(LINK) $(basic_static_pic_test_LDFLAGS) $(basic_static_pic_test_OBJECTS) $(basic_static_pic_test_LDADD) $(LIBS)
-@NATIVE_LINKER_FALSE@basic_static_pic_test$(EXEEXT): $(basic_static_pic_test_OBJECTS) $(basic_static_pic_test_DEPENDENCIES)
-@NATIVE_LINKER_FALSE@ @rm -f basic_static_pic_test$(EXEEXT)
-@NATIVE_LINKER_FALSE@ $(LINK) $(basic_static_pic_test_LDFLAGS) $(basic_static_pic_test_OBJECTS) $(basic_static_pic_test_LDADD) $(LIBS)
-@GCC_FALSE@basic_static_test$(EXEEXT): $(basic_static_test_OBJECTS) $(basic_static_test_DEPENDENCIES)
-@GCC_FALSE@ @rm -f basic_static_test$(EXEEXT)
-@GCC_FALSE@ $(LINK) $(basic_static_test_LDFLAGS) $(basic_static_test_OBJECTS) $(basic_static_test_LDADD) $(LIBS)
-@NATIVE_LINKER_FALSE@basic_static_test$(EXEEXT): $(basic_static_test_OBJECTS) $(basic_static_test_DEPENDENCIES)
-@NATIVE_LINKER_FALSE@ @rm -f basic_static_test$(EXEEXT)
-@NATIVE_LINKER_FALSE@ $(LINK) $(basic_static_test_LDFLAGS) $(basic_static_test_OBJECTS) $(basic_static_test_LDADD) $(LIBS)
-@GCC_FALSE@basic_test$(EXEEXT): $(basic_test_OBJECTS) $(basic_test_DEPENDENCIES)
-@GCC_FALSE@ @rm -f basic_test$(EXEEXT)
-@GCC_FALSE@ $(LINK) $(basic_test_LDFLAGS) $(basic_test_OBJECTS) $(basic_test_LDADD) $(LIBS)
-@NATIVE_LINKER_FALSE@basic_test$(EXEEXT): $(basic_test_OBJECTS) $(basic_test_DEPENDENCIES)
-@NATIVE_LINKER_FALSE@ @rm -f basic_test$(EXEEXT)
-@NATIVE_LINKER_FALSE@ $(LINK) $(basic_test_LDFLAGS) $(basic_test_OBJECTS) $(basic_test_LDADD) $(LIBS)
-binary_test$(EXEEXT): $(binary_test_OBJECTS) $(binary_test_DEPENDENCIES)
- @rm -f binary_test$(EXEEXT)
- $(CXXLINK) $(binary_test_LDFLAGS) $(binary_test_OBJECTS) $(binary_test_LDADD) $(LIBS)
-binary_unittest$(EXEEXT): $(binary_unittest_OBJECTS) $(binary_unittest_DEPENDENCIES)
- @rm -f binary_unittest$(EXEEXT)
- $(CXXLINK) $(binary_unittest_LDFLAGS) $(binary_unittest_OBJECTS) $(binary_unittest_LDADD) $(LIBS)
-common_test_1$(EXEEXT): $(common_test_1_OBJECTS) $(common_test_1_DEPENDENCIES)
- @rm -f common_test_1$(EXEEXT)
- $(LINK) $(common_test_1_LDFLAGS) $(common_test_1_OBJECTS) $(common_test_1_LDADD) $(LIBS)
-constructor_static_test$(EXEEXT): $(constructor_static_test_OBJECTS) $(constructor_static_test_DEPENDENCIES)
- @rm -f constructor_static_test$(EXEEXT)
- $(CXXLINK) $(constructor_static_test_LDFLAGS) $(constructor_static_test_OBJECTS) $(constructor_static_test_LDADD) $(LIBS)
-constructor_test$(EXEEXT): $(constructor_test_OBJECTS) $(constructor_test_DEPENDENCIES)
- @rm -f constructor_test$(EXEEXT)
- $(CXXLINK) $(constructor_test_LDFLAGS) $(constructor_test_OBJECTS) $(constructor_test_LDADD) $(LIBS)
-copy_test$(EXEEXT): $(copy_test_OBJECTS) $(copy_test_DEPENDENCIES)
- @rm -f copy_test$(EXEEXT)
- $(CXXLINK) $(copy_test_LDFLAGS) $(copy_test_OBJECTS) $(copy_test_LDADD) $(LIBS)
-exception_same_shared_test$(EXEEXT): $(exception_same_shared_test_OBJECTS) $(exception_same_shared_test_DEPENDENCIES)
- @rm -f exception_same_shared_test$(EXEEXT)
- $(CXXLINK) $(exception_same_shared_test_LDFLAGS) $(exception_same_shared_test_OBJECTS) $(exception_same_shared_test_LDADD) $(LIBS)
-exception_separate_shared_12_test$(EXEEXT): $(exception_separate_shared_12_test_OBJECTS) $(exception_separate_shared_12_test_DEPENDENCIES)
- @rm -f exception_separate_shared_12_test$(EXEEXT)
- $(CXXLINK) $(exception_separate_shared_12_test_LDFLAGS) $(exception_separate_shared_12_test_OBJECTS) $(exception_separate_shared_12_test_LDADD) $(LIBS)
-exception_separate_shared_21_test$(EXEEXT): $(exception_separate_shared_21_test_OBJECTS) $(exception_separate_shared_21_test_DEPENDENCIES)
- @rm -f exception_separate_shared_21_test$(EXEEXT)
- $(CXXLINK) $(exception_separate_shared_21_test_LDFLAGS) $(exception_separate_shared_21_test_OBJECTS) $(exception_separate_shared_21_test_LDADD) $(LIBS)
-exception_shared_1_test$(EXEEXT): $(exception_shared_1_test_OBJECTS) $(exception_shared_1_test_DEPENDENCIES)
- @rm -f exception_shared_1_test$(EXEEXT)
- $(CXXLINK) $(exception_shared_1_test_LDFLAGS) $(exception_shared_1_test_OBJECTS) $(exception_shared_1_test_LDADD) $(LIBS)
-exception_shared_2_test$(EXEEXT): $(exception_shared_2_test_OBJECTS) $(exception_shared_2_test_DEPENDENCIES)
- @rm -f exception_shared_2_test$(EXEEXT)
- $(CXXLINK) $(exception_shared_2_test_LDFLAGS) $(exception_shared_2_test_OBJECTS) $(exception_shared_2_test_LDADD) $(LIBS)
-exception_static_test$(EXEEXT): $(exception_static_test_OBJECTS) $(exception_static_test_DEPENDENCIES)
- @rm -f exception_static_test$(EXEEXT)
- $(CXXLINK) $(exception_static_test_LDFLAGS) $(exception_static_test_OBJECTS) $(exception_static_test_LDADD) $(LIBS)
-exception_test$(EXEEXT): $(exception_test_OBJECTS) $(exception_test_DEPENDENCIES)
- @rm -f exception_test$(EXEEXT)
- $(CXXLINK) $(exception_test_LDFLAGS) $(exception_test_OBJECTS) $(exception_test_LDADD) $(LIBS)
-@GCC_FALSE@flagstest_compress_debug_sections$(EXEEXT): $(flagstest_compress_debug_sections_OBJECTS) $(flagstest_compress_debug_sections_DEPENDENCIES)
-@GCC_FALSE@ @rm -f flagstest_compress_debug_sections$(EXEEXT)
-@GCC_FALSE@ $(LINK) $(flagstest_compress_debug_sections_LDFLAGS) $(flagstest_compress_debug_sections_OBJECTS) $(flagstest_compress_debug_sections_LDADD) $(LIBS)
-@HAVE_ZLIB_FALSE@flagstest_compress_debug_sections$(EXEEXT): $(flagstest_compress_debug_sections_OBJECTS) $(flagstest_compress_debug_sections_DEPENDENCIES)
-@HAVE_ZLIB_FALSE@ @rm -f flagstest_compress_debug_sections$(EXEEXT)
-@HAVE_ZLIB_FALSE@ $(LINK) $(flagstest_compress_debug_sections_LDFLAGS) $(flagstest_compress_debug_sections_OBJECTS) $(flagstest_compress_debug_sections_LDADD) $(LIBS)
-@NATIVE_LINKER_FALSE@flagstest_compress_debug_sections$(EXEEXT): $(flagstest_compress_debug_sections_OBJECTS) $(flagstest_compress_debug_sections_DEPENDENCIES)
-@NATIVE_LINKER_FALSE@ @rm -f flagstest_compress_debug_sections$(EXEEXT)
-@NATIVE_LINKER_FALSE@ $(LINK) $(flagstest_compress_debug_sections_LDFLAGS) $(flagstest_compress_debug_sections_OBJECTS) $(flagstest_compress_debug_sections_LDADD) $(LIBS)
-@GCC_FALSE@flagstest_o_specialfile$(EXEEXT): $(flagstest_o_specialfile_OBJECTS) $(flagstest_o_specialfile_DEPENDENCIES)
-@GCC_FALSE@ @rm -f flagstest_o_specialfile$(EXEEXT)
-@GCC_FALSE@ $(LINK) $(flagstest_o_specialfile_LDFLAGS) $(flagstest_o_specialfile_OBJECTS) $(flagstest_o_specialfile_LDADD) $(LIBS)
-@NATIVE_LINKER_FALSE@flagstest_o_specialfile$(EXEEXT): $(flagstest_o_specialfile_OBJECTS) $(flagstest_o_specialfile_DEPENDENCIES)
-@NATIVE_LINKER_FALSE@ @rm -f flagstest_o_specialfile$(EXEEXT)
-@NATIVE_LINKER_FALSE@ $(LINK) $(flagstest_o_specialfile_LDFLAGS) $(flagstest_o_specialfile_OBJECTS) $(flagstest_o_specialfile_LDADD) $(LIBS)
-@GCC_FALSE@flagstest_o_specialfile_and_compress_debug_sections$(EXEEXT): $(flagstest_o_specialfile_and_compress_debug_sections_OBJECTS) $(flagstest_o_specialfile_and_compress_debug_sections_DEPENDENCIES)
-@GCC_FALSE@ @rm -f flagstest_o_specialfile_and_compress_debug_sections$(EXEEXT)
-@GCC_FALSE@ $(LINK) $(flagstest_o_specialfile_and_compress_debug_sections_LDFLAGS) $(flagstest_o_specialfile_and_compress_debug_sections_OBJECTS) $(flagstest_o_specialfile_and_compress_debug_sections_LDADD) $(LIBS)
-@HAVE_ZLIB_FALSE@flagstest_o_specialfile_and_compress_debug_sections$(EXEEXT): $(flagstest_o_specialfile_and_compress_debug_sections_OBJECTS) $(flagstest_o_specialfile_and_compress_debug_sections_DEPENDENCIES)
-@HAVE_ZLIB_FALSE@ @rm -f flagstest_o_specialfile_and_compress_debug_sections$(EXEEXT)
-@HAVE_ZLIB_FALSE@ $(LINK) $(flagstest_o_specialfile_and_compress_debug_sections_LDFLAGS) $(flagstest_o_specialfile_and_compress_debug_sections_OBJECTS) $(flagstest_o_specialfile_and_compress_debug_sections_LDADD) $(LIBS)
-@NATIVE_LINKER_FALSE@flagstest_o_specialfile_and_compress_debug_sections$(EXEEXT): $(flagstest_o_specialfile_and_compress_debug_sections_OBJECTS) $(flagstest_o_specialfile_and_compress_debug_sections_DEPENDENCIES)
-@NATIVE_LINKER_FALSE@ @rm -f flagstest_o_specialfile_and_compress_debug_sections$(EXEEXT)
-@NATIVE_LINKER_FALSE@ $(LINK) $(flagstest_o_specialfile_and_compress_debug_sections_LDFLAGS) $(flagstest_o_specialfile_and_compress_debug_sections_OBJECTS) $(flagstest_o_specialfile_and_compress_debug_sections_LDADD) $(LIBS)
-initpri1$(EXEEXT): $(initpri1_OBJECTS) $(initpri1_DEPENDENCIES)
- @rm -f initpri1$(EXEEXT)
- $(LINK) $(initpri1_LDFLAGS) $(initpri1_OBJECTS) $(initpri1_LDADD) $(LIBS)
-justsyms$(EXEEXT): $(justsyms_OBJECTS) $(justsyms_DEPENDENCIES)
- @rm -f justsyms$(EXEEXT)
- $(CXXLINK) $(justsyms_LDFLAGS) $(justsyms_OBJECTS) $(justsyms_LDADD) $(LIBS)
-@GCC_FALSE@many_sections_r_test$(EXEEXT): $(many_sections_r_test_OBJECTS) $(many_sections_r_test_DEPENDENCIES)
-@GCC_FALSE@ @rm -f many_sections_r_test$(EXEEXT)
-@GCC_FALSE@ $(LINK) $(many_sections_r_test_LDFLAGS) $(many_sections_r_test_OBJECTS) $(many_sections_r_test_LDADD) $(LIBS)
-@NATIVE_LINKER_FALSE@many_sections_r_test$(EXEEXT): $(many_sections_r_test_OBJECTS) $(many_sections_r_test_DEPENDENCIES)
-@NATIVE_LINKER_FALSE@ @rm -f many_sections_r_test$(EXEEXT)
-@NATIVE_LINKER_FALSE@ $(LINK) $(many_sections_r_test_LDFLAGS) $(many_sections_r_test_OBJECTS) $(many_sections_r_test_LDADD) $(LIBS)
-many_sections_test$(EXEEXT): $(many_sections_test_OBJECTS) $(many_sections_test_DEPENDENCIES)
- @rm -f many_sections_test$(EXEEXT)
- $(CXXLINK) $(many_sections_test_LDFLAGS) $(many_sections_test_OBJECTS) $(many_sections_test_LDADD) $(LIBS)
-object_unittest$(EXEEXT): $(object_unittest_OBJECTS) $(object_unittest_DEPENDENCIES)
- @rm -f object_unittest$(EXEEXT)
- $(CXXLINK) $(object_unittest_LDFLAGS) $(object_unittest_OBJECTS) $(object_unittest_LDADD) $(LIBS)
-protected_1$(EXEEXT): $(protected_1_OBJECTS) $(protected_1_DEPENDENCIES)
- @rm -f protected_1$(EXEEXT)
- $(CXXLINK) $(protected_1_LDFLAGS) $(protected_1_OBJECTS) $(protected_1_LDADD) $(LIBS)
-protected_2$(EXEEXT): $(protected_2_OBJECTS) $(protected_2_DEPENDENCIES)
- @rm -f protected_2$(EXEEXT)
- $(CXXLINK) $(protected_2_LDFLAGS) $(protected_2_OBJECTS) $(protected_2_LDADD) $(LIBS)
-relro_test$(EXEEXT): $(relro_test_OBJECTS) $(relro_test_DEPENDENCIES)
- @rm -f relro_test$(EXEEXT)
- $(CXXLINK) $(relro_test_LDFLAGS) $(relro_test_OBJECTS) $(relro_test_LDADD) $(LIBS)
-script_test_1$(EXEEXT): $(script_test_1_OBJECTS) $(script_test_1_DEPENDENCIES)
- @rm -f script_test_1$(EXEEXT)
- $(CXXLINK) $(script_test_1_LDFLAGS) $(script_test_1_OBJECTS) $(script_test_1_LDADD) $(LIBS)
-script_test_2$(EXEEXT): $(script_test_2_OBJECTS) $(script_test_2_DEPENDENCIES)
- @rm -f script_test_2$(EXEEXT)
- $(CXXLINK) $(script_test_2_LDFLAGS) $(script_test_2_OBJECTS) $(script_test_2_LDADD) $(LIBS)
-@GCC_FALSE@script_test_3$(EXEEXT): $(script_test_3_OBJECTS) $(script_test_3_DEPENDENCIES)
-@GCC_FALSE@ @rm -f script_test_3$(EXEEXT)
-@GCC_FALSE@ $(LINK) $(script_test_3_LDFLAGS) $(script_test_3_OBJECTS) $(script_test_3_LDADD) $(LIBS)
-@NATIVE_LINKER_FALSE@script_test_3$(EXEEXT): $(script_test_3_OBJECTS) $(script_test_3_DEPENDENCIES)
-@NATIVE_LINKER_FALSE@ @rm -f script_test_3$(EXEEXT)
-@NATIVE_LINKER_FALSE@ $(LINK) $(script_test_3_LDFLAGS) $(script_test_3_OBJECTS) $(script_test_3_LDADD) $(LIBS)
-tls_pic_test$(EXEEXT): $(tls_pic_test_OBJECTS) $(tls_pic_test_DEPENDENCIES)
- @rm -f tls_pic_test$(EXEEXT)
- $(CXXLINK) $(tls_pic_test_LDFLAGS) $(tls_pic_test_OBJECTS) $(tls_pic_test_LDADD) $(LIBS)
-tls_shared_gd_to_ie_test$(EXEEXT): $(tls_shared_gd_to_ie_test_OBJECTS) $(tls_shared_gd_to_ie_test_DEPENDENCIES)
- @rm -f tls_shared_gd_to_ie_test$(EXEEXT)
- $(CXXLINK) $(tls_shared_gd_to_ie_test_LDFLAGS) $(tls_shared_gd_to_ie_test_OBJECTS) $(tls_shared_gd_to_ie_test_LDADD) $(LIBS)
-tls_shared_gnu2_gd_to_ie_test$(EXEEXT): $(tls_shared_gnu2_gd_to_ie_test_OBJECTS) $(tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES)
- @rm -f tls_shared_gnu2_gd_to_ie_test$(EXEEXT)
- $(CXXLINK) $(tls_shared_gnu2_gd_to_ie_test_LDFLAGS) $(tls_shared_gnu2_gd_to_ie_test_OBJECTS) $(tls_shared_gnu2_gd_to_ie_test_LDADD) $(LIBS)
-tls_shared_gnu2_test$(EXEEXT): $(tls_shared_gnu2_test_OBJECTS) $(tls_shared_gnu2_test_DEPENDENCIES)
- @rm -f tls_shared_gnu2_test$(EXEEXT)
- $(CXXLINK) $(tls_shared_gnu2_test_LDFLAGS) $(tls_shared_gnu2_test_OBJECTS) $(tls_shared_gnu2_test_LDADD) $(LIBS)
-tls_shared_ie_test$(EXEEXT): $(tls_shared_ie_test_OBJECTS) $(tls_shared_ie_test_DEPENDENCIES)
- @rm -f tls_shared_ie_test$(EXEEXT)
- $(CXXLINK) $(tls_shared_ie_test_LDFLAGS) $(tls_shared_ie_test_OBJECTS) $(tls_shared_ie_test_LDADD) $(LIBS)
-tls_shared_nonpic_test$(EXEEXT): $(tls_shared_nonpic_test_OBJECTS) $(tls_shared_nonpic_test_DEPENDENCIES)
- @rm -f tls_shared_nonpic_test$(EXEEXT)
- $(CXXLINK) $(tls_shared_nonpic_test_LDFLAGS) $(tls_shared_nonpic_test_OBJECTS) $(tls_shared_nonpic_test_LDADD) $(LIBS)
-tls_shared_test$(EXEEXT): $(tls_shared_test_OBJECTS) $(tls_shared_test_DEPENDENCIES)
- @rm -f tls_shared_test$(EXEEXT)
- $(CXXLINK) $(tls_shared_test_LDFLAGS) $(tls_shared_test_OBJECTS) $(tls_shared_test_LDADD) $(LIBS)
-tls_static_pic_test$(EXEEXT): $(tls_static_pic_test_OBJECTS) $(tls_static_pic_test_DEPENDENCIES)
- @rm -f tls_static_pic_test$(EXEEXT)
- $(CXXLINK) $(tls_static_pic_test_LDFLAGS) $(tls_static_pic_test_OBJECTS) $(tls_static_pic_test_LDADD) $(LIBS)
-tls_static_test$(EXEEXT): $(tls_static_test_OBJECTS) $(tls_static_test_DEPENDENCIES)
- @rm -f tls_static_test$(EXEEXT)
- $(CXXLINK) $(tls_static_test_LDFLAGS) $(tls_static_test_OBJECTS) $(tls_static_test_LDADD) $(LIBS)
-tls_test$(EXEEXT): $(tls_test_OBJECTS) $(tls_test_DEPENDENCIES)
- @rm -f tls_test$(EXEEXT)
- $(CXXLINK) $(tls_test_LDFLAGS) $(tls_test_OBJECTS) $(tls_test_LDADD) $(LIBS)
-two_file_mixed_2_shared_test$(EXEEXT): $(two_file_mixed_2_shared_test_OBJECTS) $(two_file_mixed_2_shared_test_DEPENDENCIES)
- @rm -f two_file_mixed_2_shared_test$(EXEEXT)
- $(CXXLINK) $(two_file_mixed_2_shared_test_LDFLAGS) $(two_file_mixed_2_shared_test_OBJECTS) $(two_file_mixed_2_shared_test_LDADD) $(LIBS)
-two_file_mixed_shared_test$(EXEEXT): $(two_file_mixed_shared_test_OBJECTS) $(two_file_mixed_shared_test_DEPENDENCIES)
- @rm -f two_file_mixed_shared_test$(EXEEXT)
- $(CXXLINK) $(two_file_mixed_shared_test_LDFLAGS) $(two_file_mixed_shared_test_OBJECTS) $(two_file_mixed_shared_test_LDADD) $(LIBS)
-two_file_pic_test$(EXEEXT): $(two_file_pic_test_OBJECTS) $(two_file_pic_test_DEPENDENCIES)
- @rm -f two_file_pic_test$(EXEEXT)
- $(CXXLINK) $(two_file_pic_test_LDFLAGS) $(two_file_pic_test_OBJECTS) $(two_file_pic_test_LDADD) $(LIBS)
-two_file_relocatable_test$(EXEEXT): $(two_file_relocatable_test_OBJECTS) $(two_file_relocatable_test_DEPENDENCIES)
- @rm -f two_file_relocatable_test$(EXEEXT)
- $(CXXLINK) $(two_file_relocatable_test_LDFLAGS) $(two_file_relocatable_test_OBJECTS) $(two_file_relocatable_test_LDADD) $(LIBS)
-two_file_same_shared_nonpic_test$(EXEEXT): $(two_file_same_shared_nonpic_test_OBJECTS) $(two_file_same_shared_nonpic_test_DEPENDENCIES)
- @rm -f two_file_same_shared_nonpic_test$(EXEEXT)
- $(CXXLINK) $(two_file_same_shared_nonpic_test_LDFLAGS) $(two_file_same_shared_nonpic_test_OBJECTS) $(two_file_same_shared_nonpic_test_LDADD) $(LIBS)
-two_file_same_shared_strip_test$(EXEEXT): $(two_file_same_shared_strip_test_OBJECTS) $(two_file_same_shared_strip_test_DEPENDENCIES)
- @rm -f two_file_same_shared_strip_test$(EXEEXT)
- $(CXXLINK) $(two_file_same_shared_strip_test_LDFLAGS) $(two_file_same_shared_strip_test_OBJECTS) $(two_file_same_shared_strip_test_LDADD) $(LIBS)
-two_file_same_shared_test$(EXEEXT): $(two_file_same_shared_test_OBJECTS) $(two_file_same_shared_test_DEPENDENCIES)
- @rm -f two_file_same_shared_test$(EXEEXT)
- $(CXXLINK) $(two_file_same_shared_test_LDFLAGS) $(two_file_same_shared_test_OBJECTS) $(two_file_same_shared_test_LDADD) $(LIBS)
-two_file_separate_shared_12_nonpic_test$(EXEEXT): $(two_file_separate_shared_12_nonpic_test_OBJECTS) $(two_file_separate_shared_12_nonpic_test_DEPENDENCIES)
- @rm -f two_file_separate_shared_12_nonpic_test$(EXEEXT)
- $(CXXLINK) $(two_file_separate_shared_12_nonpic_test_LDFLAGS) $(two_file_separate_shared_12_nonpic_test_OBJECTS) $(two_file_separate_shared_12_nonpic_test_LDADD) $(LIBS)
-two_file_separate_shared_12_test$(EXEEXT): $(two_file_separate_shared_12_test_OBJECTS) $(two_file_separate_shared_12_test_DEPENDENCIES)
- @rm -f two_file_separate_shared_12_test$(EXEEXT)
- $(CXXLINK) $(two_file_separate_shared_12_test_LDFLAGS) $(two_file_separate_shared_12_test_OBJECTS) $(two_file_separate_shared_12_test_LDADD) $(LIBS)
-two_file_separate_shared_21_nonpic_test$(EXEEXT): $(two_file_separate_shared_21_nonpic_test_OBJECTS) $(two_file_separate_shared_21_nonpic_test_DEPENDENCIES)
- @rm -f two_file_separate_shared_21_nonpic_test$(EXEEXT)
- $(CXXLINK) $(two_file_separate_shared_21_nonpic_test_LDFLAGS) $(two_file_separate_shared_21_nonpic_test_OBJECTS) $(two_file_separate_shared_21_nonpic_test_LDADD) $(LIBS)
-two_file_separate_shared_21_test$(EXEEXT): $(two_file_separate_shared_21_test_OBJECTS) $(two_file_separate_shared_21_test_DEPENDENCIES)
- @rm -f two_file_separate_shared_21_test$(EXEEXT)
- $(CXXLINK) $(two_file_separate_shared_21_test_LDFLAGS) $(two_file_separate_shared_21_test_OBJECTS) $(two_file_separate_shared_21_test_LDADD) $(LIBS)
-two_file_shared_1_nonpic_test$(EXEEXT): $(two_file_shared_1_nonpic_test_OBJECTS) $(two_file_shared_1_nonpic_test_DEPENDENCIES)
- @rm -f two_file_shared_1_nonpic_test$(EXEEXT)
- $(CXXLINK) $(two_file_shared_1_nonpic_test_LDFLAGS) $(two_file_shared_1_nonpic_test_OBJECTS) $(two_file_shared_1_nonpic_test_LDADD) $(LIBS)
-two_file_shared_1_pic_2_test$(EXEEXT): $(two_file_shared_1_pic_2_test_OBJECTS) $(two_file_shared_1_pic_2_test_DEPENDENCIES)
- @rm -f two_file_shared_1_pic_2_test$(EXEEXT)
- $(CXXLINK) $(two_file_shared_1_pic_2_test_LDFLAGS) $(two_file_shared_1_pic_2_test_OBJECTS) $(two_file_shared_1_pic_2_test_LDADD) $(LIBS)
-two_file_shared_1_test$(EXEEXT): $(two_file_shared_1_test_OBJECTS) $(two_file_shared_1_test_DEPENDENCIES)
- @rm -f two_file_shared_1_test$(EXEEXT)
- $(CXXLINK) $(two_file_shared_1_test_LDFLAGS) $(two_file_shared_1_test_OBJECTS) $(two_file_shared_1_test_LDADD) $(LIBS)
-two_file_shared_2_nonpic_test$(EXEEXT): $(two_file_shared_2_nonpic_test_OBJECTS) $(two_file_shared_2_nonpic_test_DEPENDENCIES)
- @rm -f two_file_shared_2_nonpic_test$(EXEEXT)
- $(CXXLINK) $(two_file_shared_2_nonpic_test_LDFLAGS) $(two_file_shared_2_nonpic_test_OBJECTS) $(two_file_shared_2_nonpic_test_LDADD) $(LIBS)
-two_file_shared_2_pic_1_test$(EXEEXT): $(two_file_shared_2_pic_1_test_OBJECTS) $(two_file_shared_2_pic_1_test_DEPENDENCIES)
- @rm -f two_file_shared_2_pic_1_test$(EXEEXT)
- $(CXXLINK) $(two_file_shared_2_pic_1_test_LDFLAGS) $(two_file_shared_2_pic_1_test_OBJECTS) $(two_file_shared_2_pic_1_test_LDADD) $(LIBS)
-two_file_shared_2_test$(EXEEXT): $(two_file_shared_2_test_OBJECTS) $(two_file_shared_2_test_DEPENDENCIES)
- @rm -f two_file_shared_2_test$(EXEEXT)
- $(CXXLINK) $(two_file_shared_2_test_LDFLAGS) $(two_file_shared_2_test_OBJECTS) $(two_file_shared_2_test_LDADD) $(LIBS)
-two_file_static_test$(EXEEXT): $(two_file_static_test_OBJECTS) $(two_file_static_test_DEPENDENCIES)
- @rm -f two_file_static_test$(EXEEXT)
- $(CXXLINK) $(two_file_static_test_LDFLAGS) $(two_file_static_test_OBJECTS) $(two_file_static_test_LDADD) $(LIBS)
-@GCC_FALSE@two_file_strip_test$(EXEEXT): $(two_file_strip_test_OBJECTS) $(two_file_strip_test_DEPENDENCIES)
-@GCC_FALSE@ @rm -f two_file_strip_test$(EXEEXT)
-@GCC_FALSE@ $(LINK) $(two_file_strip_test_LDFLAGS) $(two_file_strip_test_OBJECTS) $(two_file_strip_test_LDADD) $(LIBS)
-@NATIVE_LINKER_FALSE@two_file_strip_test$(EXEEXT): $(two_file_strip_test_OBJECTS) $(two_file_strip_test_DEPENDENCIES)
-@NATIVE_LINKER_FALSE@ @rm -f two_file_strip_test$(EXEEXT)
-@NATIVE_LINKER_FALSE@ $(LINK) $(two_file_strip_test_LDFLAGS) $(two_file_strip_test_OBJECTS) $(two_file_strip_test_LDADD) $(LIBS)
-two_file_test$(EXEEXT): $(two_file_test_OBJECTS) $(two_file_test_DEPENDENCIES)
- @rm -f two_file_test$(EXEEXT)
- $(CXXLINK) $(two_file_test_LDFLAGS) $(two_file_test_OBJECTS) $(two_file_test_LDADD) $(LIBS)
-ver_test$(EXEEXT): $(ver_test_OBJECTS) $(ver_test_DEPENDENCIES)
- @rm -f ver_test$(EXEEXT)
- $(CXXLINK) $(ver_test_LDFLAGS) $(ver_test_OBJECTS) $(ver_test_LDADD) $(LIBS)
-ver_test_2$(EXEEXT): $(ver_test_2_OBJECTS) $(ver_test_2_DEPENDENCIES)
- @rm -f ver_test_2$(EXEEXT)
- $(CXXLINK) $(ver_test_2_LDFLAGS) $(ver_test_2_OBJECTS) $(ver_test_2_LDADD) $(LIBS)
-ver_test_6$(EXEEXT): $(ver_test_6_OBJECTS) $(ver_test_6_DEPENDENCIES)
- @rm -f ver_test_6$(EXEEXT)
- $(LINK) $(ver_test_6_LDFLAGS) $(ver_test_6_OBJECTS) $(ver_test_6_LDADD) $(LIBS)
-ver_test_8$(EXEEXT): $(ver_test_8_OBJECTS) $(ver_test_8_DEPENDENCIES)
- @rm -f ver_test_8$(EXEEXT)
- $(CXXLINK) $(ver_test_8_LDFLAGS) $(ver_test_8_OBJECTS) $(ver_test_8_LDADD) $(LIBS)
-ver_test_9$(EXEEXT): $(ver_test_9_OBJECTS) $(ver_test_9_DEPENDENCIES)
- @rm -f ver_test_9$(EXEEXT)
- $(CXXLINK) $(ver_test_9_LDFLAGS) $(ver_test_9_OBJECTS) $(ver_test_9_LDADD) $(LIBS)
-weak_alias_test$(EXEEXT): $(weak_alias_test_OBJECTS) $(weak_alias_test_DEPENDENCIES)
- @rm -f weak_alias_test$(EXEEXT)
- $(CXXLINK) $(weak_alias_test_LDFLAGS) $(weak_alias_test_OBJECTS) $(weak_alias_test_LDADD) $(LIBS)
-@GCC_FALSE@weak_plt$(EXEEXT): $(weak_plt_OBJECTS) $(weak_plt_DEPENDENCIES)
-@GCC_FALSE@ @rm -f weak_plt$(EXEEXT)
-@GCC_FALSE@ $(LINK) $(weak_plt_LDFLAGS) $(weak_plt_OBJECTS) $(weak_plt_LDADD) $(LIBS)
-@NATIVE_LINKER_FALSE@weak_plt$(EXEEXT): $(weak_plt_OBJECTS) $(weak_plt_DEPENDENCIES)
-@NATIVE_LINKER_FALSE@ @rm -f weak_plt$(EXEEXT)
-@NATIVE_LINKER_FALSE@ $(LINK) $(weak_plt_LDFLAGS) $(weak_plt_OBJECTS) $(weak_plt_LDADD) $(LIBS)
-weak_test$(EXEEXT): $(weak_test_OBJECTS) $(weak_test_DEPENDENCIES)
- @rm -f weak_test$(EXEEXT)
- $(CXXLINK) $(weak_test_LDFLAGS) $(weak_test_OBJECTS) $(weak_test_LDADD) $(LIBS)
-weak_undef_nonpic_test$(EXEEXT): $(weak_undef_nonpic_test_OBJECTS) $(weak_undef_nonpic_test_DEPENDENCIES)
- @rm -f weak_undef_nonpic_test$(EXEEXT)
- $(CXXLINK) $(weak_undef_nonpic_test_LDFLAGS) $(weak_undef_nonpic_test_OBJECTS) $(weak_undef_nonpic_test_LDADD) $(LIBS)
-weak_undef_test$(EXEEXT): $(weak_undef_test_OBJECTS) $(weak_undef_test_DEPENDENCIES)
- @rm -f weak_undef_test$(EXEEXT)
- $(CXXLINK) $(weak_undef_test_LDFLAGS) $(weak_undef_test_OBJECTS) $(weak_undef_test_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_pic_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_static_pic_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_static_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binary_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binary_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common_test_1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constructor_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copy_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception_test_1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception_test_2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception_test_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flagstest_compress_debug_sections.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flagstest_o_specialfile.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flagstest_o_specialfile_and_compress_debug_sections.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initpri1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/justsyms_1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/many_sections_r_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/many_sections_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protected_3.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protected_main_1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protected_main_2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protected_main_3.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/relro_test_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/script_test_1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/script_test_2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/script_test_2a.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/script_test_2b.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/script_test_3.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testfile.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmain.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls_test_file2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls_test_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_file_strip_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_file_test_1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_file_test_1b.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_file_test_2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_file_test_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ver_test_6.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ver_test_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ver_test_main_2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/weak_alias_test_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/weak_plt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/weak_test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/weak_undef_test.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.cc.o:
-@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
-
-.cc.obj:
-@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-uninstall-info-am:
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-check-TESTS: $(TESTS)
- @failed=0; all=0; xfail=0; xpass=0; skip=0; \
- srcdir=$(srcdir); export srcdir; \
- list='$(TESTS)'; \
- if test -n "$$list"; then \
- for tst in $$list; do \
- if test -f ./$$tst; then dir=./; \
- elif test -f $$tst; then dir=; \
- else dir="$(srcdir)/"; fi; \
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *" $$tst "*) \
- xpass=`expr $$xpass + 1`; \
- failed=`expr $$failed + 1`; \
- echo "XPASS: $$tst"; \
- ;; \
- *) \
- echo "PASS: $$tst"; \
- ;; \
- esac; \
- elif test $$? -ne 77; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *" $$tst "*) \
- xfail=`expr $$xfail + 1`; \
- echo "XFAIL: $$tst"; \
- ;; \
- *) \
- failed=`expr $$failed + 1`; \
- echo "FAIL: $$tst"; \
- ;; \
- esac; \
- else \
- skip=`expr $$skip + 1`; \
- echo "SKIP: $$tst"; \
- fi; \
- done; \
- if test "$$failed" -eq 0; then \
- if test "$$xfail" -eq 0; then \
- banner="All $$all tests passed"; \
- else \
- banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
- fi; \
- else \
- if test "$$xpass" -eq 0; then \
- banner="$$failed of $$all tests failed"; \
- else \
- banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
- fi; \
- fi; \
- dashes="$$banner"; \
- skipped=""; \
- if test "$$skip" -ne 0; then \
- skipped="($$skip tests were not run)"; \
- test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$skipped"; \
- fi; \
- report=""; \
- if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
- report="Please report to $(PACKAGE_BUGREPORT)"; \
- test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$report"; \
- fi; \
- dashes=`echo "$$dashes" | sed s/./=/g`; \
- echo "$$dashes"; \
- echo "$$banner"; \
- test -z "$$skipped" || echo "$$skipped"; \
- test -z "$$report" || echo "$$report"; \
- echo "$$dashes"; \
- test "$$failed" -eq 0; \
- else :; fi
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS) \
- $(check_SCRIPTS) $(check_DATA)
- $(MAKE) $(AM_MAKEFLAGS) check-TESTS
-check: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile
-installdirs:
-install: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am
-
-.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
- clean-checkLIBRARIES clean-checkPROGRAMS clean-generic ctags \
- distclean distclean-compile distclean-generic distclean-tags \
- distdir dvi dvi-am html html-am info info-am install \
- install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am
-
-
-# ---------------------------------------------------------------------
-# These tests test the output of gold (end-to-end tests). In
-# particular, they make sure that gold can link "difficult" object
-# files, and the resulting object files run correctly. These can only
-# run if we've built ld-new for the native architecture (that is,
-# we're not cross-compiling it), since we run ld-new as part of these
-# tests. We use the gcc-specific flag '-B' to use our linker instead
-# of the default linker, which is why we only run our tests under gcc.
-
-# Infrastucture needed for the unittests: a directory where the linker
-# is named 'ld'. This is because the -B flag appends 'ld' to its arg.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@gcctestdir/ld: ../ld-new
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ test -d gcctestdir || mkdir -p gcctestdir
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ (cd gcctestdir && $(LN_S) ../../ld-new ld)
-
-# Each of these .o's is a useful, small complete program. They're
-# particularly useful for making sure ld-new's flags do what they're
-# supposed to (hence their names), but are used for many tests that
-# don't actually involve analyzing input data.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_debug.o: constructor_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -g -c -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_ndebug.o: constructor_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -c -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@basic_test.o: basic_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -c -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@basic_test: basic_test.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ basic_test.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@basic_static_test: basic_test.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -static basic_test.o
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@basic_pic_test.o: basic_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@basic_pic_test: basic_pic_test.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ basic_pic_test.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@basic_static_pic_test: basic_pic_test.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_1_pic.o: two_file_test_1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_1b_pic.o: two_file_test_1b.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_2_pic.o: two_file_test_2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_strip_test: two_file_test
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_STRIP) -o two_file_strip_test two_file_test
-@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_strip.so: two_file_shared.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_test_1_pic.o: exception_test_1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_test_2_pic.o: exception_test_2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_file1.o: weak_undef_file1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_file2.o: weak_undef_file2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_lib.so: weak_undef_file1.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@alt/weak_undef_lib.so: weak_undef_file2.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ test -d alt || mkdir -p alt
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_file1_nonpic.o: weak_undef_file1.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -o $@ $<
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_file2_nonpic.o: weak_undef_file2.cc
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -o $@ $<
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ test -d alt || mkdir -p alt
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_alias_test_1_pic.o: weak_alias_test_1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_alias_test_2_pic.o: weak_alias_test_2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_alias_test_3.o: weak_alias_test_3.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_alias_test_4_pic.o: weak_alias_test_4.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_plt_main_pic.o: weak_plt_main.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_plt: weak_plt_main_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_plt_shared_pic.o: weak_plt_shared.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@copy_test_1_pic.o: copy_test_1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@copy_test_1.so: gcctestdir/ld copy_test_1_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@copy_test_2_pic.o: copy_test_2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@copy_test_2.so: gcctestdir/ld copy_test_2_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_pic.o: tls_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_file2_pic.o: tls_test_file2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_c_pic.o: tls_test_c.c
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_pic_ie.o: tls_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_file2_pic_ie.o: tls_test_file2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_c_pic_ie.o: tls_test_c.c
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_c.o: tls_test_c.c
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $<
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_test_gnu2.o: tls_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@ $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_test_file2_gnu2.o: tls_test_file2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@ $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_test_c_gnu2.o: tls_test_c.c
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@ $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_DESCRIPTORS_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_DESCRIPTORS_TRUE@@TLS_GNU2_DIALECT_TRUE@@TLS_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld
-@FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@many_sections_define.h:
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ (for i in `seq 1 70000`; do \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ done) > $@.tmp
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ mv -f $@.tmp $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@many_sections_check.h:
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ (for i in `seq 1 1000 70000`; do \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "assert(var_$$i == $$i);"; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ done) > $@.tmp
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ mv -f $@.tmp $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@many_sections_r_test.o: many_sections_test.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld -r -o $@ many_sections_test.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@many_sections_r_test: many_sections_r_test.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS)
-@GCC_TRUE@@NATIVE_LINKER_TRUE@debug_msg.o: debug_msg.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@odr_violation1.o: odr_violation1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@odr_violation2.o: odr_violation2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@"
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ then \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo 1>&2 "Link of debug_msg should have failed"; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f $@; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exit 1; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ fi
-@GCC_TRUE@@NATIVE_LINKER_TRUE@debug_msg.so: debug_msg.cc gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@odr_violation1.so: odr_violation1.cc gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@odr_violation2.so: odr_violation2.cc gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@"
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ then \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo 1>&2 "Link of debug_msg_so should have failed"; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f $@; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exit 1; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ fi
-@GCC_TRUE@@NATIVE_LINKER_TRUE@debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@"
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ then \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo 1>&2 "Link of debug_msg_ndebug should have failed"; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f $@; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exit 1; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ fi
-@GCC_TRUE@@NATIVE_LINKER_TRUE@undef_symbol.o: undef_symbol.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -g -c -fPIC $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@undef_symbol.so: undef_symbol.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@"
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ then \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo 1>&2 "Link of undef_symbol_test should have failed"; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f $@; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ exit 1; \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ fi
-@GCC_TRUE@@NATIVE_LINKER_TRUE@flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ chmod a+x $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ test -s $@
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ test -s $@
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ chmod a+x $@
-@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ test -s $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script ver_test_2.o ver_test_4.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_1.o: ver_test_1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_2.o: ver_test_2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_3.o: ver_test_3.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_4.o: ver_test_4.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_2.syms: ver_test_2
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -s $< >$@ 2>/dev/null
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_4.syms: ver_test_4.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -s $< >$@ 2>/dev/null
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_5.o: ver_test_5.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_5.syms: ver_test_5.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -s $< >$@ 2>/dev/null
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_7.o: ver_test_7.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_7.syms: ver_test_7.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -s $< >$@ 2>/dev/null
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared ver_test_9.o ver_test_5.so ver_test_4.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_9.o: ver_test_9.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_10.syms: ver_test_10.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -s $< >$@ 2>/dev/null
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o
-
-@GCC_TRUE@@NATIVE_LINKER_TRUE@protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@protected_1_pic.o: protected_1.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@protected_2_pic.o: protected_2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@protected_3_pic.o: protected_3.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@relro_test.so: gcctestdir/ld relro_test_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o
-@GCC_TRUE@@NATIVE_LINKER_TRUE@relro_test_pic.o: relro_test.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@justsyms_2.o: justsyms_2.cc
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -o $@ $<
-@GCC_TRUE@@NATIVE_LINKER_TRUE@justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o
-# Copy the file to the build directory to avoid worrying about the
-# full pathname in the generated symbols.
-@GCC_TRUE@@NATIVE_LINKER_TRUE@binary.txt: $(srcdir)/binary.in
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(LN_S) $< $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_matching_def.so: ver_matching_def.cc gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -O0 -Bgcctestdir/ -shared $(srcdir)/ver_matching_def.cc -Wl,--version-script=$(srcdir)/version_script.map
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_matching_test.stdout: ver_matching_def.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
-@GCC_TRUE@@NATIVE_LINKER_TRUE@script_test_3: basic_test.o gcctestdir/ld script_test_3.t
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t
-@GCC_TRUE@@NATIVE_LINKER_TRUE@script_test_3.stdout: script_test_3
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout
-@GCC_TRUE@@NATIVE_LINKER_TRUE@script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t
-@GCC_TRUE@@NATIVE_LINKER_TRUE@script_test_4.stdout: script_test_4
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout
-# 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:
diff --git a/gold/testsuite/script_test_2.cc b/gold/testsuite/script_test_2.cc
deleted file mode 100644
index 71045516920..00000000000
--- a/gold/testsuite/script_test_2.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// script_test_2.cc -- linker script test 2 for gold -*- C++ -*-
-
-// Copyright 2008 Free Software Foundation, Inc.
-// Written by Ian Lance Taylor <iant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-// A test of some uses of the SECTIONS clause. Look at
-// script_test_2.t to make sense of this test.
-
-#include <cassert>
-#include <cstddef>
-#include <cstring>
-#include <stdint.h>
-
-extern char start_test_area[];
-extern char start_test_area_1[];
-extern char start_data[];
-extern char end_data[];
-extern char start_fill[];
-extern char end_fill[];
-extern char end_test_area[];
-extern char test_addr[];
-extern char test_addr_alias[];
-
-int
-main(int, char**)
-{
- assert(reinterpret_cast<uintptr_t>(start_test_area) == 0x20000001);
- assert(reinterpret_cast<uintptr_t>(start_test_area_1) == 0x20000010);
-
- // We should see the string from script_test_2b.o next. The
- // subalign should move it up to 0x20000020.
- for (int i = 0; i < 16; ++i)
- assert(start_test_area_1[i] == 0);
- assert(strcmp(start_test_area_1 + 16, "test bb") == 0);
-
- // Next the string from script_test_2a.o, after the subalign.
- for (int i = 16 + 7; i < 48; ++i)
- assert(start_test_area_1[i] == 0);
- assert(strcmp(start_test_area_1 + 48, "test aa") == 0);
-
- // Move four bytes forward to start_data.
- assert(reinterpret_cast<uintptr_t>(start_test_area_1 + 48 + 8 + 4)
- == reinterpret_cast<uintptr_t>(start_data));
- assert(memcmp(start_data, "\1\2\0\4\0\0\0\010\0\0\0\0\0\0\0", 15) == 0
- || memcmp(start_data, "\1\0\2\0\0\0\4\0\0\0\0\0\0\0\010", 15) == 0);
- assert(end_data == start_data + 15);
-
- // Check that FILL works as expected.
- assert(start_fill == end_data);
- assert(memcmp(start_fill, "\x12\x34\x56\x78\x12\x34\x56\0", 8) == 0);
- assert(end_fill == start_fill + 8);
-
- assert(end_test_area == end_fill);
-
- assert(test_addr == start_test_area_1);
- assert(test_addr_alias == test_addr);
-}
diff --git a/gold/testsuite/script_test_2.t b/gold/testsuite/script_test_2.t
deleted file mode 100644
index 73d39df530b..00000000000
--- a/gold/testsuite/script_test_2.t
+++ /dev/null
@@ -1,68 +0,0 @@
-/* script_test_2.t -- linker script test 2 for gold
-
- Copyright 2008 Free Software Foundation, Inc.
- Written by Ian Lance Taylor <iant@google.com>.
-
- This file is part of gold.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
-
-test_addr_alias = test_addr;
-
-SECTIONS
-{
- /* With luck this will work everywhere. */
- . = 0x10000000;
-
- /* With luck this will be enough to get the program working. */
- .text : { *(.text) }
- . += 0x100000;
- . = ALIGN(0x100);
- .data : { *(.data) }
- .bss : { *(.bss) }
-
- /* Now the real test. */
- . = 0x20000001;
- start_test_area = .;
- .gold_test ALIGN(16) : SUBALIGN(32) {
- start_test_area_1 = .;
-
- /* No sections should wind up here, because of the EXCLUDE_FILE. */
- *( EXCLUDE_FILE(script_test*) .gold_test)
-
- /* This should match only script_test_2b.o. */
- script_test_2b.o(.gold_test)
-
- /* This should match the remaining sections. */
- *(.gold_test)
-
- . = . + 4;
- start_data = .;
- BYTE(1)
- SHORT(2)
- LONG(4)
- QUAD(8)
- end_data = .;
-
- start_fill = .;
- FILL(0x12345678);
- . = . + 7;
- BYTE(0)
- end_fill = .;
- }
- end_test_area = .;
- test_addr = ADDR(.gold_test);
-}
diff --git a/gold/testsuite/weak_plt.sh b/gold/testsuite/weak_plt.sh
deleted file mode 100755
index 6c419b8095a..00000000000
--- a/gold/testsuite/weak_plt.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-# weak_plt.sh -- test calling a weak undefined function.
-
-# Copyright 2008 Free Software Foundation, Inc.
-# Written by Ian Lance Taylor <iant@google.com>.
-
-# This file is part of gold.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-# MA 02110-1301, USA.
-
-# This tests a call to a weak undefined function. We use LD_PRELOAD
-# to force the function to be defined.
-
-LD_PRELOAD=./weak_plt_shared.so ./weak_plt
diff --git a/gold/testsuite/weak_plt_main.cc b/gold/testsuite/weak_plt_main.cc
deleted file mode 100644
index 33cb35eb10f..00000000000
--- a/gold/testsuite/weak_plt_main.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-// weak_plt_main.cc -- test call to weak undefined function for gold
-
-// Copyright 2008 Free Software Foundation, Inc.
-// Written by Ian Lance Taylor <iant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-#include <cstdio>
-
-extern int weak_function() __attribute__((weak));
-
-int
-main()
-{
- if (weak_function)
- return weak_function();
- return 0;
-}
diff --git a/gold/testsuite/weak_plt_shared.cc b/gold/testsuite/weak_plt_shared.cc
deleted file mode 100644
index 8d82005d55a..00000000000
--- a/gold/testsuite/weak_plt_shared.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-// weak_plt_shared.cc -- test call to weak undefined function for gold
-
-// Copyright 2008 Free Software Foundation, Inc.
-// Written by Ian Lance Taylor <iant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-#include <cstdio>
-
-int
-weak_function()
-{
- return 0;
-}
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
deleted file mode 100644
index cbbd5ccf368..00000000000
--- a/gold/x86_64.cc
+++ /dev/null
@@ -1,2608 +0,0 @@
-// x86_64.cc -- x86_64 target support for gold.
-
-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
-// Written by Ian Lance Taylor <iant@google.com>.
-
-// This file is part of gold.
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-// MA 02110-1301, USA.
-
-#include "gold.h"
-
-#include <cstring>
-
-#include "elfcpp.h"
-#include "parameters.h"
-#include "reloc.h"
-#include "x86_64.h"
-#include "object.h"
-#include "symtab.h"
-#include "layout.h"
-#include "output.h"
-#include "copy-relocs.h"
-#include "target.h"
-#include "target-reloc.h"
-#include "target-select.h"
-#include "tls.h"
-
-namespace
-{
-
-using namespace gold;
-
-class Output_data_plt_x86_64;
-
-// The x86_64 target class.
-// See the ABI at
-// http://www.x86-64.org/documentation/abi.pdf
-// TLS info comes from
-// http://people.redhat.com/drepper/tls.pdf
-// http://www.lsd.ic.unicamp.br/~oliva/writeups/TLS/RFC-TLSDESC-x86.txt
-
-class Target_x86_64 : public Sized_target<64, false>
-{
- public:
- // In the x86_64 ABI (p 68), it says "The AMD64 ABI architectures
- // uses only Elf64_Rela relocation entries with explicit addends."
- typedef Output_data_reloc<elfcpp::SHT_RELA, true, 64, false> Reloc_section;
-
- Target_x86_64()
- : Sized_target<64, false>(&x86_64_info),
- got_(NULL), plt_(NULL), got_plt_(NULL), rela_dyn_(NULL),
- copy_relocs_(elfcpp::R_X86_64_COPY), dynbss_(NULL),
- got_mod_index_offset_(-1U), tls_base_symbol_defined_(false)
- { }
-
- // Scan the relocations to look for symbol adjustments.
- void
- scan_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<64, false>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols);
-
- // Finalize the sections.
- void
- do_finalize_sections(Layout*);
-
- // Return the value to use for a dynamic which requires special
- // treatment.
- uint64_t
- do_dynsym_value(const Symbol*) const;
-
- // Relocate a section.
- void
- relocate_section(const Relocate_info<64, false>*,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- unsigned char* view,
- elfcpp::Elf_types<64>::Elf_Addr view_address,
- section_size_type view_size);
-
- // Scan the relocs during a relocatable link.
- void
- scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<64, false>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols,
- Relocatable_relocs*);
-
- // Relocate a section during a relocatable link.
- void
- relocate_for_relocatable(const Relocate_info<64, false>*,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- off_t offset_in_output_section,
- const Relocatable_relocs*,
- unsigned char* view,
- elfcpp::Elf_types<64>::Elf_Addr view_address,
- section_size_type view_size,
- unsigned char* reloc_view,
- section_size_type reloc_view_size);
-
- // Return a string used to fill a code section with nops.
- std::string
- do_code_fill(section_size_type length) const;
-
- // Return whether SYM is defined by the ABI.
- bool
- do_is_defined_by_abi(Symbol* sym) const
- { return strcmp(sym->name(), "__tls_get_addr") == 0; }
-
- // Return the size of the GOT section.
- section_size_type
- got_size()
- {
- gold_assert(this->got_ != NULL);
- return this->got_->data_size();
- }
-
- private:
- // The class which scans relocations.
- class Scan
- {
- public:
- Scan()
- : issued_non_pic_error_(false)
- { }
-
- inline void
- local(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_x86_64* target,
- Sized_relobj<64, false>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rela<64, false>& reloc, unsigned int r_type,
- const elfcpp::Sym<64, false>& lsym);
-
- inline void
- global(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_x86_64* target,
- Sized_relobj<64, false>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rela<64, false>& reloc, unsigned int r_type,
- Symbol* gsym);
-
- private:
- static void
- unsupported_reloc_local(Sized_relobj<64, false>*, unsigned int r_type);
-
- static void
- unsupported_reloc_global(Sized_relobj<64, false>*, unsigned int r_type,
- Symbol*);
-
- void
- check_non_pic(Relobj*, unsigned int r_type);
-
- // Whether we have issued an error about a non-PIC compilation.
- bool issued_non_pic_error_;
- };
-
- // The class which implements relocation.
- class Relocate
- {
- public:
- Relocate()
- : skip_call_tls_get_addr_(false), saw_tls_block_reloc_(false)
- { }
-
- ~Relocate()
- {
- if (this->skip_call_tls_get_addr_)
- {
- // FIXME: This needs to specify the location somehow.
- gold_error(_("missing expected TLS relocation"));
- }
- }
-
- // Do a relocation. Return false if the caller should not issue
- // any warnings about this relocation.
- inline bool
- relocate(const Relocate_info<64, false>*, Target_x86_64*, size_t relnum,
- const elfcpp::Rela<64, false>&,
- unsigned int r_type, const Sized_symbol<64>*,
- const Symbol_value<64>*,
- unsigned char*, elfcpp::Elf_types<64>::Elf_Addr,
- section_size_type);
-
- private:
- // Do a TLS relocation.
- inline void
- relocate_tls(const Relocate_info<64, false>*, Target_x86_64*,
- size_t relnum, const elfcpp::Rela<64, false>&,
- unsigned int r_type, const Sized_symbol<64>*,
- const Symbol_value<64>*,
- unsigned char*, elfcpp::Elf_types<64>::Elf_Addr,
- section_size_type);
-
- // Do a TLS General-Dynamic to Initial-Exec transition.
- inline void
- tls_gd_to_ie(const Relocate_info<64, false>*, size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rela<64, false>&, unsigned int r_type,
- elfcpp::Elf_types<64>::Elf_Addr value,
- unsigned char* view,
- elfcpp::Elf_types<64>::Elf_Addr,
- section_size_type view_size);
-
- // Do a TLS General-Dynamic to Local-Exec transition.
- inline void
- tls_gd_to_le(const Relocate_info<64, false>*, size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rela<64, false>&, unsigned int r_type,
- elfcpp::Elf_types<64>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size);
-
- // Do a TLSDESC-style General-Dynamic to Initial-Exec transition.
- inline void
- tls_desc_gd_to_ie(const Relocate_info<64, false>*, size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rela<64, false>&, unsigned int r_type,
- elfcpp::Elf_types<64>::Elf_Addr value,
- unsigned char* view,
- elfcpp::Elf_types<64>::Elf_Addr,
- section_size_type view_size);
-
- // Do a TLSDESC-style General-Dynamic to Local-Exec transition.
- inline void
- tls_desc_gd_to_le(const Relocate_info<64, false>*, size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rela<64, false>&, unsigned int r_type,
- elfcpp::Elf_types<64>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size);
-
- // Do a TLS Local-Dynamic to Local-Exec transition.
- inline void
- tls_ld_to_le(const Relocate_info<64, false>*, size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rela<64, false>&, unsigned int r_type,
- elfcpp::Elf_types<64>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size);
-
- // Do a TLS Initial-Exec to Local-Exec transition.
- static inline void
- tls_ie_to_le(const Relocate_info<64, false>*, size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rela<64, false>&, unsigned int r_type,
- elfcpp::Elf_types<64>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size);
-
- // This is set if we should skip the next reloc, which should be a
- // PLT32 reloc against ___tls_get_addr.
- bool skip_call_tls_get_addr_;
-
- // This is set if we see a relocation which could load the address
- // of the TLS block. Whether we see such a relocation determines
- // how we handle the R_X86_64_DTPOFF32 relocation, which is used
- // in debugging sections.
- bool saw_tls_block_reloc_;
- };
-
- // A class which returns the size required for a relocation type,
- // used while scanning relocs during a relocatable link.
- class Relocatable_size_for_reloc
- {
- public:
- unsigned int
- get_size_for_reloc(unsigned int, Relobj*);
- };
-
- // Adjust TLS relocation type based on the options and whether this
- // is a local symbol.
- static tls::Tls_optimization
- optimize_tls_reloc(bool is_final, int r_type);
-
- // Get the GOT section, creating it if necessary.
- Output_data_got<64, false>*
- got_section(Symbol_table*, Layout*);
-
- // Get the GOT PLT section.
- Output_data_space*
- got_plt_section() const
- {
- gold_assert(this->got_plt_ != NULL);
- return this->got_plt_;
- }
-
- // Create the PLT section.
- void
- make_plt_section(Symbol_table* symtab, Layout* layout);
-
- // Create a PLT entry for a global symbol.
- void
- make_plt_entry(Symbol_table*, Layout*, Symbol*);
-
- // Define the _TLS_MODULE_BASE_ symbol at the end of the TLS segment.
- void
- define_tls_base_symbol(Symbol_table*, Layout*);
-
- // Create the reserved PLT and GOT entries for the TLS descriptor resolver.
- void
- reserve_tlsdesc_entries(Symbol_table* symtab, Layout* layout);
-
- // Create a GOT entry for the TLS module index.
- unsigned int
- got_mod_index_entry(Symbol_table* symtab, Layout* layout,
- Sized_relobj<64, false>* object);
-
- // Get the PLT section.
- Output_data_plt_x86_64*
- plt_section() const
- {
- gold_assert(this->plt_ != NULL);
- return this->plt_;
- }
-
- // Get the dynamic reloc section, creating it if necessary.
- Reloc_section*
- rela_dyn_section(Layout*);
-
- // Return true if the symbol may need a COPY relocation.
- // References from an executable object to non-function symbols
- // defined in a dynamic object may need a COPY relocation.
- bool
- may_need_copy_reloc(Symbol* gsym)
- {
- return (!parameters->options().shared()
- && gsym->is_from_dynobj()
- && gsym->type() != elfcpp::STT_FUNC);
- }
-
- // Add a potential copy relocation.
- void
- copy_reloc(Symbol_table* symtab, Layout* layout,
- Sized_relobj<64, false>* object,
- unsigned int shndx, Output_section* output_section,
- Symbol* sym, const elfcpp::Rela<64, false>& reloc)
- {
- this->copy_relocs_.copy_reloc(symtab, layout,
- symtab->get_sized_symbol<64>(sym),
- object, shndx, output_section,
- reloc, this->rela_dyn_section(layout));
- }
-
- // Information about this specific target which we pass to the
- // general Target structure.
- static const Target::Target_info x86_64_info;
-
- enum Got_type
- {
- GOT_TYPE_STANDARD = 0, // GOT entry for a regular symbol
- GOT_TYPE_TLS_OFFSET = 1, // GOT entry for TLS offset
- GOT_TYPE_TLS_PAIR = 2, // GOT entry for TLS module/offset pair
- GOT_TYPE_TLS_DESC = 3 // GOT entry for TLS_DESC pair
- };
-
- // The GOT section.
- Output_data_got<64, false>* got_;
- // The PLT section.
- Output_data_plt_x86_64* plt_;
- // The GOT PLT section.
- Output_data_space* got_plt_;
- // The dynamic reloc section.
- Reloc_section* rela_dyn_;
- // Relocs saved to avoid a COPY reloc.
- Copy_relocs<elfcpp::SHT_RELA, 64, false> copy_relocs_;
- // Space for variables copied with a COPY reloc.
- Output_data_space* dynbss_;
- // Offset of the GOT entry for the TLS module index.
- unsigned int got_mod_index_offset_;
- // True if the _TLS_MODULE_BASE_ symbol has been defined.
- bool tls_base_symbol_defined_;
-};
-
-const Target::Target_info Target_x86_64::x86_64_info =
-{
- 64, // size
- false, // is_big_endian
- elfcpp::EM_X86_64, // machine_code
- false, // has_make_symbol
- false, // has_resolve
- true, // has_code_fill
- true, // is_default_stack_executable
- '\0', // wrap_char
- "/lib/ld64.so.1", // program interpreter
- 0x400000, // default_text_segment_address
- 0x1000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000 // common_pagesize (overridable by -z common-page-size)
-};
-
-// Get the GOT section, creating it if necessary.
-
-Output_data_got<64, false>*
-Target_x86_64::got_section(Symbol_table* symtab, Layout* layout)
-{
- if (this->got_ == NULL)
- {
- gold_assert(symtab != NULL && layout != NULL);
-
- this->got_ = new Output_data_got<64, false>();
-
- Output_section* os;
- os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
- (elfcpp::SHF_ALLOC
- | elfcpp::SHF_WRITE),
- this->got_);
- os->set_is_relro();
-
- // The old GNU linker creates a .got.plt section. We just
- // create another set of data in the .got section. Note that we
- // always create a PLT if we create a GOT, although the PLT
- // might be empty.
- this->got_plt_ = new Output_data_space(8, "** GOT PLT");
- os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
- (elfcpp::SHF_ALLOC
- | elfcpp::SHF_WRITE),
- this->got_plt_);
- os->set_is_relro();
-
- // The first three entries are reserved.
- this->got_plt_->set_current_data_size(3 * 8);
-
- // Define _GLOBAL_OFFSET_TABLE_ at the start of the PLT.
- symtab->define_in_output_data("_GLOBAL_OFFSET_TABLE_", NULL,
- this->got_plt_,
- 0, 0, elfcpp::STT_OBJECT,
- elfcpp::STB_LOCAL,
- elfcpp::STV_HIDDEN, 0,
- false, false);
- }
-
- return this->got_;
-}
-
-// Get the dynamic reloc section, creating it if necessary.
-
-Target_x86_64::Reloc_section*
-Target_x86_64::rela_dyn_section(Layout* layout)
-{
- if (this->rela_dyn_ == NULL)
- {
- gold_assert(layout != NULL);
- this->rela_dyn_ = new Reloc_section(parameters->options().combreloc());
- layout->add_output_section_data(".rela.dyn", elfcpp::SHT_RELA,
- elfcpp::SHF_ALLOC, this->rela_dyn_);
- }
- return this->rela_dyn_;
-}
-
-// A class to handle the PLT data.
-
-class Output_data_plt_x86_64 : public Output_section_data
-{
- public:
- typedef Output_data_reloc<elfcpp::SHT_RELA, true, 64, false> Reloc_section;
-
- Output_data_plt_x86_64(Layout*, Output_data_got<64, false>*,
- Output_data_space*);
-
- // Add an entry to the PLT.
- void
- add_entry(Symbol* gsym);
-
- // Add the reserved TLSDESC_PLT entry to the PLT.
- void
- reserve_tlsdesc_entry(unsigned int got_offset)
- { this->tlsdesc_got_offset_ = got_offset; }
-
- // Return true if a TLSDESC_PLT entry has been reserved.
- bool
- has_tlsdesc_entry() const
- { return this->tlsdesc_got_offset_ != -1U; }
-
- // Return the GOT offset for the reserved TLSDESC_PLT entry.
- unsigned int
- get_tlsdesc_got_offset() const
- { return this->tlsdesc_got_offset_; }
-
- // Return the offset of the reserved TLSDESC_PLT entry.
- unsigned int
- get_tlsdesc_plt_offset() const
- { return (this->count_ + 1) * plt_entry_size; }
-
- // Return the .rel.plt section data.
- const Reloc_section*
- rel_plt() const
- { return this->rel_; }
-
- protected:
- void
- do_adjust_output_section(Output_section* os);
-
- // Write to a map file.
- void
- do_print_to_mapfile(Mapfile* mapfile) const
- { mapfile->print_output_data(this, _("** PLT")); }
-
- private:
- // The size of an entry in the PLT.
- static const int plt_entry_size = 16;
-
- // The first entry in the PLT.
- // From the AMD64 ABI: "Unlike Intel386 ABI, this ABI uses the same
- // procedure linkage table for both programs and shared objects."
- static unsigned char first_plt_entry[plt_entry_size];
-
- // Other entries in the PLT for an executable.
- static unsigned char plt_entry[plt_entry_size];
-
- // The reserved TLSDESC entry in the PLT for an executable.
- static unsigned char tlsdesc_plt_entry[plt_entry_size];
-
- // Set the final size.
- void
- set_final_data_size();
-
- // Write out the PLT data.
- void
- do_write(Output_file*);
-
- // The reloc section.
- Reloc_section* rel_;
- // The .got section.
- Output_data_got<64, false>* got_;
- // The .got.plt section.
- Output_data_space* got_plt_;
- // The number of PLT entries.
- unsigned int count_;
- // Offset of the reserved TLSDESC_GOT entry when needed.
- unsigned int tlsdesc_got_offset_;
-};
-
-// Create the PLT section. The ordinary .got section is an argument,
-// since we need to refer to the start. We also create our own .got
-// section just for PLT entries.
-
-Output_data_plt_x86_64::Output_data_plt_x86_64(Layout* layout,
- Output_data_got<64, false>* got,
- Output_data_space* got_plt)
- : Output_section_data(8), got_(got), got_plt_(got_plt), count_(0),
- tlsdesc_got_offset_(-1U)
-{
- this->rel_ = new Reloc_section(false);
- layout->add_output_section_data(".rela.plt", elfcpp::SHT_RELA,
- elfcpp::SHF_ALLOC, this->rel_);
-}
-
-void
-Output_data_plt_x86_64::do_adjust_output_section(Output_section* os)
-{
- // UnixWare sets the entsize of .plt to 4, and so does the old GNU
- // linker, and so do we.
- os->set_entsize(4);
-}
-
-// Add an entry to the PLT.
-
-void
-Output_data_plt_x86_64::add_entry(Symbol* gsym)
-{
- gold_assert(!gsym->has_plt_offset());
-
- // Note that when setting the PLT offset we skip the initial
- // reserved PLT entry.
- gsym->set_plt_offset((this->count_ + 1) * plt_entry_size);
-
- ++this->count_;
-
- section_offset_type got_offset = this->got_plt_->current_data_size();
-
- // Every PLT entry needs a GOT entry which points back to the PLT
- // entry (this will be changed by the dynamic linker, normally
- // lazily when the function is called).
- this->got_plt_->set_current_data_size(got_offset + 8);
-
- // Every PLT entry needs a reloc.
- gsym->set_needs_dynsym_entry();
- this->rel_->add_global(gsym, elfcpp::R_X86_64_JUMP_SLOT, this->got_plt_,
- got_offset, 0);
-
- // Note that we don't need to save the symbol. The contents of the
- // PLT are independent of which symbols are used. The symbols only
- // appear in the relocations.
-}
-
-// Set the final size.
-void
-Output_data_plt_x86_64::set_final_data_size()
-{
- unsigned int count = this->count_;
- if (this->has_tlsdesc_entry())
- ++count;
- this->set_data_size((count + 1) * plt_entry_size);
-}
-
-// The first entry in the PLT for an executable.
-
-unsigned char Output_data_plt_x86_64::first_plt_entry[plt_entry_size] =
-{
- // From AMD64 ABI Draft 0.98, page 76
- 0xff, 0x35, // pushq contents of memory address
- 0, 0, 0, 0, // replaced with address of .got + 8
- 0xff, 0x25, // jmp indirect
- 0, 0, 0, 0, // replaced with address of .got + 16
- 0x90, 0x90, 0x90, 0x90 // noop (x4)
-};
-
-// Subsequent entries in the PLT for an executable.
-
-unsigned char Output_data_plt_x86_64::plt_entry[plt_entry_size] =
-{
- // From AMD64 ABI Draft 0.98, page 76
- 0xff, 0x25, // jmpq indirect
- 0, 0, 0, 0, // replaced with address of symbol in .got
- 0x68, // pushq immediate
- 0, 0, 0, 0, // replaced with offset into relocation table
- 0xe9, // jmpq relative
- 0, 0, 0, 0 // replaced with offset to start of .plt
-};
-
-// The reserved TLSDESC entry in the PLT for an executable.
-
-unsigned char Output_data_plt_x86_64::tlsdesc_plt_entry[plt_entry_size] =
-{
- // From Alexandre Oliva, "Thread-Local Storage Descriptors for IA32
- // and AMD64/EM64T", Version 0.9.4 (2005-10-10).
- 0xff, 0x35, // pushq x(%rip)
- 0, 0, 0, 0, // replaced with address of linkmap GOT entry (at PLTGOT + 8)
- 0xff, 0x25, // jmpq *y(%rip)
- 0, 0, 0, 0, // replaced with offset of reserved TLSDESC_GOT entry
- 0x0f, 0x1f, // nop
- 0x40, 0
-};
-
-// Write out the PLT. This uses the hand-coded instructions above,
-// and adjusts them as needed. This is specified by the AMD64 ABI.
-
-void
-Output_data_plt_x86_64::do_write(Output_file* of)
-{
- const off_t offset = this->offset();
- const section_size_type oview_size =
- convert_to_section_size_type(this->data_size());
- unsigned char* const oview = of->get_output_view(offset, oview_size);
-
- const off_t got_file_offset = this->got_plt_->offset();
- const section_size_type got_size =
- convert_to_section_size_type(this->got_plt_->data_size());
- unsigned char* const got_view = of->get_output_view(got_file_offset,
- got_size);
-
- unsigned char* pov = oview;
-
- // The base address of the .plt section.
- elfcpp::Elf_types<64>::Elf_Addr plt_address = this->address();
- // The base address of the .got section.
- elfcpp::Elf_types<64>::Elf_Addr got_base = this->got_->address();
- // The base address of the PLT portion of the .got section,
- // which is where the GOT pointer will point, and where the
- // three reserved GOT entries are located.
- elfcpp::Elf_types<64>::Elf_Addr got_address = this->got_plt_->address();
-
- memcpy(pov, first_plt_entry, plt_entry_size);
- // We do a jmp relative to the PC at the end of this instruction.
- elfcpp::Swap_unaligned<32, false>::writeval(pov + 2,
- (got_address + 8
- - (plt_address + 6)));
- elfcpp::Swap<32, false>::writeval(pov + 8,
- (got_address + 16
- - (plt_address + 12)));
- pov += plt_entry_size;
-
- unsigned char* got_pov = got_view;
-
- memset(got_pov, 0, 24);
- got_pov += 24;
-
- unsigned int plt_offset = plt_entry_size;
- unsigned int got_offset = 24;
- const unsigned int count = this->count_;
- for (unsigned int plt_index = 0;
- plt_index < count;
- ++plt_index,
- pov += plt_entry_size,
- got_pov += 8,
- plt_offset += plt_entry_size,
- got_offset += 8)
- {
- // Set and adjust the PLT entry itself.
- memcpy(pov, plt_entry, plt_entry_size);
- elfcpp::Swap_unaligned<32, false>::writeval(pov + 2,
- (got_address + got_offset
- - (plt_address + plt_offset
- + 6)));
-
- elfcpp::Swap_unaligned<32, false>::writeval(pov + 7, plt_index);
- elfcpp::Swap<32, false>::writeval(pov + 12,
- - (plt_offset + plt_entry_size));
-
- // Set the entry in the GOT.
- elfcpp::Swap<64, false>::writeval(got_pov, plt_address + plt_offset + 6);
- }
-
- if (this->has_tlsdesc_entry())
- {
- // Set and adjust the reserved TLSDESC PLT entry.
- unsigned int tlsdesc_got_offset = this->get_tlsdesc_got_offset();
- memcpy(pov, tlsdesc_plt_entry, plt_entry_size);
- elfcpp::Swap_unaligned<32, false>::writeval(pov + 2,
- (got_address + 8
- - (plt_address + plt_offset
- + 6)));
- elfcpp::Swap_unaligned<32, false>::writeval(pov + 8,
- (got_base
- + tlsdesc_got_offset
- - (plt_address + plt_offset
- + 12)));
- pov += plt_entry_size;
- }
-
- gold_assert(static_cast<section_size_type>(pov - oview) == oview_size);
- gold_assert(static_cast<section_size_type>(got_pov - got_view) == got_size);
-
- of->write_output_view(offset, oview_size, oview);
- of->write_output_view(got_file_offset, got_size, got_view);
-}
-
-// Create the PLT section.
-
-void
-Target_x86_64::make_plt_section(Symbol_table* symtab, Layout* layout)
-{
- if (this->plt_ == NULL)
- {
- // Create the GOT sections first.
- this->got_section(symtab, layout);
-
- this->plt_ = new Output_data_plt_x86_64(layout, this->got_,
- this->got_plt_);
- layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
- (elfcpp::SHF_ALLOC
- | elfcpp::SHF_EXECINSTR),
- this->plt_);
- }
-}
-
-// Create a PLT entry for a global symbol.
-
-void
-Target_x86_64::make_plt_entry(Symbol_table* symtab, Layout* layout,
- Symbol* gsym)
-{
- if (gsym->has_plt_offset())
- return;
-
- if (this->plt_ == NULL)
- this->make_plt_section(symtab, layout);
-
- this->plt_->add_entry(gsym);
-}
-
-// Define the _TLS_MODULE_BASE_ symbol at the end of the TLS segment.
-
-void
-Target_x86_64::define_tls_base_symbol(Symbol_table* symtab, Layout* layout)
-{
- if (this->tls_base_symbol_defined_)
- return;
-
- Output_segment* tls_segment = layout->tls_segment();
- if (tls_segment != NULL)
- {
- symtab->define_in_output_segment("_TLS_MODULE_BASE_", NULL,
- tls_segment, 0, 0,
- elfcpp::STT_TLS,
- elfcpp::STB_LOCAL,
- elfcpp::STV_HIDDEN, 0,
- Symbol::SEGMENT_END, true);
- }
- this->tls_base_symbol_defined_ = true;
-}
-
-// Create the reserved PLT and GOT entries for the TLS descriptor resolver.
-
-void
-Target_x86_64::reserve_tlsdesc_entries(Symbol_table* symtab,
- Layout* layout)
-{
- if (this->plt_ == NULL)
- this->make_plt_section(symtab, layout);
-
- if (!this->plt_->has_tlsdesc_entry())
- {
- // Allocate the TLSDESC_GOT entry.
- Output_data_got<64, false>* got = this->got_section(symtab, layout);
- unsigned int got_offset = got->add_constant(0);
-
- // Allocate the TLSDESC_PLT entry.
- this->plt_->reserve_tlsdesc_entry(got_offset);
- }
-}
-
-// Create a GOT entry for the TLS module index.
-
-unsigned int
-Target_x86_64::got_mod_index_entry(Symbol_table* symtab, Layout* layout,
- Sized_relobj<64, false>* object)
-{
- if (this->got_mod_index_offset_ == -1U)
- {
- gold_assert(symtab != NULL && layout != NULL && object != NULL);
- Reloc_section* rela_dyn = this->rela_dyn_section(layout);
- Output_data_got<64, false>* got = this->got_section(symtab, layout);
- unsigned int got_offset = got->add_constant(0);
- rela_dyn->add_local(object, 0, elfcpp::R_X86_64_DTPMOD64, got,
- got_offset, 0);
- got->add_constant(0);
- this->got_mod_index_offset_ = got_offset;
- }
- return this->got_mod_index_offset_;
-}
-
-// Optimize the TLS relocation type based on what we know about the
-// symbol. IS_FINAL is true if the final address of this symbol is
-// known at link time.
-
-tls::Tls_optimization
-Target_x86_64::optimize_tls_reloc(bool is_final, int r_type)
-{
- // If we are generating a shared library, then we can't do anything
- // in the linker.
- if (parameters->options().shared())
- return tls::TLSOPT_NONE;
-
- switch (r_type)
- {
- case elfcpp::R_X86_64_TLSGD:
- case elfcpp::R_X86_64_GOTPC32_TLSDESC:
- case elfcpp::R_X86_64_TLSDESC_CALL:
- // These are General-Dynamic which permits fully general TLS
- // access. Since we know that we are generating an executable,
- // we can convert this to Initial-Exec. If we also know that
- // this is a local symbol, we can further switch to Local-Exec.
- if (is_final)
- return tls::TLSOPT_TO_LE;
- return tls::TLSOPT_TO_IE;
-
- case elfcpp::R_X86_64_TLSLD:
- // This is Local-Dynamic, which refers to a local symbol in the
- // dynamic TLS block. Since we know that we generating an
- // executable, we can switch to Local-Exec.
- return tls::TLSOPT_TO_LE;
-
- case elfcpp::R_X86_64_DTPOFF32:
- case elfcpp::R_X86_64_DTPOFF64:
- // Another Local-Dynamic reloc.
- return tls::TLSOPT_TO_LE;
-
- case elfcpp::R_X86_64_GOTTPOFF:
- // These are Initial-Exec relocs which get the thread offset
- // from the GOT. If we know that we are linking against the
- // local symbol, we can switch to Local-Exec, which links the
- // thread offset into the instruction.
- if (is_final)
- return tls::TLSOPT_TO_LE;
- return tls::TLSOPT_NONE;
-
- case elfcpp::R_X86_64_TPOFF32:
- // When we already have Local-Exec, there is nothing further we
- // can do.
- return tls::TLSOPT_NONE;
-
- default:
- gold_unreachable();
- }
-}
-
-// Report an unsupported relocation against a local symbol.
-
-void
-Target_x86_64::Scan::unsupported_reloc_local(Sized_relobj<64, false>* object,
- unsigned int r_type)
-{
- gold_error(_("%s: unsupported reloc %u against local symbol"),
- object->name().c_str(), r_type);
-}
-
-// We are about to emit a dynamic relocation of type R_TYPE. If the
-// dynamic linker does not support it, issue an error. The GNU linker
-// only issues a non-PIC error for an allocated read-only section.
-// Here we know the section is allocated, but we don't know that it is
-// read-only. But we check for all the relocation types which the
-// glibc dynamic linker supports, so it seems appropriate to issue an
-// error even if the section is not read-only.
-
-void
-Target_x86_64::Scan::check_non_pic(Relobj* object, unsigned int r_type)
-{
- switch (r_type)
- {
- // These are the relocation types supported by glibc for x86_64.
- case elfcpp::R_X86_64_RELATIVE:
- case elfcpp::R_X86_64_GLOB_DAT:
- case elfcpp::R_X86_64_JUMP_SLOT:
- case elfcpp::R_X86_64_DTPMOD64:
- case elfcpp::R_X86_64_DTPOFF64:
- case elfcpp::R_X86_64_TPOFF64:
- case elfcpp::R_X86_64_64:
- case elfcpp::R_X86_64_32:
- case elfcpp::R_X86_64_PC32:
- case elfcpp::R_X86_64_COPY:
- return;
-
- default:
- // This prevents us from issuing more than one error per reloc
- // section. But we can still wind up issuing more than one
- // error per object file.
- if (this->issued_non_pic_error_)
- return;
- object->error(_("requires unsupported dynamic reloc; "
- "recompile with -fPIC"));
- this->issued_non_pic_error_ = true;
- return;
-
- case elfcpp::R_X86_64_NONE:
- gold_unreachable();
- }
-}
-
-// Scan a relocation for a local symbol.
-
-inline void
-Target_x86_64::Scan::local(const General_options&,
- Symbol_table* symtab,
- Layout* layout,
- Target_x86_64* target,
- Sized_relobj<64, false>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rela<64, false>& reloc,
- unsigned int r_type,
- const elfcpp::Sym<64, false>& lsym)
-{
- switch (r_type)
- {
- case elfcpp::R_X86_64_NONE:
- case elfcpp::R_386_GNU_VTINHERIT:
- case elfcpp::R_386_GNU_VTENTRY:
- break;
-
- case elfcpp::R_X86_64_64:
- // If building a shared library (or a position-independent
- // executable), we need to create a dynamic relocation for this
- // location. The relocation applied at link time will apply the
- // link-time value, so we flag the location with an
- // R_X86_64_RELATIVE relocation so the dynamic loader can
- // relocate it easily.
- if (parameters->options().output_is_position_independent())
- {
- unsigned int r_sym = elfcpp::elf_r_sym<64>(reloc.get_r_info());
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- rela_dyn->add_local_relative(object, r_sym,
- elfcpp::R_X86_64_RELATIVE,
- output_section, data_shndx,
- reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- break;
-
- case elfcpp::R_X86_64_32:
- case elfcpp::R_X86_64_32S:
- case elfcpp::R_X86_64_16:
- case elfcpp::R_X86_64_8:
- // If building a shared library (or a position-independent
- // executable), we need to create a dynamic relocation for this
- // location. We can't use an R_X86_64_RELATIVE relocation
- // because that is always a 64-bit relocation.
- if (parameters->options().output_is_position_independent())
- {
- this->check_non_pic(object, r_type);
-
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- unsigned int r_sym = elfcpp::elf_r_sym<64>(reloc.get_r_info());
- if (lsym.get_st_type() != elfcpp::STT_SECTION)
- rela_dyn->add_local(object, r_sym, r_type, output_section,
- data_shndx, reloc.get_r_offset(),
- reloc.get_r_addend());
- else
- {
- gold_assert(lsym.get_st_value() == 0);
- unsigned int shndx = lsym.get_st_shndx();
- bool is_ordinary;
- shndx = object->adjust_sym_shndx(r_sym, shndx,
- &is_ordinary);
- if (!is_ordinary)
- object->error(_("section symbol %u has bad shndx %u"),
- r_sym, shndx);
- else
- rela_dyn->add_local_section(object, shndx,
- r_type, output_section,
- data_shndx, reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- }
- break;
-
- case elfcpp::R_X86_64_PC64:
- case elfcpp::R_X86_64_PC32:
- case elfcpp::R_X86_64_PC16:
- case elfcpp::R_X86_64_PC8:
- break;
-
- case elfcpp::R_X86_64_PLT32:
- // Since we know this is a local symbol, we can handle this as a
- // PC32 reloc.
- break;
-
- case elfcpp::R_X86_64_GOTPC32:
- case elfcpp::R_X86_64_GOTOFF64:
- case elfcpp::R_X86_64_GOTPC64:
- case elfcpp::R_X86_64_PLTOFF64:
- // We need a GOT section.
- target->got_section(symtab, layout);
- // For PLTOFF64, we'd normally want a PLT section, but since we
- // know this is a local symbol, no PLT is needed.
- break;
-
- case elfcpp::R_X86_64_GOT64:
- case elfcpp::R_X86_64_GOT32:
- case elfcpp::R_X86_64_GOTPCREL64:
- case elfcpp::R_X86_64_GOTPCREL:
- case elfcpp::R_X86_64_GOTPLT64:
- {
- // The symbol requires a GOT entry.
- Output_data_got<64, false>* got = target->got_section(symtab, layout);
- unsigned int r_sym = elfcpp::elf_r_sym<64>(reloc.get_r_info());
- if (got->add_local(object, r_sym, GOT_TYPE_STANDARD))
- {
- // If we are generating a shared object, we need to add a
- // dynamic relocation for this symbol's GOT entry.
- if (parameters->options().output_is_position_independent())
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- // R_X86_64_RELATIVE assumes a 64-bit relocation.
- if (r_type != elfcpp::R_X86_64_GOT32)
- rela_dyn->add_local_relative(
- object, r_sym, elfcpp::R_X86_64_RELATIVE, got,
- object->local_got_offset(r_sym, GOT_TYPE_STANDARD), 0);
- else
- {
- this->check_non_pic(object, r_type);
-
- gold_assert(lsym.get_st_type() != elfcpp::STT_SECTION);
- rela_dyn->add_local(
- object, r_sym, r_type, got,
- object->local_got_offset(r_sym, GOT_TYPE_STANDARD), 0);
- }
- }
- }
- // For GOTPLT64, we'd normally want a PLT section, but since
- // we know this is a local symbol, no PLT is needed.
- }
- break;
-
- case elfcpp::R_X86_64_COPY:
- case elfcpp::R_X86_64_GLOB_DAT:
- case elfcpp::R_X86_64_JUMP_SLOT:
- case elfcpp::R_X86_64_RELATIVE:
- // These are outstanding tls relocs, which are unexpected when linking
- case elfcpp::R_X86_64_TPOFF64:
- case elfcpp::R_X86_64_DTPMOD64:
- case elfcpp::R_X86_64_TLSDESC:
- gold_error(_("%s: unexpected reloc %u in object file"),
- object->name().c_str(), r_type);
- break;
-
- // These are initial tls relocs, which are expected when linking
- case elfcpp::R_X86_64_TLSGD: // Global-dynamic
- case elfcpp::R_X86_64_GOTPC32_TLSDESC: // Global-dynamic (from ~oliva url)
- case elfcpp::R_X86_64_TLSDESC_CALL:
- case elfcpp::R_X86_64_TLSLD: // Local-dynamic
- case elfcpp::R_X86_64_DTPOFF32:
- case elfcpp::R_X86_64_DTPOFF64:
- case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
- case elfcpp::R_X86_64_TPOFF32: // Local-exec
- {
- bool output_is_shared = parameters->options().shared();
- const tls::Tls_optimization optimized_type
- = Target_x86_64::optimize_tls_reloc(!output_is_shared, r_type);
- switch (r_type)
- {
- case elfcpp::R_X86_64_TLSGD: // General-dynamic
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a pair of GOT entries for the module index and
- // dtv-relative offset.
- Output_data_got<64, false>* got
- = target->got_section(symtab, layout);
- unsigned int r_sym = elfcpp::elf_r_sym<64>(reloc.get_r_info());
- unsigned int shndx = lsym.get_st_shndx();
- bool is_ordinary;
- shndx = object->adjust_sym_shndx(r_sym, shndx, &is_ordinary);
- if (!is_ordinary)
- object->error(_("local symbol %u has bad shndx %u"),
- r_sym, shndx);
- else
- got->add_local_pair_with_rela(object, r_sym,
- shndx,
- GOT_TYPE_TLS_PAIR,
- target->rela_dyn_section(layout),
- elfcpp::R_X86_64_DTPMOD64, 0);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_local(object, r_type);
- break;
-
- case elfcpp::R_X86_64_GOTPC32_TLSDESC:
- target->define_tls_base_symbol(symtab, layout);
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create reserved PLT and GOT entries for the resolver.
- target->reserve_tlsdesc_entries(symtab, layout);
-
- // Generate a double GOT entry with an R_X86_64_TLSDESC reloc.
- Output_data_got<64, false>* got
- = target->got_section(symtab, layout);
- unsigned int r_sym = elfcpp::elf_r_sym<64>(reloc.get_r_info());
- unsigned int shndx = lsym.get_st_shndx();
- bool is_ordinary;
- shndx = object->adjust_sym_shndx(r_sym, shndx, &is_ordinary);
- if (!is_ordinary)
- object->error(_("local symbol %u has bad shndx %u"),
- r_sym, shndx);
- else
- got->add_local_pair_with_rela(object, r_sym,
- shndx,
- GOT_TYPE_TLS_DESC,
- target->rela_dyn_section(layout),
- elfcpp::R_X86_64_TLSDESC, 0);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_local(object, r_type);
- break;
-
- case elfcpp::R_X86_64_TLSDESC_CALL:
- break;
-
- case elfcpp::R_X86_64_TLSLD: // Local-dynamic
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a GOT entry for the module index.
- target->got_mod_index_entry(symtab, layout, object);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_local(object, r_type);
- break;
-
- case elfcpp::R_X86_64_DTPOFF32:
- case elfcpp::R_X86_64_DTPOFF64:
- break;
-
- case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
- layout->set_has_static_tls();
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a GOT entry for the tp-relative offset.
- Output_data_got<64, false>* got
- = target->got_section(symtab, layout);
- unsigned int r_sym = elfcpp::elf_r_sym<64>(reloc.get_r_info());
- got->add_local_with_rela(object, r_sym, GOT_TYPE_TLS_OFFSET,
- target->rela_dyn_section(layout),
- elfcpp::R_X86_64_TPOFF64);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_local(object, r_type);
- break;
-
- case elfcpp::R_X86_64_TPOFF32: // Local-exec
- layout->set_has_static_tls();
- if (output_is_shared)
- unsupported_reloc_local(object, r_type);
- break;
-
- default:
- gold_unreachable();
- }
- }
- break;
-
- case elfcpp::R_X86_64_SIZE32:
- case elfcpp::R_X86_64_SIZE64:
- default:
- gold_error(_("%s: unsupported reloc %u against local symbol"),
- object->name().c_str(), r_type);
- break;
- }
-}
-
-
-// Report an unsupported relocation against a global symbol.
-
-void
-Target_x86_64::Scan::unsupported_reloc_global(Sized_relobj<64, false>* object,
- unsigned int r_type,
- Symbol* gsym)
-{
- gold_error(_("%s: unsupported reloc %u against global symbol %s"),
- object->name().c_str(), r_type, gsym->demangled_name().c_str());
-}
-
-// Scan a relocation for a global symbol.
-
-inline void
-Target_x86_64::Scan::global(const General_options&,
- Symbol_table* symtab,
- Layout* layout,
- Target_x86_64* target,
- Sized_relobj<64, false>* object,
- unsigned int data_shndx,
- Output_section* output_section,
- const elfcpp::Rela<64, false>& reloc,
- unsigned int r_type,
- Symbol* gsym)
-{
- switch (r_type)
- {
- case elfcpp::R_X86_64_NONE:
- case elfcpp::R_386_GNU_VTINHERIT:
- case elfcpp::R_386_GNU_VTENTRY:
- break;
-
- case elfcpp::R_X86_64_64:
- case elfcpp::R_X86_64_32:
- case elfcpp::R_X86_64_32S:
- case elfcpp::R_X86_64_16:
- case elfcpp::R_X86_64_8:
- {
- // Make a PLT entry if necessary.
- if (gsym->needs_plt_entry())
- {
- target->make_plt_entry(symtab, layout, gsym);
- // Since this is not a PC-relative relocation, we may be
- // taking the address of a function. In that case we need to
- // set the entry in the dynamic symbol table to the address of
- // the PLT entry.
- if (gsym->is_from_dynobj() && !parameters->options().shared())
- gsym->set_needs_dynsym_value();
- }
- // Make a dynamic relocation if necessary.
- if (gsym->needs_dynamic_reloc(Symbol::ABSOLUTE_REF))
- {
- if (target->may_need_copy_reloc(gsym))
- {
- target->copy_reloc(symtab, layout, object,
- data_shndx, output_section, gsym, reloc);
- }
- else if (r_type == elfcpp::R_X86_64_64
- && gsym->can_use_relative_reloc(false))
- {
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- rela_dyn->add_global_relative(gsym, elfcpp::R_X86_64_RELATIVE,
- output_section, object,
- data_shndx, reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- else
- {
- this->check_non_pic(object, r_type);
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- rela_dyn->add_global(gsym, r_type, output_section, object,
- data_shndx, reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- }
- }
- break;
-
- case elfcpp::R_X86_64_PC64:
- case elfcpp::R_X86_64_PC32:
- case elfcpp::R_X86_64_PC16:
- case elfcpp::R_X86_64_PC8:
- {
- // Make a PLT entry if necessary.
- if (gsym->needs_plt_entry())
- target->make_plt_entry(symtab, layout, gsym);
- // Make a dynamic relocation if necessary.
- int flags = Symbol::NON_PIC_REF;
- if (gsym->type() == elfcpp::STT_FUNC)
- flags |= Symbol::FUNCTION_CALL;
- if (gsym->needs_dynamic_reloc(flags))
- {
- if (target->may_need_copy_reloc(gsym))
- {
- target->copy_reloc(symtab, layout, object,
- data_shndx, output_section, gsym, reloc);
- }
- else
- {
- this->check_non_pic(object, r_type);
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- rela_dyn->add_global(gsym, r_type, output_section, object,
- data_shndx, reloc.get_r_offset(),
- reloc.get_r_addend());
- }
- }
- }
- break;
-
- case elfcpp::R_X86_64_GOT64:
- case elfcpp::R_X86_64_GOT32:
- case elfcpp::R_X86_64_GOTPCREL64:
- case elfcpp::R_X86_64_GOTPCREL:
- case elfcpp::R_X86_64_GOTPLT64:
- {
- // The symbol requires a GOT entry.
- Output_data_got<64, false>* got = target->got_section(symtab, layout);
- if (gsym->final_value_is_known())
- got->add_global(gsym, GOT_TYPE_STANDARD);
- else
- {
- // If this symbol is not fully resolved, we need to add a
- // dynamic relocation for it.
- Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- if (gsym->is_from_dynobj()
- || gsym->is_undefined()
- || gsym->is_preemptible())
- got->add_global_with_rela(gsym, GOT_TYPE_STANDARD, rela_dyn,
- elfcpp::R_X86_64_GLOB_DAT);
- else
- {
- if (got->add_global(gsym, GOT_TYPE_STANDARD))
- rela_dyn->add_global_relative(
- gsym, elfcpp::R_X86_64_RELATIVE, got,
- gsym->got_offset(GOT_TYPE_STANDARD), 0);
- }
- }
- // For GOTPLT64, we also need a PLT entry (but only if the
- // symbol is not fully resolved).
- if (r_type == elfcpp::R_X86_64_GOTPLT64
- && !gsym->final_value_is_known())
- target->make_plt_entry(symtab, layout, gsym);
- }
- break;
-
- case elfcpp::R_X86_64_PLT32:
- // If the symbol is fully resolved, this is just a PC32 reloc.
- // Otherwise we need a PLT entry.
- if (gsym->final_value_is_known())
- break;
- // If building a shared library, we can also skip the PLT entry
- // if the symbol is defined in the output file and is protected
- // or hidden.
- if (gsym->is_defined()
- && !gsym->is_from_dynobj()
- && !gsym->is_preemptible())
- break;
- target->make_plt_entry(symtab, layout, gsym);
- break;
-
- case elfcpp::R_X86_64_GOTPC32:
- case elfcpp::R_X86_64_GOTOFF64:
- case elfcpp::R_X86_64_GOTPC64:
- case elfcpp::R_X86_64_PLTOFF64:
- // We need a GOT section.
- target->got_section(symtab, layout);
- // For PLTOFF64, we also need a PLT entry (but only if the
- // symbol is not fully resolved).
- if (r_type == elfcpp::R_X86_64_PLTOFF64
- && !gsym->final_value_is_known())
- target->make_plt_entry(symtab, layout, gsym);
- break;
-
- case elfcpp::R_X86_64_COPY:
- case elfcpp::R_X86_64_GLOB_DAT:
- case elfcpp::R_X86_64_JUMP_SLOT:
- case elfcpp::R_X86_64_RELATIVE:
- // These are outstanding tls relocs, which are unexpected when linking
- case elfcpp::R_X86_64_TPOFF64:
- case elfcpp::R_X86_64_DTPMOD64:
- case elfcpp::R_X86_64_TLSDESC:
- gold_error(_("%s: unexpected reloc %u in object file"),
- object->name().c_str(), r_type);
- break;
-
- // These are initial tls relocs, which are expected for global()
- case elfcpp::R_X86_64_TLSGD: // Global-dynamic
- case elfcpp::R_X86_64_GOTPC32_TLSDESC: // Global-dynamic (from ~oliva url)
- case elfcpp::R_X86_64_TLSDESC_CALL:
- case elfcpp::R_X86_64_TLSLD: // Local-dynamic
- case elfcpp::R_X86_64_DTPOFF32:
- case elfcpp::R_X86_64_DTPOFF64:
- case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
- case elfcpp::R_X86_64_TPOFF32: // Local-exec
- {
- const bool is_final = gsym->final_value_is_known();
- const tls::Tls_optimization optimized_type
- = Target_x86_64::optimize_tls_reloc(is_final, r_type);
- switch (r_type)
- {
- case elfcpp::R_X86_64_TLSGD: // General-dynamic
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a pair of GOT entries for the module index and
- // dtv-relative offset.
- Output_data_got<64, false>* got
- = target->got_section(symtab, layout);
- got->add_global_pair_with_rela(gsym, GOT_TYPE_TLS_PAIR,
- target->rela_dyn_section(layout),
- elfcpp::R_X86_64_DTPMOD64,
- elfcpp::R_X86_64_DTPOFF64);
- }
- else if (optimized_type == tls::TLSOPT_TO_IE)
- {
- // Create a GOT entry for the tp-relative offset.
- Output_data_got<64, false>* got
- = target->got_section(symtab, layout);
- got->add_global_with_rela(gsym, GOT_TYPE_TLS_OFFSET,
- target->rela_dyn_section(layout),
- elfcpp::R_X86_64_TPOFF64);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_global(object, r_type, gsym);
- break;
-
- case elfcpp::R_X86_64_GOTPC32_TLSDESC:
- target->define_tls_base_symbol(symtab, layout);
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create reserved PLT and GOT entries for the resolver.
- target->reserve_tlsdesc_entries(symtab, layout);
-
- // Create a double GOT entry with an R_X86_64_TLSDESC reloc.
- Output_data_got<64, false>* got
- = target->got_section(symtab, layout);
- got->add_global_pair_with_rela(gsym, GOT_TYPE_TLS_DESC,
- target->rela_dyn_section(layout),
- elfcpp::R_X86_64_TLSDESC, 0);
- }
- else if (optimized_type == tls::TLSOPT_TO_IE)
- {
- // Create a GOT entry for the tp-relative offset.
- Output_data_got<64, false>* got
- = target->got_section(symtab, layout);
- got->add_global_with_rela(gsym, GOT_TYPE_TLS_OFFSET,
- target->rela_dyn_section(layout),
- elfcpp::R_X86_64_TPOFF64);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_global(object, r_type, gsym);
- break;
-
- case elfcpp::R_X86_64_TLSDESC_CALL:
- break;
-
- case elfcpp::R_X86_64_TLSLD: // Local-dynamic
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a GOT entry for the module index.
- target->got_mod_index_entry(symtab, layout, object);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_global(object, r_type, gsym);
- break;
-
- case elfcpp::R_X86_64_DTPOFF32:
- case elfcpp::R_X86_64_DTPOFF64:
- break;
-
- case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
- layout->set_has_static_tls();
- if (optimized_type == tls::TLSOPT_NONE)
- {
- // Create a GOT entry for the tp-relative offset.
- Output_data_got<64, false>* got
- = target->got_section(symtab, layout);
- got->add_global_with_rela(gsym, GOT_TYPE_TLS_OFFSET,
- target->rela_dyn_section(layout),
- elfcpp::R_X86_64_TPOFF64);
- }
- else if (optimized_type != tls::TLSOPT_TO_LE)
- unsupported_reloc_global(object, r_type, gsym);
- break;
-
- case elfcpp::R_X86_64_TPOFF32: // Local-exec
- layout->set_has_static_tls();
- if (parameters->options().shared())
- unsupported_reloc_local(object, r_type);
- break;
-
- default:
- gold_unreachable();
- }
- }
- break;
-
- case elfcpp::R_X86_64_SIZE32:
- case elfcpp::R_X86_64_SIZE64:
- default:
- gold_error(_("%s: unsupported reloc %u against global symbol %s"),
- object->name().c_str(), r_type,
- gsym->demangled_name().c_str());
- break;
- }
-}
-
-// Scan relocations for a section.
-
-void
-Target_x86_64::scan_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<64, false>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols)
-{
- if (sh_type == elfcpp::SHT_REL)
- {
- gold_error(_("%s: unsupported REL reloc section"),
- object->name().c_str());
- return;
- }
-
- gold::scan_relocs<64, false, Target_x86_64, elfcpp::SHT_RELA,
- Target_x86_64::Scan>(
- options,
- symtab,
- layout,
- this,
- object,
- data_shndx,
- prelocs,
- reloc_count,
- output_section,
- needs_special_offset_handling,
- local_symbol_count,
- plocal_symbols);
-}
-
-// Finalize the sections.
-
-void
-Target_x86_64::do_finalize_sections(Layout* layout)
-{
- // Fill in some more dynamic tags.
- Output_data_dynamic* const odyn = layout->dynamic_data();
- if (odyn != NULL)
- {
- if (this->got_plt_ != NULL)
- odyn->add_section_address(elfcpp::DT_PLTGOT, this->got_plt_);
-
- if (this->plt_ != NULL)
- {
- const Output_data* od = this->plt_->rel_plt();
- odyn->add_section_size(elfcpp::DT_PLTRELSZ, od);
- odyn->add_section_address(elfcpp::DT_JMPREL, od);
- odyn->add_constant(elfcpp::DT_PLTREL, elfcpp::DT_RELA);
- if (this->plt_->has_tlsdesc_entry())
- {
- unsigned int plt_offset = this->plt_->get_tlsdesc_plt_offset();
- unsigned int got_offset = this->plt_->get_tlsdesc_got_offset();
- this->got_->finalize_data_size();
- odyn->add_section_plus_offset(elfcpp::DT_TLSDESC_PLT,
- this->plt_, plt_offset);
- odyn->add_section_plus_offset(elfcpp::DT_TLSDESC_GOT,
- this->got_, got_offset);
- }
- }
-
- if (this->rela_dyn_ != NULL)
- {
- const Output_data* od = this->rela_dyn_;
- odyn->add_section_address(elfcpp::DT_RELA, od);
- odyn->add_section_size(elfcpp::DT_RELASZ, od);
- odyn->add_constant(elfcpp::DT_RELAENT,
- elfcpp::Elf_sizes<64>::rela_size);
- }
-
- if (!parameters->options().shared())
- {
- // The value of the DT_DEBUG tag is filled in by the dynamic
- // linker at run time, and used by the debugger.
- odyn->add_constant(elfcpp::DT_DEBUG, 0);
- }
- }
-
- // Emit any relocs we saved in an attempt to avoid generating COPY
- // relocs.
- if (this->copy_relocs_.any_saved_relocs())
- this->copy_relocs_.emit(this->rela_dyn_section(layout));
-}
-
-// Perform a relocation.
-
-inline bool
-Target_x86_64::Relocate::relocate(const Relocate_info<64, false>* relinfo,
- Target_x86_64* target,
- size_t relnum,
- const elfcpp::Rela<64, false>& rela,
- unsigned int r_type,
- const Sized_symbol<64>* gsym,
- const Symbol_value<64>* psymval,
- unsigned char* view,
- elfcpp::Elf_types<64>::Elf_Addr address,
- section_size_type view_size)
-{
- if (this->skip_call_tls_get_addr_)
- {
- if (r_type != elfcpp::R_X86_64_PLT32
- || gsym == NULL
- || strcmp(gsym->name(), "__tls_get_addr") != 0)
- {
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("missing expected TLS relocation"));
- }
- else
- {
- this->skip_call_tls_get_addr_ = false;
- return false;
- }
- }
-
- // Pick the value to use for symbols defined in shared objects.
- Symbol_value<64> symval;
- if (gsym != NULL
- && gsym->use_plt_offset(r_type == elfcpp::R_X86_64_PC64
- || r_type == elfcpp::R_X86_64_PC32
- || r_type == elfcpp::R_X86_64_PC16
- || r_type == elfcpp::R_X86_64_PC8))
- {
- symval.set_output_value(target->plt_section()->address()
- + gsym->plt_offset());
- psymval = &symval;
- }
-
- const Sized_relobj<64, false>* object = relinfo->object;
- const elfcpp::Elf_Xword addend = rela.get_r_addend();
-
- // Get the GOT offset if needed.
- // The GOT pointer points to the end of the GOT section.
- // We need to subtract the size of the GOT section to get
- // the actual offset to use in the relocation.
- bool have_got_offset = false;
- unsigned int got_offset = 0;
- switch (r_type)
- {
- case elfcpp::R_X86_64_GOT32:
- case elfcpp::R_X86_64_GOT64:
- case elfcpp::R_X86_64_GOTPLT64:
- case elfcpp::R_X86_64_GOTPCREL:
- case elfcpp::R_X86_64_GOTPCREL64:
- if (gsym != NULL)
- {
- gold_assert(gsym->has_got_offset(GOT_TYPE_STANDARD));
- got_offset = gsym->got_offset(GOT_TYPE_STANDARD) - target->got_size();
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<64>(rela.get_r_info());
- gold_assert(object->local_has_got_offset(r_sym, GOT_TYPE_STANDARD));
- got_offset = (object->local_got_offset(r_sym, GOT_TYPE_STANDARD)
- - target->got_size());
- }
- have_got_offset = true;
- break;
-
- default:
- break;
- }
-
- switch (r_type)
- {
- case elfcpp::R_X86_64_NONE:
- case elfcpp::R_386_GNU_VTINHERIT:
- case elfcpp::R_386_GNU_VTENTRY:
- break;
-
- case elfcpp::R_X86_64_64:
- Relocate_functions<64, false>::rela64(view, object, psymval, addend);
- break;
-
- case elfcpp::R_X86_64_PC64:
- Relocate_functions<64, false>::pcrela64(view, object, psymval, addend,
- address);
- break;
-
- case elfcpp::R_X86_64_32:
- // FIXME: we need to verify that value + addend fits into 32 bits:
- // uint64_t x = value + addend;
- // x == static_cast<uint64_t>(static_cast<uint32_t>(x))
- // Likewise for other <=32-bit relocations (but see R_X86_64_32S).
- Relocate_functions<64, false>::rela32(view, object, psymval, addend);
- break;
-
- case elfcpp::R_X86_64_32S:
- // FIXME: we need to verify that value + addend fits into 32 bits:
- // int64_t x = value + addend; // note this quantity is signed!
- // x == static_cast<int64_t>(static_cast<int32_t>(x))
- Relocate_functions<64, false>::rela32(view, object, psymval, addend);
- break;
-
- case elfcpp::R_X86_64_PC32:
- Relocate_functions<64, false>::pcrela32(view, object, psymval, addend,
- address);
- break;
-
- case elfcpp::R_X86_64_16:
- Relocate_functions<64, false>::rela16(view, object, psymval, addend);
- break;
-
- case elfcpp::R_X86_64_PC16:
- Relocate_functions<64, false>::pcrela16(view, object, psymval, addend,
- address);
- break;
-
- case elfcpp::R_X86_64_8:
- Relocate_functions<64, false>::rela8(view, object, psymval, addend);
- break;
-
- case elfcpp::R_X86_64_PC8:
- Relocate_functions<64, false>::pcrela8(view, object, psymval, addend,
- address);
- break;
-
- case elfcpp::R_X86_64_PLT32:
- gold_assert(gsym == NULL
- || gsym->has_plt_offset()
- || gsym->final_value_is_known()
- || (gsym->is_defined()
- && !gsym->is_from_dynobj()
- && !gsym->is_preemptible()));
- // Note: while this code looks the same as for R_X86_64_PC32, it
- // behaves differently because psymval was set to point to
- // the PLT entry, rather than the symbol, in Scan::global().
- Relocate_functions<64, false>::pcrela32(view, object, psymval, addend,
- address);
- break;
-
- case elfcpp::R_X86_64_PLTOFF64:
- {
- gold_assert(gsym);
- gold_assert(gsym->has_plt_offset()
- || gsym->final_value_is_known());
- elfcpp::Elf_types<64>::Elf_Addr got_address;
- got_address = target->got_section(NULL, NULL)->address();
- Relocate_functions<64, false>::rela64(view, object, psymval,
- addend - got_address);
- }
-
- case elfcpp::R_X86_64_GOT32:
- gold_assert(have_got_offset);
- Relocate_functions<64, false>::rela32(view, got_offset, addend);
- break;
-
- case elfcpp::R_X86_64_GOTPC32:
- {
- gold_assert(gsym);
- elfcpp::Elf_types<64>::Elf_Addr value;
- value = target->got_plt_section()->address();
- Relocate_functions<64, false>::pcrela32(view, value, addend, address);
- }
- break;
-
- case elfcpp::R_X86_64_GOT64:
- // The ABI doc says "Like GOT64, but indicates a PLT entry is needed."
- // Since we always add a PLT entry, this is equivalent.
- case elfcpp::R_X86_64_GOTPLT64:
- gold_assert(have_got_offset);
- Relocate_functions<64, false>::rela64(view, got_offset, addend);
- break;
-
- case elfcpp::R_X86_64_GOTPC64:
- {
- gold_assert(gsym);
- elfcpp::Elf_types<64>::Elf_Addr value;
- value = target->got_plt_section()->address();
- Relocate_functions<64, false>::pcrela64(view, value, addend, address);
- }
- break;
-
- case elfcpp::R_X86_64_GOTOFF64:
- {
- elfcpp::Elf_types<64>::Elf_Addr value;
- value = (psymval->value(object, 0)
- - target->got_plt_section()->address());
- Relocate_functions<64, false>::rela64(view, value, addend);
- }
- break;
-
- case elfcpp::R_X86_64_GOTPCREL:
- {
- gold_assert(have_got_offset);
- elfcpp::Elf_types<64>::Elf_Addr value;
- value = target->got_plt_section()->address() + got_offset;
- Relocate_functions<64, false>::pcrela32(view, value, addend, address);
- }
- break;
-
- case elfcpp::R_X86_64_GOTPCREL64:
- {
- gold_assert(have_got_offset);
- elfcpp::Elf_types<64>::Elf_Addr value;
- value = target->got_plt_section()->address() + got_offset;
- Relocate_functions<64, false>::pcrela64(view, value, addend, address);
- }
- break;
-
- case elfcpp::R_X86_64_COPY:
- case elfcpp::R_X86_64_GLOB_DAT:
- case elfcpp::R_X86_64_JUMP_SLOT:
- case elfcpp::R_X86_64_RELATIVE:
- // These are outstanding tls relocs, which are unexpected when linking
- case elfcpp::R_X86_64_TPOFF64:
- case elfcpp::R_X86_64_DTPMOD64:
- case elfcpp::R_X86_64_TLSDESC:
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unexpected reloc %u in object file"),
- r_type);
- break;
-
- // These are initial tls relocs, which are expected when linking
- case elfcpp::R_X86_64_TLSGD: // Global-dynamic
- case elfcpp::R_X86_64_GOTPC32_TLSDESC: // Global-dynamic (from ~oliva url)
- case elfcpp::R_X86_64_TLSDESC_CALL:
- case elfcpp::R_X86_64_TLSLD: // Local-dynamic
- case elfcpp::R_X86_64_DTPOFF32:
- case elfcpp::R_X86_64_DTPOFF64:
- case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
- case elfcpp::R_X86_64_TPOFF32: // Local-exec
- this->relocate_tls(relinfo, target, relnum, rela, r_type, gsym, psymval,
- view, address, view_size);
- break;
-
- case elfcpp::R_X86_64_SIZE32:
- case elfcpp::R_X86_64_SIZE64:
- default:
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unsupported reloc %u"),
- r_type);
- break;
- }
-
- return true;
-}
-
-// Perform a TLS relocation.
-
-inline void
-Target_x86_64::Relocate::relocate_tls(const Relocate_info<64, false>* relinfo,
- Target_x86_64* target,
- size_t relnum,
- const elfcpp::Rela<64, false>& rela,
- unsigned int r_type,
- const Sized_symbol<64>* gsym,
- const Symbol_value<64>* psymval,
- unsigned char* view,
- elfcpp::Elf_types<64>::Elf_Addr address,
- section_size_type view_size)
-{
- Output_segment* tls_segment = relinfo->layout->tls_segment();
-
- const Sized_relobj<64, false>* object = relinfo->object;
- const elfcpp::Elf_Xword addend = rela.get_r_addend();
-
- elfcpp::Elf_types<64>::Elf_Addr value = psymval->value(relinfo->object, 0);
-
- const bool is_final = (gsym == NULL
- ? !parameters->options().output_is_position_independent()
- : gsym->final_value_is_known());
- const tls::Tls_optimization optimized_type
- = Target_x86_64::optimize_tls_reloc(is_final, r_type);
- switch (r_type)
- {
- case elfcpp::R_X86_64_TLSGD: // Global-dynamic
- this->saw_tls_block_reloc_ = true;
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- gold_assert(tls_segment != NULL);
- this->tls_gd_to_le(relinfo, relnum, tls_segment,
- rela, r_type, value, view,
- view_size);
- break;
- }
- else
- {
- unsigned int got_type = (optimized_type == tls::TLSOPT_TO_IE
- ? GOT_TYPE_TLS_OFFSET
- : GOT_TYPE_TLS_PAIR);
- unsigned int got_offset;
- if (gsym != NULL)
- {
- gold_assert(gsym->has_got_offset(got_type));
- got_offset = gsym->got_offset(got_type) - target->got_size();
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<64>(rela.get_r_info());
- gold_assert(object->local_has_got_offset(r_sym, got_type));
- got_offset = (object->local_got_offset(r_sym, got_type)
- - target->got_size());
- }
- if (optimized_type == tls::TLSOPT_TO_IE)
- {
- gold_assert(tls_segment != NULL);
- value = target->got_plt_section()->address() + got_offset;
- this->tls_gd_to_ie(relinfo, relnum, tls_segment, rela, r_type,
- value, view, address, view_size);
- break;
- }
- else if (optimized_type == tls::TLSOPT_NONE)
- {
- // Relocate the field with the offset of the pair of GOT
- // entries.
- value = target->got_plt_section()->address() + got_offset;
- Relocate_functions<64, false>::pcrela32(view, value, addend,
- address);
- break;
- }
- }
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unsupported reloc %u"), r_type);
- break;
-
- case elfcpp::R_X86_64_GOTPC32_TLSDESC: // Global-dynamic (from ~oliva url)
- case elfcpp::R_X86_64_TLSDESC_CALL:
- this->saw_tls_block_reloc_ = true;
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- gold_assert(tls_segment != NULL);
- this->tls_desc_gd_to_le(relinfo, relnum, tls_segment,
- rela, r_type, value, view,
- view_size);
- break;
- }
- else
- {
- unsigned int got_type = (optimized_type == tls::TLSOPT_TO_IE
- ? GOT_TYPE_TLS_OFFSET
- : GOT_TYPE_TLS_DESC);
- unsigned int got_offset;
- if (gsym != NULL)
- {
- gold_assert(gsym->has_got_offset(got_type));
- got_offset = gsym->got_offset(got_type) - target->got_size();
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<64>(rela.get_r_info());
- gold_assert(object->local_has_got_offset(r_sym, got_type));
- got_offset = (object->local_got_offset(r_sym, got_type)
- - target->got_size());
- }
- if (optimized_type == tls::TLSOPT_TO_IE)
- {
- gold_assert(tls_segment != NULL);
- value = target->got_plt_section()->address() + got_offset;
- this->tls_desc_gd_to_ie(relinfo, relnum, tls_segment,
- rela, r_type, value, view, address,
- view_size);
- break;
- }
- else if (optimized_type == tls::TLSOPT_NONE)
- {
- if (r_type == elfcpp::R_X86_64_GOTPC32_TLSDESC)
- {
- // Relocate the field with the offset of the pair of GOT
- // entries.
- value = target->got_plt_section()->address() + got_offset;
- Relocate_functions<64, false>::pcrela32(view, value, addend,
- address);
- }
- break;
- }
- }
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unsupported reloc %u"), r_type);
- break;
-
- case elfcpp::R_X86_64_TLSLD: // Local-dynamic
- this->saw_tls_block_reloc_ = true;
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- gold_assert(tls_segment != NULL);
- this->tls_ld_to_le(relinfo, relnum, tls_segment, rela, r_type,
- value, view, view_size);
- break;
- }
- else if (optimized_type == tls::TLSOPT_NONE)
- {
- // Relocate the field with the offset of the GOT entry for
- // the module index.
- unsigned int got_offset;
- got_offset = (target->got_mod_index_entry(NULL, NULL, NULL)
- - target->got_size());
- value = target->got_plt_section()->address() + got_offset;
- Relocate_functions<64, false>::pcrela32(view, value, addend,
- address);
- break;
- }
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unsupported reloc %u"), r_type);
- break;
-
- case elfcpp::R_X86_64_DTPOFF32:
- gold_assert(tls_segment != NULL);
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- // This relocation type is used in debugging information.
- // In that case we need to not optimize the value. If we
- // haven't seen a TLSLD reloc, then we assume we should not
- // optimize this reloc.
- if (this->saw_tls_block_reloc_)
- value -= tls_segment->memsz();
- }
- Relocate_functions<64, false>::rela32(view, value, 0);
- break;
-
- case elfcpp::R_X86_64_DTPOFF64:
- gold_assert(tls_segment != NULL);
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- // See R_X86_64_DTPOFF32, just above, for why we test this.
- if (this->saw_tls_block_reloc_)
- value -= tls_segment->memsz();
- }
- Relocate_functions<64, false>::rela64(view, value, 0);
- break;
-
- case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
- if (optimized_type == tls::TLSOPT_TO_LE)
- {
- gold_assert(tls_segment != NULL);
- Target_x86_64::Relocate::tls_ie_to_le(relinfo, relnum, tls_segment,
- rela, r_type, value, view,
- view_size);
- break;
- }
- else if (optimized_type == tls::TLSOPT_NONE)
- {
- // Relocate the field with the offset of the GOT entry for
- // the tp-relative offset of the symbol.
- unsigned int got_offset;
- if (gsym != NULL)
- {
- gold_assert(gsym->has_got_offset(GOT_TYPE_TLS_OFFSET));
- got_offset = (gsym->got_offset(GOT_TYPE_TLS_OFFSET)
- - target->got_size());
- }
- else
- {
- unsigned int r_sym = elfcpp::elf_r_sym<64>(rela.get_r_info());
- gold_assert(object->local_has_got_offset(r_sym,
- GOT_TYPE_TLS_OFFSET));
- got_offset = (object->local_got_offset(r_sym, GOT_TYPE_TLS_OFFSET)
- - target->got_size());
- }
- value = target->got_plt_section()->address() + got_offset;
- Relocate_functions<64, false>::pcrela32(view, value, addend, address);
- break;
- }
- gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
- _("unsupported reloc type %u"),
- r_type);
- break;
-
- case elfcpp::R_X86_64_TPOFF32: // Local-exec
- value -= tls_segment->memsz();
- Relocate_functions<64, false>::rela32(view, value, 0);
- break;
- }
-}
-
-// Do a relocation in which we convert a TLS General-Dynamic to an
-// Initial-Exec.
-
-inline void
-Target_x86_64::Relocate::tls_gd_to_ie(const Relocate_info<64, false>* relinfo,
- size_t relnum,
- Output_segment*,
- const elfcpp::Rela<64, false>& rela,
- unsigned int,
- elfcpp::Elf_types<64>::Elf_Addr value,
- unsigned char* view,
- elfcpp::Elf_types<64>::Elf_Addr address,
- section_size_type view_size)
-{
- // .byte 0x66; leaq foo@tlsgd(%rip),%rdi;
- // .word 0x6666; rex64; call __tls_get_addr
- // ==> movq %fs:0,%rax; addq x@gottpoff(%rip),%rax
-
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, -4);
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, 12);
-
- tls::check_tls(relinfo, relnum, rela.get_r_offset(),
- (memcmp(view - 4, "\x66\x48\x8d\x3d", 4) == 0));
- tls::check_tls(relinfo, relnum, rela.get_r_offset(),
- (memcmp(view + 4, "\x66\x66\x48\xe8", 4) == 0));
-
- memcpy(view - 4, "\x64\x48\x8b\x04\x25\0\0\0\0\x48\x03\x05\0\0\0\0", 16);
-
- const elfcpp::Elf_Xword addend = rela.get_r_addend();
- Relocate_functions<64, false>::pcrela32(view + 8, value, addend - 8, address);
-
- // The next reloc should be a PLT32 reloc against __tls_get_addr.
- // We can skip it.
- this->skip_call_tls_get_addr_ = true;
-}
-
-// Do a relocation in which we convert a TLS General-Dynamic to a
-// Local-Exec.
-
-inline void
-Target_x86_64::Relocate::tls_gd_to_le(const Relocate_info<64, false>* relinfo,
- size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rela<64, false>& rela,
- unsigned int,
- elfcpp::Elf_types<64>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size)
-{
- // .byte 0x66; leaq foo@tlsgd(%rip),%rdi;
- // .word 0x6666; rex64; call __tls_get_addr
- // ==> movq %fs:0,%rax; leaq x@tpoff(%rax),%rax
-
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, -4);
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, 12);
-
- tls::check_tls(relinfo, relnum, rela.get_r_offset(),
- (memcmp(view - 4, "\x66\x48\x8d\x3d", 4) == 0));
- tls::check_tls(relinfo, relnum, rela.get_r_offset(),
- (memcmp(view + 4, "\x66\x66\x48\xe8", 4) == 0));
-
- memcpy(view - 4, "\x64\x48\x8b\x04\x25\0\0\0\0\x48\x8d\x80\0\0\0\0", 16);
-
- value -= tls_segment->memsz();
- Relocate_functions<64, false>::rela32(view + 8, value, 0);
-
- // The next reloc should be a PLT32 reloc against __tls_get_addr.
- // We can skip it.
- this->skip_call_tls_get_addr_ = true;
-}
-
-// Do a TLSDESC-style General-Dynamic to Initial-Exec transition.
-
-inline void
-Target_x86_64::Relocate::tls_desc_gd_to_ie(
- const Relocate_info<64, false>* relinfo,
- size_t relnum,
- Output_segment*,
- const elfcpp::Rela<64, false>& rela,
- unsigned int r_type,
- elfcpp::Elf_types<64>::Elf_Addr value,
- unsigned char* view,
- elfcpp::Elf_types<64>::Elf_Addr address,
- section_size_type view_size)
-{
- if (r_type == elfcpp::R_X86_64_GOTPC32_TLSDESC)
- {
- // leaq foo@tlsdesc(%rip), %rax
- // ==> movq foo@gottpoff(%rip), %rax
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, -3);
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, 4);
- tls::check_tls(relinfo, relnum, rela.get_r_offset(),
- view[-3] == 0x48 && view[-2] == 0x8d && view[-1] == 0x05);
- view[-2] = 0x8b;
- const elfcpp::Elf_Xword addend = rela.get_r_addend();
- Relocate_functions<64, false>::pcrela32(view, value, addend, address);
- }
- else
- {
- // call *foo@tlscall(%rax)
- // ==> nop; nop
- gold_assert(r_type == elfcpp::R_X86_64_TLSDESC_CALL);
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, 2);
- tls::check_tls(relinfo, relnum, rela.get_r_offset(),
- view[0] == 0xff && view[1] == 0x10);
- view[0] = 0x66;
- view[1] = 0x90;
- }
-}
-
-// Do a TLSDESC-style General-Dynamic to Local-Exec transition.
-
-inline void
-Target_x86_64::Relocate::tls_desc_gd_to_le(
- const Relocate_info<64, false>* relinfo,
- size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rela<64, false>& rela,
- unsigned int r_type,
- elfcpp::Elf_types<64>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size)
-{
- if (r_type == elfcpp::R_X86_64_GOTPC32_TLSDESC)
- {
- // leaq foo@tlsdesc(%rip), %rax
- // ==> movq foo@tpoff, %rax
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, -3);
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, 4);
- tls::check_tls(relinfo, relnum, rela.get_r_offset(),
- view[-3] == 0x48 && view[-2] == 0x8d && view[-1] == 0x05);
- view[-2] = 0xc7;
- view[-1] = 0xc0;
- value -= tls_segment->memsz();
- Relocate_functions<64, false>::rela32(view, value, 0);
- }
- else
- {
- // call *foo@tlscall(%rax)
- // ==> nop; nop
- gold_assert(r_type == elfcpp::R_X86_64_TLSDESC_CALL);
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, 2);
- tls::check_tls(relinfo, relnum, rela.get_r_offset(),
- view[0] == 0xff && view[1] == 0x10);
- view[0] = 0x66;
- view[1] = 0x90;
- }
-}
-
-inline void
-Target_x86_64::Relocate::tls_ld_to_le(const Relocate_info<64, false>* relinfo,
- size_t relnum,
- Output_segment*,
- const elfcpp::Rela<64, false>& rela,
- unsigned int,
- elfcpp::Elf_types<64>::Elf_Addr,
- unsigned char* view,
- section_size_type view_size)
-{
- // leaq foo@tlsld(%rip),%rdi; call __tls_get_addr@plt;
- // ... leq foo@dtpoff(%rax),%reg
- // ==> .word 0x6666; .byte 0x66; movq %fs:0,%rax ... leaq x@tpoff(%rax),%rdx
-
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, -3);
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, 9);
-
- tls::check_tls(relinfo, relnum, rela.get_r_offset(),
- view[-3] == 0x48 && view[-2] == 0x8d && view[-1] == 0x3d);
-
- tls::check_tls(relinfo, relnum, rela.get_r_offset(), view[4] == 0xe8);
-
- memcpy(view - 3, "\x66\x66\x66\x64\x48\x8b\x04\x25\0\0\0\0", 12);
-
- // The next reloc should be a PLT32 reloc against __tls_get_addr.
- // We can skip it.
- this->skip_call_tls_get_addr_ = true;
-}
-
-// Do a relocation in which we convert a TLS Initial-Exec to a
-// Local-Exec.
-
-inline void
-Target_x86_64::Relocate::tls_ie_to_le(const Relocate_info<64, false>* relinfo,
- size_t relnum,
- Output_segment* tls_segment,
- const elfcpp::Rela<64, false>& rela,
- unsigned int,
- elfcpp::Elf_types<64>::Elf_Addr value,
- unsigned char* view,
- section_size_type view_size)
-{
- // We need to examine the opcodes to figure out which instruction we
- // are looking at.
-
- // movq foo@gottpoff(%rip),%reg ==> movq $YY,%reg
- // addq foo@gottpoff(%rip),%reg ==> addq $YY,%reg
-
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, -3);
- tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, 4);
-
- unsigned char op1 = view[-3];
- unsigned char op2 = view[-2];
- unsigned char op3 = view[-1];
- unsigned char reg = op3 >> 3;
-
- if (op2 == 0x8b)
- {
- // movq
- if (op1 == 0x4c)
- view[-3] = 0x49;
- view[-2] = 0xc7;
- view[-1] = 0xc0 | reg;
- }
- else if (reg == 4)
- {
- // Special handling for %rsp.
- if (op1 == 0x4c)
- view[-3] = 0x49;
- view[-2] = 0x81;
- view[-1] = 0xc0 | reg;
- }
- else
- {
- // addq
- if (op1 == 0x4c)
- view[-3] = 0x4d;
- view[-2] = 0x8d;
- view[-1] = 0x80 | reg | (reg << 3);
- }
-
- value -= tls_segment->memsz();
- Relocate_functions<64, false>::rela32(view, value, 0);
-}
-
-// Relocate section data.
-
-void
-Target_x86_64::relocate_section(const Relocate_info<64, false>* relinfo,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- unsigned char* view,
- elfcpp::Elf_types<64>::Elf_Addr address,
- section_size_type view_size)
-{
- gold_assert(sh_type == elfcpp::SHT_RELA);
-
- gold::relocate_section<64, false, Target_x86_64, elfcpp::SHT_RELA,
- Target_x86_64::Relocate>(
- relinfo,
- this,
- prelocs,
- reloc_count,
- output_section,
- needs_special_offset_handling,
- view,
- address,
- view_size);
-}
-
-// Return the size of a relocation while scanning during a relocatable
-// link.
-
-unsigned int
-Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc(
- unsigned int r_type,
- Relobj* object)
-{
- switch (r_type)
- {
- case elfcpp::R_X86_64_NONE:
- case elfcpp::R_386_GNU_VTINHERIT:
- case elfcpp::R_386_GNU_VTENTRY:
- case elfcpp::R_X86_64_TLSGD: // Global-dynamic
- case elfcpp::R_X86_64_GOTPC32_TLSDESC: // Global-dynamic (from ~oliva url)
- case elfcpp::R_X86_64_TLSDESC_CALL:
- case elfcpp::R_X86_64_TLSLD: // Local-dynamic
- case elfcpp::R_X86_64_DTPOFF32:
- case elfcpp::R_X86_64_DTPOFF64:
- case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
- case elfcpp::R_X86_64_TPOFF32: // Local-exec
- return 0;
-
- case elfcpp::R_X86_64_64:
- case elfcpp::R_X86_64_PC64:
- case elfcpp::R_X86_64_GOTOFF64:
- case elfcpp::R_X86_64_GOTPC64:
- case elfcpp::R_X86_64_PLTOFF64:
- case elfcpp::R_X86_64_GOT64:
- case elfcpp::R_X86_64_GOTPCREL64:
- case elfcpp::R_X86_64_GOTPCREL:
- case elfcpp::R_X86_64_GOTPLT64:
- return 8;
-
- case elfcpp::R_X86_64_32:
- case elfcpp::R_X86_64_32S:
- case elfcpp::R_X86_64_PC32:
- case elfcpp::R_X86_64_PLT32:
- case elfcpp::R_X86_64_GOTPC32:
- case elfcpp::R_X86_64_GOT32:
- return 4;
-
- case elfcpp::R_X86_64_16:
- case elfcpp::R_X86_64_PC16:
- return 2;
-
- case elfcpp::R_X86_64_8:
- case elfcpp::R_X86_64_PC8:
- return 1;
-
- case elfcpp::R_X86_64_COPY:
- case elfcpp::R_X86_64_GLOB_DAT:
- case elfcpp::R_X86_64_JUMP_SLOT:
- case elfcpp::R_X86_64_RELATIVE:
- // These are outstanding tls relocs, which are unexpected when linking
- case elfcpp::R_X86_64_TPOFF64:
- case elfcpp::R_X86_64_DTPMOD64:
- case elfcpp::R_X86_64_TLSDESC:
- object->error(_("unexpected reloc %u in object file"), r_type);
- return 0;
-
- case elfcpp::R_X86_64_SIZE32:
- case elfcpp::R_X86_64_SIZE64:
- default:
- object->error(_("unsupported reloc %u against local symbol"), r_type);
- return 0;
- }
-}
-
-// Scan the relocs during a relocatable link.
-
-void
-Target_x86_64::scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<64, false>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols,
- Relocatable_relocs* rr)
-{
- gold_assert(sh_type == elfcpp::SHT_RELA);
-
- typedef gold::Default_scan_relocatable_relocs<elfcpp::SHT_RELA,
- Relocatable_size_for_reloc> Scan_relocatable_relocs;
-
- gold::scan_relocatable_relocs<64, false, elfcpp::SHT_RELA,
- Scan_relocatable_relocs>(
- options,
- symtab,
- layout,
- object,
- data_shndx,
- prelocs,
- reloc_count,
- output_section,
- needs_special_offset_handling,
- local_symbol_count,
- plocal_symbols,
- rr);
-}
-
-// Relocate a section during a relocatable link.
-
-void
-Target_x86_64::relocate_for_relocatable(
- const Relocate_info<64, false>* relinfo,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- off_t offset_in_output_section,
- const Relocatable_relocs* rr,
- unsigned char* view,
- elfcpp::Elf_types<64>::Elf_Addr view_address,
- section_size_type view_size,
- unsigned char* reloc_view,
- section_size_type reloc_view_size)
-{
- gold_assert(sh_type == elfcpp::SHT_RELA);
-
- gold::relocate_for_relocatable<64, false, elfcpp::SHT_RELA>(
- relinfo,
- prelocs,
- reloc_count,
- output_section,
- offset_in_output_section,
- rr,
- view,
- view_address,
- view_size,
- reloc_view,
- reloc_view_size);
-}
-
-// Return the value to use for a dynamic which requires special
-// treatment. This is how we support equality comparisons of function
-// pointers across shared library boundaries, as described in the
-// processor specific ABI supplement.
-
-uint64_t
-Target_x86_64::do_dynsym_value(const Symbol* gsym) const
-{
- gold_assert(gsym->is_from_dynobj() && gsym->has_plt_offset());
- return this->plt_section()->address() + gsym->plt_offset();
-}
-
-// Return a string used to fill a code section with nops to take up
-// the specified length.
-
-std::string
-Target_x86_64::do_code_fill(section_size_type length) const
-{
- if (length >= 16)
- {
- // Build a jmpq instruction to skip over the bytes.
- unsigned char jmp[5];
- jmp[0] = 0xe9;
- elfcpp::Swap_unaligned<32, false>::writeval(jmp + 1, length - 5);
- return (std::string(reinterpret_cast<char*>(&jmp[0]), 5)
- + std::string(length - 5, '\0'));
- }
-
- // Nop sequences of various lengths.
- const char nop1[1] = { 0x90 }; // nop
- const char nop2[2] = { 0x66, 0x90 }; // xchg %ax %ax
- const char nop3[3] = { 0x8d, 0x76, 0x00 }; // leal 0(%esi),%esi
- const char nop4[4] = { 0x8d, 0x74, 0x26, 0x00}; // leal 0(%esi,1),%esi
- const char nop5[5] = { 0x90, 0x8d, 0x74, 0x26, // nop
- 0x00 }; // leal 0(%esi,1),%esi
- const char nop6[6] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
- 0x00, 0x00 };
- const char nop7[7] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi
- 0x00, 0x00, 0x00 };
- const char nop8[8] = { 0x90, 0x8d, 0xb4, 0x26, // nop
- 0x00, 0x00, 0x00, 0x00 }; // leal 0L(%esi,1),%esi
- const char nop9[9] = { 0x89, 0xf6, 0x8d, 0xbc, // movl %esi,%esi
- 0x27, 0x00, 0x00, 0x00, // leal 0L(%edi,1),%edi
- 0x00 };
- const char nop10[10] = { 0x8d, 0x76, 0x00, 0x8d, // leal 0(%esi),%esi
- 0xbc, 0x27, 0x00, 0x00, // leal 0L(%edi,1),%edi
- 0x00, 0x00 };
- const char nop11[11] = { 0x8d, 0x74, 0x26, 0x00, // leal 0(%esi,1),%esi
- 0x8d, 0xbc, 0x27, 0x00, // leal 0L(%edi,1),%edi
- 0x00, 0x00, 0x00 };
- const char nop12[12] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
- 0x00, 0x00, 0x8d, 0xbf, // leal 0L(%edi),%edi
- 0x00, 0x00, 0x00, 0x00 };
- const char nop13[13] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi
- 0x00, 0x00, 0x8d, 0xbc, // leal 0L(%edi,1),%edi
- 0x27, 0x00, 0x00, 0x00,
- 0x00 };
- const char nop14[14] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi
- 0x00, 0x00, 0x00, 0x8d, // leal 0L(%edi,1),%edi
- 0xbc, 0x27, 0x00, 0x00,
- 0x00, 0x00 };
- const char nop15[15] = { 0xeb, 0x0d, 0x90, 0x90, // jmp .+15
- 0x90, 0x90, 0x90, 0x90, // nop,nop,nop,...
- 0x90, 0x90, 0x90, 0x90,
- 0x90, 0x90, 0x90 };
-
- const char* nops[16] = {
- NULL,
- nop1, nop2, nop3, nop4, nop5, nop6, nop7,
- nop8, nop9, nop10, nop11, nop12, nop13, nop14, nop15
- };
-
- return std::string(nops[length], length);
-}
-
-// The selector for x86_64 object files.
-
-class Target_selector_x86_64 : public Target_selector
-{
-public:
- Target_selector_x86_64()
- : Target_selector(elfcpp::EM_X86_64, 64, false, "elf64-x86-64")
- { }
-
- Target*
- do_instantiate_target()
- { return new Target_x86_64(); }
-};
-
-Target_selector_x86_64 target_selector_x86_64;
-
-} // End anonymous namespace.
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
deleted file mode 100644
index 9faca5a0a72..00000000000
--- a/gprof/ChangeLog
+++ /dev/null
@@ -1,429 +0,0 @@
-2008-08-04 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am (POTFILES.in): Set LC_ALL=C.
- * Makefile.in: Regenerate.
-
-2008-07-30 Alan Modra <amodra@bigpond.net.au>
-
- * corefile.c, symtab.c: Silence gcc warnings.
-
-2008-06-19 Andreas Schwab <schwab@suse.de>
-
- * basic_blocks.c: Always include "gprof.h" first.
- * cg_arcs.c: Likewise.
- * cg_dfn.c: Likewise.
- * cg_print.c: Likewise.
- * corefile.c: Likewise.
- * gprof.c: Likewise.
- * hist.c: Likewise.
- * search_list.c: Likewise.
- * sym_ids.c: Likewise.
- * utils.c: Likewise.
-
-2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * configure: Regenerate.
-
-2008-06-04 Nick Clifton <nickc@redhat.com>
-
- * po/nl.po: New file: Dutch translation.
- * configure.in (ALL_LINGUAS): Add nl.
- * configure: Regenerate.
-
-2008-05-14 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.in: Regenerate.
-
-2008-04-23 Paolo Bonzini <bonzini@gnu.org>
-
- * aclocal.m4: Regenerate.
- * configure: Regenerate.
-
-2008-03-31 Nick Clifton <nickc@redhat.com>
-
- * po/fr.po: Updated French translation.
-
-2008-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * aclocal.m4: Regenerate.
- * configure: Likewise.
- * Makefile.in: Likewise.
-
-2008-03-13 Alan Modra <amodra@bigpond.net.au>
-
- * configure: Regenerate.
-
-2008-02-06 Nick Clifton <nickc@redhat.com>
-
- * po/ms.po: Updated Malasian translation.
-
-2008-02-04 H.J. Lu <hongjiu.lu@intel.com>
-
- PR 5715
- * configure: Regenerated.
-
-2007-10-24 H.J. Lu <hongjiu.lu@intel.com>
-
- * configure.in: Move AM_PROG_LIBTOOL after AC_GNU_SOURCE.
- * configure: Regenerated.
-
-2007-10-24 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am (INCLUDES): Remove -D_GNU_SOURCE.
- * configure.in: Invoke AC_GNU_SOURCE.
- * Makefile.in: Regenerate.
- * configure: Regenerate.
- * gconfig.in: Regenerate.
-
-2007-10-12 Michael Haubenwallner <haubi@gentoo.org>
-
- PR gprof/5147
- * configure.in: Add check for fabs() being in libm.
- * configure: Regenerate.
-
-2007-09-25 Robert Norton <rnorton@broadcom.com>
-
- * cg_print.c (sort_members): Include the final member on the list
- in the sort.
-
-2007-09-17 Nick Clifton <nickc@redhat.com>
-
- * po/es.po: Updated Spanish translation.
-
-2007-08-30 Nick Clifton <nickc@redhat.com>
-
- * po/fi.po: Updated Finnish translation.
-
-2007-08-24 Daniel Jacobowitz <dan@codesourcery.com>
-
- * po/sv.po: Updated Swedish translation.
-
-2007-08-17 Alan Modra <amodra@bigpond.net.au>
-
- * po/Make-in: Add --msgid-bugs-address to xgettext invocation.
-
-2007-08-12 Matthias Klose <doko@ubuntu.com>
-
- * Makefile.am (AM_MAKEINFOFLAGS, TEXI2DVI): Include
- $(top_srcdir)/../../bfd/doc.
- * Makefile.in: Regenerate.
-
-2007-08-12 Daniel Jacobowitz <dan@codesourcery.com>
-
- * configure.in (ALL_LINGUAS): Add fi.
- * po/fi.po: New file.
- * configure: Regenerated.
-
-2007-08-10 Nick Clifton <nickc@redhat.com>
-
- * po/ga.po: Updated Irish translation.
- * po/vi.po: Updated Vietnamese translation.
-
-2007-08-07 Nick Clifton <nickc@redhat.com>
-
- * po/de.po: Updated German translation.
-
-2007-07-12 Nick Clifton <nickc@redhat.com>
-
- * po/vi.po: Updated translation.
-
-2007-07-12 Kai Tietz <kai.tietz@onevision.com>
-
- * cg_print.c: Force cast of sizeof to be a long.
- * hist.c: Likewise.
-
-2007-07-06 Nick Clifton <nickc@redhat.com>
-
- * basic_blocks.c: Update copyright notice to refer to GPLv3.
- * basic_blocks.h, bbconv.pl, bb_exit_func.c, call_graph.c,
- call_graph.h, cg_print.c, cg_print.h, corefile.c, corefile.h,
- flat_bl.m, gmon_io.c, gmon_io.h, gmon_out.h, hist.c, hist.h,
- search_list.c, search_list.h, source.c, source.h, sym_ids.c,
- sym_ids.h, symtab.c, symtab.h: Likewise.
-
-2007-07-05 Tristan Gingold <gingold@adacore.com>
-
- * corefile.c (core_sym_class): Do not discard nested subprograms.
- * Makefile.am (corefile.o): Add dependency upon safe-ctype.h.
- * Makefile.in: Regenerate.
-
-2007-07-02 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am: Run "make dep-am".
- * Makefile.in: Regenerate.
- * aclocal.m4: Regenerate.
- * gconfig.in: Regenerate.
- * po/gprof.pot: Regenerate.
-
-2007-06-30 H.J. Lu <hongjiu.lu@intel.com>
-
- * aclocal.m4: Regenerated.
- * Makefile.in: Likewise.
-
-2007-06-20 Nick Clifton <nickc@redhat.com>
-
- * gprof.texi: Refer readers to the gcov tool if they want
- line-by-line profiling.
-
-2007-06-14 H.J. Lu <hongjiu.lu@intel.com>
-
- * Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config -I ../bfd.
-
- * acinclude.m4: Removed.
-
- * Makefile.in: Regenerated.
- * aclocal.m4: Likewise.
- * configure: Likewise.
-
-2007-05-24 Steve Ellcey <sje@cup.hp.com>
-
- * Makefile.in: Regnerate.
- * configure: Regenerate.
- * aclocal.m4: Regenerate.
-
-2007-05-24 H.J. Lu <hongjiu.lu@intel.com>
-
- * gprof.texi: Remove orphaned "@end ignore".
-
-2007-05-22 Nick Clifton <nickc@redhat.com>
-
- * gprof.texi: Use @copying around the copyright notice.
-
-2007-05-14 H.J. Lu <hongjiu.lu@intel.com>
-
- * hist.c (scale_and_align_entries): Avoid C99 feature.
-
-2007-04-19 Alan Modra <amodra@bigpond.net.au>
-
- * corefile.c (core_create_function_syms, core_create_line_syms): Don't
- set discard_underscores.
- * gprof.c (discard_underscores): Delete.
- * gprof.h (discard_underscores): Delete.
- * sym_ids.c (match): Use bfd_get_symbol_leading_char to check for
- leading underscores.
- * utils.c (print_name_only): Call bfd_demangle rather than
- cplus_demangle.
- * Makefile.am: Run "make dep-am".
- * Makefile.in: Regenerate.
-
-2007-04-14 Steve Ellcey <sje@cup.hp.com>
-
- * Makefile.am: Add ACLOCAL_AMFLAGS.
- * Makefile.in: Regenerate.
-
-2007-04-10 Vladimir Prus <vladimir@codesourcery.com>
-
- * hist.h (struct histogram)
- (histograms, num_histograms): New.
- * hist.c (find_histogram, find_histogram_for_pc)
- (read_histogram_header): New.
- (s_lowpc, s_highpc, lowpc, highpc, hist_num_bins)
- (hist_sample): Remove.
- (hist_read_rec): Use the above, and handle multiple
- histogram records with disjoint address ranges.
- (hist_write_hist): Support several histogram records.
- (scale_and_align_entries): Adjust for multiple histograms.
- (hist_assign_samples_1): New.
- (hist_assign_samples): Use the above.
- (hist_clip_symbol_address): New.
- * hist.h (hist_check_address)
- (hist_clip_symbol_address): Declare.
- * gmon_io.c (gmon_out_read, gmon_out_write): Adjust handling
- of legacy format for multiple histogram changes.
- * corefile.c (find_call): Check for core_text_space and
- clip symbol address range here.
- * vax.c (vax_find_call): Don't check for
- core_text_space, or clip the symbol's address range here.
- Use hist_check_address to check call's target address.
- * sparc.c: Likewise.
- * tahoe.c: Likewise.
- * i386.c: Likewise.
- * mips.c: Likewise. Also use core_text_sect->vma as the base
- address for code accesses, just like other machine-specific
- routines do.
- * gprof.texi: Adjust for the new logic.
-
-2007-03-28 Richard Sandiford <richard@codesourcery.com>
- Phil Edwards <phil@codesourcery.com>
-
- * gprof.texi: Put the contents after the title page rather
- than at the end of the document.
-
-2007-03-22 Joseph Myers <joseph@codesourcery.com>
-
- * Makefile.am (TEXI2POD): Include $(AM_MAKEINFOFLAGS).
- (AM_MAKEINFOFLAGS, TEXI2DVI): Define with -I ../bfd/doc.
- * Makefile.in: Regenerate.
- * gprof.texi: Include bfdver.texi. Report both VERSION_PACKAGE
- and VERSION.
-
-2007-03-15 H.J. Lu <hongjiu.lu@intel.com>
-
- * Makefile.am (REPORT_BUGS_TO): Removed.
- (INCLUDES): Remove -DREPORT_BUGS_TO.
- * Makefile.in: Regenerated.
-
- * configure.in (--with-bugurl): Removed.
- * configure: Regenerated.
-
-2007-03-01 Joseph Myers <joseph@codesourcery.com>
-
- * gprof.c: Include bfdver.h
- (main): Use BFD_VERSION_STRING for version number and package
- name.
- * Makefile.am (PKGVERSION): Remove.
- (INCLUDES): Update.
- Regenerate dependencies.
- * Makefile.in: Regenerate.
- * configure.in (PKGVERSION): Remove.
- * configure: Regenerate.
-
-2007-02-17 Mark Mitchell <mark@codesourcery.com>
- Nathan Sidwell <nathan@codesourcery.com>
- Vladimir Prus <vladimir@codesourcery.com>
- Joseph Myers <joseph@codesourcery.com>
-
- * configure.in (--with-pkgversion, --with-bugurl): New options.
- * configure: Regenerate.
- * Makefile.am (PKGVERSION, REPORT_BUGS_TO): Define.
- (INCLUDES): Define PKGVERSION and REPORT_BUGS_TO.
- Regenerate dependencies.
- * Makefile.in: Regenerate.
- * gprof.c (usage): Don't print empty REPORT_BUGS_TO.
- (main): Include PKGVERSION in version output.
- * gprof.h: Remove include of bin-bugs.h.
-
-2007-01-16 Ben Elliston <bje@au.ibm.com>
-
- * corefile.c (parse_error): New function.
- (read_function_mappings): Check calls to fscanf and report any
- errors in parsing the mapping file.
-
-2006-12-12 Daniel Jacobowitz <dan@codesourcery.com>
-
- * Makefile.am (gprof_TEXINFOS): Set.
- (gprof.info gprof.dvi gprof.html): Delete rule.
- * Makefile.in: Regenerated.
-
-2006-12-11 Daniel Jacobowitz <dan@codesourcery.com>
-
- * configure.in: Define GENINSRC_NEVER.
- * doc/Makefile.am (gprof.info): Remove srcdir prefix.
- (MAINTAINERCLEANFILES): Add info file.
- (DISTCLEANFILES): Pretend to add info file.
- * po/Make-in (.po.gmo): Put gmo files in objdir.
- * configure, Makefile.in: Regenerated.
-
-2006-11-27 Nick Clifton <nickc@redhat.com>
-
- * po/ms.po: Updated Malay translation.
-
-2006-11-22 Nick Clifton <nickc@redhat.com>
-
- * configure.in (LINGUAS): Add ms.
- * po/ms.po: New Malay translation.
-
-2006-10-17 Bob Wilson <bob.wilson@acm.org>
-
- * gprof.c (main): Fix option string for -r and -R.
-
-2006-10-16 Bob Wilson <bob.wilson@acm.org>
-
- * gprof.texi (Analysis Options): Argument for -n/-N is mandatory.
-
-2006-10-16 Bob Wilson <bob.wilson@acm.org>
-
- * gprof.c (main): Fix option string for -C, -n and -N.
-
-2006-09-26 Thiemo Seufer <ths@networkno.de>
-
- * gprof.texi: Fix install failure.
-
-2006-09-19 Bob Wilson <bob.wilson@acm.org>
-
- * gprof.texi: Use TeX-style quotes and em-dashes consistently.
- Specify section names in cross references. Fix typos.
- Omit "next", "previous" and "up" fields from @node lines.
- (SYNOPSIS): Show map_file argument to --file-ordering.
- (Compiling): Remove extra, truncated lines from example output.
- (Cycles): Fix references to "called" field.
- (Internals): Allow hyphenation between file:function names.
- (GNU Free Documentation License): Update formatting to match fdl.texi.
-
-2006-07-24 Ralk Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * gprof.texi: Fix some typos.
-
-2006-06-07 Joseph S. Myers <joseph@codesourcery.com>
-
- * po/Make-in (pdf, ps): New dummy targets.
-
-2006-06-05 Daniel Jacobowitz <dan@codesourcery.com>
-
- * po/Make-in (top_builddir): Define.
-
-2006-06-05 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.in: Regenerate.
- * gconfig.in: Regenerate.
-
-2006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
-
- * Makefile.am: Replace INTLLIBS and INTLDEPS with LIBINTL
- and LIBINTL_DEP everywhere.
- (INCLUDES): Use @INCINTL@.
- * acinclude.m4: Include new gettext macros.
- * configure.in: Use ZW_GNU_GETTEXT_SISTER_DIR and AM_PO_SUBDIRS.
- Remove local code for po/Makefile.
- * Makefile.in, aclocal.m4, configure: Regenerated.
-
-2006-05-30 Nick Clifton <nickc@redhat.com>
-
- * po/es.po: Updated Spanish translation.
-
-2006-05-02 James E Wilson <wilson@specifix.com>
-
- * gprof.c (main): When setting default output_style, add separate
- checks for INPUT_HISTOGRAM and INPUT_CALL_GRAPH.
-
-2006-04-25 Masaki Muranaka <monaka@monami-software.com>
-
- PR 2587
- * Makefile.am: Add empty rule for .m -> .o build in order to work
- around bug in gmake shipped by Apple.
- * Makefile.in: Regenerate.
-
-2006-04-19 Alan Modra <amodra@bigpond.net.au>
-
- * configure: Regenerate.
-
-2006-04-06 Carlos O'Donell <carlos@codesourcery.com>
-
- * po/Make-in: Add install-html target.
- * Makefile.am: Add install-html, install-html-am and
- install-html-recursive targets.
- * Makefile.in: Regenerate.
- * configure.in: AC_SUBST datarootdir, docdir, htmldir.
- * configure: Regenerate.
-
-2006-03-21 Ben Elliston <bje@au.ibm.com>
-
- * corefile.c (core_init): Report that the executable is not in the
- expected executable format rather than "a.out" format.
-
-2006-03-09 Nick Clifton <nickc@redhat.com>
-
- * po/sv.po: Updated Swedish translation.
-
-2006-02-27 Carlos O'Donell <carlos@codesourcery.com>
-
- * po/Make-in: Add html target.
-
-For older changes see ChangeLog-2005
-
-Local Variables:
-mode: change-log
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
diff --git a/gprof/Makefile.am b/gprof/Makefile.am
deleted file mode 100644
index 0b9bc278240..00000000000
--- a/gprof/Makefile.am
+++ /dev/null
@@ -1,313 +0,0 @@
-## Process this file with automake to generate Makefile.in
-
-AUTOMAKE_OPTIONS = cygnus
-ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
-
-SUFFIXES = .m
-
-SUBDIRS = po
-
-BASEDIR = $(srcdir)/..
-BFDDIR = $(BASEDIR)/bfd
-INCDIR = $(BASEDIR)/include
-
-WARN_CFLAGS = @WARN_CFLAGS@
-NO_WERROR = @NO_WERROR@
-AM_CFLAGS = $(WARN_CFLAGS)
-
-MKDEP = gcc -MM
-
-INCLUDES = -DDEBUG -I../bfd -I$(srcdir)/../include \
- -I$(srcdir)/../bfd @INCINTL@ -I. \
- -DLOCALEDIR="\"$(datadir)/locale\""
-
-bin_PROGRAMS = gprof
-
-## Convenience var listing pure sources.
-sources = basic_blocks.c call_graph.c cg_arcs.c cg_dfn.c \
- cg_print.c corefile.c gmon_io.c gprof.c hertz.c hist.c source.c \
- search_list.c symtab.c sym_ids.c utils.c \
- i386.c alpha.c vax.c tahoe.c sparc.c mips.c
-gprof_SOURCES = $(sources) flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
-gprof_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a $(LIBINTL_DEP)
-gprof_LDADD = ../bfd/libbfd.la ../libiberty/libiberty.a $(LIBINTL)
-
-noinst_HEADERS = \
- basic_blocks.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h \
- corefile.h gmon.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \
- search_list.h source.h sym_ids.h symtab.h utils.h
-
-BUILT_SOURCES = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
-EXTRA_DIST = $(BUILT_SOURCES) bbconv.pl $(man_MANS)
-
-diststuff: $(BUILT_SOURCES) info $(man_MANS)
-
-# This empty rule is a hack against gmake patched by Apple.
-%.o:%.m
-
-.m.c:
- awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
- FUNCTION=`(echo $*|sed -e 's,.*/,,g' -e 's/_bl//')`_blurb \
- FILE=$*.m $(srcdir)/$*.m
-
-POTFILES = $(sources) $(noinst_HEADERS)
-po/POTFILES.in: @MAINT@ Makefile
- for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
- && mv tmp $(srcdir)/po/POTFILES.in
-
-MANCONF = -Dman
-
-TEXI2POD = perl $(srcdir)/../etc/texi2pod.pl $(AM_MAKEINFOFLAGS)
-
-POD2MAN = pod2man --center="GNU" --release="binutils-$(VERSION)" --section=1
-
-info_TEXINFOS = gprof.texi
-gprof_TEXINFOS = config.texi
-man_MANS = gprof.1
-
-AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../bfd/doc" -I ../bfd/doc
-TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../bfd/doc" -I ../bfd/doc
-
-config.texi:
- echo "@set top_srcdir $(top_srcdir)" >> ./config.texi
-
-# Build the man page from the texinfo file
-# The sed command removes the no-adjust Nroff command so that
-# the man output looks standard.
-gprof.1: $(srcdir)/gprof.texi config.texi
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgprof < $(srcdir)/gprof.texi > gprof.pod
- -($(POD2MAN) gprof.pod | \
- sed -e '/^.if n .na/d' > $@.T$$$$ && \
- mv -f $@.T$$$$ $@) || \
- (rm -f $@.T$$$$ && exit 1)
- rm -f gprof.pod
-
-.PHONY: install-html install-html-am install-html-recursive
-
-html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-
-install-html: install-html-recursive install-html-am
-
-install-html-am: $(HTMLS)
- @$(NORMAL_INSTALL)
- test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
- @list='$(HTMLS)'; for p in $$list; do \
- if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
- f=$(html__strip_dir) \
- if test -d "$$d$$p"; then \
- echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
- $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
- echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
- else \
- echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
- fi; \
- done
-
-install-html-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-# We want install to imply install-info as per GNU standards, despite the
-# cygnus option.
-install-data-local: install-info
-
-# Targets to rebuild dependencies in this Makefile.
-# Have to get rid of DEP1 here so that "$?" later includes all sources.
-DEP: dep.sed $(gprof_SOURCES) $(noinst_HEADERS) gconfig.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: $(gprof_SOURCES)
- 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}!" \
- -e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/gprof$$,,`'!'
-
-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
-
-CLEANFILES = dep.sed DEP DEPA DEP1 DEP2
-
-MAINTAINERCLEANFILES = gprof.info
-
-# Automake 1.9 will only build info files in the objdir if they are
-# mentioned in DISTCLEANFILES. It doesn't have to be unconditional,
-# though, so we use a bogus condition.
-if GENINSRC_NEVER
-DISTCLEANFILES = gprof.info
-endif
-
-# DO NOT DELETE THIS LINE -- mkdep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-basic_blocks.o: basic_blocks.c $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h basic_blocks.h corefile.h gmon_io.h gmon_out.h \
- search_list.h source.h symtab.h sym_ids.h
-call_graph.o: call_graph.c gprof.h $(BFDDIR)/sysdep.h \
- ../bfd/config.h $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h \
- $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h gconfig.h search_list.h source.h \
- symtab.h cg_arcs.h call_graph.h corefile.h gmon_io.h \
- gmon_out.h sym_ids.h
-cg_arcs.o: cg_arcs.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h search_list.h \
- source.h symtab.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h \
- utils.h sym_ids.h
-cg_dfn.o: cg_dfn.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h search_list.h \
- source.h symtab.h cg_arcs.h cg_dfn.h utils.h
-cg_print.o: cg_print.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h search_list.h \
- source.h symtab.h cg_arcs.h cg_print.h hist.h utils.h \
- corefile.h
-corefile.o: corefile.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h search_list.h \
- source.h symtab.h hist.h corefile.h $(INCDIR)/safe-ctype.h
-gmon_io.o: gmon_io.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- basic_blocks.h corefile.h call_graph.h gmon_io.h gmon_out.h \
- gmon.h hertz.h hist.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h
-gprof.o: gprof.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h ../bfd/bfdver.h \
- search_list.h source.h symtab.h basic_blocks.h call_graph.h \
- cg_arcs.h cg_print.h corefile.h gmon_io.h hertz.h hist.h \
- sym_ids.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h
-hertz.o: hertz.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h hertz.h
-hist.o: hist.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h search_list.h \
- source.h symtab.h corefile.h gmon_io.h gmon_out.h hist.h \
- sym_ids.h utils.h
-source.o: source.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/filenames.h search_list.h source.h
-search_list.o: search_list.c $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h
-symtab.o: symtab.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h
-sym_ids.o: sym_ids.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/safe-ctype.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- sym_ids.h corefile.h
-utils.o: utils.c $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- utils.h corefile.h
-i386.o: i386.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h hist.h
-alpha.o: alpha.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h hist.h
-vax.o: vax.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h hist.h
-tahoe.o: tahoe.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h hist.h
-sparc.o: sparc.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h hist.h
-mips.o: mips.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h hist.h
-flat_bl.o: flat_bl.c $(INCDIR)/ansidecl.h
-bsd_callg_bl.o: bsd_callg_bl.c $(INCDIR)/ansidecl.h
-fsf_callg_bl.o: fsf_callg_bl.c $(INCDIR)/ansidecl.h
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/gprof/Makefile.in b/gprof/Makefile.in
deleted file mode 100644
index ad4af3912cb..00000000000
--- a/gprof/Makefile.in
+++ /dev/null
@@ -1,1064 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 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.
-
-@SET_MAKE@
-
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-bin_PROGRAMS = gprof$(EXEEXT)
-DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub README \
- ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/gconfig.in $(srcdir)/../mkinstalldirs \
- $(top_srcdir)/po/Make-in $(srcdir)/../ltmain.sh \
- $(srcdir)/../config.guess $(srcdir)/../config.sub \
- $(gprof_TEXINFOS) $(noinst_HEADERS)
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../bfd/warning.m4 \
- $(top_srcdir)/../config/depstand.m4 \
- $(top_srcdir)/../config/gettext-sister.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
- $(top_srcdir)/../config/nls.m4 \
- $(top_srcdir)/../config/override.m4 \
- $(top_srcdir)/../config/po.m4 \
- $(top_srcdir)/../config/proginstall.m4 \
- $(top_srcdir)/../config/progtest.m4 \
- $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
- $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = gconfig.h
-CONFIG_CLEAN_FILES = po/Makefile.in
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(bin_PROGRAMS)
-am__objects_1 = basic_blocks.$(OBJEXT) call_graph.$(OBJEXT) \
- cg_arcs.$(OBJEXT) cg_dfn.$(OBJEXT) cg_print.$(OBJEXT) \
- corefile.$(OBJEXT) gmon_io.$(OBJEXT) gprof.$(OBJEXT) \
- hertz.$(OBJEXT) hist.$(OBJEXT) source.$(OBJEXT) \
- search_list.$(OBJEXT) symtab.$(OBJEXT) sym_ids.$(OBJEXT) \
- utils.$(OBJEXT) i386.$(OBJEXT) alpha.$(OBJEXT) vax.$(OBJEXT) \
- tahoe.$(OBJEXT) sparc.$(OBJEXT) mips.$(OBJEXT)
-am_gprof_OBJECTS = $(am__objects_1) flat_bl.$(OBJEXT) \
- bsd_callg_bl.$(OBJEXT) fsf_callg_bl.$(OBJEXT)
-gprof_OBJECTS = $(am_gprof_OBJECTS)
-am__DEPENDENCIES_1 =
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(gprof_SOURCES)
-INFO_DEPS = gprof.info
-TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
-am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo
-DVIS = gprof.dvi
-PDFS = gprof.pdf
-PSS = gprof.ps
-HTMLS = gprof.html
-TEXINFOS = gprof.texi
-TEXI2PDF = $(TEXI2DVI) --pdf --batch
-MAKEINFOHTML = $(MAKEINFO) --html
-AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
-DVIPS = dvips
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
-man1dir = $(mandir)/man1
-NROFF = nroff
-MANS = $(man_MANS)
-HEADERS = $(noinst_HEADERS)
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATADIRNAME = @DATADIRNAME@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GENCAT = @GENCAT@
-GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@
-GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@
-GMSGFMT = @GMSGFMT@
-GREP = @GREP@
-INCINTL = @INCINTL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INSTOBJEXT = @INSTOBJEXT@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBINTL = @LIBINTL@
-LIBINTL_DEP = @LIBINTL_DEP@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-MSGMERGE = @MSGMERGE@
-NM = @NM@
-NO_WERROR = @NO_WERROR@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POSUB = @POSUB@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-WARN_CFLAGS = @WARN_CFLAGS@
-XGETTEXT = @XGETTEXT@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-AUTOMAKE_OPTIONS = cygnus
-ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
-SUFFIXES = .m
-SUBDIRS = po
-BASEDIR = $(srcdir)/..
-BFDDIR = $(BASEDIR)/bfd
-INCDIR = $(BASEDIR)/include
-AM_CFLAGS = $(WARN_CFLAGS)
-MKDEP = gcc -MM
-INCLUDES = -DDEBUG -I../bfd -I$(srcdir)/../include \
- -I$(srcdir)/../bfd @INCINTL@ -I. \
- -DLOCALEDIR="\"$(datadir)/locale\""
-
-sources = basic_blocks.c call_graph.c cg_arcs.c cg_dfn.c \
- cg_print.c corefile.c gmon_io.c gprof.c hertz.c hist.c source.c \
- search_list.c symtab.c sym_ids.c utils.c \
- i386.c alpha.c vax.c tahoe.c sparc.c mips.c
-
-gprof_SOURCES = $(sources) flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
-gprof_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a $(LIBINTL_DEP)
-gprof_LDADD = ../bfd/libbfd.la ../libiberty/libiberty.a $(LIBINTL)
-noinst_HEADERS = \
- basic_blocks.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h \
- corefile.h gmon.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \
- search_list.h source.h sym_ids.h symtab.h utils.h
-
-BUILT_SOURCES = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
-EXTRA_DIST = $(BUILT_SOURCES) bbconv.pl $(man_MANS)
-POTFILES = $(sources) $(noinst_HEADERS)
-MANCONF = -Dman
-TEXI2POD = perl $(srcdir)/../etc/texi2pod.pl $(AM_MAKEINFOFLAGS)
-POD2MAN = pod2man --center="GNU" --release="binutils-$(VERSION)" --section=1
-info_TEXINFOS = gprof.texi
-gprof_TEXINFOS = config.texi
-man_MANS = gprof.1
-AM_MAKEINFOFLAGS = -I "$(srcdir)" -I "$(top_srcdir)/../bfd/doc" -I ../bfd/doc
-TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/../bfd/doc" -I ../bfd/doc
-html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-CLEANFILES = dep.sed DEP DEPA DEP1 DEP2
-MAINTAINERCLEANFILES = gprof.info
-
-# Automake 1.9 will only build info files in the objdir if they are
-# mentioned in DISTCLEANFILES. It doesn't have to be unconditional,
-# though, so we use a bogus condition.
-@GENINSRC_NEVER_TRUE@DISTCLEANFILES = gprof.info
-all: $(BUILT_SOURCES) gconfig.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .m .c .dvi .lo .o .obj .ps
-am--refresh:
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
- cd $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-
-gconfig.h: stamp-h1
- @if test ! -f $@; then \
- rm -f stamp-h1; \
- $(MAKE) stamp-h1; \
- else :; fi
-
-stamp-h1: $(srcdir)/gconfig.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status gconfig.h
-$(srcdir)/gconfig.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_srcdir) && $(AUTOHEADER)
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f gconfig.h stamp-h1
-po/Makefile.in: $(top_builddir)/config.status $(top_srcdir)/po/Make-in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
- rm -f "$(DESTDIR)$(bindir)/$$f"; \
- done
-
-clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-gprof$(EXEEXT): $(gprof_OBJECTS) $(gprof_DEPENDENCIES)
- @rm -f gprof$(EXEEXT)
- $(LINK) $(gprof_LDFLAGS) $(gprof_OBJECTS) $(gprof_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c $<
-
-.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- $(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-
-gprof.info: gprof.texi $(gprof_TEXINFOS)
- restore=: && backupdir="$(am__leading_dot)am$$$$" && \
- rm -rf $$backupdir && mkdir $$backupdir && \
- if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
- for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
- if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
- done; \
- else :; fi && \
- if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
- -o $@ `test -f 'gprof.texi' || echo '$(srcdir)/'`gprof.texi; \
- then \
- rc=0; \
- else \
- rc=$$?; \
- $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
- fi; \
- rm -rf $$backupdir; exit $$rc
-
-gprof.dvi: gprof.texi $(gprof_TEXINFOS)
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2DVI) -o $@ `test -f 'gprof.texi' || echo '$(srcdir)/'`gprof.texi
-
-gprof.pdf: gprof.texi $(gprof_TEXINFOS)
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2PDF) -o $@ `test -f 'gprof.texi' || echo '$(srcdir)/'`gprof.texi
-
-gprof.html: gprof.texi $(gprof_TEXINFOS)
- rm -rf $(@:.html=.htp)
- if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
- -o $(@:.html=.htp) `test -f 'gprof.texi' || echo '$(srcdir)/'`gprof.texi; \
- then \
- rm -rf $@; \
- if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
- mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
- else \
- if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
- rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
- exit 1; \
- fi
-.dvi.ps:
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- $(DVIPS) -o $@ $<
-
-uninstall-info-am:
- @$(PRE_UNINSTALL)
- @if (install-info --version && \
- install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
- list='$(INFO_DEPS)'; \
- for file in $$list; do \
- relfile=`echo "$$file" | sed 's|^.*/||'`; \
- echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
- install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
- done; \
- else :; fi
- @$(NORMAL_UNINSTALL)
- @list='$(INFO_DEPS)'; \
- for file in $$list; do \
- relfile=`echo "$$file" | sed 's|^.*/||'`; \
- relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
- (if cd "$(DESTDIR)$(infodir)"; then \
- echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
- rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
- else :; fi); \
- done
-
-dist-info: $(INFO_DEPS)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- list='$(INFO_DEPS)'; \
- for base in $$list; do \
- case $$base in \
- $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
- esac; \
- if test -f $$base; then d=.; else d=$(srcdir); fi; \
- for file in $$d/$$base*; do \
- relfile=`expr "$$file" : "$$d/\(.*\)"`; \
- test -f $(distdir)/$$relfile || \
- cp -p $$file $(distdir)/$$relfile; \
- done; \
- done
-
-mostlyclean-aminfo:
- -rm -rf gprof.aux gprof.cp gprof.cps gprof.fn gprof.fns gprof.ky gprof.kys \
- gprof.log gprof.pg gprof.pgs gprof.tmp gprof.toc gprof.tp \
- gprof.tps gprof.vr gprof.vrs gprof.dvi gprof.pdf gprof.ps \
- gprof.html
-
-maintainer-clean-aminfo:
- @list='$(INFO_DEPS)'; for i in $$list; do \
- i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
- echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
- rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
- done
-
-clean-info: mostlyclean-aminfo
-install-man1: $(man1_MANS) $(man_MANS)
- @$(NORMAL_INSTALL)
- test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
- @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_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/^.*\\.//'`; \
- case "$$ext" in \
- 1*) ;; \
- *) ext='1' ;; \
- esac; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
- done
-uninstall-man1:
- @$(NORMAL_UNINSTALL)
- @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_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/^.*\\.//'`; \
- case "$$ext" in \
- 1*) ;; \
- *) ext='1' ;; \
- esac; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
- rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
- done
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) gconfig.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) gconfig.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) gconfig.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) gconfig.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-am:
-check: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) check-recursive
-all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS) gconfig.h
-installdirs: installdirs-recursive
-installdirs-am:
- for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-install: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-recursive
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-hdr distclean-libtool distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am: $(DVIS)
-
-html: html-recursive
-
-html-am: $(HTMLS)
-
-info: info-recursive
-
-info-am: $(INFO_DEPS)
-
-install-data-am: install-data-local install-man
-
-install-exec-am: install-binPROGRAMS
-
-install-info: install-info-recursive
-
-install-info-am: $(INFO_DEPS)
- @$(NORMAL_INSTALL)
- test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)"
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- list='$(INFO_DEPS)'; \
- for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- esac; \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
- file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
- for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
- $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
- if test -f $$ifile; then \
- relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
- echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
- $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
- else : ; fi; \
- done; \
- done
- @$(POST_INSTALL)
- @if (install-info --version && \
- install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
- list='$(INFO_DEPS)'; \
- for file in $$list; do \
- relfile=`echo "$$file" | sed 's|^.*/||'`; \
- echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
- install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
- done; \
- else : ; fi
-install-man: install-man1
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-aminfo \
- maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am: $(PDFS)
-
-ps: ps-recursive
-
-ps-am: $(PSS)
-
-uninstall-am: uninstall-binPROGRAMS uninstall-man
-
-uninstall-info: uninstall-info-recursive
-
-uninstall-man: uninstall-man1
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
- check-am clean clean-binPROGRAMS clean-generic clean-info \
- clean-libtool clean-recursive ctags ctags-recursive dist-info \
- distclean distclean-compile distclean-generic distclean-hdr \
- distclean-libtool distclean-recursive distclean-tags dvi \
- dvi-am html html-am info info-am install install-am \
- install-binPROGRAMS install-data install-data-am \
- install-data-local install-exec install-exec-am install-info \
- install-info-am install-man install-man1 install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-aminfo \
- maintainer-clean-generic maintainer-clean-recursive \
- mostlyclean mostlyclean-aminfo mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
- pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
- uninstall-binPROGRAMS uninstall-info-am uninstall-man \
- uninstall-man1
-
-
-diststuff: $(BUILT_SOURCES) info $(man_MANS)
-
-# This empty rule is a hack against gmake patched by Apple.
-%.o:%.m
-
-.m.c:
- awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
- FUNCTION=`(echo $*|sed -e 's,.*/,,g' -e 's/_bl//')`_blurb \
- FILE=$*.m $(srcdir)/$*.m
-po/POTFILES.in: @MAINT@ Makefile
- for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
- && mv tmp $(srcdir)/po/POTFILES.in
-
-config.texi:
- echo "@set top_srcdir $(top_srcdir)" >> ./config.texi
-
-# Build the man page from the texinfo file
-# The sed command removes the no-adjust Nroff command so that
-# the man output looks standard.
-gprof.1: $(srcdir)/gprof.texi config.texi
- touch $@
- -$(TEXI2POD) $(MANCONF) -Dgprof < $(srcdir)/gprof.texi > gprof.pod
- -($(POD2MAN) gprof.pod | \
- sed -e '/^.if n .na/d' > $@.T$$$$ && \
- mv -f $@.T$$$$ $@) || \
- (rm -f $@.T$$$$ && exit 1)
- rm -f gprof.pod
-
-.PHONY: install-html install-html-am install-html-recursive
-
-install-html: install-html-recursive install-html-am
-
-install-html-am: $(HTMLS)
- @$(NORMAL_INSTALL)
- test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
- @list='$(HTMLS)'; for p in $$list; do \
- if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
- f=$(html__strip_dir) \
- if test -d "$$d$$p"; then \
- echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
- $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
- echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
- else \
- echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
- fi; \
- done
-
-install-html-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-# We want install to imply install-info as per GNU standards, despite the
-# cygnus option.
-install-data-local: install-info
-
-# Targets to rebuild dependencies in this Makefile.
-# Have to get rid of DEP1 here so that "$?" later includes all sources.
-DEP: dep.sed $(gprof_SOURCES) $(noinst_HEADERS) gconfig.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: $(gprof_SOURCES)
- 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}!" \
- -e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/gprof$$,,`'!'
-
-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
-
-# DO NOT DELETE THIS LINE -- mkdep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-basic_blocks.o: basic_blocks.c $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h basic_blocks.h corefile.h gmon_io.h gmon_out.h \
- search_list.h source.h symtab.h sym_ids.h
-call_graph.o: call_graph.c gprof.h $(BFDDIR)/sysdep.h \
- ../bfd/config.h $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h \
- $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/symcat.h gconfig.h search_list.h source.h \
- symtab.h cg_arcs.h call_graph.h corefile.h gmon_io.h \
- gmon_out.h sym_ids.h
-cg_arcs.o: cg_arcs.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h search_list.h \
- source.h symtab.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h \
- utils.h sym_ids.h
-cg_dfn.o: cg_dfn.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h search_list.h \
- source.h symtab.h cg_arcs.h cg_dfn.h utils.h
-cg_print.o: cg_print.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h search_list.h \
- source.h symtab.h cg_arcs.h cg_print.h hist.h utils.h \
- corefile.h
-corefile.o: corefile.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h search_list.h \
- source.h symtab.h hist.h corefile.h $(INCDIR)/safe-ctype.h
-gmon_io.o: gmon_io.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- basic_blocks.h corefile.h call_graph.h gmon_io.h gmon_out.h \
- gmon.h hertz.h hist.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h
-gprof.o: gprof.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h ../bfd/bfdver.h \
- search_list.h source.h symtab.h basic_blocks.h call_graph.h \
- cg_arcs.h cg_print.h corefile.h gmon_io.h hertz.h hist.h \
- sym_ids.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h
-hertz.o: hertz.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h hertz.h
-hist.o: hist.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h search_list.h \
- source.h symtab.h corefile.h gmon_io.h gmon_out.h hist.h \
- sym_ids.h utils.h
-source.o: source.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/filenames.h search_list.h source.h
-search_list.o: search_list.c $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h
-symtab.o: symtab.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h
-sym_ids.o: sym_ids.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/safe-ctype.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- sym_ids.h corefile.h
-utils.o: utils.c $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- utils.h corefile.h
-i386.o: i386.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h hist.h
-alpha.o: alpha.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h hist.h
-vax.o: vax.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h hist.h
-tahoe.o: tahoe.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h hist.h
-sparc.o: sparc.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h hist.h
-mips.o: mips.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
- $(INCDIR)/ansidecl.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- corefile.h hist.h
-flat_bl.o: flat_bl.c $(INCDIR)/ansidecl.h
-bsd_callg_bl.o: bsd_callg_bl.c $(INCDIR)/ansidecl.h
-fsf_callg_bl.o: fsf_callg_bl.c $(INCDIR)/ansidecl.h
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
-# 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:
diff --git a/gprof/corefile.c b/gprof/corefile.c
deleted file mode 100644
index 243a600f7e2..00000000000
--- a/gprof/corefile.c
+++ /dev/null
@@ -1,790 +0,0 @@
-/* corefile.c
-
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
- Free Software Foundation, Inc.
-
- This file is part of GNU Binutils.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-#include "gprof.h"
-#include "libiberty.h"
-#include "search_list.h"
-#include "source.h"
-#include "symtab.h"
-#include "hist.h"
-#include "corefile.h"
-#include "safe-ctype.h"
-
-bfd *core_bfd;
-static int core_num_syms;
-static asymbol **core_syms;
-asection *core_text_sect;
-PTR core_text_space;
-
-static int min_insn_size;
-int offset_to_code;
-
-/* For mapping symbols to specific .o files during file ordering. */
-struct function_map *symbol_map;
-unsigned int symbol_map_count;
-
-static void read_function_mappings (const char *);
-static int core_sym_class (asymbol *);
-static bfd_boolean get_src_info
- (bfd_vma, const char **, const char **, int *);
-
-extern void i386_find_call (Sym *, bfd_vma, bfd_vma);
-extern void alpha_find_call (Sym *, bfd_vma, bfd_vma);
-extern void vax_find_call (Sym *, bfd_vma, bfd_vma);
-extern void tahoe_find_call (Sym *, bfd_vma, bfd_vma);
-extern void sparc_find_call (Sym *, bfd_vma, bfd_vma);
-extern void mips_find_call (Sym *, bfd_vma, bfd_vma);
-
-static void
-parse_error (const char *filename)
-{
- fprintf (stderr, _("%s: unable to parse mapping file %s.\n"), whoami, filename);
- done (1);
-}
-
-static void
-read_function_mappings (const char *filename)
-{
- FILE *file = fopen (filename, "r");
- char dummy[1024];
- int count = 0;
-
- if (!file)
- {
- fprintf (stderr, _("%s: could not open %s.\n"), whoami, filename);
- done (1);
- }
-
- /* First parse the mapping file so we know how big we need to
- make our tables. We also do some sanity checks at this
- time. */
- while (!feof (file))
- {
- int matches;
-
- matches = fscanf (file, "%[^\n:]", dummy);
- if (!matches)
- parse_error (filename);
-
- /* Just skip messages about files with no symbols. */
- if (!strncmp (dummy, "No symbols in ", 14))
- {
- matches = fscanf (file, "\n");
- if (matches == EOF)
- parse_error (filename);
- continue;
- }
-
- /* Don't care what else is on this line at this point. */
- matches = fscanf (file, "%[^\n]\n", dummy);
- if (!matches)
- parse_error (filename);
- count++;
- }
-
- /* Now we know how big we need to make our table. */
- symbol_map = ((struct function_map *)
- xmalloc (count * sizeof (struct function_map)));
-
- /* Rewind the input file so we can read it again. */
- rewind (file);
-
- /* Read each entry and put it into the table. */
- count = 0;
- while (!feof (file))
- {
- int matches;
- char *tmp;
-
- matches = fscanf (file, "%[^\n:]", dummy);
- if (!matches)
- parse_error (filename);
-
- /* Just skip messages about files with no symbols. */
- if (!strncmp (dummy, "No symbols in ", 14))
- {
- matches = fscanf (file, "\n");
- if (matches == EOF)
- parse_error (filename);
- continue;
- }
-
- /* dummy has the filename, go ahead and copy it. */
- symbol_map[count].file_name = xmalloc (strlen (dummy) + 1);
- strcpy (symbol_map[count].file_name, dummy);
-
- /* Now we need the function name. */
- matches = fscanf (file, "%[^\n]\n", dummy);
- if (!matches)
- parse_error (filename);
- tmp = strrchr (dummy, ' ') + 1;
- symbol_map[count].function_name = xmalloc (strlen (tmp) + 1);
- strcpy (symbol_map[count].function_name, tmp);
- count++;
- }
-
- /* Record the size of the map table for future reference. */
- symbol_map_count = count;
-}
-
-
-void
-core_init (const char *aout_name)
-{
- int core_sym_bytes;
- asymbol *synthsyms;
- long synth_count;
-
- core_bfd = bfd_openr (aout_name, 0);
-
- if (!core_bfd)
- {
- perror (aout_name);
- done (1);
- }
-
- if (!bfd_check_format (core_bfd, bfd_object))
- {
- fprintf (stderr, _("%s: %s: not in executable format\n"), whoami, aout_name);
- done (1);
- }
-
- /* Get core's text section. */
- core_text_sect = bfd_get_section_by_name (core_bfd, ".text");
- if (!core_text_sect)
- {
- core_text_sect = bfd_get_section_by_name (core_bfd, "$CODE$");
- if (!core_text_sect)
- {
- fprintf (stderr, _("%s: can't find .text section in %s\n"),
- whoami, aout_name);
- done (1);
- }
- }
-
- /* Read core's symbol table. */
-
- /* This will probably give us more than we need, but that's ok. */
- core_sym_bytes = bfd_get_symtab_upper_bound (core_bfd);
- if (core_sym_bytes < 0)
- {
- fprintf (stderr, "%s: %s: %s\n", whoami, aout_name,
- bfd_errmsg (bfd_get_error ()));
- done (1);
- }
-
- core_syms = (asymbol **) xmalloc (core_sym_bytes);
- core_num_syms = bfd_canonicalize_symtab (core_bfd, core_syms);
-
- if (core_num_syms < 0)
- {
- fprintf (stderr, "%s: %s: %s\n", whoami, aout_name,
- bfd_errmsg (bfd_get_error ()));
- done (1);
- }
-
- synth_count = bfd_get_synthetic_symtab (core_bfd, core_num_syms, core_syms,
- 0, NULL, &synthsyms);
- if (synth_count > 0)
- {
- asymbol **symp;
- long new_size;
- long i;
-
- new_size = (core_num_syms + synth_count + 1) * sizeof (*core_syms);
- core_syms = xrealloc (core_syms, new_size);
- symp = core_syms + core_num_syms;
- core_num_syms += synth_count;
- for (i = 0; i < synth_count; i++)
- *symp++ = synthsyms + i;
- *symp = 0;
- }
-
- min_insn_size = 1;
- offset_to_code = 0;
-
- switch (bfd_get_arch (core_bfd))
- {
- case bfd_arch_vax:
- case bfd_arch_tahoe:
- offset_to_code = 2;
- break;
-
- case bfd_arch_alpha:
- min_insn_size = 4;
- break;
-
- default:
- break;
- }
-
- if (function_mapping_file)
- read_function_mappings (function_mapping_file);
-}
-
-/* Read in the text space of an a.out file. */
-
-void
-core_get_text_space (bfd *cbfd)
-{
- core_text_space = malloc (bfd_get_section_size (core_text_sect));
-
- if (!core_text_space)
- {
- fprintf (stderr, _("%s: ran out room for %lu bytes of text space\n"),
- whoami, (unsigned long) bfd_get_section_size (core_text_sect));
- done (1);
- }
-
- if (!bfd_get_section_contents (cbfd, core_text_sect, core_text_space,
- 0, bfd_get_section_size (core_text_sect)))
- {
- bfd_perror ("bfd_get_section_contents");
- free (core_text_space);
- core_text_space = 0;
- }
-
- if (!core_text_space)
- fprintf (stderr, _("%s: can't do -c\n"), whoami);
-}
-
-
-void
-find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
-{
- if (core_text_space == 0)
- return;
-
- hist_clip_symbol_address (&p_lowpc, &p_highpc);
-
- switch (bfd_get_arch (core_bfd))
- {
- case bfd_arch_i386:
- i386_find_call (parent, p_lowpc, p_highpc);
- break;
-
- case bfd_arch_alpha:
- alpha_find_call (parent, p_lowpc, p_highpc);
- break;
-
- case bfd_arch_vax:
- vax_find_call (parent, p_lowpc, p_highpc);
- break;
-
- case bfd_arch_sparc:
- sparc_find_call (parent, p_lowpc, p_highpc);
- break;
-
- case bfd_arch_tahoe:
- tahoe_find_call (parent, p_lowpc, p_highpc);
- break;
-
- case bfd_arch_mips:
- mips_find_call (parent, p_lowpc, p_highpc);
- break;
-
- default:
- fprintf (stderr, _("%s: -c not supported on architecture %s\n"),
- whoami, bfd_printable_name(core_bfd));
-
- /* Don't give the error more than once. */
- ignore_direct_calls = FALSE;
- }
-}
-
-/* Return class of symbol SYM. The returned class can be any of:
- 0 -> symbol is not interesting to us
- 'T' -> symbol is a global name
- 't' -> symbol is a local (static) name. */
-
-static int
-core_sym_class (asymbol *sym)
-{
- symbol_info syminfo;
- const char *name;
- char sym_prefix;
- int i;
-
- if (sym->section == NULL || (sym->flags & BSF_DEBUGGING) != 0)
- return 0;
-
- /* Must be a text symbol, and static text symbols
- don't qualify if ignore_static_funcs set. */
- if (ignore_static_funcs && (sym->flags & BSF_LOCAL))
- {
- DBG (AOUTDEBUG, printf ("[core_sym_class] %s: not a function\n",
- sym->name));
- return 0;
- }
-
- bfd_get_symbol_info (core_bfd, sym, &syminfo);
- i = syminfo.type;
-
- if (i == 'T')
- return i; /* It's a global symbol. */
-
- if (i == 'W')
- /* Treat weak symbols as text symbols. FIXME: a weak symbol may
- also be a data symbol. */
- return 'T';
-
- if (i != 't')
- {
- /* Not a static text symbol. */
- DBG (AOUTDEBUG, printf ("[core_sym_class] %s is of class %c\n",
- sym->name, i));
- return 0;
- }
-
- /* Do some more filtering on static function-names. */
- if (ignore_static_funcs)
- return 0;
-
- /* Can't zero-length name or funny characters in name, where
- `funny' includes: `.' (.o file names) and `$' (Pascal labels). */
- if (!sym->name || sym->name[0] == '\0')
- return 0;
-
- for (name = sym->name; *name; ++name)
- {
- if (*name == '$')
- return 0;
-
- /* Do not discard nested subprograms (those
- which end with .NNN, where N are digits). */
- if (*name == '.')
- for (name++; *name; name++)
- if (! ISDIGIT (*name))
- return 0;
- }
-
- /* On systems where the C compiler adds an underscore to all
- names, static names without underscores seem usually to be
- labels in hand written assembler in the library. We don't want
- these names. This is certainly necessary on a Sparc running
- SunOS 4.1 (try profiling a program that does a lot of
- division). I don't know whether it has harmful side effects on
- other systems. Perhaps it should be made configurable. */
- sym_prefix = bfd_get_symbol_leading_char (core_bfd);
-
- if ((sym_prefix && sym_prefix != sym->name[0])
- /* GCC may add special symbols to help gdb figure out the file
- language. We want to ignore these, since sometimes they mask
- the real function. (dj@ctron) */
- || !strncmp (sym->name, "__gnu_compiled", 14)
- || !strncmp (sym->name, "___gnu_compiled", 15))
- {
- return 0;
- }
-
- /* If the object file supports marking of function symbols, then
- we can zap anything that doesn't have BSF_FUNCTION set. */
- if (ignore_non_functions && (sym->flags & BSF_FUNCTION) == 0)
- return 0;
-
- return 't'; /* It's a static text symbol. */
-}
-
-/* Get whatever source info we can get regarding address ADDR. */
-
-static bfd_boolean
-get_src_info (bfd_vma addr, const char **filename, const char **name, int *line_num)
-{
- const char *fname = 0, *func_name = 0;
- int l = 0;
-
- if (bfd_find_nearest_line (core_bfd, core_text_sect, core_syms,
- addr - core_text_sect->vma,
- &fname, &func_name, (unsigned int *) &l)
- && fname && func_name && l)
- {
- DBG (AOUTDEBUG, printf ("[get_src_info] 0x%lx -> %s:%d (%s)\n",
- (unsigned long) addr, fname, l, func_name));
- *filename = fname;
- *name = func_name;
- *line_num = l;
- return TRUE;
- }
- else
- {
- DBG (AOUTDEBUG, printf ("[get_src_info] no info for 0x%lx (%s:%d,%s)\n",
- (unsigned long) addr,
- fname ? fname : "<unknown>", l,
- func_name ? func_name : "<unknown>"));
- return FALSE;
- }
-}
-
-/* Read in symbol table from core.
- One symbol per function is entered. */
-
-void
-core_create_function_syms ()
-{
- bfd_vma min_vma = ~(bfd_vma) 0;
- bfd_vma max_vma = 0;
- int class;
- long i, found, skip;
- unsigned int j;
-
- /* Pass 1 - determine upper bound on number of function names. */
- symtab.len = 0;
-
- for (i = 0; i < core_num_syms; ++i)
- {
- if (!core_sym_class (core_syms[i]))
- continue;
-
- /* This should be replaced with a binary search or hashed
- search. Gross.
-
- Don't create a symtab entry for a function that has
- a mapping to a file, unless it's the first function
- in the file. */
- skip = 0;
- for (j = 0; j < symbol_map_count; j++)
- if (!strcmp (core_syms[i]->name, symbol_map[j].function_name))
- {
- if (j > 0 && ! strcmp (symbol_map [j].file_name,
- symbol_map [j - 1].file_name))
- skip = 1;
- break;
- }
-
- if (!skip)
- ++symtab.len;
- }
-
- if (symtab.len == 0)
- {
- fprintf (stderr, _("%s: file `%s' has no symbols\n"), whoami, a_out_name);
- done (1);
- }
-
- /* The "+ 2" is for the sentinels. */
- symtab.base = (Sym *) xmalloc ((symtab.len + 2) * sizeof (Sym));
-
- /* Pass 2 - create symbols. */
- symtab.limit = symtab.base;
-
- for (i = 0; i < core_num_syms; ++i)
- {
- asection *sym_sec;
-
- class = core_sym_class (core_syms[i]);
-
- if (!class)
- {
- DBG (AOUTDEBUG,
- printf ("[core_create_function_syms] rejecting: 0x%lx %s\n",
- (unsigned long) core_syms[i]->value,
- core_syms[i]->name));
- continue;
- }
-
- /* This should be replaced with a binary search or hashed
- search. Gross. */
- skip = 0;
- found = 0;
-
- for (j = 0; j < symbol_map_count; j++)
- if (!strcmp (core_syms[i]->name, symbol_map[j].function_name))
- {
- if (j > 0 && ! strcmp (symbol_map [j].file_name,
- symbol_map [j - 1].file_name))
- skip = 1;
- else
- found = j;
- break;
- }
-
- if (skip)
- continue;
-
- sym_init (symtab.limit);
-
- /* Symbol offsets are always section-relative. */
- sym_sec = core_syms[i]->section;
- symtab.limit->addr = core_syms[i]->value;
- if (sym_sec)
- symtab.limit->addr += bfd_get_section_vma (sym_sec->owner, sym_sec);
-
- if (symbol_map_count
- && !strcmp (core_syms[i]->name, symbol_map[found].function_name))
- {
- symtab.limit->name = symbol_map[found].file_name;
- symtab.limit->mapped = 1;
- }
- else
- {
- symtab.limit->name = core_syms[i]->name;
- symtab.limit->mapped = 0;
- }
-
- /* Lookup filename and line number, if we can. */
- {
- const char *filename, *func_name;
-
- if (get_src_info (symtab.limit->addr, &filename, &func_name,
- &symtab.limit->line_num))
- {
- symtab.limit->file = source_file_lookup_path (filename);
-
- /* FIXME: Checking __osf__ here does not work with a cross
- gprof. */
-#ifdef __osf__
- /* Suppress symbols that are not function names. This is
- useful to suppress code-labels and aliases.
-
- This is known to be useful under DEC's OSF/1. Under SunOS 4.x,
- labels do not appear in the symbol table info, so this isn't
- necessary. */
-
- if (strcmp (symtab.limit->name, func_name) != 0)
- {
- /* The symbol's address maps to a different name, so
- it can't be a function-entry point. This happens
- for labels, for example. */
- DBG (AOUTDEBUG,
- printf ("[core_create_function_syms: rej %s (maps to %s)\n",
- symtab.limit->name, func_name));
- continue;
- }
-#endif
- }
- }
-
- symtab.limit->is_func = TRUE;
- symtab.limit->is_bb_head = TRUE;
-
- if (class == 't')
- symtab.limit->is_static = TRUE;
-
- /* Keep track of the minimum and maximum vma addresses used by all
- symbols. When computing the max_vma, use the ending address of the
- section containing the symbol, if available. */
- min_vma = MIN (symtab.limit->addr, min_vma);
- if (sym_sec)
- max_vma = MAX (bfd_get_section_vma (sym_sec->owner, sym_sec)
- + bfd_section_size (sym_sec->owner, sym_sec) - 1,
- max_vma);
- else
- max_vma = MAX (symtab.limit->addr, max_vma);
-
- DBG (AOUTDEBUG, printf ("[core_create_function_syms] %ld %s 0x%lx\n",
- (long) (symtab.limit - symtab.base),
- symtab.limit->name,
- (unsigned long) symtab.limit->addr));
- ++symtab.limit;
- }
-
- /* Create sentinels. */
- sym_init (symtab.limit);
- symtab.limit->name = "<locore>";
- symtab.limit->addr = 0;
- symtab.limit->end_addr = min_vma - 1;
- ++symtab.limit;
-
- sym_init (symtab.limit);
- symtab.limit->name = "<hicore>";
- symtab.limit->addr = max_vma + 1;
- symtab.limit->end_addr = ~(bfd_vma) 0;
- ++symtab.limit;
-
- symtab.len = symtab.limit - symtab.base;
- symtab_finalize (&symtab);
-}
-
-/* Read in symbol table from core.
- One symbol per line of source code is entered. */
-
-void
-core_create_line_syms ()
-{
- char *prev_name, *prev_filename;
- unsigned int prev_name_len, prev_filename_len;
- bfd_vma vma, min_vma = ~(bfd_vma) 0, max_vma = 0;
- Sym *prev, dummy, *sentinel, *sym;
- const char *filename;
- int prev_line_num;
- Sym_Table ltab;
- bfd_vma vma_high;
-
- /* Create symbols for functions as usual. This is necessary in
- cases where parts of a program were not compiled with -g. For
- those parts we still want to get info at the function level. */
- core_create_function_syms ();
-
- /* Pass 1: count the number of symbols. */
-
- /* To find all line information, walk through all possible
- text-space addresses (one by one!) and get the debugging
- info for each address. When the debugging info changes,
- it is time to create a new symbol.
-
- Of course, this is rather slow and it would be better if
- BFD would provide an iterator for enumerating all line infos. */
- prev_name_len = PATH_MAX;
- prev_filename_len = PATH_MAX;
- prev_name = xmalloc (prev_name_len);
- prev_filename = xmalloc (prev_filename_len);
- ltab.len = 0;
- prev_line_num = 0;
-
- vma_high = core_text_sect->vma + bfd_get_section_size (core_text_sect);
- for (vma = core_text_sect->vma; vma < vma_high; vma += min_insn_size)
- {
- unsigned int len;
-
- if (!get_src_info (vma, &filename, &dummy.name, &dummy.line_num)
- || (prev_line_num == dummy.line_num
- && prev_name != NULL
- && strcmp (prev_name, dummy.name) == 0
- && strcmp (prev_filename, filename) == 0))
- continue;
-
- ++ltab.len;
- prev_line_num = dummy.line_num;
-
- len = strlen (dummy.name);
- if (len >= prev_name_len)
- {
- prev_name_len = len + 1024;
- free (prev_name);
- prev_name = xmalloc (prev_name_len);
- }
-
- strcpy (prev_name, dummy.name);
- len = strlen (filename);
-
- if (len >= prev_filename_len)
- {
- prev_filename_len = len + 1024;
- free (prev_filename);
- prev_filename = xmalloc (prev_filename_len);
- }
-
- strcpy (prev_filename, filename);
-
- min_vma = MIN (vma, min_vma);
- max_vma = MAX (vma, max_vma);
- }
-
- free (prev_name);
- free (prev_filename);
-
- /* Make room for function symbols, too. */
- ltab.len += symtab.len;
- ltab.base = (Sym *) xmalloc (ltab.len * sizeof (Sym));
- ltab.limit = ltab.base;
-
- /* Pass 2 - create symbols. */
-
- /* We now set is_static as we go along, rather than by running
- through the symbol table at the end.
-
- The old way called symtab_finalize before the is_static pass,
- causing a problem since symtab_finalize uses is_static as part of
- its address conflict resolution algorithm. Since global symbols
- were prefered over static symbols, and all line symbols were
- global at that point, static function names that conflicted with
- their own line numbers (static, but labeled as global) were
- rejected in favor of the line num.
-
- This was not the desired functionality. We always want to keep
- our function symbols and discard any conflicting line symbols.
- Perhaps symtab_finalize should be modified to make this
- distinction as well, but the current fix works and the code is a
- lot cleaner now. */
- prev = 0;
-
- for (vma = core_text_sect->vma; vma < vma_high; vma += min_insn_size)
- {
- sym_init (ltab.limit);
-
- if (!get_src_info (vma, &filename, &ltab.limit->name, &ltab.limit->line_num)
- || (prev && prev->line_num == ltab.limit->line_num
- && strcmp (prev->name, ltab.limit->name) == 0
- && strcmp (prev->file->name, filename) == 0))
- continue;
-
- /* Make name pointer a malloc'ed string. */
- ltab.limit->name = xstrdup (ltab.limit->name);
- ltab.limit->file = source_file_lookup_path (filename);
-
- ltab.limit->addr = vma;
-
- /* Set is_static based on the enclosing function, using either:
- 1) the previous symbol, if it's from the same function, or
- 2) a symtab lookup. */
- if (prev && ltab.limit->file == prev->file &&
- strcmp (ltab.limit->name, prev->name) == 0)
- {
- ltab.limit->is_static = prev->is_static;
- }
- else
- {
- sym = sym_lookup(&symtab, ltab.limit->addr);
- ltab.limit->is_static = sym->is_static;
- }
-
- prev = ltab.limit;
-
- DBG (AOUTDEBUG, printf ("[core_create_line_syms] %lu %s 0x%lx\n",
- (unsigned long) (ltab.limit - ltab.base),
- ltab.limit->name,
- (unsigned long) ltab.limit->addr));
- ++ltab.limit;
- }
-
- /* Update sentinels. */
- sentinel = sym_lookup (&symtab, (bfd_vma) 0);
-
- if (sentinel
- && strcmp (sentinel->name, "<locore>") == 0
- && min_vma <= sentinel->end_addr)
- sentinel->end_addr = min_vma - 1;
-
- sentinel = sym_lookup (&symtab, ~(bfd_vma) 0);
-
- if (sentinel
- && strcmp (sentinel->name, "<hicore>") == 0
- && max_vma >= sentinel->addr)
- sentinel->addr = max_vma + 1;
-
- /* Copy in function symbols. */
- memcpy (ltab.limit, symtab.base, symtab.len * sizeof (Sym));
- ltab.limit += symtab.len;
-
- if ((unsigned int) (ltab.limit - ltab.base) != ltab.len)
- {
- fprintf (stderr,
- _("%s: somebody miscounted: ltab.len=%d instead of %ld\n"),
- whoami, ltab.len, (long) (ltab.limit - ltab.base));
- done (1);
- }
-
- /* Finalize ltab and make it symbol table. */
- symtab_finalize (&ltab);
- free (symtab.base);
- symtab = ltab;
-}
diff --git a/gprof/symtab.c b/gprof/symtab.c
deleted file mode 100644
index 3436f1b4c8f..00000000000
--- a/gprof/symtab.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/* symtab.c
-
- Copyright 1999, 2000, 2001, 2002, 2004, 2007, 2008
- Free Software Foundation, Inc.
-
- This file is part of GNU Binutils.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-#include "gprof.h"
-#include "search_list.h"
-#include "source.h"
-#include "symtab.h"
-#include "cg_arcs.h"
-#include "corefile.h"
-
-static int cmp_addr (const PTR, const PTR);
-
-Sym_Table symtab;
-
-
-/* Initialize a symbol (so it's empty). */
-
-void
-sym_init (Sym *sym)
-{
- memset (sym, 0, sizeof (*sym));
-
- /* It is not safe to assume that a binary zero corresponds
- to a floating-point 0.0, so initialize floats explicitly. */
- sym->hist.time = 0.0;
- sym->cg.child_time = 0.0;
- sym->cg.prop.fract = 0.0;
- sym->cg.prop.self = 0.0;
- sym->cg.prop.child = 0.0;
-}
-
-
-/* Compare the function entry-point of two symbols and return <0, =0,
- or >0 depending on whether the left value is smaller than, equal
- to, or greater than the right value. If two symbols are equal
- but one has is_func set and the other doesn't, we make the
- non-function symbol one "bigger" so that the function symbol will
- survive duplicate removal. Finally, if both symbols have the
- same is_func value, we discriminate against is_static such that
- the global symbol survives. */
-
-static int
-cmp_addr (const PTR lp, const PTR rp)
-{
- const Sym *left = (const Sym *) lp;
- const Sym *right = (const Sym *) rp;
-
- if (left->addr > right->addr)
- return 1;
- else if (left->addr < right->addr)
- return -1;
-
- if (left->is_func != right->is_func)
- return right->is_func - left->is_func;
-
- return left->is_static - right->is_static;
-}
-
-
-void
-symtab_finalize (Sym_Table *tab)
-{
- Sym *src, *dst;
- bfd_vma prev_addr;
-
- if (!tab->len)
- return;
-
- /* Sort symbol table in order of increasing function addresses. */
- qsort (tab->base, tab->len, sizeof (Sym), cmp_addr);
-
- /* Remove duplicate entries to speed-up later processing and
- set end_addr if its not set yet. */
- prev_addr = tab->base[0].addr + 1;
-
- for (src = dst = tab->base; src < tab->limit; ++src)
- {
- if (src->addr == prev_addr)
- {
- /* If same address, favor global symbol over static one,
- then function over line number. If both symbols are
- either static or global and either function or line, check
- whether one has name beginning with underscore while
- the other doesn't. In such cases, keep sym without
- underscore. This takes cares of compiler generated
- symbols (such as __gnu_compiled, __c89_used, etc.). */
- if ((!src->is_static && dst[-1].is_static)
- || ((src->is_static == dst[-1].is_static)
- && ((src->is_func && !dst[-1].is_func)
- || ((src->is_func == dst[-1].is_func)
- && ((src->name[0] != '_' && dst[-1].name[0] == '_')
- || (src->name[0]
- && src->name[1] != '_'
- && dst[-1].name[1] == '_'))))))
- {
- DBG (AOUTDEBUG | IDDEBUG,
- printf ("[symtab_finalize] favor %s@%c%c over %s@%c%c",
- src->name, src->is_static ? 't' : 'T',
- src->is_func ? 'F' : 'f',
- dst[-1].name, dst[-1].is_static ? 't' : 'T',
- dst[-1].is_func ? 'F' : 'f');
- printf (" (addr=%lx)\n", (unsigned long) src->addr));
-
- dst[-1] = *src;
- }
- else
- {
- DBG (AOUTDEBUG | IDDEBUG,
- printf ("[symtab_finalize] favor %s@%c%c over %s@%c%c",
- dst[-1].name, dst[-1].is_static ? 't' : 'T',
- dst[-1].is_func ? 'F' : 'f',
- src->name, src->is_static ? 't' : 'T',
- src->is_func ? 'F' : 'f');
- printf (" (addr=%lx)\n", (unsigned long) src->addr));
- }
- }
- else
- {
- if (dst > tab->base && dst[-1].end_addr == 0)
- dst[-1].end_addr = src->addr - 1;
-
- /* Retain sym only if it has a non-empty address range. */
- if (!src->end_addr || src->addr <= src->end_addr)
- {
- *dst = *src;
- dst++;
- prev_addr = src->addr;
- }
- }
- }
-
- if (tab->len > 0 && dst[-1].end_addr == 0)
- dst[-1].end_addr
- = core_text_sect->vma + bfd_get_section_size (core_text_sect) - 1;
-
- DBG (AOUTDEBUG | IDDEBUG,
- printf ("[symtab_finalize]: removed %d duplicate entries\n",
- tab->len - (int) (dst - tab->base)));
-
- tab->limit = dst;
- tab->len = tab->limit - tab->base;
-
- DBG (AOUTDEBUG | IDDEBUG,
- unsigned int j;
-
- for (j = 0; j < tab->len; ++j)
- {
- printf ("[symtab_finalize] 0x%lx-0x%lx\t%s\n",
- (unsigned long) tab->base[j].addr,
- (unsigned long) tab->base[j].end_addr,
- tab->base[j].name);
- }
- );
-}
-
-
-#ifdef DEBUG
-
-Sym *
-dbg_sym_lookup (Sym_Table *sym_tab, bfd_vma address)
-{
- unsigned long low, mid, high;
- Sym *sym;
-
- fprintf (stderr, "[dbg_sym_lookup] address 0x%lx\n",
- (unsigned long) address);
-
- sym = sym_tab->base;
- for (low = 0, high = sym_tab->len - 1; low != high;)
- {
- mid = (high + low) >> 1;
-
- fprintf (stderr, "[dbg_sym_lookup] low=0x%lx, mid=0x%lx, high=0x%lx\n",
- low, mid, high);
- fprintf (stderr, "[dbg_sym_lookup] sym[m]=0x%lx sym[m + 1]=0x%lx\n",
- (unsigned long) sym[mid].addr,
- (unsigned long) sym[mid + 1].addr);
-
- if (sym[mid].addr <= address && sym[mid + 1].addr > address)
- return &sym[mid];
-
- if (sym[mid].addr > address)
- high = mid;
- else
- low = mid + 1;
- }
-
- fprintf (stderr, "[dbg_sym_lookup] binary search fails???\n");
-
- return 0;
-}
-
-#endif /* DEBUG */
-
-
-/* Look up an address in the symbol-table that is sorted by address.
- If address does not hit any symbol, 0 is returned. */
-Sym *
-sym_lookup (Sym_Table *sym_tab, bfd_vma address)
-{
- long low, high;
- long mid = -1;
- Sym *sym;
-#ifdef DEBUG
- int probes = 0;
-#endif /* DEBUG */
-
- if (!sym_tab->len)
- return 0;
-
- sym = sym_tab->base;
- for (low = 0, high = sym_tab->len - 1; low != high;)
- {
- DBG (LOOKUPDEBUG, ++probes);
- mid = (high + low) / 2;
-
- if (sym[mid].addr <= address && sym[mid + 1].addr > address)
- {
- if (address > sym[mid].end_addr)
- {
- /* Address falls into gap between
- sym[mid] and sym[mid + 1]. */
- return 0;
- }
- else
- {
- DBG (LOOKUPDEBUG,
- printf ("[sym_lookup] %d probes (symtab->len=%u)\n",
- probes, sym_tab->len - 1));
- return &sym[mid];
- }
- }
-
- if (sym[mid].addr > address)
- high = mid;
- else
- low = mid + 1;
- }
-
- if (sym[mid + 1].addr <= address)
- {
- if (address > sym[mid + 1].end_addr)
- {
- /* Address is beyond end of sym[mid + 1]. */
- return 0;
- }
- else
- {
- DBG (LOOKUPDEBUG, printf ("[sym_lookup] %d (%u) probes, fall off\n",
- probes, sym_tab->len - 1));
- return &sym[mid + 1];
- }
- }
-
- return 0;
-}
diff --git a/itcl/ChangeLog b/itcl/ChangeLog
deleted file mode 100644
index 37ce2091857..00000000000
--- a/itcl/ChangeLog
+++ /dev/null
@@ -1,1295 +0,0 @@
-2008-08-02 Keith Seitz <keiths@redhat.com>
-
- * itk/configure.ac: Add missing bits to actually fill in
- itkConfig.sh.
- * itk/itkConfig.sh.in: Rewrite substitution values so that
- this file looks more like itcl/itclConfig.sh.in.
- * itk/configure: Regenerated.
-
-2008-07-23 Keith Seitz <keiths@redhat.com>
-
- Import of Itcl 3.3.
- * itcl/configure.in, itk/configure.in, iwidgets/configure.in:
- Replace with configure.ac.
- * itcl/configure, itk/configure, iwidgets/configure: Regenerate.
- * configure.ac, Makefile.am, Makefile.in: New files.
- * README: "New" file.
- * aclocal.m4: Regenerate.
- * itcl/Makefile.in (RANLIB): Replace with RANLIB_LIB so
- that the toplevel build does not override this variable.
- * itk/Makefile.in (RANLIB): Likewise.
- * itcl/tclconfig/tcl.m4 (TEA_PATH_TCLCONFIG): Look for itclConfig.sh
- in the platform-specific location (unix or win).
- (TEA_PATH_TKCONFIG): Likewise.
- (TEA_MAKE_LIB): Even on windows, GCC libraries must start with "lib".
- * itk/tclconfig.m4: Copy of itcl/tcl.m4.
- * iwidgets/tcl.m4: Remove.
- * iwidgets/tclconfig: New directory.
- * iwidgets/tclconfig/tcl.m4, iwidgets/tclconfig/install-sh: Copies
- of itcl/tclconfig files.
- * iwidgets/Makefile.in (MKINSTALLDIRS): Use mkdir -p.
- * iwidgets/configure.ac (PACKAGE): Rename to PACKAGE_NAME.
- Call TEA_INIT, add AC_CONFIG_AUX_DIR and AC_PROG_INSTALL.
- Use TEA_* instead of SC_* macros.
- Search a few more directories for the itcl and itk libraries.
-
-2006-06-16 Steve Ellcey <sje@cup.hp.com>
-
- * configure.in: Fix for autoconf 2.5.
- * aclocal.m4: Fix for autoconf 2.5.
- * configure: Regenerate.
- * itcl/configure: Regenerate.
- * itcl/win/configure: Regenerate.
- * itk/configure: Regenerate.
- * itk/win/configure: Regenerate.
- * iwidgets/configure: Regenerate.
-
-2005-08-31 Keith Seitz <keiths@redhat.com>
-
- From Jay St. Pierre <Jay.St.Pierre@colorado.edu>:
- * itcl/Makefile.in (install-doc): Install man.macros properly into
- man pages when installing.
- * itk/Makefile.in (install-doc): Likewise.
-
-2001-09-06 David Gravereaux <davygrvy@pobox.com>
-
- * itcl/generic/itcl_util.c: Threading patch from "Haneef Mohammed"
- <haneef@mindspringx.com>.
- [Patch: 445670]
-
- -=[ Incr Tcl/Tk 3.2.1 tagged as done. ]=-
-
-2001-06-22 David Gravereaux <davygrvy@pobox.com>
-
- * tcl.m4: Added support for MacOS X [#435256]
-
- * itk/win/makefile.vc: fixed a bad macro use in the genstubs target.
-
- * itk/generic/itk_cmds.c: Added Itk_SafeInit().
-
- * itk/generic/itk.decls:
- * itk/generic/itkDecls.h:
- * itk/generic/itkStubInit.c: Needed to add Itk_SafeInit() to the Stubs table.
- Regen'd Stubs table.
-
-2001-05-28 Andreas Kupries <andreas_kupries@users.sourceforge.net>
-
- * itcl/Makefile.in:
- * itk/Makefile.in:
- * iwidgets/Makefile.in: Fixed installation of manpages, added
- invocations of "basename" to create the correct paths into the
- installation directories. Fixes [#427118].
-
-2001-05-25 davygrvy
- * ChangeLog (new):
- Auto-generated this from the output of `cvs log`. This will be the
- day-to-day reference of per-commits. CHANGES will now be the digest
- of the data in here. Just like how Tcl does it. Information from
- iwidgets was not used.
-
- * itk/generic/itk.h:
- * itk/generic/itkStubLib.c:
- * itk/generic/itk_cmds.c:
- added CONST to return type for Itk_InitStubs() to match what Kevin Kenny
- is doing to Tcl. Along with a little lint cleaning regarding Stubs.
-
- * itcl/generic/itcl.h:
- * itcl/generic/itclStubLib.c:
- added CONST to return type for Itcl_InitStubs() to match what
- Kevin Kenny is doing to Tcl
-
-2001-05-24 davygrvy
- * README.vc.txt:
- instructions how to use makefile.vc to build the package
-
- * itcl/configure:
- * itcl/configure.in:
- * itcl/itclConfig.sh.in:
- * itk/configure:
- * itk/configure.in:
- * itk/itkConfig.sh.in:
- Bug #427113
-
-2001-05-23 davygrvy
- * itcl/win/makefile.vc:
- added missing quotes around include paths.
-
- * .cvsignore:
- * configure:
- * configure.in:
- changed configure.in to the new iwidgets subdir. Removed the older
- references to iwidgets3.0.0 and iwidgets2.2.0
-
- * configure:
- this could be useful.
-
- * itcl/.cvsignore:
- * itcl/configure:
- * itcl/configure.in:
- * itk/.cvsignore:
- * itk/configure:
- * itk/configure.in:
- Updated patch level to 3.2.1 in prep for a release.
-
- * itcl/win/makefile.vc:
- * itcl/win/rc/itcl.rc:
- yet another rc problem repaired
-
- * itcl/win/makefile.vc:
- rc problem repaired
-
-2001-05-22 davygrvy
- * itcl/generic/itcl_objects.c:
- * itcl/tests/interp.test:
- patch #426205, self deleting class caused core dump.
-
- * itk/generic/itk_archetype.c:
- * itk/generic/itk_cmds.c:
- Fix for Tcl_GetCommandName() now returning a CONST char *
- from the changes Kevin Kenny is doing to the HEAD tcl code.
- This hasn't been tested with older header files, yet.
-
- * config.vc:
- * itcl/win/makefile.vc:
- * itk/win/makefile.vc:
- * itk/win/rc/itk.rc:
- * makefile.vc:
- makefile.vc actually works again.
-
- * itk/win/rc/cursor00.cur:
- * itk/win/rc/cursor02.cur:
- * itk/win/rc/cursor04.cur:
- * itk/win/rc/cursor06.cur:
- * itk/win/rc/cursor08.cur:
- * itk/win/rc/cursor0a.cur:
- * itk/win/rc/cursor0c.cur:
- * itk/win/rc/cursor0e.cur:
- * itk/win/rc/cursor10.cur:
- * itk/win/rc/cursor12.cur:
- * itk/win/rc/cursor14.cur:
- * itk/win/rc/cursor16.cur:
- * itk/win/rc/cursor18.cur:
- * itk/win/rc/cursor1a.cur:
- * itk/win/rc/cursor1c.cur:
- * itk/win/rc/cursor1e.cur:
- * itk/win/rc/cursor20.cur:
- * itk/win/rc/cursor22.cur:
- * itk/win/rc/cursor24.cur:
- * itk/win/rc/cursor26.cur:
- * itk/win/rc/cursor28.cur:
- * itk/win/rc/cursor2a.cur:
- * itk/win/rc/cursor2c.cur:
- * itk/win/rc/cursor2e.cur:
- * itk/win/rc/cursor30.cur:
- * itk/win/rc/cursor32.cur:
- * itk/win/rc/cursor34.cur:
- * itk/win/rc/cursor36.cur:
- * itk/win/rc/cursor38.cur:
- * itk/win/rc/cursor3a.cur:
- * itk/win/rc/cursor3c.cur:
- * itk/win/rc/cursor3e.cur:
- * itk/win/rc/cursor40.cur:
- * itk/win/rc/cursor42.cur:
- * itk/win/rc/cursor44.cur:
- * itk/win/rc/cursor46.cur:
- * itk/win/rc/cursor48.cur:
- * itk/win/rc/cursor4a.cur:
- * itk/win/rc/cursor4c.cur:
- * itk/win/rc/cursor4e.cur:
- * itk/win/rc/cursor50.cur:
- * itk/win/rc/cursor52.cur:
- * itk/win/rc/cursor54.cur:
- * itk/win/rc/cursor56.cur:
- * itk/win/rc/cursor58.cur:
- * itk/win/rc/cursor5a.cur:
- * itk/win/rc/cursor5c.cur:
- * itk/win/rc/cursor5e.cur:
- * itk/win/rc/cursor60.cur:
- * itk/win/rc/cursor62.cur:
- * itk/win/rc/cursor64.cur:
- * itk/win/rc/cursor66.cur:
- * itk/win/rc/cursor68.cur:
- * itk/win/rc/cursor6a.cur:
- * itk/win/rc/cursor6c.cur:
- * itk/win/rc/cursor6e.cur:
- * itk/win/rc/cursor70.cur:
- * itk/win/rc/cursor72.cur:
- * itk/win/rc/cursor74.cur:
- * itk/win/rc/cursor76.cur:
- * itk/win/rc/cursor78.cur:
- * itk/win/rc/cursor7a.cur:
- * itk/win/rc/cursor7c.cur:
- * itk/win/rc/cursor7e.cur:
- * itk/win/rc/cursor80.cur:
- * itk/win/rc/cursor82.cur:
- * itk/win/rc/cursor84.cur:
- * itk/win/rc/cursor86.cur:
- * itk/win/rc/cursor88.cur:
- * itk/win/rc/cursor8a.cur:
- * itk/win/rc/cursor8c.cur:
- * itk/win/rc/cursor8e.cur:
- * itk/win/rc/cursor90.cur:
- * itk/win/rc/cursor92.cur:
- * itk/win/rc/cursor94.cur:
- * itk/win/rc/cursor96.cur:
- * itk/win/rc/cursor98.cur:
- * itk/win/rc/itkwish.rc:
- * itk/win/winMain.c:
- Removing of old cruft. itkwishXX.exe is no longer needed as itkXX.dll is a
- pure extension and loads in a vanilla wish just fine.
-
- * itcl/win/pkgIndex.tcl:
- * itk/win/pkgIndex.tcl:
- we'll auto gen these from the makefile
-
- * itcl/win/makefile.vc:
- * itk/win/makefile.vc:
- fixed include paths to make sure paths to itcl.h and itk.h in the source tree
- are mentioned first to avoid a possible bug during building.
-
- * itcl/configure:
- * itcl/configure.in:
- * itk/configure:
- * itk/configure.in:
- patch #426203
-
- * itk/win/makefile.vc:
- Mostly working. Not fully tested, but lots closer.
-
- * itk/win/makefile.vc:
- more closer, but not yet perfect.
-
- * itcl/generic/itcl_cmds.c:
- * itcl/generic/itcl_methods.c:
- Fix for Tcl_GetCommandName() now returning a CONST char *
- from the changes Kevein Kenny is doing to the HEAD tcl code.
- This hasn't been tested with older header files, yet.
-
- * itk/generic/itk_cmds.c:
- Removed old reference to external ItkStubs structure.
- Old cruft left from before Itk_InitStubs existed.
-
- * itcl/win/itcl.rc:
- * itcl/win/rc/itcl.rc:
- moving the resource script
-
- * itcl/win/rc/itcl.rc:
- subtle changes.
-
- * itcl/win/itclsh.rc:
- * itcl/win/tclAppInit.c:
- Removing of old cruft. itclshXX.exe is no longer needed as itclXX.dll is a
- pure extension and loads in a vanilla shell just fine.
-
- * itcl/generic/itcl_methods.c:
- * itcl/generic/itcl_util.c:
- removed #include "tclCompile.h"!
- It wasn't needed. Those source files made no reference to anything in it.
-
- * itk/win/makefile.vc:
- closer to perfection.
-
- * itk/win/rc/itk.rc:
- This is now the resource script for the dll.
-
- * itcl/generic/itcl_methods.c:
- whoops.. doh!
-
- * itk/win/dllEntryPoint.c:
- Stubs bug logic fix. Same as itcl/win/dllEntryPoint.c. This help build a debug
- version of itcl/itk from the standard tclstubXX.lib by removing the link
- requirement to msvcrt.lib which should never have been there.
-
- * itcl/win/makefile.vc:
- adapted for new location of itcl.rc
-
- * itk/win/rc/itk.rc:
- subtle changes to infere the correct filename and support more
- complete versioning info.
-
- * itcl/generic/itcl.h:
- * itk/generic/itk.h:
- changed RESOURCE_INCLUDED to RC_INVOKED. The windows resource
- compiler to preset to define this already.
-
- * itcl/generic/itclInt.decls:
- * itcl/generic/itclIntDecls.h:
- * itcl/generic/itcl_class.c:
- Fix for Itcl_ClassCmdResolver() not being of type Tcl_ResolveCmdProc with
- the CONST type added to param 2 in the lastest headers. I haven't tested
- this with an older tcl.h yet. Hopefully, this won't get messy.
-
- * itcl/win/makefile.vc:
- small $(RCDIR) change.
-
- * itcl/generic/itcl_bicmds.c:
- patch #426207, contextNs ptr can be NULL in Itcl_BiInfoClassCmd
- ).
-
-2001-05-18 andreas_kupries
- * itcl/generic/itcl_class.c:
- [Fix 227811] Check for any command with the given name, not only
- objects.
-
-2001-05-17 andreas_kupries
- * itcl/generic/itcl_class.c:
- * itcl/generic/itcl_cmds.c:
- Fixed bug 227804.
-
-2001-05-11 andreas_kupries
- * itk/generic/itk_archetype.c:
- 2001-05-11 Andreas Kupries <a.kupries@westend.com>
-
- * itk/generic/itk_archetype.c: Fixed bug 227876.
-
- * itcl/generic/itcl_objects.c:
- 2001-05-11 Andreas Kupries <a.kupries@westend.com>
-
- * itk/generic/itk_archetype.c: Fixed bug 227824 (and several duplicates).
-
- * itk/generic/itk_archetype.c:
- 2001-05-11 Andreas Kupries <a.kupries@westend.com>
-
- * itk/generic/itk_archetype.c: Fixed bug 227814
-
-2001-04-25 davygrvy
- * pkg.vc:
- moved the info about the iwidget version for makefile.vc
-
-2001-04-18 davygrvy
- * itcl/win/dllEntryPoint.c:
- whoops... removed C++ style comment from this .c file :)
-
-2001-04-14 davygrvy
- * itcl/library/itcl.tcl:
- Patch ID #227860
-
- * rules.vc:
- added an $Id$ keyword
-
- * .cvsignore:
- just testing loginfo mailing...
-
- * .cvsignore:
- only making a change to see the history file get an entry...
-
-2001-04-12 davygrvy
- * itcl/win/makefile.vc:
- progress is happening
-
-2001-04-08 davygrvy
- * itcl/win/.cvsignore:
- * itk/win/.cvsignore:
- no need to have CVS bother itself with the build directories
-
- * itcl/win/makefile.vc:
- a large rewrite
-
- * makefile.vc:
- todays work progress. I'm not done yet.
-
- * itcl/generic/itcl_ensemble.c:
- * itcl/generic/itcl_util.c:
- Added mutex locking around the ItclPreservedList global hash table. This
- appears to be the only work needed to support multithreading.
-
- * config.vc:
- * pkg.vc:
- * rules.vc:
- new build files for VC++ compiles
-
- * .cvsignore:
- ignore MSVC++ project artifacts
-
-2001-04-07 davygrvy
- * itcl/win/dllEntryPoint.c:
- a small windows specific fix against Tcl's Stubs library.
-
- * itcl/generic/itclInt.h:
- * itcl/generic/itclStubLib.c:
- * itcl/generic/itcl_class.c:
- * itcl/generic/itcl_cmds.c:
- * itcl/generic/itcl_ensemble.c:
- 4/07/01 (bug fix) <davygrvy@pobox.com>
- Tcl's internal header, tclInt.h, in 8.4a2 got a small change in the Command
- structure that needed 2 changes in Itcl to resolve. 1) #if/#else/#endif blocks
- added in itcl_class.c and itc_ensemble.c allowing Itcl to compile. 2) added
- a global variable called itclCompatFlags that's sets a flag in Itcl_Init()
- that will modify the logic around access to cmdPtr->flags/deleted. This
- way, any core compile will yeild a fully forward/backward compatible
- binary (correct logic set at runtime).
-
-2000-12-21 smithc
- * itk/win/makefile.vc:
- Patch #102914.
-
-2000-12-12 smithc
- * itcl/generic/itcl_ensemble.c:
- Patch #102774
-
- * itcl/generic/itcl_class.c:
- Patch #100274
-
-2000-09-23 davidg
- * CHANGES:
- added a note about the 3.2 release
-
- * itcl/generic/itcl.h:
- 9/22/00 (stubs cleanup) <davygrvy@ajubasolutions.com>
- Itcl_InitStub prototype in itcl/generic/itcl.h was getting name mangled
- by c++ compilers. Fixed with an 'extern "C"' appropriately applied.
-
-2000-08-18 davidg
- * itcl/generic/itcl_cmds.c:
- Tcl_InitStubs was using the TCL_VERSION macro set by the tcl.h header.
- Changed it to be "8.1" instead as it doesn't matter unless Itcl needs
- special/new features of the core it's header is from. But it doesn't.. so hard
- code it for an 8.1 minimum.
-
-2000-08-07 welch
- * itcl/Makefile.in:
- * itcl/generic/itcl.h:
- * itcl/generic/itclStubLib.c:
- Final iteration, really, on getting Itcl_StubInit correctly set
- up.
-
- * itk/generic/itk_cmds.c:
- Removed redundant definitions of itclStubsPtr and
- itclIntStubsPtr.
-
- * itcl/Makefile.in:
- Added Itcl_InitStubs to the main Itcl library as well as the stubs
- library for those applications (like Itk) that call Itcl_InitStub
- but are linked against the main library.
-
- * CHANGES:
- * CHANGES:
- *** empty log message ***
-
-2000-08-04 davidg
- * itcl/generic/itcl.decls:
- * itcl/generic/itclDecls.h:
- * itcl/generic/itclIntDecls.h:
- * itcl/generic/itclStubInit.c:
- * itk/generic/itk.decls:
- * itk/generic/itkDecls.h:
- * itk/generic/itkStubInit.c:
- * itk/generic/itkStubLib.c:
- added missing RCS $Id$ strings
-
- * itcl/generic/itcl.h:
- * itcl/generic/itclStubLib.c:
- * itk/generic/itk.h:
- * itk/generic/itkStubLib.c:
- yanked ugly linkage cruft from the StubLib functions. It's
- always static.
-
-2000-08-02 davidg
- * itk/generic/itk_cmds.c:
- simplified how Itcl Stubs are set
-
- * itcl/generic/itcl.h:
- * itk/generic/itk.h:
- added missing Itcl_InitStubs and Itk_InitStubs declarations.
-
-2000-08-02 welch
- * itk/generic/itkStubLib.c:
- Fixed this new function
-
- * itcl/Makefile.in:
- * itk/Makefile.in:
- Changed this to use installFiles.tcl instead of install-sh
-
- * itcl/generic/itclStubLib.c:
- Fix for new Itcl_InitStubs.c
-
- * config/installFile.tcl:
- Added a Tcl version of install-sh that avoids copying a file if
- the target has the same size and date stamp as the source file already.
- This helps parallel builds on different platforms avoid changing
- files out from one another.
-
- * CHANGES:
- *** empty log message ***
-
-2000-07-29 welch
- * itcl/configure:
- * itk/configure:
- Ran autoconf
-
- * tcl.m4:
- Fixed this with respect to recent changes in windows def of TCL_SRC_DIR
-
-2000-07-23 wart
- * itcl/Makefile.in:
- * itk/Makefile.in:
- Use INSTALL_PROGRAM instead of INSTALL_DATA to install libraries so
- they get execute permission on HPUX
-
-2000-07-14 welch
- * itcl/configure:
- * itk/configure:
- Updated configure
-
- * config/install-sh:
- Nuked debug echo statement
-
-2000-07-12 welch
- * config/install-sh:
- Added -f to MV command
-
- * CHANGES:
- * Makefile.in:
- Added some feedback to the top-level makefile loops
-
- * itcl/configure.in:
- * itk/Makefile.in:
- * itk/configure.in:
- Disable stubs in the case of static builds.
-
-2000-07-07 csmith
- * itcl/tests/info.test:
- patch submitted by David Cuthbert, 7/7/00
-
- * itcl/generic/itcl_bicmds.c:
- patch submitted by David Cuthbert, 7/7/00 to fix segfault caused by the
- following code:
-
- itcl::class X { }
- namespace eval X { info class }
-
-2000-07-06 mmc
- * Makefile.in:
- * README:
-
- Touched up README for itcl3.2 release. Fixed master Makefile to
- avoid testing iwidgets2.2.0, which is an older release provided
- only for backward-compatibility. Bug fixes and improvements are
- made and tested in the newer iwidgets3.0.0 release.
-
- * CHANGES:
- * itcl/generic/itcl.h:
- * itcl/generic/itcl_class.c:
- * itcl/generic/itcl_cmds.c:
- * itcl/generic/itcl_objects.c:
- * itcl/tests/all:
- * itcl/tests/all.tcl:
- * itcl/tests/basic.test:
- * itcl/tests/defs:
- * itcl/tests/inherit.test:
- * itcl/tests/methods.test:
- * itcl/tests/namespace.test:
- * itcl/unix/Makefile.in:
- * itcl/unix/configure.in:
- * itcl/unix/itclConfig.sh.in:
- * itcl/unix/pkgIndex.tcl.in:
- * itcl/unix/test.tcl:
- * itk/Makefile.in:
- * itk/generic/itk_archetype.c:
- * itk/library/itk.tcl:
- * itk/tests/all:
- * itk/tests/all.tcl:
- * itk/tests/defs:
- * itk/tests/widget.test:
- * itk/unix/Makefile.in:
- * itk/unix/configure.in:
- * itk/unix/itkConfig.sh:
- * itk/unix/itkConfig.sh.in:
- * itk/unix/pkgIndex.tcl.in:
-
- 6/26/00 (bug fix)
- Fixed Itcl_ClassVarResolver so that the formal parameters in a
- method/proc take precedence over class data members.
-
- 6/30/00 (bug fix)
- Fixed all itcl/itk/iwidgets3.0.0 tests to run cleanly with the new
- tcltest package.
-
- 7/1/00 (bug fix)
- Fixed "itk_component delete" so that the composite option list is
- cleaned up whenever a component is deleted. For example, suppose
- a component is the sole contributor of -font. When that component
- is removed via "itk_component delete", the -font option goes away
- as well. Also fixed the handling of the itk-delete-* binding for
- the component. When the component is removed, the binding tag
- is also removed by itk::remove_destroy_hook.
-
- 7/5/00 (bug fix)
- Fixed the check done during object creation to avoid clobbering
- existing commands. Previously, itcl would look for any command--
- in the local *and* global namespace--that might be clobbered.
- Now, it looks for commands only in the local namespace, since
- those are the only ones that could truly be clobbered.
-
- 7/5/00 (cleanup)
- Removed obsolete Makefile/configure files in the various "unix"
- directories. Makefiles and configure files now reside one level
- above, in the standard TEA place.
-
-2000-06-22 wart
- * itcl/Makefile.in:
- Added itclDecls.h to list of header files to install.
-
-2000-06-22 welch
- * itk/Makefile.in:
- Installing stub table tkDecls.h
-
- * itcl/Makefile.in:
- Installing all header files, not just public ones.
-
-2000-06-16 matt
- * itcl/generic/itcl_util.c:
- Moved #ifndef NDEBUG inside Itcl_Assert routine otherwise it may not get inclued
- BUT it is specified in the Stubs Table.....
-
-2000-06-06 wart
- * itk/tests/all.tcl:
- Added missing file for running test suite.
-
- * itcl/tests/all.tcl:
- Added missing file for running test suite
-
-2000-06-01 wart
- * itcl/Makefile.in:
- * itcl/tests/basic.test:
- * itcl/tests/body.test:
- * itcl/tests/chain.test:
- * itcl/tests/delete.test:
- * itcl/tests/ensemble.test:
- * itcl/tests/import.test:
- * itcl/tests/info.test:
- * itcl/tests/inherit.test:
- * itcl/tests/interp.test:
- * itcl/tests/local.test:
- * itcl/tests/methods.test:
- * itcl/tests/mkindex.test:
- * itcl/tests/namespace.test:
- * itcl/tests/protection.test:
- * itcl/tests/scope.test:
- * itk/Makefile.in:
- * itk/configure:
- * itk/configure.in:
- * itk/tests/interp.test:
- * itk/tests/option.test:
- * itk/tests/privacy.test:
- * itk/tests/public.test:
- * itk/tests/toplevel.test:
- * itk/tests/widget.test:
- Tests modified to work with TEA Makefile.
-
-2000-04-19 mmc
- * CHANGES:
- * itcl/Makefile.in:
- * itcl/configure:
- * itcl/configure.in:
- * itcl/doc/find.n:
- * itcl/generic/itcl.h:
- * itcl/generic/itcl_cmds.c:
- * itcl/tests/basic.test:
- * itcl/tests/body.test:
- * itcl/tests/chain.test:
- * itcl/tests/defs:
- * itcl/tests/delete.test:
- * itcl/tests/ensemble.test:
- * itcl/tests/info.test:
- * itcl/tests/inherit.test:
- * itcl/tests/local.test:
- * itcl/tests/methods.test:
- * itcl/tests/mkindex.itcl:
- * itcl/tests/namespace.test:
- * itcl/tests/protection.test:
- * itcl/tests/scope.test:
- * itcl/tests/tclIndex:
- * itcl/unix/configure.in:
- * itk/Makefile.in:
- * itk/configure:
- * itk/configure.in:
- * itk/tests/defs:
- * itk/tests/option.test:
- * itk/tests/widget.test:
- * license.terms:
-
- - fixed itcl::find to find classes/objects in *all* namespaces
- - fixed tests to run cleanly
-
-2000-03-28 csmith
- * itcl/generic/itcl_cmds.c:
- Patch for Ticket 4111, submitted by David Cuthbert:
-
- *** itcl3.1.0/itcl/generic/itcl_cmds.c.orig Tue Feb 1 16:37:53 2000
- --- itcl3.1.0/itcl/generic/itcl_cmds.c.new Tue Feb 1
- 16:38:06 2000
- ***************
- *** 94,100 ****
- static char safeInitScript[] =
- "proc ::itcl::local {class name args} {\n\
- ! set ptr [uplevel eval [list $class $name] $args]\n\
- uplevel [list set itcl-local-$ptr $ptr]\n\
- set cmd [uplevel namespace which -command $ptr]\n\
- uplevel [list trace variable itcl-local-$ptr u \"::itcl::delete object $cmd; list\"]\n\
-
- --- 94,100 ----
- static char safeInitScript[] =
- "proc ::itcl::local {class name args} {\n\
- ! set ptr [uplevel [list $class $name] $args]\n\
- uplevel [list set itcl-local-$ptr $ptr]\n\
- set cmd [uplevel namespace which -command $ptr]\n\
- uplevel [list trace variable itcl-local-$ptr u \"::itcl::delete object $cmd; list\"]\n\
-
- * itcl/library/itcl.tcl:
- Patch for ticket 4111, submitted by David Cuthbert:
-
- *** itcl3.1.0/itcl/library/itcl.tcl.orig Tue Feb 1 16:38:24 2000
- --- itcl3.1.0/itcl/library/itcl.tcl.new Tue Feb 1 16:38:30 2000
- ***************
- *** 27,33 ****
- # alive until a procedure exits.
- # ----------------------------------------------------------------------
- proc ::itcl::local {class name args} {
- ! set ptr [uplevel eval [list $class $name] $args]
- uplevel [list set itcl-local-$ptr $ptr]
- set cmd [uplevel namespace which -command $ptr]
- uplevel [list trace variable itcl-local-$ptr u \
-
- --- 27,33 ----
- # alive until a procedure exits.
- # ----------------------------------------------------------------------
- proc ::itcl::local {class name args} {
- ! set ptr [uplevel [list $class $name] $args]
- uplevel [list set itcl-local-$ptr $ptr]
- set cmd [uplevel namespace which -command $ptr]
- uplevel [list trace variable itcl-local-$ptr u \
-
-2000-03-20 wart
- * itk/configure:
- * itk/configure.in:
- Fixed typo in variable name
-
-2000-03-17 wart
- * itcl/Makefile.in:
- * itk/Makefile.in:
- * itk/configure:
- * itk/configure.in:
- Added TCL_EXTRA_CFLAGS to compile line to fix build problems on Irix
-
-2000-02-04 wart
- * itk/configure:
- * itk/configure.in:
- Fixed typo that was causing builds on CYGWIN_NT platforms not to pick up
- the Tcl stub library (TCL_STUB_LIB_SPEC was not being substituted in the
- Makefile)
-
-2000-01-28 wart
- * itcl/configure:
- * itcl/configure.in:
- * itk/configure:
- * itk/configure.in:
- Fixed a few more places where the configure wasn't checking for cygwin on
- Windows 95/98
-
-2000-01-24 wart
- * itcl/configure:
- * itk/configure:
- Regenerated configure scripts to pick up changes to tcl.m4
-
- * itcl/configure:
- * itk/configure:
- Regenerated configure scripts to pick up recent changes to tcl.m4
-
- * tcl.m4:
- * tcl.m4:
- Updated to reflect recent TEA changes
-
-2000-01-18 wart
- * tcl.m4:
- Updated to reflect recent TEA changes
-
-2000-01-03 csmith
- * itcl/unix/Makefile.in:
- Patch submitted by Mo Dejong needed so Itcl will link to the Tcl libs
- when Tcl is compiled with debugging on.
-
- * itcl/generic/itcl_parse.c:
- Patch by Mo Dejong to fix a Windows NT/95 crashing problem where you can
- build with debugging on, load the Itcl package, and press the X in the
- upper right corner. Note that I'm unable to test this on Windows and
- that this patch introduces a compiler warning.
-
- * itcl/generic/itcl_parse.c:
- Duuuuhhhh....
-
- This is the patch from Mo Dejong regarding the Windows NT/95 crashing
- problem. My previous checkin of itcl_parse.c did not include all of
- the patch - got in a hurry. Disregard the compiler warning mentioned
- in my previous checkin.
-
- * itcl/tests/defs:
- Patch submitted by Mo Dejong: needed to add "-force" option to the
- namespace import command so fix a bug with 'make test'.
-
- * itcl/generic/itcl_parse.c:
- *** empty log message ***
-
-1999-11-24 wart
- * itcl/configure:
- * itk/configure:
- regenerated configure scripts to pick up tcl.m4 changes
-
- * itcl/configure:
- * itk/configure:
- * tcl.m4:
- tcl.m4: Updated to reflect recent TEA changes
-
- */configure: Regnereated with new tcl.m4
-
- iwidgets2.2.0/Makefile.in: Don't copy nonexistent files
-
- * tcl.m4:
- Updated to reflect recent TEA changes
-
-1999-09-21 wart
- * itk/Makefile.in:
- Itk now installs appropriate library files.
-
-1999-09-20 wart
- * itcl/configure:
- * itcl/configure.in:
- * itk/Makefile.in:
- * itk/configure:
- * itk/configure.in:
- pkgIndex on Windows now looks in the correct directory for the
- .dll files.
-
-1999-09-17 wart
- * tcl.m4:
- Updated to reflect recent changes
-
-1999-09-15 wart
- * itcl/configure:
- * itcl/configure.in:
- * itcl/pkgIndex.tcl.in:
- * itk/configure:
- * itk/configure.in:
- * itk/pkgIndex.tcl.in:
- Better pkgIndex.tcl files that should now work on solaris.
-
-1999-09-14 wart
- * itcl/Makefile.in:
- * itcl/configure:
- * itcl/configure.in:
- * itcl/mkIndex.tcl.in:
- * itcl/pkgIndex.tcl.in:
- * itk/Makefile.in:
- * itk/configure:
- * itk/configure.in:
- * itk/mkIndex.tcl.in:
- * itk/pkgIndex.tcl.in:
- Fixed installation of pkgIndex.tcl file. We have to install a pre-made
- pkgIndex.tcl file since pkg_mkIndex can't seem to make a usable one.
-
-1999-09-10 wart
- * itk/Makefile.in:
- Fixed bug when calling mkIndex.tcl for itk
-
- reduced amount of output from "make install" in iwidgets
-
- * itcl/Makefile.in:
- * itk/Makefile.in:
- Removed Makefiles rules to regenerate the configure scripts. This was
- causing problems when building on Windows and Unix simultaneoulsy.
-
-1999-09-09 wart
- * itcl/configure:
- * itcl/configure.in:
- * itk/configure:
- * itk/configure.in:
- configure scripts now look for tclsh82d.exe executable when searching
- for valid tcl interpreter.
-
- * Makefile.in:
- Added pkgIndex files for Iwidgets
-
- Top level Makefile should no longer loop endlessly if the configure went bad.
-
- * itcl/configure:
- * itcl/configure.in:
- * itk/configure:
- * itk/configure.in:
- * tcl.m4:
- Look for tclsh82d.exe before tclsh82.exe.
-
- configure scripts for itcl and itk now use the tcl.m4 macro SC_PROG_TCLSH.
-
-1999-09-07 wart
- * itcl/Makefile.in:
- * itcl/configure:
- * itcl/configure.in:
- * itk/Makefile.in:
- * itk/configure:
- * itk/configure.in:
- configure now searches for tclsh82 shell in exec-prefix, then prefix, then
- relative to tclConfig.sh, then in the users path.
-
-1999-09-04 wart
- * configure.in:
- * itcl/Makefile.in:
- * itcl/aclocal.m4:
- * itcl/configure:
- * itcl/configure.in:
- * itcl/mkIndex.tcl.in:
- * itk/Makefile.in:
- * itk/aclocal.m4:
- * itk/configure:
- * itk/configure.in:
- * itk/mkIndex.tcl.in:
- * tcl.m4:
- TEA changes. Itcl now uses the same Makefiles and configure scripts for
- both Windows and Unix.
-
- Note that static shells are not yet done in this TEA implementation.
-
- * itcl/Makefile.in:
- * itk/Makefile.in:
- Temporarily removed pkg_mkIndex step from Makefile since it causes a
- crash on Windows.
-
-1999-08-21 matt
- * itcl/unix/Makefile.in:
- Fixed mismatch between configure script and makefile for stub
- enabled builds
-
- * itk/unix/Makefile.in:
- Fixed mismatch between conifgure script and Makefile for stub
- enabled builds.
-
-1999-06-28 hershey
- * itk/unix/configure.in:
- * itk/unix/itkConfig.sh:
- remove version number from comments
-
-1999-06-26 wart
- * itcl/mac/itclMacLibrary.r:
- * itcl/mac/pkgIndex.tcl:
- * itcl/unix/configure.in:
- * itk/mac/itkMacLibrary.r:
- * itk/mac/pkgIndex.tcl:
- * itk/unix/configure.in:
- * itk/win/pkgIndex.tcl:
- Version numbers changed from 3.0.1 to 3.1.0
-
-1999-05-25 redman
- * itcl/generic/itcl.h:
- * itcl/win/makefile.vc:
- * itk/win/makefile.vc:
- * itk/win/winMain.c:
- * makefile.vc:
- Fixed the use of Tcl & Tk stubs on Windows.
-
- Now the extra shells (itclsh31.exe and itkwish31.exe) are being
- created and run properly.
-
- * itcl/generic/itcl_cmds.c:
- * itcl/unix/Makefile.in:
- * itcl/unix/configure.in:
- * itcl/unix/itclConfig.sh.in:
- * itk/generic/itk_cmds.c:
- * itk/unix/Makefile.in:
- * itk/unix/configure.in:
- * itk/unix/itkConfig.sh:
- * itk/unix/itkConfig.sh.in:
- Fix the makefile and configure files, etc., for Unix
- in order to compile with Tcl/Tk 8.1 with stubs.
-
- Builds itclsh and itkwish properly.
-
-1999-05-24 redman
- * itcl/generic/itcl.decls:
- * itcl/generic/itcl.h:
- * itcl/generic/itclDecls.h:
- * itcl/generic/itclInt.decls:
- * itcl/generic/itclInt.h:
- * itcl/generic/itclIntDecls.h:
- * itcl/generic/itclStubInit.c:
- * itcl/generic/itclStubLib.c:
- * itcl/generic/itcl_cmds.c:
- * itcl/generic/itcl_ensemble.c:
- * itcl/tests/defs:
- * itcl/tests/tclIndex:
- * itcl/win/itcl.rc:
- * itcl/win/makefile.vc:
- * itcl/win/pkgIndex.tcl:
- * itk/generic/itk.decls:
- * itk/generic/itk.h:
- * itk/generic/itkDecls.h:
- * itk/generic/itkStubInit.c:
- * itk/generic/itkStubLib.c:
- * itk/generic/itk_cmds.c:
- * itk/win/makefile.vc:
- * itk/win/rc/itk.rc:
- * makefile.vc:
- Applied patches from David Gravereaux to update Itcl and Itk to
- use Tcl/Tk 8.1 stubs and provide it's own stubs interface, on
- Windows only.
-
- Changes have not been made to support I18N (if needed) or MT-safety.
-
- Version number has been changed to 3.1.0 (from 3.0.1) by
- David to coincide with the shift to Tcl/Tk 8.1.
-
- Building of itclsh31.exe and iwish31.exe have been disabled
- until someone else makes them work properly. Test suites
- have been modified to work with tclsh81.exe instead.
-
-1999-02-05 stanton
- * itk/unix/itkConfig.sh:
- updated version to itcl3.0.1
-
-1999-01-15 rjohnson
- * itcl/tests/mkindex.itcl:
-
- Fixed typo in tcl file.
-
-1998-10-29 stanton
- * itcl/doc/itcl_info.n:
- Cleaned up some out of date references to 2.2 syntax.
-
-1998-09-14 stanton
- * itk/win/rc/cursor00.cur:
- * itk/win/rc/cursor02.cur:
- * itk/win/rc/cursor04.cur:
- * itk/win/rc/cursor06.cur:
- * itk/win/rc/cursor08.cur:
- * itk/win/rc/cursor0a.cur:
- * itk/win/rc/cursor0c.cur:
- * itk/win/rc/cursor0e.cur:
- * itk/win/rc/cursor10.cur:
- * itk/win/rc/cursor12.cur:
- * itk/win/rc/cursor14.cur:
- * itk/win/rc/cursor16.cur:
- * itk/win/rc/cursor18.cur:
- * itk/win/rc/cursor1a.cur:
- * itk/win/rc/cursor1c.cur:
- * itk/win/rc/cursor1e.cur:
- * itk/win/rc/cursor20.cur:
- * itk/win/rc/cursor22.cur:
- * itk/win/rc/cursor24.cur:
- * itk/win/rc/cursor26.cur:
- * itk/win/rc/cursor28.cur:
- * itk/win/rc/cursor2a.cur:
- * itk/win/rc/cursor2c.cur:
- * itk/win/rc/cursor2e.cur:
- * itk/win/rc/cursor30.cur:
- * itk/win/rc/cursor32.cur:
- * itk/win/rc/cursor34.cur:
- * itk/win/rc/cursor36.cur:
- * itk/win/rc/cursor38.cur:
- * itk/win/rc/cursor3a.cur:
- * itk/win/rc/cursor3c.cur:
- * itk/win/rc/cursor3e.cur:
- * itk/win/rc/cursor40.cur:
- * itk/win/rc/cursor42.cur:
- * itk/win/rc/cursor44.cur:
- * itk/win/rc/cursor46.cur:
- * itk/win/rc/cursor48.cur:
- * itk/win/rc/cursor4a.cur:
- * itk/win/rc/cursor4c.cur:
- * itk/win/rc/cursor4e.cur:
- * itk/win/rc/cursor50.cur:
- * itk/win/rc/cursor52.cur:
- * itk/win/rc/cursor54.cur:
- * itk/win/rc/cursor56.cur:
- * itk/win/rc/cursor58.cur:
- * itk/win/rc/cursor5a.cur:
- * itk/win/rc/cursor5c.cur:
- * itk/win/rc/cursor5e.cur:
- * itk/win/rc/cursor60.cur:
- * itk/win/rc/cursor62.cur:
- * itk/win/rc/cursor64.cur:
- * itk/win/rc/cursor66.cur:
- * itk/win/rc/cursor68.cur:
- * itk/win/rc/cursor6a.cur:
- * itk/win/rc/cursor6c.cur:
- * itk/win/rc/cursor6e.cur:
- * itk/win/rc/cursor70.cur:
- * itk/win/rc/cursor72.cur:
- * itk/win/rc/cursor74.cur:
- * itk/win/rc/cursor76.cur:
- * itk/win/rc/cursor78.cur:
- * itk/win/rc/cursor7a.cur:
- * itk/win/rc/cursor7c.cur:
- * itk/win/rc/cursor7e.cur:
- * itk/win/rc/cursor80.cur:
- * itk/win/rc/cursor82.cur:
- * itk/win/rc/cursor84.cur:
- * itk/win/rc/cursor86.cur:
- * itk/win/rc/cursor88.cur:
- * itk/win/rc/cursor8a.cur:
- * itk/win/rc/cursor8c.cur:
- * itk/win/rc/cursor8e.cur:
- * itk/win/rc/cursor90.cur:
- * itk/win/rc/cursor92.cur:
- * itk/win/rc/cursor94.cur:
- * itk/win/rc/cursor96.cur:
- * itk/win/rc/cursor98.cur:
- * itk/win/rc/itk.ico:
- Fixed binary files
-
-1998-09-08 stanton
- * CHANGES:
- *** empty log message ***
-
-1998-09-03 stanton
- * CHANGES:
- * README:
- more changes
-
- * CHANGES:
- * Makefile.in:
- changes
-
- * Makefile.in:
- * Makefile.in:
- * Makefile.in:
- * Makefile.in:
- * Makefile.in:
- * Makefile.in:
- * Makefile.in:
- *** empty log message ***
-
- * Makefile.in:
- nothing
-
- * CHANGES:
- * Makefile.in:
- changed back
-
-1998-08-23 stanton
- * itcl/doc/scope.n:
- fixed section
-
-1998-08-20 welch
- * itcl/generic/itcl.h:
- Patchlevel 3.0.1
-
-1998-08-18 welch
- * itk/win/pkgIndex.tcl:
- Fixed loading .dll
-
- * itcl/win/pkgIndex.tcl:
- fixed loading .dll
-
- * CHANGES:
- *** empty log message ***
-
-1998-08-18 suresh
- * itk/generic/itk_cmds.c:
- Removed pedantic check for existance of "::itk" namespace. Changed code to
- conditionally create the "::itk" namespace based on whether it already exists
- or not. These changes were necessary to facilitate the wrapper dictating
- where the [incr Tk] libraries are stored in a wrapped application via the
- variable '::itk::library".
-
-1998-08-12 welch
- * itk/win/makefile.bc:
- * itk/win/makefile.vc:
- Fixes for tkConsole
-
-1998-08-11 welch
- * CHANGES:
- * README:
- * itcl/doc/class.n:
- * itcl/doc/scope.n:
- * itcl/generic/itcl.h:
- * itcl/generic/itclInt.h:
- * itcl/generic/itcl_bicmds.c:
- * itcl/generic/itcl_class.c:
- * itcl/generic/itcl_cmds.c:
- * itcl/generic/itcl_methods.c:
- * itcl/generic/itcl_objects.c:
- * itcl/library/itcl.tcl:
- * itcl/mac/itclMacApplication.r:
- * itcl/mac/itclMacLibrary.r:
- * itcl/mac/itclMacResource.r:
- * itcl/mac/pkgIndex.tcl:
- * itcl/mac/tclMacAppInit.c:
- * itcl/tests/info.test:
- * itcl/unix/Makefile.in:
- * itcl/unix/configure.in:
- * itcl/unix/tclAppInit.c:
- * itcl/win/itcl.rc:
- * itcl/win/itclsh.rc:
- * itcl/win/makefile.vc:
- * itcl/win/pkgIndex.tcl:
- * itcl/win/tclAppInit.c:
- * itk/doc/Toplevel.n:
- * itk/generic/itk.h:
- * itk/generic/itk_cmds.c:
- * itk/mac/MW_ItkHeader.pch:
- * itk/mac/itkMacApplication.r:
- * itk/mac/itkMacLibrary.r:
- * itk/mac/itkMacResource.r:
- * itk/mac/pkgIndex.tcl:
- * itk/mac/tclIndex:
- * itk/mac/tkMacAppInit.c:
- * itk/unix/Makefile.in:
- * itk/unix/configure.in:
- * itk/unix/tkAppInit.c:
- * itk/win/makefile.vc:
- * itk/win/pkgIndex.tcl:
- * itk/win/rc/itk.rc:
- * itk/win/rc/itkwish.rc:
- * itk/win/winMain.c:
- * makefile.vc:
- 3.0 final from Michael
-
-1998-08-07 stanton
- * itcl/generic/itcl_methods.c:
- changed to reflect new CompiledLocal structure
- changed to reflect changes in resolver api
- changed to use TclInitCompiledLocals interface
-
- * itcl/generic/itclInt.h:
- changed to reflect new resolver api
-
- * itcl/generic/itcl_bicmds.c:
- * itcl/generic/itcl_ensemble.c:
- changed to reflect new CompiledLocal structure
-
- * itcl/generic/itcl_class.c:
- changed to reflect changes in resolver api
-
- * itcl/doc/scope.n:
- fixed section name
-
- * itcl/doc/scope.n:
- *** empty log message ***
-
- * itcl/generic/itcl_cmds.c:
- * itcl/generic/itcl_util.c:
- * itk/doc/Toplevel.n:
- lint
-
-1998-08-04 escoffon
- * itcl/generic/itcl.h:
- * itcl/generic/itclInt.h:
- * itk/generic/itk.h:
- EXPORT is now TCL_STORAGE_CLASS
-
-1998-07-29 escoffon
- * itcl/generic/itcl.h:
- added setting of EXPORT to DLLEXPORT if we are building the
- itcl lib.
-
- * itk/generic/itk.h:
- - dropped the EXPORT macro, it is now part of EXTERN
- - added setting of EXPORT to DLLEXPORT if we are building the itk lib.
-
- * itcl/generic/itclInt.h:
- - added setting of EXPORT to DLLEXPORT if we are building the itcl lib.
- - use EXTERN instead of extern for Itcl_Assert
-
-1998-07-28 stanton
- * itcl/generic/itcl_cmds.c:
- * itk/generic/itk_cmds.c:
- changed search order
-
diff --git a/itcl/itk/configure b/itcl/itk/configure
deleted file mode 100755
index 7a9c8c91f62..00000000000
--- a/itcl/itk/configure
+++ /dev/null
@@ -1,11928 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for itk 3.3.
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-if test "x$CONFIG_SHELL" = x; then
- if (eval ":") 2>/dev/null; then
- as_have_required=yes
-else
- as_have_required=no
-fi
-
- if test $as_have_required = yes && (eval ":
-(as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=\$LINENO
- as_lineno_2=\$LINENO
- test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
- test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
- :
-else
- as_candidate_shells=
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- case $as_dir in
- /*)
- for as_base in sh bash ksh sh5; do
- as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
- done;;
- esac
-done
-IFS=$as_save_IFS
-
-
- for as_shell in $as_candidate_shells $SHELL; do
- # Try only shells that exist, to save several forks.
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-_ASEOF
-}; then
- CONFIG_SHELL=$as_shell
- as_have_required=yes
- if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-(as_func_return () {
- (exit $1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
- break
-fi
-
-fi
-
- done
-
- if test "x$CONFIG_SHELL" != x; then
- for as_var in BASH_ENV ENV
- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- done
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
- if test $as_have_required = no; then
- echo This script requires a shell more modern than all the
- echo shells that I found on your system. Please install a
- echo modern shell, or manually run the script under such a
- echo shell if you do have one.
- { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
- echo No shell found that supports shell functions.
- echo Please tell autoconf@gnu.org about your system,
- echo including any error possibly output before this
- echo message
-}
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-
-exec 7<&0 </dev/null 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Identity of this package.
-PACKAGE_NAME='itk'
-PACKAGE_TARNAME='itk'
-PACKAGE_VERSION='3.3'
-PACKAGE_STRING='itk 3.3'
-PACKAGE_BUGREPORT=''
-
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-CYGPATH
-EXEEXT
-PKG_LIB_FILE
-PKG_STUB_LIB_FILE
-PKG_STUB_SOURCES
-PKG_STUB_OBJECTS
-PKG_TCL_SOURCES
-PKG_HEADERS
-PKG_INCLUDES
-PKG_LIBS
-PKG_CFLAGS
-LN_S
-CONFIG_CLEAN_FILES
-TCL_VERSION
-TCL_BIN_DIR
-TCL_SRC_DIR
-TCL_LIB_FILE
-TCL_LIB_FLAG
-TCL_LIB_SPEC
-TCL_STUB_LIB_FILE
-TCL_STUB_LIB_FLAG
-TCL_STUB_LIB_SPEC
-TCL_LIBS
-TCL_DEFS
-TCL_EXTRA_CFLAGS
-TCL_LD_FLAGS
-TCL_SHLIB_LD_LIBS
-TK_VERSION
-TK_BIN_DIR
-TK_SRC_DIR
-TK_LIB_FILE
-TK_LIB_FLAG
-TK_LIB_SPEC
-TK_STUB_LIB_FILE
-TK_STUB_LIB_FLAG
-TK_STUB_LIB_SPEC
-TK_LIBS
-TK_XINCLUDES
-itcl_VERSION
-itcl_BIN_DIR
-itcl_SRC_DIR
-itcl_LIB_FILE
-itcl_LIB_SPEC
-itcl_STUB_LIB_FILE
-itcl_STUB_LIB_SPEC
-itcl_STUB_LIB_PATH
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-OBJEXT
-CPP
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-SET_MAKE
-RANLIB
-GREP
-EGREP
-MATH_LIBS
-PKG_SOURCES
-PKG_OBJECTS
-CLEANFILES
-TCL_TOP_DIR_NATIVE
-TCL_GENERIC_DIR_NATIVE
-TCL_UNIX_DIR_NATIVE
-TCL_WIN_DIR_NATIVE
-TCL_BMAP_DIR_NATIVE
-TCL_TOOL_DIR_NATIVE
-TCL_PLATFORM_DIR_NATIVE
-TCL_INCLUDES
-TK_TOP_DIR_NATIVE
-TK_UNIX_DIR_NATIVE
-TK_WIN_DIR_NATIVE
-TK_GENERIC_DIR_NATIVE
-TK_XLIB_DIR_NATIVE
-TK_PLATFORM_DIR_NATIVE
-TK_INCLUDES
-XMKMF
-SHARED_BUILD
-AR
-TCLSH_PROG
-CELIB_DIR
-LIBOBJS
-DL_LIBS
-CFLAGS_DEBUG
-CFLAGS_OPTIMIZE
-CFLAGS_WARNING
-STLIB_LD
-SHLIB_LD
-SHLIB_CFLAGS
-SHLIB_LD_LIBS
-LDFLAGS_DEBUG
-LDFLAGS_OPTIMIZE
-LD_LIBRARY_PATH_VAR
-TCL_DBGX
-CFLAGS_DEFAULT
-LDFLAGS_DEFAULT
-MAKE_LIB
-MAKE_SHARED_LIB
-MAKE_STATIC_LIB
-MAKE_STUB_LIB
-RANLIB_STUB
-itk_STUB_LIB_FILE
-itk_LIB_FILE
-WISH_PROG
-itk_BUILD_LIB_SPEC
-itk_LIB_SPEC
-itk_BUILD_STUB_LIB_SPEC
-itk_STUB_LIB_SPEC
-itk_BUILD_STUB_LIB_PATH
-itk_STUB_LIB_PATH
-itk_SRC_DIR
-LTLIBOBJS'
-ac_subst_files=''
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP
-XMKMF'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute directory names.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; }
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
- { (exit 1); exit 1; }; }
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
- { (exit 1); exit 1; }; }
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
- { (exit 1); exit 1; }; }
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures itk 3.3 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/itk]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-X features:
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of itk 3.3:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-shared build and link with shared libraries --enable-shared
- --enable-64bit enable 64bit support (where applicable)
- --enable-64bit-vis enable 64bit Sparc VIS support
- --enable-wince enable Win/CE support (where applicable)
- --disable-load disallow dynamic loading and "load" command
- --enable-symbols build with debugging symbols --disable-symbols
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-tcl directory containing tcl configuration (tclConfig.sh)
- --with-tk directory containing tk configuration (tkConfig.sh)
- --with-itcl directory containing itcl configuration (itclConfig.sh)
- --with-x use the X Window System
- --with-celib=DIR use Windows/CE support library from DIR
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CPP C preprocessor
- XMKMF Path to xmkmf, Makefile generator for X Window System
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-itk configure 3.3
-generated by GNU Autoconf 2.61
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by itk $as_me 3.3, which was
-generated by GNU Autoconf 2.61. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args '$ac_arg'"
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------------- ##
-## File substitutions. ##
-## ------------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
-elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
-else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
-fi
-shift
-for ac_site_file
-do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-#--------------------------------------------------------------------
-# Call TEA_INIT as the first TEA_ macro to set up initial vars.
-# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
-# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
-#--------------------------------------------------------------------
-
-
- # TEA extensions pass this us the version of TEA they think they
- # are compatible with.
- TEA_VERSION="3.2"
-
- { echo "$as_me:$LINENO: checking for correct TEA configuration" >&5
-echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6; }
- if test x"${PACKAGE_NAME}" = x ; then
- { { echo "$as_me:$LINENO: error:
-The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5
-echo "$as_me: error:
-The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;}
- { (exit 1); exit 1; }; }
- fi
- if test x"3.2" = x ; then
- { { echo "$as_me:$LINENO: error:
-TEA version not specified." >&5
-echo "$as_me: error:
-TEA version not specified." >&2;}
- { (exit 1); exit 1; }; }
- elif test "3.2" != "${TEA_VERSION}" ; then
- { echo "$as_me:$LINENO: result: warning: requested TEA version \"3.2\", have \"${TEA_VERSION}\"" >&5
-echo "${ECHO_T}warning: requested TEA version \"3.2\", have \"${TEA_VERSION}\"" >&6; }
- else
- { echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5
-echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6; }
- fi
- case "`uname -s`" in
- *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*)
- # Extract the first word of "cygpath", so it can be a program name with args.
-set dummy cygpath; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CYGPATH+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CYGPATH"; then
- ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CYGPATH="cygpath -w"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo"
-fi
-fi
-CYGPATH=$ac_cv_prog_CYGPATH
-if test -n "$CYGPATH"; then
- { echo "$as_me:$LINENO: result: $CYGPATH" >&5
-echo "${ECHO_T}$CYGPATH" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- EXEEXT=".exe"
- TEA_PLATFORM="windows"
- ;;
- *)
- CYGPATH=echo
- EXEEXT=""
- TEA_PLATFORM="unix"
- ;;
- esac
-
- # Check if exec_prefix is set. If not use fall back to prefix.
- # Note when adjusted, so that TEA_PREFIX can correct for this.
- # This is needed for recursive configures, since autoconf propagates
- # $prefix, but not $exec_prefix (doh!).
- if test x$exec_prefix = xNONE ; then
- exec_prefix_default=yes
- exec_prefix=$prefix
- fi
-
-
-
-
- # This package name must be replaced statically for AC_SUBST to work
-
- # Substitute STUB_LIB_FILE in case package creates a stub library too.
-
-
- # We AC_SUBST these here to ensure they are subst'ed,
- # in case the user doesn't call TEA_ADD_...
-
-
-
-
-
-
-
-
-
-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
- { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6; }
-fi
-
-CONFIG_CLEAN_FILES=
-if test ! -d $srcdir/tclconfig ; then
- if test -d $srcdir/../tclconfig ; then
- $LN_S $srcdir/../tclconfig tclconfig
- CONFIG_CLEAN_FILES=tclconfig
- fi
-fi
-
-
-ac_aux_dir=
-for ac_dir in tclconfig "$srcdir"/tclconfig; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in tclconfig \"$srcdir\"/tclconfig" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in tclconfig \"$srcdir\"/tclconfig" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-
-#--------------------------------------------------------------------
-# Load the tclConfig.sh file
-#--------------------------------------------------------------------
-
-
-
- #
- # Ok, lets find the tcl configuration
- # First, look for one uninstalled.
- # the alternative search directory is invoked by --with-tcl
- #
-
- if test x"${no_tcl}" = x ; then
- # we reset no_tcl in case something fails here
- no_tcl=true
-
-# Check whether --with-tcl was given.
-if test "${with_tcl+set}" = set; then
- withval=$with_tcl; with_tclconfig=${withval}
-fi
-
- { echo "$as_me:$LINENO: checking for Tcl configuration" >&5
-echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6; }
- if test "${ac_cv_c_tclconfig+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
- # For platform-specific directories
- case $TEA_PLATFORM in
- windows) platform="win" ;;
- unix) platform="unix" ;;
- *) { { echo "$as_me:$LINENO: error: unknown TEA_PLATFORM: \"$TEA_PLATFORM\"" >&5
-echo "$as_me: error: unknown TEA_PLATFORM: \"$TEA_PLATFORM\"" >&2;}
- { (exit 1); exit 1; }; }
- esac
-
- # First check to see if --with-tcl was specified.
- if test x"${with_tclconfig}" != x ; then
- case ${with_tclconfig} in
- */tclConfig.sh )
- if test -f ${with_tclconfig}; then
- { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5
-echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;}
- with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'`
- fi ;;
- esac
- if test -f "${with_tclconfig}/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
- else
- { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5
-echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-
- # then check for a private Tcl installation
- if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in \
- ../tcl \
- `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \
- ../../tcl \
- `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \
- ../../../tcl \
- `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do
- if test -f "$i/$platform/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/$platform; pwd)`
- break
- fi
- done
- fi
-
- # check in a few common install locations
- if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \
- `ls -d ${prefix}/lib 2>/dev/null` \
- `ls -d /usr/local/lib 2>/dev/null` \
- `ls -d /usr/contrib/lib 2>/dev/null` \
- `ls -d /usr/lib 2>/dev/null` \
- ; do
- if test -f "$i/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i; pwd)`
- break
- fi
- done
- fi
-
- # check in a few other private locations
- if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in \
- ${srcdir}/../tcl \
- `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \
- `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do
-
- if test -f "$i/$platform/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/$platform; pwd)`
- break
- fi
- done
- fi
-
-fi
-
-
- if test x"${ac_cv_c_tclconfig}" = x ; then
- TCL_BIN_DIR="# no Tcl configs found"
- { echo "$as_me:$LINENO: WARNING: \"Cannot find Tcl configuration definitions\"" >&5
-echo "$as_me: WARNING: \"Cannot find Tcl configuration definitions\"" >&2;}
- exit 0
- else
- no_tcl=
- TCL_BIN_DIR=${ac_cv_c_tclconfig}
- { echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5
-echo "${ECHO_T}found $TCL_BIN_DIR/tclConfig.sh" >&6; }
- fi
- fi
-
-
- { echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
-echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6; }
-
- if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
- { echo "$as_me:$LINENO: result: loading" >&5
-echo "${ECHO_T}loading" >&6; }
- . $TCL_BIN_DIR/tclConfig.sh
- else
- { echo "$as_me:$LINENO: result: file not found" >&5
-echo "${ECHO_T}file not found" >&6; }
- fi
-
- #
- # If the TCL_BIN_DIR is the build directory (not the install directory),
- # then set the common variable name to the value of the build variables.
- # For example, the variable TCL_LIB_SPEC will be set to the value
- # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
- # instead of TCL_BUILD_LIB_SPEC since it will work with both an
- # installed and uninstalled version of Tcl.
- #
-
- if test -f $TCL_BIN_DIR/Makefile ; then
- TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
- TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
- TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
- fi
-
- #
- # eval is required to do the TCL_DBGX substitution
- #
-
- eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
- eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
- eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
-
- eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
- eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
- eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #AC_SUBST(TCL_BUILD_LIB_SPEC)
- #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
-
-
-#--------------------------------------------------------------------
-# Load the tkConfig.sh file
-#--------------------------------------------------------------------
-
-
- #
- # Ok, lets find the tk configuration
- # First, look for one uninstalled.
- # the alternative search directory is invoked by --with-tk
- #
-
- if test x"${no_tk}" = x ; then
- # we reset no_tk in case something fails here
- no_tk=true
-
-# Check whether --with-tk was given.
-if test "${with_tk+set}" = set; then
- withval=$with_tk; with_tkconfig=${withval}
-fi
-
- { echo "$as_me:$LINENO: checking for Tk configuration" >&5
-echo $ECHO_N "checking for Tk configuration... $ECHO_C" >&6; }
- if test "${ac_cv_c_tkconfig+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
- # For platform-specific directories
- case $TEA_PLATFORM in
- windows) platform="win" ;;
- unix) platform="unix" ;;
- *) { { echo "$as_me:$LINENO: error: unknown TEA_PLATFORM: \"$TEA_PLATFORM\"" >&5
-echo "$as_me: error: unknown TEA_PLATFORM: \"$TEA_PLATFORM\"" >&2;}
- { (exit 1); exit 1; }; }
- esac
-
- # First check to see if --with-tkconfig was specified.
- if test x"${with_tkconfig}" != x ; then
- case ${with_tkconfig} in
- */tkConfig.sh )
- if test -f ${with_tkconfig}; then
- { echo "$as_me:$LINENO: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5
-echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;}
- with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'`
- fi ;;
- esac
- if test -f "${with_tkconfig}/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
- else
- { { echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5
-echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-
- # then check for a private Tk library
- if test x"${ac_cv_c_tkconfig}" = x ; then
- for i in \
- ../tk \
- `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \
- ../../tk \
- `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \
- ../../../tk \
- `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do
- if test -f "$i/$platform/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i/$platform; pwd)`
- break
- fi
- done
- fi
- # check in a few common install locations
- if test x"${ac_cv_c_tkconfig}" = x ; then
- for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \
- `ls -d ${prefix}/lib 2>/dev/null` \
- `ls -d /usr/local/lib 2>/dev/null` \
- `ls -d /usr/contrib/lib 2>/dev/null` \
- `ls -d /usr/lib 2>/dev/null` \
- ; do
- if test -f "$i/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i; pwd)`
- break
- fi
- done
- fi
- # check in a few other private locations
- if test x"${ac_cv_c_tkconfig}" = x ; then
- for i in \
- ${srcdir}/../tk \
- `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \
- `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do
- if test -f "$i/$platform/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i/$platform; pwd)`
- break
- fi
- done
- fi
-
-fi
-
- if test x"${ac_cv_c_tkconfig}" = x ; then
- TK_BIN_DIR="# no Tk configs found"
- { echo "$as_me:$LINENO: WARNING: \"Cannot find Tk configuration definitions\"" >&5
-echo "$as_me: WARNING: \"Cannot find Tk configuration definitions\"" >&2;}
- exit 0
- else
- no_tk=
- TK_BIN_DIR=${ac_cv_c_tkconfig}
- { echo "$as_me:$LINENO: result: found $TK_BIN_DIR/tkConfig.sh" >&5
-echo "${ECHO_T}found $TK_BIN_DIR/tkConfig.sh" >&6; }
- fi
- fi
-
-
-
- { echo "$as_me:$LINENO: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5
-echo $ECHO_N "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... $ECHO_C" >&6; }
-
- if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
- { echo "$as_me:$LINENO: result: loading" >&5
-echo "${ECHO_T}loading" >&6; }
- . $TK_BIN_DIR/tkConfig.sh
- else
- { echo "$as_me:$LINENO: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5
-echo "${ECHO_T}could not find ${TK_BIN_DIR}/tkConfig.sh" >&6; }
- fi
-
- #
- # If the TK_BIN_DIR is the build directory (not the install directory),
- # then set the common variable name to the value of the build variables.
- # For example, the variable TK_LIB_SPEC will be set to the value
- # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
- # instead of TK_BUILD_LIB_SPEC since it will work with both an
- # installed and uninstalled version of Tcl.
- #
-
- if test -f $TK_BIN_DIR/Makefile ; then
- TK_LIB_SPEC=${TK_BUILD_LIB_SPEC}
- TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC}
- TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH}
- fi
-
- #
- # eval is required to do the TK_DBGX substitution
- #
-
- eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
- eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
- eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
-
- eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
- eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
- eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #
- # Ok, lets find the itcl configuration
- # First, look for one uninstalled.
- # the alternative search directory is invoked by --with-itcl
- #
-
- if test x"${no_itcl}" = x ; then
- # we reset no_itcl in case something fails here
- no_itcl=true
-
-# Check whether --with-itcl was given.
-if test "${with_itcl+set}" = set; then
- withval=$with_itcl; with_itclconfig=${withval}
-fi
-
- { echo "$as_me:$LINENO: checking for itcl configuration" >&5
-echo $ECHO_N "checking for itcl configuration... $ECHO_C" >&6; }
- if test "${ac_cv_c_itclconfig+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
- # First check to see if --with-itcl was specified.
- if test x"${with_itclconfig}" != x ; then
- case ${with_itclconfig} in
- */itclConfig.sh )
- if test -f ${with_itclconfig}; then
- { echo "$as_me:$LINENO: WARNING: --with-itcl argument should refer to directory containing itclConfig.sh, not to itclConfig.sh itself" >&5
-echo "$as_me: WARNING: --with-itcl argument should refer to directory containing itclConfig.sh, not to itclConfig.sh itself" >&2;}
- with_itclconfig=`echo ${with_itclconfig} | sed 's!/itclConfig\.sh$!!'`
- fi;;
- esac
- if test -f "${with_itclconfig}/itclConfig.sh" ; then
- ac_cv_c_itclconfig=`(cd ${with_itclconfig}; pwd)`
- else
- { { echo "$as_me:$LINENO: error: ${with_itclconfig} directory doesn't contain itclConfig.sh" >&5
-echo "$as_me: error: ${with_itclconfig} directory doesn't contain itclConfig.sh" >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-
- # then check for a private itcl installation
- if test x"${ac_cv_c_itclconfig}" = x ; then
- for i in \
- ../itcl \
- `ls -dr ../itcl*[0-9].[0-9]*.[0-9]* 2>/dev/null` \
- `ls -dr ../itcl*[0-9].[0-9][0-9] 2>/dev/null` \
- `ls -dr ../itcl*[0-9].[0-9] 2>/dev/null` \
- `ls -dr ../itcl*[0-9].[0-9]* 2>/dev/null` \
- ../../itcl \
- `ls -dr ../../itcl*[0-9].[0-9]*.[0-9]* 2>/dev/null` \
- `ls -dr ../../itcl*[0-9].[0-9][0-9] 2>/dev/null` \
- `ls -dr ../../itcl*[0-9].[0-9] 2>/dev/null` \
- `ls -dr ../../itcl*[0-9].[0-9]* 2>/dev/null` \
- ../../../itcl \
- `ls -dr ../../../itcl*[0-9].[0-9]*.[0-9]* 2>/dev/null` \
- `ls -dr ../../../itcl*[0-9].[0-9][0-9] 2>/dev/null` \
- `ls -dr ../../../itcl*[0-9].[0-9] 2>/dev/null` \
- `ls -dr ../../../itcl*[0-9].[0-9]* 2>/dev/null` \
- ${srcdir}/../itcl \
- `ls -dr ${srcdir}/../itcl*[0-9].[0-9]*.[0-9]* 2>/dev/null` \
- `ls -dr ${srcdir}/../itcl*[0-9].[0-9][0-9] 2>/dev/null` \
- `ls -dr ${srcdir}/../itcl*[0-9].[0-9] 2>/dev/null` \
- `ls -dr ${srcdir}/../itcl*[0-9].[0-9]* 2>/dev/null` \
- ; do
- if test -f "$i/itclConfig.sh" ; then
- ac_cv_c_itclconfig=`(cd $i; pwd)`
- break
- fi
- if test -f "$i/unix/itclConfig.sh" ; then
- ac_cv_c_itclconfig=`(cd $i/unix; pwd)`
- break
- fi
- done
- fi
-
- # check in a few common install locations
- if test x"${ac_cv_c_itclconfig}" = x ; then
- for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \
- `ls -d ${prefix}/lib 2>/dev/null` \
- `ls -d /usr/local/lib 2>/dev/null` \
- `ls -d /usr/contrib/lib 2>/dev/null` \
- `ls -d /usr/lib 2>/dev/null` \
- ; do
- if test -f "$i/itclConfig.sh" ; then
- ac_cv_c_itclconfig=`(cd $i; pwd)`
- break
- fi
- done
- fi
-
-fi
-
-
- if test x"${ac_cv_c_itclconfig}" = x ; then
- itcl_BIN_DIR="# no itcl configs found"
- { echo "$as_me:$LINENO: WARNING: \"Cannot find itcl configuration definitions\"" >&5
-echo "$as_me: WARNING: \"Cannot find itcl configuration definitions\"" >&2;}
- exit 0
- else
- no_itcl=
- itcl_BIN_DIR=${ac_cv_c_itclconfig}
- { echo "$as_me:$LINENO: result: found $itcl_BIN_DIR/itclConfig.sh" >&5
-echo "${ECHO_T}found $itcl_BIN_DIR/itclConfig.sh" >&6; }
- fi
- fi
-
-
- { echo "$as_me:$LINENO: checking for existence of ${itcl_BIN_DIR}/itclConfig.sh" >&5
-echo $ECHO_N "checking for existence of ${itcl_BIN_DIR}/itclConfig.sh... $ECHO_C" >&6; }
-
- if test -f "${itcl_BIN_DIR}/itclConfig.sh" ; then
- { echo "$as_me:$LINENO: result: loading" >&5
-echo "${ECHO_T}loading" >&6; }
- . ${itcl_BIN_DIR}/itclConfig.sh
- else
- { echo "$as_me:$LINENO: result: file not found" >&5
-echo "${ECHO_T}file not found" >&6; }
- fi
-
- #
- # If the itcl_BIN_DIR is the build directory (not the install directory),
- # then set the common variable name to the value of the build variables.
- # For example, the variable itcl_LIB_SPEC will be set to the value
- # of itcl_BUILD_LIB_SPEC. An extension should make use of itcl_LIB_SPEC
- # instead of itcl_BUILD_LIB_SPEC since it will work with both an
- # installed and uninstalled version of Tcl.
- #
-
- if test -f ${itcl_BIN_DIR}/Makefile ; then
- { echo "$as_me:$LINENO: WARNING: Found Makefile - using build library specs for itcl" >&5
-echo "$as_me: WARNING: Found Makefile - using build library specs for itcl" >&2;}
- itcl_LIB_SPEC=${itcl_BUILD_LIB_SPEC}
- itcl_STUB_LIB_SPEC=${itcl_BUILD_STUB_LIB_SPEC}
- itcl_STUB_LIB_PATH=${itcl_BUILD_STUB_LIB_PATH}
- fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-ITCL_INCLUDES="-I\"`${CYGPATH} ${itcl_SRC_DIR}/generic`\""
-
-#--------------------------------------------------------------------
-# Handle the --prefix=... option by defaulting to what Tcl gave.
-# Must be called after TEA_LOAD_TCLCONFIG and before $prefix is used.
-#--------------------------------------------------------------------
-
-
- if test "${prefix}" = "NONE"; then
- prefix_default=yes
- if test x"${TCL_PREFIX}" != x; then
- { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5
-echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;}
- prefix=${TCL_PREFIX}
- else
- { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5
-echo "$as_me: --prefix defaulting to /usr/local" >&6;}
- prefix=/usr/local
- fi
- fi
- if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
- -o x"${exec_prefix_default}" = x"yes" ; then
- if test x"${TCL_EXEC_PREFIX}" != x; then
- { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5
-echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;}
- exec_prefix=${TCL_EXEC_PREFIX}
- else
- { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5
-echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;}
- exec_prefix=$prefix
- fi
- fi
-
-
-#------------------------------------------------------------------------
-# Standard compiler checks.
-# This sets up CC by using the CC env var, or looks for gcc otherwise.
-# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
-# the basic setup necessary to compile executables.
-#------------------------------------------------------------------------
-
-
- # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
- # in this macro, they need to go into TEA_SETUP_COMPILER instead.
-
- # If the user did not set CFLAGS, set it now to keep
- # the AC_PROG_CC macro from adding "-g -O2".
- if test "${CFLAGS+set}" != "set" ; then
- CFLAGS=""
- fi
-
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { (ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- ac_file=''
-fi
-
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-if test -z "$ac_file"; then
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_c89=$ac_arg
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
- xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
- # Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-IFS=$as_save_IFS
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
- #--------------------------------------------------------------------
- # Checks to see if the make program sets the $MAKE variable.
- #--------------------------------------------------------------------
-
- { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- SET_MAKE=
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-
- #--------------------------------------------------------------------
- # Find ranlib
- #--------------------------------------------------------------------
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-
- #--------------------------------------------------------------------
- # Determines the correct binary file extension (.o, .obj, .exe etc.)
- #--------------------------------------------------------------------
-
-
-
-
-
-
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
- # Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_GREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_GREP=$GREP
-fi
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
- # Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_EGREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
-fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
-
- fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_header_stdc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_stdc=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
- # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
-
-
- #------------------------------------------------------------------------
- # If we're using GCC, see if the compiler understands -pipe. If so, use it.
- # It makes compiling go faster. (This is only a performance feature.)
- #------------------------------------------------------------------------
-
- if test -z "$no_pipe" -a -n "$GCC"; then
- { echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5
-echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6; }
- OLDCC="$CC"
- CC="$CC -pipe"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CC="$OLDCC"
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
-
- #--------------------------------------------------------------------
- # Common compiler flag setup
- #--------------------------------------------------------------------
-
- { echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # See if sys/param.h defines the BYTE_ORDER macro.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/param.h>
-
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
- && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
- bogus endian macros
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- # It does; now see whether it defined to BIG_ENDIAN or not.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_c_bigendian=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_c_bigendian=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # It does not; compile a test program.
-if test "$cross_compiling" = yes; then
- # try to guess the endianness by grepping values into an object file
- ac_cv_c_bigendian=unknown
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
-int
-main ()
-{
- _ascii (); _ebcdic ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
- ac_cv_c_bigendian=yes
-fi
-if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_c_bigendian=no
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
-case $ac_cv_c_bigendian in
- yes)
-
-cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 1
-_ACEOF
- ;;
- no)
- ;;
- *)
- { { echo "$as_me:$LINENO: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-echo "$as_me: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
- { (exit 1); exit 1; }; } ;;
-esac
-
- if test "${TEA_PLATFORM}" = "unix" ; then
-
- #--------------------------------------------------------------------
- # On a few very rare systems, all of the libm.a stuff is
- # already in libc.a. Set compiler flags accordingly.
- # Also, Linux requires the "ieee" library for math to work
- # right (and it must appear before "-lm").
- #--------------------------------------------------------------------
-
- { echo "$as_me:$LINENO: checking for sin" >&5
-echo $ECHO_N "checking for sin... $ECHO_C" >&6; }
-if test "${ac_cv_func_sin+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define sin to an innocuous variant, in case <limits.h> declares sin.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define sin innocuous_sin
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char sin (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef sin
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char sin ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_sin || defined __stub___sin
-choke me
-#endif
-
-int
-main ()
-{
-return sin ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_sin=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_sin=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5
-echo "${ECHO_T}$ac_cv_func_sin" >&6; }
-if test $ac_cv_func_sin = yes; then
- MATH_LIBS=""
-else
- MATH_LIBS="-lm"
-fi
-
- { echo "$as_me:$LINENO: checking for main in -lieee" >&5
-echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6; }
-if test "${ac_cv_lib_ieee_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lieee $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-return main ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_ieee_main=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_ieee_main=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5
-echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6; }
-if test $ac_cv_lib_ieee_main = yes; then
- MATH_LIBS="-lieee $MATH_LIBS"
-fi
-
-
- #--------------------------------------------------------------------
- # Interactive UNIX requires -linet instead of -lsocket, plus it
- # needs net/errno.h to define the socket-related error codes.
- #--------------------------------------------------------------------
-
- { echo "$as_me:$LINENO: checking for main in -linet" >&5
-echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6; }
-if test "${ac_cv_lib_inet_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-linet $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-return main ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_inet_main=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_inet_main=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5
-echo "${ECHO_T}$ac_cv_lib_inet_main" >&6; }
-if test $ac_cv_lib_inet_main = yes; then
- LIBS="$LIBS -linet"
-fi
-
- if test "${ac_cv_header_net_errno_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for net/errno.h" >&5
-echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_net_errno_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5
-echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking net/errno.h usability" >&5
-echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <net/errno.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking net/errno.h presence" >&5
-echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <net/errno.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for net/errno.h" >&5
-echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_net_errno_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_net_errno_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5
-echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6; }
-
-fi
-if test $ac_cv_header_net_errno_h = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_NET_ERRNO_H 1
-_ACEOF
-
-fi
-
-
-
- #--------------------------------------------------------------------
- # Check for the existence of the -lsocket and -lnsl libraries.
- # The order here is important, so that they end up in the right
- # order in the command line generated by make. Here are some
- # special considerations:
- # 1. Use "connect" and "accept" to check for -lsocket, and
- # "gethostbyname" to check for -lnsl.
- # 2. Use each function name only once: can't redo a check because
- # autoconf caches the results of the last check and won't redo it.
- # 3. Use -lnsl and -lsocket only if they supply procedures that
- # aren't already present in the normal libraries. This is because
- # IRIX 5.2 has libraries, but they aren't needed and they're
- # bogus: they goof up name resolution if used.
- # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
- # To get around this problem, check for both libraries together
- # if -lsocket doesn't work by itself.
- #--------------------------------------------------------------------
-
- tcl_checkBoth=0
- { echo "$as_me:$LINENO: checking for connect" >&5
-echo $ECHO_N "checking for connect... $ECHO_C" >&6; }
-if test "${ac_cv_func_connect+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define connect to an innocuous variant, in case <limits.h> declares connect.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define connect innocuous_connect
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char connect (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef connect
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char connect ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_connect || defined __stub___connect
-choke me
-#endif
-
-int
-main ()
-{
-return connect ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_connect=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_connect=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
-echo "${ECHO_T}$ac_cv_func_connect" >&6; }
-if test $ac_cv_func_connect = yes; then
- tcl_checkSocket=0
-else
- tcl_checkSocket=1
-fi
-
- if test "$tcl_checkSocket" = 1; then
- { echo "$as_me:$LINENO: checking for setsockopt" >&5
-echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6; }
-if test "${ac_cv_func_setsockopt+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define setsockopt to an innocuous variant, in case <limits.h> declares setsockopt.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define setsockopt innocuous_setsockopt
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char setsockopt (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef setsockopt
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char setsockopt ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_setsockopt || defined __stub___setsockopt
-choke me
-#endif
-
-int
-main ()
-{
-return setsockopt ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_setsockopt=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_setsockopt=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5
-echo "${ECHO_T}$ac_cv_func_setsockopt" >&6; }
-if test $ac_cv_func_setsockopt = yes; then
- :
-else
- { echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5
-echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6; }
-if test "${ac_cv_lib_socket_setsockopt+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char setsockopt ();
-int
-main ()
-{
-return setsockopt ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_socket_setsockopt=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_socket_setsockopt=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6; }
-if test $ac_cv_lib_socket_setsockopt = yes; then
- LIBS="$LIBS -lsocket"
-else
- tcl_checkBoth=1
-fi
-
-fi
-
- fi
- if test "$tcl_checkBoth" = 1; then
- tk_oldLibs=$LIBS
- LIBS="$LIBS -lsocket -lnsl"
- { echo "$as_me:$LINENO: checking for accept" >&5
-echo $ECHO_N "checking for accept... $ECHO_C" >&6; }
-if test "${ac_cv_func_accept+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define accept to an innocuous variant, in case <limits.h> declares accept.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define accept innocuous_accept
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char accept (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef accept
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char accept ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_accept || defined __stub___accept
-choke me
-#endif
-
-int
-main ()
-{
-return accept ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_accept=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_accept=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5
-echo "${ECHO_T}$ac_cv_func_accept" >&6; }
-if test $ac_cv_func_accept = yes; then
- tcl_checkNsl=0
-else
- LIBS=$tk_oldLibs
-fi
-
- fi
- { echo "$as_me:$LINENO: checking for gethostbyname" >&5
-echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; }
-if test "${ac_cv_func_gethostbyname+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define gethostbyname innocuous_gethostbyname
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char gethostbyname (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef gethostbyname
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_gethostbyname || defined __stub___gethostbyname
-choke me
-#endif
-
-int
-main ()
-{
-return gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_gethostbyname=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_gethostbyname=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; }
-if test $ac_cv_func_gethostbyname = yes; then
- :
-else
- { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
-echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_nsl_gethostbyname=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_nsl_gethostbyname=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test $ac_cv_lib_nsl_gethostbyname = yes; then
- LIBS="$LIBS -lnsl"
-fi
-
-fi
-
-
- # Don't perform the eval of the libraries here because DL_LIBS
- # won't be set until we call TEA_CONFIG_CFLAGS
-
- TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
-
-
-
-
- { echo "$as_me:$LINENO: checking dirent.h" >&5
-echo $ECHO_N "checking dirent.h... $ECHO_C" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <dirent.h>
-int
-main ()
-{
-
-#ifndef _POSIX_SOURCE
-# ifdef __Lynx__
- /*
- * Generate compilation error to make the test fail: Lynx headers
- * are only valid if really in the POSIX environment.
- */
-
- missing_procedure();
-# endif
-#endif
-DIR *d;
-struct dirent *entryPtr;
-char *p;
-d = opendir("foobar");
-entryPtr = readdir(d);
-p = entryPtr->d_name;
-closedir(d);
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- tcl_ok=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- tcl_ok=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-
- if test $tcl_ok = no; then
- cat >>confdefs.h <<\_ACEOF
-#define NO_DIRENT_H 1
-_ACEOF
-
- fi
-
- { echo "$as_me:$LINENO: result: $tcl_ok" >&5
-echo "${ECHO_T}$tcl_ok" >&6; }
- if test "${ac_cv_header_errno_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for errno.h" >&5
-echo $ECHO_N "checking for errno.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_errno_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5
-echo "${ECHO_T}$ac_cv_header_errno_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking errno.h usability" >&5
-echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <errno.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking errno.h presence" >&5
-echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <errno.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for errno.h" >&5
-echo $ECHO_N "checking for errno.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_errno_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_errno_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5
-echo "${ECHO_T}$ac_cv_header_errno_h" >&6; }
-
-fi
-if test $ac_cv_header_errno_h = yes; then
- :
-else
- cat >>confdefs.h <<\_ACEOF
-#define NO_ERRNO_H 1
-_ACEOF
-
-fi
-
-
- if test "${ac_cv_header_float_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for float.h" >&5
-echo $ECHO_N "checking for float.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_float_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5
-echo "${ECHO_T}$ac_cv_header_float_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking float.h usability" >&5
-echo $ECHO_N "checking float.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <float.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking float.h presence" >&5
-echo $ECHO_N "checking float.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <float.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for float.h" >&5
-echo $ECHO_N "checking for float.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_float_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_float_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5
-echo "${ECHO_T}$ac_cv_header_float_h" >&6; }
-
-fi
-if test $ac_cv_header_float_h = yes; then
- :
-else
- cat >>confdefs.h <<\_ACEOF
-#define NO_FLOAT_H 1
-_ACEOF
-
-fi
-
-
- if test "${ac_cv_header_values_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for values.h" >&5
-echo $ECHO_N "checking for values.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_values_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5
-echo "${ECHO_T}$ac_cv_header_values_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking values.h usability" >&5
-echo $ECHO_N "checking values.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <values.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking values.h presence" >&5
-echo $ECHO_N "checking values.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <values.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for values.h" >&5
-echo $ECHO_N "checking for values.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_values_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_values_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5
-echo "${ECHO_T}$ac_cv_header_values_h" >&6; }
-
-fi
-if test $ac_cv_header_values_h = yes; then
- :
-else
- cat >>confdefs.h <<\_ACEOF
-#define NO_VALUES_H 1
-_ACEOF
-
-fi
-
-
- if test "${ac_cv_header_limits_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for limits.h" >&5
-echo $ECHO_N "checking for limits.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_limits_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5
-echo "${ECHO_T}$ac_cv_header_limits_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking limits.h usability" >&5
-echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <limits.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking limits.h presence" >&5
-echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <limits.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for limits.h" >&5
-echo $ECHO_N "checking for limits.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_limits_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_limits_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5
-echo "${ECHO_T}$ac_cv_header_limits_h" >&6; }
-
-fi
-if test $ac_cv_header_limits_h = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIMITS_H 1
-_ACEOF
-
-else
- cat >>confdefs.h <<\_ACEOF
-#define NO_LIMITS_H 1
-_ACEOF
-
-fi
-
-
- if test "${ac_cv_header_stdlib_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for stdlib.h" >&5
-echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdlib_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking stdlib.h usability" >&5
-echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <stdlib.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking stdlib.h presence" >&5
-echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for stdlib.h" >&5
-echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdlib_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_stdlib_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6; }
-
-fi
-if test $ac_cv_header_stdlib_h = yes; then
- tcl_ok=1
-else
- tcl_ok=0
-fi
-
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "strtol" >/dev/null 2>&1; then
- :
-else
- tcl_ok=0
-fi
-rm -f conftest*
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "strtoul" >/dev/null 2>&1; then
- :
-else
- tcl_ok=0
-fi
-rm -f conftest*
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "strtod" >/dev/null 2>&1; then
- :
-else
- tcl_ok=0
-fi
-rm -f conftest*
-
- if test $tcl_ok = 0; then
- cat >>confdefs.h <<\_ACEOF
-#define NO_STDLIB_H 1
-_ACEOF
-
- fi
- if test "${ac_cv_header_string_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for string.h" >&5
-echo $ECHO_N "checking for string.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_string_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5
-echo "${ECHO_T}$ac_cv_header_string_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking string.h usability" >&5
-echo $ECHO_N "checking string.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <string.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking string.h presence" >&5
-echo $ECHO_N "checking string.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for string.h" >&5
-echo $ECHO_N "checking for string.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_string_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_string_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5
-echo "${ECHO_T}$ac_cv_header_string_h" >&6; }
-
-fi
-if test $ac_cv_header_string_h = yes; then
- tcl_ok=1
-else
- tcl_ok=0
-fi
-
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "strstr" >/dev/null 2>&1; then
- :
-else
- tcl_ok=0
-fi
-rm -f conftest*
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "strerror" >/dev/null 2>&1; then
- :
-else
- tcl_ok=0
-fi
-rm -f conftest*
-
-
- # See also memmove check below for a place where NO_STRING_H can be
- # set and why.
-
- if test $tcl_ok = 0; then
- cat >>confdefs.h <<\_ACEOF
-#define NO_STRING_H 1
-_ACEOF
-
- fi
-
- if test "${ac_cv_header_sys_wait_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for sys/wait.h" >&5
-echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sys_wait_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking sys/wait.h usability" >&5
-echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <sys/wait.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking sys/wait.h presence" >&5
-echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/wait.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for sys/wait.h" >&5
-echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sys_wait_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_sys_wait_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
-
-fi
-if test $ac_cv_header_sys_wait_h = yes; then
- :
-else
- cat >>confdefs.h <<\_ACEOF
-#define NO_SYS_WAIT_H 1
-_ACEOF
-
-fi
-
-
- if test "${ac_cv_header_dlfcn_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for dlfcn.h" >&5
-echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dlfcn_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
-echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking dlfcn.h usability" >&5
-echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <dlfcn.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking dlfcn.h presence" >&5
-echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <dlfcn.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for dlfcn.h" >&5
-echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dlfcn_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_dlfcn_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
-echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; }
-
-fi
-if test $ac_cv_header_dlfcn_h = yes; then
- :
-else
- cat >>confdefs.h <<\_ACEOF
-#define NO_DLFCN_H 1
-_ACEOF
-
-fi
-
-
-
- # OS/390 lacks sys/param.h (and doesn't need it, by chance).
-
-for ac_header in sys/param.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
- # Let the user call this, because if it triggers, they will
- # need a compat/strtod.c that is correct. Users can also
- # use Tcl_GetDouble(FromObj) instead.
- #TEA_BUGGY_STRTOD
- fi
-
-
-#-----------------------------------------------------------------------
-# __CHANGE__
-# Specify the C source files to compile in TEA_ADD_SOURCES,
-# public headers that need to be installed in TEA_ADD_HEADERS,
-# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
-# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
-# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
-# and PKG_TCL_SOURCES.
-#-----------------------------------------------------------------------
-
-
- vars="itk_cmds.c
- itk_option.c
- itk_archetype.c
- itk_util.c
- itkStubInit.c"
- for i in $vars; do
- case $i in
- \$*)
- # allow $-var names
- PKG_SOURCES="$PKG_SOURCES $i"
- PKG_OBJECTS="$PKG_OBJECTS $i"
- ;;
- *)
- # check for existence - allows for generic/win/unix VPATH
- if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
- -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
- ; then
- { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5
-echo "$as_me: error: could not find source file '$i'" >&2;}
- { (exit 1); exit 1; }; }
- fi
- PKG_SOURCES="$PKG_SOURCES $i"
- # this assumes it is in a VPATH dir
- i=`basename $i`
- # handle user calling this before or after TEA_SETUP_COMPILER
- if test x"${OBJEXT}" != x ; then
- j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
- else
- j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
- fi
- PKG_OBJECTS="$PKG_OBJECTS $j"
- ;;
- esac
- done
-
-
-
-
- vars="generic/itk.h generic/itkDecls.h"
- for i in $vars; do
- # check for existence, be strict because it is installed
- if test ! -f "${srcdir}/$i" ; then
- { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5
-echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;}
- { (exit 1); exit 1; }; }
- fi
- PKG_HEADERS="$PKG_HEADERS $i"
- done
-
-
-
- vars="${ITCL_INCLUDES} -I\"`${CYGPATH} ${srcdir}/generic`\""
- for i in $vars; do
- PKG_INCLUDES="$PKG_INCLUDES $i"
- done
-
-
-
- vars=""
- for i in $vars; do
- if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
- # Convert foo.lib to -lfoo for GCC. No-op if not *.lib
- i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
- fi
- PKG_LIBS="$PKG_LIBS $i"
- done
-
-
-
- PKG_CFLAGS="$PKG_CFLAGS "
-
-
-#TEA_ADD_STUB_SOURCES([itkStubLib.c])
-
- vars="library/Archetype.itk
- library/Toplevel.itk
- library/Widget.itk
- library/itk.tcl
- library/tclIndex"
- for i in $vars; do
- # check for existence, be strict because it is installed
- if test ! -f "${srcdir}/$i" ; then
- { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5
-echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;}
- { (exit 1); exit 1; }; }
- fi
- PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i"
- done
-
-
-
-#--------------------------------------------------------------------
-# __CHANGE__
-# A few miscellaneous platform-specific items:
-#
-# Define a special symbol for Windows (BUILD_itk in this case) so
-# that we create the export library with the dll. See sha1.h on how
-# to use this.
-#
-# Windows creates a few extra files that need to be cleaned up.
-# You can add more files to clean if your extension creates any extra
-# files.
-#
-# Define any extra compiler flags in the PACKAGE_CFLAGS variable.
-# These will be appended to the current set of compiler flags for
-# your system.
-#--------------------------------------------------------------------
-
-if test "${TEA_PLATFORM}" = "windows" ; then
- cat >>confdefs.h <<\_ACEOF
-#define BUILD_itk 1
-_ACEOF
-
- CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch"
-
- vars="dllEntryPoint.c"
- for i in $vars; do
- case $i in
- \$*)
- # allow $-var names
- PKG_SOURCES="$PKG_SOURCES $i"
- PKG_OBJECTS="$PKG_OBJECTS $i"
- ;;
- *)
- # check for existence - allows for generic/win/unix VPATH
- if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
- -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
- ; then
- { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5
-echo "$as_me: error: could not find source file '$i'" >&2;}
- { (exit 1); exit 1; }; }
- fi
- PKG_SOURCES="$PKG_SOURCES $i"
- # this assumes it is in a VPATH dir
- i=`basename $i`
- # handle user calling this before or after TEA_SETUP_COMPILER
- if test x"${OBJEXT}" != x ; then
- j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
- else
- j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
- fi
- PKG_OBJECTS="$PKG_OBJECTS $j"
- ;;
- esac
- done
-
-
-
-else
- CLEANFILES=
-fi
-
-
-
-#--------------------------------------------------------------------
-# __CHANGE__
-# Choose which headers you need. Extension authors should try very
-# hard to only rely on the Tcl public header files. Internal headers
-# contain private data structures and are subject to change without
-# notice.
-# This must be done AFTER calling TEA_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG
-# so that we can extract TCL_SRC_DIR from the config file (in the case
-# of private headers
-#--------------------------------------------------------------------
-
-#TEA_PUBLIC_TCL_HEADERS
-
- { echo "$as_me:$LINENO: checking for Tcl private include files" >&5
-echo $ECHO_N "checking for Tcl private include files... $ECHO_C" >&6; }
-
- if test "${TEA_PLATFORM}" = "windows"; then
- TCL_TOP_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}`\"
- TCL_GENERIC_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/generic`\"
- TCL_UNIX_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/unix`\"
- TCL_WIN_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/win`\"
- TCL_BMAP_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/bitmaps`\"
- TCL_TOOL_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/tools`\"
- TCL_COMPAT_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/compat`\"
- TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE}
-
- TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
- else
- TCL_TOP_DIR_NATIVE='$(TCL_SRC_DIR)'
- TCL_GENERIC_DIR_NATIVE='${TCL_TOP_DIR_NATIVE}/generic'
- TCL_UNIX_DIR_NATIVE='${TCL_TOP_DIR_NATIVE}/unix'
- TCL_WIN_DIR_NATIVE='${TCL_TOP_DIR_NATIVE}/win'
- TCL_BMAP_DIR_NATIVE='${TCL_TOP_DIR_NATIVE}/bitmaps'
- TCL_TOOL_DIR_NATIVE='${TCL_TOP_DIR_NATIVE}/tools'
- TCL_COMPAT_DIR_NATIVE='${TCL_TOP_DIR_NATIVE}/compat'
- TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE}
-
- # substitute these in "relaxed" so that TCL_INCLUDES still works
- # without requiring the other vars to be defined in the Makefile
- eval "TCL_INCLUDES=\"-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}\""
- fi
-
-
-
-
-
-
-
-
-
-
- { echo "$as_me:$LINENO: result: Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" >&5
-echo "${ECHO_T}Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" >&6; }
-
-
-#TEA_PUBLIC_TK_HEADERS
-
- { echo "$as_me:$LINENO: checking for Tk private include files" >&5
-echo $ECHO_N "checking for Tk private include files... $ECHO_C" >&6; }
-
- if test "${TEA_PLATFORM}" = "windows"; then
- TK_TOP_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}`\"
- TK_UNIX_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/unix`\"
- TK_WIN_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/win`\"
- TK_GENERIC_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/generic`\"
- TK_XLIB_DIR_NATIVE=\"`${CYGPATH} ${TK_SRC_DIR}/xlib`\"
- TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE}
-
- TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE} -I${TK_XLIB_DIR_NATIVE}"
- else
- TK_TOP_DIR_NATIVE='${TK_SRC_DIR}'
- TK_GENERIC_DIR_NATIVE='${TK_TOP_DIR_NATIVE}/generic'
- TK_UNIX_DIR_NATIVE='${TK_TOP_DIR_NATIVE}/unix'
- TK_WIN_DIR_NATIVE='${TK_TOP_DIR_NATIVE}/win'
- TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE}
-
- # substitute these in "relaxed" so that TK_INCLUDES still works
- # without requiring the other vars to be defined in the Makefile
- eval "TK_INCLUDES=\"-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}\""
- fi
-
-
-
-
-
-
-
-
-
- { echo "$as_me:$LINENO: result: Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}" >&5
-echo "${ECHO_T}Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}" >&6; }
-
-
-#--------------------------------------------------------------------
-# For Unix/Tk builds, make sure that the X libraries/headers are found.
-#--------------------------------------------------------------------
-
-
- if test "${TEA_PLATFORM}" = "unix" ; then
- case ${TK_DEFS} in
- *MAC_OSX_TK*)
- cat >>confdefs.h <<\_ACEOF
-#define MAC_OSX_TK 1
-_ACEOF
-
- TEA_WINDOWINGSYSTEM="aqua"
- ;;
- *)
-
- { echo "$as_me:$LINENO: checking for X" >&5
-echo $ECHO_N "checking for X... $ECHO_C" >&6; }
-
-
-# Check whether --with-x was given.
-if test "${with_x+set}" = set; then
- withval=$with_x;
-fi
-
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
-if test "x$with_x" = xno; then
- # The user explicitly disabled X.
- have_x=disabled
-else
- case $x_includes,$x_libraries in #(
- *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
-echo "$as_me: error: Cannot use X directory names containing '" >&2;}
- { (exit 1); exit 1; }; };; #(
- *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=no ac_x_libraries=no
-rm -f -r conftest.dir
-if mkdir conftest.dir; then
- cd conftest.dir
- cat >Imakefile <<'_ACEOF'
-incroot:
- @echo incroot='${INCROOT}'
-usrlibdir:
- @echo usrlibdir='${USRLIBDIR}'
-libdir:
- @echo libdir='${LIBDIR}'
-_ACEOF
- if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
- # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
- for ac_var in incroot usrlibdir libdir; do
- eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
- done
- # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
- for ac_extension in a so sl; do
- if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
- test -f "$ac_im_libdir/libX11.$ac_extension"; then
- ac_im_usrlibdir=$ac_im_libdir; break
- fi
- done
- # Screen out bogus values from the imake configuration. They are
- # bogus both because they are the default anyway, and because
- # using them would break gcc on systems where it needs fixed includes.
- case $ac_im_incroot in
- /usr/include) ac_x_includes= ;;
- *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
- esac
- case $ac_im_usrlibdir in
- /usr/lib | /lib) ;;
- *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
- esac
- fi
- cd ..
- rm -f -r conftest.dir
-fi
-
-# Standard set of common directories for X headers.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-ac_x_header_dirs='
-/usr/X11/include
-/usr/X11R6/include
-/usr/X11R5/include
-/usr/X11R4/include
-
-/usr/include/X11
-/usr/include/X11R6
-/usr/include/X11R5
-/usr/include/X11R4
-
-/usr/local/X11/include
-/usr/local/X11R6/include
-/usr/local/X11R5/include
-/usr/local/X11R4/include
-
-/usr/local/include/X11
-/usr/local/include/X11R6
-/usr/local/include/X11R5
-/usr/local/include/X11R4
-
-/usr/X386/include
-/usr/x386/include
-/usr/XFree86/include/X11
-
-/usr/include
-/usr/local/include
-/usr/unsupported/include
-/usr/athena/include
-/usr/local/x11r5/include
-/usr/lpp/Xamples/include
-
-/usr/openwin/include
-/usr/openwin/share/include'
-
-if test "$ac_x_includes" = no; then
- # Guess where to find include files, by looking for Xlib.h.
- # First, try using that file with no special directory specified.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <X11/Xlib.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # We can compile using X headers with no special include directory.
-ac_x_includes=
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- for ac_dir in $ac_x_header_dirs; do
- if test -r "$ac_dir/X11/Xlib.h"; then
- ac_x_includes=$ac_dir
- break
- fi
-done
-fi
-
-rm -f conftest.err conftest.$ac_ext
-fi # $ac_x_includes = no
-
-if test "$ac_x_libraries" = no; then
- # Check for the libraries.
- # See if we find them without any special options.
- # Don't add to $LIBS permanently.
- ac_save_LIBS=$LIBS
- LIBS="-lX11 $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <X11/Xlib.h>
-int
-main ()
-{
-XrmInitialize ()
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- LIBS=$ac_save_LIBS
-# We can link X programs with no special library path.
-ac_x_libraries=
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- LIBS=$ac_save_LIBS
-for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
-do
- # Don't even attempt the hair of trying to link an X program!
- for ac_extension in a so sl; do
- if test -r "$ac_dir/libX11.$ac_extension"; then
- ac_x_libraries=$ac_dir
- break 2
- fi
- done
-done
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi # $ac_x_libraries = no
-
-case $ac_x_includes,$ac_x_libraries in #(
- no,* | *,no | *\'*)
- # Didn't find X, or a directory has "'" in its name.
- ac_cv_have_x="have_x=no";; #(
- *)
- # Record where we found X for the cache.
- ac_cv_have_x="have_x=yes\
- ac_x_includes='$ac_x_includes'\
- ac_x_libraries='$ac_x_libraries'"
-esac
-fi
-;; #(
- *) have_x=yes;;
- esac
- eval "$ac_cv_have_x"
-fi # $with_x != no
-
-if test "$have_x" != yes; then
- { echo "$as_me:$LINENO: result: $have_x" >&5
-echo "${ECHO_T}$have_x" >&6; }
- no_x=yes
-else
- # If each of the values was on the command line, it overrides each guess.
- test "x$x_includes" = xNONE && x_includes=$ac_x_includes
- test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
- # Update the cache value to reflect the command line values.
- ac_cv_have_x="have_x=yes\
- ac_x_includes='$x_includes'\
- ac_x_libraries='$x_libraries'"
- { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
-echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; }
-fi
-
- not_really_there=""
- if test "$no_x" = ""; then
- if test "$x_includes" = ""; then
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <X11/XIntrinsic.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- not_really_there="yes"
-fi
-
-rm -f conftest.err conftest.$ac_ext
- else
- if test ! -r $x_includes/X11/Intrinsic.h; then
- not_really_there="yes"
- fi
- fi
- fi
- if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
- { echo "$as_me:$LINENO: checking for X11 header files" >&5
-echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6; }
- XINCLUDES="# no special path needed"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <X11/Intrinsic.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- XINCLUDES="nope"
-fi
-
-rm -f conftest.err conftest.$ac_ext
- if test "$XINCLUDES" = nope; then
- dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
- for i in $dirs ; do
- if test -r $i/X11/Intrinsic.h; then
- { echo "$as_me:$LINENO: result: $i" >&5
-echo "${ECHO_T}$i" >&6; }
- XINCLUDES=" -I$i"
- break
- fi
- done
- fi
- else
- if test "$x_includes" != ""; then
- XINCLUDES=-I$x_includes
- else
- XINCLUDES="# no special path needed"
- fi
- fi
- if test "$XINCLUDES" = nope; then
- { echo "$as_me:$LINENO: result: could not find any!" >&5
-echo "${ECHO_T}could not find any!" >&6; }
- XINCLUDES="# no include files found"
- fi
-
- if test "$no_x" = yes; then
- { echo "$as_me:$LINENO: checking for X11 libraries" >&5
-echo $ECHO_N "checking for X11 libraries... $ECHO_C" >&6; }
- XLIBSW=nope
- dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
- for i in $dirs ; do
- if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
- { echo "$as_me:$LINENO: result: $i" >&5
-echo "${ECHO_T}$i" >&6; }
- XLIBSW="-L$i -lX11"
- x_libraries="$i"
- break
- fi
- done
- else
- if test "$x_libraries" = ""; then
- XLIBSW=-lX11
- else
- XLIBSW="-L$x_libraries -lX11"
- fi
- fi
- if test "$XLIBSW" = nope ; then
- { echo "$as_me:$LINENO: checking for XCreateWindow in -lXwindow" >&5
-echo $ECHO_N "checking for XCreateWindow in -lXwindow... $ECHO_C" >&6; }
-if test "${ac_cv_lib_Xwindow_XCreateWindow+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXwindow $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XCreateWindow ();
-int
-main ()
-{
-return XCreateWindow ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_Xwindow_XCreateWindow=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_Xwindow_XCreateWindow=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5
-echo "${ECHO_T}$ac_cv_lib_Xwindow_XCreateWindow" >&6; }
-if test $ac_cv_lib_Xwindow_XCreateWindow = yes; then
- XLIBSW=-lXwindow
-fi
-
- fi
- if test "$XLIBSW" = nope ; then
- { echo "$as_me:$LINENO: result: could not find any! Using -lX11." >&5
-echo "${ECHO_T}could not find any! Using -lX11." >&6; }
- XLIBSW=-lX11
- fi
- if test x"${XLIBSW}" != x ; then
- PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
- fi
-
- TEA_WINDOWINGSYSTEM="x11"
- ;;
- esac
- elif test "${TEA_PLATFORM}" = "windows" ; then
- TEA_WINDOWINGSYSTEM="windows"
- fi
-
-
-#--------------------------------------------------------------------
-# We need to enable the threading macros found in tcl.h and tclInt.h.
-# The use of the threading features is determined by the core the
-# extension is loaded into, but we need to compile with these macros
-# turned on.
-#--------------------------------------------------------------------
-
-cat >>confdefs.h <<\_ACEOF
-#define TCL_THREADS 1
-_ACEOF
-
-#--------------------------------------------------------------------
-# Check whether --enable-threads or --disable-threads was given.
-# This auto-enables if Tcl was compiled threaded.
-#--------------------------------------------------------------------
-
-#TEA_ENABLE_THREADS
-
-#--------------------------------------------------------------------
-# The statement below defines a collection of symbols related to
-# building as a shared library instead of a static library.
-#--------------------------------------------------------------------
-
-
- { echo "$as_me:$LINENO: checking how to build libraries" >&5
-echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6; }
- # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval=$enable_shared; tcl_ok=$enableval
-else
- tcl_ok=yes
-fi
-
-
- if test "${enable_shared+set}" = set; then
- enableval="$enable_shared"
- tcl_ok=$enableval
- else
- tcl_ok=yes
- fi
-
- if test "$tcl_ok" = "yes" ; then
- { echo "$as_me:$LINENO: result: shared" >&5
-echo "${ECHO_T}shared" >&6; }
- SHARED_BUILD=1
- else
- { echo "$as_me:$LINENO: result: static" >&5
-echo "${ECHO_T}static" >&6; }
- SHARED_BUILD=0
- cat >>confdefs.h <<\_ACEOF
-#define STATIC_BUILD 1
-_ACEOF
-
- fi
-
-
-
-#--------------------------------------------------------------------
-# This macro figures out what flags to use with the compiler/linker
-# when building shared/static debug/optimized objects. This information
-# is all taken from the tclConfig.sh file.
-#--------------------------------------------------------------------
-
-
- # Allow the user to provide this setting in the env
- if test "x${TCLSH_PROG}" = "x" ; then
- { echo "$as_me:$LINENO: checking for tclsh" >&5
-echo $ECHO_N "checking for tclsh... $ECHO_C" >&6; }
-
- if test "${ac_cv_path_tclsh+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- search_path=`echo ${PATH} | sed -e 's/:/ /g'`
- if test "${TEA_PLATFORM}" != "windows" -o \
- \( "$do64bit_ok" = "no" -a "$doWince" = "no" \) ; then
- # Do not allow target tclsh in known cross-compile builds,
- # as we need one we can run on this system
- search_path="${TCL_BIN_DIR} ${TCL_BIN_DIR}/../bin ${exec_prefix}/bin ${prefix}/bin ${search_path}"
- fi
- for dir in $search_path ; do
- for j in `ls -r $dir/tclsh[8-9]*${EXEEXT} 2> /dev/null` \
- `ls -r $dir/tclsh*${EXEEXT} 2> /dev/null` ; do
- if test x"$ac_cv_path_tclsh" = x ; then
- if test -f "$j" ; then
- ac_cv_path_tclsh=$j
- break
- fi
- fi
- done
- done
-
-fi
-
-
- if test -f "$ac_cv_path_tclsh" ; then
- TCLSH_PROG=$ac_cv_path_tclsh
- { echo "$as_me:$LINENO: result: $TCLSH_PROG" >&5
-echo "${ECHO_T}$TCLSH_PROG" >&6; }
- else
- { { echo "$as_me:$LINENO: error: No tclsh found in PATH: $search_path" >&5
-echo "$as_me: error: No tclsh found in PATH: $search_path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-
-
-
-
-
- # Step 0: Enable 64 bit support?
-
- { echo "$as_me:$LINENO: checking if 64bit support is enabled" >&5
-echo $ECHO_N "checking if 64bit support is enabled... $ECHO_C" >&6; }
- # Check whether --enable-64bit was given.
-if test "${enable_64bit+set}" = set; then
- enableval=$enable_64bit; do64bit=$enableval
-else
- do64bit=no
-fi
-
- { echo "$as_me:$LINENO: result: $do64bit" >&5
-echo "${ECHO_T}$do64bit" >&6; }
-
- # Step 0.b: Enable Solaris 64 bit VIS support?
-
- { echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5
-echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6; }
- # Check whether --enable-64bit-vis was given.
-if test "${enable_64bit_vis+set}" = set; then
- enableval=$enable_64bit_vis; do64bitVIS=$enableval
-else
- do64bitVIS=no
-fi
-
- { echo "$as_me:$LINENO: result: $do64bitVIS" >&5
-echo "${ECHO_T}$do64bitVIS" >&6; }
-
- if test "$do64bitVIS" = "yes"; then
- # Force 64bit on with VIS
- do64bit=yes
- fi
-
- # Step 0.c: Cross-compiling options for Windows/CE builds?
-
- if test "${TEA_PLATFORM}" = "windows" ; then
- { echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5
-echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6; }
- # Check whether --enable-wince was given.
-if test "${enable_wince+set}" = set; then
- enableval=$enable_wince; doWince=$enableval
-else
- doWince=no
-fi
-
- { echo "$as_me:$LINENO: result: $doWince" >&5
-echo "${ECHO_T}$doWince" >&6; }
- fi
-
- # Step 1: set the variable "system" to hold the name and version number
- # for the system. This can usually be done via the "uname" command, but
- # there are a few systems, like Next, where this doesn't work.
-
- { echo "$as_me:$LINENO: checking system version (for dynamic loading)" >&5
-echo $ECHO_N "checking system version (for dynamic loading)... $ECHO_C" >&6; }
- if test -f /usr/lib/NextStep/software_version; then
- system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
- else
- system=`uname -s`-`uname -r`
- if test "$?" -ne 0 ; then
- { echo "$as_me:$LINENO: result: unknown (can't find uname command)" >&5
-echo "${ECHO_T}unknown (can't find uname command)" >&6; }
- system=unknown
- else
- # Special check for weird MP-RAS system (uname returns weird
- # results, and the version is kept in special file).
-
- if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
- system=MP-RAS-`awk '{print }' /etc/.relid'`
- fi
- if test "`uname -s`" = "AIX" ; then
- system=AIX-`uname -v`.`uname -r`
- fi
- if test "${TEA_PLATFORM}" = "windows" ; then
- system=windows
- fi
- { echo "$as_me:$LINENO: result: $system" >&5
-echo "${ECHO_T}$system" >&6; }
- fi
- fi
-
- # Step 2: check for existence of -ldl library. This is needed because
- # Linux can use either -ldl or -ldld for dynamic loading.
-
- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_dl_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dl_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
- have_dl=yes
-else
- have_dl=no
-fi
-
-
- # Step 3: set configuration options based on system name and version.
- # This is similar to Tcl's unix/tcl.m4 except that we've added a
- # "windows" case and CC_SEARCH_FLAGS becomes LD_SEARCH_FLAGS for us
- # (and we have no CC_SEARCH_FLAGS).
-
- do64bit_ok=no
- LDFLAGS_ORIG="$LDFLAGS"
- TCL_EXPORT_FILE_SUFFIX=""
- UNSHARED_LIB_SUFFIX=""
- TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
- ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
- TCL_LIB_VERSIONS_OK=ok
- CFLAGS_DEBUG=-g
- if test "$GCC" = "yes" ; then
- CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wno-implicit-int"
- else
- CFLAGS_OPTIMIZE=-O
- CFLAGS_WARNING=""
- fi
- TCL_NEEDS_EXP_FILE=0
- TCL_BUILD_EXP_FILE=""
- TCL_EXP_FILE=""
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AR="ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- STLIB_LD='${AR} cr'
- LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
- case $system in
- windows)
- # This is a 2-stage check to make sure we have the 64-bit SDK
- # We have to know where the SDK is installed.
- if test "$do64bit" = "yes" ; then
- if test "x${MSSDK}x" = "xx" ; then
- MSSDK="C:/Progra~1/Microsoft SDK"
- fi
- # Ensure that this path has no spaces to work in autoconf
-
- if test "${TEA_PLATFORM}" = "windows" ; then
- # we need TCLSH_PROG defined to get Windows short pathnames
-
-
- { echo "$as_me:$LINENO: checking short pathname for MSSDK (${MSSDK})" >&5
-echo $ECHO_N "checking short pathname for MSSDK (${MSSDK})... $ECHO_C" >&6; }
-
- shortpath=
- case "${MSSDK}" in
- *\ *)
- # Only do this if we need to.
- shortpath=`echo "puts [file attributes {${MSSDK}} -shortname] ; exit" | ${TCLSH_PROG} 2>/dev/null`
- ;;
- esac
- if test "x${shortpath}" = "x" ; then
- { echo "$as_me:$LINENO: result: not changed" >&5
-echo "${ECHO_T}not changed" >&6; }
- else
- MSSDK=$shortpath
- { echo "$as_me:$LINENO: result: ${MSSDK}" >&5
-echo "${ECHO_T}${MSSDK}" >&6; }
- fi
- fi
-
- if test ! -d "${MSSDK}/bin/win64" ; then
- { echo "$as_me:$LINENO: WARNING: could not find 64-bit SDK to enable 64bit mode" >&5
-echo "$as_me: WARNING: could not find 64-bit SDK to enable 64bit mode" >&2;}
- do64bit="no"
- else
- do64bit_ok="yes"
- fi
- fi
-
- if test "$doWince" != "no" ; then
- if test "$do64bit" = "yes" ; then
- { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5
-echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;}
- { (exit 1); exit 1; }; }
- fi
- if test "$GCC" = "yes" ; then
- { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5
-echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- # First, look for one uninstalled.
- # the alternative search directory is invoked by --with-celib
-
- if test x"${no_celib}" = x ; then
- # we reset no_celib in case something fails here
- no_celib=true
-
-# Check whether --with-celib was given.
-if test "${with_celib+set}" = set; then
- withval=$with_celib; with_celibconfig=${withval}
-fi
-
- { echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5
-echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6; }
- if test "${ac_cv_c_celibconfig+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- # First check to see if --with-celibconfig was specified.
- if test x"${with_celibconfig}" != x ; then
- if test -d "${with_celibconfig}/inc" ; then
- ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
- else
- { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5
-echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-
- # then check for a celib library
- if test x"${ac_cv_c_celibconfig}" = x ; then
- for i in \
- ../celib-palm-3.0 \
- ../celib \
- ../../celib-palm-3.0 \
- ../../celib \
- `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \
- ${srcdir}/../celib-palm-3.0 \
- ${srcdir}/../celib \
- `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \
- ; do
- if test -d "$i/inc" ; then
- ac_cv_c_celibconfig=`(cd $i; pwd)`
- break
- fi
- done
- fi
-
-fi
-
- if test x"${ac_cv_c_celibconfig}" = x ; then
- { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5
-echo "$as_me: error: Cannot find celib support library directory" >&2;}
- { (exit 1); exit 1; }; }
- else
- no_celib=
- CELIB_DIR=${ac_cv_c_celibconfig}
- { echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5
-echo "${ECHO_T}found $CELIB_DIR" >&6; }
-
- if test "${TEA_PLATFORM}" = "windows" ; then
- # we need TCLSH_PROG defined to get Windows short pathnames
-
-
- { echo "$as_me:$LINENO: checking short pathname for CELIB_DIR (${ac_cv_c_celibconfig})" >&5
-echo $ECHO_N "checking short pathname for CELIB_DIR (${ac_cv_c_celibconfig})... $ECHO_C" >&6; }
-
- shortpath=
- case "${ac_cv_c_celibconfig}" in
- *\ *)
- # Only do this if we need to.
- shortpath=`echo "puts [file attributes {${ac_cv_c_celibconfig}} -shortname] ; exit" | ${TCLSH_PROG} 2>/dev/null`
- ;;
- esac
- if test "x${shortpath}" = "x" ; then
- { echo "$as_me:$LINENO: result: not changed" >&5
-echo "${ECHO_T}not changed" >&6; }
- else
- CELIB_DIR=$shortpath
- { echo "$as_me:$LINENO: result: ${CELIB_DIR}" >&5
-echo "${ECHO_T}${CELIB_DIR}" >&6; }
- fi
- fi
-
- fi
- fi
-
- # Set defaults for common evc4/PPC2003 setup
- # Currently Tcl requires 300+, possibly 420+ for sockets
- CEVERSION=420; # could be 211 300 301 400 420 ...
- TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ...
- ARCH=ARM; # could be ARM MIPS X86EM ...
- PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
- if test "$doWince" != "yes"; then
- # If !yes then the user specified something
- # Reset ARCH to allow user to skip specifying it
- ARCH=
- eval `echo $doWince | awk -F, '{ \
- if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \
- if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
- if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \
- if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \
- if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \
- }'`
- if test "x${ARCH}" = "x" ; then
- ARCH=$TARGETCPU;
- fi
- fi
- OSVERSION=WCE$CEVERSION;
- if test "x${WCEROOT}" = "x" ; then
- WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
- if test ! -d "${WCEROOT}" ; then
- WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
- fi
- fi
- if test "x${SDKROOT}" = "x" ; then
- SDKROOT="C:/Program Files/Windows CE Tools"
- if test ! -d "${SDKROOT}" ; then
- SDKROOT="C:/Windows CE Tools"
- fi
- fi
- # Ensure that this path has no spaces to work in autoconf
-
- if test "${TEA_PLATFORM}" = "windows" ; then
- # we need TCLSH_PROG defined to get Windows short pathnames
-
-
- { echo "$as_me:$LINENO: checking short pathname for WCEROOT (${WCEROOT})" >&5
-echo $ECHO_N "checking short pathname for WCEROOT (${WCEROOT})... $ECHO_C" >&6; }
-
- shortpath=
- case "${WCEROOT}" in
- *\ *)
- # Only do this if we need to.
- shortpath=`echo "puts [file attributes {${WCEROOT}} -shortname] ; exit" | ${TCLSH_PROG} 2>/dev/null`
- ;;
- esac
- if test "x${shortpath}" = "x" ; then
- { echo "$as_me:$LINENO: result: not changed" >&5
-echo "${ECHO_T}not changed" >&6; }
- else
- WCEROOT=$shortpath
- { echo "$as_me:$LINENO: result: ${WCEROOT}" >&5
-echo "${ECHO_T}${WCEROOT}" >&6; }
- fi
- fi
-
-
- if test "${TEA_PLATFORM}" = "windows" ; then
- # we need TCLSH_PROG defined to get Windows short pathnames
-
-
- { echo "$as_me:$LINENO: checking short pathname for SDKROOT (${SDKROOT})" >&5
-echo $ECHO_N "checking short pathname for SDKROOT (${SDKROOT})... $ECHO_C" >&6; }
-
- shortpath=
- case "${SDKROOT}" in
- *\ *)
- # Only do this if we need to.
- shortpath=`echo "puts [file attributes {${SDKROOT}} -shortname] ; exit" | ${TCLSH_PROG} 2>/dev/null`
- ;;
- esac
- if test "x${shortpath}" = "x" ; then
- { echo "$as_me:$LINENO: result: not changed" >&5
-echo "${ECHO_T}not changed" >&6; }
- else
- SDKROOT=$shortpath
- { echo "$as_me:$LINENO: result: ${SDKROOT}" >&5
-echo "${ECHO_T}${SDKROOT}" >&6; }
- fi
- fi
-
- if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
- -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
- { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5
-echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;}
- { (exit 1); exit 1; }; }
- doWince="no"
- else
- # We could PATH_NOSPACE these, but that's not important,
- # as long as we quote them when used.
- CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
- if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
- CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
- fi
- CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
- fi
- fi
-
- if test "$GCC" != "yes" ; then
- if test "${SHARED_BUILD}" = "0" ; then
- runtime=-MT
- else
- runtime=-MD
- fi
-
- if test "$do64bit" = "yes" ; then
- # All this magic is necessary for the Win64 SDK RC1 - hobbs
- CC="${MSSDK}/Bin/Win64/cl.exe"
- CFLAGS="${CFLAGS} -I${MSSDK}/Include/prerelease \
- -I${MSSDK}/Include/Win64/crt \
- -I${MSSDK}/Include"
- RC="${MSSDK}/bin/rc.exe"
- lflags="-MACHINE:IA64 -LIBPATH:${MSSDK}/Lib/IA64 \
- -LIBPATH:${MSSDK}/Lib/Prerelease/IA64 -nologo"
- LINKBIN="${MSSDK}/bin/win64/link.exe"
- CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
- CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
- elif test "$doWince" != "no" ; then
- CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
- if test "${TARGETCPU}" = "X86"; then
- CC="${CEBINROOT}/cl.exe"
- else
- CC="${CEBINROOT}/cl${ARCH}.exe"
- fi
- CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
- RC="${WCEROOT}/Common/EVC/bin/rc.exe"
- arch=`echo ${ARCH} | awk '{print tolower($0)}'`
- defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
- if test "${SHARED_BUILD}" = "1" ; then
- # Static CE builds require static celib as well
- defs="${defs} _DLL"
- fi
- for i in $defs ; do
- cat >>confdefs.h <<_ACEOF
-#define $i 1
-_ACEOF
-
- done
- cat >>confdefs.h <<_ACEOF
-#define _WIN32_WCE $CEVERSION
-_ACEOF
-
- cat >>confdefs.h <<_ACEOF
-#define UNDER_CE $CEVERSION
-_ACEOF
-
- CFLAGS_DEBUG="-nologo -Zi -Od"
- CFLAGS_OPTIMIZE="-nologo -Ox"
- lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
- lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
- LINKBIN="${CEBINROOT}/link.exe"
-
- else
- RC="rc"
- lflags="-nologo"
- LINKBIN="link"
- CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
- CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
- fi
- fi
-
- if test "$GCC" = "yes"; then
- # mingw gcc mode
- RC="windres"
- CFLAGS_DEBUG="-g"
- CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
- SHLIB_LD="$CC -shared"
- UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
- LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
- LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
- else
- SHLIB_LD="${LINKBIN} -dll ${lflags}"
- # link -lib only works when -lib is the first arg
- STLIB_LD="${LINKBIN} -lib ${lflags}"
- UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
- PATHTYPE=-w
- # For information on what debugtype is most useful, see:
- # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
- # This essentially turns it all on.
- LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2"
- LDFLAGS_OPTIMIZE="-release"
- if test "$doWince" != "no" ; then
- LDFLAGS_CONSOLE="-link ${lflags}"
- LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
- else
- LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
- LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
- fi
- fi
-
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".dll"
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
-
- TCL_LIB_VERSIONS_OK=nodots
- # Bogus to avoid getting this turned off
- DL_OBJS="tclLoadNone.obj"
- ;;
- AIX-*)
- if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
- # AIX requires the _r compiler when gcc isn't being used
- if test "${CC}" != "cc_r" ; then
- CC=${CC}_r
- fi
- { echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5
-echo "${ECHO_T}Using $CC for compiling with threads" >&6; }
- fi
- LIBS="$LIBS -lc"
- SHLIB_CFLAGS=""
- SHLIB_SUFFIX=".so"
- SHLIB_LD_LIBS='${LIBS}'
-
- DL_OBJS="tclLoadDl.o"
- LD_LIBRARY_PATH_VAR="LIBPATH"
-
- # AIX v<=4.1 has some different flags than 4.2+
- if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
- #LIBOBJS="$LIBOBJS tclLoadAix.o"
- case " $LIBOBJS " in
- *" tclLoadAix.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext"
- ;;
-esac
-
- DL_LIBS="-lld"
- fi
-
- # Check to enable 64-bit flags for compiler/linker on AIX 4+
- if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then
- if test "$GCC" = "yes" ; then
- { echo "$as_me:$LINENO: WARNING: \"64bit mode not supported with GCC on $system\"" >&5
-echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;}
- else
- do64bit_ok=yes
- CFLAGS="$CFLAGS -q64"
- LDFLAGS="$LDFLAGS -q64"
- RANLIB="${RANLIB} -X64"
- AR="${AR} -X64"
- SHLIB_LD_FLAGS="-b64"
- fi
- fi
-
- if test "`uname -m`" = "ia64" ; then
- # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
- SHLIB_LD="/usr/ccs/bin/ld -G -z text"
- # AIX-5 has dl* in libc.so
- DL_LIBS=""
- if test "$GCC" = "yes" ; then
- LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
- else
- LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
- fi
- else
- if test "$GCC" = "yes" ; then
- SHLIB_LD="gcc -shared"
- else
- SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
- fi
- SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}"
- DL_LIBS="-ldl"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- TCL_NEEDS_EXP_FILE=1
- TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp'
- fi
-
- # On AIX <=v4 systems, libbsd.a has to be linked in to support
- # non-blocking file IO. This library has to be linked in after
- # the MATH_LIBS or it breaks the pow() function. The way to
- # insure proper sequencing, is to add it to the tail of MATH_LIBS.
- # This library also supplies gettimeofday.
- #
- # AIX does not have a timezone field in struct tm. When the AIX
- # bsd library is used, the timezone global and the gettimeofday
- # methods are to be avoided for timezone deduction instead, we
- # deduce the timezone by comparing the localtime result on a
- # known GMT value.
-
- { echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5
-echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6; }
-if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbsd $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gettimeofday ();
-int
-main ()
-{
-return gettimeofday ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_bsd_gettimeofday=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_bsd_gettimeofday=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5
-echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6; }
-if test $ac_cv_lib_bsd_gettimeofday = yes; then
- libbsd=yes
-else
- libbsd=no
-fi
-
- if test $libbsd = yes; then
- MATH_LIBS="$MATH_LIBS -lbsd"
- cat >>confdefs.h <<\_ACEOF
-#define USE_DELTA_FOR_TZ 1
-_ACEOF
-
- fi
- ;;
- BeOS*)
- SHLIB_CFLAGS="-fPIC"
- SHLIB_LD="${CC} -nostart"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- ;;
- BSD/OS-2.1*|BSD/OS-3*)
- SHLIB_CFLAGS=""
- SHLIB_LD="shlicc -r"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LD_SEARCH_FLAGS=""
- ;;
- BSD/OS-4.*)
- SHLIB_CFLAGS="-export-dynamic -fPIC"
- SHLIB_LD="cc -shared"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LDFLAGS="$LDFLAGS -export-dynamic"
- LD_SEARCH_FLAGS=""
- ;;
- dgux*)
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc -G"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LD_SEARCH_FLAGS=""
- ;;
- HP-UX-*.11.*)
- # Use updated header definitions where possible
- cat >>confdefs.h <<\_ACEOF
-#define _XOPEN_SOURCE_EXTENDED 1
-_ACEOF
-
-
- SHLIB_SUFFIX=".sl"
- { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_dld_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dld_shl_load=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
-if test $ac_cv_lib_dld_shl_load = yes; then
- tcl_ok=yes
-else
- tcl_ok=no
-fi
-
- if test "$tcl_ok" = yes; then
- SHLIB_CFLAGS="+z"
- SHLIB_LD="ld -b"
- SHLIB_LD_LIBS='${LIBS}'
- DL_OBJS="tclLoadShl.o"
- DL_LIBS="-ldld"
- LDFLAGS="$LDFLAGS -Wl,-E"
- LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
- LD_LIBRARY_PATH_VAR="SHLIB_PATH"
- fi
- if test "$GCC" = "yes" ; then
- SHLIB_LD="gcc -shared"
- SHLIB_LD_LIBS='${LIBS}'
- LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
- fi
-
- # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
- #CFLAGS="$CFLAGS +DAportable"
-
- # Check to enable 64-bit flags for compiler/linker
- if test "$do64bit" = "yes" ; then
- if test "$GCC" = "yes" ; then
- hpux_arch=`${CC} -dumpmachine`
- case $hpux_arch in
- hppa64*)
- # 64-bit gcc in use. Fix flags for GNU ld.
- do64bit_ok=yes
- SHLIB_LD="${CC} -shared"
- SHLIB_LD_LIBS='${LIBS}'
- ;;
- *)
- { echo "$as_me:$LINENO: WARNING: \"64bit mode not supported with GCC on $system\"" >&5
-echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;}
- ;;
- esac
- else
- do64bit_ok=yes
- CFLAGS="$CFLAGS +DD64"
- LDFLAGS="$LDFLAGS +DD64"
- fi
- fi
- ;;
- HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
- SHLIB_SUFFIX=".sl"
- { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_dld_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dld_shl_load=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
-if test $ac_cv_lib_dld_shl_load = yes; then
- tcl_ok=yes
-else
- tcl_ok=no
-fi
-
- if test "$tcl_ok" = yes; then
- SHLIB_CFLAGS="+z"
- SHLIB_LD="ld -b"
- SHLIB_LD_LIBS=""
- DL_OBJS="tclLoadShl.o"
- DL_LIBS="-ldld"
- LDFLAGS="$LDFLAGS -Wl,-E"
- LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
- fi
- LD_LIBRARY_PATH_VAR="SHLIB_PATH"
- ;;
- IRIX-4.*)
- SHLIB_CFLAGS="-G 0"
- SHLIB_SUFFIX=".a"
- SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
- SHLIB_LD_LIBS='${LIBS}'
- DL_OBJS="tclLoadAout.o"
- DL_LIBS=""
- LDFLAGS="$LDFLAGS -Wl,-D,08000000"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- SHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'
- ;;
- IRIX-5.*)
- SHLIB_CFLAGS=""
- SHLIB_LD="ld -shared -rdata_shared"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- ;;
- IRIX-6.*|IRIX64-6.5*)
- SHLIB_CFLAGS=""
- SHLIB_LD="ld -n32 -shared -rdata_shared"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- if test "$GCC" = "yes" ; then
- CFLAGS="$CFLAGS -mabi=n32"
- LDFLAGS="$LDFLAGS -mabi=n32"
- else
- case $system in
- IRIX-6.3)
- # Use to build 6.2 compatible binaries on 6.3.
- CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
- ;;
- *)
- CFLAGS="$CFLAGS -n32"
- ;;
- esac
- LDFLAGS="$LDFLAGS -n32"
- fi
- ;;
- IRIX64-6.*)
- SHLIB_CFLAGS=""
- SHLIB_LD="ld -n32 -shared -rdata_shared"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
-
- # Check to enable 64-bit flags for compiler/linker
-
- if test "$do64bit" = "yes" ; then
- if test "$GCC" = "yes" ; then
- { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5
-echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
- else
- do64bit_ok=yes
- SHLIB_LD="ld -64 -shared -rdata_shared"
- CFLAGS="$CFLAGS -64"
- LDFLAGS="$LDFLAGS -64"
- fi
- fi
- ;;
- Linux*)
- SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
-
- CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
- # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
- # when you inline the string and math operations. Turn this off to
- # get rid of the warnings.
-
- #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
-
- if test "$have_dl" = yes; then
- SHLIB_LD="${CC} -shared"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- else
- if test "${ac_cv_header_dld_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for dld.h" >&5
-echo $ECHO_N "checking for dld.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dld_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5
-echo "${ECHO_T}$ac_cv_header_dld_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking dld.h usability" >&5
-echo $ECHO_N "checking dld.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <dld.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking dld.h presence" >&5
-echo $ECHO_N "checking dld.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <dld.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: dld.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: dld.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: dld.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: dld.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: dld.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: dld.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: dld.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: dld.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: dld.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: dld.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for dld.h" >&5
-echo $ECHO_N "checking for dld.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dld_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_dld_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5
-echo "${ECHO_T}$ac_cv_header_dld_h" >&6; }
-
-fi
-if test $ac_cv_header_dld_h = yes; then
-
- SHLIB_LD="ld -shared"
- DL_OBJS="tclLoadDld.o"
- DL_LIBS="-ldld"
- LD_SEARCH_FLAGS=""
-fi
-
-
- fi
- if test "`uname -m`" = "alpha" ; then
- CFLAGS="$CFLAGS -mieee"
- fi
-
- # The combo of gcc + glibc has a bug related
- # to inlining of functions like strtod(). The
- # -fno-builtin flag should address this problem
- # but it does not work. The -fno-inline flag
- # is kind of overkill but it works.
- # Disable inlining only when one of the
- # files in compat/*.c is being linked in.
- if test x"${USE_COMPAT}" != x ; then
- CFLAGS="$CFLAGS -fno-inline"
- fi
-
- ;;
- GNU*)
- SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
-
- if test "$have_dl" = yes; then
- SHLIB_LD="${CC} -shared"
- DL_OBJS=""
- DL_LIBS="-ldl"
- LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
- LD_SEARCH_FLAGS=""
- else
- if test "${ac_cv_header_dld_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for dld.h" >&5
-echo $ECHO_N "checking for dld.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dld_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5
-echo "${ECHO_T}$ac_cv_header_dld_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking dld.h usability" >&5
-echo $ECHO_N "checking dld.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <dld.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking dld.h presence" >&5
-echo $ECHO_N "checking dld.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <dld.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: dld.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: dld.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: dld.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: dld.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: dld.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: dld.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: dld.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: dld.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: dld.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: dld.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for dld.h" >&5
-echo $ECHO_N "checking for dld.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dld_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_dld_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5
-echo "${ECHO_T}$ac_cv_header_dld_h" >&6; }
-
-fi
-if test $ac_cv_header_dld_h = yes; then
-
- SHLIB_LD="ld -shared"
- DL_OBJS=""
- DL_LIBS="-ldld"
- LD_SEARCH_FLAGS=""
-fi
-
-
- fi
- if test "`uname -m`" = "alpha" ; then
- CFLAGS="$CFLAGS -mieee"
- fi
- ;;
- MP-RAS-02*)
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc -G"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LD_SEARCH_FLAGS=""
- ;;
- MP-RAS-*)
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc -G"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LDFLAGS="$LDFLAGS -Wl,-Bexport"
- LD_SEARCH_FLAGS=""
- ;;
- NetBSD-*|FreeBSD-[1-2].*)
- # Not available on all versions: check for include file.
- if test "${ac_cv_header_dlfcn_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for dlfcn.h" >&5
-echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dlfcn_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
-echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking dlfcn.h usability" >&5
-echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <dlfcn.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking dlfcn.h presence" >&5
-echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <dlfcn.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for dlfcn.h" >&5
-echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_dlfcn_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_dlfcn_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
-echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; }
-
-fi
-if test $ac_cv_header_dlfcn_h = yes; then
-
- # NetBSD/SPARC needs -fPIC, -fpic will not do.
- SHLIB_CFLAGS="-fPIC"
- SHLIB_LD="ld -Bshareable -x"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- { echo "$as_me:$LINENO: checking for ELF" >&5
-echo $ECHO_N "checking for ELF... $ECHO_C" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef __ELF__
- yes
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "yes" >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
-
-fi
-rm -f conftest*
-
-
-else
-
- SHLIB_CFLAGS=""
- SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".a"
- DL_OBJS="tclLoadAout.o"
- DL_LIBS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
-
-fi
-
-
-
- # FreeBSD doesn't handle version numbers with dots.
-
- UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
- TCL_LIB_VERSIONS_OK=nodots
- ;;
- OpenBSD-*)
- SHLIB_LD="${CC} -shared"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_SEARCH_FLAGS=""
- { echo "$as_me:$LINENO: checking for ELF" >&5
-echo $ECHO_N "checking for ELF... $ECHO_C" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef __ELF__
- yes
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "yes" >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
-
-fi
-rm -f conftest*
-
-
- # OpenBSD doesn't do version numbers with dots.
- UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
- TCL_LIB_VERSIONS_OK=nodots
- ;;
- FreeBSD-*)
- # FreeBSD 3.* and greater have ELF.
- SHLIB_CFLAGS="-fPIC"
- SHLIB_LD="ld -Bshareable -x"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LDFLAGS="$LDFLAGS -export-dynamic"
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- if test "${TCL_THREADS}" = "1" ; then
- # The -pthread needs to go in the CFLAGS, not LIBS
- LIBS=`echo $LIBS | sed s/-pthread//`
- CFLAGS="$CFLAGS -pthread"
- LDFLAGS="$LDFLAGS -pthread"
- fi
- case $system in
- FreeBSD-3.*)
- # FreeBSD-3 doesn't handle version numbers with dots.
- UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
- TCL_LIB_VERSIONS_OK=nodots
- ;;
- esac
- ;;
- Darwin-*)
- SHLIB_CFLAGS="-fno-common"
- SHLIB_LD="cc -dynamiclib \${LDFLAGS}"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".dylib"
- DL_OBJS="tclLoadDyld.o"
- DL_LIBS=""
- LDFLAGS="$LDFLAGS -prebind -Wl,-search_paths_first"
- LD_SEARCH_FLAGS=""
- LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
- CFLAGS_OPTIMIZE="-Os"
- ;;
- NEXTSTEP-*)
- SHLIB_CFLAGS=""
- SHLIB_LD="cc -nostdlib -r"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadNext.o"
- DL_LIBS=""
- LD_SEARCH_FLAGS=""
- ;;
- OS/390-*)
- CFLAGS_OPTIMIZE="" # Optimizer is buggy
- cat >>confdefs.h <<\_ACEOF
-#define _OE_SOCKETS 1
-_ACEOF
- # needed in sys/socket.h
- ;;
- OSF1-1.0|OSF1-1.1|OSF1-1.2)
- # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
- SHLIB_CFLAGS=""
- # Hack: make package name same as library name
- SHLIB_LD='ld -R -export :'
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadOSF.o"
- DL_LIBS=""
- LD_SEARCH_FLAGS=""
- ;;
- OSF1-1.*)
- # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
- SHLIB_CFLAGS="-fPIC"
- if test "$SHARED_BUILD" = "1" ; then
- SHLIB_LD="ld -shared"
- else
- SHLIB_LD="ld -non_shared"
- fi
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_SEARCH_FLAGS=""
- ;;
- OSF1-V*)
- # Digital OSF/1
- SHLIB_CFLAGS=""
- if test "$SHARED_BUILD" = "1" ; then
- SHLIB_LD='ld -shared -expect_unresolved "*"'
- else
- SHLIB_LD='ld -non_shared -expect_unresolved "*"'
- fi
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
- if test "$GCC" = "yes" ; then
- CFLAGS="$CFLAGS -mieee"
- else
- CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
- fi
- # see pthread_intro(3) for pthread support on osf1, k.furukawa
- if test "${TCL_THREADS}" = "1" ; then
- CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
- CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
- LIBS=`echo $LIBS | sed s/-lpthreads//`
- if test "$GCC" = "yes" ; then
- LIBS="$LIBS -lpthread -lmach -lexc"
- else
- CFLAGS="$CFLAGS -pthread"
- LDFLAGS="$LDFLAGS -pthread"
- fi
- fi
-
- ;;
- QNX-6*)
- # QNX RTP
- # This may work for all QNX, but it was only reported for v6.
- SHLIB_CFLAGS="-fPIC"
- SHLIB_LD="ld -Bshareable -x"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- # dlopen is in -lc on QNX
- DL_LIBS=""
- LD_SEARCH_FLAGS=""
- ;;
- RISCos-*)
- SHLIB_CFLAGS="-G 0"
- SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".a"
- DL_OBJS="tclLoadAout.o"
- DL_LIBS=""
- LDFLAGS="$LDFLAGS -Wl,-D,08000000"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- ;;
- SCO_SV-3.2*)
- # Note, dlopen is available only on SCO 3.2.5 and greater. However,
- # this test works, since "uname -s" was non-standard in 3.2.4 and
- # below.
- if test "$GCC" = "yes" ; then
- SHLIB_CFLAGS="-fPIC -melf"
- LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
- else
- SHLIB_CFLAGS="-Kpic -belf"
- LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
- fi
- SHLIB_LD="ld -G"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- LD_SEARCH_FLAGS=""
- ;;
- SINIX*5.4*)
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc -G"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LD_SEARCH_FLAGS=""
- ;;
- SunOS-4*)
- SHLIB_CFLAGS="-PIC"
- SHLIB_LD="ld"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
-
- # SunOS can't handle version numbers with dots in them in library
- # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
- # requires an extra version number at the end of .so file names.
- # So, the library has to have a name like libtcl75.so.1.0
-
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
- UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
- TCL_LIB_VERSIONS_OK=nodots
- ;;
- SunOS-5.[0-6]*)
-
- # Note: If _REENTRANT isn't defined, then Solaris
- # won't define thread-safe library routines.
-
- cat >>confdefs.h <<\_ACEOF
-#define _REENTRANT 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define _POSIX_PTHREAD_SEMANTICS 1
-_ACEOF
-
-
- SHLIB_CFLAGS="-KPIC"
-
- # Note: need the LIBS below, otherwise Tk won't find Tcl's
- # symbols when dynamically loaded into tclsh.
-
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- if test "$GCC" = "yes" ; then
- SHLIB_LD="$CC -shared"
- LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
- else
- SHLIB_LD="/usr/ccs/bin/ld -G -z text"
- LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
- fi
- ;;
- SunOS-5*)
-
- # Note: If _REENTRANT isn't defined, then Solaris
- # won't define thread-safe library routines.
-
- cat >>confdefs.h <<\_ACEOF
-#define _REENTRANT 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define _POSIX_PTHREAD_SEMANTICS 1
-_ACEOF
-
-
- SHLIB_CFLAGS="-KPIC"
-
- # Check to enable 64-bit flags for compiler/linker
- if test "$do64bit" = "yes" ; then
- arch=`isainfo`
- if test "$arch" = "sparcv9 sparc" ; then
- if test "$GCC" = "yes" ; then
- if test "`gcc -dumpversion` | awk -F. '{print }'" -lt "3" ; then
- { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5
-echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;}
- else
- do64bit_ok=yes
- CFLAGS="$CFLAGS -m64 -mcpu=v9"
- LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
- SHLIB_CFLAGS="-fPIC"
- fi
- else
- do64bit_ok=yes
- if test "$do64bitVIS" = "yes" ; then
- CFLAGS="$CFLAGS -xarch=v9a"
- LDFLAGS="$LDFLAGS -xarch=v9a"
- else
- CFLAGS="$CFLAGS -xarch=v9"
- LDFLAGS="$LDFLAGS -xarch=v9"
- fi
- fi
- else
- { echo "$as_me:$LINENO: WARNING: \"64bit mode only supported sparcv9 system\"" >&5
-echo "$as_me: WARNING: \"64bit mode only supported sparcv9 system\"" >&2;}
- fi
- fi
-
- # Note: need the LIBS below, otherwise Tk won't find Tcl's
- # symbols when dynamically loaded into tclsh.
-
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- if test "$GCC" = "yes" ; then
- SHLIB_LD="$CC -shared"
- LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
- if test "$do64bit" = "yes" ; then
- # We need to specify -static-libgcc or we need to
- # add the path to the sparv9 libgcc.
- # JH: static-libgcc is necessary for core Tcl, but may
- # not be necessary for extensions.
- SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
- # for finding sparcv9 libgcc, get the regular libgcc
- # path, remove so name and append 'sparcv9'
- #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
- #LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS},-R,$v9gcclibdir"
- fi
- else
- SHLIB_LD="/usr/ccs/bin/ld -G -z text"
- LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
- fi
- ;;
- ULTRIX-4.*)
- SHLIB_CFLAGS="-G 0"
- SHLIB_SUFFIX=".a"
- SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
- SHLIB_LD_LIBS='${LIBS}'
- DL_OBJS="tclLoadAout.o"
- DL_LIBS=""
- LDFLAGS="$LDFLAGS -Wl,-D,08000000"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- if test "$GCC" != "yes" ; then
- CFLAGS="$CFLAGS -DHAVE_TZSET -std1"
- fi
- ;;
- UNIX_SV* | UnixWare-5*)
- SHLIB_CFLAGS="-KPIC"
- SHLIB_LD="cc -G"
- SHLIB_LD_LIBS=""
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
- # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
- # that don't grok the -Bexport option. Test that it does.
- hold_ldflags=$LDFLAGS
- { echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5
-echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6; }
- LDFLAGS="$LDFLAGS -Wl,-Bexport"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-int i;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- found=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- LDFLAGS=$hold_ldflags found=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- { echo "$as_me:$LINENO: result: $found" >&5
-echo "${ECHO_T}$found" >&6; }
- LD_SEARCH_FLAGS=""
- ;;
- esac
-
- if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then
- { echo "$as_me:$LINENO: WARNING: \"64bit support being disabled -- don\'t know magic for this platform\"" >&5
-echo "$as_me: WARNING: \"64bit support being disabled -- don\'t know magic for this platform\"" >&2;}
- fi
-
- # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic
- # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop,
- # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need
- # to determine which of several header files defines the a.out file
- # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we
- # support only a file format that is more or less version-7-compatible.
- # In particular,
- # - a.out files must begin with `struct exec'.
- # - the N_TXTOFF on the `struct exec' must compute the seek address
- # of the text segment
- # - The `struct exec' must contain a_magic, a_text, a_data, a_bss
- # and a_entry fields.
- # The following compilation should succeed if and only if either sys/exec.h
- # or a.out.h is usable for the purpose.
- #
- # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the
- # `struct exec' includes a second header that contains information that
- # duplicates the v7 fields that are needed.
-
- if test "x$DL_OBJS" = "xtclLoadAout.o" ; then
- { echo "$as_me:$LINENO: checking sys/exec.h" >&5
-echo $ECHO_N "checking sys/exec.h... $ECHO_C" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/exec.h>
-int
-main ()
-{
-
- struct exec foo;
- unsigned long seek;
- int flag;
-#if defined(__mips) || defined(mips)
- seek = N_TXTOFF (foo.ex_f, foo.ex_o);
-#else
- seek = N_TXTOFF (foo);
-#endif
- flag = (foo.a_magic == OMAGIC);
- return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- tcl_ok=usable
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- tcl_ok=unusable
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { echo "$as_me:$LINENO: result: $tcl_ok" >&5
-echo "${ECHO_T}$tcl_ok" >&6; }
- if test $tcl_ok = usable; then
- cat >>confdefs.h <<\_ACEOF
-#define USE_SYS_EXEC_H 1
-_ACEOF
-
- else
- { echo "$as_me:$LINENO: checking a.out.h" >&5
-echo $ECHO_N "checking a.out.h... $ECHO_C" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <a.out.h>
-int
-main ()
-{
-
- struct exec foo;
- unsigned long seek;
- int flag;
-#if defined(__mips) || defined(mips)
- seek = N_TXTOFF (foo.ex_f, foo.ex_o);
-#else
- seek = N_TXTOFF (foo);
-#endif
- flag = (foo.a_magic == OMAGIC);
- return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- tcl_ok=usable
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- tcl_ok=unusable
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { echo "$as_me:$LINENO: result: $tcl_ok" >&5
-echo "${ECHO_T}$tcl_ok" >&6; }
- if test $tcl_ok = usable; then
- cat >>confdefs.h <<\_ACEOF
-#define USE_A_OUT_H 1
-_ACEOF
-
- else
- { echo "$as_me:$LINENO: checking sys/exec_aout.h" >&5
-echo $ECHO_N "checking sys/exec_aout.h... $ECHO_C" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/exec_aout.h>
-int
-main ()
-{
-
- struct exec foo;
- unsigned long seek;
- int flag;
-#if defined(__mips) || defined(mips)
- seek = N_TXTOFF (foo.ex_f, foo.ex_o);
-#else
- seek = N_TXTOFF (foo);
-#endif
- flag = (foo.a_midmag == OMAGIC);
- return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- tcl_ok=usable
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- tcl_ok=unusable
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { echo "$as_me:$LINENO: result: $tcl_ok" >&5
-echo "${ECHO_T}$tcl_ok" >&6; }
- if test $tcl_ok = usable; then
- cat >>confdefs.h <<\_ACEOF
-#define USE_SYS_EXEC_AOUT_H 1
-_ACEOF
-
- else
- DL_OBJS=""
- fi
- fi
- fi
- fi
-
- # Step 5: disable dynamic loading if requested via a command-line switch.
-
- # Check whether --enable-load was given.
-if test "${enable_load+set}" = set; then
- enableval=$enable_load; tcl_ok=$enableval
-else
- tcl_ok=yes
-fi
-
- if test "$tcl_ok" = "no"; then
- DL_OBJS=""
- fi
-
- if test "x$DL_OBJS" != "x" ; then
- BUILD_DLTEST="\$(DLTEST_TARGETS)"
- else
- echo "Can't figure out how to do dynamic loading or shared libraries"
- echo "on this system."
- SHLIB_CFLAGS=""
- SHLIB_LD=""
- SHLIB_SUFFIX=""
- DL_OBJS="tclLoadNone.o"
- DL_LIBS=""
- LDFLAGS="$LDFLAGS_ORIG"
- LD_SEARCH_FLAGS=""
- BUILD_DLTEST=""
- fi
-
- # If we're running gcc, then change the C flags for compiling shared
- # libraries to the right flags for gcc, instead of those for the
- # standard manufacturer compiler.
-
- if test "$DL_OBJS" != "tclLoadNone.o" ; then
- if test "$GCC" = "yes" ; then
- case $system in
- AIX-*)
- ;;
- BSD/OS*)
- ;;
- IRIX*)
- ;;
- NetBSD-*|FreeBSD-*)
- ;;
- Darwin-*)
- ;;
- RISCos-*)
- ;;
- SCO_SV-3.2*)
- ;;
- ULTRIX-4.*)
- ;;
- windows)
- ;;
- *)
- SHLIB_CFLAGS="-fPIC"
- ;;
- esac
- fi
- fi
-
- if test "$SHARED_LIB_SUFFIX" = "" ; then
- SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'
- fi
- if test "$UNSHARED_LIB_SUFFIX" = "" ; then
- UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'
- fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- # These must be called after we do the basic CFLAGS checks and
- # verify any possible 64-bit or similar switches are necessary
-
- { echo "$as_me:$LINENO: checking for required early compiler flags" >&5
-echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6; }
- tcl_flags=""
-
- if test "${tcl_cv_flag__isoc99_source+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-int
-main ()
-{
-char *p = (char *)strtoll; char *q = (char *)strtoull;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- tcl_cv_flag__isoc99_source=no
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#define _ISOC99_SOURCE 1
-#include <stdlib.h>
-int
-main ()
-{
-char *p = (char *)strtoll; char *q = (char *)strtoull;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- tcl_cv_flag__isoc99_source=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- tcl_cv_flag__isoc99_source=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
- if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then
- cat >>confdefs.h <<\_ACEOF
-#define _ISOC99_SOURCE 1
-_ACEOF
-
- tcl_flags="$tcl_flags _ISOC99_SOURCE"
- fi
-
-
- if test "${tcl_cv_flag__largefile64_source+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat64 buf; int i = stat64("/", &buf);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- tcl_cv_flag__largefile64_source=no
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#define _LARGEFILE64_SOURCE 1
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat64 buf; int i = stat64("/", &buf);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- tcl_cv_flag__largefile64_source=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- tcl_cv_flag__largefile64_source=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
- if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then
- cat >>confdefs.h <<\_ACEOF
-#define _LARGEFILE64_SOURCE 1
-_ACEOF
-
- tcl_flags="$tcl_flags _LARGEFILE64_SOURCE"
- fi
-
- if test "x${tcl_flags}" = "x" ; then
- { echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6; }
- else
- { echo "$as_me:$LINENO: result: ${tcl_flags}" >&5
-echo "${ECHO_T}${tcl_flags}" >&6; }
- fi
-
-
- { echo "$as_me:$LINENO: checking for 64-bit integer type" >&5
-echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6; }
- if test "${tcl_cv_type_64bit+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- tcl_cv_type_64bit=none
- # See if the compiler knows natively about __int64
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-__int64 value = (__int64) 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- tcl_type_64bit=__int64
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- tcl_type_64bit="long long"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- # See if we should use long anyway Note that we substitute in the
- # type that is our current guess for a 64-bit type inside this check
- # program, so it should be modified only carefully...
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-switch (0) {
- case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
- }
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- tcl_cv_type_64bit=${tcl_type_64bit}
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
- if test "${tcl_cv_type_64bit}" = none ; then
- cat >>confdefs.h <<\_ACEOF
-#define TCL_WIDE_INT_IS_LONG 1
-_ACEOF
-
- { echo "$as_me:$LINENO: result: using long" >&5
-echo "${ECHO_T}using long" >&6; }
- elif test "${tcl_cv_type_64bit}" = "__int64" \
- -a "${TEA_PLATFORM}" = "windows" ; then
- # We actually want to use the default tcl.h checks in this
- # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
- { echo "$as_me:$LINENO: result: using Tcl header defaults" >&5
-echo "${ECHO_T}using Tcl header defaults" >&6; }
- else
- cat >>confdefs.h <<_ACEOF
-#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit}
-_ACEOF
-
- { echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5
-echo "${ECHO_T}${tcl_cv_type_64bit}" >&6; }
-
- # Now check for auxiliary declarations
- { echo "$as_me:$LINENO: checking for struct dirent64" >&5
-echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6; }
- if test "${tcl_cv_struct_dirent64+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/dirent.h>
-int
-main ()
-{
-struct dirent64 p;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- tcl_cv_struct_dirent64=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- tcl_cv_struct_dirent64=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
- if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_DIRENT64 1
-_ACEOF
-
- fi
- { echo "$as_me:$LINENO: result: ${tcl_cv_struct_dirent64}" >&5
-echo "${ECHO_T}${tcl_cv_struct_dirent64}" >&6; }
-
- { echo "$as_me:$LINENO: checking for struct stat64" >&5
-echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6; }
- if test "${tcl_cv_struct_stat64+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/stat.h>
-int
-main ()
-{
-struct stat64 p;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- tcl_cv_struct_stat64=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- tcl_cv_struct_stat64=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
- if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_STAT64 1
-_ACEOF
-
- fi
- { echo "$as_me:$LINENO: result: ${tcl_cv_struct_stat64}" >&5
-echo "${ECHO_T}${tcl_cv_struct_stat64}" >&6; }
-
- { echo "$as_me:$LINENO: checking for off64_t" >&5
-echo $ECHO_N "checking for off64_t... $ECHO_C" >&6; }
- if test "${tcl_cv_type_off64_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-int
-main ()
-{
-off64_t offset;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- tcl_cv_type_off64_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- tcl_cv_type_off64_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
- if test "x${tcl_cv_type_off64_t}" = "xyes" ; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_TYPE_OFF64_T 1
-_ACEOF
-
- fi
- { echo "$as_me:$LINENO: result: ${tcl_cv_type_off64_t}" >&5
-echo "${ECHO_T}${tcl_cv_type_off64_t}" >&6; }
- fi
-
-
-
-#--------------------------------------------------------------------
-# Set the default compiler switches based on the --enable-symbols
-# option.
-#--------------------------------------------------------------------
-
-
-
-
- DBGX=""
-
- { echo "$as_me:$LINENO: checking for build with symbols" >&5
-echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6; }
- # Check whether --enable-symbols was given.
-if test "${enable_symbols+set}" = set; then
- enableval=$enable_symbols; tcl_ok=$enableval
-else
- tcl_ok=no
-fi
-
- if test "$tcl_ok" = "no"; then
- CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}"
- LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- else
- CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
- LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
- if test "$tcl_ok" = "yes"; then
- { echo "$as_me:$LINENO: result: yes (standard debugging)" >&5
-echo "${ECHO_T}yes (standard debugging)" >&6; }
- fi
- fi
- if test "${TEA_PLATFORM}" != "windows" ; then
- LDFLAGS_DEFAULT="${LDFLAGS}"
- fi
-
-
-
-
-
- if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
- cat >>confdefs.h <<\_ACEOF
-#define TCL_MEM_DEBUG 1
-_ACEOF
-
- fi
-
- if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
- if test "$tcl_ok" = "all"; then
- { echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5
-echo "${ECHO_T}enabled symbols mem debugging" >&6; }
- else
- { echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5
-echo "${ECHO_T}enabled $tcl_ok debugging" >&6; }
- fi
- fi
-
-
-#--------------------------------------------------------------------
-# Everyone should be linking against the Tcl stub library. If you
-# can't for some reason, remove this definition. If you aren't using
-# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
-# link against the non-stubbed Tcl library.
-#--------------------------------------------------------------------
-
-if test "${SHARED_BUILD}" = "1" ; then
- cat >>confdefs.h <<\_ACEOF
-#define USE_TCL_STUBS 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define USE_TK_STUBS 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define USE_ITCL_STUBS 1
-_ACEOF
-
-fi
-
-#--------------------------------------------------------------------
-# This macro generates a line to use when building a library. It
-# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
-# and TEA_LOAD_TCLCONFIG macros above.
-#--------------------------------------------------------------------
-
-
- if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
- MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)"
- MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)"
- MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)"
- else
- MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)"
- MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
- MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)"
- fi
-
- if test "${SHARED_BUILD}" = "1" ; then
- MAKE_LIB="${MAKE_SHARED_LIB} "
- else
- MAKE_LIB="${MAKE_STATIC_LIB} "
- fi
-
- #--------------------------------------------------------------------
- # Shared libraries and static libraries have different names.
- # Use the double eval to make sure any variables in the suffix is
- # substituted. (@@@ Might not be necessary anymore)
- #--------------------------------------------------------------------
-
- if test "${TEA_PLATFORM}" = "windows" ; then
- if test "${SHARED_BUILD}" = "1" ; then
- # We force the unresolved linking of symbols that are really in
- # the private libraries of Tcl and Tk.
- SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
- if test x"${TK_BIN_DIR}" != x ; then
- SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
- fi
- eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
- else
- eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
- fi
- # Some packages build there own stubs libraries
- if test "$GCC" = "yes"; then
- eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
- else
- eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
- fi
-
- # These aren't needed on Windows (either MSVC or gcc)
- RANLIB=:
- RANLIB_STUB=:
- else
- RANLIB_STUB="${RANLIB}"
- if test "${SHARED_BUILD}" = "1" ; then
- SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
- if test x"${TK_BIN_DIR}" != x ; then
- SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
- fi
- eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
- RANLIB=:
- else
- eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
- fi
- # Some packages build there own stubs libraries
- eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
- fi
-
- # These are escaped so that only CFLAGS is picked up at configure time.
- # The other values will be substituted at make time.
- CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
- if test "${SHARED_BUILD}" = "1" ; then
- CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
- fi
-
-
-
-
-
-
-
-
-#--------------------------------------------------------------------
-# __CHANGE__
-# Add platform libs to LIBS or SHLIB_LD_LIBS as necessary.
-#--------------------------------------------------------------------
-
-if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then
- SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${itcl_STUB_LIB_PATH}`\""
-else
- SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${itcl_STUB_LIB_SPEC}"
-fi
-
-#--------------------------------------------------------------------
-# __CHANGE__
-# Change the name from exampeA_LIB_FILE to match your package name.
-# Use the stub_LIB_FILE substitution if your package creates a stub
-# library.
-#--------------------------------------------------------------------
-
-itk_STUB_LIB_FILE=${PKG_STUB_LIB_FILE}
-itk_LIB_FILE=${PKG_LIB_FILE}
-
-
-
-#--------------------------------------------------------------------
-# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
-# file during the install process. Don't run the TCLSH_PROG through
-# ${CYGPATH} because it's being used directly by make.
-# Require that we use a tclsh shell version 8.2 or later since earlier
-# versions have bugs in the pkg_mkIndex routine.
-#--------------------------------------------------------------------
-
-
- # Allow the user to provide this setting in the env
- if test "x${TCLSH_PROG}" = "x" ; then
- { echo "$as_me:$LINENO: checking for tclsh" >&5
-echo $ECHO_N "checking for tclsh... $ECHO_C" >&6; }
-
- if test "${ac_cv_path_tclsh+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- search_path=`echo ${PATH} | sed -e 's/:/ /g'`
- if test "${TEA_PLATFORM}" != "windows" -o \
- \( "$do64bit_ok" = "no" -a "$doWince" = "no" \) ; then
- # Do not allow target tclsh in known cross-compile builds,
- # as we need one we can run on this system
- search_path="${TCL_BIN_DIR} ${TCL_BIN_DIR}/../bin ${exec_prefix}/bin ${prefix}/bin ${search_path}"
- fi
- for dir in $search_path ; do
- for j in `ls -r $dir/tclsh[8-9]*${EXEEXT} 2> /dev/null` \
- `ls -r $dir/tclsh*${EXEEXT} 2> /dev/null` ; do
- if test x"$ac_cv_path_tclsh" = x ; then
- if test -f "$j" ; then
- ac_cv_path_tclsh=$j
- break
- fi
- fi
- done
- done
-
-fi
-
-
- if test -f "$ac_cv_path_tclsh" ; then
- TCLSH_PROG=$ac_cv_path_tclsh
- { echo "$as_me:$LINENO: result: $TCLSH_PROG" >&5
-echo "${ECHO_T}$TCLSH_PROG" >&6; }
- else
- { { echo "$as_me:$LINENO: error: No tclsh found in PATH: $search_path" >&5
-echo "$as_me: error: No tclsh found in PATH: $search_path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-
-
-
- # Allow the user to provide this setting in the env
- if test "x${WISH_PROG}" = "x" ; then
- { echo "$as_me:$LINENO: checking for wish" >&5
-echo $ECHO_N "checking for wish... $ECHO_C" >&6; }
-
- if test "${ac_cv_path_wish+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- search_path=`echo ${PATH} | sed -e 's/:/ /g'`
- if test "${TEA_PLATFORM}" != "windows" -o \
- \( "$do64bit_ok" = "no" -a "$doWince" = "no" \) ; then
- # Do not allow target wish in known cross-compile builds,
- # as we need one we can run on this system
- search_path="${TK_BIN_DIR} ${TK_BIN_DIR}/../bin ${TCL_BIN_DIR} ${TCL_BIN_DIR}/../bin ${exec_prefix}/bin ${prefix}/bin ${search_path}"
- fi
- for dir in $search_path ; do
- for j in `ls -r $dir/wish[8-9]*${EXEEXT} 2> /dev/null` \
- `ls -r $dir/wish*${EXEEXT} 2> /dev/null` ; do
- if test x"$ac_cv_path_wish" = x ; then
- if test -f "$j" ; then
- ac_cv_path_wish=$j
- break
- fi
- fi
- done
- done
-
-fi
-
-
- if test -f "$ac_cv_path_wish" ; then
- WISH_PROG=$ac_cv_path_wish
- { echo "$as_me:$LINENO: result: $WISH_PROG" >&5
-echo "${ECHO_T}$WISH_PROG" >&6; }
- else
- { { echo "$as_me:$LINENO: error: No wish found in PATH: $search_path" >&5
-echo "$as_me: error: No wish found in PATH: $search_path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-
-
-
-#--------------------------------------------------------------------
-# These are for itkConfig.sh
-#--------------------------------------------------------------------
-
-# pkglibdir must be a fully qualified path and (not ${exec_prefix/lib)
-eval pkglibdir="${libdir}/${PACKAGE_NAME}${PACKAGE_VERSION}"
-if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
- eval itk_LIB_FLAG="-litk${PACKAGE_VERSION}${DBGX}"
- eval itk_STUB_LIB_FLAG="-litclstub${PACKAGE_VERSION}${DBGX}"
-else
- eval itk_LIB_FLAG="-litcl`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
- eval itk_STUB_LIB_FLAG="-litcl`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
-fi
-itk_BUILD_LIB_SPEC="-L`pwd` ${itk_LIB_FLAG}"
-itk_LIB_SPEC="-L${pkglibdir} ${itk_LIB_FLAG}"
-
-itk_BUILD_STUB_LIB_SPEC="-L`pwd` ${itk_STUB_LIB_FLAG}"
-itk_STUB_LIB_SPEC="-L${pkglibdir} ${itk_STUB_LIB_FLAG}"
-itk_BUILD_STUB_LIB_PATH="`pwd`/${itk_STUB_LIB_FILE}"
-itk_STUB_LIB_PATH="${pkglibdir}/${itk_STUB_LIB_FILE}"
-
-
-
-
-
-
-
-
-# itk_SRC_DIR must be a fully qualified path
-eval itk_SRC_DIR="$srcdir"
-itk_SRC_DIR=`cd "${itk_SRC_DIR}"; pwd`
-
-
-#--------------------------------------------------------------------
-# Finally, substitute all of the various values into the Makefile.
-#--------------------------------------------------------------------
-
-ac_config_files="$ac_config_files Makefile pkgIndex.tcl itkConfig.sh"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- test "x$cache_file" != "x/dev/null" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
- else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-ac_script='
-t clear
-:clear
-s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-b any
-:quote
-s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
-s/\[/\\&/g
-s/\]/\\&/g
-s/\$/$$/g
-H
-:any
-${
- g
- s/^\n//
- s/\n/ /g
- p
-}
-'
-DEFS=`sed -n "$ac_script" confdefs.h`
-
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-
-# Save the log message, to keep $[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by itk $as_me 3.3, which was
-generated by GNU Autoconf 2.61. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-# Files that config.status was made for.
-config_files="$ac_config_files"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Report bugs to <bug-autoconf@gnu.org>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-itk config.status 3.3
-configured by $0, generated by GNU Autoconf 2.61,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2006 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- echo "$ac_cs_version"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --he | --h | --help | --hel | -h )
- echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
- export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "pkgIndex.tcl") CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;;
- "itkConfig.sh") CONFIG_FILES="$CONFIG_FILES itkConfig.sh" ;;
-
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp=
- trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
-' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "$CONFIG_FILES"; then
-
-_ACEOF
-
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-CYGPATH!$CYGPATH$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-PKG_LIB_FILE!$PKG_LIB_FILE$ac_delim
-PKG_STUB_LIB_FILE!$PKG_STUB_LIB_FILE$ac_delim
-PKG_STUB_SOURCES!$PKG_STUB_SOURCES$ac_delim
-PKG_STUB_OBJECTS!$PKG_STUB_OBJECTS$ac_delim
-PKG_TCL_SOURCES!$PKG_TCL_SOURCES$ac_delim
-PKG_HEADERS!$PKG_HEADERS$ac_delim
-PKG_INCLUDES!$PKG_INCLUDES$ac_delim
-PKG_LIBS!$PKG_LIBS$ac_delim
-PKG_CFLAGS!$PKG_CFLAGS$ac_delim
-LN_S!$LN_S$ac_delim
-CONFIG_CLEAN_FILES!$CONFIG_CLEAN_FILES$ac_delim
-TCL_VERSION!$TCL_VERSION$ac_delim
-TCL_BIN_DIR!$TCL_BIN_DIR$ac_delim
-TCL_SRC_DIR!$TCL_SRC_DIR$ac_delim
-TCL_LIB_FILE!$TCL_LIB_FILE$ac_delim
-TCL_LIB_FLAG!$TCL_LIB_FLAG$ac_delim
-TCL_LIB_SPEC!$TCL_LIB_SPEC$ac_delim
-TCL_STUB_LIB_FILE!$TCL_STUB_LIB_FILE$ac_delim
-TCL_STUB_LIB_FLAG!$TCL_STUB_LIB_FLAG$ac_delim
-TCL_STUB_LIB_SPEC!$TCL_STUB_LIB_SPEC$ac_delim
-TCL_LIBS!$TCL_LIBS$ac_delim
-TCL_DEFS!$TCL_DEFS$ac_delim
-TCL_EXTRA_CFLAGS!$TCL_EXTRA_CFLAGS$ac_delim
-TCL_LD_FLAGS!$TCL_LD_FLAGS$ac_delim
-TCL_SHLIB_LD_LIBS!$TCL_SHLIB_LD_LIBS$ac_delim
-TK_VERSION!$TK_VERSION$ac_delim
-TK_BIN_DIR!$TK_BIN_DIR$ac_delim
-TK_SRC_DIR!$TK_SRC_DIR$ac_delim
-TK_LIB_FILE!$TK_LIB_FILE$ac_delim
-TK_LIB_FLAG!$TK_LIB_FLAG$ac_delim
-TK_LIB_SPEC!$TK_LIB_SPEC$ac_delim
-TK_STUB_LIB_FILE!$TK_STUB_LIB_FILE$ac_delim
-TK_STUB_LIB_FLAG!$TK_STUB_LIB_FLAG$ac_delim
-TK_STUB_LIB_SPEC!$TK_STUB_LIB_SPEC$ac_delim
-TK_LIBS!$TK_LIBS$ac_delim
-TK_XINCLUDES!$TK_XINCLUDES$ac_delim
-itcl_VERSION!$itcl_VERSION$ac_delim
-itcl_BIN_DIR!$itcl_BIN_DIR$ac_delim
-itcl_SRC_DIR!$itcl_SRC_DIR$ac_delim
-itcl_LIB_FILE!$itcl_LIB_FILE$ac_delim
-itcl_LIB_SPEC!$itcl_LIB_SPEC$ac_delim
-itcl_STUB_LIB_FILE!$itcl_STUB_LIB_FILE$ac_delim
-itcl_STUB_LIB_SPEC!$itcl_STUB_LIB_SPEC$ac_delim
-itcl_STUB_LIB_PATH!$itcl_STUB_LIB_PATH$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-CPP!$CPP$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-SET_MAKE!$SET_MAKE$ac_delim
-RANLIB!$RANLIB$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-CEOF$ac_eof
-_ACEOF
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-MATH_LIBS!$MATH_LIBS$ac_delim
-PKG_SOURCES!$PKG_SOURCES$ac_delim
-PKG_OBJECTS!$PKG_OBJECTS$ac_delim
-CLEANFILES!$CLEANFILES$ac_delim
-TCL_TOP_DIR_NATIVE!$TCL_TOP_DIR_NATIVE$ac_delim
-TCL_GENERIC_DIR_NATIVE!$TCL_GENERIC_DIR_NATIVE$ac_delim
-TCL_UNIX_DIR_NATIVE!$TCL_UNIX_DIR_NATIVE$ac_delim
-TCL_WIN_DIR_NATIVE!$TCL_WIN_DIR_NATIVE$ac_delim
-TCL_BMAP_DIR_NATIVE!$TCL_BMAP_DIR_NATIVE$ac_delim
-TCL_TOOL_DIR_NATIVE!$TCL_TOOL_DIR_NATIVE$ac_delim
-TCL_PLATFORM_DIR_NATIVE!$TCL_PLATFORM_DIR_NATIVE$ac_delim
-TCL_INCLUDES!$TCL_INCLUDES$ac_delim
-TK_TOP_DIR_NATIVE!$TK_TOP_DIR_NATIVE$ac_delim
-TK_UNIX_DIR_NATIVE!$TK_UNIX_DIR_NATIVE$ac_delim
-TK_WIN_DIR_NATIVE!$TK_WIN_DIR_NATIVE$ac_delim
-TK_GENERIC_DIR_NATIVE!$TK_GENERIC_DIR_NATIVE$ac_delim
-TK_XLIB_DIR_NATIVE!$TK_XLIB_DIR_NATIVE$ac_delim
-TK_PLATFORM_DIR_NATIVE!$TK_PLATFORM_DIR_NATIVE$ac_delim
-TK_INCLUDES!$TK_INCLUDES$ac_delim
-XMKMF!$XMKMF$ac_delim
-SHARED_BUILD!$SHARED_BUILD$ac_delim
-AR!$AR$ac_delim
-TCLSH_PROG!$TCLSH_PROG$ac_delim
-CELIB_DIR!$CELIB_DIR$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-DL_LIBS!$DL_LIBS$ac_delim
-CFLAGS_DEBUG!$CFLAGS_DEBUG$ac_delim
-CFLAGS_OPTIMIZE!$CFLAGS_OPTIMIZE$ac_delim
-CFLAGS_WARNING!$CFLAGS_WARNING$ac_delim
-STLIB_LD!$STLIB_LD$ac_delim
-SHLIB_LD!$SHLIB_LD$ac_delim
-SHLIB_CFLAGS!$SHLIB_CFLAGS$ac_delim
-SHLIB_LD_LIBS!$SHLIB_LD_LIBS$ac_delim
-LDFLAGS_DEBUG!$LDFLAGS_DEBUG$ac_delim
-LDFLAGS_OPTIMIZE!$LDFLAGS_OPTIMIZE$ac_delim
-LD_LIBRARY_PATH_VAR!$LD_LIBRARY_PATH_VAR$ac_delim
-TCL_DBGX!$TCL_DBGX$ac_delim
-CFLAGS_DEFAULT!$CFLAGS_DEFAULT$ac_delim
-LDFLAGS_DEFAULT!$LDFLAGS_DEFAULT$ac_delim
-MAKE_LIB!$MAKE_LIB$ac_delim
-MAKE_SHARED_LIB!$MAKE_SHARED_LIB$ac_delim
-MAKE_STATIC_LIB!$MAKE_STATIC_LIB$ac_delim
-MAKE_STUB_LIB!$MAKE_STUB_LIB$ac_delim
-RANLIB_STUB!$RANLIB_STUB$ac_delim
-itk_STUB_LIB_FILE!$itk_STUB_LIB_FILE$ac_delim
-itk_LIB_FILE!$itk_LIB_FILE$ac_delim
-WISH_PROG!$WISH_PROG$ac_delim
-itk_BUILD_LIB_SPEC!$itk_BUILD_LIB_SPEC$ac_delim
-itk_LIB_SPEC!$itk_LIB_SPEC$ac_delim
-itk_BUILD_STUB_LIB_SPEC!$itk_BUILD_STUB_LIB_SPEC$ac_delim
-itk_STUB_LIB_SPEC!$itk_STUB_LIB_SPEC$ac_delim
-itk_BUILD_STUB_LIB_PATH!$itk_BUILD_STUB_LIB_PATH$ac_delim
-itk_STUB_LIB_PATH!$itk_STUB_LIB_PATH$ac_delim
-itk_SRC_DIR!$itk_SRC_DIR$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 55; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
-_ACEOF
-
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
-s/:*$//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-fi # test -n "$CONFIG_FILES"
-
-
-for ac_tag in :F $CONFIG_FILES
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
- { (exit 1); exit 1; }; };;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
- { (exit 1); exit 1; }; };;
- esac
- ac_file_inputs="$ac_file_inputs $ac_f"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input="Generated from "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- fi
-
- case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- { as_dir="$ac_dir"
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-
-case `sed -n '/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&2;}
-
- rm -f "$tmp/stdin"
- case $ac_file in
- -) cat "$tmp/out"; rm -f "$tmp/out";;
- *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
- esac
- ;;
-
-
-
- esac
-
-done # for ac_tag
-
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
diff --git a/itcl/itk/configure.ac b/itcl/itk/configure.ac
deleted file mode 100644
index 0dc9cfb7fc4..00000000000
--- a/itcl/itk/configure.ac
+++ /dev/null
@@ -1,275 +0,0 @@
-#!/bin/bash -norc
-#--------------------------------------------------------------------
-# Sample configure.in for Tcl Extensions. The only places you should
-# need to modify this file are marked by the string __CHANGE__
-#--------------------------------------------------------------------
-
-#-----------------------------------------------------------------------
-# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
-# set as provided. These will also be added as -D defs in your Makefile
-# so you can encode the package version directly into the source files.
-#-----------------------------------------------------------------------
-
-AC_INIT([itk], [3.3])
-
-#--------------------------------------------------------------------
-# Call TEA_INIT as the first TEA_ macro to set up initial vars.
-# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
-# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
-#--------------------------------------------------------------------
-
-TEA_INIT([3.2])
-
-AC_PROG_LN_S
-CONFIG_CLEAN_FILES=
-if test ! -d $srcdir/tclconfig ; then
- if test -d $srcdir/../tclconfig ; then
- $LN_S $srcdir/../tclconfig tclconfig
- CONFIG_CLEAN_FILES=tclconfig
- fi
-fi
-AC_SUBST(CONFIG_CLEAN_FILES)
-
-AC_CONFIG_AUX_DIR(tclconfig)
-
-#--------------------------------------------------------------------
-# Load the tclConfig.sh file
-#--------------------------------------------------------------------
-
-TEA_PATH_TCLCONFIG
-TEA_LOAD_TCLCONFIG
-
-#--------------------------------------------------------------------
-# Load the tkConfig.sh file
-#--------------------------------------------------------------------
-
-TEA_PATH_TKCONFIG
-TEA_LOAD_TKCONFIG
-
-TEA_PATH_CONFIG(itcl)
-TEA_LOAD_CONFIG(itcl)
-
-ITCL_INCLUDES="-I\"`${CYGPATH} ${itcl_SRC_DIR}/generic`\""
-
-#--------------------------------------------------------------------
-# Handle the --prefix=... option by defaulting to what Tcl gave.
-# Must be called after TEA_LOAD_TCLCONFIG and before $prefix is used.
-#--------------------------------------------------------------------
-
-TEA_PREFIX
-
-#------------------------------------------------------------------------
-# Standard compiler checks.
-# This sets up CC by using the CC env var, or looks for gcc otherwise.
-# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
-# the basic setup necessary to compile executables.
-#------------------------------------------------------------------------
-
-TEA_SETUP_COMPILER
-
-#-----------------------------------------------------------------------
-# __CHANGE__
-# Specify the C source files to compile in TEA_ADD_SOURCES,
-# public headers that need to be installed in TEA_ADD_HEADERS,
-# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
-# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
-# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
-# and PKG_TCL_SOURCES.
-#-----------------------------------------------------------------------
-
-TEA_ADD_SOURCES([itk_cmds.c
- itk_option.c
- itk_archetype.c
- itk_util.c
- itkStubInit.c])
-TEA_ADD_HEADERS([generic/itk.h generic/itkDecls.h])
-TEA_ADD_INCLUDES([${ITCL_INCLUDES} -I\"`${CYGPATH} ${srcdir}/generic`\"])
-TEA_ADD_LIBS([])
-TEA_ADD_CFLAGS([])
-#TEA_ADD_STUB_SOURCES([itkStubLib.c])
-TEA_ADD_TCL_SOURCES([library/Archetype.itk
- library/Toplevel.itk
- library/Widget.itk
- library/itk.tcl
- library/tclIndex])
-
-#--------------------------------------------------------------------
-# __CHANGE__
-# A few miscellaneous platform-specific items:
-#
-# Define a special symbol for Windows (BUILD_itk in this case) so
-# that we create the export library with the dll. See sha1.h on how
-# to use this.
-#
-# Windows creates a few extra files that need to be cleaned up.
-# You can add more files to clean if your extension creates any extra
-# files.
-#
-# Define any extra compiler flags in the PACKAGE_CFLAGS variable.
-# These will be appended to the current set of compiler flags for
-# your system.
-#--------------------------------------------------------------------
-
-if test "${TEA_PLATFORM}" = "windows" ; then
- AC_DEFINE(BUILD_itk)
- CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch"
- TEA_ADD_SOURCES([dllEntryPoint.c])
-else
- CLEANFILES=
-fi
-
-AC_SUBST(CLEANFILES)
-
-#--------------------------------------------------------------------
-# __CHANGE__
-# Choose which headers you need. Extension authors should try very
-# hard to only rely on the Tcl public header files. Internal headers
-# contain private data structures and are subject to change without
-# notice.
-# This must be done AFTER calling TEA_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG
-# so that we can extract TCL_SRC_DIR from the config file (in the case
-# of private headers
-#--------------------------------------------------------------------
-
-#TEA_PUBLIC_TCL_HEADERS
-TEA_PRIVATE_TCL_HEADERS
-
-#TEA_PUBLIC_TK_HEADERS
-TEA_PRIVATE_TK_HEADERS
-
-#--------------------------------------------------------------------
-# For Unix/Tk builds, make sure that the X libraries/headers are found.
-#--------------------------------------------------------------------
-
-TEA_PATH_X
-
-#--------------------------------------------------------------------
-# We need to enable the threading macros found in tcl.h and tclInt.h.
-# The use of the threading features is determined by the core the
-# extension is loaded into, but we need to compile with these macros
-# turned on.
-#--------------------------------------------------------------------
-
-AC_DEFINE(TCL_THREADS)
-#--------------------------------------------------------------------
-# Check whether --enable-threads or --disable-threads was given.
-# This auto-enables if Tcl was compiled threaded.
-#--------------------------------------------------------------------
-
-#TEA_ENABLE_THREADS
-
-#--------------------------------------------------------------------
-# The statement below defines a collection of symbols related to
-# building as a shared library instead of a static library.
-#--------------------------------------------------------------------
-
-TEA_ENABLE_SHARED
-
-#--------------------------------------------------------------------
-# This macro figures out what flags to use with the compiler/linker
-# when building shared/static debug/optimized objects. This information
-# is all taken from the tclConfig.sh file.
-#--------------------------------------------------------------------
-
-TEA_CONFIG_CFLAGS
-
-#--------------------------------------------------------------------
-# Set the default compiler switches based on the --enable-symbols
-# option.
-#--------------------------------------------------------------------
-
-TEA_ENABLE_SYMBOLS
-
-#--------------------------------------------------------------------
-# Everyone should be linking against the Tcl stub library. If you
-# can't for some reason, remove this definition. If you aren't using
-# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
-# link against the non-stubbed Tcl library.
-#--------------------------------------------------------------------
-
-if test "${SHARED_BUILD}" = "1" ; then
- AC_DEFINE(USE_TCL_STUBS)
- AC_DEFINE(USE_TK_STUBS)
- AC_DEFINE(USE_ITCL_STUBS)
-fi
-
-#--------------------------------------------------------------------
-# This macro generates a line to use when building a library. It
-# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
-# and TEA_LOAD_TCLCONFIG macros above.
-#--------------------------------------------------------------------
-
-TEA_MAKE_LIB
-
-#--------------------------------------------------------------------
-# __CHANGE__
-# Add platform libs to LIBS or SHLIB_LD_LIBS as necessary.
-#--------------------------------------------------------------------
-
-if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then
- SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${itcl_STUB_LIB_PATH}`\""
-else
- SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${itcl_STUB_LIB_SPEC}"
-fi
-
-#--------------------------------------------------------------------
-# __CHANGE__
-# Change the name from exampeA_LIB_FILE to match your package name.
-# Use the stub_LIB_FILE substitution if your package creates a stub
-# library.
-#--------------------------------------------------------------------
-
-itk_STUB_LIB_FILE=${PKG_STUB_LIB_FILE}
-itk_LIB_FILE=${PKG_LIB_FILE}
-AC_SUBST(itk_STUB_LIB_FILE)
-AC_SUBST(itk_LIB_FILE)
-
-#--------------------------------------------------------------------
-# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
-# file during the install process. Don't run the TCLSH_PROG through
-# ${CYGPATH} because it's being used directly by make.
-# Require that we use a tclsh shell version 8.2 or later since earlier
-# versions have bugs in the pkg_mkIndex routine.
-#--------------------------------------------------------------------
-
-TEA_PROG_TCLSH
-TEA_PROG_WISH
-
-#--------------------------------------------------------------------
-# These are for itkConfig.sh
-#--------------------------------------------------------------------
-
-# pkglibdir must be a fully qualified path and (not ${exec_prefix/lib)
-eval pkglibdir="${libdir}/${PACKAGE_NAME}${PACKAGE_VERSION}"
-if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
- eval itk_LIB_FLAG="-litk${PACKAGE_VERSION}${DBGX}"
- eval itk_STUB_LIB_FLAG="-litclstub${PACKAGE_VERSION}${DBGX}"
-else
- eval itk_LIB_FLAG="-litcl`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
- eval itk_STUB_LIB_FLAG="-litcl`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
-fi
-itk_BUILD_LIB_SPEC="-L`pwd` ${itk_LIB_FLAG}"
-itk_LIB_SPEC="-L${pkglibdir} ${itk_LIB_FLAG}"
-
-itk_BUILD_STUB_LIB_SPEC="-L`pwd` ${itk_STUB_LIB_FLAG}"
-itk_STUB_LIB_SPEC="-L${pkglibdir} ${itk_STUB_LIB_FLAG}"
-itk_BUILD_STUB_LIB_PATH="`pwd`/${itk_STUB_LIB_FILE}"
-itk_STUB_LIB_PATH="${pkglibdir}/${itk_STUB_LIB_FILE}"
-
-AC_SUBST(itk_BUILD_LIB_SPEC)
-AC_SUBST(itk_LIB_SPEC)
-AC_SUBST(itk_BUILD_STUB_LIB_SPEC)
-AC_SUBST(itk_STUB_LIB_SPEC)
-AC_SUBST(itk_BUILD_STUB_LIB_PATH)
-AC_SUBST(itk_STUB_LIB_PATH)
-
-# itk_SRC_DIR must be a fully qualified path
-eval itk_SRC_DIR="$srcdir"
-itk_SRC_DIR=`cd "${itk_SRC_DIR}"; pwd`
-AC_SUBST(itk_SRC_DIR)
-
-#--------------------------------------------------------------------
-# Finally, substitute all of the various values into the Makefile.
-#--------------------------------------------------------------------
-
-AC_OUTPUT([Makefile pkgIndex.tcl itkConfig.sh])
diff --git a/itcl/itk/itkConfig.sh.in b/itcl/itk/itkConfig.sh.in
deleted file mode 100644
index f36dee23900..00000000000
--- a/itcl/itk/itkConfig.sh.in
+++ /dev/null
@@ -1,58 +0,0 @@
-# itkConfig.sh --
-#
-# This shell script (for sh) is generated automatically by Itk's
-# configure script. It will create shell variables for most of
-# the configuration options discovered by the configure script.
-# This script is intended to be included by the configure scripts
-# for Itk extensions so that they don't have to figure this all
-# out for themselves. This file does not duplicate information
-# already provided by tclConfig.sh, tkConfig.sh or itclConfig.sh,
-# so you may need to use those files in addition to this one.
-#
-# The information in this file is specific to a single platform.
-
-# Itcl's version number.
-itk_VERSION='@PACKAGE_VERSION@'
-ITK_VERSION='@PACKAGE_VERSION@'
-
-# The name of the Itk library (may be either a .a file or a shared library):
-itk_LIB_FILE=@itk_LIB_FILE@
-ITK_LIB_FILE=@itk_LIB_FILE@
-
-# String to pass to linker to pick up the Itk library from its
-# build directory.
-itk_BUILD_LIB_SPEC='@itk_BUILD_LIB_SPEC@'
-ITK_BUILD_LIB_SPEC='@itk_BUILD_LIB_SPEC@'
-
-# String to pass to linker to pick up the Itk library from its
-# installed directory.
-itk_LIB_SPEC='@itk_LIB_SPEC@'
-ITK_LIB_SPEC='@itk_LIB_SPEC@'
-
-# The name of the Itk stub library (a .a file):
-itk_STUB_LIB_FILE=@itk_STUB_LIB_FILE@
-ITK_STUB_LIB_FILE=@itk_STUB_LIB_FILE@
-
-# String to pass to linker to pick up the Itk stub library from its
-# build directory.
-itk_BUILD_STUB_LIB_SPEC='@itk_BUILD_STUB_LIB_SPEC@'
-ITK_BUILD_STUB_LIB_SPEC='@itk_BUILD_STUB_LIB_SPEC@'
-
-# String to pass to linker to pick up the Itk stub library from its
-# installed directory.
-itk_STUB_LIB_SPEC='@itk_STUB_LIB_SPEC@'
-ITK_STUB_LIB_SPEC='@itk_STUB_LIB_SPEC@'
-
-# String to pass to linker to pick up the Itk stub library from its
-# build directory.
-itk_BUILD_STUB_LIB_PATH='@itk_BUILD_STUB_LIB_PATH@'
-ITK_BUILD_STUB_LIB_PATH='@itk_BUILD_STUB_LIB_PATH@'
-
-# Location of the top-level source directories from which [incr Tk]
-# was built. This is the directory that contains a README file as well
-# as subdirectories such as generic, unix, etc. If [incr Tk] was
-# compiled in a different place than the directory containing the source
-# files, this points to the location of the sources, not the location
-# where [incr Tk] was compiled.
-itk_SRC_DIR='@itk_SRC_DIR@'
-ITK_SRC_DIR='@itk_SRC_DIR@'
diff --git a/ld/ChangeLog b/ld/ChangeLog
deleted file mode 100644
index 534a2709d69..00000000000
--- a/ld/ChangeLog
+++ /dev/null
@@ -1,664 +0,0 @@
-2008-08-04 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am (POTFILES.in): Set LC_ALL=C.
- * Makefile.in: Regenerate.
- * po/POTFILES.in: Regenerate.
-
-2008-08-03 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am (spu_ovl.o): Merge rule into..
- (spu_ovl.o_c): ..this one. Only run cpp for spu target.
- * Makefile.in: Regenerate.
-
-2008-08-02 Jan Kratochvil <jan.kratochvil@redhat.com>
-
- Include the spu_ovl ASCII form in the repository files.
- * emultempl/spuelf.em: No longer use `bin2c', use now `spu_ovl.o_c'.
- * Makefile.am (eelf32_spu.c): Depend now on `spu_ovl.o_c'.
- ($(srcdir)/emultempl/spu_ovl.o_c): New target.
- ($(srcdir)/emultempl/spu_ovl.o): Rename to...
- (spu_ovl.o): ...this one.
- * Makefile.in: Regenerate.
- * emultempl/spu_ovl.o_c: New file.
- * emultempl/spu_ovl.o: File removed.
-
-2008-07-31 Takashi Ono <t_ono@hkfreak.net>
-
- * pe-dll.c (generate_relocs): Don't generate relocs for
- undefined weak symbols.
-
-2008-07-31 Jan Kratochvil <jan.kratochvil@redhat.com>
-
- * emultempl/spuelf.em: Abort on the missing required `spu_ovl.o'.
-
-2008-07-30 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/pe.em, emultempl/pep.em: Silence gcc warnings.
-
-2008-07-18 Joseph Myers <joseph@codesourcery.com>
-
- * ld.texinfo (--no-wchar-size-warning): Document new ARM option.
- * emultempl/armelf.em (no_wchar_size_warning): New.
- (arm_elf_create_output_section_statements): Pass
- no_wchar_size_warning to arm_elf_create_output_section_statements.
- (OPTION_NO_WCHAR_SIZE_WARNING): New.
- (PARSE_AND_LIST_LONGOPTS): Add no-wchar-size-warning.
- (PARSE_AND_LIST_OPTIONS): List --no-wchar-size-warning.
- (PARSE_AND_LIST_ARGS_CASES): Handle --no-wchar-size-warning.
-
-2008-07-15 Jie Zhang <jie.zhang@analog.com>
-
- * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define.
-
-2008-07-12 Craig Silverstein <csilvers@google.com>
-
- PR ld/6741
- * configure.in: Check for, and include, libz.a if it is present.
- * configure: Regenerate.
- * config.in: Regenerate.
-
-2008-07-12 Jie Zhang <jie.zhang@analog.com>
-
- Revert
- 2008-07-12 Jie Zhang <jie.zhang@analog.com>
- * Makefile.am (eelf32bfin.c): Depend on bfin.em.
- (eelf32bfinfd.c): Likewise.
- * Makefile.in: Regenerate.
- * gen-doc.texi: Set Blackfin.
- * ld.texinfo: Document --sep-code and Blackfin specific
- options.
- * ldmain.c (main): Initialize link_info.sep_code.
- * lexsup.c (enum option_values): Add OPTION_SEP_CODE.
- (ld_options[]): Add --sep-code.
- (parse_args): Deal with --sep-code.
- * emulparams/bfin.sh (EXTRA_EM_FILE): Define.
- * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define.
- * emultempl/bfin.em: New file.
-
-2008-07-12 Jie Zhang <jie.zhang@analog.com>
-
- * Makefile.am (eelf32bfin.c): Depend on bfin.em.
- (eelf32bfinfd.c): Likewise.
- * Makefile.in: Regenerate.
- * gen-doc.texi: Set Blackfin.
- * ld.texinfo: Document --sep-code and Blackfin specific
- options.
- * ldmain.c (main): Initialize link_info.sep_code.
- * lexsup.c (enum option_values): Add OPTION_SEP_CODE.
- (ld_options[]): Add --sep-code.
- (parse_args): Deal with --sep-code.
- * emulparams/bfin.sh (EXTRA_EM_FILE): Define.
- * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define.
- * emultempl/bfin.em: New file.
-
-2008-07-09 Danny Smith <dannysmith@users.sourceforge.net>
-
- *pe-dll.c (autofilter_symbolprefixlist): Excude all symbols
- starting with ".".
- Exclude "_IMPORT_DESCRIPTOR_".
- (autofilter_symbolsuffixlist): Exclude "_NULL_THUNK_DATA".
- (autofilter_symbollist_generic): Don't check for ".text".
- Exclude "_NULL_IMPORT_DESCRIPTOR".
- (autofilter_symbollist_i386): Likewise.
-
-2008-07-07 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/armelf.em (elf32_arm_add_stub_section): Use
- bfd_make_section_with_flags.
- * emultempl/avrelf.em (avr_elf_create_output_section_statements):
- Likewise.
- * emultempl/hppaelf.em (hppaelf_add_stub_section): Likewise.
- * emultempl/m68hc1xelf.em (m68hc11elf_add_stub_section): Likewise.
- * emultempl/m68kcoff.em (gld${EMULATION_NAME}_after_open): Likewise.
- * emultempl/m68kelf.em (m68k_elf_after_open): Likewise.
- * emultempl/ppc64elf.em (ppc_add_stub_section): Likewise.
- * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation):
- Likewise.
-
-2008-07-06 Nathan Sidwell <nathan@codesourcery.com>
-
- * ld.texinfo (File Commands): Document that INCLUDE can be used in
- several different places.
- * ldgram.y (statement, memory_spec, section): Allow INCLUDE.
- (memory, memory_spec_list): Simplify BNF
- (memory_spec_list_opt): New rule.
- * ldlex.l (INCLUDE): Recognize in EXPRESSION.
-
-2008-06-20 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Make "can not
- build overlay stubs" a fatal error.
-
-2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * config.in: Regenerate.
- * configure: Regenerate.
-
-2008-06-17 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/spuelf.em (extra_stack_space): New variable.
- (gld${EMULATION_NAME}_finish): Pass it to spu_elf_check_vma.
- (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS,
- PARSE_AND_LIST_ARGS_CASES): Handle --extra-stack-space.
- * emultempl/spu_ovl.S: Mask interrupts during dma and update of
- overlay manager structures.
- * emultempl/spu_ovl.o: Regenerate.
-
-2008-06-16 Hans-Peter Nilsson <hp@bitrange.com>
-
- * ld.texinfo (@node MMIX): For the __.MMIX.start. prefix, only
- mention it as being special for global symbols.
-
-2008-06-12 Nick Clifton <nickc@redhat.com>
-
- * ldlang.c (print_output_section_statement): If the output section
- statement has an update_dot_tree expression, apply it to
- print_dot.
- (print_input_section): Do not update print_dot if it would move
- print_dot backwards.
- (lang_do_assignments_1): If the output section statement has an
- update_dot_tree expression apply it to dot.
-
-2008-06-07 Alan Modra <amodra@bigpond.net.au>
-
- * NEWS: Mention archive:path patterns.
- * ld.texinfo: Likewise.
- * ldlang.c: Formatting throughout.
- (archive_path): Only assume "[A-Za-z]:" is a dos drive.
- (input_statement_is_archive_path): New function, extracted from..
- (walk_wild): ..here.
- (walk_wild_consider_section): Match archive:path here too.
- (init_map_userdata, sort_def_symbol): Convert to ISO C.
- * ldmain.c (main): Set link_info.path_separator.
- * emultempl/spuelf.em (choose_target): Don't set it here.
-
-2008-06-06 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (name_match): New function.
- (unique_section_p, walk_wild_consider_section): Use it here.
- (walk_wild_section_general): And here.
- (archive_path): New function.
- (walk_wild): Match archive:path filespecs.
- (open_input_bfds): Don't load archive:path files.
- * emultempl/spuelf.em (choose_target): Set path_separator.
- * emulparams/elf32_spu.sh: Add ._ea.* sections to ._ea output.
-
-2008-06-04 Nick Clifton <nickc@redhat.com>
-
- * ld.texinfo (Orphan Sections): Fix texi typo.
-
-2008-06-04 Chris Metcalf <cmetcalf@tilera.com>
-
- * lexsup.c (option_values): Add OPTION_NO_WARN_FATAL.
- (ld_options): Add entry for --no-fatal-warnings.
- (parse_args): Handle OPTION_NO_WARN_FATAL.
- * ld.texinfo (Options): Document new command line switch.
-
-2008-06-04 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/spuelf.em (spu_elf_relink): Correct --no-auto-overlay arg.
-
-2008-06-02 Nathan Sidwell <nathan@codesourcery.com>
-
- * ldlang.c (closest_target_match): Skip generic big and little
- endian ELF targets.
-
-2008-05-31 Evandro Menezes <evandro@yahoo.com>
-
- PR ld/6430
- * ld.h (enum sort_order): New.
- * ldlang.c (lang_check: Fix comment.
- (lang_common): Sort commons in ascending or descending order.
- (lang_one_common): Likewise.
- * lexsup.c (ld_options): Have --sort-common take an option
- argument.
- (parse_args): Handle argument to --sort-common.
- * ld.texinfo (--sort-common): Document new optional argument.
- * NEWS: Mention new feature.
-
-2008-05-28 Christophe Lyon <christophe.lyon@st.com>
-
- * ld.texinfo: State that farcalls stubs are supported for ARM-EABI
- only.
-
-2008-05-27 Kai Tietz <kai.tietz@onevision.com>
-
- * pe-dll.c (fill_edata): Make sure we calculate vma's in
- type bfd_vma.
- (generate_reloc): Likewise.
- (pe_implied_import_dll): Likewise.
-
-2008-05-21 Nick Clifton <nickc@redhat.com>
-
- PR ld/6519
- * ld.texinfo (Orphan Sections): Mention that the linker will
- provide start and stop symbols for orphaned sections if their
- names are valid C identifiers.
- * NEWS: Add an addendum to the description of the linker feature
- for providing orphan section start and end symbols.
-
-2008-05-21 Maxim Kuvyrkov <maxim@codesourcery.com>
-
- * configure.in (--enable-got): New option. Handle it.
- * configure: Regenerate.
- * config.in: Regenerate.
- * emultempl/m68kelf.em: (got_handling_target_default): New shell
- variable.
- (GOT_HANDLING_TARGET_DEFAULT): New macro.
- (GOT_HANDLING_DEFAULT): New macro. Initialize it from configure
- option if one was given.
- (got_handling): New static variable.
- (elf_m68k_create_output_section_statements): New static function
- implementing hook.
- (PARSE_AND_LIST_PROLOGUE): Define shell variable.
- (OPTION_GOT): New macro.
- (PARSE_AND_LIST_LONGOPTS): Define shell variable. Specify
- --got option.
- (got): New linker option.
- (PARSE_AND_LIST_OPTIONS): Define shell variable. Print help string
- for --got option.
- (PARSE_AND_LIST_ARGS_CASES): Define shell variable. Handle --got
- option.
- * ld.texinfo: Document --got=<type> option.
- * gen-doc.texi: Add M68K.
- * NEWS: Mention the new feature.
-
-2008-05-21 Evandro Menezes <evandro@yahoo.com>
-
- PR ld/6430
- * ld.texinfo (--sort-common): Correct documentation to indicate
- that sorting is performed by alignment, not size, biggest
- alignment first.
-
-2008-05-21 Christophe Lyon <christophe.lyon@st.com>
- Nick Clifton <nickc@redhat.com>
-
- * ld.texinfo (ARM): Document --stub-group-size=N option.
- Move description of --pic-veneer option into the ARM section.
- * NEWS: Mention the support for long function calls.
-
-2008-05-15 Christophe Lyon <christophe.lyon@st.com>
-
- * emultempl/armelf.em (build_section_lists): New function.
- (stub_file): Define.
- (need_laying_out): Define.
- (group_size): Define.
- (hook_stub_info): Define.
- (hook_in_stub): New function.
- (elf32_arm_add_stub_section): New function.
- (gldarm_layout_sections_again): New function.
- (gld${EMULATION_NAME}_finish): Replace arm_elf_finish(). Generate
- stubs for long calls if needed.
- (arm_elf_create_output_section_statements): create stub_file bfd.
- (arm_for_each_input_file_wrapper): New function.
- (arm_lang_for_each_input_file): New function.
- (lang_for_each_input_file): Define.
- (PARSE_AND_LIST_PROLOGUE): Add option token OPTION_STUBGROUP_SIZE.
- (PARSE_AND_LIST_LONGOPTS): Add option stub-group-size.
- (PARSE_AND_LIST_OPTIONS): Add option stub-group-size.
- (PARSE_AND_LIST_ARGS_CASES): Add OPTION_STUBGROUP_SIZE case.
- (LDEMUL_FINISH): Update to gld${EMULATION_NAME}_finish.
- * lang.c (print_input_statement): Skip if bfd has
- BFD_LINKER_CREATED.
-
-2008-05-14 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.in: Regenerate.
-
-2008-05-09 Kai Tietz <kai.tietz@onevision.com>
-
- ld/PR6502
- * emultempl/pep.em (compute_dll_image_base): Use bfd_vma instead
- of long and change return type to bfd_vma.
- (definfo): Change type of address from long to bfd_vma.
- (set_pep_value): Replace strtoul to strtoull.
- (gld_${EMULATION_NAME}_set_symbols): use bfd_vma instead of long..
- * pe-dll.c (pe_dll_generate_def_file): Use fprintf_vma to print
- ImageBase.
- (quick_reloc): Change argument address from int to bfd_size_type.
-
-2008-05-08 Tom Tromey <tromey@redhat.com>
-
- * ld.texinfo (PowerPC64 ELF64): Fix typo.
-
-2008-05-08 Alan Modra <amodra@bigpond.net.au>
-
- * elf32_spu.sh (OTHER_SECTIONS): Add "._ea".
- * elf32ppc.sh: If building with spu support, put ".data.spehandle"
- sections at the start of ".data" and provide a symbol to locate
- the directory of embedded spe programs.
-
-2008-05-08 Alan Modra <amodra@bigpond.net.au>
-
- * ldexp.c (exp_print_token): Add ABSOLUTE, MIN_K, ASSERT_K. Correct
- MAX_K.
- (fold_binary <SEGMENT_START>): Set expld.result.section to
- current section. Expand comment. Formatting.
- (fold_name <DEFINED>): Set expld.result.section to current section.
-
-2008-04-28 Nathan Sidwell <nathan@codesourcery.com>
-
- * ldlang.c (lang_size_sections_1): Don't check LMA overflow on
- non-load sections.
-
-2008-04-25 Michael Frysinger <vapier@gentoo.org>
-
- * configure.tgt (bfin-*-linux-uclibc*): Set targ_emul to elf32bfinfd
- and targ_extra_emuls to elf32bfin.
-
-2008-04-23 Paolo Bonzini <bonzini@gnu.org>
-
- * aclocal.m4: Regenerate.
- * configure: Regenerate.
-
-2008-04-03 Kai Tietz <kai.tietz@onevision.com>
-
- * scripttempl/pep.sc: Align start of symbol __CTOR_LIST__.
-
-2008-04-08 Alan Modra <amodra@bigpond.net.au>
-
- * po/POTFILES.in: Regenerate.
-
-2008-04-08 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/spuelf.em (auto_overlay, auto_overlay_file,
- auto_overlay_fixed, auto_overlay_reserved, my_argc, my_argv): New vars.
- (spu_before_allocation): Warn on --auto-overlay and existing overlays.
- (struct tflist, clean_tmp): Move.
- (new_tmp_file): New function, extracted from..
- (embedded_spu_file): ..here.
- (spu_elf_open_overlay_script, spu_elf_relink): New function.
- (gld${EMULATION_NAME}_finish): Pass a bunch of --auto-overlay params.
- Warn on --auto-overlay and zero local store.
- (gld${EMULATION_NAME}_choose_target): New function to stash argv.
- (OPTION_SPU_AUTO_OVERLAY, OPTION_SPU_AUTO_RELINK,
- OPTION_SPU_OVERLAY_RODATA, OPTION_SPU_FIXED_SPACE,
- OPTION_SPU_RESERVED_SPACE, OPTION_SPU_NO_AUTO_OVERLAY): Define.
- (PARSE_AND_LIST_LONGOPTS): Add entries for new options.
- (PARSE_AND_LIST_OPTIONS): Likewise.
- (PARSE_AND_LIST_ARGS_CASES): Likewise.
- (LDEMUL_CHOOSE_TARGET): Define.
-
-2008-04-03 Kai Tietz <kai.tietz@onevision.com>
-
- PR ld/6026
- * pe-dll.c (make_head): Fix iat and thunk addend offset.
-
-2008-03-31 Nick Clifton <nickc@redhat.com>
-
- * po/fr.po: Updated French translation.
-
-2008-03-24 Ian Lance Taylor <iant@google.com>
-
- The sha1 code is now in libiberty.
- * sha1.c: Remove.
- * sha1.h: Remove.
- * Makefile.am (CFILES): Remove sha1.c.
- (HFILES): Remove sha1.h.
- (OFILES): Remove sha1.o.
- (ld_new_SOURCES): Remove sha1.c.
- (sha1.o): Remove target.
- * Makefile.in: Rebuild.
-
-2008-03-20 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/spuelf.em: Update calls to elf32-spu.c funcs.
-
-2008-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * aclocal.m4: Regenerate.
- * configure: Likewise.
- * Makefile.in: Likewise.
-
-2008-03-14 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Protect
- spu_elf_build_stubs with is_spu_target.
-
-2008-03-13 Alan Modra <amodra@bigpond.net.au>
-
- * Makefile.am: Run "make dep-am".
- * Makefile.in: Regenerate.
- * configure: Regenerate.
-
-2008-03-06 Joseph Myers <joseph@codesourcery.com>
- Roman Zippel <zippel@linux-m68k.org>
-
- * emulparams/m68kelf.sh (GENERATE_PIE_SCRIPT): Define.
- (COMMONPAGESIZE): Define.
-
-2008-02-22 Nick Clifton <nickc@redhat.com>
-
- PR ld/5785
- * ldlang.c (lang_size_sections_1): Honour the setting of an
- lma_region even if there is no vma region set, or the vma region
- is the same as the lma region.
-
-2008-02-18 Nick Clifton <nickc@redhat.com>
-
- * scripttempl/armbpabi.sc (ENTRY): Do not define when performing a
- relocatable link.
- * scripttempl/elf32cr16.sc: Likewise.
- * scripttempl/elf32cr16c.sc: Likewise.
- * scripttempl/elf32crx.sc: Likewise.
- * scripttempl/elf32sh-symbian.sc: Likewise.
- * scripttempl/elf_chaos.sc: Likewise.
- * scripttempl/elfd10v.sc: Likewise.
- * scripttempl/elfi370.sc: Likewise.
- * scripttempl/elfm68hc11.sc: Likewise.
- * scripttempl/elfm68hc12.sc: Likewise.
- * scripttempl/ip2k.sc: Likewise.
- * scripttempl/iq2000.sc: Likewise.
- * scripttempl/mep.sc: Likewise.
- * scripttempl/v850.sc: Likewise.
- * scripttempl/xstormy16.sc: Likewise.
-
-2008-02-16 Alan Modra <amodra@bigpond.net.au>
-
- PR ld/5761
- * ldexp.c (fold_name <LOADADDR>): Check result of evaluating
- load_base before calling make_abs.
-
-2008-02-15 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/alphaelf.em (alpha_after_open): Use elf_object_id.
- * emultempl/hppaelf.em (hppaelf_create_output_section_statements):
- Likewise.
- * emultempl/ppc64elf.em (ppc_create_output_section_statements):
- Likewise.
- * emultempl/ppc32elf.em (is_ppc_elf32_vec): Delete. Replace all
- uses with..
- (is_ppc_elf): ..this new macro.
-
-2008-02-15 Alan Modra <amodra@bigpond.net.au>
-
- * ldmain.h (output_bfd): Delete.
- * ldmain.c (output_bfd): Delete.
- Replace all occurrences of output_bfd with link_info.output_bfd.
- * ldcref.c: Likewise.
- * ldctor.c: Likewise.
- * ldemul.c: Likewise.
- * ldexp.c: Likewise.
- * ldfile.c: Likewise.
- * ldlang.c: Likewise.
- * ldmisc.c: Likewise.
- * ldwrite.c: Likewise.
- * pe-dll.c: Likewise.
- * emultempl/aix.em: Likewise.
- * emultempl/alphaelf.em: Likewise.
- * emultempl/armcoff.em: Likewise.
- * emultempl/armelf.em: Likewise.
- * emultempl/avrelf.em: Likewise.
- * emultempl/beos.em: Likewise.
- * emultempl/elf-generic.em: Likewise.
- * emultempl/elf32.em: Likewise.
- * emultempl/gld960.em: Likewise.
- * emultempl/hppaelf.em: Likewise.
- * emultempl/irix.em: Likewise.
- * emultempl/linux.em: Likewise.
- * emultempl/lnk960.em: Likewise.
- * emultempl/m68hc1xelf.em: Likewise.
- * emultempl/mmix-elfnmmo.em: Likewise.
- * emultempl/mmo.em: Likewise.
- * emultempl/pe.em: Likewise.
- * emultempl/pep.em: Likewise.
- * emultempl/ppc32elf.em: Likewise.
- * emultempl/ppc64elf.em: Likewise.
- * emultempl/scoreelf.em: Likewise.
- * emultempl/sh64elf.em: Likewise.
- * emultempl/spuelf.em: Likewise.
- * emultempl/sunos.em: Likewise.
- * emultempl/vanilla.em: Likewise.
- * emultempl/vxworks.em: Likewise.
- * emultempl/xtensaelf.em: Likewise.
- * emultempl/z80.em: Likewise.
- * ldlang.c (open_output): Don't return output, instead write
- link_info_output_bfd directly.
- * emultempl/alphaelf.em: Replace occurrences of link_info.hash->creator
- with link_info.output_bfd->xvec.
- * emultempl/hppaelf.em: Likewise.
- * emultempl/ppc32elf.em: Likewise.
- * emultempl/ppc64elf.em: Likewise.
- * emultempl/spuelf.em: Likewise.
-
-2008-02-07 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (new_afile): Don't pass unadorned NULL to concat.
- * ldfile.c (ldfile_add_library_path): Likewise.
- * emultempl/elf32.em (check_ld_elf_hints, check_ld_so_conf): Likewise.
- * emultempl/lnk960.em (lnk960_before_parse): Likewise.
- * emultempl/spuelf.em (embedded_spu_file): Likewise.
-
-2008-02-07 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/spu_ovl.S: Use low bit of _ovly_table.size as
- a "present" bit rather than low bit of .buf. Correct indexing
- into _ovly_buf_table. Use relative loads and stores to access
- overlay manager local vars.
- * emultempl/spu_ovl.o: Regenerate.
-
-2008-02-04 H.J. Lu <hongjiu.lu@intel.com>
-
- PR 5715
- * configure: Regenerated.
-
-2008-01-31 Marc Gauthier <marc@tensilica.com>
-
- * configure.tgt (xtensa*-*-*): Recognize processor variants.
-
-2008-01-28 Fabian Groffen <grobian@gentoo.org>
-
- * configure.tgt (x86_64-*-solaris2): Add support for this target.
-
-2008-01-28 Vincent Riviere <vincent.riviere@freesbee.fr>
-
- PR ld/5652
- * genscripts.sh: Check for the existence of BASH_LINENO not just
- the BASH shell before generating line numbers in the emulation
- file.
-
-2008-01-28 Alan Modra <amodra@bigpond.net.au>
-
- * emultempl/spu_ovl.S: Rewrite.
- * emultempl/spu_ovl.o: Regenerate.
- * emultempl/spuelf.em (toe): Delete.
- (spu_place_special_section): Add param to control section placement.
- Adjust callers.
- (spu_elf_load_ovl_mgr): Adjust for struct _spu_elf_section_data
- changes.
- (spu_before_allocation): Adjust spu_elf_size_stubs call.
- (gld${EMULATION_NAME}_finish): Adjust spu_elf_build_stubs call.
-
-2008-01-25 H.J. Lu <hongjiu.lu@intel.com>
-
- PR ld/5670
- * ldlang.c (process_insert_statements): Silence gcc 4.1 alias
- warning.
-
-2008-01-25 Alan Modra <amodra@bigpond.net.au>
-
- * ld.texinfo (INSERT): Describe.
- * ldgram.y (ldgram_in_script, ldgram_had_equals): Delete.
- (INSERT_K, AFTER, BEFORE): Add as tokens.
- (ifile_p1): Handle INSERT statements.
- (saved_script_handle, force_make_executable): Move to..
- * ldmain.c: ..here.
- (previous_script_handle): New global var.
- * ldmain.h (saved_script_handle, force_make_executable): Declare.
- (previous_script_handle): Likewise.
- * ldlex.l (INSERT_K, AFTER, BEFORE): Add tokens.
- * lexsup.c (parge_args <-T>): Set previous_script_handle.
- * ldlang.c (lang_for_each_statement_worker): Handle insert statement.
- (map_input_to_output_sections, print_statement): Likewise.
- (lang_size_sections_1, lang_do_assignments_1): Likewise.
- (insert_os_after): New function, extracted from..
- (lang_insert_orphan): ..here.
- (process_insert_statements): New function.
- (lang_process): Call it.
- (lang_add_insert): New function.
- * ldlang.h (lang_insert_statement_enum): New.
- (lang_insert_statement_type): New.
- (lang_statement_union_type): Add insert_statement.
- (lang_add_insert): Declare.
-
-2008-01-18 Bob Wilson <bob.wilson@acm.org>
-
- * scripttempl/elfxtensa.sc: Merge ENTRY and .note.gnu.build-id
- changes from elf.sc.
-
-2008-01-16 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.c (lang_size_sections_1): Simplify SEC_NEVER_LOAD test.
-
-2008-01-16 Alan Modra <amodra@bigpond.net.au>
-
- * ldlang.h (lang_afile_asection_pair_statement_enum): Delete.
- (lang_afile_asection_pair_statement_type): Delete.
- (lang_statement_union_type): Delete afile_asection_pair_statement.
- * ldlang.c (lang_insert_orphan): Delete case handling the above.
- (map_input_to_output_sections, print_statement): Likewise.
-
-2008-01-15 Kaz Kojima <kkojima@rr.iij4u.or.jp>
-
- * emulparams/shlelf_linux.sh (DATA_START_SYMBOLS): Use PROVIDE
- with __data_start.
- * emulparams/shelf_nbsd.sh (DATA_START_SYMBOLS): Likewise.
-
-2008-01-15 Alan Modra <amodra@bigpond.net.au>
-
- PR 5604
- * ldlang.c (lang_gc_sections): Move code to set SEC_KEEP on entry
- syms to _bfd_elf_gc_keep.
- * emultempl/ppc64elf.em (ppc_before_allocation): Don't call
- ppc64_elf_edit_opd if no_opd_opt.
-
-2008-01-11 Tristan Gingold <gingold@adacore.com>
- Eric Botcazou <ebotcazou@adacore.com>
-
- * ldlang.c (lang_end): Warns if the entry point is not found when
- --gc-sections.
- Emit an error if no root is specified when --gc-sections -r.
- * ld.texinfo (Options): Document that --gc-sections is compatible
- with -r and -q.
- * ldmain.c (main): Do not error out if -r and --gc-sections.
- * scripttempl/elf.sc: Emit ENTRY command only if relocating.
-
-2008-01-10 Daniel Jacobowitz <drow@sources.redhat.com>
-
- PR ld/5533
- * ldlang.c (lang_end): Issue a warning for a missing start symbol
- of a shared library if the symbol was specified on the command
- line.
-
-2008-01-10 Alan Modra <amodra@bigpond.net.au>
-
- * ld.texinfo (--gc-sections): Describe linker behaviour.
-
-For older changes see ChangeLog-2007
-
-Local Variables:
-mode: change-log
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
diff --git a/ld/Makefile.am b/ld/Makefile.am
deleted file mode 100644
index 2e40b6f3e48..00000000000
--- a/ld/Makefile.am
+++ /dev/null
@@ -1,2051 +0,0 @@
-## Process this file with automake to generate Makefile.in
-
-AUTOMAKE_OPTIONS = cygnus dejagnu
-ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
-
-SUBDIRS = po
-
-tooldir = $(exec_prefix)/$(target_alias)
-
-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@
-NO_WERROR = @NO_WERROR@
-AM_CFLAGS = $(WARN_CFLAGS)
-
-# We put the scripts in the directory $(scriptdir)/ldscripts.
-# We can't put the scripts in $(datadir) because the SEARCH_DIR
-# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
-
-EMUL = @EMUL@
-EMULATION_OFILES = @EMULATION_OFILES@
-EMUL_EXTRA_OFILES = @EMUL_EXTRA_OFILES@
-
-# Search path to override the default search path for -lfoo libraries.
-# If LIB_PATH is empty, the ones in the script (if any) are left alone.
-# (The default is usually /lib:/usr/lib:/usr/local/lib, unless building
-# a cross-linker, in which case the default is empty. See genscripts.sh.)
-# Otherwise, they are replaced with the ones given in LIB_PATH,
-# which may have the form: LIB_PATH=/lib:/usr/local/lib. This can be set
-# when the linker is configured via the --with-lib-path configure switch.
-LIB_PATH = @LIB_PATH@
-
-BASEDIR = $(srcdir)/..
-BFDDIR = $(BASEDIR)/bfd
-INCDIR = $(BASEDIR)/include
-MKDEP = gcc -MM
-
-# What version of the manual to build
-DOCVER = gen
-
-# Options to extract the man page from ld.texinfo
-MANCONF = -Dman
-
-TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl $(AM_MAKEINFOFLAGS)
-
-POD2MAN = pod2man --center="GNU Development Tools" \
- --release="binutils-$(VERSION)" --section=1
-
-#stuff for self hosting (can be overridden in config file).
-HOSTING_CRT0 = @HOSTING_CRT0@
-HOSTING_LIBS = @HOSTING_LIBS@
-HOSTING_EMU = -m $(EMUL)
-
-# Setup the testing framework, if you have one
-EXPECT = expect
-RUNTEST = runtest
-RUNTESTFLAGS =
-
-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`
-
-CXX = g++
-CXX_FOR_TARGET = ` \
- if [ -f $$r/../gcc/g++ ] ; then \
- if [ -f $$r/../newlib/Makefile ] ; then \
- echo $$r/../gcc/g++ -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
- else \
- echo $$r/../gcc/g++ -B$$r/../gcc/; \
- fi; \
- else \
- if [ "@host@" = "@target@" ] ; then \
- echo $(CXX); \
- else \
- echo g++ | sed '$(transform)'; \
- fi; \
- fi`
-
-noinst_PROGRAMS = ld-new
-info_TEXINFOS = ld.texinfo
-ld_TEXINFOS = configdoc.texi
-noinst_TEXINFOS = ldint.texinfo
-man_MANS = ld.1
-
-AM_MAKEINFOFLAGS = -I $(srcdir) -I $(BFDDIR)/doc -I ../bfd/doc \
- -I $(top_srcdir)/../libiberty
-TEXI2DVI = texi2dvi -I $(srcdir) -I $(BFDDIR)/doc -I ../bfd/doc \
- -I $(top_srcdir)/../libiberty
-
-INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
- @INCINTL@ $(HDEFINES) $(CFLAGS) \
- -DLOCALEDIR="\"$(datadir)/locale\""
-
-BFDLIB = ../bfd/libbfd.la
-LIBIBERTY = ../libiberty/libiberty.a
-
-ALL_EMULATIONS = \
- eaixppc.o \
- eaixrs6.o \
- ealpha.o \
- earcelf.o \
- earm_epoc_pe.o \
- earm_wince_pe.o \
- earmaoutb.o \
- earmaoutl.o \
- earmcoff.o \
- earmelf.o \
- earmelfb.o \
- earmelf_fbsd.o \
- earmelf_linux.o \
- earmelf_linux_eabi.o \
- earmelfb_linux.o \
- earmelfb_linux_eabi.o \
- earmelf_nbsd.o \
- earmelfb_nbsd.o \
- earmelf_vxworks.o \
- earmnto.o \
- earmnbsd.o \
- earmpe.o \
- earmsymbian.o \
- eavr2.o \
- eavr1.o \
- eavr3.o \
- eavr4.o \
- eavr5.o \
- eavr6.o \
- ecoff_i860.o \
- ecoff_sparc.o \
- eelf32_spu.o \
- ecrisaout.o \
- ecriself.o \
- ecrislinux.o \
- ed10velf.o \
- ed30v_e.o \
- ed30v_o.o \
- ed30velf.o \
- edelta68.o \
- eelf32_dlx.o \
- eelf32_i960.o \
- eelf32_i860.o \
- eelf32_sparc.o \
- eelf32_sparc_vxworks.o \
- eelf32b4300.o \
- eelf32bfin.o \
- eelf32bfinfd.o \
- eelf32cr16.o \
- eelf32cr16c.o \
- eelf32bmip.o \
- eelf32bmipn32.o \
- eelf32btsmip.o \
- eelf32crx.o \
- eelf32btsmipn32.o \
- eelf32ltsmip.o \
- eelf32ltsmipn32.o \
- eelf32ebmip.o \
- eelf32ebmipvxworks.o \
- eelf32elmip.o \
- eelf32elmipvxworks.o \
- eelf32fr30.o \
- eelf32frv.o \
- eelf32i370.o \
- eelf32ip2k.o \
- eelf32iq2000.o \
- eelf32iq10.o \
- eelf32l4300.o \
- eelf32lmip.o \
- eelf32lppc.o \
- eelf32lppcnto.o \
- eelf32lppcsim.o \
- eelf32m32c.o \
- eelf32mcore.o \
- eelf32mep.o \
- eelf32mipswindiss.o \
- eelf32mt.o \
- eelf32openrisc.o \
- eelf32ppc.o \
- eelf32ppc_fbsd.o \
- eelf32ppclinux.o \
- eelf32ppcnto.o \
- eelf32ppcsim.o \
- eelf32ppcwindiss.o \
- eelf32ppcvxworks.o \
- eelf32vax.o \
- eelf32xc16x.o \
- eelf32xc16xl.o \
- eelf32xc16xs.o \
- eelf32xstormy16.o \
- eelf32xtensa.o \
- eelf_i386.o \
- eelf_i386_be.o \
- eelf_i386_chaos.o \
- eelf_i386_fbsd.o \
- eelf_i386_ldso.o \
- eelf_i386_vxworks.o \
- eelf_s390.o \
- egld960.o \
- egld960coff.o \
- eh8300.o \
- eh8300h.o \
- eh8300s.o \
- eh8300elf.o \
- eh8300hn.o \
- eh8300sn.o \
- eh8300sx.o \
- eh8300helf.o \
- eh8300self.o \
- eh8300hnelf.o \
- eh8300snelf.o \
- eh8300sxelf.o \
- eh8300sxn.o \
- eh8300sxnelf.o \
- eh8500.o \
- eh8500b.o \
- eh8500c.o \
- eh8500m.o \
- eh8500s.o \
- ehp300bsd.o \
- ehp3hpux.o \
- ehppaelf.o \
- ehppalinux.o \
- ehppanbsd.o \
- ehppaobsd.o \
- ei386aout.o \
- ei386beos.o \
- ei386bsd.o \
- ei386coff.o \
- ei386go32.o \
- ei386linux.o \
- ei386lynx.o \
- ei386mach.o \
- ei386moss.o \
- ei386msdos.o \
- ei386nbsd.o \
- ei386nto.o \
- ei386nw.o \
- ei386pe.o \
- ei386pe_posix.o \
- ei386pep.o \
- elnk960.o \
- em32relf.o \
- em32rlelf.o \
- em32relf_linux.o \
- em32rlelf_linux.o \
- em68hc11elf.o \
- em68hc11elfb.o \
- em68hc12elf.o \
- em68hc12elfb.o \
- em68k4knbsd.o \
- em68kaout.o \
- em68kaux.o \
- em68kcoff.o \
- em68kelf.o \
- em68kelfnbsd.o \
- em68klinux.o \
- em68knbsd.o \
- em68kpsos.o \
- em88kbcs.o \
- emaxqcoff.o \
- emcorepe.o \
- emipsbig.o \
- emipsbsd.o \
- emipsidt.o \
- emipsidtl.o \
- emipslit.o \
- emipslnews.o \
- emipspe.o \
- emsp430x110.o \
- emsp430x112.o \
- emsp430x1101.o \
- emsp430x1111.o \
- emsp430x1121.o \
- emsp430x1122.o \
- emsp430x1132.o \
- emsp430x122.o \
- emsp430x123.o \
- emsp430x1222.o \
- emsp430x1232.o \
- emsp430x133.o \
- emsp430x135.o \
- emsp430x1331.o \
- emsp430x1351.o \
- emsp430x147.o \
- emsp430x148.o \
- emsp430x149.o \
- emsp430x155.o \
- emsp430x156.o \
- emsp430x157.o \
- emsp430x167.o \
- emsp430x168.o \
- emsp430x169.o \
- emsp430x1610.o \
- emsp430x1611.o \
- emsp430x1612.o \
- emsp430x2101.o \
- emsp430x2111.o \
- emsp430x2121.o \
- emsp430x2131.o \
- emsp430x311.o \
- emsp430x312.o \
- emsp430x313.o \
- emsp430x314.o \
- emsp430x315.o \
- emsp430x323.o \
- emsp430x325.o \
- emsp430x336.o \
- emsp430x337.o \
- emsp430x412.o \
- emsp430x413.o \
- emsp430x415.o \
- emsp430x417.o \
- emsp430xE423.o \
- emsp430xE425.o \
- emsp430xE427.o \
- emsp430xW423.o \
- emsp430xW425.o \
- emsp430xW427.o \
- emsp430xG437.o \
- emsp430xG438.o \
- emsp430xG439.o \
- emsp430x435.o \
- emsp430x436.o \
- emsp430x437.o \
- emsp430x447.o \
- emsp430x448.o \
- emsp430x449.o \
- enews.o \
- ens32knbsd.o \
- eor32.o \
- eor32elf.o \
- epc532macha.o \
- epdp11.o \
- epjelf.o \
- epjlelf.o \
- eppcmacos.o \
- eppcnw.o \
- eppcpe.o \
- eppclynx.o \
- eriscix.o \
- escoreelf.o \
- esh.o \
- eshelf32.o \
- eshlelf32.o \
- eshelf32_linux.o \
- eshlelf32_linux.o \
- eshelf32_nbsd.o \
- eshlelf32_nbsd.o \
- eshelf.o \
- eshelf_linux.o \
- eshlelf_linux.o \
- eshelf_nbsd.o \
- eshlelf_nbsd.o \
- eshelf_nto.o \
- eshlelf_nto.o \
- eshelf_uclinux.o \
- eshelf_vxworks.o \
- eshlelf_vxworks.o \
- eshl.o \
- eshlelf.o \
- eshlsymbian.o \
- eshpe.o \
- esparcaout.o \
- esparclinux.o \
- esparcnbsd.o \
- est2000.o \
- esun3.o \
- esun4.o \
- etic30aout.o \
- etic30coff.o \
- etic3xcoff.o \
- etic3xcoff_onchip.o \
- etic4xcoff.o \
- etic54xcoff.o \
- etic80coff.o \
- evanilla.o \
- evax.o \
- evaxnbsd.o \
- evsta.o \
- ew65.o \
- ez8001.o \
- eelf32frvfd.o \
- ez80.o \
- ez8002.o
-
-ALL_64_EMULATIONS = \
- eelf64_aix.o \
- eelf64_ia64.o \
- eelf64_ia64_fbsd.o \
- eshelf64.o \
- eshlelf64.o \
- eshelf64_nbsd.o \
- eshlelf64_nbsd.o \
- eelf_x86_64.o \
- eelf_x86_64_fbsd.o \
- eelf64_s390.o \
- eelf64_sparc.o \
- eelf64_sparc_fbsd.o \
- eelf64alpha.o \
- eelf64alpha_fbsd.o \
- eelf64alpha_nbsd.o \
- eelf64bmip.o \
- eelf64btsmip.o \
- eelf64ltsmip.o \
- eelf64hppa.o \
- eelf64mmix.o \
- emmo.o \
- eelf64ppc.o \
- eelf64lppc.o \
- ehppa64linux.o
-
-ALL_EMUL_EXTRA_OFILES = \
- deffilep.o \
- pe-dll.o \
- pep-dll.o
-
-CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
- ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
- mri.c ldcref.c pe-dll.c pep-dll.c
-
-HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
- ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
- ldwrite.h mri.h deffile.h pe-dll.h pep-dll.h elf-hints-local.h
-
-GENERATED_CFILES = ldgram.c ldlex.c deffilep.c
-GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
-
-OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
- ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
- ldfile.o ldcref.o ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES}
-
-STAGESTUFF = *.o ldscripts/* e*.c
-
-# Disable -Werror, if it has been enabled, since old versions of bison/
-# yacc will produce working code which contain compile time warnings.
-ldgram.o:
- $(COMPILE) -c $< $(NO_WERROR)
-ldlex.o:
- $(COMPILE) -c $< $(NO_WERROR)
-deffilep.o:
- $(COMPILE) -c $< $(NO_WERROR)
-
-# At the moment this is just a list of those emulation template files
-# that contain internationalised strings.
-EMULATION_FILES = emultempl/pe.em emultempl/armcoff.em
-
-POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES)
-
-po/POTFILES.in: @MAINT@ Makefile
- for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
- && mv tmp $(srcdir)/po/POTFILES.in
-
-ldmain.o: ldmain.c config.status
- $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' \
- -DSCRIPTDIR='"$(scriptdir)"' -DBINDIR='"$(bindir)"' \
- -DTOOLBINDIR='"$(tooldir)/bin"' \
- -DTARGET='"@target@"' @TARGET_SYSTEM_ROOT_DEFINE@ \
- $(srcdir)/ldmain.c
-
-eelf32_spu.o: eelf32_spu.c
- $(COMPILE) -c -DEMBEDSPU="\"`echo embedspu | sed '$(transform)'`\"" \
- eelf32_spu.c
-
-ldemul-list.h: Makefile
- (echo "/* This file is automatically generated. DO NOT EDIT! */";\
- for f in `echo " " ${EMULATION_OFILES} "" \
- | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
- echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
- done;\
- echo "";\
- echo "#define EMULATION_LIST \\";\
- for f in `echo " " ${EMULATION_OFILES} "" \
- | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
- echo " &ld_$${f}_emulation, \\"; \
- done;\
- echo " 0") >ldemul-tmp.h
- mv ldemul-tmp.h ldemul-list.h
-
-stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
- cp ${srcdir}/emultempl/$(STRINGIFY) stringify.sed
-
-# These all start with e so 'make clean' can find them.
-
-GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
-GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
-ELF_DEPS = $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/elf-generic.em
-ELF_GEN_DEPS = $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/elf-generic.em $(srcdir)/emultempl/genelf.em
-
-@TDIRS@
-
-eaix5ppc.c: $(srcdir)/emulparams/aix5ppc.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} aix5ppc "$(tdir_aixppc)"
-eaix5rs6.c: $(srcdir)/emulparams/aix5rs6.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} aix5rs6 "$(tdir_aixrs6)"
-eaixppc.c: $(srcdir)/emulparams/aixppc.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} aixppc "$(tdir_aixppc)"
-eaixrs6.c: $(srcdir)/emulparams/aixrs6.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} aixrs6 "$(tdir_aixrs6)"
-ealpha.c: $(srcdir)/emulparams/alpha.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} alpha "$(tdir_alpha)"
-earcelf.c: $(srcdir)/emulparams/arcelf.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} arcelf "$(tdir_arcelf)"
-earmelf.c: $(srcdir)/emulparams/armelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelf "$(tdir_armelf)"
-earmelfb.c: $(srcdir)/emulparams/armelfb.sh $(srcdir)/emulparams/armelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelfb "$(tdir_armelfb)"
-earmelf_fbsd.c: $(srcdir)/emulparams/armelf_fbsd.sh \
- $(srcdir)/emulparams/armelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelf_fbsd "$(tdir_armelf_fbsd)"
-earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelf_linux "$(tdir_armelf_linux)"
-earmelf_linux_eabi.c: $(srcdir)/emulparams/armelf_linux_eabi.sh \
- $(srcdir)/emulparams/armelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelf_linux_eabi "$(tdir_armelf_linux_abi)"
-earmelfb_linux.c: $(srcdir)/emulparams/armelfb_linux.sh \
- $(srcdir)/emulparams/armelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelfb_linux "$(tdir_armelfb_linux)"
-earmelfb_linux_eabi.c: $(srcdir)/emulparams/armelfb_linux_eabi.sh \
- $(srcdir)/emulparams/armelf_linux_eabi.sh \
- $(srcdir)/emulparams/armelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelfb_linux_eabi "$(tdir_armelfb_linux_abi)"
-earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \
- $(srcdir)/emulparams/armelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelf_nbsd "$(tdir_armelf_nbsd)"
-earmelfb_nbsd.c: $(srcdir)/emulparams/armelfb_nbsd.sh \
- $(srcdir)/emulparams/armelf_nbsd.sh \
- $(srcdir)/emulparams/armelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelfb_nbsd "$(tdir_armelfb_nbsd)"
-earmelf_vxworks.c: $(srcdir)/emulparams/armelf_vxworks.sh \
- $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/armelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/vxworks.em \
- $(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} armelf_vxworks "$(tdir_armelf)"
-earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armaoutb "$(tdir_armaoutb)"
-earmaoutl.c: $(srcdir)/emulparams/armaoutl.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armaoutl "$(tdir_armaoutl)"
-earmcoff.c: $(srcdir)/emulparams/armcoff.sh \
- $(srcdir)/emultempl/armcoff.em $(srcdir)/scripttempl/armcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armcoff "$(tdir_armcoff)"
-earmnbsd.c: $(srcdir)/emulparams/armnbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
-earmnto.c: $(srcdir)/emulparams/armnto.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armnto "$(tdir_armnto)"
-earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/epocpe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} arm_epoc_pe "$(tdir_armpe)"
-earm_wince_pe.c: $(srcdir)/emulparams/arm_wince_pe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} arm_wince_pe "$(tdir_armpe)"
-earmpe.c: $(srcdir)/emulparams/armpe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armpe "$(tdir_armpe)"
-earmsymbian.c: $(srcdir)/emulparams/armsymbian.sh \
- $(srcdir)/emulparams/armelf.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/armbpabi.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} armsymbian "$(tdir_armelf)"
-eavr2.c: $(srcdir)/emulparams/avr2.sh $(srcdir)/emultempl/avrelf.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr2 "$(tdir_avr2)"
-eavr1.c: $(srcdir)/emulparams/avr1.sh $(srcdir)/emultempl/avrelf.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr1 "$(tdir_avr2)"
-eavr3.c: $(srcdir)/emulparams/avr3.sh $(srcdir)/emultempl/avrelf.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr3 "$(tdir_avr2)"
-eavr4.c: $(srcdir)/emulparams/avr4.sh $(srcdir)/emultempl/avrelf.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr4 "$(tdir_avr2)"
-eavr5.c: $(srcdir)/emulparams/avr5.sh $(srcdir)/emultempl/avrelf.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr5 "$(tdir_avr2)"
-eavr6.c: $(srcdir)/emulparams/avr6.sh $(srcdir)/emultempl/avrelf.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr6 "$(tdir_avr2)"
-ecoff_i860.c: $(srcdir)/emulparams/coff_i860.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i860coff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} coff_i860 "$(tdir_coff_i860)"
-ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)"
-ecrisaout.c: $(srcdir)/emulparams/crisaout.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/crisaout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} crisaout "$(tdir_cris)"
-ecriself.c: $(srcdir)/emulparams/criself.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} criself "$(tdir_cris)"
-ecrislinux.c: $(srcdir)/emulparams/crislinux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} crislinux "$(tdir_cris)"
-ed10velf.c: $(srcdir)/emulparams/d10velf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elfd10v.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} d10velf "$(tdir_d10v)"
-ed30velf.c: $(srcdir)/emulparams/d30velf.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elfd30v.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} d30velf "$(tdir_d30v)"
-ed30v_o.c: $(srcdir)/emulparams/d30v_o.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elfd30v.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} d30v_o "$(tdir_d30v)"
-ed30v_e.c: $(srcdir)/emulparams/d30v_e.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elfd30v.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} d30v_e "$(tdir_d30v)"
-edelta68.c: $(srcdir)/emulparams/delta68.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} delta68 "$(tdir_delta68)"
-eelf32bfin.c: $(srcdir)/emulparams/bfin.sh \
- $(ELF_DEPS) \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32bfin "$(tdir_elf32bfin)" bfin
-eelf32bfinfd.c: $(srcdir)/emulparams/elf32bfinfd.sh $(srcdir)/emulparams/bfin.sh \
- $(ELF_DEPS) \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32bfinfd "$(tdir_elf32bfinfd)" elf32bfinfd
-eelf32_dlx.c: $(srcdir)/emulparams/elf32_dlx.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/dlx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_dlx "$(tdir_elf32_dlx)"
-eelf32xc16x.c: $(srcdir)/emulparams/elf32xc16x.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32xc16x "$(tdir_xc16x)"
-eelf32xc16xl.c: $(srcdir)/emulparams/elf32xc16xl.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32xc16xl "$(tdir_xc16xl)"
-eelf32xc16xs.c: $(srcdir)/emulparams/elf32xc16xs.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32xc16xs "$(tdir_xc16xs)"
-eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/xstormy16.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32xstormy16 "$(tdir_xstormy16)"
-eelf32am33lin.c: $(srcdir)/emulparams/elf32am33lin.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32am33lin "$(tdir_mn10300)"
-eelf32vax.c: $(srcdir)/emulparams/elf32vax.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32vax "$(tdir_elf32vax)"
-eelf32xtensa.c: $(srcdir)/emulparams/elf32xtensa.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/xtensaelf.em $(INCDIR)/xtensa-config.h \
- $(BFDDIR)/elf-bfd.h $(BFDDIR)/libbfd.h $(INCDIR)/elf/xtensa.h \
- $(srcdir)/scripttempl/elfxtensa.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32xtensa "$(tdir_elf32xtensa)"
-eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32fr30 "$(tdir_fr30)"
-eelf32frv.c: $(srcdir)/emulparams/elf32frv.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32frv "$(tdir_frv)"
-eelf32frvfd.c: $(srcdir)/emulparams/elf32frvfd.sh \
- $(srcdir)/emulparams/elf32frv.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32frvfd "$(tdir_frv)"
-eelf32mcore.c: $(srcdir)/emulparams/elf32mcore.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32mcore "$(tdir_mcore)"
-eelf32mep.c: $(srcdir)/emulparams/elf32mep.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/mep.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32mep "$(tdir_mep)"
-em32relf.c: $(srcdir)/emulparams/m32relf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m32relf "$(tdir_m32r)"
-em32rlelf.c: $(srcdir)/emulparams/m32rlelf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m32rlelf "$(tdir_m32rlelf)"
-em32relf_linux.c: $(srcdir)/emulparams/m32relf_linux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m32relf_linux "$(tdir_m32relf_linux)"
-em32rlelf_linux.c: $(srcdir)/emulparams/m32rlelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m32rlelf_linux "$(tdir_m32rlelf_linux)"
-eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
-eelf32_sparc_vxworks.c: $(srcdir)/emulparams/elf32_sparc_vxworks.sh \
- $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/elf32_sparc.sh \
- $(srcdir)/emultempl/vxworks.em $(ELF_DEPS) \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_sparc_vxworks "$(tdir_elf32_sparc_vxworks)"
-eelf32_spu.c: $(srcdir)/emulparams/elf32_spu.sh $(srcdir)/emultempl/spuelf.em \
- $(srcdir)/emultempl/spu_ovl.o_c \
- ldemul-list.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_spu "$(tdir_elf32_spu)"
-$(srcdir)/emultempl/spu_ovl.o_c: @MAINT@ $(srcdir)/emultempl/spu_ovl.S
- if ../gas/as-new --version \
- | grep 'target.*spu' >/dev/null 2>/dev/null; then \
- cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s
- ../gas/as-new -o spu_ovl.o spu_ovl.s; \
- ../binutils/bin2c <spu_ovl.o >$@
- fi
-eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_i860 "$(tdir_elf32_i860)"
-eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
-eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
-eelf32cr16.c: $(srcdir)/emulparams/elf32cr16.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/cr16elf.em \
- $(srcdir)/scripttempl/elf32cr16.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32cr16 "$(tdir_elf32crx)"
-eelf32cr16c.c: $(srcdir)/emulparams/elf32cr16c.sh \
- $(ELF_DEPS) \
- $(srcdir)/scripttempl/elf32cr16c.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32cr16c "$(tdir_elf32cr16c)"
-eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
-eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) $(srcdir)/emultempl/irix.em \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32bsmip "$(tdir_elf32bsmip)"
-eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)"
-eelf32crx.c: $(srcdir)/emulparams/elf32crx.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/crxelf.em \
- $(srcdir)/scripttempl/elf32crx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32crx "$(tdir_elf32crx)"
-eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \
- $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32btsmipn32 "$(tdir_elf32btsmipn32)"
-eelf32ltsmip.c: $(srcdir)/emulparams/elf32ltsmip.sh \
- $(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ltsmip "$(tdir_elf32ltsmip)"
-eelf32ltsmipn32.c: $(srcdir)/emulparams/elf32ltsmipn32.sh \
- $(srcdir)/emulparams/elf32btsmipn32.sh \
- $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ltsmipn32 "$(tdir_elf32ltsmipn32)"
-eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
-eelf32ebmipvxworks.c: $(srcdir)/emulparams/elf32ebmipvxworks.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emulparams/vxworks.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/mipself.em \
- $(srcdir)/emultempl/vxworks.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ebmipvxworks "$(tdir_elf32ebmipvxworks)"
-eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
- $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
-eelf32elmipvxworks.c: $(srcdir)/emulparams/elf32elmipvxworks.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emulparams/vxworks.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/mipself.em \
- $(srcdir)/emultempl/vxworks.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32elmipvxworks "$(tdir_elf32elmipvxworks)"
-eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
- $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/irix.em $(srcdir)/emultempl/mipself.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32bmipn32 "$(tdir_elf32bmipn32)"
-eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
- $(srcdir)/emulparams/elf32b4300.sh $(srcdir)/emulparams/elf32bmip.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
-eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
-eelf32mipswindiss.c: $(srcdir)/emulparams/elf32mipswindiss.sh $(ELF_DEPS) \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32mipswindiss "$(tdir_elf32mipswindiss)"
-eelf32m32c.c: $(srcdir)/emulparams/elf32m32c.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32m32c "$(tdir_m32c)"
-eelf32mt.c: $(srcdir)/emulparams/elf32mt.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32mt "$(tdir_mt)"
-eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
- $(srcdir)/emulparams/elf32ppccommon.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
- ldemul-list.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
-eelf32lppcnto.c: $(srcdir)/emulparams/elf32lppcnto.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
- $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
- ldemul-list.h \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32lppcnto "$(tdir_elf32lppcnto)"
-eelf32lppcsim.c: $(srcdir)/emulparams/elf32lppcsim.sh \
- $(srcdir)/emulparams/elf32lppc.sh $(srcdir)/emulparams/elf32ppc.sh \
- $(srcdir)/emulparams/elf32ppccommon.sh $(srcdir)/emultempl/ppc32elf.em \
- ldemul-list.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32lppcsim "$(tdir_elf32lppcsim)"
-eelf32ppcnto.c: $(srcdir)/emulparams/elf32ppcnto.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
- $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
- ldemul-list.h \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppcnto "$(tdir_elf32ppcnto)"
-eelf32ppcwindiss.c: $(srcdir)/emulparams/elf32ppcwindiss.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppcwindiss "$(tdir_elf32ppcwindiss)"
-eelf32ppcvxworks.c: $(srcdir)/emulparams/elf32ppcvxworks.sh \
- $(srcdir)/emulparams/elf32ppccommon.sh $(srcdir)/emulparams/vxworks.sh \
- $(srcdir)/emultempl/vxworks.em $(ELF_DEPS) \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppcvxworks "$(tdir_elf32ppcvxworks)"
-eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
- $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)"
-eelf32openrisc.c: $(srcdir)/emulparams/elf32openrisc.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32openrisc "$(tdir_openrisc)"
-eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
- $(srcdir)/emulparams/elf32ppccommon.sh $(srcdir)/emultempl/ppc32elf.em \
- ldemul-list.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
-eelf32ppc_fbsd.c: $(srcdir)/emulparams/elf32ppc_fbsd.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
- $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
- ldemul-list.h \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppc_fbsd "$(tdir_elf32ppc_fbsd)"
-eelf32ppcsim.c: $(srcdir)/emulparams/elf32ppcsim.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
- $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
- ldemul-list.h \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppcsim "$(tdir_elf32ppcsim)"
-eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
- $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
- ldemul-list.h \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppclinux "$(tdir_elf32ppclinux)"
-eelf64ppc.c: $(srcdir)/emulparams/elf64ppc.sh $(srcdir)/emultempl/ppc64elf.em \
- ldemul-list.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64ppc "$(tdir_elf64ppc)"
-eelf64lppc.c: $(srcdir)/emulparams/elf64lppc.sh \
- $(srcdir)/emulparams/elf64ppc.sh $(srcdir)/emultempl/ppc64elf.em \
- ldemul-list.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64lppc "$(tdir_elf64lppc)"
-eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elfi370.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32i370 "$(tdir_elf32i370)"
-eelf32ip2k.c: $(srcdir)/emulparams/elf32ip2k.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/ip2k.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ip2k "$(tdir_ip2k)"
-eelf32iq2000.c: $(srcdir)/emulparams/elf32iq2000.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/iq2000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32iq2000 "$(tdir_iq2000)"
-eelf32iq10.c: $(srcdir)/emulparams/elf32iq10.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/iq2000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32iq10 "$(tdir_iq10)"
-eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/alphaelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
-eelf64alpha_fbsd.c: $(srcdir)/emulparams/elf64alpha_fbsd.sh \
- $(srcdir)/emulparams/elf64alpha.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/alphaelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64alpha_fbsd "$(tdir_elf64alpha_fbsd)"
-eelf64alpha_nbsd.c: $(srcdir)/emulparams/elf64alpha_nbsd.sh \
- $(srcdir)/emulparams/elf64alpha.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/alphaelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64alpha_nbsd "$(tdir_elf64alpha_nbsd)"
-eelf64hppa.c: $(srcdir)/emulparams/elf64hppa.sh \
- $(srcdir)/emulparams/hppa64linux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64hppa "$(tdir_elf64hppa)"
-eelf64_aix.c: $(srcdir)/emulparams/elf64_aix.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_aix "$(tdir_elf64_aix)"
-eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/ia64elf.em \
- $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)"
-eelf64_ia64_fbsd.c: $(srcdir)/emulparams/elf64_ia64_fbsd.sh \
- $(srcdir)/emulparams/elf64_ia64.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/ia64elf.em \
- $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_ia64_fbsd "$(tdir_elf64_ia64_fbsd)"
-eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_s390 "$(tdir_elf64_s390)"
-eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)"
-eelf64_sparc_fbsd.c: $(srcdir)/emulparams/elf64_sparc_fbsd.sh \
- $(srcdir)/emulparams/elf64_sparc.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_sparc_fbsd "$(tdir_elf64_sparc_fbsd)"
-eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \
- $(srcdir)/emulparams/elf64bmip-defs.sh \
- $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/irix.em $(srcdir)/emultempl/mipself.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64bmip "$(tdir_elf64bmip)"
-eelf64mmix.c: $(srcdir)/emulparams/elf64mmix.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/mmix-elfnmmo.em \
- $(srcdir)/emultempl/mmixelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64mmix "$(tdir_elf64mmix)"
-emmo.c: $(srcdir)/emulparams/mmo.sh $(srcdir)/emultempl/mmix-elfnmmo.em \
- $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/elf-generic.em \
- $(srcdir)/emultempl/mmo.em \
- $(srcdir)/scripttempl/mmo.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mmo "$(tdir_mmo)"
-eelf64btsmip.c: $(srcdir)/emulparams/elf64btsmip.sh \
- $(srcdir)/emulparams/elf64bmip-defs.sh \
- $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64btsmip "$(tdir_elf64btsmip)"
-eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \
- $(srcdir)/emulparams/elf64btsmip.sh $(srcdir)/emulparams/elf64bmip-defs.sh \
- $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64ltsmip "$(tdir_elf64ltsmip)"
-eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
-eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
-eelf_x86_64_fbsd.c: $(srcdir)/emulparams/elf_x86_64_fbsd.sh \
- $(srcdir)/emulparams/elf_x86_64.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_x86_64_fbsd "$(tdir_elf_x86_64_fbsd)"
-eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_be "$(tdir_elf_i386_be)"
-eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf_chaos.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)"
-eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
- $(srcdir)/emulparams/elf_i386.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_fbsd "$(tdir_elf_i386_fbsd)"
-eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
-eelf_i386_vxworks.c: $(srcdir)/emulparams/elf_i386_vxworks.sh \
- $(srcdir)/emulparams/vxworks.sh $(srcdir)/emultempl/vxworks.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_vxworks "$(tdir_elf_i386_vxworks)"
-eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)"
-egld960.c: $(srcdir)/emulparams/gld960.sh \
- $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} gld960 "$(tdir_gld960)"
-egld960coff.c: $(srcdir)/emulparams/gld960coff.sh \
- $(srcdir)/emultempl/gld960c.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} gld960coff "$(tdir_gld960coff)"
-eh8300.c: $(srcdir)/emulparams/h8300.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300 "$(tdir_h8300)"
-eh8300h.c: $(srcdir)/emulparams/h8300h.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300h "$(tdir_h8300h)"
-eh8300s.c: $(srcdir)/emulparams/h8300s.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300s.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300s "$(tdir_h8300s)"
-eh8300hn.c: $(srcdir)/emulparams/h8300hn.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300hn.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300hn "$(tdir_h8300hn)"
-eh8300sn.c: $(srcdir)/emulparams/h8300sn.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sn.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300sn "$(tdir_h8300sn)"
-eh8300sx.c: $(srcdir)/emulparams/h8300sx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300sx "$(tdir_h8300sx)"
-eh8300sxn.c: $(srcdir)/emulparams/h8300sxn.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sxn.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300sxn "$(tdir_h8300sxn)"
-eh8300elf.c: $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300elf "$(tdir_h8300elf)"
-eh8300helf.c: $(srcdir)/emulparams/h8300helf.sh \
- $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300helf "$(tdir_h8300helf)"
-eh8300self.c: $(srcdir)/emulparams/h8300self.sh \
- $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300self "$(tdir_h8300self)"
-eh8300hnelf.c: $(srcdir)/emulparams/h8300hnelf.sh \
- $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300hnelf "$(tdir_h8300hnelf)"
-eh8300snelf.c: $(srcdir)/emulparams/h8300snelf.sh \
- $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300snelf "$(tdir_h8300snelf)"
-eh8300sxelf.c: $(srcdir)/emulparams/h8300sxelf.sh \
- $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300sxelf "$(tdir_h8300sxelf)"
-eh8300sxnelf.c: $(srcdir)/emulparams/h8300sxnelf.sh \
- $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300sxnelf "$(tdir_h8300sxnelf)"
-eh8500.c: $(srcdir)/emulparams/h8500.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500 "$(tdir_h8500)"
-eh8500b.c: $(srcdir)/emulparams/h8500b.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500b.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500b "$(tdir_h8500b)"
-eh8500c.c: $(srcdir)/emulparams/h8500c.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500c.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500c "$(tdir_h8500c)"
-eh8500m.c: $(srcdir)/emulparams/h8500m.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500m.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500m "$(tdir_h8500m)"
-eh8500s.c: $(srcdir)/emulparams/h8500s.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500s.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500s "$(tdir_h8500s)"
-ehp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hp300bsd "$(tdir_hp300bsd)"
-ehp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hp3hpux "$(tdir_hp3hpux)"
-ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/hppaelf.em \
- $(srcdir)/scripttempl/hppaelf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hppaelf "$(tdir_hppaelf)"
-ehppalinux.c: $(srcdir)/emulparams/hppalinux.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/hppaelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hppalinux "$(tdir_hppalinux)"
-ehppanbsd.c: $(srcdir)/emulparams/hppanbsd.sh \
- $(srcdir)/emulparams/hppaelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/hppaelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hppanbsd "$(tdir_hppanbsd)"
-ehppaobsd.c: $(srcdir)/emulparams/hppaobsd.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/hppaelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hppaobsd "$(tdir_hppaobsd)"
-ehppa64linux.c: $(srcdir)/emulparams/hppa64linux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hppa64linux "$(tdir_hppa64linux)"
-ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386aout "$(tdir_i386aout)"
-ei386beos.c: $(srcdir)/emulparams/i386beos.sh \
- $(srcdir)/emultempl/beos.em $(srcdir)/scripttempl/i386beos.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386beos "$(tdir_i386beos)"
-ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386bsd "$(tdir_i386bsd)"
-ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386coff "$(tdir_i386coff)"
-ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386go32 "$(tdir_i386go32)"
-ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
- $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386linux "$(tdir_i386linux)"
-ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386lynx "$(tdir_i386lynx)"
-ei386mach.c: $(srcdir)/emulparams/i386mach.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386mach "$(tdir_i386mach)"
-ei386moss.c: $(srcdir)/emulparams/i386moss.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386moss "$(tdir_i386moss)"
-ei386msdos.c: $(srcdir)/emulparams/i386msdos.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386msdos.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386msdos "$(tdir_i386msdos)"
-ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386nbsd "$(tdir_i386nbsd)"
-ei386nto.c: $(srcdir)/emulparams/i386nto.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386nto "$(tdir_i386nto)"
-ei386nw.c: $(srcdir)/emulparams/i386nw.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386nw "$(tdir_i386nw)"
-ei386pe.c: $(srcdir)/emulparams/i386pe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386pe "$(tdir_i386pe)"
-ei386pe_posix.c: $(srcdir)/emulparams/i386pe_posix.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386pe_posix "$(tdir_i386pe_posix)"
-ei386pep.c: $(srcdir)/emulparams/i386pep.sh \
- $(srcdir)/emultempl/pep.em $(srcdir)/scripttempl/pep.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386pep "$(tdir_i386pe)"
-elnk960.c: $(srcdir)/emulparams/lnk960.sh \
- $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
-em68hc11elf.c: $(srcdir)/emulparams/m68hc11elf.sh \
- $(srcdir)/emultempl/m68hc1xelf.em $(ELF_DEPS) \
- $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68hc11elf "$(tdir_m68hc11)"
-em68hc11elfb.c: $(srcdir)/emulparams/m68hc11elfb.sh \
- $(srcdir)/emultempl/m68hc1xelf.em $(ELF_DEPS) \
- $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68hc11elfb "$(tdir_m68hc11b)"
-em68hc12elf.c: $(srcdir)/emulparams/m68hc12elf.sh \
- $(srcdir)/emultempl/m68hc1xelf.em $(ELF_DEPS) \
- $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68hc12elf "$(tdir_m68hc12)"
-em68hc12elfb.c: $(srcdir)/emulparams/m68hc12elfb.sh \
- $(srcdir)/emultempl/m68hc1xelf.em $(ELF_DEPS) \
- $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68hc12elfb "$(tdir_m68hc12b)"
-em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68k4knbsd "$(tdir_m68k4knbsd)"
-em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kaout "$(tdir_m68kaout)"
-em68kaux.c: $(srcdir)/emulparams/m68kaux.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kaux.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kaux "$(tdir_m68kaux)"
-em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
- $(srcdir)/emultempl/m68kcoff.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kcoff "$(tdir_m68kcoff)"
-em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/m68kelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kelf "$(tdir_m68kelf)"
-em68kelfnbsd.c: $(srcdir)/emulparams/m68kelfnbsd.sh \
- $(srcdir)/emulparams/m68kelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/m68kelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kelfnbsd "$(tdir_m68kelfnbsd)"
-em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
- $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68klinux "$(tdir_m68klinux)"
-em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68knbsd "$(tdir_m68knbsd)"
-em68kpsos.c: $(srcdir)/emulparams/m68kpsos.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/psos.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kpsos "$(tdir_m68kpsos)"
-em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m88kbcs "$(tdir_m88kbcs)"
-emaxqcoff.c: $(srcdir)/emulparams/maxqcoff.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/maxqcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} maxqcoff "$(tdir_maxqcoff)"
-emcorepe.c: $(srcdir)/emulparams/mcorepe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mcorepe "$(tdir_mcorepe)"
-emipsbig.c: $(srcdir)/emulparams/mipsbig.sh $(srcdir)/emultempl/generic.em \
- $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipsbig "$(tdir_mipsbig)"
-emipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh $(srcdir)/emultempl/generic.em \
- $(srcdir)/scripttempl/mipsbsd.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipsbsd "$(tdir_mipsbsd)"
-emipsidt.c: $(srcdir)/emulparams/mipsidt.sh $(srcdir)/emultempl/generic.em \
- $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} mipsidt "$(tdir_mipsidt)"
-emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh $(srcdir)/emultempl/generic.em \
- $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} mipsidtl "$(tdir_mipsidtl)"
-emipslit.c: $(srcdir)/emulparams/mipslit.sh $(srcdir)/emultempl/generic.em \
- $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipslit "$(tdir_mipslit)"
-emipslnews.c: $(srcdir)/emulparams/mipslnews.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipslnews "$(tdir_mipslnews)"
-emipspe.c: $(srcdir)/emulparams/mipspe.sh $(srcdir)/emultempl/pe.em \
- $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipspe "$(tdir_mipspe)"
-emn10300.c: $(srcdir)/emulparams/mn10300.sh \
- $(srcdir)/emulparams/mn10200.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mn10300 "$(tdir_mn10300)"
-emn10200.c: $(srcdir)/emulparams/mn10200.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mn10200 "$(tdir_mn10200)"
-emsp430x110.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x110 "$(tdir_msp430x110)" msp430all
-emsp430x112.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x112 "$(tdir_msp430x112)" msp430all
-emsp430x1101.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1101 "$(tdir_msp430x1101)" msp430all
-emsp430x1111.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1111 "$(tdir_msp430x1111)" msp430all
-emsp430x1121.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1121 "$(tdir_msp430x1121)" msp430all
-emsp430x1122.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1122 "$(tdir_msp430x1122)" msp430all
-emsp430x1132.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1132 "$(tdir_msp430x1132)" msp430all
-emsp430x122.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x122 "$(tdir_msp430x122)" msp430all
-emsp430x123.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x123 "$(tdir_msp430x123)" msp430all
-emsp430x1222.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1222 "$(tdir_msp430x1222)" msp430all
-emsp430x1232.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1232 "$(tdir_msp430x1232)" msp430all
-emsp430x133.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x133 "$(tdir_msp430x133)" msp430all
-emsp430x135.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x135 "$(tdir_msp430x135)" msp430all
-emsp430x1331.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1331 "$(tdir_msp430x1331)" msp430all
-emsp430x1351.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1351 "$(tdir_msp430x1351)" msp430all
-emsp430x147.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x147 "$(tdir_msp430x147)" msp430all
-emsp430x148.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x148 "$(tdir_msp430x148)" msp430all
-emsp430x149.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x149 "$(tdir_msp430x149)" msp430all
-emsp430x155.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x155 "$(tdir_msp430x155)" msp430all
-emsp430x156.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x156 "$(tdir_msp430x156)" msp430all
-emsp430x157.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x157 "$(tdir_msp430x157)" msp430all
-emsp430x167.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x167 "$(tdir_msp430x167)" msp430all
-emsp430x168.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x168 "$(tdir_msp430x168)" msp430all
-emsp430x169.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x169 "$(tdir_msp430x169)" msp430all
-emsp430x1610.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1610 "$(tdir_msp430x1610)" msp430all
-emsp430x1611.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1611 "$(tdir_msp430x1611)" msp430all
-emsp430x1612.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1612 "$(tdir_msp430x1612)" msp430all
-emsp430x2101.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x2101 "$(tdir_msp430x2101)" msp430all
-emsp430x2111.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x2111 "$(tdir_msp430x2111)" msp430all
-emsp430x2121.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x2121 "$(tdir_msp430x2121)" msp430all
-emsp430x2131.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x2131 "$(tdir_msp430x2131)" msp430all
-emsp430x311.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x311 "$(tdir_msp430x311)" msp430all
-emsp430x312.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x312 "$(tdir_msp430x312)" msp430all
-emsp430x313.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x313 "$(tdir_msp430x313)" msp430all
-emsp430x314.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x314 "$(tdir_msp430x314)" msp430all
-emsp430x315.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x315 "$(tdir_msp430x315)" msp430all
-emsp430x323.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x323 "$(tdir_msp430x323)" msp430all
-emsp430x325.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x325 "$(tdir_msp430x325)" msp430all
-emsp430x336.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x336 "$(tdir_msp430x336)" msp430all
-emsp430x337.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x337 "$(tdir_msp430x337)" msp430all
-emsp430x412.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x412 "$(tdir_msp430x412)" msp430all
-emsp430x413.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x413 "$(tdir_msp430x413)" msp430all
-emsp430x415.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x415 "$(tdir_msp430x415)" msp430all
-emsp430x417.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x417 "$(tdir_msp430x417)" msp430all
-emsp430xE423.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xE423 "$(tdir_msp430xE423)" msp430all
-emsp430xE425.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xE425 "$(tdir_msp430xE425)" msp430all
-emsp430xE427.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xE427 "$(tdir_msp430xE427)" msp430all
-emsp430xW423.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xW423 "$(tdir_msp430xW423)" msp430all
-emsp430xW425.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xW425 "$(tdir_msp430xW425)" msp430all
-emsp430xW427.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xW427 "$(tdir_msp430xW427)" msp430all
-emsp430xG437.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xG437 "$(tdir_msp430xG437)" msp430all
-emsp430xG438.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xG438 "$(tdir_msp430xG438)" msp430all
-emsp430xG439.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xG439 "$(tdir_msp430xG439)" msp430all
-emsp430x435.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x435 "$(tdir_msp430x435)" msp430all
-emsp430x436.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x436 "$(tdir_msp430x436)" msp430all
-emsp430x437.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x437 "$(tdir_msp430x437)" msp430all
-emsp430x447.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x447 "$(tdir_msp430x447)" msp430all
-emsp430x448.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x448 "$(tdir_msp430x448)" msp430all
-emsp430x449.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x449 "$(tdir_msp430x449)" msp430all
-enews.c: $(srcdir)/emulparams/news.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} news "$(tdir_news)"
-ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \
- $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ns32knbsd "$(tdir_ns32knbsd)"
-eor32.c: $(srcdir)/emulparams/or32.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/or32.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} or32 "$(tdir_or32)"
-eor32elf.c: $(srcdir)/emulparams/or32elf.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} or32elf "$(tdir_or32elf)"
-epc532macha.c: $(srcdir)/emulparams/pc532macha.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} pc532macha "$(tdir_pc532macha)"
-epdp11.c: $(srcdir)/emulparams/pdp11.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} pdp11 "$(tdir_pdp11)"
-epjelf.c: $(srcdir)/emulparams/pjelf.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} pjelf "$(tdir_pjelf)"
-epjlelf.c: $(srcdir)/emulparams/pjlelf.sh $(srcdir)/emulparams/pjelf.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} pjlelf "$(tdir_pjlelf)"
-eppcmacos.c: $(srcdir)/emulparams/ppcmacos.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ppcmacos "$(tdir_ppcmacos)"
-eppcnw.c: $(srcdir)/emulparams/ppcnw.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ppcnw "$(tdir_ppcnw)"
-eppcpe.c: $(srcdir)/emulparams/ppcpe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/ppcpe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ppcpe "$(tdir_ppcpe)"
-eppclynx.c: $(srcdir)/emulparams/ppclynx.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ppclynx "$(tdir_ppclynx)"
-eriscix.c: $(srcdir)/emulparams/riscix.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} riscix "$(tdir_riscix)"
-escoreelf.c: $(srcdir)/emulparams/scoreelf.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/scoreelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} scoreelf "$(tdir_scoreelf)"
-esh.c: $(srcdir)/emulparams/sh.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sh "$(tdir_sh)"
-eshelf.c: $(srcdir)/emulparams/shelf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf "$(tdir_shelf)"
-eshelf32.c: $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
- $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf32 "$(tdir_shelf32)"
-eshelf32_linux.c: $(srcdir)/emulparams/shelf32_linux.sh \
- $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
- $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf32_linux "$(tdir_shelf32_linux)"
-eshelf32_nbsd.c: $(srcdir)/emulparams/shelf32_nbsd.sh \
- $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
- $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf32_nbsd "$(tdir_shelf32_nbsd)"
-eshelf64.c: $(srcdir)/emulparams/shelf64.sh $(srcdir)/emulparams/shelf32.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf64 "$(tdir_shelf64)"
-eshelf64_nbsd.c: $(srcdir)/emulparams/shelf64_nbsd.sh \
- $(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf64_nbsd "$(tdir_shelf64_nbsd)"
-eshelf_linux.c: $(srcdir)/emulparams/shelf_linux.sh \
- $(srcdir)/emulparams/shlelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf_linux "$(tdir_shelf_linux)"
-eshlelf_linux.c: $(srcdir)/emulparams/shlelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf_linux "$(tdir_shlelf_linux)"
-eshelf_nbsd.c: $(srcdir)/emulparams/shelf_nbsd.sh \
- $(srcdir)/emulparams/shelf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf_nbsd "$(tdir_shelf_nbsd)"
-eshelf_nto.c: $(srcdir)/emulparams/shelf_nto.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf_nto "$(tdir_shelf_nto)"
-eshelf_vxworks.c: $(srcdir)/emulparams/shelf_vxworks.sh \
- $(srcdir)/emulparams/vxworks.sh $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc \
- $(srcdir)/emultempl/vxworks.em ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf_vxworks "$(tdir_shelf_vxworks)"
-eshlelf_nbsd.c: $(srcdir)/emulparams/shlelf_nbsd.sh \
- $(srcdir)/emulparams/shelf_nbsd.sh \
- $(srcdir)/emulparams/shelf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf_nbsd "$(tdir_shlelf_nbsd)"
-eshlelf_nto.c: $(srcdir)/emulparams/shlelf_nto.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf_nto "$(tdir_shlelf_nto)"
-eshlelf_vxworks.c: $(srcdir)/emulparams/shlelf_vxworks.sh \
- $(srcdir)/emulparams/shelf_vxworks.sh $(srcdir)/emulparams/vxworks.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/vxworks.em \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf_vxworks "$(tdir_shlelf_vxworks)"
-eshelf_uclinux.c: $(srcdir)/emulparams/shelf_uclinux.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf_uclinux "$(tdir_shelf_uclinux)"
-eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
- $(srcdir)/emulparams/shelf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf "$(tdir_shlelf)"
-eshlsymbian.c: $(srcdir)/emulparams/shlsymbian.sh \
- $(srcdir)/emulparams/shelf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf32sh-symbian.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlsymbian "$(tdir_shlelf)"
-eshlelf32.c: $(srcdir)/emulparams/shlelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h $(srcdir)/emulparams/shelf32.sh \
- $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf32 "$(tdir_shlelf32)"
-eshlelf32_linux.c: $(srcdir)/emulparams/shlelf32_linux.sh \
- $(srcdir)/emulparams/shelf32_linux.sh $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
- $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf32_linux "$(tdir_shlelf32_linux)"
-eshlelf32_nbsd.c: $(srcdir)/emulparams/shlelf32_nbsd.sh \
- $(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
- $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf32_nbsd "$(tdir_shlelf32_nbsd)"
-eshlelf64.c: $(srcdir)/emulparams/shlelf64.sh \
- $(srcdir)/emulparams/shelf64.sh $(srcdir)/emulparams/shelf32.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf64 "$(tdir_shlelf64)"
-eshlelf64_nbsd.c: $(srcdir)/emulparams/shlelf64_nbsd.sh \
- $(srcdir)/emulparams/shelf64_nbsd.sh \
- $(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf64_nbsd "$(tdir_shlelf64_nbsd)"
-eshl.c: $(srcdir)/emulparams/shl.sh \
- $(srcdir)/emulparams/sh.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shl "$(tdir_shl)"
-eshpe.c: $(srcdir)/emulparams/shpe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shpe "$(tdir_shl)"
-esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sparcaout "$(tdir_sparcaout)"
-esparclinux.c: $(srcdir)/emulparams/sparclinux.sh \
- $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sparclinux "$(tdir_sparclinux)"
-esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sparcnbsd "$(tdir_sparcnbsd)"
-est2000.c: $(srcdir)/emulparams/st2000.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} st2000 "$(tdir_st2000)"
-esun3.c: $(srcdir)/emulparams/sun3.sh \
- $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sun3 "$(tdir_sun3)"
-esun4.c: $(srcdir)/emulparams/sun4.sh \
- $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sun4 "$(tdir_sun4)"
-etic30aout.c: $(srcdir)/emulparams/tic30aout.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic30aout "$(tdir_tic30aout)"
-etic30coff.c: $(srcdir)/emulparams/tic30coff.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30coff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic30coff "$(tdir_tic30coff)"
-etic3xcoff.c: $(srcdir)/emulparams/tic3xcoff.sh \
- $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic3xcoff "$(tdir_tic4xcoff)"
-etic3xcoff_onchip.c: $(srcdir)/emulparams/tic3xcoff_onchip.sh \
- $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic3xcoff_onchip "$(tdir_tic4xcoff)"
-etic4xcoff.c: $(srcdir)/emulparams/tic4xcoff.sh \
- $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic4xcoff "$(tdir_tic4xcoff)"
-etic54xcoff.c: $(srcdir)/emulparams/tic54xcoff.sh \
- $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic54xcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic54xcoff "$(tdir_tic54xcoff)"
-etic80coff.c: $(srcdir)/emulparams/tic80coff.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic80coff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic80coff "$(tdir_tic80coff)"
-evanilla.c: $(srcdir)/emulparams/vanilla.sh \
- $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} vanilla "$(tdir_vanilla)"
-evax.c: $(srcdir)/emulparams/vax.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} vax "$(tdir_vax)"
-evaxnbsd.c: $(srcdir)/emulparams/vaxnbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} vaxnbsd "$(tdir_vaxnbsd)"
-evsta.c: $(srcdir)/emulparams/vsta.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} vsta "$(tdir_vsta)"
-ev850.c: $(srcdir)/emulparams/v850.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/v850.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} v850 "$(tdir_v850)"
-ew65.c: $(srcdir)/emulparams/w65.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} w65 "$(tdir_w65)"
-ez80.c: $(srcdir)/emulparams/z80.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/z80.em \
- $(srcdir)/scripttempl/z80.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} z80 "$(tdir_z80)"
-ez8001.c: $(srcdir)/emulparams/z8001.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} z8001 "$(tdir_z8001)"
-ez8002.c: $(srcdir)/emulparams/z8002.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} z8002 "$(tdir_z8002)"
-
-# We need this for automake to use YLWRAP.
-EXTRA_ld_new_SOURCES = deffilep.y
-
-ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
- ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c
-ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL_DEP)
-ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
-
-# The generated emulation files mostly have the same dependencies.
-$(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
- ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \
- ldctor.h ldexp.h ldlang.h ldgram.h
-
-# This is the real libbfd.a created by libtool.
-TESTBFDLIB = @TESTBFDLIB@
-
-check-DEJAGNU: site.exp
- srcroot=`cd $(srcdir) && pwd`; export srcroot; \
- r=`pwd`; export r; \
- LC_COLLATE=; LC_ALL=; LANG=; export LC_COLLATE LC_ALL LANG; \
- EXPECT=$(EXPECT); export EXPECT; \
- runtest=$(RUNTEST); \
- if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
- $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
- CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
- CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
- CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
- OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
- LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \
- $(RUNTESTFLAGS); \
- else echo "WARNING: could not find \`runtest'" 1>&2; :;\
- fi
-
-# Rules for testing by relinking ld itself.
-# A similar test is in the testsuite. This target is for ease of use
-# when porting ld.
-
-ld-partial.o: ld-new$(EXEEXT)
- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
-ld1$(EXEEXT): ld-partial.o
- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.o $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-ld1-full$(EXEEXT): ld-new
- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-ld2$(EXEEXT): ld1$(EXEEXT)
- ./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-ld3$(EXEEXT): ld2$(EXEEXT)
- ./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-bootstrap: ld3$(EXEEXT)
- cmp ld2$(EXEEXT) ld3$(EXEEXT)
-
-.PHONY: bootstrap
-
-# A test program for C++ constructors and destructors.
-# This test is now in the testsuite.
-#
-#cdtest: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
-# ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
-# cdtest-main.o cdtest-bar.o cdtest-foo.o $(HOSTING_LIBS)
-#
-#cdtest.out: cdtest
-# ./cdtest > cdtest.tmp
-# mv cdtest.tmp cdtest.out
-#
-#cdtest-ur.o: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
-# ./ld.new $(HOSTING_EMU) -o cdtest-ur.o -Ur cdtest-main.o \
-# cdtest-bar.o cdtest-foo.o
-#
-#cdtest-ur: cdtest-ur.o
-# ./ld.new $(HOSTING_EMU) -o cdtest-ur $(HOSTING_CRT0) cdtest-ur.o \
-# $(HOSTING_LIBS)
-#
-#cdtest-ur.out: cdtest-ur
-# ./cdtest-ur > cdtest-ur.tmp
-# mv cdtest-ur.tmp cdtest-ur.out
-#
-#check-cdtest: cdtest.out cdtest-ur.out $(srcdir)/cdtest.exp
-# diff $(srcdir)/cdtest.exp cdtest.out
-# diff $(srcdir)/cdtest.exp cdtest-ur.out
-#
-#.PHONY: check-cdtest
-
-# END OF CHECK TARGETS
-
-# DOCUMENTATION TARGETS
-# Manual configuration file; not usually attached to normal configuration,
-# because almost all configs use "gen" version of manual.
-# Set DOCVER above to change.
-configdoc.texi: ${DOCVER}-doc.texi
- cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
- chmod u+w ./configdoc.texi
-
-# Build the man page from the texinfo file
-# The sed command removes the no-adjust Nroff command so that
-# the man output looks standard.
-ld.1: $(srcdir)/ld.texinfo configdoc.texi
- touch $@
- -$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texinfo > ld.pod
- -($(POD2MAN) ld.pod | \
- sed -e '/^.if n .na/d' > $@.T$$$$ && \
- mv -f $@.T$$$$ $@) || \
- (rm -f $@.T$$$$ && exit 1)
- rm -f ld.pod
-
-MAINTAINERCLEANFILES = configdoc.texi
-
-# We want to reconfigure if configure.host or configure.tgt changes. We
-# extract version from bfd/configure.in, so we must depend on that also.
-CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \
- $(srcdir)/../bfd/configure.in
-
-MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
- ldemul-list.h crtbegin.o crtend.o ld.log ld.sum
-mostlyclean-local:
- -rm -rf tmpdir
-CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 spu_ovl.s spu_ovl.o
-
-.PHONY: install-html install-html-am install-html-recursive
-
-html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-
-install-html: install-html-recursive install-html-am
-
-install-html-am: $(HTMLS)
- @$(NORMAL_INSTALL)
- test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
- @list='$(HTMLS)'; for p in $$list; do \
- if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
- f=$(html__strip_dir) \
- if test -d "$$d$$p"; then \
- echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
- $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
- echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
- else \
- echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
- fi; \
- done
-
-install-html-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-.PHONY: install-exec-local install-data-local
-
-install-exec-local: ld-new$(EXEEXT)
- $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
- @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//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
- else :; fi; \
- done
- n=`echo ld | sed '$(transform)'`; \
- if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)" ]; then \
- rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
- ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
- || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
- fi
-
-install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(scriptdir)/ldscripts
- for f in ldscripts/*; do \
- $(INSTALL_DATA) $$f $(DESTDIR)$(scriptdir)/$$f ; \
- done
-
-# We want install to imply install-info as per GNU standards, despite the
-# cygnus option.
-install-data-local: install-info
-
-# Stuff that should be included in a distribution. The diststuff
-# target is run by the taz target in ../Makefile.in.
-EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c $(man_MANS)
-diststuff: info $(EXTRA_DIST)
-all: info ld.1
-
-# Both info (ld.info) and ld.1 depend on configdoc.texi.
-# But info isn't a direct target. Make info-recursive to depend on
-# ld.1 to support parallel build.
-info-recursive: ld.1
-
-DISTCLEANFILES = tdirs site.exp site.bak stringify.sed
-distclean-local:
- rm -rf ldscripts
-
-MAINTAINERCLEANFILES += ld.info
-
-# Automake 1.9 will only build info files in the objdir if they are
-# mentioned in DISTCLEANFILES. It doesn't have to be unconditional,
-# though, so we use a bogus condition.
-if GENINSRC_NEVER
-DISTCLEANFILES += ld.info
-endif
-
-# 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
- sed <$(srcdir)/dep-in.sed >dep.sed \
- -e 's!@INCDIR@!$(INCDIR)!' \
- -e 's!@BFDDIR@!$(BFDDIR)!' \
- -e 's!@SRCDIR@!$(srcdir)!' \
- -e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/ld$$,,`'!'
-
-dep: DEP
- sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
- cat DEP >> tmp-Makefile
- $(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
- $(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
- $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
-
-.PHONY: dep dep-in dep-am
-
-# 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.
-ldctor.o: ldctor.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h ld.h ldexp.h \
- ldlang.h ldmisc.h ldgram.h ldmain.h ldctor.h
-ldemul.o: ldemul.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h ld.h ldmisc.h ldexp.h ldlang.h \
- ldfile.h ldemul.h ldmain.h ldemul-list.h
-ldexp.o: ldexp.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h ld.h ldmain.h ldmisc.h ldexp.h \
- ldlex.h ldgram.h ldlang.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/safe-ctype.h
-ldfile.o: ldfile.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h ld.h ldmisc.h \
- ldexp.h ldlang.h ldfile.h ldmain.h ldgram.h ldlex.h \
- ldemul.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/filenames.h
-ldlang.o: ldlang.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/obstack.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
- ldexp.h ldlang.h ldgram.h ldlex.h ldmisc.h ldctor.h \
- ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h \
- $(INCDIR)/libiberty.h $(INCDIR)/hashtab.h
-ldmain.o: ldmain.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/progress.h $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \
- ld.h ldmain.h ldmisc.h ldwrite.h ldexp.h ldlang.h ldgram.h \
- ldlex.h ldfile.h ldemul.h ldctor.h
-ldmisc.o: ldmisc.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/demangle.h $(INCDIR)/libiberty.h ld.h ldmisc.h \
- ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h ldfile.h \
- $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/bfdlink.h
-ldver.o: ldver.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- ../bfd/bfdver.h ld.h ldver.h ldexp.h ldlang.h ldfile.h \
- ldemul.h ldmain.h
-ldwrite.o: ldwrite.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/safe-ctype.h ld.h ldexp.h ldlang.h ldwrite.h \
- ldmisc.h ldgram.h ldmain.h
-lexsup.o: lexsup.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- ../bfd/bfdver.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
- ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldfile.h \
- ldver.h ldemul.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h
-mri.o: mri.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- ld.h ldexp.h ldlang.h ldmisc.h mri.h ldgram.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h
-ldcref.o: ldcref.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/demangle.h $(INCDIR)/libiberty.h $(INCDIR)/objalloc.h \
- ld.h ldmain.h ldmisc.h ldexp.h ldlang.h
-pe-dll.o: pe-dll.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/safe-ctype.h ld.h ldexp.h ldlang.h ldwrite.h \
- ldmisc.h ldgram.h ldmain.h ldfile.h ldemul.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h deffile.h pe-dll.h
-pep-dll.o: pep-dll.c pe-dll.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/safe-ctype.h ld.h ldexp.h ldlang.h ldwrite.h \
- ldmisc.h ldgram.h ldmain.h ldfile.h ldemul.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h deffile.h pe-dll.h \
- pep-dll.h
-ldgram.o: ldgram.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h ld.h ldexp.h ldver.h ldlang.h ldfile.h \
- ldemul.h ldmisc.h ldmain.h mri.h ldctor.h ldlex.h
-ldlex.o: ldlex.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h ld.h ldmisc.h \
- ldexp.h ldlang.h ldgram.h ldfile.h ldlex.h ldmain.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h
-deffilep.o: deffilep.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- ld.h ldmisc.h deffile.h
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/ld/Makefile.in b/ld/Makefile.in
deleted file mode 100644
index 2dc1fa22c94..00000000000
--- a/ld/Makefile.in
+++ /dev/null
@@ -1,2844 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 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.
-
-@SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-noinst_PROGRAMS = ld-new$(EXEEXT)
-
-# Automake 1.9 will only build info files in the objdir if they are
-# mentioned in DISTCLEANFILES. It doesn't have to be unconditional,
-# though, so we use a bogus condition.
-@GENINSRC_NEVER_TRUE@am__append_1 = ld.info
-DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \
- README ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/config.in $(srcdir)/../mkinstalldirs \
- $(top_srcdir)/po/Make-in ldgram.h ldgram.c ldlex.c deffilep.h \
- deffilep.c $(srcdir)/../ylwrap $(srcdir)/../ltmain.sh \
- $(srcdir)/../config.guess $(srcdir)/../config.sub \
- $(ld_TEXINFOS)
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \
- $(top_srcdir)/../bfd/warning.m4 \
- $(top_srcdir)/../config/depstand.m4 \
- $(top_srcdir)/../config/gettext-sister.m4 \
- $(top_srcdir)/../config/lead-dot.m4 \
- $(top_srcdir)/../config/nls.m4 \
- $(top_srcdir)/../config/override.m4 \
- $(top_srcdir)/../config/po.m4 \
- $(top_srcdir)/../config/proginstall.m4 \
- $(top_srcdir)/../config/progtest.m4 \
- $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
- $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = po/Makefile.in
-PROGRAMS = $(noinst_PROGRAMS)
-am_ld_new_OBJECTS = ldgram.$(OBJEXT) ldlex.$(OBJEXT) lexsup.$(OBJEXT) \
- ldlang.$(OBJEXT) mri.$(OBJEXT) ldctor.$(OBJEXT) \
- ldmain.$(OBJEXT) ldwrite.$(OBJEXT) ldexp.$(OBJEXT) \
- ldemul.$(OBJEXT) ldver.$(OBJEXT) ldmisc.$(OBJEXT) \
- ldfile.$(OBJEXT) ldcref.$(OBJEXT)
-ld_new_OBJECTS = $(am_ld_new_OBJECTS)
-am__DEPENDENCIES_1 =
-am__DEPENDENCIES_2 = ../bfd/libbfd.la
-am__DEPENDENCIES_3 = ../libiberty/libiberty.a
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
-LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
-YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
-LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \
- $(AM_YFLAGS)
-YLWRAP = $(top_srcdir)/../ylwrap
-SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES)
-INFO_DEPS = ld.info
-TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
-am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo
-DVIS = ld.dvi
-PDFS = ld.pdf
-PSS = ld.ps
-HTMLS = ld.html
-TEXINFOS = ld.texinfo
-TEXI2PDF = $(TEXI2DVI) --pdf --batch
-MAKEINFOHTML = $(MAKEINFO) --html
-AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
-DVIPS = dvips
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
-man1dir = $(mandir)/man1
-am__installdirs = "$(DESTDIR)$(man1dir)"
-NROFF = nroff
-MANS = $(man_MANS)
-ETAGS = etags
-CTAGS = ctags
-DEJATOOL = $(PACKAGE)
-RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
-DIST_SUBDIRS = $(SUBDIRS)
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATADIRNAME = @DATADIRNAME@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EMUL = @EMUL@
-EMULATION_LIBPATH = @EMULATION_LIBPATH@
-EMULATION_OFILES = @EMULATION_OFILES@
-EMUL_EXTRA_OFILES = @EMUL_EXTRA_OFILES@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GENCAT = @GENCAT@
-GENINSRC_NEVER_FALSE = @GENINSRC_NEVER_FALSE@
-GENINSRC_NEVER_TRUE = @GENINSRC_NEVER_TRUE@
-GMSGFMT = @GMSGFMT@
-GREP = @GREP@
-HDEFINES = @HDEFINES@
-
-#stuff for self hosting (can be overridden in config file).
-HOSTING_CRT0 = @HOSTING_CRT0@
-HOSTING_LIBS = @HOSTING_LIBS@
-INCINTL = @INCINTL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INSTOBJEXT = @INSTOBJEXT@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi`
-LEXLIB = @LEXLIB@
-LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-LIBINTL = @LIBINTL@
-LIBINTL_DEP = @LIBINTL_DEP@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-
-# Search path to override the default search path for -lfoo libraries.
-# If LIB_PATH is empty, the ones in the script (if any) are left alone.
-# (The default is usually /lib:/usr/lib:/usr/local/lib, unless building
-# a cross-linker, in which case the default is empty. See genscripts.sh.)
-# Otherwise, they are replaced with the ones given in LIB_PATH,
-# which may have the form: LIB_PATH=/lib:/usr/local/lib. This can be set
-# when the linker is configured via the --with-lib-path configure switch.
-LIB_PATH = @LIB_PATH@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-MSGMERGE = @MSGMERGE@
-NATIVE_LIB_DIRS = @NATIVE_LIB_DIRS@
-NM = @NM@
-NO_WERROR = @NO_WERROR@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-POSUB = @POSUB@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRINGIFY = @STRINGIFY@
-STRIP = @STRIP@
-TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
-TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
-
-# This is the real libbfd.a created by libtool.
-TESTBFDLIB = @TESTBFDLIB@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-WARN_CFLAGS = @WARN_CFLAGS@
-XGETTEXT = @XGETTEXT@
-YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi`
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-use_sysroot = @use_sysroot@
-AUTOMAKE_OPTIONS = cygnus dejagnu
-ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
-SUBDIRS = po
-tooldir = $(exec_prefix)/$(target_alias)
-YFLAGS = -d
-AM_CFLAGS = $(WARN_CFLAGS)
-
-# We put the scripts in the directory $(scriptdir)/ldscripts.
-# We can't put the scripts in $(datadir) because the SEARCH_DIR
-# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
-BASEDIR = $(srcdir)/..
-BFDDIR = $(BASEDIR)/bfd
-INCDIR = $(BASEDIR)/include
-MKDEP = gcc -MM
-
-# What version of the manual to build
-DOCVER = gen
-
-# Options to extract the man page from ld.texinfo
-MANCONF = -Dman
-TEXI2POD = perl $(BASEDIR)/etc/texi2pod.pl $(AM_MAKEINFOFLAGS)
-POD2MAN = pod2man --center="GNU Development Tools" \
- --release="binutils-$(VERSION)" --section=1
-
-HOSTING_EMU = -m $(EMUL)
-
-# Setup the testing framework, if you have one
-EXPECT = expect
-RUNTEST = runtest
-RUNTESTFLAGS =
-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`
-
-CXX = g++
-CXX_FOR_TARGET = ` \
- if [ -f $$r/../gcc/g++ ] ; then \
- if [ -f $$r/../newlib/Makefile ] ; then \
- echo $$r/../gcc/g++ -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
- else \
- echo $$r/../gcc/g++ -B$$r/../gcc/; \
- fi; \
- else \
- if [ "@host@" = "@target@" ] ; then \
- echo $(CXX); \
- else \
- echo g++ | sed '$(transform)'; \
- fi; \
- fi`
-
-info_TEXINFOS = ld.texinfo
-ld_TEXINFOS = configdoc.texi
-noinst_TEXINFOS = ldint.texinfo
-man_MANS = ld.1
-AM_MAKEINFOFLAGS = -I $(srcdir) -I $(BFDDIR)/doc -I ../bfd/doc \
- -I $(top_srcdir)/../libiberty
-
-TEXI2DVI = texi2dvi -I $(srcdir) -I $(BFDDIR)/doc -I ../bfd/doc \
- -I $(top_srcdir)/../libiberty
-
-INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
- @INCINTL@ $(HDEFINES) $(CFLAGS) \
- -DLOCALEDIR="\"$(datadir)/locale\""
-
-BFDLIB = ../bfd/libbfd.la
-LIBIBERTY = ../libiberty/libiberty.a
-ALL_EMULATIONS = \
- eaixppc.o \
- eaixrs6.o \
- ealpha.o \
- earcelf.o \
- earm_epoc_pe.o \
- earm_wince_pe.o \
- earmaoutb.o \
- earmaoutl.o \
- earmcoff.o \
- earmelf.o \
- earmelfb.o \
- earmelf_fbsd.o \
- earmelf_linux.o \
- earmelf_linux_eabi.o \
- earmelfb_linux.o \
- earmelfb_linux_eabi.o \
- earmelf_nbsd.o \
- earmelfb_nbsd.o \
- earmelf_vxworks.o \
- earmnto.o \
- earmnbsd.o \
- earmpe.o \
- earmsymbian.o \
- eavr2.o \
- eavr1.o \
- eavr3.o \
- eavr4.o \
- eavr5.o \
- eavr6.o \
- ecoff_i860.o \
- ecoff_sparc.o \
- eelf32_spu.o \
- ecrisaout.o \
- ecriself.o \
- ecrislinux.o \
- ed10velf.o \
- ed30v_e.o \
- ed30v_o.o \
- ed30velf.o \
- edelta68.o \
- eelf32_dlx.o \
- eelf32_i960.o \
- eelf32_i860.o \
- eelf32_sparc.o \
- eelf32_sparc_vxworks.o \
- eelf32b4300.o \
- eelf32bfin.o \
- eelf32bfinfd.o \
- eelf32cr16.o \
- eelf32cr16c.o \
- eelf32bmip.o \
- eelf32bmipn32.o \
- eelf32btsmip.o \
- eelf32crx.o \
- eelf32btsmipn32.o \
- eelf32ltsmip.o \
- eelf32ltsmipn32.o \
- eelf32ebmip.o \
- eelf32ebmipvxworks.o \
- eelf32elmip.o \
- eelf32elmipvxworks.o \
- eelf32fr30.o \
- eelf32frv.o \
- eelf32i370.o \
- eelf32ip2k.o \
- eelf32iq2000.o \
- eelf32iq10.o \
- eelf32l4300.o \
- eelf32lmip.o \
- eelf32lppc.o \
- eelf32lppcnto.o \
- eelf32lppcsim.o \
- eelf32m32c.o \
- eelf32mcore.o \
- eelf32mep.o \
- eelf32mipswindiss.o \
- eelf32mt.o \
- eelf32openrisc.o \
- eelf32ppc.o \
- eelf32ppc_fbsd.o \
- eelf32ppclinux.o \
- eelf32ppcnto.o \
- eelf32ppcsim.o \
- eelf32ppcwindiss.o \
- eelf32ppcvxworks.o \
- eelf32vax.o \
- eelf32xc16x.o \
- eelf32xc16xl.o \
- eelf32xc16xs.o \
- eelf32xstormy16.o \
- eelf32xtensa.o \
- eelf_i386.o \
- eelf_i386_be.o \
- eelf_i386_chaos.o \
- eelf_i386_fbsd.o \
- eelf_i386_ldso.o \
- eelf_i386_vxworks.o \
- eelf_s390.o \
- egld960.o \
- egld960coff.o \
- eh8300.o \
- eh8300h.o \
- eh8300s.o \
- eh8300elf.o \
- eh8300hn.o \
- eh8300sn.o \
- eh8300sx.o \
- eh8300helf.o \
- eh8300self.o \
- eh8300hnelf.o \
- eh8300snelf.o \
- eh8300sxelf.o \
- eh8300sxn.o \
- eh8300sxnelf.o \
- eh8500.o \
- eh8500b.o \
- eh8500c.o \
- eh8500m.o \
- eh8500s.o \
- ehp300bsd.o \
- ehp3hpux.o \
- ehppaelf.o \
- ehppalinux.o \
- ehppanbsd.o \
- ehppaobsd.o \
- ei386aout.o \
- ei386beos.o \
- ei386bsd.o \
- ei386coff.o \
- ei386go32.o \
- ei386linux.o \
- ei386lynx.o \
- ei386mach.o \
- ei386moss.o \
- ei386msdos.o \
- ei386nbsd.o \
- ei386nto.o \
- ei386nw.o \
- ei386pe.o \
- ei386pe_posix.o \
- ei386pep.o \
- elnk960.o \
- em32relf.o \
- em32rlelf.o \
- em32relf_linux.o \
- em32rlelf_linux.o \
- em68hc11elf.o \
- em68hc11elfb.o \
- em68hc12elf.o \
- em68hc12elfb.o \
- em68k4knbsd.o \
- em68kaout.o \
- em68kaux.o \
- em68kcoff.o \
- em68kelf.o \
- em68kelfnbsd.o \
- em68klinux.o \
- em68knbsd.o \
- em68kpsos.o \
- em88kbcs.o \
- emaxqcoff.o \
- emcorepe.o \
- emipsbig.o \
- emipsbsd.o \
- emipsidt.o \
- emipsidtl.o \
- emipslit.o \
- emipslnews.o \
- emipspe.o \
- emsp430x110.o \
- emsp430x112.o \
- emsp430x1101.o \
- emsp430x1111.o \
- emsp430x1121.o \
- emsp430x1122.o \
- emsp430x1132.o \
- emsp430x122.o \
- emsp430x123.o \
- emsp430x1222.o \
- emsp430x1232.o \
- emsp430x133.o \
- emsp430x135.o \
- emsp430x1331.o \
- emsp430x1351.o \
- emsp430x147.o \
- emsp430x148.o \
- emsp430x149.o \
- emsp430x155.o \
- emsp430x156.o \
- emsp430x157.o \
- emsp430x167.o \
- emsp430x168.o \
- emsp430x169.o \
- emsp430x1610.o \
- emsp430x1611.o \
- emsp430x1612.o \
- emsp430x2101.o \
- emsp430x2111.o \
- emsp430x2121.o \
- emsp430x2131.o \
- emsp430x311.o \
- emsp430x312.o \
- emsp430x313.o \
- emsp430x314.o \
- emsp430x315.o \
- emsp430x323.o \
- emsp430x325.o \
- emsp430x336.o \
- emsp430x337.o \
- emsp430x412.o \
- emsp430x413.o \
- emsp430x415.o \
- emsp430x417.o \
- emsp430xE423.o \
- emsp430xE425.o \
- emsp430xE427.o \
- emsp430xW423.o \
- emsp430xW425.o \
- emsp430xW427.o \
- emsp430xG437.o \
- emsp430xG438.o \
- emsp430xG439.o \
- emsp430x435.o \
- emsp430x436.o \
- emsp430x437.o \
- emsp430x447.o \
- emsp430x448.o \
- emsp430x449.o \
- enews.o \
- ens32knbsd.o \
- eor32.o \
- eor32elf.o \
- epc532macha.o \
- epdp11.o \
- epjelf.o \
- epjlelf.o \
- eppcmacos.o \
- eppcnw.o \
- eppcpe.o \
- eppclynx.o \
- eriscix.o \
- escoreelf.o \
- esh.o \
- eshelf32.o \
- eshlelf32.o \
- eshelf32_linux.o \
- eshlelf32_linux.o \
- eshelf32_nbsd.o \
- eshlelf32_nbsd.o \
- eshelf.o \
- eshelf_linux.o \
- eshlelf_linux.o \
- eshelf_nbsd.o \
- eshlelf_nbsd.o \
- eshelf_nto.o \
- eshlelf_nto.o \
- eshelf_uclinux.o \
- eshelf_vxworks.o \
- eshlelf_vxworks.o \
- eshl.o \
- eshlelf.o \
- eshlsymbian.o \
- eshpe.o \
- esparcaout.o \
- esparclinux.o \
- esparcnbsd.o \
- est2000.o \
- esun3.o \
- esun4.o \
- etic30aout.o \
- etic30coff.o \
- etic3xcoff.o \
- etic3xcoff_onchip.o \
- etic4xcoff.o \
- etic54xcoff.o \
- etic80coff.o \
- evanilla.o \
- evax.o \
- evaxnbsd.o \
- evsta.o \
- ew65.o \
- ez8001.o \
- eelf32frvfd.o \
- ez80.o \
- ez8002.o
-
-ALL_64_EMULATIONS = \
- eelf64_aix.o \
- eelf64_ia64.o \
- eelf64_ia64_fbsd.o \
- eshelf64.o \
- eshlelf64.o \
- eshelf64_nbsd.o \
- eshlelf64_nbsd.o \
- eelf_x86_64.o \
- eelf_x86_64_fbsd.o \
- eelf64_s390.o \
- eelf64_sparc.o \
- eelf64_sparc_fbsd.o \
- eelf64alpha.o \
- eelf64alpha_fbsd.o \
- eelf64alpha_nbsd.o \
- eelf64bmip.o \
- eelf64btsmip.o \
- eelf64ltsmip.o \
- eelf64hppa.o \
- eelf64mmix.o \
- emmo.o \
- eelf64ppc.o \
- eelf64lppc.o \
- ehppa64linux.o
-
-ALL_EMUL_EXTRA_OFILES = \
- deffilep.o \
- pe-dll.o \
- pep-dll.o
-
-CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
- ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
- mri.c ldcref.c pe-dll.c pep-dll.c
-
-HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
- ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
- ldwrite.h mri.h deffile.h pe-dll.h pep-dll.h elf-hints-local.h
-
-GENERATED_CFILES = ldgram.c ldlex.c deffilep.c
-GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
-OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
- ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
- ldfile.o ldcref.o ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES}
-
-STAGESTUFF = *.o ldscripts/* e*.c
-
-# At the moment this is just a list of those emulation template files
-# that contain internationalised strings.
-EMULATION_FILES = emultempl/pe.em emultempl/armcoff.em
-POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES)
-
-# These all start with e so 'make clean' can find them.
-GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
-GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
-ELF_DEPS = $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/elf-generic.em
-ELF_GEN_DEPS = $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/elf-generic.em $(srcdir)/emultempl/genelf.em
-
-# We need this for automake to use YLWRAP.
-EXTRA_ld_new_SOURCES = deffilep.y
-ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
- ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c
-
-ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL_DEP)
-ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
-MAINTAINERCLEANFILES = configdoc.texi ld.info
-
-# We want to reconfigure if configure.host or configure.tgt changes. We
-# extract version from bfd/configure.in, so we must depend on that also.
-CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host $(srcdir)/configure.tgt \
- $(srcdir)/../bfd/configure.in
-
-MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
- ldemul-list.h crtbegin.o crtend.o ld.log ld.sum
-
-CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 spu_ovl.s spu_ovl.o
-html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-
-# Stuff that should be included in a distribution. The diststuff
-# target is run by the taz target in ../Makefile.in.
-EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c $(man_MANS)
-DISTCLEANFILES = tdirs site.exp site.bak stringify.sed $(am__append_1)
-all: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .c .dvi .l .lo .o .obj .ps .y
-am--refresh:
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \
- cd $(srcdir) && $(AUTOMAKE) --cygnus \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --cygnus Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-
-config.h: stamp-h1
- @if test ! -f $@; then \
- rm -f stamp-h1; \
- $(MAKE) stamp-h1; \
- else :; fi
-
-stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_srcdir) && $(AUTOHEADER)
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f config.h stamp-h1
-po/Makefile.in: $(top_builddir)/config.status $(top_srcdir)/po/Make-in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-
-clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-ldgram.h: ldgram.c
- @if test ! -f $@; then \
- rm -f ldgram.c; \
- $(MAKE) ldgram.c; \
- else :; fi
-deffilep.h: deffilep.c
- @if test ! -f $@; then \
- rm -f deffilep.c; \
- $(MAKE) deffilep.c; \
- else :; fi
-ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES)
- @rm -f ld-new$(EXEEXT)
- $(LINK) $(ld_new_LDFLAGS) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c $<
-
-.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- $(LTCOMPILE) -c -o $@ $<
-
-.l.c:
- $(LEXCOMPILE) $<
- sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@
- rm -f $(LEX_OUTPUT_ROOT).c
-
-.y.c:
- $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-
-ld.info: ld.texinfo $(ld_TEXINFOS)
- restore=: && backupdir="$(am__leading_dot)am$$$$" && \
- rm -rf $$backupdir && mkdir $$backupdir && \
- if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
- for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
- if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
- done; \
- else :; fi && \
- if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
- -o $@ `test -f 'ld.texinfo' || echo '$(srcdir)/'`ld.texinfo; \
- then \
- rc=0; \
- else \
- rc=$$?; \
- $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
- fi; \
- rm -rf $$backupdir; exit $$rc
-
-ld.dvi: ld.texinfo $(ld_TEXINFOS)
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2DVI) -o $@ `test -f 'ld.texinfo' || echo '$(srcdir)/'`ld.texinfo
-
-ld.pdf: ld.texinfo $(ld_TEXINFOS)
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2PDF) -o $@ `test -f 'ld.texinfo' || echo '$(srcdir)/'`ld.texinfo
-
-ld.html: ld.texinfo $(ld_TEXINFOS)
- rm -rf $(@:.html=.htp)
- if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
- -o $(@:.html=.htp) `test -f 'ld.texinfo' || echo '$(srcdir)/'`ld.texinfo; \
- then \
- rm -rf $@; \
- if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
- mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
- else \
- if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
- rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
- exit 1; \
- fi
-.dvi.ps:
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- $(DVIPS) -o $@ $<
-
-uninstall-info-am:
- @$(PRE_UNINSTALL)
- @if (install-info --version && \
- install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
- list='$(INFO_DEPS)'; \
- for file in $$list; do \
- relfile=`echo "$$file" | sed 's|^.*/||'`; \
- echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
- install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
- done; \
- else :; fi
- @$(NORMAL_UNINSTALL)
- @list='$(INFO_DEPS)'; \
- for file in $$list; do \
- relfile=`echo "$$file" | sed 's|^.*/||'`; \
- relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
- (if cd "$(DESTDIR)$(infodir)"; then \
- echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
- rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
- else :; fi); \
- done
-
-dist-info: $(INFO_DEPS)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- list='$(INFO_DEPS)'; \
- for base in $$list; do \
- case $$base in \
- $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
- esac; \
- if test -f $$base; then d=.; else d=$(srcdir); fi; \
- for file in $$d/$$base*; do \
- relfile=`expr "$$file" : "$$d/\(.*\)"`; \
- test -f $(distdir)/$$relfile || \
- cp -p $$file $(distdir)/$$relfile; \
- done; \
- done
-
-mostlyclean-aminfo:
- -rm -rf ld.aux ld.cp ld.cps ld.fn ld.fns ld.ky ld.log ld.pg ld.pgs ld.tmp \
- ld.toc ld.tp ld.tps ld.vr ld.vrs ld.dvi ld.pdf ld.ps ld.html
-
-maintainer-clean-aminfo:
- @list='$(INFO_DEPS)'; for i in $$list; do \
- i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
- echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
- rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
- done
-
-clean-info: mostlyclean-aminfo
-install-man1: $(man1_MANS) $(man_MANS)
- @$(NORMAL_INSTALL)
- test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
- @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_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/^.*\\.//'`; \
- case "$$ext" in \
- 1*) ;; \
- *) ext='1' ;; \
- esac; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
- done
-uninstall-man1:
- @$(NORMAL_UNINSTALL)
- @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_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/^.*\\.//'`; \
- case "$$ext" in \
- 1*) ;; \
- *) ext='1' ;; \
- esac; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
- rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
- done
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-site.exp: Makefile
- @echo 'Making a new site.exp file...'
- @echo '## these variables are automatically generated by make ##' >site.tmp
- @echo '# Do not edit here. If you wish to override these values' >>site.tmp
- @echo '# edit the last section' >>site.tmp
- @echo 'set srcdir $(srcdir)' >>site.tmp
- @echo "set objdir `pwd`" >>site.tmp
- @echo 'set build_alias "$(build_alias)"' >>site.tmp
- @echo 'set build_triplet $(build_triplet)' >>site.tmp
- @echo 'set host_alias "$(host_alias)"' >>site.tmp
- @echo 'set host_triplet $(host_triplet)' >>site.tmp
- @echo 'set target_alias "$(target_alias)"' >>site.tmp
- @echo 'set target_triplet $(target_triplet)' >>site.tmp
- @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
- @test ! -f site.exp || \
- sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
- @-rm -f site.bak
- @test ! -f site.exp || mv site.exp site.bak
- @mv site.tmp site.exp
-
-distclean-DEJAGNU:
- -rm -f site.exp site.bak
- -l='$(DEJATOOL)'; for tool in $$l; do \
- rm -f $$tool.sum $$tool.log; \
- done
-check-am:
- $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
-check: check-recursive
-all-am: Makefile $(PROGRAMS) $(MANS) config.h
-installdirs: installdirs-recursive
-installdirs-am:
- for dir in "$(DESTDIR)$(man1dir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
- -rm -f deffilep.c
- -rm -f deffilep.h
- -rm -f ldgram.c
- -rm -f ldgram.h
- -rm -f ldlex.c
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
- mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-DEJAGNU distclean-compile \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-local distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am: $(DVIS)
-
-html: html-recursive
-
-html-am: $(HTMLS)
-
-info: info-recursive
-
-info-am: $(INFO_DEPS)
-
-install-data-am: install-data-local install-man
-
-install-exec-am: install-exec-local
-
-install-info: install-info-recursive
-
-install-info-am: $(INFO_DEPS)
- @$(NORMAL_INSTALL)
- test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)"
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- list='$(INFO_DEPS)'; \
- for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- esac; \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
- file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
- for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
- $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
- if test -f $$ifile; then \
- relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
- echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
- $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
- else : ; fi; \
- done; \
- done
- @$(POST_INSTALL)
- @if (install-info --version && \
- install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
- list='$(INFO_DEPS)'; \
- for file in $$list; do \
- relfile=`echo "$$file" | sed 's|^.*/||'`; \
- echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
- install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
- done; \
- else : ; fi
-install-man: install-man1
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-aminfo \
- maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool mostlyclean-local
-
-pdf: pdf-recursive
-
-pdf-am: $(PDFS)
-
-ps: ps-recursive
-
-ps-am: $(PSS)
-
-uninstall-am: uninstall-man
-
-uninstall-info: uninstall-info-recursive
-
-uninstall-man: uninstall-man1
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
- check-DEJAGNU check-am clean clean-generic clean-info \
- clean-libtool clean-noinstPROGRAMS clean-recursive ctags \
- ctags-recursive dist-info distclean distclean-DEJAGNU \
- distclean-compile distclean-generic distclean-hdr \
- distclean-libtool distclean-local distclean-recursive \
- distclean-tags dvi dvi-am html html-am info info-am install \
- install-am install-data install-data-am install-data-local \
- install-exec install-exec-am install-exec-local install-info \
- install-info-am install-man install-man1 install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-aminfo \
- maintainer-clean-generic maintainer-clean-recursive \
- mostlyclean mostlyclean-aminfo mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool mostlyclean-local \
- mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
- uninstall uninstall-am uninstall-info-am uninstall-man \
- uninstall-man1
-
-
-# Disable -Werror, if it has been enabled, since old versions of bison/
-# yacc will produce working code which contain compile time warnings.
-ldgram.o:
- $(COMPILE) -c $< $(NO_WERROR)
-ldlex.o:
- $(COMPILE) -c $< $(NO_WERROR)
-deffilep.o:
- $(COMPILE) -c $< $(NO_WERROR)
-
-po/POTFILES.in: @MAINT@ Makefile
- for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
- && mv tmp $(srcdir)/po/POTFILES.in
-
-ldmain.o: ldmain.c config.status
- $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' \
- -DSCRIPTDIR='"$(scriptdir)"' -DBINDIR='"$(bindir)"' \
- -DTOOLBINDIR='"$(tooldir)/bin"' \
- -DTARGET='"@target@"' @TARGET_SYSTEM_ROOT_DEFINE@ \
- $(srcdir)/ldmain.c
-
-eelf32_spu.o: eelf32_spu.c
- $(COMPILE) -c -DEMBEDSPU="\"`echo embedspu | sed '$(transform)'`\"" \
- eelf32_spu.c
-
-ldemul-list.h: Makefile
- (echo "/* This file is automatically generated. DO NOT EDIT! */";\
- for f in `echo " " ${EMULATION_OFILES} "" \
- | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
- echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
- done;\
- echo "";\
- echo "#define EMULATION_LIST \\";\
- for f in `echo " " ${EMULATION_OFILES} "" \
- | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
- echo " &ld_$${f}_emulation, \\"; \
- done;\
- echo " 0") >ldemul-tmp.h
- mv ldemul-tmp.h ldemul-list.h
-
-stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
- cp ${srcdir}/emultempl/$(STRINGIFY) stringify.sed
-
-@TDIRS@
-
-eaix5ppc.c: $(srcdir)/emulparams/aix5ppc.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} aix5ppc "$(tdir_aixppc)"
-eaix5rs6.c: $(srcdir)/emulparams/aix5rs6.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} aix5rs6 "$(tdir_aixrs6)"
-eaixppc.c: $(srcdir)/emulparams/aixppc.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} aixppc "$(tdir_aixppc)"
-eaixrs6.c: $(srcdir)/emulparams/aixrs6.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} aixrs6 "$(tdir_aixrs6)"
-ealpha.c: $(srcdir)/emulparams/alpha.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} alpha "$(tdir_alpha)"
-earcelf.c: $(srcdir)/emulparams/arcelf.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} arcelf "$(tdir_arcelf)"
-earmelf.c: $(srcdir)/emulparams/armelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelf "$(tdir_armelf)"
-earmelfb.c: $(srcdir)/emulparams/armelfb.sh $(srcdir)/emulparams/armelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelfb "$(tdir_armelfb)"
-earmelf_fbsd.c: $(srcdir)/emulparams/armelf_fbsd.sh \
- $(srcdir)/emulparams/armelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelf_fbsd "$(tdir_armelf_fbsd)"
-earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelf_linux "$(tdir_armelf_linux)"
-earmelf_linux_eabi.c: $(srcdir)/emulparams/armelf_linux_eabi.sh \
- $(srcdir)/emulparams/armelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelf_linux_eabi "$(tdir_armelf_linux_abi)"
-earmelfb_linux.c: $(srcdir)/emulparams/armelfb_linux.sh \
- $(srcdir)/emulparams/armelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelfb_linux "$(tdir_armelfb_linux)"
-earmelfb_linux_eabi.c: $(srcdir)/emulparams/armelfb_linux_eabi.sh \
- $(srcdir)/emulparams/armelf_linux_eabi.sh \
- $(srcdir)/emulparams/armelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelfb_linux_eabi "$(tdir_armelfb_linux_abi)"
-earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \
- $(srcdir)/emulparams/armelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelf_nbsd "$(tdir_armelf_nbsd)"
-earmelfb_nbsd.c: $(srcdir)/emulparams/armelfb_nbsd.sh \
- $(srcdir)/emulparams/armelf_nbsd.sh \
- $(srcdir)/emulparams/armelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armelfb_nbsd "$(tdir_armelfb_nbsd)"
-earmelf_vxworks.c: $(srcdir)/emulparams/armelf_vxworks.sh \
- $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/armelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/vxworks.em \
- $(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} armelf_vxworks "$(tdir_armelf)"
-earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armaoutb "$(tdir_armaoutb)"
-earmaoutl.c: $(srcdir)/emulparams/armaoutl.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armaoutl "$(tdir_armaoutl)"
-earmcoff.c: $(srcdir)/emulparams/armcoff.sh \
- $(srcdir)/emultempl/armcoff.em $(srcdir)/scripttempl/armcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armcoff "$(tdir_armcoff)"
-earmnbsd.c: $(srcdir)/emulparams/armnbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
-earmnto.c: $(srcdir)/emulparams/armnto.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armnto "$(tdir_armnto)"
-earm_epoc_pe.c: $(srcdir)/emulparams/arm_epoc_pe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/epocpe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} arm_epoc_pe "$(tdir_armpe)"
-earm_wince_pe.c: $(srcdir)/emulparams/arm_wince_pe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} arm_wince_pe "$(tdir_armpe)"
-earmpe.c: $(srcdir)/emulparams/armpe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} armpe "$(tdir_armpe)"
-earmsymbian.c: $(srcdir)/emulparams/armsymbian.sh \
- $(srcdir)/emulparams/armelf.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/armbpabi.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} armsymbian "$(tdir_armelf)"
-eavr2.c: $(srcdir)/emulparams/avr2.sh $(srcdir)/emultempl/avrelf.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr2 "$(tdir_avr2)"
-eavr1.c: $(srcdir)/emulparams/avr1.sh $(srcdir)/emultempl/avrelf.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr1 "$(tdir_avr2)"
-eavr3.c: $(srcdir)/emulparams/avr3.sh $(srcdir)/emultempl/avrelf.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr3 "$(tdir_avr2)"
-eavr4.c: $(srcdir)/emulparams/avr4.sh $(srcdir)/emultempl/avrelf.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr4 "$(tdir_avr2)"
-eavr5.c: $(srcdir)/emulparams/avr5.sh $(srcdir)/emultempl/avrelf.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr5 "$(tdir_avr2)"
-eavr6.c: $(srcdir)/emulparams/avr6.sh $(srcdir)/emultempl/avrelf.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} avr6 "$(tdir_avr2)"
-ecoff_i860.c: $(srcdir)/emulparams/coff_i860.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i860coff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} coff_i860 "$(tdir_coff_i860)"
-ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)"
-ecrisaout.c: $(srcdir)/emulparams/crisaout.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/crisaout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} crisaout "$(tdir_cris)"
-ecriself.c: $(srcdir)/emulparams/criself.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} criself "$(tdir_cris)"
-ecrislinux.c: $(srcdir)/emulparams/crislinux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} crislinux "$(tdir_cris)"
-ed10velf.c: $(srcdir)/emulparams/d10velf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elfd10v.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} d10velf "$(tdir_d10v)"
-ed30velf.c: $(srcdir)/emulparams/d30velf.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elfd30v.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} d30velf "$(tdir_d30v)"
-ed30v_o.c: $(srcdir)/emulparams/d30v_o.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elfd30v.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} d30v_o "$(tdir_d30v)"
-ed30v_e.c: $(srcdir)/emulparams/d30v_e.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elfd30v.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} d30v_e "$(tdir_d30v)"
-edelta68.c: $(srcdir)/emulparams/delta68.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} delta68 "$(tdir_delta68)"
-eelf32bfin.c: $(srcdir)/emulparams/bfin.sh \
- $(ELF_DEPS) \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32bfin "$(tdir_elf32bfin)" bfin
-eelf32bfinfd.c: $(srcdir)/emulparams/elf32bfinfd.sh $(srcdir)/emulparams/bfin.sh \
- $(ELF_DEPS) \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32bfinfd "$(tdir_elf32bfinfd)" elf32bfinfd
-eelf32_dlx.c: $(srcdir)/emulparams/elf32_dlx.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/dlx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_dlx "$(tdir_elf32_dlx)"
-eelf32xc16x.c: $(srcdir)/emulparams/elf32xc16x.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32xc16x "$(tdir_xc16x)"
-eelf32xc16xl.c: $(srcdir)/emulparams/elf32xc16xl.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32xc16xl "$(tdir_xc16xl)"
-eelf32xc16xs.c: $(srcdir)/emulparams/elf32xc16xs.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32xc16xs "$(tdir_xc16xs)"
-eelf32xstormy16.c: $(srcdir)/emulparams/elf32xstormy16.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/xstormy16.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32xstormy16 "$(tdir_xstormy16)"
-eelf32am33lin.c: $(srcdir)/emulparams/elf32am33lin.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32am33lin "$(tdir_mn10300)"
-eelf32vax.c: $(srcdir)/emulparams/elf32vax.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32vax "$(tdir_elf32vax)"
-eelf32xtensa.c: $(srcdir)/emulparams/elf32xtensa.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/xtensaelf.em $(INCDIR)/xtensa-config.h \
- $(BFDDIR)/elf-bfd.h $(BFDDIR)/libbfd.h $(INCDIR)/elf/xtensa.h \
- $(srcdir)/scripttempl/elfxtensa.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32xtensa "$(tdir_elf32xtensa)"
-eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32fr30 "$(tdir_fr30)"
-eelf32frv.c: $(srcdir)/emulparams/elf32frv.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32frv "$(tdir_frv)"
-eelf32frvfd.c: $(srcdir)/emulparams/elf32frvfd.sh \
- $(srcdir)/emulparams/elf32frv.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32frvfd "$(tdir_frv)"
-eelf32mcore.c: $(srcdir)/emulparams/elf32mcore.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32mcore "$(tdir_mcore)"
-eelf32mep.c: $(srcdir)/emulparams/elf32mep.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/mep.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32mep "$(tdir_mep)"
-em32relf.c: $(srcdir)/emulparams/m32relf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m32relf "$(tdir_m32r)"
-em32rlelf.c: $(srcdir)/emulparams/m32rlelf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m32rlelf "$(tdir_m32rlelf)"
-em32relf_linux.c: $(srcdir)/emulparams/m32relf_linux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m32relf_linux "$(tdir_m32relf_linux)"
-em32rlelf_linux.c: $(srcdir)/emulparams/m32rlelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m32rlelf_linux "$(tdir_m32rlelf_linux)"
-eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
-eelf32_sparc_vxworks.c: $(srcdir)/emulparams/elf32_sparc_vxworks.sh \
- $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/elf32_sparc.sh \
- $(srcdir)/emultempl/vxworks.em $(ELF_DEPS) \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_sparc_vxworks "$(tdir_elf32_sparc_vxworks)"
-eelf32_spu.c: $(srcdir)/emulparams/elf32_spu.sh $(srcdir)/emultempl/spuelf.em \
- $(srcdir)/emultempl/spu_ovl.o_c \
- ldemul-list.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_spu "$(tdir_elf32_spu)"
-$(srcdir)/emultempl/spu_ovl.o_c: @MAINT@ $(srcdir)/emultempl/spu_ovl.S
- if ../gas/as-new --version \
- | grep 'target.*spu' >/dev/null 2>/dev/null; then \
- cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s
- ../gas/as-new -o spu_ovl.o spu_ovl.s; \
- ../binutils/bin2c <spu_ovl.o >$@
- fi
-eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_i860 "$(tdir_elf32_i860)"
-eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
-eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
-eelf32cr16.c: $(srcdir)/emulparams/elf32cr16.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/cr16elf.em \
- $(srcdir)/scripttempl/elf32cr16.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32cr16 "$(tdir_elf32crx)"
-eelf32cr16c.c: $(srcdir)/emulparams/elf32cr16c.sh \
- $(ELF_DEPS) \
- $(srcdir)/scripttempl/elf32cr16c.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32cr16c "$(tdir_elf32cr16c)"
-eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
-eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) $(srcdir)/emultempl/irix.em \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32bsmip "$(tdir_elf32bsmip)"
-eelf32btsmip.c: $(srcdir)/emulparams/elf32btsmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32btsmip "$(tdir_elf32btsmip)"
-eelf32crx.c: $(srcdir)/emulparams/elf32crx.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/crxelf.em \
- $(srcdir)/scripttempl/elf32crx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32crx "$(tdir_elf32crx)"
-eelf32btsmipn32.c: $(srcdir)/emulparams/elf32btsmipn32.sh \
- $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32btsmipn32 "$(tdir_elf32btsmipn32)"
-eelf32ltsmip.c: $(srcdir)/emulparams/elf32ltsmip.sh \
- $(srcdir)/emulparams/elf32btsmip.sh $(srcdir)/emulparams/elf32bmip.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ltsmip "$(tdir_elf32ltsmip)"
-eelf32ltsmipn32.c: $(srcdir)/emulparams/elf32ltsmipn32.sh \
- $(srcdir)/emulparams/elf32btsmipn32.sh \
- $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ltsmipn32 "$(tdir_elf32ltsmipn32)"
-eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
-eelf32ebmipvxworks.c: $(srcdir)/emulparams/elf32ebmipvxworks.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emulparams/vxworks.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/mipself.em \
- $(srcdir)/emultempl/vxworks.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ebmipvxworks "$(tdir_elf32ebmipvxworks)"
-eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
- $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
-eelf32elmipvxworks.c: $(srcdir)/emulparams/elf32elmipvxworks.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(srcdir)/emulparams/vxworks.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/mipself.em \
- $(srcdir)/emultempl/vxworks.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32elmipvxworks "$(tdir_elf32elmipvxworks)"
-eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
- $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/irix.em $(srcdir)/emultempl/mipself.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32bmipn32 "$(tdir_elf32bmipn32)"
-eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
- $(srcdir)/emulparams/elf32b4300.sh $(srcdir)/emulparams/elf32bmip.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
-eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
- $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
-eelf32mipswindiss.c: $(srcdir)/emulparams/elf32mipswindiss.sh $(ELF_DEPS) \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32mipswindiss "$(tdir_elf32mipswindiss)"
-eelf32m32c.c: $(srcdir)/emulparams/elf32m32c.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32m32c "$(tdir_m32c)"
-eelf32mt.c: $(srcdir)/emulparams/elf32mt.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32mt "$(tdir_mt)"
-eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
- $(srcdir)/emulparams/elf32ppccommon.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emultempl/ppc32elf.em \
- ldemul-list.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
-eelf32lppcnto.c: $(srcdir)/emulparams/elf32lppcnto.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
- $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
- ldemul-list.h \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32lppcnto "$(tdir_elf32lppcnto)"
-eelf32lppcsim.c: $(srcdir)/emulparams/elf32lppcsim.sh \
- $(srcdir)/emulparams/elf32lppc.sh $(srcdir)/emulparams/elf32ppc.sh \
- $(srcdir)/emulparams/elf32ppccommon.sh $(srcdir)/emultempl/ppc32elf.em \
- ldemul-list.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32lppcsim "$(tdir_elf32lppcsim)"
-eelf32ppcnto.c: $(srcdir)/emulparams/elf32ppcnto.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
- $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
- ldemul-list.h \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppcnto "$(tdir_elf32ppcnto)"
-eelf32ppcwindiss.c: $(srcdir)/emulparams/elf32ppcwindiss.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppcwindiss "$(tdir_elf32ppcwindiss)"
-eelf32ppcvxworks.c: $(srcdir)/emulparams/elf32ppcvxworks.sh \
- $(srcdir)/emulparams/elf32ppccommon.sh $(srcdir)/emulparams/vxworks.sh \
- $(srcdir)/emultempl/vxworks.em $(ELF_DEPS) \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppcvxworks "$(tdir_elf32ppcvxworks)"
-eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
- $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)"
-eelf32openrisc.c: $(srcdir)/emulparams/elf32openrisc.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32openrisc "$(tdir_openrisc)"
-eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
- $(srcdir)/emulparams/elf32ppccommon.sh $(srcdir)/emultempl/ppc32elf.em \
- ldemul-list.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
-eelf32ppc_fbsd.c: $(srcdir)/emulparams/elf32ppc_fbsd.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
- $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
- ldemul-list.h \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppc_fbsd "$(tdir_elf32ppc_fbsd)"
-eelf32ppcsim.c: $(srcdir)/emulparams/elf32ppcsim.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
- $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
- ldemul-list.h \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppcsim "$(tdir_elf32ppcsim)"
-eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \
- $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
- $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
- ldemul-list.h \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ppclinux "$(tdir_elf32ppclinux)"
-eelf64ppc.c: $(srcdir)/emulparams/elf64ppc.sh $(srcdir)/emultempl/ppc64elf.em \
- ldemul-list.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64ppc "$(tdir_elf64ppc)"
-eelf64lppc.c: $(srcdir)/emulparams/elf64lppc.sh \
- $(srcdir)/emulparams/elf64ppc.sh $(srcdir)/emultempl/ppc64elf.em \
- ldemul-list.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64lppc "$(tdir_elf64lppc)"
-eelf32i370.c: $(srcdir)/emulparams/elf32i370.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elfi370.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32i370 "$(tdir_elf32i370)"
-eelf32ip2k.c: $(srcdir)/emulparams/elf32ip2k.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/ip2k.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32ip2k "$(tdir_ip2k)"
-eelf32iq2000.c: $(srcdir)/emulparams/elf32iq2000.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/iq2000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32iq2000 "$(tdir_iq2000)"
-eelf32iq10.c: $(srcdir)/emulparams/elf32iq10.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/iq2000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf32iq10 "$(tdir_iq10)"
-eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/alphaelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
-eelf64alpha_fbsd.c: $(srcdir)/emulparams/elf64alpha_fbsd.sh \
- $(srcdir)/emulparams/elf64alpha.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/alphaelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64alpha_fbsd "$(tdir_elf64alpha_fbsd)"
-eelf64alpha_nbsd.c: $(srcdir)/emulparams/elf64alpha_nbsd.sh \
- $(srcdir)/emulparams/elf64alpha.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/alphaelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64alpha_nbsd "$(tdir_elf64alpha_nbsd)"
-eelf64hppa.c: $(srcdir)/emulparams/elf64hppa.sh \
- $(srcdir)/emulparams/hppa64linux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64hppa "$(tdir_elf64hppa)"
-eelf64_aix.c: $(srcdir)/emulparams/elf64_aix.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_aix "$(tdir_elf64_aix)"
-eelf64_ia64.c: $(srcdir)/emulparams/elf64_ia64.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/ia64elf.em \
- $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_ia64 "$(tdir_elf64_ia64)"
-eelf64_ia64_fbsd.c: $(srcdir)/emulparams/elf64_ia64_fbsd.sh \
- $(srcdir)/emulparams/elf64_ia64.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/ia64elf.em \
- $(srcdir)/emultempl/needrelax.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_ia64_fbsd "$(tdir_elf64_ia64_fbsd)"
-eelf64_s390.c: $(srcdir)/emulparams/elf64_s390.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_s390 "$(tdir_elf64_s390)"
-eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)"
-eelf64_sparc_fbsd.c: $(srcdir)/emulparams/elf64_sparc_fbsd.sh \
- $(srcdir)/emulparams/elf64_sparc.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64_sparc_fbsd "$(tdir_elf64_sparc_fbsd)"
-eelf64bmip.c: $(srcdir)/emulparams/elf64bmip.sh \
- $(srcdir)/emulparams/elf64bmip-defs.sh \
- $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/irix.em $(srcdir)/emultempl/mipself.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64bmip "$(tdir_elf64bmip)"
-eelf64mmix.c: $(srcdir)/emulparams/elf64mmix.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/mmix-elfnmmo.em \
- $(srcdir)/emultempl/mmixelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64mmix "$(tdir_elf64mmix)"
-emmo.c: $(srcdir)/emulparams/mmo.sh $(srcdir)/emultempl/mmix-elfnmmo.em \
- $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/elf-generic.em \
- $(srcdir)/emultempl/mmo.em \
- $(srcdir)/scripttempl/mmo.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mmo "$(tdir_mmo)"
-eelf64btsmip.c: $(srcdir)/emulparams/elf64btsmip.sh \
- $(srcdir)/emulparams/elf64bmip-defs.sh \
- $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64btsmip "$(tdir_elf64btsmip)"
-eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \
- $(srcdir)/emulparams/elf64btsmip.sh $(srcdir)/emulparams/elf64bmip-defs.sh \
- $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \
- $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf64ltsmip "$(tdir_elf64ltsmip)"
-eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
-eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
-eelf_x86_64_fbsd.c: $(srcdir)/emulparams/elf_x86_64_fbsd.sh \
- $(srcdir)/emulparams/elf_x86_64.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_x86_64_fbsd "$(tdir_elf_x86_64_fbsd)"
-eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_be "$(tdir_elf_i386_be)"
-eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf_chaos.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)"
-eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
- $(srcdir)/emulparams/elf_i386.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_fbsd "$(tdir_elf_i386_fbsd)"
-eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
-eelf_i386_vxworks.c: $(srcdir)/emulparams/elf_i386_vxworks.sh \
- $(srcdir)/emulparams/vxworks.sh $(srcdir)/emultempl/vxworks.em \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_i386_vxworks "$(tdir_elf_i386_vxworks)"
-eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)"
-egld960.c: $(srcdir)/emulparams/gld960.sh \
- $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} gld960 "$(tdir_gld960)"
-egld960coff.c: $(srcdir)/emulparams/gld960coff.sh \
- $(srcdir)/emultempl/gld960c.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} gld960coff "$(tdir_gld960coff)"
-eh8300.c: $(srcdir)/emulparams/h8300.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300 "$(tdir_h8300)"
-eh8300h.c: $(srcdir)/emulparams/h8300h.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300h "$(tdir_h8300h)"
-eh8300s.c: $(srcdir)/emulparams/h8300s.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300s.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300s "$(tdir_h8300s)"
-eh8300hn.c: $(srcdir)/emulparams/h8300hn.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300hn.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300hn "$(tdir_h8300hn)"
-eh8300sn.c: $(srcdir)/emulparams/h8300sn.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sn.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300sn "$(tdir_h8300sn)"
-eh8300sx.c: $(srcdir)/emulparams/h8300sx.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sx.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300sx "$(tdir_h8300sx)"
-eh8300sxn.c: $(srcdir)/emulparams/h8300sxn.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sxn.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300sxn "$(tdir_h8300sxn)"
-eh8300elf.c: $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300elf "$(tdir_h8300elf)"
-eh8300helf.c: $(srcdir)/emulparams/h8300helf.sh \
- $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300helf "$(tdir_h8300helf)"
-eh8300self.c: $(srcdir)/emulparams/h8300self.sh \
- $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300self "$(tdir_h8300self)"
-eh8300hnelf.c: $(srcdir)/emulparams/h8300hnelf.sh \
- $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300hnelf "$(tdir_h8300hnelf)"
-eh8300snelf.c: $(srcdir)/emulparams/h8300snelf.sh \
- $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300snelf "$(tdir_h8300snelf)"
-eh8300sxelf.c: $(srcdir)/emulparams/h8300sxelf.sh \
- $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300sxelf "$(tdir_h8300sxelf)"
-eh8300sxnelf.c: $(srcdir)/emulparams/h8300sxnelf.sh \
- $(srcdir)/emulparams/h8300elf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8300sxnelf "$(tdir_h8300sxnelf)"
-eh8500.c: $(srcdir)/emulparams/h8500.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500 "$(tdir_h8500)"
-eh8500b.c: $(srcdir)/emulparams/h8500b.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500b.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500b "$(tdir_h8500b)"
-eh8500c.c: $(srcdir)/emulparams/h8500c.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500c.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500c "$(tdir_h8500c)"
-eh8500m.c: $(srcdir)/emulparams/h8500m.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500m.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500m "$(tdir_h8500m)"
-eh8500s.c: $(srcdir)/emulparams/h8500s.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500s.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} h8500s "$(tdir_h8500s)"
-ehp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hp300bsd "$(tdir_hp300bsd)"
-ehp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hp3hpux "$(tdir_hp3hpux)"
-ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/hppaelf.em \
- $(srcdir)/scripttempl/hppaelf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hppaelf "$(tdir_hppaelf)"
-ehppalinux.c: $(srcdir)/emulparams/hppalinux.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/hppaelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hppalinux "$(tdir_hppalinux)"
-ehppanbsd.c: $(srcdir)/emulparams/hppanbsd.sh \
- $(srcdir)/emulparams/hppaelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/hppaelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hppanbsd "$(tdir_hppanbsd)"
-ehppaobsd.c: $(srcdir)/emulparams/hppaobsd.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/hppaelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hppaobsd "$(tdir_hppaobsd)"
-ehppa64linux.c: $(srcdir)/emulparams/hppa64linux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} hppa64linux "$(tdir_hppa64linux)"
-ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386aout "$(tdir_i386aout)"
-ei386beos.c: $(srcdir)/emulparams/i386beos.sh \
- $(srcdir)/emultempl/beos.em $(srcdir)/scripttempl/i386beos.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386beos "$(tdir_i386beos)"
-ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386bsd "$(tdir_i386bsd)"
-ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386coff "$(tdir_i386coff)"
-ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386go32 "$(tdir_i386go32)"
-ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
- $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386linux "$(tdir_i386linux)"
-ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386lynx "$(tdir_i386lynx)"
-ei386mach.c: $(srcdir)/emulparams/i386mach.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386mach "$(tdir_i386mach)"
-ei386moss.c: $(srcdir)/emulparams/i386moss.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386moss "$(tdir_i386moss)"
-ei386msdos.c: $(srcdir)/emulparams/i386msdos.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386msdos.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386msdos "$(tdir_i386msdos)"
-ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386nbsd "$(tdir_i386nbsd)"
-ei386nto.c: $(srcdir)/emulparams/i386nto.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386nto "$(tdir_i386nto)"
-ei386nw.c: $(srcdir)/emulparams/i386nw.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386nw "$(tdir_i386nw)"
-ei386pe.c: $(srcdir)/emulparams/i386pe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386pe "$(tdir_i386pe)"
-ei386pe_posix.c: $(srcdir)/emulparams/i386pe_posix.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386pe_posix "$(tdir_i386pe_posix)"
-ei386pep.c: $(srcdir)/emulparams/i386pep.sh \
- $(srcdir)/emultempl/pep.em $(srcdir)/scripttempl/pep.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} i386pep "$(tdir_i386pe)"
-elnk960.c: $(srcdir)/emulparams/lnk960.sh \
- $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
-em68hc11elf.c: $(srcdir)/emulparams/m68hc11elf.sh \
- $(srcdir)/emultempl/m68hc1xelf.em $(ELF_DEPS) \
- $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68hc11elf "$(tdir_m68hc11)"
-em68hc11elfb.c: $(srcdir)/emulparams/m68hc11elfb.sh \
- $(srcdir)/emultempl/m68hc1xelf.em $(ELF_DEPS) \
- $(srcdir)/scripttempl/elfm68hc11.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68hc11elfb "$(tdir_m68hc11b)"
-em68hc12elf.c: $(srcdir)/emulparams/m68hc12elf.sh \
- $(srcdir)/emultempl/m68hc1xelf.em $(ELF_DEPS) \
- $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68hc12elf "$(tdir_m68hc12)"
-em68hc12elfb.c: $(srcdir)/emulparams/m68hc12elfb.sh \
- $(srcdir)/emultempl/m68hc1xelf.em $(ELF_DEPS) \
- $(srcdir)/scripttempl/elfm68hc12.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68hc12elfb "$(tdir_m68hc12b)"
-em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68k4knbsd "$(tdir_m68k4knbsd)"
-em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kaout "$(tdir_m68kaout)"
-em68kaux.c: $(srcdir)/emulparams/m68kaux.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kaux.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kaux "$(tdir_m68kaux)"
-em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
- $(srcdir)/emultempl/m68kcoff.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kcoff "$(tdir_m68kcoff)"
-em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/m68kelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kelf "$(tdir_m68kelf)"
-em68kelfnbsd.c: $(srcdir)/emulparams/m68kelfnbsd.sh \
- $(srcdir)/emulparams/m68kelf.sh \
- $(ELF_DEPS) $(srcdir)/emultempl/m68kelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kelfnbsd "$(tdir_m68kelfnbsd)"
-em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
- $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68klinux "$(tdir_m68klinux)"
-em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68knbsd "$(tdir_m68knbsd)"
-em68kpsos.c: $(srcdir)/emulparams/m68kpsos.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/psos.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m68kpsos "$(tdir_m68kpsos)"
-em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} m88kbcs "$(tdir_m88kbcs)"
-emaxqcoff.c: $(srcdir)/emulparams/maxqcoff.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/maxqcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} maxqcoff "$(tdir_maxqcoff)"
-emcorepe.c: $(srcdir)/emulparams/mcorepe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mcorepe "$(tdir_mcorepe)"
-emipsbig.c: $(srcdir)/emulparams/mipsbig.sh $(srcdir)/emultempl/generic.em \
- $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipsbig "$(tdir_mipsbig)"
-emipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh $(srcdir)/emultempl/generic.em \
- $(srcdir)/scripttempl/mipsbsd.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipsbsd "$(tdir_mipsbsd)"
-emipsidt.c: $(srcdir)/emulparams/mipsidt.sh $(srcdir)/emultempl/generic.em \
- $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} mipsidt "$(tdir_mipsidt)"
-emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh $(srcdir)/emultempl/generic.em \
- $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} mipsidtl "$(tdir_mipsidtl)"
-emipslit.c: $(srcdir)/emulparams/mipslit.sh $(srcdir)/emultempl/generic.em \
- $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipslit "$(tdir_mipslit)"
-emipslnews.c: $(srcdir)/emulparams/mipslnews.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipslnews "$(tdir_mipslnews)"
-emipspe.c: $(srcdir)/emulparams/mipspe.sh $(srcdir)/emultempl/pe.em \
- $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mipspe "$(tdir_mipspe)"
-emn10300.c: $(srcdir)/emulparams/mn10300.sh \
- $(srcdir)/emulparams/mn10200.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mn10300 "$(tdir_mn10300)"
-emn10200.c: $(srcdir)/emulparams/mn10200.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} mn10200 "$(tdir_mn10200)"
-emsp430x110.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x110 "$(tdir_msp430x110)" msp430all
-emsp430x112.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x112 "$(tdir_msp430x112)" msp430all
-emsp430x1101.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1101 "$(tdir_msp430x1101)" msp430all
-emsp430x1111.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1111 "$(tdir_msp430x1111)" msp430all
-emsp430x1121.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1121 "$(tdir_msp430x1121)" msp430all
-emsp430x1122.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1122 "$(tdir_msp430x1122)" msp430all
-emsp430x1132.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1132 "$(tdir_msp430x1132)" msp430all
-emsp430x122.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x122 "$(tdir_msp430x122)" msp430all
-emsp430x123.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x123 "$(tdir_msp430x123)" msp430all
-emsp430x1222.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1222 "$(tdir_msp430x1222)" msp430all
-emsp430x1232.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1232 "$(tdir_msp430x1232)" msp430all
-emsp430x133.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x133 "$(tdir_msp430x133)" msp430all
-emsp430x135.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x135 "$(tdir_msp430x135)" msp430all
-emsp430x1331.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1331 "$(tdir_msp430x1331)" msp430all
-emsp430x1351.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1351 "$(tdir_msp430x1351)" msp430all
-emsp430x147.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x147 "$(tdir_msp430x147)" msp430all
-emsp430x148.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x148 "$(tdir_msp430x148)" msp430all
-emsp430x149.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x149 "$(tdir_msp430x149)" msp430all
-emsp430x155.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x155 "$(tdir_msp430x155)" msp430all
-emsp430x156.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x156 "$(tdir_msp430x156)" msp430all
-emsp430x157.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x157 "$(tdir_msp430x157)" msp430all
-emsp430x167.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x167 "$(tdir_msp430x167)" msp430all
-emsp430x168.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x168 "$(tdir_msp430x168)" msp430all
-emsp430x169.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x169 "$(tdir_msp430x169)" msp430all
-emsp430x1610.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1610 "$(tdir_msp430x1610)" msp430all
-emsp430x1611.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1611 "$(tdir_msp430x1611)" msp430all
-emsp430x1612.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x1612 "$(tdir_msp430x1612)" msp430all
-emsp430x2101.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x2101 "$(tdir_msp430x2101)" msp430all
-emsp430x2111.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x2111 "$(tdir_msp430x2111)" msp430all
-emsp430x2121.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x2121 "$(tdir_msp430x2121)" msp430all
-emsp430x2131.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x2131 "$(tdir_msp430x2131)" msp430all
-emsp430x311.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x311 "$(tdir_msp430x311)" msp430all
-emsp430x312.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x312 "$(tdir_msp430x312)" msp430all
-emsp430x313.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x313 "$(tdir_msp430x313)" msp430all
-emsp430x314.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x314 "$(tdir_msp430x314)" msp430all
-emsp430x315.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x315 "$(tdir_msp430x315)" msp430all
-emsp430x323.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x323 "$(tdir_msp430x323)" msp430all
-emsp430x325.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x325 "$(tdir_msp430x325)" msp430all
-emsp430x336.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x336 "$(tdir_msp430x336)" msp430all
-emsp430x337.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430_3.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x337 "$(tdir_msp430x337)" msp430all
-emsp430x412.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x412 "$(tdir_msp430x412)" msp430all
-emsp430x413.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x413 "$(tdir_msp430x413)" msp430all
-emsp430x415.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x415 "$(tdir_msp430x415)" msp430all
-emsp430x417.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x417 "$(tdir_msp430x417)" msp430all
-emsp430xE423.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xE423 "$(tdir_msp430xE423)" msp430all
-emsp430xE425.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xE425 "$(tdir_msp430xE425)" msp430all
-emsp430xE427.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xE427 "$(tdir_msp430xE427)" msp430all
-emsp430xW423.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xW423 "$(tdir_msp430xW423)" msp430all
-emsp430xW425.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xW425 "$(tdir_msp430xW425)" msp430all
-emsp430xW427.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xW427 "$(tdir_msp430xW427)" msp430all
-emsp430xG437.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xG437 "$(tdir_msp430xG437)" msp430all
-emsp430xG438.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xG438 "$(tdir_msp430xG438)" msp430all
-emsp430xG439.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430xG439 "$(tdir_msp430xG439)" msp430all
-emsp430x435.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x435 "$(tdir_msp430x435)" msp430all
-emsp430x436.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x436 "$(tdir_msp430x436)" msp430all
-emsp430x437.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x437 "$(tdir_msp430x437)" msp430all
-emsp430x447.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x447 "$(tdir_msp430x447)" msp430all
-emsp430x448.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x448 "$(tdir_msp430x448)" msp430all
-emsp430x449.c: $(srcdir)/emulparams/msp430all.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf32msp430.sc \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} msp430x449 "$(tdir_msp430x449)" msp430all
-enews.c: $(srcdir)/emulparams/news.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} news "$(tdir_news)"
-ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \
- $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ns32knbsd "$(tdir_ns32knbsd)"
-eor32.c: $(srcdir)/emulparams/or32.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/or32.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} or32 "$(tdir_or32)"
-eor32elf.c: $(srcdir)/emulparams/or32elf.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} or32elf "$(tdir_or32elf)"
-epc532macha.c: $(srcdir)/emulparams/pc532macha.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} pc532macha "$(tdir_pc532macha)"
-epdp11.c: $(srcdir)/emulparams/pdp11.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} pdp11 "$(tdir_pdp11)"
-epjelf.c: $(srcdir)/emulparams/pjelf.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} pjelf "$(tdir_pjelf)"
-epjlelf.c: $(srcdir)/emulparams/pjlelf.sh $(srcdir)/emulparams/pjelf.sh \
- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} pjlelf "$(tdir_pjlelf)"
-eppcmacos.c: $(srcdir)/emulparams/ppcmacos.sh \
- $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ppcmacos "$(tdir_ppcmacos)"
-eppcnw.c: $(srcdir)/emulparams/ppcnw.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ppcnw "$(tdir_ppcnw)"
-eppcpe.c: $(srcdir)/emulparams/ppcpe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/ppcpe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ppcpe "$(tdir_ppcpe)"
-eppclynx.c: $(srcdir)/emulparams/ppclynx.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} ppclynx "$(tdir_ppclynx)"
-eriscix.c: $(srcdir)/emulparams/riscix.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} riscix "$(tdir_riscix)"
-escoreelf.c: $(srcdir)/emulparams/scoreelf.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/scoreelf.em \
- $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} scoreelf "$(tdir_scoreelf)"
-esh.c: $(srcdir)/emulparams/sh.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sh "$(tdir_sh)"
-eshelf.c: $(srcdir)/emulparams/shelf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf "$(tdir_shelf)"
-eshelf32.c: $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
- $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf32 "$(tdir_shelf32)"
-eshelf32_linux.c: $(srcdir)/emulparams/shelf32_linux.sh \
- $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
- $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf32_linux "$(tdir_shelf32_linux)"
-eshelf32_nbsd.c: $(srcdir)/emulparams/shelf32_nbsd.sh \
- $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
- $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf32_nbsd "$(tdir_shelf32_nbsd)"
-eshelf64.c: $(srcdir)/emulparams/shelf64.sh $(srcdir)/emulparams/shelf32.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf64 "$(tdir_shelf64)"
-eshelf64_nbsd.c: $(srcdir)/emulparams/shelf64_nbsd.sh \
- $(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf64_nbsd "$(tdir_shelf64_nbsd)"
-eshelf_linux.c: $(srcdir)/emulparams/shelf_linux.sh \
- $(srcdir)/emulparams/shlelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf_linux "$(tdir_shelf_linux)"
-eshlelf_linux.c: $(srcdir)/emulparams/shlelf_linux.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf_linux "$(tdir_shlelf_linux)"
-eshelf_nbsd.c: $(srcdir)/emulparams/shelf_nbsd.sh \
- $(srcdir)/emulparams/shelf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf_nbsd "$(tdir_shelf_nbsd)"
-eshelf_nto.c: $(srcdir)/emulparams/shelf_nto.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf_nto "$(tdir_shelf_nto)"
-eshelf_vxworks.c: $(srcdir)/emulparams/shelf_vxworks.sh \
- $(srcdir)/emulparams/vxworks.sh $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc \
- $(srcdir)/emultempl/vxworks.em ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf_vxworks "$(tdir_shelf_vxworks)"
-eshlelf_nbsd.c: $(srcdir)/emulparams/shlelf_nbsd.sh \
- $(srcdir)/emulparams/shelf_nbsd.sh \
- $(srcdir)/emulparams/shelf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf_nbsd "$(tdir_shlelf_nbsd)"
-eshlelf_nto.c: $(srcdir)/emulparams/shlelf_nto.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf_nto "$(tdir_shlelf_nto)"
-eshlelf_vxworks.c: $(srcdir)/emulparams/shlelf_vxworks.sh \
- $(srcdir)/emulparams/shelf_vxworks.sh $(srcdir)/emulparams/vxworks.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc $(srcdir)/emultempl/vxworks.em \
- ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf_vxworks "$(tdir_shlelf_vxworks)"
-eshelf_uclinux.c: $(srcdir)/emulparams/shelf_uclinux.sh \
- $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shelf_uclinux "$(tdir_shelf_uclinux)"
-eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
- $(srcdir)/emulparams/shelf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf "$(tdir_shlelf)"
-eshlsymbian.c: $(srcdir)/emulparams/shlsymbian.sh \
- $(srcdir)/emulparams/shelf.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf32sh-symbian.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlsymbian "$(tdir_shlelf)"
-eshlelf32.c: $(srcdir)/emulparams/shlelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h $(srcdir)/emulparams/shelf32.sh \
- $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf32 "$(tdir_shlelf32)"
-eshlelf32_linux.c: $(srcdir)/emulparams/shlelf32_linux.sh \
- $(srcdir)/emulparams/shelf32_linux.sh $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
- $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf32_linux "$(tdir_shlelf32_linux)"
-eshlelf32_nbsd.c: $(srcdir)/emulparams/shlelf32_nbsd.sh \
- $(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
- $(BFDDIR)/libbfd.h $(INCDIR)/libiberty.h \
- $(srcdir)/emultempl/sh64elf.em $(INCDIR)/elf/sh.h $(BFDDIR)/elf-bfd.h \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf32_nbsd "$(tdir_shlelf32_nbsd)"
-eshlelf64.c: $(srcdir)/emulparams/shlelf64.sh \
- $(srcdir)/emulparams/shelf64.sh $(srcdir)/emulparams/shelf32.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf64 "$(tdir_shlelf64)"
-eshlelf64_nbsd.c: $(srcdir)/emulparams/shlelf64_nbsd.sh \
- $(srcdir)/emulparams/shelf64_nbsd.sh \
- $(srcdir)/emulparams/shelf32_nbsd.sh $(srcdir)/emulparams/shelf32.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shlelf64_nbsd "$(tdir_shlelf64_nbsd)"
-eshl.c: $(srcdir)/emulparams/shl.sh \
- $(srcdir)/emulparams/sh.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shl "$(tdir_shl)"
-eshpe.c: $(srcdir)/emulparams/shpe.sh \
- $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} shpe "$(tdir_shl)"
-esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sparcaout "$(tdir_sparcaout)"
-esparclinux.c: $(srcdir)/emulparams/sparclinux.sh \
- $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sparclinux "$(tdir_sparclinux)"
-esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sparcnbsd "$(tdir_sparcnbsd)"
-est2000.c: $(srcdir)/emulparams/st2000.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} st2000 "$(tdir_st2000)"
-esun3.c: $(srcdir)/emulparams/sun3.sh \
- $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sun3 "$(tdir_sun3)"
-esun4.c: $(srcdir)/emulparams/sun4.sh \
- $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} sun4 "$(tdir_sun4)"
-etic30aout.c: $(srcdir)/emulparams/tic30aout.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic30aout "$(tdir_tic30aout)"
-etic30coff.c: $(srcdir)/emulparams/tic30coff.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30coff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic30coff "$(tdir_tic30coff)"
-etic3xcoff.c: $(srcdir)/emulparams/tic3xcoff.sh \
- $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic3xcoff "$(tdir_tic4xcoff)"
-etic3xcoff_onchip.c: $(srcdir)/emulparams/tic3xcoff_onchip.sh \
- $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic3xcoff_onchip "$(tdir_tic4xcoff)"
-etic4xcoff.c: $(srcdir)/emulparams/tic4xcoff.sh \
- $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic4xcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic4xcoff "$(tdir_tic4xcoff)"
-etic54xcoff.c: $(srcdir)/emulparams/tic54xcoff.sh \
- $(srcdir)/emultempl/ticoff.em $(srcdir)/scripttempl/tic54xcoff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic54xcoff "$(tdir_tic54xcoff)"
-etic80coff.c: $(srcdir)/emulparams/tic80coff.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic80coff.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} tic80coff "$(tdir_tic80coff)"
-evanilla.c: $(srcdir)/emulparams/vanilla.sh \
- $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} vanilla "$(tdir_vanilla)"
-evax.c: $(srcdir)/emulparams/vax.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} vax "$(tdir_vax)"
-evaxnbsd.c: $(srcdir)/emulparams/vaxnbsd.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} vaxnbsd "$(tdir_vaxnbsd)"
-evsta.c: $(srcdir)/emulparams/vsta.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} vsta "$(tdir_vsta)"
-ev850.c: $(srcdir)/emulparams/v850.sh \
- $(ELF_DEPS) $(srcdir)/scripttempl/v850.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} v850 "$(tdir_v850)"
-ew65.c: $(srcdir)/emulparams/w65.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} w65 "$(tdir_w65)"
-ez80.c: $(srcdir)/emulparams/z80.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/z80.em \
- $(srcdir)/scripttempl/z80.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} z80 "$(tdir_z80)"
-ez8001.c: $(srcdir)/emulparams/z8001.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} z8001 "$(tdir_z8001)"
-ez8002.c: $(srcdir)/emulparams/z8002.sh \
- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
- ${GENSCRIPTS} z8002 "$(tdir_z8002)"
-
-# The generated emulation files mostly have the same dependencies.
-$(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
- ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \
- ldctor.h ldexp.h ldlang.h ldgram.h
-
-check-DEJAGNU: site.exp
- srcroot=`cd $(srcdir) && pwd`; export srcroot; \
- r=`pwd`; export r; \
- LC_COLLATE=; LC_ALL=; LANG=; export LC_COLLATE LC_ALL LANG; \
- EXPECT=$(EXPECT); export EXPECT; \
- runtest=$(RUNTEST); \
- if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
- $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
- CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
- CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
- CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
- OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
- LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \
- $(RUNTESTFLAGS); \
- else echo "WARNING: could not find \`runtest'" 1>&2; :;\
- fi
-
-# Rules for testing by relinking ld itself.
-# A similar test is in the testsuite. This target is for ease of use
-# when porting ld.
-
-ld-partial.o: ld-new$(EXEEXT)
- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
-ld1$(EXEEXT): ld-partial.o
- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.o $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-ld1-full$(EXEEXT): ld-new
- ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-ld2$(EXEEXT): ld1$(EXEEXT)
- ./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-ld3$(EXEEXT): ld2$(EXEEXT)
- ./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) $(LIBS)
-
-bootstrap: ld3$(EXEEXT)
- cmp ld2$(EXEEXT) ld3$(EXEEXT)
-
-.PHONY: bootstrap
-
-# A test program for C++ constructors and destructors.
-# This test is now in the testsuite.
-#
-#cdtest: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
-# ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
-# cdtest-main.o cdtest-bar.o cdtest-foo.o $(HOSTING_LIBS)
-#
-#cdtest.out: cdtest
-# ./cdtest > cdtest.tmp
-# mv cdtest.tmp cdtest.out
-#
-#cdtest-ur.o: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
-# ./ld.new $(HOSTING_EMU) -o cdtest-ur.o -Ur cdtest-main.o \
-# cdtest-bar.o cdtest-foo.o
-#
-#cdtest-ur: cdtest-ur.o
-# ./ld.new $(HOSTING_EMU) -o cdtest-ur $(HOSTING_CRT0) cdtest-ur.o \
-# $(HOSTING_LIBS)
-#
-#cdtest-ur.out: cdtest-ur
-# ./cdtest-ur > cdtest-ur.tmp
-# mv cdtest-ur.tmp cdtest-ur.out
-#
-#check-cdtest: cdtest.out cdtest-ur.out $(srcdir)/cdtest.exp
-# diff $(srcdir)/cdtest.exp cdtest.out
-# diff $(srcdir)/cdtest.exp cdtest-ur.out
-#
-#.PHONY: check-cdtest
-
-# END OF CHECK TARGETS
-
-# DOCUMENTATION TARGETS
-# Manual configuration file; not usually attached to normal configuration,
-# because almost all configs use "gen" version of manual.
-# Set DOCVER above to change.
-configdoc.texi: ${DOCVER}-doc.texi
- cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
- chmod u+w ./configdoc.texi
-
-# Build the man page from the texinfo file
-# The sed command removes the no-adjust Nroff command so that
-# the man output looks standard.
-ld.1: $(srcdir)/ld.texinfo configdoc.texi
- touch $@
- -$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texinfo > ld.pod
- -($(POD2MAN) ld.pod | \
- sed -e '/^.if n .na/d' > $@.T$$$$ && \
- mv -f $@.T$$$$ $@) || \
- (rm -f $@.T$$$$ && exit 1)
- rm -f ld.pod
-mostlyclean-local:
- -rm -rf tmpdir
-
-.PHONY: install-html install-html-am install-html-recursive
-
-install-html: install-html-recursive install-html-am
-
-install-html-am: $(HTMLS)
- @$(NORMAL_INSTALL)
- test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
- @list='$(HTMLS)'; for p in $$list; do \
- if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
- f=$(html__strip_dir) \
- if test -d "$$d$$p"; then \
- echo " $(mkdir_p) '$(DESTDIR)$(htmldir)/$$f'"; \
- $(mkdir_p) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
- echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
- else \
- echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
- fi; \
- done
-
-install-html-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-.PHONY: install-exec-local install-data-local
-
-install-exec-local: ld-new$(EXEEXT)
- $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
- @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//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
- else :; fi; \
- done
- n=`echo ld | sed '$(transform)'`; \
- if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)" ]; then \
- rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
- ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
- || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
- fi
-
-install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(scriptdir)/ldscripts
- for f in ldscripts/*; do \
- $(INSTALL_DATA) $$f $(DESTDIR)$(scriptdir)/$$f ; \
- done
-
-# We want install to imply install-info as per GNU standards, despite the
-# cygnus option.
-install-data-local: install-info
-diststuff: info $(EXTRA_DIST)
-all: info ld.1
-
-# Both info (ld.info) and ld.1 depend on configdoc.texi.
-# But info isn't a direct target. Make info-recursive to depend on
-# ld.1 to support parallel build.
-info-recursive: ld.1
-distclean-local:
- rm -rf ldscripts
-
-# 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
- sed <$(srcdir)/dep-in.sed >dep.sed \
- -e 's!@INCDIR@!$(INCDIR)!' \
- -e 's!@BFDDIR@!$(BFDDIR)!' \
- -e 's!@SRCDIR@!$(srcdir)!' \
- -e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/ld$$,,`'!'
-
-dep: DEP
- sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
- cat DEP >> tmp-Makefile
- $(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
- $(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
- $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
-
-.PHONY: dep dep-in dep-am
-
-# 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.
-ldctor.o: ldctor.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h ld.h ldexp.h \
- ldlang.h ldmisc.h ldgram.h ldmain.h ldctor.h
-ldemul.o: ldemul.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h ld.h ldmisc.h ldexp.h ldlang.h \
- ldfile.h ldemul.h ldmain.h ldemul-list.h
-ldexp.o: ldexp.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h ld.h ldmain.h ldmisc.h ldexp.h \
- ldlex.h ldgram.h ldlang.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/safe-ctype.h
-ldfile.o: ldfile.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h ld.h ldmisc.h \
- ldexp.h ldlang.h ldfile.h ldmain.h ldgram.h ldlex.h \
- ldemul.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/filenames.h
-ldlang.o: ldlang.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h \
- $(INCDIR)/obstack.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
- ldexp.h ldlang.h ldgram.h ldlex.h ldmisc.h ldctor.h \
- ldfile.h ldemul.h $(INCDIR)/fnmatch.h $(INCDIR)/demangle.h \
- $(INCDIR)/libiberty.h $(INCDIR)/hashtab.h
-ldmain.o: ldmain.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/progress.h $(INCDIR)/bfdlink.h $(INCDIR)/filenames.h \
- ld.h ldmain.h ldmisc.h ldwrite.h ldexp.h ldlang.h ldgram.h \
- ldlex.h ldfile.h ldemul.h ldctor.h
-ldmisc.o: ldmisc.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/demangle.h $(INCDIR)/libiberty.h ld.h ldmisc.h \
- ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h ldfile.h \
- $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/bfdlink.h
-ldver.o: ldver.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- ../bfd/bfdver.h ld.h ldver.h ldexp.h ldlang.h ldfile.h \
- ldemul.h ldmain.h
-ldwrite.o: ldwrite.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/safe-ctype.h ld.h ldexp.h ldlang.h ldwrite.h \
- ldmisc.h ldgram.h ldmain.h
-lexsup.o: lexsup.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- ../bfd/bfdver.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
- ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldfile.h \
- ldver.h ldemul.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h
-mri.o: mri.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- ld.h ldexp.h ldlang.h ldmisc.h mri.h ldgram.h $(INCDIR)/libiberty.h \
- $(INCDIR)/ansidecl.h
-ldcref.o: ldcref.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/demangle.h $(INCDIR)/libiberty.h $(INCDIR)/objalloc.h \
- ld.h ldmain.h ldmisc.h ldexp.h ldlang.h
-pe-dll.o: pe-dll.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/safe-ctype.h ld.h ldexp.h ldlang.h ldwrite.h \
- ldmisc.h ldgram.h ldmain.h ldfile.h ldemul.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h deffile.h pe-dll.h
-pep-dll.o: pep-dll.c pe-dll.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
- $(INCDIR)/safe-ctype.h ld.h ldexp.h ldlang.h ldwrite.h \
- ldmisc.h ldgram.h ldmain.h ldfile.h ldemul.h $(INCDIR)/coff/internal.h \
- $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h deffile.h pe-dll.h \
- pep-dll.h
-ldgram.o: ldgram.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/bfdlink.h ld.h ldexp.h ldver.h ldlang.h ldfile.h \
- ldemul.h ldmisc.h ldmain.h mri.h ldctor.h ldlex.h
-ldlex.o: ldlex.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h ld.h ldmisc.h \
- ldexp.h ldlang.h ldgram.h ldfile.h ldlex.h ldmain.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h
-deffilep.o: deffilep.c sysdep.h config.h $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h \
- ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
- ld.h ldmisc.h deffile.h
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
-# 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:
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
deleted file mode 100644
index 08cfcfc24a6..00000000000
--- a/ld/emultempl/pe.em
+++ /dev/null
@@ -1,1954 +0,0 @@
-# This shell script emits a C file. -*- C -*-
-# It does some substitutions.
-test -z "${ENTRY}" && ENTRY="_mainCRTStartup"
-if [ -z "$MACHINE" ]; then
- OUTPUT_ARCH=${ARCH}
-else
- OUTPUT_ARCH=${ARCH}:${MACHINE}
-fi
-rm -f e${EMULATION_NAME}.c
-(echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
-fragment <<EOF
-/* Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-
- This file is part of the GNU Binutils.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
-
-
-/* For WINDOWS_NT */
-/* The original file generated returned different default scripts depending
- on whether certain switches were set, but these switches pertain to the
- Linux system and that particular version of coff. In the NT case, we
- only determine if the subsystem is console or windows in order to select
- the correct entry point by default. */
-
-#define TARGET_IS_${EMULATION_NAME}
-
-/* Do this before including bfd.h, so we prototype the right functions. */
-
-#if defined(TARGET_IS_armpe) \
- || defined(TARGET_IS_arm_epoc_pe) \
- || defined(TARGET_IS_arm_wince_pe)
-#define bfd_arm_allocate_interworking_sections \
- bfd_${EMULATION_NAME}_allocate_interworking_sections
-#define bfd_arm_get_bfd_for_interworking \
- bfd_${EMULATION_NAME}_get_bfd_for_interworking
-#define bfd_arm_process_before_allocation \
- bfd_${EMULATION_NAME}_process_before_allocation
-#endif
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "bfdlink.h"
-#include "getopt.h"
-#include "libiberty.h"
-#include "ld.h"
-#include "ldmain.h"
-#include "ldexp.h"
-#include "ldlang.h"
-#include "ldfile.h"
-#include "ldemul.h"
-#include <ldgram.h>
-#include "ldlex.h"
-#include "ldmisc.h"
-#include "ldctor.h"
-#include "coff/internal.h"
-
-/* FIXME: See bfd/peXXigen.c for why we include an architecture specific
- header in generic PE code. */
-#include "coff/i386.h"
-#include "coff/pe.h"
-
-/* FIXME: This is a BFD internal header file, and we should not be
- using it here. */
-#include "../bfd/libcoff.h"
-
-#include "deffile.h"
-#include "pe-dll.h"
-#include "safe-ctype.h"
-
-/* Permit the emulation parameters to override the default section
- alignment by setting OVERRIDE_SECTION_ALIGNMENT. FIXME: This makes
- it seem that include/coff/internal.h should not define
- PE_DEF_SECTION_ALIGNMENT. */
-#if PE_DEF_SECTION_ALIGNMENT != ${OVERRIDE_SECTION_ALIGNMENT:-PE_DEF_SECTION_ALIGNMENT}
-#undef PE_DEF_SECTION_ALIGNMENT
-#define PE_DEF_SECTION_ALIGNMENT ${OVERRIDE_SECTION_ALIGNMENT}
-#endif
-
-#if defined(TARGET_IS_i386pe) \
- || defined(TARGET_IS_shpe) \
- || defined(TARGET_IS_mipspe) \
- || defined(TARGET_IS_armpe) \
- || defined(TARGET_IS_arm_epoc_pe) \
- || defined(TARGET_IS_arm_wince_pe)
-#define DLL_SUPPORT
-#endif
-
-#if defined(TARGET_IS_i386pe) || ! defined(DLL_SUPPORT)
-#define PE_DEF_SUBSYSTEM 3
-#else
-#undef NT_EXE_IMAGE_BASE
-#undef PE_DEF_SECTION_ALIGNMENT
-#undef PE_DEF_FILE_ALIGNMENT
-#define NT_EXE_IMAGE_BASE 0x00010000
-
-#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_wince_pe)
-#define PE_DEF_SECTION_ALIGNMENT 0x00001000
-#define PE_DEF_SUBSYSTEM 9
-#else
-#define PE_DEF_SECTION_ALIGNMENT 0x00000400
-#define PE_DEF_SUBSYSTEM 2
-#endif
-#define PE_DEF_FILE_ALIGNMENT 0x00000200
-#endif
-
-#define U(S) ${INITIAL_SYMBOL_CHAR} S
-
-static struct internal_extra_pe_aouthdr pe;
-static int dll;
-static flagword real_flags = 0;
-static int support_old_code = 0;
-static char * thumb_entry_symbol = NULL;
-static lang_assignment_statement_type *image_base_statement = 0;
-
-#ifdef DLL_SUPPORT
-static int pe_enable_stdcall_fixup = -1; /* 0=disable 1=enable. */
-static char *pe_out_def_filename = NULL;
-static char *pe_implib_filename = NULL;
-static int pe_enable_auto_image_base = 0;
-static char *pe_dll_search_prefix = NULL;
-#endif
-
-extern const char *output_filename;
-
-static void
-gld_${EMULATION_NAME}_before_parse (void)
-{
- ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
- output_filename = "${EXECUTABLE_NAME:-a.exe}";
-#ifdef DLL_SUPPORT
- config.dynamic_link = TRUE;
- config.has_shared = 1;
- link_info.pei386_auto_import = -1;
- link_info.pei386_runtime_pseudo_reloc = -1;
-
-#if (PE_DEF_SUBSYSTEM == 9) || (PE_DEF_SUBSYSTEM == 2)
-#if defined TARGET_IS_mipspe || defined TARGET_IS_armpe || defined TARGET_IS_arm_wince_pe
- lang_default_entry ("WinMainCRTStartup");
-#else
- lang_default_entry ("_WinMainCRTStartup");
-#endif
-#else
- lang_default_entry ("${ENTRY}");
-#endif
-#endif
-}
-
-/* PE format extra command line options. */
-
-/* Used for setting flags in the PE header. */
-#define OPTION_BASE_FILE (300 + 1)
-#define OPTION_DLL (OPTION_BASE_FILE + 1)
-#define OPTION_FILE_ALIGNMENT (OPTION_DLL + 1)
-#define OPTION_IMAGE_BASE (OPTION_FILE_ALIGNMENT + 1)
-#define OPTION_MAJOR_IMAGE_VERSION (OPTION_IMAGE_BASE + 1)
-#define OPTION_MAJOR_OS_VERSION (OPTION_MAJOR_IMAGE_VERSION + 1)
-#define OPTION_MAJOR_SUBSYSTEM_VERSION (OPTION_MAJOR_OS_VERSION + 1)
-#define OPTION_MINOR_IMAGE_VERSION (OPTION_MAJOR_SUBSYSTEM_VERSION + 1)
-#define OPTION_MINOR_OS_VERSION (OPTION_MINOR_IMAGE_VERSION + 1)
-#define OPTION_MINOR_SUBSYSTEM_VERSION (OPTION_MINOR_OS_VERSION + 1)
-#define OPTION_SECTION_ALIGNMENT (OPTION_MINOR_SUBSYSTEM_VERSION + 1)
-#define OPTION_STACK (OPTION_SECTION_ALIGNMENT + 1)
-#define OPTION_SUBSYSTEM (OPTION_STACK + 1)
-#define OPTION_HEAP (OPTION_SUBSYSTEM + 1)
-#define OPTION_SUPPORT_OLD_CODE (OPTION_HEAP + 1)
-#define OPTION_OUT_DEF (OPTION_SUPPORT_OLD_CODE + 1)
-#define OPTION_EXPORT_ALL (OPTION_OUT_DEF + 1)
-#define OPTION_EXCLUDE_SYMBOLS (OPTION_EXPORT_ALL + 1)
-#define OPTION_KILL_ATS (OPTION_EXCLUDE_SYMBOLS + 1)
-#define OPTION_STDCALL_ALIASES (OPTION_KILL_ATS + 1)
-#define OPTION_ENABLE_STDCALL_FIXUP (OPTION_STDCALL_ALIASES + 1)
-#define OPTION_DISABLE_STDCALL_FIXUP (OPTION_ENABLE_STDCALL_FIXUP + 1)
-#define OPTION_IMPLIB_FILENAME (OPTION_DISABLE_STDCALL_FIXUP + 1)
-#define OPTION_THUMB_ENTRY (OPTION_IMPLIB_FILENAME + 1)
-#define OPTION_WARN_DUPLICATE_EXPORTS (OPTION_THUMB_ENTRY + 1)
-#define OPTION_IMP_COMPAT (OPTION_WARN_DUPLICATE_EXPORTS + 1)
-#define OPTION_ENABLE_AUTO_IMAGE_BASE (OPTION_IMP_COMPAT + 1)
-#define OPTION_DISABLE_AUTO_IMAGE_BASE (OPTION_ENABLE_AUTO_IMAGE_BASE + 1)
-#define OPTION_DLL_SEARCH_PREFIX (OPTION_DISABLE_AUTO_IMAGE_BASE + 1)
-#define OPTION_NO_DEFAULT_EXCLUDES (OPTION_DLL_SEARCH_PREFIX + 1)
-#define OPTION_DLL_ENABLE_AUTO_IMPORT (OPTION_NO_DEFAULT_EXCLUDES + 1)
-#define OPTION_DLL_DISABLE_AUTO_IMPORT (OPTION_DLL_ENABLE_AUTO_IMPORT + 1)
-#define OPTION_ENABLE_EXTRA_PE_DEBUG (OPTION_DLL_DISABLE_AUTO_IMPORT + 1)
-#define OPTION_EXCLUDE_LIBS (OPTION_ENABLE_EXTRA_PE_DEBUG + 1)
-#define OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC \
- (OPTION_EXCLUDE_LIBS + 1)
-#define OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC \
- (OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC + 1)
-#define OPTION_LARGE_ADDRESS_AWARE \
- (OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC + 1)
-
-static void
-gld${EMULATION_NAME}_add_options
- (int ns ATTRIBUTE_UNUSED, char **shortopts ATTRIBUTE_UNUSED, int nl,
- struct option **longopts, int nrl ATTRIBUTE_UNUSED,
- struct option **really_longopts ATTRIBUTE_UNUSED)
-{
- static const struct option xtra_long[] = {
- /* PE options */
- {"base-file", required_argument, NULL, OPTION_BASE_FILE},
- {"dll", no_argument, NULL, OPTION_DLL},
- {"file-alignment", required_argument, NULL, OPTION_FILE_ALIGNMENT},
- {"heap", required_argument, NULL, OPTION_HEAP},
- {"image-base", required_argument, NULL, OPTION_IMAGE_BASE},
- {"major-image-version", required_argument, NULL, OPTION_MAJOR_IMAGE_VERSION},
- {"major-os-version", required_argument, NULL, OPTION_MAJOR_OS_VERSION},
- {"major-subsystem-version", required_argument, NULL, OPTION_MAJOR_SUBSYSTEM_VERSION},
- {"minor-image-version", required_argument, NULL, OPTION_MINOR_IMAGE_VERSION},
- {"minor-os-version", required_argument, NULL, OPTION_MINOR_OS_VERSION},
- {"minor-subsystem-version", required_argument, NULL, OPTION_MINOR_SUBSYSTEM_VERSION},
- {"section-alignment", required_argument, NULL, OPTION_SECTION_ALIGNMENT},
- {"stack", required_argument, NULL, OPTION_STACK},
- {"subsystem", required_argument, NULL, OPTION_SUBSYSTEM},
- {"support-old-code", no_argument, NULL, OPTION_SUPPORT_OLD_CODE},
- {"thumb-entry", required_argument, NULL, OPTION_THUMB_ENTRY},
-#ifdef DLL_SUPPORT
- /* getopt allows abbreviations, so we do this to stop it from treating -o
- as an abbreviation for this option */
- {"output-def", required_argument, NULL, OPTION_OUT_DEF},
- {"output-def", required_argument, NULL, OPTION_OUT_DEF},
- {"export-all-symbols", no_argument, NULL, OPTION_EXPORT_ALL},
- {"exclude-symbols", required_argument, NULL, OPTION_EXCLUDE_SYMBOLS},
- {"exclude-libs", required_argument, NULL, OPTION_EXCLUDE_LIBS},
- {"kill-at", no_argument, NULL, OPTION_KILL_ATS},
- {"add-stdcall-alias", no_argument, NULL, OPTION_STDCALL_ALIASES},
- {"enable-stdcall-fixup", no_argument, NULL, OPTION_ENABLE_STDCALL_FIXUP},
- {"disable-stdcall-fixup", no_argument, NULL, OPTION_DISABLE_STDCALL_FIXUP},
- {"out-implib", required_argument, NULL, OPTION_IMPLIB_FILENAME},
- {"warn-duplicate-exports", no_argument, NULL, OPTION_WARN_DUPLICATE_EXPORTS},
- /* getopt() allows abbreviations, so we do this to stop it from
- treating -c as an abbreviation for these --compat-implib. */
- {"compat-implib", no_argument, NULL, OPTION_IMP_COMPAT},
- {"compat-implib", no_argument, NULL, OPTION_IMP_COMPAT},
- {"enable-auto-image-base", no_argument, NULL, OPTION_ENABLE_AUTO_IMAGE_BASE},
- {"disable-auto-image-base", no_argument, NULL, OPTION_DISABLE_AUTO_IMAGE_BASE},
- {"dll-search-prefix", required_argument, NULL, OPTION_DLL_SEARCH_PREFIX},
- {"no-default-excludes", no_argument, NULL, OPTION_NO_DEFAULT_EXCLUDES},
- {"enable-auto-import", no_argument, NULL, OPTION_DLL_ENABLE_AUTO_IMPORT},
- {"disable-auto-import", no_argument, NULL, OPTION_DLL_DISABLE_AUTO_IMPORT},
- {"enable-extra-pe-debug", no_argument, NULL, OPTION_ENABLE_EXTRA_PE_DEBUG},
- {"enable-runtime-pseudo-reloc", no_argument, NULL, OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC},
- {"disable-runtime-pseudo-reloc", no_argument, NULL, OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC},
-#endif
- {"large-address-aware", no_argument, NULL, OPTION_LARGE_ADDRESS_AWARE},
- {NULL, no_argument, NULL, 0}
- };
-
- *longopts = (struct option *)
- xrealloc (*longopts, nl * sizeof (struct option) + sizeof (xtra_long));
- memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
-}
-
-/* PE/WIN32; added routines to get the subsystem type, heap and/or stack
- parameters which may be input from the command line. */
-
-typedef struct
-{
- void *ptr;
- int size;
- int value;
- char *symbol;
- int inited;
-} definfo;
-
-#define D(field,symbol,def) {&pe.field,sizeof(pe.field), def, symbol,0}
-
-static definfo init[] =
-{
- /* imagebase must be first */
-#define IMAGEBASEOFF 0
- D(ImageBase,"__image_base__", NT_EXE_IMAGE_BASE),
-#define DLLOFF 1
- {&dll, sizeof(dll), 0, "__dll__", 0},
-#define MSIMAGEBASEOFF 2
- D(ImageBase, U ("__ImageBase"), NT_EXE_IMAGE_BASE),
- D(SectionAlignment,"__section_alignment__", PE_DEF_SECTION_ALIGNMENT),
- D(FileAlignment,"__file_alignment__", PE_DEF_FILE_ALIGNMENT),
- D(MajorOperatingSystemVersion,"__major_os_version__", 4),
- D(MinorOperatingSystemVersion,"__minor_os_version__", 0),
- D(MajorImageVersion,"__major_image_version__", 1),
- D(MinorImageVersion,"__minor_image_version__", 0),
-#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_wince_pe)
- D(MajorSubsystemVersion,"__major_subsystem_version__", 3),
-#else
- D(MajorSubsystemVersion,"__major_subsystem_version__", 4),
-#endif
- D(MinorSubsystemVersion,"__minor_subsystem_version__", 0),
- D(Subsystem,"__subsystem__", ${SUBSYSTEM}),
- D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x200000),
- D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000),
- D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000),
- D(SizeOfHeapCommit,"__size_of_heap_commit__", 0x1000),
- D(LoaderFlags,"__loader_flags__", 0x0),
- { NULL, 0, 0, NULL, 0 }
-};
-
-
-static void
-gld_${EMULATION_NAME}_list_options (FILE *file)
-{
- fprintf (file, _(" --base_file <basefile> Generate a base file for relocatable DLLs\n"));
- fprintf (file, _(" --dll Set image base to the default for DLLs\n"));
- fprintf (file, _(" --file-alignment <size> Set file alignment\n"));
- fprintf (file, _(" --heap <size> Set initial size of the heap\n"));
- fprintf (file, _(" --image-base <address> Set start address of the executable\n"));
- fprintf (file, _(" --major-image-version <number> Set version number of the executable\n"));
- fprintf (file, _(" --major-os-version <number> Set minimum required OS version\n"));
- fprintf (file, _(" --major-subsystem-version <number> Set minimum required OS subsystem version\n"));
- fprintf (file, _(" --minor-image-version <number> Set revision number of the executable\n"));
- fprintf (file, _(" --minor-os-version <number> Set minimum required OS revision\n"));
- fprintf (file, _(" --minor-subsystem-version <number> Set minimum required OS subsystem revision\n"));
- fprintf (file, _(" --section-alignment <size> Set section alignment\n"));
- fprintf (file, _(" --stack <size> Set size of the initial stack\n"));
- fprintf (file, _(" --subsystem <name>[:<version>] Set required OS subsystem [& version]\n"));
- fprintf (file, _(" --support-old-code Support interworking with old code\n"));
- fprintf (file, _(" --thumb-entry=<symbol> Set the entry point to be Thumb <symbol>\n"));
-#ifdef DLL_SUPPORT
- fprintf (file, _(" --add-stdcall-alias Export symbols with and without @nn\n"));
- fprintf (file, _(" --disable-stdcall-fixup Don't link _sym to _sym@nn\n"));
- fprintf (file, _(" --enable-stdcall-fixup Link _sym to _sym@nn without warnings\n"));
- fprintf (file, _(" --exclude-symbols sym,sym,... Exclude symbols from automatic export\n"));
- fprintf (file, _(" --exclude-libs lib,lib,... Exclude libraries from automatic export\n"));
- fprintf (file, _(" --export-all-symbols Automatically export all globals to DLL\n"));
- fprintf (file, _(" --kill-at Remove @nn from exported symbols\n"));
- fprintf (file, _(" --out-implib <file> Generate import library\n"));
- fprintf (file, _(" --output-def <file> Generate a .DEF file for the built DLL\n"));
- fprintf (file, _(" --warn-duplicate-exports Warn about duplicate exports.\n"));
- fprintf (file, _(" --compat-implib Create backward compatible import libs;\n\
- create __imp_<SYMBOL> as well.\n"));
- fprintf (file, _(" --enable-auto-image-base Automatically choose image base for DLLs\n\
- unless user specifies one\n"));
- fprintf (file, _(" --disable-auto-image-base Do not auto-choose image base. (default)\n"));
- fprintf (file, _(" --dll-search-prefix=<string> When linking dynamically to a dll without\n\
- an importlib, use <string><basename>.dll\n\
- in preference to lib<basename>.dll \n"));
- fprintf (file, _(" --enable-auto-import Do sophistcated linking of _sym to\n\
- __imp_sym for DATA references\n"));
- fprintf (file, _(" --disable-auto-import Do not auto-import DATA items from DLLs\n"));
- fprintf (file, _(" --enable-runtime-pseudo-reloc Work around auto-import limitations by\n\
- adding pseudo-relocations resolved at\n\
- runtime.\n"));
- fprintf (file, _(" --disable-runtime-pseudo-reloc Do not add runtime pseudo-relocations for\n\
- auto-imported DATA.\n"));
- fprintf (file, _(" --enable-extra-pe-debug Enable verbose debug output when building\n\
- or linking to DLLs (esp. auto-import)\n"));
-#endif
- fprintf (file, _(" --large-address-aware Executable supports virtual addresses\n\
- greater than 2 gigabytes\n"));
-}
-
-
-static void
-set_pe_name (char *name, long val)
-{
- int i;
-
- /* Find the name and set it. */
- for (i = 0; init[i].ptr; i++)
- {
- if (strcmp (name, init[i].symbol) == 0)
- {
- init[i].value = val;
- init[i].inited = 1;
- if (strcmp (name,"__image_base__") == 0)
- set_pe_name (U ("__ImageBase"), val);
- return;
- }
- }
- abort ();
-}
-
-
-static void
-set_pe_subsystem (void)
-{
- const char *sver;
- const char *entry;
- const char *initial_symbol_char;
- char *end;
- int len;
- int i;
- int subsystem;
- unsigned long temp_subsystem;
- static const struct
- {
- const char *name;
- const int value;
- const char *entry;
- }
- v[] =
- {
- { "native", 1, "NtProcessStartup" },
- { "windows", 2, "WinMainCRTStartup" },
- { "console", 3, "mainCRTStartup" },
- { "posix", 7, "__PosixProcessStartup"},
- { "wince", 9, "WinMainCRTStartup" },
- { "xbox", 14, "mainCRTStartup" },
- { NULL, 0, NULL }
- };
- /* Entry point name for arbitrary subsystem numbers. */
- static const char default_entry[] = "mainCRTStartup";
-
- /* Check for the presence of a version number. */
- sver = strchr (optarg, ':');
- if (sver == NULL)
- len = strlen (optarg);
- else
- {
- len = sver - optarg;
- set_pe_name ("__major_subsystem_version__",
- strtoul (sver + 1, &end, 0));
- if (*end == '.')
- set_pe_name ("__minor_subsystem_version__",
- strtoul (end + 1, &end, 0));
- if (*end != '\0')
- einfo (_("%P: warning: bad version number in -subsystem option\n"));
- }
-
- /* Check for numeric subsystem. */
- temp_subsystem = strtoul (optarg, & end, 0);
- if ((*end == ':' || *end == '\0') && (temp_subsystem < 65536))
- {
- /* Search list for a numeric match to use its entry point. */
- for (i = 0; v[i].name; i++)
- if (v[i].value == (int) temp_subsystem)
- break;
-
- /* If no match, use the default. */
- if (v[i].name != NULL)
- entry = v[i].entry;
- else
- entry = default_entry;
-
- /* Use this subsystem. */
- subsystem = (int) temp_subsystem;
- }
- else
- {
- /* Search for subsystem by name. */
- for (i = 0; v[i].name; i++)
- if (strncmp (optarg, v[i].name, len) == 0
- && v[i].name[len] == '\0')
- break;
-
- if (v[i].name == NULL)
- {
- einfo (_("%P%F: invalid subsystem type %s\n"), optarg);
- return;
- }
-
- entry = v[i].entry;
- subsystem = v[i].value;
- }
-
- set_pe_name ("__subsystem__", subsystem);
-
- initial_symbol_char = ${INITIAL_SYMBOL_CHAR};
- if (*initial_symbol_char != '\0')
- {
- char *alc_entry;
-
- /* lang_default_entry expects its argument to be permanently
- allocated, so we don't free this string. */
- alc_entry = xmalloc (strlen (initial_symbol_char)
- + strlen (entry)
- + 1);
- strcpy (alc_entry, initial_symbol_char);
- strcat (alc_entry, entry);
- entry = alc_entry;
- }
-
- lang_default_entry (entry);
-
- return;
-}
-
-
-static void
-set_pe_value (char *name)
-{
- char *end;
-
- set_pe_name (name, strtoul (optarg, &end, 0));
-
- if (end == optarg)
- einfo (_("%P%F: invalid hex number for PE parameter '%s'\n"), optarg);
-
- optarg = end;
-}
-
-
-static void
-set_pe_stack_heap (char *resname, char *comname)
-{
- set_pe_value (resname);
-
- if (*optarg == ',')
- {
- optarg++;
- set_pe_value (comname);
- }
- else if (*optarg)
- einfo (_("%P%F: strange hex info for PE parameter '%s'\n"), optarg);
-}
-
-
-static bfd_boolean
-gld${EMULATION_NAME}_handle_option (int optc)
-{
- switch (optc)
- {
- default:
- return FALSE;
-
- case OPTION_BASE_FILE:
- link_info.base_file = fopen (optarg, FOPEN_WB);
- if (link_info.base_file == NULL)
- {
- /* xgettext:c-format */
- fprintf (stderr, _("%s: Can't open base file %s\n"),
- program_name, optarg);
- xexit (1);
- }
- break;
-
- /* PE options. */
- case OPTION_HEAP:
- set_pe_stack_heap ("__size_of_heap_reserve__", "__size_of_heap_commit__");
- break;
- case OPTION_STACK:
- set_pe_stack_heap ("__size_of_stack_reserve__", "__size_of_stack_commit__");
- break;
- case OPTION_SUBSYSTEM:
- set_pe_subsystem ();
- break;
- case OPTION_MAJOR_OS_VERSION:
- set_pe_value ("__major_os_version__");
- break;
- case OPTION_MINOR_OS_VERSION:
- set_pe_value ("__minor_os_version__");
- break;
- case OPTION_MAJOR_SUBSYSTEM_VERSION:
- set_pe_value ("__major_subsystem_version__");
- break;
- case OPTION_MINOR_SUBSYSTEM_VERSION:
- set_pe_value ("__minor_subsystem_version__");
- break;
- case OPTION_MAJOR_IMAGE_VERSION:
- set_pe_value ("__major_image_version__");
- break;
- case OPTION_MINOR_IMAGE_VERSION:
- set_pe_value ("__minor_image_version__");
- break;
- case OPTION_FILE_ALIGNMENT:
- set_pe_value ("__file_alignment__");
- break;
- case OPTION_SECTION_ALIGNMENT:
- set_pe_value ("__section_alignment__");
- break;
- case OPTION_DLL:
- set_pe_name ("__dll__", 1);
- break;
- case OPTION_IMAGE_BASE:
- set_pe_value ("__image_base__");
- break;
- case OPTION_SUPPORT_OLD_CODE:
- support_old_code = 1;
- break;
- case OPTION_THUMB_ENTRY:
- thumb_entry_symbol = optarg;
- break;
-#ifdef DLL_SUPPORT
- case OPTION_OUT_DEF:
- pe_out_def_filename = xstrdup (optarg);
- break;
- case OPTION_EXPORT_ALL:
- pe_dll_export_everything = 1;
- break;
- case OPTION_EXCLUDE_SYMBOLS:
- pe_dll_add_excludes (optarg, 0);
- break;
- case OPTION_EXCLUDE_LIBS:
- pe_dll_add_excludes (optarg, 1);
- break;
- case OPTION_KILL_ATS:
- pe_dll_kill_ats = 1;
- break;
- case OPTION_STDCALL_ALIASES:
- pe_dll_stdcall_aliases = 1;
- break;
- case OPTION_ENABLE_STDCALL_FIXUP:
- pe_enable_stdcall_fixup = 1;
- break;
- case OPTION_DISABLE_STDCALL_FIXUP:
- pe_enable_stdcall_fixup = 0;
- break;
- case OPTION_IMPLIB_FILENAME:
- pe_implib_filename = xstrdup (optarg);
- break;
- case OPTION_WARN_DUPLICATE_EXPORTS:
- pe_dll_warn_dup_exports = 1;
- break;
- case OPTION_IMP_COMPAT:
- pe_dll_compat_implib = 1;
- break;
- case OPTION_ENABLE_AUTO_IMAGE_BASE:
- pe_enable_auto_image_base = 1;
- break;
- case OPTION_DISABLE_AUTO_IMAGE_BASE:
- pe_enable_auto_image_base = 0;
- break;
- case OPTION_DLL_SEARCH_PREFIX:
- pe_dll_search_prefix = xstrdup (optarg);
- break;
- case OPTION_NO_DEFAULT_EXCLUDES:
- pe_dll_do_default_excludes = 0;
- break;
- case OPTION_DLL_ENABLE_AUTO_IMPORT:
- link_info.pei386_auto_import = 1;
- break;
- case OPTION_DLL_DISABLE_AUTO_IMPORT:
- link_info.pei386_auto_import = 0;
- break;
- case OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC:
- link_info.pei386_runtime_pseudo_reloc = 1;
- break;
- case OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC:
- link_info.pei386_runtime_pseudo_reloc = 0;
- break;
- case OPTION_ENABLE_EXTRA_PE_DEBUG:
- pe_dll_extra_pe_debug = 1;
- break;
-#endif
- case OPTION_LARGE_ADDRESS_AWARE:
- real_flags |= IMAGE_FILE_LARGE_ADDRESS_AWARE;
- break;
- }
- return TRUE;
-}
-
-
-#ifdef DLL_SUPPORT
-static unsigned long
-strhash (const char *str)
-{
- const unsigned char *s;
- unsigned long hash;
- unsigned int c;
- unsigned int len;
-
- hash = 0;
- len = 0;
- s = (const unsigned char *) str;
- while ((c = *s++) != '\0')
- {
- hash += c + (c << 17);
- hash ^= hash >> 2;
- ++len;
- }
- hash += len + (len << 17);
- hash ^= hash >> 2;
-
- return hash;
-}
-
-/* Use the output file to create a image base for relocatable DLLs. */
-
-static unsigned long
-compute_dll_image_base (const char *ofile)
-{
- unsigned long hash = strhash (ofile);
- return 0x61300000 + ((hash << 16) & 0x0FFC0000);
-}
-#endif
-
-/* Assign values to the special symbols before the linker script is
- read. */
-
-static void
-gld_${EMULATION_NAME}_set_symbols (void)
-{
- /* Run through and invent symbols for all the
- names and insert the defaults. */
- int j;
- lang_statement_list_type *save;
-
- if (!init[IMAGEBASEOFF].inited)
- {
- if (link_info.relocatable)
- init[IMAGEBASEOFF].value = 0;
- else if (init[DLLOFF].value || (link_info.shared && !link_info.pie))
-#ifdef DLL_SUPPORT
- init[IMAGEBASEOFF].value = (pe_enable_auto_image_base) ?
- compute_dll_image_base (output_filename) : NT_DLL_IMAGE_BASE;
-#else
- init[IMAGEBASEOFF].value = NT_DLL_IMAGE_BASE;
-#endif
- else
- init[IMAGEBASEOFF].value = NT_EXE_IMAGE_BASE;
- init[MSIMAGEBASEOFF].value = init[IMAGEBASEOFF].value;
- }
-
- /* Don't do any symbol assignments if this is a relocatable link. */
- if (link_info.relocatable)
- return;
-
- /* Glue the assignments into the abs section. */
- save = stat_ptr;
-
- stat_ptr = &(abs_output_section->children);
-
- for (j = 0; init[j].ptr; j++)
- {
- long val = init[j].value;
- lang_assignment_statement_type *rv;
- rv = lang_add_assignment (exp_assop ('=', init[j].symbol,
- exp_intop (val)));
- if (init[j].size == sizeof (short))
- *(short *) init[j].ptr = val;
- else if (init[j].size == sizeof (int))
- *(int *) init[j].ptr = val;
- else if (init[j].size == sizeof (long))
- *(long *) init[j].ptr = val;
- /* This might be a long long or other special type. */
- else if (init[j].size == sizeof (bfd_vma))
- *(bfd_vma *) init[j].ptr = val;
- else abort ();
- if (j == IMAGEBASEOFF)
- image_base_statement = rv;
- }
- /* Restore the pointer. */
- stat_ptr = save;
-
- if (pe.FileAlignment >
- pe.SectionAlignment)
- {
- einfo (_("%P: warning, file alignment > section alignment.\n"));
- }
-}
-
-/* This is called after the linker script and the command line options
- have been read. */
-
-static void
-gld_${EMULATION_NAME}_after_parse (void)
-{
- /* The Windows libraries are designed for the linker to treat the
- entry point as an undefined symbol. Otherwise, the .obj that
- defines mainCRTStartup is brought in because it is the first
- encountered in libc.lib and it has other symbols in it which will
- be pulled in by the link process. To avoid this, we act as
- though the user specified -u with the entry point symbol.
-
- This function is called after the linker script and command line
- options have been read, so at this point we know the right entry
- point. This function is called before the input files are
- opened, so registering the symbol as undefined will make a
- difference. */
-
- if (! link_info.relocatable && entry_symbol.name != NULL)
- ldlang_add_undef (entry_symbol.name);
-}
-
-/* pe-dll.c directly accesses pe_data_import_dll,
- so it must be defined outside of #ifdef DLL_SUPPORT.
- Note - this variable is deliberately not initialised.
- This allows it to be treated as a common varaible, and only
- exist in one incarnation in a multiple target enabled linker. */
-char * pe_data_import_dll;
-
-#ifdef DLL_SUPPORT
-static struct bfd_link_hash_entry *pe_undef_found_sym;
-
-static bfd_boolean
-pe_undef_cdecl_match (struct bfd_link_hash_entry *h, void *inf)
-{
- int sl;
- char *string = inf;
-
- sl = strlen (string);
- if (h->type == bfd_link_hash_defined
- && strncmp (h->root.string, string, sl) == 0
- && h->root.string[sl] == '@')
- {
- pe_undef_found_sym = h;
- return FALSE;
- }
- return TRUE;
-}
-
-static void
-pe_fixup_stdcalls (void)
-{
- static int gave_warning_message = 0;
- struct bfd_link_hash_entry *undef, *sym;
-
- if (pe_dll_extra_pe_debug)
- printf ("%s\n", __FUNCTION__);
-
- for (undef = link_info.hash->undefs; undef; undef=undef->u.undef.next)
- if (undef->type == bfd_link_hash_undefined)
- {
- char* at = strchr (undef->root.string, '@');
- int lead_at = (*undef->root.string == '@');
- /* For now, don't try to fixup fastcall symbols. */
-
- if (at && !lead_at)
- {
- /* The symbol is a stdcall symbol, so let's look for a
- cdecl symbol with the same name and resolve to that. */
- char *cname = xstrdup (undef->root.string /* + lead_at */);
- at = strchr (cname, '@');
- *at = 0;
- sym = bfd_link_hash_lookup (link_info.hash, cname, 0, 0, 1);
-
- if (sym && sym->type == bfd_link_hash_defined)
- {
- undef->type = bfd_link_hash_defined;
- undef->u.def.value = sym->u.def.value;
- undef->u.def.section = sym->u.def.section;
-
- if (pe_enable_stdcall_fixup == -1)
- {
- einfo (_("Warning: resolving %s by linking to %s\n"),
- undef->root.string, cname);
- if (! gave_warning_message)
- {
- gave_warning_message = 1;
- einfo (_("Use --enable-stdcall-fixup to disable these warnings\n"));
- einfo (_("Use --disable-stdcall-fixup to disable these fixups\n"));
- }
- }
- }
- }
- else
- {
- /* The symbol is a cdecl symbol, so we look for stdcall
- symbols - which means scanning the whole symbol table. */
- pe_undef_found_sym = 0;
- bfd_link_hash_traverse (link_info.hash, pe_undef_cdecl_match,
- (char *) undef->root.string);
- sym = pe_undef_found_sym;
- if (sym)
- {
- undef->type = bfd_link_hash_defined;
- undef->u.def.value = sym->u.def.value;
- undef->u.def.section = sym->u.def.section;
-
- if (pe_enable_stdcall_fixup == -1)
- {
- einfo (_("Warning: resolving %s by linking to %s\n"),
- undef->root.string, sym->root.string);
- if (! gave_warning_message)
- {
- gave_warning_message = 1;
- einfo (_("Use --enable-stdcall-fixup to disable these warnings\n"));
- einfo (_("Use --disable-stdcall-fixup to disable these fixups\n"));
- }
- }
- }
- }
- }
-}
-
-static int
-make_import_fixup (arelent *rel, asection *s)
-{
- struct bfd_symbol *sym = *rel->sym_ptr_ptr;
- char addend[4];
-
- if (pe_dll_extra_pe_debug)
- printf ("arelent: %s@%#lx: add=%li\n", sym->name,
- (unsigned long) rel->address, (long) rel->addend);
-
- if (! bfd_get_section_contents (s->owner, s, addend, rel->address, sizeof (addend)))
- einfo (_("%C: Cannot get section contents - auto-import exception\n"),
- s->owner, s, rel->address);
-
- pe_create_import_fixup (rel, s, bfd_get_32 (s->owner, addend));
-
- return 1;
-}
-
-static void
-pe_find_data_imports (void)
-{
- struct bfd_link_hash_entry *undef, *sym;
-
- if (link_info.pei386_auto_import == 0)
- return;
-
- for (undef = link_info.hash->undefs; undef; undef=undef->u.undef.next)
- {
- if (undef->type == bfd_link_hash_undefined)
- {
- /* C++ symbols are *long*. */
- char buf[4096];
-
- if (pe_dll_extra_pe_debug)
- printf ("%s:%s\n", __FUNCTION__, undef->root.string);
-
- sprintf (buf, "__imp_%s", undef->root.string);
-
- sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1);
-
- if (sym && sym->type == bfd_link_hash_defined)
- {
- bfd *b = sym->u.def.section->owner;
- asymbol **symbols;
- int nsyms, symsize, i;
-
- if (link_info.pei386_auto_import == -1)
- {
- static bfd_boolean warned = FALSE;
-
- info_msg (_("Info: resolving %s by linking to %s (auto-import)\n"),
- undef->root.string, buf);
-
- /* PR linker/4844. */
- if (! warned)
- {
- warned = TRUE;
- einfo (_("%P: warning: auto-importing has been activated without --enable-auto-import specified on the command line.\n\
-This should work unless it involves constant data structures referencing symbols from auto-imported DLLs."));
- }
- }
-
- symsize = bfd_get_symtab_upper_bound (b);
- symbols = (asymbol **) xmalloc (symsize);
- nsyms = bfd_canonicalize_symtab (b, symbols);
-
- for (i = 0; i < nsyms; i++)
- {
- if (! CONST_STRNEQ (symbols[i]->name, U ("_head_")))
- continue;
-
- if (pe_dll_extra_pe_debug)
- printf ("->%s\n", symbols[i]->name);
-
- pe_data_import_dll = (char*) (symbols[i]->name +
- sizeof (U ("_head_")) - 1);
- break;
- }
-
- pe_walk_relocs_of_symbol (&link_info, undef->root.string,
- make_import_fixup);
-
- /* Let's differentiate it somehow from defined. */
- undef->type = bfd_link_hash_defweak;
- /* We replace original name with __imp_ prefixed, this
- 1) may trash memory 2) leads to duplicate symbol generation.
- Still, IMHO it's better than having name poluted. */
- undef->root.string = sym->root.string;
- undef->u.def.value = sym->u.def.value;
- undef->u.def.section = sym->u.def.section;
- }
- }
- }
-}
-
-static bfd_boolean
-pr_sym (struct bfd_hash_entry *h, void *inf ATTRIBUTE_UNUSED)
-{
- if (pe_dll_extra_pe_debug)
- printf ("+%s\n", h->string);
-
- return TRUE;
-}
-#endif /* DLL_SUPPORT */
-
-
-static void
-gld_${EMULATION_NAME}_after_open (void)
-{
-#ifdef DLL_SUPPORT
- if (pe_dll_extra_pe_debug)
- {
- bfd *a;
- struct bfd_link_hash_entry *sym;
-
- printf ("%s()\n", __FUNCTION__);
-
- for (sym = link_info.hash->undefs; sym; sym=sym->u.undef.next)
- printf ("-%s\n", sym->root.string);
- bfd_hash_traverse (&link_info.hash->table, pr_sym, NULL);
-
- for (a = link_info.input_bfds; a; a = a->link_next)
- printf ("*%s\n",a->filename);
- }
-#endif
-
- /* Pass the wacky PE command line options into the output bfd.
- FIXME: This should be done via a function, rather than by
- including an internal BFD header. */
-
- if (coff_data (link_info.output_bfd) == NULL
- || coff_data (link_info.output_bfd)->pe == 0)
- einfo (_("%F%P: cannot perform PE operations on non PE output file '%B'.\n"),
- link_info.output_bfd);
-
- pe_data (link_info.output_bfd)->pe_opthdr = pe;
- pe_data (link_info.output_bfd)->dll = init[DLLOFF].value;
- pe_data (link_info.output_bfd)->real_flags |= real_flags;
-
-#ifdef DLL_SUPPORT
- if (pe_enable_stdcall_fixup) /* -1=warn or 1=disable */
- pe_fixup_stdcalls ();
-
- pe_process_import_defs (link_info.output_bfd, &link_info);
-
- pe_find_data_imports ();
-
-#if defined (TARGET_IS_i386pe) \
- || defined (TARGET_IS_armpe) \
- || defined (TARGET_IS_arm_epoc_pe) \
- || defined (TARGET_IS_arm_wince_pe)
- if (!link_info.relocatable)
- pe_dll_build_sections (link_info.output_bfd, &link_info);
- else
- pe_exe_build_sections (link_info.output_bfd, &link_info);
-#else
- if (link_info.shared)
- pe_dll_build_sections (link_info.output_bfd, &link_info);
-#endif
-#endif /* DLL_SUPPORT */
-
-#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) || defined(TARGET_IS_arm_wince_pe)
- if (strstr (bfd_get_target (link_info.output_bfd), "arm") == NULL)
- {
- /* The arm backend needs special fields in the output hash structure.
- These will only be created if the output format is an arm format,
- hence we do not support linking and changing output formats at the
- same time. Use a link followed by objcopy to change output formats. */
- einfo ("%F%X%P: error: cannot change output format whilst linking ARM binaries\n");
- return;
- }
- {
- /* Find a BFD that can hold the interworking stubs. */
- LANG_FOR_EACH_INPUT_STATEMENT (is)
- {
- if (bfd_arm_get_bfd_for_interworking (is->the_bfd, & link_info))
- break;
- }
- }
-#endif
-
- {
- /* This next chunk of code tries to detect the case where you have
- two import libraries for the same DLL (specifically,
- symbolically linking libm.a and libc.a in cygwin to
- libcygwin.a). In those cases, it's possible for function
- thunks from the second implib to be used but without the
- head/tail objects, causing an improper import table. We detect
- those cases and rename the "other" import libraries to match
- the one the head/tail come from, so that the linker will sort
- things nicely and produce a valid import table. */
-
- LANG_FOR_EACH_INPUT_STATEMENT (is)
- {
- if (is->the_bfd->my_archive)
- {
- int idata2 = 0, reloc_count=0, is_imp = 0;
- asection *sec;
-
- /* See if this is an import library thunk. */
- for (sec = is->the_bfd->sections; sec; sec = sec->next)
- {
- if (strcmp (sec->name, ".idata\$2") == 0)
- idata2 = 1;
- if (CONST_STRNEQ (sec->name, ".idata\$"))
- is_imp = 1;
- reloc_count += sec->reloc_count;
- }
-
- if (is_imp && !idata2 && reloc_count)
- {
- /* It is, look for the reference to head and see if it's
- from our own library. */
- for (sec = is->the_bfd->sections; sec; sec = sec->next)
- {
- int i;
- long symsize;
- long relsize;
- asymbol **symbols;
- arelent **relocs;
- int nrelocs;
-
- symsize = bfd_get_symtab_upper_bound (is->the_bfd);
- if (symsize < 1)
- break;
- relsize = bfd_get_reloc_upper_bound (is->the_bfd, sec);
- if (relsize < 1)
- break;
-
- symbols = (asymbol **) xmalloc (symsize);
- symsize = bfd_canonicalize_symtab (is->the_bfd, symbols);
- if (symsize < 0)
- {
- einfo ("%X%P: unable to process symbols: %E");
- return;
- }
-
- relocs = (arelent **) xmalloc ((size_t) relsize);
- nrelocs = bfd_canonicalize_reloc (is->the_bfd, sec,
- relocs, symbols);
- if (nrelocs < 0)
- {
- free (relocs);
- einfo ("%X%P: unable to process relocs: %E");
- return;
- }
-
- for (i = 0; i < nrelocs; i++)
- {
- struct bfd_symbol *s;
- struct bfd_link_hash_entry * blhe;
- char *other_bfd_filename;
- char *n;
-
- s = (relocs[i]->sym_ptr_ptr)[0];
-
- if (s->flags & BSF_LOCAL)
- continue;
-
- /* Thunk section with reloc to another bfd. */
- blhe = bfd_link_hash_lookup (link_info.hash,
- s->name,
- FALSE, FALSE, TRUE);
-
- if (blhe == NULL
- || blhe->type != bfd_link_hash_defined)
- continue;
-
- other_bfd_filename
- = blhe->u.def.section->owner->my_archive
- ? bfd_get_filename (blhe->u.def.section->owner->my_archive)
- : bfd_get_filename (blhe->u.def.section->owner);
-
- if (strcmp (bfd_get_filename (is->the_bfd->my_archive),
- other_bfd_filename) == 0)
- continue;
-
- /* Rename this implib to match the other one. */
- n = xmalloc (strlen (other_bfd_filename) + 1);
- strcpy (n, other_bfd_filename);
- is->the_bfd->my_archive->filename = n;
- }
-
- free (relocs);
- /* Note - we do not free the symbols,
- they are now cached in the BFD. */
- }
- }
- }
- }
- }
-
- {
- int is_ms_arch = 0;
- bfd *cur_arch = 0;
- lang_input_statement_type *is2;
- lang_input_statement_type *is3;
-
- /* Careful - this is a shell script. Watch those dollar signs! */
- /* Microsoft import libraries have every member named the same,
- and not in the right order for us to link them correctly. We
- must detect these and rename the members so that they'll link
- correctly. There are three types of objects: the head, the
- thunks, and the sentinel(s). The head is easy; it's the one
- with idata2. We assume that the sentinels won't have relocs,
- and the thunks will. It's easier than checking the symbol
- table for external references. */
- LANG_FOR_EACH_INPUT_STATEMENT (is)
- {
- if (is->the_bfd->my_archive)
- {
- char *pnt;
- bfd *arch = is->the_bfd->my_archive;
-
- if (cur_arch != arch)
- {
- cur_arch = arch;
- is_ms_arch = 1;
-
- for (is3 = is;
- is3 && is3->the_bfd->my_archive == arch;
- is3 = (lang_input_statement_type *) is3->next)
- {
- /* A MS dynamic import library can also contain static
- members, so look for the first element with a .dll
- extension, and use that for the remainder of the
- comparisons. */
- pnt = strrchr (is3->the_bfd->filename, '.');
- if (pnt != NULL && strcmp (pnt, ".dll") == 0)
- break;
- }
-
- if (is3 == NULL)
- is_ms_arch = 0;
- else
- {
- /* OK, found one. Now look to see if the remaining
- (dynamic import) members use the same name. */
- for (is2 = is;
- is2 && is2->the_bfd->my_archive == arch;
- is2 = (lang_input_statement_type *) is2->next)
- {
- /* Skip static members, ie anything with a .obj
- extension. */
- pnt = strrchr (is2->the_bfd->filename, '.');
- if (pnt != NULL && strcmp (pnt, ".obj") == 0)
- continue;
-
- if (strcmp (is3->the_bfd->filename,
- is2->the_bfd->filename))
- {
- is_ms_arch = 0;
- break;
- }
- }
- }
- }
-
- /* This fragment might have come from an .obj file in a Microsoft
- import, and not an actual import record. If this is the case,
- then leave the filename alone. */
- pnt = strrchr (is->the_bfd->filename, '.');
-
- if (is_ms_arch && (strcmp (pnt, ".dll") == 0))
- {
- int idata2 = 0, reloc_count=0;
- asection *sec;
- char *new_name, seq;
-
- for (sec = is->the_bfd->sections; sec; sec = sec->next)
- {
- if (strcmp (sec->name, ".idata\$2") == 0)
- idata2 = 1;
- reloc_count += sec->reloc_count;
- }
-
- if (idata2) /* .idata2 is the TOC */
- seq = 'a';
- else if (reloc_count > 0) /* thunks */
- seq = 'b';
- else /* sentinel */
- seq = 'c';
-
- new_name = xmalloc (strlen (is->the_bfd->filename) + 3);
- sprintf (new_name, "%s.%c", is->the_bfd->filename, seq);
- is->the_bfd->filename = new_name;
-
- new_name = xmalloc (strlen (is->filename) + 3);
- sprintf (new_name, "%s.%c", is->filename, seq);
- is->filename = new_name;
- }
- }
- }
- }
-
- {
- /* The following chunk of code tries to identify jump stubs in
- import libraries which are dead code and eliminates them
- from the final link. For each exported symbol <sym>, there
- is a object file in the import library with a .text section
- and several .idata$* sections. The .text section contains the
- symbol definition for <sym> which is a jump stub of the form
- jmp *__imp_<sym>. The .idata$5 contains the symbol definition
- for __imp_<sym> which is the address of the slot for <sym> in
- the import address table. When a symbol is imported explicitly
- using __declspec(dllimport) declaration, the compiler generates
- a reference to __imp_<sym> which directly resolves to the
- symbol in .idata$5, in which case the jump stub code is not
- needed. The following code tries to identify jump stub sections
- in import libraries which are not referred to by anyone and
- marks them for exclusion from the final link. */
- LANG_FOR_EACH_INPUT_STATEMENT (is)
- {
- if (is->the_bfd->my_archive)
- {
- int is_imp = 0;
- asection *sec, *stub_sec = NULL;
-
- /* See if this is an import library thunk. */
- for (sec = is->the_bfd->sections; sec; sec = sec->next)
- {
- if (strncmp (sec->name, ".idata\$", 7) == 0)
- is_imp = 1;
- /* The section containing the jmp stub has code
- and has a reloc. */
- if ((sec->flags & SEC_CODE) && sec->reloc_count)
- stub_sec = sec;
- }
-
- if (is_imp && stub_sec)
- {
- long symsize;
- asymbol **symbols;
- long src_count;
- struct bfd_link_hash_entry * blhe;
-
- symsize = bfd_get_symtab_upper_bound (is->the_bfd);
- symbols = xmalloc (symsize);
- symsize = bfd_canonicalize_symtab (is->the_bfd, symbols);
-
- for (src_count = 0; src_count < symsize; src_count++)
- {
- if (symbols[src_count]->section->id == stub_sec->id)
- {
- /* This symbol belongs to the section containing
- the stub. */
- blhe = bfd_link_hash_lookup (link_info.hash,
- symbols[src_count]->name,
- FALSE, FALSE, TRUE);
- /* If the symbol in the stub section has no other
- undefined references, exclude the stub section
- from the final link. */
- if (blhe && (blhe->type == bfd_link_hash_defined)
- && (blhe->u.undef.next == NULL))
- stub_sec->flags |= SEC_EXCLUDE;
- }
- }
- free (symbols);
- }
- }
- }
- }
-}
-
-static void
-gld_${EMULATION_NAME}_before_allocation (void)
-{
-#ifdef TARGET_IS_ppcpe
- /* Here we rummage through the found bfds to collect toc information. */
- {
- LANG_FOR_EACH_INPUT_STATEMENT (is)
- {
- if (!ppc_process_before_allocation (is->the_bfd, &link_info))
- {
- /* xgettext:c-format */
- einfo (_("Errors encountered processing file %s\n"), is->filename);
- }
- }
- }
-
- /* We have seen it all. Allocate it, and carry on. */
- ppc_allocate_toc_section (&link_info);
-#endif /* TARGET_IS_ppcpe */
-
-#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) || defined(TARGET_IS_arm_wince_pe)
- /* FIXME: we should be able to set the size of the interworking stub
- section.
-
- Here we rummage through the found bfds to collect glue
- information. FIXME: should this be based on a command line
- option? krk@cygnus.com. */
- {
- LANG_FOR_EACH_INPUT_STATEMENT (is)
- {
- if (! bfd_arm_process_before_allocation
- (is->the_bfd, & link_info, support_old_code))
- {
- /* xgettext:c-format */
- einfo (_("Errors encountered processing file %s for interworking"),
- is->filename);
- }
- }
- }
-
- /* We have seen it all. Allocate it, and carry on. */
- bfd_arm_allocate_interworking_sections (& link_info);
-#endif /* TARGET_IS_armpe || TARGET_IS_arm_epoc_pe || TARGET_IS_arm_wince_pe */
-
- before_allocation_default ();
-}
-
-#ifdef DLL_SUPPORT
-/* This is called when an input file isn't recognized as a BFD. We
- check here for .DEF files and pull them in automatically. */
-
-static int
-saw_option (char *option)
-{
- int i;
-
- for (i = 0; init[i].ptr; i++)
- if (strcmp (init[i].symbol, option) == 0)
- return init[i].inited;
- return 0;
-}
-#endif /* DLL_SUPPORT */
-
-static bfd_boolean
-gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
-{
-#ifdef DLL_SUPPORT
- const char *ext = entry->filename + strlen (entry->filename) - 4;
-
- if (strcmp (ext, ".def") == 0 || strcmp (ext, ".DEF") == 0)
- {
- pe_def_file = def_file_parse (entry->filename, pe_def_file);
-
- if (pe_def_file)
- {
- int i, buflen=0, len;
- char *buf;
-
- for (i = 0; i < pe_def_file->num_exports; i++)
- {
- len = strlen (pe_def_file->exports[i].internal_name);
- if (buflen < len + 2)
- buflen = len + 2;
- }
-
- buf = (char *) xmalloc (buflen);
-
- for (i = 0; i < pe_def_file->num_exports; i++)
- {
- struct bfd_link_hash_entry *h;
-
- sprintf (buf, "%s%s", U (""), pe_def_file->exports[i].internal_name);
-
- h = bfd_link_hash_lookup (link_info.hash, buf, TRUE, TRUE, TRUE);
- if (h == (struct bfd_link_hash_entry *) NULL)
- einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n"));
- if (h->type == bfd_link_hash_new)
- {
- h->type = bfd_link_hash_undefined;
- h->u.undef.abfd = NULL;
- bfd_link_add_undef (link_info.hash, h);
- }
- }
- free (buf);
-
- /* def_file_print (stdout, pe_def_file); */
- if (pe_def_file->is_dll == 1)
- link_info.shared = 1;
-
- if (pe_def_file->base_address != (bfd_vma)(-1))
- {
- pe.ImageBase
- = pe_data (link_info.output_bfd)->pe_opthdr.ImageBase
- = init[IMAGEBASEOFF].value
- = pe_def_file->base_address;
- init[IMAGEBASEOFF].inited = 1;
- if (image_base_statement)
- image_base_statement->exp = exp_assop ('=', "__image_base__",
- exp_intop (pe.ImageBase));
- }
-
- if (pe_def_file->stack_reserve != -1
- && ! saw_option ("__size_of_stack_reserve__"))
- {
- pe.SizeOfStackReserve = pe_def_file->stack_reserve;
- if (pe_def_file->stack_commit != -1)
- pe.SizeOfStackCommit = pe_def_file->stack_commit;
- }
- if (pe_def_file->heap_reserve != -1
- && ! saw_option ("__size_of_heap_reserve__"))
- {
- pe.SizeOfHeapReserve = pe_def_file->heap_reserve;
- if (pe_def_file->heap_commit != -1)
- pe.SizeOfHeapCommit = pe_def_file->heap_commit;
- }
- return TRUE;
- }
- }
-#endif
- return FALSE;
-}
-
-static bfd_boolean
-gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
-{
-#ifdef DLL_SUPPORT
-#ifdef TARGET_IS_i386pe
- pe_dll_id_target ("pei-i386");
-#endif
-#ifdef TARGET_IS_shpe
- pe_dll_id_target ("pei-shl");
-#endif
-#ifdef TARGET_IS_mipspe
- pe_dll_id_target ("pei-mips");
-#endif
-#ifdef TARGET_IS_armpe
- pe_dll_id_target ("pei-arm-little");
-#endif
-#ifdef TARGET_IS_arm_epoc_pe
- pe_dll_id_target ("epoc-pei-arm-little");
-#endif
-#ifdef TARGET_IS_arm_wince_pe
- pe_dll_id_target ("pei-arm-wince-little");
-#endif
- if (pe_bfd_is_dll (entry->the_bfd))
- return pe_implied_import_dll (entry->filename);
-#endif
- return FALSE;
-}
-
-static void
-gld_${EMULATION_NAME}_finish (void)
-{
-#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) || defined(TARGET_IS_arm_wince_pe)
- struct bfd_link_hash_entry * h;
-
- if (thumb_entry_symbol != NULL)
- {
- h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol,
- FALSE, FALSE, TRUE);
-
- if (h != (struct bfd_link_hash_entry *) NULL
- && (h->type == bfd_link_hash_defined
- || h->type == bfd_link_hash_defweak)
- && h->u.def.section->output_section != NULL)
- {
- static char buffer[32];
- bfd_vma val;
-
- /* Special procesing is required for a Thumb entry symbol. The
- bottom bit of its address must be set. */
- val = (h->u.def.value
- + bfd_get_section_vma (link_info.output_bfd,
- h->u.def.section->output_section)
- + h->u.def.section->output_offset);
-
- val |= 1;
-
- /* Now convert this value into a string and store it in entry_symbol
- where the lang_finish() function will pick it up. */
- buffer[0] = '0';
- buffer[1] = 'x';
-
- sprintf_vma (buffer + 2, val);
-
- if (entry_symbol.name != NULL && entry_from_cmdline)
- einfo (_("%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"),
- thumb_entry_symbol, entry_symbol.name);
- entry_symbol.name = buffer;
- }
- else
- einfo (_("%P: warning: cannot find thumb start symbol %s\n"), thumb_entry_symbol);
- }
-#endif /* defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_epoc_pe) || defined(TARGET_IS_arm_wince_pe) */
-
- finish_default ();
-
-#ifdef DLL_SUPPORT
- if (link_info.shared
-#if !defined(TARGET_IS_shpe) && !defined(TARGET_IS_mipspe)
- || (!link_info.relocatable && pe_def_file->num_exports != 0)
-#endif
- )
- {
- pe_dll_fill_sections (link_info.output_bfd, &link_info);
- if (pe_implib_filename)
- pe_dll_generate_implib (pe_def_file, pe_implib_filename);
- }
-#if defined(TARGET_IS_shpe) || defined(TARGET_IS_mipspe)
- /* ARM doesn't need relocs. */
- else
- {
- pe_exe_fill_sections (link_info.output_bfd, &link_info);
- }
-#endif
-
- if (pe_out_def_filename)
- pe_dll_generate_def_file (pe_out_def_filename);
-#endif /* DLL_SUPPORT */
-
- /* I don't know where .idata gets set as code, but it shouldn't be. */
- {
- asection *asec = bfd_get_section_by_name (link_info.output_bfd, ".idata");
-
- if (asec)
- {
- asec->flags &= ~SEC_CODE;
- asec->flags |= SEC_DATA;
- }
- }
-}
-
-
-/* Place an orphan section.
-
- We use this to put sections in a reasonable place in the file, and
- to ensure that they are aligned as required.
-
- We handle grouped sections here as well. A section named .foo$nn
- goes into the output section .foo. All grouped sections are sorted
- by name.
-
- Grouped sections for the default sections are handled by the
- default linker script using wildcards, and are sorted by
- sort_sections. */
-
-static bfd_boolean
-gld_${EMULATION_NAME}_place_orphan (asection *s)
-{
- const char *secname;
- const char *orig_secname;
- char *dollar = NULL;
- lang_output_section_statement_type *os;
- lang_statement_list_type add_child;
-
- secname = bfd_get_section_name (s->owner, s);
-
- /* Look through the script to see where to place this section. */
- orig_secname = secname;
- if (!link_info.relocatable
- && (dollar = strchr (secname, '$')) != NULL)
- {
- size_t len = dollar - orig_secname;
- char *newname = xmalloc (len + 1);
- memcpy (newname, orig_secname, len);
- newname[len] = '\0';
- secname = newname;
- }
-
- os = lang_output_section_find (secname);
-
- lang_list_init (&add_child);
-
- if (os != NULL
- && (os->bfd_section == NULL
- || os->bfd_section->flags == 0
- || ((s->flags ^ os->bfd_section->flags)
- & (SEC_LOAD | SEC_ALLOC)) == 0))
- {
- /* We already have an output section statement with this
- name, and its bfd section, if any, has compatible flags.
- If the section already exists but does not have any flags set,
- then it has been created by the linker, probably as a result of
- a --section-start command line switch. */
- lang_add_section (&add_child, s, os);
- }
- else
- {
- static struct orphan_save hold[] =
- {
- { ".text",
- SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE,
- 0, 0, 0, 0 },
- { ".rdata",
- SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
- 0, 0, 0, 0 },
- { ".data",
- SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_DATA,
- 0, 0, 0, 0 },
- { ".bss",
- SEC_ALLOC,
- 0, 0, 0, 0 }
- };
- enum orphan_save_index
- {
- orphan_text = 0,
- orphan_rodata,
- orphan_data,
- orphan_bss
- };
- static int orphan_init_done = 0;
- struct orphan_save *place;
- lang_output_section_statement_type *after;
- etree_type *address;
-
- if (!orphan_init_done)
- {
- struct orphan_save *ho;
- for (ho = hold; ho < hold + sizeof (hold) / sizeof (hold[0]); ++ho)
- if (ho->name != NULL)
- {
- ho->os = lang_output_section_find (ho->name);
- if (ho->os != NULL && ho->os->flags == 0)
- ho->os->flags = ho->flags;
- }
- orphan_init_done = 1;
- }
-
- /* Try to put the new output section in a reasonable place based
- on the section name and section flags. */
-
- place = NULL;
- if ((s->flags & SEC_ALLOC) == 0)
- ;
- else if ((s->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
- place = &hold[orphan_bss];
- else if ((s->flags & SEC_READONLY) == 0)
- place = &hold[orphan_data];
- else if ((s->flags & SEC_CODE) == 0)
- place = &hold[orphan_rodata];
- else
- place = &hold[orphan_text];
-
- after = NULL;
- if (place != NULL)
- {
- if (place->os == NULL)
- place->os = lang_output_section_find (place->name);
- after = place->os;
- if (after == NULL)
- after = lang_output_section_find_by_flags (s, &place->os, NULL);
- if (after == NULL)
- /* *ABS* is always the first output section statement. */
- after = (&lang_output_section_statement.head
- ->output_section_statement);
- }
-
- /* Choose a unique name for the section. This will be needed if the
- same section name appears in the input file with different
- loadable or allocatable characteristics. */
- if (bfd_get_section_by_name (link_info.output_bfd, secname) != NULL)
- {
- static int count = 1;
- secname = bfd_get_unique_section_name (link_info.output_bfd,
- secname, &count);
- if (secname == NULL)
- einfo ("%F%P: place_orphan failed: %E\n");
- }
-
- /* All sections in an executable must be aligned to a page boundary. */
- address = exp_unop (ALIGN_K, exp_nameop (NAME, "__section_alignment__"));
- os = lang_insert_orphan (s, secname, after, place, address, &add_child);
- }
-
- {
- lang_statement_union_type **pl = &os->children.head;
-
- if (dollar != NULL)
- {
- bfd_boolean found_dollar;
-
- /* The section name has a '$'. Sort it with the other '$'
- sections. */
- found_dollar = FALSE;
- for ( ; *pl != NULL; pl = &(*pl)->header.next)
- {
- lang_input_section_type *ls;
- const char *lname;
-
- if ((*pl)->header.type != lang_input_section_enum)
- continue;
-
- ls = &(*pl)->input_section;
-
- lname = bfd_get_section_name (ls->section->owner, ls->section);
- if (strchr (lname, '$') == NULL)
- {
- if (found_dollar)
- break;
- }
- else
- {
- found_dollar = TRUE;
- if (strcmp (orig_secname, lname) < 0)
- break;
- }
- }
- }
-
- if (add_child.head != NULL)
- {
- add_child.head->header.next = *pl;
- *pl = add_child.head;
- }
- }
-
- return TRUE;
-}
-
-static bfd_boolean
-gld_${EMULATION_NAME}_open_dynamic_archive
- (const char *arch ATTRIBUTE_UNUSED, search_dirs_type *search,
- lang_input_statement_type *entry)
-{
- static const struct
- {
- const char * format;
- bfd_boolean use_prefix;
- }
- libname_fmt [] =
- {
- /* Preferred explicit import library for dll's. */
- { "lib%s.dll.a", FALSE },
- /* Alternate explicit import library for dll's. */
- { "%s.dll.a", FALSE },
- /* "libfoo.a" could be either an import lib or a static lib.
- For backwards compatibility, libfoo.a needs to precede
- libfoo.dll and foo.dll in the search. */
- { "lib%s.a", FALSE },
- /* The 'native' spelling of an import lib name is "foo.lib". */
- { "%s.lib", FALSE },
-#ifdef DLL_SUPPORT
- /* Try "<prefix>foo.dll" (preferred dll name, if specified). */
- { "%s%s.dll", TRUE },
-#endif
- /* Try "libfoo.dll" (default preferred dll name). */
- { "lib%s.dll", FALSE },
- /* Finally try 'native' dll name "foo.dll". */
- { "%s.dll", FALSE },
- /* Note: If adding more formats to this table, make sure to check to
- see if their length is longer than libname_fmt[0].format, and if
- so, update the call to xmalloc() below. */
- { NULL, FALSE }
- };
- static unsigned int format_max_len = 0;
- const char * filename;
- char * full_string;
- char * base_string;
- unsigned int i;
-
-
- if (! entry->is_archive)
- return FALSE;
-
- filename = entry->filename;
-
- if (format_max_len == 0)
- /* We need to allow space in the memory that we are going to allocate
- for the characters in the format string. Since the format array is
- static we only need to calculate this information once. In theory
- this value could also be computed statically, but this introduces
- the possibility for a discrepancy and hence a possible memory
- corruption. The lengths we compute here will be too long because
- they will include any formating characters (%s) in the strings, but
- this will not matter. */
- for (i = 0; libname_fmt[i].format; i++)
- if (format_max_len < strlen (libname_fmt[i].format))
- format_max_len = strlen (libname_fmt[i].format);
-
- full_string = xmalloc (strlen (search->name)
- + strlen (filename)
- + format_max_len
-#ifdef DLL_SUPPORT
- + (pe_dll_search_prefix
- ? strlen (pe_dll_search_prefix) : 0)
-#endif
- /* Allow for the terminating NUL and for the path
- separator character that is inserted between
- search->name and the start of the format string. */
- + 2);
-
- sprintf (full_string, "%s/", search->name);
- base_string = full_string + strlen (full_string);
-
- for (i = 0; libname_fmt[i].format; i++)
- {
-#ifdef DLL_SUPPORT
- if (libname_fmt[i].use_prefix)
- {
- if (!pe_dll_search_prefix)
- continue;
- sprintf (base_string, libname_fmt[i].format, pe_dll_search_prefix, filename);
- }
- else
-#endif
- sprintf (base_string, libname_fmt[i].format, filename);
-
- if (ldfile_try_open_bfd (full_string, entry))
- break;
- }
-
- if (!libname_fmt[i].format)
- {
- free (full_string);
- return FALSE;
- }
-
- entry->filename = full_string;
-
- return TRUE;
-}
-
-static int
-gld_${EMULATION_NAME}_find_potential_libraries
- (char *name, lang_input_statement_type *entry)
-{
- return ldfile_open_file_search (name, entry, "", ".lib");
-}
-
-static char *
-gld_${EMULATION_NAME}_get_script (int *isfile)
-EOF
-# Scripts compiled in.
-# sed commands to quote an ld script as a C string.
-sc="-f stringify.sed"
-
-fragment <<EOF
-{
- *isfile = 0;
-
- if (link_info.relocatable && config.build_constructors)
- return
-EOF
-sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
-if test -n "$GENERATE_AUTO_IMPORT_SCRIPT" ; then
-echo ' ; else if (link_info.pei386_auto_import == 1) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xa >> e${EMULATION_NAME}.c
-fi
-echo ' ; else return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
-echo '; }' >> e${EMULATION_NAME}.c
-
-fragment <<EOF
-
-
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
-{
- gld_${EMULATION_NAME}_before_parse,
- syslib_default,
- hll_default,
- gld_${EMULATION_NAME}_after_parse,
- gld_${EMULATION_NAME}_after_open,
- after_allocation_default,
- set_output_arch_default,
- ldemul_default_target,
- gld_${EMULATION_NAME}_before_allocation,
- gld_${EMULATION_NAME}_get_script,
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- gld_${EMULATION_NAME}_finish,
- NULL, /* Create output section statements. */
- gld_${EMULATION_NAME}_open_dynamic_archive,
- gld_${EMULATION_NAME}_place_orphan,
- gld_${EMULATION_NAME}_set_symbols,
- NULL, /* parse_args */
- gld${EMULATION_NAME}_add_options,
- gld${EMULATION_NAME}_handle_option,
- gld_${EMULATION_NAME}_unrecognized_file,
- gld_${EMULATION_NAME}_list_options,
- gld_${EMULATION_NAME}_recognized_file,
- gld_${EMULATION_NAME}_find_potential_libraries,
- NULL /* new_vers_pattern. */
-};
-EOF
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
deleted file mode 100644
index 2fae386650a..00000000000
--- a/ld/emultempl/pep.em
+++ /dev/null
@@ -1,1717 +0,0 @@
-# This shell script emits a C file. -*- C -*-
-# It does some substitutions.
-test -z "${ENTRY}" && ENTRY="_mainCRTStartup"
-if [ -z "$MACHINE" ]; then
- OUTPUT_ARCH=${ARCH}
-else
- OUTPUT_ARCH=${ARCH}:${MACHINE}
-fi
-rm -f e${EMULATION_NAME}.c
-(echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
-fragment <<EOF
-/* Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
- Written by Kai Tietz, OneVision Software GmbH&CoKg.
-
- This file is part of the GNU Binutils.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
-
-
-/* For WINDOWS_XP64 and higher */
-/* Based on pe.em, but modified for 64 bit support. */
-
-#define TARGET_IS_${EMULATION_NAME}
-
-#define COFF_IMAGE_WITH_PE
-#define COFF_WITH_PE
-#define COFF_WITH_pex64
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "bfdlink.h"
-#include "getopt.h"
-#include "libiberty.h"
-#include "ld.h"
-#include "ldmain.h"
-#include "ldexp.h"
-#include "ldlang.h"
-#include "ldfile.h"
-#include "ldemul.h"
-#include <ldgram.h>
-#include "ldlex.h"
-#include "ldmisc.h"
-#include "ldctor.h"
-#include "coff/internal.h"
-
-/* FIXME: See bfd/peXXigen.c for why we include an architecture specific
- header in generic PE code. */
-#include "coff/x86_64.h"
-#include "coff/pe.h"
-
-/* FIXME: This is a BFD internal header file, and we should not be
- using it here. */
-#include "../bfd/libcoff.h"
-
-#undef AOUTSZ
-#define AOUTSZ PEPAOUTSZ
-#define PEAOUTHDR PEPAOUTHDR
-
-#include "deffile.h"
-#include "pep-dll.h"
-#include "safe-ctype.h"
-
-/* Permit the emulation parameters to override the default section
- alignment by setting OVERRIDE_SECTION_ALIGNMENT. FIXME: This makes
- it seem that include/coff/internal.h should not define
- PE_DEF_SECTION_ALIGNMENT. */
-#if PE_DEF_SECTION_ALIGNMENT != ${OVERRIDE_SECTION_ALIGNMENT:-PE_DEF_SECTION_ALIGNMENT}
-#undef PE_DEF_SECTION_ALIGNMENT
-#define PE_DEF_SECTION_ALIGNMENT ${OVERRIDE_SECTION_ALIGNMENT}
-#endif
-
-#ifdef TARGET_IS_i386pep
-#define DLL_SUPPORT
-#endif
-
-#if defined(TARGET_IS_i386pep) || ! defined(DLL_SUPPORT)
-#define PE_DEF_SUBSYSTEM 3
-#else
-#undef NT_EXE_IMAGE_BASE
-#define NT_EXE_IMAGE_BASE 0x00010000
-#undef PE_DEF_SECTION_ALIGNMENT
-#define PE_DEF_SUBSYSTEM 2
-#undef PE_DEF_FILE_ALIGNMENT
-#define PE_DEF_FILE_ALIGNMENT 0x00000200
-#define PE_DEF_SECTION_ALIGNMENT 0x00000400
-#endif
-
-
-static struct internal_extra_pe_aouthdr pep;
-static int dll;
-static flagword real_flags = IMAGE_FILE_LARGE_ADDRESS_AWARE;
-static int support_old_code = 0;
-static lang_assignment_statement_type *image_base_statement = 0;
-
-#ifdef DLL_SUPPORT
-static int pep_enable_stdcall_fixup = 1; /* 0=disable 1=enable (default). */
-static char * pep_out_def_filename = NULL;
-static char * pep_implib_filename = NULL;
-static int pep_enable_auto_image_base = 0;
-static char * pep_dll_search_prefix = NULL;
-#endif
-
-extern const char *output_filename;
-
-static void
-gld_${EMULATION_NAME}_before_parse (void)
-{
- ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
- output_filename = "${EXECUTABLE_NAME:-a.exe}";
-#ifdef DLL_SUPPORT
- config.dynamic_link = TRUE;
- config.has_shared = 1;
- link_info.pei386_auto_import = -1;
- link_info.pei386_runtime_pseudo_reloc = -1;
-
-#if (PE_DEF_SUBSYSTEM == 9) || (PE_DEF_SUBSYSTEM == 2)
- lang_default_entry ("_WinMainCRTStartup");
-#else
- lang_default_entry ("${ENTRY}");
-#endif
-#endif
-}
-
-/* PE format extra command line options. */
-
-/* Used for setting flags in the PE header. */
-enum options
-{
- OPTION_BASE_FILE = 300 + 1,
- OPTION_DLL,
- OPTION_FILE_ALIGNMENT,
- OPTION_IMAGE_BASE,
- OPTION_MAJOR_IMAGE_VERSION,
- OPTION_MAJOR_OS_VERSION,
- OPTION_MAJOR_SUBSYSTEM_VERSION,
- OPTION_MINOR_IMAGE_VERSION,
- OPTION_MINOR_OS_VERSION,
- OPTION_MINOR_SUBSYSTEM_VERSION,
- OPTION_SECTION_ALIGNMENT,
- OPTION_STACK,
- OPTION_SUBSYSTEM,
- OPTION_HEAP,
- OPTION_SUPPORT_OLD_CODE,
- OPTION_OUT_DEF,
- OPTION_EXPORT_ALL,
- OPTION_EXCLUDE_SYMBOLS,
- OPTION_KILL_ATS,
- OPTION_STDCALL_ALIASES,
- OPTION_ENABLE_STDCALL_FIXUP,
- OPTION_DISABLE_STDCALL_FIXUP,
- OPTION_IMPLIB_FILENAME,
- OPTION_WARN_DUPLICATE_EXPORTS,
- OPTION_IMP_COMPAT,
- OPTION_ENABLE_AUTO_IMAGE_BASE,
- OPTION_DISABLE_AUTO_IMAGE_BASE,
- OPTION_DLL_SEARCH_PREFIX,
- OPTION_NO_DEFAULT_EXCLUDES,
- OPTION_DLL_ENABLE_AUTO_IMPORT,
- OPTION_DLL_DISABLE_AUTO_IMPORT,
- OPTION_ENABLE_EXTRA_PE_DEBUG,
- OPTION_EXCLUDE_LIBS,
- OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC,
- OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC
-};
-
-static void
-gld${EMULATION_NAME}_add_options
- (int ns ATTRIBUTE_UNUSED,
- char **shortopts ATTRIBUTE_UNUSED,
- int nl,
- struct option **longopts,
- int nrl ATTRIBUTE_UNUSED,
- struct option **really_longopts ATTRIBUTE_UNUSED)
-{
- static const struct option xtra_long[] =
- {
- /* PE options */
- {"base-file", required_argument, NULL, OPTION_BASE_FILE},
- {"dll", no_argument, NULL, OPTION_DLL},
- {"file-alignment", required_argument, NULL, OPTION_FILE_ALIGNMENT},
- {"heap", required_argument, NULL, OPTION_HEAP},
- {"image-base", required_argument, NULL, OPTION_IMAGE_BASE},
- {"major-image-version", required_argument, NULL, OPTION_MAJOR_IMAGE_VERSION},
- {"major-os-version", required_argument, NULL, OPTION_MAJOR_OS_VERSION},
- {"major-subsystem-version", required_argument, NULL, OPTION_MAJOR_SUBSYSTEM_VERSION},
- {"minor-image-version", required_argument, NULL, OPTION_MINOR_IMAGE_VERSION},
- {"minor-os-version", required_argument, NULL, OPTION_MINOR_OS_VERSION},
- {"minor-subsystem-version", required_argument, NULL, OPTION_MINOR_SUBSYSTEM_VERSION},
- {"section-alignment", required_argument, NULL, OPTION_SECTION_ALIGNMENT},
- {"stack", required_argument, NULL, OPTION_STACK},
- {"subsystem", required_argument, NULL, OPTION_SUBSYSTEM},
- {"support-old-code", no_argument, NULL, OPTION_SUPPORT_OLD_CODE},
-#ifdef DLL_SUPPORT
- /* getopt allows abbreviations, so we do this to stop it
- from treating -o as an abbreviation for this option. */
- {"output-def", required_argument, NULL, OPTION_OUT_DEF},
- {"output-def", required_argument, NULL, OPTION_OUT_DEF},
- {"export-all-symbols", no_argument, NULL, OPTION_EXPORT_ALL},
- {"exclude-symbols", required_argument, NULL, OPTION_EXCLUDE_SYMBOLS},
- {"exclude-libs", required_argument, NULL, OPTION_EXCLUDE_LIBS},
- {"kill-at", no_argument, NULL, OPTION_KILL_ATS},
- {"add-stdcall-alias", no_argument, NULL, OPTION_STDCALL_ALIASES},
- {"enable-stdcall-fixup", no_argument, NULL, OPTION_ENABLE_STDCALL_FIXUP},
- {"disable-stdcall-fixup", no_argument, NULL, OPTION_DISABLE_STDCALL_FIXUP},
- {"out-implib", required_argument, NULL, OPTION_IMPLIB_FILENAME},
- {"warn-duplicate-exports", no_argument, NULL, OPTION_WARN_DUPLICATE_EXPORTS},
- /* getopt() allows abbreviations, so we do this to stop it from
- treating -c as an abbreviation for these --compat-implib. */
- {"compat-implib", no_argument, NULL, OPTION_IMP_COMPAT},
- {"compat-implib", no_argument, NULL, OPTION_IMP_COMPAT},
- {"enable-auto-image-base", no_argument, NULL, OPTION_ENABLE_AUTO_IMAGE_BASE},
- {"disable-auto-image-base", no_argument, NULL, OPTION_DISABLE_AUTO_IMAGE_BASE},
- {"dll-search-prefix", required_argument, NULL, OPTION_DLL_SEARCH_PREFIX},
- {"no-default-excludes", no_argument, NULL, OPTION_NO_DEFAULT_EXCLUDES},
- {"enable-auto-import", no_argument, NULL, OPTION_DLL_ENABLE_AUTO_IMPORT},
- {"disable-auto-import", no_argument, NULL, OPTION_DLL_DISABLE_AUTO_IMPORT},
- {"enable-extra-pep-debug", no_argument, NULL, OPTION_ENABLE_EXTRA_PE_DEBUG},
- {"enable-runtime-pseudo-reloc", no_argument, NULL, OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC},
- {"disable-runtime-pseudo-reloc", no_argument, NULL, OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC},
-#endif
- {NULL, no_argument, NULL, 0}
- };
-
- *longopts = xrealloc (*longopts, nl * sizeof (struct option) + sizeof (xtra_long));
- memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
-}
-
-/* PE/WIN32; added routines to get the subsystem type, heap and/or stack
- parameters which may be input from the command line. */
-
-typedef struct
-{
- void *ptr;
- int size;
- bfd_vma value;
- char *symbol;
- int inited;
-} definfo;
-
-#define D(field,symbol,def) {&pep.field,sizeof(pep.field), def, symbol,0}
-
-static definfo init[] =
-{
- /* imagebase must be first */
-#define IMAGEBASEOFF 0
- D(ImageBase,"__image_base__", NT_EXE_IMAGE_BASE),
-#define DLLOFF 1
- {&dll, sizeof(dll), 0, "__dll__", 0},
-#define MSIMAGEBASEOFF 2
- D(ImageBase,"___ImageBase", NT_EXE_IMAGE_BASE),
- D(SectionAlignment,"__section_alignment__", PE_DEF_SECTION_ALIGNMENT),
- D(FileAlignment,"__file_alignment__", PE_DEF_FILE_ALIGNMENT),
- D(MajorOperatingSystemVersion,"__major_os_version__", 4),
- D(MinorOperatingSystemVersion,"__minor_os_version__", 0),
- D(MajorImageVersion,"__major_image_version__", 0),
- D(MinorImageVersion,"__minor_image_version__", 0),
- D(MajorSubsystemVersion,"__major_subsystem_version__", 5),
- D(MinorSubsystemVersion,"__minor_subsystem_version__", 2),
- D(Subsystem,"__subsystem__", ${SUBSYSTEM}),
- D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x200000),
- D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000),
- D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000),
- D(SizeOfHeapCommit,"__size_of_heap_commit__", 0x1000),
- D(LoaderFlags,"__loader_flags__", 0x0),
- { NULL, 0, 0, NULL, 0 }
-};
-
-
-static void
-gld_${EMULATION_NAME}_list_options (FILE *file)
-{
- fprintf (file, _(" --base_file <basefile> Generate a base file for relocatable DLLs\n"));
- fprintf (file, _(" --dll Set image base to the default for DLLs\n"));
- fprintf (file, _(" --file-alignment <size> Set file alignment\n"));
- fprintf (file, _(" --heap <size> Set initial size of the heap\n"));
- fprintf (file, _(" --image-base <address> Set start address of the executable\n"));
- fprintf (file, _(" --major-image-version <number> Set version number of the executable\n"));
- fprintf (file, _(" --major-os-version <number> Set minimum required OS version\n"));
- fprintf (file, _(" --major-subsystem-version <number> Set minimum required OS subsystem version\n"));
- fprintf (file, _(" --minor-image-version <number> Set revision number of the executable\n"));
- fprintf (file, _(" --minor-os-version <number> Set minimum required OS revision\n"));
- fprintf (file, _(" --minor-subsystem-version <number> Set minimum required OS subsystem revision\n"));
- fprintf (file, _(" --section-alignment <size> Set section alignment\n"));
- fprintf (file, _(" --stack <size> Set size of the initial stack\n"));
- fprintf (file, _(" --subsystem <name>[:<version>] Set required OS subsystem [& version]\n"));
- fprintf (file, _(" --support-old-code Support interworking with old code\n"));
-#ifdef DLL_SUPPORT
- fprintf (file, _(" --add-stdcall-alias Export symbols with and without @nn\n"));
- fprintf (file, _(" --disable-stdcall-fixup Don't link _sym to _sym@nn\n"));
- fprintf (file, _(" --enable-stdcall-fixup Link _sym to _sym@nn without warnings\n"));
- fprintf (file, _(" --exclude-symbols sym,sym,... Exclude symbols from automatic export\n"));
- fprintf (file, _(" --exclude-libs lib,lib,... Exclude libraries from automatic export\n"));
- fprintf (file, _(" --export-all-symbols Automatically export all globals to DLL\n"));
- fprintf (file, _(" --kill-at Remove @nn from exported symbols\n"));
- fprintf (file, _(" --out-implib <file> Generate import library\n"));
- fprintf (file, _(" --output-def <file> Generate a .DEF file for the built DLL\n"));
- fprintf (file, _(" --warn-duplicate-exports Warn about duplicate exports.\n"));
- fprintf (file, _(" --compat-implib Create backward compatible import libs;\n\
- create __imp_<SYMBOL> as well.\n"));
- fprintf (file, _(" --enable-auto-image-base Automatically choose image base for DLLs\n\
- unless user specifies one\n"));
- fprintf (file, _(" --disable-auto-image-base Do not auto-choose image base. (default)\n"));
- fprintf (file, _(" --dll-search-prefix=<string> When linking dynamically to a dll without\n\
- an importlib, use <string><basename>.dll\n\
- in preference to lib<basename>.dll \n"));
- fprintf (file, _(" --enable-auto-import Do sophistcated linking of _sym to\n\
- __imp_sym for DATA references\n"));
- fprintf (file, _(" --disable-auto-import Do not auto-import DATA items from DLLs\n"));
- fprintf (file, _(" --enable-runtime-pseudo-reloc Work around auto-import limitations by\n\
- adding pseudo-relocations resolved at\n\
- runtime.\n"));
- fprintf (file, _(" --disable-runtime-pseudo-reloc Do not add runtime pseudo-relocations for\n\
- auto-imported DATA.\n"));
- fprintf (file, _(" --enable-extra-pep-debug Enable verbose debug output when building\n\
- or linking to DLLs (esp. auto-import)\n"));
-#endif
-}
-
-
-static void
-set_pep_name (char *name, bfd_vma val)
-{
- int i;
-
- /* Find the name and set it. */
- for (i = 0; init[i].ptr; i++)
- {
- if (strcmp (name, init[i].symbol) == 0)
- {
- init[i].value = val;
- init[i].inited = 1;
- if (strcmp (name,"__image_base__") == 0)
- set_pep_name ("___ImageBase", val);
- return;
- }
- }
- abort ();
-}
-
-
-static void
-set_pep_subsystem (void)
-{
- const char *sver;
- const char *entry;
- const char *initial_symbol_char;
- char *end;
- int len;
- int i;
- int subsystem;
- unsigned long temp_subsystem;
- static const struct
- {
- const char *name;
- const int value;
- const char *entry;
- }
- v[] =
- {
- { "native", 1, "NtProcessStartup" },
- { "windows", 2, "WinMainCRTStartup" },
- { "console", 3, "mainCRTStartup" },
- { "posix", 7, "__PosixProcessStartup"},
- { "wince", 9, "_WinMainCRTStartup" },
- { "xbox", 14, "mainCRTStartup" },
- { NULL, 0, NULL }
- };
- /* Entry point name for arbitrary subsystem numbers. */
- static const char default_entry[] = "mainCRTStartup";
-
- /* Check for the presence of a version number. */
- sver = strchr (optarg, ':');
- if (sver == NULL)
- len = strlen (optarg);
- else
- {
- len = sver - optarg;
- set_pep_name ("__major_subsystem_version__",
- strtoul (sver + 1, &end, 0));
- if (*end == '.')
- set_pep_name ("__minor_subsystem_version__",
- strtoul (end + 1, &end, 0));
- if (*end != '\0')
- einfo (_("%P: warning: bad version number in -subsystem option\n"));
- }
-
- /* Check for numeric subsystem. */
- temp_subsystem = strtoul (optarg, & end, 0);
- if ((*end == ':' || *end == '\0') && (temp_subsystem < 65536))
- {
- /* Search list for a numeric match to use its entry point. */
- for (i = 0; v[i].name; i++)
- if (v[i].value == (int) temp_subsystem)
- break;
-
- /* If no match, use the default. */
- if (v[i].name != NULL)
- entry = v[i].entry;
- else
- entry = default_entry;
-
- /* Use this subsystem. */
- subsystem = (int) temp_subsystem;
- }
- else
- {
- /* Search for subsystem by name. */
- for (i = 0; v[i].name; i++)
- if (strncmp (optarg, v[i].name, len) == 0
- && v[i].name[len] == '\0')
- break;
-
- if (v[i].name == NULL)
- {
- einfo (_("%P%F: invalid subsystem type %s\n"), optarg);
- return;
- }
-
- entry = v[i].entry;
- subsystem = v[i].value;
- }
-
- set_pep_name ("__subsystem__", subsystem);
-
- initial_symbol_char = ${INITIAL_SYMBOL_CHAR};
- if (*initial_symbol_char != '\0')
- {
- char *alc_entry;
-
- /* lang_default_entry expects its argument to be permanently
- allocated, so we don't free this string. */
- alc_entry = xmalloc (strlen (initial_symbol_char)
- + strlen (entry)
- + 1);
- strcpy (alc_entry, initial_symbol_char);
- strcat (alc_entry, entry);
- entry = alc_entry;
- }
-
- lang_default_entry (entry);
-
- return;
-}
-
-
-static void
-set_pep_value (char *name)
-{
- char *end;
-
- set_pep_name (name, (bfd_vma) strtoull (optarg, &end, 0));
-
- if (end == optarg)
- einfo (_("%P%F: invalid hex number for PE parameter '%s'\n"), optarg);
-
- optarg = end;
-}
-
-
-static void
-set_pep_stack_heap (char *resname, char *comname)
-{
- set_pep_value (resname);
-
- if (*optarg == ',')
- {
- optarg++;
- set_pep_value (comname);
- }
- else if (*optarg)
- einfo (_("%P%F: strange hex info for PE parameter '%s'\n"), optarg);
-}
-
-
-static bfd_boolean
-gld${EMULATION_NAME}_handle_option (int optc)
-{
- switch (optc)
- {
- default:
- return FALSE;
-
- case OPTION_BASE_FILE:
- link_info.base_file = fopen (optarg, FOPEN_WB);
- if (link_info.base_file == NULL)
- {
- /* xgettext:c-format */
- fprintf (stderr, _("%s: Can't open base file %s\n"),
- program_name, optarg);
- xexit (1);
- }
- break;
-
- /* PE options. */
- case OPTION_HEAP:
- set_pep_stack_heap ("__size_of_heap_reserve__", "__size_of_heap_commit__");
- break;
- case OPTION_STACK:
- set_pep_stack_heap ("__size_of_stack_reserve__", "__size_of_stack_commit__");
- break;
- case OPTION_SUBSYSTEM:
- set_pep_subsystem ();
- break;
- case OPTION_MAJOR_OS_VERSION:
- set_pep_value ("__major_os_version__");
- break;
- case OPTION_MINOR_OS_VERSION:
- set_pep_value ("__minor_os_version__");
- break;
- case OPTION_MAJOR_SUBSYSTEM_VERSION:
- set_pep_value ("__major_subsystem_version__");
- break;
- case OPTION_MINOR_SUBSYSTEM_VERSION:
- set_pep_value ("__minor_subsystem_version__");
- break;
- case OPTION_MAJOR_IMAGE_VERSION:
- set_pep_value ("__major_image_version__");
- break;
- case OPTION_MINOR_IMAGE_VERSION:
- set_pep_value ("__minor_image_version__");
- break;
- case OPTION_FILE_ALIGNMENT:
- set_pep_value ("__file_alignment__");
- break;
- case OPTION_SECTION_ALIGNMENT:
- set_pep_value ("__section_alignment__");
- break;
- case OPTION_DLL:
- set_pep_name ("__dll__", 1);
- break;
- case OPTION_IMAGE_BASE:
- set_pep_value ("__image_base__");
- break;
- case OPTION_SUPPORT_OLD_CODE:
- support_old_code = 1;
- break;
-#ifdef DLL_SUPPORT
- case OPTION_OUT_DEF:
- pep_out_def_filename = xstrdup (optarg);
- break;
- case OPTION_EXPORT_ALL:
- pep_dll_export_everything = 1;
- break;
- case OPTION_EXCLUDE_SYMBOLS:
- pep_dll_add_excludes (optarg, 0);
- break;
- case OPTION_EXCLUDE_LIBS:
- pep_dll_add_excludes (optarg, 1);
- break;
- case OPTION_KILL_ATS:
- pep_dll_kill_ats = 1;
- break;
- case OPTION_STDCALL_ALIASES:
- pep_dll_stdcall_aliases = 1;
- break;
- case OPTION_ENABLE_STDCALL_FIXUP:
- pep_enable_stdcall_fixup = 1;
- break;
- case OPTION_DISABLE_STDCALL_FIXUP:
- pep_enable_stdcall_fixup = 0;
- break;
- case OPTION_IMPLIB_FILENAME:
- pep_implib_filename = xstrdup (optarg);
- break;
- case OPTION_WARN_DUPLICATE_EXPORTS:
- pep_dll_warn_dup_exports = 1;
- break;
- case OPTION_IMP_COMPAT:
- pep_dll_compat_implib = 1;
- break;
- case OPTION_ENABLE_AUTO_IMAGE_BASE:
- pep_enable_auto_image_base = 1;
- break;
- case OPTION_DISABLE_AUTO_IMAGE_BASE:
- pep_enable_auto_image_base = 0;
- break;
- case OPTION_DLL_SEARCH_PREFIX:
- pep_dll_search_prefix = xstrdup (optarg);
- break;
- case OPTION_NO_DEFAULT_EXCLUDES:
- pep_dll_do_default_excludes = 0;
- break;
- case OPTION_DLL_ENABLE_AUTO_IMPORT:
- link_info.pei386_auto_import = 1;
- break;
- case OPTION_DLL_DISABLE_AUTO_IMPORT:
- link_info.pei386_auto_import = 0;
- break;
- case OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC:
- link_info.pei386_runtime_pseudo_reloc = 1;
- break;
- case OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC:
- link_info.pei386_runtime_pseudo_reloc = 0;
- break;
- case OPTION_ENABLE_EXTRA_PE_DEBUG:
- pep_dll_extra_pe_debug = 1;
- break;
-#endif
- }
- return TRUE;
-}
-
-
-#ifdef DLL_SUPPORT
-static unsigned long
-strhash (const char *str)
-{
- const unsigned char *s;
- unsigned long hash;
- unsigned int c;
- unsigned int len;
-
- hash = 0;
- len = 0;
- s = (const unsigned char *) str;
- while ((c = *s++) != '\0')
- {
- hash += c + (c << 17);
- hash ^= hash >> 2;
- ++len;
- }
- hash += len + (len << 17);
- hash ^= hash >> 2;
-
- return hash;
-}
-
-/* Use the output file to create a image base for relocatable DLLs. */
-
-static bfd_vma
-compute_dll_image_base (const char *ofile)
-{
- bfd_vma hash = (bfd_vma) strhash (ofile);
- return 0x61300000 + ((hash << 16) & 0x0FFC0000);
-}
-#endif
-
-/* Assign values to the special symbols before the linker script is
- read. */
-
-static void
-gld_${EMULATION_NAME}_set_symbols (void)
-{
- /* Run through and invent symbols for all the
- names and insert the defaults. */
- int j;
- lang_statement_list_type *save;
-
- if (!init[IMAGEBASEOFF].inited)
- {
- if (link_info.relocatable)
- init[IMAGEBASEOFF].value = 0;
- else if (init[DLLOFF].value || (link_info.shared && !link_info.pie))
-#ifdef DLL_SUPPORT
- init[IMAGEBASEOFF].value = (pep_enable_auto_image_base) ?
- compute_dll_image_base (output_filename) : NT_DLL_IMAGE_BASE;
-#else
- init[IMAGEBASEOFF].value = NT_DLL_IMAGE_BASE;
-#endif
- else
- init[IMAGEBASEOFF].value = NT_EXE_IMAGE_BASE;
- init[MSIMAGEBASEOFF].value = init[IMAGEBASEOFF].value;
- }
-
- /* Don't do any symbol assignments if this is a relocatable link. */
- if (link_info.relocatable)
- return;
-
- /* Glue the assignments into the abs section. */
- save = stat_ptr;
-
- stat_ptr = &(abs_output_section->children);
-
- for (j = 0; init[j].ptr; j++)
- {
- bfd_vma val = init[j].value;
- lang_assignment_statement_type *rv;
- rv = lang_add_assignment (exp_assop ('=', init[j].symbol,
- exp_intop (val)));
- if (init[j].size == sizeof (short))
- *(short *) init[j].ptr = (short) val;
- else if (init[j].size == sizeof (int))
- *(int *) init[j].ptr = (int) val;
- else if (init[j].size == sizeof (long))
- *(long *) init[j].ptr = (long) val;
- /* This might be a long long or other special type. */
- else if (init[j].size == sizeof (bfd_vma))
- *(bfd_vma *) init[j].ptr = val;
- else abort ();
- if (j == IMAGEBASEOFF)
- image_base_statement = rv;
- }
- /* Restore the pointer. */
- stat_ptr = save;
-
- if (pep.FileAlignment > pep.SectionAlignment)
- {
- einfo (_("%P: warning, file alignment > section alignment.\n"));
- }
-}
-
-/* This is called after the linker script and the command line options
- have been read. */
-
-static void
-gld_${EMULATION_NAME}_after_parse (void)
-{
- /* The Windows libraries are designed for the linker to treat the
- entry point as an undefined symbol. Otherwise, the .obj that
- defines mainCRTStartup is brought in because it is the first
- encountered in libc.lib and it has other symbols in it which will
- be pulled in by the link process. To avoid this, we act as
- though the user specified -u with the entry point symbol.
-
- This function is called after the linker script and command line
- options have been read, so at this point we know the right entry
- point. This function is called before the input files are
- opened, so registering the symbol as undefined will make a
- difference. */
-
- if (! link_info.relocatable && entry_symbol.name != NULL)
- ldlang_add_undef (entry_symbol.name);
-}
-
-/* pep-dll.c directly accesses pep_data_import_dll,
- so it must be defined outside of #ifdef DLL_SUPPORT.
- Note - this variable is deliberately not initialised.
- This allows it to be treated as a common varaible, and only
- exist in one incarnation in a multiple target enabled linker. */
-char * pep_data_import_dll;
-
-#ifdef DLL_SUPPORT
-static struct bfd_link_hash_entry *pep_undef_found_sym;
-
-static bfd_boolean
-pep_undef_cdecl_match (struct bfd_link_hash_entry *h, void *inf)
-{
- int sl;
- char *string = inf;
-
- sl = strlen (string);
- if (h->type == bfd_link_hash_defined
- && strncmp (h->root.string, string, sl) == 0
- && h->root.string[sl] == '@')
- {
- pep_undef_found_sym = h;
- return FALSE;
- }
- return TRUE;
-}
-
-static void
-pep_fixup_stdcalls (void)
-{
- static int gave_warning_message = 0;
- struct bfd_link_hash_entry *undef, *sym;
-
- if (pep_dll_extra_pe_debug)
- printf ("%s\n", __FUNCTION__);
-
- for (undef = link_info.hash->undefs; undef; undef=undef->u.undef.next)
- if (undef->type == bfd_link_hash_undefined)
- {
- char* at = strchr (undef->root.string, '@');
- int lead_at = (*undef->root.string == '@');
- /* For now, don't try to fixup fastcall symbols. */
-
- if (at && !lead_at)
- {
- /* The symbol is a stdcall symbol, so let's look for a
- cdecl symbol with the same name and resolve to that. */
- char *cname = xstrdup (undef->root.string /* + lead_at */);
- at = strchr (cname, '@');
- *at = 0;
- sym = bfd_link_hash_lookup (link_info.hash, cname, 0, 0, 1);
-
- if (sym && sym->type == bfd_link_hash_defined)
- {
- undef->type = bfd_link_hash_defined;
- undef->u.def.value = sym->u.def.value;
- undef->u.def.section = sym->u.def.section;
-
- if (pep_enable_stdcall_fixup == -1)
- {
- einfo (_("Warning: resolving %s by linking to %s\n"),
- undef->root.string, cname);
- if (! gave_warning_message)
- {
- gave_warning_message = 1;
- einfo (_("Use --enable-stdcall-fixup to disable these warnings\n"));
- einfo (_("Use --disable-stdcall-fixup to disable these fixups\n"));
- }
- }
- }
- }
- else
- {
- /* The symbol is a cdecl symbol, so we look for stdcall
- symbols - which means scanning the whole symbol table. */
- pep_undef_found_sym = 0;
- bfd_link_hash_traverse (link_info.hash, pep_undef_cdecl_match,
- (char *) undef->root.string);
- sym = pep_undef_found_sym;
- if (sym)
- {
- undef->type = bfd_link_hash_defined;
- undef->u.def.value = sym->u.def.value;
- undef->u.def.section = sym->u.def.section;
-
- if (pep_enable_stdcall_fixup == -1)
- {
- einfo (_("Warning: resolving %s by linking to %s\n"),
- undef->root.string, sym->root.string);
- if (! gave_warning_message)
- {
- gave_warning_message = 1;
- einfo (_("Use --enable-stdcall-fixup to disable these warnings\n"));
- einfo (_("Use --disable-stdcall-fixup to disable these fixups\n"));
- }
- }
- }
- }
- }
-}
-
-static int
-make_import_fixup (arelent *rel, asection *s)
-{
- struct bfd_symbol *sym = *rel->sym_ptr_ptr;
- char addend[4];
-
- if (pep_dll_extra_pe_debug)
- printf ("arelent: %s@%#lx: add=%li\n", sym->name,
- (unsigned long) rel->address, (long) rel->addend);
-
- if (! bfd_get_section_contents (s->owner, s, addend, rel->address, sizeof (addend)))
- einfo (_("%C: Cannot get section contents - auto-import exception\n"),
- s->owner, s, rel->address);
-
- pep_create_import_fixup (rel, s, bfd_get_32 (s->owner, addend));
-
- return 1;
-}
-
-static void
-pep_find_data_imports (void)
-{
- struct bfd_link_hash_entry *undef, *sym;
-
- if (link_info.pei386_auto_import == 0)
- return;
-
- for (undef = link_info.hash->undefs; undef; undef=undef->u.undef.next)
- {
- if (undef->type == bfd_link_hash_undefined)
- {
- /* C++ symbols are *long*. */
- char buf[4096];
-
- if (pep_dll_extra_pe_debug)
- printf ("%s:%s\n", __FUNCTION__, undef->root.string);
-
- sprintf (buf, "__imp_%s", undef->root.string);
-
- sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1);
-
- if (sym && sym->type == bfd_link_hash_defined)
- {
- bfd *b = sym->u.def.section->owner;
- asymbol **symbols;
- int nsyms, symsize, i;
-
- if (link_info.pei386_auto_import == -1)
- {
- static bfd_boolean warned = FALSE;
-
- info_msg (_("Info: resolving %s by linking to %s (auto-import)\n"),
- undef->root.string, buf);
-
- /* PR linker/4844. */
- if (! warned)
- {
- warned = TRUE;
- einfo (_("%P: warning: auto-importing has been activated without --enable-auto-import specified on the command line.\n\
-This should work unless it involves constant data structures referencing symbols from auto-imported DLLs."));
- }
- }
-
- symsize = bfd_get_symtab_upper_bound (b);
- symbols = xmalloc (symsize);
- nsyms = bfd_canonicalize_symtab (b, symbols);
-
- for (i = 0; i < nsyms; i++)
- {
- if (! CONST_STRNEQ (symbols[i]->name, "__head_"))
- continue;
-
- if (pep_dll_extra_pe_debug)
- printf ("->%s\n", symbols[i]->name);
-
- pep_data_import_dll = (char*) (symbols[i]->name +
- sizeof ("__head_") - 1);
- break;
- }
-
- pep_walk_relocs_of_symbol (&link_info, undef->root.string,
- make_import_fixup);
-
- /* Let's differentiate it somehow from defined. */
- undef->type = bfd_link_hash_defweak;
- /* We replace original name with __imp_ prefixed, this
- 1) may trash memory 2) leads to duplicate symbol generation.
- Still, IMHO it's better than having name poluted. */
- undef->root.string = sym->root.string;
- undef->u.def.value = sym->u.def.value;
- undef->u.def.section = sym->u.def.section;
- }
- }
- }
-}
-
-static bfd_boolean
-pr_sym (struct bfd_hash_entry *h, void *inf ATTRIBUTE_UNUSED)
-{
- if (pep_dll_extra_pe_debug)
- printf ("+%s\n", h->string);
-
- return TRUE;
-}
-#endif /* DLL_SUPPORT */
-
-
-static void
-gld_${EMULATION_NAME}_after_open (void)
-{
-#ifdef DLL_SUPPORT
- if (pep_dll_extra_pe_debug)
- {
- bfd *a;
- struct bfd_link_hash_entry *sym;
-
- printf ("%s()\n", __FUNCTION__);
-
- for (sym = link_info.hash->undefs; sym; sym=sym->u.undef.next)
- printf ("-%s\n", sym->root.string);
- bfd_hash_traverse (&link_info.hash->table, pr_sym, NULL);
-
- for (a = link_info.input_bfds; a; a = a->link_next)
- printf ("*%s\n",a->filename);
- }
-#endif
-
- /* Pass the wacky PE command line options into the output bfd.
- FIXME: This should be done via a function, rather than by
- including an internal BFD header. */
-
- if (coff_data (link_info.output_bfd) == NULL
- || coff_data (link_info.output_bfd)->pe == 0)
- einfo (_("%F%P: cannot perform PE operations on non PE output file '%B'.\n"),
- link_info.output_bfd);
-
- pe_data (link_info.output_bfd)->pe_opthdr = pep;
- pe_data (link_info.output_bfd)->dll = init[DLLOFF].value;
- pe_data (link_info.output_bfd)->real_flags |= real_flags;
-
-#ifdef DLL_SUPPORT
- if (pep_enable_stdcall_fixup) /* -1=warn or 1=disable */
- pep_fixup_stdcalls ();
-
- pep_process_import_defs (link_info.output_bfd, &link_info);
-
- pep_find_data_imports ();
-
-#ifndef TARGET_IS_i386pep
- if (link_info.shared)
-#else
- if (!link_info.relocatable)
-#endif
- pep_dll_build_sections (link_info.output_bfd, &link_info);
-
-#ifndef TARGET_IS_i386pep
- else
- pep_exe_build_sections (link_info.output_bfd, &link_info);
-#endif
-#endif /* DLL_SUPPORT */
-
- {
- /* This next chunk of code tries to detect the case where you have
- two import libraries for the same DLL (specifically,
- symbolically linking libm.a and libc.a in cygwin to
- libcygwin.a). In those cases, it's possible for function
- thunks from the second implib to be used but without the
- head/tail objects, causing an improper import table. We detect
- those cases and rename the "other" import libraries to match
- the one the head/tail come from, so that the linker will sort
- things nicely and produce a valid import table. */
-
- LANG_FOR_EACH_INPUT_STATEMENT (is)
- {
- if (is->the_bfd->my_archive)
- {
- int idata2 = 0, reloc_count=0, is_imp = 0;
- asection *sec;
-
- /* See if this is an import library thunk. */
- for (sec = is->the_bfd->sections; sec; sec = sec->next)
- {
- if (strcmp (sec->name, ".idata\$2") == 0)
- idata2 = 1;
- if (CONST_STRNEQ (sec->name, ".idata\$"))
- is_imp = 1;
- reloc_count += sec->reloc_count;
- }
-
- if (is_imp && !idata2 && reloc_count)
- {
- /* It is, look for the reference to head and see if it's
- from our own library. */
- for (sec = is->the_bfd->sections; sec; sec = sec->next)
- {
- int i;
- long symsize;
- long relsize;
- asymbol **symbols;
- arelent **relocs;
- int nrelocs;
-
- symsize = bfd_get_symtab_upper_bound (is->the_bfd);
- if (symsize < 1)
- break;
- relsize = bfd_get_reloc_upper_bound (is->the_bfd, sec);
- if (relsize < 1)
- break;
-
- symbols = xmalloc (symsize);
- symsize = bfd_canonicalize_symtab (is->the_bfd, symbols);
- if (symsize < 0)
- {
- einfo ("%X%P: unable to process symbols: %E");
- return;
- }
-
- relocs = xmalloc ((size_t) relsize);
- nrelocs = bfd_canonicalize_reloc (is->the_bfd, sec,
- relocs, symbols);
- if (nrelocs < 0)
- {
- free (relocs);
- einfo ("%X%P: unable to process relocs: %E");
- return;
- }
-
- for (i = 0; i < nrelocs; i++)
- {
- struct bfd_symbol *s;
- struct bfd_link_hash_entry * blhe;
- char *other_bfd_filename;
- char *n;
-
- s = (relocs[i]->sym_ptr_ptr)[0];
-
- if (s->flags & BSF_LOCAL)
- continue;
-
- /* Thunk section with reloc to another bfd. */
- blhe = bfd_link_hash_lookup (link_info.hash,
- s->name,
- FALSE, FALSE, TRUE);
-
- if (blhe == NULL
- || blhe->type != bfd_link_hash_defined)
- continue;
-
- other_bfd_filename
- = blhe->u.def.section->owner->my_archive
- ? bfd_get_filename (blhe->u.def.section->owner->my_archive)
- : bfd_get_filename (blhe->u.def.section->owner);
-
- if (strcmp (bfd_get_filename (is->the_bfd->my_archive),
- other_bfd_filename) == 0)
- continue;
-
- /* Rename this implib to match the other one. */
- n = xmalloc (strlen (other_bfd_filename) + 1);
- strcpy (n, other_bfd_filename);
- is->the_bfd->my_archive->filename = n;
- }
-
- free (relocs);
- /* Note - we do not free the symbols,
- they are now cached in the BFD. */
- }
- }
- }
- }
- }
-
- {
- int is_ms_arch = 0;
- bfd *cur_arch = 0;
- lang_input_statement_type *is2;
- lang_input_statement_type *is3;
-
- /* Careful - this is a shell script. Watch those dollar signs! */
- /* Microsoft import libraries have every member named the same,
- and not in the right order for us to link them correctly. We
- must detect these and rename the members so that they'll link
- correctly. There are three types of objects: the head, the
- thunks, and the sentinel(s). The head is easy; it's the one
- with idata2. We assume that the sentinels won't have relocs,
- and the thunks will. It's easier than checking the symbol
- table for external references. */
- LANG_FOR_EACH_INPUT_STATEMENT (is)
- {
- if (is->the_bfd->my_archive)
- {
- char *pnt;
- bfd *arch = is->the_bfd->my_archive;
-
- if (cur_arch != arch)
- {
- cur_arch = arch;
- is_ms_arch = 1;
-
- for (is3 = is;
- is3 && is3->the_bfd->my_archive == arch;
- is3 = (lang_input_statement_type *) is3->next)
- {
- /* A MS dynamic import library can also contain static
- members, so look for the first element with a .dll
- extension, and use that for the remainder of the
- comparisons. */
- pnt = strrchr (is3->the_bfd->filename, '.');
- if (pnt != NULL && strcmp (pnt, ".dll") == 0)
- break;
- }
-
- if (is3 == NULL)
- is_ms_arch = 0;
- else
- {
- /* OK, found one. Now look to see if the remaining
- (dynamic import) members use the same name. */
- for (is2 = is;
- is2 && is2->the_bfd->my_archive == arch;
- is2 = (lang_input_statement_type *) is2->next)
- {
- /* Skip static members, ie anything with a .obj
- extension. */
- pnt = strrchr (is2->the_bfd->filename, '.');
- if (pnt != NULL && strcmp (pnt, ".obj") == 0)
- continue;
-
- if (strcmp (is3->the_bfd->filename,
- is2->the_bfd->filename))
- {
- is_ms_arch = 0;
- break;
- }
- }
- }
- }
-
- /* This fragment might have come from an .obj file in a Microsoft
- import, and not an actual import record. If this is the case,
- then leave the filename alone. */
- pnt = strrchr (is->the_bfd->filename, '.');
-
- if (is_ms_arch && (strcmp (pnt, ".dll") == 0))
- {
- int idata2 = 0, reloc_count=0;
- asection *sec;
- char *new_name, seq;
-
- for (sec = is->the_bfd->sections; sec; sec = sec->next)
- {
- if (strcmp (sec->name, ".idata\$2") == 0)
- idata2 = 1;
- reloc_count += sec->reloc_count;
- }
-
- if (idata2) /* .idata2 is the TOC */
- seq = 'a';
- else if (reloc_count > 0) /* thunks */
- seq = 'b';
- else /* sentinel */
- seq = 'c';
-
- new_name = xmalloc (strlen (is->the_bfd->filename) + 3);
- sprintf (new_name, "%s.%c", is->the_bfd->filename, seq);
- is->the_bfd->filename = new_name;
-
- new_name = xmalloc (strlen (is->filename) + 3);
- sprintf (new_name, "%s.%c", is->filename, seq);
- is->filename = new_name;
- }
- }
- }
- }
-}
-
-static void
-gld_${EMULATION_NAME}_before_allocation (void)
-{
- before_allocation_default ();
-}
-
-#ifdef DLL_SUPPORT
-/* This is called when an input file isn't recognized as a BFD. We
- check here for .DEF files and pull them in automatically. */
-
-static int
-saw_option (char *option)
-{
- int i;
-
- for (i = 0; init[i].ptr; i++)
- if (strcmp (init[i].symbol, option) == 0)
- return init[i].inited;
- return 0;
-}
-#endif /* DLL_SUPPORT */
-
-static bfd_boolean
-gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
-{
-#ifdef DLL_SUPPORT
- const char *ext = entry->filename + strlen (entry->filename) - 4;
-
- if (strcmp (ext, ".def") == 0 || strcmp (ext, ".DEF") == 0)
- {
- pep_def_file = def_file_parse (entry->filename, pep_def_file);
-
- if (pep_def_file)
- {
- int i, buflen=0, len;
- char *buf;
-
- for (i = 0; i < pep_def_file->num_exports; i++)
- {
- len = strlen (pep_def_file->exports[i].internal_name);
- if (buflen < len + 2)
- buflen = len + 2;
- }
-
- buf = xmalloc (buflen);
-
- for (i = 0; i < pep_def_file->num_exports; i++)
- {
- struct bfd_link_hash_entry *h;
-
- sprintf (buf, "_%s", pep_def_file->exports[i].internal_name);
-
- h = bfd_link_hash_lookup (link_info.hash, buf, TRUE, TRUE, TRUE);
- if (h == (struct bfd_link_hash_entry *) NULL)
- einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n"));
- if (h->type == bfd_link_hash_new)
- {
- h->type = bfd_link_hash_undefined;
- h->u.undef.abfd = NULL;
- bfd_link_add_undef (link_info.hash, h);
- }
- }
- free (buf);
-
- /* def_file_print (stdout, pep_def_file); */
- if (pep_def_file->is_dll == 1)
- link_info.shared = 1;
-
- if (pep_def_file->base_address != (bfd_vma)(-1))
- {
- pep.ImageBase
- = pe_data (link_info.output_bfd)->pe_opthdr.ImageBase
- = init[IMAGEBASEOFF].value
- = pep_def_file->base_address;
- init[IMAGEBASEOFF].inited = 1;
- if (image_base_statement)
- image_base_statement->exp = exp_assop ('=', "__image_base__",
- exp_intop (pep.ImageBase));
- }
-
- if (pep_def_file->stack_reserve != -1
- && ! saw_option ("__size_of_stack_reserve__"))
- {
- pep.SizeOfStackReserve = pep_def_file->stack_reserve;
- if (pep_def_file->stack_commit != -1)
- pep.SizeOfStackCommit = pep_def_file->stack_commit;
- }
- if (pep_def_file->heap_reserve != -1
- && ! saw_option ("__size_of_heap_reserve__"))
- {
- pep.SizeOfHeapReserve = pep_def_file->heap_reserve;
- if (pep_def_file->heap_commit != -1)
- pep.SizeOfHeapCommit = pep_def_file->heap_commit;
- }
- return TRUE;
- }
- }
-#endif
- return FALSE;
-}
-
-static bfd_boolean
-gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
-{
-#ifdef DLL_SUPPORT
-#ifdef TARGET_IS_i386pep
- pep_dll_id_target ("pei-x86-64");
-#endif
- if (pep_bfd_is_dll (entry->the_bfd))
- return pep_implied_import_dll (entry->filename);
-#endif
- return FALSE;
-}
-
-static void
-gld_${EMULATION_NAME}_finish (void)
-{
- finish_default ();
-
-#ifdef DLL_SUPPORT
- if (link_info.shared
- || (!link_info.relocatable && pep_def_file->num_exports != 0))
- {
- pep_dll_fill_sections (link_info.output_bfd, &link_info);
- if (pep_implib_filename)
- pep_dll_generate_implib (pep_def_file, pep_implib_filename);
- }
-
- if (pep_out_def_filename)
- pep_dll_generate_def_file (pep_out_def_filename);
-#endif /* DLL_SUPPORT */
-
- /* I don't know where .idata gets set as code, but it shouldn't be. */
- {
- asection *asec = bfd_get_section_by_name (link_info.output_bfd, ".idata");
-
- if (asec)
- {
- asec->flags &= ~SEC_CODE;
- asec->flags |= SEC_DATA;
- }
- }
-}
-
-
-/* Place an orphan section.
-
- We use this to put sections in a reasonable place in the file, and
- to ensure that they are aligned as required.
-
- We handle grouped sections here as well. A section named .foo$nn
- goes into the output section .foo. All grouped sections are sorted
- by name.
-
- Grouped sections for the default sections are handled by the
- default linker script using wildcards, and are sorted by
- sort_sections. */
-
-static bfd_boolean
-gld_${EMULATION_NAME}_place_orphan (asection *s)
-{
- const char *secname;
- const char *orig_secname;
- char *dollar = NULL;
- lang_output_section_statement_type *os;
- lang_statement_list_type add_child;
-
- secname = bfd_get_section_name (s->owner, s);
-
- /* Look through the script to see where to place this section. */
- orig_secname = secname;
- if (!link_info.relocatable
- && (dollar = strchr (secname, '$')) != NULL)
- {
- size_t len = dollar - orig_secname;
- char *newname = xmalloc (len + 1);
- memcpy (newname, orig_secname, len);
- newname[len] = '\0';
- secname = newname;
- }
-
- os = lang_output_section_find (secname);
-
- lang_list_init (&add_child);
-
- if (os != NULL
- && (os->bfd_section == NULL
- || os->bfd_section->flags == 0
- || ((s->flags ^ os->bfd_section->flags)
- & (SEC_LOAD | SEC_ALLOC)) == 0))
- {
- /* We already have an output section statement with this
- name, and its bfd section, if any, has compatible flags.
- If the section already exists but does not have any flags set,
- then it has been created by the linker, probably as a result of
- a --section-start command line switch. */
- lang_add_section (&add_child, s, os);
- }
- else
- {
- static struct orphan_save hold[] =
- {
- { ".text",
- SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE,
- 0, 0, 0, 0 },
- { ".rdata",
- SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
- 0, 0, 0, 0 },
- { ".data",
- SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_DATA,
- 0, 0, 0, 0 },
- { ".bss",
- SEC_ALLOC,
- 0, 0, 0, 0 }
- };
- enum orphan_save_index
- {
- orphan_text = 0,
- orphan_rodata,
- orphan_data,
- orphan_bss
- };
- static int orphan_init_done = 0;
- struct orphan_save *place;
- lang_output_section_statement_type *after;
- etree_type *address;
-
- if (!orphan_init_done)
- {
- struct orphan_save *ho;
- for (ho = hold; ho < hold + sizeof (hold) / sizeof (hold[0]); ++ho)
- if (ho->name != NULL)
- {
- ho->os = lang_output_section_find (ho->name);
- if (ho->os != NULL && ho->os->flags == 0)
- ho->os->flags = ho->flags;
- }
- orphan_init_done = 1;
- }
-
- /* Try to put the new output section in a reasonable place based
- on the section name and section flags. */
-
- place = NULL;
- if ((s->flags & SEC_ALLOC) == 0)
- ;
- else if ((s->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
- place = &hold[orphan_bss];
- else if ((s->flags & SEC_READONLY) == 0)
- place = &hold[orphan_data];
- else if ((s->flags & SEC_CODE) == 0)
- place = &hold[orphan_rodata];
- else
- place = &hold[orphan_text];
-
- after = NULL;
- if (place != NULL)
- {
- if (place->os == NULL)
- place->os = lang_output_section_find (place->name);
- after = place->os;
- if (after == NULL)
- after = lang_output_section_find_by_flags (s, &place->os, NULL);
- if (after == NULL)
- /* *ABS* is always the first output section statement. */
- after = (&lang_output_section_statement.head
- ->output_section_statement);
- }
-
- /* Choose a unique name for the section. This will be needed if the
- same section name appears in the input file with different
- loadable or allocatable characteristics. */
- if (bfd_get_section_by_name (link_info.output_bfd, secname) != NULL)
- {
- static int count = 1;
- secname = bfd_get_unique_section_name (link_info.output_bfd,
- secname, &count);
- if (secname == NULL)
- einfo ("%F%P: place_orphan failed: %E\n");
- }
-
- /* All sections in an executable must be aligned to a page boundary. */
- address = exp_unop (ALIGN_K, exp_nameop (NAME, "__section_alignment__"));
- os = lang_insert_orphan (s, secname, after, place, address, &add_child);
- }
-
- {
- lang_statement_union_type **pl = &os->children.head;
-
- if (dollar != NULL)
- {
- bfd_boolean found_dollar;
-
- /* The section name has a '$'. Sort it with the other '$'
- sections. */
- found_dollar = FALSE;
- for ( ; *pl != NULL; pl = &(*pl)->header.next)
- {
- lang_input_section_type *ls;
- const char *lname;
-
- if ((*pl)->header.type != lang_input_section_enum)
- continue;
-
- ls = &(*pl)->input_section;
-
- lname = bfd_get_section_name (ls->section->owner, ls->section);
- if (strchr (lname, '$') == NULL)
- {
- if (found_dollar)
- break;
- }
- else
- {
- found_dollar = TRUE;
- if (strcmp (orig_secname, lname) < 0)
- break;
- }
- }
- }
-
- if (add_child.head != NULL)
- {
- add_child.head->header.next = *pl;
- *pl = add_child.head;
- }
- }
-
- return TRUE;
-}
-
-static bfd_boolean
-gld_${EMULATION_NAME}_open_dynamic_archive
- (const char *arch ATTRIBUTE_UNUSED,
- search_dirs_type *search,
- lang_input_statement_type *entry)
-{
- static const struct
- {
- const char * format;
- bfd_boolean use_prefix;
- }
- libname_fmt [] =
- {
- /* Preferred explicit import library for dll's. */
- { "lib%s.dll.a", FALSE },
- /* Alternate explicit import library for dll's. */
- { "%s.dll.a", FALSE },
- /* "libfoo.a" could be either an import lib or a static lib.
- For backwards compatibility, libfoo.a needs to precede
- libfoo.dll and foo.dll in the search. */
- { "lib%s.a", FALSE },
- /* The 'native' spelling of an import lib name is "foo.lib". */
- { "%s.lib", FALSE },
-#ifdef DLL_SUPPORT
- /* Try "<prefix>foo.dll" (preferred dll name, if specified). */
- { "%s%s.dll", TRUE },
-#endif
- /* Try "libfoo.dll" (default preferred dll name). */
- { "lib%s.dll", FALSE },
- /* Finally try 'native' dll name "foo.dll". */
- { "%s.dll", FALSE },
- /* Note: If adding more formats to this table, make sure to check to
- see if their length is longer than libname_fmt[0].format, and if
- so, update the call to xmalloc() below. */
- { NULL, FALSE }
- };
- static unsigned int format_max_len = 0;
- const char * filename;
- char * full_string;
- char * base_string;
- unsigned int i;
-
-
- if (! entry->is_archive)
- return FALSE;
-
- filename = entry->filename;
-
- if (format_max_len == 0)
- /* We need to allow space in the memory that we are going to allocate
- for the characters in the format string. Since the format array is
- static we only need to calculate this information once. In theory
- this value could also be computed statically, but this introduces
- the possibility for a discrepancy and hence a possible memory
- corruption. The lengths we compute here will be too long because
- they will include any formating characters (%s) in the strings, but
- this will not matter. */
- for (i = 0; libname_fmt[i].format; i++)
- if (format_max_len < strlen (libname_fmt[i].format))
- format_max_len = strlen (libname_fmt[i].format);
-
- full_string = xmalloc (strlen (search->name)
- + strlen (filename)
- + format_max_len
-#ifdef DLL_SUPPORT
- + (pep_dll_search_prefix
- ? strlen (pep_dll_search_prefix) : 0)
-#endif
- /* Allow for the terminating NUL and for the path
- separator character that is inserted between
- search->name and the start of the format string. */
- + 2);
-
- sprintf (full_string, "%s/", search->name);
- base_string = full_string + strlen (full_string);
-
- for (i = 0; libname_fmt[i].format; i++)
- {
-#ifdef DLL_SUPPORT
- if (libname_fmt[i].use_prefix)
- {
- if (!pep_dll_search_prefix)
- continue;
- sprintf (base_string, libname_fmt[i].format, pep_dll_search_prefix, filename);
- }
- else
-#endif
- sprintf (base_string, libname_fmt[i].format, filename);
-
- if (ldfile_try_open_bfd (full_string, entry))
- break;
- }
-
- if (!libname_fmt[i].format)
- {
- free (full_string);
- return FALSE;
- }
-
- entry->filename = full_string;
-
- return TRUE;
-}
-
-static int
-gld_${EMULATION_NAME}_find_potential_libraries
- (char *name, lang_input_statement_type *entry)
-{
- return ldfile_open_file_search (name, entry, "", ".lib");
-}
-
-static char *
-gld_${EMULATION_NAME}_get_script (int *isfile)
-EOF
-# Scripts compiled in.
-# sed commands to quote an ld script as a C string.
-sc="-f stringify.sed"
-
-fragment <<EOF
-{
- *isfile = 0;
-
- if (link_info.relocatable && config.build_constructors)
- return
-EOF
-sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
-echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
-if test -n "$GENERATE_AUTO_IMPORT_SCRIPT" ; then
-echo ' ; else if (link_info.pei386_auto_import == 1) return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.xa >> e${EMULATION_NAME}.c
-fi
-echo ' ; else return' >> e${EMULATION_NAME}.c
-sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
-echo '; }' >> e${EMULATION_NAME}.c
-
-fragment <<EOF
-
-
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
-{
- gld_${EMULATION_NAME}_before_parse,
- syslib_default,
- hll_default,
- gld_${EMULATION_NAME}_after_parse,
- gld_${EMULATION_NAME}_after_open,
- after_allocation_default,
- set_output_arch_default,
- ldemul_default_target,
- gld_${EMULATION_NAME}_before_allocation,
- gld_${EMULATION_NAME}_get_script,
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- gld_${EMULATION_NAME}_finish,
- NULL, /* Create output section statements. */
- gld_${EMULATION_NAME}_open_dynamic_archive,
- gld_${EMULATION_NAME}_place_orphan,
- gld_${EMULATION_NAME}_set_symbols,
- NULL, /* parse_args */
- gld${EMULATION_NAME}_add_options,
- gld${EMULATION_NAME}_handle_option,
- gld_${EMULATION_NAME}_unrecognized_file,
- gld_${EMULATION_NAME}_list_options,
- gld_${EMULATION_NAME}_recognized_file,
- gld_${EMULATION_NAME}_find_potential_libraries,
- NULL /* new_vers_pattern. */
-};
-EOF
diff --git a/ld/emultempl/spu_ovl.o_c b/ld/emultempl/spu_ovl.o_c
deleted file mode 100644
index c9eff93f84b..00000000000
--- a/ld/emultempl/spu_ovl.o_c
+++ /dev/null
@@ -1,101 +0,0 @@
-0x7f,0x45,0x4c,0x46,0x01,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x01,0x00,0x17,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x02,0x74,0x00,0x00,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0x00,0x00,0x28,
-0x00,0x08,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x01,0x02,0x03,0x10,0x11,0x12,0x13,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-0x04,0x05,0x06,0x07,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x42,0x00,0x00,0x4b,0x3f,0xe1,0x00,0x4e,0x3f,0xe2,0x00,0x4f,0x0f,0x61,0x27,0x4c,
-0x35,0x80,0x27,0x8b,0x38,0x93,0x25,0xcb,0x40,0x20,0x00,0x00,0x24,0xff,0x00,0xc7,
-0x3f,0x81,0x25,0xcd,0x24,0xff,0x40,0xc8,0x24,0xff,0x80,0xc9,0x24,0xff,0xc0,0xca,
-0x14,0x00,0x66,0xcc,0x23,0xff,0xf7,0xce,0x20,0x00,0x0e,0x4c,0x35,0x00,0x27,0x80,
-0x42,0x00,0x00,0x4b,0x24,0xff,0x40,0xc8,0x42,0x00,0x00,0x48,0x24,0xff,0x80,0xc9,
-0x0f,0x61,0x27,0x4c,0x33,0xff,0xf3,0xc9,0x40,0x20,0x00,0x00,0x23,0xff,0xf2,0xce,
-0x78,0x12,0x00,0x4e,0x33,0xff,0xed,0xcd,0x35,0x80,0x27,0x8f,0x38,0x93,0x25,0xcb,
-0x24,0xff,0xc0,0xca,0xb9,0x52,0x64,0x4d,0x36,0xc0,0x27,0x4e,0x3f,0xbe,0x00,0x49,
-0x3f,0x81,0x25,0xcd,0x34,0xff,0x40,0xc8,0x08,0x32,0x65,0x4a,0x34,0xff,0x80,0xc9,
-0x14,0x00,0x66,0xcc,0x24,0xff,0x00,0xc7,0x80,0x00,0x25,0x4e,0x34,0xff,0xc0,0xca,
-0x20,0x00,0x01,0x4c,0x35,0x00,0x27,0x80,0x42,0x00,0x00,0x4e,0x3f,0x82,0x25,0xcc,
-0x01,0xa0,0x06,0xc7,0x35,0x08,0x27,0x00,0x40,0x20,0x00,0x00,0x3f,0x81,0x25,0xc9,
-0x30,0x80,0x00,0x48,0x33,0xff,0xe3,0xce,0x3f,0xbf,0x26,0x4d,0x18,0x53,0x64,0x4c,
-0xb9,0x93,0x26,0x4e,0x68,0x13,0x64,0x4c,0x42,0x20,0x00,0x4a,0x00,0x20,0x00,0x00,
-0x04,0x00,0x26,0x48,0x3f,0x81,0x26,0x4d,0x48,0x12,0xa4,0xcc,0x21,0xa0,0x08,0x4b,
-0x89,0x92,0xa4,0xcc,0x21,0xa0,0x08,0xc8,0x42,0x00,0x00,0x4a,0x21,0xa0,0x09,0x4d,
-0x42,0x00,0x20,0x4d,0x21,0xa0,0x09,0xcc,0x08,0x12,0x66,0x49,0x21,0xa0,0x0a,0x4a,
-0x18,0x13,0x25,0xcb,0x21,0xa0,0x0a,0xcd,0x21,0x7f,0xf6,0x49,0x33,0xff,0xda,0xce,
-0x0f,0x61,0x27,0x4c,0x42,0x00,0x00,0x4d,0x32,0x80,0x80,0x4a,0x38,0x93,0x26,0xcb,
-0x14,0x00,0x65,0x4a,0x00,0x20,0x00,0x00,0x08,0x32,0xa5,0xc9,0x3f,0x83,0x25,0xc8,
-0x28,0x93,0x26,0xc9,0x0f,0x60,0xa4,0x4c,0x42,0x00,0x00,0x4d,0x38,0x93,0x26,0xcb,
-0x3a,0xd3,0x26,0xc8,0x18,0x13,0x26,0xcc,0x3b,0x93,0x25,0xc9,0xb9,0x12,0xe7,0x48,
-0x42,0x00,0x00,0xcb,0x24,0x00,0x26,0x48,0x42,0x00,0x01,0x4c,0x01,0xa0,0x06,0x48,
-0x21,0xa0,0x0b,0x4b,0x21,0xa0,0x0b,0xcc,0x01,0xa0,0x0c,0x4c,0x00,0x40,0x00,0x00,
-0x42,0x00,0x00,0x4d,0x35,0x80,0x27,0x92,0x0f,0x61,0x24,0xcc,0x21,0xa0,0x0b,0x48,
-0x7c,0x00,0x24,0xc9,0x36,0x80,0x24,0xc9,0x38,0x93,0x26,0xcb,0x34,0xff,0x40,0xc8,
-0x58,0x32,0x65,0x4a,0x34,0xff,0x80,0xc9,0x42,0x00,0x00,0x4e,0x14,0x00,0x63,0xc7,
-0x58,0x32,0xa5,0xcb,0x34,0xff,0xc0,0xca,0x40,0x20,0x00,0x00,0x28,0x93,0x26,0xcb,
-0x25,0x24,0x27,0x47,0x34,0xff,0x00,0xc7,0x40,0x20,0x00,0x00,0x35,0x00,0x27,0x80,
-0x00,0x2e,0x73,0x79,0x6d,0x74,0x61,0x62,0x00,0x2e,0x73,0x74,0x72,0x74,0x61,0x62,
-0x00,0x2e,0x73,0x68,0x73,0x74,0x72,0x74,0x61,0x62,0x00,0x2e,0x72,0x65,0x6c,0x61,
-0x2e,0x74,0x65,0x78,0x74,0x00,0x2e,0x64,0x61,0x74,0x61,0x00,0x2e,0x62,0x73,0x73,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,
-0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,
-0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1b,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x05,0xdc,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x06,
-0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x26,
-0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x40,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x03,
-0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,
-0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x40,
-0x00,0x00,0x00,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xb4,0x00,0x00,0x01,0x50,0x00,0x00,0x00,0x07,
-0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x09,
-0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x04,
-0x00,0x00,0x00,0xd6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x03,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x03,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x03,0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,
-0x01,0x00,0x00,0x01,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,
-0x01,0x00,0x00,0x01,0x00,0x00,0x00,0x1b,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x10,
-0x01,0x00,0x00,0x01,0x00,0x00,0x00,0x2a,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x34,0x00,0x00,0x00,0xd8,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0xd4,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x47,0x00,0x00,0x00,0xe8,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x51,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x62,0x00,0x00,0x01,0xfc,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x6c,0x00,0x00,0x01,0xf4,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x76,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,
-0x12,0x00,0x00,0x01,0x00,0x00,0x00,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x00,0x00,0x00,0x70,0x00,0x00,0x01,0x90,
-0x12,0x00,0x00,0x01,0x00,0x00,0x00,0x9c,0x00,0x00,0x00,0xd8,0x00,0x00,0x00,0x00,
-0x12,0x00,0x00,0x01,0x00,0x00,0x00,0xae,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x10,0x00,0x00,0x00,0x00,0x00,0x00,0xb4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x10,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0x00,0x00,0x01,0xf8,0x00,0x00,0x00,0x00,
-0x12,0x00,0x00,0x01,0x00,0x5f,0x5f,0x72,0x76,0x5f,0x70,0x61,0x74,0x74,0x65,0x72,
-0x6e,0x00,0x5f,0x5f,0x63,0x67,0x5f,0x70,0x61,0x74,0x74,0x65,0x72,0x6e,0x00,0x5f,
-0x5f,0x6f,0x76,0x6c,0x79,0x5f,0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x00,0x6f,0x76,
-0x6c,0x79,0x5f,0x72,0x65,0x74,0x39,0x00,0x64,0x6f,0x5f,0x6c,0x6f,0x61,0x64,0x00,
-0x6f,0x76,0x6c,0x79,0x5f,0x6c,0x6f,0x61,0x64,0x39,0x00,0x64,0x6f,0x5f,0x6c,0x6f,
-0x61,0x64,0x31,0x30,0x00,0x5f,0x5f,0x6f,0x76,0x6c,0x79,0x5f,0x78,0x66,0x65,0x72,
-0x5f,0x6c,0x6f,0x6f,0x70,0x00,0x64,0x6f,0x5f,0x6c,0x6f,0x61,0x64,0x39,0x39,0x00,
-0x64,0x6f,0x5f,0x6c,0x6f,0x61,0x64,0x39,0x30,0x00,0x5f,0x5f,0x6f,0x76,0x6c,0x79,
-0x5f,0x72,0x65,0x74,0x75,0x72,0x6e,0x00,0x5f,0x6f,0x76,0x6c,0x79,0x5f,0x74,0x61,
-0x62,0x6c,0x65,0x00,0x5f,0x5f,0x6f,0x76,0x6c,0x79,0x5f,0x6c,0x6f,0x61,0x64,0x00,
-0x5f,0x5f,0x6f,0x76,0x6c,0x79,0x5f,0x6c,0x6f,0x61,0x64,0x5f,0x65,0x76,0x65,0x6e,
-0x74,0x00,0x5f,0x45,0x41,0x52,0x5f,0x00,0x5f,0x6f,0x76,0x6c,0x79,0x5f,0x62,0x75,
-0x66,0x5f,0x74,0x61,0x62,0x6c,0x65,0x00,0x5f,0x6f,0x76,0x6c,0x79,0x5f,0x64,0x65,
-0x62,0x75,0x67,0x5f,0x65,0x76,0x65,0x6e,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x30,
-0x00,0x00,0x0f,0x05,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x70,0x00,0x00,0x0f,0x05,
-0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x78,0x00,0x00,0x0e,0x05,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0xd8,0x00,0x00,0x01,0x05,0x00,0x00,0x00,0xe8,0x00,0x00,0x00,0xf0,
-0x00,0x00,0x12,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x54,0x00,0x00,0x0f,0x05,
-0xff,0xff,0xff,0xf0,0x00,0x00,0x01,0x78,0x00,0x00,0x13,0x05,0xff,0xff,0xff,0xfc,
-0x00,0x00,0x01,0xb0,0x00,0x00,0x0f,0x05,0xff,0xff,0xff,0xf0,0x00,0x00,0x01,0xd8,
-0x00,0x00,0x01,0x05,0x00,0x00,0x01,0xf4,
diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em
deleted file mode 100644
index 116a0cc9851..00000000000
--- a/ld/emultempl/spuelf.em
+++ /dev/null
@@ -1,682 +0,0 @@
-# This shell script emits a C file. -*- C -*-
-# Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
-#
-# This file is part of the GNU Binutils.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-# MA 02110-1301, USA.
-#
-
-# This file is sourced from elf32.em, and defines extra spu specific
-# features.
-#
-fragment <<EOF
-#include "ldctor.h"
-#include "elf32-spu.h"
-
-/* Non-zero if no overlay processing should be done. */
-static int no_overlays = 0;
-
-/* Non-zero if we want stubs on all calls out of overlay regions. */
-static int non_overlay_stubs = 0;
-
-/* Whether to emit symbols for stubs. */
-static int emit_stub_syms = 0;
-
-/* Non-zero to perform stack space analysis. */
-static int stack_analysis = 0;
-
-/* Whether to emit symbols with stack requirements for each function. */
-static int emit_stack_syms = 0;
-
-/* Range of valid addresses for loadable sections. */
-static bfd_vma local_store_lo = 0;
-static bfd_vma local_store_hi = 0x3ffff;
-
-/* Control --auto-overlay feature. */
-static int auto_overlay = 0;
-static char *auto_overlay_file = 0;
-static unsigned int auto_overlay_fixed = 0;
-static unsigned int auto_overlay_reserved = 0;
-static int extra_stack_space = 2000;
-int my_argc;
-char **my_argv;
-
-static const char ovl_mgr[] = {
-EOF
-
-if ! cat ${srcdir}/emultempl/spu_ovl.o_c >> e${EMULATION_NAME}.c
-then
- echo >&2 "Missing ${srcdir}/emultempl/spu_ovl.o_c"
- echo >&2 "You must build gas/as-new with --target=spu to build spu_ovl.o"
- exit 1
-fi
-
-fragment <<EOF
-};
-
-static const struct _ovl_stream ovl_mgr_stream = {
- ovl_mgr,
- ovl_mgr + sizeof (ovl_mgr)
-};
-
-
-static int
-is_spu_target (void)
-{
- extern const bfd_target bfd_elf32_spu_vec;
-
- return link_info.output_bfd->xvec == &bfd_elf32_spu_vec;
-}
-
-/* Create our note section. */
-
-static void
-spu_after_open (void)
-{
- if (is_spu_target ()
- && !link_info.relocatable
- && link_info.input_bfds != NULL
- && !spu_elf_create_sections (&link_info,
- stack_analysis, emit_stack_syms))
- einfo ("%X%P: can not create note section: %E\n");
-
- gld${EMULATION_NAME}_after_open ();
-}
-
-/* If O is NULL, add section S at the end of output section OUTPUT_NAME.
- If O is not NULL, add section S at the beginning of output section O.
-
- Really, we should be duplicating ldlang.c map_input_to_output_sections
- logic here, ie. using the linker script to find where the section
- goes. That's rather a lot of code, and we don't want to run
- map_input_to_output_sections again because most sections are already
- mapped. So cheat, and put the section in a fixed place, ignoring any
- attempt via a linker script to put .stub, .ovtab, and built-in
- overlay manager code somewhere else. */
-
-static void
-spu_place_special_section (asection *s, asection *o, const char *output_name)
-{
- lang_output_section_statement_type *os;
-
- os = lang_output_section_find (o != NULL ? o->name : output_name);
- if (os == NULL)
- {
- const char *save = s->name;
- s->name = output_name;
- gld${EMULATION_NAME}_place_orphan (s);
- s->name = save;
- }
- else if (o != NULL && os->children.head != NULL)
- {
- lang_statement_list_type add;
-
- lang_list_init (&add);
- lang_add_section (&add, s, os);
- *add.tail = os->children.head;
- os->children.head = add.head;
- }
- else
- lang_add_section (&os->children, s, os);
-
- s->output_section->size += s->size;
-}
-
-/* Load built-in overlay manager, and tweak overlay section alignment. */
-
-static void
-spu_elf_load_ovl_mgr (void)
-{
- lang_output_section_statement_type *os;
- struct elf_link_hash_entry *h;
-
- h = elf_link_hash_lookup (elf_hash_table (&link_info),
- "__ovly_load", FALSE, FALSE, FALSE);
-
- if (h != NULL
- && (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- && h->def_regular)
- {
- /* User supplied __ovly_load. */
- }
- else if (ovl_mgr_stream.start == ovl_mgr_stream.end)
- einfo ("%F%P: no built-in overlay manager\n");
- else
- {
- lang_input_statement_type *ovl_is;
-
- ovl_is = lang_add_input_file ("builtin ovl_mgr",
- lang_input_file_is_file_enum,
- NULL);
-
- if (!spu_elf_open_builtin_lib (&ovl_is->the_bfd, &ovl_mgr_stream))
- einfo ("%X%P: can not open built-in overlay manager: %E\n");
- else
- {
- asection *in;
-
- if (!load_symbols (ovl_is, NULL))
- einfo ("%X%P: can not load built-in overlay manager: %E\n");
-
- /* Map overlay manager sections to output sections. */
- for (in = ovl_is->the_bfd->sections; in != NULL; in = in->next)
- if ((in->flags & (SEC_ALLOC | SEC_LOAD))
- == (SEC_ALLOC | SEC_LOAD))
- spu_place_special_section (in, NULL, ".text");
- }
- }
-
- /* Ensure alignment of overlay sections is sufficient. */
- for (os = &lang_output_section_statement.head->output_section_statement;
- os != NULL;
- os = os->next)
- if (os->bfd_section != NULL
- && spu_elf_section_data (os->bfd_section) != NULL
- && spu_elf_section_data (os->bfd_section)->u.o.ovl_index != 0)
- {
- if (os->bfd_section->alignment_power < 4)
- os->bfd_section->alignment_power = 4;
-
- /* Also ensure size rounds up. */
- os->block_value = 16;
- }
-}
-
-/* Go find if we need to do anything special for overlays. */
-
-static void
-spu_before_allocation (void)
-{
- if (is_spu_target ()
- && !link_info.relocatable
- && !no_overlays)
- {
- /* Size the sections. This is premature, but we need to know the
- rough layout so that overlays can be found. */
- expld.phase = lang_mark_phase_enum;
- expld.dataseg.phase = exp_dataseg_none;
- one_lang_size_sections_pass (NULL, TRUE);
-
- /* Find overlays by inspecting section vmas. */
- if (spu_elf_find_overlays (&link_info))
- {
- int ret;
-
- if (auto_overlay != 0)
- {
- einfo ("%P: --auto-overlay ignored with user overlay script\n");
- auto_overlay = 0;
- }
-
- ret = spu_elf_size_stubs (&link_info,
- spu_place_special_section,
- non_overlay_stubs);
- if (ret == 0)
- einfo ("%X%P: can not size overlay stubs: %E\n");
- else if (ret == 2)
- spu_elf_load_ovl_mgr ();
- }
-
- /* We must not cache anything from the preliminary sizing. */
- lang_reset_memory_regions ();
- }
-
- gld${EMULATION_NAME}_before_allocation ();
-}
-
-struct tflist {
- struct tflist *next;
- char name[9];
-};
-
-static struct tflist *tmp_file_list;
-
-static void clean_tmp (void)
-{
- for (; tmp_file_list != NULL; tmp_file_list = tmp_file_list->next)
- unlink (tmp_file_list->name);
-}
-
-static int
-new_tmp_file (char **fname)
-{
- struct tflist *tf;
- int fd;
-
- if (tmp_file_list == NULL)
- atexit (clean_tmp);
- tf = xmalloc (sizeof (*tf));
- tf->next = tmp_file_list;
- tmp_file_list = tf;
- memcpy (tf->name, "ldXXXXXX", sizeof (tf->name));
- *fname = tf->name;
-#ifdef HAVE_MKSTEMP
- fd = mkstemp (*fname);
-#else
- *fname = mktemp (*fname);
- if (*fname == NULL)
- return -1;
- fd = open (fname, O_RDWR | O_CREAT | O_EXCL, 0600);
-#endif
- return fd;
-}
-
-static FILE *
-spu_elf_open_overlay_script (void)
-{
- FILE *script = NULL;
-
- if (auto_overlay_file == NULL)
- {
- int fd = new_tmp_file (&auto_overlay_file);
- if (fd == -1)
- goto file_err;
- script = fdopen (fd, "w");
- }
- else
- script = fopen (auto_overlay_file, "w");
-
- if (script == NULL)
- {
- file_err:
- einfo ("%F%P: can not open script: %E\n");
- }
- return script;
-}
-
-static void
-spu_elf_relink (void)
-{
- char **argv = xmalloc ((my_argc + 4) * sizeof (*argv));
-
- memcpy (argv, my_argv, my_argc * sizeof (*argv));
- argv[my_argc++] = "--no-auto-overlay";
- if (tmp_file_list->name == auto_overlay_file)
- argv[my_argc - 1] = concat (argv[my_argc - 1], "=",
- auto_overlay_file, (const char *) NULL);
- argv[my_argc++] = "-T";
- argv[my_argc++] = auto_overlay_file;
- argv[my_argc] = 0;
- execvp (argv[0], (char *const *) argv);
- perror (argv[0]);
- _exit (127);
-}
-
-/* Final emulation specific call. */
-
-static void
-gld${EMULATION_NAME}_finish (void)
-{
- int need_laying_out;
-
- need_laying_out = bfd_elf_discard_info (link_info.output_bfd, &link_info);
-
- gld${EMULATION_NAME}_map_segments (need_laying_out);
-
- if (is_spu_target ())
- {
- if (local_store_lo < local_store_hi)
- {
- asection *s;
-
- s = spu_elf_check_vma (&link_info, auto_overlay,
- local_store_lo, local_store_hi,
- auto_overlay_fixed, auto_overlay_reserved,
- extra_stack_space,
- spu_elf_load_ovl_mgr,
- spu_elf_open_overlay_script,
- spu_elf_relink);
- if (s != NULL && !auto_overlay)
- einfo ("%X%P: %A exceeds local store range\n", s);
- }
- else if (auto_overlay)
- einfo ("%P: --auto-overlay ignored with zero local store range\n");
-
- if (!spu_elf_build_stubs (&link_info,
- emit_stub_syms || link_info.emitrelocations))
- einfo ("%F%P: can not build overlay stubs: %E\n");
- }
-
- finish_default ();
-}
-
-static char *
-gld${EMULATION_NAME}_choose_target (int argc, char *argv[])
-{
- my_argc = argc;
- my_argv = argv;
- return ldemul_default_target (argc, argv);
-}
-
-EOF
-
-if grep -q 'ld_elf.*ppc.*_emulation' ldemul-list.h; then
- fragment <<EOF
-#include "filenames.h"
-#include <fcntl.h>
-#include <sys/wait.h>
-
-static const char *
-base_name (const char *path)
-{
- const char *file = strrchr (path, '/');
-#ifdef HAVE_DOS_BASED_FILE_SYSTEM
- {
- char *bslash = strrchr (path, '\\\\');
-
- if (file == NULL || (bslash != NULL && bslash > file))
- file = bslash;
- if (file == NULL
- && path[0] != '\0'
- && path[1] == ':')
- file = path + 1;
- }
-#endif
- if (file == NULL)
- file = path;
- else
- ++file;
- return file;
-}
-
-/* This function is called when building a ppc32 or ppc64 executable
- to handle embedded spu images. */
-extern bfd_boolean embedded_spu_file (lang_input_statement_type *, const char *);
-
-bfd_boolean
-embedded_spu_file (lang_input_statement_type *entry, const char *flags)
-{
- const char *cmd[6];
- const char *sym;
- char *handle, *p;
- char *oname;
- int fd;
- pid_t pid;
- int status;
- union lang_statement_union **old_stat_tail;
- union lang_statement_union **old_file_tail;
- union lang_statement_union *new_ent;
- lang_input_statement_type *search;
-
- if (entry->the_bfd->format != bfd_object
- || strcmp (entry->the_bfd->xvec->name, "elf32-spu") != 0
- || (entry->the_bfd->tdata.elf_obj_data->elf_header->e_type != ET_EXEC
- && entry->the_bfd->tdata.elf_obj_data->elf_header->e_type != ET_DYN))
- return FALSE;
-
- /* Use the filename as the symbol marking the program handle struct. */
- sym = base_name (entry->the_bfd->filename);
-
- handle = xstrdup (sym);
- for (p = handle; *p; ++p)
- if (!(ISALNUM (*p) || *p == '$' || *p == '.'))
- *p = '_';
-
- fd = new_tmp_file (&oname);
- if (fd == -1)
- return FALSE;
- close (fd);
-
- for (search = (lang_input_statement_type *) input_file_chain.head;
- search != NULL;
- search = (lang_input_statement_type *) search->next_real_file)
- if (search->filename != NULL)
- {
- const char *infile = base_name (search->filename);
-
- if (strncmp (infile, "crtbegin", 8) == 0)
- {
- if (infile[8] == 'S')
- flags = concat (flags, " -fPIC", (const char *) NULL);
- else if (infile[8] == 'T')
- flags = concat (flags, " -fpie", (const char *) NULL);
- break;
- }
- }
-
- /* Use fork() and exec() rather than system() so that we don't
- need to worry about quoting args. */
- cmd[0] = EMBEDSPU;
- cmd[1] = flags;
- cmd[2] = handle;
- cmd[3] = entry->the_bfd->filename;
- cmd[4] = oname;
- cmd[5] = NULL;
- if (trace_file_tries)
- {
- info_msg (_("running: %s \"%s\" \"%s\" \"%s\" \"%s\"\n"),
- cmd[0], cmd[1], cmd[2], cmd[3], cmd[4]);
- fflush (stdout);
- }
-
- pid = fork ();
- if (pid == -1)
- return FALSE;
- if (pid == 0)
- {
- execvp (cmd[0], (char *const *) cmd);
- if (strcmp ("embedspu", EMBEDSPU) != 0)
- {
- cmd[0] = "embedspu";
- execvp (cmd[0], (char *const *) cmd);
- }
- perror (cmd[0]);
- _exit (127);
- }
-#ifdef HAVE_WAITPID
-#define WAITFOR(PID, STAT) waitpid (PID, STAT, 0)
-#else
-#define WAITFOR(PID, STAT) wait (STAT)
-#endif
- if (WAITFOR (pid, &status) != pid
- || !WIFEXITED (status)
- || WEXITSTATUS (status) != 0)
- return FALSE;
-#undef WAITFOR
-
- old_stat_tail = stat_ptr->tail;
- old_file_tail = input_file_chain.tail;
- if (lang_add_input_file (oname, lang_input_file_is_file_enum, NULL) == NULL)
- return FALSE;
-
- /* lang_add_input_file put the new list entry at the end of the statement
- and input file lists. Move it to just after the current entry. */
- new_ent = *old_stat_tail;
- *old_stat_tail = NULL;
- stat_ptr->tail = old_stat_tail;
- *old_file_tail = NULL;
- input_file_chain.tail = old_file_tail;
- new_ent->header.next = entry->header.next;
- entry->header.next = new_ent;
- new_ent->input_statement.next_real_file = entry->next_real_file;
- entry->next_real_file = new_ent;
-
- /* Ensure bfd sections are excluded from the output. */
- bfd_section_list_clear (entry->the_bfd);
- entry->loaded = TRUE;
- return TRUE;
-}
-
-EOF
-fi
-
-# Define some shell vars to insert bits of code into the standard elf
-# parse_args and list_options functions.
-#
-PARSE_AND_LIST_PROLOGUE='
-#define OPTION_SPU_PLUGIN 301
-#define OPTION_SPU_NO_OVERLAYS (OPTION_SPU_PLUGIN + 1)
-#define OPTION_SPU_STUB_SYMS (OPTION_SPU_NO_OVERLAYS + 1)
-#define OPTION_SPU_NON_OVERLAY_STUBS (OPTION_SPU_STUB_SYMS + 1)
-#define OPTION_SPU_LOCAL_STORE (OPTION_SPU_NON_OVERLAY_STUBS + 1)
-#define OPTION_SPU_STACK_ANALYSIS (OPTION_SPU_LOCAL_STORE + 1)
-#define OPTION_SPU_STACK_SYMS (OPTION_SPU_STACK_ANALYSIS + 1)
-#define OPTION_SPU_AUTO_OVERLAY (OPTION_SPU_STACK_SYMS + 1)
-#define OPTION_SPU_AUTO_RELINK (OPTION_SPU_AUTO_OVERLAY + 1)
-#define OPTION_SPU_OVERLAY_RODATA (OPTION_SPU_AUTO_RELINK + 1)
-#define OPTION_SPU_FIXED_SPACE (OPTION_SPU_OVERLAY_RODATA + 1)
-#define OPTION_SPU_RESERVED_SPACE (OPTION_SPU_FIXED_SPACE + 1)
-#define OPTION_SPU_EXTRA_STACK (OPTION_SPU_RESERVED_SPACE + 1)
-#define OPTION_SPU_NO_AUTO_OVERLAY (OPTION_SPU_EXTRA_STACK + 1)
-'
-
-PARSE_AND_LIST_LONGOPTS='
- { "plugin", no_argument, NULL, OPTION_SPU_PLUGIN },
- { "no-overlays", no_argument, NULL, OPTION_SPU_NO_OVERLAYS },
- { "emit-stub-syms", no_argument, NULL, OPTION_SPU_STUB_SYMS },
- { "extra-overlay-stubs", no_argument, NULL, OPTION_SPU_NON_OVERLAY_STUBS },
- { "local-store", required_argument, NULL, OPTION_SPU_LOCAL_STORE },
- { "stack-analysis", no_argument, NULL, OPTION_SPU_STACK_ANALYSIS },
- { "emit-stack-syms", no_argument, NULL, OPTION_SPU_STACK_SYMS },
- { "auto-overlay", optional_argument, NULL, OPTION_SPU_AUTO_OVERLAY },
- { "auto-relink", no_argument, NULL, OPTION_SPU_AUTO_RELINK },
- { "overlay-rodata", no_argument, NULL, OPTION_SPU_OVERLAY_RODATA },
- { "fixed-space", required_argument, NULL, OPTION_SPU_FIXED_SPACE },
- { "reserved-space", required_argument, NULL, OPTION_SPU_RESERVED_SPACE },
- { "extra-stack-space", required_argument, NULL, OPTION_SPU_EXTRA_STACK },
- { "no-auto-overlay", optional_argument, NULL, OPTION_SPU_NO_AUTO_OVERLAY },
-'
-
-PARSE_AND_LIST_OPTIONS='
- fprintf (file, _("\
- --plugin Make SPU plugin.\n\
- --no-overlays No overlay handling.\n\
- --emit-stub-syms Add symbols on overlay call stubs.\n\
- --extra-overlay-stubs Add stubs on all calls out of overlay regions.\n\
- --local-store=lo:hi Valid address range.\n\
- --stack-analysis Estimate maximum stack requirement.\n\
- --emit-stack-syms Add sym giving stack needed for each func.\n\
- --auto-overlay [=filename] Create an overlay script in filename if\n\
- executable does not fit in local store.\n\
- --auto-relink Rerun linker using auto-overlay script.\n\
- --overlay-rodata Place read-only data with associated function\n\
- code in overlays.\n\
- --fixed-space=bytes Local store for non-overlay code and data.\n\
- --reserved-space=bytes Local store for stack and heap. If not specified\n\
- ld will estimate stack size and assume no heap.\n\
- --extra-stack-space=bytes Space for negative sp access (default 2000) if\n\
- --reserved-space not given.\n"
- ));
-'
-
-PARSE_AND_LIST_ARGS_CASES='
- case OPTION_SPU_PLUGIN:
- spu_elf_plugin (1);
- break;
-
- case OPTION_SPU_NO_OVERLAYS:
- no_overlays = 1;
- break;
-
- case OPTION_SPU_STUB_SYMS:
- emit_stub_syms = 1;
- break;
-
- case OPTION_SPU_NON_OVERLAY_STUBS:
- non_overlay_stubs = 1;
- break;
-
- case OPTION_SPU_LOCAL_STORE:
- {
- char *end;
- local_store_lo = strtoul (optarg, &end, 0);
- if (*end == '\'':'\'')
- {
- local_store_hi = strtoul (end + 1, &end, 0);
- if (*end == 0)
- break;
- }
- einfo (_("%P%F: invalid --local-store address range `%s'\''\n"), optarg);
- }
- break;
-
- case OPTION_SPU_STACK_ANALYSIS:
- stack_analysis = 1;
- break;
-
- case OPTION_SPU_STACK_SYMS:
- emit_stack_syms = 1;
- break;
-
- case OPTION_SPU_AUTO_OVERLAY:
- auto_overlay |= 1;
- if (optarg != NULL)
- {
- auto_overlay_file = optarg;
- break;
- }
- /* Fall thru */
-
- case OPTION_SPU_AUTO_RELINK:
- auto_overlay |= 2;
- break;
-
- case OPTION_SPU_OVERLAY_RODATA:
- auto_overlay |= 4;
- break;
-
- case OPTION_SPU_FIXED_SPACE:
- {
- char *end;
- auto_overlay_fixed = strtoul (optarg, &end, 0);
- if (*end != 0)
- einfo (_("%P%F: invalid --fixed-space value `%s'\''\n"), optarg);
- }
- break;
-
- case OPTION_SPU_RESERVED_SPACE:
- {
- char *end;
- auto_overlay_reserved = strtoul (optarg, &end, 0);
- if (*end != 0)
- einfo (_("%P%F: invalid --reserved-space value `%s'\''\n"), optarg);
- }
- break;
-
- case OPTION_SPU_EXTRA_STACK:
- {
- char *end;
- extra_stack_space = strtol (optarg, &end, 0);
- if (*end != 0)
- einfo (_("%P%F: invalid --extra-stack-space value `%s'\''\n"), optarg);
- }
- break;
-
- case OPTION_SPU_NO_AUTO_OVERLAY:
- auto_overlay = 0;
- if (optarg != NULL)
- {
- struct tflist *tf;
- size_t len;
-
- if (tmp_file_list == NULL)
- atexit (clean_tmp);
-
- len = strlen (optarg) + 1;
- tf = xmalloc (sizeof (*tf) - sizeof (tf->name) + len);
- memcpy (tf->name, optarg, len);
- tf->next = tmp_file_list;
- tmp_file_list = tf;
- break;
- }
- break;
-'
-
-LDEMUL_AFTER_OPEN=spu_after_open
-LDEMUL_BEFORE_ALLOCATION=spu_before_allocation
-LDEMUL_FINISH=gld${EMULATION_NAME}_finish
-LDEMUL_CHOOSE_TARGET=gld${EMULATION_NAME}_choose_target
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
deleted file mode 100644
index c6c656a230d..00000000000
--- a/ld/pe-dll.c
+++ /dev/null
@@ -1,2896 +0,0 @@
-/* Routines to help build PEI-format DLLs (Win32 etc)
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008 Free Software Foundation, Inc.
- Written by DJ Delorie <dj@cygnus.com>
-
- This file is part of the GNU Binutils.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "bfdlink.h"
-#include "libiberty.h"
-#include "safe-ctype.h"
-
-#include <time.h>
-
-#include "ld.h"
-#include "ldexp.h"
-#include "ldlang.h"
-#include "ldwrite.h"
-#include "ldmisc.h"
-#include <ldgram.h>
-#include "ldmain.h"
-#include "ldfile.h"
-#include "ldemul.h"
-#include "coff/internal.h"
-#include "../bfd/libcoff.h"
-#include "deffile.h"
-#include "pe-dll.h"
-
-#ifdef pe_use_x86_64
-
-#define PE_IDATA4_SIZE 8
-#define PE_IDATA5_SIZE 8
-#include "pep-dll.h"
-#undef AOUTSZ
-#define AOUTSZ PEPAOUTSZ
-#define PEAOUTHDR PEPAOUTHDR
-
-#else
-
-#include "pe-dll.h"
-
-#endif
-
-#ifndef PE_IDATA4_SIZE
-#define PE_IDATA4_SIZE 4
-#endif
-
-#ifndef PE_IDATA5_SIZE
-#define PE_IDATA5_SIZE 4
-#endif
-
-/* This file turns a regular Windows PE image into a DLL. Because of
- the complexity of this operation, it has been broken down into a
- number of separate modules which are all called by the main function
- at the end of this file. This function is not re-entrant and is
- normally only called once, so static variables are used to reduce
- the number of parameters and return values required.
-
- See also: ld/emultempl/pe.em and ld/emultempl/pep.em. */
-
-/* Auto-import feature by Paul Sokolovsky
-
- Quick facts:
-
- 1. With this feature on, DLL clients can import variables from DLL
- without any concern from their side (for example, without any source
- code modifications).
-
- 2. This is done completely in bounds of the PE specification (to be fair,
- there's a place where it pokes nose out of, but in practice it works).
- So, resulting module can be used with any other PE compiler/linker.
-
- 3. Auto-import is fully compatible with standard import method and they
- can be mixed together.
-
- 4. Overheads: space: 8 bytes per imported symbol, plus 20 for each
- reference to it; load time: negligible; virtual/physical memory: should be
- less than effect of DLL relocation, and I sincerely hope it doesn't affect
- DLL sharability (too much).
-
- Idea
-
- The obvious and only way to get rid of dllimport insanity is to make client
- access variable directly in the DLL, bypassing extra dereference. I.e.,
- whenever client contains something like
-
- mov dll_var,%eax,
-
- address of dll_var in the command should be relocated to point into loaded
- DLL. The aim is to make OS loader do so, and than make ld help with that.
- Import section of PE made following way: there's a vector of structures
- each describing imports from particular DLL. Each such structure points
- to two other parallel vectors: one holding imported names, and one which
- will hold address of corresponding imported name. So, the solution is
- de-vectorize these structures, making import locations be sparse and
- pointing directly into code. Before continuing, it is worth a note that,
- while authors strives to make PE act ELF-like, there're some other people
- make ELF act PE-like: elfvector, ;-) .
-
- Implementation
-
- For each reference of data symbol to be imported from DLL (to set of which
- belong symbols with name <sym>, if __imp_<sym> is found in implib), the
- import fixup entry is generated. That entry is of type
- IMAGE_IMPORT_DESCRIPTOR and stored in .idata$2 subsection. Each
- fixup entry contains pointer to symbol's address within .text section
- (marked with __fuN_<sym> symbol, where N is integer), pointer to DLL name
- (so, DLL name is referenced by multiple entries), and pointer to symbol
- name thunk. Symbol name thunk is singleton vector (__nm_th_<symbol>)
- pointing to IMAGE_IMPORT_BY_NAME structure (__nm_<symbol>) directly
- containing imported name. Here comes that "on the edge" problem mentioned
- above: PE specification rambles that name vector (OriginalFirstThunk)
- should run in parallel with addresses vector (FirstThunk), i.e. that they
- should have same number of elements and terminated with zero. We violate
- this, since FirstThunk points directly into machine code. But in practice,
- OS loader implemented the sane way: it goes thru OriginalFirstThunk and
- puts addresses to FirstThunk, not something else. It once again should be
- noted that dll and symbol name structures are reused across fixup entries
- and should be there anyway to support standard import stuff, so sustained
- overhead is 20 bytes per reference. Other question is whether having several
- IMAGE_IMPORT_DESCRIPTORS for the same DLL is possible. Answer is yes, it is
- done even by native compiler/linker (libth32's functions are in fact reside
- in windows9x kernel32.dll, so if you use it, you have two
- IMAGE_IMPORT_DESCRIPTORS for kernel32.dll). Yet other question is whether
- referencing the same PE structures several times is valid. The answer is why
- not, prohibiting that (detecting violation) would require more work on
- behalf of loader than not doing it.
-
- See also: ld/emultempl/pe.em and ld/emultempl/pep.em. */
-
-static void add_bfd_to_link (bfd *, const char *, struct bfd_link_info *);
-
-/* For emultempl/pe.em. */
-
-def_file * pe_def_file = 0;
-int pe_dll_export_everything = 0;
-int pe_dll_do_default_excludes = 1;
-int pe_dll_kill_ats = 0;
-int pe_dll_stdcall_aliases = 0;
-int pe_dll_warn_dup_exports = 0;
-int pe_dll_compat_implib = 0;
-int pe_dll_extra_pe_debug = 0;
-
-/* Static variables and types. */
-
-static bfd_vma image_base;
-static bfd *filler_bfd;
-static struct bfd_section *edata_s, *reloc_s;
-static unsigned char *edata_d, *reloc_d;
-static size_t edata_sz, reloc_sz;
-static int runtime_pseudo_relocs_created = 0;
-
-typedef struct
-{
- const char *name;
- int len;
-}
-autofilter_entry_type;
-
-typedef struct
-{
- const char *target_name;
- const char *object_target;
- unsigned int imagebase_reloc;
- int pe_arch;
- int bfd_arch;
- bfd_boolean underscored;
- const autofilter_entry_type* autofilter_symbollist;
-}
-pe_details_type;
-
-static const autofilter_entry_type autofilter_symbollist_generic[] =
-{
- { STRING_COMMA_LEN ("_NULL_IMPORT_DESCRIPTOR") },
- /* Entry point symbols. */
- { STRING_COMMA_LEN ("DllMain") },
- { STRING_COMMA_LEN ("DllMainCRTStartup") },
- { STRING_COMMA_LEN ("_DllMainCRTStartup") },
- /* Runtime pseudo-reloc. */
- { STRING_COMMA_LEN ("_pei386_runtime_relocator") },
- { STRING_COMMA_LEN ("do_pseudo_reloc") },
- { NULL, 0 }
-};
-
-static const autofilter_entry_type autofilter_symbollist_i386[] =
-{
- { STRING_COMMA_LEN ("_NULL_IMPORT_DESCRIPTOR") },
- /* Entry point symbols, and entry hooks. */
- { STRING_COMMA_LEN ("cygwin_crt0") },
-#ifdef pe_use_x86_64
- { STRING_COMMA_LEN ("DllMain") },
- { STRING_COMMA_LEN ("DllEntryPoint") },
- { STRING_COMMA_LEN ("DllMainCRTStartup") },
- { STRING_COMMA_LEN ("_cygwin_dll_entry") },
- { STRING_COMMA_LEN ("_cygwin_crt0_common") },
- { STRING_COMMA_LEN ("_cygwin_noncygwin_dll_entry") },
-#else
- { STRING_COMMA_LEN ("DllMain@12") },
- { STRING_COMMA_LEN ("DllEntryPoint@0") },
- { STRING_COMMA_LEN ("DllMainCRTStartup@12") },
- { STRING_COMMA_LEN ("_cygwin_dll_entry@12") },
- { STRING_COMMA_LEN ("_cygwin_crt0_common@8") },
- { STRING_COMMA_LEN ("_cygwin_noncygwin_dll_entry@12") },
- { STRING_COMMA_LEN ("cygwin_attach_dll") },
-#endif
- { STRING_COMMA_LEN ("cygwin_premain0") },
- { STRING_COMMA_LEN ("cygwin_premain1") },
- { STRING_COMMA_LEN ("cygwin_premain2") },
- { STRING_COMMA_LEN ("cygwin_premain3") },
- /* Runtime pseudo-reloc. */
- { STRING_COMMA_LEN ("_pei386_runtime_relocator") },
- { STRING_COMMA_LEN ("do_pseudo_reloc") },
- /* Global vars that should not be exported. */
- { STRING_COMMA_LEN ("impure_ptr") },
- { STRING_COMMA_LEN ("_impure_ptr") },
- { STRING_COMMA_LEN ("_fmode") },
- { STRING_COMMA_LEN ("environ") },
- { NULL, 0 }
-};
-
-#define PE_ARCH_i386 1
-#define PE_ARCH_sh 2
-#define PE_ARCH_mips 3
-#define PE_ARCH_arm 4
-#define PE_ARCH_arm_epoc 5
-#define PE_ARCH_arm_wince 6
-
-static const pe_details_type pe_detail_list[] =
-{
- {
-#ifdef pe_use_x86_64
- "pei-x86-64",
- "pe-x86-64",
- 3 /* R_IMAGEBASE */,
-#else
- "pei-i386",
- "pe-i386",
- 7 /* R_IMAGEBASE */,
-#endif
- PE_ARCH_i386,
- bfd_arch_i386,
- TRUE,
- autofilter_symbollist_i386
- },
- {
- "pei-shl",
- "pe-shl",
- 16 /* R_SH_IMAGEBASE */,
- PE_ARCH_sh,
- bfd_arch_sh,
- TRUE,
- autofilter_symbollist_generic
- },
- {
- "pei-mips",
- "pe-mips",
- 34 /* MIPS_R_RVA */,
- PE_ARCH_mips,
- bfd_arch_mips,
- FALSE,
- autofilter_symbollist_generic
- },
- {
- "pei-arm-little",
- "pe-arm-little",
- 11 /* ARM_RVA32 */,
- PE_ARCH_arm,
- bfd_arch_arm,
- TRUE,
- autofilter_symbollist_generic
- },
- {
- "epoc-pei-arm-little",
- "epoc-pe-arm-little",
- 11 /* ARM_RVA32 */,
- PE_ARCH_arm_epoc,
- bfd_arch_arm,
- FALSE,
- autofilter_symbollist_generic
- },
- {
- "pei-arm-wince-little",
- "pe-arm-wince-little",
- 2, /* ARM_RVA32 on Windows CE, see bfd/coff-arm.c. */
- PE_ARCH_arm_wince,
- bfd_arch_arm,
- FALSE,
- autofilter_symbollist_generic
- },
- { NULL, NULL, 0, 0, 0, FALSE, NULL }
-};
-
-static const pe_details_type *pe_details;
-
-/* Do not specify library suffix explicitly, to allow for dllized versions. */
-static const autofilter_entry_type autofilter_liblist[] =
-{
- { STRING_COMMA_LEN ("libcegcc") },
- { STRING_COMMA_LEN ("libcygwin") },
- { STRING_COMMA_LEN ("libgcc") },
- { STRING_COMMA_LEN ("libstdc++") },
- { STRING_COMMA_LEN ("libmingw32") },
- { STRING_COMMA_LEN ("libmingwex") },
- { STRING_COMMA_LEN ("libg2c") },
- { STRING_COMMA_LEN ("libsupc++") },
- { STRING_COMMA_LEN ("libobjc") },
- { STRING_COMMA_LEN ("libgcj") },
- { NULL, 0 }
-};
-
-static const autofilter_entry_type autofilter_objlist[] =
-{
- { STRING_COMMA_LEN ("crt0.o") },
- { STRING_COMMA_LEN ("crt1.o") },
- { STRING_COMMA_LEN ("crt2.o") },
- { STRING_COMMA_LEN ("dllcrt1.o") },
- { STRING_COMMA_LEN ("dllcrt2.o") },
- { STRING_COMMA_LEN ("gcrt0.o") },
- { STRING_COMMA_LEN ("gcrt1.o") },
- { STRING_COMMA_LEN ("gcrt2.o") },
- { STRING_COMMA_LEN ("crtbegin.o") },
- { STRING_COMMA_LEN ("crtend.o") },
- { NULL, 0 }
-};
-
-static const autofilter_entry_type autofilter_symbolprefixlist[] =
-{
- /* _imp_ is treated specially, as it is always underscored. */
- /* { STRING_COMMA_LEN ("_imp_") }, */
- /* Don't export some c++ symbols. */
- { STRING_COMMA_LEN ("__rtti_") },
- { STRING_COMMA_LEN ("__builtin_") },
- /* Don't re-export auto-imported symbols. */
- { STRING_COMMA_LEN ("_nm_") },
- /* Don't export symbols specifying internal DLL layout. */
- { STRING_COMMA_LEN ("_head_") },
- { STRING_COMMA_LEN ("_IMPORT_DESCRIPTOR_") },
- /* Don't export section labels or artificial symbols
- (eg ".weak.foo". */
- { STRING_COMMA_LEN (".") },
- { NULL, 0 }
-};
-
-static const autofilter_entry_type autofilter_symbolsuffixlist[] =
-{
- { STRING_COMMA_LEN ("_iname") },
- { STRING_COMMA_LEN ("_NULL_THUNK_DATA") },
- { NULL, 0 }
-};
-
-#define U(str) (pe_details->underscored ? "_" str : str)
-
-void
-pe_dll_id_target (const char *target)
-{
- int i;
-
- for (i = 0; pe_detail_list[i].target_name; i++)
- if (strcmp (pe_detail_list[i].target_name, target) == 0
- || strcmp (pe_detail_list[i].object_target, target) == 0)
- {
- pe_details = pe_detail_list + i;
- return;
- }
- einfo (_("%XUnsupported PEI architecture: %s\n"), target);
- exit (1);
-}
-
-/* Helper functions for qsort. Relocs must be sorted so that we can write
- them out by pages. */
-
-typedef struct
- {
- bfd_vma vma;
- char type;
- short extra;
- }
-reloc_data_type;
-
-static int
-reloc_sort (const void *va, const void *vb)
-{
- bfd_vma a = ((const reloc_data_type *) va)->vma;
- bfd_vma b = ((const reloc_data_type *) vb)->vma;
-
- return (a > b) ? 1 : ((a < b) ? -1 : 0);
-}
-
-static int
-pe_export_sort (const void *va, const void *vb)
-{
- const def_file_export *a = va;
- const def_file_export *b = vb;
-
- return strcmp (a->name, b->name);
-}
-
-/* Read and process the .DEF file. */
-
-/* These correspond to the entries in pe_def_file->exports[]. I use
- exported_symbol_sections[i] to tag whether or not the symbol was
- defined, since we can't export symbols we don't have. */
-
-static bfd_vma *exported_symbol_offsets;
-static struct bfd_section **exported_symbol_sections;
-static int export_table_size;
-static int count_exported;
-static int count_exported_byname;
-static int count_with_ordinals;
-static const char *dll_name;
-static int min_ordinal, max_ordinal;
-static int *exported_symbols;
-
-typedef struct exclude_list_struct
- {
- char *string;
- struct exclude_list_struct *next;
- int type;
- }
-exclude_list_struct;
-
-static struct exclude_list_struct *excludes = 0;
-
-void
-pe_dll_add_excludes (const char *new_excludes, const int type)
-{
- char *local_copy;
- char *exclude_string;
-
- local_copy = xstrdup (new_excludes);
-
- exclude_string = strtok (local_copy, ",:");
- for (; exclude_string; exclude_string = strtok (NULL, ",:"))
- {
- struct exclude_list_struct *new_exclude;
-
- new_exclude = xmalloc (sizeof (struct exclude_list_struct));
- new_exclude->string = xmalloc (strlen (exclude_string) + 1);
- strcpy (new_exclude->string, exclude_string);
- new_exclude->type = type;
- new_exclude->next = excludes;
- excludes = new_exclude;
- }
-
- free (local_copy);
-}
-
-static bfd_boolean
-is_import (const char* n)
-{
- return (CONST_STRNEQ (n, "__imp_"));
-}
-
-/* abfd is a bfd containing n (or NULL)
- It can be used for contextual checks. */
-
-static int
-auto_export (bfd *abfd, def_file *d, const char *n)
-{
- int i;
- struct exclude_list_struct *ex;
- const autofilter_entry_type *afptr;
- const char * libname = 0;
- if (abfd && abfd->my_archive)
- libname = lbasename (abfd->my_archive->filename);
-
- for (i = 0; i < d->num_exports; i++)
- if (strcmp (d->exports[i].name, n) == 0)
- return 0;
-
- if (pe_dll_do_default_excludes)
- {
- const char * p;
- int len;
-
- if (pe_dll_extra_pe_debug)
- printf ("considering exporting: %s, abfd=%p, abfd->my_arc=%p\n",
- n, abfd, abfd->my_archive);
-
- /* First of all, make context checks:
- Don't export anything from standard libs. */
- if (libname)
- {
- afptr = autofilter_liblist;
-
- while (afptr->name)
- {
- if (strncmp (libname, afptr->name, afptr->len) == 0 )
- return 0;
- afptr++;
- }
- }
-
- /* Next, exclude symbols from certain startup objects. */
-
- if (abfd && (p = lbasename (abfd->filename)))
- {
- afptr = autofilter_objlist;
- while (afptr->name)
- {
- if (strcmp (p, afptr->name) == 0)
- return 0;
- afptr++;
- }
- }
-
- /* Don't try to blindly exclude all symbols
- that begin with '__'; this was tried and
- it is too restrictive. Instead we have
- a target specific list to use: */
- afptr = pe_details->autofilter_symbollist;
-
- while (afptr->name)
- {
- if (strcmp (n, afptr->name) == 0)
- return 0;
-
- afptr++;
- }
-
- /* Next, exclude symbols starting with ... */
- afptr = autofilter_symbolprefixlist;
- while (afptr->name)
- {
- if (strncmp (n, afptr->name, afptr->len) == 0)
- return 0;
-
- afptr++;
- }
-
- /* Finally, exclude symbols ending with ... */
- len = strlen (n);
- afptr = autofilter_symbolsuffixlist;
- while (afptr->name)
- {
- if ((len >= afptr->len)
- /* Add 1 to insure match with trailing '\0'. */
- && strncmp (n + len - afptr->len, afptr->name,
- afptr->len + 1) == 0)
- return 0;
-
- afptr++;
- }
- }
-
- for (ex = excludes; ex; ex = ex->next)
- {
- if (ex->type == 1) /* exclude-libs */
- {
- if (libname
- && ((strcmp (libname, ex->string) == 0)
- || (strcasecmp ("ALL", ex->string) == 0)))
- return 0;
- }
- else if (strcmp (n, ex->string) == 0)
- return 0;
- }
-
- return 1;
-}
-
-static void
-process_def_file (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
-{
- int i, j;
- struct bfd_link_hash_entry *blhe;
- bfd *b;
- struct bfd_section *s;
- def_file_export *e = 0;
-
- if (!pe_def_file)
- pe_def_file = def_file_empty ();
-
- /* First, run around to all the objects looking for the .drectve
- sections, and push those into the def file too. */
- for (b = info->input_bfds; b; b = b->link_next)
- {
- s = bfd_get_section_by_name (b, ".drectve");
- if (s)
- {
- long size = s->size;
- char *buf = xmalloc (size);
-
- bfd_get_section_contents (b, s, buf, 0, size);
- def_file_add_directive (pe_def_file, buf, size);
- free (buf);
- }
- }
-
- /* If we are not building a DLL, when there are no exports
- we do not build an export table at all. */
- if (!pe_dll_export_everything && pe_def_file->num_exports == 0
- && info->executable)
- return;
-
- /* Now, maybe export everything else the default way. */
- if (pe_dll_export_everything || pe_def_file->num_exports == 0)
- {
- for (b = info->input_bfds; b; b = b->link_next)
- {
- asymbol **symbols;
- int nsyms, symsize;
-
- symsize = bfd_get_symtab_upper_bound (b);
- symbols = xmalloc (symsize);
- nsyms = bfd_canonicalize_symtab (b, symbols);
-
- for (j = 0; j < nsyms; j++)
- {
- /* We should export symbols which are either global or not
- anything at all. (.bss data is the latter)
- We should not export undefined symbols. */
- if (symbols[j]->section != &bfd_und_section
- && ((symbols[j]->flags & BSF_GLOBAL)
- || (symbols[j]->flags == BFD_FORT_COMM_DEFAULT_VALUE)))
- {
- const char *sn = symbols[j]->name;
-
- /* We should not re-export imported stuff. */
- {
- char *name;
- if (is_import (sn))
- continue;
-
- name = xmalloc (strlen ("__imp_") + strlen (sn) + 1);
- sprintf (name, "%s%s", "__imp_", sn);
-
- blhe = bfd_link_hash_lookup (info->hash, name,
- FALSE, FALSE, FALSE);
- free (name);
-
- if (blhe && blhe->type == bfd_link_hash_defined)
- continue;
- }
-
- if (pe_details->underscored && *sn == '_')
- sn++;
-
- if (auto_export (b, pe_def_file, sn))
- {
- def_file_export *p;
- p=def_file_add_export (pe_def_file, sn, 0, -1);
- /* Fill data flag properly, from dlltool.c. */
- p->flag_data = !(symbols[j]->flags & BSF_FUNCTION);
- }
- }
- }
- }
- }
-
-#undef NE
-#define NE pe_def_file->num_exports
-
- /* Canonicalize the export list. */
- if (pe_dll_kill_ats)
- {
- for (i = 0; i < NE; i++)
- {
- if (strchr (pe_def_file->exports[i].name, '@'))
- {
- /* This will preserve internal_name, which may have been
- pointing to the same memory as name, or might not
- have. */
- int lead_at = (*pe_def_file->exports[i].name == '@');
- char *tmp = xstrdup (pe_def_file->exports[i].name + lead_at);
- char *tmp_at = strchr (tmp, '@');
-
- if (tmp_at)
- *tmp_at = 0;
- else
- einfo (_("%XCannot export %s: invalid export name\n"),
- pe_def_file->exports[i].name);
- pe_def_file->exports[i].name = tmp;
- }
- }
- }
-
- if (pe_dll_stdcall_aliases)
- {
- for (i = 0; i < NE; i++)
- {
- if (is_import (pe_def_file->exports[i].name))
- continue;
-
- if (strchr (pe_def_file->exports[i].name, '@'))
- {
- int lead_at = (*pe_def_file->exports[i].name == '@');
- char *tmp = xstrdup (pe_def_file->exports[i].name + lead_at);
-
- *(strchr (tmp, '@')) = 0;
- if (auto_export (NULL, pe_def_file, tmp))
- def_file_add_export (pe_def_file, tmp,
- pe_def_file->exports[i].internal_name,
- -1);
- else
- free (tmp);
- }
- }
- }
-
- /* Convenience, but watch out for it changing. */
- e = pe_def_file->exports;
-
- exported_symbol_offsets = xmalloc (NE * sizeof (bfd_vma));
- exported_symbol_sections = xmalloc (NE * sizeof (struct bfd_section *));
-
- memset (exported_symbol_sections, 0, NE * sizeof (struct bfd_section *));
- max_ordinal = 0;
- min_ordinal = 65536;
- count_exported = 0;
- count_exported_byname = 0;
- count_with_ordinals = 0;
-
- qsort (pe_def_file->exports, NE, sizeof (pe_def_file->exports[0]),
- pe_export_sort);
- for (i = 0, j = 0; i < NE; i++)
- {
- if (i > 0 && strcmp (e[i].name, e[i - 1].name) == 0)
- {
- /* This is a duplicate. */
- if (e[j - 1].ordinal != -1
- && e[i].ordinal != -1
- && e[j - 1].ordinal != e[i].ordinal)
- {
- if (pe_dll_warn_dup_exports)
- /* xgettext:c-format */
- einfo (_("%XError, duplicate EXPORT with ordinals: %s (%d vs %d)\n"),
- e[j - 1].name, e[j - 1].ordinal, e[i].ordinal);
- }
- else
- {
- if (pe_dll_warn_dup_exports)
- /* xgettext:c-format */
- einfo (_("Warning, duplicate EXPORT: %s\n"),
- e[j - 1].name);
- }
-
- if (e[i].ordinal != -1)
- e[j - 1].ordinal = e[i].ordinal;
- e[j - 1].flag_private |= e[i].flag_private;
- e[j - 1].flag_constant |= e[i].flag_constant;
- e[j - 1].flag_noname |= e[i].flag_noname;
- e[j - 1].flag_data |= e[i].flag_data;
- }
- else
- {
- if (i != j)
- e[j] = e[i];
- j++;
- }
- }
- pe_def_file->num_exports = j; /* == NE */
-
- for (i = 0; i < NE; i++)
- {
- char *name;
-
- /* Check for forward exports */
- if (strchr (pe_def_file->exports[i].internal_name, '.'))
- {
- count_exported++;
- if (!pe_def_file->exports[i].flag_noname)
- count_exported_byname++;
-
- pe_def_file->exports[i].flag_forward = 1;
-
- if (pe_def_file->exports[i].ordinal != -1)
- {
- if (max_ordinal < pe_def_file->exports[i].ordinal)
- max_ordinal = pe_def_file->exports[i].ordinal;
- if (min_ordinal > pe_def_file->exports[i].ordinal)
- min_ordinal = pe_def_file->exports[i].ordinal;
- count_with_ordinals++;
- }
-
- continue;
- }
-
- name = xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2);
- if (pe_details->underscored
- && (*pe_def_file->exports[i].internal_name != '@'))
- {
- *name = '_';
- strcpy (name + 1, pe_def_file->exports[i].internal_name);
- }
- else
- strcpy (name, pe_def_file->exports[i].internal_name);
-
- blhe = bfd_link_hash_lookup (info->hash,
- name,
- FALSE, FALSE, TRUE);
-
- if (blhe
- && (blhe->type == bfd_link_hash_defined
- || (blhe->type == bfd_link_hash_common)))
- {
- count_exported++;
- if (!pe_def_file->exports[i].flag_noname)
- count_exported_byname++;
-
- /* Only fill in the sections. The actual offsets are computed
- in fill_exported_offsets() after common symbols are laid
- out. */
- if (blhe->type == bfd_link_hash_defined)
- exported_symbol_sections[i] = blhe->u.def.section;
- else
- exported_symbol_sections[i] = blhe->u.c.p->section;
-
- if (pe_def_file->exports[i].ordinal != -1)
- {
- if (max_ordinal < pe_def_file->exports[i].ordinal)
- max_ordinal = pe_def_file->exports[i].ordinal;
- if (min_ordinal > pe_def_file->exports[i].ordinal)
- min_ordinal = pe_def_file->exports[i].ordinal;
- count_with_ordinals++;
- }
- }
- else if (blhe && blhe->type == bfd_link_hash_undefined)
- {
- /* xgettext:c-format */
- einfo (_("%XCannot export %s: symbol not defined\n"),
- pe_def_file->exports[i].internal_name);
- }
- else if (blhe)
- {
- /* xgettext:c-format */
- einfo (_("%XCannot export %s: symbol wrong type (%d vs %d)\n"),
- pe_def_file->exports[i].internal_name,
- blhe->type, bfd_link_hash_defined);
- }
- else
- {
- /* xgettext:c-format */
- einfo (_("%XCannot export %s: symbol not found\n"),
- pe_def_file->exports[i].internal_name);
- }
- free (name);
- }
-}
-
-/* Build the bfd that will contain .edata and .reloc sections. */
-
-static void
-build_filler_bfd (int include_edata)
-{
- lang_input_statement_type *filler_file;
- filler_file = lang_add_input_file ("dll stuff",
- lang_input_file_is_fake_enum,
- NULL);
- filler_file->the_bfd = filler_bfd = bfd_create ("dll stuff",
- link_info.output_bfd);
- if (filler_bfd == NULL
- || !bfd_set_arch_mach (filler_bfd,
- bfd_get_arch (link_info.output_bfd),
- bfd_get_mach (link_info.output_bfd)))
- {
- einfo ("%X%P: can not create BFD: %E\n");
- return;
- }
-
- if (include_edata)
- {
- edata_s = bfd_make_section_old_way (filler_bfd, ".edata");
- if (edata_s == NULL
- || !bfd_set_section_flags (filler_bfd, edata_s,
- (SEC_HAS_CONTENTS
- | SEC_ALLOC
- | SEC_LOAD
- | SEC_KEEP
- | SEC_IN_MEMORY)))
- {
- einfo ("%X%P: can not create .edata section: %E\n");
- return;
- }
- bfd_set_section_size (filler_bfd, edata_s, edata_sz);
- }
-
- reloc_s = bfd_make_section_old_way (filler_bfd, ".reloc");
- if (reloc_s == NULL
- || !bfd_set_section_flags (filler_bfd, reloc_s,
- (SEC_HAS_CONTENTS
- | SEC_ALLOC
- | SEC_LOAD
- | SEC_KEEP
- | SEC_IN_MEMORY)))
- {
- einfo ("%X%P: can not create .reloc section: %E\n");
- return;
- }
-
- bfd_set_section_size (filler_bfd, reloc_s, 0);
-
- ldlang_add_file (filler_file);
-}
-
-/* Gather all the exported symbols and build the .edata section. */
-
-static void
-generate_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
-{
- int i, next_ordinal;
- int name_table_size = 0;
- const char *dlnp;
-
- /* First, we need to know how many exported symbols there are,
- and what the range of ordinals is. */
- if (pe_def_file->name)
- dll_name = pe_def_file->name;
- else
- {
- dll_name = abfd->filename;
-
- for (dlnp = dll_name; *dlnp; dlnp++)
- if (*dlnp == '\\' || *dlnp == '/' || *dlnp == ':')
- dll_name = dlnp + 1;
- }
-
- if (count_with_ordinals && max_ordinal > count_exported)
- {
- if (min_ordinal > max_ordinal - count_exported + 1)
- min_ordinal = max_ordinal - count_exported + 1;
- }
- else
- {
- min_ordinal = 1;
- max_ordinal = count_exported;
- }
-
- export_table_size = max_ordinal - min_ordinal + 1;
- exported_symbols = xmalloc (export_table_size * sizeof (int));
- for (i = 0; i < export_table_size; i++)
- exported_symbols[i] = -1;
-
- /* Now we need to assign ordinals to those that don't have them. */
- for (i = 0; i < NE; i++)
- {
- if (exported_symbol_sections[i] ||
- pe_def_file->exports[i].flag_forward)
- {
- if (pe_def_file->exports[i].ordinal != -1)
- {
- int ei = pe_def_file->exports[i].ordinal - min_ordinal;
- int pi = exported_symbols[ei];
-
- if (pi != -1)
- {
- /* xgettext:c-format */
- einfo (_("%XError, ordinal used twice: %d (%s vs %s)\n"),
- pe_def_file->exports[i].ordinal,
- pe_def_file->exports[i].name,
- pe_def_file->exports[pi].name);
- }
- exported_symbols[ei] = i;
- }
- name_table_size += strlen (pe_def_file->exports[i].name) + 1;
- }
-
- /* Reserve space for the forward name. */
- if (pe_def_file->exports[i].flag_forward)
- {
- name_table_size += strlen (pe_def_file->exports[i].internal_name) + 1;
- }
- }
-
- next_ordinal = min_ordinal;
- for (i = 0; i < NE; i++)
- if ((exported_symbol_sections[i] ||
- pe_def_file->exports[i].flag_forward) &&
- pe_def_file->exports[i].ordinal == -1)
- {
- while (exported_symbols[next_ordinal - min_ordinal] != -1)
- next_ordinal++;
-
- exported_symbols[next_ordinal - min_ordinal] = i;
- pe_def_file->exports[i].ordinal = next_ordinal;
- }
-
- /* OK, now we can allocate some memory. */
- edata_sz = (40 /* directory */
- + 4 * export_table_size /* addresses */
- + 4 * count_exported_byname /* name ptrs */
- + 2 * count_exported_byname /* ordinals */
- + name_table_size + strlen (dll_name) + 1);
-}
-
-/* Fill the exported symbol offsets. The preliminary work has already
- been done in process_def_file(). */
-
-static void
-fill_exported_offsets (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
-{
- int i;
- struct bfd_link_hash_entry *blhe;
-
- for (i = 0; i < pe_def_file->num_exports; i++)
- {
- char *name;
-
- name = xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2);
- if (pe_details->underscored
- && *pe_def_file->exports[i].internal_name != '@')
- {
- *name = '_';
- strcpy (name + 1, pe_def_file->exports[i].internal_name);
- }
- else
- strcpy (name, pe_def_file->exports[i].internal_name);
-
- blhe = bfd_link_hash_lookup (info->hash,
- name,
- FALSE, FALSE, TRUE);
-
- if (blhe && blhe->type == bfd_link_hash_defined)
- exported_symbol_offsets[i] = blhe->u.def.value;
-
- free (name);
- }
-}
-
-static void
-fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
-{
- int s, hint;
- unsigned char *edirectory;
- unsigned char *eaddresses;
- unsigned char *enameptrs;
- unsigned char *eordinals;
- char *enamestr;
- time_t now;
-
- time (&now);
-
- edata_d = xmalloc (edata_sz);
-
- /* Note use of array pointer math here. */
- edirectory = edata_d;
- eaddresses = edata_d + 40;
- enameptrs = eaddresses + 4 * export_table_size;
- eordinals = enameptrs + 4 * count_exported_byname;
- enamestr = (char *) eordinals + 2 * count_exported_byname;
-
-#define ERVA(ptr) (((unsigned char *)(ptr) - edata_d) \
- + edata_s->output_section->vma - image_base)
-
- memset (edata_d, 0, edata_sz);
- bfd_put_32 (abfd, now, edata_d + 4);
- if (pe_def_file->version_major != -1)
- {
- bfd_put_16 (abfd, pe_def_file->version_major, edata_d + 8);
- bfd_put_16 (abfd, pe_def_file->version_minor, edata_d + 10);
- }
-
- bfd_put_32 (abfd, ERVA (enamestr), edata_d + 12);
- strcpy (enamestr, dll_name);
- enamestr += strlen (enamestr) + 1;
- bfd_put_32 (abfd, min_ordinal, edata_d + 16);
- bfd_put_32 (abfd, export_table_size, edata_d + 20);
- bfd_put_32 (abfd, count_exported_byname, edata_d + 24);
- bfd_put_32 (abfd, ERVA (eaddresses), edata_d + 28);
- bfd_put_32 (abfd, ERVA (enameptrs), edata_d + 32);
- bfd_put_32 (abfd, ERVA (eordinals), edata_d + 36);
-
- fill_exported_offsets (abfd, info);
-
- /* Ok, now for the filling in part.
- Scan alphabetically - ie the ordering in the exports[] table,
- rather than by ordinal - the ordering in the exported_symbol[]
- table. See dlltool.c and:
- http://sources.redhat.com/ml/binutils/2003-04/msg00379.html
- for more information. */
- hint = 0;
- for (s = 0; s < NE; s++)
- {
- struct bfd_section *ssec = exported_symbol_sections[s];
- if (pe_def_file->exports[s].ordinal != -1 &&
- (pe_def_file->exports[s].flag_forward || ssec != NULL))
- {
- int ord = pe_def_file->exports[s].ordinal;
-
- if (pe_def_file->exports[s].flag_forward)
- {
- bfd_put_32 (abfd, ERVA (enamestr),
- eaddresses + 4 * (ord - min_ordinal));
-
- strcpy (enamestr, pe_def_file->exports[s].internal_name);
- enamestr += strlen (pe_def_file->exports[s].internal_name) + 1;
- }
- else
- {
- bfd_vma srva = (exported_symbol_offsets[s]
- + ssec->output_section->vma
- + ssec->output_offset);
-
- bfd_put_32 (abfd, srva - image_base,
- eaddresses + 4 * (ord - min_ordinal));
- }
-
- if (!pe_def_file->exports[s].flag_noname)
- {
- char *ename = pe_def_file->exports[s].name;
-
- bfd_put_32 (abfd, ERVA (enamestr), enameptrs);
- enameptrs += 4;
- strcpy (enamestr, ename);
- enamestr += strlen (enamestr) + 1;
- bfd_put_16 (abfd, ord - min_ordinal, eordinals);
- eordinals += 2;
- pe_def_file->exports[s].hint = hint++;
- }
- }
- }
-}
-
-
-static struct bfd_section *current_sec;
-
-void
-pe_walk_relocs_of_symbol (struct bfd_link_info *info,
- const char *name,
- int (*cb) (arelent *, asection *))
-{
- bfd *b;
- asection *s;
-
- for (b = info->input_bfds; b; b = b->link_next)
- {
- asymbol **symbols;
- int nsyms, symsize;
-
- symsize = bfd_get_symtab_upper_bound (b);
- symbols = xmalloc (symsize);
- nsyms = bfd_canonicalize_symtab (b, symbols);
-
- for (s = b->sections; s; s = s->next)
- {
- arelent **relocs;
- int relsize, nrelocs, i;
- int flags = bfd_get_section_flags (b, s);
-
- /* Skip discarded linkonce sections. */
- if (flags & SEC_LINK_ONCE
- && s->output_section == bfd_abs_section_ptr)
- continue;
-
- current_sec = s;
-
- relsize = bfd_get_reloc_upper_bound (b, s);
- relocs = xmalloc (relsize);
- nrelocs = bfd_canonicalize_reloc (b, s, relocs, symbols);
-
- for (i = 0; i < nrelocs; i++)
- {
- struct bfd_symbol *sym = *relocs[i]->sym_ptr_ptr;
-
- if (!strcmp (name, sym->name))
- cb (relocs[i], s);
- }
-
- free (relocs);
-
- /* Warning: the allocated symbols are remembered in BFD and reused
- later, so don't free them! */
- /* free (symbols); */
- }
- }
-}
-
-/* Gather all the relocations and build the .reloc section. */
-
-static void
-generate_reloc (bfd *abfd, struct bfd_link_info *info)
-{
-
- /* For .reloc stuff. */
- reloc_data_type *reloc_data;
- int total_relocs = 0;
- int i;
- bfd_vma sec_page = (bfd_vma) -1;
- bfd_vma page_ptr, page_count;
- int bi;
- bfd *b;
- struct bfd_section *s;
-
- total_relocs = 0;
- for (b = info->input_bfds; b; b = b->link_next)
- for (s = b->sections; s; s = s->next)
- total_relocs += s->reloc_count;
-
- reloc_data = xmalloc (total_relocs * sizeof (reloc_data_type));
-
- total_relocs = 0;
- bi = 0;
- for (bi = 0, b = info->input_bfds; b; bi++, b = b->link_next)
- {
- arelent **relocs;
- int relsize, nrelocs, i;
-
- for (s = b->sections; s; s = s->next)
- {
- bfd_vma sec_vma = s->output_section->vma + s->output_offset;
- asymbol **symbols;
- int nsyms, symsize;
-
- /* If it's not loaded, we don't need to relocate it this way. */
- if (!(s->output_section->flags & SEC_LOAD))
- continue;
-
- /* I don't know why there would be a reloc for these, but I've
- seen it happen - DJ */
- if (s->output_section == &bfd_abs_section)
- continue;
-
- if (s->output_section->vma == 0)
- {
- /* Huh? Shouldn't happen, but punt if it does. */
- einfo ("DJ: zero vma section reloc detected: `%s' #%d f=%d\n",
- s->output_section->name, s->output_section->index,
- s->output_section->flags);
- continue;
- }
-
- symsize = bfd_get_symtab_upper_bound (b);
- symbols = xmalloc (symsize);
- nsyms = bfd_canonicalize_symtab (b, symbols);
-
- relsize = bfd_get_reloc_upper_bound (b, s);
- relocs = xmalloc (relsize);
- nrelocs = bfd_canonicalize_reloc (b, s, relocs, symbols);
-
- for (i = 0; i < nrelocs; i++)
- {
- if (pe_dll_extra_pe_debug)
- {
- struct bfd_symbol *sym = *relocs[i]->sym_ptr_ptr;
- printf ("rel: %s\n", sym->name);
- }
- if (!relocs[i]->howto->pc_relative
- && relocs[i]->howto->type != pe_details->imagebase_reloc)
- {
- bfd_vma sym_vma;
- struct bfd_symbol *sym = *relocs[i]->sym_ptr_ptr;
-
- /* Don't create relocs for undefined weak symbols. */
- if (sym->flags == BSF_WEAK)
- {
- struct bfd_link_hash_entry *blhe
- = bfd_link_hash_lookup (info->hash, sym->name,
- FALSE, FALSE, FALSE);
- if (!blhe || blhe->type != bfd_link_hash_defined)
- continue;
- }
-
- sym_vma = (relocs[i]->addend
- + sym->value
- + sym->section->vma
- + sym->section->output_offset
- + sym->section->output_section->vma);
- reloc_data[total_relocs].vma = sec_vma + relocs[i]->address;
-
-#define BITS_AND_SHIFT(bits, shift) (bits * 1000 | shift)
-
- switch BITS_AND_SHIFT (relocs[i]->howto->bitsize,
- relocs[i]->howto->rightshift)
- {
-#ifdef pe_use_x86_64
- case BITS_AND_SHIFT (64, 0):
- reloc_data[total_relocs].type = 10;
- total_relocs++;
- break;
-#endif
- case BITS_AND_SHIFT (32, 0):
- reloc_data[total_relocs].type = 3;
- total_relocs++;
- break;
- case BITS_AND_SHIFT (16, 0):
- reloc_data[total_relocs].type = 2;
- total_relocs++;
- break;
- case BITS_AND_SHIFT (16, 16):
- reloc_data[total_relocs].type = 4;
- /* FIXME: we can't know the symbol's right value
- yet, but we probably can safely assume that
- CE will relocate us in 64k blocks, so leaving
- it zero is safe. */
- reloc_data[total_relocs].extra = 0;
- total_relocs++;
- break;
- case BITS_AND_SHIFT (26, 2):
- reloc_data[total_relocs].type = 5;
- total_relocs++;
- break;
- case BITS_AND_SHIFT (24, 2):
- /* FIXME: 0 is ARM_26D, it is defined in bfd/coff-arm.c
- Those ARM_xxx definitions should go in proper
- header someday. */
- if (relocs[i]->howto->type == 0
- /* Older GNU linkers used 5 instead of 0 for this reloc. */
- || relocs[i]->howto->type == 5)
- /* This is an ARM_26D reloc, which is an ARM_26 reloc
- that has already been fully processed during a
- previous link stage, so ignore it here. */
- break;
- /* Fall through. */
- default:
- /* xgettext:c-format */
- einfo (_("%XError: %d-bit reloc in dll\n"),
- relocs[i]->howto->bitsize);
- break;
- }
- }
- }
- free (relocs);
- /* Warning: the allocated symbols are remembered in BFD and
- reused later, so don't free them! */
- }
- }
-
- /* At this point, we have total_relocs relocation addresses in
- reloc_addresses, which are all suitable for the .reloc section.
- We must now create the new sections. */
- qsort (reloc_data, total_relocs, sizeof (*reloc_data), reloc_sort);
-
- for (i = 0; i < total_relocs; i++)
- {
- bfd_vma this_page = (reloc_data[i].vma >> 12);
-
- if (this_page != sec_page)
- {
- reloc_sz = (reloc_sz + 3) & ~3; /* 4-byte align. */
- reloc_sz += 8;
- sec_page = this_page;
- }
-
- reloc_sz += 2;
-
- if (reloc_data[i].type == 4)
- reloc_sz += 2;
- }
-
- reloc_sz = (reloc_sz + 3) & ~3; /* 4-byte align. */
- reloc_d = xmalloc (reloc_sz);
- sec_page = (bfd_vma) -1;
- reloc_sz = 0;
- page_ptr = (bfd_vma) -1;
- page_count = 0;
-
- for (i = 0; i < total_relocs; i++)
- {
- bfd_vma rva = reloc_data[i].vma - image_base;
- bfd_vma this_page = (rva & ~0xfff);
-
- if (this_page != sec_page)
- {
- while (reloc_sz & 3)
- reloc_d[reloc_sz++] = 0;
-
- if (page_ptr != (bfd_vma) -1)
- bfd_put_32 (abfd, reloc_sz - page_ptr, reloc_d + page_ptr + 4);
-
- bfd_put_32 (abfd, this_page, reloc_d + reloc_sz);
- page_ptr = reloc_sz;
- reloc_sz += 8;
- sec_page = this_page;
- page_count = 0;
- }
-
- bfd_put_16 (abfd, (rva & 0xfff) + (reloc_data[i].type << 12),
- reloc_d + reloc_sz);
- reloc_sz += 2;
-
- if (reloc_data[i].type == 4)
- {
- bfd_put_16 (abfd, reloc_data[i].extra, reloc_d + reloc_sz);
- reloc_sz += 2;
- }
-
- page_count++;
- }
-
- while (reloc_sz & 3)
- reloc_d[reloc_sz++] = 0;
-
- if (page_ptr != (bfd_vma) -1)
- bfd_put_32 (abfd, reloc_sz - page_ptr, reloc_d + page_ptr + 4);
-
- while (reloc_sz < reloc_s->size)
- reloc_d[reloc_sz++] = 0;
-}
-
-/* Given the exiting def_file structure, print out a .DEF file that
- corresponds to it. */
-
-static void
-quoteput (char *s, FILE *f, int needs_quotes)
-{
- char *cp;
-
- for (cp = s; *cp; cp++)
- if (*cp == '\''
- || *cp == '"'
- || *cp == '\\'
- || ISSPACE (*cp)
- || *cp == ','
- || *cp == ';')
- needs_quotes = 1;
-
- if (needs_quotes)
- {
- putc ('"', f);
-
- while (*s)
- {
- if (*s == '"' || *s == '\\')
- putc ('\\', f);
-
- putc (*s, f);
- s++;
- }
-
- putc ('"', f);
- }
- else
- fputs (s, f);
-}
-
-void
-pe_dll_generate_def_file (const char *pe_out_def_filename)
-{
- int i;
- FILE *out = fopen (pe_out_def_filename, "w");
-
- if (out == NULL)
- /* xgettext:c-format */
- einfo (_("%s: Can't open output def file %s\n"),
- program_name, pe_out_def_filename);
-
- if (pe_def_file)
- {
- if (pe_def_file->name)
- {
- if (pe_def_file->is_dll)
- fprintf (out, "LIBRARY ");
- else
- fprintf (out, "NAME ");
-
- quoteput (pe_def_file->name, out, 1);
-
- if (pe_data (link_info.output_bfd)->pe_opthdr.ImageBase)
- {
- fprintf (out, " BASE=0x");
- fprintf_vma (out, ((bfd_vma) pe_data (link_info.output_bfd)->pe_opthdr.ImageBase));
- }
- fprintf (out, "\n");
- }
-
- if (pe_def_file->description)
- {
- fprintf (out, "DESCRIPTION ");
- quoteput (pe_def_file->description, out, 1);
- fprintf (out, "\n");
- }
-
- if (pe_def_file->version_minor != -1)
- fprintf (out, "VERSION %d.%d\n", pe_def_file->version_major,
- pe_def_file->version_minor);
- else if (pe_def_file->version_major != -1)
- fprintf (out, "VERSION %d\n", pe_def_file->version_major);
-
- if (pe_def_file->stack_reserve != -1 || pe_def_file->heap_reserve != -1)
- fprintf (out, "\n");
-
- if (pe_def_file->stack_commit != -1)
- fprintf (out, "STACKSIZE 0x%x,0x%x\n",
- pe_def_file->stack_reserve, pe_def_file->stack_commit);
- else if (pe_def_file->stack_reserve != -1)
- fprintf (out, "STACKSIZE 0x%x\n", pe_def_file->stack_reserve);
-
- if (pe_def_file->heap_commit != -1)
- fprintf (out, "HEAPSIZE 0x%x,0x%x\n",
- pe_def_file->heap_reserve, pe_def_file->heap_commit);
- else if (pe_def_file->heap_reserve != -1)
- fprintf (out, "HEAPSIZE 0x%x\n", pe_def_file->heap_reserve);
-
- if (pe_def_file->num_section_defs > 0)
- {
- fprintf (out, "\nSECTIONS\n\n");
-
- for (i = 0; i < pe_def_file->num_section_defs; i++)
- {
- fprintf (out, " ");
- quoteput (pe_def_file->section_defs[i].name, out, 0);
-
- if (pe_def_file->section_defs[i].class)
- {
- fprintf (out, " CLASS ");
- quoteput (pe_def_file->section_defs[i].class, out, 0);
- }
-
- if (pe_def_file->section_defs[i].flag_read)
- fprintf (out, " READ");
-
- if (pe_def_file->section_defs[i].flag_write)
- fprintf (out, " WRITE");
-
- if (pe_def_file->section_defs[i].flag_execute)
- fprintf (out, " EXECUTE");
-
- if (pe_def_file->section_defs[i].flag_shared)
- fprintf (out, " SHARED");
-
- fprintf (out, "\n");
- }
- }
-
- if (pe_def_file->num_exports > 0)
- {
- fprintf (out, "EXPORTS\n");
-
- for (i = 0; i < pe_def_file->num_exports; i++)
- {
- def_file_export *e = pe_def_file->exports + i;
- fprintf (out, " ");
- quoteput (e->name, out, 0);
-
- if (e->internal_name && strcmp (e->internal_name, e->name))
- {
- fprintf (out, " = ");
- quoteput (e->internal_name, out, 0);
- }
-
- if (e->ordinal != -1)
- fprintf (out, " @%d", e->ordinal);
-
- if (e->flag_private)
- fprintf (out, " PRIVATE");
-
- if (e->flag_constant)
- fprintf (out, " CONSTANT");
-
- if (e->flag_noname)
- fprintf (out, " NONAME");
-
- if (e->flag_data)
- fprintf (out, " DATA");
-
- fprintf (out, "\n");
- }
- }
-
- if (pe_def_file->num_imports > 0)
- {
- fprintf (out, "\nIMPORTS\n\n");
-
- for (i = 0; i < pe_def_file->num_imports; i++)
- {
- def_file_import *im = pe_def_file->imports + i;
- fprintf (out, " ");
-
- if (im->internal_name
- && (!im->name || strcmp (im->internal_name, im->name)))
- {
- quoteput (im->internal_name, out, 0);
- fprintf (out, " = ");
- }
-
- quoteput (im->module->name, out, 0);
- fprintf (out, ".");
-
- if (im->name)
- quoteput (im->name, out, 0);
- else
- fprintf (out, "%d", im->ordinal);
-
- fprintf (out, "\n");
- }
- }
- }
- else
- fprintf (out, _("; no contents available\n"));
-
- if (fclose (out) == EOF)
- /* xgettext:c-format */
- einfo (_("%P: Error closing file `%s'\n"), pe_out_def_filename);
-}
-
-/* Generate the import library. */
-
-static asymbol **symtab;
-static int symptr;
-static int tmp_seq;
-static const char *dll_filename;
-static char *dll_symname;
-
-#define UNDSEC (asection *) &bfd_und_section
-
-static asection *
-quick_section (bfd *abfd, const char *name, int flags, int align)
-{
- asection *sec;
- asymbol *sym;
-
- sec = bfd_make_section_old_way (abfd, name);
- bfd_set_section_flags (abfd, sec, flags | SEC_ALLOC | SEC_LOAD | SEC_KEEP);
- bfd_set_section_alignment (abfd, sec, align);
- /* Remember to undo this before trying to link internally! */
- sec->output_section = sec;
-
- sym = bfd_make_empty_symbol (abfd);
- symtab[symptr++] = sym;
- sym->name = sec->name;
- sym->section = sec;
- sym->flags = BSF_LOCAL;
- sym->value = 0;
-
- return sec;
-}
-
-static void
-quick_symbol (bfd *abfd,
- const char *n1,
- const char *n2,
- const char *n3,
- asection *sec,
- int flags,
- int addr)
-{
- asymbol *sym;
- char *name = xmalloc (strlen (n1) + strlen (n2) + strlen (n3) + 1);
-
- strcpy (name, n1);
- strcat (name, n2);
- strcat (name, n3);
- sym = bfd_make_empty_symbol (abfd);
- sym->name = name;
- sym->section = sec;
- sym->flags = flags;
- sym->value = addr;
- symtab[symptr++] = sym;
-}
-
-static arelent *reltab = 0;
-static int relcount = 0, relsize = 0;
-
-static void
-quick_reloc (bfd *abfd, bfd_size_type address, int which_howto, int symidx)
-{
- if (relcount >= relsize - 1)
- {
- relsize += 10;
- if (reltab)
- reltab = xrealloc (reltab, relsize * sizeof (arelent));
- else
- reltab = xmalloc (relsize * sizeof (arelent));
- }
- reltab[relcount].address = address;
- reltab[relcount].addend = 0;
- reltab[relcount].howto = bfd_reloc_type_lookup (abfd, which_howto);
- reltab[relcount].sym_ptr_ptr = symtab + symidx;
- relcount++;
-}
-
-static void
-save_relocs (asection *sec)
-{
- int i;
-
- sec->relocation = reltab;
- sec->reloc_count = relcount;
- sec->orelocation = xmalloc ((relcount + 1) * sizeof (arelent *));
- for (i = 0; i < relcount; i++)
- sec->orelocation[i] = sec->relocation + i;
- sec->orelocation[relcount] = 0;
- sec->flags |= SEC_RELOC;
- reltab = 0;
- relcount = relsize = 0;
-}
-
-/* .section .idata$2
- .global __head_my_dll
- __head_my_dll:
- .rva hname
- .long 0
- .long 0
- .rva __my_dll_iname
- .rva fthunk
-
- .section .idata$5
- .long 0
- fthunk:
-
- .section .idata$4
- .long 0
- hname: */
-
-static bfd *
-make_head (bfd *parent)
-{
- asection *id2, *id5, *id4;
- unsigned char *d2, *d5, *d4;
- char *oname;
- bfd *abfd;
-
- oname = xmalloc (20);
- sprintf (oname, "d%06d.o", tmp_seq);
- tmp_seq++;
-
- abfd = bfd_create (oname, parent);
- bfd_find_target (pe_details->object_target, abfd);
- bfd_make_writable (abfd);
-
- bfd_set_format (abfd, bfd_object);
- bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
-
- symptr = 0;
- symtab = xmalloc (6 * sizeof (asymbol *));
- id2 = quick_section (abfd, ".idata$2", SEC_HAS_CONTENTS, 2);
- id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
- id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
- quick_symbol (abfd, U ("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0);
- quick_symbol (abfd, U (""), dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0);
-
- /* OK, pay attention here. I got confused myself looking back at
- it. We create a four-byte section to mark the beginning of the
- list, and we include an offset of 4 in the section, so that the
- pointer to the list points to the *end* of this section, which is
- the start of the list of sections from other objects. */
-
- bfd_set_section_size (abfd, id2, 20);
- d2 = xmalloc (20);
- id2->contents = d2;
- memset (d2, 0, 20);
- d2[0] = d2[16] = PE_IDATA5_SIZE; /* Reloc addend. */
- quick_reloc (abfd, 0, BFD_RELOC_RVA, 2);
- quick_reloc (abfd, 12, BFD_RELOC_RVA, 4);
- quick_reloc (abfd, 16, BFD_RELOC_RVA, 1);
- save_relocs (id2);
-
- bfd_set_section_size (abfd, id5, PE_IDATA5_SIZE);
- d5 = xmalloc (PE_IDATA5_SIZE);
- id5->contents = d5;
- memset (d5, 0, PE_IDATA5_SIZE);
-
- bfd_set_section_size (abfd, id4, PE_IDATA4_SIZE);
- d4 = xmalloc (PE_IDATA4_SIZE);
- id4->contents = d4;
- memset (d4, 0, PE_IDATA4_SIZE);
-
- bfd_set_symtab (abfd, symtab, symptr);
-
- bfd_set_section_contents (abfd, id2, d2, 0, 20);
- bfd_set_section_contents (abfd, id5, d5, 0, PE_IDATA5_SIZE);
- bfd_set_section_contents (abfd, id4, d4, 0, PE_IDATA4_SIZE);
-
- bfd_make_readable (abfd);
- return abfd;
-}
-
-/* .section .idata$4
- .long 0
- [.long 0] for PE+
- .section .idata$5
- .long 0
- [.long 0] for PE+
- .section idata$7
- .global __my_dll_iname
- __my_dll_iname:
- .asciz "my.dll" */
-
-static bfd *
-make_tail (bfd *parent)
-{
- asection *id4, *id5, *id7;
- unsigned char *d4, *d5, *d7;
- int len;
- char *oname;
- bfd *abfd;
-
- oname = xmalloc (20);
- sprintf (oname, "d%06d.o", tmp_seq);
- tmp_seq++;
-
- abfd = bfd_create (oname, parent);
- bfd_find_target (pe_details->object_target, abfd);
- bfd_make_writable (abfd);
-
- bfd_set_format (abfd, bfd_object);
- bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
-
- symptr = 0;
- symtab = xmalloc (5 * sizeof (asymbol *));
- id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
- id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
- id7 = quick_section (abfd, ".idata$7", SEC_HAS_CONTENTS, 2);
- quick_symbol (abfd, U (""), dll_symname, "_iname", id7, BSF_GLOBAL, 0);
-
- bfd_set_section_size (abfd, id4, PE_IDATA4_SIZE);
- d4 = xmalloc (PE_IDATA4_SIZE);
- id4->contents = d4;
- memset (d4, 0, PE_IDATA4_SIZE);
-
- bfd_set_section_size (abfd, id5, PE_IDATA5_SIZE);
- d5 = xmalloc (PE_IDATA5_SIZE);
- id5->contents = d5;
- memset (d5, 0, PE_IDATA5_SIZE);
-
- len = strlen (dll_filename) + 1;
- if (len & 1)
- len++;
- bfd_set_section_size (abfd, id7, len);
- d7 = xmalloc (len);
- id7->contents = d7;
- strcpy ((char *) d7, dll_filename);
- /* If len was odd, the above
- strcpy leaves behind an undefined byte. That is harmless,
- but we set it to 0 just so the binary dumps are pretty. */
- d7[len - 1] = 0;
-
- bfd_set_symtab (abfd, symtab, symptr);
-
- bfd_set_section_contents (abfd, id4, d4, 0, PE_IDATA4_SIZE);
- bfd_set_section_contents (abfd, id5, d5, 0, PE_IDATA5_SIZE);
- bfd_set_section_contents (abfd, id7, d7, 0, len);
-
- bfd_make_readable (abfd);
- return abfd;
-}
-
-/* .text
- .global _function
- .global ___imp_function
- .global __imp__function
- _function:
- jmp *__imp__function:
-
- .section idata$7
- .long __head_my_dll
-
- .section .idata$5
- ___imp_function:
- __imp__function:
- iat?
- .section .idata$4
- iat?
- .section .idata$6
- ID<ordinal>:
- .short <hint>
- .asciz "function" xlate? (add underscore, kill at) */
-
-static const unsigned char jmp_ix86_bytes[] =
-{
- 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90
-};
-
-/* _function:
- mov.l ip+8,r0
- mov.l @r0,r0
- jmp @r0
- nop
- .dw __imp_function */
-
-static const unsigned char jmp_sh_bytes[] =
-{
- 0x01, 0xd0, 0x02, 0x60, 0x2b, 0x40, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-/* _function:
- lui $t0,<high:__imp_function>
- lw $t0,<low:__imp_function>
- jr $t0
- nop */
-
-static const unsigned char jmp_mips_bytes[] =
-{
- 0x00, 0x00, 0x08, 0x3c, 0x00, 0x00, 0x08, 0x8d,
- 0x08, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00
-};
-
-static const unsigned char jmp_arm_bytes[] =
-{
- 0x00, 0xc0, 0x9f, 0xe5, /* ldr ip, [pc] */
- 0x00, 0xf0, 0x9c, 0xe5, /* ldr pc, [ip] */
- 0, 0, 0, 0
-};
-
-
-static bfd *
-make_one (def_file_export *exp, bfd *parent, bfd_boolean include_jmp_stub)
-{
- asection *tx, *id7, *id5, *id4, *id6;
- unsigned char *td = NULL, *d7, *d5, *d4, *d6 = NULL;
- int len;
- char *oname;
- bfd *abfd;
- const unsigned char *jmp_bytes = NULL;
- int jmp_byte_count = 0;
-
- /* Include the jump stub section only if it is needed. A jump
- stub is needed if the symbol being imported <sym> is a function
- symbol and there is at least one undefined reference to that
- symbol. In other words, if all the import references to <sym> are
- explicitly through _declspec(dllimport) then the jump stub is not
- needed. */
- if (include_jmp_stub)
- {
- switch (pe_details->pe_arch)
- {
- case PE_ARCH_i386:
- jmp_bytes = jmp_ix86_bytes;
- jmp_byte_count = sizeof (jmp_ix86_bytes);
- break;
- case PE_ARCH_sh:
- jmp_bytes = jmp_sh_bytes;
- jmp_byte_count = sizeof (jmp_sh_bytes);
- break;
- case PE_ARCH_mips:
- jmp_bytes = jmp_mips_bytes;
- jmp_byte_count = sizeof (jmp_mips_bytes);
- break;
- case PE_ARCH_arm:
- case PE_ARCH_arm_epoc:
- case PE_ARCH_arm_wince:
- jmp_bytes = jmp_arm_bytes;
- jmp_byte_count = sizeof (jmp_arm_bytes);
- break;
- default:
- abort ();
- }
- }
-
- oname = xmalloc (20);
- sprintf (oname, "d%06d.o", tmp_seq);
- tmp_seq++;
-
- abfd = bfd_create (oname, parent);
- bfd_find_target (pe_details->object_target, abfd);
- bfd_make_writable (abfd);
-
- bfd_set_format (abfd, bfd_object);
- bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
-
- symptr = 0;
- symtab = xmalloc (11 * sizeof (asymbol *));
- tx = quick_section (abfd, ".text", SEC_CODE|SEC_HAS_CONTENTS, 2);
- id7 = quick_section (abfd, ".idata$7", SEC_HAS_CONTENTS, 2);
- id5 = quick_section (abfd, ".idata$5", SEC_HAS_CONTENTS, 2);
- id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
- id6 = quick_section (abfd, ".idata$6", SEC_HAS_CONTENTS, 2);
-
- if (*exp->internal_name == '@')
- {
- quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC,
- BSF_GLOBAL, 0);
- if (include_jmp_stub)
- quick_symbol (abfd, "", exp->internal_name, "", tx, BSF_GLOBAL, 0);
- quick_symbol (abfd, "__imp_", exp->internal_name, "", id5,
- BSF_GLOBAL, 0);
- /* Fastcall applies only to functions,
- so no need for auto-import symbol. */
- }
- else
- {
- quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC,
- BSF_GLOBAL, 0);
- if (include_jmp_stub)
- quick_symbol (abfd, U (""), exp->internal_name, "", tx,
- BSF_GLOBAL, 0);
- quick_symbol (abfd, "__imp_", U (""), exp->internal_name, id5,
- BSF_GLOBAL, 0);
- /* Symbol to reference ord/name of imported
- data symbol, used to implement auto-import. */
- if (exp->flag_data)
- quick_symbol (abfd, U ("_nm_"), U (""), exp->internal_name, id6,
- BSF_GLOBAL,0);
- }
- if (pe_dll_compat_implib)
- quick_symbol (abfd, U ("__imp_"), exp->internal_name, "", id5,
- BSF_GLOBAL, 0);
-
- if (include_jmp_stub)
- {
- bfd_set_section_size (abfd, tx, jmp_byte_count);
- td = xmalloc (jmp_byte_count);
- tx->contents = td;
- memcpy (td, jmp_bytes, jmp_byte_count);
-
- switch (pe_details->pe_arch)
- {
- case PE_ARCH_i386:
-#ifdef pe_use_x86_64
- quick_reloc (abfd, 2, BFD_RELOC_32_PCREL, 2);
-#else
- quick_reloc (abfd, 2, BFD_RELOC_32, 2);
-#endif
- break;
- case PE_ARCH_sh:
- quick_reloc (abfd, 8, BFD_RELOC_32, 2);
- break;
- case PE_ARCH_mips:
- quick_reloc (abfd, 0, BFD_RELOC_HI16_S, 2);
- quick_reloc (abfd, 0, BFD_RELOC_LO16, 0); /* MIPS_R_PAIR */
- quick_reloc (abfd, 4, BFD_RELOC_LO16, 2);
- break;
- case PE_ARCH_arm:
- case PE_ARCH_arm_epoc:
- case PE_ARCH_arm_wince:
- quick_reloc (abfd, 8, BFD_RELOC_32, 2);
- break;
- default:
- abort ();
- }
- save_relocs (tx);
- }
- else
- bfd_set_section_size (abfd, tx, 0);
-
- bfd_set_section_size (abfd, id7, 4);
- d7 = xmalloc (4);
- id7->contents = d7;
- memset (d7, 0, 4);
- quick_reloc (abfd, 0, BFD_RELOC_RVA, 5);
- save_relocs (id7);
-
- bfd_set_section_size (abfd, id5, PE_IDATA5_SIZE);
- d5 = xmalloc (PE_IDATA5_SIZE);
- id5->contents = d5;
- memset (d5, 0, PE_IDATA5_SIZE);
-
- if (exp->flag_noname)
- {
- d5[0] = exp->ordinal;
- d5[1] = exp->ordinal >> 8;
- d5[PE_IDATA5_SIZE - 1] = 0x80;
- }
- else
- {
- quick_reloc (abfd, 0, BFD_RELOC_RVA, 4);
- save_relocs (id5);
- }
-
- bfd_set_section_size (abfd, id4, PE_IDATA4_SIZE);
- d4 = xmalloc (PE_IDATA4_SIZE);
- id4->contents = d4;
- memset (d4, 0, PE_IDATA4_SIZE);
-
- if (exp->flag_noname)
- {
- d4[0] = exp->ordinal;
- d4[1] = exp->ordinal >> 8;
- d4[PE_IDATA4_SIZE - 1] = 0x80;
- }
- else
- {
- quick_reloc (abfd, 0, BFD_RELOC_RVA, 4);
- save_relocs (id4);
- }
-
- if (exp->flag_noname)
- {
- len = 0;
- bfd_set_section_size (abfd, id6, 0);
- }
- else
- {
- /* { short, asciz } */
- len = 2 + strlen (exp->name) + 1;
- if (len & 1)
- len++;
- bfd_set_section_size (abfd, id6, len);
- d6 = xmalloc (len);
- id6->contents = d6;
- memset (d6, 0, len);
- d6[0] = exp->hint & 0xff;
- d6[1] = exp->hint >> 8;
- strcpy ((char *) d6 + 2, exp->name);
- }
-
- bfd_set_symtab (abfd, symtab, symptr);
-
- if (include_jmp_stub)
- bfd_set_section_contents (abfd, tx, td, 0, jmp_byte_count);
- bfd_set_section_contents (abfd, id7, d7, 0, 4);
- bfd_set_section_contents (abfd, id5, d5, 0, PE_IDATA5_SIZE);
- bfd_set_section_contents (abfd, id4, d4, 0, PE_IDATA4_SIZE);
- if (!exp->flag_noname)
- bfd_set_section_contents (abfd, id6, d6, 0, len);
-
- bfd_make_readable (abfd);
- return abfd;
-}
-
-static bfd *
-make_singleton_name_thunk (const char *import, bfd *parent)
-{
- /* Name thunks go to idata$4. */
- asection *id4;
- unsigned char *d4;
- char *oname;
- bfd *abfd;
-
- oname = xmalloc (20);
- sprintf (oname, "nmth%06d.o", tmp_seq);
- tmp_seq++;
-
- abfd = bfd_create (oname, parent);
- bfd_find_target (pe_details->object_target, abfd);
- bfd_make_writable (abfd);
-
- bfd_set_format (abfd, bfd_object);
- bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
-
- symptr = 0;
- symtab = xmalloc (3 * sizeof (asymbol *));
- id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
- quick_symbol (abfd, U ("_nm_thnk_"), import, "", id4, BSF_GLOBAL, 0);
- quick_symbol (abfd, U ("_nm_"), import, "", UNDSEC, BSF_GLOBAL, 0);
-
- /* We need space for the real thunk and for the null terminator. */
- bfd_set_section_size (abfd, id4, PE_IDATA4_SIZE * 2);
- d4 = xmalloc (PE_IDATA4_SIZE * 2);
- id4->contents = d4;
- memset (d4, 0, PE_IDATA4_SIZE * 2);
- quick_reloc (abfd, 0, BFD_RELOC_RVA, 2);
- save_relocs (id4);
-
- bfd_set_symtab (abfd, symtab, symptr);
-
- bfd_set_section_contents (abfd, id4, d4, 0, PE_IDATA4_SIZE * 2);
-
- bfd_make_readable (abfd);
- return abfd;
-}
-
-static char *
-make_import_fixup_mark (arelent *rel)
-{
- /* We convert reloc to symbol, for later reference. */
- static int counter;
- static char *fixup_name = NULL;
- static size_t buffer_len = 0;
-
- struct bfd_symbol *sym = *rel->sym_ptr_ptr;
-
- bfd *abfd = bfd_asymbol_bfd (sym);
- struct bfd_link_hash_entry *bh;
-
- if (!fixup_name)
- {
- fixup_name = xmalloc (384);
- buffer_len = 384;
- }
-
- if (strlen (sym->name) + 25 > buffer_len)
- /* Assume 25 chars for "__fu" + counter + "_". If counter is
- bigger than 20 digits long, we've got worse problems than
- overflowing this buffer... */
- {
- free (fixup_name);
- /* New buffer size is length of symbol, plus 25, but
- then rounded up to the nearest multiple of 128. */
- buffer_len = ((strlen (sym->name) + 25) + 127) & ~127;
- fixup_name = xmalloc (buffer_len);
- }
-
- sprintf (fixup_name, "__fu%d_%s", counter++, sym->name);
-
- bh = NULL;
- bfd_coff_link_add_one_symbol (&link_info, abfd, fixup_name, BSF_GLOBAL,
- current_sec, /* sym->section, */
- rel->address, NULL, TRUE, FALSE, &bh);
-
- return fixup_name;
-}
-
-/* .section .idata$2
- .rva __nm_thnk_SYM (singleton thunk with name of func)
- .long 0
- .long 0
- .rva __my_dll_iname (name of dll)
- .rva __fuNN_SYM (pointer to reference (address) in text) */
-
-static bfd *
-make_import_fixup_entry (const char *name,
- const char *fixup_name,
- const char *dll_symname,
- bfd *parent)
-{
- asection *id2;
- unsigned char *d2;
- char *oname;
- bfd *abfd;
-
- oname = xmalloc (20);
- sprintf (oname, "fu%06d.o", tmp_seq);
- tmp_seq++;
-
- abfd = bfd_create (oname, parent);
- bfd_find_target (pe_details->object_target, abfd);
- bfd_make_writable (abfd);
-
- bfd_set_format (abfd, bfd_object);
- bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
-
- symptr = 0;
- symtab = xmalloc (6 * sizeof (asymbol *));
- id2 = quick_section (abfd, ".idata$2", SEC_HAS_CONTENTS, 2);
-
- quick_symbol (abfd, U ("_nm_thnk_"), name, "", UNDSEC, BSF_GLOBAL, 0);
- quick_symbol (abfd, U (""), dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0);
- quick_symbol (abfd, "", fixup_name, "", UNDSEC, BSF_GLOBAL, 0);
-
- bfd_set_section_size (abfd, id2, 20);
- d2 = xmalloc (20);
- id2->contents = d2;
- memset (d2, 0, 20);
-
- quick_reloc (abfd, 0, BFD_RELOC_RVA, 1);
- quick_reloc (abfd, 12, BFD_RELOC_RVA, 2);
- quick_reloc (abfd, 16, BFD_RELOC_RVA, 3);
- save_relocs (id2);
-
- bfd_set_symtab (abfd, symtab, symptr);
-
- bfd_set_section_contents (abfd, id2, d2, 0, 20);
-
- bfd_make_readable (abfd);
- return abfd;
-}
-
-/* .section .rdata_runtime_pseudo_reloc
- .long addend
- .rva __fuNN_SYM (pointer to reference (address) in text) */
-
-static bfd *
-make_runtime_pseudo_reloc (const char *name ATTRIBUTE_UNUSED,
- const char *fixup_name,
- int addend,
- bfd *parent)
-{
- asection *rt_rel;
- unsigned char *rt_rel_d;
- char *oname;
- bfd *abfd;
-
- oname = xmalloc (20);
- sprintf (oname, "rtr%06d.o", tmp_seq);
- tmp_seq++;
-
- abfd = bfd_create (oname, parent);
- bfd_find_target (pe_details->object_target, abfd);
- bfd_make_writable (abfd);
-
- bfd_set_format (abfd, bfd_object);
- bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
-
- symptr = 0;
- symtab = xmalloc (2 * sizeof (asymbol *));
- rt_rel = quick_section (abfd, ".rdata_runtime_pseudo_reloc",
- SEC_HAS_CONTENTS, 2);
-
- quick_symbol (abfd, "", fixup_name, "", UNDSEC, BSF_GLOBAL, 0);
-
- bfd_set_section_size (abfd, rt_rel, 8);
- rt_rel_d = xmalloc (8);
- rt_rel->contents = rt_rel_d;
- memset (rt_rel_d, 0, 8);
- bfd_put_32 (abfd, addend, rt_rel_d);
-
- quick_reloc (abfd, 4, BFD_RELOC_RVA, 1);
- save_relocs (rt_rel);
-
- bfd_set_symtab (abfd, symtab, symptr);
-
- bfd_set_section_contents (abfd, rt_rel, rt_rel_d, 0, 8);
-
- bfd_make_readable (abfd);
- return abfd;
-}
-
-/* .section .rdata
- .rva __pei386_runtime_relocator */
-
-static bfd *
-pe_create_runtime_relocator_reference (bfd *parent)
-{
- asection *extern_rt_rel;
- unsigned char *extern_rt_rel_d;
- char *oname;
- bfd *abfd;
-
- oname = xmalloc (20);
- sprintf (oname, "ertr%06d.o", tmp_seq);
- tmp_seq++;
-
- abfd = bfd_create (oname, parent);
- bfd_find_target (pe_details->object_target, abfd);
- bfd_make_writable (abfd);
-
- bfd_set_format (abfd, bfd_object);
- bfd_set_arch_mach (abfd, pe_details->bfd_arch, 0);
-
- symptr = 0;
- symtab = xmalloc (2 * sizeof (asymbol *));
- extern_rt_rel = quick_section (abfd, ".rdata", SEC_HAS_CONTENTS, 2);
-
- quick_symbol (abfd, "", U ("_pei386_runtime_relocator"), "", UNDSEC,
- BSF_NO_FLAGS, 0);
-
- bfd_set_section_size (abfd, extern_rt_rel, 4);
- extern_rt_rel_d = xmalloc (4);
- extern_rt_rel->contents = extern_rt_rel_d;
-
- quick_reloc (abfd, 0, BFD_RELOC_RVA, 1);
- save_relocs (extern_rt_rel);
-
- bfd_set_symtab (abfd, symtab, symptr);
-
- bfd_set_section_contents (abfd, extern_rt_rel, extern_rt_rel_d, 0, 4);
-
- bfd_make_readable (abfd);
- return abfd;
-}
-
-void
-pe_create_import_fixup (arelent *rel, asection *s, int addend)
-{
- char buf[300];
- struct bfd_symbol *sym = *rel->sym_ptr_ptr;
- struct bfd_link_hash_entry *name_thunk_sym;
- const char *name = sym->name;
- char *fixup_name = make_import_fixup_mark (rel);
- bfd *b;
-
- sprintf (buf, U ("_nm_thnk_%s"), name);
-
- name_thunk_sym = bfd_link_hash_lookup (link_info.hash, buf, 0, 0, 1);
-
- if (!name_thunk_sym || name_thunk_sym->type != bfd_link_hash_defined)
- {
- bfd *b = make_singleton_name_thunk (name, link_info.output_bfd);
- add_bfd_to_link (b, b->filename, &link_info);
-
- /* If we ever use autoimport, we have to cast text section writable. */
- config.text_read_only = FALSE;
- link_info.output_bfd->flags &= ~WP_TEXT;
- }
-
- if (addend == 0 || link_info.pei386_runtime_pseudo_reloc)
- {
- extern char * pe_data_import_dll;
- char * dll_symname = pe_data_import_dll ? pe_data_import_dll : "unknown";
-
- b = make_import_fixup_entry (name, fixup_name, dll_symname,
- link_info.output_bfd);
- add_bfd_to_link (b, b->filename, &link_info);
- }
-
- if (addend != 0)
- {
- if (link_info.pei386_runtime_pseudo_reloc)
- {
- if (pe_dll_extra_pe_debug)
- printf ("creating runtime pseudo-reloc entry for %s (addend=%d)\n",
- fixup_name, addend);
- b = make_runtime_pseudo_reloc (name, fixup_name, addend,
- link_info.output_bfd);
- add_bfd_to_link (b, b->filename, &link_info);
-
- if (runtime_pseudo_relocs_created == 0)
- {
- b = pe_create_runtime_relocator_reference (link_info.output_bfd);
- add_bfd_to_link (b, b->filename, &link_info);
- }
- runtime_pseudo_relocs_created++;
- }
- else
- {
- einfo (_("%C: variable '%T' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.\n"),
- s->owner, s, rel->address, sym->name);
- einfo ("%X");
- }
- }
-}
-
-
-void
-pe_dll_generate_implib (def_file *def, const char *impfilename)
-{
- int i;
- bfd *ar_head;
- bfd *ar_tail;
- bfd *outarch;
- bfd *head = 0;
-
- dll_filename = (def->name) ? def->name : dll_name;
- dll_symname = xstrdup (dll_filename);
- for (i = 0; dll_symname[i]; i++)
- if (!ISALNUM (dll_symname[i]))
- dll_symname[i] = '_';
-
- unlink_if_ordinary (impfilename);
-
- outarch = bfd_openw (impfilename, 0);
-
- if (!outarch)
- {
- /* xgettext:c-format */
- einfo (_("%XCan't open .lib file: %s\n"), impfilename);
- return;
- }
-
- /* xgettext:c-format */
- info_msg (_("Creating library file: %s\n"), impfilename);
-
- bfd_set_format (outarch, bfd_archive);
- outarch->has_armap = 1;
-
- /* Work out a reasonable size of things to put onto one line. */
- ar_head = make_head (outarch);
-
- for (i = 0; i < def->num_exports; i++)
- {
- /* The import library doesn't know about the internal name. */
- char *internal = def->exports[i].internal_name;
- bfd *n;
-
- /* Don't add PRIVATE entries to import lib. */
- if (pe_def_file->exports[i].flag_private)
- continue;
- def->exports[i].internal_name = def->exports[i].name;
- n = make_one (def->exports + i, outarch,
- ! (def->exports + i)->flag_data);
- n->archive_next = head;
- head = n;
- def->exports[i].internal_name = internal;
- }
-
- ar_tail = make_tail (outarch);
-
- if (ar_head == NULL || ar_tail == NULL)
- return;
-
- /* Now stick them all into the archive. */
- ar_head->archive_next = head;
- ar_tail->archive_next = ar_head;
- head = ar_tail;
-
- if (! bfd_set_archive_head (outarch, head))
- einfo ("%Xbfd_set_archive_head: %E\n");
-
- if (! bfd_close (outarch))
- einfo ("%Xbfd_close %s: %E\n", impfilename);
-
- while (head != NULL)
- {
- bfd *n = head->archive_next;
- bfd_close (head);
- head = n;
- }
-}
-
-static void
-add_bfd_to_link (bfd *abfd, const char *name, struct bfd_link_info *link_info)
-{
- lang_input_statement_type *fake_file;
-
- fake_file = lang_add_input_file (name,
- lang_input_file_is_fake_enum,
- NULL);
- fake_file->the_bfd = abfd;
- ldlang_add_file (fake_file);
-
- if (!bfd_link_add_symbols (abfd, link_info))
- einfo ("%Xaddsym %s: %E\n", name);
-}
-
-void
-pe_process_import_defs (bfd *output_bfd, struct bfd_link_info *link_info)
-{
- def_file_module *module;
-
- pe_dll_id_target (bfd_get_target (output_bfd));
-
- if (!pe_def_file)
- return;
-
- for (module = pe_def_file->modules; module; module = module->next)
- {
- int i, do_this_dll;
-
- dll_filename = module->name;
- dll_symname = xstrdup (module->name);
- for (i = 0; dll_symname[i]; i++)
- if (!ISALNUM (dll_symname[i]))
- dll_symname[i] = '_';
-
- do_this_dll = 0;
-
- for (i = 0; i < pe_def_file->num_imports; i++)
- if (pe_def_file->imports[i].module == module)
- {
- def_file_export exp;
- struct bfd_link_hash_entry *blhe;
- int lead_at = (*pe_def_file->imports[i].internal_name == '@');
- /* See if we need this import. */
- size_t len = strlen (pe_def_file->imports[i].internal_name);
- char *name = xmalloc (len + 2 + 6);
- bfd_boolean include_jmp_stub = FALSE;
-
- if (lead_at)
- sprintf (name, "%s",
- pe_def_file->imports[i].internal_name);
- else
- sprintf (name, "%s%s",U (""),
- pe_def_file->imports[i].internal_name);
-
- blhe = bfd_link_hash_lookup (link_info->hash, name,
- FALSE, FALSE, FALSE);
-
- /* Include the jump stub for <sym> only if the <sym>
- is undefined. */
- if (!blhe || (blhe && blhe->type != bfd_link_hash_undefined))
- {
- if (lead_at)
- sprintf (name, "%s%s", "__imp_",
- pe_def_file->imports[i].internal_name);
- else
- sprintf (name, "%s%s%s", "__imp_", U (""),
- pe_def_file->imports[i].internal_name);
-
- blhe = bfd_link_hash_lookup (link_info->hash, name,
- FALSE, FALSE, FALSE);
- }
- else
- include_jmp_stub = TRUE;
-
- free (name);
-
- if (blhe && blhe->type == bfd_link_hash_undefined)
- {
- bfd *one;
- /* We do. */
- if (!do_this_dll)
- {
- bfd *ar_head = make_head (output_bfd);
- add_bfd_to_link (ar_head, ar_head->filename, link_info);
- do_this_dll = 1;
- }
- exp.internal_name = pe_def_file->imports[i].internal_name;
- exp.name = pe_def_file->imports[i].name;
- exp.ordinal = pe_def_file->imports[i].ordinal;
- exp.hint = exp.ordinal >= 0 ? exp.ordinal : 0;
- exp.flag_private = 0;
- exp.flag_constant = 0;
- exp.flag_data = pe_def_file->imports[i].data;
- exp.flag_noname = exp.name ? 0 : 1;
- one = make_one (&exp, output_bfd, (! exp.flag_data) && include_jmp_stub);
- add_bfd_to_link (one, one->filename, link_info);
- }
- }
- if (do_this_dll)
- {
- bfd *ar_tail = make_tail (output_bfd);
- add_bfd_to_link (ar_tail, ar_tail->filename, link_info);
- }
-
- free (dll_symname);
- }
-}
-
-/* We were handed a *.DLL file. Parse it and turn it into a set of
- IMPORTS directives in the def file. Return TRUE if the file was
- handled, FALSE if not. */
-
-static unsigned int
-pe_get16 (bfd *abfd, int where)
-{
- unsigned char b[2];
-
- bfd_seek (abfd, (file_ptr) where, SEEK_SET);
- bfd_bread (b, (bfd_size_type) 2, abfd);
- return b[0] + (b[1] << 8);
-}
-
-static unsigned int
-pe_get32 (bfd *abfd, int where)
-{
- unsigned char b[4];
-
- bfd_seek (abfd, (file_ptr) where, SEEK_SET);
- bfd_bread (b, (bfd_size_type) 4, abfd);
- return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
-}
-
-static unsigned int
-pe_as32 (void *ptr)
-{
- unsigned char *b = ptr;
-
- return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
-}
-
-bfd_boolean
-pe_implied_import_dll (const char *filename)
-{
- bfd *dll;
- bfd_vma pe_header_offset, opthdr_ofs, num_entries, i;
- bfd_vma export_rva, export_size, nsections, secptr, expptr;
- bfd_vma exp_funcbase;
- unsigned char *expdata;
- char *erva;
- bfd_vma name_rvas, ordinals, nexp, ordbase;
- const char *dll_name;
- /* Initialization with start > end guarantees that is_data
- will not be set by mistake, and avoids compiler warning. */
- bfd_vma data_start = 1;
- bfd_vma data_end = 0;
- bfd_vma rdata_start = 1;
- bfd_vma rdata_end = 0;
- bfd_vma bss_start = 1;
- bfd_vma bss_end = 0;
-
- /* No, I can't use bfd here. kernel32.dll puts its export table in
- the middle of the .rdata section. */
- dll = bfd_openr (filename, pe_details->target_name);
- if (!dll)
- {
- einfo ("%Xopen %s: %E\n", filename);
- return FALSE;
- }
-
- /* PEI dlls seem to be bfd_objects. */
- if (!bfd_check_format (dll, bfd_object))
- {
- einfo ("%X%s: this doesn't appear to be a DLL\n", filename);
- return FALSE;
- }
-
- /* Get pe_header, optional header and numbers of export entries. */
- pe_header_offset = pe_get32 (dll, 0x3c);
- opthdr_ofs = pe_header_offset + 4 + 20;
-#ifdef pe_use_x86_64
- num_entries = pe_get32 (dll, opthdr_ofs + 92 + 4 * 4); /* & NumberOfRvaAndSizes. */
-#else
- num_entries = pe_get32 (dll, opthdr_ofs + 92);
-#endif
-
- if (num_entries < 1) /* No exports. */
- return FALSE;
-
-#ifdef pe_use_x86_64
- export_rva = pe_get32 (dll, opthdr_ofs + 96 + 4 * 4);
- export_size = pe_get32 (dll, opthdr_ofs + 100 + 4 * 4);
-#else
- export_rva = pe_get32 (dll, opthdr_ofs + 96);
- export_size = pe_get32 (dll, opthdr_ofs + 100);
-#endif
-
- nsections = pe_get16 (dll, pe_header_offset + 4 + 2);
- secptr = (pe_header_offset + 4 + 20 +
- pe_get16 (dll, pe_header_offset + 4 + 16));
- expptr = 0;
-
- /* Get the rva and size of the export section. */
- for (i = 0; i < nsections; i++)
- {
- char sname[8];
- bfd_vma secptr1 = secptr + 40 * i;
- bfd_vma vaddr = pe_get32 (dll, secptr1 + 12);
- bfd_vma vsize = pe_get32 (dll, secptr1 + 16);
- bfd_vma fptr = pe_get32 (dll, secptr1 + 20);
-
- bfd_seek (dll, (file_ptr) secptr1, SEEK_SET);
- bfd_bread (sname, (bfd_size_type) 8, dll);
-
- if (vaddr <= export_rva && vaddr + vsize > export_rva)
- {
- expptr = fptr + (export_rva - vaddr);
- if (export_rva + export_size > vaddr + vsize)
- export_size = vsize - (export_rva - vaddr);
- break;
- }
- }
-
- /* Scan sections and store the base and size of the
- data and bss segments in data/base_start/end. */
- for (i = 0; i < nsections; i++)
- {
- bfd_vma secptr1 = secptr + 40 * i;
- bfd_vma vsize = pe_get32 (dll, secptr1 + 8);
- bfd_vma vaddr = pe_get32 (dll, secptr1 + 12);
- bfd_vma flags = pe_get32 (dll, secptr1 + 36);
- char sec_name[9];
-
- sec_name[8] = '\0';
- bfd_seek (dll, (file_ptr) secptr1 + 0, SEEK_SET);
- bfd_bread (sec_name, (bfd_size_type) 8, dll);
-
- if (strcmp(sec_name,".data") == 0)
- {
- data_start = vaddr;
- data_end = vaddr + vsize;
-
- if (pe_dll_extra_pe_debug)
- printf ("%s %s: 0x%08lx-0x%08lx (0x%08lx)\n",
- __FUNCTION__, sec_name, (unsigned long) vaddr,
- (unsigned long) (vaddr + vsize), (unsigned long) flags);
- }
- else if (strcmp(sec_name,".rdata") == 0)
- {
- rdata_start = vaddr;
- rdata_end = vaddr + vsize;
-
- if (pe_dll_extra_pe_debug)
- printf ("%s %s: 0x%08lx-0x%08lx (0x%08lx)\n",
- __FUNCTION__, sec_name, (unsigned long) vaddr,
- (unsigned long) (vaddr + vsize), (unsigned long) flags);
- }
- else if (strcmp (sec_name,".bss") == 0)
- {
- bss_start = vaddr;
- bss_end = vaddr + vsize;
-
- if (pe_dll_extra_pe_debug)
- printf ("%s %s: 0x%08lx-0x%08lx (0x%08lx)\n",
- __FUNCTION__, sec_name, (unsigned long) vaddr,
- (unsigned long) (vaddr + vsize), (unsigned long) flags);
- }
- }
-
- expdata = xmalloc (export_size);
- bfd_seek (dll, (file_ptr) expptr, SEEK_SET);
- bfd_bread (expdata, (bfd_size_type) export_size, dll);
- erva = (char *) expdata - export_rva;
-
- if (pe_def_file == 0)
- pe_def_file = def_file_empty ();
-
- nexp = pe_as32 (expdata + 24);
- name_rvas = pe_as32 (expdata + 32);
- ordinals = pe_as32 (expdata + 36);
- ordbase = pe_as32 (expdata + 16);
- exp_funcbase = pe_as32 (expdata + 28);
-
- /* Use internal dll name instead of filename
- to enable symbolic dll linking. */
- dll_name = erva + pe_as32 (expdata + 12);
-
- /* Check to see if the dll has already been added to
- the definition list and if so return without error.
- This avoids multiple symbol definitions. */
- if (def_get_module (pe_def_file, dll_name))
- {
- if (pe_dll_extra_pe_debug)
- printf ("%s is already loaded\n", dll_name);
- return TRUE;
- }
-
- /* Iterate through the list of symbols. */
- for (i = 0; i < nexp; i++)
- {
- /* Pointer to the names vector. */
- bfd_vma name_rva = pe_as32 (erva + name_rvas + i * 4);
- def_file_import *imp;
- /* Pointer to the function address vector. */
- bfd_vma func_rva = pe_as32 (erva + exp_funcbase + i * 4);
- int is_data = 0;
-
- /* Skip unwanted symbols, which are
- exported in buggy auto-import releases. */
- if (! CONST_STRNEQ (erva + name_rva, "_nm_"))
- {
- /* is_data is true if the address is in the data, rdata or bss
- segment. */
- is_data =
- (func_rva >= data_start && func_rva < data_end)
- || (func_rva >= rdata_start && func_rva < rdata_end)
- || (func_rva >= bss_start && func_rva < bss_end);
-
- imp = def_file_add_import (pe_def_file, erva + name_rva,
- dll_name, i, 0);
- /* Mark symbol type. */
- imp->data = is_data;
-
- if (pe_dll_extra_pe_debug)
- printf ("%s dll-name: %s sym: %s addr: 0x%lx %s\n",
- __FUNCTION__, dll_name, erva + name_rva,
- (unsigned long) func_rva, is_data ? "(data)" : "");
- }
- }
-
- return TRUE;
-}
-
-/* These are the main functions, called from the emulation. The first
- is called after the bfds are read, so we can guess at how much space
- we need. The second is called after everything is placed, so we
- can put the right values in place. */
-
-void
-pe_dll_build_sections (bfd *abfd, struct bfd_link_info *info)
-{
- pe_dll_id_target (bfd_get_target (abfd));
- process_def_file (abfd, info);
-
- if (pe_def_file->num_exports == 0 && !info->shared)
- return;
-
- generate_edata (abfd, info);
- build_filler_bfd (1);
-}
-
-void
-pe_exe_build_sections (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
-{
- pe_dll_id_target (bfd_get_target (abfd));
- build_filler_bfd (0);
-}
-
-void
-pe_dll_fill_sections (bfd *abfd, struct bfd_link_info *info)
-{
- pe_dll_id_target (bfd_get_target (abfd));
- image_base = pe_data (abfd)->pe_opthdr.ImageBase;
-
- generate_reloc (abfd, info);
- if (reloc_sz > 0)
- {
- bfd_set_section_size (filler_bfd, reloc_s, reloc_sz);
-
- /* Resize the sections. */
- lang_reset_memory_regions ();
- lang_size_sections (NULL, TRUE);
-
- /* Redo special stuff. */
- ldemul_after_allocation ();
-
- /* Do the assignments again. */
- lang_do_assignments ();
- }
-
- fill_edata (abfd, info);
-
- if (info->shared && !info->pie)
- pe_data (abfd)->dll = 1;
-
- edata_s->contents = edata_d;
- reloc_s->contents = reloc_d;
-}
-
-void
-pe_exe_fill_sections (bfd *abfd, struct bfd_link_info *info)
-{
- pe_dll_id_target (bfd_get_target (abfd));
- image_base = pe_data (abfd)->pe_opthdr.ImageBase;
-
- generate_reloc (abfd, info);
- if (reloc_sz > 0)
- {
- bfd_set_section_size (filler_bfd, reloc_s, reloc_sz);
-
- /* Resize the sections. */
- lang_reset_memory_regions ();
- lang_size_sections (NULL, TRUE);
-
- /* Redo special stuff. */
- ldemul_after_allocation ();
-
- /* Do the assignments again. */
- lang_do_assignments ();
- }
- reloc_s->contents = reloc_d;
-}
-
-bfd_boolean
-pe_bfd_is_dll (bfd *abfd)
-{
- return (bfd_get_format (abfd) == bfd_object
- && obj_pe (abfd)
- && pe_data (abfd)->dll);
-}
diff --git a/ld/po/POTFILES.in b/ld/po/POTFILES.in
deleted file mode 100644
index 48172c489b0..00000000000
--- a/ld/po/POTFILES.in
+++ /dev/null
@@ -1,32 +0,0 @@
-deffile.h
-elf-hints-local.h
-emultempl/armcoff.em
-emultempl/pe.em
-ld.h
-ldcref.c
-ldctor.c
-ldctor.h
-ldemul.c
-ldemul.h
-ldexp.c
-ldexp.h
-ldfile.c
-ldfile.h
-ldlang.c
-ldlang.h
-ldlex.h
-ldmain.c
-ldmain.h
-ldmisc.c
-ldmisc.h
-ldver.c
-ldver.h
-ldwrite.c
-ldwrite.h
-lexsup.c
-mri.c
-mri.h
-pe-dll.c
-pe-dll.h
-pep-dll.c
-pep-dll.h
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
deleted file mode 100644
index 93a5e4183f6..00000000000
--- a/ld/testsuite/ChangeLog
+++ /dev/null
@@ -1,566 +0,0 @@
-2008-07-30 Nick Clifton <nickc@redhat.com>
-
- * ld-elf/sec-to-seg.exp: New test: Checks the assignment of
- sections to segments.
- * ld-elf/sec-to-seg1.s: Test source file.
- * ld-elf/sec-to-seg2.s: Test source file.
- * ld-elf/sec-to-seg-script-same-page.t: Test linker script.
- * ld-elf/sec-to-seg-script-adjoining-pages.t: Test linker script.
- * ld-elf/sec-to-seg-script-disjoint-pages.t: Test linker script.
-
-2008-07-28 Alexandre Oliva <aoliva@redhat.com>
-
- * ld-i386/tlsbindesc.dd: Adjust incorrect expectations for LD to
- LE relaxation.
- * ld-x86-64/tlsbindesc.dd: Likewise.
- * ld-i386/tlsbindesc.rd: Adjust address of _TLS_MODULE_BASE_.
- * ld-x86-64/tlsbindesc.rd: Likewise.
- Reported by Cary Coutant <ccoutant@google.com>
-
-2008-07-27 Alan Modra <amodra@bigpond.net.au>
-
- * ld-gc/gc.exp (test_gc): xfail powerpc64.
-
-2008-07-26 Michael Eager <eager@eagercon.com>
-
- * ld-powerpc/powerpc.exp: Run new tests.
- * ld-powerpc/attr-gnu-4-03.d: New file.
- * ld-powerpc/attr-gnu-4-14.d: New file.
- * ld-powerpc/attr-gnu-4-23.d: New file.
- * ld-powerpc/attr-gnu-4-24.d: New file.
- * ld-powerpc/attr-gnu-4-32.d: New file.
- * ld-powerpc/attr-gnu-4-33.d: New file.
- * ld-powerpc/attr-gnu-4-34.d: New file.
- * ld-powerpc/attr-gnu-4-41.d: New file.
- * ld-powerpc/attr-gnu-4-4.s: New file.
- * ld-powerpc/attr-gnu-4-13.d: Adjust.
- * ld-powerpc/attr-gnu-4-31.d: Adjust.
-
-2008-07-26 Alan Modra <amodra@bigpond.net.au>
-
- * ld-scripts/include.exp: Don't run test for aout.
- * ld-scripts/include.s: Use .fill rather than .4byte.
- * ld-scripts/include-1.d: Adjust.
-
-2008-07-22 Alan Modra <amodra@bigpond.net.au>
-
- * ld-alpha/tlsbin.rd: Update.
- * ld-alpha/tlsbinr.rd: Update.
- * ld-arm/mixed-app.sym: Update.
- * ld-arm/use-thumb-lib.sym: Update.
- * ld-cris/pv32-1.d: Update.
-
-2008-07-21 Nick Clifton <nickc@redhat.com>
-
- * ld-scripts/include-sections.t: Discard all sections not
- explicitly requested by the rest of the linker script.
- * ld-scripts/include-1.d: Expect test to fail for AIX ports.
- Do not assume that the .text section will be marked readonly.
- * ld-scripts/include.s: Replace .section directives with just
- .text or .data.
-
-2008-07-18 Joseph Myers <joseph@codesourcery.com>
-
- * ld-arm/attr-merge-wchar-0.s,ld-arm/attr-merge-wchar-2.s,
- ld-arm/attr-merge-wchar-4.s, ld-arm/attr-merge-wchar-00-nowarn.d,
- ld-arm/attr-merge-wchar-00.d, ld-arm/attr-merge-wchar-02-nowarn.d,
- ld-arm/attr-merge-wchar-02.d, ld-arm/attr-merge-wchar-04-nowarn.d,
- ld-arm/attr-merge-wchar-04.d, ld-arm/attr-merge-wchar-20-nowarn.d,
- ld-arm/attr-merge-wchar-20.d, ld-arm/attr-merge-wchar-22-nowarn.d,
- ld-arm/attr-merge-wchar-22.d, ld-arm/attr-merge-wchar-24-nowarn.d,
- ld-arm/attr-merge-wchar-24.d, ld-arm/attr-merge-wchar-40-nowarn.d,
- ld-arm/attr-merge-wchar-40.d, ld-arm/attr-merge-wchar-42-nowarn.d,
- ld-arm/attr-merge-wchar-42.d, ld-arm/attr-merge-wchar-44-nowarn.d,
- ld-arm/attr-merge-wchar-44.d: New.
- * ld-arm/arm-elf.exp: Run new tests.
-
-2008-07-11 H.J. Lu <hongjiu.lu@intel.com>
-
- * ld-m68k/got-12.s: Removed.
- * ld-m68k/got-13.s: Likewise.
- * ld-m68k/got-14.s: Likewise.
- * ld-m68k/got-15.s: Likewise.
- * ld-m68k/got-34.s: Likewise.
- * ld-m68k/got-35.s: Likewise.
- * ld-m68k/xgot-15.s: Likewise.
-
- * ld-m68k/got-multigot-12-13-14-34-35-ok.d: Remove #source
- and expected relocations.
- * ld-m68k/got-multigot-14-ok.d: Likewise.
- * ld-m68k/got-negative-12-13-14-34-ok.d: Likewise.
- * ld-m68k/got-negative-14-ok.d: Likewise.
- * ld-m68k/got-single-12-ok.d: Likewise.
- * ld-m68k/got-xgot-12-13-14-15-34-35-ok.d: Likewise.
- * ld-m68k/got-xgot-15-ok.d: Likewise.
-
- * ld-m68k/got-multigot-15-er.d: Remove #source.
- * ld-m68k/got-negative-12-13-14-35-er.d: Likewise.
- * ld-m68k/got-negative-15-er.d: Likewise.
- * ld-m68k/got-single-13-er.d: Likewise.
-
- * ld-m68k/m68k.exp: Move GOT tests to ...
- * ld-m68k/m68k-got.exp: This. New.
-
-2008-07-10 Richard Sandiford <rdsandiford@googlemail.com>
-
- * ld-mips-elf/no-shared-1-o32.s,
- ld-mips-elf/no-shared-1-o32.d,
- ld-mips-elf/no-shared-1-n32.d,
- ld-mips-elf/no-shared-1-n64.s,
- ld-mips-elf/no-shared-1-n64.d,
- ld-mips-elf/no-shared-1.ld: New tests.
- * ld-mips-elf/mips-elf.exp: Run them.
-
-2008-07-07 Stan Shebs <stan@codesourcery.com>
-
- * ld-arm/arm-elf.exp: Use objdump -d for arm-be8 test.
- * ld-arm/arm-be8.d: Change to test disassembly.
-
-2008-07-06 Nathan Sidwell <nathan@codesourcery.com>
-
- * ld-scripts/include-1.d: New.
- * ld-scripts/include-1.t: New.
- * ld-scripts/include-data.t: New.
- * ld-scripts/include-mem.t: New.
- * ld-scripts/include-ram.t: New.
- * ld-scripts/include-sections.t: New.
- * ld-scripts/include-subdata.t: New.
- * ld-scripts/include.exp: New.
- * ld-scripts/include.s: New.
-
-2008-06-29 Andreas Schwab <schwab@suse.de>
-
- * ld-m68k/got-1.s: New file.
- * ld-m68k/got-1.d: New dump test.
- * ld-m68k/m68k.exp: Run it.
-
-2008-06-24 Daniel Jacobowitz <dan@codesourcery.com>
-
- * ld-arm/farcall-arm-arm-be8.d, ld-arm/farcall-arm-arm-pic-veneer.d,
- ld-arm/farcall-arm-arm.d, ld-arm/farcall-arm-thumb-blx-pic-veneer.d,
- ld-arm/farcall-arm-thumb-blx.d, ld-arm/farcall-arm-thumb-pic-veneer.d,
- ld-arm/farcall-arm-thumb.d, ld-arm/farcall-group-size2.d,
- ld-arm/farcall-group.d, ld-arm/farcall-mix.d, ld-arm/farcall-mix2.d,
- ld-arm/farcall-thumb-arm-blx-pic-veneer.d,
- ld-arm/farcall-thumb-arm-blx.d, ld-arm/farcall-thumb-arm.d,
- ld-arm/farcall-thumb-thumb-blx-pic-veneer.d,
- ld-arm/farcall-thumb-thumb-blx.d, ld-arm/farcall-thumb-thumb-m.d,
- ld-arm/thumb2-bl-as-thumb1-bad.d, ld-arm/thumb2-bl-bad.d: Update for
- stub symbols and stub corrections.
-
-2008-06-20 Alan Modra <amodra@bigpond.net.au>
-
- * ld-spu/ovl.d: Update.
- * ld-spu/ovl2.d: Update.
-
-2008-06-16 Hans-Peter Nilsson <hp@bitrange.com>
-
- PR gas/6607
- * ld-mmix/loc10.d, ld-mmix/loc10.s, ld-mmix/loc10m.d, ld-mmix/loc8.d,
- ld-mmix/loc8.s, ld-mmix/loc8m.d, ld-mmix/loc9.d, ld-mmix/loc9.s,
- ld-mmix/loc9m.d: New tests.
-
-2008-06-12 Nick Clifton <nickc@redhat.com>
-
- * ld-scripts/overlay-size.t (end_of_bss_overlays): Define.
- (end_of_text_overlays): Define.
- (end_of_data_overlays): Define.
- * ld-scripts/overlay-size-map.d: Add expected values for
- end_of_bss_overlays, end_of_text_overlays and
- end_of_data_overlays.
-
-2008-06-09 Kaz Kojima <kkojima@rr.iij4u.or.jp>
-
- * ld-sh/arch/arch_expected.txt: Regenerate.
-
-2008-06-09 Daniel Jacobowitz <dan@codesourcery.com>
-
- * ld-arm/mixed-lib.d: Loosen pattern.
-
-2008-06-09 Christophe Lyon <christophe.lyon@st.com>
-
- * ld-arm/farcall-thumb-thumb-m.d: Fix branch type.
- * ld-arm/farcall-thumb-arm.d: Likewise.
-
-2008-05-31 Nick Clifton <nickc@redhat.com>
-
- PR ld/6430
- * ld-elfcomm/elfcomm.exp (test_sort_common): Test the
- ascending/descending argument to the --sort-common command line
- option.
- * ld-elfcomm/sort-common.s: New file.
-
-2008-05-28 Christophe Lyon <christophe.lyon@st.com>
-
- * ld-arm/arm-elf.exp: Skip farcalls tests for non-ARM-EABI
- targets.
- * ld-arm/thumb2-bl-as-thumb1-bad-noeabi.d: New file.
- * ld-arm/thumb2-bl-bad-noeabi.d: Likewise.
-
-2008-05-22 Christophe Lyon <christophe.lyon@st.com>
-
- * ld-arm/farcall-arm-arm.s: Force function type on 'bar'.
- * ld-arm/farcall-thumb-arm.s: Likewise.
- * ld-arm/farcall-thumb-arm-blx.d: Fix encoding.
- * ld-arm/farcall-thumb-arm.d: Likewise.
- * ld-arm/farcall-thumb-arm-blx-pic-veneer.d: Likewise.
- * ld-arm/arm-elf.exp (armelftests): Add farcall-mix, farcall-mix2,
- farcall-group-default, farcall-group-size2, farcall-section Ignore
- gas warnings in farcall-thumb-arm, farcall-thumb-arm-blx,
- farcall-thumb-arm-blx-pic-veneer.
-
-2008-05-21 Maxim Kuvyrkov <maxim@codesourcery.com>
-
- * ld-m68k/got-12.s: New file.
- * ld-m68k/got-13.s: New file.
- * ld-m68k/got-14.s: New file.
- * ld-m68k/got-15.s: New file.
- * ld-m68k/got-34.s: New file.
- * ld-m68k/got-35.s: New file.
- * ld-m68k/got-single-12-ok.d: New dump test.
- * ld-m68k/got-single-13-er.d: New dump test.
- * ld-m68k/got-negative-14-ok.d: New dump test.
- * ld-m68k/got-negative-15-er.d: New dump test.
- * ld-m68k/got-negative-12-13-14-34-ok.d: New dump test.
- * ld-m68k/got-negative-12-13-14-35-er.d: New dump test.
- * ld-m68k/got-multigot-14-ok.d: New dump test.
- * ld-m68k/got-multigot-15-er.d: New dump test.
- * ld-m68k/got-multigot-12-13-14-34-35-ok.d: New dump test.
- * ld-m68k/xgot-15.s: New source.
- * ld-m68k/got-xgot-15-ok.d: New test.
- * ld-m68k/got-xgot-12-13-14-15-34-35-ok.d: New test.
- * ld-m68k/m68k.exp: Run new tests.
-
-2008-05-15 Christophe Lyon <christophe.lyon@st.com>
-
- * ld-arm/arm-elf.exp (armelftests): Add farcall-arm-arm,
- farcall-arm-arm-pic-veneer, farcall-arm-arm-be8 farcall-arm-thumb,
- farcall-arm-thumb-blx, farcall-arm-thumb-pic-veneer,
- farcall-arm-thumb-blx-pic-veneer, farcall-thumb-thumb,
- farcall-thumb-thumb-pic-veneer, farcall-thumb-thumb-blx,
- farcall-thumb-thumb-m, farcall-thumb-thumb-m-pic-veneer,
- farcall-thumb-thumb-blx-pic-veneer, farcall-thumb-arm,
- farcall-thumb-arm-pic-veneer, farcall-thumb-arm-blx,
- farcall-thumb-arm-blx-pic-veneer.
- Change thumb2-bl-as-thumb1-bad, thumb2-bl-bad.
- * ld-arm/thumb2-bl-as-thumb1-bad.d: Reflects farcall stub
- generation.
- * ld-arm/thumb2-bl-bad.d: Likewise.
- * ld-arm/thumb2-bl-as-thumb1-bad.s: Update comments.
- * ld-arm/thumb2-bl-bad.s: Likewise.
-
-2008-05-08 Alan Modra <amodra@bigpond.net.au>
-
- * ld-spu/ear.s: Align various sections.
- * ld-spu/embed.rd: Update.
-
-2008-05-05 Alan Modra <amodra@bigpond.net.au>
-
- PR 6473
- * ld-elf/lma.s, ld-elf/lma.lnk: New test.
- * ld-elf/binutils.exp: Run it.
-
-2008-05-03 Mike Frysinger <vapier@gentoo.org>
-
- * ld-scripts/defined.s: Use .set syntax rather than =.
-
-2008-05-02 H.J. Lu <hongjiu.lu@intel.com>
-
- PR ld/6475
- * ld-scripts/rgn-over8-ok.d: Accept any alignment.
-
-2008-04-29 Daniel Jacobowitz <dan@codesourcery.com>
-
- * ld-arm/symbian-seg1.s, ld-arm/symbian-seg1.d: New files.
- * ld-arm/arm-elf.exp: Run symbian-seg1.
-
-2008-04-28 Nathan Sidwell <nathan@codesourcery.com>
-
- * ld-scripts/rgn-over8.s: Tweak.
-
- * ld-scripts/rgn-over.exp: Allow -ok file names to pass.
- * ld-scripts/rgn-over8.s: New.
- * ld-scripts/rgn-over8.t: New.
- * ld-scripts/rgn-over8-ok.d: New.
-
-2008-04-21 Nathan Sidwell <nathan@codesourcery.com>
-
- * ld-vxworks/plt-mips1.s: New.
- * ld-vxworks/plt-mips1.d: New.
-
-2008-04-16 David S. Miller <davem@davemloft.net>
-
- * ld-sparc/gotop32.dd: New.
- * ld-sparc/gotop32.rd: Likewise.
- * ld-sparc/gotop32.s: Likewise.
- * ld-sparc/gotop32.sd: Likewise.
- * ld-sparc/gotop32.td: Likewise.
- * ld-sparc/gotop64.dd: Likewise.
- * ld-sparc/gotop64.rd: Likewise.
- * ld-sparc/gotop64.s: Likewise.
- * ld-sparc/gotop64.sd: Likewise.
- * ld-sparc/gotop64.td: Likewise.
- * ld-sparc/sparc.exp: Run new gotdata tests.
-
-2008-04-15 Andrew Stubbs <andrew.stubbs@st.com>
-
- * ld-sh/arch/sh-dsp.s: Regenerate.
- * ld-sh/arch/sh.s: Regenerate.
- * ld-sh/arch/sh2.s: Regenerate.
- * ld-sh/arch/sh2a-nofpu-or-sh3-nommu.s: Regenerate.
- * ld-sh/arch/sh2a-nofpu-or-sh4-nommu-nofpu.s: Regenerate.
- * ld-sh/arch/sh2a-nofpu.s: Regenerate.
- * ld-sh/arch/sh2a-or-sh3e.s: Regenerate.: Regenerate.
- * ld-sh/arch/sh2a-or-sh4.s: Regenerate.
- * ld-sh/arch/sh2a.s: Regenerate.
- * ld-sh/arch/sh2e.s: Regenerate.
- * ld-sh/arch/sh3-dsp.s: Regenerate.
- * ld-sh/arch/sh3-nommu.s: Regenerate.
- * ld-sh/arch/sh3.s: Regenerate.
- * ld-sh/arch/sh3e.s: Regenerate.
- * ld-sh/arch/sh4-nofpu.s: Regenerate.
- * ld-sh/arch/sh4-nommu-nofpu.s: Regenerate.
- * ld-sh/arch/sh4.s: Regenerate.
- * ld-sh/arch/sh4a-nofpu.s: Regenerate.
- * ld-sh/arch/sh4a.s: Regenerate.
- * ld-sh/arch/sh4al-dsp.s: Regenerate.
-
-2008-04-08 Alan Modra <amodra@bigpond.net.au>
-
- * ld-spu/ovl2.s: Extend to test jump table references and
- absolute _SPUEAR_ syms.
- * ld-spu/ovl2.d: Update.
-
-2008-03-28 Joseph Myers <joseph@codesourcery.com>
-
- * ld-elfcomm/elfcomm.exp: Run $READELF not readelf.
-
-2008-03-26 Daniel Jacobowitz <dan@codesourcery.com>
-
- * ld-elf/flags1.d: Adjust for MIPS text alignment.
-
-2008-03-25 Nathan Sidwell <nathan@codesourcery.com>
-
- * ld-vxworks/tls-3.s: New.
- * ld-vxworks/tls-3.d: New.
-
-2008-03-22 Hans-Peter Nilsson <hp@axis.com>
-
- * ld-cris/libdso-10.d: Adjust for change in objdump output.
-
-2008-03-21 Adam Nemet <anemet@caviumnetworks.com>
-
- * ld-mips-elf/dyn-sec64.d, ld-mips-elf/dyn-sec64.s,
- ld-mips-elf/dyn-sec64.ld: New test.
- * ld-mips-elf/mips-elf.exp: Run it.
-
-2008-03-20 Richard Sandiford <rsandifo@nildram.co.uk>
-
- * ld-mips-elf/got-dump-1.d, ld-mips-elf/got-dump-1.s,
- ld-mips-elf/got-dump-1.ld, ld-mips-elf/got-dump-2.d,
- ld-mips-elf/got-dump-2.s, ld-mips-elf/got-dump-2.ld: New tests.
- * ld-mips-elf/mips-elf.exp: Run them.
-
-2008-03-20 Richard Sandiford <rsandifo@nildram.co.uk>
-
- * ld-mips-elf/elf-rel-got-n64-linux.d: Expect bit 63 rather than
- bit 31 of the second GOT entry to be set.
- * ld-mips-elf/elf-rel-got-n64.d: Likewise.
- * ld-mips-elf/elf-rel-xgot-n64-linux.d: Likewise.
- * ld-mips-elf/elf-rel-xgot-n64.d: Likewise.
-
-2008-03-17 Richard Sandiford <rsandifo@nildram.co.uk>
-
- * ld-mips-elf/eh-frame1-n32.d: Expect a warning about .eh_frame_hdr.
- Remove duplicate CIEs. Adjust relocation addresses and .eh_frame
- offsets accordingly. Do not allow there to be any trailing
- R_MIPS_NONE relocations.
- * ld-mips-elf/eh-frame1-n64.d: Likewise.
- * ld-mips-elf/eh-frame2-n32.d: Likewise.
- * ld-mips-elf/eh-frame2-n64.d: Likewise.
-
-2008-03-17 Richard Sandiford <rsandifo@nildram.co.uk>
-
- * ld-mips-elf/mips-elf.exp (o32_as_flags, o32_ld_flags): New variables.
- (mips16_call_global_test, mips16_intermix_test): Use them.
-
-2008-03-16 H.J. Lu <hongjiu.lu@intel.com>
-
- PR ld/5789
- PR ld/5943
- * ld-i386/hidden1.d: New.
- * ld-i386/hidden1.s: Likewise.
- * ld-i386/hidden2.d: Likewise.
- * ld-i386/hidden2.s: Likewise.
- * ld-i386/hidden3.d: Likewise.
- * ld-i386/hidden4.s: Likewise.
- * ld-i386/protected1.d: Likewise.
- * ld-i386/protected1.s: Likewise.
- * ld-i386/protected2.d: Likewise.
- * ld-i386/protected2.s: Likewise.
- * ld-i386/protected3.d: Likewise.
- * ld-i386/protected3.s: Likewise.
- * ld-x86-64/hidden1.d: Likewise.
- * ld-x86-64/hidden1.s: Likewise.
- * ld-x86-64/hidden2.d: Likewise.
- * ld-x86-64/hidden2.s: Likewise.
- * ld-x86-64/hidden3.d: Likewise.
- * ld-x86-64/hidden3.s: Likewise.
- * ld-x86-64/protected1.d: Likewise.
- * ld-x86-64/protected1.s: Likewise.
- * ld-x86-64/protected2.d: Likewise.
- * ld-x86-64/protected2.s: Likewise.
- * ld-x86-64/protected3.d: Likewise.
- * ld-x86-64/protected3.s: Likewise.
-
- * ld-i386/i386.exp: Run hidden1, hidden2, hidden3, protected1,
- protected2 and protected3.
- * ld-x86-64/x86-64.exp: Likewise.
-
-2008-03-14 Alan Modra <amodra@bigpond.net.au>
-
- * ld-spu/ovl2.s: Make setjmp global.
- * ld-spu/ovl2.d: Update.
-
-2008-03-12 Alan Modra <amodra@bigpond.net.au>
-
- PR 5900
- * ld-elf/sec64k.exp: Update.
-
-2008-03-08 Paul Brook <paul@codesourcery.com>
-
- * ld-arm/arm-elf.exp (armeabitests): Add thumb2-b-interwork.
- * ld-arm/thumb2-b-interwork.d: New test.
- * ld-arm/thumb2-b-interwork.s: New test.
-
-2008-03-07 Paul Brook <paul@codesourcery.com>
-
- * ld-arm/arm-elf.exp (armelftests): Add movw-merge and arm-app-movw.
- * ld-arm/arm-app-movw.s: New test.
- * ld-arm/arm-app.r: Update expected output.
- * ld-arm/movw-merge.d: New test.
- * ld-arm/movw-merge.s: New test.
-
-2008-03-01 Alan Modra <amodra@bigpond.net.au>
-
- * ld-powerpc/relbrlt.d: Update. Also check .branch_lt section.
-
-2008-02-27 Catherine Moore <clm@codesourcery.com>
-
- * ld-cris/libdso-10.d: Update expected output for the Dynamic
- Section to allow an arbitrary number of spaces.
-
-2008-02-20 Mark Mitchell <mark@codesourcery.com>
-
- ld/testsuite/
- * ld-elf/seg.d: Expect .reginfo section on MIPS.
-
-2008-02-20 Pedro Alves <pedro_alves@portugalmail.pt>
-
- * ld-auto-import/auto-import.exp: Use $ld to link the dll for
- cygwin, not $CC.
-
-2008-02-18 Hans-Peter Nilsson <hp@axis.com>
-
- * lib/ld-lib.exp (run_dump_test): Don't apply prune_warnings
- for tool invocations where warnings or errors can be matched.
-
-2008-02-14 H.J. Lu <hongjiu.lu@intel.com>
-
- * ld-shared/sh1.c (shlib_overriddencall2): Moved to ...
- * ld-shared/sh2.c (shlib_overriddencall2): Here. New.
-
-2008-02-07 Alan Modra <amodra@bigpond.net.au>
-
- * ld-spu/ovl.d: Update.
- * ld-spu/ovl2.d: Update.
-
-2008-02-04 Bob Wilson <bob.wilson@acm.org>
-
- * ld-undefined/undefined.exp: XFAIL for xtensa*-*-linux*.
-
-2008-01-31 Marc Gauthier <marc@tensilica.com>
-
- * ld-elf/merge.d: Recognize Xtensa processor variants.
- * ld-xtensa/coalesce.exp: Likewise.
- * ld-xtensa/lcall.exp: Likewise.
-
-2008-01-28 Petr Muller <pmuller@redhat.com>
-
- * ld-elfvers/vers.exp (test_ar): Sort the expected output so that
- it has matches the ordering of the obtained output.
-
-2008-01-28 H.J. Lu <hongjiu.lu@intel.com>
-
- * ld-elf/eh1.d: Replace DW_CFA_def_cfa_reg with
- DW_CFA_def_cfa_register. Updated for i386/x86-64 register
- names.
- * ld-elf/eh2.d: Likewise.
- * ld-elf/eh3.d: Likewise.
- * ld-elf/eh4.d: Likewise.
- * ld-elf/eh5.d: Likewise.
-
-2008-01-28 Alan Modra <amodra@bigpond.net.au>
-
- * ld-spu/ovl.d: Update.
- * ld-spu/ovl2.d: Update.
-
-2008-01-26 Alan Modra <amodra@bigpond.net.au>
-
- * ld-elf/loadaddr.t: New, extracted from..
- * ld-elf/loadaddr1.t: ..here. Use insert.
- * ld-elf/loadaddr2.t: Likewise.
- * ld-elf/loadaddr1.d: Update.
- * ld-elf/loadaddr2.d: Update.
-
-2008-01-25 Alan Modra <amodra@bigpond.net.au>
-
- * ld-spu/ovl.lnk: Delete overlay.
- * ld-spu/ovl1.lnk: New file.
- * ld-spu/ovl2.lnk: New file.
- * ld-spu/ovl.d: Update.
- * ld-spu/ovl2.d: Update.
-
-2008-01-23 Andreas Schwab <schwab@suse.de>
-
- * ld-gc/gc.c: Make sure used_func is not inlined.
-
-2008-01-22 H.J. Lu <hongjiu.lu@intel.com>
-
- * ld-gc/gc.exp: Use [which $CC] != 0.
-
-2008-01-14 Tristan Gingold <gingold@adacore.com>
-
- * ld-gc/gc.exp (test_gc): Let missing C compiler make tests
- "untested" instead of "failed".
-
-2008-01-10 Tristan Gingold <gingold@adacore.com>
-
- * lib/ld-lib.exp (check_gc_sections_available): Now available on
- VxWorks.
- * ld-gc: New directory for testing --gc-sections.
- * ld-gc/gc.c: New file.
- * ld-gc/gc.exp: New file.
- * ld-gc/noent.s: New file.
- * ld-gc/noent.d: New file.
-
-2008-01-09 Richard Sandiford <rsandifo@nildram.co.uk>
-
- PR ld/5526
- * ld-elf/eh6.s, ld-elf/eh6.d: New test.
-
-2008-01-07 H.J. Lu <hongjiu.lu@intel.com>
-
- PR ld/5522
- * ld-elf/noload-3.d: New file.
- * ld-elf/noload-3.s: Likewise.
- * ld-elf/noload-3.t: Likewise.
-
-For older changes see ChangeLog-2007
-
-Local Variables:
-mode: change-log
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
diff --git a/ld/testsuite/ld-elf/sec-to-seg-script-adjoining-pages.t b/ld/testsuite/ld-elf/sec-to-seg-script-adjoining-pages.t
deleted file mode 100644
index 763fcb748c9..00000000000
--- a/ld/testsuite/ld-elf/sec-to-seg-script-adjoining-pages.t
+++ /dev/null
@@ -1,11 +0,0 @@
-SECTIONS
-{
- . = 0x1000;
- .sec1 : { *sec-to-seg1.o(.rodata) }
- . += CONSTANT(MAXPAGESIZE);
- .sec2 : { *sec-to-seg2.o(.rodata) }
-
- .data : { *(.data) } /* For hppa64. */
-
- /DISCARD/ : {*(*) }
-}
diff --git a/ld/testsuite/ld-elf/sec-to-seg-script-disjoint-pages.t b/ld/testsuite/ld-elf/sec-to-seg-script-disjoint-pages.t
deleted file mode 100644
index 25023ccfde3..00000000000
--- a/ld/testsuite/ld-elf/sec-to-seg-script-disjoint-pages.t
+++ /dev/null
@@ -1,11 +0,0 @@
-SECTIONS
-{
- . = 0x1000;
- .sec1 : { *sec-to-seg1.o(.rodata) }
- . += CONSTANT(MAXPAGESIZE) * 2;
- .sec2 : { *sec-to-seg2.o(.rodata) }
-
- .data : { *(.data) } /* For hppa64. */
-
- /DISCARD/ : {*(*) }
-}
diff --git a/ld/testsuite/ld-elf/sec-to-seg-script-same-page.t b/ld/testsuite/ld-elf/sec-to-seg-script-same-page.t
deleted file mode 100644
index 2b50f7e3065..00000000000
--- a/ld/testsuite/ld-elf/sec-to-seg-script-same-page.t
+++ /dev/null
@@ -1,10 +0,0 @@
-SECTIONS
-{
- . = 0x1000;
- .sec1 : { *sec-to-seg1.o(.rodata) }
- .sec2 : { *sec-to-seg2.o(.rodata) }
-
- .data : { *(.data) } /* For hppa64. */
-
- /DISCARD/ : {*(*) }
-}
diff --git a/ld/testsuite/ld-elf/sec-to-seg.exp b/ld/testsuite/ld-elf/sec-to-seg.exp
deleted file mode 100644
index a576fcefcd2..00000000000
--- a/ld/testsuite/ld-elf/sec-to-seg.exp
+++ /dev/null
@@ -1,97 +0,0 @@
-# Test the assigment of sections to segments.
-#
-# Copyright 2008 Free Software Foundation, Inc.
-# Contributed by Red Hat.
-#
-# This file is part of the GNU Binutils.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-# MA 02110-1301, USA.
-
-set testname "assignment of ELF sections to segments"
-
-if {! [is_elf_format] } {
- unsupported $testname
- return
-}
-
-if { ! [ld_assemble $as $srcdir/$subdir/sec-to-seg1.s tmpdir/sec-to-seg1.o]
- || ! [ld_assemble $as $srcdir/$subdir/sec-to-seg2.s tmpdir/sec-to-seg2.o]} then {
- unresolved $testname
- return
-}
-
-proc sec_to_seg_test { testname scriptname same_seg } {
- global srcdir
- global subdir
- global ld
- global exec_output
- global READELF
-
- if {! [ld_simple_link $ld tmpdir/sec-to-seg "-T $srcdir/$subdir/$scriptname tmpdir/sec-to-seg1.o tmpdir/sec-to-seg2.o"] } then {
- fail $testname
- return 0
- }
-
- send_log "$READELF --program-headers --section-headers tmpdir/sec-to-seg\n"
- set exec_output [run_host_cmd "$READELF" "--program-headers --section-headers tmpdir/sec-to-seg"]
-
- if { $same_seg == 1 } {
- if {! [regexp ".*.sec1 .sec2" $exec_output] } {
- fail $testname
- return 0
- }
- } else {
- if { [regexp ".*.sec1 .sec2" $exec_output] } {
- fail $testname
- return 0
- }
- }
-
- pass $testname
- return 1
-}
-
-# Assuming a pagesize of 0x1000 then:
-#
-# Test Sec1 End Sec 2 Start Expected Result
-# ---- -------- ----------- ---------------
-# A 00001042 00001043 Both sections on same page: assign to same segment.
-# B 00001042 00002044 Sections on adjacent pages: assign to same segment.
-# C 00001042 00003044 Sections on disjoint pages: assign to separate segments.
-
-# These targets have a pagesize of 1, so they will always end up
-# placing the two sections in separate segments in the B test.
-if { [istarget avr-*-*]
- || [istarget cr16-*-*]
- || [istarget crx-*-*]
- || [istarget dlx-*-*]
- || [istarget h8300-*-*]
- || [istarget ip2k-*-*]
- || [istarget m32r-*-*]
- || [istarget m88k-*-*]
- || [istarget msp430-*-*]
- } {
- set B_test_same_seg 0
-} else {
- set B_test_same_seg 1
-}
-
-sec_to_seg_test "assignment of ELF sections to segments (same page)" "sec-to-seg-script-same-page.t" 1
-sec_to_seg_test "assignment of ELF sections to segments (adjacent pages)" "sec-to-seg-script-adjoining-pages.t" $B_test_same_seg
-sec_to_seg_test "assignment of ELF sections to segments (disjoint pages)" "sec-to-seg-script-disjoint-pages.t" 0
-
-
-# FIXME: Add more tests to check other rules of section to segment assignment.
diff --git a/ld/testsuite/ld-elf/sec-to-seg1.s b/ld/testsuite/ld-elf/sec-to-seg1.s
deleted file mode 100644
index 7c9f47926fe..00000000000
--- a/ld/testsuite/ld-elf/sec-to-seg1.s
+++ /dev/null
@@ -1,9 +0,0 @@
- .file "sec-to-seg1.s"
-
- .section .rodata
- .align 2
- .ascii "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\000"
- .align 2
- .ascii "00000000000000000000000000000000\000"
-
-
diff --git a/ld/testsuite/ld-elf/sec-to-seg2.s b/ld/testsuite/ld-elf/sec-to-seg2.s
deleted file mode 100644
index b1dd0780e73..00000000000
--- a/ld/testsuite/ld-elf/sec-to-seg2.s
+++ /dev/null
@@ -1,13 +0,0 @@
- .file "sec-to-seg2.s"
-
- .section .rodata
- .align 2
- .ascii "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\000"
- .align 2
- .ascii "55555555555555555555555555555555\000"
- .align 2
- .ascii "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\000"
- .align 2
- .ascii "99999999999999999999999999999999\000"
-
-
diff --git a/ld/testsuite/ld-gc/gc.exp b/ld/testsuite/ld-gc/gc.exp
deleted file mode 100644
index 400e989606c..00000000000
--- a/ld/testsuite/ld-gc/gc.exp
+++ /dev/null
@@ -1,81 +0,0 @@
-# Expect script for ld-gc tests
-# Copyright 2008
-# Free Software Foundation, Inc.
-#
-# This file is part of the GNU Binutils.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
-# MA 02110-1301, USA.
-
-# These tests require --gc-sections
-if ![check_gc_sections_available] {
- return
-}
-
-set cflags "-ffunction-sections -fdata-sections"
-set objfile "tmpdir/gc.o"
-
-if { [is_remote host] || [which $CC] != 0 } {
- ld_compile "$CC -c $CFLAGS $cflags" $srcdir/$subdir/gc.c $objfile
-}
-
-proc test_gc { testname filename linker ldflags} {
- global nm
- global srcdir
- global subdir
- global nm_output
- global objfile
-
- if ![file readable $objfile ] {
- untested $testname
- return
- }
-
- set outfile "tmpdir/$filename"
-
- if ![ld_simple_link $linker $outfile "-L$srcdir/$subdir $ldflags $objfile"] {
- fail $testname
- return
- }
- if ![ld_nm $nm "" $outfile] {
- unresolved $testname
- return
- }
- if {![info exists nm_output(used_func)] \
- || ![info exists nm_output(used_var)]} {
- send_log "used sections do not exist\n"
- verbose "used sections do not exist"
- fail $testname
- return
- }
- #ppc64_elf_gc_mark_hook needs to be taught how to look through
- #the .toc section to properly mark variable sections for gc.
- setup_xfail "powerpc64*-*-*"
- if {[info exists nm_output(unused_func)] \
- || [info exists nm_output(unused_var)]} {
- send_log "unused section still here\n"
- verbose "unused section still here"
- fail $testname
- return
- }
- pass $testname
-}
-
-test_gc "Check --gc-section" "gcexe" $ld "--gc-sections -e main"
-test_gc "Check --gc-section/-q" "gcrexe" $ld "--gc-sections -q -e main"
-test_gc "Check --gc-section/-r/-e" "gcrel" $ld "-r --gc-sections -e main"
-test_gc "Check --gc-section/-r/-u" "gcrel" $ld "-r --gc-sections -u used_func"
-
-run_dump_test "noent"
diff --git a/ld/testsuite/ld-i386/tlsbindesc.dd b/ld/testsuite/ld-i386/tlsbindesc.dd
deleted file mode 100644
index f77d1c8d5fd..00000000000
--- a/ld/testsuite/ld-i386/tlsbindesc.dd
+++ /dev/null
@@ -1,456 +0,0 @@
-#source: tlsbindesc.s
-#source: tlsbin.s
-#as: --32
-#ld: -melf_i386 tmpdir/libtlslib.so
-#objdump: -drj.text
-#target: i?86-*-*
-
-# PT_TLS layout is:
-# Offset from Offset from Name
-# TCB base TCB end
-# 0x00 -0xa0 sg1..sg8
-# 0x20 -0x80 sl1..sl8
-# 0x40 -0x60 sh1..sh8
-# 0x60 -0x40 bg1..bg8
-# 0x80 -0x20 bl1..bl8
-
-.*: +file format elf32-i386
-
-Disassembly of section .text:
-
-[0-9a-f]+ <fn2>:
- [0-9a-f]+: 55[ ]+push %ebp
- [0-9a-f]+: 89 e5[ ]+mov %esp,%ebp
- [0-9a-f]+: 53[ ]+push %ebx
- [0-9a-f]+: 50[ ]+push %eax
- [0-9a-f]+: e8 00 00 00 00[ ]+call [0-9a-f]+ <fn2\+0xa>
- [0-9a-f]+: 5b[ ]+pop %ebx
- [0-9a-f]+: 81 c3 fa 10 00 00[ ]+add \$0x10fa,%ebx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# GD -> IE because variable is not defined in executable
- [0-9a-f]+: 8b 83 f8 ff ff ff[ ]+mov -0x8\(%ebx\),%eax
-# ->R_386_TLS_TPOFF32 sG1
- [0-9a-f]+: f7 d8[ ]+neg %eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# GD -> IE because variable is not defined in executable where
-# the variable is referenced through @gottpoff too
- [0-9a-f]+: 8b 83 e8 ff ff ff[ ]+mov -0x18\(%ebx\),%eax
-# ->R_386_TLS_TPOFF32 sG2
- [0-9a-f]+: f7 d8[ ]+neg %eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# GD -> IE because variable is not defined in executable where
-# the variable is referenced through @gotntpoff too
- [0-9a-f]+: 8b 83 dc ff ff ff[ ]+mov -0x24\(%ebx\),%eax
-# ->R_386_TLS_TPOFF sG3
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# GD -> IE because variable is not defined in executable where
-# the variable is referenced through @gottpoff and @gotntpoff too
- [0-9a-f]+: 8b 83 f0 ff ff ff[ ]+mov -0x10\(%ebx\),%eax
-# ->R_386_TLS_TPOFF32 sG4
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# GD -> LE with global variable defined in executable
- [0-9a-f]+: 8d 05 00 f0 ff ff[ ]+lea 0xfffff000,%eax
-# sg1
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# GD -> LE with local variable defined in executable
- [0-9a-f]+: 8d 05 20 f0 ff ff[ ]+lea 0xfffff020,%eax
-# sl1
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# GD -> LE with hidden variable defined in executable
- [0-9a-f]+: 8d 05 40 f0 ff ff[ ]+lea 0xfffff040,%eax
-# sh1
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LD -> LE
- [0-9a-f]+: 8d 05 00 00 00 00[ ]+lea 0x0,%eax
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 8d 90 20 f0 ff ff[ ]+lea -0xfe0\(%eax\),%edx
-# sl1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 8d 88 24 f0 ff ff[ ]+lea -0xfdc\(%eax\),%ecx
-# sl2
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LD -> LE against hidden variables
- [0-9a-f]+: 8d 05 00 00 00 00[ ]+lea 0x0,%eax
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 8d 90 40 f0 ff ff[ ]+lea -0xfc0\(%eax\),%edx
-# sh1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 8d 88 44 f0 ff ff[ ]+lea -0xfbc\(%eax\),%ecx
-# sh2
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gottpoff IE against global var
- [0-9a-f]+: 65 8b 0d 00 00 00 00[ ]+mov %gs:0x0,%ecx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 2b 8b e8 ff ff ff[ ]+sub -0x18\(%ebx\),%ecx
-# ->R_386_TLS_TPOFF32 sG2
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gottpoff IE against global var
- [0-9a-f]+: 65 a1 00 00 00 00[ ]+mov %gs:0x0,%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 2b 83 ec ff ff ff[ ]+sub -0x14\(%ebx\),%eax
-# ->R_386_TLS_TPOFF32 sG4
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gotntpoff IE against global var
- [0-9a-f]+: 65 8b 0d 00 00 00 00[ ]+mov %gs:0x0,%ecx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 03 8b dc ff ff ff[ ]+add -0x24\(%ebx\),%ecx
-# ->R_386_TLS_TPOFF sG3
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gotntpoff IE against global var
- [0-9a-f]+: 65 a1 00 00 00 00[ ]+mov %gs:0x0,%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 03 83 f0 ff ff ff[ ]+add -0x10\(%ebx\),%eax
-# ->R_386_TLS_TPOFF sG4
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gottpoff IE -> LE against global var defined in exec
- [0-9a-f]+: 65 8b 0d 00 00 00 00[ ]+mov %gs:0x0,%ecx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 81 e9 00 10 00 00[ ]+sub \$0x1000,%ecx
-# sg1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gotntpoff IE -> LE against local var
- [0-9a-f]+: 65 8b 0d 00 00 00 00[ ]+mov %gs:0x0,%ecx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 81 c0 20 f0 ff ff[ ]+add \$0xfffff020,%eax
-# sl1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gottpoff IE -> LE against hidden var
- [0-9a-f]+: 65 8b 0d 00 00 00 00[ ]+mov %gs:0x0,%ecx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 81 e9 c0 0f 00 00[ ]+sub \$0xfc0,%ecx
-# sh1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# Direct access through %gs
-# @gotntpoff IE against global var
- [0-9a-f]+: 8b 8b e0 ff ff ff[ ]+mov -0x20\(%ebx\),%ecx
-# ->R_386_TLS_TPOFF sG5
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 65 8b 11[ ]+mov %gs:\(%ecx\),%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gotntpoff IE->LE against local var
- [0-9a-f]+: c7 c0 30 f0 ff ff[ ]+mov \$0xfffff030,%eax
-# sl5
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 65 8b 10[ ]+mov %gs:\(%eax\),%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gotntpoff IE->LE against hidden var
- [0-9a-f]+: c7 c2 50 f0 ff ff[ ]+mov \$0xfffff050,%edx
-# sh5
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 65 8b 12[ ]+mov %gs:\(%edx\),%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 8b 5d fc[ ]+mov -0x4\(%ebp\),%ebx
- [0-9a-f]+: c9[ ]+leave *
- [0-9a-f]+: c3[ ]+ret *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-
-[0-9a-f]+ <_start>:
- [0-9a-f]+: 55[ ]+push %ebp
- [0-9a-f]+: 89 e5[ ]+mov %esp,%ebp
- [0-9a-f]+: e8 00 00 00 00[ ]+call [0-9a-f]+ <_start\+0x8>
- [0-9a-f]+: 59[ ]+pop %ecx
- [0-9a-f]+: 81 c1 a4 0f 00 00[ ]+add \$0xfa4,%ecx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gottpoff IE against global var
- [0-9a-f]+: 65 8b 15 00 00 00 00[ ]+mov %gs:0x0,%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 2b 91 f4 ff ff ff[ ]+sub -0xc\(%ecx\),%edx
-# ->R_386_TLS_TPOFF32 sG6
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @indntpoff IE against global var
- [0-9a-f]+: 65 a1 00 00 00 00[ ]+mov %gs:0x0,%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 03 05 e8 a0 04 08[ ]+add 0x804a0e8,%eax
-# ->R_386_TLS_TPOFF sG7
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @indntpoff direct %gs access IE against global var
- [0-9a-f]+: 8b 15 00 a1 04 08[ ]+mov 0x804a100,%edx
-# ->R_386_TLS_TPOFF sG8
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 65 8b 02[ ]+mov %gs:\(%edx\),%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gottpoff IE -> LE against global var defined in exec
- [0-9a-f]+: 65 8b 15 00 00 00 00[ ]+mov %gs:0x0,%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 81 ea 8c 0f 00 00[ ]+sub \$0xf8c,%edx
-# bg6
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @indntpoff IE -> LE against global var defined in exec
- [0-9a-f]+: 65 a1 00 00 00 00[ ]+mov %gs:0x0,%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 81 c0 78 f0 ff ff[ ]+add \$0xfffff078,%eax
-# bg7
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @indntpoff direct %gs access IE -> LE against global var defined
-# in exec
- [0-9a-f]+: c7 c2 7c f0 ff ff[ ]+mov \$0xfffff07c,%edx
-# bg8
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 65 8b 02[ ]+mov %gs:\(%edx\),%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gottpoff IE -> LE against local var
- [0-9a-f]+: 65 8b 15 00 00 00 00[ ]+mov %gs:0x0,%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 81 ea 6c 0f 00 00[ ]+sub \$0xf6c,%edx
-# bl6
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @indntpoff IE -> LE against local var
- [0-9a-f]+: 65 a1 00 00 00 00[ ]+mov %gs:0x0,%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 81 c0 98 f0 ff ff[ ]+add \$0xfffff098,%eax
-# bl7
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @indntpoff direct %gs access IE -> LE against local var
- [0-9a-f]+: c7 c2 9c f0 ff ff[ ]+mov \$0xfffff09c,%edx
-# bl8
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 65 8b 02[ ]+mov %gs:\(%edx\),%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @gottpoff IE -> LE against hidden but not local var
- [0-9a-f]+: 65 8b 15 00 00 00 00[ ]+mov %gs:0x0,%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 81 ea ac 0f 00 00[ ]+sub \$0xfac,%edx
-# sh6
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @indntpoff IE -> LE against hidden but not local var
- [0-9a-f]+: 65 a1 00 00 00 00[ ]+mov %gs:0x0,%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 81 c0 58 f0 ff ff[ ]+add \$0xfffff058,%eax
-# sh7
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# @indntpoff direct %gs access IE -> LE against hidden but not
-# local var
- [0-9a-f]+: c7 c2 5c f0 ff ff[ ]+mov \$0xfffff05c,%edx
-# sh8
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 65 8b 02[ ]+mov %gs:\(%edx\),%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE @tpoff, global var defined in exec
- [0-9a-f]+: ba 00 10 00 00[ ]+mov \$0x1000,%edx
-# sg1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 65 a1 00 00 00 00[ ]+mov %gs:0x0,%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 29 d0[ ]+sub %edx,%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE @tpoff, local var
- [0-9a-f]+: b8 7f 0f 00 00[ ]+mov \$0xf7f,%eax
-# bl1+1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 65 8b 15 00 00 00 00[ ]+mov %gs:0x0,%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 29 c2[ ]+sub %eax,%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE @tpoff, hidden var defined in exec
- [0-9a-f]+: b8 bd 0f 00 00[ ]+mov \$0xfbd,%eax
-# sh1+3
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 65 8b 15 00 00 00 00[ ]+mov %gs:0x0,%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 29 c2[ ]+sub %eax,%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE @ntpoff, global var defined in exec
- [0-9a-f]+: 65 a1 00 00 00 00[ ]+mov %gs:0x0,%eax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 8d 90 04 f0 ff ff[ ]+lea -0xffc\(%eax\),%edx
-# sg2
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE @ntpoff, local var, non-canonical sequence
- [0-9a-f]+: b8 86 f0 ff ff[ ]+mov \$0xfffff086,%eax
-# bl2+2
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 65 8b 15 00 00 00 00[ ]+mov %gs:0x0,%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 01 c2[ ]+add %eax,%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE @ntpoff, hidden var defined in exec, non-canonical sequence
- [0-9a-f]+: 65 8b 15 00 00 00 00[ ]+mov %gs:0x0,%edx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 81 c2 45 f0 ff ff[ ]+add \$0xfffff045,%edx
-# sh2+1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE @ntpoff, global var defined in exec
- [0-9a-f]+: 65 a1 08 f0 ff ff[ ]+mov %gs:0xfffff008,%eax
-# sg3
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE @ntpoff, local var
- [0-9a-f]+: 65 8b 15 8b f0 ff ff[ ]+mov %gs:0xfffff08b,%edx
-# bl3+3
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE @ntpoff, hidden var defined in exec
- [0-9a-f]+: 65 8b 15 49 f0 ff ff[ ]+mov %gs:0xfffff049,%edx
-# sh3+1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 8b 5d fc[ ]+mov -0x4\(%ebp\),%ebx
- [0-9a-f]+: c9[ ]+leave *
- [0-9a-f]+: c3[ ]+ret *
diff --git a/ld/testsuite/ld-i386/tlsbindesc.rd b/ld/testsuite/ld-i386/tlsbindesc.rd
deleted file mode 100644
index dd3e65eeea3..00000000000
--- a/ld/testsuite/ld-i386/tlsbindesc.rd
+++ /dev/null
@@ -1,151 +0,0 @@
-#source: tlsbindesc.s
-#source: tlsbin.s
-#as: --32
-#ld: -melf_i386 tmpdir/libtlslib.so
-#readelf: -Ssrl
-#target: i?86-*-*
-
-There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+:
-
-Section Headers:
- \[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al
- +\[[ 0-9]+\] +NULL +0+ 0+ 0+ 0+ +0 +0 +0
- +\[[ 0-9]+\] \.interp +.*
- +\[[ 0-9]+\] \.hash +.*
- +\[[ 0-9]+\] \.dynsym +.*
- +\[[ 0-9]+\] \.dynstr +.*
- +\[[ 0-9]+\] \.rel.dyn +.*
- +\[[ 0-9]+\] \.text +PROGBITS +0+8049000 .*
- +\[[ 0-9]+\] \.tdata +PROGBITS +0+804a000 [0-9a-f]+ 000060 00 WAT 0 0 4096
- +\[[ 0-9]+\] \.tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ 000040 00 WAT 0 0 1
- +\[[ 0-9]+\] \.dynamic +DYNAMIC +0+804a060 .*
- +\[[ 0-9]+\] \.got +PROGBITS +0+804a0e0 .*
- +\[[ 0-9]+\] \.got\.plt +PROGBITS +0+804a104 .*
- +\[[ 0-9]+\] \.shstrtab +.*
- +\[[ 0-9]+\] \.symtab +.*
- +\[[ 0-9]+\] \.strtab +.*
-Key to Flags:
-.*
-.*
-.*
-
-Elf file type is EXEC \(Executable file\)
-Entry point 0x8049158
-There are [0-9]+ program headers, starting at offset [0-9]+
-
-Program Headers:
- Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
- PHDR.*
- INTERP.*
-.*Requesting program interpreter.*
- LOAD.*
- LOAD.*
- DYNAMIC.*
- TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+a0 R +0x1000
-
- Section to Segment mapping:
- Segment Sections...
- 00 +
- 01 +.interp *
- 02 +.interp .hash .dynsym .dynstr .rel.dyn .text *
- 03 +.tdata .dynamic .got .got.plt *
- 04 +.dynamic *
- 05 +.tdata .tbss *
-
-Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 9 entries:
- Offset +Info +Type +Sym.Value +Sym. Name
-0+804a0e0 0000010e R_386_TLS_TPOFF +0+ +sG3
-0+804a0e4 0000020e R_386_TLS_TPOFF +0+ +sG5
-0+804a0e8 0000030e R_386_TLS_TPOFF +0+ +sG7
-0+804a0ec 00000425 R_386_TLS_TPOFF32 0+ +sG2
-0+804a0f0 00000525 R_386_TLS_TPOFF32 0+ +sG4
-0+804a0f4 0000050e R_386_TLS_TPOFF +0+ +sG4
-0+804a0f8 00000725 R_386_TLS_TPOFF32 0+ +sG6
-0+804a0fc 00000825 R_386_TLS_TPOFF32 0+ +sG1
-0+804a100 00000b0e R_386_TLS_TPOFF +0+ +sG8
-
-Symbol table '\.dynsym' contains [0-9]+ entries:
- +Num: +Value Size Type +Bind +Vis +Ndx Name
- +[0-9]+: 0+ +0 NOTYPE LOCAL DEFAULT UND *
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG3
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG5
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG7
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG2
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG4
- +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS __bss_start
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG6
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG1
- +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata
- +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG8
-
-Symbol table '\.symtab' contains [0-9]+ entries:
- +Num: +Value Size Type +Bind +Vis +Ndx Name
- +[0-9]+: 0+ +0 NOTYPE LOCAL DEFAULT UND *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +1 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +2 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +3 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +4 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +5 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +6 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +7 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +8 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +9 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +10 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +11 *
- +[0-9]+: 00000020 +0 TLS +LOCAL DEFAULT +7 sl1
- +[0-9]+: 00000024 +0 TLS +LOCAL DEFAULT +7 sl2
- +[0-9]+: 00000028 +0 TLS +LOCAL DEFAULT +7 sl3
- +[0-9]+: 0000002c +0 TLS +LOCAL DEFAULT +7 sl4
- +[0-9]+: 00000030 +0 TLS +LOCAL DEFAULT +7 sl5
- +[0-9]+: 00000034 +0 TLS +LOCAL DEFAULT +7 sl6
- +[0-9]+: 00000038 +0 TLS +LOCAL DEFAULT +7 sl7
- +[0-9]+: 0000003c +0 TLS +LOCAL DEFAULT +7 sl8
- +[0-9]+: 00000080 +0 TLS +LOCAL DEFAULT +8 bl1
- +[0-9]+: 00000084 +0 TLS +LOCAL DEFAULT +8 bl2
- +[0-9]+: 00000088 +0 TLS +LOCAL DEFAULT +8 bl3
- +[0-9]+: 0000008c +0 TLS +LOCAL DEFAULT +8 bl4
- +[0-9]+: 00000090 +0 TLS +LOCAL DEFAULT +8 bl5
- +[0-9]+: 00000094 +0 TLS +LOCAL DEFAULT +8 bl6
- +[0-9]+: 00000098 +0 TLS +LOCAL DEFAULT +8 bl7
- +[0-9]+: 0000009c +0 TLS +LOCAL DEFAULT +8 bl8
- +[0-9]+: 00001000 +0 TLS +LOCAL HIDDEN +7 _TLS_MODULE_BASE_
- +[0-9]+: 0+804a060 +0 OBJECT LOCAL HIDDEN 9 _DYNAMIC
- +[0-9]+: [0-9a-f]+ +0 OBJECT LOCAL HIDDEN 11 _GLOBAL_OFFSET_TABLE_
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG3
- +[0-9]+: 0000001c +0 TLS +GLOBAL DEFAULT +7 sg8
- +[0-9]+: 0000007c +0 TLS +GLOBAL DEFAULT +8 bg8
- +[0-9]+: 00000074 +0 TLS +GLOBAL DEFAULT +8 bg6
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG5
- +[0-9]+: 00000068 +0 TLS +GLOBAL DEFAULT +8 bg3
- +[0-9]+: 00000008 +0 TLS +GLOBAL DEFAULT +7 sg3
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG7
- +[0-9]+: 00000048 +0 TLS +GLOBAL HIDDEN +7 sh3
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG2
- +[0-9]+: 0000000c +0 TLS +GLOBAL DEFAULT +7 sg4
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG4
- +[0-9]+: 00000010 +0 TLS +GLOBAL DEFAULT +7 sg5
- +[0-9]+: 00000070 +0 TLS +GLOBAL DEFAULT +8 bg5
- +[0-9]+: 00000058 +0 TLS +GLOBAL HIDDEN +7 sh7
- +[0-9]+: 0000005c +0 TLS +GLOBAL HIDDEN +7 sh8
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +7 sg1
- +[0-9]+: 0+8049158 +0 FUNC +GLOBAL DEFAULT +6 _start
- +[0-9]+: 0000004c +0 TLS +GLOBAL HIDDEN +7 sh4
- +[0-9]+: 00000078 +0 TLS +GLOBAL DEFAULT +8 bg7
- +[0-9]+: 00000050 +0 TLS +GLOBAL HIDDEN +7 sh5
- +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS __bss_start
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG6
- +[0-9]+: 0+8049000 +0 FUNC +GLOBAL DEFAULT +6 fn2
- +[0-9]+: 00000004 +0 TLS +GLOBAL DEFAULT +7 sg2
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG1
- +[0-9]+: 00000040 +0 TLS +GLOBAL HIDDEN +7 sh1
- +[0-9]+: 00000014 +0 TLS +GLOBAL DEFAULT +7 sg6
- +[0-9]+: 00000018 +0 TLS +GLOBAL DEFAULT +7 sg7
- +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata
- +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end
- +[0-9]+: 00000044 +0 TLS +GLOBAL HIDDEN +7 sh2
- +[0-9]+: 00000054 +0 TLS +GLOBAL HIDDEN +7 sh6
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG8
- +[0-9]+: 00000064 +0 TLS +GLOBAL DEFAULT +8 bg2
- +[0-9]+: 00000060 +0 TLS +GLOBAL DEFAULT +8 bg1
- +[0-9]+: 0000006c +0 TLS +GLOBAL DEFAULT +8 bg4
diff --git a/ld/testsuite/ld-x86-64/tlsbindesc.dd b/ld/testsuite/ld-x86-64/tlsbindesc.dd
deleted file mode 100644
index 9e82eab4be5..00000000000
--- a/ld/testsuite/ld-x86-64/tlsbindesc.dd
+++ /dev/null
@@ -1,301 +0,0 @@
-#source: tlsbindesc.s
-#source: tlsbin.s
-#as: --64
-#ld: -shared -melf_x86_64
-#objdump: -drj.text
-#target: x86_64-*-*
-
-# PT_TLS layout is:
-# Offset from Offset from Name
-# TCB base TCB end
-# 0x00 -0xa0 sg1..sg8
-# 0x20 -0x80 sl1..sl8
-# 0x40 -0x60 sh1..sh8
-# 0x60 -0x40 bg1..bg8
-# 0x80 -0x20 bl1..bl8
-
-.*: +file format elf64-x86-64
-
-Disassembly of section .text:
-
-0+401000 <fn2>:
- [0-9a-f]+: 55[ ]+push %rbp
- [0-9a-f]+: 48 89 e5[ ]+mov %rsp,%rbp
-# GD -> IE because variable is not defined in executable
- [0-9a-f]+: 48 8b 05 65 03 20 00[ ]+mov 0x200365\(%rip\),%rax +# 601370 <.*>
-# -> R_X86_64_TPOFF64 sG1
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# GD -> IE because variable is not defined in executable where
-# the variable is referenced through IE too
- [0-9a-f]+: 48 8b 05 48 03 20 00[ ]+mov 0x200348\(%rip\),%rax +# 601360 <.*>
-# -> R_X86_64_TPOFF64 sG2
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# GD -> LE with global variable defined in executable
- [0-9a-f]+: 48 c7 c0 60 ff ff ff[ ]+mov \$0xf+60,%rax
-# sg1
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# GD -> LE with local variable defined in executable
- [0-9a-f]+: 48 c7 c0 80 ff ff ff[ ]+mov \$0xf+80,%rax
-# sl1
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# GD -> LE with hidden variable defined in executable
- [0-9a-f]+: 48 c7 c0 a0 ff ff ff[ ]+mov \$0xf+a0,%rax
-# sh1
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LD -> LE
- [0-9a-f]+: 48 c7 c0 00 00 00 00[ ]+mov \$0x0,%rax
- [0-9a-f]+: 66 90[ ]+xchg %ax,%ax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 48 8d 90 81 ff ff ff[ ]+lea -0x7f\(%rax\),%rdx
-# sl1+1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 4c 8d 88 86 ff ff ff[ ]+lea -0x7a\(%rax\),%r9
-# sl2+2
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LD -> LE against hidden variables
- [0-9a-f]+: 48 8d 90 a0 ff ff ff[ ]+lea -0x60\(%rax\),%rdx
-# sh1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 48 8d 88 a7 ff ff ff[ ]+lea -0x59\(%rax\),%rcx
-# sh2+3
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# IE against global var
- [0-9a-f]+: 64 4c 8b 0c 25 00 00[ ]+mov %fs:0x0,%r9
- [0-9a-f]+: 00 00 *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 4c 03 0d d6 02 20 00[ ]+add 0x2002d6\(%rip\),%r9 +# 601360 <.*>
-# -> R_X86_64_TPOFF64 sG2
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# IE -> LE against global var defined in exec
- [0-9a-f]+: 64 4c 8b 14 25 00 00[ ]+mov %fs:0x0,%r10
- [0-9a-f]+: 00 00 *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 4d 8d 92 60 ff ff ff[ ]+lea -0xa0\(%r10\),%r10
-# sg1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# IE -> LE against local var
- [0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax
- [0-9a-f]+: 00 00 *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 48 8d 80 80 ff ff ff[ ]+lea -0x80\(%rax\),%rax
-# sl1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# IE -> LE against hidden var
- [0-9a-f]+: 64 48 8b 0c 25 00 00[ ]+mov %fs:0x0,%rcx
- [0-9a-f]+: 00 00 *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 48 8d 89 a0 ff ff ff[ ]+lea -0x60\(%rcx\),%rcx
-# sh1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# Direct access through %fs
-# IE against global var
- [0-9a-f]+: 48 8b 0d 81 02 20 00[ ]+mov 0x200281\(%rip\),%rcx +# 601358 <.*>
-# -> R_X86_64_TPOFF64 sG5
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 64 48 8b 11[ ]+mov %fs:\(%rcx\),%rdx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# IE->LE against local var
- [0-9a-f]+: 49 c7 c3 90 ff ff ff[ ]+mov \$0xf+90,%r11
-# sl5
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 64 4d 8b 23[ ]+mov %fs:\(%r11\),%r12
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# IE->LE against hidden var
- [0-9a-f]+: 48 c7 c2 b0 ff ff ff[ ]+mov \$0xf+b0,%rdx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 64 48 8b 12[ ]+mov %fs:\(%rdx\),%rdx
-# sh5
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: c9[ ]+leaveq *
- [0-9a-f]+: c3[ ]+retq *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-
-[0-9a-f]+ <_start>:
- [0-9a-f]+: 55[ ]+push %rbp
- [0-9a-f]+: 48 89 e5[ ]+mov %rsp,%rbp
-# IE against global var
- [0-9a-f]+: 64 4c 8b 1c 25 00 00[ ]+mov %fs:0x0,%r11
- [0-9a-f]+: 00 00 *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 4c 03 1d 4a 02 20 00[ ]+add 0x20024a\(%rip\),%r11 +# 601368 <.*>
-# -> R_X86_64_TPOFF64 sG6
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# IE -> LE against global var defined in exec
- [0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx
- [0-9a-f]+: 00 00 *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 48 8d 92 d4 ff ff ff[ ]+lea -0x2c\(%rdx\),%rdx
-# bg6
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# IE -> LE against local var
- [0-9a-f]+: 64 4c 8b 24 25 00 00[ ]+mov %fs:0x0,%r12
- [0-9a-f]+: 00 00 *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 49 81 c4 f4 ff ff ff[ ]+add \$0xf+f4,%r12
-# bl6
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# direct %fs access IE -> LE against local var
- [0-9a-f]+: 48 c7 c2 fc ff ff ff[ ]+mov \$0xf+fc,%rdx
-# bl8
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 64 48 8b 02[ ]+mov %fs:\(%rdx\),%rax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# IE -> LE against hidden but not local var
- [0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx
- [0-9a-f]+: 00 00 *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 48 8d 92 b4 ff ff ff[ ]+lea -0x4c\(%rdx\),%rdx
-# sh6
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# direct %fs access IE -> LE against hidden but not local var
- [0-9a-f]+: 48 c7 c2 bc ff ff ff[ ]+mov \$0xf+bc,%rdx
-# sh8
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 64 48 8b 02[ ]+mov %fs:\(%rdx\),%rax
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE, global var defined in exec
- [0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax
- [0-9a-f]+: 00 00 *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 48 8d 90 64 ff ff ff[ ]+lea -0x9c\(%rax\),%rdx
-# sg2
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE, local var, non-canonical sequence
- [0-9a-f]+: 49 c7 c1 e6 ff ff ff[ ]+mov \$0xf+e6,%r9
-# bl2+2
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx
- [0-9a-f]+: 00 00 *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 4c 01 ca[ ]+add %r9,%rdx
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE, hidden var defined in exec, non-canonical sequence
- [0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx
- [0-9a-f]+: 00 00 *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 48 81 c2 a5 ff ff ff[ ]+add \$0xf+a5,%rdx
-# sh2+1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# Direct %fs access
-# LE, global var defined in exec
- [0-9a-f]+: 64 48 8b 04 25 68 ff[ ]+mov %fs:0xf+68,%rax
- [0-9a-f]+: ff ff *
-# sg3
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE, local var
- [0-9a-f]+: 64 4c 8b 14 25 eb ff[ ]+mov %fs:0xf+eb,%r10
- [0-9a-f]+: ff ff *
-# bl3+3
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
-# LE, hidden var defined in exec
- [0-9a-f]+: 64 48 8b 14 25 a9 ff[ ]+mov %fs:0xf+a9,%rdx
- [0-9a-f]+: ff ff *
-# sh3+1
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: 90[ ]+nop *
- [0-9a-f]+: c9[ ]+leaveq *
- [0-9a-f]+: c3[ ]+retq *
diff --git a/ld/testsuite/ld-x86-64/tlsbindesc.rd b/ld/testsuite/ld-x86-64/tlsbindesc.rd
deleted file mode 100644
index b70d78f02de..00000000000
--- a/ld/testsuite/ld-x86-64/tlsbindesc.rd
+++ /dev/null
@@ -1,138 +0,0 @@
-#source: tlsbindesc.s
-#source: tlsbin.s
-#as: --64
-#ld: -shared -melf_x86_64
-#readelf: -WSsrl
-#target: x86_64-*-*
-
-There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+:
-
-Section Headers:
- \[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al
- +\[[ 0-9]+\] +NULL +0+ 0+ 0+ 00 +0 +0 +0
- +\[[ 0-9]+\] .interp +.*
- +\[[ 0-9]+\] .hash +.*
- +\[[ 0-9]+\] .dynsym +.*
- +\[[ 0-9]+\] .dynstr +.*
- +\[[ 0-9]+\] .rela.dyn +.*
- +\[[ 0-9]+\] .text +PROGBITS +0+401000 0+1000 0+1f6 00 +AX +0 +0 +4096
- +\[[ 0-9]+\] .tdata +PROGBITS +0+6011f6 0+11f6 0+60 00 WAT +0 +0 +1
- +\[[ 0-9]+\] .tbss +NOBITS +0+601256 0+1256 0+40 00 WAT +0 +0 +1
- +\[[ 0-9]+\] .dynamic +DYNAMIC +0+601258 0+1258 0+100 10 +WA +4 +0 +8
- +\[[ 0-9]+\] .got +PROGBITS +0+601358 0+1358 0+20 08 +WA +0 +0 +8
- +\[[ 0-9]+\] .got.plt +PROGBITS +0+601378 0+1378 0+18 08 +WA +0 +0 +8
- +\[[ 0-9]+\] .shstrtab +.*
- +\[[ 0-9]+\] .symtab +.*
- +\[[ 0-9]+\] .strtab +.*
-Key to Flags:
-.*
-.*
-.*
-
-Elf file type is EXEC \(Executable file\)
-Entry point 0x401108
-There are [0-9]+ program headers, starting at offset [0-9]+
-
-Program Headers:
- Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
- PHDR.*
- INTERP.*
-.*Requesting program interpreter.*
- LOAD +0x0+ 0x0+400000 0x0+400000 0x0+11f6 0x0+11f6 R E 0x200000
- LOAD +0x0+11f6 0x0+6011f6 0x0+6011f6 0x0+19a 0x0+19a RW 0x200000
- DYNAMIC +0x0+1258 0x0+601258 0x0+601258 0x0+100 0x0+100 RW 0x8
- TLS +0x0+11f6 0x0+6011f6 0x0+6011f6 0x0+60 0x0+a0 R +0x1
-
- Section to Segment mapping:
- Segment Sections...
- 00 *
- 01 +.interp *
- 02 +.interp .hash .dynsym .dynstr .rela.dyn .text *
- 03 +.tdata .dynamic .got .got.plt *
- 04 +.dynamic *
- 05 +.tdata .tbss *
-
-Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
- +Offset +Info +Type +Symbol's Value Symbol's Name \+ Addend
-0+601358 0+100000012 R_X86_64_TPOFF64 +0+ sG5 \+ 0
-0+601360 0+200000012 R_X86_64_TPOFF64 +0+ sG2 \+ 0
-0+601368 0+400000012 R_X86_64_TPOFF64 +0+ sG6 \+ 0
-0+601370 0+500000012 R_X86_64_TPOFF64 +0+ sG1 \+ 0
-
-Symbol table '\.dynsym' contains [0-9]+ entries:
- +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +[0-9]+: 0+ +0 NOTYPE LOCAL DEFAULT UND *
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG5
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG2
- +[0-9]+: 0+[0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS __bss_start
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG6
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG1
- +[0-9]+: 0+[0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata
- +[0-9]+: 0+[0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end
-
-Symbol table '\.symtab' contains [0-9]+ entries:
- +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +[0-9]+: 0+ +0 NOTYPE LOCAL DEFAULT UND *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +1 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +2 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +3 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +4 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +5 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +6 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +7 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +8 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +9 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +10 *
- +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +11 *
- +[0-9]+: 0+20 +0 TLS +LOCAL DEFAULT +7 sl1
- +[0-9]+: 0+24 +0 TLS +LOCAL DEFAULT +7 sl2
- +[0-9]+: 0+28 +0 TLS +LOCAL DEFAULT +7 sl3
- +[0-9]+: 0+2c +0 TLS +LOCAL DEFAULT +7 sl4
- +[0-9]+: 0+30 +0 TLS +LOCAL DEFAULT +7 sl5
- +[0-9]+: 0+34 +0 TLS +LOCAL DEFAULT +7 sl6
- +[0-9]+: 0+38 +0 TLS +LOCAL DEFAULT +7 sl7
- +[0-9]+: 0+3c +0 TLS +LOCAL DEFAULT +7 sl8
- +[0-9]+: 0+80 +0 TLS +LOCAL DEFAULT +8 bl1
- +[0-9]+: 0+84 +0 TLS +LOCAL DEFAULT +8 bl2
- +[0-9]+: 0+88 +0 TLS +LOCAL DEFAULT +8 bl3
- +[0-9]+: 0+8c +0 TLS +LOCAL DEFAULT +8 bl4
- +[0-9]+: 0+90 +0 TLS +LOCAL DEFAULT +8 bl5
- +[0-9]+: 0+94 +0 TLS +LOCAL DEFAULT +8 bl6
- +[0-9]+: 0+98 +0 TLS +LOCAL DEFAULT +8 bl7
- +[0-9]+: 0+9c +0 TLS +LOCAL DEFAULT +8 bl8
- +[0-9]+: 0+a0 +0 TLS +LOCAL HIDDEN +7 _TLS_MODULE_BASE_
- +[0-9]+: 0+601258 +0 OBJECT LOCAL HIDDEN 9 _DYNAMIC
- +[0-9]+: 0+601378 +0 OBJECT LOCAL HIDDEN 11 _GLOBAL_OFFSET_TABLE_
- +[0-9]+: 0+1c +0 TLS +GLOBAL DEFAULT +7 sg8
- +[0-9]+: 0+7c +0 TLS +GLOBAL DEFAULT +8 bg8
- +[0-9]+: 0+74 +0 TLS +GLOBAL DEFAULT +8 bg6
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG5
- +[0-9]+: 0+68 +0 TLS +GLOBAL DEFAULT +8 bg3
- +[0-9]+: 0+8 +0 TLS +GLOBAL DEFAULT +7 sg3
- +[0-9]+: 0+48 +0 TLS +GLOBAL HIDDEN +7 sh3
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG2
- +[0-9]+: 0+c +0 TLS +GLOBAL DEFAULT +7 sg4
- +[0-9]+: 0+10 +0 TLS +GLOBAL DEFAULT +7 sg5
- +[0-9]+: 0+70 +0 TLS +GLOBAL DEFAULT +8 bg5
- +[0-9]+: 0+58 +0 TLS +GLOBAL HIDDEN +7 sh7
- +[0-9]+: 0+5c +0 TLS +GLOBAL HIDDEN +7 sh8
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +7 sg1
- +[0-9]+: 0+401108 +0 FUNC +GLOBAL DEFAULT +6 _start
- +[0-9]+: 0+4c +0 TLS +GLOBAL HIDDEN +7 sh4
- +[0-9]+: 0+78 +0 TLS +GLOBAL DEFAULT +8 bg7
- +[0-9]+: 0+50 +0 TLS +GLOBAL HIDDEN +7 sh5
- +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS __bss_start
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG6
- +[0-9]+: 0+401000 +0 FUNC +GLOBAL DEFAULT +6 fn2
- +[0-9]+: 0+4 +0 TLS +GLOBAL DEFAULT +7 sg2
- +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT UND sG1
- +[0-9]+: 0+40 +0 TLS +GLOBAL HIDDEN +7 sh1
- +[0-9]+: 0+14 +0 TLS +GLOBAL DEFAULT +7 sg6
- +[0-9]+: 0+18 +0 TLS +GLOBAL DEFAULT +7 sg7
- +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata
- +[0-9]+: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end
- +[0-9]+: 0+44 +0 TLS +GLOBAL HIDDEN +7 sh2
- +[0-9]+: 0+54 +0 TLS +GLOBAL HIDDEN +7 sh6
- +[0-9]+: 0+64 +0 TLS +GLOBAL DEFAULT +8 bg2
- +[0-9]+: 0+60 +0 TLS +GLOBAL DEFAULT +8 bg1
- +[0-9]+: 0+6c +0 TLS +GLOBAL DEFAULT +8 bg4
diff --git a/libgui/ChangeLog b/libgui/ChangeLog
deleted file mode 100644
index d8d91333adb..00000000000
--- a/libgui/ChangeLog
+++ /dev/null
@@ -1,1285 +0,0 @@
-2008-08-02 Keith Seitz <keiths@redhat.com>
-
- * tcl.m4: Remove. I changed my mind.
- * acinclude.m4: Include ../config/tcl.m4.
- (CY_AC_TCL_PRIVATE_HEADERS): New macro.
- (CY_AC_TK_PRIVATE_HEADERS): New macro.
- * configure.ac: When using in-tree tcl/tk, include
- Tcl's/Tk's platform directory.
- When using installed Tcl/Tk, use CY_AC_{TCL,TK}_PRIVATE_HEADERS
- to find the private header files.
- * aclocal.m4: Regenerated.
- * configure: Regenerated.
- * library/Makefile.in: Regenerated.
- * src/Makefile.in: Regenerated.
-
-2008-07-22 Keith Seitz <keiths@redhat.com>
-
- * tcl.m4: New file.
- * acinclude.m4: Include tcl.m4 instead of ../config/acinclude.m4
- * aclocal.m4: Regenerated.
- * configure.ac: Do not check for ITCL_SH.
- Use SC_PATH_TCLCONFIG, SC_PATH_TKCONFIG, SC_LOAD_TCLCONFIG, and
- SC_LOAD_TKCONFIG to find Tcl and Tk.
- Add some logic for when using in-tree Tcl/Tk.
- Change substitutes for TCL_BUILD_LIB_SPEC, TK_BUILD_LIB_SPEC, and
- TCLHDIR to accommodate using system-supplied Tcl and Tk.
- * configure: Regenerated.
- * Makefile.in: Regenerated.
- * library/Makefile.am: Replace ITCL_SH with TCLSH.
- Remove TCL_SHARED rules.
- (tclIndex): Update build rules.
- * library/Makefile.in: Regenerate.
- * library/balloon.tcl: Update for Itcl 3.2/3.3.
- * library/cframe.tcl: Likewise.
- * library/lframe.tcl: Likewise.
- * library/multibox.tcl: Likewise.
- * library/sendpr.tcl: Likewise.
- * library/ventry.tcl: Likewise.
- * library/wframe.tcl: Likewise.
- * src/Makefile.am (INCLUDES): Update.
- * src/Makefile.in: Regenerate.
- * src/paths.c (init_script): Accommodate builddir != srcdir.
-
-2005-03-23 Martin Hunt <hunt@redhat.com>
-
- * configure.ac: Remove -fwritable-strings from CFLAGS.
- * configure: Regenerate.
-
-2005-01-13 Keith Seitz <keiths@redhat.com>
-
- * configure.in: Rename to ...
- * configure.ac: ... this.
- * configure: Regenerate with autoconf 2.59.
-
-2004-03-31 Martin Hunt <hunt@redhat.com>
-
- * library/combobox.tcl (::combobox::Configure): Remove
- debug line.
-
-2003-12-02 Martin Hunt <hunt@redhat.com>
-
- * library/combobox.tcl: Merge in latest changes
- from Bryan Oakley. Fixes a problem with Solaris
- X servers.
-
-2003-02-11 Martin M. Hunt <hunt@redhat.com>
-
- * src/Makefile.am (libgui_a_SOURCES): Remove files that
- are not used in Insight. Removed xpmlib.c, tclmain.c,
- tclwinfont.c, tkCanvEdge.c, tkGraphCanvas.c,
- tkCanvLayout.c, tkCanvLayout.h, tclmapi.c, tclwinmode.c,
- tclhelp.c, and tclgetdir.c.
- * src/Makefile.in: Rebuilt.
-
-2003-02-10 Martin M. Hunt <hunt@redhat.com>
-
- * library/balloon.tcl (Balloon): Don't bind MB 3.
-
-2003-02-03 Martin M. Hunt <hunt@redhat.com>
-
- * library/combobox.tcl: Import combobox 2.2.1
- * library/pkgIndex.tcl: Change combobox version to 2.2.1.
-
-2003-01-21 Martin M. Hunt <hunt@redhat.com>
-
- * src/tkTabletcl.h: Change all references of "tkPriv"
- to "tk::Priv". Change all references of "tkCancelRepeat"
- to "tk::CancelRepeat". Needed for tk 8.4.1.
- * src/tkTable.tcl.h: Ditto.
- * library/combobox.tcl: Ditto.
-
- * src/Makefile.am: Remove tclsizebox.c.
- * src/Makefile.in: Rebuilt.
-
- * aclocal.m4: Rebuilt.
- * Makefile.in: Rebuilt.
- * configure: Rebuilt.
-
-2002-12-03 Martin M. Hunt <hunt@redhat.com>
-
- * library/pane.tcl: auto_mkindex cannot rebuild
- tclIndex because it does not recognize the namespace
- import in main.tcl. To get it to work again, rename the
- following:
- body -> itcl::body
- configbody -> itcl::configbody
- class -> itcl::class
- * library/panedwindow.tcl: Ditto.
-
- * library/tclIndex: Regenerated.
-
- * library/pkgIndex.tcl: Regenerated.
-
-2002-11-26 Martin M. Hunt <hunt@redhat.com>
-
- * Makefile.in: Remove Tix references.
- * library/Makefile.in: Remove Tix references.
- * src/Makefile.in: Remove Tix references.
-
-2002-09-20 Fernando Nasser <fnasser@totem.toronto.redhat.com>
-
- * library/combobox.tcl (build): Add line missing from previous patch.
-
-2002-09-20 Fernando Nasser <fnasser@totem.toronto.redhat.com>
-
- * library/combobox.tcl (build): New variable to save grabs.
- (widgetProc): Save and restore previous grabs.
-
-2002-07-03 Martin M. Hunt <hunt@redhat.com>
-
- * library/panedwindow.tcl (_placePlanes): Make certain things
- are initialized before attempting to move panes.
-
-2002-06-07 Martin M. Hunt <hunt@redhat.com>
-
- * src/tkTableTag.c (Table_TagCmd): Don't decrement past
- beginning of array.
-
- * library/combobox.tcl (::combobox::configure): Don't
- force background to white.
-
-2002-03-07 Martin M. Hunt <hunt@redhat.com>
-
- * library/balloon.tcl (_set_variable): Set the public
- variable before calling notifiers. Set the help text
- from the public variable afterwards.
- (BALLOON_command_variable): Fix call with no args to
- return variable name.
-
-2002-02-25 Ian Roxborough <irox@redhat.com>
-
- * src/library/looknfeel.tcl (standard_look_and_feel):
- Hard code Windows menu font name to MS Sans Serif 8.
-
-2002-02-24 Mo DeJong <supermo@bayarea.net>
-
- * src/Makefile.am: Add -DSTATIC_BUILD so
- that no __declspec() is used in function
- delarations. This fixes the build under VC++.
- * src/Makefile.in: Regen.
-
-2002-02-05 Jim Blandy <jimb@redhat.com>
-
- De-Cygnify libgui.
-
- * library/Makefile.am (guidir): Name dir `redhat', not `cygnus'.
- * src/Makefile.am (guidir): Same.
- * library/Makefile.in, src/Makefile.in: Regenerated.
- * library/sendpr.tcl (itcl_class Sendpr): Update company name in
- PR headers.
- * src/paths.c: Rename environment variables CYGNUS_GUI_LIBRARY
- and CYGNUS_IDE_LIBRARY to REDHAT_GUI_LIBRARY and
- REDHAT_IDE_LIBRARY. Name dir `redhat', not `cygnus'.
-
-2002-01-04 Ian Roxborough <irox@redhat.com>
-
- * src/tkCanvEdge.c (CreateEdge, EdgeCoords, ConfigureEdge):
- Objectify functions to use Tcl_Obj instead of char**.
-
- * src/tkGraphCanvas.c: Cut and paste parts of the new
- Tcl8.3 tagsearch code in to replace old. Rewrite much
- of the code to use the new tagsearch features.
-
-2001-10-28 Christopher Faylor <cgf@redhat.com>
-
- * configure.in: Modify 2001-10-12 change to check for cygwin host
- rather than cygwin target.
- * configure: Regenerate.
-
-2001-10-26 Keith Seitz <keiths@redhat.com>
-
- * configure.in (ac_win_build): Actually want "-DWIN32" with
- cygwin hosts, not just cygwin targets.
- * configure: Regenerate.
-
-2001-10-24 Keith Seitz <keiths@redhat.com>
-
- * configure.in (ac_win_build): Put "-DWIN32" back into LIBGUI_CFLAGS.
- * configure: Regenerate.
-
-2001-10-12 Christopher Faylor <cgf@redhat.com>
-
- * win/configure.in: Add detection for -mwin32 option requirement under
- cygwin.
- * win/configure: Regenerate.
-
-2001-10-10 Ian Roxborough <irox@redhat.com>
-
- * library/looknfeel.tcl (standard_look_and_feel):
- Font changes to improve default look and feel.
- Increase default font size, use helvetica for
- menus, status bar and balloon help.
-
-2001-09-08 Ian Roxborough <irox@redhat.com>
-
- * all: Tcl/Tk8.3 upgrade merge.
-
-2001-09-02 Martin M. Hunt <hunt@redhat.com>
-
- * library/panedwindow.tcl (fraction): Remove method.
- (_resizeArray): Correct calculations of _max
- and _min for each pane.
- (_moveSash): Take a third parameter, direction.
- (_caclPos): Rename to _calcPos. Take an optional
- third parameter, direction. This is so recursive calls
- to _calcPos continue adjusting panes upward or downward
- ans does not loop infinitely.
-
-2001-08-24 Keith Seitz <keiths@redhat.com>
-
- * src/tkTable.tcl: Use "string compare" instead of "string
- equal". The latter is only available in newer versions of
- tcl.
-
-2001-08-12 Mo DeJong <mdejong@redhat.com>
-
- * src/tkCanvEdge.c: Work around Windows gcc problem
- initializing a static member with a dll imported
- symbol by assigning the function pointer at runtime.
- Static initialization works just fine in VC++ but
- fails when compiling with the Windows version of gcc.
-
-2001-08-12 Keith Seitz <keiths@redhat.com>
-
- Update tkTable to version 2.7:
- * src/tkTableCmds.c, src/tkTable.tcl.h, src/tkTableCellSort.c,
- src/tkTableEdit.c, src/tkTableInitScript.h, src/tkTablePs.c,
- src/tkTableUtil.c, doc/tkTable.html: New files.
- * src/tkTable.c, src/tkTable.h, src/TkTable.tcl, src/tkTableCell.c,
- src/tkTableTag.c, src/tkTableWin.c, src/tkTable_version.in: Update to
- version 2.7.
- * configure.in: If compiling with cygwin, we need to have
- WIN32 defined to build tkTable modules.
- * configure: Regenerate.
- * src/Makefile.am: Add new tkTable files and update build rules
- for new version of tkTable.
- * src/Makefile.in: Regenerate.
-
-2001-08-06 Mo DeJong <mdejong@redhat.com>
-
- * Makefile.in: Regen.
- * configure: Regen.
- * configure.in: Remove unused ITCL_DIR variable.
- * library/Makefile.in: Regen.
- * src/Makefile.in: Regen.
-
-2001-08-06 Mo DeJong <mdejong@redhat.com>
-
- * Makefile.in:
- * library/Makefile.in:
- * src/Makefile.in:
- Regenerate Makefiles to account for AR fix
- on 2001-08-03.
-
-2001-08-03 Mo DeJong <mdejong@redhat.com>
-
- * configure: Regen.
- * configure.in: Check for cross AR using the
- AC_CHECK_TOOL macro to fix cross compile. Use
- AC_CHECK_TOOL instead of AC_PROG_RANLIB for
- ranlib. The ranlib change is not required
- but it is more correct. Move the call to
- AC_CANONICAL_HOST up in the file.
-
-2001-08-03 Mo DeJong <mdejong@redhat.com>
-
- * src/tclhelp.c (help_display_file_command): Pass int
- address to Tcl_GetInt instead of an unsigned long to
- avoid compiler warning.
-
-2001-08-03 Mo DeJong <mdejong@redhat.com>
-
- * src/subcommand.c:
- * src/tclgetdir.c:
- * src/tclhelp.c:
- * src/tclmain.c:
- * src/tclmsgbox.c:
- * src/tclsizebox.c:
- * src/tclwinmode.c:
- * src/tclwinpath.c:
- * src/tclwinprint.c:
- * src/tkWinPrintCanvas.c:
- * src/tkWinPrintText.c:
- Use ckalloc/ckfree instead of Tcl_Alloc/Tcl_Free
- or malloc/free so that allocations will
- be marked with file positions when Tcl mem
- debug is activated.
-
-2001-08-02 Mo DeJong <mdejong@redhat.com>
-
- * src/tkWinPrintCanvas.c (PrintCanvasCmd):
- * src/tkWinPrintText.c (PrintTextCmd): Plug
- memory leak by calling free on memory allocated
- in PrintCanvasCmd and PrintTextCmd method. Make
- sure error cases branch to the cleanup code at
- the end of the method instead of just returning.
-
-2001-08-02 Mo DeJong <mdejong@redhat.com>
-
- * src/tkWinPrintText.c (DisplayDLineToDrawable): Fix
- compiler warning by adding missing static modifier
- to funciton declaration.
-
-2001-08-02 Mo DeJong <mdejong@redhat.com>
-
- * config.h.in: Regen.
- * configure: Regen.
- * configure.in: Don't check for strdup since it
- is no longer used in libgui.
- * src/tclhelp.c (help_initialize_command): Replace
- use of strdup with calls to malloc and strcpy.
-
-2001-08-02 Mo DeJong <mdejong@redhat.com>
-
- * src/tclhelp.c (help_command_deleted): Free the
- help_command_data->help_dir member allocated in
- help_initialize_command.
-
-2001-08-02 Mo DeJong <mdejong@redhat.com>
-
- * src/tkGraphCanvas.c (GetEdgeNodes): Use ckalloc
- and strcpy instead of calling strdup() since this
- memory is deallocated with ckfree() later on.
-
-2001-08-02 Mo DeJong <mdejong@redhat.com>
-
- * Makefile.in: Regen.
- * configure: Regen.
- * configure.in: Check for cross AR using the
- AC_CHECK_TOOL macro to fix cross compile. Use
- AC_CHECK_TOOL instead of AC_PROG_RANLIB for
- ranlib. The ranlib change is not required
- but it is more correct. Move the call to
- AC_CANONICAL_HOST up in the file. Don't
- set or subst ITCL_DIR since it is not used
- and depends on pre Itcl 3.1 paths.
- * library/Makefile.in: Regen.
- * src/Makefile.in: Regen.
-
-2001-05-18 Keith Seitz <keiths@cygnus.com>
-
- * library/center.tcl (center_window): Allow centering
- the toplevel on a window, too.
-
-2001-05-03 Keith Seitz <keiths@cygnus.com>
-
- * src/tkWarpPointer.c (WarpPointer): Implement for windows.
-
-2001-04-06 Christopher Faylor <cgf@redhat.com>
-
- * configure.in: Add test for -mwin32 requirement switch when building
- on cygwin.
- * configure: Regenerate.
-
-2000-11-30 Tom Tromey <tromey@cygnus.com>
-
- * library/balloon.tcl (balloon): Document `balloon withdraw'.
-
-2000-11-27 Tom Tromey <tromey@cygnus.com>
-
- * library/debug.tcl (logfile): Also recognize stderr.
-
-2000-07-12 Syd Polk <spolk@redhat.com>
-
- * library/Makefile.am: Only regenerate tclIndex and pkgIndex.tcl
- if this is configured with --enable-maintainer-mode.
-
-2000-07-11 Mo DeJong <mdejong@redhat.com>
-
- * README:
- * library/Makefile.am:
- * library/Makefile.in:
- * library/tclIndex:
- * library/tree.tcl:
- * library/treetable.tcl:
- * src/Makefile.am:
- * src/Makefile.in:
- * src/guitcl.h:
- * src/tkTreeTable.c:
- * src/tkTreeTable.h: Moved implementation of
- "treetable" command out back into snavigator.
-
-2000-07-06 Mo DeJong <mdejong@redhat.com>
-
- * library/debug.tcl (logfile): Use non-blocking IO.
- * library/tree.tcl (set_column_filter, bind, exchange,
- ide_treetable): Don't fully qualify global commands.
- Use itcl::delete. Use non-blocking IO. Rename bind
- method to __bind. Brace exprs. Set default value
- for when_post_menu variable. Itcl 3.0 fixups.
-
-2000-06-30 Mo DeJong <mdejong@redhat.com>
-
- * library/tree.tcl: Fix typo made in patch
- from 2000-06-22.
-
-2000-06-30 Syd Polk <spolk@cygnus.com>
-
- * src/paths.c: Chris Faylor's path changes from 2000-06-09 blow
- out MSVC's stupid path limitation. This is only a problem
- for Source-Navigator.
-
-2000-06-22 Mo DeJong <mdejong@redhat.com>
-
- * library/tree.tcl: Remove use of watch
- command. Add check to see if toplevel
- exists to avoid error.
-
-2000-06-22 Mo DeJong <mdejong@redhat.com>
-
- * src/tkGraphCanvas.c (GetEdgeNodes): Fixed
- crash in ckfree caused by call to strdup that
- was later freed using ckfree.
-
-2000-06-19 Syd Polk <spolk@redhat.com>
-
- * configure.in: Use CYG_AC_PATH_ITCLCONFIG and CYG_AC_LOAD_ITCLCONFIG
- instead of using exising itclsh.
- * aclocal.m4: Regenerated with new ../config/acinclude.m4.
- * configure: Regenerate.
- * Makefile.in library/Makefile.in src/Makefile.in: Regenerate.
-
-Fri Jun 9 20:43:40 2000 Christopher Faylor <cgf@cygnus.com>
-
- * src/paths.c (initialize_paths): Look in /usr/share for stuff.
-
-2000-04-18 James Ingham <jingham@leda.cygnus.com>
-
- * library/toolbar.tcl (TOOLBAR_button_up): If the pointer is still
- in the button, reraise the button after a press.
-
-2000-04-03 James Ingham <jingham@leda.cygnus.com>
-
- * src/paths.c: Follow links in determining the location of the
- executable.
-
-Fri Sep 17 19:14:15 1999 Andrew Cagney <cagney@b1.cygnus.com>
-
- * src/guitcl.h (cyg_create_warp_pointer_command): Add declaration.
-
-1999-09-07 Jim Ingham <jingham@cygnus.com>
-
- * library/tclIndex: Rebuild - this somehow got built wrong,
- leaving out all the debug, and all the panedwindow references.
-
-1999-09-02 Syd Polk <spolk@cygnus.com>
-
- * library/Makefile.am: Revert bad merge
- * library/Makefile.in: Regenerate
-
-1999-08-10 James Ingham <jingham@leda.cygnus.com>
-
- * library/balloon.tcl (BALLOON_command_withdraw): New command, use
- to remove the balloon before it's timeout has expired.
-
-1999-08-02 James Ingham <jingham@leda.cygnus.com>
-
- * library/combobox.tcl (::combobox::setValue): Call the combobox
- command after idle, so the menu gets a chance to unpost itself
- before the command is run.
-
-1999-05-26 Ian Roxborough <irox@cygnus.com>
-
- * library/combobox.tcl: If a combobox is not editable then
- make the background of the text box white.
-
-1999-04-29 Syd Polk <spolk@cygnus.com>
-
- * src/paths.c: Add a scaled-down version of path initialization
- in Visual C++ build.
-
-1999-04-28 Syd Polk <spolk@cygnus.com>
-
- * acinclude.m4: Add from devo.
- * aclocal.m4: Regenerate.
- * configure: Regenerate.
- * Makefile.in: Regenerate.
- * library/Makefile.am: Use auto_mkindex to generate tclIndex. The
- itcl1.5 one generates bogus entries sometimes.
- * library/Makefile.in: Regenerate.
- * src/Makefile.in: Regenerate.
-
-1999-04-17 Syd Polk <spolk@cygnus.com>
-
- * Revert merge. I checked in itcl3.0 code into a itcl 1.5 branch.
-
-1999-04-22 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * library/tree.tcl (treetable_bindings): moved the default bindings
- source code from SN into the file to build unseparated unit. The
- bindings themself relay (compatible) on the listbox bindings.
- -the bindings are defined when ever the file is loaded, so no
- need to call the function extra.
-
-1999-04-07 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * library/tree.tcl (print_dialog_box): deleted reference to -leader
- option of the print dialog.
- (Tree): added a new public variable to specify a customer
- post command for the right-mouse menu.
-
- * library/toolbar.tcl (TOOLBAR_button_leave): synchronize enter/leave
- to not mismatch a relief change.
-
-1999-03-30 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * library/tclIndex: regenerated.
-
- * library/tree.tcl (start_motion): by changing column size use only a
- black line.
-
- * library/toolbar.tcl (TOOLBAR_button_up): patched toolbar procedures
- to support buttons that interact like chechbuttons (remain flat or
- sunken). The button keeps it's original relief after the pointer
- leaves the widget.
- (TOOLBAR_button_up): How the bindings are made for the toolbar buttons
- is wrong. I patched it to work now for SN, but it must be a general
- fix, even for gdbtk. When you bind events to the button use please
- {+ ...} to keep existing bindings for the widget.
- (TOOLBAR_command): new. To change the relief state of a checkbutton-
- like widgets from the application.
-
-1999-03-29 Martin Hunt <hunt@cygnus.com>
-
- * library/combobox.tcl (::combobox::computeGeometry): Calculate
- geometry based on whole thing, including scrollbar. This fixes
- the problem from the last couple of months where the popup list
- box was not below the dropdown button unless there was a scrollbar.
-
-1999-03-29 Syd Polk <spolk@cygnus.com>
-
- * src/paths.c: Added initialization back in for Visual C++
- build. Pared it down so that VC++ can actually compile it.
- Stupid MS 2048 character limit.
-
-1999-03-17 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * library/tree.tcl (create_tabs): patched the tree table to support
- resizing a column when moving around the column line.
- (button_motion): new function realized resizing the columns using an
- area mode.
-
-1999-03-15 Ian T Roxborough <irox@cygnus.com>
-
- * library/combobox.tcl(combobox::configure): On Windows draw a black
- box around the popup for a better Windows look'n'feel.
-
-1999-03-15 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * library/tree.tcl: Placed here from SN tree to allow other parties
- to use it for there own applications. If you want to see how it is
- used, please refer to snavigator/gui/*.tcl.
-
- * library/Makefile.in: added tree.tcl as part of the library.
-
- * library/Makefile.am: likewise.
-
-Wed Mar 10 19:44:31 1999 Geoffrey Noer <noer@cygnus.com>
-
- * src/tclgetdir.c: Need to also include shlobj.h if we're
- using standard Win32 API headers (not the old set of Cygwin
- headers).
-
-1999-03-09 Ian T Roxborough <irox@cygnus.com>
-
- * library/combobox.tcl(combobox::configure): On Windows
- if -editable is 0, use a standard background for the
- entry widget (better windowz look'n'feel)
-
-Fri Mar 5 11:00:54 1999 Khamis Abuelkombuz <khamis@cygnus.com>
-
- * src/tkGraphCanvas.c: fixed the hash problem. Uses a hash table that
- is associated with the interp rather to use a static hash table.
-
-1999-03-04 Syd Polk <spolk@cygnus.com>
-
- * src/tkTreeTable.c: Re-fixed SunOS build problem.
-
-Wed Mar 3 16:57:21 1999 Khamis Abuelkombuz <khamis@cygnus.com>
-
- * src/tkGraphCanvas.c: fixed the hash problem. Uses a hash table that
- is associated with the interp rather to use a static hash table.
-
-1999-03-03 James Ingham <jingham@cygnus.com>
-
- * library/combobox.tcl (::combobox::setValue): Call the command in
- an after idle, so that the combobox gets a chance to unpost before
- the action is taken.
-
-1999-02-23 Martin Hunt <hunt@cygnus.com>
-
- * src/paths.c: Change error message so that it says
- it can't find "GUI" library instead of "IDE" library.
-
-1999-02-18 Martin Hunt <hunt@cygnus.com>
-
- * library/hooks.tcl (run_hooks): Cleanup error message.
-
-1999-02-17 Martin Hunt <hunt@cygnus.com>
-
- * library/internet.tcl (open_url): Change to open another
- window for Netscape on Unix. Returns 0 on failure, 1 on
- success.
-
-1999-02-11 Syd Polk <spolk@cygnus.com>
-
- * configure.in: Fixed problem with comparison to xcl.
- * configure: Regenerated.
-
-1999-02-10 Syd Polk <spolk@cygnus.com>
-
- * configure.in: Find the correct itclsh.
- Fixed problem with cygwin build. Should not need cygpath
- to configure.
- * configure: Regenerated.
-
-1999-02-10 Martin Hunt <hunt@cygnus.com>
-
- * library/bgerror.tcl (bgerror): Do not use the old debug
- preferences. Write errors into debug window. Keep old
- dialog for now, although it should probably either go away
- or be replaced by instructions on how to file a PR.
-
-1999-02-09 Martin Hunt <hunt@cygnus.com>
-
- * library/panedwindow.tcl (cyg::PanedWindow): Add -sashcolor
- option.
- (cyg::PanedWindow::sashcolor): New config method.
- (cyg::PanedWindow::_makeSashes): Set sash color.
-
-1999-02-01 James Ingham <jingham@cygnus.com>
-
- * src/paths.c: Put in some missing \n\'s.
-
-1999-01-22 Jim Ingham <jingham@cygnus.com>
-
- Merging changes in from gdbtk-980810-branch
-
- 1999-01-22 Martin Hunt <hunt@cygnus.com>
-
- * library/panedwindow.tcl (cyg::PanedWindow::delete): Fix
- variable name so this function works again.
- * src/tkWarpPointer.c: New file. Implements tcl function
- warp_pointer, used by the testsuite.
- * src/Makefile.am: Added tkWarpPointer.c.
-
- 1998-12-17 Martin M. Hunt <hunt@cygnus.com>
-
- * library/panedwindow.tcl (cyg::PanedWindow::sashwidth): Change
- borderwidth to 2.
- (cyg::PanedWindow::_makeSashes): Ditto.
- (cyg::PanedWindow::delete): Free up the space in the _frac
- array when a pane is deleted.
- (cyg::PanedWindow::hide): Ditto.
- (cyg::PanedWindow::replace): New function. Replaces an active
- pane with an inactive (hidden) one.
-
- 1998-12-16 Martin M. Hunt <hunt@cygnus.com>
-
- * library/panedwindow.tcl: New file. Implements
- cyg::PanedWindow which is a generic paned window supporting
- non-resizable panes, individual max and min pane sizes. It
- has a very different look from the iwidget panedwindow.
-
- * library/pane.tcl: New file. Basically an extended pane.itk
- from the iwidgets distribution.
-
- 1998-08-10 Jim Ingham <jingham@cygnus.com>
-
- * src/paths.c: Figure out how to run from the build tree.
-
-1999-01-14 Ben Elliston <bje@cygnus.com>
-
- * src/tkTreeTable.c: Remove unnecessary #includes that collide
- with Tcl's compat headers.
-
-1998-12-14 Ian Roxborough <irox@cygnus.com>
-
- * src/tclwinfont.c (win_choose_font): convert all result strings
- to utf8 format if using tcl/tk8.1.
-
-1998-12-12 Ian Roxborough <irox@cygnus.com>
- * src/tclgetdir.c (get_directory_command): Make sure that
- the parent is getting redrawn if the dialog box moves.
- * src/tclwinfont.c (win_choose_font): Make sure that
- the parent is getting redrawn if the dialog box moves.
-
-1998-12-12 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * src/tkTreeTable.c (DisplayRecursive): use metrics.descent by
- displaying the active line.
-
-1998-12-11 Syd Polk <spolk@cygnus.com>
-
- * src/tkgetdir.c: The arguments to this need to be
- converted from UTF-8 and the return value needs to
- be converted to UTF-8 in Tcl 8.1.
-
-1998-11-30 Ian Roxborough <irox@cygnus.com>
-
- * src/tkWinPrintCanvas.c (PrintCanvasCmd): return OK
- if the user hits cancel.
- * src/tkGraphCanvas.c (GraphCanvasCmd): changed to free()s
- to ckfree()s.
-
-1998-11-17 Ian Roxborough <irox@cygnus.com>
-
- * src/tkWinPrintText.c (PrintTextCmd): Disable the print
- selection until it is implemented properly.
-
-1998-11-17 Ben Elliston <bje@cygnus.com>
-
- * src/tkTreeTable.h: Merge from Source-Navigator.
-
- * src/tkTreeTable.c: Likewise.
-
-1998-11-16 Ian Roxborough <irox@cygnus.com>
-
- * src/tkWinPrintText.c (PrintTextCmd): return OK
- if the user hits cancel.
-
-1998-11-11 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * src/tkTreeTable.c: using tcl/memory allocation functions.
-
- * src/tkCanvLayout.c (LayoutClearGraph): check parent/succ for
- availiability before freeing it.
-
-1998-06-04 Jim Blandy <jimb@zwingli.cygnus.com>
-
- * configure.in: Use AM_PROC_CC_STDC, since this directory requires
- ANSI C in order to compile.
- * aclocal.m4, configure: Regenerated.
-
-Thu Dec 17 11:46:04 1998 Keith Seitz <keiths@cygnus.com>
-
- * library/combobox.tcl (::combobox::computeGeometry): Allow
- the listbox to expand larger than the limits of the combobox.
- (::combobox::widgetProc): Pack the scrollbar before the listbox
- so that scroll remains visible when the combobox shrinks.
- (::combobox::build): Ditto for the button.
-
-Sun Nov 8 23:52:31 1998 Felix Lee <flee@cygnus.com>
-
- * configure.in (ac_win_build): quoting fix.
- * configure: regenerated.
-
-Wed Nov 4 18:46:13 1998 Dave Brolley <brolley@cygnus.com>
-
- * acinclude.m4: New file.
- * Makefile.in: Regenerated.
- * aclocal.m4: Regenerated.
- * configure: Regenerated.
-
-1998-11-04 Ian Roxborough <irox@cygnus.com>
-
- * src/tkWinPrintText.c (PrintTextCmd): For Tk 8.1 call
- TkTextMakeByteIndex, otherwise call TkTextMakeIndex.
- * src/tkWinPrintText.c: Remove some compiler warnings.
- * src/tkWinPrintCanvas.c: Remove some compiler warnings.
-
-1998-11-02 Ben Elliston <bje@cygnus.com>
-
- * src/xpmlib.c (LONGBITS): Take the sizeof `long', not
- `LONG'. Most UNIX environments have no such macro.
-
-1998-10-30 Ian Roxborough <irox@cygnus.com>
-
- * src/xpmlib.c (ImgXpmGetPixmapFromData): calculate the
- bitmap pading the same the tk x-emulation layer does.
-
-1998-10-29 Ben Elliston <bje@cygnus.com>
-
- * configure.in: Look for itcl_sh in the PATH.
- * configure: Regenerate.
- * library/Makefile.am: Use discovered path to itcl_sh.
- * library/Makefile.in: Regenerate.
- * Makefile.in: Likewise.
- * src/Makefile.in: Likewise.
-
-1998-10-28 Syd Polk <spolk@cygnus.com>
-
- * configure.in: Generate a TCL_LIBRARY for itcl_sh to use.
- * configure: Regenerate
- * library/Makefile.am: Use generated TCL_LIBRARY.
- * library/Makefile.in: Regenerate.
-
-1998-10-28 Syd Polk <spolk@cygnus.com>
-
- * configure.in: Generate correctly formatted directories for itcl_sh
- * configure: Regenerate
- * library/Makefile.am: Pass correctly formatted directories to itcl
- so that it does not get confused with cygwin paths when generating
- tclIndex.
- * library/Makefile.in: Regenerate
-
-1998-10-27 Syd Polk <spolk@cygnus.com>
-
- * configure.in: Add test and AM_CONDITIONAL for Windows.
- * library/Makefile.am: On Windows, piping output straight from pwd
- to itcl_sh.exe does not work if build is not on /. Wrap the pwd
- in a cygpath.
- * configure: Regenerate
- * library/Makefile.in: Regenerate.
-
-1998-10-27 Syd Polk <spolk@cygnus.com>
-
- * src/Makefile.am: Fix TKHDIR problems.
- * src/Makefile.in: Regenerate.
-
-1998-10-26 Syd Polk <spolk@cygnus.com>
-
- * configure.in: Use TCLHDIR instead of TCL_BUILD_INCLUDES and
- TKHDIR instead of TK_BUILD_INCLUDES
- * configure: Regenerate
- * src/Makefile.am: Use TCLHDIR instead of TCL_BUILD_INCLUDES
- TKHDIR instead of TK_BUILD_INCLUDES
- * src/Makefile.in: Regenerate
-
-Mon Oct 26 09:19:34 1998 Ian Roxborough <irox@cygnus.com>
-
- * src/Makefile.am: Add tkWinPrintText.c and tkWinPrintCanvas.c
- * src/tkWinPrintText.c: removed a MSVC++ headerfile and
- protected the file with pragmas (_WIN32) so it isn't
- compiled on Unix builds.
- * src/tkWinPrintCanvas.c: Same as tkWinPrintText.c
- * src/tkWinPrintText.c (PrintTextCmd): Trick TkTextXviewCmd into
- calling UpdateDisplayInfo, this means tk doesn't need patched.
- Cleaned up/added some comments.
-
-1998-10-20 Syd Polk <spolk@cygnus.com>
-
- * aclocal.m4: Added include for standard macros to locate tcl and tk
- * configure.in: Use standard macros for tcl and tk
- * configure: Regenerated
- * Makefile.in: Regenerated with latest automake
- * library/Makefile.in: Regenerated with latest automake
- * src/Makefile.am: Don't use hard-coded pathnames for tcl and tk
- directories; use variables instead
- * src/Makefile.in: Regenerated
-
-1998-10-14 Syd Polk <spolk@cygnus.com>
-
- * src/tclwinfont.c: Compile fix for tcl 8.1.
-
-Wed Oct 14 13:01:00 1998 Ian Roxborough <irox@cygnus.com>
-
- *src/xpmlib.c (ImgXpmGetPixmapFromData): Fix pixmaps
- on windows (SN problem), if pixmap mask width <= half the
- bit padding, then things got messed up. (mayby a bug in
- the X-emulation layer).
- - Remove some old commented out code.
-
-Fri Oct 9 10:04:00 1998 Ian Roxborough <irox@cygnus.com>
-
- * src/xpmlib.c (ImgXpmGetPixmapFromData): set memory allocated
- for the mask to zero before using.
-
-1998-10-05 Syd Polk <spolk@cygnus.com>
-
- * configure: Regenerated with new autoconf
-
-Mon Oct 5 00:53:59 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/balloon.tcl (showballoon): Add "keep" parameter
- to tell balloon messages to not go away after 6 seconds.
- (BALLOON_command_show): Ditto.
-
-Wed Sep 30 9:35:00 1998 Ian Roxborough <irox@cygnus.com>
-
- *src/tkprintcanvas.c: New file, for printing a canvas under windows.
-
-Mon Sep 21 15:45:17 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/combobox.tcl (::combobox::setValue): Fix
- instance when value has an embedded space.
-
-Thu Sep 3 19:10:00 1998 Sean Mahan <smahan@cygnus.com>
-
- * src/tclgetdir.c: Change C++ style comments to C style.
-
-Thu Sep 3 18:45:00 1998 Sean Mahan <smahan@cygnus.com>
-
- * src/tclhelp.c: Change C++ style comments to C style.
-
-Mon Aug 31 11:55:00 1998 Ian Roxborough <irox@cygnus.com>
-
- *src/tclgetdir.c: Add definition for SHBrowseForFolderA.
- (it was missing from cygwin.)
-
-Mon Aug 31 11:33:00 1998 Syd Polk <spolk@cygnus.com>
-
- *configure.in library/Makefile.am src/Makefile.am: Tcl/Tk 8.1
- require -fwritable strings.
- *configure Makefile.in library/Makefile.in src/Makefile.in:
- Regenerated.
-
-Fri Aug 28 18:15:25 1998 Ian Roxborough <irox@cygnus.com>
-
- *src/tclgetdir.c: Added missing (from cygwin) #defines for BFFM_*.
-
-Wed Aug 26 14:01:25 1998 Ian Roxborough <irox@cygnus.com>
-
- *src/tclgetdir.c (get_directory_command): free up
- memory allocated with Tcl_DString.
-
-Wed Aug 26 14:01:25 1998 Ian Roxborough <irox@cygnus.com>
-
- Added "-initialdir <dir>" to the ide_get_directory
- command.
-
- *src/tclgetdir.c (get_directory_command): added flag
- handling and set callback to change selected directory.
- (MyBrowseCallbackProc): New function, sets selected
- directory once initialization has been completed.
-
-Tue Aug 25 18:31:16 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/combobox.tcl: Fix previous checkin.
-
-Tue Aug 25 17:22:36 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/combobox.tcl (::combobox::configure): Remove
- scrollbar width hack. Set foreground and background colors
- for non-editable and disabled widgets.
-
-Tue Aug 25 16:06:34 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/combobox.tcl (::combobox::doInternalWidgetCommand):
- Add "Curselection" widget command.
-
-Fri Aug 21 12:48:09 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/combobox.tcl: Merge my changes into the
- new 1.05 combobox code.
- (entryset): New command that sets the contents of
- the entry field without triggering any commands.
-
-Fri Aug 21 11:38:35 1998 Ian Roxborough <irox@cygnus.com>
-
- Integrated changes between Source-Navigator's
- hyper/tkCanvas.c and libgui's src/tkGraphCanvas.c.
- Add a new option (-gridlock) to switch between
- SN style (-gridlock 1) and the old style.
-
- *src/tkGraphCanvas.c (graphspecs[]): add gridlock
- option (1 = ON, 0 = OFF).
- (setedgegeom): added a new parameter (int i) and
- code to keep lines running a X or Y axis only.
- (GetGraphLayoutII): new function (same as GetGraphLayout
- but takes TkCanvas as parameter).
- (GraphCanvasCmd): use extra parameter when calling
- setedgegeom.
- *src/tkCanvLayout.c (struct Layout_Graph): add int
- gridlock.
- (LayoutCreateGraph): initalise 'gridlock'.
- (GetLayoutConfig): copy 'gridlock' when getting.
- (SetLayoutConfig): copy back 'gridlock' when setting.
- *src/tkCanvLayout.h (struct LayoutConfig): add
- 'gridlock' member.
-
-1998-08-20 Keith Seitz <keiths@cygnus.com>
-
- * src/tclwinprint.c (winprint_print_text_options): Intialize the "initproc"
- for struct print_text_options.
-
-
-Tue Aug 18 15:39:53 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/Makefile.am (pkgIndex.tcl): Make this
- require maintainer mode.
-
-Mon Aug 17 16:20:38 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/Makefile.am (ITCL_SH): Revert previous change.
-
-Mon Aug 17 14:44:31 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/Makefile.am (WISH): Run itcl_wish from the
- proper place.
-
-Mon Aug 17 13:20:09 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/combobox.tcl (::combobox::build): Initialize
- oldValue. Don't pack scrollbar.
- (::combobox::widgetProc): When items are inserted or deleted
- from the list, pack or forget the scrollbar, depending on
- the size of the list and the max height.
- (::combobox::setValue): Call the command callback even if
- the value selected was the same as the previous value.
- (::combobox::configure): Change listbox width as well
- as entry width. This keeps the scrollbar from being
- truncated.
- (::combobox::configure): Replace "oldValue" with "oldval"
- to avoid confusion with the variable that saves the
- previous value for the entry. Fixes several bugs.
- (::combobox::widgetProc): Unset tmpopt.
- (::combobox::widgetProc): Pass the listbox widget to the
- computeGeometry proc so it can use it in its computations.
- (::combobox::computeGeometry): Compute size of popup by
- requested size of listbox plus twice the bordersize of
- the popup.
-
-Thu Aug 13 22:55:36 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * configure.in: Add AC_OBJEXT call.
- * configure: Rebuilt.
-
-Thu Aug 13 00:47:08 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/combobox.tcl: Fix -editable.
-
-Wed Aug 12 10:41:45 1998 Matt Leach <mleach@cygnus.com>
-
- * src/tclhelp.c: added !WIN32 entries for Webhelp
-
-=======
-Tue Aug 18 15:39:53 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/Makefile.am (pkgIndex.tcl): Make this
- require maintainer mode.
-
-Mon Aug 3 01:29:05 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/combobox.tcl: New file. Windows style
- combobox.
- * library/pkgIndex.tcl: New file.
- * library/Makefile.am: Added combobox.tcl.
- * library/Makefile.in, library/tclIndex: Rebuilt.
- * configure: Rebuilt.
-
-Mon Jul 20 13:36:33 1998 Ian Roxborough <irox@cygnus.com>
-
- * src/tclhelp.c: include missing headerfile on Windows.
- * src/tkCanvEdge.c: defined F_OK to be 0 on Windows.
- * src/tclmain.c: include missing headerfile on Windows.
- * src/tclmsgbox.c (msgbox_thread): type should be WINAPI.
- * src/paths.c (init_script[]): Due to string length limits
- with the MSVC compiler, the init_script we now return a
- error message when compiled with VC++.
- * src/Makefile.am: Change all '.o' to '.$(OBJEXT)'
- * configure.in: Added AC_OBJEXT and changed AM_EXEEXT to
- AC_EXEEXT.
-
-Fri Jul 10 19:17:53 1998 Jim Ingham <jingham@cygnus.com>
-
- * src/tkTable* Upgraded tkTable to version 2.1
-
-Fri Jul 10 11:29:00 1998 Sean Mahan <smahan@cygnus.com>
-
- * src/paths.c (constant run_app_script): Fixed to work with
- latest version of the TclPro debugger (1.0 beta 3).
-
-1998-06-30 Ben Elliston <bje@cygnus.com>
-
- * src/tclgetdir.c: Merged from S-N.
-
- * src/tclwinprint.c: Merged from S-N. Includes new options for
- PostScript printing and once-per-job initialisation.
-
- * src/tkCanvLayout.c: Merged from S-N. Mostly cleanup.
-
- * src/tkCanvEdge.c: Merged from S-N. Handle justified and
- multi-line labels.
-
-Fri Jun 26 17:57:00 1998 Sean Mahan <smahan@cygnus.com>
-
- * src/paths.c (init_script): fixed `prefix' path.
-
-Mon Jun 22 14:15:36 1998 Drew Moseley <dmoseley@cygnus.com>
-
- * src/paths.c: Added TCLPRO_DEBUGGER code
-
-Thu Jun 4 18:00:27 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src/tkTable*: Imported Jeffrey Hobbs tkTable 2.0
- widget.
- * src/Makefile.am: Add tkTable stuff.
- * src/Makefile.in: Rebuilt.
- * Makefile.in: Rebuilt.
- * doc/tkTable.n: Man page for tkTable.
-
-Thu May 14 10:45:00 1998 Sean Mahan <smahan@cygnus.com>
-
- * library/prefs.tcl (PREFS_cmd_init): Changed name of global
- variable from "IDE" to "IDE_ENABLED".
- * src/tclmain.c (ide_main): Setup TCL global variable based
- on the defined value of "IDE_ENABLED".
- * configure.in: Changed "IDE" define to "IDE_ENABLED".
- * configure: regenerated.
- * acconfig.h: Changed "IDE" to "IDE_ENABLED" and made sure that
- "IDE_ENABLED" would always be defined (either as 0 or 1).
- * config.h.in: regenerated.
-
-Wed May 13 10:05:00 1998 Sean Mahan <smahan@cygnus.com>
-
- * library/prefs.tcl (PREFS_cmd_init): Revert change by hunt that
- used global variable "GDBTK_IDE" instead of libgui variable "IDE".
- * configure.in: added support for "--enable-ide" option.
- * configure: regenerated.
- * acconfig.h: added define for "IDE".
- * config.h.in: regenerated.
-
-Wed May 6 14:54:47 1998 Ben Elliston <bje@cygnus.com>
-
- * src/xpmlib.c (ImgXpmGetData): Preinitialise some local variables.
- (GetColor): Removed an unused local variable.
- (ImgXpmGetPixmapFromData): Likewise.
-
-Thu Apr 30 19:16:13 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * src/paths.c (run_app_script): Don't crash if Paths(appdir) or
- Paths(idedir) was not set.
-
-Thu Apr 23 13:52:13 1998 Tom Tromey <tromey@cygnus.com>
-
- * src/tclgetdir.c (get_directory_command): Pass -choosedir to
- tk_getOpenFile.
-
-Wed Apr 15 16:47:00 1998 Sean Mahan <smahan@cygnus.com>
-
- * src/tclhelp.c (help_display_file_command): new function to
- display a specified help file.
- (ide_subcommand_table): added `display_file' subcommand.
-
-Thu Apr 9 14:19:08 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/prefs.tcl (PREFS_cmd_init): Use global
- variable "GDBTK_IDE" instead of "IDE".
-
-Tue Apr 7 12:41:59 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * src/Makefile.am (libgui_a_SOURCES): Add tclcursor.c.
- (tclcursor.o): New target.
- * src/Makefile.in: Rebuild.
-
-Tue Mar 31 14:52:31 1998 Tom Tromey <tromey@cygnus.com>
-
- * library/Makefile.in: Rebuilt.
- * library/Makefile.am (TCL): Added ventry.tcl.
- * library/ventry.tcl: Moved from libide.
-
-Tue Mar 31 16:58:34 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * src/paths.c: Rewrite Tcl code to search $prefix/share/cygnus for
- gui and ide directories. Change environment variable names to
- CYGNUS_GUI_LIBRARY and CYGNUS_IDE_LIBRARY. Permit application
- directory to be a sibling of the parent of the gui or ide
- directory.
- * library/Makefile.am (guidir): Add `cygnus' between `$(datadir)'
- and `gui'.
- * library/Makefile.in: Rebuild.
- * configure: Rebuild with current autoconf.
-
-Mon Mar 30 12:28:06 1998 Tom Tromey <tromey@cygnus.com>
-
- * library/tclIndex: Rebuilt.
-
- * library/Makefile.in: Rebuilt.
- * library/Makefile.am (TCL): Added new files.
- * library/advice.tcl, library/path.tcl, library/sendpr.tcl: Moved
- from libide.
-
- * src/Makefile.in: Rebuilt.
- * src/Makefile.am (tclwinmode.o): New target.
- (libgui_a_SOURCES): Added tclwinmode.c.
- * src/tclwinmode.c: Moved from libide.
- * src/tclcursor.c: Likewise.
-
-Fri Mar 27 20:10:14 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * library/looknfeel.tcl (standard_look_and_feel): windows-menu is a font
- family, not a symbolic font.
-
-Fri Mar 27 00:19:04 1998 Keith Seitz <keiths@onions.cygnus.com>
-
- * library/looknfeel.tcl (standard_look_and_feel): Define font global/menu
- to allow changing the menu font on unix.
-
-Tue Mar 24 02:06:59 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * src/Makefile.am (libgui_a_SOURCES): Add tclmsgbox.c.
- * src/Makefile.in: Rebuilt.
- * src/tclmsgbox.c: New file.
-
-Sun Mar 22 19:29:10 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- * library/email.tcl: removed and replaced with internet.tcl.
- * library/internet.tcl: added
-
-Sat Mar 21 21:18:06 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- Merged the files in library with the corresponding files in Foundry
-
- - Tom Tromey <tromey@cygnus.com>
- * library/balloon.tcl
- (destructor): Cancel any pending after handlers.
- (showballoon): Unshow balloon after 6 seconds.
- (showballoon): On Windows, position balloon
- according to cursor position. (Disabled for now.)
- (_recent_parent): New variable.
- (_enter): If new parent the same as old parent, eliminate delay.
- (showballoon): Set _recent_parent.
- * library/bgerror.tcl
- (bgerror): Display errorCode as well.
- * library/center.tcl
- (center_window): Run "update idletasks" after
- setting window geometry.
- * library/debug.tcl
- (debug_log): Set buffering on log file to "line".
- (DEBUG_window): Removed.
- (DEBUG_after_source): Changed indexing into DEBUG_state array.
- (re_source): Likewise.
- (debug_log): New proc.
- (DEBUG_state): Initialize log_file, window elements.
- (debug): Log to file if user requested it.
- (DEBUG_state): New array.
- (DEBUG_after_source): New proc.
- (source): Likewise.
- (re_source): Likewise.
- * library/hooks.tcl
- (define_hook): Renamed.
- * library/looknfeel.tcl
- (add): Define global/italic font in a way
- that actually works on Windows.
-
- - Martin M. Hunt <hunt@cygnus.com>
- * library/list.tcl
- (lrep): New function. Replace an element in a list with a
- new one.
- * library/prefs.tcl
- (PREFS_cmd_getd): Rewrite to call define then get.
- Fixes strange problem.
-
- - Ian Lance Taylor <ian@cygnus.com>
- * library/print.tcl
- Expand tabs to spaces assuming there are tabstops every
- 8 spaces.
-
-
-Tue Feb 24 19:49:12 1998 Jonathan Larmour <jlarmour@cygnus.co.uk>
-
- * configure.in, src/Makefile.am: Add --enable-install-libgui
- option to install libgui.a and header files if required
-
- * Makefile.in, aclocal.m4, configure, library/Makefile.in,
- src/Makefile.in: regenerate with latest automake
-
-Wed Jan 14 12:36:49 1998 Keith Seitz <keiths@pizza.cygnus.com>
-
- * library/Makefile.am (SET_LIB_PATH): Macro to add Tcl's build dir
- to host's ld search path (LD_LIBRARY_PATH or what have you) for
- builds where Tcl was built using shared libraries. This macro is
- empty otherwise.
- (tclIndex): Call SET_LIB_PATH.
-
- * library/Makefile.in: Regenerate.
-
- * configure.in: Define TCL_SHARED if using shared library for Tcl
-
- * configure: Regenerate.
-
-Tue Dec 16 16:50:40 1997 Ian Lance Taylor <ian@cygnus.com>
-
- New directory to hold GUI support code.
diff --git a/libgui/Makefile.in b/libgui/Makefile.in
deleted file mode 100644
index 65d6eb80c47..00000000000
--- a/libgui/Makefile.in
+++ /dev/null
@@ -1,475 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 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.
-
-@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub README \
- ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) acconfig.h \
- $(srcdir)/config.h.in $(srcdir)/../mkinstalldirs
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/../config/tcl.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
-depcomp =
-am__depfiles_maybe =
-SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
-CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-IDE_ENABLED_FALSE = @IDE_ENABLED_FALSE@
-IDE_ENABLED_TRUE = @IDE_ENABLED_TRUE@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_LIBGUI_FALSE = @INSTALL_LIBGUI_FALSE@
-INSTALL_LIBGUI_TRUE = @INSTALL_LIBGUI_TRUE@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBGUI_CFLAGS = @LIBGUI_CFLAGS@
-LIBGUI_LIBRARY_DIR = @LIBGUI_LIBRARY_DIR@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-RPATH_ENVVAR = @RPATH_ENVVAR@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TCL_BIN_DIR = @TCL_BIN_DIR@
-TCL_DEFS = @TCL_DEFS@
-TCL_INCLUDES = @TCL_INCLUDES@
-TCL_LIBRARY = @TCL_LIBRARY@
-TCL_LIBS = @TCL_LIBS@
-TCL_LIB_FILE = @TCL_LIB_FILE@
-TCL_LIB_FLAG = @TCL_LIB_FLAG@
-TCL_LIB_SPEC = @TCL_LIB_SPEC@
-TCL_PATCH_LEVEL = @TCL_PATCH_LEVEL@
-TCL_SHARED_FALSE = @TCL_SHARED_FALSE@
-TCL_SHARED_TRUE = @TCL_SHARED_TRUE@
-TCL_SRC_DIR = @TCL_SRC_DIR@
-TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@
-TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@
-TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@
-TCL_VERSION = @TCL_VERSION@
-TK_BIN_DIR = @TK_BIN_DIR@
-TK_DEFS = @TK_DEFS@
-TK_INCLUDES = @TK_INCLUDES@
-TK_LIBRARY = @TK_LIBRARY@
-TK_LIBS = @TK_LIBS@
-TK_LIB_FILE = @TK_LIB_FILE@
-TK_LIB_FLAG = @TK_LIB_FLAG@
-TK_LIB_SPEC = @TK_LIB_SPEC@
-TK_SRC_DIR = @TK_SRC_DIR@
-TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@
-TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@
-TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@
-TK_VERSION = @TK_VERSION@
-TK_XINCLUDES = @TK_XINCLUDES@
-VERSION = @VERSION@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-AUTOMAKE_OPTIONS = cygnus
-SUBDIRS = library src
-all: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-am--refresh:
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
- cd $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-
-config.h: stamp-h1
- @if test ! -f $@; then \
- rm -f stamp-h1; \
- $(MAKE) stamp-h1; \
- else :; fi
-
-stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/acconfig.h
- cd $(top_srcdir) && $(AUTOHEADER)
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f config.h stamp-h1
-uninstall-info-am:
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-am:
-check: check-recursive
-all-am: Makefile config.h
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
- check-am clean clean-generic clean-recursive ctags \
- ctags-recursive distclean distclean-generic distclean-hdr \
- distclean-recursive distclean-tags dvi dvi-am html html-am \
- info info-am install install-am install-data install-data-am \
- install-exec install-exec-am install-info install-info-am \
- install-man install-strip installcheck installcheck-am \
- installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic maintainer-clean-recursive \
- mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
- pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
- uninstall-info-am
-
-# 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:
diff --git a/libgui/acinclude.m4 b/libgui/acinclude.m4
deleted file mode 100644
index 2a6ad4ca83a..00000000000
--- a/libgui/acinclude.m4
+++ /dev/null
@@ -1,43 +0,0 @@
-sinclude(../config/tcl.m4)
-
-dnl Find the location of the private Tcl headers
-dnl When Tcl is installed, this is TCL_INCLUDE_SPEC/tcl-private/generic
-dnl When Tcl is in the build tree, this is not needed.
-dnl
-dnl Note: you must use first use SC_LOAD_TCLCONFIG!
-AC_DEFUN([CY_AC_TCL_PRIVATE_HEADERS], [
- AC_MSG_CHECKING([for Tcl private headers])
- private_dir=""
- dir=`echo ${TCL_INCLUDE_SPEC}/tcl-private/generic | sed -e s/-I//`
- if test -f ${dir}/tclInt.h ; then
- private_dir=${dir}
- fi
-
- if test x"${private_dir}" = x; then
- AC_ERROR(could not find private Tcl headers)
- else
- TCL_PRIVATE_INCLUDE="-I${private_dir}"
- AC_MSG_RESULT(${private_dir})
- fi
-])
-
-dnl Find the location of the private Tk headers
-dnl When Tk is installed, this is TK_INCLUDE_SPEC/tk-private/generic
-dnl When Tk is in the build tree, this not needed.
-dnl
-dnl Note: you must first use SC_LOAD_TKCONFIG
-AC_DEFUN([CY_AC_TK_PRIVATE_HEADERS], [
- AC_MSG_CHECKING([for Tk private headers])
- private_dir=""
- dir=`echo ${TK_INCLUDE_SPEC}/tk-private/generic | sed -e s/-I//`
- if test -f ${dir}/tkInt.h; then
- private_dir=${dir}
- fi
-
- if test x"${private_dir}" = x; then
- AC_ERROR(could not find Tk private headers)
- else
- TK_PRIVATE_INCLUDE="-I${private_dir}"
- AC_MSG_RESULT(${private_dir})
- fi
-])
diff --git a/libgui/aclocal.m4 b/libgui/aclocal.m4
deleted file mode 100644
index 0e90944648f..00000000000
--- a/libgui/aclocal.m4
+++ /dev/null
@@ -1,892 +0,0 @@
-# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005 Free Software Foundation, Inc.
-# This file 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.
-
-# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
- [AM_AUTOMAKE_VERSION([1.9.6])])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 7
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 8
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-#serial 3
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 8
-
-# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 12
-
-# 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.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.58])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])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
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-])
-])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $1 | $1:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
-# From Jim Meyering
-
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 4
-
-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
-]
-)
-
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 3
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 4
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-#
-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
-# created by `make install' are always world readable, even if the
-# installer happens to have an overly restrictive umask (e.g. 077).
-# This was a mistake. There are at least two reasons why we must not
-# use `-m 0755':
-# - it causes special bits like SGID to be ignored,
-# - it may be too restrictive (some setups expect 775 directories).
-#
-# Do not use -m 0755 and let people choose whatever they expect by
-# setting umask.
-#
-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
-# Some implementations (such as Solaris 8's) are not thread-safe: if a
-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
-# concurrently, both version can detect that a/ is missing, but only
-# one can create it and the other will error out. Consequently we
-# restrict ourselves to GNU make (using the --version option ensures
-# this.)
-AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-AC_SUBST([mkdir_p])])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 3
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 4
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# 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 conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $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]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
- [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
-m4_include([acinclude.m4])
diff --git a/libgui/configure b/libgui/configure
deleted file mode 100755
index 504e233fc58..00000000000
--- a/libgui/configure
+++ /dev/null
@@ -1,6398 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59.
-#
-# Copyright (C) 2003 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-exec 6>&1
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_config_libobj_dir=.
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete. It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_unique_file="src/subcommand.h"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# if HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#if HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CROSS_COMPILING_TRUE CROSS_COMPILING_FALSE INSTALL_LIBGUI_TRUE INSTALL_LIBGUI_FALSE RANLIB ac_ct_RANLIB AR ac_ct_AR ALLOCA CPP EGREP IDE_ENABLED_TRUE IDE_ENABLED_FALSE LIBGUI_CFLAGS LIBGUI_LIBRARY_DIR TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TCL_DEFS TCL_INCLUDES TK_DEFS TK_INCLUDES TK_XINCLUDES TCL_LIBS TK_LIBRARY TCL_LIBRARY TK_LIBS TCL_SHARED_TRUE TCL_SHARED_FALSE RPATH_ENVVAR LIBOBJS LTLIBOBJS'
-ac_subst_files=''
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-ac_prev=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_option in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval "enable_$ac_feature=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_$ac_feature='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "with_$ac_package='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval "with_$ac_package=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
- eval "$ac_envvar='$ac_optarg'"
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
- { (exit 1); exit 1; }; }
- else
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
- fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
- { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
- cat <<_ACEOF
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
-\
- --enable-install-libgui Install libgui.a and library header files
- --enable-ide Enable IDE support
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-tcl directory containing tcl configuration (tclConfig.sh)
- --with-tk directory containing tk configuration (tkConfig.sh)
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
- headers in a nonstandard directory <include dir>
- CPP C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- ac_popdir=`pwd`
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d $ac_dir || continue
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
- cd $ac_dir
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- echo
- $SHELL $ac_srcdir/configure.gnu --help=recursive
- elif test -f $ac_srcdir/configure; then
- echo
- $SHELL $ac_srcdir/configure --help=recursive
- elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
- echo
- $ac_configure --help
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
- cd $ac_popdir
- done
-fi
-
-test -n "$ac_init_help" && exit 0
-if $ac_init_version; then
- cat <<\_ACEOF
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit 0
-fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_sep=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-{
- (set) 2>&1 |
- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
- ;;
- *)
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-}
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- sed "/^$/d" confdefs.h | sort
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core &&
- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
- ' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . $cache_file;;
- *) . ./$cache_file;;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
- eval ac_new_val="\$ac_env_${ac_var}_value"
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-am__api_version="1.9"
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f $ac_dir/shtool; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
- { (exit 1); exit 1; }; }
-fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL=$ac_install_sh
- fi
-fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# 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 conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $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".
- { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
-Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
-Check your system clock" >&2;}
- { (exit 1); exit 1; }; }
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-test "$program_prefix" != NONE &&
- program_transform_name="s,^,$program_prefix,;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s,\$,$program_suffix,;$program_transform_name"
-# Double any \ or $. echo might interpret backslashes.
-# By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AWK+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AWK="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$AWK" && break
-done
-
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.make <<\_ACEOF
-all:
- @echo 'ac_maketemp="$(MAKE)"'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftest.make
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- SET_MAKE=
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE=libgui
- VERSION=0.0
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- STRIP=$ac_ct_STRIP
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
-
-
-
-
- ac_config_headers="$ac_config_headers config.h"
-
-echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
-echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
- # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then
- enableval="$enable_maintainer_mode"
- USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
-fi;
- echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
-echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
-
-
-if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-# Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
- { (exit 1); exit 1; }; }
-
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
- ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
-build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
- ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
-host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$ac_ct_CC" && break
-done
-
- CC=$ac_ct_CC
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
- "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
- (eval $ac_compiler --version </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
- (eval $ac_compiler -v </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
- (eval $ac_compiler -V </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
- (eval $ac_link_default) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Find the output, starting from the most likely. This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
- conftest.$ac_ext )
- # This is the source file.
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
- break;;
- * )
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std1 is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std1. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_stdc=$ac_arg
-break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
- x|xno)
- echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
- *)
- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
- CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-# Some people use a C++ compiler to compile C. Since we use `exit',
-# in C++ we need to declare it. In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
- choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- for ac_declaration in \
- '' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);'
-do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-DEPDIR="${am__leading_dot}deps"
-
- ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-
-
-echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
- enableval="$enable_dependency_tracking"
-
-fi;
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-
-depcc="$CC" am_compiler_list=
-
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-
-
-if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-
-
-# Check whether --enable-install-libgui or --disable-install-libgui was given.
-if test "${enable_install_libgui+set}" = set; then
- enableval="$enable_install_libgui"
-
-fi;
-
-
-if test x$cross_compiling = xyes; then
- CROSS_COMPILING_TRUE=
- CROSS_COMPILING_FALSE='#'
-else
- CROSS_COMPILING_TRUE='#'
- CROSS_COMPILING_FALSE=
-fi
-
-
-
-if test x$enable_install_libgui = xyes; then
- INSTALL_LIBGUI_TRUE=
- INSTALL_LIBGUI_FALSE='#'
-else
- INSTALL_LIBGUI_TRUE='#'
- INSTALL_LIBGUI_FALSE=
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- RANLIB=$ac_ct_RANLIB
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_AR"; then
- ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AR="ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR=":"
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- AR=$ac_ct_AR
-else
- AR="$ac_cv_prog_AR"
-fi
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether non-existent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether non-existent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
- fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
-
-
-# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments. Useless!
-echo "$as_me:$LINENO: checking for working alloca.h" >&5
-echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
-if test "${ac_cv_working_alloca_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <alloca.h>
-int
-main ()
-{
-char *p = (char *) alloca (2 * sizeof (int));
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_working_alloca_h=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_working_alloca_h=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
-echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
-if test $ac_cv_working_alloca_h = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALLOCA_H 1
-_ACEOF
-
-fi
-
-echo "$as_me:$LINENO: checking for alloca" >&5
-echo $ECHO_N "checking for alloca... $ECHO_C" >&6
-if test "${ac_cv_func_alloca_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# ifdef _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-# else
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
-# endif
-# endif
-#endif
-
-int
-main ()
-{
-char *p = (char *) alloca (1);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_alloca_works=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_alloca_works=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
-echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
-
-if test $ac_cv_func_alloca_works = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALLOCA 1
-_ACEOF
-
-else
- # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-# that cause trouble. Some versions do not even contain alloca or
-# contain a buggy version. If you still want to use their alloca,
-# use ar to extract alloca.o from them instead of compiling alloca.c.
-
-ALLOCA=alloca.$ac_objext
-
-cat >>confdefs.h <<\_ACEOF
-#define C_ALLOCA 1
-_ACEOF
-
-
-echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
-echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
-if test "${ac_cv_os_cray+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#if defined(CRAY) && ! defined(CRAY2)
-webecray
-#else
-wenotbecray
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "webecray" >/dev/null 2>&1; then
- ac_cv_os_cray=yes
-else
- ac_cv_os_cray=no
-fi
-rm -f conftest*
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
-echo "${ECHO_T}$ac_cv_os_cray" >&6
-if test $ac_cv_os_cray = yes; then
- for ac_func in _getb67 GETB67 getb67; do
- as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
-_ACEOF
-
- break
-fi
-
- done
-fi
-
-echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
-echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
-if test "${ac_cv_c_stack_direction+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_c_stack_direction=0
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-int
-find_stack_direction ()
-{
- static char *addr = 0;
- auto char dummy;
- if (addr == 0)
- {
- addr = &dummy;
- return find_stack_direction ();
- }
- else
- return (&dummy > addr) ? 1 : -1;
-}
-
-int
-main ()
-{
- exit (find_stack_direction () < 0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_c_stack_direction=1
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_c_stack_direction=-1
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
-echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
-
-cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
-_ACEOF
-
-
-fi
-
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_header_stdc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_header_stdc=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- exit(2);
- exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in stddef.h stdlib.h getopt.h unistd.h fcntl.h sys/file.h sys/wait.h string.h strings.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists. ##
-## ------------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_func in raise
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-# Check whether --enable-ide or --disable-ide was given.
-if test "${enable_ide+set}" = set; then
- enableval="$enable_ide"
- case "${enableval}" in
- yes) ide=yes ;;
- no) ide=no ;;
- *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for enable-ide option" >&5
-echo "$as_me: error: bad value ${enableval} for enable-ide option" >&2;}
- { (exit 1); exit 1; }; } ;;
-esac
-else
- ide=no
-fi;
-
-
-if test x$ide = xyes; then
- IDE_ENABLED_TRUE=
- IDE_ENABLED_FALSE='#'
-else
- IDE_ENABLED_TRUE='#'
- IDE_ENABLED_FALSE=
-fi
-
-if test x$ide = xyes; then
- cat >>confdefs.h <<\_ACEOF
-#define IDE_ENABLED 1
-_ACEOF
-
-fi
-
-# If we have random, assume we have srandom. If we have drand48,
-# assume we have srand48. If we have rand, assume we have srand.
-
-
-
-for ac_func in random drand48 rand
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- break
-fi
-done
-
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "strncasecmp" >/dev/null 2>&1; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRNCASECMP_DECL 1
-_ACEOF
-
-fi
-rm -f conftest*
-
-
-
-echo "$as_me:$LINENO: checking for cygwin32" >&5
-echo $ECHO_N "checking for cygwin32... $ECHO_C" >&6
-if test "${ide_cv_os_cygwin32+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef __CYGWIN32__
-lose
-#endif
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "lose" >/dev/null 2>&1; then
- ide_cv_os_cygwin32=yes
-else
- ide_cv_os_cygwin32=no
-fi
-rm -f conftest*
-
-fi
-echo "$as_me:$LINENO: result: $ide_cv_os_cygwin32" >&5
-echo "${ECHO_T}$ide_cv_os_cygwin32" >&6
-ac_win_build="no"
-if test x$ide_cv_os_cygwin32 = xyes; then
- ac_win_build="yes"
-fi
-
-case "${host}" in
-*-*-cygwin*)
- touch ac$$.c
- if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then
- case "$LIBGUI_CFLAGS" in
- *-mwin32*) ;;
- *) LIBGUI_CFLAGS="-mwin32 $LIBGUI_CFLAGS" ;;
- esac
- fi
- rm -f ac$$.o ac$$.c
- ;;
-esac
-case "${host}" in
-*-*-cygwin*)
- LIBGUI_CFLAGS="-DWIN32 $LIBGUI_CFLAGS" ;;
-esac
-
-
-tmp="`cd $srcdir/library; pwd`"
-if test x"$ac_cv_prog_CC" = xcl ; then
- tmp2="`cygpath --windows $tmp`"
- LIBGUI_LIBRARY_DIR="`echo $tmp2 | sed -e s#\\\\\\\\#/#g`"
-else
- LIBGUI_LIBRARY_DIR=$tmp
-fi
-
-
-# Check for Tcl and Tk.
-
- #
- # Ok, lets find the tcl configuration
- # First, look for one uninstalled.
- # the alternative search directory is invoked by --with-tcl
- #
-
- if test x"${no_tcl}" = x ; then
- # we reset no_tcl in case something fails here
- no_tcl=true
-
-# Check whether --with-tcl or --without-tcl was given.
-if test "${with_tcl+set}" = set; then
- withval="$with_tcl"
- with_tclconfig=${withval}
-fi;
- echo "$as_me:$LINENO: checking for Tcl configuration" >&5
-echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6
- if test "${ac_cv_c_tclconfig+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
- # First check to see if --with-tcl was specified.
- case "${host}" in
- *-*-cygwin*) platDir="win" ;;
- *) platDir="unix" ;;
- esac
- if test x"${with_tclconfig}" != x ; then
- if test -f "${with_tclconfig}/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
- else
- { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5
-echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-
- # then check for a private Tcl installation
- if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in \
- ../tcl \
- `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \
- ../../tcl \
- `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \
- ../../../tcl \
- `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do
- if test -f "$i/$platDir/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/$platDir; pwd)`
- break
- fi
- done
- fi
-
- # on Darwin, check in Framework installation locations
- if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
- for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
- `ls -d /Library/Frameworks 2>/dev/null` \
- `ls -d /Network/Library/Frameworks 2>/dev/null` \
- `ls -d /System/Library/Frameworks 2>/dev/null` \
- ; do
- if test -f "$i/Tcl.framework/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)`
- break
- fi
- done
- fi
-
- # check in a few common install locations
- if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in `ls -d ${libdir} 2>/dev/null` \
- `ls -d ${exec_prefix}/lib 2>/dev/null` \
- `ls -d ${prefix}/lib 2>/dev/null` \
- `ls -d /usr/local/lib 2>/dev/null` \
- `ls -d /usr/contrib/lib 2>/dev/null` \
- `ls -d /usr/lib 2>/dev/null` \
- ; do
- if test -f "$i/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i; pwd)`
- break
- fi
- done
- fi
-
- # check in a few other private locations
- if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in \
- ${srcdir}/../tcl \
- `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \
- `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do
- if test -f "$i/$platDir/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/$platDir; pwd)`
- break
- fi
- done
- fi
-
-fi
-
-
- if test x"${ac_cv_c_tclconfig}" = x ; then
- TCL_BIN_DIR="# no Tcl configs found"
- { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5
-echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;}
- exit 0
- else
- no_tcl=
- TCL_BIN_DIR=${ac_cv_c_tclconfig}
- echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5
-echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6
- fi
- fi
-
-
- echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5
-echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6
-
- if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
- echo "$as_me:$LINENO: result: loading" >&5
-echo "${ECHO_T}loading" >&6
- . ${TCL_BIN_DIR}/tclConfig.sh
- else
- echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5
-echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6
- fi
-
- # eval is required to do the TCL_DBGX substitution
- eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
- eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
-
- # If the TCL_BIN_DIR is the build directory (not the install directory),
- # then set the common variable name to the value of the build variables.
- # For example, the variable TCL_LIB_SPEC will be set to the value
- # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
- # instead of TCL_BUILD_LIB_SPEC since it will work with both an
- # installed and uninstalled version of Tcl.
- if test -f ${TCL_BIN_DIR}/Makefile ; then
- TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
- TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
- TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
- elif test "`uname -s`" = "Darwin"; then
- # If Tcl was built as a framework, attempt to use the libraries
- # from the framework at the given location so that linking works
- # against Tcl.framework installed in an arbitary location.
- case ${TCL_DEFS} in
- *TCL_FRAMEWORK*)
- if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then
- for i in "`cd ${TCL_BIN_DIR}; pwd`" \
- "`cd ${TCL_BIN_DIR}/../..; pwd`"; do
- if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
- TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}"
- break
- fi
- done
- fi
- if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then
- TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
- TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
- fi
- ;;
- esac
- fi
-
- # eval is required to do the TCL_DBGX substitution
- eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
- eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
- eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
- eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #
- # Ok, lets find the tk configuration
- # First, look for one uninstalled.
- # the alternative search directory is invoked by --with-tk
- #
-
- if test x"${no_tk}" = x ; then
- # we reset no_tk in case something fails here
- no_tk=true
-
-# Check whether --with-tk or --without-tk was given.
-if test "${with_tk+set}" = set; then
- withval="$with_tk"
- with_tkconfig=${withval}
-fi;
- echo "$as_me:$LINENO: checking for Tk configuration" >&5
-echo $ECHO_N "checking for Tk configuration... $ECHO_C" >&6
- if test "${ac_cv_c_tkconfig+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
- # First check to see if --with-tkconfig was specified.
- if test x"${with_tkconfig}" != x ; then
- if test -f "${with_tkconfig}/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
- else
- { { echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5
-echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-
- # then check for a private Tk library
- case "${host}" in
- *-*-cygwin*) platDir="win" ;;
- *) platDir="unix" ;;
- esac
- if test x"${ac_cv_c_tkconfig}" = x ; then
- for i in \
- ../tk \
- `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \
- ../../tk \
- `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \
- ../../../tk \
- `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \
- `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do
- if test -f "$i/$platDir/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i/$platDir; pwd)`
- break
- fi
- done
- fi
-
- # on Darwin, check in Framework installation locations
- if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
- for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
- `ls -d /Library/Frameworks 2>/dev/null` \
- `ls -d /Network/Library/Frameworks 2>/dev/null` \
- `ls -d /System/Library/Frameworks 2>/dev/null` \
- ; do
- if test -f "$i/Tk.framework/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)`
- break
- fi
- done
- fi
-
- # check in a few common install locations
- if test x"${ac_cv_c_tkconfig}" = x ; then
- for i in `ls -d ${libdir} 2>/dev/null` \
- `ls -d ${exec_prefix}/lib 2>/dev/null` \
- `ls -d ${prefix}/lib 2>/dev/null` \
- `ls -d /usr/local/lib 2>/dev/null` \
- `ls -d /usr/contrib/lib 2>/dev/null` \
- `ls -d /usr/lib 2>/dev/null` \
- ; do
- if test -f "$i/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i; pwd)`
- break
- fi
- done
- fi
- # check in a few other private locations
- if test x"${ac_cv_c_tkconfig}" = x ; then
- for i in \
- ${srcdir}/../tk \
- `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
- `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \
- `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do
- if test -f "$i/$platDir/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i/$platDir; pwd)`
- break
- fi
- done
- fi
-
-fi
-
-
- if test x"${ac_cv_c_tkconfig}" = x ; then
- TK_BIN_DIR="# no Tk configs found"
- { echo "$as_me:$LINENO: WARNING: Can't find Tk configuration definitions" >&5
-echo "$as_me: WARNING: Can't find Tk configuration definitions" >&2;}
- exit 0
- else
- no_tk=
- TK_BIN_DIR=${ac_cv_c_tkconfig}
- echo "$as_me:$LINENO: result: found ${TK_BIN_DIR}/tkConfig.sh" >&5
-echo "${ECHO_T}found ${TK_BIN_DIR}/tkConfig.sh" >&6
- fi
- fi
-
-
- echo "$as_me:$LINENO: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5
-echo $ECHO_N "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... $ECHO_C" >&6
-
- if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
- echo "$as_me:$LINENO: result: loading" >&5
-echo "${ECHO_T}loading" >&6
- . ${TK_BIN_DIR}/tkConfig.sh
- else
- echo "$as_me:$LINENO: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5
-echo "${ECHO_T}could not find ${TK_BIN_DIR}/tkConfig.sh" >&6
- fi
-
- # eval is required to do the TK_DBGX substitution
- eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
- eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
-
- # If the TK_BIN_DIR is the build directory (not the install directory),
- # then set the common variable name to the value of the build variables.
- # For example, the variable TK_LIB_SPEC will be set to the value
- # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
- # instead of TK_BUILD_LIB_SPEC since it will work with both an
- # installed and uninstalled version of Tcl.
- if test -f ${TK_BIN_DIR}/Makefile ; then
- TK_LIB_SPEC=${TK_BUILD_LIB_SPEC}
- TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC}
- TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH}
- elif test "`uname -s`" = "Darwin"; then
- # If Tk was built as a framework, attempt to use the libraries
- # from the framework at the given location so that linking works
- # against Tk.framework installed in an arbitary location.
- case ${TK_DEFS} in
- *TK_FRAMEWORK*)
- if test -f ${TK_BIN_DIR}/${TK_LIB_FILE}; then
- for i in "`cd ${TK_BIN_DIR}; pwd`" \
- "`cd ${TK_BIN_DIR}/../..; pwd`"; do
- if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
- TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}"
- break
- fi
- done
- fi
- if test -f ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}; then
- TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}"
- TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
- fi
- ;;
- esac
- fi
-
- # eval is required to do the TK_DBGX substitution
- eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
- eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
- eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
- eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-here=`pwd`
-cd ${srcdir}/..
-topdir=`pwd`
-cd ${here}
-
-if test "${TCL_SRC_DIR}" = "${topdir}/tcl"; then
- # Using in-tree Tcl/Tk
- case "${host}" in
- *-*-cygwin*) platDir="win" ;;
- *) platDir="unix" ;;
- esac
-
- TCL_INCLUDES="-I${TCL_SRC_DIR}/generic -I${TCL_SRC_DIR}/${platDir}"
- TCL_LIBRARY=${TCL_BUILD_LIB_SPEC}
- TK_INCLUDES="-I${TK_SRC_DIR}/generic -I${TK_SRC_DIR}/${platDir}"
- TK_LIBRARY=${TK_BUILD_LIB_SPEC}
-else
- # Using installed Tcl/Tk
-
- echo "$as_me:$LINENO: checking for Tcl private headers" >&5
-echo $ECHO_N "checking for Tcl private headers... $ECHO_C" >&6
- private_dir=""
- dir=`echo ${TCL_INCLUDE_SPEC}/tcl-private/generic | sed -e s/-I//`
- if test -f ${dir}/tclInt.h ; then
- private_dir=${dir}
- fi
-
- if test x"${private_dir}" = x; then
- { { echo "$as_me:$LINENO: error: could not find private Tcl headers" >&5
-echo "$as_me: error: could not find private Tcl headers" >&2;}
- { (exit 1); exit 1; }; }
- else
- TCL_PRIVATE_INCLUDE="-I${private_dir}"
- echo "$as_me:$LINENO: result: ${private_dir}" >&5
-echo "${ECHO_T}${private_dir}" >&6
- fi
-
-
- echo "$as_me:$LINENO: checking for Tk private headers" >&5
-echo $ECHO_N "checking for Tk private headers... $ECHO_C" >&6
- private_dir=""
- dir=`echo ${TK_INCLUDE_SPEC}/tk-private/generic | sed -e s/-I//`
- if test -f ${dir}/tkInt.h; then
- private_dir=${dir}
- fi
-
- if test x"${private_dir}" = x; then
- { { echo "$as_me:$LINENO: error: could not find Tk private headers" >&5
-echo "$as_me: error: could not find Tk private headers" >&2;}
- { (exit 1); exit 1; }; }
- else
- TK_PRIVATE_INCLUDE="-I${private_dir}"
- echo "$as_me:$LINENO: result: ${private_dir}" >&5
-echo "${ECHO_T}${private_dir}" >&6
- fi
-
- TCL_INCLUDES="${TCL_INCLUDE_SPEC} ${TCL_PRIVATE_INCLUDE}"
- TCL_LIBRARY=${TCL_LIB_SPEC}
- TK_INCLUDES="${TK_INCLUDE_SPEC} ${TK_PRIVATE_INCLUDE}"
- TK_LIBRARY=${TK_LIB_SPEC}
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test x$TCL_SHARED_BUILD = x1; then
- TCL_SHARED_TRUE=
- TCL_SHARED_FALSE='#'
-else
- TCL_SHARED_TRUE='#'
- TCL_SHARED_FALSE=
-fi
-
-
-
-
- ac_config_files="$ac_config_files Makefile library/Makefile src/Makefile"
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
- (set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-} |
- sed '
- t clear
- : clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
- if test -w $cache_file; then
- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
- cat confcache >$cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ ]*$//;
-}'
-fi
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"CROSS_COMPILING\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"CROSS_COMPILING\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${INSTALL_LIBGUI_TRUE}" && test -z "${INSTALL_LIBGUI_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LIBGUI\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"INSTALL_LIBGUI\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${IDE_ENABLED_TRUE}" && test -z "${IDE_ENABLED_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"IDE_ENABLED\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"IDE_ENABLED\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${TCL_SHARED_TRUE}" && test -z "${TCL_SHARED_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"TCL_SHARED\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"TCL_SHARED\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-_ACEOF
-
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.59,
- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- -*)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
- esac
-
- case $ac_option in
- # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1" ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# INIT-COMMANDS section.
-#
-
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_config_target in $ac_config_targets
-do
- case "$ac_config_target" in
- # Handling of arguments.
- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "library/Makefile" ) CONFIG_FILES="$CONFIG_FILES library/Makefile" ;;
- "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
- "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@CYGPATH_W@,$CYGPATH_W,;t t
-s,@PACKAGE@,$PACKAGE,;t t
-s,@VERSION@,$VERSION,;t t
-s,@ACLOCAL@,$ACLOCAL,;t t
-s,@AUTOCONF@,$AUTOCONF,;t t
-s,@AUTOMAKE@,$AUTOMAKE,;t t
-s,@AUTOHEADER@,$AUTOHEADER,;t t
-s,@MAKEINFO@,$MAKEINFO,;t t
-s,@install_sh@,$install_sh,;t t
-s,@STRIP@,$STRIP,;t t
-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
-s,@mkdir_p@,$mkdir_p,;t t
-s,@AWK@,$AWK,;t t
-s,@SET_MAKE@,$SET_MAKE,;t t
-s,@am__leading_dot@,$am__leading_dot,;t t
-s,@AMTAR@,$AMTAR,;t t
-s,@am__tar@,$am__tar,;t t
-s,@am__untar@,$am__untar,;t t
-s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
-s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
-s,@MAINT@,$MAINT,;t t
-s,@build@,$build,;t t
-s,@build_cpu@,$build_cpu,;t t
-s,@build_vendor@,$build_vendor,;t t
-s,@build_os@,$build_os,;t t
-s,@host@,$host,;t t
-s,@host_cpu@,$host_cpu,;t t
-s,@host_vendor@,$host_vendor,;t t
-s,@host_os@,$host_os,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@DEPDIR@,$DEPDIR,;t t
-s,@am__include@,$am__include,;t t
-s,@am__quote@,$am__quote,;t t
-s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
-s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
-s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
-s,@CCDEPMODE@,$CCDEPMODE,;t t
-s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
-s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
-s,@CROSS_COMPILING_TRUE@,$CROSS_COMPILING_TRUE,;t t
-s,@CROSS_COMPILING_FALSE@,$CROSS_COMPILING_FALSE,;t t
-s,@INSTALL_LIBGUI_TRUE@,$INSTALL_LIBGUI_TRUE,;t t
-s,@INSTALL_LIBGUI_FALSE@,$INSTALL_LIBGUI_FALSE,;t t
-s,@RANLIB@,$RANLIB,;t t
-s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s,@AR@,$AR,;t t
-s,@ac_ct_AR@,$ac_ct_AR,;t t
-s,@ALLOCA@,$ALLOCA,;t t
-s,@CPP@,$CPP,;t t
-s,@EGREP@,$EGREP,;t t
-s,@IDE_ENABLED_TRUE@,$IDE_ENABLED_TRUE,;t t
-s,@IDE_ENABLED_FALSE@,$IDE_ENABLED_FALSE,;t t
-s,@LIBGUI_CFLAGS@,$LIBGUI_CFLAGS,;t t
-s,@LIBGUI_LIBRARY_DIR@,$LIBGUI_LIBRARY_DIR,;t t
-s,@TCL_VERSION@,$TCL_VERSION,;t t
-s,@TCL_PATCH_LEVEL@,$TCL_PATCH_LEVEL,;t t
-s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t
-s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t
-s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t
-s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t
-s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t
-s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t
-s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t
-s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t
-s,@TK_VERSION@,$TK_VERSION,;t t
-s,@TK_BIN_DIR@,$TK_BIN_DIR,;t t
-s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t
-s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t
-s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t
-s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t
-s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t
-s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t
-s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t
-s,@TCL_DEFS@,$TCL_DEFS,;t t
-s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t
-s,@TK_DEFS@,$TK_DEFS,;t t
-s,@TK_INCLUDES@,$TK_INCLUDES,;t t
-s,@TK_XINCLUDES@,$TK_XINCLUDES,;t t
-s,@TCL_LIBS@,$TCL_LIBS,;t t
-s,@TK_LIBRARY@,$TK_LIBRARY,;t t
-s,@TCL_LIBRARY@,$TCL_LIBRARY,;t t
-s,@TK_LIBS@,$TK_LIBS,;t t
-s,@TCL_SHARED_TRUE@,$TCL_SHARED_TRUE,;t t
-s,@TCL_SHARED_FALSE@,$TCL_SHARED_FALSE,;t t
-s,@RPATH_ENVVAR@,$RPATH_ENVVAR,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
- cat >>$CONFIG_STATUS <<\_ACEOF
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
- fi
-fi # test -n "$CONFIG_FILES"
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
- esac
-
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
-
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='[ ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- # Do quote $f, to prevent DOS paths from being IFS'd.
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
- # Remove the trailing spaces.
- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
-
-_ACEOF
-
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h. The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status. Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless. Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
-
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo ' :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
-do
- # Write a limited-size here document to $tmp/defines.sed.
- echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
- # Speed up: don't consider the non `#define' lines.
- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
- # Work around the forget-to-reset-the-flag bug.
- echo 't clr' >>$CONFIG_STATUS
- echo ': clr' >>$CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
- echo 'CEOF
- sed -f $tmp/defines.sed $tmp/in >$tmp/out
- rm -f $tmp/in
- mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
- rm -f conftest.defines
- mv conftest.tail conftest.defines
-done
-rm -f conftest.defines
-echo ' fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
-
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
- # Write a limited-size here document to $tmp/undefs.sed.
- echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
- # Speed up: don't consider the non `#undef'
- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
- # Work around the forget-to-reset-the-flag bug.
- echo 't clr' >>$CONFIG_STATUS
- echo ': clr' >>$CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
- echo 'CEOF
- sed -f $tmp/undefs.sed $tmp/in >$tmp/out
- rm -f $tmp/in
- mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
- rm -f conftest.undefs
- mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
-
-cat >>$CONFIG_STATUS <<\_ACEOF
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- echo "/* Generated by configure. */" >$tmp/config.h
- else
- echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
- fi
- cat $tmp/in >>$tmp/config.h
- rm -f $tmp/in
- if test x"$ac_file" != x-; then
- if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
- else
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- rm -f $ac_file
- mv $tmp/config.h $ac_file
- fi
- else
- cat $tmp/config.h
- rm -f $tmp/config.h
- fi
-# Compute $ac_file's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $ac_file | $ac_file:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
-$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X$ac_file : 'X\(//\)[^/]' \| \
- X$ac_file : 'X\(//\)$' \| \
- X$ac_file : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X$ac_file |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`/stamp-h$_am_stamp_count
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
- ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
- ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_dest" : 'X\(//\)[^/]' \| \
- X"$ac_dest" : 'X\(//\)$' \| \
- X"$ac_dest" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
- { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
- case $ac_dest in
- depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`(dirname "$mf") 2>/dev/null ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`(dirname "$file") 2>/dev/null ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p $dirpart/$fdir
- else
- as_dir=$dirpart/$fdir
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
- { (exit 1); exit 1; }; }; }
-
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
- ;;
- esac
-done
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
-
-
-
diff --git a/libgui/configure.ac b/libgui/configure.ac
deleted file mode 100644
index 0eb55b00e97..00000000000
--- a/libgui/configure.ac
+++ /dev/null
@@ -1,131 +0,0 @@
-dnl Process this file with autoconf to produce configure.
-
-AC_INIT(src/subcommand.h)
-AM_INIT_AUTOMAKE(libgui, 0.0)
-AM_CONFIG_HEADER(config.h)
-AM_MAINTAINER_MODE
-AC_CANONICAL_HOST
-AC_PROG_CC
-AC_EXEEXT
-AC_OBJEXT
-AC_ARG_ENABLE(install-libgui, \
- [ --enable-install-libgui Install libgui.a and library header files])
-AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
-AM_CONDITIONAL(INSTALL_LIBGUI, test x$enable_install_libgui = xyes)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(AR, ar, :)
-
-AC_FUNC_ALLOCA
-AC_HAVE_HEADERS(stddef.h stdlib.h getopt.h unistd.h fcntl.h sys/file.h sys/wait.h string.h strings.h)
-AC_CHECK_FUNCS(raise)
-
-AC_ARG_ENABLE(ide, [ --enable-ide Enable IDE support],
-[case "${enableval}" in
- yes) ide=yes ;;
- no) ide=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for enable-ide option) ;;
-esac],
-[ide=no])
-AM_CONDITIONAL(IDE_ENABLED, test x$ide = xyes)
-if test x$ide = xyes; then
- AC_DEFINE(IDE_ENABLED)
-fi
-
-# If we have random, assume we have srandom. If we have drand48,
-# assume we have srand48. If we have rand, assume we have srand.
-AC_CHECK_FUNCS(random drand48 rand, break)
-
-dnl Tcl ensures that strncasecmp is provided everywhere. But in some
-dnl situations we might need to declare it. We check for that case
-dnl here.
-AC_EGREP_CPP(strncasecmp, [#include <string.h>],
- AC_DEFINE(HAVE_STRNCASECMP_DECL))
-
-
-AC_CACHE_CHECK([for cygwin32], ide_cv_os_cygwin32,
-[AC_EGREP_CPP(lose, [
-#ifdef __CYGWIN32__
-lose
-#endif],[ide_cv_os_cygwin32=yes],[ide_cv_os_cygwin32=no])])
-ac_win_build="no"
-if test x$ide_cv_os_cygwin32 = xyes; then
- ac_win_build="yes"
-fi
-
-case "${host}" in
-*-*-cygwin*)
- touch ac$$.c
- if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then
- case "$LIBGUI_CFLAGS" in
- *-mwin32*) ;;
- *) LIBGUI_CFLAGS="-mwin32 $LIBGUI_CFLAGS" ;;
- esac
- fi
- rm -f ac$$.o ac$$.c
- ;;
-esac
-case "${host}" in
-*-*-cygwin*)
- LIBGUI_CFLAGS="-DWIN32 $LIBGUI_CFLAGS" ;;
-esac
-AC_SUBST(LIBGUI_CFLAGS)
-
-tmp="`cd $srcdir/library; pwd`"
-if test x"$ac_cv_prog_CC" = xcl ; then
- tmp2="`cygpath --windows $tmp`"
- LIBGUI_LIBRARY_DIR="`echo $tmp2 | sed -e s#\\\\\\\\#/#g`"
-else
- LIBGUI_LIBRARY_DIR=$tmp
-fi
-AC_SUBST(LIBGUI_LIBRARY_DIR)
-
-# Check for Tcl and Tk.
-SC_PATH_TCLCONFIG
-SC_LOAD_TCLCONFIG
-SC_PATH_TKCONFIG
-SC_LOAD_TKCONFIG
-
-here=`pwd`
-cd ${srcdir}/..
-topdir=`pwd`
-cd ${here}
-
-if test "${TCL_SRC_DIR}" = "${topdir}/tcl"; then
- # Using in-tree Tcl/Tk
- case "${host}" in
- *-*-cygwin*) platDir="win" ;;
- *) platDir="unix" ;;
- esac
-
- TCL_INCLUDES="-I${TCL_SRC_DIR}/generic -I${TCL_SRC_DIR}/${platDir}"
- TCL_LIBRARY=${TCL_BUILD_LIB_SPEC}
- TK_INCLUDES="-I${TK_SRC_DIR}/generic -I${TK_SRC_DIR}/${platDir}"
- TK_LIBRARY=${TK_BUILD_LIB_SPEC}
-else
- # Using installed Tcl/Tk
- CY_AC_TCL_PRIVATE_HEADERS
- CY_AC_TK_PRIVATE_HEADERS
- TCL_INCLUDES="${TCL_INCLUDE_SPEC} ${TCL_PRIVATE_INCLUDE}"
- TCL_LIBRARY=${TCL_LIB_SPEC}
- TK_INCLUDES="${TK_INCLUDE_SPEC} ${TK_PRIVATE_INCLUDE}"
- TK_LIBRARY=${TK_LIB_SPEC}
-fi
-
-AC_SUBST(TCL_DEFS)
-AC_SUBST(TCL_INCLUDES)
-AC_SUBST(TK_DEFS)
-AC_SUBST(TK_INCLUDES)
-AC_SUBST(TK_XINCLUDES)
-AC_SUBST(TCL_LIBS)
-AC_SUBST(TK_LIBRARY)
-AC_SUBST(TCL_LIBRARY)
-AC_SUBST(TK_LIBS)
-
-AM_CONDITIONAL(TCL_SHARED, test x$TCL_SHARED_BUILD = x1)
-
-AC_SUBST(RPATH_ENVVAR)
-
-AC_OUTPUT([Makefile library/Makefile src/Makefile])
-
-
-
diff --git a/libgui/library/Makefile.in b/libgui/library/Makefile.in
deleted file mode 100644
index e3f04396636..00000000000
--- a/libgui/library/Makefile.in
+++ /dev/null
@@ -1,395 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 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.
-
-@SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = library
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/../config/tcl.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-depcomp =
-am__depfiles_maybe =
-SOURCES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(guidir)"
-guiDATA_INSTALL = $(INSTALL_DATA)
-DATA = $(gui_DATA)
-ETAGS = etags
-CTAGS = ctags
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
-CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-IDE_ENABLED_FALSE = @IDE_ENABLED_FALSE@
-IDE_ENABLED_TRUE = @IDE_ENABLED_TRUE@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_LIBGUI_FALSE = @INSTALL_LIBGUI_FALSE@
-INSTALL_LIBGUI_TRUE = @INSTALL_LIBGUI_TRUE@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBGUI_CFLAGS = @LIBGUI_CFLAGS@
-LIBGUI_LIBRARY_DIR = @LIBGUI_LIBRARY_DIR@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-RPATH_ENVVAR = @RPATH_ENVVAR@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TCL_BIN_DIR = @TCL_BIN_DIR@
-TCL_DEFS = @TCL_DEFS@
-TCL_INCLUDES = @TCL_INCLUDES@
-TCL_LIBRARY = @TCL_LIBRARY@
-TCL_LIBS = @TCL_LIBS@
-TCL_LIB_FILE = @TCL_LIB_FILE@
-TCL_LIB_FLAG = @TCL_LIB_FLAG@
-TCL_LIB_SPEC = @TCL_LIB_SPEC@
-TCL_PATCH_LEVEL = @TCL_PATCH_LEVEL@
-TCL_SHARED_FALSE = @TCL_SHARED_FALSE@
-TCL_SHARED_TRUE = @TCL_SHARED_TRUE@
-TCL_SRC_DIR = @TCL_SRC_DIR@
-TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@
-TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@
-TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@
-TCL_VERSION = @TCL_VERSION@
-TK_BIN_DIR = @TK_BIN_DIR@
-TK_DEFS = @TK_DEFS@
-TK_INCLUDES = @TK_INCLUDES@
-TK_LIBRARY = @TK_LIBRARY@
-TK_LIBS = @TK_LIBS@
-TK_LIB_FILE = @TK_LIB_FILE@
-TK_LIB_FLAG = @TK_LIB_FLAG@
-TK_LIB_SPEC = @TK_LIB_SPEC@
-TK_SRC_DIR = @TK_SRC_DIR@
-TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@
-TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@
-TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@
-TK_VERSION = @TK_VERSION@
-TK_XINCLUDES = @TK_XINCLUDES@
-VERSION = @VERSION@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-AUTOMAKE_OPTIONS = cygnus
-TCL = advice.tcl balloon.tcl bbox.tcl bgerror.tcl bindings.tcl \
-canvas.tcl cframe.tcl center.tcl debug.tcl def.tcl internet.tcl \
-font.tcl gensym.tcl gettext.tcl hooks.tcl lframe.tcl list.tcl \
-looknfeel.tcl menu.tcl mono.tcl multibox.tcl parse_args.tcl path.tcl \
-postghost.tcl prefs.tcl print.tcl sendpr.tcl topbind.tcl toolbar.tcl \
-ulset.tcl wframe.tcl wingrab.tcl ventry.tcl combobox.tcl \
-pane.tcl panedwindow.tcl
-
-PACKAGES = combobox.tcl
-guidir = $(datadir)/redhat/gui
-gui_DATA = tclIndex pkgIndex.tcl $(TCL) $(PACKAGES)
-@CROSS_COMPILING_FALSE@TCLSH = @TCLSH@
-@CROSS_COMPILING_TRUE@TCLSH = tclsh8.4
-ETAGS_ARGS = --lang=none --regex='/[ \t]*\(proc\|method\|itcl_class\)[ \t]+\([^ \t]+\)/\1/' $(TCL) --lang=auto
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign library/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign library/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-uninstall-info-am:
-install-guiDATA: $(gui_DATA)
- @$(NORMAL_INSTALL)
- test -z "$(guidir)" || $(mkdir_p) "$(DESTDIR)$(guidir)"
- @list='$(gui_DATA)'; for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(guiDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(guidir)/$$f'"; \
- $(guiDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(guidir)/$$f"; \
- done
-
-uninstall-guiDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(gui_DATA)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(guidir)/$$f'"; \
- rm -f "$(DESTDIR)$(guidir)/$$f"; \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-am:
-check: check-am
-all-am: Makefile $(DATA)
-installdirs:
- for dir in "$(DESTDIR)$(guidir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am: install-guiDATA
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-guiDATA
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- ctags distclean distclean-generic distclean-tags dvi dvi-am \
- html html-am info info-am install install-am install-data \
- install-data-am install-exec install-exec-am install-guiDATA \
- install-info install-info-am install-man install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
- pdf-am ps ps-am tags uninstall uninstall-am uninstall-guiDATA \
- uninstall-info-am
-
-
-@MAINTAINER_MODE_TRUE@tclIndex: $(TCL)
-@MAINTAINER_MODE_TRUE@ echo "package require Itcl; auto_mkindex $(LIBGUI_LIBRARY_DIR) $(TCL)" | $(TCLSH)
-@MAINTAINER_MODE_FALSE@tclIndex:
-# 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:
diff --git a/libgui/src/Makefile.in b/libgui/src/Makefile.in
deleted file mode 100644
index ef293de18cf..00000000000
--- a/libgui/src/Makefile.in
+++ /dev/null
@@ -1,499 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 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.
-
-@SET_MAKE@
-
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-DIST_COMMON = $(srcdir)/tkTable_version.in $(srcdir)/Makefile.in \
- $(srcdir)/Makefile.am $(am__include_HEADERS_DIST)
-subdir = src
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/../config/tcl.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-libgui_a_AR = $(AR) $(ARFLAGS)
-libgui_a_LIBADD =
-am__objects_1 = tkTable.$(OBJEXT) tkTableCell.$(OBJEXT) \
- tkTableCellSort.$(OBJEXT) tkTableCmds.$(OBJEXT) \
- tkTableEdit.$(OBJEXT) tkTableTag.$(OBJEXT) \
- tkTableWin.$(OBJEXT) tkTableUtil.$(OBJEXT)
-am_libgui_a_OBJECTS = subcommand.$(OBJEXT) tclwinprint.$(OBJEXT) \
- tclshellexe.$(OBJEXT) paths.$(OBJEXT) tclwingrab.$(OBJEXT) \
- tclwinpath.$(OBJEXT) tclmsgbox.$(OBJEXT) tclcursor.$(OBJEXT) \
- tkWinPrintText.$(OBJEXT) tkWinPrintCanvas.$(OBJEXT) \
- tkWarpPointer.$(OBJEXT) $(am__objects_1)
-libgui_a_OBJECTS = $(am_libgui_a_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(libgui_a_SOURCES)
-am__include_HEADERS_DIST = guitcl.h subcommand.h
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(includedir)"
-includeHEADERS_INSTALL = $(INSTALL_HEADER)
-HEADERS = $(include_HEADERS)
-ETAGS = etags
-CTAGS = ctags
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
-CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-IDE_ENABLED_FALSE = @IDE_ENABLED_FALSE@
-IDE_ENABLED_TRUE = @IDE_ENABLED_TRUE@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_LIBGUI_FALSE = @INSTALL_LIBGUI_FALSE@
-INSTALL_LIBGUI_TRUE = @INSTALL_LIBGUI_TRUE@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBGUI_CFLAGS = @LIBGUI_CFLAGS@
-LIBGUI_LIBRARY_DIR = @LIBGUI_LIBRARY_DIR@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-RPATH_ENVVAR = @RPATH_ENVVAR@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TCL_BIN_DIR = @TCL_BIN_DIR@
-TCL_DEFS = @TCL_DEFS@
-TCL_INCLUDES = @TCL_INCLUDES@
-TCL_LIBRARY = @TCL_LIBRARY@
-TCL_LIBS = @TCL_LIBS@
-TCL_LIB_FILE = @TCL_LIB_FILE@
-TCL_LIB_FLAG = @TCL_LIB_FLAG@
-TCL_LIB_SPEC = @TCL_LIB_SPEC@
-TCL_PATCH_LEVEL = @TCL_PATCH_LEVEL@
-TCL_SHARED_FALSE = @TCL_SHARED_FALSE@
-TCL_SHARED_TRUE = @TCL_SHARED_TRUE@
-TCL_SRC_DIR = @TCL_SRC_DIR@
-TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@
-TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@
-TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@
-TCL_VERSION = @TCL_VERSION@
-TK_BIN_DIR = @TK_BIN_DIR@
-TK_DEFS = @TK_DEFS@
-TK_INCLUDES = @TK_INCLUDES@
-TK_LIBRARY = @TK_LIBRARY@
-TK_LIBS = @TK_LIBS@
-TK_LIB_FILE = @TK_LIB_FILE@
-TK_LIB_FLAG = @TK_LIB_FLAG@
-TK_LIB_SPEC = @TK_LIB_SPEC@
-TK_SRC_DIR = @TK_SRC_DIR@
-TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@
-TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@
-TK_STUB_LIB_SPEC = @TK_STUB_LIB_SPEC@
-TK_VERSION = @TK_VERSION@
-TK_XINCLUDES = @TK_XINCLUDES@
-VERSION = @VERSION@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-AUTOMAKE_OPTIONS = cygnus
-noinst_LIBRARIES = libgui.a
-@INSTALL_LIBGUI_TRUE@include_HEADERS = \
-@INSTALL_LIBGUI_TRUE@ guitcl.h subcommand.h
-
-guidir = $(datadir)/redhat/gui
-
-#if 0
-TBL_MAJOR_VERSION = 2
-TBL_MINOR_VERSION = 7
-TBL_VERSION = $(TBL_MAJOR_VERSION).$(TBL_MINOR_VERSION)
-
-# tkTable version info
-
-# This sets the name that tkTable will define for itself when loaded
-# If you change this, then the demos won't work, but it might be necessary
-# for those with another built-in "table" command
-TBL_COMMAND = table
-INCLUDES = $(LIBGUI_CFLAGS) $(TCL_INCLUDES) \
-$(TK_INCLUDES) $(TK_XINCLUDES) $(TCL_DEFS) $(TK_DEFS) \
--DTBL_VERSION=\"$(TBL_VERSION)\"\
--DTBL_COMMAND=\"$(TBL_COMMAND)\"\
--DTBL_RUNTIME=\"tkTable.tcl\" -DTBL_RUNTIME_DIR=\"$(guidir)\"\
--DSTATIC_BUILD
-
-TKTABLE_SOURCES = tkTable.c tkTableCell.c tkTableCellSort.c \
-tkTableCmds.c tkTableEdit.c tkTableTag.c tkTableWin.c tkTableUtil.c
-
-libgui_a_SOURCES = guitcl.h subcommand.c subcommand.h \
-tclwinprint.c tclshellexe.c paths.c \
-tclwingrab.c tclwinpath.c tclmsgbox.c tclcursor.c \
-tkWinPrintText.c tkWinPrintCanvas.c tkWarpPointer.c $(TKTABLE_SOURCES)
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/tkTable_version.in $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libgui.a: $(libgui_a_OBJECTS) $(libgui_a_DEPENDENCIES)
- -rm -f libgui.a
- $(libgui_a_AR) libgui.a $(libgui_a_OBJECTS) $(libgui_a_LIBADD)
- $(RANLIB) libgui.a
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c $<
-
-.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
-install-includeHEADERS: $(include_HEADERS)
- @$(NORMAL_INSTALL)
- test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
- @list='$(include_HEADERS)'; for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
- $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
- done
-
-uninstall-includeHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(include_HEADERS)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
- rm -f "$(DESTDIR)$(includedir)/$$f"; \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-am:
-check: check-am
-all-am: Makefile $(LIBRARIES) $(HEADERS)
-installdirs:
- for dir in "$(DESTDIR)$(includedir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am: install-includeHEADERS
-
-install-exec-am: install-exec-local
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-includeHEADERS
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-noinstLIBRARIES ctags distclean distclean-compile \
- distclean-generic distclean-tags dvi dvi-am html html-am info \
- info-am install install-am install-data install-data-am \
- install-exec install-exec-am install-exec-local \
- install-includeHEADERS install-info install-info-am \
- install-man install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
- ps ps-am tags uninstall uninstall-am uninstall-includeHEADERS \
- uninstall-info-am
-
-#endif
-#define TBL_MAJOR_VERSION 2
-#define TBL_MINOR_VERSION 7
-#define TBL_VERSION "2.7"
-
-tkTable.tcl.h: $(srcdir)/tkTable.tcl
- sed -e '/^$\#/d' -e '/^$$/d' -e 's/\"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' <$(srcdir)/tkTable.tcl >tkTable.tcl.h || rm tkTable.tcl.h
-
-# Defining lib_LIBRARIES conditionally doesn't do the right thing.
-install-exec-local:
-@INSTALL_LIBGUI_TRUE@ @$(NORMAL_INSTALL)
-@INSTALL_LIBGUI_TRUE@ $(mkinstalldirs) $(libdir)
-@INSTALL_LIBGUI_TRUE@ $(INSTALL_DATA) libgui.a $(libdir)/libgui.a
-@INSTALL_LIBGUI_TRUE@ @$(POST_INSTALL)
-@INSTALL_LIBGUI_TRUE@ $(RANLIB) $(libdir)/libgui.a
-
-paths.$(OBJEXT): paths.c guitcl.h
-subcommand.$(OBJEXT): subcommand.c subcommand.h
-tkCanvEdge.$(OBJEXT): tkCanvEdge.c ../config.h
-tkCanvLayout.$(OBJEXT): tkCanvLayout.c ../config.h tkCanvLayout.h
-tkGraphCanvas.$(OBJEXT): tkGraphCanvas.c tkCanvLayout.h
-xpmlib.$(OBJEXT): xpmlib.c guitcl.h
-assertions.$(OBJEXT): assertions.c ../config.h assertions.h
-tclcursor.$(OBJEXT): tclcursor.c ../config.h guitcl.h subcommand.h
-tclhelp.$(OBJEXT): tclhelp.c ../config.h guitcl.h subcommand.h
-tclgetdir.$(OBJEXT): tclgetdir.c guitcl.h
-tclmain.$(OBJEXT): tclmain.c guitcl.h
-tclwinprint.$(OBJEXT): tclwinprint.c guitcl.h subcommand.h
-tclsizebox.$(OBJEXT): tclsizebox.c guitcl.h
-tclshellexe.$(OBJEXT): tclshellexe.c guitcl.h
-tclmapi.$(OBJEXT): tclmapi.c guitcl.h subcommand.h
-tclwinfont.$(OBJEXT): tclwinfont.c guitcl.h
-tclwingrab.$(OBJEXT): tclwingrab.c guitcl.h
-tclwinpath.$(OBJEXT): tclwinpath.c guitcl.h subcommand.h
-tclwinmode.$(OBJEXT): tclwinmode.c guitcl.h
-tkTable.$(OBJEXT): tkTable.c tkTable.h tkTableInitScript.h tkTable.tcl.h
-tkTableCell.$(OBJEXT): tkTableCell.c tkTable.h
-tkTableCellSort.$(OBJEXT): tkTableCellSort.c tkTable.h
-tkTableCmds.$(OBJEXT): tkTableCmds.c tkTable.h
-tkTableEdit.$(OBJEXT): tkTableEdit.c tkTable.h
-tkTableTag.$(OBJEXT): tkTableTag.c tkTable.h
-tkTablePs.$(OBJECT): tkTablePs.c tkTable.h
-tkTableWin.$(OBJEXT):tkTableWin.c tkTable.h
-tkTableUtil.$(OBJEXT): tkTableUtil.c tkTable.h
-tkTable.tcl.h: tkTable.tcl
-# 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:
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
deleted file mode 100644
index 9e31b2a0592..00000000000
--- a/winsup/cygwin/ChangeLog
+++ /dev/null
@@ -1,2551 +0,0 @@
-2008-08-05 Christopher Faylor <me+cygwin@cgf.cx>
-
- * dll_init.cc (dll_global_dtors): Add an additional test to avoid
- walking the linked list if it is empty.
- (dll_list::detach): Don't set dll_global_dtors_recorded if we aren't
- actually going to record any dlls.
-
-2008-08-04 Christopher Faylor <me+cygwin@cgf.cx>
-
- Changes suggested by Dave Korn.
- * dcrt0.cc (cygwin_exit): Remove (hopefully) extraneous call to
- dll_global_dtors.
- * dll_init.cc (dll_global_dtors): Run destructors in reverse
- dependency/load order.
- * dll_init.h (dll_list): Add dll_global_dtors as a friend.
-
-2008-08-01 Christopher Faylor <me+cygwin@cgf.cx>
-
- * dcrt0.cc (dll_crt0_1): Add a symbol denoting return from call to
- main().
- * exceptions.cc (stack_info::walk): Stop walking the stack when we
- hit _cygwin_exit_return rather than just blindly stopping when PC
- becomes zero.
-
-2008-07-31 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (symlink_info::check): Handle (and explain) a special case
- when accessing files matching DOS device names on SMB shares.
-
-2008-07-31 Corinna Vinschen <corinna@vinschen.de>
-
- * spawn.cc (spawn_guts): Check constructed short pathname for being
- a DOS device name and fall back to long path name, if so.
-
-2008-07-30 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_base::fstat_by_name): Check for
- file systems incapable of handling FileIdBothDirectoryInformation
- correctly.
- (fhandler_disk_file::opendir): Ditto.
- * path.cc (fs_info::update): Always clear at the start.
- Rearrange to make certain tests only on non-Samba, non-NFS remote
- drives.
- Add test for file systems known to be incapable of handling
- FileIdBothDirectoryInformation correctly. Right now that's just
- "UNIXFS".
- * path.h (struct fs_info): Add has_buggy_fileid_dirinfo flag and
- accessor methods.
- (class path_conv): Add has_buggy_fileid_dirinfo method.
-
-2008-07-30 Corinna Vinschen <corinna@vinschen.de>
-
- * sec_auth.cc (extract_nt_dom_user): Return domain and user name as
- WCHAR.
- (cygwin_logon_user): Accommodate above change. Convert password to
- WCHAR and call LogonUserW.
- * external.cc (cygwin_internal): Accommodate above change.
- * security.h (extract_nt_dom_user): Change prototype accordingly.
-
-2008-07-30 Christopher Faylor <me+cygwin@cgf.cx>
-
- * cygwin.din (_getutline): Remove.
- * lib/bsdlib.cc (login): Make argument const as per linux.
- (logout): Ditto.
- * syscalls.cc (getutid): Ditto.
- (getutline): Ditto.
- (pututline): Ditto.
- (getutxent): Add comment mentioning non-thread-safety.
- (getutxid): Ditto.
- (getutxline): Ditto.
- (pututxline): Ditto.
- * sys/utmp.h: Declare arguments to various functions as const as per
- linux. Remove bogus _getutline definition.
-
-2008-07-29 Christopher Faylor <me+cygwin@cgf.cx>
-
- * include/cygwin/version.h: Add comment indicating that current API number
- bump also has another consequence.
-
-2008-07-29 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (DLL_OFILES): Remove v8 regexp files.
- (OBSOLETE_FUNCTIONS): Remove v8 regexp functions.
- (NEW_FUNCTIONS): Remove POSIX regex functions.
- * cygwin.din: Export POSIX regex functions with their correct symbol
- name. Export with posix_ prefix for backward compatibility.
- * syscalls.cc (regfree): Remove ancient fake function.
- * regex/regex.h: Remove renaming regex functions within Cygwin.
- * regexp/*: Remove.
- * include/cygwin/version.h: Bump API minor number.
-
-2008-07-27 Corinna Vinschen <corinna@vinschen.de>
- Christopher Faylor <me+cygwin@cgf.cx>
-
- * dcrt0.cc (dll_crt0_0): Remove calling malloc_init and
- user_shared_initialize_1 from here.
- (dll_crt0_1): Remove dynamically_loaded check. Just call malloc_init
- and user_shared_initialize unconditionally.
- * shared.cc (user_shared_create): Rename from user_shared_initialize.
- (user_shared_initialize): Rename from user_shared_initialize_1. Move
- complete user_shared content initialization code here from
- user_shared_create.
- * syscalls.cc (seteuid32): Remove call to user_shared_initialize_1.
- That is implied by the "true" argument to user_shared_create().
-
-2008-07-27 Christopher Faylor <me+cygwin@cgf.cx>
-
- * mount.cc (mount_info::init): Add location where we're looking for
- fstab to temporary message.
-
- * lib/cygwin_crt0.c (cygwin_crt0): Simplify by eliminating
- accommodations for ancient cygwin DLLs.
- * lib/crt0.h: Include <windows.h> directly since it is needed.
-
-2008-07-27 Christopher Faylor <me+cygwin@cgf.cx>
-
- * shared_info.h (shared_destroy): Declare.
- * shared.cc (shared_destroy): Define new function to destroy shared
- memory regions.
- * init.cc (dll_entry): Call shared_destroy when dll detaches from the
- process.
-
-2008-07-27 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_socket.cc (fhandler_socket::send_internal): Send never more
- then 64K bytes at once. For blocking sockets, loop until entire data
- has been sent or an error occurs.
- (fhandler_socket::sendto): Drop code which sends on 64K bytes.
- (fhandler_socket::sendmsg): Ditto.
-
-2008-07-26 Christopher Faylor <me+cygwin@cgf.cx>
-
- * fhandler_tty.cc (fhandler_pty_master::setup): Reorganize so that all
- operations for each end of the pipe are grouped together.
-
-2008-07-25 Corinna Vinschen <corinna@vinschen.de>
-
- * dcrt0.cc (dll_crt0_1): Call malloc_init and user_shared_initialize_1
- only in non-dynamically loaded case.
-
-2008-07-25 Corinna Vinschen <corinna@vinschen.de>
-
- * dcrt0.cc (dll_crt0_0): Call malloc_init and user_shared_initialize_1
- here in case we're dynamically loaded. Explain why.
- (dll_crt0_1): Call user_shared_initialize_1 from here.
- * mount.cc (is_native_path): New inline function testing for native
- and long Win32 path prefix.
- (is_unc_share): Remove long WIn32 path prefix test.
- (mount_info::create_root_entry): Use PATH_MAX buffer.
- (mount_info::init): Ditto.
- (mount_info::add_item): Test for is_native_path as well.
- * path.cc (normalize_win32_path): Simplify native path prefix code.
- * shared.cc (user_shared_initialize_1): New function taking user
- shared initialization code relying on malloc and cygtls.
- (user_shared_initialize): Move mountinfo initialization to
- user_shared_initialize_1.
- * shared_info.h (user_shared_initialize_1): Declare.
- * syscalls.cc (seteuid32): Call user_shared_initialize_1 after user
- changed.
-
-2008-07-24 Corinna Vinschen <corinna@vinschen.de>
-
- * mount.cc (mount_info::from_fstab): Change system_printf to
- debug_printf on NtOpenFile failure.
-
-2008-07-24 Corinna Vinschen <corinna@vinschen.de>
-
- * shared.cc (user_shared_initialize): Fetch potentially changed Cygwin
- username from /etc/passwd before loading mount table.
- (shared_info::init_installation_root): New function fetching Cygwin's
- installation root dir and storing as native NT path in global shared
- memory.
- (shared_info::initialize): Call init_installation_root exactly once at
- first startup.
- * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
- (CURR_SHARED_MAGIC): Ditto.
- (class shared_info): Add installation_root member.
- (shared_info::init_installation_root): Declare.
-
- * grp.cc (pwdgrp::read_group): Call pwdgrp::load with native WCHAR path.
- * passwd.cc (pwdgrp::read_passwd): Ditto. Avoid recursion.
- (etc::init): Take POBJECT_ATTRIBUTES instead of path_conv.
- * path.h (etc::init): Change prototype accordingly.
- * pwdgrp.h (class pwdgrp): Store path as UNICODE_STRING/PWCHAR instead
- of as path_conv.
- (pwdgrp::load): Accommodate prototype.
- * uinfo.cc (pwdgrp::load): Change argument type from char to wchar_t.
- Create native NT path here instead of calling path_conv.
-
- * mount.cc (find_root_from_cygwin_dll): Drop in favor of global
- initializaion in shared_info.
- (mount_info::init): Fetch native NT root dir from cygwin_shared.
- (mount_info::from_fstab): Expect native NT path and use native NT
- functions to access file. Convert username part in user fstab path
- according to special char transformation rules.
- * path.cc (tfx_chars): Convert slash to backslash.
- (transform_chars): Implement for path given as PWCHAR.
- (transform_chars): PUNICODE_STRING version calls PWCHAR version.
- Remove useless commented code.
-
-2008-07-22 Corinna Vinschen <corinna@vinschen.de>
-
- * spawn.cc (spawn_guts): Fix previous patch for UNC paths.
-
-2008-07-22 Corinna Vinschen <corinna@vinschen.de>
-
- * spawn.cc (spawn_guts): Remove long path prefix from win32 path
- before calling CreateProcess if path length is < MAX_PATH.
-
-2008-07-22 Corinna Vinschen <corinna@vinschen.de>
-
- * include/ctype.h: Declare __ctype_ptr__ to keep newlib build happy.
-
-2008-07-19 Corinna Vinschen <corinna@vinschen.de>
-
- * autoload.cc (WNetGetProviderNameA): Define.
- (WNetGetResourceParentA): Remove.
- * fhandler_netdrive.cc (struct net_hdls): New structure to keep
- WNet handles. Stored in dir->__handle throughout.
- (thread_netdrive): Rewrite to enumerate all servers in all accessible
- domains and workgroups.
- (fhandler_netdrive::readdir): Simplify toplevel code. Lowercase all
- server names in toplevel.
- (fhandler_netdrive::rewinddir): Close all WNet handles and free
- net_hdls structure.
-
-2008-07-18 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.cc (fhandler_base::open): Rename x to fh. On Samba, always
- create file with NULL security descriptor and set the permissions
- afterwards. Explain why.
-
-2008-07-18 Corinna Vinschen <corinna@vinschen.de>
-
- * environ.cc (known): Remove "binmode" option.
- * fhandler.cc (binmode): Remove.
- (fhandler_base::set_flags): Accommodate binmode removal.
- * path.h (path_conv::set_binary): Remove.
- * pipe.cc (pipe): Create pipes always as binary pipes.
- * winsup.h (binmode): Remove declaration.
-
-2008-07-17 Corinna Vinschen <corinna@vinschen.de>
-
- * mount.cc (mount_info::from_fstab_line): Default to binary mount.
-
-2008-07-16 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (allow_winsymlinks): Revert default to create system bit
- symlinks for speed.
-
-2008-07-16 Corinna Vinschen <corinna@vinschen.de>
-
- Add case-sensitivity.
- Unconditionally handle mount points case-sensitive.
- Unconditionally handle virtual paths case-sensitive.
- Unconditionally handle registry paths case-insensitive.
- Otherwise, accommodate case-sensitivity of given path throughout.
- * cygheap.cc (cygheap_root::set): Get additional caseinsensitive
- parameter and store it.
- * cygheap.h (struct cygheap_root_mount_info): Add member
- caseinsensitive.
- * dlfcn.cc (get_full_path_of_dll): Drop PC_NOFULL parameter from call
- to path_conv::check.
- * environ.cc (pcheck_case): Remove.
- (check_case_init): Remove.
- (known): Drop "check_case" option.
- * exceptions.cc (open_stackdumpfile): Add comment.
- * fhandler.cc (fhandler_base::get_default_fmode): Call pathmatch
- instead of strcasematch.
- * fhandler_disk_file.cc: Accommodate case-sensitivity of given path
- throughout.
- (__DIR_mounts::check_mount): Unconditionally check virtual paths
- case-sensitive.
- (fhandler_disk_file::link): Drop case clash handling.
- (fhandler_disk_file::open): Ditto.
- (fhandler_disk_file::readdir_helper): Drop managed mount code.
- * mount.cc: Remove managed mount code and datastructures.
- (struct opt): Remove "managed" option. Add "posix=0" and "posix=1"
- options.
- (fillout_mntent): Remove "managed" output. Add "posix" output.
- * path.cc (struct symlink_info): Remove case_clash member and
- case_check method.
- (pcheck_case): Remove.
- (path_prefix_p): Take additional bool parameter "caseinsensitive".
- (pathnmatch): Ditto.
- (pathmatch): Ditto.
- (mkrelpath): Ditto.
- (fs_info::update): Set caseinsensitive flag according to file system
- name and FILE_CASE_SENSITIVE_SEARCH flag. Add comment.
- (tfx_chars_managed): Remove.
- (transform_chars): Drop "managed" parameter. Always use tfx_chars.
- (get_nt_native_path): Drop "managed" parameter. Make sure drive letters
- are always upper case.
- (getfileattr): Change second parameter to denote caseinsensitivity.
- (path_conv::check): Initialize caseinsensitive to OBJ_CASE_INSENSITIVE.
- Set caseinsensitive according to global obcaseinsensitive flag, file
- system case sensitivity and MOUNT_NOPOSIX mount flag.
- Drop case_clash and all the related code.
- (symlink_worker): Drop case clash handling.
- (symlink_info::set): Drop setting case_clash.
- (symlink_info::case_check): Remove.
- (cwdstuff::set): Add comment.
- (etc::init): Take path_conv instead of PUNICODE_STRING as parameter to
- allow case sensitivity.
- * path.h (enum pathconv_arg): Drop PC_SYM_IGNORE.
- (enum case_checking): Remove.
- (enum path_types): Drop PATH_ENC, add PATH_NOPOSIX flag.
- (struct fs_info): Add caseinsensitive flag and accessor methods.
- (class path_conv): Add caseinsensitive member and define
- objcaseinsensitive method. Drop case_clash member and isencoded method.
- (pathmatch): Change prototype according to above change.
- (pathnmatch): Ditto.
- (path_prefix_p): Ditto.
- (get_nt_native_path): Ditto.
- (class etc): Ditto.
- (fnunmunge): Remove prototype.
- * shared.cc (shared_info::init_obcaseinsensitive): Initialize
- obcaseinsensitive flag from obcaseinsensitive registry value.
- (shared_info::initialize): Call init_obcaseinsensitive here by the
- first process creating the shared memory.
- * shared_info.h (mount_item::fnmunge): Remove.
- (shared_info::obcaseinsensitive): Rename from obcaseinsensitivity.
- (shared_info::init_obcaseinsensitive): Declare.
- * syscalls.cc (try_to_bin): Add comment.
- * include/sys/mount.h (MOUNT_ENC): Remove flag.
- (MOUNT_NOPOSIX): Add flag.
-
-2008-07-15 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_tape.cc (mtinfo::initialize): Remove synchronization stuff.
- Just initialize drive data.
- * mtinfo.h (MTINFO_MAGIC): Remove.
- (MTINFO_VERSION): Remove.
- (class mtinfo): Remove magic and version members.
- * shared.cc (shared_info::initialize): Move call to
- get_session_parent_dir so that the dir creation is only called once.
- Move call to mt.initialize so that it's called only by the first
- process creating the shared memory.
- * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
- (CURR_SHARED_MAGIC): Ditto.
- (class shared_info): Add obcaseinsensitivity member.
-
-2008-07-14 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.cc (fhandler_base::fpathconf): On _PC_POSIX_PERMISSIONS
- and _PC_POSIX_SECURITY, return true for NFS, too.
-
-2008-07-14 Corinna Vinschen <corinna@vinschen.de>
-
- Throughout drop allow_ntsec and allow_smbntsec handling.
- * environ.cc (set_ntsec): Remove.
- (set_smbntsec): Remove.
- (known): Remove ntsec and smbntsec options.
- * external.cc (check_ntsec): Return true if no filename is given.
- * mount.cc (oopts): Add "acl" and "noacl" options. Set MOUNT_NOACL
- flag accordingly.
- (fillout_mntent): Handle MOUNT_NOACL flag.
- * path.h (enum path_types): Add PATH_NOACL.
- * security.cc (allow_ntsec): Remove.
- (allow_smbntsec): Remove.
- * security.h (allow_ntsec): Drop declaration.
- (allow_smbntsec): Drop declaration.
- * include/sys/mount.h (MOUNT_NOACL): Define.
-
-2008-07-14 Corinna Vinschen <corinna@vinschen.de>
-
- * miscfuncs.cc (cygwin_strncasecmp): Fix bug which results in
- prematurely truncated strings. Simplify target length argument to
- sys_mbstowcs.
-
-2008-07-14 Corinna Vinschen <corinna@vinschen.de>
-
- * autoload.cc (GetExtendedTcpTable): Define.
- * fhandler_socket.cc (address_in_use): Take const struct sockaddr
- pointer as argument. Implement additional AF_INET6 table check.
- (fhandler_socket::bind): Drop AF_INET test before calling
- address_in_use.
- * net.cc (ipv4_getnameinfo): Return EAI_FAMILY instead of 1 if
- called with unsupported af_family.
-
-2008-07-12 Eric Blake <ebb9@byu.net>
-
- Fix usage of recently fixed Interlocked* functions.
- * winbase.h (ilockincr, ilockdecr, ilockexch, ilockcmpexch): Add
- volatile qualifier, to match Interlocked* functions.
-
-2008-07-11 Corinna Vinschen <corinna@vinschen.de>
-
- * select.cc (peek_pipe): Temporarily revert patch from 2008-05-30.
-
-2008-07-11 Corinna Vinschen <corinna@vinschen.de>
-
- Change length for domain buffers from INTERNET_MAX_HOST_NAME_LENGTH to
- MAX_DOMAIN_NAME_LEN throughout.
- * cyglsa.h (CYG_LSA_MAGIC): New value.
- (cyglsa_t): Define username and domain as WCHAR arrays.
- * errno.cc (errmap): Add mapping for ERROR_NONE_MAPPED.
- * sec_auth.cc: Drop 'w' prefix from WCHAR string variable names where
- appropriate.
- (extract_nt_dom_user): Prefer resolving by SID before resolving by
- domain\name pair.
- (cygwin_logon_user): Don't print cleartext password in debug output.
- Change comment.
- (get_user_groups): Revert calls to LookupAccountNameW to use NULL
- server instead of explicit server name, according to MSDN.
- (get_user_local_groups): Ditto.
- (get_server_groups): Fetch domain and user name from usersid per
- LookupAccountSidW instead of calling extract_nt_dom_user.
- (lsaauth): Fetch domain and user name from usersid per LookupAccountSidW
- instead of calling extract_nt_dom_user.
- * sec_helper.cc (cygpriv): Convert to wchar_t pointer array.
- (privilege_luid): Convert first parameter to PWCHAR.
- (privilege_name): Return wchar_t pointer.
- (set_privileges): Accommodate debug output.
- * security.h (privilege_luid): Change prototype accordingly.
-
-2008-07-10 Corinna Vinschen <corinna@vinschen.de>
-
- * cyglsa.h (SECURITY_STRING): Define.
- (enum _SECPKG_NAME_TYPE): Define.
- (struct _SECPKG_CALL_INFO): Define.
- (struct _LSA_SECPKG_FUNCS): Extend to full size. Define unused
- functions lazily.
- (cygprf_t): Define.
- * sec_auth.cc (lsaauth): Use actual primary group if no admins group.
- Add (disabled) code to fetch token from profil data.
-
-2008-07-09 Corinna Vinschen <corinna@vinschen.de>
-
- * sec_auth.cc (verify_token): Allow builtin groups missing in a token
- and it's still valid. Explain why.
-
-2008-07-09 Corinna Vinschen <corinna@vinschen.de>
-
- * autoload.cc (DsGetDcNameW): Replace DsGetDcNameA.
- * dcrt0.cc (child_info_spawn::handle_spawn): Drop artificial
- supplementary group list from calling setgroups in parent.
- * grp.cc (internal_getgroups): Drop 9x-only code. Reformat.
- * sec_auth.cc (get_logon_server): Do everything in WCHAR only.
- (get_user_groups): Ditto. Use wlogonserver in LookupAccountNameW
- calls, too.
- (is_group_member): Get logon server as first argument and use in call
- to NetLocalGroupGetMembers.
- (get_user_local_groups): Get logon server as first argument and use in
- calls to NetLocalGroupEnum and LookupAccountNameW. Revamp to work
- more correctly in domain environments.
- (get_server_groups): Accommodate aforementioned changed function calls.
- * security.h (get_logon_server): Change prototype accordingly.
- * uinfo.cc (cygheap_user::env_logsrv): Accommodate changed
- get_logon_server call.
-
-2008-07-09 Corinna Vinschen <corinna@vinschen.de>
-
- * grp.cc (internal_getgroups): Also add integrity-enabled groups.
-
-2008-07-09 Corinna Vinschen <corinna@vinschen.de>
-
- * sec_auth.cc (verify_token): Disable code which returns false if
- the token contains additional groups not requested by setgroups.
- Explain why.
-
-2008-07-08 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_socket.cc (fhandler_socket::bind): Don't run explicit
- local socket test in SO_REUSEADDR case on systems supporting
- enhanced socket security. Explain why. Only call address_in_use
- for AF_INET sockets.
- * net.cc (cygwin_setsockopt): Don't call setsockopt to set SO_REUSEADDR
- on systems supporting enhanced socket security. Add comment.
- * wincap.h (wincaps::has_enhanced_socket_security): New element.
- * wincap.cc: Implement above element throughout.
-
-2008-07-08 Corinna Vinschen <corinna@vinschen.de>
-
- * net.cc (ipv6_inited): Make NO_COPY.
-
-2008-07-02 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (path_conv::is_binary): Fix test. Add comment.
-
-2008-06-24 Corinna Vinschen <corinna@vinschen.de>
-
- * net.cc (cygwin_bindresvport_sa): Fix usage of last_used_bindresvport.
-
-2008-06-21 Corinna Vinschen <corinna@vinschen.de>
-
- * include/limits.h (PATH_MAX): Add comment.
- * include/cygwin/config.h (__FILENAME_MAX__): Define as 4096. Add
- comment.
-
-2008-06-19 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_tty.cc (fhandler_pty_master::setup): Fix pipe inheritance.
-
-2008-06-18 Christopher Faylor <me+cygwin@cgf.cx>
-
- * strsig.cc (strsignal): Return non-const buffer to allow building with
- recent newlib change.
-
-2008-06-17 Corinna Vinschen <corinna@vinschen.de>
-
- * sec_auth.cc (DsGetDcNameA): Drop declaration.
- (DS_FORCE_REDISCOVERY): Drop definition.
-
-2008-06-17 Christopher Faylor <me+cygwin@cgf.cx>
-
- * spawn.cc (spawn_guts): Reinstate call to
- fhandler_console::need_invisible since it is required to prevent
- console flashing.
-
-2008-06-17 Corinna Vinschen <corinna@vinschen.de>
-
- * include/resolv.h (_getshort): Drop declaration.
- (_getlong): Ditto.
-
-2008-06-12 Corinna Vinschen <corinna@vinschen.de>
-
- * mount.cc (mount_info::get_cygdrive_info): Fix usage of user and
- system arguments. Strip trailing slash from path for backward
- compatibility.
-
-2008-06-12 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.h (set_console_state_for_spawn): Drop declaration.
- * fhandler_console.cc (set_console_state_for_spawn): Remove.
- (fhandler_console::open): Set console state last. Don't set
- ENABLE_PROCESSED_INPUT flag.
- * spawn.cc (spawn_guts): Drop call to set_console_state_for_spawn.
-
-2008-06-11 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (get_nt_native_path): Drop considerations for DOS devices.
- Keep relative paths relative.
- (cygwin_conv_path): Don't try to skip native NT prefixes on relative
- paths.
-
-2008-06-11 Corinna Vinschen <corinna@vinschen.de>
-
- * include/cygwin/version.h (CYGWIN_VERSION_MOUNT_REGISTRY): Bump.
- (CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME): Remove.
- (CYGWIN_INFO_CYGDRIVE_FLAGS): Remove.
- (CYGWIN_INFO_CYGDRIVE_PREFIX): Remove.
- (CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX): Add comment to differ from the
- registry related defines.
-
-2008-06-11 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_procnet.cc (dad_to_flags): Fix comment.
-
-2008-06-10 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_procnet.cc (get_scope): New static function to evaluate
- scope.
- (dad_to_flags): New static array to convert Windows DAD state to
- Linux values.
- (format_procnet_ifinet6): Drop asking for IfIndex, just use Ipv6IfIndex.
- Use get_scope and dad_to_flags to generate more accurate linux-like
- output.
-
-2008-06-10 Corinna Vinschen <corinna@vinschen.de>
-
- * net.cc (if_nametoindex): Fix typo in call to get_adapters_addresses.
- (if_indextoname): Prefer IPv6 loopback device name over IPv4 loopback
- device name on pre-Vista systems.
- (if_nameindex): Ditto.
-
-2008-06-10 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_procnet.cc (format_procnet_ifinet6): Use sprintf rather than
- __small_sprintf.
- * net.cc (if_nametoindex): Prefer IPv6IfIndex over IfIndex for
- consistency with /proc/net/if_inet6.
- (if_indextoname): Ditto.
- (if_nameindex): Ditto.
-
-2008-06-10 Corinna Vinschen <corinna@vinschen.de>
-
- * mount.cc (mount_info::from_fstab): Read sizeof (buf) - 2 bytes.
- Add code to handle overly long lines.
-
-2008-06-10 Corinna Vinschen <corinna@vinschen.de>
-
- * sec_auth.cc (lsaauth): Make returned token inheritable.
-
-2008-06-10 Corinna Vinschen <corinna@vinschen.de>
-
- * devices.cc: Regenerate.
-
-2008-06-09 Christopher Faylor <me+cygwin@cgf.cx>
-
- * devices.in: Remove "Global" from tty device.
-
-008-06-09 Eric Blake <ebb9@byu.net>
-
- * signal.cc (abort): Only flush streams after signal handler.
-
-2008-06-02 Christopher Faylor <me+cygwin@cgf.cx>
-
- * cygwin.sc: Remove unrequired and erroneous definition.
-
-2008-05-30 Christopher Faylor <me+cygwin@cgf.cx>
-
- * select.cc (peek_pipe): Semi-reinstate pipe NT-special write
- detection.
-
-2008-05-29 Christopher Faylor <me+cygwin@cgf.cx>
-
- * devices.in: Change mapping for /dev/ttyS* and /dev/com*.
- * devices.cc: Regenerate.
-
-2008-05-25 Christopher Faylor <me+cygwin@cgf.cx>
-
- * mount.cc (mount_info::from_fstab): Use proper buffer size.
-
-2008-05-24 Christopher Faylor <me+cygwin@cgf.cx>
-
- * mount.cc (mount_info::init): Revert previous change.
- (mount_info::from_fstab): Change system_printf to debug_printf. Just
- use a local NT_MAX_PATH sized temporary buffer.
-
-2008-05-24 Corinna Vinschen <corinna@vinschen.de>
-
- * mount.cc (mount_info::init): Recreate path when trying to read the
- user fstab file.
-
-2008-05-24 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (symlink_info::check): Reorder test for nfs symlinks.
-
-2008-05-23 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_disk_file::opendir): Don't try to
- use FileIdBothDirectoryInformation on NFS shares. Fix comment to
- explain why.
- * path.cc (symlink_info::check): Reinstantiate no_ea. Use in
- erroneously changed condition.
-
-2008-05-23 Christopher Faylor <me+cygwin@cgf.cx>
-
- * mount.cc (find_root_from_cygwin_dll): New function factored from
- from_fstab. Avoid use of tls since it isn't necessarily initialized
- when cygwin1.dll is dynamically loaded.
- (mount_info::create_root_entry): Ditto.
- (mount_info::init): Calculate cygwin root once. Use create_root_entry
- to record it. Pass fstab location to from_fstab.
- (mount_info::from_fstab): Move root calculation stuff elsewhere, as per
- above.
-
- * shared_info.h (mount_info::from_fstab_line): Make private.
- (mount_info::fstab): Ditto. Accommodate new arguments.
-
-2008-05-23 Christopher Faylor <me+cygwin@cgf.cx>
-
- * mount.cc (mount_info::from_fstab): Use cygwin_hmodule rather than
- trying to find handle based on cygwin1.dll.
-
- * path.cc (symlink_info::check): Remove unused variable.
-
-2008-05-23 Corinna Vinschen <corinna@vinschen.de>
-
- * shared.cc (open_shared): Fix comments. Fix a condition which has
- been overlooked to revert to its old state in change from 2008-04-18.
-
-2008-05-22 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (symlink_info::check): Define eabuf and easize outside of
- loop. Set to NULL on first STATUS_EAS_NOT_SUPPORTED. Align comments.
- Fix formatting.
-
-2008-05-23 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_disk_file::readdir): Eliminate
- compiler warning.
-
-2008-05-23 Christopher Faylor <me+cygwin@cgf.cx>
-
- * path.cc (symlink_info::check): Don't pass EaBuffer to NtCreateFile if
- it has indicated that it isn't appropriate.
- * ntdll.h (STATUS_EAS_NOT_SUPPORTED): Define.
-
- * winsup.h: Remove __builtin* defines.
-
-2008-05-22 Corinna Vinschen <corinna@vinschen.de>
-
- * grp.cc (internal_getgroups): Fix thinko. Only add enabled groups to
- the group list.
-
-2008-05-22 Corinna Vinschen <corinna@vinschen.de>
-
- * grp.cc (internal_getgroups): Don't add deny-only groups to the group
- list.
-
-2008-05-22 Corinna Vinschen <corinna@vinschen.de>
-
- * cygtls.h (struct san): Add two int values to store the current
- tls_pathbuf counters.
- (return_from_fault): Restore tls_pathbuf counters.
- (setup_fault): Save tls_pathbuf counters.
- * tlsoffset.h: Regenerate.
-
-2008-05-22 Corinna Vinschen <corinna@vinschen.de>
-
- * sec_acl.cc (setacl): Set errno to EINVAL if user or group don't exist.
-
-2008-05-22 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (cygwin_conv_path): Define tp before setting up faul handler.
- * syscalls.cc: Ditto, throughout.
- (gen_full_path_at): Add bool parameter to allow NULL pathname.
- (futimesat): Allow NULL pathname as GLIBC.
-
-2008-05-21 Christopher Faylor <me+cygwin@cgf.cx>
-
- * string.h (strchr): Eliminate.
-
- * syscalls.cc (rename): Work around inexplicable C++ warning.
-
-2008-05-21 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (get_ino_by_handle): Rename pfai to fai.
- (fhandler_base::fstat_by_handle): Drop fai_size and pfai in favor of
- static struct fai_buf. Restructure.
- (fhandler_base::fstat_by_name): Drop fvi_size and pfvi. Drop fdi_size
- and pfdi in favor of static struct fdi_buf. Drop redundant test for
- existance. Use FileDirectoryInformation class instead of
- FileBothDirectoryInformation. Drop call to NtQueryVolumeInformationFile
- in favor of using pc.fs_serial_number (). Fix FileId information given
- to fstat_helper.
- (fhandler_disk_file::fstatvfs): Drop fvi_size, pfvi, fai_size and pfai.
- Drop getting FileFsVolumeInformation and FileFsAttributeInformation in
- favor of using the related path_conv info.
- (fhandler_disk_file::opendir): Fix comment.
- (fhandler_disk_file::readdir): Ditto. Use FileDirectoryInformation
- class instead of FileBothDirectoryInformation.
- * path.cc (fs_info::update): Store MaximumComponentNameLength in new
- member name_len.
- * path.h (struct fs_info): Use ULONG rather than DWORD. Add member
- name_len to store MaximumComponentNameLength. Add accessor methods.
- (path_conv::fs_name_len): New method.
-
-2008-05-21 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.h (dirent_states): Add dirent_nfs_d_ino state and add it to
- dirent_info_mask.
- * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set
- dirent_nfs_d_ino flag for NFS shares. Explain why.
- (fhandler_disk_file::readdir): Use FileNamesInformation instead of
- FileBothDirectoryInformation info class on NFS clients not supporting
- the FileIdBothDirectoryInformation info class. Use local pointers to
- accommodate different offsets.
- * path.cc (symlink_info::check): Don't test directories for symlinks
- on NFS shares. Enhance comment.
-
-2008-05-21 Corinna Vinschen <corinna@vinschen.de>
-
- * syscalls.cc (FILTERED_MODE): Define valid chmod mode mask.
- (chmod): Call fh->fchmod with filtered mode.
- (fchmod): Ditto.
-
-2008-05-20 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix test for
- S_IFSOCK in mode bits.
-
-2008-05-20 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (symlink_worker): Fix EA buffer size info given to
- NtCreateFile.
- (symlink_info::check_nfs_symlink): Get 64K buffer for EA buffer.
- Change EA buffer size info given to NtQueryEaFile accordingly.
-
-2008-05-20 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (symlink_info::check_shortcut): Minimize requested file
- access flags.
- (symlink_info::check_sysfile): Ditto. Add missing `else'.
- (symlink_info::check): Only retry to open file if first try failed
- with access denied.
-
-2008-05-20 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (fs_info::update): Re-add opening the unsplitted path
- for fillout_mntent's sake.
-
-2008-05-20 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Create directories
- on NFS shares with correct mode bits.
-
-2008-05-20 Corinna Vinschen <corinna@vinschen.de>
-
- * winsup.h (cygwin_inet_addr): Fix type of declaration.
-
-2008-05-20 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (DLL_OFILES): Add nfs.o.
- * fhandler.cc (fhandler_base::open): Open files on NFS shares with
- correct access flags and EAs.
- * fhandler.h (fhandler_base::fstat_by_nfs_ea): Declare.
- * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): New method.
- (fhandler_base::fstat_by_handle): Call fstat_by_nfs_ea for files on
- NFS shares.
- (fhandler_disk_file::fchmod): Use NFS specific method to set mode for
- files on NFS shares. Don't overrule errno from call to
- set_file_attribute with errno from NtSetInformationFile call.
- (fhandler_disk_file::fchown): Add comment.
- * mount.cc (fillout_mntent): Accommodate change in second parameter
- to fs_info::update.
- * nfs.cc: New file.
- * nfs.h: New file.
- * path.cc (fs_info::update): Take handle instead of bool as second
- parameter. Use that handle if it's not NULL. Only close handle if
- it has been opened here. Use static defined buffers instead of
- alloca'd buffers.
- (path_conv::check): Call symlink_info::check with reference to fs.
- Don't call fs.update here if file exists.
- (conv_path_list): Prefer tmp_pathbuf buffer over using alloca.
- (symlink_worker): Use NFS specific method to create symlinks on NFS
- shares. Prefer tmp_pathbuf buffer over using alloca.
- (symlink_info::check_shortcut): Reopen file from incoming handle
- with necessary FILE_GENERIC_READ flag. Prefer tmp_pathbuf buffer over
- using alloca.
- (symlink_info::check_sysfile): Ditto.
- (symlink_info::check_reparse_point): Use tmp_pathbuf buffer to
- allocate REPARSE_DATA_BUFFER.
- (symlink_info::check_nfs_symlink): New method.
- (enum symlink_t): Remove.
- (symlink_info::check): Don't use NtQueryAttributesFile. Rather, open
- file with necessary access flags and call NtQueryInformationFile. Fix
- error handling in case file can't be opened. For existing files, call
- fs_info::update here. Restructure symlink checking to accommodate the
- fact that the file is already open. Add case for NFS symlinks.
- * path.h (fs_info::update): Take handle instead of bool as second
- parameter.
-
-2008-05-20 Corinna Vinschen <corinna@vinschen.de>
-
- * syscalls.cc (rename): Fix condition when to start a transaction.
-
-2008-05-20 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (path_conv::check): Free wide_path and normalized_path if
- necessary.
- * path.h (path_conv::path_conv): Set wide_path, normalized_path and
- normalized_path_size to 0 in all constructors.
-
-2008-05-19 Corinna Vinschen <corinna@vinschen.de>
-
- * syscalls.cc (rename): Allocate temporary path buffers using
- tmp_pathbuf. Don't try to unset R/O attribute on dstpc if a
- removepc exists. dstpc is a non-existant file in that case.
-
-2008-05-17 Christopher Faylor <me+cygwin@cgf.cx>
-
- * include/stdint.h: Use int rather than long for {u,}int32_t.
-
-2008-05-16 Corinna Vinschen <corinna@vinschen.de>
-
- * CYGWIN_LICENSE: Remove duplicate file here.
-
-2008-05-15 Corinna Vinschen <corinna@vinschen.de>
-
- * syscalls.cc (rename): ONly start transaction if FS supports them.
-
-2008-05-15 Corinna Vinschen <corinna@vinschen.de>
-
- * autoload.cc (LoadDLLfuncNt): Re-invent.
- (NtCreateTransaction): Define.
- (NtCommitTransaction): Define.
- (NtRollbackTransaction): Define.
- (RtlGetCurrentTransaction): Define.
- (RtlSetCurrentTransaction): Define.
- * ntdll.h (TRANSACTION_ALL_ACCESS): Define.
- (NtCreateTransaction): Declare.
- (NtCommitTransaction): Declare.
- (NtRollbackTransaction): Declare.
- (RtlGetCurrentTransaction): Declare.
- (RtlSetCurrentTransaction): Declare.
- * syscalls.cc (start_transaction): New static function to start TxF
- transaction.
- (stop_transaction): New static function to end TxF transaction.
- (rename): Call start_transaction and stop_transaction where appropriate
- on systems supporting transactions.
- * wincap.h (wincaps::has_transactions): New element.
- * wincap.cc: Implement above element throughout.
-
-2008-05-14 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Drop
- explicit transformation of special DOS chars.
- * strfuncs.cc (sys_wcstombs): Always transform UNICODE private use area
- back to ASCII.
-
-2008-05-13 Corinna Vinschen <corinna@vinschen.de>
-
- * include/cygwin/stdlib.h (initstate): Declare.
- (setstate): Declare.
-
-2008-05-13 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (path_conv::set_normalized_path): Drop strip_tail argument.
- Never strip trailing dots and spaces.
- * (path_conv::check): Accomodate above change.
- * path.h (path_conv::operator=): Ditto
- * dtable.cc (build_fh_dev): Ditto.
- * fhandler.h (fhandler_base::set_name): Ditto.
-
- * path.cc (transform_chars): Disable converting trailing dots and
- spaces.
-
- * path.cc (path_conv::check): Remove two disabled code snippets.
-
-2008-05-13 Corinna Vinschen <corinna@vinschen.de>
-
- * random.cc (initstate): Align to POSIX definition.
- (setstate): Ditto.
-
-2008-05-10 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (DLL_OFILES): Remove _def_time.o.
- * libc/_def_time.c: Remove. Move definitions of _DefaultTimeLocale
- and _CurrentTimeLocale ...
- * libc/strptime.cc: ... here.
-
-2008-05-08 Corinna Vinschen <corinna@vinschen.de>
-
- * include/sys/localedef.h: Remove.
- * libc/strptime.cc: Define _TimeLocale and declare _CurrentTimeLocale
- as well as _DefaultTimeLocale locally for Cygwin.
-
-2008-05-08 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (DLL_OFILES): Add _def_time.o. Remove timelocal.o.
- * include/sys/localedef.h: New file from NetBSD.
- * libc/_def_time.c: Ditto.
- * libc/getopt.c: Update to latest OpenBSD version 1.23.
- * libc/strptime.cc: Replace FreeBSD version 1.35 with latest NetBSD
- version 1.28.
- * libc/timelocal.cc: Remove.
- * libc/timelocal.h: Remove.
-
-2008-04-30 Corinna Vinschen <corinna@vinschen.de>
-
- * dtable.cc (dtable::release): Drop fixup_before handling.
- (dtable::fixup_before_fork): Remove.
- (dtable::fixup_before_exec): Remove.
- * dtable.h (class dtable): Remove cnt_need_fixup_before member.
- (dtable::dtable): Accommodate above change.
- (dtable::dec_need_fixup_before): Remove.
- (dtable::inc_need_fixup_before): Remove.
- (dtable::need_fixup_before): Remove.
- (dtable::fixup_before_exec): Remove declaration.
- (dtable::fixup_before_fork): Ditto.
- * fhandler.h (fhandler_base::fixup_before_fork_exec): Remove.
- (fhandler_base::need_fixup_before): Remove.
- * fork.cc (frok::parent): Drop fixup_before handling.
- * spawn.cc (spawn_guts): Ditto.
-
-2008-04-30 Corinna Vinschen <corinna@vinschen.de>
-
- * mount.cc (is_unc_share): Allow \\?\ prefix as well. Enhance comment.
- (mount_info::from_fstab): Remove patch from 2008-04-29.
-
- * mount.cc (mount_info::conv_to_posix_path): Simplify test for native
- UNC path.
- * path.cc (normalize_win32_path): Ditto.
- (symlink_worker): Ditto.
- (symlink_info::posixify): Ditto.
- (cygwin_conv_path): Ditto.
-
-2008-04-29 Corinna Vinschen <corinna@vinschen.de>
-
- * mount.cc (mount_info::from_fstab): Skip native path prefix in
- module path.
-
-2008-04-29 Corinna Vinschen <corinna@vinschen.de>
-
- * syscalls.cc (rename): Use volume serial numbers stored in path_conv
- rather than fetching them here for the "same file" test. Change
- comment to reflect this.
-
-2008-04-28 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (symlink_info::check): Avoid special handling for
- STATUS_BUFFER_OVERFLOW when calling NtQueryDirectoryFile.
- * strace.cc (strace::vprntf): Use bigger buffer.
-
-2008-04-28 Corinna Vinschen <corinna@vinschen.de>
-
- * kernel32.cc (CreateFileMappingW): Remove stray small_printf.
-
-2008-04-28 Corinna Vinschen <corinna@vinschen.de>
-
- * autoload.cc (IsWow64Process): Remove.
- (Wow64DisableWow64FsRedirection): Remove.
- (Wow64RevertWow64FsRedirection): Remove.
- * ntdll.h (enum _PROCESSINFOCLASS): Define ProcessWow64Information.
- * init.cc (respawn_wow64_process): Use NtQueryInformationProcess to
- get WOW64 state.
- * wincap.cc (wincapc::init): Ditto.
- * wincap.h (wincapc::wow64): Change type to ULONG.
-
-2008-04-27 Corinna Vinschen <corinna@vinschen.de>
-
- * wincap.h (wincapc::wow64): Change type to BOOL.
- * wincap.cc: Remove explicit use of this pointer in wincapc methods.
- (wincapc::init): Fix bug in IsWow64Process handling.
-
-2008-04-26 Corinna Vinschen <corinna@vinschen.de>
-
- * dcrt0.cc (dll_crt0_0): Set SEM_NOGPFAULTERRORBOX error mode, too,
- to accommodate Vista/Longhorn.
- * spawn.cc (spawn_guts): Move check for CREATE_SUSPENDED condition
- after the call to ch.set() since it depends on it.
-
-2008-04-25 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (install): Drop install rules for postinstall script.
-
-2008-04-25 Corinna Vinschen <corinna@vinschen.de>
-
- * postinstall: Remove (Moved to base-cygwin package).
-
-2008-04-25 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.cc (fhandler_base::open): Move handling FILE_ATTRIBUTE_NORMAL
- back to its old place. Or it to file_attributes instead of setting it.
-
-2008-04-25 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.cc (fhandler_base::open): *Only* handle SYSTEM and HIDDEN
- attributes in FILE_OVERWRITE case.
-
-2008-04-25 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.cc (fhandler_base::open): Handle SYSTEM and HIDDEN attributes
- in FILE_OVERWRITE case as well.
-
-2008-04-24 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_base::fstat_helper): Disable calling
- pc.ndisk_links. Just use nNumberOfLinks instead.
-
-2008-04-24 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_base::utimens_fs): Fix typo in
- input range check.
-
-2008-04-24 Corinna Vinschen <corinna@vinschen.de>
-
- * cygwin.din (futimens): Export.
- (utimensat): Export.
- * fhandler.cc (fhandler_base::utimens): Replace fhandler_base::utimes.
- Call utimens_fs.
- * fhandler.h (class fhandler_base): Declare utimens_fs instead of
- utimes_fs, utimens instead of utimes.
- (class fhandler_disk_file): Declare utimens instead of utimes.
- * fhandler_disk_file.cc (fhandler_disk_file::utimens): Replace
- fhandler_disk_file::utimes.
- (fhandler_base::utimens_fs): Replace fhandler_base::utimes_fs.
- Implement tv_nsec handling according to SUSv4.
- * syscalls.cc (utimensat): New function.
- * times.cc (timespec_to_filetime): New function.
- (timeval_to_timespec): New function.
- (utimens_worker): Replace utimes_worker.
- (utimes): Convert timeval to timespec and call utimens_worker.
- (lutimes): Ditto.
- (futimens): Take over implementation from futimes.
- (futimes): Convert timeval to timespec and call futimens.
- * winsup.h (timespec_to_filetime): Declare.
- * include/cygwin/version.h: Bump API minor number.
- * posix.sgml: Add SUSv4 section. Add futimens and utimensat to it.
-
-2008-04-24 Yaakov (Cygwin Ports) <yselkowitz@users.sourceforge.net>
-
- * include/wait.h: New file.
-
-2008-04-23 Corinna Vinschen <corinna@vinschen.de>
-
- * posix.sgml: Add openat, faccessat, fchmodat, fchownat, fstatat,
- futimesat, linkat, mkdirat, mkfifoat, mknodat, readlinkat, renameat,
- symlinkat, unlinkat to list of implemented Solaris functions.
-
-2008-04-23 Corinna Vinschen <corinna@vinschen.de>
-
- * cygwin.din: Sort.
- (faccessat): Export.
- (fchmodat): Export.
- (fchownat): Export.
- (fstatat): Export.
- (futimesat): Export.
- (linkat): Export.
- (mkdirat): Export.
- (mkfifoat): Export.
- (mknodat): Export.
- (openat): Export.
- (readlinkat): Export.
- (renameat): Export.
- (symlinkat): Export.
- (unlinkat): Export.
- * path.cc (readlink): Align definition to POSIX.
- * syscalls.cc (gen_full_path_at): New static function.
- (faccessat): Implement.
- (fchmodat): Implement.
- (fchownat): Implement.
- (fstatat): Implement.
- (futimesat): Implement.
- (linkat): Implement.
- (mkdirat): Implement.
- (mkfifoat): Implement.
- (mknodat): Implement.
- (openat): Implement.
- (readlinkat): Implement.
- (renameat): Implement.
- (symlinkat): Implement.
- (unlinkat): Implement.
- * include/cygwin/version.h: Bump API minor number.
-
-2008-04-22 Corinna Vinschen <corinna@vinschen.de>
-
- * dcrt0.cc (dll_crt0_0): Move CWD initialization from here...
- (dll_crt0_1): ...to here.
-
-2008-04-22 Corinna Vinschen <corinna@vinschen.de>
-
- * cygwin.din (fmemopen): Export.
- (open_memstream): Export.
- * include/cygwin/version.h: Bump API minor number.
-
-2008-04-22 Corinna Vinschen <corinna@vinschen.de>
-
- * sec_auth.cc (create_token): Add integrity level SID to token on
- systems supporting that. Remove useless check for dynamically loading
- NtCreateToken function.
- * sec_helper.cc (mandatory_medium_integrity_sid): Define.
- (mandatory_high_integrity_sid): Define.
- (mandatory_system_integrity_sid): Define.
- * sec_helper.h (mandatory_medium_integrity_sid): Declare.
- (mandatory_high_integrity_sid): Declare.
- (mandatory_system_integrity_sid): Declare.
-
-2008-04-21 Corinna Vinschen <corinna@vinschen.de>
-
- * mount.cc (mount_info::init): Remove call to from_registry. Print
- message that fstab is missing.
- (mount_info::from_fstab): Use CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX
- instead of constant string.
- (mount_info::read_mounts): Remove.
- (mount_info::from_registry): Remove.
- (mount_info::read_cygdrive_info_from_registry): Remove.
- * postinstall: Enable code to create fstab entries from old registry
- entries.
- * registry.cc (reg_key::reg_key): Drop CYGWIN_INFO_CYGNUS_REGISTRY_NAME
- from registry key.
- * shared_info.h (mount_info::read_mounts): Remove declaration.
- (mount_info::from_registry): Ditto.
- (mount_info::to_registry): Ditto.
- (mount_info::read_cygdrive_info_from_registry): Ditto.
- * winver.rc (CYGWIN_REGISTRY_KEY): Remove.
- (LegalCopyright): Fix to include 2008.
- (RegistryKey): Set to CYGWIN_INFO_CYGWIN_REGISTRY_NAME.
- * include/cygwin/version.h (CYGWIN_INFO_CYGNUS_REGISTRY_NAME): Remove.
-
-2008-04-21 Corinna Vinschen <corinna@vinschen.de>
-
- * kernel32.cc (CreateFileMappingW): Fix bug in reserve/commit handling.
-
-2008-04-21 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (DLL_OFILES): Add kernel32.o.
- * autoload.cc (WSACloseEvent): Remove.
- (WSACreateEvent): Remove.
- * cygheap.cc (cygheap_init): Drop initializing shared_prefix.
- * cygheap.h (struct init_cygheap): Drop shared_prefix and
- shared_prefix_buf members.
- * fhandler_socket.cc (sock_shared_name): New static function.
- (search_wsa_event_slot): Convert name buffers to WCHAR. Call
- NtCreateMutant/NtOpenMutant to create mutexes in session local
- namespace.
- (fhandler_socket::init_events): Ditto. Fix debug output.
- (fhandler_socket::release_events): Close mutexes using NtClose.
- (fhandler_socket::dup): Ditto.
- * kernel32.cc: New file, implementing Win32 calls in a Cygwin-specific
- way.
- * mmap.cc (MapView): Make static.
- * ntdll.h: Fix status code sorting.
- (STATUS_OBJECT_NAME_EXISTS): Define.
- (SEMAPHORE_QUERY_STATE): Define.
- (CYG_SHARED_DIR_ACCESS): Define.
- (CYG_MUTANT_ACCESS): Define.
- (CYG_EVENT_ACCESS): Define.
- (CYG_SEMAPHORE_ACCESS): Define.
- (enum _PROCESSINFOCLASS): Define ProcessSessionInformation.
- (struct _PROCESS_SESSION_INFORMATION): Define.
- (NtCreateSemaphore): Declare.
- (NtOpenSemaphore): Declare.
- * flock.cc: Use CYG_xxx_ACCESS access masks where appropriate.
- * posix_ipc.cc (ipc_mutex_init): Use native functions to create mutex.
- Create in cygwin-shared subdir.
- (ipc_cond_init): Ditto for event.
- (ipc_mutex_close): Use NtClose.
- (ipc_cond_close): Ditto.
- (mq_open): Drop "cyg" prefix from mqh_uname.
- * shared.cc (CYG_SHARED_DIR_ACCESS): Drop definition here.
- (_cygwin_testing): Declare extern on file level.
- (get_shared_parent_dir): Change name of shared directory. Add name
- to api_fatal output.
- (get_session_parent_dir): New function.
- (shared_name): Simplify.
- (shared_info::initialize): Call get_session_parent_dir.
- * shared_info.h (get_session_parent_dir): Declare.
- * smallprint.cc (__small_vswprintf): Fix bug in multibyte string
- conversion.
- * thread.cc (semaphore::semaphore): Align semaphore name to object
- names in posix IPC functions.
- * include/cygwin/version.h (CYGWIN_VERSION_SHARED_DATA): Bump.
-
-2008-04-18 Corinna Vinschen <corinna@vinschen.de>
-
- Revert thinko in previous patch.
- * fhandler.h (struct wsa_event): Move back from wsa_event.h to here.
- * fhandler_socket.cc (NUM_SOCKS): Ditto.
- (wsa_events): Move back from cygwin_shared to here. Accommodate
- throughout.
- (socket_serial_number): Ditto.
- * shared_info.h: Accommodate above changes.
- * wsa_event.h: Remove.
-
-2008-04-18 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.h (struct wsa_event): Move to wsa_event.h. Include
- wsa_event.h instead.
- * fhandler_socket.cc (NUM_SOCKS): Move to wsa_event.h.
- (wsa_events): Move from DLL shared area to cygwin_shared shared
- memory. Accommodate throughout.
- (socket_serial_number): Ditto.
- * fhandler_tape.cc (mt): Ditto.
- (mtinfo_init): Remove.
- (mt): Define as cygwin_shared->mt.
- * flock.cc (FLOCK_PARENT_DIR_ACCESS): Remove.
- (FLOCK_INODE_DIR_ACCESS): Move up in file.
- (FLOCK_MUTANT_ACCESS): Ditto.
- (FLOCK_EVENT_ACCESS): Ditto.
- (get_lock_parent_dir): Remove.
- (inode_t::inode_t): Call get_shared_parent_dir to get parent dir handle.
- Add a "flock-" prefix to file's lock directory name for clarity.
- * mtinfo.h (mtinfo_init): Drop declaration.
- * net.cc (last_used_bindresvport): Move from DLL shared area to
- cygwin_shared shared memory.
- (cygwin_bindresvport_sa): Accommodate above change.
- * sec_helper.cc (_everyone_sd): Move here from flock.cc.
- * security.h (SD_MIN_SIZE): Ditto.
- (everyone_sd): Ditto.
- * shared.cc (cygwin_shared_area): Remove.
- (cygwin_shared_h): New handle.
- (get_shared_parent_dir): New static function.
- (shared_name): Drop session_local argument. Call get_shared_parent_dir
- here. Add cygwin-shared subdir to object name.
- (offsets): Reinstantiate SH_CYGWIN_SHARED member.
- (open_shared): Revert change from 2007-03-29 for systems supporting
- SeCreateGlobalPrivilege.
- (shared_info::initialize): Call mtinfo's initialize here.
- (memory_init): Drop call to mtinfo_init.
- * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
- (CURR_SHARED_MAGIC): Ditto.
- (class shared_info): Add members for global socket and tape info
- sharing.
- (enum shared_locations): Reinstantiate SH_CYGWIN_SHARED.
- (get_shared_parent_dir): Declare.
- (shared_name): Drop session_local argument from declaration.
- * wsa_event.h: New file. Move definitions of NUM_SOCKS and
- struct wsa_event here.
-
-2008-04-18 Christopher Faylor <me+cygwin@cgf.cx>
-
- * autoload.cc (noload): Make sure this and succeeding functions are
- located in the text segment.
-
-2008-04-16 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_socket.cc (fhandler_socket::close): Disable enforced
- lingering since the original problem can no longer be reproduced.
-
-2008-04-16 Corinna Vinschen <corinna@vinschen.de>
-
- * grp.cc (internal_getgroups): Drop local buf. Allocate groups
- directly using alloca.
-
-2008-04-14 Corinna Vinschen <corinna@vinschen.de>
-
- * postinstall: Fix copy/paste bug.
-
-2008-04-14 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Fix
- thinko in UNC path handling.
- * path.cc (symlink_worker): Fix typo in comment. Fix UNC path handling.
-
-2008-04-13 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Simplify
- code which checks for symlinks. Fix problem with UNC paths.
-
- * environ.cc (struct parse_thing): Remove transparent_exe option.
- * syscalls.cc (transparent_exe): Remove.
- (unlink): Always add stat_suffixes, drop transparent_exe check.
- (open): Ditto.
- (link): Ditto.
- (pathconf): Ditto.
- * fhandler_disk_file.cc (fhandler_disk_file::link): Ditto.
- * fhandler_process.cc (fhandler_process::fill_filebuf): Always remove
- .exe suffix.
- * path.cc (realpath): Never attach known_suffix.
-
-2008-04-10 Corinna Vinschen <corinna@vinschen.de>
-
- * cygwin.din (wprintf): Remove.
- (_wprintf): Ditto.
- * syscalls.cc (wprintf): Ditto.
- * include/cygwin/version.h: Add FIXME comment.
-
-2008-04-08 Corinna Vinschen <corinna@vinschen.de>
-
- * mount.cc (mount_info::from_fstab): Read user fstab files from
- /etc/fstab.d/$USER to avoid user write access to /etc.
- * postinstall: Use variables for filenames. Create /etc/fstab.d dir
- with 01777 permissions.
-
-2008-04-08 Corinna Vinschen <corinna@vinschen.de>
-
- * postinstall: Disable adding registry mounts to /etc/fstab for now.
-
-2008-04-07 Christopher Faylor <me+cygwin@cgf.cx>
-
- Remove unneeded header files from source files throughout.
-
-2008-04-07 Corinna Vinschen <corinna@vinschen.de>
-
- * postinstall: Add function print_flags and call where appropriate.
- Omit system and cygdrive flag when testing cygdrive flags.
-
-2008-04-07 Christopher Faylor <me+cygwin@cgf.cx>
-
- Add miscfuncs.h to files as needed throughout.
- * mount.cc: New file.
- * path.cc: Move mount-specific stuff into mount.cc. Move common stuff
- into miscfuncs.cc. Remove unneeded includes.
- * miscfuncs.cc: Move some common path functions here.
- * miscfuncs.h: New file.
- * winsup.h: Move miscelleneous functions to miscfuncs.h.
- * dcrt0.cc: Remove unneeded includes.
- * Makefile.in (DLL_OFILES): Add mount.o.
-
- * include/cygwin/config.h: Fix a minor typo.
-
-2008-04-07 Corinna Vinschen <corinna@vinschen.de>
-
- * postinstall: Set IFS to LF only. Change while loop in subshell to
- for loop in parent shell. Add code to read system mount points and
- system cygdrive prefix from registry and append them to /etc/fstab.
-
-2008-04-06 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (struct opt): Rename "system" to "nouser".
- * postinsatll: Ditto.
-
-2008-04-05 Corinna Vinschen <corinna@vinschen.de>
-
- * postinstall: New script.
- * Makefile.in (sysconfdir): Define.
- (install): Create $(sysconfdir)/postinstall dir. Install postinstall
- script into it.
-
- * path.cc: Add temorary comments to note later function removal.
- (conv_fstab_spaces): New inline function to handle \040 to space
- conversion.
- (struct opt): Add "system" and "user" mount options.
- (mount_info::from_fstab_line): Only allow # to start a comment at
- the beginning of the line. Call conv_fstab_spaces on native_path and
- posix_path fields. Don't enforce system mounts in /etc/fstab.
- Drop last argument in call to add_item.
- (mount_info::from_fstab): Create a default cygdrive entry. Load
- user mount points from fstab.<username> instead of fstab.<sid>.
- (mount_info::read_mounts): Drop last argument in call to add_item.
- (mount_info::add_reg_mount): Remove.
- (mount_info::del_reg_mount): Remove.
- (mount_info::write_cygdrive_info): Rename from
- mount_info::write_cygdrive_info_to_registry. Don't write to registry.
- Disallow to overwrite a system cygdrive prefix.
- (mount_info::remove_cygdrive_info_from_registry): Remove.
- (mount_info::get_cygdrive_info): Just fetch current cygdrive prefix and
- flags.
- (mount_info::add_item): Drop last argument. Don't write to registry.
- Disallow to overwrite a system mount point.
- (mount_info::del_item): Drop last argument. Don't write to registry.
- Disallow to remove a system mount point.
- (mount): Enforce user mount.
- (cygwin_umount): Ditto.
- * shared_info.h (mount_info::add_item): Drop last argument.
- (mount_info::del_item): Ditto.
- (mount_info::add_reg_mount): Remove.
- (mount_info::del_reg_mount): Remove.
- (mount_info::write_cygdrive_info): Rename from
- mount_info::write_cygdrive_info_to_registry.
- (mount_info::remove_cygdrive_info_from_registry): Remove.
-
-2008-04-03 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (mount_info::from_fstab_line): Simplify. Recognize special
- "cygdrive" entry from FS type field.
- (mount_info::from_fstab): Create a default root dir.
-
-2008-04-03 Corinna Vinschen <corinna@vinschen.de>
-
- * dcrt0.cc (insert_file): Fix potential buffer overflow.
-
-2008-04-03 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (mount_info::from_fstab): Get module path name of the Cygwin
- DLL, not the path of the application.
-
-2008-04-03 Corinna Vinschen <corinna@vinschen.de>
-
- Cleanup.
- * exceptions.cc (windows_system_directory): Make static. Convert to
- WCHAR.
- (_cygtls::inside_kernel): Accommodate above change. Check module
- path name for leading \\?\ and skip, if so.
- (try_to_debug): Call GetEnvironmentStringsW and convert evaluation to
- WCHAR to avoid truncated environment problem.
- (has_visible_window_station): Call GetUserObjectInformationW.
- (events_init): Accommodate above conversion of windows_system_directory.
- * init.cc (respawn_wow64_process): Use WCHAR functions to start new
- process.
- * net.cc (__dup_ent): Drop Windows 9x consideration.
- (load_ipv6_funcs): Use WCHAR functions to load IPv6 libs.
- * syscalls.cc (syscalls.cc): Remove call to GetDiskFreeSpace.
-
-2008-04-02 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (mount_info::init): First try to fetch mount points from
- fstab files. Fallback to registry if none exists.
- (skip_ws): New inline function.
- (find_ws): Ditto.
- (struct opt): New structure for mount options.
- (read_flags): New static function to convert a mount flags string into
- a flag value.
- (mount_info::from_fstab_line): New method to create a mount table
- entry from a fstab line.
- (mount_info::from_fstab): New method to read fstab file.
- * shared_info.h (mount_info::from_fstab_line): Declare.
- (mount_info::from_fstab): Declare.
-
-2008-04-02 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (enum symlink_t): Rename from shortcut_t.
-
-2008-04-02 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (symlink_info::check_reparse_point): Use NtFsControlFile
- to read reparse points.
- (enum shortcut_t): New type.
- (symlink_info::check): Convert sym_check to shortcut_t. Use shortcut_t
- enum values throughout. Check reparse point before checking for
- sysfile shortcut. Open reparse points with READ_CONTROL only to
- accommodate special Vista reparse points. Add comments.
-
-2008-04-02 Corinna Vinschen <corinna@vinschen.de>
-
- * flock.cc (get_lock_parent_dir): Drop call to NtOpenDirectoryObject
- and utilize OBJ_OPENIF flag in call to NtCreateDirectoryObject.
- (inode_t::inode_t): Ditto. Same for NtOpenMutant/NtCreateMutant.
-
-2008-04-02 Corinna Vinschen <corinna@vinschen.de>
-
- * posix.sgml: Change lockf to being implemented.
-
-2008-04-02 Corinna Vinschen <corinna@vinschen.de>
-
- * dcrt0.cc (insert_file): Convert filename to WCHAR and call
- CreateFileW to allow UTF-8 filenames.
-
-2008-04-01 Corinna Vinschen <corinna@vinschen.de>
-
- * Fix copyright dates.
-
-2008-04-01 Corinna Vinschen <corinna@vinschen.de>
-
- Throughout, call fcntl64 instead of fcntl or fcntl_worker.
- * fcntl.cc (fcntl_worker): Remove.
- (fcntl64): Add fault handler. Move fcntl_worker stuff here. Add case
- for locking and call fhandler's lock method directly. Make sure that
- F_FLOCK flag isn't set in lock call.
- (_fcntl): Add fault handler.
- * fhandler.cc (fhandler_base::fcntl): Drop lock cases.
- * flock.cc (flock): Add fault handler. Simplify code. Call fhandlers
- lock method directly instead of fcntl_worker. Add debug output.
- (lockf): Add fault handler. Call fhandlers lock method directly
- instead of fcntl_worker. Add debug output.
- * winsup.h (fcntl_worker): Drop declaration.
- (fcntl64): Declare.
-
-2008-03-31 Corinna Vinschen <corinna@vinschen.de>
-
- * smallprint.cc (__small_vswprintf): Fix uninitialized usage of `w'.
-
- Revamp advisory file locking to avoid cross reference pointers as well
- as to allow BSD flock semantics. More agressively delete unused nodes
- and sync objects.
- * fhandler.h (fhandler_base::ino): Rename from namehash. Fix comment.
- (fhandler_base::node): Remove.
- (fhandler_base::unique_id): Add.
- (fhandler_base::del_my_locks): New method.
- (get_ino): Rename from get_namehash. Change usage throughout Cygwin.
- (get_unique_id): New method.
- * fhandler.cc (fhandler_base::close): Call own del_my_locks method.
- Fix comment.
- (fhandler_base::fhandler_base): Accommodate new and changed members.
- (fhandler_base::fixup_after_fork): Call del_my_locks.
- (fhandler_base::fixup_after_exec): Ditto for files with close-on-exec
- flag set.
- * fhandler_disk_file.cc (get_ino_by_handle): Rename from
- readdir_get_ino_by_handle. Accommodate throughout.
- (fhandler_base::open_fs): Fill ino with inode number if FS has good
- inodes. Allocate a LUID and store in unique_id to recognize file
- descriptors referencing the same file object.
- * flock.cc: Drop flock TODO comments. Use explicit types __dev32_t
- and __ino64_t instead of dev_t and ino_t.
- (LOCK_OBJ_NAME_LEN): Change to reflect longer lf_id length.
- (get_obj_handle_count): New method.
- (lockf_t::lf_id): Change type to long long.
- (inode_t::get_lock_obj_handle_count): Drop in favor of static function
- get_obj_handle_count.
- (inode_t::del_locks): Remove.
- (inode_t::get): Add create_if_missing flag argument.
- (inode_t::del_my_locks): Reimplement to handle POSIX and BSD flock
- locks. Return if node can be deleted or not.
- (inode_t::~inode_t): Ditto. Close handles to i_dir and i_mtx.
- (fixup_lockf_after_fork): Remove.
- (fhandler_base::del_my_locks): New method.
- (fixup_lockf_after_exec): Check if node can be deleted.
- (inode_t::get): Only create node if create_if_missing is set. Lock
- the returned node here before unlocking the node list.
- (inode_t::get_all_locks_list): Accommodate new lf_id length.
- (inode_t::create_lock_obj): Ditto.
- (lockf_t::open_lock_obj): Ditto. Change return type to bool. De-const.
- Set lf_obj instead of returning a handle.
- (lockf_t::del_lock_obj): Call SetEvent only if new incoming parameters
- allow it. Explain how it's supposed to work.
- (fhandler_disk_file::lock): Only fetch file length in SEEK_END case.
- Use NtQueryInformationFile(FileStandardInformation) instead of
- calling fstat_by_handle. Always unlock node before returning.
- Use fhandler's unique id to create lf_id for BSD flock locks.
- Rely on node lock from inode_t::get. Call del_lock_obj on removed
- locks here to allow explicit unlocking. Delete node if no lock exists
- on the file anymore.
- (lf_setlock): Get file handle as additional parameter. Handle the fact
- that lf_getblock now always opens the attached event object. Reactivate
- erroneously applied patch which deactivates setting thread priority.
- Additionally handle blocking on BSD flock locks.
- (lf_clearlock): Get file handle as additional parameter.
- (lf_getlock): Close event handle opened by lf_getblock.
- (lf_getblock): Open potentially blocking event object here and check
- its signal state if it's a BSD flock lock.
- (lf_wakelock): Get file handle as additional parameter.
- * fork.cc (frok::child): Drop call to fixup_lockf_after_fork.
- * ntdll.h (struct _EVENT_BASIC_INFORMATION): Define.
- (enum _EVENT_INFORMATION_CLASS): Define.
- (NtQueryEvent): Declare.
-
- * fhandler.h (fhandler_base::fs_flags): Remove.
- (fhandler_base::set_fs_flags): Remove.
- (fhandler_base::get_fs_flags): Remove.
- * fhandler.cc (fhandler_base::write): Check for sparse file using
- pc.fs_flags().
- * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Ditto.
-
- The return of the volume serial number in fs_info.
- * fhandler.h (get_dev): New method.
- * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop call to
- NtQueryVolumeInformationFile(FileFsVolumeInformation). Just use
- get_dev() method.
- * fhandler_fifo.cc (fhandler_fifo::open) Use device ID and inode number
- to generate fifo name.
- * path.h (fs_info::sernum): New member.
- (fs_info::serial_number): New method.
- (path_conv::fs_serial_number): New method.
- * path.cc (fs_info::update): Fetch volume serial number and store in
- sernum.
-
-2008-03-28 Corinna Vinschen <corinna@vinschen.de>
-
- * flock.cc (lockf_t::operator new): Add operator taking a pointer. Call
- cmalloc instead of ccalloc in the default operator. Add comments.
- (inode_t::operator new): Call cmalloc instead of ccalloc.
- (inode_t::get_all_locks_list): Return lockf_t pointer.
- (inode_t::del_all_locks_list): Delete. Remove calls throughout.
- (inode_t::get): Handle failing new gracefully.
- (MAX_LOCKF_CNT): Define.
- (inode_t::get_all_locks_list): Use pre-allocated buffer in i_all_lf
- instead of allocating every lock. Return pointer to start of linked
- list of locks.
- (lockf_t::open_lock_obj): Create event object non-inheritable.
- (fhandler_disk_file::lock): Handle failing new gracefully.
- (lf_setlock): Allocate temporary buffer for node->i_all_lf from TLS.
- Remove erroneous NtClose call.
- (lf_getlock): Allocate temporary buffer for node->i_all_lf from TLS.
- (lf_getblock): Set lf to return value of get_all_locks_list.
-
-2008-03-27 Corinna Vinschen <corinna@vinschen.de>
-
- * flock.cc (FLOCK_PARENT_DIR_ACCESS): Define.
- (FLOCK_INODE_DIR_ACCESS): Define.
- (FLOCK_MUTANT_ACCESS): Define.
- (FLOCK_EVENT_ACCESS): Define.
- (SD_MIN_SIZE): Define.
- (everyone_sd): Define to simplify calling _everyone_sd.
- (_everyone_sd): Replace everyone_sync_sd. Take SECURITY_DESCRIPTOR as
- argument and allow to specify access mask.
- (get_lock_parent_dir): Open/Create parent dir with
- FLOCK_PARENT_DIR_ACCESS. Add text to api_fatal message.
- (inode_t::inode_t): Open/Create dir with FLOCK_INODE_DIR_ACCESS.
- Open/Create mutant with FLOCK_MUTANT_ACCESS. Add text to api_fatal
- message.
- (lockf_t::create_lock_obj): Create event with FLOCK_EVENT_ACCESS.
- Add text to api_fatal message.
- (lockf_t::open_lock_obj): Open event with FLOCK_EVENT_ACCESS.
- On failure, just return NULL pointer instead of calling api_fatal.
- (lockf_t::get_lock_obj_handle_count): Replace call to small_printf
- with call to debug_printf.
- (lf_setlock): Handle a failure to open the lock event object as
- EDEADLK. Call system_printf if opening sync objects fail.
- * ntdll.h (DIRECTORY_TRAVERSE): Define.
- (DIRECTORY_CREATE_OBJECT): Define.
- (DIRECTORY_CREATE_SUBDIRECTORY): Define.
- (EVENT_QUERY_STATE): Define.
-
-2008-03-27 Corinna Vinschen <corinna@vinschen.de>
-
- * syscalls.cc (rename): Fix setting errno in case of trailing "/."
-
-2008-03-27 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_socket.cc: Create shared objects session local throughout.
- * shared.cc (shared_name): Add argument to allow opening session
- local shared memory.
- * shared_info.h (shared_name): Change declaration accordingly.
-
-2008-03-26 Christopher Faylor <me+cygwin@cgf.cx>
-
- Implement method of detecting a missing dll as suggested by Brian
- Dessent.
- * hookapi.cc (find_first_notloaded_dll): New function.
- * pinfo.cc (status_exit): New function. Issue message when dll not
- found. Use find_first_notloaded_dll to find a nonexistent dll.
- (pinfo::maybe_set_exit_code_from_windows): Call status_exit when exit
- code >= 0xc0000000UL.
- * sigproc.cc (child_info::proc_retry): Return exit code when
- STATUS_DLL_NOT_FOUND.
- * spawn.cc (spawn_guts): Minor cleanup.
- * syscalls.cc (close_all_files): Don't actually close stderr
- filehandle. Just make it noninheritable.
- * winsup.h (find_first_notloaded_dll): Declare new function.
-
-2008-03-26 Brian Dessent <brian@dessent.net>
-
- * ntdll.h: Add several missing NTSTATUS defines.
-
-2008-03-24 Corinna Vinschen <corinna@vinschen.de>
-
- * flock.cc (inode_t::get_all_locks_list): Don't allow F_WAIT flag
- in lock event object name.
- (lockf_t::create_lock_obj): Ditto.
- (lockf_t::open_lock_obj): Ditto.
- (lf_setlock): Only check POSIX locks for deadlock condition.
- (lf_findoverlap): Don't let POSIX and flock locks interact.
-
-2008-03-24 Corinna Vinschen <corinna@vinschen.de>
-
- * flock.cc: Clarify a couple of comments.
- (lf_setlock): Treat not being able to sync on a process as a potential
- deadlock situation. Close process handle using CloseHandle.
-
-2008-03-24 Corinna Vinschen <corinna@vinschen.de>
-
- * flock.cc: Fix typo in comment.
-
-2008-03-24 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.cc (fhandler_base::dup): Drop setting flags in the parent.
-
- Implement advisory file locking.
- * cygheap.h (struct init_cygheap): Add inode_list member.
- * cygwin.din (lockf): Export.
- * dcrt0.cc (child_info_spawn::handle_spawn): Call
- fixup_lockf_after_exec.
- * dtable.h (class dtable): Add fhandler_disk_file as friend class.
- * fhandler.cc (fhandler_base::close): Call del_my_locks if node is set.
- (fhandler_base::fhandler_base): Initialize node to NULL.
- (fhandler_base::fixup_after_fork): Ditto.
- * fhandler.h (class fhandler_base): Add member node.
- * fhandler_disk_file.cc (fhandler_disk_file::lock): Delete.
- * flock.cc: Implement all advisory file locking here.
- (fhandler_disk_file::lock): Implement here.
- (flock): Call fcntl with F_FLOCK bit set. Remove test main function.
- (lockf): New function.
- * fork.cc (frok::child): Call fixup_lockf_after_fork.
- * ntdll.h (DIRECTORY_ALL_ACCESS): Define.
- (struct _OBJECT_BASIC_INFORMATION): Define.
- (enum _EVENT_TYPE): Define.
- (NtCreateDirectoryObject): Declare.
- (NtCreateEvent): Declare.
- (NtCreateMutant): Declare.
- (NtOpenEvent): Declare.
- (NtOpenMutant): Declare.
- * include/cygwin/version.h: Bump API minor number.
-
-2008-03-22 Christopher Faylor <me+cygwin@cgf.cx>
-
- * dtable.cc (handle_to_fn): Modify to return true if handle represents
- a cygwin tty.
- (dtable::init_std_file_from_handle): Detect when we've seen a cygwin
- pipe and use it in overlapped mode by default.
- (decode_tty): Make static.
-
-2008-03-22 Christopher Faylor <me+cygwin@cgf.cx>
-
- * dtable.cc: Define various device-related string constants as wide
- character constants.
- (dtable::init_std_file_from_handle): Reorganize pipe handling to try to
- catch special tty case.
- (build_fh_name_worker): Declare for common use.
- (build_fh_name): Define char version.
- (build_fh_name): Define (currently unused) UNICODE_STRING version.
- (decode_tty): Detect if pipe is actually a cygwin tty, returning the
- tty name in the buffer.
- (handle_to_fn): Reorganize to use wide characters.
- * dtable.h (build_fh_name): Declare (currently unused) UNICODE_STRING
- version.
- * fhandler_tty.cc (fhandler_pty_master::setup): Use
- fhandler_pipe::create_selectable to create a pipe with a given name.
- * pipe.cc (pipe_handler): Make returned handle inheritable.
- (fhandler_pipe::create_selectable): Take an optional name. Use a
- standard cygwin introducer for the name.
-
- * path.cc (path_conv::check): Make first argument const.
- * path.h (path_conv::check): Ditto for declaration.
- (path_conv::path_conv): Ditto for UNICODE_STRING version.
-
-2008-03-18 Corinna Vinschen <corinna@vinschen.de>
-
- * include/sys/cygwin.h: Revert erroneous move of `#ifdef WINVER' to
- another location.
-
-2008-03-14 Corinna Vinschen <corinna@vinschen.de>
-
- * fcntl.cc (fcntl_worker): Protect with a 'myfault'.
-
- * path.cc (normalize_posix_path): Treat X:/ as Win32 path, too.
-
- * smallprint.cc (__wrn): New static function.
- (__small_vswprintf): New function to generate WCHAR strings.
- (__small_swprintf): Ditto.
- * winsup.h (__small_swprintf): Declare.
- (__small_vswprintf): Declare.
-
-2008-03-13 Corinna Vinschen <corinna@vinschen.de>
-
- * path.sgml: Remove documentation for old path API. Add documentation
- for new path API.
- * security.sgml: New file to document cygwin_set_impersonation_token
- and cygwin_logon_user with only eight years of delay.
- * shared.sgml: Remove file.
- * include/sys/cygwin.h (cygwin32_attach_handle_to_fd): Move declaration
- into fully deprecated function block.
- (cygwin_logon_user): Move declaration down to declaration of
- cygwin_set_impersonation_token.
-
-2008-03-12 Corinna Vinschen <corinna@vinschen.de>
-
- * syscalls.cc (rename): Just return with 0 if filenames are identical,
- per POSIX. Drop comment added in previous patch.
-
-2008-03-12 Corinna Vinschen <corinna@vinschen.de>
-
- * syscalls.cc (rename): Handle a special case of trying to rename a
- mount point.
-
-2008-03-12 Corinna Vinschen <corinna@vinschen.de>
-
- * environ.h: Fix comment.
- * winsup.h: Ditto. Reflect the fact that CYG_MAX_PATH is deprecated.
-
-2008-03-12 Corinna Vinschen <corinna@vinschen.de>
-
- * pipe.cc (fhandler_pipe::create_selectable): Use MAX_PATH instead of
- CYG_MAX_PATH.
- * tty.cc (tty_list::init_session): Ditto.
- (tty::alive): Ditto.
- (tty::open_mutex): Ditto.
- (tty::create_inuse): Ditto.
- (tty::get_event): Ditto.
-
-2008-03-12 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Disable
- munging. Convert all chars in the 0xf0xx area to it's ascii equivalent.
- * path.cc (normalize_posix_path): Don't treat "X:foo" as windows path,
- only "X:\foo".
- (tfx_chars): New transformation table for special DOS chars.
- (tfx_chars_managed): Ditto, plus transformation of uppercase ASCII
- chars.
- (transform_chars): New function.
- (get_nt_native_path): Make static. Call transform_chars for all valid
- FS paths. Get additional flag if file is managed or not. Accommodate
- throughout.
- (getfileattr): Get additional flag if file is managed or not.
- Accommodate throughout.
- (path_conv::check): Disable special handling for trailing dots and
- spaces.
- (mount_item::build_win32): Disable code for managed paths.
- (mount_info::conv_to_posix_path): Ditto.
- * path.h (get_nt_native_path): Remove declaration.
-
-2008-03-12 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Don't
- copy filename twice in the non-managed case.
-
-2008-03-12 Corinna Vinschen <corinna@vinschen.de>
-
- * winsup.h (NT_MAX_PATH): Revert ill-advised change to 32767.
- Accommodate change throughout.
-
- * cygwin.din (cygwin_conv_path): Export.
- (cygwin_conv_path_list): Export.
- (cygwin_create_path): Export.
- * dcrt0.cc (dll_crt0_1): Use cygwin_conv_path.
- * dtable.cc (handle_to_fn): Ditto. Don't expect UNICODE_STRING being
- 0-terminated.
- * environ.cc (env_plist_to_posix): New helper function.
- (env_plist_to_win32): Ditto.
- (env_path_to_posix): Ditto.
- (env_path_to_win32): Ditto.
- (return_MAX_PATH): Remove.
- (conv_envvars): Use new helper functions. Drop removed members.
- (win_env::operator =): Accommodate removal of path length functions.
- (win_env::add_cache): Accommodate new env helper function API.
- (posify): Ditto.
- * environ.h (struct win_env): Ditto. Remove path length function
- pointers since they are unused.
- * path.cc (warn_msdos): Use cygwin_conv_path.
- (getfileattr): Use new tmp_pathbuf::u_get method.
- (fillout_mntent): Ditto.
- (symlink_info::check): Ditto.
- (path_conv::check): Use sizeof (WCHAR) instead of constant 2.
- (symlink_info::check_reparse_point): Ditto.
- (conv_path_list): Get max size of target string as argument. Call
- cygwin_conv_path as helper function.
- (cygwin_conv_path): New function.
- (cygwin_create_path): New function.
- (cygwin_conv_to_win32_path): Just call cygwin_conv_path with size set
- to MAX_PATH.
- (cygwin_conv_to_full_win32_path): Ditto.
- (cygwin_conv_to_posix_path): Ditto.
- (cygwin_conv_to_full_posix_path): Ditto.
- (conv_path_list_buf_size): Add FIXME comment.
- (env_PATH_to_posix): Rename from env_win32_to_posix_path_list.
- Add size argument as required for env helper functions.
- (cygwin_win32_to_posix_path_list): Call conv_path_list with size set to
- MAX_PATH.
- (cygwin_posix_to_win32_path_list): Ditto.
- (cygwin_conv_path_list): New function.
- (cwdstuff::get): Fix length argument in call to sys_wcstombs.
- * spawn.cc (find_exec): Use cygwin_conv_path_list.
- * tls_pbuf.h (tmp_pathbuf::u_get: New method.
- * uinfo.cc (cygheap_user::ontherange): Allocate temporary path buffers
- using tmp_pathbuf. Use cygwin_conv_path.
- * winf.cc (av::unshift): Use cygwin_conv_path.
- * include/cygwin/version.h: Bump API minor number.
- * include/sys/cygwin.h: Comment out old cygwin32_XXX API.
- Mark old path handling API as deprecated.
- (cygwin_conv_path_t): Typedef. Define values.
- (cygwin_conv_path): Declare.
- (cygwin_create_path): Declare.
- (cygwin_conv_path_list): Declare.
-
-2008-03-11 Corinna Vinschen <corinna@vinschen.de>
-
- * dlfcn.cc (get_full_path_of_dll): Allow paths up to PATH_MAX.
- (dlopen): Call get_full_path_of_dll with path buffer allocate by
- tmp_pathbuf.
-
-2008-03-11 Corinna Vinschen <corinna@vinschen.de>
-
- * spawn.cc (find_exec): Use tmp_pathbuf to allocate path buffer.
-
-2008-03-11 Corinna Vinschen <corinna@vinschen.de>
-
- * dtable.cc (dtable::init_std_file_from_handle): Use tmp_pathbuf to
- allocate path buffer.
- (handle_to_fn): Ditto. Allocate fnbuf big enough to get long path
- names.
-
-2008-03-11 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (cwdstuff::set): Make sure drive_length is 0 for virtual
- paths. Add comments.
- * spawn.cc (spawn_guts): Don't allow to start a native Win32 application
- from a long path or a virtual path. Print an error message to stderr.
-
-2008-03-11 Corinna Vinschen <corinna@vinschen.de>
-
- * environ.cc (parse_options): Use tmp_pathbuf to allocate buffer.
- (regopt): Take tmp buffer as additional argument.
- (environ_init): Alllcate tmpbuf earlier. Use as temporary buffer in
- call to regopt.
- * tls_pbuf.cc (tmp_pathbuf::c_get): Allocate one additional char.
- (tmp_pathbuf::w_get): Allocate one additional WCHAR.
- * winf.cc (av::unshift): Use tmp_pathbuf to allocate buffer.
-
-2008-03-11 Corinna Vinschen <corinna@vinschen.de>
-
- * syscalls.cc (sync): Use MAX_PATH rather than CYG_MAX_PATH.
-
-2008-03-10 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.h (class fhandler_console): Add write_buf as pointer to
- temporary buffer space.
- * fhandler_console.cc (CONVERT_LIMIT): Define as NT_MAX_PATH. Add
- comment.
- (fhandler_console::write_normal): Use write_buf throughout.
- (fhandler_console::write): Use tmp_pathbuf to allocate write_buf.
-
-2008-03-10 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_console.cc (fhandler_console::write_normal): Don't print
- chars marked as ERR chars.
-
-2008-03-10 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.h (dev_console::con_to_str): Declare returning DWORD.
- * fhandler_console.cc (dev_console::con_to_str): Return number of
- multibyte char bytes.
- (fhandler_console::read): Set nread to number of multibyte char bytes
- returned from con_to_str.
- (fhandler_console::write_normal): Reorder trunc buffer preocessing.
- Return after writing valid multibyte sequence out of trunc buffer.
- Change comments slightly.
-
-2008-03-08 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (DIR_BUF_SIZE): Define required space for file
- name in terms of sizeof(WCHAR).
- (fhandler_disk_file::readdir_helper): Convert *all* of fname.
- * path.cc (fillout_mntent): Use tmp_pathbuf for path buffer.
- (symlink_worker): Ditto.
- (SCAN_JUSTCHECKTHIS): New state for suffix_scan to define
- that only the actual name gets cheked and a suffix is never attached.
- (suffix_scan::has): If filename + suffix would be > NAME_MAX, start
- in SCAN_JUSTCHECKTHIS state.
- (suffix_scan::next): Add case for SCAN_JUSTCHECKTHIS.
- (symlink_info::check): Use tmp_pathbuf for path buffer. Goto
- file_not_symlink in case of invalid file name.
- (realpath): Use tmp_pathbuf for path buffer.
-
-2008-03-07 Brian Dessent <brian@dessent.net>
-
- * dtable.cc (handle_to_fn): Null-terminate posix_fn in the case
- of justslash = true.
-
-2008-03-07 Brian Dessent <brian@dessent.net>
-
- * fhandler.cc (fhandler_base::open): Use %S for PUNICODE_STRING.
- * syscalls.cc (setmode): Ditto.
-
-2008-03-07 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_socket.cc (fhandler_socket::sendto): Never send more than
- 64K. Add comment to explain why.
- (fhandler_socket::sendmsg): Ditto.
-
-2008-03-07 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (DLL_OFILES): Add tls_pbuf.o.
- * autoload.cc (CreateDesktopW): Replace CreateDesktopA.
- (CreateWindowStationW): Replace CreateWindowStationA.
- (GetUserObjectInformationW): Replace GetUserObjectInformationA.
- * cygheap.h (cwdstuff::get): Assume default buffer size NT_MAX_PATH.
- * cygtls.cc (_cygtls::remove): Free temporary TLS path buffers.
- * cygtls.h (TP_NUM_C_BUFS): Define.
- (TP_NUM_W_BUFS): Define.
- (class tls_pathbuf): New class to store pointers to thread local
- temporary path buffers.
- (_local_storage::pathbufs): New member.
- * environ.cc (win_env::add_cache): Use temporary TLS path buffer instead
- of stack based buffer.
- (posify): Get temporary outenv buffer from calling function.
- (environ_init): Create temporary TLS path buffer for posify.
- (build_env): Create Windows environment block as WCHAR buffer.
- * environ.h (build_env): Change declaration accordingly.
- * external.cc (sync_winenv): Accommodate build_env change.
- * fhandler_console.cc (fhandler_console::need_invisible): Use
- GetUserObjectInformationW and CreateWindowStationW.
- * fhandler_process.cc (format_process_maps): Use temporary TLS path
- buffer instead of stack based buffer.
- * fork.cc (frok::parent): Convert to use CreateProcessW.
- * path.cc: Throughout use temporary TLS path buffers instead of stack
- based buffer. Replace checks for CYG_MAX_PATH by checks for
- NT_MAX_PATH.
- (getfileattr): New function to replace GetFileAttributesA.
- (normalize_win32_path): Remove Win32 and NT long path prefixes.
- (getwd): Assume PATH_MAX + 1 buffer per SUSv3.
- * path.h (class path_conv): Set path buffer to size NT_MAX_PATH.
- (iswdrive): Define.
- * pinfo.cc (commune_process): Use temporary TLS path buffer instead of
- stack based buffer.
- * registry.cc (get_registry_hive_path): Ditto.
- (load_registry_hive): Ditto.
- * spawn.cc (spawn_guts): Convert to use CreateProcessW and
- CreateProcessAsUserW.
- (av::fixup): Open/close file using NtOpenFile/NtClose.
- * syscalls.cc (mknod_worker): Allow PATH_MAX file name.
- (mknod32): Ditto.
- (getusershell): Ditto.
- * tls_pbuf.cc: New file implementing tls_pathbuf and tmp_pathbuf
- methods.
- * tls_pbuf.h: New header for files using tmp_pathbuf.
- * tlsoffsets.h: Regenerate.
- * winsup.h (NT_MAX_PATH): Define as 32767 to avoid USHORT overflow.
-
-2008-03-06 Corinna Vinschen <corinna@vinschen.de>
-
- * child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
-
-2008-03-06 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.cc (fhandler_base::open_): Add missing test for O_CREAT.
- Fix comment.
-
-2008-03-05 Corinna Vinschen <corinna@vinschen.de>
-
- * child_info.h (~child_info_spawn): Check moreinfo->myself_pinfo for
- NULL before closing.
- * spawn.cc (spawn_guts): Don't close moreinfo->myself_pinfo explicitely
- in case of failing CloseProcess.
-
- * fhandler.cc (fhandler_base::open_): Return EISDIR when trying to
- create a directory.
- * path.cc (path_conv::check): If input path had a trailing dir
- separator, tack it on to the native path if directory doesn't exist.
-
-2008-03-02 Christopher Faylor <me+cygwin@cgf.cx>
-
- * cygtls.cc (_cygtls::init_exception_handler): Semi-revert to making
- only ourselves the exception handler and nothing else.
- * exceptions.cc (open_stackdumpfile): Use correct format specifiers for
- unicode when printing the name of the stackdump file.
- (stack_info::walk): Stop walking if ebp points into cygwin itself.
- (_cygtls::handle_exceptions): Detect when signal is masked and treat as
- if it was not caught. Reinitialize exception handler to known state to
- avoid subsequent attempts to call Windows exception handlers if an
- exception occurs in a signal handler. Revert to a 'return 0' rather
- than using a goto.
-
- * strfuncs.cc (sys_wcstombs_alloc): Minor formatting tweak.
- * winsup.h: Fix comment typo.
-
-2008-03-02 Christopher Faylor <me+cygwin@cgf.cx>
-
- * smallprint.cc (__small_vsprintf): Free allocated buffer rather than
- pointer into the buffer.
-
-2008-03-01 Christopher Faylor <me+cygwin@cgf.cx>
-
- * cygtls.h (_cygtls::handle_threadlist_exception): Eliminate.
- (_cygtls::init_threadlist_exceptions): Ditto.
- * cygtls.cc (_cygtls::handle_threadlist_exception): Eliminate.
- (_cygtls::init_threadlist_exceptions): Ditto.
- (_cygtls::find_tls): Use myfault handling to deal with errors caused by
- nonexistent threads.
- * sigproc.cc (wait_sig): Eliminate call to init_threadlist_exceptions.
-
-2008-03-01 Christopher Faylor <me+cygwin@cgf.cx>
-
- * cygtls.cc (_cygtls::init_exception_handler): Just return.
-
-2008-03-01 Corinna Vinschen <corinna@vinschen.de>
-
- * exceptions.cc (_cygtls::handle_exceptions): Only call rtl_unwind when
- exiting. Just return, don't set thread context.
- * gendef (_setjmp): Store %fs:0 in jmp_buf.
- (_sjfault): Ditto.
- (_ljfault): Restore %fs:0 from jmp_buf.
- (_longjmp): Ditto.
-
-2008-02-29 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Call close_fs
- instead of close to avoid calling close from wrong class when changing
- a file system based device node.
- (fhandler_disk_file::fchown): Ditto.
- (fhandler_disk_file::facl): Ditto.
-
-2008-02-28 Corinna Vinschen <corinna@vinschen.de>
-
- * exceptions.cc (_cygtls::handle_exceptions): When being debugged,
- leave through SetThreadContext, too, to keep exception handler stack
- intact.
-
-2008-02-28 Corinna Vinschen <corinna@vinschen.de>
-
- * exceptions.cc (open_stackdumpfile): Add comments.
-
-2008-02-28 Corinna Vinschen <corinna@vinschen.de>
-
- * exceptions.cc (open_stackdumpfile): Use NtCreateFile to create
- stackdump file.
-
-2008-02-27 Corinna Vinschen <corinna@vinschen.de>
-
- * exceptions.cc (stack_info::walk): Fix typo.
-
-2008-02-27 Corinna Vinschen <corinna@vinschen.de>
-
- * cygtls.cc (_cygtls::init_exception_handler): Fix comment.
-
-2008-02-27 Corinna Vinschen <corinna@vinschen.de>
-
- * (struct __DIR_cache): Switch order of members so that the buffer
- given to NtQueryDirectoryFile is 8 byte aligned.
-
-2008-02-27 Christopher Faylor <me+cygwin@cgf.cx>
-
- * cygtls.cc (_cygtls::handle_threadlist_exception): Make it clear that
- the function never actually returns.
- * exceptions.cc (_cygtls::handle_exceptions): Jump out of function
- rather than returning to avoid meddling by previously installed
- exception handlers.
-
-2008-02-25 Corinna Vinschen <corinna@vinschen.de>
-
- * dcrt0.cc (initial_env): Only use local buffer "buf" if DEBUGGING is
- enabled. Replace calls to GetEnvironmentVariable by calls to
- GetEnvironmentVariableA for clarity. Call GetEnvironmentVariableA
- with NULL buffer.
- (cygbench): Ditto, drop local buffer.
- * environ.cc (getearly): Call GetEnvironmentVariableA.
- (environ_init): Retrieve unicode environment and convert to current
- codepage locally.
- (getwinenveq): Ditto.
- * exceptions.cc (try_to_debug): Accommodate new sys_mbstowcs calling
- convention.
- * fhandler_clipboard.cc (set_clipboard): Call sys_mbstowcs to retrieve
- required buffer length.
- * fork.cc (frok::child): Call GetEnvironmentVariableA.
- * miscfuncs.cc: Accommodate changed arguments in calls to sys_mbstowcs.
- * sec_auth.cc: Ditto.
- * strfuncs.cc (sys_wcstombs_alloc): Fix formatting.
- (sys_mbstowcs): Change arguments to allow specifying a source string
- length.
- (sys_mbstowcs_alloc): Ditto.
- * uinfo.cc (cygheap_user::ontherange): Accommodate changed arguments in
- calls to sys_mbstowcs.
- * winsup.h (sys_mbstowcs): Adjust declaration.
- (sys_mbstowcs_alloc): Ditto.
-
-2008-02-20 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (cwdstuff::set): Revert error handling change in case
- DuplicateHandle fails, because it breaks Vista/Longhorn workaround.
-
-2008-02-19 Christopher Faylor <me+cygwin@cgf.cx>
-
- * sigproc.cc (sig_send): Use sigmask of target thread if it is
- specified otherwise default to main sigmask.
-
-2008-02-16 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.cc (fhandler_base::fpathconf): Fix _PC_NAME_MAX and
- _PC_PATH_MAX cases.
-
-2008-02-15 Corinna Vinschen <corinna@vinschen.de>
-
- * include/sys/cygwin.h (__INT_MAX_PATH): Remove.
- (external_pinfo): Convert program_long to pointer.
- * external.cc (fillout_pinfo): Add buffer for program_long value.
-
-2008-02-15 Corinna Vinschen <corinna@vinschen.de>
-
- * include/sys/cygwin.h (__INT_MAX_PATH): Define to 32K.
- (external_pinfo): Set size of program_long to __INT_MAX_PATH.
-
-2008-02-15 Christopher Faylor <me+cygwin@cgf.cx>
-
- * include/sys/cygwin.h (external_pinfo): Define program_long size using
- external buffer size rather than cygwin-internal buffer size.
-
-2008-02-15 Christopher Faylor <me+cygwin@cgf.cx>
-
- Perform whitespace cleanup throughout.
-
- * dcrt0.cc (signal_shift_subtract): Eliminate ancient backwards
- compatibility.
- (check_sanity_and_sync): Ditto.
- * winsup.h (SIGTOMASK): Ditto. Just use constant in signal
- calculation.
- * include/cygwin/version: Remove backwards signal mask compatibility
- define.
-
- * path.cc (symlink_info::check_sysfile): Cosmetic change.
-
- * registry.cc (get_registry_hive_path): Remove unneeded variable.
-
- * exceptions.cc (handle_sigsuspend): Eliminate thread signal mask and
- use either main sigmask or current thread sigmask.
- (set_process_mask): Ditto.
- (sighold): Ditto.
- (sigrelse): Ditto.
- (sigset): Ditto.
- (set_process_mask_delta): Ditto.
- (_cygtls::call_signal_handler): Ditto.
- * fhandler_process.cc (format_process_status): Ditto.
- * fhandler_termios.cc (fhandler_termios::bg_check): Ditto.
- * pinfo.h (class pinfo): Ditto.
- * select.cc (pselect): Ditto.
- * signal.cc (sigprocmask): Ditto.
- (abort): Ditto.
- (sigpause): Ditto.
- (sigsend): Ditto.
- (wait_sig): Ditto.
- * thread.h (pthread::parent_tls): New member.
- * thread.cc (pthread::pthread): Record parent_tls here.
- (pthread::thread_init_wrapper): Initialize sigmask from parent thread.
-
-2008-02-14 Corinna Vinschen <corinna@vinschen.de>
-
- * cygheap.cc (cwcsdup): New function.
- (cwcsdup1): New function.
- * cygheap.h (cygheap_user::get_windows_id): New method returning PWCHAR.
- (cwcsdup): Declare.
- (cwcsdup1): Declare.
- * registry.cc (get_registry_hive_path): Use WCHAR instead of char
- throughout.
- (load_registry_hive): Ditto.
- * registry.h (get_registry_hive_path): Change declaration accordingly.
- (load_registry_hive): Ditto.
- * sec_helper.cc (cygpsid::string): New method returning PWCHAR.
- * security.h (cygpsid::string): Declare.
- * syscalls.cc (seteuid32): Convert local name var to WCHAR.
- * uinfo.cc (cygheap_user::env_userprofile): Convert local name buffers
- to WCHAR. Call sys_wcstombs_alloc to generate puserprof buffer.
-
- * winsup.h: Fix comment.
- (NT_MAX_PATH): New definition for maximum internal path length.
- Use throughout where appropriate.
- * include/limits.h (PATH_MAX): Set to 4096 as on Linux.
-
-2008-02-13 Christopher Faylor <me+cygwin@cgf.cx>
-
- * configure.in: Remove non-working options.
- * configure: Regenerate.
-
-2008-02-13 Christopher Faylor <me+cygwin@cgf.cx>
-
- * syscalls.cc (_isatty): Define as an alias to isatty to override
- newlib version.
-
- * thread.cc (pthread_kill): Deal with signal 0 as per POSIX and also
- avoid manipulating an invalid thread.
-
-2008-02-13 Corinna Vinschen <corinna@vinschen.de>
-
- * posix.sgml: Move llrint, llrintf, llrintl, lrintl, rintl, wcstol,
- wcstoll, wcstoul, wcstoull, wcsxfrm from unimplemented to implemented
- POSIX interfaces.
- Change headline of "GNU extensions" to "GNU and Linux extensions".
- Add fgetxattr, flistxattr, fremovexattr, fsetxattr, getxattr, lgetxattr,
- listxattr, llistxattr, lremovexattr, lsetxattr, removexattr, setxattr,
- wcpcpy and wcpncpy to list of implemented GNU functions.
-
-2008-02-13 Corinna Vinschen <corinna@vinschen.de>
-
- * cygtls.cc (_cygtls::init_exception_handler): Revert patch
- from 2005-12-02.
- * exceptions.cc (stack_info::walk): Add workaround for NT 5.2
- 64 bit OSes.
- * wincap.h (wincaps::has_restricted_stack_args): New element.
- * wincap.cc: Implement above element throughout.
- (wincapc::init): Reset has_restricted_stack_args if not running
- under WOW64.
-
-2008-02-11 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): Remove unused
- attr.
- (fhandler_disk_file::fsetxattr): Ditto.
- * include/attr/xattr.h: New file.
-
-2008-02-11 Corinna Vinschen <corinna@vinschen.de>
-
- * dcrt0.cc (dll_crt0_1): Fix typo in call to sys_wcstombs.
- * miscfuncs.cc (next_char): Initialize ret to keep gcc happy.
-
-2008-02-10 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (DLL_OFILES): Add ntea.o.
- * cygwin.din (getxattr, listxattr, removexattr, setxattr, lgetxattr,
- llistxattr, lremovexattr, lsetxattr, fgetxattr, flistxattr,
- fremovexattr, fsetxattr): Export Linux extended attribute functions.
- Sort.
- * errno.cc (errmap): Add mappings for ERROR_EAS_DIDNT_FIT,
- ERROR_EAS_NOT_SUPPORTED, ERROR_EA_LIST_INCONSISTENT,
- ERROR_EA_TABLE_FULL, ERROR_FILE_CORRUPT, ERROR_INVALID_EA_NAME.
- * fhandler.h (class fhandler_base): Declare new fgetxattr and
- fsetxattr methods.
- (class fhandler_disk_file): Ditto.
- * fhandler.cc (fhandler_base::fgetxattr): New method.
- (fhandler_base::fsetxattr): New method.
- * fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): New method.
- (fhandler_disk_file::fsetxattr): New method.
- * ntdll.h (STATUS_EA_TOO_LARGE): Define.
- (STATUS_NONEXISTENT_EA_ENTRY): Define.
- (STATUS_NO_EAS_ON_FILE): Define.
- * ntea.cc (read_ea): Rewrite for long pathnames and for using with
- Linux extended attribute functions.
- (write_ea): Ditto.
- (getxattr_worker): New static function.
- (getxattr): New function.
- (lgetxattr): New function.
- (fgetxattr): New function.
- (listxattr): New function.
- (llistxattr): New function.
- (flistxattr): New function.
- (setxattr_worker): New static function.
- (setxattr): New function.
- (lsetxattr): New function.
- (fsetxattr): New function.
- (removexattr): New function.
- (lsetxattr): New function.
- (fsetxattr): New function.
- * security.h (read_ea): Change declaration according to above changes.
- (write_ea): Ditto.
- * include/cygwin/version.h: Bump API minor version.
-
-2008-02-10 Corinna Vinschen <corinna@vinschen.de>
-
- * libc/ftw.cc (ftw): Allow nfds <= 0 for glibc compatibility.
- * libc/nftw.c (nftw): Ditto.
-
-2008-02-07 Corinna Vinschen <corinna@vinschen.de>
-
- * dtable.cc (dtable::init_std_file_from_handle): Set access to
- read/write if handle is connected to a tty or console.
- * fhandler_dsp.cc (fhandler_dev_dsp::dup): Set open flags correctly
- after duplicating from archetype.
- * fhandler_tty.cc (fhandler_tty_slave::dup): Ditto.
- (fhandler_pty_master::dup): Ditto.
-
-2008-02-06 Corinna Vinschen <corinna@vinschen.de>
-
- * miscfuncs.cc (next_char): Fix typos in comment.
- * strfuncs.cc: Remove cygserver guards.
-
-2008-02-06 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.h (fhandler_console::trunc_buf): Add to use as cache for
- truncated multibyte characters on input.
- (fhandler_console::write_replacement_char): Declare new method.
- * fhandler_console.cc (CONVERT_LIMIT): Raise to 64K.
- (fhandler_console::fhandler_console): Initialize trunc_buf.
- (ERR): Define as independent value again.
- (fhandler_console::write_replacement_char): New method to print
- replacement chars.
- (fhandler_console::write_normal): Add handling for truncated multibyte
- sequences. Call next_char instead of pathetic CharNextExA function.
- Don't change src, rather just work with found later on.
- * miscfuncs.cc (is_cp_multibyte): Move here from strfuncs.cc.
- Don't call Windows function, restrict to well-known ANSI/OEM codepages
- and UTF-8.
- (next_char): Call CharNextExA only for doublebyte codepages.
- Implement for UTF-8 here.
- * strfuncs.cc (is_cp_multibyte): Move to miscfuncs.cc.
- * winsup.h (next_char): Declare.
- * include/limits.h (MB_LEN_MAX): Set to maximum value of MB_CUR_MAX
- as defined by newlib for now.
-
-2008-02-05 Corinna Vinschen <corinna@vinschen.de>
-
- * autoload.cc (CharToOemA): Remove.
- (CharNextExA): Define.
- * environ.cc (codepage_init): Un-static. Set active_codepage to
- active codepage. Default to ansi regardless of buf pointer.
- * fhandler.h (dev_console::get_console_cp): New method.
- (dev_console::con_to_str): Change declaration according to new
- implementation.
- (dev_console::str_to_con): Ditto.
- * fhandler_console.cc (cp_convert): Remove.
- (dev_console::con_to_str): Redefine to take WCHAR as incoming console
- char.
- (dev_console::get_console_cp): Return correct codepage according to
- alternate_charset_active setting.
- (dev_console::str_to_con): Redefine to create WCHAR buffer for console
- output.
- (fhandler_console::read): Read console input as WCHARs.
- (base_chars): Fix typo in comment.
- (fhandler_console::char_command): Save and restore console output
- buffer using UNICODE functions.
- (fhandler_console::write_normal): Convert to write output in UNICODE.
- Use CharNextExA to recognize multibyte characters in input. Workaround
- problem with UTF-8 and MultiByteToWideChar. Simplify the loop for
- printing "normal" characters.
- * strfuncs.cc (active_codepage): New variable to store active codepage.
- (get_cp): Call codepage_init() if active_codepage is uninitialized.
- Just return active_codepage.
- (is_cp_multibyte): New function.
- * winsup.h (active_codepage): Declare.
- (codepage_init): Declare.
- (is_cp_multibyte): Declare.
-
-2008-02-03 Brian Dessent <brian@dessent.net>
-
- * smallprint.cc (__small_vsprintf): Use HEAP_NOTHEAP for type.
- * strfuncs.cc (sys_wcstombs_alloc): Guard use of ccalloc
- to !__OUTSIDE_CYGWIN__ for use in cygserver.
- (sys_mbstowcs_alloc): Ditto.
-
-2008-02-01 Corinna Vinschen <corinna@vinschen.de>
-
- * miscfuncs.cc (cygwin_wcsncasecmp): Never access more than n
- characters.
- (cygwin_strncasecmp): Ditto. Fix for strings longer than n.
-
-2008-02-01 Corinna Vinschen <corinna@vinschen.de>
-
- * string.h: Re-enable inline strcasematch and strncasematch
- implementations and rename to ascii_strcasematch/ascii_strncasematch.
- * dcrt0.cc: Replace str[n]casematch with ascii_str[n]casematch where
- applicable.
- * environ.cc: Ditto.
- * fhandler_process.cc: Ditto.
- * hookapi.cc: Ditto.
- * path.cc: Ditto.
- * spawn.cc: Ditto.
- * strace.cc: Ditto.
- * syscalls.cc: Ditto.
- * uinfo.cc: Ditto.
- * winf.cc: Ditto.
-
-2008-01-31 Corinna Vinschen <corinna@vinschen.de>
-
- * dcrt0.cc (dll_crt0_1): Use GetCommandLineW and convert to current
- codepage.
- * environ.cc (set_file_api_mode): Always set file api to ANSI if not
- using the OEM codepage.
- (codepage_init): Allow "utf8" codepage.
- * fhandler_clipboard.cc (set_clipboard): Convert clipbuf to void and
- cast as needed. Always convert input to wide char and write
- CF_UNICODETEXT to clipboard.
- (fhandler_dev_clipboard::read): Read CF_UNICODETEXT from clipboard and
- convert to current codepage if CYGWIN_NATIVE format is not available.
- * fhandler_console.cc: Drop redundant undef.
- * smallprint.cc (__small_vsprintf): Convert PWCHAR and UNICODE_STRING
- to current codepage for printing.
- * strfuncs.cc: Use PWCHAR throughout.
- (get_cp): Return CP_UTF8 for utf8_cp codepage setting.
- (sys_wcstombs): Allow NULL target buffer.
- (sys_wcstombs_alloc): New function.
- (sys_mbstowcs_alloc): Ditto.
- * winsup.h (codepage_type): Add utf8_cp.
- (HEAP_NOTHEAP): Define.
- (sys_wcstombs_alloc): Declare.
- (sys_mbstowcs_alloc): Declare.
-
-2008-01-31 Corinna Vinschen <corinna@vinschen.de>
-
- * cygheap.h (struct cwdstuff): Add dir member to store cwd handle.
- (cwdstuff::get_handle): New method.
- * path.cc (cwdstuff::set): When doit is true, always try to get
- directory handle. Fail if duplicating handle fails. Store handle
- in dir. Fix potential SEGV when setting drive_length.
-
-2008-01-28 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc: Fix Samba version in comment.
-
-2008-01-24 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (fs_info::update): Fix old-style Samba test to support
- recent as well as upcoming Samba releases.
-
-2008-01-22 Corinna Vinschen <corinna@vinschen.de>
-
- * ntdll.h (struct _FILE_FS_OBJECTID_INFORMATION): Define.
- * path.cc (struct smb_extended_info): Define.
- (fs_info::update): Request object id info to get Samba information.
- Set flags according to new implementation.
- * path.h (struct fs_info): Add samba_version to status_flags.
- Implement flags() and samba_version() using IMPLEMENT_STATUS_FLAG.
-
-2008-01-21 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler_disk_file.cc (fhandler_disk_file::link): Open file with
- READ_CONTROL for Vista/Longhorn's sake.
-
-2008-01-15 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (install-libs): Overwrite newlib's libg.a with symlink
- to libcygwin.a.
-
-2008-01-15 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (DLL_OFILES): Remove memmem.o.
- * memmem.cc: Remove in favor of newlib implementation.
-
-2008-01-07 Corinna Vinschen <corinna@vinschen.de>
-
- * fhandler.h: Update copyright.
- * include/limits.h: Ditto.
-
-2008-01-06 Christopher Faylor <me+cygwin@cgf.cx>
-
- * fhandler.h (fhandler_base::is_tty): Make bool.
- (fhandler_serial::is_tty): Ditto.
- (fhandler_termios::is_tty): Ditto.
- (fhandler_base::is_slow): Return bool value.
- (fhandler_socket::is_slow): Ditto.
- (fhandler_serial::is_slow): Ditto.
- (fhandler_console::is_slow): Ditto.
- (fhandler_tty_common::is_slow): Ditto.
- (fhandler_tty_master::is_slow): Ditto.
- (fhandler_dev_null::is_slow): Ditto.
-
-2008-01-06 Christopher Faylor <me+cygwin@cgf.cx>
-
- * include/limits.h (TTY_NAME_MAX): Increase size to same as linux to
- allow for (at least) null terminating byte for "/dev/console".
-
-2008-01-01 Christopher Faylor <me+cygwin@cgf.cx>
-
- * tty.cc: Update copyright.
- * pipe.cc: Ditto.
-
-2008-01-01 Christopher Faylor <me+cygwin@cgf.cx>
-
- * newsym: First stab at understanding data as well as functions.
-
- * pipe.cc (fhandler_pipe::init): Move more intelligence here.
- (fhandler_pipe::create): Simplify based on above change.
-
- * tty.cc (tty_list::allocate): Remove non-NT code.
diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
deleted file mode 100644
index e9b96629cd2..00000000000
--- a/winsup/cygwin/Makefile.in
+++ /dev/null
@@ -1,478 +0,0 @@
-# Makefile.in for Cygwin.
-# Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008 Red Hat, Inc.
-#
-# This file is part of Cygwin.
-#
-# This software is a copyrighted work licensed under the terms of the
-# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-# details.
-
-# This makefile requires GNU make.
-
-SHELL:=@SHELL@
-srcdir:=@srcdir@
-objdir:=.
-
-CONFIG_DIR:=$(srcdir)/config/@CONFIG_DIR@
-VPATH:=$(srcdir):$(CONFIG_DIR):$(srcdir)/regex:$(srcdir)/regexp:$(srcdir)/lib:$(srcdir)/libc
-
-target_alias:=@target_alias@
-build_alias:=@build_alias@
-host_alias:=@host_alias@
-prefix:=@prefix@
-
-program_transform_name:=@program_transform_name@
-exec_prefix:=@exec_prefix@
-bindir:=@bindir@
-libdir:=@libdir@
-mandir:=@mandir@
-sysconfdir:=@sysconfdir@
-ifeq ($(target_alias),$(host_alias))
-ifeq ($(build_alias),$(host_alias))
-tooldir:=$(exec_prefix)
-else
-tooldir:=$(exec_prefix)/$(target_alias)
-endif
-else
-tooldir:=$(exec_prefix)/$(target_alias)
-endif
-datadir:=@datadir@
-infodir:=@infodir@
-includedir:=@includedir@
-
-override INSTALL:=@INSTALL@
-override INSTALL_PROGRAM:=@INSTALL_PROGRAM@
-override INSTALL_DATA:=@INSTALL_DATA@
-
-#
-# --enable options from configure
-#
-MT_SAFE:=@MT_SAFE@
-DEFS:=@DEFS@
-CCEXTRA:=
-CC:=@CC@
-# FIXME: Which is it, CC or CC_FOR_TARGET?
-CC_FOR_TARGET:=$(CC)
-CFLAGS=@CFLAGS@
-override CFLAGS+=-MMD ${$(*F)_CFLAGS} -fmerge-constants -ftracer $(CCEXTRA)
-CXX=@CXX@
-override CXXFLAGS=@CXXFLAGS@
-
-AR:=@AR@
-AR_FLAGS:=qv
-RANLIB:=@RANLIB@
-LD:=@LD@
-DLLTOOL:=@DLLTOOL@
-WINDRES:=@WINDRES@
-AS:=@AS@
-NM:=@NM@
-OBJCOPY:=@OBJCOPY@
-OBJDUMP:=@OBJDUMP@
-STRIP:=@STRIP@
-LDSCRIPT:=cygwin.sc
-MKDIRP:=$(INSTALL) -m 755 -d
-
-#
-# Include common definitions for winsup directory
-#
-include $(srcdir)/../Makefile.common
-
-@SET_MAKE@
-
-# Setup the testing framework, if you have one
-EXPECT = `if [ -f $${rootme}/../../expect/expect$(EXEEXT) ] ; then \
- echo $${rootme}/../../expect/expect$(EXEEXT) ; \
- else echo expect ; fi`
-
-RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
- echo $${srcdir}/../dejagnu/runtest ; \
- else echo runtest; fi`
-RUNTESTFLAGS =
-
-# Parameters used in building the cygwin.dll.
-# We build as cygwin0.dll and rename at install time to overcome
-# native rebuilding issues (we don't want the build tools to see a partially
-# built cygwin.dll and attempt to use it instead of the old one).
-
-DLL_NAME:=cygwin1.dll
-TEST_DLL_NAME:=cygwin0.dll
-TEST_LIB_NAME:=libcygwin0.a
-DEF_FILE:=cygwin.def
-DLL_ENTRY:=@DLL_ENTRY@
-
-LIBGMON_A:=libgmon.a
-CYGWIN_START:=crt0.o
-GMON_START:=gcrt0.o
-
-# Some things want these from libc, but they have their own static
-# data which apps can get to, which is a pain in the dll, so we
-# include them directly into the library.
-
-LIBCOS:=${sort ${addsuffix .o,${basename ${notdir ${wildcard $(srcdir)/lib/*.c}}}} \
- ${addsuffix .o,${basename ${notdir ${wildcard $(srcdir)/lib/*.cc}}}}}
-
-# Build all source files in the config directory
-
-EXTRA_DLL_OFILES:=${addsuffix .o,${basename ${notdir ${wildcard $(CONFIG_DIR)/*.c}}}}
-
-EXTRA_OFILES:=
-
-MALLOC_OFILES:=@MALLOC_OFILES@
-
-DLL_IMPORTS:=$(w32api_lib)/libkernel32.a $(w32api_lib)/libadvapi32.a $(w32api_lib)/libntdll.a
-
-MT_SAFE_OBJECTS:=
-# Please maintain this list in sorted order, with maximum files per 86 col line
-#
-DLL_OFILES:=assert.o autoload.o bsdlib.o ctype.o cxx.o cygheap.o cygthread.o \
- cygtls.o dcrt0.o debug.o devices.o dir.o dlfcn.o dll_init.o \
- dtable.o environ.o errno.o exceptions.o exec.o external.o fcntl.o \
- fhandler.o fhandler_clipboard.o fhandler_console.o fhandler_disk_file.o \
- fhandler_dsp.o fhandler_fifo.o fhandler_floppy.o fhandler_mailslot.o \
- fhandler_mem.o fhandler_netdrive.o fhandler_nodevice.o fhandler_proc.o \
- fhandler_process.o fhandler_procnet.o fhandler_random.o fhandler_raw.o \
- fhandler_registry.o fhandler_serial.o fhandler_socket.o fhandler_tape.o \
- fhandler_termios.o fhandler_tty.o fhandler_virtual.o fhandler_windows.o \
- fhandler_zero.o flock.o fnmatch.o fork.o fts.o ftw.o getopt.o glob.o \
- grp.o heap.o hookapi.o inet_addr.o inet_network.o init.o ioctl.o ipc.o \
- kernel32.o localtime.o lsearch.o malloc_wrapper.o minires-os-if.o \
- minires.o miscfuncs.o mktemp.o mmap.o msg.o mount.o net.o netdb.o nfs.o \
- nftw.o ntea.o passwd.o path.o pinfo.o pipe.o poll.o posix_ipc.o \
- pthread.o random.o regcomp.o regerror.o regexec.o regfree.o registry.o \
- resource.o rexec.o rcmd.o scandir.o sched.o sec_acl.o sec_auth.o \
- sec_helper.o security.o select.o sem.o shared.o shm.o sigfe.o signal.o \
- sigproc.o smallprint.o spawn.o strace.o strfuncs.o strptime.o strsep.o \
- strsig.o sync.o syscalls.o sysconf.o syslog.o termios.o thread.o \
- timer.o times.o tls_pbuf.o tty.o uinfo.o uname.o wait.o wincap.o \
- window.o winf.o xsique.o \
- $(EXTRA_DLL_OFILES) $(EXTRA_OFILES) $(MALLOC_OFILES) $(MT_SAFE_OBJECTS)
-
-GMON_OFILES:=gmon.o mcount.o profil.o
-
-OBSOLETE_FUNCTIONS:=open acl aclcheck aclfrommode aclfrompbits \
- aclfromtext aclsort acltomode acltopbits \
- acltotext chown facl fchown fcntl fdopen fgetpos fopen \
- freopen fseeko fsetpos fstat ftello ftruncate \
- getegid geteuid getgid getgrent getgrgid getgrnam \
- getgroups getpwuid getpwuid_r getuid initgroups \
- lchown lseek lstat mknod mmap seekdir setegid seteuid \
- setgid setgroups setregid setreuid setuid stat \
- telldir tmpfile truncate timezone
-
-NEW_FUNCTIONS:=open _open64 \
- acl _acl32 \
- aclcheck _aclcheck32 \
- aclfrommode _aclfrommode32 \
- aclfrompbits _aclfrompbits32 \
- aclfromtext _aclfromtext32 \
- aclsort _aclsort32 \
- acltomode _acltomode32 \
- acltopbits _acltopbits32 \
- acltotext _acltotext32 \
- chown _chown32 \
- facl _facl32 \
- fchown _fchown32 \
- fcntl _fcntl64 \
- fdopen _fdopen64 \
- fgetpos _fgetpos64 \
- fopen _fopen64 \
- freopen _freopen64 \
- fseeko _fseeko64 \
- fsetpos _fsetpos64 \
- fstat _fstat64 \
- ftello _ftello64 \
- ftruncate _ftruncate64 \
- getegid _getegid32 \
- geteuid _geteuid32 \
- getgid _getgid32 \
- getgrent _getgrent32 \
- getgrgid _getgrgid32 \
- getgrnam _getgrnam32 \
- getgroups _getgroups32 \
- getpwuid _getpwuid32 \
- getpwuid_r _getpwuid_r32 \
- getuid _getuid32 \
- initgroups _initgroups32 \
- lchown _lchown32 \
- lseek _lseek64 \
- lstat _lstat64 \
- mknod _mknod32 \
- mmap _mmap64 \
- seekdir _seekdir64 \
- setegid _setegid32 \
- seteuid _seteuid32 \
- setgid _setgid32 \
- setgroups _setgroups32 \
- setregid _setregid32 \
- setreuid _setreuid32 \
- setuid _setuid32 \
- stat _stat64 \
- telldir _telldir64 \
- tmpfile _tmpfile64 \
- truncate _truncate64
-
-API_VER:=$(srcdir)/include/cygwin/version.h
-
-PWD:=${shell pwd}
-LIB_NAME:=$(PWD)/libcygwin.a
-LIBSERVER:=@LIBSERVER@
-SUBLIBS:=$(PWD)/libpthread.a $(PWD)/libutil.a $(PWD)/libm.a $(PWD)/libc.a $(PWD)/libdl.a $(PWD)/libresolv.a
-EXTRALIBS:=libautomode.a libbinmode.a libtextmode.a libtextreadmode.a
-INSTOBJS:=automode.o binmode.o textmode.o textreadmode.o
-TARGET_LIBS:=$(LIB_NAME) $(CYGWIN_START) $(GMON_START) $(LIBGMON_A) $(SUBLIBS) $(INSTOBJS) $(EXTRALIBS)
-
-ifneq "${filter -O%,$(CFLAGS)}" ""
-cygheap_CFLAGS:=-fomit-frame-pointer
-cygthread_CFLAGS:=-fomit-frame-pointer
-cygtls_CFLAGS:=-fomit-frame-pointer
-delqueue_CFLAGS:=-fomit-frame-pointer
-devices_CFLAGS:=-fomit-frame-pointer -Os
-dir_CFLAGS:=-fomit-frame-pointer
-dlfcn_CFLAGS:=-fomit-frame-pointer
-dll_init_CFLAGS:=-fomit-frame-pointer
-dtable_CFLAGS:=-fomit-frame-pointer -fcheck-new
-fcntl_CFLAGS:=-fomit-frame-pointer
-fhandler_CFLAGS:=-fomit-frame-pointer
-fhandler_clipboard_CFLAGS:=-fomit-frame-pointer
-fhandler_console_CFLAGS:=-fomit-frame-pointer
-fhandler_disk_file_CFLAGS:=-fomit-frame-pointer
-fhandler_dsp_CFLAGS:=-fomit-frame-pointer
-fhandler_floppy_CFLAGS:=-fomit-frame-pointer
-fhandler_mem_CFLAGS:=-fomit-frame-pointer
-fhandler_netdrive_CFLAGS:=-fomit-frame-pointer
-fhandler_proc_CFLAGS:=-fomit-frame-pointer
-fhandler_process_CFLAGS:=-fomit-frame-pointer
-fhandler_random_CFLAGS:=-fomit-frame-pointer
-fhandler_raw_CFLAGS:=-fomit-frame-pointer
-fhandler_registry_CFLAGS:=-fomit-frame-pointer
-fhandler_serial_CFLAGS:=-fomit-frame-pointer
-fhandler_socket_CFLAGS:=-fomit-frame-pointer
-fhandler_syslog_CFLAGS:=-fomit-frame-pointer
-fhandler_tape_CFLAGS:=-fomit-frame-pointer
-fhandler_termios_CFLAGS:=-fomit-frame-pointer
-fhandler_tty_CFLAGS:=-fomit-frame-pointer
-fhandler_virtual_CFLAGS:=-fomit-frame-pointer
-fhandler_windows_CFLAGS:=-fomit-frame-pointer
-fhandler_zero_CFLAGS:=-fomit-frame-pointer
-flock_CFLAGS:=-fomit-frame-pointer
-grp_CFLAGS:=-fomit-frame-pointer
-malloc_CFLAGS:=-fomit-frame-pointer
-malloc_wrapper_CFLAGS:=-fomit-frame-pointer
-miscfuncs_CFLAGS:=-fomit-frame-pointer
-net_CFLAGS:=-fomit-frame-pointer
-passwd_CFLAGS:=-fomit-frame-pointer
-regcomp_CFLAGS=-fomit-frame-pointer
-regerror_CFLAGS=-fomit-frame-pointer
-regexec_CFLAGS=-fomit-frame-pointer
-regfree_CFLAGS=-fomit-frame-pointer
-shared_CFLAGS:=-fomit-frame-pointer
-sync_CFLAGS:=-fomit-frame-pointer -O3
-smallprint_CFLAGS:=-fomit-frame-pointer
-syscalls_CFLAGS:=-fomit-frame-pointer
-sysconf_CFLAGS:=-fomit-frame-pointer
-uinfo_CFLAGS:=-fomit-frame-pointer
-endif
-
-.PHONY: all force dll_ofiles install all_target install_target all_host install_host \
- install install-libs install-headers
-
-.SUFFIXES:
-.SUFFIXES: .c .cc .def .a .o .d .s
-
-all_host=@all_host@
-install_host=@install_host@
-
-all: all_target $(all_host)
-
-all_target: $(TARGET_LIBS)
-
-all_host: $(TEST_LIB_NAME)
-
-force:
-
-install: install-libs install-headers install-man install_target \
- $(install_host) $(install_target)
-
-uninstall: uninstall-libs uninstall-headers uninstall-man
-
-install-libs: $(TARGET_LIBS)
- @$(MKDIRP) $(bindir)
- $(INSTALL_PROGRAM) $(TEST_DLL_NAME) $(bindir)/$(DLL_NAME); \
- for i in $^; do \
- $(INSTALL_DATA) $$i $(tooldir)/lib/`basename $$i` ; \
- done
- cd $(tooldir)/lib && ln -sf libcygwin.a libg.a
-
-install-headers:
- cd $(srcdir); \
- for sub in `find include -name '[a-z]*' -type d -print | sort`; do \
- $(MKDIRP) $(tooldir)/$$sub; \
- for i in $$sub/*.h ; do \
- $(INSTALL_DATA) $$i $(tooldir)/$$sub/`basename $$i` ; \
- done ; \
- done ; \
- $(INSTALL_DATA) regex/regex.h $(tooldir)/include/regex.h
-
-install-man:
- @$(MKDIRP) $(mandir)/man2 $(mandir)/man3 $(mandir)/man5 $(mandir)/man7
- cd $(srcdir); \
- for i in `find . -type f -name '*.2'`; do \
- $(INSTALL_DATA) $$i $(mandir)/man2/`basename $$i` ; \
- done; \
- for i in `find . -type f -name '*.3'`; do \
- $(INSTALL_DATA) $$i $(mandir)/man3/`basename $$i` ; \
- done; \
- for i in `find . -type f -name '*.5'`; do \
- $(INSTALL_DATA) $$i $(mandir)/man5/`basename $$i` ; \
- done; \
- for i in `find . -type f -name '*.7'`; do \
- $(INSTALL_DATA) $$i $(mandir)/man7/`basename $$i` ; \
- done
-
-install_target:
-
-install_host:
-
-uninstall-libs: $(TARGET_LIBS)
- rm -f $(bindir)/$(DLL_NAME); \
- for i in $^; do \
- rm -f $(tooldir)/lib/$$i ; \
- done
-
-uninstall-headers:
- cd $(srcdir); \
- for sub in `find include -name '[a-z]*' -type d -print | sort`; do \
- for i in $$sub/*.h ; do \
- rm -f $(tooldir)/$$sub/`basename $$i` ; \
- done ; \
- done ; \
- rm -f $(tooldir)/include/regex.h
-
-uninstall-man:
- cd $(srcdir); \
- for i in `find . -type f -name '*.2'`; do \
- rm -f $(tooldir)/man/man2/`basename $$i` ; \
- done; \
- for i in `find . -type f -name '*.3'`; do \
- rm -f $(tooldir)/man/man3/`basename $$i` ; \
- done; \
- for i in `find . -type f -name '*.5'`; do \
- rm -f $(tooldir)/man/man5/`basename $$i` ; \
- done; \
- for i in `find . -type f -name '*.7'`; do \
- rm -f $(tooldir)/man/man7/`basename $$i` ; \
- done
-
-clean:
- -rm -f *.o *.dll *.dbg *.a *.exp junk *.base version.cc regexp/*.o winver_stamp *.exe *.d *stamp* *_magic.h sigfe.s cygwin.def
- -@$(MAKE) -C $(bupdir)/cygserver libclean
-
-maintainer-clean realclean: clean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
- -rm -fr configure
-
-
-# Rule to build cygwin.dll
-$(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg $(DLL_OFILES) $(DLL_IMPORTS) $(LIBSERVER) $(LIBC) $(LIBM) $(API_VER) Makefile winver_stamp
- $(CXX) $(CXXFLAGS) -Wl,--gc-sections $(nostdlib) -Wl,-T$(firstword $^) \
- -Wl,--heap=0 -Wl,--out-implib,cygdll.a -shared -o $@ \
- -e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) version.o winver.o \
- $(MALLOC_OBJ) $(LIBSERVER) $(LIBM) $(LIBC) \
- -lgcc $(DLL_IMPORTS)
- @$(word 2,$^) $(OBJDUMP) $(OBJCOPY) $@ ${patsubst %0.dll,%1.dbg,$@}
- @ln -f $@ new-$(DLL_NAME)
-
-# Rule to build libcygwin.a
-$(LIB_NAME): rmsym newsym $(TEST_DLL_NAME) $(LIBCOS)
- /bin/sh ${word 1,$^} ./cygdll.a "$(NM)" "$(AR)" $(OBSOLETE_FUNCTIONS) || exit 0
- /bin/sh ${word 2,$^} ./cygdll.a "$(AS)" "$(AR)" $(NEW_FUNCTIONS) || exit 0
- (echo create $(LIB_NAME); echo addmod $(LIBCOS); echo addlib cygdll.a; echo save) | $(AR) -M
- $(RANLIB) $@
-
-# Rule to make stub library used by testsuite
-# dependency set to $(LIB_NAME) to accommodate make -j2.
-# Otherwise dlltool gets confused. cgf (11-16-2000)
-$(TEST_LIB_NAME): $(LIB_NAME)
- perl -p -e 'BEGIN{binmode(STDIN); binmode(STDOUT);}; s/cygwin1/cygwin0/g' < $? > $@
-
-$(LIBSERVER): $(bupdir)/cygserver/Makefile
- $(MAKE) -C $(bupdir)/cygserver libcygserver.a
-
-dll_ofiles: $(DLL_OFILES)
-
-$(LIBGMON_A): $(GMON_OFILES) $(GMON_START)
- $(AR) rcv $(LIBGMON_A) $(GMON_OFILES)
-
-$(API_VER): $(srcdir)/cygwin.din
- @echo Error: Version info is older than DLL API!
-
-version.cc winver.o: winver_stamp
- @ :
-
-shared_info_magic.h: cygmagic shared_info.h
- /bin/sh ${word 1,$^} $@ "$(CC) -x c" ${word 2,$^} USER_MAGIC 'class user_info' SHARED_MAGIC 'class shared_info'
-
-child_info_magic.h: cygmagic child_info.h
- /bin/sh ${word 1,$^} $@ "$(CC) -x c" ${word 2,$^} CHILD_INFO_MAGIC 'class child_info'
-
-dcrt0.o sigproc.o: child_info_magic.h
-
-shared.o: shared_info_magic.h
-
-$(srcdir)/qevices.cc: cygwin-gperf devices.gperf devices.h
- $^ > $@
-
-$(srcdir)/devices.cc: gendevices devices.in devices.h
- ${wordlist 1,2,$^} $@
-
-$(PWD)/libpthread.a: speclib $(LIB_NAME) pthread.o thread.o
- /bin/sh ${word 1, $^} $@ "${NM}" "$(AR)" ${wordlist 2, 99, $^}
-
-$(PWD)/libutil.a: speclib $(LIB_NAME) bsdlib.o
- /bin/sh ${word 1, $^} $@ "${NM}" "$(AR)" ${wordlist 2, 99, $^}
-
-$(PWD)/libm.a: speclib $(LIB_NAME) $(LIBM)
- /bin/sh ${word 1, $^} $@ "${NM}" "$(AR)" ${wordlist 2, 99, $^}
-
-$(PWD)/libc.a: speclib $(LIB_NAME) $(PWD)/libm.a libpthread.a libutil.a
- /bin/sh ${word 1, $^} -v $@ "${NM}" "$(AR)" ${wordlist 2, 99, $^}
-
-$(PWD)/libdl.a: speclib $(LIB_NAME) dlfcn.o
- /bin/sh ${word 1, $^} $@ "${NM}" "$(AR)" ${wordlist 2, 99, $^}
-
-$(PWD)/libresolv.a: speclib $(LIB_NAME) minires.o
- /bin/sh ${word 1, $^} $@ "${NM}" "$(AR)" ${wordlist 2, 99, $^}
-
-lib%.a: %.o
- $(AR) cru $@ $?
-
-winver_stamp: mkvers.sh include/cygwin/version.h winver.rc $(DLL_OFILES)
- @echo "Making version.o and winver.o";\
- $(SHELL) ${word 1,$^} ${word 2,$^} ${word 3,$^} $(WINDRES) && \
- $(COMPILE_CXX) -o version.o version.cc && \
- touch $@
-
-Makefile: cygwin.din
-
-$(DEF_FILE): gendef cygwin.din $(srcdir)/tlsoffsets.h
- $^ $@ sigfe.s
-
-$(srcdir)/tlsoffsets.h: gentls_offsets cygtls.h
- $^ $@ $(COMPILE_CXX)
-
-sigfe.s: $(DEF_FILE)
- @[ -s $@ ] || \
- { rm -f $(DEF_FILE); $(MAKE) -s -j1 $(DEF_FILE); }; \
- [ -s $@ ] && touch $@
-
-sigfe.o: sigfe.s
- $(CC) -c -o $@ $?
-
-winsup.h: config.h
-
-deps:=${wildcard *.d}
-ifneq (,$(deps))
-include $(deps)
-endif
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
deleted file mode 100644
index 1b5ac9f4ef5..00000000000
--- a/winsup/cygwin/cygwin.din
+++ /dev/null
@@ -1,1765 +0,0 @@
-LIBRARY "cygwin1.dll" BASE=0x61000000
-
-EXPORTS
-__argc DATA
-__argv DATA
-_check_for_executable DATA
-__check_rhosts_file DATA
-_ctype_ DATA
-__cygwin_environ DATA
-__cygwin_user_data DATA
-_daylight DATA
-h_errno DATA
-_impure_ptr DATA
-in6addr_any DATA
-in6addr_loopback DATA
-__mb_cur_max DATA
-optarg DATA
-opterr DATA
-optind DATA
-optopt DATA
-optreset DATA
-__progname DATA
-__rcmd_errstr DATA
-reent_data DATA
-sys_errlist = _sys_errlist DATA
-_sys_errlist DATA
-sys_nerr = _sys_nerr DATA
-_sys_nerr DATA
-_timezone DATA
-_tzname DATA
-_Exit SIGFE
-a64l NOSIGFE
-abort NOSIGFE
-_abort = abort SIGFE
-abs NOSIGFE
-_abs = abs NOSIGFE
-accept = cygwin_accept SIGFE
-access SIGFE
-_access = access SIGFE
-acl SIGFE
-_acl = acl SIGFE
-_acl32 = acl32 SIGFE
-aclcheck NOSIGFE
-_aclcheck = aclcheck NOSIGFE
-_aclcheck32 = aclcheck32 NOSIGFE
-aclfrommode SIGFE
-_aclfrommode = aclfrommode SIGFE
-_aclfrommode32 = aclfrommode32 SIGFE
-aclfrompbits SIGFE
-_aclfrompbits = aclfrompbits SIGFE
-_aclfrompbits32 = aclfrompbits32 SIGFE
-aclfromtext SIGFE
-_aclfromtext = aclfromtext SIGFE
-_aclfromtext32 = aclfromtext32 SIGFE
-aclsort SIGFE
-_aclsort = aclsort SIGFE
-_aclsort32 = aclsort32 SIGFE
-acltomode SIGFE
-_acltomode = acltomode SIGFE
-_acltomode32 = acltomode32 SIGFE
-acltopbits SIGFE
-_acltopbits = acltopbits SIGFE
-_acltopbits32 = acltopbits32 SIGFE
-acltotext SIGFE
-_acltotext = acltotext SIGFE
-_acltotext32 = acltotext32 SIGFE
-acos NOSIGFE
-_acos = acos NOSIGFE
-acosf NOSIGFE
-_acosf = acosf NOSIGFE
-acosh NOSIGFE
-_acosh = acosh NOSIGFE
-acoshf NOSIGFE
-_acoshf = acoshf NOSIGFE
-alarm SIGFE
-_alarm = alarm SIGFE
-_alloca NOSIGFE
-alphasort NOSIGFE
-_alphasort = alphasort NOSIGFE
-argz_add SIGFE
-__argz_add = argz_add SIGFE
-argz_add_sep SIGFE
-__argz_add_sep = argz_add_sep SIGFE
-argz_append SIGFE
-__argz_append = argz_append SIGFE
-argz_count NOSIGFE
-__argz_count = argz_count NOSIGFE
-argz_create SIGFE
-__argz_create = argz_create SIGFE
-argz_create_sep SIGFE
-__argz_create_sep = argz_create_sep SIGFE
-argz_delete SIGFE
-__argz_delete = argz_delete SIGFE
-argz_extract NOSIGFE
-__argz_extract = argz_extract NOSIGFE
-argz_insert SIGFE
-__argz_insert = argz_insert SIGFE
-argz_next NOSIGFE
-__argz_next = argz_next NOSIGFE
-argz_replace SIGFE
-__argz_replace = argz_replace SIGFE
-argz_stringify NOSIGFE
-__argz_stringify = argz_stringify NOSIGFE
-asctime SIGFE
-_asctime = asctime SIGFE
-asctime_r SIGFE
-_asctime_r = asctime_r SIGFE
-asin NOSIGFE
-_asin = asin NOSIGFE
-asinf NOSIGFE
-_asinf = asinf NOSIGFE
-asinh NOSIGFE
-_asinh = asinh NOSIGFE
-asinhf NOSIGFE
-_asinhf = asinhf NOSIGFE
-asnprintf SIGFE
-asprintf SIGFE
-_asprintf = asprintf SIGFE
-asprintf_r = _asprintf_r SIGFE
-_asprintf_r SIGFE
-__assert SIGFE
-__assert_func SIGFE
-__assertfail SIGFE
-atan NOSIGFE
-_atan = atan NOSIGFE
-atan2 NOSIGFE
-_atan2 = atan2 NOSIGFE
-atan2f NOSIGFE
-_atan2f = atan2f NOSIGFE
-atanf NOSIGFE
-_atanf = atanf NOSIGFE
-atanh NOSIGFE
-_atanh = atanh NOSIGFE
-atanhf NOSIGFE
-_atanhf = atanhf NOSIGFE
-atexit = cygwin_atexit SIGFE
-_atexit = cygwin_atexit SIGFE
-atof SIGFE
-_atof = atof SIGFE
-atoff SIGFE
-_atoff = atoff SIGFE
-atoi NOSIGFE
-_atoi = atoi NOSIGFE
-atol NOSIGFE
-_atol = atol NOSIGFE
-atoll NOSIGFE
-basename NOSIGFE
-bcmp NOSIGFE
-_bcmp = bcmp NOSIGFE
-bcopy NOSIGFE
-_bcopy = bcopy NOSIGFE
-bind = cygwin_bind SIGFE
-bindresvport = cygwin_bindresvport SIGFE
-bindresvport_sa = cygwin_bindresvport_sa SIGFE
-bsearch NOSIGFE
-_bsearch = bsearch NOSIGFE
-btowc NOSIGFE
-bzero NOSIGFE
-_bzero = bzero NOSIGFE
-cabs NOSIGFE
-_cabs = cabs NOSIGFE
-cabsf NOSIGFE
-_cabsf = cabsf NOSIGFE
-calloc SIGFE
-_calloc = calloc SIGFE
-cbrt NOSIGFE
-_cbrt = cbrt NOSIGFE
-cbrtf NOSIGFE
-_cbrtf = cbrtf NOSIGFE
-ceil NOSIGFE
-_ceil = ceil NOSIGFE
-ceilf NOSIGFE
-_ceilf = ceilf NOSIGFE
-cfgetispeed NOSIGFE
-cfgetospeed NOSIGFE
-cfsetispeed SIGFE
-cfsetospeed SIGFE
-chdir SIGFE
-_chdir = chdir SIGFE
-chmod SIGFE
-_chmod = chmod SIGFE
-chown SIGFE
-_chown = chown SIGFE
-_chown32 = chown32 SIGFE
-chroot SIGFE
-_chroot = chroot SIGFE
-cleanup_glue NOSIGFE
-clearerr SIGFE
-_clearerr = clearerr SIGFE
-clock SIGFE
-_clock = clock SIGFE
-clock_getres SIGFE
-clock_gettime SIGFE
-clock_setres SIGFE
-close SIGFE
-_close = close SIGFE
-closedir SIGFE
-_closedir = closedir SIGFE
-closelog SIGFE
-confstr NOSIGFE
-connect = cygwin_connect SIGFE
-copysign NOSIGFE
-_copysign = copysign NOSIGFE
-copysignf NOSIGFE
-_copysignf = copysignf NOSIGFE
-cos NOSIGFE
-_cos = cos NOSIGFE
-cosf NOSIGFE
-_cosf = cosf NOSIGFE
-cosh NOSIGFE
-_cosh = cosh NOSIGFE
-coshf NOSIGFE
-_coshf = coshf NOSIGFE
-creat SIGFE
-_creat = creat SIGFE
-ctermid SIGFE
-ctime SIGFE
-_ctime = ctime SIGFE
-ctime_r SIGFE
-_ctime_r = ctime_r SIGFE
-cuserid NOSIGFE
-_cuserid = cuserid NOSIGFE
-cwait SIGFE
-_cwait = cwait SIGFE
-cygwin32_attach_handle_to_fd = cygwin_attach_handle_to_fd SIGFE
-cygwin32_conv_to_full_posix_path = cygwin_conv_to_full_posix_path SIGFE
-cygwin32_conv_to_full_win32_path = cygwin_conv_to_full_win32_path SIGFE
-cygwin32_conv_to_posix_path = cygwin_conv_to_posix_path SIGFE
-cygwin32_conv_to_win32_path = cygwin_conv_to_win32_path SIGFE
-cygwin32_detach_dll = cygwin_detach_dll SIGFE_MAYBE
-cygwin32_internal = cygwin_internal SIGFE
-cygwin32_posix_path_list_p = cygwin_posix_path_list_p NOSIGFE
-cygwin32_posix_to_win32_path_list = cygwin_posix_to_win32_path_list SIGFE
-cygwin32_posix_to_win32_path_list_buf_size = cygwin_posix_to_win32_path_list_buf_size SIGFE
-cygwin32_split_path = cygwin_split_path NOSIGFE
-cygwin32_win32_to_posix_path_list = cygwin_win32_to_posix_path_list SIGFE
-cygwin32_win32_to_posix_path_list_buf_size = cygwin_win32_to_posix_path_list_buf_size SIGFE
-cygwin32_winpid_to_pid = cygwin_winpid_to_pid SIGFE
-cygwin_attach_handle_to_fd SIGFE
-cygwin_conv_path SIGFE
-cygwin_conv_path_list SIGFE
-cygwin_conv_to_full_posix_path SIGFE
-cygwin_conv_to_full_win32_path SIGFE
-cygwin_conv_to_posix_path SIGFE
-cygwin_conv_to_win32_path SIGFE
-cygwin_create_path SIGFE
-cygwin_detach_dll SIGFE_MAYBE
-cygwin_dll_init NOSIGFE
-cygwin_internal NOSIGFE
-cygwin_logon_user SIGFE
-cygwin_posix_path_list_p NOSIGFE
-cygwin_posix_to_win32_path_list SIGFE
-cygwin_posix_to_win32_path_list_buf_size SIGFE
-cygwin_set_impersonation_token SIGFE
-cygwin_split_path NOSIGFE
-cygwin_stackdump SIGFE
-cygwin_umount SIGFE
-cygwin_win32_to_posix_path_list SIGFE
-cygwin_win32_to_posix_path_list_buf_size SIGFE
-cygwin_winpid_to_pid SIGFE
-daemon SIGFE
-difftime NOSIGFE
-_difftime = difftime NOSIGFE
-dirfd SIGFE
-_dirfd = dirfd SIGFE
-dirname NOSIGFE
-div NOSIGFE
-_div = div NOSIGFE
-dlclose SIGFE
-dlerror NOSIGFE
-dlfork NOSIGFE
-_dll_crt0@0 NOSIGFE
-dll_crt0__FP11per_process NOSIGFE
-dll_dllcrt0 NOSIGFE
-dll_entry@12 NOSIGFE
-dll_noncygwin_dllcrt0 NOSIGFE
-dlopen SIGFE
-dlsym SIGFE
-dn_comp = __dn_comp SIGFE
-__dn_comp SIGFE
-dn_expand = __dn_expand SIGFE
-__dn_expand SIGFE
-dn_skipname = __dn_skipname SIGFE
-__dn_skipname SIGFE
-dprintf SIGFE
-drand48 NOSIGFE
-_drand48 = drand48 NOSIGFE
-drem NOSIGFE
-_drem = drem NOSIGFE
-dremf NOSIGFE
-_dremf = dremf NOSIGFE
-dup SIGFE
-_dup = dup SIGFE
-dup2 SIGFE
-_dup2 = dup2 SIGFE
-ecvt SIGFE
-_ecvt = ecvt SIGFE
-ecvtbuf SIGFE
-_ecvtbuf = ecvtbuf SIGFE
-ecvtf SIGFE
-_ecvtf = ecvtf SIGFE
-endgrent NOSIGFE
-_endgrent = endgrent NOSIGFE
-endhostent NOSIGFE
-endmntent NOSIGFE
-_endmntent = endmntent NOSIGFE
-endprotoent = cygwin_endprotoent SIGFE
-endpwent NOSIGFE
-_endpwent = endpwent NOSIGFE
-endservent = cygwin_endservent SIGFE
-endusershell SIGFE
-endutent SIGFE
-_endutent = endutent SIGFE
-endutxent SIGFE
-envz_add SIGFE
-__envz_add = envz_add SIGFE
-envz_entry NOSIGFE
-__envz_entry = envz_entry NOSIGFE
-envz_get NOSIGFE
-__envz_get = envz_get NOSIGFE
-envz_merge SIGFE
-__envz_merge = envz_merge SIGFE
-envz_remove SIGFE
-__envz_remove = envz_remove SIGFE
-envz_strip SIGFE
-__envz_strip = envz_strip SIGFE
-__eprintf SIGFE
-erand48 NOSIGFE
-_erand48 = erand48 NOSIGFE
-erf NOSIGFE
-_erf = erf NOSIGFE
-erfc NOSIGFE
-_erfc = erfc NOSIGFE
-erfcf NOSIGFE
-_erfcf = erfcf NOSIGFE
-erff NOSIGFE
-_erff = erff NOSIGFE
-err SIGFE
-__errno NOSIGFE
-errx SIGFE
-execl SIGFE
-_execl = execl SIGFE
-execle SIGFE
-_execle = execle SIGFE
-execlp SIGFE
-_execlp = execlp SIGFE
-execv SIGFE
-_execv = execv SIGFE
-execve SIGFE
-_execve = execve SIGFE
-execvp SIGFE
-_execvp = execvp SIGFE
-exit = cygwin_exit SIGFE
-_exit SIGFE
-exp NOSIGFE
-_exp = exp NOSIGFE
-exp10 NOSIGFE
-exp10f NOSIGFE
-exp2 NOSIGFE
-exp2f NOSIGFE
-expf NOSIGFE
-_expf = expf NOSIGFE
-expm1 NOSIGFE
-_expm1 = expm1 NOSIGFE
-expm1f NOSIGFE
-_expm1f = expm1f NOSIGFE
-_f_atan2 NOSIGFE
-__f_atan2 = _f_atan2 NOSIGFE
-_f_atan2f NOSIGFE
-__f_atan2f = _f_atan2f NOSIGFE
-_f_exp NOSIGFE
-__f_exp = _f_exp NOSIGFE
-_f_expf NOSIGFE
-__f_expf = _f_expf NOSIGFE
-_f_frexp NOSIGFE
-__f_frexp = _f_frexp NOSIGFE
-_f_frexpf NOSIGFE
-__f_frexpf = _f_frexpf NOSIGFE
-_f_ldexp NOSIGFE
-__f_ldexp = _f_ldexp NOSIGFE
-_f_ldexpf NOSIGFE
-__f_ldexpf = _f_ldexpf NOSIGFE
-_f_llrint NOSIGFE
-_f_llrintf NOSIGFE
-_f_llrintl NOSIGFE
-_f_log NOSIGFE
-__f_log = _f_log NOSIGFE
-_f_log10 NOSIGFE
-__f_log10 = _f_log10 NOSIGFE
-_f_log10f NOSIGFE
-__f_log10f = _f_log10f NOSIGFE
-_f_logf NOSIGFE
-__f_logf = _f_logf NOSIGFE
-_f_lrint NOSIGFE
-_f_lrintf NOSIGFE
-_f_lrintl NOSIGFE
-_f_pow NOSIGFE
-__f_pow = _f_pow NOSIGFE
-_f_powf NOSIGFE
-__f_powf = _f_powf NOSIGFE
-_f_rint NOSIGFE
-_f_rintf NOSIGFE
-_f_rintl NOSIGFE
-_f_tan NOSIGFE
-__f_tan = _f_tan NOSIGFE
-_f_tanf NOSIGFE
-__f_tanf = _f_tanf NOSIGFE
-fabs NOSIGFE
-_fabs = fabs NOSIGFE
-fabsf NOSIGFE
-_fabsf = fabsf NOSIGFE
-faccessat SIGFE
-facl SIGFE
-_facl = facl SIGFE
-_facl32 = facl32 SIGFE
-fchdir SIGFE
-_fchdir = fchdir SIGFE
-fchmod SIGFE
-_fchmod = fchmod SIGFE
-fchmodat SIGFE
-fchown SIGFE
-_fchown = fchown SIGFE
-_fchown32 = fchown32 SIGFE
-fchownat SIGFE
-fclose SIGFE
-_fclose = fclose SIGFE
-fcloseall SIGFE
-_fcloseall = fcloseall SIGFE
-fcloseall_r = _fcloseall_r SIGFE
-_fcloseall_r SIGFE
-fcntl SIGFE
-_fcntl = fcntl SIGFE
-_fcntl64 = fcntl64 SIGFE
-fcvt SIGFE
-_fcvt = fcvt SIGFE
-fcvtbuf SIGFE
-_fcvtbuf = fcvtbuf SIGFE
-fcvtf SIGFE
-_fcvtf = fcvtf SIGFE
-fdatasync SIGFE
-fdim NOSIGFE
-fdimf NOSIGFE
-fdopen SIGFE
-_fdopen = fdopen SIGFE
-_fdopen64 = fdopen64 SIGFE
-fdopendir SIGFE
-feof SIGFE
-_feof = feof SIGFE
-ferror SIGFE
-_ferror = ferror SIGFE
-fflush SIGFE
-_fflush = fflush SIGFE
-ffs NOSIGFE
-_ffs = ffs NOSIGFE
-fgetc SIGFE
-_fgetc = fgetc SIGFE
-fgetpos SIGFE
-_fgetpos = fgetpos SIGFE
-_fgetpos64 = fgetpos64 SIGFE
-fgets SIGFE
-_fgets = fgets SIGFE
-fgetxattr SIGFE
-fileno SIGFE
-_fileno = fileno SIGFE
-finite NOSIGFE
-_finite = finite NOSIGFE
-finitef NOSIGFE
-_finitef = finitef NOSIGFE
-fiprintf SIGFE
-_fiprintf = fiprintf SIGFE
-flistxattr SIGFE
-flock SIGFE
-flockfile SIGFE
-floor NOSIGFE
-_floor = floor NOSIGFE
-floorf NOSIGFE
-_floorf = floorf NOSIGFE
-fma NOSIGFE
-fmaf NOSIGFE
-fmax NOSIGFE
-fmaxf NOSIGFE
-fmemopen SIGFE
-fmin NOSIGFE
-fminf NOSIGFE
-fmod NOSIGFE
-_fmod = fmod NOSIGFE
-fmodf NOSIGFE
-_fmodf = fmodf NOSIGFE
-fnmatch NOSIGFE
-_fnmatch = fnmatch NOSIGFE
-fopen SIGFE
-_fopen = fopen SIGFE
-_fopen64 = fopen64 SIGFE
-fopencookie SIGFE
-fork SIGFE
-_fork = fork SIGFE
-forkpty SIGFE
-fpathconf SIGFE
-__fpclassifyd NOSIGFE
-__fpclassifyf NOSIGFE
-fprintf SIGFE
-_fprintf = fprintf SIGFE
-fputc SIGFE
-_fputc = fputc SIGFE
-fputs SIGFE
-_fputs = fputs SIGFE
-fread SIGFE
-_fread = fread SIGFE
-free SIGFE
-_free = free SIGFE
-freeaddrinfo = cygwin_freeaddrinfo SIGFE
-freeifaddrs SIGFE
-fremovexattr SIGFE
-freopen SIGFE
-_freopen = freopen SIGFE
-_freopen64 = freopen64 SIGFE
-frexp NOSIGFE
-_frexp = frexp NOSIGFE
-frexpf NOSIGFE
-_frexpf = frexpf NOSIGFE
-fscanf SIGFE
-_fscanf = fscanf SIGFE
-fscanf_r = _fscanf_r SIGFE
-_fscanf_r SIGFE
-fseek SIGFE
-_fseek = fseek SIGFE
-fseeko SIGFE
-_fseeko = fseeko SIGFE
-_fseeko64 = fseeko64 SIGFE
-fsetpos SIGFE
-_fsetpos = fsetpos SIGFE
-_fsetpos64 = fsetpos64 SIGFE
-fsetxattr SIGFE
-fstat SIGFE
-_fstat = fstat SIGFE
-_fstat64 = fstat64 SIGFE
-fstatat SIGFE
-fstatfs SIGFE
-_fstatfs = fstatfs SIGFE
-fstatvfs SIGFE
-fsync SIGFE
-_fsync = fsync SIGFE
-ftell SIGFE
-_ftell = ftell SIGFE
-ftello SIGFE
-_ftello = ftello SIGFE
-_ftello64 = ftello64 SIGFE
-ftime SIGFE
-_ftime = ftime SIGFE
-ftok SIGFE
-_ftok = ftok SIGFE
-ftruncate SIGFE
-_ftruncate = ftruncate SIGFE
-_ftruncate64 = ftruncate64 SIGFE
-ftrylockfile SIGFE
-fts_children SIGFE
-fts_close SIGFE
-fts_get_clientptr NOSIGFE
-fts_get_stream NOSIGFE
-fts_open SIGFE
-fts_read SIGFE
-fts_set NOSIGFE
-fts_set_clientptr NOSIGFE
-ftw SIGFE
-funlockfile SIGFE
-funopen SIGFE
-futimens SIGFE
-futimes SIGFE
-futimesat SIGFE
-fwrite SIGFE
-_fwrite = fwrite SIGFE
-gai_strerror = cygwin_gai_strerror NOSIGFE
-gamma NOSIGFE
-_gamma = gamma NOSIGFE
-gamma_r NOSIGFE
-_gamma_r = gamma_r NOSIGFE
-gammaf NOSIGFE
-_gammaf = gammaf NOSIGFE
-gammaf_r NOSIGFE
-_gammaf_r = gammaf_r NOSIGFE
-gcvt SIGFE
-_gcvt = gcvt SIGFE
-gcvtf SIGFE
-_gcvtf = gcvtf SIGFE
-get_osfhandle SIGFE
-_get_osfhandle = get_osfhandle SIGFE
-getaddrinfo = cygwin_getaddrinfo SIGFE
-getc SIGFE
-_getc = getc SIGFE
-getc_unlocked SIGFE
-_getc_unlocked = getc_unlocked SIGFE
-getchar SIGFE
-_getchar = getchar SIGFE
-getchar_unlocked SIGFE
-_getchar_unlocked = getchar_unlocked SIGFE
-getcwd SIGFE
-_getcwd = getcwd SIGFE
-getdelim = __getdelim SIGFE
-__getdelim SIGFE
-getdomainname SIGFE
-_getdomainname = getdomainname SIGFE
-getdtablesize NOSIGFE
-_getdtablesize = getdtablesize NOSIGFE
-getegid NOSIGFE
-_getegid = getegid NOSIGFE
-_getegid32 = getegid32 NOSIGFE
-getenv NOSIGFE
-_getenv = getenv NOSIGFE
-geteuid NOSIGFE
-_geteuid = geteuid NOSIGFE
-_geteuid32 = geteuid32 NOSIGFE
-getgid NOSIGFE
-_getgid = getgid NOSIGFE
-_getgid32 = getgid32 NOSIGFE
-getgrent SIGFE
-_getgrent = getgrent SIGFE
-_getgrent32 = getgrent32 SIGFE
-getgrgid SIGFE
-_getgrgid = getgrgid SIGFE
-_getgrgid32 = getgrgid32 SIGFE
-getgrgid_r SIGFE
-getgrnam SIGFE
-_getgrnam = getgrnam SIGFE
-_getgrnam32 = getgrnam32 SIGFE
-getgrnam_r SIGFE
-getgroups SIGFE
-_getgroups = getgroups SIGFE
-_getgroups32 = getgroups32 SIGFE
-gethostbyaddr = cygwin_gethostbyaddr SIGFE
-gethostbyname = cygwin_gethostbyname SIGFE
-gethostid SIGFE
-gethostname = cygwin_gethostname SIGFE
-_gethostname = cygwin_gethostname SIGFE
-getifaddrs SIGFE
-getitimer SIGFE
-getline = __getline SIGFE
-__getline SIGFE
-getlogin NOSIGFE
-_getlogin = getlogin NOSIGFE
-getlogin_r NOSIGFE
-getmntent SIGFE
-_getmntent = getmntent SIGFE
-getmode SIGFE
-_getmode = getmode SIGFE
-getnameinfo = cygwin_getnameinfo SIGFE
-getopt SIGFE
-getopt_long SIGFE
-getopt_long_only SIGFE
-getpagesize SIGFE
-_getpagesize = getpagesize SIGFE
-getpass SIGFE
-_getpass = getpass SIGFE
-getpeereid SIGFE
-getpeername = cygwin_getpeername SIGFE
-getpgid SIGFE
-getpgrp SIGFE
-_getpgrp = getpgrp SIGFE
-getpid NOSIGFE
-_getpid = getpid NOSIGFE
-getppid NOSIGFE
-_getppid = getppid NOSIGFE
-getpriority SIGFE
-getprogname NOSIGFE
-getprotobyname = cygwin_getprotobyname SIGFE
-getprotobynumber = cygwin_getprotobynumber SIGFE
-getprotoent = cygwin_getprotoent SIGFE
-getpwduid NOSIGFE
-_getpwduid = getpwduid NOSIGFE
-getpwent SIGFE
-_getpwent = getpwent SIGFE
-getpwnam SIGFE
-_getpwnam = getpwnam SIGFE
-getpwnam_r SIGFE
-getpwuid SIGFE
-_getpwuid = getpwuid SIGFE
-_getpwuid32 = getpwuid32 SIGFE
-getpwuid_r SIGFE
-_getpwuid_r32 = getpwuid_r32 SIGFE
-__getreent NOSIGFE
-getrlimit SIGFE
-_getrlimit = getrlimit SIGFE
-getrusage SIGFE
-_getrusage = getrusage SIGFE
-gets SIGFE
-_gets = gets SIGFE
-getservbyname = cygwin_getservbyname SIGFE
-getservbyport = cygwin_getservbyport SIGFE
-getservent = cygwin_getservent SIGFE
-getsid SIGFE
-getsockname = cygwin_getsockname SIGFE
-getsockopt = cygwin_getsockopt SIGFE
-getsubopt NOSIGFE
-gettimeofday SIGFE
-_gettimeofday = gettimeofday SIGFE
-getuid NOSIGFE
-_getuid = getuid NOSIGFE
-_getuid32 = getuid32 NOSIGFE
-getusershell SIGFE
-getutent SIGFE
-_getutent = getutent SIGFE
-getutid SIGFE
-_getutid = getutid SIGFE
-getutline SIGFE
-getutxent SIGFE
-getutxid SIGFE
-getutxline SIGFE
-getw SIGFE
-_getw = getw SIGFE
-getwd SIGFE
-_getwd = getwd SIGFE
-getxattr SIGFE
-glob SIGFE
-_glob = glob SIGFE
-globfree SIGFE
-_globfree = globfree SIGFE
-gmtime SIGFE
-_gmtime = gmtime SIGFE
-gmtime_r SIGFE
-_gmtime_r = gmtime_r SIGFE
-grantpt NOSIGFE
-hcreate SIGFE
-hcreate_r SIGFE
-hdestroy SIGFE
-hdestroy_r SIGFE
-herror = cygwin_herror SIGFE
-hsearch SIGFE
-hsearch_r SIGFE
-hstrerror = cygwin_hstrerror NOSIGFE
-htonl NOSIGFE
-_htonl = htonl NOSIGFE
-htons NOSIGFE
-_htons = htons NOSIGFE
-hypot NOSIGFE
-_hypot = hypot NOSIGFE
-hypotf NOSIGFE
-_hypotf = hypotf NOSIGFE
-if_freenameindex SIGFE
-if_indextoname SIGFE
-if_nameindex SIGFE
-if_nametoindex SIGFE
-ilogb NOSIGFE
-_ilogb = ilogb NOSIGFE
-ilogbf NOSIGFE
-_ilogbf = ilogbf NOSIGFE
-imaxabs = llabs NOSIGFE
-imaxdiv = lldiv NOSIGFE
-index NOSIGFE
-_index = index NOSIGFE
-inet_addr = cygwin_inet_addr SIGFE
-inet_aton = cygwin_inet_aton SIGFE
-inet_makeaddr NOSIGFE
-inet_netof NOSIGFE
-inet_network = cygwin_inet_network SIGFE
-inet_ntoa = cygwin_inet_ntoa SIGFE
-inet_ntop = cygwin_inet_ntop SIGFE
-inet_pton = cygwin_inet_pton SIGFE
-infinity NOSIGFE
-_infinity = infinity NOSIGFE
-__infinity NOSIGFE
-infinityf NOSIGFE
-_infinityf = infinityf NOSIGFE
-initgroups SIGFE
-_initgroups32 = initgroups32 SIGFE
-initstate NOSIGFE
-insque NOSIGFE
-ioctl SIGFE
-_ioctl = ioctl SIGFE
-iprintf SIGFE
-_iprintf = iprintf SIGFE
-iruserok SIGFE
-iruserok_sa SIGFE
-isalnum NOSIGFE
-_isalnum = isalnum NOSIGFE
-isalpha NOSIGFE
-_isalpha = isalpha NOSIGFE
-isascii NOSIGFE
-_isascii = isascii NOSIGFE
-isatty SIGFE
-_isatty = isatty SIGFE
-isblank NOSIGFE
-iscntrl NOSIGFE
-_iscntrl = iscntrl NOSIGFE
-isdigit NOSIGFE
-_isdigit = isdigit NOSIGFE
-isgraph NOSIGFE
-_isgraph = isgraph NOSIGFE
-isinf NOSIGFE
-_isinf = isinf NOSIGFE
-__isinfd NOSIGFE
-isinff NOSIGFE
-_isinff = isinff NOSIGFE
-__isinff NOSIGFE
-islower NOSIGFE
-_islower = islower NOSIGFE
-isnan NOSIGFE
-_isnan = isnan NOSIGFE
-__isnand NOSIGFE
-isnanf NOSIGFE
-_isnanf = isnanf NOSIGFE
-__isnanf NOSIGFE
-isprint NOSIGFE
-_isprint = isprint NOSIGFE
-ispunct NOSIGFE
-_ispunct = ispunct NOSIGFE
-isspace NOSIGFE
-_isspace = isspace NOSIGFE
-isupper NOSIGFE
-_isupper = isupper NOSIGFE
-iswalnum NOSIGFE
-iswalpha NOSIGFE
-iswblank NOSIGFE
-iswcntrl NOSIGFE
-iswctype NOSIGFE
-iswdigit NOSIGFE
-iswgraph NOSIGFE
-iswlower NOSIGFE
-iswprint NOSIGFE
-iswpunct NOSIGFE
-iswspace NOSIGFE
-iswupper NOSIGFE
-iswxdigit NOSIGFE
-isxdigit NOSIGFE
-_isxdigit = isxdigit NOSIGFE
-j0 NOSIGFE
-_j0 = j0 NOSIGFE
-j0f NOSIGFE
-_j0f = j0f NOSIGFE
-j1 NOSIGFE
-_j1 = j1 NOSIGFE
-j1f NOSIGFE
-_j1f = j1f NOSIGFE
-jn NOSIGFE
-_jn = jn NOSIGFE
-jnf NOSIGFE
-_jnf = jnf NOSIGFE
-jrand48 NOSIGFE
-_jrand48 = jrand48 NOSIGFE
-kill SIGFE
-_kill = kill SIGFE
-killpg SIGFE
-l64a NOSIGFE
-labs NOSIGFE
-_labs = labs NOSIGFE
-lacl SIGFE
-_lacl = lacl SIGFE
-lchown SIGFE
-_lchown = lchown SIGFE
-_lchown32 = lchown32 SIGFE
-lcong48 NOSIGFE
-_lcong48 = lcong48 NOSIGFE
-ldexp NOSIGFE
-_ldexp = ldexp NOSIGFE
-ldexpf NOSIGFE
-_ldexpf = ldexpf NOSIGFE
-ldiv NOSIGFE
-_ldiv = ldiv NOSIGFE
-lfind NOSIGFE
-lgamma NOSIGFE
-_lgamma = lgamma NOSIGFE
-lgamma_r NOSIGFE
-_lgamma_r = lgamma_r NOSIGFE
-lgammaf NOSIGFE
-_lgammaf = lgammaf NOSIGFE
-lgammaf_r NOSIGFE
-_lgammaf_r = lgammaf_r NOSIGFE
-lgetxattr SIGFE
-link SIGFE
-_link = link SIGFE
-linkat SIGFE
-listen = cygwin_listen SIGFE
-listxattr SIGFE
-llabs NOSIGFE
-lldiv NOSIGFE
-llistxattr SIGFE
-llrint = _f_llrint NOSIGFE
-llrintf = _f_llrintf NOSIGFE
-llrintl = _f_llrintl NOSIGFE
-localeconv NOSIGFE
-_localeconv = localeconv NOSIGFE
-localtime SIGFE
-_localtime = localtime SIGFE
-localtime_r SIGFE
-_localtime_r = localtime_r SIGFE
-lockf SIGFE
-log NOSIGFE
-_log = log NOSIGFE
-log10 NOSIGFE
-_log10 = log10 NOSIGFE
-log10f NOSIGFE
-_log10f = log10f NOSIGFE
-log1p NOSIGFE
-_log1p = log1p NOSIGFE
-log1pf NOSIGFE
-_log1pf = log1pf NOSIGFE
-logb NOSIGFE
-_logb = logb NOSIGFE
-logbf NOSIGFE
-_logbf = logbf NOSIGFE
-logf NOSIGFE
-_logf = logf NOSIGFE
-login SIGFE
-login_tty SIGFE
-logout SIGFE
-logwtmp SIGFE
-longjmp NOSIGFE
-_longjmp = longjmp NOSIGFE
-lrand48 NOSIGFE
-_lrand48 = lrand48 NOSIGFE
-lremovexattr SIGFE
-lrint = _f_lrint NOSIGFE
-lrintf = _f_lrintf NOSIGFE
-lrintl = _f_lrintl NOSIGFE
-lround NOSIGFE
-lroundf NOSIGFE
-lsearch NOSIGFE
-lseek SIGFE
-_lseek = lseek SIGFE
-_lseek64 = lseek64 SIGFE
-lsetxattr SIGFE
-lstat SIGFE
-_lstat = lstat SIGFE
-_lstat64 = lstat64 SIGFE
-lutimes SIGFE
-__main NOSIGFE
-mallinfo SIGFE
-malloc SIGFE
-_malloc = malloc SIGFE
-malloc_stats SIGFE
-malloc_trim SIGFE
-malloc_usable_size SIGFE
-mallopt SIGFE
-matherr NOSIGFE
-_matherr = matherr NOSIGFE
-mblen NOSIGFE
-_mblen = mblen NOSIGFE
-mbrlen NOSIGFE
-mbrtowc NOSIGFE
-mbsinit NOSIGFE
-mbsrtowcs NOSIGFE
-mbstowcs NOSIGFE
-_mbstowcs = mbstowcs NOSIGFE
-mbtowc NOSIGFE
-_mbtowc = mbtowc NOSIGFE
-memalign SIGFE
-memccpy NOSIGFE
-_memccpy = memccpy NOSIGFE
-memchr NOSIGFE
-_memchr = memchr NOSIGFE
-memcmp NOSIGFE
-_memcmp = memcmp NOSIGFE
-memcpy NOSIGFE
-_memcpy = memcpy NOSIGFE
-memmem NOSIGFE
-memmove NOSIGFE
-_memmove = memmove NOSIGFE
-mempcpy NOSIGFE
-__mempcpy = mempcpy NOSIGFE
-memset NOSIGFE
-_memset = memset NOSIGFE
-mkdir SIGFE
-_mkdir = mkdir SIGFE
-mkdirat SIGFE
-mkdtemp SIGFE
-mkfifo SIGFE
-mkfifoat SIGFE
-mknod SIGFE
-_mknod = mknod SIGFE
-_mknod32 = mknod32 SIGFE
-mknodat SIGFE
-mkstemp SIGFE
-_mkstemp = mkstemp SIGFE
-mktemp SIGFE
-_mktemp = mktemp SIGFE
-mktime SIGFE
-_mktime = mktime SIGFE
-mlock SIGFE
-mmap SIGFE
-_mmap64 = mmap64 SIGFE
-modf NOSIGFE
-_modf = modf NOSIGFE
-modff NOSIGFE
-_modff = modff NOSIGFE
-mount SIGFE
-_mount = mount SIGFE
-mprotect SIGFE
-mq_close SIGFE
-mq_getattr SIGFE
-mq_notify SIGFE
-mq_open SIGFE
-mq_receive SIGFE
-mq_send SIGFE
-mq_setattr SIGFE
-mq_timedreceive SIGFE
-mq_timedsend SIGFE
-mq_unlink SIGFE
-mrand48 NOSIGFE
-msgctl SIGFE
-msgget SIGFE
-msgrcv SIGFE
-msgsnd SIGFE
-msync SIGFE
-munlock SIGFE
-munmap SIGFE
-nan NOSIGFE
-_nan = nan NOSIGFE
-nanf NOSIGFE
-_nanf = nanf NOSIGFE
-nanosleep SIGFE
-_nanosleep = nanosleep SIGFE
-nearbyint NOSIGFE
-nearbyintf NOSIGFE
-nextafter NOSIGFE
-_nextafter = nextafter NOSIGFE
-nextafterf NOSIGFE
-_nextafterf = nextafterf NOSIGFE
-nftw SIGFE
-nice SIGFE
-_nice = nice SIGFE
-nl_langinfo SIGFE
-_nl_langinfo = nl_langinfo SIGFE
-nrand48 NOSIGFE
-_nrand48 = nrand48 NOSIGFE
-ntohl NOSIGFE
-_ntohl = ntohl NOSIGFE
-ntohs NOSIGFE
-_ntohs = ntohs NOSIGFE
-on_exit SIGFE
-open SIGFE
-_open = open SIGFE
-_open64
-open_memstream SIGFE
-openat SIGFE
-opendir SIGFE
-__opendir_with_d_ino SIGFE
-openlog SIGFE
-_openlog = openlog SIGFE
-openpty SIGFE
-pathconf SIGFE
-_pathconf = pathconf SIGFE
-pause SIGFE
-pclose SIGFE
-_pclose = pclose SIGFE
-perror SIGFE
-_perror = perror SIGFE
-pipe SIGFE
-_pipe SIGFE
-poll SIGFE
-_poll = poll SIGFE
-popen SIGFE
-_popen = popen SIGFE
-posix_fadvise SIGFE
-posix_fallocate SIGFE
-posix_madvise SIGFE
-posix_memalign SIGFE
-posix_openpt SIGFE
-posix_regcomp = regcomp SIGFE
-posix_regerror = regerror SIGFE
-posix_regexec = regexec SIGFE
-posix_regfree = regfree SIGFE
-pow NOSIGFE
-_pow = pow NOSIGFE
-pow10 NOSIGFE
-pow10f NOSIGFE
-powf NOSIGFE
-_powf = powf NOSIGFE
-pread SIGFE
-printf SIGFE
-_printf = printf SIGFE
-pselect SIGFE
-pthread_atfork SIGFE
-pthread_attr_destroy SIGFE
-pthread_attr_getdetachstate SIGFE
-pthread_attr_getinheritsched SIGFE
-pthread_attr_getschedparam SIGFE
-pthread_attr_getschedpolicy SIGFE
-pthread_attr_getscope SIGFE
-pthread_attr_getstacksize SIGFE
-pthread_attr_init SIGFE
-pthread_attr_setdetachstate SIGFE
-pthread_attr_setinheritsched SIGFE
-pthread_attr_setschedparam SIGFE
-pthread_attr_setschedpolicy SIGFE
-pthread_attr_setscope SIGFE
-pthread_attr_setstacksize SIGFE
-pthread_cancel SIGFE
-_pthread_cleanup_pop SIGFE
-_pthread_cleanup_push SIGFE
-pthread_cond_broadcast SIGFE
-pthread_cond_destroy SIGFE
-pthread_cond_init SIGFE
-pthread_cond_signal SIGFE
-pthread_cond_timedwait SIGFE
-pthread_cond_wait SIGFE
-pthread_condattr_destroy SIGFE
-pthread_condattr_getpshared SIGFE
-pthread_condattr_init SIGFE
-pthread_condattr_setpshared SIGFE
-pthread_continue SIGFE
-pthread_create SIGFE
-pthread_detach SIGFE
-pthread_equal SIGFE
-pthread_exit SIGFE
-pthread_getconcurrency SIGFE
-pthread_getschedparam SIGFE
-pthread_getsequence_np SIGFE
-pthread_getspecific SIGFE
-pthread_join SIGFE
-pthread_key_create SIGFE
-pthread_key_delete SIGFE
-pthread_kill SIGFE
-pthread_mutex_destroy SIGFE
-pthread_mutex_getprioceiling SIGFE
-pthread_mutex_init SIGFE
-pthread_mutex_lock SIGFE
-pthread_mutex_setprioceiling SIGFE
-pthread_mutex_trylock SIGFE
-pthread_mutex_unlock SIGFE
-pthread_mutexattr_destroy SIGFE
-pthread_mutexattr_getprioceiling SIGFE
-pthread_mutexattr_getprotocol SIGFE
-pthread_mutexattr_getpshared SIGFE
-pthread_mutexattr_gettype SIGFE
-pthread_mutexattr_init SIGFE
-pthread_mutexattr_setprioceiling SIGFE
-pthread_mutexattr_setprotocol SIGFE
-pthread_mutexattr_setpshared SIGFE
-pthread_mutexattr_settype SIGFE
-pthread_once SIGFE
-pthread_rwlock_destroy SIGFE
-pthread_rwlock_init SIGFE
-pthread_rwlock_rdlock SIGFE
-pthread_rwlock_tryrdlock SIGFE
-pthread_rwlock_trywrlock SIGFE
-pthread_rwlock_unlock SIGFE
-pthread_rwlock_wrlock SIGFE
-pthread_rwlockattr_destroy SIGFE
-pthread_rwlockattr_getpshared SIGFE
-pthread_rwlockattr_init SIGFE
-pthread_rwlockattr_setpshared SIGFE
-pthread_self SIGFE
-pthread_setcancelstate SIGFE
-pthread_setcanceltype SIGFE
-pthread_setconcurrency SIGFE
-pthread_setschedparam SIGFE
-pthread_setspecific SIGFE
-pthread_sigmask SIGFE
-pthread_suspend SIGFE
-pthread_testcancel SIGFE
-ptsname SIGFE
-putc SIGFE
-_putc = putc SIGFE
-putc_unlocked SIGFE
-_putc_unlocked = putc_unlocked SIGFE
-putchar SIGFE
-_putchar = putchar SIGFE
-putchar_unlocked SIGFE
-_putchar_unlocked = putchar_unlocked SIGFE
-putenv SIGFE
-_putenv = putenv SIGFE
-puts SIGFE
-_puts = puts SIGFE
-pututline SIGFE
-_pututline = pututline SIGFE
-pututxline SIGFE
-putw SIGFE
-_putw = putw SIGFE
-pwrite SIGFE
-qsort NOSIGFE
-_qsort = qsort NOSIGFE
-raise SIGFE
-_raise = raise SIGFE
-rand NOSIGFE
-_rand = rand NOSIGFE
-rand_r NOSIGFE
-random NOSIGFE
-rcmd = cygwin_rcmd SIGFE
-rcmd_af = cygwin_rcmd_af SIGFE
-read SIGFE
-_read = read SIGFE
-readdir SIGFE
-_readdir = readdir SIGFE
-readdir_r SIGFE
-readlink SIGFE
-_readlink = readlink SIGFE
-readlinkat SIGFE
-readv SIGFE
-_readv = readv SIGFE
-realloc SIGFE
-_realloc = realloc SIGFE
-realpath SIGFE
-recv = cygwin_recv SIGFE
-recvfrom = cygwin_recvfrom SIGFE
-recvmsg = cygwin_recvmsg SIGFE
-regcomp SIGFE
-regerror SIGFE
-regexec SIGFE
-regfree SIGFE
-remainder NOSIGFE
-_remainder = remainder NOSIGFE
-remainderf NOSIGFE
-_remainderf = remainderf NOSIGFE
-remove SIGFE
-_remove = remove SIGFE
-removexattr SIGFE
-remque NOSIGFE
-remquo NOSIGFE
-remquof NOSIGFE
-rename SIGFE
-_rename = rename SIGFE
-renameat SIGFE
-res_close = __res_close SIGFE
-__res_close SIGFE
-res_init = __res_init SIGFE
-__res_init SIGFE
-res_mkquery = __res_mkquery SIGFE
-__res_mkquery SIGFE
-res_nclose = __res_nclose SIGFE
-__res_nclose SIGFE
-res_ninit = __res_ninit SIGFE
-__res_ninit SIGFE
-res_nmkquery = __res_nmkquery SIGFE
-__res_nmkquery SIGFE
-res_nquery = __res_nquery SIGFE
-__res_nquery SIGFE
-res_nquerydomain = __res_nquerydomain SIGFE
-__res_nquerydomain SIGFE
-res_nsearch = __res_nsearch SIGFE
-__res_nsearch SIGFE
-res_nsend = __res_nsend SIGFE
-__res_nsend SIGFE
-res_query = __res_query SIGFE
-__res_query SIGFE
-res_querydomain = __res_querydomain SIGFE
-__res_querydomain SIGFE
-res_search = __res_search SIGFE
-__res_search SIGFE
-res_send = __res_send SIGFE
-__res_send SIGFE
-__res_state SIGFE
-revoke SIGFE
-rewind SIGFE
-_rewind = rewind SIGFE
-rewinddir SIGFE
-_rewinddir = rewinddir SIGFE
-rexec = cygwin_rexec SIGFE
-rindex NOSIGFE
-_rindex = rindex NOSIGFE
-rint = _f_rint NOSIGFE
-rintf = _f_rintf NOSIGFE
-rintl = _f_rintl NOSIGFE
-rmdir SIGFE
-_rmdir = rmdir SIGFE
-round NOSIGFE
-roundf NOSIGFE
-rresvport = cygwin_rresvport SIGFE
-rresvport_af = cygwin_rresvport_af SIGFE
-ruserok SIGFE
-sbrk SIGFE
-_sbrk = sbrk SIGFE
-scalb NOSIGFE
-_scalb = scalb NOSIGFE
-scalbf NOSIGFE
-_scalbf = scalbf NOSIGFE
-scalbln NOSIGFE
-scalblnf NOSIGFE
-scalbn NOSIGFE
-_scalbn = scalbn NOSIGFE
-scalbnf NOSIGFE
-_scalbnf = scalbnf NOSIGFE
-scandir SIGFE
-_scandir = scandir SIGFE
-scanf SIGFE
-_scanf = scanf SIGFE
-scanf_r = _scanf_r SIGFE
-_scanf_r SIGFE
-sched_get_priority_max SIGFE
-sched_get_priority_min SIGFE
-sched_getparam SIGFE
-sched_getscheduler NOSIGFE
-sched_rr_get_interval SIGFE
-sched_setparam SIGFE
-sched_setscheduler SIGFE
-sched_yield SIGFE
-seed48 NOSIGFE
-_seed48 = seed48 NOSIGFE
-seekdir SIGFE
-_seekdir = seekdir SIGFE
-_seekdir64 = seekdir64 SIGFE
-select = cygwin_select SIGFE
-_select = cygwin_select SIGFE
-sem_close SIGFE
-sem_destroy SIGFE
-sem_getvalue SIGFE
-sem_init SIGFE
-sem_open SIGFE
-sem_post SIGFE
-sem_timedwait SIGFE
-sem_trywait SIGFE
-sem_unlink SIGFE
-sem_wait SIGFE
-semctl SIGFE
-semget SIGFE
-semop SIGFE
-send = cygwin_send SIGFE
-sendmsg = cygwin_sendmsg SIGFE
-sendto = cygwin_sendto SIGFE
-setbuf SIGFE
-_setbuf = setbuf SIGFE
-setbuffer SIGFE
-setdtablesize SIGFE
-_setdtablesize = setdtablesize SIGFE
-setegid SIGFE
-_setegid = setegid SIGFE
-_setegid32 = setegid32 SIGFE
-setenv SIGFE
-_setenv = setenv SIGFE
-seteuid SIGFE
-_seteuid = seteuid SIGFE
-_seteuid32 = seteuid32 SIGFE
-setgid SIGFE
-_setgid = setgid SIGFE
-_setgid32 = setgid32 SIGFE
-setgrent NOSIGFE
-_setgrent = setgrent NOSIGFE
-setgroups SIGFE
-_setgroups = setgroups SIGFE
-_setgroups32 = setgroups32 SIGFE
-sethostent NOSIGFE
-setitimer SIGFE
-setjmp NOSIGFE
-_setjmp = setjmp NOSIGFE
-setlinebuf SIGFE
-setlocale NOSIGFE
-_setlocale = setlocale NOSIGFE
-setlogmask NOSIGFE
-setmntent SIGFE
-_setmntent = setmntent SIGFE
-setmode = cygwin_setmode SIGFE
-_setmode = cygwin_setmode SIGFE
-setpassent NOSIGFE
-_setpassent = setpassent NOSIGFE
-setpgid SIGFE
-_setpgid = setpgid SIGFE
-setpgrp SIGFE
-_setpgrp = setpgrp SIGFE
-setpriority SIGFE
-setprogname NOSIGFE
-setprotoent = cygwin_setprotoent SIGFE
-setpwent NOSIGFE
-_setpwent = setpwent NOSIGFE
-setregid SIGFE
-_setregid = setregid SIGFE
-setregid32 SIGFE
-_setregid32 = setregid32 SIGFE
-setreuid SIGFE
-_setreuid = setreuid SIGFE
-setreuid32 SIGFE
-_setreuid32 = setreuid32 SIGFE
-setrlimit SIGFE
-_setrlimit = setrlimit SIGFE
-setservent = cygwin_setservent SIGFE
-setsid SIGFE
-_setsid = setsid SIGFE
-setsockopt = cygwin_setsockopt SIGFE
-setstate NOSIGFE
-settimeofday SIGFE
-_settimeofday = settimeofday SIGFE
-setuid SIGFE
-_setuid = setuid SIGFE
-_setuid32 = setuid32 SIGFE
-setusershell SIGFE
-setutent SIGFE
-_setutent = setutent SIGFE
-setutxent SIGFE
-setvbuf SIGFE
-_setvbuf = setvbuf SIGFE
-setxattr SIGFE
-sexecl = sexecve_is_bad SIGFE
-sexecle = sexecve_is_bad SIGFE
-sexeclp = sexecve_is_bad SIGFE
-sexeclpe = sexecve_is_bad SIGFE
-sexecp = sexecve_is_bad SIGFE
-sexecv = sexecve_is_bad SIGFE
-sexecve = sexecve_is_bad SIGFE
-sexecvpe = sexecve_is_bad SIGFE
-shm_open SIGFE
-shm_unlink SIGFE
-shmat SIGFE
-shmctl SIGFE
-shmdt SIGFE
-shmget SIGFE
-shutdown = cygwin_shutdown SIGFE
-sigaction SIGFE
-sigaddset SIGFE
-sigdelset SIGFE
-sigemptyset NOSIGFE
-sigfillset NOSIGFE
-sighold SIGFE
-sigignore SIGFE
-siginterrupt SIGFE
-sigismember SIGFE
-signal SIGFE
-__signbitd NOSIGFE
-__signbitf NOSIGFE
-__signgam NOSIGFE
-significand NOSIGFE
-significandf NOSIGFE
-sigpause SIGFE
-sigpending SIGFE
-sigprocmask SIGFE
-sigqueue SIGFE
-sigrelse SIGFE
-sigset SIGFE
-sigsuspend SIGFE
-sigwait SIGFE
-sigwaitinfo SIGFE
-sin NOSIGFE
-_sin = sin NOSIGFE
-sincos NOSIGFE
-sincosf NOSIGFE
-sinf NOSIGFE
-_sinf = sinf NOSIGFE
-sinh NOSIGFE
-_sinh = sinh NOSIGFE
-sinhf NOSIGFE
-_sinhf = sinhf NOSIGFE
-siprintf SIGFE
-_siprintf = siprintf SIGFE
-sleep SIGFE
-_sleep = sleep SIGFE
-snprintf SIGFE
-_snprintf = snprintf SIGFE
-socket = cygwin_socket SIGFE
-socketpair SIGFE
-spawnl SIGFE
-_spawnl = spawnl SIGFE
-spawnle SIGFE
-_spawnle = spawnle SIGFE
-spawnlp SIGFE
-_spawnlp = spawnlp SIGFE
-spawnlpe SIGFE
-_spawnlpe = spawnlpe SIGFE
-spawnv SIGFE
-_spawnv = spawnv SIGFE
-spawnve SIGFE
-_spawnve = spawnve SIGFE
-spawnvp SIGFE
-_spawnvp = spawnvp SIGFE
-spawnvpe SIGFE
-_spawnvpe = spawnvpe SIGFE
-sprintf SIGFE
-_sprintf = sprintf SIGFE
-sqrt NOSIGFE
-_sqrt = sqrt NOSIGFE
-sqrtf NOSIGFE
-_sqrtf = sqrtf NOSIGFE
-srand NOSIGFE
-_srand = srand NOSIGFE
-srand48 NOSIGFE
-_srand48 = srand48 NOSIGFE
-srandom NOSIGFE
-__srget SIGFE
-__srget_r SIGFE
-sscanf SIGFE
-_sscanf = sscanf SIGFE
-sscanf_r = _sscanf_r SIGFE
-_sscanf_r SIGFE
-stat SIGFE
-_stat = stat SIGFE
-_stat64 = stat64 SIGFE
-statfs SIGFE
-_statfs = statfs SIGFE
-statvfs SIGFE
-stpcpy NOSIGFE
-stpncpy NOSIGFE
-strcasecmp NOSIGFE
-_strcasecmp = strcasecmp NOSIGFE
-strcasestr NOSIGFE
-strcat NOSIGFE
-_strcat = strcat NOSIGFE
-strchr NOSIGFE
-_strchr = strchr NOSIGFE
-strcmp NOSIGFE
-_strcmp = strcmp NOSIGFE
-strcoll NOSIGFE
-_strcoll = strcoll NOSIGFE
-strcpy NOSIGFE
-_strcpy = strcpy NOSIGFE
-strcspn NOSIGFE
-_strcspn = strcspn NOSIGFE
-strdup SIGFE
-_strdup = strdup SIGFE
-strerror SIGFE
-_strerror = strerror SIGFE
-strerror_r SIGFE
-_strerror_r = strerror_r SIGFE
-strftime SIGFE
-_strftime = strftime SIGFE
-strlcat NOSIGFE
-_strlcat = strlcat NOSIGFE
-strlcpy NOSIGFE
-_strlcpy = strlcpy NOSIGFE
-strlen NOSIGFE
-_strlen = strlen NOSIGFE
-strlwr NOSIGFE
-_strlwr = strlwr NOSIGFE
-strncasecmp NOSIGFE
-_strncasecmp = strncasecmp NOSIGFE
-strncat NOSIGFE
-_strncat = strncat NOSIGFE
-strncmp NOSIGFE
-_strncmp = strncmp NOSIGFE
-strncpy NOSIGFE
-_strncpy = strncpy NOSIGFE
-strndup SIGFE
-strnlen NOSIGFE
-strpbrk NOSIGFE
-_strpbrk = strpbrk NOSIGFE
-strptime SIGFE
-_strptime = strptime SIGFE
-strrchr NOSIGFE
-_strrchr = strrchr NOSIGFE
-strsep NOSIGFE
-_strsep = strsep NOSIGFE
-strsignal SIGFE
-strspn NOSIGFE
-_strspn = strspn NOSIGFE
-strstr NOSIGFE
-_strstr = strstr NOSIGFE
-strtod SIGFE
-_strtod = strtod SIGFE
-strtodf = strtof SIGFE
-_strtodf = strtof SIGFE
-strtof SIGFE
-strtoimax = strtoll NOSIGFE
-strtok NOSIGFE
-_strtok = strtok NOSIGFE
-strtok_r NOSIGFE
-_strtok_r = strtok_r NOSIGFE
-strtol NOSIGFE
-_strtol = strtol NOSIGFE
-_strtold SIGFE
-strtoll NOSIGFE
-_strtoll = strtoll NOSIGFE
-strtosigno NOSIGFE
-strtoul NOSIGFE
-_strtoul = strtoul NOSIGFE
-strtoull NOSIGFE
-_strtoull = strtoull NOSIGFE
-strtoumax = strtoull NOSIGFE
-strupr NOSIGFE
-_strupr = strupr NOSIGFE
-strxfrm NOSIGFE
-_strxfrm = strxfrm NOSIGFE
-swab NOSIGFE
-_swab = swab NOSIGFE
-__swbuf SIGFE
-__swbuf_r SIGFE
-symlink SIGFE
-_symlink = symlink SIGFE
-symlinkat SIGFE
-sync SIGFE
-sysconf SIGFE
-_sysconf = sysconf SIGFE
-syslog SIGFE
-_syslog = syslog SIGFE
-system SIGFE
-_system = system SIGFE
-tan NOSIGFE
-_tan = tan NOSIGFE
-tanf NOSIGFE
-_tanf = tanf NOSIGFE
-tanh NOSIGFE
-_tanh = tanh NOSIGFE
-tanhf NOSIGFE
-_tanhf = tanhf NOSIGFE
-tcdrain SIGFE
-_tcdrain = tcdrain SIGFE
-tcflow SIGFE
-_tcflow = tcflow SIGFE
-tcflush SIGFE
-_tcflush = tcflush SIGFE
-tcgetattr SIGFE
-_tcgetattr = tcgetattr SIGFE
-tcgetpgrp SIGFE
-_tcgetpgrp = tcgetpgrp SIGFE
-tcsendbreak SIGFE
-_tcsendbreak = tcsendbreak SIGFE
-tcsetattr SIGFE
-_tcsetattr = tcsetattr SIGFE
-tcsetpgrp SIGFE
-_tcsetpgrp = tcsetpgrp SIGFE
-tdelete SIGFE
-tdestroy NOSIGFE
-telldir SIGFE
-_telldir = telldir SIGFE
-_telldir64 = telldir64 SIGFE
-tempnam SIGFE
-_tempnam = tempnam SIGFE
-tfind NOSIGFE
-tgamma NOSIGFE
-tgammaf NOSIGFE
-time SIGFE
-_time = time SIGFE
-timegm NOSIGFE
-timelocal SIGFE
-timer_create SIGFE
-timer_delete SIGFE
-timer_gettime SIGFE
-timer_settime SIGFE
-times SIGFE
-_times = times SIGFE
-timezone SIGFE
-tmpfile SIGFE
-_tmpfile = tmpfile SIGFE
-_tmpfile64 = tmpfile64 SIGFE
-tmpnam SIGFE
-_tmpnam = tmpnam SIGFE
-toascii NOSIGFE
-_toascii = toascii NOSIGFE
-tolower NOSIGFE
-_tolower = tolower NOSIGFE
-toupper NOSIGFE
-_toupper = toupper NOSIGFE
-towctrans NOSIGFE
-towlower NOSIGFE
-towupper NOSIGFE
-trunc NOSIGFE
-truncate SIGFE
-_truncate = truncate SIGFE
-_truncate64 = truncate64 SIGFE
-truncf NOSIGFE
-tsearch SIGFE
-ttyname SIGFE
-_ttyname = ttyname SIGFE
-ttyname_r SIGFE
-ttyslot NOSIGFE
-twalk NOSIGFE
-tzset SIGFE
-_tzset = tzset SIGFE
-ualarm SIGFE
-_ualarm = ualarm SIGFE
-umask NOSIGFE
-_umask = umask NOSIGFE
-umount SIGFE
-_umount = umount SIGFE
-uname SIGFE
-_uname = uname SIGFE
-ungetc SIGFE
-_ungetc = ungetc SIGFE
-unlink SIGFE
-_unlink = unlink SIGFE
-unlinkat SIGFE
-unlockpt NOSIGFE
-unsetenv SIGFE
-_unsetenv = unsetenv SIGFE
-updwtmp SIGFE
-updwtmpx SIGFE
-usleep SIGFE
-_usleep = usleep SIGFE
-utime SIGFE
-_utime = utime SIGFE
-utimensat SIGFE
-utimes SIGFE
-_utimes = utimes SIGFE
-utmpname SIGFE
-_utmpname = utmpname SIGFE
-utmpxname SIGFE
-valloc SIGFE
-vasnprintf SIGFE
-vasprintf SIGFE
-_vasprintf = vasprintf SIGFE
-vasprintf_r = _vasprintf_r SIGFE
-_vasprintf_r SIGFE
-vdprintf SIGFE
-verr SIGFE
-verrx SIGFE
-vfiprintf SIGFE
-_vfiprintf = vfiprintf SIGFE
-vfork SIGFE
-_vfork = vfork SIGFE
-vfprintf SIGFE
-_vfprintf = vfprintf SIGFE
-vfscanf SIGFE
-_vfscanf = vfscanf SIGFE
-vfscanf_r = _vfscanf_r SIGFE
-_vfscanf_r SIGFE
-vhangup SIGFE
-_vhangup = vhangup SIGFE
-vprintf SIGFE
-_vprintf = vprintf SIGFE
-vscanf SIGFE
-_vscanf = vscanf SIGFE
-vscanf_r = _vscanf_r SIGFE
-_vscanf_r SIGFE
-vsnprintf SIGFE
-_vsnprintf = vsnprintf SIGFE
-vsprintf SIGFE
-_vsprintf = vsprintf SIGFE
-vsscanf SIGFE
-_vsscanf = vsscanf SIGFE
-vsscanf_r = _vsscanf_r SIGFE
-_vsscanf_r SIGFE
-vsyslog SIGFE
-vwarn SIGFE
-vwarnx SIGFE
-wait SIGFE
-_wait = wait SIGFE
-wait3 SIGFE
-wait4 SIGFE
-waitpid SIGFE
-_waitpid = waitpid SIGFE
-warn SIGFE
-warnx SIGFE
-wcpcpy NOSIGFE
-wcpncpy NOSIGFE
-wcrtomb NOSIGFE
-wcscat NOSIGFE
-wcschr NOSIGFE
-wcscmp NOSIGFE
-_wcscmp = wcscmp NOSIGFE
-wcscoll NOSIGFE
-wcscpy NOSIGFE
-wcscspn NOSIGFE
-wcslcat NOSIGFE
-wcslcpy NOSIGFE
-wcslen NOSIGFE
-_wcslen = wcslen NOSIGFE
-wcsncat NOSIGFE
-wcsncmp NOSIGFE
-wcsncpy NOSIGFE
-wcspbrk NOSIGFE
-wcsrchr NOSIGFE
-wcsrtombs NOSIGFE
-wcsspn NOSIGFE
-wcsstr NOSIGFE
-wcstol NOSIGFE
-wcstoll NOSIGFE
-wcstombs NOSIGFE
-_wcstombs = wcstombs NOSIGFE
-wcstoul NOSIGFE
-wcstoull NOSIGFE
-wcswidth NOSIGFE
-wcsxfrm NOSIGFE
-wctob NOSIGFE
-wctomb NOSIGFE
-_wctomb = wctomb NOSIGFE
-wctrans NOSIGFE
-wctype NOSIGFE
-wcwidth NOSIGFE
-wmemchr NOSIGFE
-wmemcmp NOSIGFE
-wmemcpy NOSIGFE
-wmemmove NOSIGFE
-wmemset NOSIGFE
-write SIGFE
-_write = write SIGFE
-writev SIGFE
-_writev = writev SIGFE
-y0 NOSIGFE
-y0f NOSIGFE
-y1 NOSIGFE
-y1f NOSIGFE
-yn NOSIGFE
-ynf NOSIGFE
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
deleted file mode 100644
index dbdc61e2c9e..00000000000
--- a/winsup/cygwin/dcrt0.cc
+++ /dev/null
@@ -1,1176 +0,0 @@
-/* dcrt0.cc -- essentially the main() for the Cygwin dll
-
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "winsup.h"
-#include "miscfuncs.h"
-#include <unistd.h>
-#include <stdlib.h>
-#include "glob.h"
-#include <ctype.h>
-#include "sigproc.h"
-#include "pinfo.h"
-#include "cygerrno.h"
-#define NEED_VFORK
-#include "perprocess.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "cygheap.h"
-#include "child_info_magic.h"
-#include "cygtls.h"
-#include "shared_info.h"
-#include "cygwin_version.h"
-#include "dll_init.h"
-#include "heap.h"
-#include "tls_pbuf.h"
-
-#define MAX_AT_FILE_LEVEL 10
-
-#define PREMAIN_LEN (sizeof (user_data->premain) / sizeof (user_data->premain[0]))
-
-extern "C" void cygwin_exit (int) __attribute__ ((noreturn));
-
-HANDLE NO_COPY hMainProc = (HANDLE) -1;
-HANDLE NO_COPY hMainThread;
-HANDLE NO_COPY hProcToken;
-HANDLE NO_COPY hProcImpToken;
-
-muto NO_COPY lock_process::locker;
-
-bool display_title;
-bool strip_title_path;
-bool allow_glob = true;
-bool NO_COPY in_forkee;
-
-int __argc_safe;
-int _declspec(dllexport) __argc;
-char _declspec(dllexport) **__argv;
-#ifdef NEWVFORK
-vfork_save NO_COPY *main_vfork;
-#endif
-
-static int NO_COPY envc;
-char NO_COPY **envp;
-
-extern "C" void __sinit (_reent *);
-
-_cygtls NO_COPY *_main_tls;
-
-bool NO_COPY cygwin_finished_initializing;
-
-MTinterface _mtinterf;
-
-bool NO_COPY _cygwin_testing;
-
-char NO_COPY almost_null[1];
-
-extern "C"
-{
- /* This is an exported copy of environ which can be used by DLLs
- which use cygwin.dll. */
- char **__cygwin_environ;
- char ***main_environ = &__cygwin_environ;
- /* __progname used in getopt error message */
- char *__progname;
- struct per_process __cygwin_user_data =
- {/* initial_sp */ 0, /* magic_biscuit */ 0,
- /* dll_major */ CYGWIN_VERSION_DLL_MAJOR,
- /* dll_major */ CYGWIN_VERSION_DLL_MINOR,
- /* impure_ptr_ptr */ NULL, /* envptr */ NULL,
- /* malloc */ malloc, /* free */ free,
- /* realloc */ realloc,
- /* fmode_ptr */ NULL, /* main */ NULL, /* ctors */ NULL,
- /* dtors */ NULL, /* data_start */ NULL, /* data_end */ NULL,
- /* bss_start */ NULL, /* bss_end */ NULL,
- /* calloc */ calloc,
- /* premain */ {NULL, NULL, NULL, NULL},
- /* run_ctors_p */ 0,
- /* unused */ {0, 0, 0, 0, 0, 0, 0},
- /* UNUSED forkee */ 0,
- /* hmodule */ NULL,
- /* api_major */ CYGWIN_VERSION_API_MAJOR,
- /* api_minor */ CYGWIN_VERSION_API_MINOR,
- /* unused2 */ {0, 0, 0, 0, 0, 0},
- /* threadinterface */ &_mtinterf,
- /* impure_ptr */ _GLOBAL_REENT,
- };
- bool ignore_case_with_glob;
- int __declspec (dllexport) _check_for_executable = true;
-#ifdef DEBUGGING
- int pinger;
-#endif
-};
-
-int NO_COPY __api_fatal_exit_val = 1;
-char *old_title;
-char title_buf[TITLESIZE + 1];
-
-static void
-do_global_dtors ()
-{
- void (**pfunc) () = user_data->dtors;
- if (pfunc)
- {
- user_data->dtors = NULL;
- while (*++pfunc)
- (*pfunc) ();
- }
-}
-
-static void __stdcall
-do_global_ctors (void (**in_pfunc)(), int force)
-{
- if (!force && in_forkee)
- return; // inherit constructed stuff from parent pid
-
- /* Run ctors backwards, so skip the first entry and find how many
- there are, then run them. */
-
- void (**pfunc) () = in_pfunc;
-
- while (*++pfunc)
- ;
- while (--pfunc > in_pfunc)
- (*pfunc) ();
-}
-
-/*
- * Replaces @file in the command line with the contents of the file.
- * There may be multiple @file's in a single command line
- * A \@file is replaced with @file so that echo \@foo would print
- * @foo and not the contents of foo.
- */
-static bool __stdcall
-insert_file (char *name, char *&cmd)
-{
- HANDLE f;
- DWORD size;
- tmp_pathbuf tp;
-
- PWCHAR wname = tp.w_get ();
- sys_mbstowcs (wname, NT_MAX_PATH, name + 1);
- f = CreateFileW (wname,
- GENERIC_READ, /* open for reading */
- FILE_SHARE_READ, /* share for reading */
- &sec_none_nih, /* default security */
- OPEN_EXISTING, /* existing file only */
- FILE_ATTRIBUTE_NORMAL,/* normal file */
- NULL); /* no attr. template */
-
- if (f == INVALID_HANDLE_VALUE)
- {
- debug_printf ("couldn't open file '%s', %E", name);
- return false;
- }
-
- /* This only supports files up to about 4 billion bytes in
- size. I am making the bold assumption that this is big
- enough for this feature */
- size = GetFileSize (f, NULL);
- if (size == 0xFFFFFFFF)
- {
- debug_printf ("couldn't get file size for '%s', %E", name);
- return false;
- }
-
- int new_size = strlen (cmd) + size + 2;
- char *tmp = (char *) malloc (new_size);
- if (!tmp)
- {
- debug_printf ("malloc failed, %E");
- return false;
- }
-
- /* realloc passed as it should */
- DWORD rf_read;
- BOOL rf_result;
- rf_result = ReadFile (f, tmp, size, &rf_read, NULL);
- CloseHandle (f);
- if (!rf_result || (rf_read != size))
- {
- debug_printf ("ReadFile failed, %E");
- return false;
- }
-
- tmp[size++] = ' ';
- strcpy (tmp + size, cmd);
- cmd = tmp;
- return true;
-}
-
-static inline int
-isquote (char c)
-{
- char ch = c;
- return ch == '"' || ch == '\'';
-}
-
-/* Step over a run of characters delimited by quotes */
-static /*__inline*/ char *
-quoted (char *cmd, int winshell)
-{
- char *p;
- char quote = *cmd;
-
- if (!winshell)
- {
- char *p;
- strcpy (cmd, cmd + 1);
- if (*(p = strechr (cmd, quote)))
- strcpy (p, p + 1);
- return p;
- }
-
- const char *s = quote == '\'' ? "'" : "\\\"";
- /* This must have been run from a Windows shell, so preserve
- quotes for globify to play with later. */
- while (*cmd && *++cmd)
- if ((p = strpbrk (cmd, s)) == NULL)
- {
- cmd = strchr (cmd, '\0'); // no closing quote
- break;
- }
- else if (*p == '\\')
- cmd = ++p;
- else if (quote == '"' && p[1] == '"')
- {
- *p = '\\';
- cmd = ++p; // a quoted quote
- }
- else
- {
- cmd = p + 1; // point to after end
- break;
- }
- return cmd;
-}
-
-/* Perform a glob on word if it contains wildcard characters.
- Also quote every character between quotes to force glob to
- treat the characters literally. */
-static int __stdcall
-globify (char *word, char **&argv, int &argc, int &argvlen)
-{
- if (*word != '~' && strpbrk (word, "?*[\"\'(){}") == NULL)
- return 0;
-
- int n = 0;
- char *p, *s;
- int dos_spec = isdrive (word);
- if (!dos_spec && isquote (*word) && word[1] && word[2])
- dos_spec = isdrive (word + 1);
-
- /* We'll need more space if there are quoting characters in
- word. If that is the case, doubling the size of the
- string should provide more than enough space. */
- if (strpbrk (word, "'\""))
- n = strlen (word);
- char pattern[strlen (word) + ((dos_spec + 1) * n) + 1];
-
- /* Fill pattern with characters from word, quoting any
- characters found within quotes. */
- for (p = pattern, s = word; *s != '\000'; s++, p++)
- if (!isquote (*s))
- {
- if (dos_spec && *s == '\\')
- *p++ = '\\';
- *p = *s;
- }
- else
- {
- char quote = *s;
- while (*++s && *s != quote)
- {
- if (dos_spec || *s != '\\')
- /* nothing */;
- else if (s[1] == quote || s[1] == '\\')
- s++;
- *p++ = '\\';
- *p++ = *s;
- }
- if (*s == quote)
- p--;
- if (*s == '\0')
- break;
- }
-
- *p = '\0';
-
- glob_t gl;
- gl.gl_offs = 0;
-
- /* Attempt to match the argument. Return just word (minus quoting) if no match. */
- if (glob (pattern, GLOB_TILDE | GLOB_NOCHECK | GLOB_BRACE | GLOB_QUOTE, NULL, &gl) || !gl.gl_pathc)
- return 0;
-
- /* Allocate enough space in argv for the matched filenames. */
- n = argc;
- if ((argc += gl.gl_pathc) > argvlen)
- {
- argvlen = argc + 10;
- argv = (char **) realloc (argv, (1 + argvlen) * sizeof (argv[0]));
- }
-
- /* Copy the matched filenames to argv. */
- char **gv = gl.gl_pathv;
- char **av = argv + n;
- while (*gv)
- {
- debug_printf ("argv[%d] = '%s'", n++, *gv);
- *av++ = *gv++;
- }
-
- /* Clean up after glob. */
- free (gl.gl_pathv);
- return 1;
-}
-
-/* Build argv, argc from string passed from Windows. */
-
-static void __stdcall
-build_argv (char *cmd, char **&argv, int &argc, int winshell)
-{
- int argvlen = 0;
- int nesting = 0; // monitor "nesting" from insert_file
-
- argc = 0;
- argvlen = 0;
- argv = NULL;
-
- /* Scan command line until there is nothing left. */
- while (*cmd)
- {
- /* Ignore spaces */
- if (issep (*cmd))
- {
- cmd++;
- continue;
- }
-
- /* Found the beginning of an argument. */
- char *word = cmd;
- char *sawquote = NULL;
- while (*cmd)
- {
- if (*cmd != '"' && (!winshell || *cmd != '\''))
- cmd++; // Skip over this character
- else
- /* Skip over characters until the closing quote */
- {
- sawquote = cmd;
- cmd = quoted (cmd, winshell && argc > 0);
- }
- if (issep (*cmd)) // End of argument if space
- break;
- }
- if (*cmd)
- *cmd++ = '\0'; // Terminate `word'
-
- /* Possibly look for @file construction assuming that this isn't
- the very first argument and the @ wasn't quoted */
- if (argc && sawquote != word && *word == '@')
- {
- if (++nesting > MAX_AT_FILE_LEVEL)
- api_fatal ("Too many levels of nesting for %s", word);
- if (insert_file (word, cmd))
- continue; // There's new stuff in cmd now
- }
-
- /* See if we need to allocate more space for argv */
- if (argc >= argvlen)
- {
- argvlen = argc + 10;
- argv = (char **) realloc (argv, (1 + argvlen) * sizeof (argv[0]));
- }
-
- /* Add word to argv file after (optional) wildcard expansion. */
- if (!winshell || !argc || !globify (word, argv, argc, argvlen))
- {
- debug_printf ("argv[%d] = '%s'", argc, word);
- argv[argc++] = word;
- }
- }
-
- argv[argc] = NULL;
-
- debug_printf ("argc %d", argc);
-}
-
-/* sanity and sync check */
-void __stdcall
-check_sanity_and_sync (per_process *p)
-{
- /* Sanity check to make sure developers didn't change the per_process */
- /* struct without updating SIZEOF_PER_PROCESS [it makes them think twice */
- /* about changing it]. */
- if (sizeof (per_process) != SIZEOF_PER_PROCESS)
- api_fatal ("per_process sanity check failed");
-
- /* Make sure that the app and the dll are in sync. */
-
- /* Complain if older than last incompatible change */
- if (p->dll_major < CYGWIN_VERSION_DLL_EPOCH)
- api_fatal ("cygwin DLL and APP are out of sync -- DLL version mismatch %d < %d",
- p->dll_major, CYGWIN_VERSION_DLL_EPOCH);
-
- /* magic_biscuit != 0 if using the old style version numbering scheme. */
- if (p->magic_biscuit != SIZEOF_PER_PROCESS)
- api_fatal ("Incompatible cygwin .dll -- incompatible per_process info %d != %d",
- p->magic_biscuit, SIZEOF_PER_PROCESS);
-
- /* Complain if incompatible API changes made */
- if (p->api_major > cygwin_version.api_major)
- api_fatal ("cygwin DLL and APP are out of sync -- API version mismatch %d > %d",
- p->api_major, cygwin_version.api_major);
-}
-
-child_info NO_COPY *child_proc_info = NULL;
-
-#define CYGWIN_GUARD (PAGE_EXECUTE_READWRITE | PAGE_GUARD)
-
-void
-child_info_fork::alloc_stack_hard_way (volatile char *b)
-{
- void *new_stack_pointer;
- MEMORY_BASIC_INFORMATION m;
- void *newbase;
- int newlen;
- bool guard;
-
- if (!VirtualQuery ((LPCVOID) &b, &m, sizeof m))
- api_fatal ("fork: couldn't get stack info, %E");
-
- LPBYTE curbot = (LPBYTE) m.BaseAddress + m.RegionSize;
-
- if (stacktop > (LPBYTE) m.AllocationBase && stacktop < curbot)
- {
- newbase = curbot;
- newlen = (LPBYTE) stackbottom - (LPBYTE) curbot;
- guard = false;
- }
- else
- {
- newbase = (LPBYTE) stacktop - (128 * 1024);
- newlen = (LPBYTE) stackbottom - (LPBYTE) newbase;
- guard = true;
- }
-
- if (!VirtualAlloc (newbase, newlen, MEM_RESERVE, PAGE_NOACCESS))
- api_fatal ("fork: can't reserve memory for stack %p - %p, %E",
- stacktop, stackbottom);
- new_stack_pointer = (void *) ((LPBYTE) stackbottom - (stacksize += 8192));
- if (!VirtualAlloc (new_stack_pointer, stacksize, MEM_COMMIT,
- PAGE_EXECUTE_READWRITE))
- api_fatal ("fork: can't commit memory for stack %p(%d), %E",
- new_stack_pointer, stacksize);
- if (!VirtualQuery ((LPCVOID) new_stack_pointer, &m, sizeof m))
- api_fatal ("fork: couldn't get new stack info, %E");
-
- if (guard)
- {
- m.BaseAddress = (LPBYTE) m.BaseAddress - 1;
- if (!VirtualAlloc ((LPVOID) m.BaseAddress, 1, MEM_COMMIT,
- CYGWIN_GUARD))
- api_fatal ("fork: couldn't allocate new stack guard page %p, %E",
- m.BaseAddress);
- }
- if (!VirtualQuery ((LPCVOID) m.BaseAddress, &m, sizeof m))
- api_fatal ("fork: couldn't get new stack info, %E");
- stacktop = m.BaseAddress;
- b[0] = '\0';
-}
-
-void *getstack (void *) __attribute__ ((noinline));
-volatile char *
-getstack (volatile char * volatile p)
-{
- *p ^= 1;
- *p ^= 1;
- return p - 4096;
-}
-
-/* extend the stack prior to fork longjmp */
-
-void
-child_info_fork::alloc_stack ()
-{
- volatile char * volatile esp;
- __asm__ volatile ("movl %%esp,%0": "=r" (esp));
- if (_tlsbase != stackbottom)
- alloc_stack_hard_way (esp);
- else
- {
- char *st = (char *) stacktop - 4096;
- while (_tlstop >= st)
- esp = getstack (esp);
- stacksize = 0;
- }
-}
-
-extern "C" void
-break_here ()
-{
- static int NO_COPY sent_break;
- if (!sent_break++)
- DebugBreak ();
- debug_printf ("break here");
-}
-
-static void
-initial_env ()
-{
- if (GetEnvironmentVariableA ("CYGWIN_TESTING", NULL, 0))
- _cygwin_testing = 1;
-
-#ifdef DEBUGGING
- char buf[NT_MAX_PATH];
- DWORD len;
-
- if (GetEnvironmentVariableA ("CYGWIN_SLEEP", buf, sizeof (buf) - 1))
- {
- DWORD ms = atoi (buf);
- console_printf ("Sleeping %d, pid %u %P\n", ms, GetCurrentProcessId ());
- Sleep (ms);
- if (!strace.active () && !dynamically_loaded)
- strace.hello ();
- }
- if (GetEnvironmentVariableA ("CYGWIN_DEBUG", buf, sizeof (buf) - 1))
- {
- char buf1[NT_MAX_PATH];
- len = GetModuleFileName (NULL, buf1, NT_MAX_PATH);
- strlwr (buf1);
- strlwr (buf);
- char *p = strpbrk (buf, ":=");
- if (!p)
- p = (char *) "gdb.exe -nw";
- else
- *p++ = '\0';
- if (strstr (buf1, buf))
- {
- error_start_init (p);
- try_to_debug ();
- console_printf ("*** Sending Break. gdb may issue spurious SIGTRAP message.\n");
- break_here ();
- }
- }
-#endif
-
-}
-
-child_info *
-get_cygwin_startup_info ()
-{
- STARTUPINFO si;
-
- GetStartupInfo (&si);
- child_info *res = (child_info *) si.lpReserved2;
-
- if (si.cbReserved2 < EXEC_MAGIC_SIZE || !res
- || res->intro != PROC_MAGIC_GENERIC || res->magic != CHILD_INFO_MAGIC)
- res = NULL;
- else
- {
- if ((res->intro & OPROC_MAGIC_MASK) == OPROC_MAGIC_GENERIC)
- multiple_cygwin_problem ("proc intro", res->intro, 0);
- else if (res->cygheap != (void *) &_cygheap_start)
- multiple_cygwin_problem ("cygheap base", (DWORD) res->cygheap,
- (DWORD) &_cygheap_start);
-
- unsigned should_be_cb = 0;
- switch (res->type)
- {
- case _PROC_FORK:
- in_forkee = true;
- should_be_cb = sizeof (child_info_fork);
- /* fall through */;
- case _PROC_SPAWN:
- case _PROC_EXEC:
- if (!should_be_cb)
- should_be_cb = sizeof (child_info_spawn);
- if (should_be_cb != res->cb)
- multiple_cygwin_problem ("proc size", res->cb, should_be_cb);
- else if (sizeof (fhandler_union) != res->fhandler_union_cb)
- multiple_cygwin_problem ("fhandler size", res->fhandler_union_cb, sizeof (fhandler_union));
- if (res->isstraced ())
- {
- res->ready (false);
- for (unsigned i = 0; !being_debugged () && i < 10000; i++)
- low_priority_sleep (0);
- strace.hello ();
- }
- break;
- default:
- system_printf ("unknown exec type %d", res->type);
- /* intentionally fall through */
- case _PROC_WHOOPS:
- res = NULL;
- break;
- }
- }
-
- return res;
-}
-
-#define dll_data_start &_data_start__
-#define dll_data_end &_data_end__
-#define dll_bss_start &_bss_start__
-#define dll_bss_end &_bss_end__
-
-void
-child_info_fork::handle_fork ()
-{
- cygheap_fixup_in_child (false);
- memory_init ();
- set_myself (NULL);
- myself->uid = cygheap->user.real_uid;
- myself->gid = cygheap->user.real_gid;
-
- child_copy (parent, false,
- "dll data", dll_data_start, dll_data_end,
- "dll bss", dll_bss_start, dll_bss_end,
- "user heap", cygheap->user_heap.base, cygheap->user_heap.ptr,
- NULL);
- /* step 2 now that the dll has its heap filled in, we can fill in the
- user's data and bss since user_data is now filled out. */
- child_copy (parent, false,
- "data", user_data->data_start, user_data->data_end,
- "bss", user_data->bss_start, user_data->bss_end,
- NULL);
-
- if (fixup_mmaps_after_fork (parent))
- api_fatal ("recreate_mmaps_after_fork_failed");
-}
-
-void
-child_info_spawn::handle_spawn ()
-{
- extern void fixup_lockf_after_exec ();
- HANDLE h;
- cygheap_fixup_in_child (true);
- memory_init ();
- if (!moreinfo->myself_pinfo ||
- !DuplicateHandle (hMainProc, moreinfo->myself_pinfo, hMainProc, &h, 0,
- FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
- h = NULL;
- set_myself (h);
- __argc = moreinfo->argc;
- __argv = moreinfo->argv;
- envp = moreinfo->envp;
- envc = moreinfo->envc;
- if (!dynamically_loaded)
- cygheap->fdtab.fixup_after_exec ();
- if (__stdin >= 0)
- cygheap->fdtab.move_fd (__stdin, 0);
- if (__stdout >= 0)
- cygheap->fdtab.move_fd (__stdout, 1);
- cygheap->user.groups.clear_supp ();
-
- ready (true);
-
- /* Need to do this after debug_fixup_after_fork_exec or DEBUGGING handling of
- handles might get confused. */
- CloseHandle (child_proc_info->parent);
- child_proc_info->parent = NULL;
-
- signal_fixup_after_exec ();
- if (moreinfo->old_title)
- {
- old_title = strcpy (title_buf, moreinfo->old_title);
- cfree (moreinfo->old_title);
- }
- fixup_lockf_after_exec ();
-}
-
-void __stdcall
-dll_crt0_0 ()
-{
- init_global_security ();
- initial_env ();
-
- SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
-
- /* Initialize signal processing here, early, in the hopes that the creation
- of a thread early in the process will cause more predictability in memory
- layout for the main thread. */
- sigproc_init ();
-
- lock_process::init ();
- _impure_ptr = _GLOBAL_REENT;
- _impure_ptr->_stdin = &_impure_ptr->__sf[0];
- _impure_ptr->_stdout = &_impure_ptr->__sf[1];
- _impure_ptr->_stderr = &_impure_ptr->__sf[2];
- _impure_ptr->_current_locale = "C";
- user_data->impure_ptr = _impure_ptr;
- user_data->impure_ptr_ptr = &_impure_ptr;
-
- if (!DuplicateHandle (GetCurrentProcess (), GetCurrentProcess (),
- GetCurrentProcess (), &hMainProc, 0, FALSE,
- DUPLICATE_SAME_ACCESS))
- hMainProc = GetCurrentProcess ();
-
- DuplicateHandle (hMainProc, GetCurrentThread (), hMainProc,
- &hMainThread, 0, false, DUPLICATE_SAME_ACCESS);
-
- OpenProcessToken (hMainProc, MAXIMUM_ALLOWED, &hProcToken);
- set_cygwin_privileges (hProcToken);
-
- device::init ();
- do_global_ctors (&__CTOR_LIST__, 1);
- cygthread::init ();
-
- child_proc_info = get_cygwin_startup_info ();
- if (!child_proc_info)
- memory_init ();
- else
- {
- cygwin_user_h = child_proc_info->user_h;
- switch (child_proc_info->type)
- {
- case _PROC_FORK:
- fork_info->handle_fork ();
- break;
- case _PROC_SPAWN:
- case _PROC_EXEC:
- spawn_info->handle_spawn ();
- break;
- }
- }
-
- user_data->threadinterface->Init ();
-
- _cygtls::init ();
-
- /* Initialize events */
- events_init ();
- tty_list::init_session ();
-
- debug_printf ("finished dll_crt0_0 initialization");
-}
-
-/* Take over from libc's crt0.o and start the application. Note the
- various special cases when Cygwin DLL is being runtime loaded (as
- opposed to being link-time loaded by Cygwin apps) from a non
- cygwin app via LoadLibrary. */
-void
-dll_crt0_1 (void *)
-{
- check_sanity_and_sync (user_data);
-
- /* Initialize malloc and then call user_shared_initialize since it relies
- on a functioning malloc and it's possible that the user's program may
- have overridden malloc. We only know about that at this stage,
- unfortunately. */
- malloc_init ();
- user_shared_initialize ();
-
-#ifdef CGF
- int i = 0;
- const int n = 2 * 1024 * 1024;
- while (i--)
- small_printf ("cmalloc returns %p\n", cmalloc (HEAP_STR, n));
-#endif
-
- ProtectHandle (hMainProc);
- ProtectHandle (hMainThread);
-
- cygheap->cwd.init ();
-
- /* Initialize pthread mainthread when not forked and it is safe to call new,
- otherwise it is reinitalized in fixup_after_fork */
- if (!in_forkee)
- pthread::init_mainthread ();
-
-#ifdef DEBUGGING
- strace.microseconds ();
-#endif
-
- create_signal_arrived (); /* FIXME: move into wait_sig? */
-
- /* Initialize debug muto, if DLL is built with --enable-debugging.
- Need to do this before any helper threads start. */
- debug_init ();
-
-#ifdef NEWVFORK
- cygheap->fdtab.vfork_child_fixup ();
- main_vfork = vfork_storage.create ();
-#endif
-
- cygbench ("pre-forkee");
- if (in_forkee)
- {
- /* If we've played with the stack, stacksize != 0. That means that
- fork() was invoked from other than the main thread. Make sure that
- frame pointer is referencing the new stack so that the OS knows what
- to do when it needs to increase the size of the stack.
-
- NOTE: Don't do anything that involves the stack until you've completed
- this step. */
- if (fork_info->stacksize)
- {
- _tlsbase = (char *) fork_info->stackbottom;
- _tlstop = (char *) fork_info->stacktop;
- _my_tls.init_exception_handler (_cygtls::handle_exceptions);
- }
-
- longjmp (fork_info->jmp, true);
- }
-
-#ifdef DEBUGGING
- {
- extern void fork_init ();
- fork_init ();
- }
-#endif
- pinfo_init (envp, envc);
-
- if (!old_title && GetConsoleTitle (title_buf, TITLESIZE))
- old_title = title_buf;
-
- /* Allocate cygheap->fdtab */
- dtable_init ();
-
- uinfo_init (); /* initialize user info */
-
- wait_for_sigthread ();
- extern DWORD threadfunc_ix;
- if (!threadfunc_ix)
- system_printf ("internal error: couldn't determine location of thread function on stack. Expect signal problems.");
-
- /* Connect to tty. */
- tty::init_session ();
-
- if (!__argc)
- {
- PWCHAR wline = GetCommandLineW ();
- size_t size = sys_wcstombs (NULL, 0, wline);
- char *line = (char *) alloca (size);
- sys_wcstombs (line, size, wline);
-
- /* Scan the command line and build argv. Expand wildcards if not
- called from another cygwin process. */
- build_argv (line, __argv, __argc,
- NOTSTATE (myself, PID_CYGPARENT) && allow_glob);
-
- /* Convert argv[0] to posix rules if it's currently blatantly
- win32 style. */
- if ((strchr (__argv[0], ':')) || (strchr (__argv[0], '\\')))
- {
- char *new_argv0 = (char *) malloc (NT_MAX_PATH);
- cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_RELATIVE, __argv[0],
- new_argv0, NT_MAX_PATH);
- __argv[0] = (char *) realloc (new_argv0, strlen (new_argv0) + 1);
- }
- }
-
- __argc_safe = __argc;
- if (user_data->premain[0])
- for (unsigned int i = 0; i < PREMAIN_LEN / 2; i++)
- user_data->premain[i] (__argc, __argv, user_data);
-
- /* Set up standard fds in file descriptor table. */
- cygheap->fdtab.stdio_init ();
-
- /* Set up __progname for getopt error call. */
- if (__argv[0] && (__progname = strrchr (__argv[0], '/')))
- ++__progname;
- else
- __progname = __argv[0];
- if (__progname)
- {
- char *cp = strchr (__progname, '\0') - 4;
- if (cp > __progname && ascii_strcasematch (cp, ".exe"))
- *cp = '\0';
- }
-
- /* Set new console title if appropriate. */
-
- if (display_title && !dynamically_loaded)
- {
- char *cp = __progname;
- if (strip_title_path)
- for (char *ptr = cp; *ptr && *ptr != ' '; ptr++)
- if (isdirsep (*ptr))
- cp = ptr + 1;
- set_console_title (cp);
- }
-
- cygwin_finished_initializing = true;
- /* Call init of loaded dlls. */
- dlls.init ();
-
- /* Execute any specified "premain" functions */
- if (user_data->premain[PREMAIN_LEN / 2])
- for (unsigned int i = PREMAIN_LEN / 2; i < PREMAIN_LEN; i++)
- user_data->premain[i] (__argc, __argv, user_data);
-
- debug_printf ("user_data->main %p", user_data->main);
-
- if (dynamically_loaded)
- {
- set_errno (0);
- return;
- }
-
- /* Disable case-insensitive globbing */
- ignore_case_with_glob = false;
-
- set_errno (0);
-
- MALLOC_CHECK;
- cygbench (__progname);
-
- /* Flush signals and ensure that signal thread is up and running. Can't
- do this for noncygwin case since the signal thread is blocked due to
- LoadLibrary serialization. */
- ld_preload ();
- if (user_data->main)
- cygwin_exit (user_data->main (__argc, __argv, *user_data->envptr));
- __asm__ (" \n\
- .global __cygwin_exit_return \n\
-__cygwin_exit_return: \n\
-");
-}
-
-extern "C" void __stdcall
-_dll_crt0 ()
-{
- main_environ = user_data->envptr;
- if (in_forkee)
- fork_info->alloc_stack ();
- else
- __sinit (_impure_ptr);
-
- _main_tls = &_my_tls;
- _main_tls->call ((DWORD (*) (void *, void *)) dll_crt0_1, NULL);
-}
-
-void
-dll_crt0 (per_process *uptr)
-{
- /* Set the local copy of the pointer into the user space. */
- if (!in_forkee && uptr && uptr != user_data)
- {
- memcpy (user_data, uptr, per_process_overwrite);
- *(user_data->impure_ptr_ptr) = _GLOBAL_REENT;
- }
- _dll_crt0 ();
-}
-
-/* This must be called by anyone who uses LoadLibrary to load cygwin1.dll.
- You must have CYGTLS_PADSIZE bytes reserved at the bottom of the stack
- calling this function, and that storage must not be overwritten until you
- unload cygwin1.dll, as it is used for _my_tls. It is best to load
- cygwin1.dll before spawning any additional threads in your process.
-
- See winsup/testsuite/cygload for an example of how to use cygwin1.dll
- from MSVC and non-cygwin MinGW applications. */
-extern "C" void
-cygwin_dll_init ()
-{
- static char **envp;
- static int _fmode;
-
- user_data->magic_biscuit = sizeof (per_process);
-
- user_data->envptr = &envp;
- user_data->fmode_ptr = &_fmode;
-
- _dll_crt0 ();
-}
-
-extern "C" void
-__main (void)
-{
- do_global_ctors (user_data->ctors, false);
- atexit (do_global_dtors);
-}
-
-exit_states NO_COPY exit_state;
-
-void __stdcall
-do_exit (int status)
-{
- syscall_printf ("do_exit (%d), exit_state %d", status, exit_state);
-
-#ifdef NEWVFORK
- vfork_save *vf = vfork_storage.val ();
- if (vf != NULL && vf->pid < 0)
- {
- exit_state = ES_NOT_EXITING;
- vf->restore_exit (status);
- }
-#endif
-
- lock_process until_exit (true);
-
- if (exit_state < ES_GLOBAL_DTORS)
- {
- exit_state = ES_GLOBAL_DTORS;
- dll_global_dtors ();
- }
-
- if (exit_state < ES_EVENTS_TERMINATE)
- {
- exit_state = ES_EVENTS_TERMINATE;
- events_terminate ();
- }
-
- UINT n = (UINT) status;
- if (exit_state < ES_THREADTERM)
- {
- exit_state = ES_THREADTERM;
- cygthread::terminate ();
- }
-
- if (exit_state < ES_SIGNAL)
- {
- exit_state = ES_SIGNAL;
- signal (SIGCHLD, SIG_IGN);
- signal (SIGHUP, SIG_IGN);
- signal (SIGINT, SIG_IGN);
- signal (SIGQUIT, SIG_IGN);
- }
-
- if (exit_state < ES_CLOSEALL)
- {
- exit_state = ES_CLOSEALL;
- close_all_files ();
- }
-
- myself->stopsig = 0;
-
- if (exit_state < ES_HUP_PGRP)
- {
- exit_state = ES_HUP_PGRP;
- /* Kill orphaned children on group leader exit */
- if (myself->has_pgid_children && myself->pid == myself->pgid)
- {
- siginfo_t si = {0};
- si.si_signo = -SIGHUP;
- si.si_code = SI_KERNEL;
- sigproc_printf ("%d == pgrp %d, send SIG{HUP,CONT} to stopped children",
- myself->pid, myself->pgid);
- kill_pgrp (myself->pgid, si);
- }
- }
-
- if (exit_state < ES_HUP_SID)
- {
- exit_state = ES_HUP_SID;
- /* Kill the foreground process group on session leader exit */
- if (getpgrp () > 0 && myself->pid == myself->sid && real_tty_attached (myself))
- {
- tty *tp = cygwin_shared->tty[myself->ctty];
- sigproc_printf ("%d == sid %d, send SIGHUP to children",
- myself->pid, myself->sid);
-
- /* CGF FIXME: This can't be right. */
- if (tp->getsid () == myself->sid)
- tp->kill_pgrp (SIGHUP);
- }
-
- }
-
- if (exit_state < ES_TITLE)
- {
- exit_state = ES_TITLE;
- /* restore console title */
- if (old_title && display_title)
- set_console_title (old_title);
- }
-
- if (exit_state < ES_TTY_TERMINATE)
- {
- exit_state = ES_TTY_TERMINATE;
- cygwin_shared->tty.terminate ();
- }
-
- myself.exit (n);
-}
-
-static NO_COPY muto atexit_lock;
-
-extern "C" int
-cygwin_atexit (void (*function)(void))
-{
- int res;
- atexit_lock.init ("atexit_lock");
- atexit_lock.acquire ();
- res = atexit (function);
- atexit_lock.release ();
- return res;
-}
-
-extern "C" void
-cygwin_exit (int n)
-{
- if (atexit_lock)
- atexit_lock.acquire ();
- exit (n);
-}
-
-extern "C" void
-_exit (int n)
-{
- do_exit (((DWORD) n & 0xff) << 8);
-}
-
-extern "C" void
-__api_fatal (const char *fmt, ...)
-{
- char buf[4096];
- va_list ap;
-
- va_start (ap, fmt);
- int n = __small_sprintf (buf, "%P: *** fatal error - ");
- __small_vsprintf (buf + n, fmt, ap);
- va_end (ap);
- strace.prntf (_STRACE_SYSTEM, NULL, "%s", buf);
-
-#ifdef DEBUGGING
- try_to_debug ();
-#endif
- myself.exit (__api_fatal_exit_val);
-}
-
-void
-multiple_cygwin_problem (const char *what, unsigned magic_version, unsigned version)
-{
- if (_cygwin_testing && (strstr (what, "proc") || strstr (what, "cygheap")))
- {
- child_proc_info->type = _PROC_WHOOPS;
- return;
- }
-
- if (GetEnvironmentVariableA ("CYGWIN_MISMATCH_OK", NULL, 0))
- return;
-
- if (CYGWIN_VERSION_MAGIC_VERSION (magic_version) == version)
- system_printf ("%s magic number mismatch detected - %p/%p", what, magic_version, version);
- else
- api_fatal ("%s mismatch detected - %p/%p.\n\
-This problem is probably due to using incompatible versions of the cygwin DLL.\n\
-Search for cygwin1.dll using the Windows Start->Find/Search facility\n\
-and delete all but the most recent version. The most recent version *should*\n\
-reside in x:\\cygwin\\bin, where 'x' is the drive on which you have\n\
-installed the cygwin distribution. Rebooting is also suggested if you\n\
-are unable to find another cygwin DLL.",
- what, magic_version, version);
-}
-
-#ifdef DEBUGGING
-void __stdcall
-cygbench (const char *s)
-{
- if (GetEnvironmentVariableA ("CYGWIN_BENCH", NULL, 0))
- small_printf ("%05d ***** %s : %10d\n", GetCurrentProcessId (), s, strace.microseconds ());
-}
-#endif
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
deleted file mode 100644
index dac48618a1e..00000000000
--- a/winsup/cygwin/dll_init.cc
+++ /dev/null
@@ -1,461 +0,0 @@
-/* dll_init.cc
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "winsup.h"
-#include "cygerrno.h"
-#include "perprocess.h"
-#include "dll_init.h"
-#include "environ.h"
-#include "security.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "cygheap.h"
-#include "pinfo.h"
-#include "cygtls.h"
-
-extern void __stdcall check_sanity_and_sync (per_process *);
-
-dll_list NO_COPY dlls;
-
-static bool dll_global_dtors_recorded;
-
-/* Run destructors for all DLLs on exit. */
-void
-dll_global_dtors ()
-{
- int recorded = dll_global_dtors_recorded;
- dll_global_dtors_recorded = false;
- if (recorded && dlls.start.next)
- for (dll *d = dlls.end; d != &dlls.start; d = d->prev)
- d->p.run_dtors ();
-}
-
-/* Run all constructors associated with a dll */
-void
-per_module::run_ctors ()
-{
- void (**pfunc)() = ctors;
-
- /* Run ctors backwards, so skip the first entry and find how many
- there are, then run them. */
-
- if (pfunc)
- {
- int i;
- for (i = 1; pfunc[i]; i++);
-
- for (int j = i - 1; j > 0; j--)
- (pfunc[j]) ();
- }
-}
-
-/* Run all destructors associated with a dll */
-void
-per_module::run_dtors ()
-{
- void (**pfunc)() = dtors;
- for (int i = 1; pfunc[i]; i++)
- (pfunc[i]) ();
-}
-
-/* Initialize an individual DLL */
-int
-dll::init ()
-{
- int ret = 1;
-
- /* Why didn't we just import this variable? */
- *(p.envptr) = __cygwin_environ;
-
- /* Don't run constructors or the "main" if we've forked. */
- if (!in_forkee)
- {
- /* global contructors */
- p.run_ctors ();
-
- /* entry point of dll (use main of per_process with null args...) */
- if (p.main)
- ret = (*(p.main)) (0, 0, 0);
- }
-
- return ret;
-}
-
-/* Look for a dll based on name */
-dll *
-dll_list::operator[] (const char *name)
-{
- dll *d = &start;
- while ((d = d->next) != NULL)
- if (strcasematch (name, d->name))
- return d;
-
- return NULL;
-}
-
-#define RETRIES 1000
-
-/* Allocate space for a dll struct contiguous with the just-loaded dll. */
-dll *
-dll_list::alloc (HINSTANCE h, per_process *p, dll_type type)
-{
- char name[NT_MAX_PATH];
- DWORD namelen = GetModuleFileName (h, name, sizeof (name));
-
- /* Already loaded? */
- dll *d = dlls[name];
- if (d)
- {
- d->count++; /* Yes. Bump the usage count. */
- return d; /* Return previously allocated pointer. */
- }
-
- SYSTEM_INFO s1;
- GetSystemInfo (&s1);
-
- int i;
- void *s = p->bss_end;
- DWORD n;
- MEMORY_BASIC_INFORMATION m;
- /* Search for space after the DLL */
- for (i = 0; i <= RETRIES; i++, s = (char *) m.BaseAddress + m.RegionSize)
- {
- if (!VirtualQuery (s, &m, sizeof (m)))
- return NULL; /* Can't do it. */
- if (m.State == MEM_FREE)
- {
- /* Couldn't find any. Uh oh. FIXME: Issue an error? */
- if (i == RETRIES)
- return NULL; /* Oh well. Couldn't locate free space. */
-
- /* Ensure that this is rounded to the nearest page boundary.
- FIXME: Should this be ensured by VirtualQuery? */
- n = (DWORD) m.BaseAddress;
- DWORD r = n % s1.dwAllocationGranularity;
-
- if (r)
- n = ((n - r) + s1.dwAllocationGranularity);
-
- /* First reserve the area of memory, then commit it. */
- if (VirtualAlloc ((void *) n, sizeof (dll), MEM_RESERVE, PAGE_READWRITE))
- d = (dll *) VirtualAlloc ((void *) n, sizeof (dll), MEM_COMMIT,
- PAGE_READWRITE);
- if (d)
- break;
- }
- }
-
- /* Did we succeed? */
- if (d == NULL)
- { /* Nope. */
-#ifdef DEBUGGING
- system_printf ("VirtualAlloc failed, %E");
-#endif
- __seterrno ();
- return NULL;
- }
-
- /* Now we've allocated a block of information. Fill it in with the supplied
- info about this DLL. */
- d->count = 1;
- d->namelen = namelen;
- strcpy (d->name, name);
- d->handle = h;
- d->p = p;
- d->type = type;
- if (end == NULL)
- end = &start; /* Point to "end" of dll chain. */
- end->next = d; /* Standard linked list stuff. */
- d->next = NULL;
- d->prev = end;
- end = d;
- tot++;
- if (type == DLL_LOAD)
- loaded_dlls++;
- return d;
-}
-
-/* Detach a DLL from the chain. */
-void
-dll_list::detach (void *retaddr)
-{
- if (!myself || exit_state)
- return;
- MEMORY_BASIC_INFORMATION m;
- if (!VirtualQuery (retaddr, &m, sizeof m))
- return;
- HMODULE h = (HMODULE) m.AllocationBase;
-
- dll *d = &start;
- while ((d = d->next))
- if (d->handle != h)
- continue;
- else if (d->count <= 0)
- system_printf ("WARNING: trying to detach an already detached dll ...");
- else if (--d->count == 0)
- {
- d->p.run_dtors ();
- d->prev->next = d->next;
- if (d->next)
- d->next->prev = d->prev;
- if (d->type == DLL_LOAD)
- loaded_dlls--;
- if (end == d)
- end = d->prev;
- VirtualFree (d, 0, MEM_RELEASE);
- break;
- }
-}
-
-/* Initialization for all linked DLLs, called by dll_crt0_1. */
-void
-dll_list::init ()
-{
- /* Walk the dll chain, initializing each dll */
- dll *d = &start;
- dll_global_dtors_recorded = d->next != NULL;
- while ((d = d->next))
- d->init ();
-}
-
-#define A64K (64 * 1024)
-
-/* Mark every memory address up to "here" as reserved. This may force
- Windows NT to load a DLL in the next available, lowest slot. */
-static void
-reserve_upto (const char *name, DWORD here)
-{
- DWORD size;
- MEMORY_BASIC_INFORMATION mb;
- for (DWORD start = 0x10000; start < here; start += size)
- if (!VirtualQuery ((void *) start, &mb, sizeof (mb)))
- size = A64K;
- else
- {
- size = A64K * ((mb.RegionSize + A64K - 1) / A64K);
- start = A64K * (((DWORD) mb.BaseAddress + A64K - 1) / A64K);
-
- if (start + size > here)
- size = here - start;
- if (mb.State == MEM_FREE &&
- !VirtualAlloc ((void *) start, size, MEM_RESERVE, PAGE_NOACCESS))
- api_fatal ("couldn't allocate memory %p(%d) for '%s' alignment, %E\n",
- start, size, name);
- }
-}
-
-/* Release all of the memory previously allocated by "upto" above.
- Note that this may also free otherwise reserved memory. If that becomes
- a problem, we'll have to keep track of the memory that we reserve above. */
-static void
-release_upto (const char *name, DWORD here)
-{
- DWORD size;
- MEMORY_BASIC_INFORMATION mb;
- for (DWORD start = 0x10000; start < here; start += size)
- if (!VirtualQuery ((void *) start, &mb, sizeof (mb)))
- size = 64 * 1024;
- else
- {
- size = mb.RegionSize;
- if (!(mb.State == MEM_RESERVE && mb.AllocationProtect == PAGE_NOACCESS &&
- (((void *) start < cygheap->user_heap.base
- || (void *) start > cygheap->user_heap.top) &&
- ((void *) start < (void *) cygheap
- | (void *) start > (void *) ((char *) cygheap + CYGHEAPSIZE)))))
- continue;
- if (!VirtualFree ((void *) start, 0, MEM_RELEASE))
- api_fatal ("couldn't release memory %p(%d) for '%s' alignment, %E\n",
- start, size, name);
- }
-}
-
-/* Reload DLLs after a fork. Iterates over the list of dynamically loaded DLLs
- and attempts to load them in the same place as they were loaded in the parent. */
-void
-dll_list::load_after_fork (HANDLE parent, dll *first)
-{
- int try2 = 0;
- dll d;
-
- void *next = first;
- while (next)
- {
- DWORD nb;
- /* Read the dll structure from the parent. */
- if (!ReadProcessMemory (parent, next, &d, sizeof (dll), &nb) ||
- nb != sizeof (dll))
- return;
-
- /* We're only interested in dynamically loaded dlls.
- Hopefully, this function wouldn't even have been called unless
- the parent had some of those. */
- if (d.type == DLL_LOAD)
- {
- bool unload = true;
- HMODULE h = LoadLibraryEx (d.name, NULL, DONT_RESOLVE_DLL_REFERENCES);
-
- if (!h)
- system_printf ("can't reload %s", d.name);
- /* See if DLL will load in proper place. If so, free it and reload
- it the right way.
- It sort of stinks that we can't invert the order of the FreeLibrary
- and LoadLibrary since Microsoft documentation seems to imply that that
- should do what we want. However, since the library was loaded above,
- the second LoadLibrary does not execute it's startup code unless it
- is first unloaded. */
- else if (h == d.handle)
- {
- if (unload)
- {
- FreeLibrary (h);
- LoadLibrary (d.name);
- }
- }
- else if (try2)
- api_fatal ("unable to remap %s to same address as parent(%p) != %p",
- d.name, d.handle, h);
- else
- {
- /* It loaded in the wrong place. Dunno why this happens but it always
- seems to happen when there are multiple DLLs attempting to load into
- the same address space. In the "forked" process, the second DLL always
- loads into a different location. */
- FreeLibrary (h);
- /* Block all of the memory up to the new load address. */
- reserve_upto (d.name, (DWORD) d.handle);
- try2 = 1; /* And try */
- continue; /* again. */
- }
- /* If we reached here, and try2 is set, then there is a lot of memory to
- release. */
- if (try2)
- {
- release_upto (d.name, (DWORD) d.handle);
- try2 = 0;
- }
- }
- next = d.next; /* Get the address of the next DLL. */
- }
- in_forkee = false;
-}
-
-struct dllcrt0_info
-{
- HMODULE h;
- per_process *p;
- int res;
- dllcrt0_info (HMODULE h0, per_process *p0): h(h0), p(p0) {}
-};
-
-extern "C" int
-dll_dllcrt0 (HMODULE h, per_process *p)
-{
- dllcrt0_info x (h, p);
-
- if (_my_tls.isinitialized ())
- dll_dllcrt0_1 (&x);
- else
- _my_tls.call ((DWORD (*) (void *, void *)) dll_dllcrt0_1, &x);
- return x.res;
-}
-
-void
-dll_dllcrt0_1 (VOID *x)
-{
- HMODULE& h = ((dllcrt0_info *)x)->h;
- per_process*& p = ((dllcrt0_info *)x)->p;
- int& res = ((dllcrt0_info *)x)->res;
-
- /* Windows apparently installs a bunch of exception handlers prior to
- this function getting called and one of them may trip before cygwin
- gets to it. So, install our own exception handler only.
- FIXME: It is possible that we may have to save state of the
- previous exception handler chain and restore it, if problems
- are noted. */
- _my_tls.init_exception_handler (_cygtls::handle_exceptions);
-
- if (p == NULL)
- p = &__cygwin_user_data;
- else
- *(p->impure_ptr_ptr) = __cygwin_user_data.impure_ptr;
-
- bool linked = !in_forkee && !cygwin_finished_initializing;
-
- /* Partially initialize Cygwin guts for non-cygwin apps. */
- if (dynamically_loaded && user_data->magic_biscuit == 0)
- dll_crt0 (p);
- else
- check_sanity_and_sync (p);
-
- dll_type type;
-
- /* If this function is called before cygwin has finished
- initializing, then the DLL must be a cygwin-aware DLL
- that was explicitly linked into the program rather than
- a dlopened DLL. */
- if (linked)
- type = DLL_LINK;
- else
- {
- type = DLL_LOAD;
- dlls.reload_on_fork = 1;
- }
-
- /* Allocate and initialize space for the DLL. */
- dll *d = dlls.alloc (h, p, type);
-
- /* If d == NULL, then something is broken.
- Otherwise, if we've finished initializing, it's ok to
- initialize the DLL. If we haven't finished initializing,
- it may not be safe to call the dll's "main" since not
- all of cygwin's internal structures may have been set up. */
- if (!d || (!linked && !d->init ()))
- res = -1;
- else
- res = (DWORD) d;
-}
-
-/* OBSOLETE: This function is obsolescent and will go away in the
- future. Cygwin can now handle being loaded from a noncygwin app
- using the same entry point. */
-
-extern "C" int
-dll_noncygwin_dllcrt0 (HMODULE h, per_process *p)
-{
- return dll_dllcrt0 (h, p);
-}
-
-extern "C" void
-cygwin_detach_dll (dll *)
-{
- HANDLE retaddr;
- if (_my_tls.isinitialized ())
- retaddr = (HANDLE) _my_tls.retaddr ();
- else
- retaddr = __builtin_return_address (0);
- dlls.detach (retaddr);
-}
-
-extern "C" void
-dlfork (int val)
-{
- dlls.reload_on_fork = val;
-}
-
-/* Called from various places to update all of the individual
- ideas of the environ block. Explain to me again why we didn't
- just import __cygwin_environ? */
-void __stdcall
-update_envptrs ()
-{
- for (dll *d = dlls.istart (DLL_ANY); d; d = dlls.inext ())
- *(d->p.envptr) = __cygwin_environ;
- *main_environ = __cygwin_environ;
-}
diff --git a/winsup/cygwin/dll_init.h b/winsup/cygwin/dll_init.h
deleted file mode 100644
index a7601e78bd4..00000000000
--- a/winsup/cygwin/dll_init.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* dll_init.h
-
- Copyright 1998, 1999, 2000, 2001 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-struct per_module
-{
- char ***envptr;
- void (**ctors)(void);
- void (**dtors)(void);
- void *data_start;
- void *data_end;
- void *bss_start;
- void *bss_end;
- int (*main)(int, char **, char **);
- per_module &operator = (per_process *p)
- {
- envptr = p->envptr;
- ctors = p->ctors;
- dtors = p->dtors;
- data_start = p->data_start;
- data_end = p->data_end;
- bss_start = p->bss_start;
- bss_end = p->bss_end;
- main = p->main;
- return *this;
- }
- void run_ctors ();
- void run_dtors ();
-};
-
-
-typedef enum
-{
- DLL_NONE,
- DLL_LINK,
- DLL_LOAD,
- DLL_ANY
-} dll_type;
-
-struct dll
-{
- struct dll *next, *prev;
- per_module p;
- HMODULE handle;
- int count;
- dll_type type;
- int namelen;
- char name[NT_MAX_PATH];
- void detach ();
- int init ();
-};
-
-#define MAX_DLL_BEFORE_INIT 100
-
-class dll_list
-{
- dll *end;
- dll *hold;
- dll_type hold_type;
-public:
- dll start;
- int tot;
- int loaded_dlls;
- int reload_on_fork;
- dll *operator [] (const char *name);
- dll *alloc (HINSTANCE, per_process *, dll_type);
- void detach (void *);
- void init ();
- void load_after_fork (HANDLE, dll *);
- dll *inext ()
- {
- while ((hold = hold->next))
- if (hold_type == DLL_ANY || hold->type == hold_type)
- break;
- return hold;
- }
- dll *istart (dll_type t)
- {
- hold_type = t;
- hold = &start;
- return inext ();
- }
- friend void dll_global_dtors ();
-};
-
-extern dll_list dlls;
-void dll_global_dtors ();
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
deleted file mode 100644
index e744e7c5d03..00000000000
--- a/winsup/cygwin/exceptions.cc
+++ /dev/null
@@ -1,1432 +0,0 @@
-/* exceptions.cc
-
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "winsup.h"
-#include "miscfuncs.h"
-#include <wingdi.h>
-#include <winuser.h>
-#include <imagehlp.h>
-#include <stdlib.h>
-#include <syslog.h>
-#include <wchar.h>
-
-#include "pinfo.h"
-#include "cygtls.h"
-#include "sigproc.h"
-#include "shared_info.h"
-#include "perprocess.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "cygheap.h"
-#include "child_info.h"
-#include "ntdll.h"
-
-#define CALL_HANDLER_RETRY 20
-
-char debugger_command[2 * NT_MAX_PATH + 20];
-
-extern "C" {
-extern void sigdelayed ();
-};
-
-extern child_info_spawn *chExeced;
-int NO_COPY sigExeced;
-
-static BOOL WINAPI ctrl_c_handler (DWORD);
-static WCHAR windows_system_directory[1024];
-static size_t windows_system_directory_length;
-
-/* This is set to indicate that we have already exited. */
-
-static NO_COPY int exit_already = 0;
-static muto NO_COPY mask_sync;
-
-NO_COPY static struct
-{
- unsigned int code;
- const char *name;
-} status_info[] =
-{
-#define X(s) s, #s
- { X (STATUS_ABANDONED_WAIT_0) },
- { X (STATUS_ACCESS_VIOLATION) },
- { X (STATUS_ARRAY_BOUNDS_EXCEEDED) },
- { X (STATUS_BREAKPOINT) },
- { X (STATUS_CONTROL_C_EXIT) },
- { X (STATUS_DATATYPE_MISALIGNMENT) },
- { X (STATUS_FLOAT_DENORMAL_OPERAND) },
- { X (STATUS_FLOAT_DIVIDE_BY_ZERO) },
- { X (STATUS_FLOAT_INEXACT_RESULT) },
- { X (STATUS_FLOAT_INVALID_OPERATION) },
- { X (STATUS_FLOAT_OVERFLOW) },
- { X (STATUS_FLOAT_STACK_CHECK) },
- { X (STATUS_FLOAT_UNDERFLOW) },
- { X (STATUS_GUARD_PAGE_VIOLATION) },
- { X (STATUS_ILLEGAL_INSTRUCTION) },
- { X (STATUS_INTEGER_DIVIDE_BY_ZERO) },
- { X (STATUS_INTEGER_OVERFLOW) },
- { X (STATUS_INVALID_DISPOSITION) },
- { X (STATUS_IN_PAGE_ERROR) },
- { X (STATUS_NONCONTINUABLE_EXCEPTION) },
- { X (STATUS_NO_MEMORY) },
- { X (STATUS_PENDING) },
- { X (STATUS_PRIVILEGED_INSTRUCTION) },
- { X (STATUS_SINGLE_STEP) },
- { X (STATUS_STACK_OVERFLOW) },
- { X (STATUS_TIMEOUT) },
- { X (STATUS_USER_APC) },
- { X (STATUS_WAIT_0) },
- { 0, 0 }
-#undef X
-};
-
-/* Initialization code. */
-
-void
-init_console_handler (bool install_handler)
-{
- BOOL res;
-
- SetConsoleCtrlHandler (ctrl_c_handler, FALSE);
- SetConsoleCtrlHandler (NULL, FALSE);
- if (install_handler)
- res = SetConsoleCtrlHandler (ctrl_c_handler, TRUE);
- else
- res = SetConsoleCtrlHandler (NULL, TRUE);
- if (!res)
- system_printf ("SetConsoleCtrlHandler failed, %E");
-}
-
-extern "C" void
-error_start_init (const char *buf)
-{
- if (!buf || !*buf)
- {
- debugger_command[0] = '\0';
- return;
- }
-
- char pgm[NT_MAX_PATH];
- if (!GetModuleFileName (NULL, pgm, NT_MAX_PATH))
- strcpy (pgm, "cygwin1.dll");
- for (char *p = strchr (pgm, '\\'); p; p = strchr (p, '\\'))
- *p = '/';
-
- __small_sprintf (debugger_command, "%s \"%s\"", buf, pgm);
-}
-
-static void
-open_stackdumpfile ()
-{
- if (myself->progname[0])
- {
- const char *p;
- /* write to progname.stackdump if possible */
- if (!myself->progname[0])
- p = "unknown";
- else if ((p = strrchr (myself->progname, '\\')))
- p++;
- else
- p = myself->progname;
-
- WCHAR corefile[strlen (p) + sizeof (".stackdump")];
- UNICODE_STRING ucore;
- OBJECT_ATTRIBUTES attr;
- /* Create the UNICODE variation of <progname>.stackdump. */
- RtlInitEmptyUnicodeString (&ucore, corefile,
- sizeof corefile - sizeof (WCHAR));
- ucore.Length = sys_mbstowcs (ucore.Buffer,
- ucore.MaximumLength / sizeof (WCHAR),
- p, strlen (p)) * sizeof (WCHAR);
- RtlAppendUnicodeToString (&ucore, L".stackdump");
- /* Create an object attribute which refers to <progname>.stackdump
- in Cygwin's cwd. Stick to caseinsensitivity. */
- InitializeObjectAttributes (&attr, &ucore, OBJ_CASE_INSENSITIVE,
- cygheap->cwd.get_handle (), NULL);
- HANDLE h;
- IO_STATUS_BLOCK io;
- NTSTATUS status;
- /* Try to open it to dump the stack in it. */
- status = NtCreateFile (&h, GENERIC_WRITE | SYNCHRONIZE, &attr, &io,
- NULL, FILE_ATTRIBUTE_NORMAL, 0, FILE_OVERWRITE_IF,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT
- | FILE_OPEN_FOR_RECOVERY, NULL, 0);
- if (NT_SUCCESS (status))
- {
- if (!myself->cygstarted)
- system_printf ("Dumping stack trace to %S", &ucore);
- else
- debug_printf ("Dumping stack trace to %S", &ucore);
- SetStdHandle (STD_ERROR_HANDLE, h);
- }
- }
-}
-
-/* Utilities for dumping the stack, etc. */
-
-static void
-exception (EXCEPTION_RECORD *e, CONTEXT *in)
-{
- const char *exception_name = NULL;
-
- if (e)
- {
- for (int i = 0; status_info[i].name; i++)
- {
- if (status_info[i].code == e->ExceptionCode)
- {
- exception_name = status_info[i].name;
- break;
- }
- }
- }
-
- if (exception_name)
- small_printf ("Exception: %s at eip=%08x\r\n", exception_name, in->Eip);
- else
- small_printf ("Signal %d at eip=%08x\r\n", e->ExceptionCode, in->Eip);
- small_printf ("eax=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x\r\n",
- in->Eax, in->Ebx, in->Ecx, in->Edx, in->Esi, in->Edi);
- small_printf ("ebp=%08x esp=%08x program=%s, pid %u, thread %s\r\n",
- in->Ebp, in->Esp, myself->progname, myself->pid, cygthread::name ());
- small_printf ("cs=%04x ds=%04x es=%04x fs=%04x gs=%04x ss=%04x\r\n",
- in->SegCs, in->SegDs, in->SegEs, in->SegFs, in->SegGs, in->SegSs);
-}
-
-/* A class for manipulating the stack. */
-class stack_info
-{
- int walk (); /* Uses the "old" method */
- char *next_offset () {return *((char **) sf.AddrFrame.Offset);}
- bool needargs;
- DWORD dummy_frame;
-public:
- STACKFRAME sf; /* For storing the stack information */
- void init (DWORD, bool, bool); /* Called the first time that stack info is needed */
-
- /* Postfix ++ iterates over the stack, returning zero when nothing is left. */
- int operator ++(int) { return walk (); }
-};
-
-/* The number of parameters used in STACKFRAME */
-#define NPARAMS (sizeof (thestack.sf.Params) / sizeof (thestack.sf.Params[0]))
-
-/* This is the main stack frame info for this process. */
-static NO_COPY stack_info thestack;
-
-/* Initialize everything needed to start iterating. */
-void
-stack_info::init (DWORD ebp, bool wantargs, bool goodframe)
-{
-# define debp ((DWORD *) ebp)
- memset (&sf, 0, sizeof (sf));
- if (!goodframe)
- sf.AddrFrame.Offset = ebp;
- else
- {
- dummy_frame = ebp;
- sf.AddrFrame.Offset = (DWORD) &dummy_frame;
- }
- sf.AddrReturn.Offset = debp[1];
- sf.AddrFrame.Mode = AddrModeFlat;
- needargs = wantargs;
-# undef debp
-}
-
-extern "C" void _cygwin_exit_return ();
-
-/* Walk the stack by looking at successive stored 'bp' frames.
- This is not foolproof. */
-int
-stack_info::walk ()
-{
- char **ebp;
-
- if ((void (*) ()) sf.AddrPC.Offset == _cygwin_exit_return)
- return 0; /* stack frames are exhausted */
-
- if (((ebp = (char **) next_offset ()) == NULL) || (ebp >= (char **) cygwin_hmodule))
- return 0;
-
- sf.AddrFrame.Offset = (DWORD) ebp;
- sf.AddrPC.Offset = sf.AddrReturn.Offset;
-
- /* The return address always follows the stack pointer */
- sf.AddrReturn.Offset = (DWORD) *++ebp;
-
- if (needargs)
- {
- unsigned nparams = NPARAMS;
-
- /* The arguments follow the return address */
- sf.Params[0] = (DWORD) *++ebp;
- /* Hack for XP/2K3 WOW64. If the first stack param points to the
- application entry point, we can only fetch one additional
- parameter. Accessing anything beyond this address results in
- a SEGV. This is fixed in Vista/2K8 WOW64. */
- if (wincap.has_restricted_stack_args () && sf.Params[0] == 0x401000)
- nparams = 2;
- for (unsigned i = 1; i < nparams; i++)
- sf.Params[i] = (DWORD) *++ebp;
- }
-
- return 1;
-}
-
-static void
-stackdump (DWORD ebp, int open_file, bool isexception)
-{
- extern unsigned long rlim_core;
- static bool already_dumped;
-
- if (rlim_core == 0UL || (open_file && already_dumped))
- return;
-
- if (open_file)
- open_stackdumpfile ();
-
- already_dumped = true;
-
- int i;
-
- thestack.init (ebp, 1, !isexception); /* Initialize from the input CONTEXT */
- small_printf ("Stack trace:\r\nFrame Function Args\r\n");
- for (i = 0; i < 16 && thestack++; i++)
- {
- small_printf ("%08x %08x ", thestack.sf.AddrFrame.Offset,
- thestack.sf.AddrPC.Offset);
- for (unsigned j = 0; j < NPARAMS; j++)
- small_printf ("%s%08x", j == 0 ? " (" : ", ", thestack.sf.Params[j]);
- small_printf (")\r\n");
- }
- small_printf ("End of stack trace%s\n",
- i == 16 ? " (more stack frames may be present)" : "");
-}
-
-bool
-_cygtls::inside_kernel (CONTEXT *cx)
-{
- int res;
- MEMORY_BASIC_INFORMATION m;
-
- if (!isinitialized ())
- return true;
-
- memset (&m, 0, sizeof m);
- if (!VirtualQuery ((LPCVOID) cx->Eip, &m, sizeof m))
- sigproc_printf ("couldn't get memory info, pc %p, %E", cx->Eip);
-
- size_t size = (windows_system_directory_length + 6) * sizeof (WCHAR);
- PWCHAR checkdir = (PWCHAR) alloca (size);
- memset (checkdir, 0, size);
-
-# define h ((HMODULE) m.AllocationBase)
- /* Apparently Windows 95 can sometimes return bogus addresses from
- GetThreadContext. These resolve to a strange allocation base.
- These should *never* be treated as interruptible. */
- if (!h || m.State != MEM_COMMIT)
- res = true;
- else if (h == user_data->hmodule)
- res = false;
- else if (!GetModuleFileNameW (h, checkdir, windows_system_directory_length + 6))
- res = false;
- else
- {
- /* Skip potential long path prefix. */
- if (!wcsncmp (checkdir, L"\\\\?\\", 4))
- checkdir += 4;
- res = !wcsncasecmp (windows_system_directory, checkdir,
- windows_system_directory_length);
- }
- sigproc_printf ("pc %p, h %p, inside_kernel %d", cx->Eip, h, res);
-# undef h
- return res;
-}
-
-/* Temporary (?) function for external callers to get a stack dump */
-extern "C" void
-cygwin_stackdump ()
-{
- CONTEXT c;
- c.ContextFlags = CONTEXT_FULL;
- GetThreadContext (GetCurrentThread (), &c);
- stackdump (c.Ebp, 0, 0);
-}
-
-#define TIME_TO_WAIT_FOR_DEBUGGER 10000
-
-extern "C" int
-try_to_debug (bool waitloop)
-{
- WCHAR dbg_cmd[sizeof debugger_command];
-
- debug_printf ("debugger_command '%s'", debugger_command);
- if (*debugger_command == '\0')
- return 0;
- if (being_debugged ())
- {
- extern void break_here ();
- break_here ();
- return 0;
- }
-
- __small_sprintf (strchr (debugger_command, '\0'), " %u", GetCurrentProcessId ());
-
- LONG prio = GetThreadPriority (GetCurrentThread ());
- SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_HIGHEST);
- PROCESS_INFORMATION pi = {NULL, 0, 0, 0};
-
- STARTUPINFOW si = {0, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL};
- si.lpReserved = NULL;
- si.lpDesktop = NULL;
- si.dwFlags = 0;
- si.cb = sizeof (si);
-
- /* FIXME: need to know handles of all running threads to
- suspend_all_threads_except (current_thread_id);
- */
-
- /* if any of these mutexes is owned, we will fail to start any cygwin app
- until trapped app exits */
-
- lock_ttys::release ();
-
- /* prevent recursive exception handling */
- PWCHAR rawenv = GetEnvironmentStringsW () ;
- for (PWCHAR p = rawenv; *p != L'\0'; p = wcschr (p, L'\0') + 1)
- {
- if (wcsncmp (p, L"CYGWIN=", wcslen (L"CYGWIN=")) == 0)
- {
- PWCHAR q = wcsstr (p, L"error_start") ;
- /* replace 'error_start=...' with '_rror_start=...' */
- if (q)
- {
- *q = L'_' ;
- SetEnvironmentVariableW (L"CYGWIN", p + wcslen (L"CYGWIN=")) ;
- }
- break ;
- }
- }
-
- console_printf ("*** starting debugger for pid %u, tid %u\n",
- cygwin_pid (GetCurrentProcessId ()), GetCurrentThreadId ());
- BOOL dbg;
- sys_mbstowcs (dbg_cmd, sizeof debugger_command, debugger_command);
- dbg = CreateProcessW (NULL,
- dbg_cmd,
- NULL,
- NULL,
- FALSE,
- CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP,
- NULL,
- NULL,
- &si,
- &pi);
-
- if (!dbg)
- system_printf ("Failed to start debugger, %E");
- else
- {
- if (!waitloop)
- return dbg;
- SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_IDLE);
- while (!being_debugged ())
- low_priority_sleep (0);
- Sleep (2000);
- }
-
- console_printf ("*** continuing pid %u from debugger call (%d)\n",
- cygwin_pid (GetCurrentProcessId ()), dbg);
-
- SetThreadPriority (GetCurrentThread (), prio);
- return dbg;
-}
-
-extern "C" DWORD __stdcall RtlUnwind (void *, void *, void *, DWORD);
-static void __stdcall rtl_unwind (exception_list *, PEXCEPTION_RECORD) __attribute__ ((noinline, regparm (3)));
-void __stdcall
-rtl_unwind (exception_list *frame, PEXCEPTION_RECORD e)
-{
- __asm__ ("\n\
- pushl %%ebx \n\
- pushl %%edi \n\
- pushl %%esi \n\
- pushl $0 \n\
- pushl %1 \n\
- pushl $1f \n\
- pushl %0 \n\
- call _RtlUnwind@16 \n\
-1: \n\
- popl %%esi \n\
- popl %%edi \n\
- popl %%ebx \n\
-": : "r" (frame), "r" (e));
-}
-
-/* Main exception handler. */
-
-extern exception_list *_except_list asm ("%fs:0");
-
-extern "C" char *__progname;
-int
-_cygtls::handle_exceptions (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void *)
-{
- static bool NO_COPY debugging;
- static int NO_COPY recursed;
- _cygtls& me = _my_tls;
-
- if (debugging && ++debugging < 500000)
- {
- SetThreadPriority (hMainThread, THREAD_PRIORITY_NORMAL);
- return 0;
- }
-
- /* If we've already exited, don't do anything here. Returning 1
- tells Windows to keep looking for an exception handler. */
- if (exit_already || e->ExceptionFlags)
- return 1;
-
- siginfo_t si = {0};
- si.si_code = SI_KERNEL;
- /* Coerce win32 value to posix value. */
- switch (e->ExceptionCode)
- {
- case STATUS_FLOAT_DENORMAL_OPERAND:
- case STATUS_FLOAT_DIVIDE_BY_ZERO:
- case STATUS_FLOAT_INVALID_OPERATION:
- case STATUS_FLOAT_STACK_CHECK:
- si.si_signo = SIGFPE;
- si.si_code = FPE_FLTSUB;
- break;
- case STATUS_FLOAT_INEXACT_RESULT:
- si.si_signo = SIGFPE;
- si.si_code = FPE_FLTRES;
- break;
- case STATUS_FLOAT_OVERFLOW:
- si.si_signo = SIGFPE;
- si.si_code = FPE_FLTOVF;
- break;
- case STATUS_FLOAT_UNDERFLOW:
- si.si_signo = SIGFPE;
- si.si_code = FPE_FLTUND;
- break;
- case STATUS_INTEGER_DIVIDE_BY_ZERO:
- si.si_signo = SIGFPE;
- si.si_code = FPE_INTDIV;
- break;
- case STATUS_INTEGER_OVERFLOW:
- si.si_signo = SIGFPE;
- si.si_code = FPE_INTOVF;
- break;
-
- case STATUS_ILLEGAL_INSTRUCTION:
- si.si_signo = SIGILL;
- si.si_code = ILL_ILLOPC;
- break;
-
- case STATUS_PRIVILEGED_INSTRUCTION:
- si.si_signo = SIGILL;
- si.si_code = ILL_PRVOPC;
- break;
-
- case STATUS_NONCONTINUABLE_EXCEPTION:
- si.si_signo = SIGILL;
- si.si_code = ILL_ILLADR;
- break;
-
- case STATUS_TIMEOUT:
- si.si_signo = SIGALRM;
- break;
-
- case STATUS_GUARD_PAGE_VIOLATION:
- si.si_signo = SIGBUS;
- si.si_code = BUS_OBJERR;
- break;
-
- case STATUS_DATATYPE_MISALIGNMENT:
- si.si_signo = SIGBUS;
- si.si_code = BUS_ADRALN;
- break;
-
- case STATUS_ACCESS_VIOLATION:
- switch (mmap_is_attached_or_noreserve ((void *)e->ExceptionInformation[1],
- 1))
- {
- case MMAP_NORESERVE_COMMITED:
- return 0;
- case MMAP_RAISE_SIGBUS: /* MAP_NORESERVE page, commit failed, or
- access to mmap page beyond EOF. */
- si.si_signo = SIGBUS;
- si.si_code = BUS_OBJERR;
- break;
- default:
- MEMORY_BASIC_INFORMATION m;
- VirtualQuery ((PVOID) e->ExceptionInformation[1], &m, sizeof m);
- si.si_signo = SIGSEGV;
- si.si_code = m.State == MEM_FREE ? SEGV_MAPERR : SEGV_ACCERR;
- break;
- }
- break;
-
- case STATUS_ARRAY_BOUNDS_EXCEEDED:
- case STATUS_IN_PAGE_ERROR:
- case STATUS_NO_MEMORY:
- case STATUS_INVALID_DISPOSITION:
- case STATUS_STACK_OVERFLOW:
- si.si_signo = SIGSEGV;
- si.si_code = SEGV_MAPERR;
- break;
-
- case STATUS_CONTROL_C_EXIT:
- si.si_signo = SIGINT;
- break;
-
- case STATUS_INVALID_HANDLE:
- /* CloseHandle will throw this exception if it is given an
- invalid handle. We don't care about the exception; we just
- want CloseHandle to return an error. This can be revisited
- if gcc ever supports Windows style structured exception
- handling. */
- return 0;
-
- default:
- /* If we don't recognize the exception, we have to assume that
- we are doing structured exception handling, and we let
- something else handle it. */
- return 1;
- }
-
- debug_printf ("In cygwin_except_handler exc %p at %p sp %p", e->ExceptionCode, in->Eip, in->Esp);
- debug_printf ("In cygwin_except_handler sig %d at %p", si.si_signo, in->Eip);
-
- bool masked = !!(me.sigmask & SIGTOMASK (si.si_signo));
- if (masked)
- syscall_printf ("signal %d, masked %p", si.si_signo,
- global_sigs[si.si_signo].sa_mask);
-
- debug_printf ("In cygwin_except_handler calling %p",
- global_sigs[si.si_signo].sa_handler);
-
- DWORD *ebp = (DWORD *) in->Esp;
- for (DWORD *bpend = (DWORD *) __builtin_frame_address (0); ebp > bpend; ebp--)
- if (*ebp == in->SegCs && ebp[-1] == in->Eip)
- {
- ebp -= 2;
- break;
- }
-
- if (me.fault_guarded ())
- me.return_from_fault ();
-
- me.copy_context (in);
-
- /* Temporarily replace windows top level SEH with our own handler.
- We don't want any Windows magic kicking in. This top level frame
- will be removed automatically after our exception handler returns. */
- _except_list->handler = _cygtls::handle_exceptions;
-
- if (masked
- || &me == _sig_tls
- || !cygwin_finished_initializing
- || (void *) global_sigs[si.si_signo].sa_handler == (void *) SIG_DFL
- || (void *) global_sigs[si.si_signo].sa_handler == (void *) SIG_IGN
- || (void *) global_sigs[si.si_signo].sa_handler == (void *) SIG_ERR)
- {
- /* Print the exception to the console */
- if (!myself->cygstarted)
- for (int i = 0; status_info[i].name; i++)
- if (status_info[i].code == e->ExceptionCode)
- {
- system_printf ("Exception: %s", status_info[i].name);
- break;
- }
-
- /* Another exception could happen while tracing or while exiting.
- Only do this once. */
- if (recursed++)
- system_printf ("Error while dumping state (probably corrupted stack)");
- else
- {
- if (try_to_debug (0))
- {
- debugging = true;
- return 0;
- }
-
- rtl_unwind (frame, e);
- open_stackdumpfile ();
- exception (e, in);
- stackdump ((DWORD) ebp, 0, 1);
- }
-
- if (e->ExceptionCode == STATUS_ACCESS_VIOLATION)
- {
- int error_code = 0;
- if (si.si_code == SEGV_ACCERR) /* Address present */
- error_code |= 1;
- if (e->ExceptionInformation[0]) /* Write access */
- error_code |= 2;
- if (!me.inside_kernel (in)) /* User space */
- error_code |= 4;
- klog (LOG_INFO, "%s[%d]: segfault at %08x rip %08x rsp %08x error %d",
- __progname, myself->pid,
- e->ExceptionInformation[1], in->Eip, in->Esp,
- ((in->Eip >= 0x61000000 && in->Eip < 0x61200000)
- ? 0 : 4) | (e->ExceptionInformation[0] << 1));
- }
-
- me.signal_exit (0x80 | si.si_signo); // Flag signal + core dump
- }
-
- si.si_addr = (void *) in->Eip;
- si.si_errno = si.si_pid = si.si_uid = 0;
- me.incyg++;
- sig_send (NULL, si, &me); // Signal myself
- me.incyg--;
- e->ExceptionFlags = 0;
- return 0;
-}
-
-/* Utilities to call a user supplied exception handler. */
-
-#define SIG_NONMASKABLE (SIGTOMASK (SIGKILL) | SIGTOMASK (SIGSTOP))
-
-/* Non-raceable sigsuspend
- * Note: This implementation is based on the Single UNIX Specification
- * man page. This indicates that sigsuspend always returns -1 and that
- * attempts to block unblockable signals will be silently ignored.
- * This is counter to what appears to be documented in some UNIX
- * man pages, e.g. Linux.
- */
-int __stdcall
-handle_sigsuspend (sigset_t tempmask)
-{
- if (&_my_tls != _main_tls)
- {
- cancelable_wait (signal_arrived, INFINITE, cw_cancel_self);
- return -1;
- }
-
- sigset_t oldmask = _my_tls.sigmask; // Remember for restoration
-
- set_signal_mask (tempmask, _my_tls.sigmask);
- sigproc_printf ("oldmask %p, newmask %p", oldmask, tempmask);
-
- pthread_testcancel ();
- cancelable_wait (signal_arrived, INFINITE);
-
- set_sig_errno (EINTR); // Per POSIX
-
- /* A signal dispatch function will have been added to our stack and will
- be hit eventually. Set the old mask to be restored when the signal
- handler returns and indicate its presence by modifying deltamask. */
-
- _my_tls.deltamask |= SIG_NONMASKABLE;
- _my_tls.oldmask = oldmask; // Will be restored by signal handler
- return -1;
-}
-
-extern DWORD exec_exit; // Possible exit value for exec
-
-extern "C" {
-static void
-sig_handle_tty_stop (int sig)
-{
- _my_tls.incyg = 1;
- /* Silently ignore attempts to suspend if there is no accommodating
- cygwin parent to deal with this behavior. */
- if (!myself->cygstarted)
- {
- myself->process_state &= ~PID_STOPPED;
- return;
- }
-
- myself->stopsig = sig;
- myself->alert_parent (sig);
- sigproc_printf ("process %d stopped by signal %d", myself->pid, sig);
- HANDLE w4[2];
- w4[0] = sigCONT;
- w4[1] = signal_arrived;
- switch (WaitForMultipleObjects (2, w4, TRUE, INFINITE))
- {
- case WAIT_OBJECT_0:
- case WAIT_OBJECT_0 + 1:
- reset_signal_arrived ();
- myself->alert_parent (SIGCONT);
- break;
- default:
- api_fatal ("WaitSingleObject failed, %E");
- break;
- }
- _my_tls.incyg = 0;
-}
-}
-
-bool
-_cygtls::interrupt_now (CONTEXT *cx, int sig, void *handler,
- struct sigaction& siga)
-{
- bool interrupted;
-
- if (incyg || spinning || locked () || inside_kernel (cx))
- interrupted = false;
- else
- {
- push ((__stack_t) cx->Eip);
- interrupt_setup (sig, handler, siga);
- cx->Eip = pop ();
- SetThreadContext (*this, cx); /* Restart the thread in a new location */
- interrupted = true;
- }
- return interrupted;
-}
-
-void __stdcall
-_cygtls::interrupt_setup (int sig, void *handler, struct sigaction& siga)
-{
- push ((__stack_t) sigdelayed);
- deltamask = siga.sa_mask & ~SIG_NONMASKABLE;
- sa_flags = siga.sa_flags;
- func = (void (*) (int)) handler;
- if (siga.sa_flags & SA_RESETHAND)
- siga.sa_handler = SIG_DFL;
- saved_errno = -1; // Flag: no errno to save
- if (handler == sig_handle_tty_stop)
- {
- myself->stopsig = 0;
- myself->process_state |= PID_STOPPED;
- }
-
- this->sig = sig; // Should always be last thing set to avoid a race
-
- if (!event)
- threadkill = false;
- else
- {
- HANDLE h = event;
- event = NULL;
- SetEvent (h);
- }
-
- /* Clear any waiting threads prior to dispatching to handler function */
- int res = SetEvent (signal_arrived); // For an EINTR case
- proc_subproc (PROC_CLEARWAIT, 1);
- sigproc_printf ("armed signal_arrived %p, sig %d, res %d", signal_arrived,
- sig, res);
-}
-
-extern "C" void __stdcall
-set_sig_errno (int e)
-{
- *_my_tls.errno_addr = e;
- _my_tls.saved_errno = e;
- // sigproc_printf ("errno %d", e);
-}
-
-static int setup_handler (int, void *, struct sigaction&, _cygtls *tls)
- __attribute__((regparm(3)));
-static int
-setup_handler (int sig, void *handler, struct sigaction& siga, _cygtls *tls)
-{
- CONTEXT cx;
- bool interrupted = false;
-
- if (tls->sig)
- {
- sigproc_printf ("trying to send sig %d but signal %d already armed",
- sig, tls->sig);
- goto out;
- }
-
- for (int i = 0; i < CALL_HANDLER_RETRY; i++)
- {
- tls->lock ();
- if (tls->incyg)
- {
- sigproc_printf ("controlled interrupt. stackptr %p, stack %p, stackptr[-1] %p",
- tls->stackptr, tls->stack, tls->stackptr[-1]);
- tls->interrupt_setup (sig, handler, siga);
- interrupted = true;
- tls->unlock ();
- break;
- }
-
- tls->unlock ();
- DWORD res;
- HANDLE hth = (HANDLE) *tls;
-
- /* Suspend the thread which will receive the signal.
- For Windows 95, we also have to ensure that the addresses returned by
- GetThreadContext are valid.
- If one of these conditions is not true we loop for a fixed number of times
- since we don't want to stall the signal handler. FIXME: Will this result in
- noticeable delays?
- If the thread is already suspended (which can occur when a program has called
- SuspendThread on itself) then just queue the signal. */
-
-#ifndef DEBUGGING
- sigproc_printf ("suspending mainthread");
-#else
- cx.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER;
- if (!GetThreadContext (hth, &cx))
- memset (&cx, 0, sizeof cx);
- sigproc_printf ("suspending mainthread PC %p", cx.Eip);
-#endif
- res = SuspendThread (hth);
- /* Just set pending if thread is already suspended */
- if (res)
- {
- ResumeThread (hth);
- break;
- }
- cx.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER;
- if (!GetThreadContext (hth, &cx))
- system_printf ("couldn't get context of main thread, %E");
- else
- interrupted = tls->interrupt_now (&cx, sig, handler, siga);
-
- res = ResumeThread (hth);
- if (interrupted)
- break;
-
- sigproc_printf ("couldn't interrupt. trying again.");
- low_priority_sleep (0);
- }
-
-out:
- sigproc_printf ("signal %d %sdelivered", sig, interrupted ? "" : "not ");
- return interrupted;
-}
-
-static inline bool
-has_visible_window_station ()
-{
- HWINSTA station_hdl;
- USEROBJECTFLAGS uof;
- DWORD len;
-
- /* Check if the process is associated with a visible window station.
- These are processes running on the local desktop as well as processes
- running in terminal server sessions.
- Processes running in a service session not explicitely associated
- with the desktop (using the "Allow service to interact with desktop"
- property) are running in an invisible window station. */
- if ((station_hdl = GetProcessWindowStation ())
- && GetUserObjectInformationW (station_hdl, UOI_FLAGS, &uof,
- sizeof uof, &len)
- && (uof.dwFlags & WSF_VISIBLE))
- return true;
- return false;
-}
-
-/* Keyboard interrupt handler. */
-static BOOL WINAPI
-ctrl_c_handler (DWORD type)
-{
- static bool saw_close;
- lock_process now;
-
- if (!cygwin_finished_initializing)
- {
- if (myself->cygstarted) /* Was this process created by a cygwin process? */
- return TRUE; /* Yes. Let the parent eventually handle CTRL-C issues. */
- debug_printf ("exiting with status %p", STATUS_CONTROL_C_EXIT);
- ExitProcess (STATUS_CONTROL_C_EXIT);
- }
-
- _my_tls.remove (INFINITE);
-
-#if 0
- if (type == CTRL_C_EVENT || type == CTRL_BREAK_EVENT)
- proc_subproc (PROC_KILLFORKED, 0);
-#endif
-
- /* Return FALSE to prevent an "End task" dialog box from appearing
- for each Cygwin process window that's open when the computer
- is shut down or console window is closed. */
-
- if (type == CTRL_SHUTDOWN_EVENT)
- {
-#if 0
- /* Don't send a signal. Only NT service applications and their child
- processes will receive this event and the services typically already
- handle the shutdown action when getting the SERVICE_CONTROL_SHUTDOWN
- control message. */
- sig_send (NULL, SIGTERM);
-#endif
- return FALSE;
- }
-
- if (myself->ctty != -1)
- {
- if (type == CTRL_CLOSE_EVENT)
- {
- sig_send (NULL, SIGHUP);
- saw_close = true;
- return FALSE;
- }
- if (!saw_close && type == CTRL_LOGOFF_EVENT)
- {
- /* The CTRL_LOGOFF_EVENT is sent when *any* user logs off.
- The below code sends a SIGHUP only if it is not performing the
- default activity for SIGHUP. Note that it is possible for two
- SIGHUP signals to arrive if a process group leader is exiting
- too. Getting this 100% right is saved for a future cygwin mailing
- list goad. */
- if (global_sigs[SIGHUP].sa_handler != SIG_DFL)
- {
- sig_send (myself_nowait, SIGHUP);
- return TRUE;
- }
- return FALSE;
- }
- }
-
- if (chExeced)
- {
- chExeced->set_saw_ctrl_c ();
- return TRUE;
- }
-
- /* We're only the process group leader when we have a valid pinfo structure.
- If we don't have one, then the parent "stub" will handle the signal. */
- if (!pinfo (cygwin_pid (GetCurrentProcessId ())))
- return TRUE;
-
- tty_min *t = cygwin_shared->tty.get_tty (myself->ctty);
- /* Ignore this if we're not the process group leader since it should be handled
- *by* the process group leader. */
- if (myself->ctty != -1 && t->getpgid () == myself->pid &&
- (GetTickCount () - t->last_ctrl_c) >= MIN_CTRL_C_SLOP)
- /* Otherwise we just send a SIGINT to the process group and return TRUE (to indicate
- that we have handled the signal). At this point, type should be
- a CTRL_C_EVENT or CTRL_BREAK_EVENT. */
- {
- int sig = SIGINT;
- /* If intr and quit are both mapped to ^C, send SIGQUIT on ^BREAK */
- if (type == CTRL_BREAK_EVENT
- && t->ti.c_cc[VINTR] == 3 && t->ti.c_cc[VQUIT] == 3)
- sig = SIGQUIT;
- t->last_ctrl_c = GetTickCount ();
- killsys (-myself->pid, sig);
- t->last_ctrl_c = GetTickCount ();
- return TRUE;
- }
-
- return TRUE;
-}
-
-/* Function used by low level sig wrappers. */
-extern "C" void __stdcall
-set_process_mask (sigset_t newmask)
-{
- set_signal_mask (newmask, _my_tls.sigmask);
-}
-
-extern "C" int
-sighold (int sig)
-{
- /* check that sig is in right range */
- if (sig < 0 || sig >= NSIG)
- {
- set_errno (EINVAL);
- syscall_printf ("signal %d out of range", sig);
- return -1;
- }
- mask_sync.acquire (INFINITE);
- sigset_t mask = _my_tls.sigmask;
- sigaddset (&mask, sig);
- set_signal_mask (mask, _my_tls.sigmask);
- mask_sync.release ();
- return 0;
-}
-
-extern "C" int
-sigrelse (int sig)
-{
- /* check that sig is in right range */
- if (sig < 0 || sig >= NSIG)
- {
- set_errno (EINVAL);
- syscall_printf ("signal %d out of range", sig);
- return -1;
- }
- mask_sync.acquire (INFINITE);
- sigset_t mask = _my_tls.sigmask;
- sigdelset (&mask, sig);
- set_signal_mask (mask, _my_tls.sigmask);
- mask_sync.release ();
- return 0;
-}
-
-extern "C" _sig_func_ptr
-sigset (int sig, _sig_func_ptr func)
-{
- sig_dispatch_pending ();
- _sig_func_ptr prev;
-
- /* check that sig is in right range */
- if (sig < 0 || sig >= NSIG || sig == SIGKILL || sig == SIGSTOP)
- {
- set_errno (EINVAL);
- syscall_printf ("SIG_ERR = sigset (%d, %p)", sig, func);
- return (_sig_func_ptr) SIG_ERR;
- }
-
- mask_sync.acquire (INFINITE);
- sigset_t mask = _my_tls.sigmask;
- /* If sig was in the signal mask return SIG_HOLD, otherwise return the
- previous disposition. */
- if (sigismember (&mask, sig))
- prev = SIG_HOLD;
- else
- prev = global_sigs[sig].sa_handler;
- /* If func is SIG_HOLD, add sig to the signal mask, otherwise set the
- disposition to func and remove sig from the signal mask. */
- if (func == SIG_HOLD)
- sigaddset (&mask, sig);
- else
- {
- /* No error checking. The test which could return SIG_ERR has already
- been made above. */
- signal (sig, func);
- sigdelset (&mask, sig);
- }
- set_signal_mask (mask, _my_tls.sigmask);
- mask_sync.release ();
- return prev;
-}
-
-extern "C" int
-sigignore (int sig)
-{
- return sigset (sig, SIG_IGN) == SIG_ERR ? -1 : 0;
-}
-
-/* Update the signal mask for this process and return the old mask.
- Called from sigdelayed */
-extern "C" sigset_t
-set_process_mask_delta ()
-{
- mask_sync.acquire (INFINITE);
- sigset_t newmask, oldmask;
-
- if (_my_tls.deltamask & SIG_NONMASKABLE)
- oldmask = _my_tls.oldmask; /* from handle_sigsuspend */
- else
- oldmask = _my_tls.sigmask;
- newmask = (oldmask | _my_tls.deltamask) & ~SIG_NONMASKABLE;
- sigproc_printf ("oldmask %p, newmask %p, deltamask %p", oldmask, newmask,
- _my_tls.deltamask);
- _my_tls.sigmask = newmask;
- mask_sync.release ();
- return oldmask;
-}
-
-/* Set the signal mask for this process.
- Note that some signals are unmaskable, as in UNIX. */
-extern "C" void __stdcall
-set_signal_mask (sigset_t newmask, sigset_t& oldmask)
-{
-#ifdef CGF
- if (&_my_tls == _sig_tls)
- small_printf ("********* waiting in signal thread\n");
-#endif
- mask_sync.acquire (INFINITE);
- newmask &= ~SIG_NONMASKABLE;
- sigset_t mask_bits = oldmask & ~newmask;
- sigproc_printf ("oldmask %p, newmask %p, mask_bits %p", oldmask, newmask,
- mask_bits);
- oldmask = newmask;
- if (mask_bits)
- sig_dispatch_pending (true);
- else
- sigproc_printf ("not calling sig_dispatch_pending");
- mask_sync.release ();
-}
-
-int __stdcall
-sigpacket::process ()
-{
- DWORD continue_now;
- struct sigaction dummy = global_sigs[SIGSTOP];
-
- if (si.si_signo != SIGCONT)
- continue_now = false;
- else
- {
- continue_now = myself->process_state & PID_STOPPED;
- myself->stopsig = 0;
- myself->process_state &= ~PID_STOPPED;
- /* Clear pending stop signals */
- sig_clear (SIGSTOP);
- sig_clear (SIGTSTP);
- sig_clear (SIGTTIN);
- sig_clear (SIGTTOU);
- }
-
- int rc = 1;
-
- sigproc_printf ("signal %d processing", si.si_signo);
- struct sigaction& thissig = global_sigs[si.si_signo];
-
- myself->rusage_self.ru_nsignals++;
-
- bool masked;
- void *handler;
- if (!hExeced || (void *) thissig.sa_handler == (void *) SIG_IGN)
- handler = (void *) thissig.sa_handler;
- else if (tls)
- return 1;
- else
- handler = NULL;
-
- if (si.si_signo == SIGKILL)
- goto exit_sig;
- if (si.si_signo == SIGSTOP)
- {
- sig_clear (SIGCONT);
- if (!tls)
- tls = _main_tls;
- goto stop;
- }
-
- bool insigwait_mask;
- if ((masked = ISSTATE (myself, PID_STOPPED)))
- insigwait_mask = false;
- else if (!tls)
- insigwait_mask = !handler && (tls = _cygtls::find_tls (si.si_signo));
- else
- insigwait_mask = sigismember (&tls->sigwait_mask, si.si_signo);
-
- if (insigwait_mask)
- goto thread_specific;
-
- if (masked)
- /* nothing to do */;
- else if (sigismember (mask, si.si_signo))
- masked = true;
- else if (tls)
- masked = sigismember (&tls->sigmask, si.si_signo);
-
- if (!tls)
- tls = _main_tls;
-
- if (masked)
- {
- sigproc_printf ("signal %d blocked", si.si_signo);
- rc = -1;
- goto done;
- }
-
- /* Clear pending SIGCONT on stop signals */
- if (si.si_signo == SIGTSTP || si.si_signo == SIGTTIN || si.si_signo == SIGTTOU)
- sig_clear (SIGCONT);
-
-#ifdef CGF
- if (being_debugged ())
- {
- char sigmsg[sizeof (_CYGWIN_SIGNAL_STRING " 0xffffffff")];
- __small_sprintf (sigmsg, _CYGWIN_SIGNAL_STRING " %p", si.si_signo);
- OutputDebugString (sigmsg);
- }
-#endif
-
- if (handler == (void *) SIG_DFL)
- {
- if (insigwait_mask)
- goto thread_specific;
- if (si.si_signo == SIGCHLD || si.si_signo == SIGIO || si.si_signo == SIGCONT || si.si_signo == SIGWINCH
- || si.si_signo == SIGURG)
- {
- sigproc_printf ("default signal %d ignored", si.si_signo);
- if (continue_now)
- SetEvent (signal_arrived);
- goto done;
- }
-
- if (si.si_signo == SIGTSTP || si.si_signo == SIGTTIN || si.si_signo == SIGTTOU)
- goto stop;
-
- goto exit_sig;
- }
-
- if (handler == (void *) SIG_IGN)
- {
- sigproc_printf ("signal %d ignored", si.si_signo);
- goto done;
- }
-
- if (handler == (void *) SIG_ERR)
- goto exit_sig;
-
- tls->set_siginfo (this);
- goto dosig;
-
-stop:
- /* Eat multiple attempts to STOP */
- if (ISSTATE (myself, PID_STOPPED))
- goto done;
- handler = (void *) sig_handle_tty_stop;
- thissig = dummy;
-
-dosig:
- /* Dispatch to the appropriate function. */
- sigproc_printf ("signal %d, about to call %p", si.si_signo, handler);
- rc = setup_handler (si.si_signo, handler, thissig, tls);
-
-done:
- if (continue_now)
- SetEvent (sigCONT);
- sigproc_printf ("returning %d", rc);
- return rc;
-
-thread_specific:
- tls->sig = si.si_signo;
- tls->set_siginfo (this);
- sigproc_printf ("releasing sigwait for thread");
- SetEvent (tls->event);
- goto done;
-
-exit_sig:
- if (si.si_signo == SIGQUIT || si.si_signo == SIGABRT)
- {
- CONTEXT c;
- c.ContextFlags = CONTEXT_FULL;
- GetThreadContext (hMainThread, &c);
- tls->copy_context (&c);
- si.si_signo |= 0x80;
- }
- sigproc_printf ("signal %d, about to call do_exit", si.si_signo);
- tls->signal_exit (si.si_signo); /* never returns */
-}
-
-/* Cover function to `do_exit' to handle exiting even in presence of more
- exceptions. We used to call exit, but a SIGSEGV shouldn't cause atexit
- routines to run. */
-void
-_cygtls::signal_exit (int rc)
-{
- if (hExeced)
- {
- sigproc_printf ("terminating captive process");
- TerminateProcess (hExeced, sigExeced = rc);
- }
-
- signal_debugger (rc & 0x7f);
- if ((rc & 0x80) && !try_to_debug ())
- stackdump (thread_context.ebp, 1, 1);
-
- lock_process until_exit (true);
- if (hExeced || exit_state > ES_PROCESS_LOCKED)
- myself.exit (rc);
-
- /* Starve other threads in a vain attempt to stop them from doing something
- stupid. */
- SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_TIME_CRITICAL);
-
- sigproc_printf ("about to call do_exit (%x)", rc);
- SetEvent (signal_arrived);
- do_exit (rc);
-}
-
-void
-events_init ()
-{
- mask_sync.init ("mask_sync");
- windows_system_directory[0] = L'\0';
- GetSystemDirectoryW (windows_system_directory, sizeof (windows_system_directory) / sizeof (WCHAR) - 2);
- PWCHAR end = wcschr (windows_system_directory, L'\0');
- if (end == windows_system_directory)
- api_fatal ("can't find windows system directory");
- if (end[-1] != L'\\')
- {
- *end++ = L'\\';
- *end = L'\0';
- }
- windows_system_directory_length = end - windows_system_directory;
- debug_printf ("windows_system_directory '%W', windows_system_directory_length %d",
- windows_system_directory, windows_system_directory_length);
-}
-
-void
-events_terminate ()
-{
- exit_already = 1;
-}
-
-int
-_cygtls::call_signal_handler ()
-{
- int this_sa_flags = 0;
- /* Call signal handler. */
- while (sig)
- {
- lock ();
- this_sa_flags = sa_flags;
- int thissig = sig;
-
- pop ();
- reset_signal_arrived ();
- sigset_t this_oldmask = set_process_mask_delta ();
- int this_errno = saved_errno;
- sig = 0;
- unlock (); // make sure synchronized
- incyg = 0;
- if (!(this_sa_flags & SA_SIGINFO))
- {
- void (*sigfunc) (int) = func;
- sigfunc (thissig);
- }
- else
- {
- siginfo_t thissi = infodata;
- void (*sigact) (int, siginfo_t *, void *) = (void (*) (int, siginfo_t *, void *)) func;
- /* no ucontext_t information provided yet */
- sigact (thissig, &thissi, NULL);
- }
- incyg = 1;
- set_signal_mask (this_oldmask, _my_tls.sigmask);
- if (this_errno >= 0)
- set_errno (this_errno);
- }
-
- return this_sa_flags & SA_RESTART;
-}
-
-extern "C" void __stdcall
-reset_signal_arrived ()
-{
- // NEEDED? WaitForSingleObject (signal_arrived, 10);
- ResetEvent (signal_arrived);
- sigproc_printf ("reset signal_arrived");
- if (_my_tls.stackptr > _my_tls.stack)
- debug_printf ("stackptr[-1] %p", _my_tls.stackptr[-1]);
-}
-
-void
-_cygtls::copy_context (CONTEXT *c)
-{
- memcpy (&thread_context, c, (&thread_context._internal - (unsigned char *) &thread_context));
-}
-
-void
-_cygtls::signal_debugger (int sig)
-{
- if (isinitialized () && being_debugged ())
- {
- char sigmsg[2 * sizeof (_CYGWIN_SIGNAL_STRING " ffffffff ffffffff")];
- __small_sprintf (sigmsg, _CYGWIN_SIGNAL_STRING " %d %p %p", sig, thread_id, &thread_context);
- OutputDebugString (sigmsg);
- }
-}
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc
deleted file mode 100644
index d9ab4d57831..00000000000
--- a/winsup/cygwin/external.cc
+++ /dev/null
@@ -1,365 +0,0 @@
-/* external.cc: Interface to Cygwin internals from external programs.
-
- Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008 Red Hat, Inc.
-
- Written by Christopher Faylor <cgf@cygnus.com>
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "winsup.h"
-#include "sigproc.h"
-#include "pinfo.h"
-#include "shared_info.h"
-#include "cygwin_version.h"
-#include "cygerrno.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "cygheap.h"
-#include "heap.h"
-#include "cygtls.h"
-#include "child_info.h"
-#include "environ.h"
-#include <unistd.h>
-#include <stdlib.h>
-#include <wchar.h>
-#include <iptypes.h>
-
-child_info *get_cygwin_startup_info ();
-
-static winpids pids;
-
-static external_pinfo *
-fillout_pinfo (pid_t pid, int winpid)
-{
- BOOL nextpid;
- static external_pinfo ep;
- static char ep_progname_long_buf[NT_MAX_PATH];
-
- if ((nextpid = !!(pid & CW_NEXTPID)))
- pid ^= CW_NEXTPID;
-
-
- static unsigned int i;
- if (!pids.npids || !nextpid)
- {
- pids.set (winpid);
- i = 0;
- }
-
- if (!pid)
- i = 0;
-
- memset (&ep, 0, sizeof ep);
- while (i < pids.npids)
- {
- DWORD thispid = pids.winpid (i);
- _pinfo *p = pids[i];
- i++;
-
- if (!p)
- {
- if (!nextpid && thispid != (DWORD) pid)
- continue;
- ep.pid = cygwin_pid (thispid);
- ep.dwProcessId = thispid;
- ep.process_state = PID_IN_USE;
- ep.ctty = -1;
- break;
- }
- else if (nextpid || p->pid == pid || (winpid && thispid == (DWORD) pid))
- {
- ep.ctty = p->ctty;
- ep.pid = p->pid;
- ep.ppid = p->ppid;
- ep.dwProcessId = p->dwProcessId;
- ep.uid = p->uid;
- ep.gid = p->gid;
- ep.pgid = p->pgid;
- ep.sid = p->sid;
- ep.umask = 0;
- ep.start_time = p->start_time;
- ep.rusage_self = p->rusage_self;
- ep.rusage_children = p->rusage_children;
- ep.progname[0] = '\0';
- strncat (ep.progname, p->progname, MAX_PATH - 1);
- ep.strace_mask = 0;
- ep.version = EXTERNAL_PINFO_VERSION;
-
- ep.process_state = p->process_state;
-
- ep.uid32 = p->uid;
- ep.gid32 = p->gid;
-
- ep.progname_long = ep_progname_long_buf;
- strcpy (ep.progname_long, p->progname);
- break;
- }
- }
-
- if (!ep.pid)
- {
- i = 0;
- pids.reset ();
- return 0;
- }
- return &ep;
-}
-
-static inline DWORD
-get_cygdrive_info (char *user, char *system, char *user_flags,
- char *system_flags)
-{
- int res = mount_table->get_cygdrive_info (user, system, user_flags,
- system_flags);
- return (res == ERROR_SUCCESS) ? 1 : 0;
-}
-
-static DWORD
-check_ntsec (const char *filename)
-{
- if (!filename)
- return true;
- path_conv pc (filename);
- return pc.has_acls ();
-}
-
-/* Copy cygwin environment variables to the Windows environment. */
-static void
-sync_winenv ()
-{
- int unused_envc;
- PWCHAR envblock = NULL;
- char **envp = build_env (cur_environ (), envblock, unused_envc, false);
- PWCHAR p = envblock;
-
- if (envp)
- {
- for (char **e = envp; *e; e++)
- cfree (*e);
- cfree (envp);
- }
- if (!p)
- return;
- while (*p)
- {
- PWCHAR eq = wcschr (p, L'=');
- if (eq)
- {
- *eq = L'\0';
- SetEnvironmentVariableW (p, ++eq);
- p = eq;
- }
- p = wcschr (p, L'\0') + 1;
- }
- free (envblock);
-}
-
-extern "C" unsigned long
-cygwin_internal (cygwin_getinfo_types t, ...)
-{
- va_list arg;
- va_start (arg, t);
-
- switch (t)
- {
- case CW_LOCK_PINFO:
- return 1;
-
- case CW_UNLOCK_PINFO:
- return 1;
-
- case CW_GETTHREADNAME:
- return (DWORD) cygthread::name (va_arg (arg, DWORD));
-
- case CW_SETTHREADNAME:
- {
- set_errno (ENOSYS);
- return 0;
- }
-
- case CW_GETPINFO:
- return (DWORD) fillout_pinfo (va_arg (arg, DWORD), 0);
-
- case CW_GETVERSIONINFO:
- return (DWORD) cygwin_version_strings;
-
- case CW_READ_V1_MOUNT_TABLES:
- set_errno (ENOSYS);
- return 1;
-
- case CW_USER_DATA:
- return (DWORD) &__cygwin_user_data;
-
- case CW_PERFILE:
- perfile_table = va_arg (arg, struct __cygwin_perfile *);
- return 0;
-
- case CW_GET_CYGDRIVE_PREFIXES:
- {
- char *user = va_arg (arg, char *);
- char *system = va_arg (arg, char *);
- return get_cygdrive_info (user, system, NULL, NULL);
- }
-
- case CW_GETPINFO_FULL:
- return (DWORD) fillout_pinfo (va_arg (arg, pid_t), 1);
-
- case CW_INIT_EXCEPTIONS:
- /* noop */ /* init_exceptions (va_arg (arg, exception_list *)); */
- return 0;
-
- case CW_GET_CYGDRIVE_INFO:
- {
- char *user = va_arg (arg, char *);
- char *system = va_arg (arg, char *);
- char *user_flags = va_arg (arg, char *);
- char *system_flags = va_arg (arg, char *);
- return get_cygdrive_info (user, system, user_flags, system_flags);
- }
-
- case CW_SET_CYGWIN_REGISTRY_NAME:
- case CW_GET_CYGWIN_REGISTRY_NAME:
- return 0;
-
- case CW_STRACE_TOGGLE:
- {
- pid_t pid = va_arg (arg, pid_t);
- pinfo p (pid);
- if (p)
- {
- sig_send (p, __SIGSTRACE);
- return 0;
- }
- else
- {
- set_errno (ESRCH);
- return (DWORD) -1;
- }
- }
-
- case CW_STRACE_ACTIVE:
- {
- return strace.active ();
- }
-
- case CW_CYGWIN_PID_TO_WINPID:
- {
- pinfo p (va_arg (arg, pid_t));
- return p ? p->dwProcessId : 0;
- }
- case CW_EXTRACT_DOMAIN_AND_USER:
- {
- WCHAR nt_domain[MAX_DOMAIN_NAME_LEN + 1];
- WCHAR nt_user[UNLEN + 1];
-
- struct passwd *pw = va_arg (arg, struct passwd *);
- char *domain = va_arg (arg, char *);
- char *user = va_arg (arg, char *);
- extract_nt_dom_user (pw, nt_domain, nt_user);
- if (domain)
- sys_wcstombs (domain, MAX_DOMAIN_NAME_LEN + 1, nt_domain);
- if (user)
- sys_wcstombs (user, UNLEN + 1, nt_user);
- return 0;
- }
- case CW_CMDLINE:
- {
- size_t n;
- pid_t pid = va_arg (arg, pid_t);
- pinfo p (pid);
- return (DWORD) p->cmdline (n);
- }
- case CW_CHECK_NTSEC:
- {
- char *filename = va_arg (arg, char *);
- return check_ntsec (filename);
- }
- case CW_GET_ERRNO_FROM_WINERROR:
- {
- int error = va_arg (arg, int);
- int deferrno = va_arg (arg, int);
- return geterrno_from_win_error (error, deferrno);
- }
- case CW_GET_POSIX_SECURITY_ATTRIBUTE:
- {
- security_descriptor sd;
- int attribute = va_arg (arg, int);
- PSECURITY_ATTRIBUTES psa = va_arg (arg, PSECURITY_ATTRIBUTES);
- void *sd_buf = va_arg (arg, void *);
- DWORD sd_buf_size = va_arg (arg, DWORD);
- set_security_attribute (attribute, psa, sd);
- if (!psa->lpSecurityDescriptor)
- return sd.size ();
- psa->lpSecurityDescriptor = sd_buf;
- return sd.copy (sd_buf, sd_buf_size);
- }
- case CW_GET_SHMLBA:
- {
- return getpagesize ();
- }
- case CW_GET_UID_FROM_SID:
- {
- cygpsid psid = va_arg (arg, PSID);
- return psid.get_id (false, NULL);
- }
- case CW_GET_GID_FROM_SID:
- {
- cygpsid psid = va_arg (arg, PSID);
- return psid.get_id (true, NULL);
- }
- case CW_GET_BINMODE:
- {
- const char *path = va_arg (arg, const char *);
- path_conv p (path, PC_SYM_FOLLOW | PC_NULLEMPTY);
- if (p.error)
- {
- set_errno (p.error);
- return (unsigned long) -1;
- }
- return p.binmode ();
- }
- case CW_HOOK:
- {
- const char *name = va_arg (arg, const char *);
- const void *hookfn = va_arg (arg, const void *);
- WORD subsys;
- return (unsigned long) hook_or_detect_cygwin (name, hookfn, subsys);
- }
- case CW_ARGV:
- {
- child_info_spawn *ci = (child_info_spawn *) get_cygwin_startup_info ();
- return (unsigned long) (ci ? ci->moreinfo->argv : NULL);
- }
- case CW_ENVP:
- {
- child_info_spawn *ci = (child_info_spawn *) get_cygwin_startup_info ();
- return (unsigned long) (ci ? ci->moreinfo->envp : NULL);
- }
- case CW_DEBUG_SELF:
- error_start_init (va_arg (arg, const char *));
- try_to_debug ();
- break;
- case CW_SYNC_WINENV:
- sync_winenv ();
- return 0;
- case CW_CYGTLS_PADSIZE:
- return CYGTLS_PADSIZE;
- case CW_SET_DOS_FILE_WARNING:
- {
- extern bool dos_file_warning;
- dos_file_warning = va_arg (arg, int);
- }
- break;
-
- default:
- break;
- }
- set_errno (ENOSYS);
- return (unsigned long) -1;
-}
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
deleted file mode 100644
index de2b0d06e60..00000000000
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ /dev/null
@@ -1,2109 +0,0 @@
-/* fhandler_disk_file.cc
-
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "winsup.h"
-#include <stdlib.h>
-#include <sys/acl.h>
-#include <sys/statvfs.h>
-#include "cygerrno.h"
-#include "security.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "cygheap.h"
-#include "shared_info.h"
-#include "pinfo.h"
-#include "ntdll.h"
-#include "tls_pbuf.h"
-#include "nfs.h"
-#include <winioctl.h>
-
-#define _COMPILING_NEWLIB
-#include <dirent.h>
-
-class __DIR_mounts
-{
- int count;
- const char *parent_dir;
- int parent_dir_len;
- UNICODE_STRING mounts[MAX_MOUNTS];
- bool found[MAX_MOUNTS + 2];
- UNICODE_STRING cygdrive;
-
-#define __DIR_PROC (MAX_MOUNTS)
-#define __DIR_CYGDRIVE (MAX_MOUNTS+1)
-
- __ino64_t eval_ino (int idx)
- {
- __ino64_t ino = 0;
- char fname[parent_dir_len + mounts[idx].Length + 2];
- struct __stat64 st;
-
- char *c = stpcpy (fname, parent_dir);
- if (c[- 1] != '/')
- *c++ = '/';
- sys_wcstombs (c, mounts[idx].Length + 1,
- mounts[idx].Buffer, mounts[idx].Length / sizeof (WCHAR));
- path_conv pc (fname, PC_SYM_NOFOLLOW | PC_POSIX);
- if (!stat_worker (pc, &st))
- ino = st.st_ino;
- return ino;
- }
-
-public:
- __DIR_mounts (const char *posix_path)
- : parent_dir (posix_path)
- {
- parent_dir_len = strlen (parent_dir);
- count = mount_table->get_mounts_here (parent_dir, parent_dir_len, mounts,
- &cygdrive);
- rewind ();
- }
- ~__DIR_mounts ()
- {
- for (int i = 0; i < count; ++i)
- RtlFreeUnicodeString (&mounts[i]);
- RtlFreeUnicodeString (&cygdrive);
- }
- __ino64_t check_mount (PUNICODE_STRING fname, __ino64_t ino,
- bool eval = true)
- {
- if (parent_dir_len == 1) /* root dir */
- {
- UNICODE_STRING proc;
-
- RtlInitUnicodeString (&proc, L"proc");
- if (RtlEqualUnicodeString (fname, &proc, FALSE))
- {
- found[__DIR_PROC] = true;
- return 2;
- }
- if (fname->Length / sizeof (WCHAR) == mount_table->cygdrive_len - 2
- && RtlEqualUnicodeString (fname, &cygdrive, FALSE))
- {
- found[__DIR_CYGDRIVE] = true;
- return 2;
- }
- }
- for (int i = 0; i < count; ++i)
- if (RtlEqualUnicodeString (fname, &mounts[i], FALSE))
- {
- found[i] = true;
- return eval ? eval_ino (i) : 1;
- }
- return ino;
- }
- __ino64_t check_missing_mount (PUNICODE_STRING retname = NULL)
- {
- for (int i = 0; i < count; ++i)
- if (!found[i])
- {
- found[i] = true;
- if (retname)
- {
- *retname = mounts[i];
- return eval_ino (i);
- }
- return 1;
- }
- if (parent_dir_len == 1) /* root dir */
- {
- if (!found[__DIR_PROC])
- {
- found[__DIR_PROC] = true;
- if (retname)
- RtlInitUnicodeString (retname, L"proc");
- return 2;
- }
- if (!found[__DIR_CYGDRIVE])
- {
- found[__DIR_CYGDRIVE] = true;
- if (cygdrive.Length > 0)
- {
- if (retname)
- *retname = cygdrive;
- return 2;
- }
- }
- }
- return 0;
- }
- void rewind () { memset (found, 0, sizeof found); }
-};
-
-static inline bool
-is_volume_mountpoint (POBJECT_ATTRIBUTES attr)
-{
- bool ret = false;
- IO_STATUS_BLOCK io;
- HANDLE reph;
-
- if (NT_SUCCESS (NtOpenFile (&reph, READ_CONTROL, attr, &io,
- FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT
- | FILE_OPEN_REPARSE_POINT)))
- {
- PREPARSE_DATA_BUFFER rp = (PREPARSE_DATA_BUFFER)
- alloca (MAXIMUM_REPARSE_DATA_BUFFER_SIZE);
- if (NT_SUCCESS (NtFsControlFile (reph, NULL, NULL, NULL,
- &io, FSCTL_GET_REPARSE_POINT, NULL, 0,
- (LPVOID) rp, MAXIMUM_REPARSE_DATA_BUFFER_SIZE))
- && rp->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT
- && rp->SymbolicLinkReparseBuffer.PrintNameLength == 0)
- ret = true;
- NtClose (reph);
- }
- return ret;
-}
-
-static inline __ino64_t
-get_ino_by_handle (HANDLE hdl)
-{
- IO_STATUS_BLOCK io;
- FILE_INTERNAL_INFORMATION fai;
-
- if (NT_SUCCESS (NtQueryInformationFile (hdl, &io, &fai, sizeof fai,
- FileInternalInformation)))
- return fai.FileId.QuadPart;
- return 0;
-}
-
-unsigned __stdcall
-path_conv::ndisk_links (DWORD nNumberOfLinks)
-{
- if (!isdir () || isremote ())
- return nNumberOfLinks;
-
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- HANDLE fh;
-
- if (!NT_SUCCESS (NtOpenFile (&fh, SYNCHRONIZE | FILE_LIST_DIRECTORY,
- get_object_attr (attr, sec_none_nih),
- &io, FILE_SHARE_VALID_FLAGS,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT
- | FILE_DIRECTORY_FILE)))
- return nNumberOfLinks;
-
- unsigned count = 0;
- bool first = true;
- PFILE_DIRECTORY_INFORMATION fdibuf = (PFILE_DIRECTORY_INFORMATION)
- alloca (65536);
- __DIR_mounts *dir = new __DIR_mounts (normalized_path);
- while (NT_SUCCESS (NtQueryDirectoryFile (fh, NULL, NULL, 0, &io, fdibuf,
- 65536, FileDirectoryInformation,
- FALSE, NULL, first)))
- {
- if (first)
- {
- first = false;
- /* All directories have . and .. as their first entries.
- If . is not present as first entry, we're on a drive's
- root direcotry, which doesn't have these entries. */
- if (fdibuf->FileNameLength != 2 || fdibuf->FileName[0] != L'.')
- count = 2;
- }
- for (PFILE_DIRECTORY_INFORMATION pfdi = fdibuf;
- pfdi;
- pfdi = (PFILE_DIRECTORY_INFORMATION)
- (pfdi->NextEntryOffset ? (PBYTE) pfdi + pfdi->NextEntryOffset
- : NULL))
- {
- switch (pfdi->FileAttributes
- & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT))
- {
- case FILE_ATTRIBUTE_DIRECTORY:
- /* Just a directory */
- ++count;
- break;
- case FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT:
- /* Volume mount point or symlink to directory */
- {
- UNICODE_STRING fname;
-
- RtlInitCountedUnicodeString (&fname, pfdi->FileName,
- pfdi->FileNameLength);
- InitializeObjectAttributes (&attr, &fname,
- objcaseinsensitive (), fh, NULL);
- if (is_volume_mountpoint (&attr))
- ++count;
- }
- break;
- default:
- break;
- }
- UNICODE_STRING fname;
- RtlInitCountedUnicodeString (&fname, pfdi->FileName,
- pfdi->FileNameLength);
- dir->check_mount (&fname, 0, false);
- }
- }
- while (dir->check_missing_mount ())
- ++count;
- NtClose (fh);
- delete dir;
- return count;
-}
-
-inline bool
-path_conv::isgood_inode (__ino64_t ino) const
-{
- /* We can't trust remote inode numbers of only 32 bit. That means,
- all remote inode numbers when running under NT4, as well as remote NT4
- NTFS, as well as shares of Samba version < 3.0.
- The known exception are SFU NFS shares, which return the valid 32 bit
- inode number from the remote file system unchanged. */
- return hasgood_inode () && (ino > UINT32_MAX || !isremote () || fs_is_nfs ());
-}
-
-/* For files on NFS shares, we request an EA of type NfsV3Attributes.
- This returns the content of a struct fattr3 as defined in RFC 1813.
- The content is the NFS equivalent of struct stat. so there's not much
- to do here except for copying. */
-int __stdcall
-fhandler_base::fstat_by_nfs_ea (struct __stat64 *buf)
-{
- NTSTATUS status;
- IO_STATUS_BLOCK io;
- struct {
- FILE_FULL_EA_INFORMATION ffei;
- char buf[sizeof (NFS_V3_ATTR) + sizeof (fattr3)];
- } ffei_buf;
- struct {
- FILE_GET_EA_INFORMATION fgei;
- char buf[sizeof (NFS_V3_ATTR)];
- } fgei_buf;
-
- fgei_buf.fgei.NextEntryOffset = 0;
- fgei_buf.fgei.EaNameLength = sizeof (NFS_V3_ATTR) - 1;
- stpcpy (fgei_buf.fgei.EaName, NFS_V3_ATTR);
- status = NtQueryEaFile (get_handle (), &io,
- &ffei_buf.ffei, sizeof ffei_buf, TRUE,
- &fgei_buf.fgei, sizeof fgei_buf, NULL, TRUE);
- if (NT_SUCCESS (status))
- {
- fattr3 *nfs_attr = (fattr3 *) (ffei_buf.ffei.EaName
- + ffei_buf.ffei.EaNameLength + 1);
- buf->st_dev = nfs_attr->fsid;
- buf->st_ino = nfs_attr->fileid;
- buf->st_mode = (nfs_attr->mode & 0xfff)
- | nfs_type_mapping[nfs_attr->type & 7];
- buf->st_nlink = nfs_attr->nlink;
- /* FIXME: How to convert UNIX uid/gid to Windows SIDs? */
-#if 0
- buf->st_uid = nfs_attr->uid;
- buf->st_gid = nfs_attr->gid;
-#else
- buf->st_uid = myself->uid;
- buf->st_gid = myself->gid;
-#endif
- buf->st_rdev = makedev (nfs_attr->rdev.specdata1,
- nfs_attr->rdev.specdata2);
- buf->st_size = nfs_attr->size;
- buf->st_blksize = PREFERRED_IO_BLKSIZE;
- buf->st_blocks = nfs_attr->used / 512;
- buf->st_atim = nfs_attr->atime;
- buf->st_mtim = nfs_attr->mtime;
- buf->st_ctim = nfs_attr->ctime;
- return 0;
- }
- debug_printf ("%p = NtQueryEaFile(%S)", status, pc.get_nt_native_path ());
- return -1;
-}
-
-int __stdcall
-fhandler_base::fstat_by_handle (struct __stat64 *buf)
-{
- NTSTATUS status;
- IO_STATUS_BLOCK io;
-
- if (pc.fs_is_nfs ())
- return fstat_by_nfs_ea (buf);
-
- struct {
- FILE_ALL_INFORMATION fai;
- WCHAR buf[NAME_MAX + 1];
- } fai_buf;
-
- status = NtQueryInformationFile (get_handle (), &io, &fai_buf.fai,
- sizeof fai_buf, FileAllInformation);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("%p = NtQueryInformationFile(%S)",
- status, pc.get_nt_native_path ());
- return -1;
- }
- /* If the change time is 0, it's a file system which doesn't
- support a change timestamp. In that case use the LastWriteTime
- entry, as in other calls to fstat_helper. */
- if (pc.is_rep_symlink ())
- fai_buf.fai.BasicInformation.FileAttributes &= ~FILE_ATTRIBUTE_DIRECTORY;
- pc.file_attributes (fai_buf.fai.BasicInformation.FileAttributes);
- return fstat_helper (buf,
- fai_buf.fai.BasicInformation.ChangeTime.QuadPart
- ? *(FILETIME *) &fai_buf.fai.BasicInformation.ChangeTime
- : *(FILETIME *) &fai_buf.fai.BasicInformation.LastWriteTime,
- *(FILETIME *) &fai_buf.fai.BasicInformation.LastAccessTime,
- *(FILETIME *) &fai_buf.fai.BasicInformation.LastWriteTime,
- *(FILETIME *) &fai_buf.fai.BasicInformation.CreationTime,
- get_dev (),
- fai_buf.fai.StandardInformation.EndOfFile.QuadPart,
- fai_buf.fai.StandardInformation.AllocationSize.QuadPart,
- fai_buf.fai.InternalInformation.FileId.QuadPart,
- fai_buf.fai.StandardInformation.NumberOfLinks,
- fai_buf.fai.BasicInformation.FileAttributes);
-}
-
-int __stdcall
-fhandler_base::fstat_by_name (struct __stat64 *buf)
-{
- NTSTATUS status;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- UNICODE_STRING dirname;
- UNICODE_STRING basename;
- HANDLE dir;
- struct {
- FILE_ID_BOTH_DIR_INFORMATION fdi;
- WCHAR buf[NAME_MAX + 1];
- } fdi_buf;
- LARGE_INTEGER FileId;
-
- RtlSplitUnicodePath (pc.get_nt_native_path (), &dirname, &basename);
- InitializeObjectAttributes (&attr, &dirname, pc.objcaseinsensitive (),
- NULL, NULL);
- if (!NT_SUCCESS (status = NtOpenFile (&dir, SYNCHRONIZE | FILE_LIST_DIRECTORY,
- &attr, &io, FILE_SHARE_VALID_FLAGS,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT
- | FILE_DIRECTORY_FILE)))
- {
- debug_printf ("%p = NtOpenFile(%S)", status, pc.get_nt_native_path ());
- goto too_bad;
- }
- if (wincap.has_fileid_dirinfo () && !pc.has_buggy_fileid_dirinfo ()
- && NT_SUCCESS (status = NtQueryDirectoryFile (dir, NULL, NULL, 0, &io,
- &fdi_buf.fdi, sizeof fdi_buf,
- FileIdBothDirectoryInformation,
- TRUE, &basename, TRUE)))
- FileId = fdi_buf.fdi.FileId;
- else if (NT_SUCCESS (status = NtQueryDirectoryFile (dir, NULL, NULL, 0, &io,
- &fdi_buf.fdi, sizeof fdi_buf,
- FileDirectoryInformation,
- TRUE, &basename, TRUE)))
- FileId.QuadPart = 0; /* get_ino is called in fstat_helper. */
- if (!NT_SUCCESS (status))
- {
- debug_printf ("%p = NtQueryDirectoryFile(%S)", status,
- pc.get_nt_native_path ());
- NtClose (dir);
- goto too_bad;
- }
- NtClose (dir);
- /* If the change time is 0, it's a file system which doesn't
- support a change timestamp. In that case use the LastWriteTime
- entry, as in other calls to fstat_helper. */
- if (pc.is_rep_symlink ())
- fdi_buf.fdi.FileAttributes &= ~FILE_ATTRIBUTE_DIRECTORY;
- pc.file_attributes (fdi_buf.fdi.FileAttributes);
- return fstat_helper (buf,
- fdi_buf.fdi.ChangeTime.QuadPart ?
- *(FILETIME *) &fdi_buf.fdi.ChangeTime :
- *(FILETIME *) &fdi_buf.fdi.LastWriteTime,
- *(FILETIME *) &fdi_buf.fdi.LastAccessTime,
- *(FILETIME *) &fdi_buf.fdi.LastWriteTime,
- *(FILETIME *) &fdi_buf.fdi.CreationTime,
- pc.fs_serial_number (),
- fdi_buf.fdi.EndOfFile.QuadPart,
- fdi_buf.fdi.AllocationSize.QuadPart,
- FileId.QuadPart,
- 1,
- fdi_buf.fdi.FileAttributes);
-
-too_bad:
- LARGE_INTEGER ft;
- /* Arbitrary value: 2006-12-01 */
- RtlSecondsSince1970ToTime (1164931200L, &ft);
- return fstat_helper (buf,
- *(FILETIME *) &ft,
- *(FILETIME *) &ft,
- *(FILETIME *) &ft,
- *(FILETIME *) &ft,
- 0,
- 0ULL,
- -1LL,
- 0ULL,
- 1,
- pc.file_attributes ());
-}
-
-int __stdcall
-fhandler_base::fstat_fs (struct __stat64 *buf)
-{
- int res = -1;
- int oret;
- int open_flags = O_RDONLY | O_BINARY;
-
- if (get_handle ())
- {
- if (!nohandle () && !is_fs_special ())
- res = fstat_by_handle (buf);
- if (res)
- res = fstat_by_name (buf);
- return res;
- }
- query_open (query_read_attributes);
- oret = open_fs (open_flags, 0);
- if (oret)
- {
- /* We now have a valid handle, regardless of the "nohandle" state.
- Since fhandler_base::open only calls CloseHandle if !nohandle,
- we have to set it to false before calling close and restore
- the state afterwards. */
- res = fstat_by_handle (buf);
- bool no_handle = nohandle ();
- nohandle (false);
- close_fs ();
- nohandle (no_handle);
- set_io_handle (NULL);
- }
- if (res)
- res = fstat_by_name (buf);
-
- return res;
-}
-
-/* The ftChangeTime is taken from the NTFS ChangeTime entry, if reading
- the file information using NtQueryInformationFile succeeded. If not,
- it's faked using the LastWriteTime entry from GetFileInformationByHandle
- or FindFirstFile. We're deliberatly not using the creation time anymore
- to simplify interaction with native Windows applications which choke on
- creation times >= access or write times.
-
- Note that the dwFileAttributes member of the file information evaluated
- in the calling function is used here, not the pc.fileattr member, since
- the latter might be old and not reflect the actual state of the file. */
-int __stdcall
-fhandler_base::fstat_helper (struct __stat64 *buf,
- FILETIME ftChangeTime,
- FILETIME ftLastAccessTime,
- FILETIME ftLastWriteTime,
- FILETIME ftCreationTime,
- DWORD dwVolumeSerialNumber,
- ULONGLONG nFileSize,
- LONGLONG nAllocSize,
- ULONGLONG nFileIndex,
- DWORD nNumberOfLinks,
- DWORD dwFileAttributes)
-{
- IO_STATUS_BLOCK st;
- FILE_COMPRESSION_INFORMATION fci;
-
- to_timestruc_t (&ftLastAccessTime, &buf->st_atim);
- to_timestruc_t (&ftLastWriteTime, &buf->st_mtim);
- to_timestruc_t (&ftChangeTime, &buf->st_ctim);
- to_timestruc_t (&ftCreationTime, &buf->st_birthtim);
- buf->st_dev = dwVolumeSerialNumber;
- buf->st_size = (_off64_t) nFileSize;
- /* The number of links to a directory includes the
- number of subdirectories in the directory, since all
- those subdirectories point to it.
- This is too slow on remote drives, so we do without it.
- Setting the count to 2 confuses `find (1)' command. So
- let's try it with `1' as link count. */
-#if 0
- buf->st_nlink = pc.ndisk_links (nNumberOfLinks);
-#else
- buf->st_nlink = nNumberOfLinks;
-#endif
-
- /* Enforce namehash as inode number on untrusted file systems. */
- if (pc.isgood_inode (nFileIndex))
- buf->st_ino = (__ino64_t) nFileIndex;
- else
- buf->st_ino = get_ino ();
-
- buf->st_blksize = PREFERRED_IO_BLKSIZE;
-
- if (nAllocSize >= 0LL)
- /* A successful NtQueryInformationFile returns the allocation size
- correctly for compressed and sparse files as well. */
- buf->st_blocks = (nAllocSize + S_BLKSIZE - 1) / S_BLKSIZE;
- else if (::has_attribute (dwFileAttributes, FILE_ATTRIBUTE_COMPRESSED
- | FILE_ATTRIBUTE_SPARSE_FILE)
- && get_handle () && !is_fs_special ()
- && !NtQueryInformationFile (get_handle (), &st, (PVOID) &fci,
- sizeof fci, FileCompressionInformation))
- /* Otherwise we request the actual amount of bytes allocated for
- compressed and sparsed files. */
- buf->st_blocks = (fci.CompressedFileSize.QuadPart + S_BLKSIZE - 1)
- / S_BLKSIZE;
- else
- /* Otherwise compute no. of blocks from file size. */
- buf->st_blocks = (buf->st_size + S_BLKSIZE - 1) / S_BLKSIZE;
-
- buf->st_mode = 0;
- /* Using a side effect: get_file_attibutes checks for
- directory. This is used, to set S_ISVTX, if needed. */
- if (pc.isdir ())
- buf->st_mode = S_IFDIR;
- else if (pc.issymlink ())
- {
- buf->st_size = pc.get_symlink_length ();
- /* symlinks are everything for everyone! */
- buf->st_mode = S_IFLNK | S_IRWXU | S_IRWXG | S_IRWXO;
- get_file_attribute (get_handle (), pc, NULL,
- &buf->st_uid, &buf->st_gid);
- goto done;
- }
- else if (pc.issocket ())
- buf->st_mode = S_IFSOCK;
-
- if (!get_file_attribute (is_fs_special () && !pc.issocket ()
- ? NULL : get_handle (), pc,
- &buf->st_mode, &buf->st_uid, &buf->st_gid))
- {
- /* If read-only attribute is set, modify ntsec return value */
- if (::has_attribute (dwFileAttributes, FILE_ATTRIBUTE_READONLY)
- && !pc.isdir () && !pc.issymlink ())
- buf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
-
- if (buf->st_mode & S_IFMT)
- /* nothing */;
- else if (!is_fs_special ())
- buf->st_mode |= S_IFREG;
- else
- {
- buf->st_dev = dev ();
- buf->st_mode = dev ().mode;
- buf->st_size = 0;
- }
- }
- else
- {
- buf->st_mode |= STD_RBITS;
-
- if (!::has_attribute (dwFileAttributes, FILE_ATTRIBUTE_READONLY))
- buf->st_mode |= STD_WBITS;
- /* | S_IWGRP | S_IWOTH; we don't give write to group etc */
-
- if (pc.isdir ())
- buf->st_mode |= S_IFDIR | STD_WBITS | STD_XBITS;
- else if (buf->st_mode & S_IFMT)
- /* nothing */;
- else if (is_fs_special ())
- {
- buf->st_dev = dev ();
- buf->st_mode = dev ().mode;
- buf->st_size = 0;
- }
- else
- {
- buf->st_mode |= S_IFREG;
- if (pc.exec_state () == dont_know_if_executable)
- {
- UNICODE_STRING same;
- OBJECT_ATTRIBUTES attr;
- HANDLE h;
- IO_STATUS_BLOCK io;
-
- RtlInitUnicodeString (&same, L"");
- InitializeObjectAttributes (&attr, &same, 0, get_handle (), NULL);
- if (NT_SUCCESS (NtOpenFile (&h, FILE_READ_DATA, &attr, &io,
- FILE_SHARE_VALID_FLAGS, 0)))
- {
- LARGE_INTEGER off = { QuadPart:0LL };
- char magic[3];
-
- if (NT_SUCCESS (NtReadFile (h, NULL, NULL, NULL, &io, magic,
- 3, &off, NULL))
- && has_exec_chars (magic, io.Information))
- {
- pc.set_exec ();
- buf->st_mode |= STD_XBITS;
- }
- NtClose (h);
- }
- }
- }
- if (pc.exec_state () == is_executable)
- buf->st_mode |= STD_XBITS;
-
- /* This fakes the permissions of all files to match the current umask. */
- buf->st_mode &= ~(cygheap->umask);
- }
-
- done:
- syscall_printf ("0 = fstat (, %p) st_atime=%x st_size=%D, st_mode=%p, st_ino=%D, sizeof=%d",
- buf, buf->st_atime, buf->st_size, buf->st_mode,
- buf->st_ino, sizeof (*buf));
- return 0;
-}
-
-int __stdcall
-fhandler_disk_file::fstat (struct __stat64 *buf)
-{
- return fstat_fs (buf);
-}
-
-int __stdcall
-fhandler_disk_file::fstatvfs (struct statvfs *sfs)
-{
- int ret = -1, opened = 0;
- NTSTATUS status;
- IO_STATUS_BLOCK io;
- FILE_FS_FULL_SIZE_INFORMATION full_fsi;
- FILE_FS_SIZE_INFORMATION fsi;
- HANDLE fh = get_handle ();
-
- if (!fh)
- {
- OBJECT_ATTRIBUTES attr;
- opened = NT_SUCCESS (NtOpenFile (&fh, READ_CONTROL,
- pc.get_object_attr (attr, sec_none_nih),
- &io, FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT));
- if (!opened)
- {
- /* Can't open file. Try again with parent dir. */
- UNICODE_STRING dirname;
- RtlSplitUnicodePath (pc.get_nt_native_path (), &dirname, NULL);
- attr.ObjectName = &dirname;
- opened = NT_SUCCESS (NtOpenFile (&fh, READ_CONTROL, &attr, &io,
- FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT));
- if (!opened)
- goto out;
- }
- }
-
- sfs->f_files = ULONG_MAX;
- sfs->f_ffree = ULONG_MAX;
- sfs->f_favail = ULONG_MAX;
- sfs->f_fsid = pc.fs_serial_number ();
- sfs->f_flag = pc.fs_flags ();
- sfs->f_namemax = pc.fs_name_len ();
- /* Get allocation related information. Try to get "full" information
- first, which is only available since W2K. If that fails, try to
- retrieve normal allocation information. */
- status = NtQueryVolumeInformationFile (fh, &io, &full_fsi, sizeof full_fsi,
- FileFsFullSizeInformation);
- if (NT_SUCCESS (status))
- {
- sfs->f_bsize = full_fsi.BytesPerSector * full_fsi.SectorsPerAllocationUnit;
- sfs->f_frsize = sfs->f_bsize;
- sfs->f_blocks = full_fsi.TotalAllocationUnits.LowPart;
- sfs->f_bfree = full_fsi.ActualAvailableAllocationUnits.LowPart;
- sfs->f_bavail = full_fsi.CallerAvailableAllocationUnits.LowPart;
- if (sfs->f_bfree > sfs->f_bavail)
- {
- /* Quotas active. We can't trust TotalAllocationUnits. */
- NTFS_VOLUME_DATA_BUFFER nvdb;
-
- status = NtFsControlFile (fh, NULL, NULL, NULL, &io,
- FSCTL_GET_NTFS_VOLUME_DATA,
- NULL, 0, &nvdb, sizeof nvdb);
- if (!NT_SUCCESS (status))
- debug_printf ("%p = NtFsControlFile(%S, FSCTL_GET_NTFS_VOLUME_DATA)",
- status, pc.get_nt_native_path ());
- else
- sfs->f_blocks = nvdb.TotalClusters.QuadPart;
- }
- ret = 0;
- }
- else
- {
- status = NtQueryVolumeInformationFile (fh, &io, &fsi, sizeof fsi,
- FileFsSizeInformation);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- goto out;
- }
- sfs->f_bsize = fsi.BytesPerSector * fsi.SectorsPerAllocationUnit;
- sfs->f_frsize = sfs->f_bsize;
- sfs->f_blocks = fsi.TotalAllocationUnits.LowPart;
- sfs->f_bfree = fsi.AvailableAllocationUnits.LowPart;
- sfs->f_bavail = sfs->f_bfree;
- ret = 0;
- }
-out:
- if (opened)
- NtClose (fh);
- syscall_printf ("%d = fstatvfs (%s, %p)", ret, get_name (), sfs);
- return ret;
-}
-
-int __stdcall
-fhandler_disk_file::fchmod (mode_t mode)
-{
- extern int chmod_device (path_conv& pc, mode_t mode);
- int res = -1;
- int oret = 0;
- NTSTATUS status;
- IO_STATUS_BLOCK io;
-
- if (pc.is_fs_special ())
- return chmod_device (pc, mode);
-
- if (!get_handle ())
- {
- query_open (query_write_control);
- if (!(oret = open (O_BINARY, 0)))
- {
- /* Need WRITE_DAC|WRITE_OWNER to write ACLs. */
- if (pc.has_acls ())
- return -1;
- /* Otherwise FILE_WRITE_ATTRIBUTES is sufficient. */
- query_open (query_write_attributes);
- if (!(oret = open (O_BINARY, 0)))
- return -1;
- }
- }
-
- if (pc.fs_is_nfs ())
- {
- /* chmod on NFS shares works by writing an EA of type NfsV3Attributes.
- Only type and mode have to be set. Apparently type isn't checked
- for consistency, so it's sufficent to set it to NF3REG all the time. */
- struct {
- FILE_FULL_EA_INFORMATION ffei;
- char buf[sizeof (NFS_V3_ATTR) + sizeof (fattr3)];
- } ffei_buf;
- ffei_buf.ffei.NextEntryOffset = 0;
- ffei_buf.ffei.Flags = 0;
- ffei_buf.ffei.EaNameLength = sizeof (NFS_V3_ATTR) - 1;
- ffei_buf.ffei.EaValueLength = sizeof (fattr3);
- strcpy (ffei_buf.ffei.EaName, NFS_V3_ATTR);
- fattr3 *nfs_attr = (fattr3 *) (ffei_buf.ffei.EaName
- + ffei_buf.ffei.EaNameLength + 1);
- memset (nfs_attr, 0, sizeof (fattr3));
- nfs_attr->type = NF3REG;
- nfs_attr->mode = mode;
- status = NtSetEaFile (get_handle (), &io,
- &ffei_buf.ffei, sizeof ffei_buf);
- if (!NT_SUCCESS (status))
- __seterrno_from_nt_status (status);
- else
- res = 0;
- goto out;
- }
-
- if (pc.has_acls ())
- {
- if (pc.isdir ())
- mode |= S_IFDIR;
- if (!set_file_attribute (get_handle (), pc,
- ILLEGAL_UID, ILLEGAL_GID, mode))
- res = 0;
- }
-
- /* if the mode we want has any write bits set, we can't be read only. */
- if (mode & (S_IWUSR | S_IWGRP | S_IWOTH))
- pc &= (DWORD) ~FILE_ATTRIBUTE_READONLY;
- else
- pc |= (DWORD) FILE_ATTRIBUTE_READONLY;
- if (S_ISSOCK (mode))
- pc |= (DWORD) FILE_ATTRIBUTE_SYSTEM;
-
- FILE_BASIC_INFORMATION fbi;
- fbi.CreationTime.QuadPart = fbi.LastAccessTime.QuadPart
- = fbi.LastWriteTime.QuadPart = fbi.ChangeTime.QuadPart = 0LL;
- fbi.FileAttributes = pc.file_attributes () ?: FILE_ATTRIBUTE_NORMAL;
- status = NtSetInformationFile (get_handle (), &io, &fbi, sizeof fbi,
- FileBasicInformation);
- /* Correct NTFS security attributes have higher priority */
- if (!pc.has_acls ())
- {
- if (!NT_SUCCESS (status))
- __seterrno_from_nt_status (status);
- else
- res = 0;
- }
-
-out:
- if (oret)
- close_fs ();
-
- return res;
-}
-
-int __stdcall
-fhandler_disk_file::fchown (__uid32_t uid, __gid32_t gid)
-{
- int oret = 0;
-
- if (!pc.has_acls ())
- {
- /* fake - if not supported, pretend we're like win95
- where it just works */
- /* FIXME: Could be supported on NFS when user->uid mapping is in place. */
- return 0;
- }
-
- if (!get_handle ())
- {
- query_open (query_write_control);
- if (!(oret = fhandler_disk_file::open (O_BINARY, 0)))
- return -1;
- }
-
- mode_t attrib = 0;
- if (pc.isdir ())
- attrib |= S_IFDIR;
- int res = get_file_attribute (get_handle (), pc, &attrib, NULL, NULL);
- if (!res)
- {
- /* Typical Windows default ACLs can contain permissions for one
- group, while being owned by another user/group. The permission
- bits returned above are pretty much useless then. Creating a
- new ACL with these useless permissions results in a potentially
- broken symlink. So what we do here is to set the underlying
- permissions of symlinks to a sensible value which allows the
- world to read the symlink and only the new owner to change it. */
- if (pc.issymlink ())
- attrib = S_IFLNK | STD_RBITS | STD_WBITS;
- res = set_file_attribute (get_handle (), pc, uid, gid, attrib);
- }
- if (oret)
- close_fs ();
-
- return res;
-}
-
-int _stdcall
-fhandler_disk_file::facl (int cmd, int nentries, __aclent32_t *aclbufp)
-{
- int res = -1;
- int oret = 0;
-
- if (!pc.has_acls ())
- {
-cant_access_acl:
- switch (cmd)
- {
- struct __stat64 st;
-
- case SETACL:
- /* Open for writing required to be able to set ctime
- (even though setting the ACL is just pretended). */
- if (!get_handle ())
- oret = open (O_WRONLY | O_BINARY, 0);
- res = 0;
- break;
- case GETACL:
- if (!aclbufp)
- set_errno (EFAULT);
- else if (nentries < MIN_ACL_ENTRIES)
- set_errno (ENOSPC);
- else
- {
- if (!get_handle ())
- {
- query_open (query_read_attributes);
- oret = open (O_BINARY, 0);
- }
- if ((!oret && !fstat_by_handle (&st))
- || !fstat_by_name (&st))
- {
- aclbufp[0].a_type = USER_OBJ;
- aclbufp[0].a_id = st.st_uid;
- aclbufp[0].a_perm = (st.st_mode & S_IRWXU) >> 6;
- aclbufp[1].a_type = GROUP_OBJ;
- aclbufp[1].a_id = st.st_gid;
- aclbufp[1].a_perm = (st.st_mode & S_IRWXG) >> 3;
- aclbufp[2].a_type = OTHER_OBJ;
- aclbufp[2].a_id = ILLEGAL_GID;
- aclbufp[2].a_perm = st.st_mode & S_IRWXO;
- aclbufp[3].a_type = CLASS_OBJ;
- aclbufp[3].a_id = ILLEGAL_GID;
- aclbufp[3].a_perm = S_IRWXU | S_IRWXG | S_IRWXO;
- res = MIN_ACL_ENTRIES;
- }
- }
- break;
- case GETACLCNT:
- res = MIN_ACL_ENTRIES;
- break;
- default:
- set_errno (EINVAL);
- break;
- }
- }
- else
- {
- if (!get_handle ())
- {
- query_open (cmd == SETACL ? query_write_control : query_read_control);
- if (!(oret = open (O_BINARY, 0)))
- {
- if (cmd == GETACL || cmd == GETACLCNT)
- goto cant_access_acl;
- return -1;
- }
- }
- switch (cmd)
- {
- case SETACL:
- if (!aclsort32 (nentries, 0, aclbufp))
- {
- bool rw = false;
- res = setacl (get_handle (), pc, nentries, aclbufp, rw);
- if (rw)
- {
- IO_STATUS_BLOCK io;
- FILE_BASIC_INFORMATION fbi;
- fbi.CreationTime.QuadPart
- = fbi.LastAccessTime.QuadPart
- = fbi.LastWriteTime.QuadPart
- = fbi.ChangeTime.QuadPart = 0LL;
- fbi.FileAttributes = (pc.file_attributes ()
- & ~FILE_ATTRIBUTE_READONLY)
- ?: FILE_ATTRIBUTE_NORMAL;
- NtSetInformationFile (get_handle (), &io, &fbi, sizeof fbi,
- FileBasicInformation);
- }
- }
- break;
- case GETACL:
- if (!aclbufp)
- set_errno(EFAULT);
- else
- res = getacl (get_handle (), pc, nentries, aclbufp);
- break;
- case GETACLCNT:
- res = getacl (get_handle (), pc, 0, NULL);
- break;
- default:
- set_errno (EINVAL);
- break;
- }
- }
-
- if (oret)
- close_fs ();
-
- return res;
-}
-
-ssize_t
-fhandler_disk_file::fgetxattr (const char *name, void *value, size_t size)
-{
- if (pc.is_fs_special ())
- {
- set_errno (ENOTSUP);
- return -1;
- }
- return read_ea (get_handle (), pc, name, (char *) value, size);
-}
-
-int
-fhandler_disk_file::fsetxattr (const char *name, const void *value, size_t size,
- int flags)
-{
- if (pc.is_fs_special ())
- {
- set_errno (ENOTSUP);
- return -1;
- }
- return write_ea (get_handle (), pc, name, (const char *) value, size, flags);
-}
-
-int
-fhandler_disk_file::fadvise (_off64_t offset, _off64_t length, int advice)
-{
- if (advice < POSIX_FADV_NORMAL || advice > POSIX_FADV_NOREUSE)
- {
- set_errno (EINVAL);
- return -1;
- }
-
- /* Windows only supports advice flags for the whole file. We're using
- a simplified test here so that we don't have to ask for the actual
- file size. Length == 0 means all bytes starting at offset anyway.
- So we only actually follow the advice, if it's given for offset == 0. */
- if (offset != 0)
- return 0;
-
- /* We only support normal and sequential mode for now. Everything which
- is not POSIX_FADV_SEQUENTIAL is treated like POSIX_FADV_NORMAL. */
- if (advice != POSIX_FADV_SEQUENTIAL)
- advice = POSIX_FADV_NORMAL;
-
- IO_STATUS_BLOCK io;
- FILE_MODE_INFORMATION fmi;
- NTSTATUS status = NtQueryInformationFile (get_handle (), &io,
- &fmi, sizeof fmi,
- FileModeInformation);
- if (!NT_SUCCESS (status))
- __seterrno_from_nt_status (status);
- else
- {
- fmi.Mode &= ~FILE_SEQUENTIAL_ONLY;
- if (advice == POSIX_FADV_SEQUENTIAL)
- fmi.Mode |= FILE_SEQUENTIAL_ONLY;
- status = NtSetInformationFile (get_handle (), &io, &fmi, sizeof fmi,
- FileModeInformation);
- if (NT_SUCCESS (status))
- return 0;
- __seterrno_from_nt_status (status);
- }
-
- return -1;
-}
-
-int
-fhandler_disk_file::ftruncate (_off64_t length, bool allow_truncate)
-{
- int res = -1;
-
- if (length < 0 || !get_handle ())
- set_errno (EINVAL);
- else if (pc.isdir ())
- set_errno (EISDIR);
- else if (!(get_access () & GENERIC_WRITE))
- set_errno (EBADF);
- else
- {
- NTSTATUS status;
- IO_STATUS_BLOCK io;
- FILE_STANDARD_INFORMATION fsi;
- FILE_END_OF_FILE_INFORMATION feofi;
-
- status = NtQueryInformationFile (get_handle (), &io, &fsi, sizeof fsi,
- FileStandardInformation);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- return -1;
- }
-
- /* If called through posix_fallocate, silently succeed if length
- is less than the file's actual length. */
- if (!allow_truncate && length < fsi.EndOfFile.QuadPart)
- return 0;
-
- feofi.EndOfFile.QuadPart = length;
- /* Create sparse files only when called through ftruncate, not when
- called through posix_fallocate. */
- if (allow_truncate
- && (pc.fs_flags () & FILE_SUPPORTS_SPARSE_FILES)
- && length >= fsi.EndOfFile.QuadPart + (128 * 1024))
- {
- status = NtFsControlFile (get_handle (), NULL, NULL, NULL, &io,
- FSCTL_SET_SPARSE, NULL, 0, NULL, 0);
- syscall_printf ("%p = NtFsControlFile(%S, FSCTL_SET_SPARSE)",
- status, pc.get_nt_native_path ());
- }
- status = NtSetInformationFile (get_handle (), &io,
- &feofi, sizeof feofi,
- FileEndOfFileInformation);
- if (!NT_SUCCESS (status))
- __seterrno_from_nt_status (status);
- else
- res = 0;
- }
- return res;
-}
-
-int
-fhandler_disk_file::link (const char *newpath)
-{
- extern bool allow_winsymlinks;
-
- path_conv newpc (newpath, PC_SYM_NOFOLLOW | PC_POSIX, stat_suffixes);
- if (newpc.error)
- {
- set_errno (newpc.error);
- return -1;
- }
-
- if (newpc.exists ())
- {
- syscall_printf ("file '%S' exists?", newpc.get_nt_native_path ());
- set_errno (EEXIST);
- return -1;
- }
-
- char new_buf[strlen (newpath) + 5];
- if (!newpc.error)
- {
- if (allow_winsymlinks && pc.is_lnk_special ())
- {
- /* Shortcut hack. */
- stpcpy (stpcpy (new_buf, newpath), ".lnk");
- newpath = new_buf;
- newpc.check (newpath, PC_SYM_NOFOLLOW);
- }
- else if (!pc.isdir ()
- && pc.is_binary ()
- && !RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
- L".exe", TRUE))
- {
- /* Executable hack. */
- stpcpy (stpcpy (new_buf, newpath), ".exe");
- newpath = new_buf;
- newpc.check (newpath, PC_SYM_NOFOLLOW);
- }
- }
-
- HANDLE fh;
- NTSTATUS status;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- status = NtOpenFile (&fh, READ_CONTROL,
- pc.get_object_attr (attr, sec_none_nih), &io,
- FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_REPARSE_POINT);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- return -1;
- }
- PUNICODE_STRING tgt = newpc.get_nt_native_path ();
- ULONG size = sizeof (FILE_LINK_INFORMATION) + tgt->Length;
- PFILE_LINK_INFORMATION pfli = (PFILE_LINK_INFORMATION) alloca (size);
- pfli->ReplaceIfExists = FALSE;
- pfli->RootDirectory = NULL;
- memcpy (pfli->FileName, tgt->Buffer, pfli->FileNameLength = tgt->Length);
- status = NtSetInformationFile (fh, &io, pfli, size, FileLinkInformation);
- NtClose (fh);
- if (!NT_SUCCESS (status))
- {
- if (status == STATUS_INVALID_DEVICE_REQUEST)
- {
- /* FS doesn't support hard links. Try to copy file. */
- WCHAR pcw[pc.get_nt_native_path ()->Length + 1];
- WCHAR newpcw[newpc.get_nt_native_path ()->Length + 1];
- if (!CopyFileW (pc.get_wide_win32_path (pcw),
- newpc.get_wide_win32_path (newpcw), TRUE))
- {
- __seterrno ();
- return -1;
- }
- if (!allow_winsymlinks && pc.is_lnk_special ())
- SetFileAttributesW (newpcw, pc.file_attributes ()
- | FILE_ATTRIBUTE_SYSTEM
- | FILE_ATTRIBUTE_READONLY);
- }
- else
- {
- __seterrno_from_nt_status (status);
- return -1;
- }
- }
- return 0;
-}
-
-int
-fhandler_disk_file::utimens (const struct timespec *tvp)
-{
- return utimens_fs (tvp);
-}
-
-int
-fhandler_base::utimens_fs (const struct timespec *tvp)
-{
- LARGE_INTEGER lastaccess, lastwrite;
- struct timespec timeofday;
- struct timespec tmp[2];
- bool closeit = false;
-
- if (!get_handle ())
- {
- query_open (query_write_attributes);
- if (!open_fs (O_BINARY, 0))
- {
- /* It's documented in MSDN that FILE_WRITE_ATTRIBUTES is sufficient
- to change the timestamps. Unfortunately it's not sufficient for a
- remote HPFS which requires GENERIC_WRITE, so we just retry to open
- for writing, though this fails for R/O files of course. */
- query_open (no_query);
- if (!open_fs (O_WRONLY | O_BINARY, 0))
- {
- syscall_printf ("Opening file failed");
- return -1;
- }
- }
- closeit = true;
- }
-
- gettimeofday (reinterpret_cast<struct timeval *> (&timeofday), 0);
- timeofday.tv_nsec *= 1000;
- if (!tvp)
- tmp[1] = tmp[0] = timeofday;
- else
- {
- if ((tvp[0].tv_nsec < UTIME_NOW || tvp[0].tv_nsec > 999999999L)
- || (tvp[1].tv_nsec < UTIME_NOW || tvp[1].tv_nsec > 999999999L))
- {
- set_errno (EINVAL);
- return -1;
- }
- tmp[0] = (tvp[0].tv_nsec == UTIME_NOW) ? timeofday : tvp[0];
- tmp[1] = (tvp[1].tv_nsec == UTIME_NOW) ? timeofday : tvp[1];
- }
- /* UTIME_OMIT is handled in timespec_to_filetime by setting FILETIME to 0. */
- timespec_to_filetime (&tmp[0], (FILETIME *) &lastaccess);
- timespec_to_filetime (&tmp[1], (FILETIME *) &lastwrite);
- debug_printf ("incoming lastaccess %08x %08x", tmp[0].tv_sec, tmp[0].tv_nsec);
-
- IO_STATUS_BLOCK io;
- FILE_BASIC_INFORMATION fbi;
- fbi.CreationTime.QuadPart = 0LL;
- fbi.LastAccessTime = lastaccess;
- fbi.LastWriteTime = lastwrite;
- fbi.ChangeTime.QuadPart = 0LL;
- fbi.FileAttributes = 0;
- NTSTATUS status = NtSetInformationFile (get_handle (), &io, &fbi, sizeof fbi,
- FileBasicInformation);
- if (closeit)
- close_fs ();
- /* Opening a directory on a 9x share from a NT machine works(!), but
- then NtSetInformationFile fails with STATUS_NOT_SUPPORTED. Oh well... */
- if (!NT_SUCCESS (status) && status != STATUS_NOT_SUPPORTED)
- {
- __seterrno_from_nt_status (status);
- return -1;
- }
- return 0;
-}
-
-fhandler_disk_file::fhandler_disk_file () :
- fhandler_base ()
-{
-}
-
-fhandler_disk_file::fhandler_disk_file (path_conv &pc) :
- fhandler_base ()
-{
- set_name (pc);
-}
-
-int
-fhandler_disk_file::open (int flags, mode_t mode)
-{
- return open_fs (flags, mode);
-}
-
-int
-fhandler_base::open_fs (int flags, mode_t mode)
-{
- /* Unfortunately NT allows to open directories for writing, but that's
- disallowed according to SUSv3. */
- if (pc.isdir () && (flags & O_ACCMODE) != O_RDONLY)
- {
- set_errno (EISDIR);
- return 0;
- }
-
- int res = fhandler_base::open (flags | O_DIROPEN, mode);
- if (!res)
- goto out;
-
- /* This is for file systems known for having a buggy CreateFile call
- which might return a valid HANDLE without having actually opened
- the file.
- The only known file system to date is the SUN NFS Solstice Client 3.1
- which returns a valid handle when trying to open a file in a nonexistent
- directory. */
- if (pc.has_buggy_open () && !pc.exists ())
- {
- debug_printf ("Buggy open detected.");
- close_fs ();
- set_errno (ENOENT);
- return 0;
- }
-
- if (pc.hasgood_inode ())
- ino = get_ino_by_handle (get_handle ());
- /* A unique ID is necessary to recognize fhandler entries which are
- duplicated by dup(2) or fork(2). */
- AllocateLocallyUniqueId ((PLUID) &unique_id);
-
-out:
- syscall_printf ("%d = fhandler_disk_file::open (%S, %p)", res,
- pc.get_nt_native_path (), flags);
- return res;
-}
-
-ssize_t __stdcall
-fhandler_disk_file::pread (void *buf, size_t count, _off64_t offset)
-{
- ssize_t res;
- _off64_t curpos = lseek (0, SEEK_CUR);
- if (curpos < 0 || lseek (offset, SEEK_SET) < 0)
- res = -1;
- else
- {
- size_t tmp_count = count;
- read (buf, tmp_count);
- if (lseek (curpos, SEEK_SET) >= 0)
- res = (ssize_t) tmp_count;
- else
- res = -1;
- }
- debug_printf ("%d = pread (%p, %d, %d)\n", res, buf, count, offset);
- return res;
-}
-
-ssize_t __stdcall
-fhandler_disk_file::pwrite (void *buf, size_t count, _off64_t offset)
-{
- int res;
- _off64_t curpos = lseek (0, SEEK_CUR);
- if (curpos < 0 || lseek (offset, SEEK_SET) < 0)
- res = curpos;
- else
- {
- res = (ssize_t) write (buf, count);
- if (lseek (curpos, SEEK_SET) < 0)
- res = -1;
- }
- debug_printf ("%d = pwrite (%p, %d, %d)\n", res, buf, count, offset);
- return res;
-}
-
-int
-fhandler_disk_file::mkdir (mode_t mode)
-{
- int res = -1;
- SECURITY_ATTRIBUTES sa = sec_none_nih;
- security_descriptor sd;
-
- if (has_acls ())
- set_security_attribute (S_IFDIR | ((mode & 07777) & ~cygheap->umask),
- &sa, sd);
-
- NTSTATUS status;
- HANDLE dir;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- ULONG fattr = FILE_ATTRIBUTE_DIRECTORY;
- PFILE_FULL_EA_INFORMATION p = NULL;
- ULONG plen = 0;
-
- if (pc.fs_is_nfs ())
- {
- /* When creating a dir on an NFS share, we have to set the
- file mode by writing a NFS fattr3 structure with the
- correct mode bits set. */
- plen = sizeof (FILE_FULL_EA_INFORMATION) + sizeof (NFS_V3_ATTR)
- + sizeof (fattr3);
- p = (PFILE_FULL_EA_INFORMATION) alloca (plen);
- p->NextEntryOffset = 0;
- p->Flags = 0;
- p->EaNameLength = sizeof (NFS_V3_ATTR) - 1;
- p->EaValueLength = sizeof (fattr3);
- strcpy (p->EaName, NFS_V3_ATTR);
- fattr3 *nfs_attr = (fattr3 *) (p->EaName + p->EaNameLength + 1);
- memset (nfs_attr, 0, sizeof (fattr3));
- nfs_attr->type = NF3DIR;
- nfs_attr->mode = (mode & 07777) & ~cygheap->umask;
- }
- status = NtCreateFile (&dir, FILE_LIST_DIRECTORY | SYNCHRONIZE,
- pc.get_object_attr (attr, sa), &io, NULL,
- fattr, FILE_SHARE_VALID_FLAGS, FILE_CREATE,
- FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT,
- p, plen);
- if (NT_SUCCESS (status))
- {
- NtClose (dir);
- res = 0;
- }
- else
- __seterrno_from_nt_status (status);
-
- return res;
-}
-
-int
-fhandler_disk_file::rmdir ()
-{
- extern NTSTATUS unlink_nt (path_conv &pc);
-
- if (!pc.isdir ())
- {
- set_errno (ENOTDIR);
- return -1;
- }
- if (!pc.exists ())
- {
- set_errno (ENOENT);
- return -1;
- }
-
- NTSTATUS status = unlink_nt (pc);
-
- /* Check for existence of remote dirs after trying to delete them.
- Two reasons:
- - Sometimes SMB indicates failure when it really succeeds.
- - Removeing a directory on a samba drive doesn't return an error if the
- directory can't be removed because it's not empty. */
- if (isremote ())
- {
- OBJECT_ATTRIBUTES attr;
- FILE_BASIC_INFORMATION fbi;
-
- if (NT_SUCCESS (NtQueryAttributesFile
- (pc.get_object_attr (attr, sec_none_nih), &fbi)))
- status = STATUS_DIRECTORY_NOT_EMPTY;
- else
- status = STATUS_SUCCESS;
- }
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- return -1;
- }
- return 0;
-}
-
-/* This is the minimal number of entries which fit into the readdir cache.
- The number of bytes allocated by the cache is determined by this number,
- To tune caching, just tweak this number. To get a feeling for the size,
- the size of the readdir cache is DIR_NUM_ENTRIES * 624 + 4 bytes. */
-
-#define DIR_NUM_ENTRIES 100 /* Cache size 62404 bytes */
-
-#define DIR_BUF_SIZE (DIR_NUM_ENTRIES \
- * (sizeof (FILE_ID_BOTH_DIR_INFORMATION) \
- + (NAME_MAX + 1) * sizeof (WCHAR)))
-
-struct __DIR_cache
-{
- char __cache[DIR_BUF_SIZE]; /* W2K needs this buffer 8 byte aligned. */
- ULONG __pos;
-};
-
-#define d_cachepos(d) (((__DIR_cache *) (d)->__d_dirname)->__pos)
-#define d_cache(d) (((__DIR_cache *) (d)->__d_dirname)->__cache)
-
-#define d_mounts(d) ((__DIR_mounts *) (d)->__d_internal)
-
-DIR *
-fhandler_disk_file::opendir (int fd)
-{
- DIR *dir;
- DIR *res = NULL;
-
- if (!pc.isdir ())
- set_errno (ENOTDIR);
- else if ((dir = (DIR *) malloc (sizeof (DIR))) == NULL)
- set_errno (ENOMEM);
- else if ((dir->__d_dirname = (char *) malloc ( sizeof (struct __DIR_cache)))
- == NULL)
- {
- set_errno (ENOMEM);
- goto free_dir;
- }
- else if ((dir->__d_dirent =
- (struct dirent *) malloc (sizeof (struct dirent))) == NULL)
- {
- set_errno (ENOMEM);
- goto free_dirname;
- }
- else
- {
- cygheap_fdnew cfd;
- if (cfd < 0 && fd < 0)
- goto free_dirent;
-
- dir->__d_dirent->__d_version = __DIRENT_VERSION;
- dir->__d_cookie = __DIRENT_COOKIE;
- dir->__handle = INVALID_HANDLE_VALUE;
- dir->__d_position = 0;
- dir->__flags = (get_name ()[0] == '/' && get_name ()[1] == '\0')
- ? dirent_isroot : 0;
- dir->__d_internal = (unsigned) new __DIR_mounts (get_name ());
- d_cachepos (dir) = 0;
-
- if (!pc.iscygdrive ())
- {
- if (fd < 0)
- {
- /* opendir() case. Initialize with given directory name and
- NULL directory handle. */
- OBJECT_ATTRIBUTES attr;
- NTSTATUS status;
- IO_STATUS_BLOCK io;
-
- status = NtOpenFile (&get_handle (),
- SYNCHRONIZE | FILE_LIST_DIRECTORY,
- pc.get_object_attr (attr, sec_none_nih),
- &io, FILE_SHARE_VALID_FLAGS,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT
- | FILE_DIRECTORY_FILE);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- goto free_mounts;
- }
- }
-
- /* FileIdBothDirectoryInformation is apparently unsupported on
- XP when accessing directories on UDF. When trying to use it
- so, NtQueryDirectoryFile returns with STATUS_ACCESS_VIOLATION.
- It's not clear if the call isn't also unsupported on other
- OS/FS combinations (say, Win2K/CDFS or so). Instead of
- testing in readdir for yet another error code, let's use
- FileIdBothDirectoryInformation only on filesystems supporting
- persistent ACLs, FileDirectoryInformation otherwise.
-
- NFS clients hide dangling symlinks from directory queries,
- unless you use the FileNamesInformation info class.
- On newer NFS clients (>=Vista) FileIdBothDirectoryInformation
- works fine, but only if the NFS share is mounted to a drive
- letter. TODO: We don't test that here for now, but it might
- be worth to test if there's a speed gain in using
- FileIdBothDirectoryInformation, because it doesn't require to
- open the file to read the inode number. */
- if (pc.hasgood_inode ())
- {
- dir->__flags |= dirent_set_d_ino;
- if (pc.fs_is_nfs ())
- dir->__flags |= dirent_nfs_d_ino;
- else if (wincap.has_fileid_dirinfo ()
- && !pc.has_buggy_fileid_dirinfo ())
- dir->__flags |= dirent_get_d_ino;
- }
- }
- if (fd >= 0)
- dir->__d_fd = fd;
- else
- {
- /* Filling cfd with `this' (aka storing this in the file
- descriptor table should only happen after it's clear that
- opendir doesn't fail, otherwise we end up cfree'ing the
- fhandler twice, once in opendir() in dir.cc, the second
- time on exit. Nasty, nasty... */
- cfd = this;
- dir->__d_fd = cfd;
- if (pc.iscygdrive ())
- cfd->nohandle (true);
- }
- set_close_on_exec (true);
- dir->__fh = this;
- res = dir;
- }
-
- syscall_printf ("%p = opendir (%s)", res, get_name ());
- return res;
-
-free_mounts:
- delete d_mounts (dir);
-free_dirent:
- free (dir->__d_dirent);
-free_dirname:
- free (dir->__d_dirname);
-free_dir:
- free (dir);
- return res;
-}
-
-__ino64_t __stdcall
-readdir_get_ino (const char *path, bool dot_dot)
-{
- char *fname;
- struct __stat64 st;
- HANDLE hdl;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- __ino64_t ino = 0;
-
- if (dot_dot)
- {
- fname = (char *) alloca (strlen (path) + 4);
- char *c = stpcpy (fname, path);
- if (c[-1] != '/')
- *c++ = '/';
- strcpy (c, "..");
- path = fname;
- }
- path_conv pc (path, PC_SYM_NOFOLLOW | PC_POSIX);
- if (pc.isspecial ())
- {
- if (!stat_worker (pc, &st))
- ino = st.st_ino;
- }
- else if (!pc.hasgood_inode ())
- ino = hash_path_name (0, pc.get_nt_native_path ());
- else if (NT_SUCCESS (NtOpenFile (&hdl, READ_CONTROL,
- pc.get_object_attr (attr, sec_none_nih),
- &io, FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT
- | (pc.is_rep_symlink ()
- ? FILE_OPEN_REPARSE_POINT : 0))))
- {
- ino = get_ino_by_handle (hdl);
- NtClose (hdl);
- }
- return ino;
-}
-
-int
-fhandler_disk_file::readdir_helper (DIR *dir, dirent *de, DWORD w32_err,
- DWORD attr, PUNICODE_STRING fname)
-{
- if (w32_err)
- {
- bool added = false;
- if ((de->d_ino = d_mounts (dir)->check_missing_mount (fname)))
- added = true;
- if (!added)
- return geterrno_from_win_error (w32_err);
-
- attr = 0;
- dir->__flags &= ~dirent_set_d_ino;
- }
-
- /* Check for directory reparse point. These are potential volume mount
- points which have another inode than the underlying directory. */
- if ((attr & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT))
- == (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT))
- {
- HANDLE reph;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
-
- InitializeObjectAttributes (&attr, fname, pc.objcaseinsensitive (),
- get_handle (), NULL);
- if (is_volume_mountpoint (&attr)
- && (NT_SUCCESS (NtOpenFile (&reph, READ_CONTROL, &attr, &io,
- FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT))))
- {
- de->d_ino = get_ino_by_handle (reph);
- NtClose (reph);
- }
- }
-
- /* Check for Windows shortcut. If it's a Cygwin or U/WIN
- symlink, drop the .lnk suffix. */
- if ((attr & FILE_ATTRIBUTE_READONLY) && fname->Length > 4 * sizeof (WCHAR))
- {
- UNICODE_STRING uname;
- UNICODE_STRING lname;
-
- RtlInitCountedUnicodeString (&uname,
- fname->Buffer
- + fname->Length / sizeof (WCHAR) - 4,
- 4 * sizeof (WCHAR));
- RtlInitUnicodeString (&lname, (PWCHAR) L".lnk");
- if (RtlEqualUnicodeString (&uname, &lname, TRUE))
- {
- tmp_pathbuf tp;
- UNICODE_STRING fbuf;
-
- tp.u_get (&fbuf);
- RtlCopyUnicodeString (&fbuf, pc.get_nt_native_path ());
- RtlAppendUnicodeToString (&fbuf, L"\\");
- RtlAppendUnicodeStringToString (&fbuf, fname);
- fbuf.Buffer += 4; /* Skip leading \??\ */
- fbuf.Length -= 4 * sizeof (WCHAR);
- if (fbuf.Buffer[1] != L':') /* UNC path */
- {
- *(fbuf.Buffer += 2) = L'\\';
- fbuf.Length -= 2 * sizeof (WCHAR);
- }
- path_conv fpath (&fbuf, PC_SYM_NOFOLLOW);
- if (fpath.issymlink () || fpath.is_fs_special ())
- fname->Length -= 4 * sizeof (WCHAR);
- }
- }
-
- sys_wcstombs (de->d_name, NAME_MAX + 1, fname->Buffer,
- fname->Length / sizeof (WCHAR));
-
- if (dir->__d_position == 0 && !strcmp (de->d_name, "."))
- dir->__flags |= dirent_saw_dot;
- else if (dir->__d_position == 1 && !strcmp (de->d_name, ".."))
- dir->__flags |= dirent_saw_dot_dot;
- return 0;
-}
-
-int
-fhandler_disk_file::readdir (DIR *dir, dirent *de)
-{
- int res = 0;
- NTSTATUS status = STATUS_SUCCESS;
- PFILE_ID_BOTH_DIR_INFORMATION buf = NULL;
- PWCHAR FileName;
- ULONG FileNameLength;
- ULONG FileAttributes = 0;
- IO_STATUS_BLOCK io;
- UNICODE_STRING fname;
-
- /* d_cachepos always refers to the next cache entry to use. If it's 0
- we must reload the cache. */
- if (d_cachepos (dir) == 0)
- {
- if ((dir->__flags & dirent_get_d_ino))
- {
- status = NtQueryDirectoryFile (get_handle (), NULL, NULL, 0, &io,
- d_cache (dir), DIR_BUF_SIZE,
- FileIdBothDirectoryInformation,
- FALSE, NULL, dir->__d_position == 0);
- /* FileIdBothDirectoryInformation isn't supported for remote drives
- on NT4 and 2K systems, and it's also not supported on 2K at all,
- when accessing network drives on any remote OS. We just fall
- back to using a standard directory query in this case and note
- this case using the dirent_get_d_ino flag. */
- if (status == STATUS_INVALID_LEVEL
- || status == STATUS_INVALID_PARAMETER
- || status == STATUS_INVALID_INFO_CLASS)
- dir->__flags &= ~dirent_get_d_ino;
- /* Something weird happens on Samba up to version 3.0.21c, which is
- fixed in 3.0.22. FileIdBothDirectoryInformation seems to work
- nicely, but only up to the 128th entry in the directory. After
- reaching this entry, the next call to NtQueryDirectoryFile
- (FileIdBothDirectoryInformation) returns STATUS_INVALID_LEVEL.
- Why should we care, we can just switch to FileDirectoryInformation,
- isn't it? Nope! The next call to
- NtQueryDirectoryFile(FileDirectoryInformation)
- actually returns STATUS_NO_MORE_FILES, regardless how many files
- are left unread in the directory. This does not happen when using
- FileDirectoryInformation right from the start, but since
- we can't decide whether the server we're talking with has this
- bug or not, we end up serving Samba shares always in the slow
- mode using FileDirectoryInformation. So, what we do here is
- to implement the solution suggested by Andrew Tridgell, we just
- reread all entries up to dir->d_position using
- FileDirectoryInformation.
- However, We do *not* mark this server as broken and fall back to
- using FileDirectoryInformation further on. This would slow
- down every access to such a server, even for directories under
- 128 entries. Also, bigger dirs only suffer from one additional
- call per full directory scan, which shouldn't be too big a hit.
- This can easily be changed if necessary. */
- if (status == STATUS_INVALID_LEVEL && dir->__d_position)
- {
- d_cachepos (dir) = 0;
- for (int cnt = 0; cnt < dir->__d_position; ++cnt)
- {
- if (d_cachepos (dir) == 0)
- {
- status = NtQueryDirectoryFile (get_handle (), NULL, NULL,
- 0, &io, d_cache (dir), DIR_BUF_SIZE,
- FileDirectoryInformation,
- FALSE, NULL, cnt == 0);
- if (!NT_SUCCESS (status))
- goto go_ahead;
- }
- buf = (PFILE_ID_BOTH_DIR_INFORMATION) (d_cache (dir)
- + d_cachepos (dir));
- if (buf->NextEntryOffset == 0)
- d_cachepos (dir) = 0;
- else
- d_cachepos (dir) += buf->NextEntryOffset;
- }
- goto go_ahead;
- }
- }
- if (!(dir->__flags & dirent_get_d_ino))
- status = NtQueryDirectoryFile (get_handle (), NULL, NULL, 0, &io,
- d_cache (dir), DIR_BUF_SIZE,
- (dir->__flags & dirent_nfs_d_ino)
- ? FileNamesInformation
- : FileDirectoryInformation,
- FALSE, NULL, dir->__d_position == 0);
- }
-
-go_ahead:
-
- if (!NT_SUCCESS (status))
- debug_printf ("NtQueryDirectoryFile failed, status %p, win32 error %lu",
- status, RtlNtStatusToDosError (status));
- else
- {
- buf = (PFILE_ID_BOTH_DIR_INFORMATION) (d_cache (dir) + d_cachepos (dir));
- if (buf->NextEntryOffset == 0)
- d_cachepos (dir) = 0;
- else
- d_cachepos (dir) += buf->NextEntryOffset;
- if ((dir->__flags & dirent_get_d_ino))
- {
- FileName = buf->FileName;
- FileNameLength = buf->FileNameLength;
- FileAttributes = buf->FileAttributes;
- if ((dir->__flags & dirent_set_d_ino))
- de->d_ino = buf->FileId.QuadPart;
- }
- else if ((dir->__flags & dirent_nfs_d_ino))
- {
- FileName = ((PFILE_NAMES_INFORMATION) buf)->FileName;
- FileNameLength = ((PFILE_NAMES_INFORMATION) buf)->FileNameLength;
- }
- else
- {
- FileName = ((PFILE_DIRECTORY_INFORMATION) buf)->FileName;
- FileNameLength = ((PFILE_DIRECTORY_INFORMATION) buf)->FileNameLength;
- FileAttributes = ((PFILE_DIRECTORY_INFORMATION) buf)->FileAttributes;
- }
- RtlInitCountedUnicodeString (&fname, FileName, FileNameLength);
- de->d_ino = d_mounts (dir)->check_mount (&fname, de->d_ino);
- if (de->d_ino == 0 && (dir->__flags & dirent_set_d_ino))
- {
- OBJECT_ATTRIBUTES attr;
-
- if (dir->__d_position == 0 && FileNameLength == 2
- && FileName[0] == '.')
- de->d_ino = get_ino_by_handle (get_handle ());
- else if (dir->__d_position == 1 && FileNameLength == 4
- && FileName[0] == L'.' && FileName[1] == L'.')
- if (!(dir->__flags & dirent_isroot))
- de->d_ino = readdir_get_ino (get_name (), true);
- else
- de->d_ino = get_ino_by_handle (get_handle ());
- else
- {
- HANDLE hdl;
-
- InitializeObjectAttributes (&attr, &fname,
- pc.objcaseinsensitive (),
- get_handle (), NULL);
- if (NT_SUCCESS (NtOpenFile (&hdl, READ_CONTROL, &attr, &io,
- FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT)))
- {
- de->d_ino = get_ino_by_handle (hdl);
- NtClose (hdl);
- }
- }
- /* Enforce namehash as inode number on untrusted file systems. */
- if (!pc.isgood_inode (de->d_ino))
- {
- dir->__flags &= ~dirent_set_d_ino;
- de->d_ino = 0;
- }
- }
- }
-
- if (!(res = readdir_helper (dir, de, RtlNtStatusToDosError (status),
- buf ? FileAttributes : 0, &fname)))
- dir->__d_position++;
- else if (!(dir->__flags & dirent_saw_dot))
- {
- strcpy (de->d_name , ".");
- de->d_ino = get_ino_by_handle (get_handle ());
- dir->__d_position++;
- dir->__flags |= dirent_saw_dot;
- res = 0;
- }
- else if (!(dir->__flags & dirent_saw_dot_dot))
- {
- strcpy (de->d_name , "..");
- if (!(dir->__flags & dirent_isroot))
- de->d_ino = readdir_get_ino (get_name (), true);
- else
- de->d_ino = get_ino_by_handle (get_handle ());
- dir->__d_position++;
- dir->__flags |= dirent_saw_dot_dot;
- res = 0;
- }
-
- syscall_printf ("%d = readdir (%p, %p) (%s)", res, dir, &de, res ? "***" : de->d_name);
- return res;
-}
-
-_off64_t
-fhandler_disk_file::telldir (DIR *dir)
-{
- return dir->__d_position;
-}
-
-void
-fhandler_disk_file::seekdir (DIR *dir, _off64_t loc)
-{
- rewinddir (dir);
- while (loc > dir->__d_position)
- if (!::readdir (dir))
- break;
-}
-
-void
-fhandler_disk_file::rewinddir (DIR *dir)
-{
- d_cachepos (dir) = 0;
- if (wincap.has_buggy_restart_scan () && isremote ())
- {
- /* This works around a W2K bug. The RestartScan parameter in calls
- to NtQueryDirectoryFile on remote shares is ignored, thus
- resulting in not being able to rewind on remote shares. By
- reopening the directory, we get a fresh new directory pointer. */
- UNICODE_STRING fname;
- OBJECT_ATTRIBUTES attr;
- NTSTATUS status;
- IO_STATUS_BLOCK io;
- HANDLE new_dir;
-
- RtlInitUnicodeString (&fname, L"");
- InitializeObjectAttributes (&attr, &fname, pc.objcaseinsensitive (),
- get_handle (), NULL);
- status = NtOpenFile (&new_dir, SYNCHRONIZE | FILE_LIST_DIRECTORY,
- &attr, &io, FILE_SHARE_VALID_FLAGS,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT
- | FILE_DIRECTORY_FILE);
- if (!NT_SUCCESS (stat))
- debug_printf ("Unable to reopen dir %s, NT error: %p",
- get_name (), status);
- else
- {
- NtClose (get_handle ());
- set_io_handle (new_dir);
- }
- }
- dir->__d_position = 0;
- d_mounts (dir)->rewind ();
-}
-
-int
-fhandler_disk_file::closedir (DIR *dir)
-{
- int res = 0;
- NTSTATUS status;
-
- delete d_mounts (dir);
- if (!get_handle ())
- /* ignore */;
- else if (get_handle () == INVALID_HANDLE_VALUE)
- {
- set_errno (EBADF);
- res = -1;
- }
- else if (!NT_SUCCESS (status = NtClose (get_handle ())))
- {
- __seterrno_from_nt_status (status);
- res = -1;
- }
- syscall_printf ("%d = closedir (%p, %s)", res, dir, get_name ());
- return res;
-}
-
-fhandler_cygdrive::fhandler_cygdrive () :
- fhandler_disk_file (), ndrives (0), pdrive (NULL)
-{
-}
-
-int
-fhandler_cygdrive::open (int flags, mode_t mode)
-{
- if ((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
- {
- set_errno (EEXIST);
- return 0;
- }
- if (flags & O_WRONLY)
- {
- set_errno (EISDIR);
- return 0;
- }
- flags |= O_DIROPEN;
- set_flags (flags);
- nohandle (true);
- return 1;
-}
-
-int
-fhandler_cygdrive::close ()
-{
- return 0;
-}
-
-#define DRVSZ sizeof ("x:\\")
-void
-fhandler_cygdrive::set_drives ()
-{
- const int len = 2 + 26 * DRVSZ;
- char *p = const_cast<char *> (get_win32_name ());
- pdrive = p;
- ndrives = GetLogicalDriveStrings (len, p) / DRVSZ;
-}
-
-int
-fhandler_cygdrive::fstat (struct __stat64 *buf)
-{
- fhandler_base::fstat (buf);
- buf->st_ino = 2;
- buf->st_mode = S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH;
- if (!ndrives)
- set_drives ();
- char flptst[] = "X:";
- int n = ndrives;
- for (const char *p = pdrive; p && *p; p = strchr (p, '\0') + 1)
- if (is_floppy ((flptst[0] = *p, flptst))
- || GetFileAttributes (p) == INVALID_FILE_ATTRIBUTES)
- --n;
- buf->st_nlink = n + 2;
- return 0;
-}
-
-DIR *
-fhandler_cygdrive::opendir (int fd)
-{
- DIR *dir;
-
- dir = fhandler_disk_file::opendir (fd);
- if (dir && !ndrives)
- set_drives ();
-
- return dir;
-}
-
-int
-fhandler_cygdrive::readdir (DIR *dir, dirent *de)
-{
- char flptst[] = "X:";
-
- while (true)
- {
- if (!pdrive || !*pdrive)
- {
- if (!(dir->__flags & dirent_saw_dot))
- {
- de->d_name[0] = '.';
- de->d_name[1] = '\0';
- de->d_ino = 2;
- }
- return ENMFILE;
- }
- if (!is_floppy ((flptst[0] = *pdrive, flptst))
- && GetFileAttributes (pdrive) != INVALID_FILE_ATTRIBUTES)
- break;
- pdrive = strchr (pdrive, '\0') + 1;
- }
- *de->d_name = cyg_tolower (*pdrive);
- de->d_name[1] = '\0';
- user_shared->warned_msdos = true;
- de->d_ino = readdir_get_ino (pdrive, false);
- dir->__d_position++;
- pdrive = strchr (pdrive, '\0') + 1;
- syscall_printf ("%p = readdir (%p) (%s)", &de, dir, de->d_name);
- return 0;
-}
-
-void
-fhandler_cygdrive::rewinddir (DIR *dir)
-{
- pdrive = get_win32_name ();
- dir->__d_position = 0;
-}
-
-int
-fhandler_cygdrive::closedir (DIR *dir)
-{
- pdrive = get_win32_name ();
- return 0;
-}
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
deleted file mode 100644
index 176838de866..00000000000
--- a/winsup/cygwin/fhandler_socket.cc
+++ /dev/null
@@ -1,1878 +0,0 @@
-/* fhandler_socket.cc. See fhandler.h for a description of the fhandler classes.
-
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Red Hat, Inc.
-
- This file is part of Cygwin.
-
- This software is a copyrighted work licensed under the terms of the
- Cygwin license. Please consult the file "CYGWIN_LICENSE" for
- details. */
-
-/* #define DEBUG_NEST_ON 1 */
-
-#define __INSIDE_CYGWIN_NET__
-
-#include "winsup.h"
-#include <sys/un.h>
-#include <asm/byteorder.h>
-
-#include <stdlib.h>
-#define USE_SYS_TYPES_FD_SET
-#include <winsock2.h>
-#include <iphlpapi.h>
-#include "cygerrno.h"
-#include "security.h"
-#include "cygwin/version.h"
-#include "perprocess.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "cygheap.h"
-#include "shared_info.h"
-#include "sigproc.h"
-#include "wininfo.h"
-#include <unistd.h>
-#include <sys/acl.h>
-#include "cygtls.h"
-#include "cygwin/in6.h"
-#include "ntdll.h"
-
-#define ASYNC_MASK (FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT|FD_CONNECT)
-#define EVENT_MASK (FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT|FD_CONNECT|FD_CLOSE)
-
-extern bool fdsock (cygheap_fdmanip& fd, const device *, SOCKET soc);
-extern "C" {
-int sscanf (const char *, const char *, ...);
-} /* End of "C" section */
-
-fhandler_dev_random* entropy_source;
-
-static inline mode_t
-adjust_socket_file_mode (mode_t mode)
-{
- /* Kludge: Don't allow to remove read bit on socket files for
- user/group/other, if the accompanying write bit is set. It would
- be nice to have exact permissions on a socket file, but it's
- necessary that somebody able to access the socket can always read
- the contents of the socket file to avoid spurious "permission
- denied" messages. */
- return mode | ((mode & (S_IWUSR | S_IWGRP | S_IWOTH)) << 1);
-}
-
-/* cygwin internal: map sockaddr into internet domain address */
-static int
-get_inet_addr (const struct sockaddr *in, int inlen,
- struct sockaddr_storage *out, int *outlen,
- int *type = NULL, int *secret = NULL)
-{
- int secret_buf [4];
- int* secret_ptr = (secret ? : secret_buf);
-
- if (in->sa_family == AF_INET || in->sa_family == AF_INET6)
- {
- memcpy (out, in, inlen);
- *outlen = inlen;
- return 1;
- }
- else if (in->sa_family == AF_LOCAL)
- {
- NTSTATUS status;
- HANDLE fh;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
-
- path_conv pc (in->sa_data, PC_SYM_FOLLOW);
- if (pc.error)
- {
- set_errno (pc.error);
- return 0;
- }
- if (!pc.exists ())
- {
- set_errno (ENOENT);
- return 0;
- }
- if (!pc.issocket ())
- {
- set_errno (EBADF);
- return 0;
- }
- status = NtOpenFile (&fh, GENERIC_READ | SYNCHRONIZE,
- pc.get_object_attr (attr, sec_none_nih), &io,
- FILE_SHARE_VALID_FLAGS,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- return 0;
- }
- int ret = 0;
- char buf[128];
- memset (buf, 0, sizeof buf);
- status = NtReadFile (fh, NULL, NULL, NULL, &io, buf, 128, NULL, NULL);
- NtClose (fh);
- if (NT_SUCCESS (status))
- {
- struct sockaddr_in sin;
- char ctype;
- sin.sin_family = AF_INET;
- sscanf (buf + strlen (SOCKET_COOKIE), "%hu %c %08x-%08x-%08x-%08x",
- &sin.sin_port,
- &ctype,
- secret_ptr, secret_ptr + 1, secret_ptr + 2, secret_ptr + 3);
- sin.sin_port = htons (sin.sin_port);
- sin.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
- memcpy (out, &sin, sizeof sin);
- *outlen = sizeof sin;
- if (type)
- *type = (ctype == 's' ? SOCK_STREAM :
- ctype == 'd' ? SOCK_DGRAM
- : 0);
- ret = 1;
- }
- else
- __seterrno_from_nt_status (status);
- return ret;
- }
- else
- {
- set_errno (EAFNOSUPPORT);
- return 0;
- }
-}
-
-/**********************************************************************/
-/* fhandler_socket */
-
-fhandler_socket::fhandler_socket () :
- fhandler_base (),
- wsock_events (NULL),
- wsock_mtx (NULL),
- wsock_evt (NULL),
- sun_path (NULL),
- status ()
-{
- need_fork_fixup (true);
-}
-
-fhandler_socket::~fhandler_socket ()
-{
- if (sun_path)
- cfree (sun_path);
-}
-
-char *
-fhandler_socket::get_proc_fd_name (char *buf)
-{
- __small_sprintf (buf, "socket:[%d]", get_socket ());
- return buf;
-}
-
-int
-fhandler_socket::open (int flags, mode_t mode)
-{
- set_errno (ENXIO);
- return 0;
-}
-
-void
-fhandler_socket::af_local_set_sockpair_cred ()
-{
- sec_pid = sec_peer_pid = getpid ();
- sec_uid = sec_peer_uid = geteuid32 ();
- sec_gid = sec_peer_gid = getegid32 ();
-}
-
-void
-fhandler_socket::af_local_setblocking (bool &async, bool &nonblocking)
-{
- async = async_io ();
- nonblocking = is_nonblocking ();
- if (async)
- {
- WSAAsyncSelect (get_socket (), winmsg, 0, 0);
- WSAEventSelect (get_socket (), wsock_evt, EVENT_MASK);
- }
- set_nonblocking (false);
- async_io (false);
-}
-
-void
-fhandler_socket::af_local_unsetblocking (bool async, bool nonblocking)
-{
- if (nonblocking)
- set_nonblocking (true);
- if (async)
- {
- WSAAsyncSelect (get_socket (), winmsg, WM_ASYNCIO, ASYNC_MASK);
- async_io (true);
- }
-}
-
-bool
-fhandler_socket::af_local_recv_secret ()
-{
- int out[4] = { 0, 0, 0, 0 };
- int rest = sizeof out;
- char *ptr = (char *) out;
- while (rest > 0)
- {
- int ret = recvfrom (ptr, rest, 0, NULL, NULL);
- if (ret <= 0)
- break;
- rest -= ret;
- ptr += ret;
- }
- if (rest == 0)
- {
- debug_printf ("Received af_local secret: %08x-%08x-%08x-%08x",
- out[0], out[1], out[2], out[3]);
- if (out[0] != connect_secret[0] || out[1] != connect_secret[1]
- || out[2] != connect_secret[2] || out[3] != connect_secret[3])
- {
- debug_printf ("Receiving af_local secret mismatch");
- return false;
- }
- }
- else
- debug_printf ("Receiving af_local secret failed");
- return rest == 0;
-}
-
-bool
-fhandler_socket::af_local_send_secret ()
-{
- int rest = sizeof connect_secret;
- char *ptr = (char *) connect_secret;
- while (rest > 0)
- {
- int ret = sendto (ptr, rest, 0, NULL, 0);
- if (ret <= 0)
- break;
- rest -= ret;
- ptr += ret;
- }
- debug_printf ("Sending af_local secret %s", rest == 0 ? "succeeded"
- : "failed");
- return rest == 0;
-}
-
-bool
-fhandler_socket::af_local_recv_cred ()
-{
- struct ucred out = { (pid_t) 0, (__uid32_t) -1, (__gid32_t) -1 };
- int rest = sizeof out;
- char *ptr = (char *) &out;
- while (rest > 0)
- {
- int ret = recvfrom (ptr, rest, 0, NULL, NULL);
- if (ret <= 0)
- break;
- rest -= ret;
- ptr += ret;
- }
- if (rest == 0)
- {
- debug_printf ("Received eid credentials: pid: %d, uid: %d, gid: %d",
- out.pid, out.uid, out.gid);
- sec_peer_pid = out.pid;
- sec_peer_uid = out.uid;
- sec_peer_gid = out.gid;
- }
- else
- debug_printf ("Receiving eid credentials failed");
- return rest == 0;
-}
-
-bool
-fhandler_socket::af_local_send_cred ()
-{
- struct ucred in = { sec_pid, sec_uid, sec_gid };
- int rest = sizeof in;
- char *ptr = (char *) &in;
- while (rest > 0)
- {
- int ret = sendto (ptr, rest, 0, NULL, 0);
- if (ret <= 0)
- break;
- rest -= ret;
- ptr += ret;
- }
- if (rest == 0)
- debug_printf ("Sending eid credentials succeeded");
- else
- debug_printf ("Sending eid credentials failed");
- return rest == 0;
-}
-
-int
-fhandler_socket::af_local_connect ()
-{
- /* This keeps the test out of select. */
- if (get_addr_family () != AF_LOCAL || get_socket_type () != SOCK_STREAM)
- return 0;
-
- debug_printf ("af_local_connect called");
- bool orig_async_io, orig_is_nonblocking;
- af_local_setblocking (orig_async_io, orig_is_nonblocking);
- if (!af_local_send_secret () || !af_local_recv_secret ()
- || !af_local_send_cred () || !af_local_recv_cred ())
- {
- debug_printf ("accept from unauthorized server");
- ::shutdown (get_socket (), SD_BOTH);
- WSASetLastError (WSAECONNREFUSED);
- return -1;
- }
- af_local_unsetblocking (orig_async_io, orig_is_nonblocking);
- return 0;
-}
-
-int
-fhandler_socket::af_local_accept ()
-{
- debug_printf ("af_local_accept called");
- bool orig_async_io, orig_is_nonblocking;
- af_local_setblocking (orig_async_io, orig_is_nonblocking);
- if (!af_local_recv_secret () || !af_local_send_secret ()
- || !af_local_recv_cred () || !af_local_send_cred ())
- {
- debug_printf ("connect from unauthorized client");
- ::shutdown (get_socket (), SD_BOTH);
- ::closesocket (get_socket ());
- WSASetLastError (WSAECONNABORTED);
- return -1;
- }
- af_local_unsetblocking (orig_async_io, orig_is_nonblocking);
- return 0;
-}
-
-void
-fhandler_socket::af_local_set_cred ()
-{
- sec_pid = getpid ();
- sec_uid = geteuid32 ();
- sec_gid = getegid32 ();
- sec_peer_pid = (pid_t) 0;
- sec_peer_uid = (__uid32_t) -1;
- sec_peer_gid = (__gid32_t) -1;
-}
-
-void
-fhandler_socket::af_local_copy (fhandler_socket *sock)
-{
- sock->connect_secret[0] = connect_secret[0];
- sock->connect_secret[1] = connect_secret[1];
- sock->connect_secret[2] = connect_secret[2];
- sock->connect_secret[3] = connect_secret[3];
- sock->sec_pid = sec_pid;
- sock->sec_uid = sec_uid;
- sock->sec_gid = sec_gid;
- sock->sec_peer_pid = sec_peer_pid;
- sock->sec_peer_uid = sec_peer_uid;
- sock->sec_peer_gid = sec_peer_gid;
-}
-
-void
-fhandler_socket::af_local_set_secret (char *buf)
-{
- if (!entropy_source)
- {
- void *buf = malloc (sizeof (fhandler_dev_random));
- entropy_source = new (buf) fhandler_dev_random ();
- entropy_source->dev () = *urandom_dev;
- }
- if (entropy_source &&
- !entropy_source->open (O_RDONLY))
- {
- delete entropy_source;
- entropy_source = NULL;
- }
- if (entropy_source)
- {
- size_t len = sizeof (connect_secret);
- entropy_source->read (connect_secret, len);
- if (len != sizeof (connect_secret))
- bzero ((char*) connect_secret, sizeof (connect_secret));
- }
- __small_sprintf (buf, "%08x-%08x-%08x-%08x",
- connect_secret [0], connect_secret [1],
- connect_secret [2], connect_secret [3]);
-}
-
-/* Maximum number of concurrently opened sockets from all Cygwin processes
- per session. Note that shared sockets (through dup/fork/exec) are
- counted as one socket. */
-#define NUM_SOCKS (32768 / sizeof (wsa_event))
-
-#define LOCK_EVENTS WaitForSingleObject (wsock_mtx, INFINITE)
-#define UNLOCK_EVENTS ReleaseMutex (wsock_mtx)
-
-static wsa_event wsa_events[NUM_SOCKS] __attribute__((section (".cygwin_dll_common"), shared)) = { 0 };
-
-static LONG socket_serial_number __attribute__((section (".cygwin_dll_common"), shared)) = 0;
-
-static HANDLE wsa_slot_mtx;
-
-static PWCHAR
-sock_shared_name (PWCHAR buf, LONG num)
-{
- __small_swprintf (buf, L"socket.%d", num);
- return buf;
-}
-
-static wsa_event *
-search_wsa_event_slot (LONG new_serial_number)
-{
- WCHAR name[32], searchname[32];
- UNICODE_STRING uname;
- OBJECT_ATTRIBUTES attr;
- NTSTATUS status;
-
- if (!wsa_slot_mtx)
- {
- RtlInitUnicodeString (&uname, sock_shared_name (name, 0));
- InitializeObjectAttributes (&attr, &uname, OBJ_INHERIT | OBJ_OPENIF,
- get_session_parent_dir (),
- everyone_sd (CYG_MUTANT_ACCESS));
- status = NtCreateMutant (&wsa_slot_mtx, CYG_MUTANT_ACCESS, &attr, FALSE);
- if (!NT_SUCCESS (status))
- api_fatal ("Couldn't create/open shared socket mutex %S, %p",
- &uname, status);
- }
- switch (WaitForSingleObject (wsa_slot_mtx, INFINITE))
- {
- case WAIT_OBJECT_0:
- case WAIT_ABANDONED:
- break;
- default:
- api_fatal ("WFSO failed for shared socket mutex, %E");
- break;
- }
- unsigned int slot = new_serial_number % NUM_SOCKS;
- while (wsa_events[slot].serial_number)
- {
- HANDLE searchmtx;
- RtlInitUnicodeString (&uname, sock_shared_name (searchname,
- wsa_events[slot].serial_number));
- InitializeObjectAttributes (&attr, &uname, 0, get_session_parent_dir (),
- NULL);
- status = NtOpenMutant (&searchmtx, READ_CONTROL, &attr);
- if (!NT_SUCCESS (status))
- break;
- /* Mutex still exists, attached socket is active, try next slot. */
- NtClose (searchmtx);
- slot = (slot + 1) % NUM_SOCKS;
- if (slot == (new_serial_number % NUM_SOCKS))
- {
- /* Did the whole array once. Too bad. */
- debug_printf ("No free socket slot");
- ReleaseMutex (wsa_slot_mtx);
- return NULL;
- }
- }
- memset (&wsa_events[slot], 0, sizeof (wsa_event));
- wsa_events[slot].serial_number = new_serial_number;
- ReleaseMutex (wsa_slot_mtx);
- return wsa_events + slot;
-}
-
-bool
-fhandler_socket::init_events ()
-{
- LONG new_serial_number;
- WCHAR name[32];
- UNICODE_STRING uname;
- OBJECT_ATTRIBUTES attr;
- NTSTATUS status;
-
- do
- {
- new_serial_number =
- InterlockedIncrement (&socket_serial_number);
- if (!new_serial_number) /* 0 is reserved for global mutex */
- InterlockedIncrement (&socket_serial_number);
- RtlInitUnicodeString (&uname, sock_shared_name (name, new_serial_number));
- InitializeObjectAttributes (&attr, &uname, OBJ_INHERIT | OBJ_OPENIF,
- get_session_parent_dir (),
- everyone_sd (CYG_MUTANT_ACCESS));
- status = NtCreateMutant (&wsock_mtx, CYG_MUTANT_ACCESS, &attr, FALSE);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("NtCreateMutant(%S), %p", &uname, status);
- set_errno (ENOBUFS);
- return false;
- }
- if (status == STATUS_OBJECT_NAME_EXISTS)
- NtClose (wsock_mtx);
- }
- while (status == STATUS_OBJECT_NAME_EXISTS);
- if ((wsock_evt = CreateEvent (&sec_all, TRUE, FALSE, NULL))
- == WSA_INVALID_EVENT)
- {
- debug_printf ("CreateEvent, %E");
- set_errno (ENOBUFS);
- NtClose (wsock_mtx);
- return false;
- }
- if (WSAEventSelect (get_socket (), wsock_evt, EVENT_MASK) == SOCKET_ERROR)
- {
- debug_printf ("WSAEventSelect, %E");
- set_winsock_errno ();
- NtClose (wsock_evt);
- NtClose (wsock_mtx);
- return false;
- }
- wsock_events = search_wsa_event_slot (new_serial_number);
- /* sock type not yet set here. */
- if (pc.dev == FH_UDP || pc.dev == FH_DGRAM)
- wsock_events->events = FD_WRITE;
- return true;
-}
-
-int
-fhandler_socket::evaluate_events (const long event_mask, long &events,
- bool erase)
-{
- int ret = 0;
- long events_now = 0;
-
- WSANETWORKEVENTS evts = { 0 };
- if (!(WSAEnumNetworkEvents (get_socket (), wsock_evt, &evts)))
- {
- if (evts.lNetworkEvents)
- {
- LOCK_EVENTS;
- wsock_events->events |= evts.lNetworkEvents;
- events_now = (wsock_events->events & event_mask);
- if (evts.lNetworkEvents & FD_CONNECT)
- wsock_events->connect_errorcode = evts.iErrorCode[FD_CONNECT_BIT];
- UNLOCK_EVENTS;
- if ((evts.lNetworkEvents & FD_OOB) && wsock_events->owner)
- kill (wsock_events->owner, SIGURG);
- }
- }
-
- LOCK_EVENTS;
- if ((events = events_now) != 0
- || (events = (wsock_events->events & event_mask)) != 0)
- {
- if (events & FD_CONNECT)
- {
- int wsa_err = 0;
- if ((wsa_err = wsock_events->connect_errorcode) != 0)
- {
- WSASetLastError (wsa_err);
- ret = SOCKET_ERROR;
- }
- else
- wsock_events->events |= FD_WRITE;
- wsock_events->events &= ~FD_CONNECT;
- wsock_events->connect_errorcode = 0;
- }
- if (erase)
- wsock_events->events &= ~(events & ~(FD_WRITE | FD_CLOSE));
- }
- UNLOCK_EVENTS;
-
- return ret;
-}
-
-int
-fhandler_socket::wait_for_events (const long event_mask)
-{
- if (async_io ())
- return 0;
-
- int ret;
- long events;
-
- while (!(ret = evaluate_events (event_mask, events, true)) && !events)
- {
- if (is_nonblocking ())
- {
- WSASetLastError (WSAEWOULDBLOCK);
- return SOCKET_ERROR;
- }
-
- WSAEVENT ev[2] = { wsock_evt, signal_arrived };
- switch (WSAWaitForMultipleEvents (2, ev, FALSE, 50, FALSE))
- {
- case WSA_WAIT_TIMEOUT:
- case WSA_WAIT_EVENT_0:
- break;
-
- case WSA_WAIT_EVENT_0 + 1:
- if (_my_tls.call_signal_handler ())
- {
- sig_dispatch_pending ();
- break;
- }
- WSASetLastError (WSAEINTR);
- return SOCKET_ERROR;
-
- default:
- WSASetLastError (WSAEFAULT);
- return SOCKET_ERROR;
- }
- }
-
- return ret;
-}
-
-void
-fhandler_socket::release_events ()
-{
- NtClose (wsock_evt);
- NtClose (wsock_mtx);
-}
-
-void
-fhandler_socket::fixup_after_fork (HANDLE parent)
-{
- fork_fixup (parent, wsock_mtx, "wsock_mtx");
- fork_fixup (parent, wsock_evt, "wsock_evt");
- fhandler_base::fixup_after_fork (parent);
-}
-
-int
-fhandler_socket::dup (fhandler_base *child)
-{
- debug_printf ("here");
- fhandler_socket *fhs = (fhandler_socket *) child;
-
- if (!DuplicateHandle (hMainProc, wsock_mtx, hMainProc, &fhs->wsock_mtx, 0,
- TRUE, DUPLICATE_SAME_ACCESS))
- {
- __seterrno ();
- return -1;
- }
- if (!DuplicateHandle (hMainProc, wsock_evt, hMainProc, &fhs->wsock_evt, 0,
- TRUE, DUPLICATE_SAME_ACCESS))
- {
- __seterrno ();
- NtClose (fhs->wsock_mtx);
- return -1;
- }
- fhs->wsock_events = wsock_events;
-
- fhs->addr_family = addr_family;
- fhs->set_socket_type (get_socket_type ());
- if (get_addr_family () == AF_LOCAL)
- {
- fhs->set_sun_path (get_sun_path ());
- if (get_socket_type () == SOCK_STREAM)
- {
- fhs->sec_pid = sec_pid;
- fhs->sec_uid = sec_uid;
- fhs->sec_gid = sec_gid;
- fhs->sec_peer_pid = sec_peer_pid;
- fhs->sec_peer_uid = sec_peer_uid;
- fhs->sec_peer_gid = sec_peer_gid;
- }
- }
- fhs->connect_state (connect_state ());
- int ret = fhandler_base::dup (child);
- if (ret)
- {
- NtClose (fhs->wsock_evt);
- NtClose (fhs->wsock_mtx);
- }
- return ret;
-}
-
-int __stdcall
-fhandler_socket::fstat (struct __stat64 *buf)
-{
- int res;
- if (get_device () == FH_UNIX)
- {
- res = fhandler_base::fstat_fs (buf);
- if (!res)
- {
- buf->st_mode = (buf->st_mode & ~S_IFMT) | S_IFSOCK;
- }
- }
- else
- {
- res = fhandler_base::fstat (buf);
- if (!res)
- {
- buf->st_dev = 0;
- buf->st_ino = (__ino64_t) ((DWORD) get_handle ());
- buf->st_mode = S_IFSOCK | S_IRWXU | S_IRWXG | S_IRWXO;
- }
- }
- return res;
-}
-
-int __stdcall
-fhandler_socket::fstatvfs (struct statvfs *sfs)
-{
- if (get_device () == FH_UNIX)
- {
- fhandler_disk_file fh (pc);
- fh.get_device () = FH_FS;
- return fh.fstatvfs (sfs);
- }
- set_errno (EBADF);
- return -1;
-}
-
-int
-fhandler_socket::fchmod (mode_t mode)
-{
- if (get_device () == FH_UNIX)
- {
- fhandler_disk_file fh (pc);
- fh.get_device () = FH_FS;
- int ret = fh.fchmod (S_IFSOCK | adjust_socket_file_mode (mode));
- return ret;
- }
- set_errno (EBADF);
- return -1;
-}
-
-int
-fhandler_socket::fchown (__uid32_t uid, __gid32_t gid)
-{
- if (get_device () == FH_UNIX)
- {
- fhandler_disk_file fh (pc);
- return fh.fchown (uid, gid);
- }
- set_errno (EBADF);
- return -1;
-}
-
-int
-fhandler_socket::facl (int cmd, int nentries, __aclent32_t *aclbufp)
-{
- if (get_device () == FH_UNIX)
- {
- fhandler_disk_file fh (pc);
- return fh.facl (cmd, nentries, aclbufp);
- }
- set_errno (EBADF);
- return -1;
-}
-
-int
-fhandler_socket::link (const char *newpath)
-{
- if (get_device () == FH_UNIX)
- {
- fhandler_disk_file fh (pc);
- return fh.link (newpath);
- }
- return fhandler_base::link (newpath);
-}
-
-static inline bool
-address_in_use (const struct sockaddr *addr)
-{
- switch (addr->sa_family)
- {
- case AF_INET:
- {
- PMIB_TCPTABLE tab;
- PMIB_TCPROW entry;
- DWORD size = 0, i;
- struct sockaddr_in *in = (struct sockaddr_in *) addr;
-
- if (GetTcpTable (NULL, &size, FALSE) == ERROR_INSUFFICIENT_BUFFER)
- {
- tab = (PMIB_TCPTABLE) alloca (size += 16 * sizeof (PMIB_TCPROW));
- if (!GetTcpTable (tab, &size, FALSE))
- for (i = tab->dwNumEntries, entry = tab->table; i > 0;
- --i, ++entry)
- if (entry->dwLocalAddr == in->sin_addr.s_addr
- && entry->dwLocalPort == in->sin_port
- && entry->dwState >= MIB_TCP_STATE_LISTEN
- && entry->dwState <= MIB_TCP_STATE_LAST_ACK)
- return true;
- }
- }
- break;
- case AF_INET6:
- {
- /* This test works on XP SP2 and above which should cover almost
- all IPv6 users... */
- PMIB_TCP6TABLE_OWNER_PID tab;
- PMIB_TCP6ROW_OWNER_PID entry;
- DWORD size = 0, i;
- struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) addr;
-
- if (GetExtendedTcpTable (NULL, &size, FALSE, AF_INET6,
- TCP_TABLE_OWNER_PID_ALL, 0)
- == ERROR_INSUFFICIENT_BUFFER)
- {
- tab = (PMIB_TCP6TABLE_OWNER_PID)
- alloca (size += 16 * sizeof (PMIB_TCP6ROW_OWNER_PID));
- if (!GetExtendedTcpTable (tab, &size, FALSE, AF_INET6,
- TCP_TABLE_OWNER_PID_ALL, 0))
- for (i = tab->dwNumEntries, entry = tab->table; i > 0;
- --i, ++entry)
- if (IN6_ARE_ADDR_EQUAL (entry->ucLocalAddr,
- in6->sin6_addr.s6_addr)
- /* FIXME: Is testing for the scope required. too?!? */
- && entry->dwLocalPort == in6->sin6_port
- && entry->dwState >= MIB_TCP_STATE_LISTEN
- && entry->dwState <= MIB_TCP_STATE_LAST_ACK)
- return true;
- }
- }
- break;
- default:
- break;
- }
- return false;
-}
-
-int
-fhandler_socket::bind (const struct sockaddr *name, int namelen)
-{
- int res = -1;
-
- if (name->sa_family == AF_LOCAL)
- {
-#define un_addr ((struct sockaddr_un *) name)
- struct sockaddr_in sin;
- int len = sizeof sin;
-
- if (strlen (un_addr->sun_path) >= UNIX_PATH_LEN)
- {
- set_errno (ENAMETOOLONG);
- goto out;
- }
- sin.sin_family = AF_INET;
- sin.sin_port = 0;
- sin.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
- if (::bind (get_socket (), (sockaddr *) &sin, len))
- {
- syscall_printf ("AF_LOCAL: bind failed");
- set_winsock_errno ();
- goto out;
- }
- if (::getsockname (get_socket (), (sockaddr *) &sin, &len))
- {
- syscall_printf ("AF_LOCAL: getsockname failed");
- set_winsock_errno ();
- goto out;
- }
-
- sin.sin_port = ntohs (sin.sin_port);
- debug_printf ("AF_LOCAL: socket bound to port %u", sin.sin_port);
-
- path_conv pc (un_addr->sun_path, PC_SYM_FOLLOW);
- if (pc.error)
- {
- set_errno (pc.error);
- goto out;
- }
- if (pc.exists ())
- {
- set_errno (EADDRINUSE);
- goto out;
- }
- mode_t mode = adjust_socket_file_mode ((S_IRWXU | S_IRWXG | S_IRWXO)
- & ~cygheap->umask);
- DWORD fattr = FILE_ATTRIBUTE_SYSTEM;
- if (!(mode & (S_IWUSR | S_IWGRP | S_IWOTH)))
- fattr |= FILE_ATTRIBUTE_READONLY;
- SECURITY_ATTRIBUTES sa = sec_none_nih;
- security_descriptor sd;
- if (pc.has_acls ())
- set_security_attribute (mode, &sa, sd);
- NTSTATUS status;
- HANDLE fh;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- status = NtCreateFile (&fh, DELETE | FILE_GENERIC_WRITE,
- pc.get_object_attr (attr, sa), &io, NULL, fattr,
- FILE_SHARE_VALID_FLAGS, FILE_CREATE,
- FILE_NON_DIRECTORY_FILE
- | FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT,
- NULL, 0);
- if (!NT_SUCCESS (status))
- {
- if (io.Information == FILE_EXISTS)
- set_errno (EADDRINUSE);
- else
- __seterrno_from_nt_status (status);
- }
- else
- {
- char buf[sizeof (SOCKET_COOKIE) + 80];
- __small_sprintf (buf, "%s%u %c ", SOCKET_COOKIE, sin.sin_port,
- get_socket_type () == SOCK_STREAM ? 's'
- : get_socket_type () == SOCK_DGRAM ? 'd' : '-');
- af_local_set_secret (strchr (buf, '\0'));
- DWORD blen = strlen (buf) + 1;
- status = NtWriteFile (fh, NULL, NULL, NULL, &io, buf, blen, NULL, 0);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- FILE_DISPOSITION_INFORMATION fdi = { TRUE };
- status = NtSetInformationFile (fh, &io, &fdi, sizeof fdi,
- FileDispositionInformation);
- if (!NT_SUCCESS (status))
- debug_printf ("Setting delete dispostion failed, status = %p",
- status);
- }
- else
- {
- set_sun_path (un_addr->sun_path);
- res = 0;
- }
- NtClose (fh);
- }
-#undef un_addr
- }
- else
- {
- /* If the application didn't explicitely call setsockopt (SO_REUSEADDR),
- enforce exclusive local address use using the SO_EXCLUSIVEADDRUSE
- socket option, to emulate POSIX socket behaviour more closely.
-
- KB 870562: Note that this option is only available since NT4 SP4.
- Also note that a bug in Win2K SP1-3 and XP up to SP1 only enables
- this option for users in the local administrators group. */
- if (wincap.has_exclusiveaddruse ())
- {
- if (!saw_reuseaddr ())
- {
- int on = 1;
- int ret = ::setsockopt (get_socket (), SOL_SOCKET,
- ~(SO_REUSEADDR),
- (const char *) &on, sizeof on);
- debug_printf ("%d = setsockopt (SO_EXCLUSIVEADDRUSE), %E", ret);
- }
- else if (!wincap.has_enhanced_socket_security ())
- {
- debug_printf ("SO_REUSEADDR set");
- /* There's a bug in SO_REUSEADDR handling in WinSock.
- Per standards, we must not be able to reuse a complete
- duplicate of a local TCP address (same IP, same port),
- even if SO_REUSEADDR has been set. That's unfortunately
- possible in WinSock.
-
- So we're testing here if the local address is already in
- use and don't bind, if so. This only works for OSes with
- IP Helper support and is, of course, still prone to races.
-
- However, we don't have to do this on systems supporting
- "enhanced socket security" (2K3 and later). On these
- systems the default binding behaviour is exactly as you'd
- expect for SO_REUSEADDR, while setting SO_REUSEADDR re-enables
- the wrong behaviour. So all we have to do on these newer
- systems is never to set SO_REUSEADDR but only to note that
- it has been set for the above SO_EXCLUSIVEADDRUSE setting.
- See setsockopt() in net.cc. */
- if (get_socket_type () == SOCK_STREAM
- && wincap.has_ip_helper_lib ()
- && address_in_use (name))
- {
- debug_printf ("Local address in use, don't bind");
- set_errno (EADDRINUSE);
- goto out;
- }
- }
- }
- if (::bind (get_socket (), name, namelen))
- set_winsock_errno ();
- else
- res = 0;
- }
-
-out:
- return res;
-}
-
-int
-fhandler_socket::connect (const struct sockaddr *name, int namelen)
-{
- int res = -1;
- bool in_progress = false;
- struct sockaddr_storage sst;
- DWORD err;
- int type;
-
- if (!get_inet_addr (name, namelen, &sst, &namelen, &type, connect_secret))
- return -1;
-
- if (get_addr_family () == AF_LOCAL && get_socket_type () != type)
- {
- WSASetLastError (WSAEPROTOTYPE);
- set_winsock_errno ();
- return -1;
- }
-
- res = ::connect (get_socket (), (struct sockaddr *) &sst, namelen);
- if (!is_nonblocking ()
- && res == SOCKET_ERROR
- && WSAGetLastError () == WSAEWOULDBLOCK)
- res = wait_for_events (FD_CONNECT | FD_CLOSE);
-
- if (!res)
- err = 0;
- else
- {
- err = WSAGetLastError ();
- /* Special handling for connect to return the correct error code
- when called on a non-blocking socket. */
- if (is_nonblocking ())
- {
- if (err == WSAEWOULDBLOCK || err == WSAEALREADY)
- in_progress = true;
-
- if (err == WSAEWOULDBLOCK)
- WSASetLastError (err = WSAEINPROGRESS);
- }
- if (err == WSAEINVAL)
- WSASetLastError (err = WSAEISCONN);
- set_winsock_errno ();
- }
-
- if (get_addr_family () == AF_LOCAL && (!res || in_progress))
- set_sun_path (name->sa_data);
-
- if (get_addr_family () == AF_LOCAL && get_socket_type () == SOCK_STREAM)
- {
- af_local_set_cred (); /* Don't move into af_local_connect since
- af_local_connect is called from select,
- possibly running under another identity. */
- if (!res && af_local_connect ())
- {
- set_winsock_errno ();
- return -1;
- }
- }
-
- if (err == WSAEINPROGRESS || err == WSAEALREADY)
- connect_state (connect_pending);
- else if (err)
- connect_state (connect_failed);
- else
- connect_state (connected);
-
- return res;
-}
-
-int
-fhandler_socket::listen (int backlog)
-{
- int res = ::listen (get_socket (), backlog);
- if (res && WSAGetLastError () == WSAEINVAL)
- {
- /* It's perfectly valid to call listen on an unbound INET socket.
- In this case the socket is automatically bound to an unused
- port number, listening on all interfaces. On Winsock, listen
- fails with WSAEINVAL when it's called on an unbound socket.
- So we have to bind manually here to have POSIX semantics. */
- if (get_addr_family () == AF_INET)
- {
- struct sockaddr_in sin;
- sin.sin_family = AF_INET;
- sin.sin_port = 0;
- sin.sin_addr.s_addr = INADDR_ANY;
- if (!::bind (get_socket (), (struct sockaddr *) &sin, sizeof sin))
- res = ::listen (get_socket (), backlog);
- }
- else if (get_addr_family () == AF_INET6)
- {
- struct sockaddr_in6 sin6 =
- {
- sin6_family: AF_INET6,
- sin6_port: 0,
- sin6_flowinfo: 0,
- sin6_addr: IN6ADDR_ANY_INIT,
- sin6_scope_id: 0
- };
- if (!::bind (get_socket (), (struct sockaddr *) &sin6, sizeof sin6))
- res = ::listen (get_socket (), backlog);
- }
- }
- if (!res)
- {
- if (get_addr_family () == AF_LOCAL && get_socket_type () == SOCK_STREAM)
- af_local_set_cred ();
- connect_state (connected);
- listener (true);
- }
- else
- set_winsock_errno ();
- return res;
-}
-
-int
-fhandler_socket::accept (struct sockaddr *peer, int *len)
-{
- /* Allows NULL peer and len parameters. */
- struct sockaddr_in peer_dummy;
- int len_dummy;
- if (!peer)
- peer = (struct sockaddr *) &peer_dummy;
- if (!len)
- {
- len_dummy = sizeof (struct sockaddr_in);
- len = &len_dummy;
- }
-
- /* accept on NT fails if len < sizeof (sockaddr_in)
- * some programs set len to
- * sizeof (name.sun_family) + strlen (name.sun_path) for UNIX domain
- */
- if (len && ((unsigned) *len < sizeof (struct sockaddr_in)))
- *len = sizeof (struct sockaddr_in);
-
-
- int res = 0;
- while (!(res = wait_for_events (FD_ACCEPT | FD_CLOSE))
- && (res = ::accept (get_socket (), peer, len)) == SOCKET_ERROR
- && WSAGetLastError () == WSAEWOULDBLOCK)
- ;
- if (res == (int) INVALID_SOCKET)
- set_winsock_errno ();
- else
- {
- cygheap_fdnew res_fd;
- if (res_fd >= 0 && fdsock (res_fd, &dev (), res))
- {
- fhandler_socket *sock = (fhandler_socket *) res_fd;
- sock->set_addr_family (get_addr_family ());
- sock->set_socket_type (get_socket_type ());
- sock->async_io (async_io ());
- sock->set_nonblocking (is_nonblocking ());
- if (get_addr_family () == AF_LOCAL)
- {
- sock->set_sun_path (get_sun_path ());
- if (get_socket_type () == SOCK_STREAM)
- {
- /* Don't forget to copy credentials from accepting
- socket to accepted socket and start transaction
- on accepted socket! */
- af_local_copy (sock);
- res = sock->af_local_accept ();
- if (res == -1)
- {
- res_fd.release ();
- set_winsock_errno ();
- goto out;
- }
- }
- }
- /* No locking necessary at this point. */
- sock->wsock_events->events = wsock_events->events | FD_WRITE;
- sock->wsock_events->owner = wsock_events->owner;
- sock->connect_state (connected);
- res = res_fd;
- }
- else
- {
- closesocket (res);
- res = -1;
- }
- }
-
-out:
- debug_printf ("res %d", res);
- return res;
-}
-
-int
-fhandler_socket::getsockname (struct sockaddr *name, int *namelen)
-{
- int res = -1;
-
- if (get_addr_family () == AF_LOCAL)
- {
- struct sockaddr_un *sun = (struct sockaddr_un *) name;
- memset (sun, 0, *namelen);
- sun->sun_family = AF_LOCAL;
-
- if (!get_sun_path ())
- sun->sun_path[0] = '\0';
- else
- /* According to SUSv2 "If the actual length of the address is
- greater than the length of the supplied sockaddr structure, the
- stored address will be truncated." We play it save here so
- that the path always has a trailing 0 even if it's truncated. */
- strncpy (sun->sun_path, get_sun_path (),
- *namelen - sizeof *sun + sizeof sun->sun_path - 1);
-
- *namelen = sizeof *sun - sizeof sun->sun_path
- + strlen (sun->sun_path) + 1;
- res = 0;
- }
- else
- {
- res = ::getsockname (get_socket (), name, namelen);
- if (res)
- {
- if (WSAGetLastError () == WSAEINVAL)
- {
- /* Winsock returns WSAEINVAL if the socket is locally
- unbound. Per SUSv3 this is not an error condition.
- We're faking a valid return value here by creating the
- same content in the sockaddr structure as on Linux. */
- switch (get_addr_family ())
- {
- case AF_INET:
- res = 0;
- *namelen = sizeof (struct sockaddr_in);
- break;
- case AF_INET6:
- res = 0;
- *namelen = sizeof (struct sockaddr_in6);
- break;
- default:
- WSASetLastError (WSAEOPNOTSUPP);
- break;
- }
- if (!res)
- {
- memset (name, 0, *namelen);
- name->sa_family = get_addr_family ();
- }
- }
- if (res)
- set_winsock_errno ();
- }
- }
-
- return res;
-}
-
-int
-fhandler_socket::getpeername (struct sockaddr *name, int *namelen)
-{
- int res = ::getpeername (get_socket (), name, namelen);
- if (res)
- set_winsock_errno ();
-
- return res;
-}
-
-int
-fhandler_socket::readv (const struct iovec *const iov, const int iovcnt,
- ssize_t tot)
-{
- struct msghdr msg =
- {
- msg_name: NULL,
- msg_namelen: 0,
- msg_iov: (struct iovec *) iov, // const_cast
- msg_iovlen: iovcnt,
- msg_control: NULL,
- msg_controllen: 0,
- msg_flags: 0
- };
-
- return recvmsg (&msg, 0);
-}
-
-inline ssize_t
-fhandler_socket::recv_internal (WSABUF *wsabuf, DWORD wsacnt, DWORD flags,
- struct sockaddr *from, int *fromlen)
-{
- ssize_t res = 0;
- DWORD ret = 0, wret;
- int evt_mask = FD_READ | ((flags & MSG_OOB) ? FD_OOB : 0);
-
- bool waitall = (flags & MSG_WAITALL);
- flags &= (MSG_OOB | MSG_PEEK | MSG_DONTROUTE);
- if (waitall)
- {
- if (get_socket_type () != SOCK_STREAM)
- {
- WSASetLastError (WSAEOPNOTSUPP);
- set_winsock_errno ();
- return SOCKET_ERROR;
- }
- if (is_nonblocking () || (flags & (MSG_OOB | MSG_PEEK)))
- waitall = false;
- }
-
- /* Note: Don't call WSARecvFrom(MSG_PEEK) without actually having data
- waiting in the buffers, otherwise the event handling gets messed up
- for some reason. */
- while (!(res = wait_for_events (evt_mask | FD_CLOSE))
- || saw_shutdown_read ())
- {
- res = WSARecvFrom (get_socket (), wsabuf, wsacnt, &wret,
- &flags, from, fromlen, NULL, NULL);
- if (!res)
- {
- ret += wret;
- if (!waitall)
- break;
- while (wret && wsacnt)
- {
- if (wsabuf->len > wret)
- {
- wsabuf->len -= wret;
- wsabuf->buf += wret;
- wret = 0;
- }
- else
- {
- wret -= wsabuf->len;
- ++wsabuf;
- --wsacnt;
- }
- }
- if (!wret)
- break;
- }
- else if (WSAGetLastError () != WSAEWOULDBLOCK)
- break;
- }
-
- if (!ret && res == SOCKET_ERROR)
- {
- /* According to SUSv3, errno isn't set in that case and no error
- condition is returned. */
- if (WSAGetLastError () == WSAEMSGSIZE)
- return ret;
-
- /* ESHUTDOWN isn't defined for recv in SUSv3. Simply EOF is returned
- in this case. */
- if (WSAGetLastError () == WSAESHUTDOWN)
- return 0;
-
- set_winsock_errno ();
- return SOCKET_ERROR;
- }
-
- return ret;
-}
-
-int
-fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
- struct sockaddr *from, int *fromlen)
-{
- WSABUF wsabuf = { len, (char *) ptr };
- return recv_internal (&wsabuf, 1, flags, from, fromlen);
-}
-
-int
-fhandler_socket::recvmsg (struct msghdr *msg, int flags)
-{
- if (CYGWIN_VERSION_CHECK_FOR_USING_ANCIENT_MSGHDR)
- ((struct OLD_msghdr *) msg)->msg_accrightslen = 0;
- else
- {
- msg->msg_controllen = 0;
- msg->msg_flags = 0;
- }
- if (get_addr_family () == AF_LOCAL)
- {
- /* On AF_LOCAL sockets the (fixed-size) name of the shared memory
- area used for descriptor passing is transmitted first.
- If this string is empty, no descriptors are passed and we can
- go ahead recv'ing the normal data blocks. Otherwise start
- special handling for descriptor passing. */
- /*TODO*/
- }
-
- WSABUF wsabuf[msg->msg_iovlen];
- WSABUF *wsaptr = wsabuf + msg->msg_iovlen;
- const struct iovec *iovptr = msg->msg_iov + msg->msg_iovlen;
- while (--wsaptr >= wsabuf)
- {
- wsaptr->len = (--iovptr)->iov_len;
- wsaptr->buf = (char *) iovptr->iov_base;
- }
-
- struct sockaddr *from = (struct sockaddr *) msg->msg_name;
- int *fromlen = from ? &msg->msg_namelen : NULL;
-
- return recv_internal (wsabuf, msg->msg_iovlen, flags, from, fromlen);
-}
-
-int
-fhandler_socket::writev (const struct iovec *const iov, const int iovcnt,
- ssize_t tot)
-{
- struct msghdr msg =
- {
- msg_name: NULL,
- msg_namelen: 0,
- msg_iov: (struct iovec *) iov, // const_cast
- msg_iovlen: iovcnt,
- msg_control: NULL,
- msg_controllen: 0,
- msg_flags: 0
- };
-
- return sendmsg (&msg, 0);
-}
-
-inline ssize_t
-fhandler_socket::send_internal (struct _WSABUF *wsabuf, DWORD wsacnt, int flags,
- const struct sockaddr *to, int tolen)
-{
- int res = 0;
- DWORD ret = 0, err = 0, sum = 0, off = 0;
- WSABUF buf;
-
- for (DWORD i = 0; i < wsacnt; off >= wsabuf[i].len && (++i, off = 0))
- {
- buf.buf = wsabuf[i].buf + off;
- buf.len = wsabuf[i].len - off;
- if (buf.len > 65536) /* See KB 823764 */
- buf.len = 65536;
-
- do
- {
- if ((res = WSASendTo (get_socket (), &buf, 1, &ret,
- flags & (MSG_OOB | MSG_DONTROUTE), to, tolen,
- NULL, NULL))
- && (err = WSAGetLastError ()) == WSAEWOULDBLOCK)
- {
- LOCK_EVENTS;
- wsock_events->events &= ~FD_WRITE;
- UNLOCK_EVENTS;
- }
- }
- while (res && err == WSAEWOULDBLOCK
- && !(res = wait_for_events (FD_WRITE | FD_CLOSE)));
-
- if (!res)
- {
- off += ret;
- sum += ret;
- }
- else if (is_nonblocking () || err != WSAEWOULDBLOCK)
- break;
- }
-
- if (sum)
- res = sum;
- else if (res == SOCKET_ERROR)
- {
- set_winsock_errno ();
-
- /* Special handling for EPIPE and SIGPIPE.
-
- EPIPE is generated if the local end has been shut down on a connection
- oriented socket. In this case the process will also receive a SIGPIPE
- unless MSG_NOSIGNAL is set. */
- if (get_errno () == ESHUTDOWN && get_socket_type () == SOCK_STREAM)
- {
- set_errno (EPIPE);
- if (! (flags & MSG_NOSIGNAL))
- raise (SIGPIPE);
- }
- }
-
- return res;
-}
-
-ssize_t
-fhandler_socket::sendto (const void *ptr, size_t len, int flags,
- const struct sockaddr *to, int tolen)
-{
- struct sockaddr_storage sst;
-
- if (to && !get_inet_addr (to, tolen, &sst, &tolen))
- return SOCKET_ERROR;
-
- /* Never write more than 64K at once to workaround a problem with
- Winsock, which creates a temporary buffer with the total incoming
- buffer size and copies the whole content over, regardless of
- the size of the internal send buffer. A buffer full condition
- is only recognized in subsequent calls and, if len is big enough,
- the call even might fail with an out-of-memory condition. */
- WSABUF wsabuf = { len, (char *) ptr };
- return send_internal (&wsabuf, 1, flags,
- (to ? (const struct sockaddr *) &sst : NULL), tolen);
-}
-
-int
-fhandler_socket::sendmsg (const struct msghdr *msg, int flags)
-{
- if (get_addr_family () == AF_LOCAL)
- {
- /* For AF_LOCAL/AF_UNIX sockets, if descriptors are given, start
- the special handling for descriptor passing. Otherwise just
- transmit an empty string to tell the receiver that no
- descriptor passing is done. */
- /*TODO*/
- }
-
- WSABUF wsabuf[msg->msg_iovlen];
- WSABUF *wsaptr = wsabuf;
- const struct iovec *iovptr = msg->msg_iov;
- for (int i = 0; i < msg->msg_iovlen; ++i)
- {
- wsaptr->len = iovptr->iov_len;
- (wsaptr++)->buf = (char *) (iovptr++)->iov_base;
- }
-
- return send_internal (wsabuf, msg->msg_iovlen, flags,
- (struct sockaddr *) msg->msg_name, msg->msg_namelen);
-}
-
-int
-fhandler_socket::shutdown (int how)
-{
- int res = ::shutdown (get_socket (), how);
-
- if (res)
- set_winsock_errno ();
- else
- switch (how)
- {
- case SHUT_RD:
- saw_shutdown_read (true);
- break;
- case SHUT_WR:
- saw_shutdown_write (true);
- break;
- case SHUT_RDWR:
- saw_shutdown_read (true);
- saw_shutdown_write (true);
- break;
- }
- return res;
-}
-
-int
-fhandler_socket::close ()
-{
- int res = 0;
- /* TODO: CV - 2008-04-16. Lingering disabled. The original problem
- could be no longer reproduced on NT4, XP, 2K8. Any return of a
- spurious "Connection reset by peer" *could* be caused by disabling
- the linger code here... */
-#if 0
- /* HACK to allow a graceful shutdown even if shutdown() hasn't been
- called by the application. Note that this isn't the ultimate
- solution but it helps in many cases. */
- struct linger linger;
- linger.l_onoff = 1;
- linger.l_linger = 240; /* secs. default 2MSL value according to MSDN. */
- setsockopt (get_socket (), SOL_SOCKET, SO_LINGER,
- (const char *)&linger, sizeof linger);
-#endif
- release_events ();
- while ((res = closesocket (get_socket ())) != 0)
- {
- if (WSAGetLastError () != WSAEWOULDBLOCK)
- {
- set_winsock_errno ();
- res = -1;
- break;
- }
- if (WaitForSingleObject (signal_arrived, 10) == WAIT_OBJECT_0)
- {
- set_errno (EINTR);
- res = -1;
- break;
- }
- WSASetLastError (0);
- }
-
- debug_printf ("%d = fhandler_socket::close()", res);
- return res;
-}
-
-/* Definitions of old ifreq stuff used prior to Cygwin 1.7.0. */
-#define OLD_SIOCGIFFLAGS _IOW('s', 101, struct __old_ifreq)
-#define OLD_SIOCGIFADDR _IOW('s', 102, struct __old_ifreq)
-#define OLD_SIOCGIFBRDADDR _IOW('s', 103, struct __old_ifreq)
-#define OLD_SIOCGIFNETMASK _IOW('s', 104, struct __old_ifreq)
-#define OLD_SIOCGIFHWADDR _IOW('s', 105, struct __old_ifreq)
-#define OLD_SIOCGIFMETRIC _IOW('s', 106, struct __old_ifreq)
-#define OLD_SIOCGIFMTU _IOW('s', 107, struct __old_ifreq)
-#define OLD_SIOCGIFINDEX _IOW('s', 108, struct __old_ifreq)
-
-#define CONV_OLD_TO_NEW_SIO(old) (((old)&0xff00ffff)|(((long)sizeof(struct ifreq)&IOCPARM_MASK)<<16))
-
-struct __old_ifreq {
-#define __OLD_IFNAMSIZ 16
- union {
- char ifrn_name[__OLD_IFNAMSIZ]; /* if name, e.g. "en0" */
- } ifr_ifrn;
-
- union {
- struct sockaddr ifru_addr;
- struct sockaddr ifru_broadaddr;
- struct sockaddr ifru_netmask;
- struct sockaddr ifru_hwaddr;
- short ifru_flags;
- int ifru_metric;
- int ifru_mtu;
- int ifru_ifindex;
- } ifr_ifru;
-};
-
-int
-fhandler_socket::ioctl (unsigned int cmd, void *p)
-{
- extern int get_ifconf (struct ifconf *ifc, int what); /* net.cc */
- int res;
- struct ifconf ifc, *ifcp;
- struct ifreq *ifrp;
-
- switch (cmd)
- {
- case SIOCGIFCONF:
- ifcp = (struct ifconf *) p;
- if (!ifcp)
- {
- set_errno (EINVAL);
- return -1;
- }
- if (CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ)
- {
- ifc.ifc_len = ifcp->ifc_len / sizeof (struct __old_ifreq)
- * sizeof (struct ifreq);
- ifc.ifc_buf = (caddr_t) alloca (ifc.ifc_len);
- }
- else
- {
- ifc.ifc_len = ifcp->ifc_len;
- ifc.ifc_buf = ifcp->ifc_buf;
- }
- res = get_ifconf (&ifc, cmd);
- if (res)
- debug_printf ("error in get_ifconf");
- if (CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ)
- {
- struct __old_ifreq *ifr = (struct __old_ifreq *) ifcp->ifc_buf;
- for (ifrp = ifc.ifc_req;
- (caddr_t) ifrp < ifc.ifc_buf + ifc.ifc_len;
- ++ifrp, ++ifr)
- {
- memcpy (&ifr->ifr_ifrn, &ifrp->ifr_ifrn, sizeof ifr->ifr_ifrn);
- ifr->ifr_name[__OLD_IFNAMSIZ - 1] = '\0';
- memcpy (&ifr->ifr_ifru, &ifrp->ifr_ifru, sizeof ifr->ifr_ifru);
- }
- ifcp->ifc_len = ifc.ifc_len / sizeof (struct ifreq)
- * sizeof (struct __old_ifreq);
- }
- else
- ifcp->ifc_len = ifc.ifc_len;
- break;
- case OLD_SIOCGIFFLAGS:
- case OLD_SIOCGIFADDR:
- case OLD_SIOCGIFBRDADDR:
- case OLD_SIOCGIFNETMASK:
- case OLD_SIOCGIFHWADDR:
- case OLD_SIOCGIFMETRIC:
- case OLD_SIOCGIFMTU:
- case OLD_SIOCGIFINDEX:
- cmd = CONV_OLD_TO_NEW_SIO (cmd);
- /*FALLTHRU*/
- case SIOCGIFFLAGS:
- case SIOCGIFBRDADDR:
- case SIOCGIFNETMASK:
- case SIOCGIFADDR:
- case SIOCGIFHWADDR:
- case SIOCGIFMETRIC:
- case SIOCGIFMTU:
- case SIOCGIFINDEX:
- case SIOCGIFFRNDLYNAM:
- case SIOCGIFDSTADDR:
- {
- if (!p)
- {
- debug_printf ("ifr == NULL");
- set_errno (EINVAL);
- return -1;
- }
-
- if (cmd > SIOCGIFINDEX && CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ)
- {
- debug_printf ("cmd not supported on this platform");
- set_errno (EINVAL);
- return -1;
- }
- ifc.ifc_len = 64 * sizeof (struct ifreq);
- ifc.ifc_buf = (caddr_t) alloca (ifc.ifc_len);
- if (cmd == SIOCGIFFRNDLYNAM)
- {
- struct ifreq_frndlyname *iff = (struct ifreq_frndlyname *)
- alloca (64 * sizeof (struct ifreq_frndlyname));
- for (int i = 0; i < 64; ++i)
- ifc.ifc_req[i].ifr_frndlyname = &iff[i];
- }
-
- res = get_ifconf (&ifc, cmd);
- if (res)
- {
- debug_printf ("error in get_ifconf");
- break;
- }
-
- if (CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ)
- {
- struct __old_ifreq *ifr = (struct __old_ifreq *) p;
- debug_printf (" name: %s", ifr->ifr_name);
- for (ifrp = ifc.ifc_req;
- (caddr_t) ifrp < ifc.ifc_buf + ifc.ifc_len;
- ++ifrp)
- {
- debug_printf ("testname: %s", ifrp->ifr_name);
- if (! strcmp (ifrp->ifr_name, ifr->ifr_name))
- {
- memcpy (&ifr->ifr_ifru, &ifrp->ifr_ifru,
- sizeof ifr->ifr_ifru);
- break;
- }
- }
- }
- else
- {
- struct ifreq *ifr = (struct ifreq *) p;
- debug_printf (" name: %s", ifr->ifr_name);
- for (ifrp = ifc.ifc_req;
- (caddr_t) ifrp < ifc.ifc_buf + ifc.ifc_len;
- ++ifrp)
- {
- debug_printf ("testname: %s", ifrp->ifr_name);
- if (! strcmp (ifrp->ifr_name, ifr->ifr_name))
- {
- if (cmd == SIOCGIFFRNDLYNAM)
- /* The application has to care for the space. */
- memcpy (ifr->ifr_frndlyname, ifrp->ifr_frndlyname,
- sizeof (struct ifreq_frndlyname));
- else
- memcpy (&ifr->ifr_ifru, &ifrp->ifr_ifru,
- sizeof ifr->ifr_ifru);
- break;
- }
- }
- }
- if ((caddr_t) ifrp >= ifc.ifc_buf + ifc.ifc_len)
- {
- set_errno (EINVAL);
- return -1;
- }
- break;
- }
- case FIOASYNC:
- res = WSAAsyncSelect (get_socket (), winmsg, WM_ASYNCIO,
- *(int *) p ? ASYNC_MASK : 0);
- syscall_printf ("Async I/O on socket %s",
- *(int *) p ? "started" : "cancelled");
- async_io (*(int *) p != 0);
- /* If async_io is switched off, revert the event handling. */
- if (*(int *) p == 0)
- WSAEventSelect (get_socket (), wsock_evt, EVENT_MASK);
- break;
- case FIONREAD:
- res = ioctlsocket (get_socket (), FIONREAD, (unsigned long *) p);
- if (res == SOCKET_ERROR)
- set_winsock_errno ();
- break;
- default:
- /* Sockets are always non-blocking internally. So we just note the
- state here. */
- if (cmd == FIONBIO)
- {
- syscall_printf ("socket is now %sblocking",
- *(int *) p ? "non" : "");
- set_nonblocking (*(int *) p);
- res = 0;
- }
- else
- res = ioctlsocket (get_socket (), cmd, (unsigned long *) p);
- break;
- }
- syscall_printf ("%d = ioctl_socket (%x, %x)", res, cmd, p);
- return res;
-}
-
-int
-fhandler_socket::fcntl (int cmd, void *arg)
-{
- int res = 0;
- int request, current;
-
- switch (cmd)
- {
- case F_SETOWN:
- {
- pid_t pid = (pid_t) arg;
- LOCK_EVENTS;
- wsock_events->owner = pid;
- UNLOCK_EVENTS;
- debug_printf ("owner set to %d", pid);
- }
- break;
- case F_GETOWN:
- res = wsock_events->owner;
- break;
- case F_SETFL:
- {
- /* Carefully test for the O_NONBLOCK or deprecated OLD_O_NDELAY flag.
- Set only the flag that has been passed in. If both are set, just
- record O_NONBLOCK. */
- int new_flags = (int) arg & O_NONBLOCK_MASK;
- if ((new_flags & OLD_O_NDELAY) && (new_flags & O_NONBLOCK))
- new_flags = O_NONBLOCK;
- current = get_flags () & O_NONBLOCK_MASK;
- request = new_flags ? 1 : 0;
- if (!!current != !!new_flags && (res = ioctl (FIONBIO, &request)))
- break;
- set_flags ((get_flags () & ~O_NONBLOCK_MASK) | new_flags);
- break;
- }
- default:
- res = fhandler_base::fcntl (cmd, arg);
- break;
- }
- return res;
-}
-
-void
-fhandler_socket::set_close_on_exec (bool val)
-{
- set_no_inheritance (wsock_mtx, val);
- set_no_inheritance (wsock_evt, val);
- fhandler_base::set_close_on_exec (val);
- debug_printf ("set close_on_exec for %s to %d", get_name (), val);
-}
-
-void
-fhandler_socket::set_sun_path (const char *path)
-{
- sun_path = path ? cstrdup (path) : NULL;
-}
-
-int
-fhandler_socket::getpeereid (pid_t *pid, __uid32_t *euid, __gid32_t *egid)
-{
- if (get_addr_family () != AF_LOCAL || get_socket_type () != SOCK_STREAM)
- {
- set_errno (EINVAL);
- return -1;
- }
- if (connect_state () != connected)
- {
- set_errno (ENOTCONN);
- return -1;
- }
- if (sec_peer_pid == (pid_t) 0)
- {
- set_errno (ENOTCONN); /* Usually when calling getpeereid on
- accepting (instead of accepted) socket. */
- return -1;
- }
-
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- if (pid)
- *pid = sec_peer_pid;
- if (euid)
- *euid = sec_peer_uid;
- if (egid)
- *egid = sec_peer_gid;
- return 0;
-}
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
deleted file mode 100644
index 23836a537ae..00000000000
--- a/winsup/cygwin/include/cygwin/version.h
+++ /dev/null
@@ -1,410 +0,0 @@
-/* version.h -- Cygwin version numbers and accompanying documentation.
-
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-/* Cygwin versioning is relatively complicated because of its status
- as a shared library. Let's start with how versioning used to be done.
-
- Historical versioning in Cygwin 16.0 to 19.5:
-
- In the olden days of Cygwin, we had a dll major and minor version
- and a registry version. The major number started at 16 because the
- "b15" GNU-Win32 release of the compiler tools was out when this
- scheme was started. We incremented the DLL name frequently (for
- every official release) and towards the end of this period every
- release used a different shared memory area to prevent DLLs from
- interfering with each other (embedding a build timestamp into the
- name of the shared memory area). This turned out to be a Bad Idea
- (tm) because people needed to mingle separate releases and have
- them work together more than we thought they would. This was
- especially problematic when tty info needed to be retained when an
- old Cygwin executable executed a newer one.
-
- In the old scheme, we incremented the major number whenever a
- change to the dll invalidated existing executables. This can
- happen for a number of reasons, including when functions are
- removed from the export list of the dll. The minor number was
- incremented when a change was made that we wanted to record, but
- that didn't invalidate existing executables. Both numbers were
- recorded in the executable and in the dll.
-
- In October 1998 (starting with Cygwin 19.6), we started a new method
- of Cygwin versioning: */
-
- /* The DLL major and minor numbers correspond to the "version of
- the Cygwin shared library". This version is used to track important
- changes to the DLL and is mainly informative in nature. */
-
-#define CYGWIN_VERSION_DLL_MAJOR 1007
-#define CYGWIN_VERSION_DLL_MINOR 0
-
- /* Major numbers before CYGWIN_VERSION_DLL_EPOCH are
- incompatible. */
-
-#define CYGWIN_VERSION_DLL_EPOCH 19
-
- /* CYGWIN_VERSION_DLL_COMBINED gives us a single number
- representing the combined DLL major and minor numbers. */
-
- /* WATCH OUT FOR OCTAL! Don't use, say, "00020" for 0.20 */
-
-#define CYGWIN_VERSION_DLL_MAKE_COMBINED(maj, min) (((maj) * 1000) + min)
-#define CYGWIN_VERSION_DLL_COMBINED \
- CYGWIN_VERSION_DLL_MAKE_COMBINED (CYGWIN_VERSION_DLL_MAJOR, CYGWIN_VERSION_DLL_MINOR)
-
- /* Every version of cygwin <= this uses an old, incorrect method
- to determine signal masks. */
-
-#define CYGWIN_VERSION_USER_API_VERSION_COMBINED \
- CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor)
-
- /* API versions <= this had a termios structure whose members were
- too small to accomodate modern settings. */
-#define CYGWIN_VERSION_DLL_OLD_TERMIOS 5
-#define CYGWIN_VERSION_DLL_IS_OLD_TERMIOS \
- (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= CYGWIN_VERSION_DLL_OLD_TERMIOS)
-
-#define CYGWIN_VERSION_DLL_MALLOC_ENV 28
- /* Old APIs had getc/putc macros that conflict with new CR/LF
- handling in the stdio buffers */
-#define CYGWIN_VERSION_OLD_STDIO_CRLF_HANDLING \
- (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 20)
-
-#define CYGWIN_VERSION_CHECK_FOR_S_IEXEC \
- (CYGWIN_VERSION_USER_API_VERSION_COMBINED >= 36)
-
-#define CYGWIN_VERSION_CHECK_FOR_OLD_O_NONBLOCK \
- (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 28)
-
-#define CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES \
- (CYGWIN_VERSION_USER_API_VERSION_COMBINED >= 79)
-
-#define CYGWIN_VERSION_CHECK_FOR_USING_ANCIENT_MSGHDR \
- (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 138)
-
-#define CYGWIN_VERSION_CHECK_FOR_USING_WINSOCK1_VALUES \
- (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 138)
-
-#define CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ \
- (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 161)
-
- /* API_MAJOR 0.0: Initial version. API_MINOR changes:
- 1: Export cygwin32_ calls as cygwin_ as well.
- 2: Export j1, jn, y1, yn.
- 3: Export dll_noncygwin_dllcrt0.
- 4: New socket ioctls, revamped ifconf support.
- 5: Thread support/exports.
- 6: Change in termios handling.
- 7: Export scandir and alphasort.
- 8: Export _ctype_, _sys_errlist, _sys_nerr.
- 9: Mount-related changes, new cygwin_umount export.
- Raw device support (tape, floppies).
- 10: Fast math routine support added.
- 11: Export seekdir, telldir.
- 12: Export pthread_join, pthread_detach.
- 13: Export math funcs gamma and friends, also _j0, _j1, etc.
- 14: Export snprintf and vnsprintf.
- 15: Export glob
- 16: Export cygwin_stackdump
- 17: Export fast math stuff
- 18: Stop exporting _strace_wm
- 19: Export fchown, lchown, lacl
- 20: regsub, inet_network
- 21: incompatible change to stdio cr/lf and buffering
- 22: Export cygwin_logon_user, cygwin_set_impersonation_token.
- geteuid, getegid return effective uid/gid.
- getuid, getgid return real uid/gid.
- seteuid, setegid set only effective uid/gid.
- setuid, setgid set effective and real uid/gid.
- 23: Export new dll_crt0 interface and cygwin_user_data for use
- with crt0 startup code.
- 24: Export poll and _poll.
- 25: Export getmode and _getmode.
- 26: CW_GET_CYGDRIVE_PREFIXES addition to external.cc
- 27: CW_GETPINFO_FULL addition to external.cc
- 28: Accidentally bumped by cgf
- 29: Export hstrerror
- 30: CW_GET_CYGDRIVE_INFO addition to external.cc
- 31: Export inet_aton
- 32: Export getrlimit/setrlimit
- 33: Export setlogmask
- 34: Separated out mount table
- 35: Export drand48, erand48, jrand48, lcong48, lrand48,
- mrand48, nrand48, seed48, and srand48.
- 36: Added _cygwin_S_IEXEC, et al
- 37: [f]pathconv support _PC_POSIX_PERMISSIONS and _PC_POSIX_SECURITY
- 38: vscanf, vscanf_r, and random pthread functions
- 39: asctime_r, ctime_r, gmtime_r, localtime_r
- 40: fchdir
- 41: __signgam
- 42: sys_errlist, sys_nerr
- 43: sigsetjmp, siglongjmp fixed
- 44: Export dirfd
- 45: perprocess change, gamma_r, gammaf_r, lgamma_r, lgammaf_r
- 46: Remove cygwin_getshared
- 47: Report EOTWarningZoneSize in struct mtget.
- 48: Export "posix" regex functions
- 49: Export setutent, endutent, utmpname, getutent, getutid, getutline.
- 50: Export fnmatch.
- 51: Export recvmsg, sendmsg.
- 52: Export strptime
- 53: Export strlcat, strlcpy.
- 54: Export __fpclassifyd, __fpclassifyf, __signbitd, __signbitf.
- 55: Export fcloseall, fcloseall_r.
- 56: Make ntsec on by default.
- 57: Export setgroups.
- 58: Export memalign, valloc, malloc_trim, malloc_usable_size, mallopt,
- malloc_stats
- 59: getsid
- 60: MSG_NOSIGNAL
- 61: Export getc_unlocked, getchar_unlocked, putc_unlocked,
- putchar_unlocked
- 62: Erroneously bumped
- 63: Export pututline
- 64: Export fseeko, ftello
- 65: Export siginterrupt
- 66: Export nl_langinfo
- 67: Export pthread_getsequence_np
- 68: Export netdb stuff
- 69: Export strtof
- 70: Export asprintf, _asprintf_r, vasprintf, _vasprintf_r
- 71: Export strerror_r
- 72: Export nanosleep
- 73: Export setreuid32, setreuid, setregid32, setregid
- 74: Export _strtold a64l hcreate hcreate_r hdestroy hdestroy_r hsearch
- hsearch_r isblank iswalnum iswalpha iswblank iswcntrl iswctype
- iswdigit iswgraph iswlower iswprint iswpunct iswspace iswupper
- iswxdigit l64a mbrlen mbrtowc mbsinit mbsrtowcs mempcpy
- on_exit setbuffer setlinebuf strndup strnlen tdelete tdestroy
- tfind towctrans towlower towupper tsearch twalk wcrtomb wcscat
- wcschr wcscpy wcscspn wcslcat wcslcpy wcsncat wcsncmp wcsncpy
- wcspbrk wcsrchr wcsrtombs wcsspn wcsstr wctob wctob wctrans
- wctype wmemchr wmemcmp wmemcpy wmemmove wmemset
- 75: Export exp2 exp2f fdim fdimf fma fmaf fmax fmaxf fmin fminf lrint
- lrintf lround lroundf nearbyint nearbyintf remquo remquof
- round roundf scalbln scalblnf sincos sincosf tgamma tgammaf
- truncf
- 76: mallinfo
- 77: thread-safe exit/at_exit
- 78: Use stat and fstat rather than _stat, and _fstat.
- Export btowc and trunc.
- 79: Export acl32 aclcheck32 aclfrommode32 aclfrompbits32 aclfromtext32
- aclsort32 acltomode32 acltopbits32 acltotext32 facl32
- fgetpos64 fopen64 freopen64 fseeko64 fsetpos64 ftello64
- _open64 _lseek64 _fstat64 _stat64 mknod32
- 80: Export pthread_rwlock stuff
- 81: CW_CHECK_NTSEC addition to external.cc
- 82: Export wcscoll wcswidth wcwidth
- 83: Export gethostid
- 84: Pty open allocates invisible console. 64 bit interface
- 85: Export new 32/64 functions from API 0.79 only with leading
- underscore. No problems with backward compatibility since no
- official release has been made so far. This change removes
- exported symbols like fopen64, which might confuse configure.
- 86: Export ftok
- 87: Export vsyslog
- 88: Export _getreent
- 89: Export __mempcpy
- 90: Export _fopen64
- 91: Export argz_add argz_add_sep argz_append argz_count argz_create
- argz_create_sep argz_delete argz_extract argz_insert
- argz_next argz_replace argz_stringify envz_add envz_entry
- envz_get envz_merge envz_remove envz_strip
- 92: Export getusershell, setusershell, endusershell
- 93: Export daemon, forkpty, openpty, iruserok, ruserok, login_tty,
- openpty, forkpty, revoke, logwtmp, updwtmp
- 94: Export getopt, getopt_long, optarg, opterr, optind, optopt,
- optreset, __check_rhosts_file, __rcmd_errstr.
- 95: Export shmat, shmctl, shmdt, shmget.
- 96: CW_GET_ERRNO_FROM_WINERROR addition to external.cc
- 97: Export sem_open, sem_close, sem_timedwait, sem_getvalue.
- 98: Export _tmpfile64.
- 99: CW_GET_POSIX_SECURITY_ATTRIBUTE addition to external.cc.
- 100: CW_GET_SHMLBA addition to external.cc.
- 101: Export err, errx, verr, verrx, warn, warnx, vwarn, vwarnx.
- 102: CW_GET_UID_FROM_SID and CW_GET_GID_FROM_SID addition to external.cc.
- 103: Export getprogname, setprogname.
- 104: Export msgctl, msgget, msgrcv, msgsnd, semctl, semget, semop.
- 105: Export sigwait.
- 106: Export flock.
- 107: Export fcntl64.
- 108: Remove unused (hopefully) reent_data export.
- 109: Oh well. Someone uses reent_data.
- 110: Export clock_gettime, sigwaitinfo, timer_create, timer_delete,
- timer_settime
- 111: Export sigqueue, sighold.
- 112: Redefine some mtget fields.
- 113: Again redefine some mtget fields. Use mt_fileno and mt_blkno as
- on Linux.
- 114: Export rand_r, ttyname_r.
- 115: Export flockfile, ftrylockfile, funlockfile, getgrgid_r, getgrnam_r,
- getlogin_r.
- 116: Export atoll.
- 117: Export utmpx functions, Return utmp * from pututent.
- 118: Export getpriority, setpriority.
- 119: Export fdatasync.
- 120: Export basename, dirname.
- 122: Export statvfs, fstatvfs.
- 123: Export utmpxname.
- 124: Add MAP_AUTOGROW flag to mmap.
- 125: LD_PRELOAD/CW_HOOK available.
- 126: Export lsearch, lfind, timer_gettime.
- 127: Export sigrelese.
- 128: Export pselect.
- 129: Export mkdtemp.
- 130: Export strtoimax, strtoumax, llabs, imaxabs, lldiv, imaxdiv.
- 131: Export inet_ntop, inet_pton.
- 132: Add GLOB_LIMIT flag to glob.
- 133: Export __getline, __getdelim.
- 134: Export getline, getdelim.
- 135: Export pread, pwrite
- 136: Add TIOCMBIS/TIOCMBIC ioctl codes.
- 137: fts_children, fts_close, fts_get_clientptr, fts_get_stream,
- fts_open, fts_read, fts_set, fts_set_clientptr, ftw, nftw.
- 138: Export readdir_r.
- 139: Start using POSIX definition of struct msghdr and WinSock2
- IPPROTO_IP values.
- 140: Export mlock, munlock.
- 141: Export futimes, lutimes.
- 142: Export memmem
- 143: Export clock_getres, clock_setres
- 144: Export timelocal, timegm.
- 145: Add MAP_NORESERVE flag to mmap.
- 146: Change SI_USER definition. FIXME: Need to develop compatibility
- macro for this?
- 147: Eliminate problematic d_ino from dirent structure. unsetenv now
- returns int, as per linux.
- 148: Add open(2) flags O_SYNC, O_RSYNC, O_DSYNC and O_DIRECT.
- 149: Add open(2) flag O_NOFOLLOW.
- 150: Export getsubopt.
- 151: Export __opendir_with_d_ino
- 152: Revert to having d_ino in dirent unconditionally.
- 153: Export updwtmpx, Implement CW_SETUP_WINENV.
- 154: Export sigset, sigignore.
- 155: Export __isinff, __isinfd, __isnanf, __isnand.
- 156: Export __srbuf_r, __swget_r.
- 157: Export gai_strerror, getaddrinfo, getnameinfo, freeaddrinfo,
- in6addr_any, in6addr_loopback.
- 158: Export bindresvport, bindresvport_sa, iruserok_sa, rcmd_af,
- rresvport_af.
- 159: Export posix_openpt.
- 160: Export posix_fadvise, posix_fallocate.
- 161: Export resolver functions.
- 162: New struct ifreq. Export if_nametoindex, if_indextoname,
- if_nameindex, if_freenameindex.
- 163: Export posix_madvise, posix_memalign.
- 164: Export shm_open, shm_unlink.
- 165: Export mq_close, mq_getattr, mq_notify, mq_open, mq_receive,
- mq_send, mq_setattr, mq_timedreceive, mq_timedsend, mq_unlink.
- 166: Export sem_unlink.
- 167: Add st_birthtim to struct stat.
- 168: Export asnprintf, dprintf, _Exit, vasnprintf, vdprintf.
- 169: Export confstr.
- 170: Export insque, remque.
- 171: Export exp10, exp10f, pow10, pow10f, strcasestr, funopen,
- fopencookie.
- 172: Export getifaddrs, freeifaddrs.
- 173: Export __assert_func.
- 174: Export stpcpy, stpncpy.
- 175: Export fdopendir.
- 176: Export wcstol, wcstoll, wcstoul, wcstoull, wcsxfrm.
- 177: Export sys_sigabbrev
- 178: Export wcpcpy, wcpncpy.
- 179: Export _f_llrint, _f_llrintf, _f_llrintl, _f_lrint, _f_lrintf,
- _f_lrintl, _f_rint, _f_rintf, _f_rintl, llrint, llrintf, llrintl,
- rintl, lrintl, and redirect exports of lrint, lrintf, rint, rintf.
- 180: Export getxattr, lgetxattr, fgetxattr, listxattr, llistxattr,
- flistxattr, setxattr, lsetxattr, fsetxattr, removexattr,
- lremovexattr, fremovexattr.
- 181: Export cygwin_conv_path, cygwin_create_path, cygwin_conv_path_list.
- 182: Export lockf.
- FIXME: Removed 12 year old and entirely wrong wprintf function at
- this point. We need a working implementation soon.
- 183: Export open_memstream, fmemopen.
- 184: Export openat, faccessat, fchmodat, fchownat, fstatat, futimesat,
- linkat, mkdirat, mkfifoat, mknodat, readlinkat, renameat, symlinkat,
- unlinkat.
- 185: Export futimens, utimensat.
- 186: Remove ancient V8 regexp functions. Also eliminate old crt0 interface
- which provided its own user_data structure.
- */
-
- /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
-
-#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 186
-
- /* There is also a compatibity version number associated with the
- shared memory regions. It is incremented when incompatible
- changes are made to the shared memory region *or* to any named
- shared mutexes, semaphores, etc. The arbitrary starting
- version was 0 (cygwin release 98r2).
- Bump to 4 since this hasn't been rigorously updated in a
- while. */
-
-#define CYGWIN_VERSION_SHARED_DATA 5
-
- /* An identifier used in the names used to create shared objects.
- The full names include the CYGWIN_VERSION_SHARED_DATA version
- as well as this identifier. */
-
-#define CYGWIN_VERSION_DLL_IDENTIFIER "cygwin1"
-
- /* The Cygwin mount table interface in the Win32 registry also
- has a version number associated with it in case that is
- changed in a non-backwards compatible fashion. Increment this
- version number whenever incompatible changes in mount table
- registry usage are made.
-
- 1: Original number version.
- 2: New mount registry layout, system-wide mount accessibility.
- 3: The mount table is not in the registry anymore, but in /etc/fstab.
- */
-
-#define CYGWIN_VERSION_MOUNT_REGISTRY 3
-
- /* Identifiers used in the Win32 registry. */
-
-#define CYGWIN_INFO_CYGWIN_REGISTRY_NAME "Cygwin"
-#define CYGWIN_INFO_PROGRAM_OPTIONS_NAME "Program Options"
-
- /* The default cygdrive prefix. */
-
-#define CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX "/cygdrive"
-
- /* In addition to the above version number strings, the build
- process adds some strings that may be useful in
- debugging/identifying a particular Cygwin DLL:
-
- The mkvers.sh script at the top level produces a .cc file
- which initializes a cygwin_version structure based on the
- above version information and creates a string table for
- grepping via "fgrep '%%%' cygwinwhatever.dll" if you are
- using GNU grep. Otherwise you may want to do a
- "strings cygwinwhatever.dll | fgrep '%%%'" instead.
-
- This will produce output such as:
-
- %%% Cygwin dll_identifier: cygwin
- %%% Cygwin api_major: 0
- %%% Cygwin api_minor: 0
- %%% Cygwin dll_major: 19
- %%% Cygwin dll_minor: 6
- %%% Cygwin shared_data: 1
- %%% Cygwin registry: b15
- %%% Cygwin build date: Wed Oct 14 16:26:51 EDT 1998
- %%% Cygwin shared id: cygwinS1
-
- This information can also be obtained through a call to
- cygwin_internal (CW_GETVERSIONINFO).
- */
-
-#define CYGWIN_VERSION_MAGIC(a, b) ((unsigned) ((((unsigned short) a) << 16) | (unsigned short) b))
-#define CYGWIN_VERSION_MAGIC_VERSION(a) ((unsigned) ((unsigned)a & 0xffff))
diff --git a/winsup/cygwin/include/sys/utmp.h b/winsup/cygwin/include/sys/utmp.h
deleted file mode 100644
index 8a63b348b88..00000000000
--- a/winsup/cygwin/include/sys/utmp.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* sys/utmp.h
-
- Copyright 2001, 2003, 2004, 2005, 2008 Red Hat, Inc.
-
- This software is a copyrighted work licensed under the terms of the
- Cygwin license. Please consult the file "CYGWIN_LICENSE" for
- details. */
-
-#ifndef UTMP_H
-#define UTMP_H
-
-#include <cygwin/utmp.h>
-
-#define UTMP_FILE _PATH_UTMP
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef ut_name
-#define ut_name ut_user
-#endif
-
-
-struct utmp
-{
- short ut_type;
- pid_t ut_pid;
- char ut_line[UT_LINESIZE];
- char ut_id[UT_IDLEN];
- time_t ut_time;
- char ut_user[UT_NAMESIZE];
- char ut_host[UT_HOSTSIZE];
- long ut_addr;
-};
-
-extern struct utmp *getutent (void);
-extern struct utmp *getutid (const struct utmp *);
-extern struct utmp *getutline (const struct utmp *);
-extern struct utmp *pututline (const struct utmp *);
-extern void endutent (void);
-extern void setutent (void);
-extern void utmpname (const char *);
-
-void login (const struct utmp *);
-int logout (const char *);
-int login_tty (int);
-void updwtmp (const char *, const struct utmp *);
-void logwtmp (const char *, const char *, const char *);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* UTMP_H */
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc
deleted file mode 100644
index 1e633f43233..00000000000
--- a/winsup/cygwin/init.cc
+++ /dev/null
@@ -1,161 +0,0 @@
-/* init.cc
-
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "winsup.h"
-#include "cygtls.h"
-#include "ntdll.h"
-#include "shared_info.h"
-
-static DWORD _my_oldfunc;
-
-int NO_COPY dynamically_loaded;
-static char NO_COPY *search_for = (char *) cygthread::stub;
-unsigned threadfunc_ix[8] __attribute__((section (".cygwin_dll_common"), shared));
-extern cygthread *hwait_sig;
-
-#define OLDFUNC_OFFSET -1
-
-static void WINAPI
-threadfunc_fe (VOID *arg)
-{
- (void)__builtin_return_address(1);
- asm volatile ("andl $-16,%%esp" ::: "%esp");
- _cygtls::call ((DWORD (*) (void *, void *)) TlsGetValue (_my_oldfunc), arg);
-}
-
-/* If possible, redirect the thread entry point to a cygwin routine which
- adds tls stuff to the stack. */
-static void
-munge_threadfunc ()
-{
- int i;
- char **ebp = (char **) __builtin_frame_address (0);
- if (!threadfunc_ix[0])
- {
- char **peb;
- char **top = (char **) _tlsbase;
- for (peb = ebp, i = 0; peb < top && i < 7; peb++)
- if (*peb == search_for)
- threadfunc_ix[i++] = peb - ebp;
- if (0 && !threadfunc_ix[0])
- {
- try_to_debug ();
- return;
- }
- }
-
- if (threadfunc_ix[0])
- {
- char *threadfunc = ebp[threadfunc_ix[0]];
- if (!search_for || threadfunc == search_for)
- {
- search_for = NULL;
- for (i = 0; threadfunc_ix[i]; i++)
- ebp[threadfunc_ix[i]] = (char *) threadfunc_fe;
- TlsSetValue (_my_oldfunc, threadfunc);
- }
- }
-}
-
-inline static void
-respawn_wow64_process ()
-{
- NTSTATUS ret;
- PROCESS_BASIC_INFORMATION pbi;
- HANDLE parent;
-
- ULONG wow64 = TRUE; /* Opt on the safe side. */
-
- /* Unfortunately there's no simpler way to retrieve the
- parent process in NT, as far as I know. Hints welcome. */
- ret = NtQueryInformationProcess (GetCurrentProcess (),
- ProcessBasicInformation,
- &pbi, sizeof pbi, NULL);
- if (NT_SUCCESS (ret)
- && (parent = OpenProcess (PROCESS_QUERY_INFORMATION,
- FALSE,
- pbi.InheritedFromUniqueProcessId)))
- {
- NtQueryInformationProcess (parent, ProcessWow64Information,
- &wow64, sizeof wow64, NULL);
- CloseHandle (parent);
- }
-
- /* The parent is a real 64 bit process? Respawn! */
- if (!wow64)
- {
- PROCESS_INFORMATION pi;
- STARTUPINFOW si;
- DWORD ret = 0;
-
- GetStartupInfoW (&si);
- if (!CreateProcessW (NULL, GetCommandLineW (), NULL, NULL, TRUE,
- CREATE_DEFAULT_ERROR_MODE
- | GetPriorityClass (GetCurrentProcess ()),
- NULL, NULL, &si, &pi))
- api_fatal ("Failed to create process <%s>, %E", GetCommandLineA ());
- CloseHandle (pi.hThread);
- if (WaitForSingleObject (pi.hProcess, INFINITE) == WAIT_FAILED)
- api_fatal ("Waiting for process %d failed, %E", pi.dwProcessId);
- GetExitCodeProcess (pi.hProcess, &ret);
- CloseHandle (pi.hProcess);
- ExitProcess (ret);
- }
-}
-
-extern void __stdcall dll_crt0_0 ();
-
-HMODULE NO_COPY cygwin_hmodule;
-
-extern "C" BOOL WINAPI
-dll_entry (HANDLE h, DWORD reason, void *static_load)
-{
- BOOL wow64_test_stack_marker;
-
- switch (reason)
- {
- case DLL_PROCESS_ATTACH:
- wincap.init ();
- init_console_handler (false);
-
- cygwin_hmodule = (HMODULE) h;
- dynamically_loaded = (static_load == NULL);
-
- /* Is the stack at an unusual address? This is, an address which
- is in the usual space occupied by the process image, but below
- the auto load address of DLLs?
- Check if we're running in WOW64 on a 64 bit machine *and* are
- spawned by a genuine 64 bit process. If so, respawn. */
- if (wincap.is_wow64 ()
- && &wow64_test_stack_marker >= (PBOOL) 0x400000
- && &wow64_test_stack_marker <= (PBOOL) 0x10000000)
- respawn_wow64_process ();
-
- dll_crt0_0 ();
- _my_oldfunc = TlsAlloc ();
- break;
- case DLL_PROCESS_DETACH:
- if (dynamically_loaded)
- shared_destroy ();
- break;
- case DLL_THREAD_ATTACH:
- if (hwait_sig)
- munge_threadfunc ();
- break;
- case DLL_THREAD_DETACH:
- if (hwait_sig && (void *) &_my_tls > (void *) &wow64_test_stack_marker
- && _my_tls.isinitialized ())
- _my_tls.remove (0);
- break;
- }
-
- return TRUE;
-}
diff --git a/winsup/cygwin/lib/crt0.h b/winsup/cygwin/lib/crt0.h
deleted file mode 100644
index 461ea9b2e49..00000000000
--- a/winsup/cygwin/lib/crt0.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* crt0.h: header file for crt0.
-
- Copyright 2000, 2001, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <windows.h>
-struct per_process;
-typedef int (*MainFunc) (int argc, char *argv[], char **env);
-int __stdcall _cygwin_crt0_common (MainFunc, struct per_process *);
-int dll_dllcrt0 (HMODULE, struct per_process *);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/winsup/cygwin/lib/cygwin_crt0.c b/winsup/cygwin/lib/cygwin_crt0.c
deleted file mode 100644
index fdd2d8d5f6e..00000000000
--- a/winsup/cygwin/lib/cygwin_crt0.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* cygwin_crt0.cc: crt0 for cygwin
-
- Copyright 2000, 2001 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#undef __INSIDE_CYGWIN__
-#include <sys/cygwin.h>
-#include "crt0.h"
-
-extern void __stdcall _dll_crt0 ()
- __declspec (dllimport) __attribute ((noreturn));
-
-/* for main module */
-void
-cygwin_crt0 (MainFunc f)
-{
- _cygwin_crt0_common (f, NULL);
- _dll_crt0 (); /* Jump into the dll, never to return */
-}
diff --git a/winsup/cygwin/libc/bsdlib.cc b/winsup/cygwin/libc/bsdlib.cc
deleted file mode 100644
index 9d488c35a1c..00000000000
--- a/winsup/cygwin/libc/bsdlib.cc
+++ /dev/null
@@ -1,303 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * CV 2003-09-10: Cygwin specific changes applied. Code simplified just
- * for Cygwin alone.
- */
-
-#include "winsup.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <utmp.h>
-#include <unistd.h>
-#include <sys/termios.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include "cygerrno.h"
-#include "thread.h"
-#include "cygtls.h"
-
-extern "C" int
-daemon (int nochdir, int noclose)
-{
- int fd;
-
- switch (fork ())
- {
- case -1:
- return -1;
- case 0:
- break;
- default:
- /* This sleep avoids a race condition which kills the
- child process if parent is started by a NT/W2K service.
- FIXME: Is that still true? */
- Sleep (1000L);
- _exit (0);
- }
- if (setsid () == -1)
- return -1;
- if (!nochdir)
- chdir ("/");
- if (!noclose && (fd = open (_PATH_DEVNULL, O_RDWR, 0)) >= 0)
- {
- dup2 (fd, STDIN_FILENO);
- dup2 (fd, STDOUT_FILENO);
- dup2 (fd, STDERR_FILENO);
- if (fd > 2)
- close (fd);
- }
- return 0;
-}
-
-extern "C" int
-login_tty (int fd)
-{
- char *fdname;
- int newfd;
-
- if (setsid () == -1)
- return -1;
- if ((fdname = ttyname (fd)))
- {
- if (fd != STDIN_FILENO)
- close (STDIN_FILENO);
- if (fd != STDOUT_FILENO)
- close (STDOUT_FILENO);
- if (fd != STDERR_FILENO)
- close (STDERR_FILENO);
- newfd = open (fdname, O_RDWR);
- close (newfd);
- }
- dup2 (fd, STDIN_FILENO);
- dup2 (fd, STDOUT_FILENO);
- dup2 (fd, STDERR_FILENO);
- if (fd > 2)
- close (fd);
- return 0;
-}
-
-extern "C" int
-openpty (int *amaster, int *aslave, char *name, struct termios *termp,
- struct winsize *winp)
-{
- int master, slave;
- char pts[TTY_NAME_MAX];
-
- if ((master = open ("/dev/ptmx", O_RDWR | O_NOCTTY)) >= 0)
- {
- grantpt (master);
- unlockpt (master);
- strcpy (pts, ptsname (master));
- revoke (pts);
- if ((slave = open (pts, O_RDWR | O_NOCTTY)) >= 0)
- {
- if (amaster)
- *amaster = master;
- if (aslave)
- *aslave = slave;
- if (name)
- strcpy (name, pts);
- if (termp)
- tcsetattr (slave, TCSAFLUSH, termp);
- if (winp)
- ioctl (slave, TIOCSWINSZ, (char *) winp);
- return 0;
- }
- close (master);
- }
- set_errno (ENOENT);
- return -1;
-}
-
-extern "C" int
-forkpty (int *amaster, char *name, struct termios *termp, struct winsize *winp)
-{
- int master, slave, pid;
-
- if (openpty (&master, &slave, name, termp, winp) == -1)
- return -1;
- switch (pid = fork ())
- {
- case -1:
- return -1;
- case 0:
- close (master);
- login_tty (slave);
- return 0;
- }
- if (amaster)
- *amaster = master;
- close (slave);
- return pid;
-}
-
-extern "C" char *__progname;
-
-static void
-_vwarnx (const char *fmt, va_list ap)
-{
- fprintf (stderr, "%s: ", __progname);
- vfprintf (stderr, fmt, ap);
-}
-
-extern "C" void
-vwarn (const char *fmt, va_list ap)
-{
- _vwarnx (fmt, ap);
- fprintf (stderr, ": %s", strerror (get_errno ()));
- fputc ('\n', stderr);
-}
-
-extern "C" void
-vwarnx (const char *fmt, va_list ap)
-{
- _vwarnx (fmt, ap);
- fputc ('\n', stderr);
-}
-
-extern "C" void
-warn (const char *fmt, ...)
-{
- va_list ap;
- va_start (ap, fmt);
- vwarn (fmt, ap);
-}
-
-extern "C" void
-warnx (const char *fmt, ...)
-{
- va_list ap;
- va_start (ap, fmt);
- vwarnx (fmt, ap);
-}
-
-extern "C" void
-verr (int eval, const char *fmt, va_list ap)
-{
- vwarn (fmt, ap);
- exit (eval);
-}
-
-extern "C" void
-verrx (int eval, const char *fmt, va_list ap)
-{
- vwarnx (fmt, ap);
- exit (eval);
-}
-
-extern "C" void
-err (int eval, const char *fmt, ...)
-{
- va_list ap;
- va_start (ap, fmt);
- vwarn (fmt, ap);
- exit (eval);
-}
-
-extern "C" void
-errx (int eval, const char *fmt, ...)
-{
- va_list ap;
- va_start (ap, fmt);
- vwarnx (fmt, ap);
- exit (eval);
-}
-
-extern "C" const char *
-getprogname (void)
-{
- return __progname;
-}
-
-extern "C" void
-setprogname (const char *newprogname)
-{
- myfault efault;
- if (!efault.faulted (EFAULT))
- {
- /* Per BSD man page, setprogname keeps a pointer to the last
- path component of the argument. It does *not* copy the
- argument before. */
- __progname = strrchr (newprogname, '/');
- if (__progname)
- ++__progname;
- else
- __progname = (char *)newprogname;
- }
-}
-
-extern "C" void
-logwtmp (const char *line, const char *user, const char *host)
-{
- struct utmp ut;
- memset (&ut, 0, sizeof ut);
- ut.ut_type = USER_PROCESS;
- ut.ut_pid = getpid ();
- if (line)
- strncpy (ut.ut_line, line, sizeof ut.ut_line);
- time (&ut.ut_time);
- if (user)
- strncpy (ut.ut_user, user, sizeof ut.ut_user);
- if (host)
- strncpy (ut.ut_host, host, sizeof ut.ut_host);
- updwtmp (_PATH_WTMP, &ut);
-}
-
-extern "C" void
-login (const struct utmp *ut)
-{
- pututline (ut);
- endutent ();
- updwtmp (_PATH_WTMP, ut);
-}
-
-extern "C" int
-logout (const char *line)
-{
- struct utmp ut_buf, *ut;
-
- memset (&ut_buf, 0, sizeof ut_buf);
- strncpy (ut_buf.ut_line, line, sizeof ut_buf.ut_line);
- setutent ();
- ut = getutline (&ut_buf);
-
- if (ut)
- {
- ut->ut_type = DEAD_PROCESS;
- memset (ut->ut_user, 0, sizeof ut->ut_user);
- memset (ut->ut_host, 0, sizeof ut->ut_host);
- time (&ut->ut_time);
- debug_printf ("set logout time for %s", line);
- pututline (ut);
- endutent ();
- return 1;
- }
- return 0;
-}
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
deleted file mode 100644
index 55b276193c8..00000000000
--- a/winsup/cygwin/mount.cc
+++ /dev/null
@@ -1,1359 +0,0 @@
-/* path.cc: path support.
-
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "winsup.h"
-#include "miscfuncs.h"
-#include <mntent.h>
-#include <ctype.h>
-#include <wingdi.h>
-#include <winuser.h>
-#include <winnetwk.h>
-#include <shlobj.h>
-#include <cygwin/version.h>
-#include "cygerrno.h"
-#include "security.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "cygheap.h"
-#include "shared_info.h"
-#include "cygtls.h"
-#include "tls_pbuf.h"
-#include <ntdll.h>
-#include <wchar.h>
-
-/* Determine if path prefix matches current cygdrive */
-#define iscygdrive(path) \
- (path_prefix_p (mount_table->cygdrive, (path), mount_table->cygdrive_len, false))
-
-#define iscygdrive_device(path) \
- (isalpha (path[mount_table->cygdrive_len]) && \
- (path[mount_table->cygdrive_len + 1] == '/' || \
- !path[mount_table->cygdrive_len + 1]))
-
-#define isproc(path) \
- (path_prefix_p (proc, (path), proc_len, false))
-
-/* is_unc_share: Return non-zero if PATH begins with //server/share
- or with one of the native prefixes //./ or //?/
- This function is only used to test for valid input strings.
- The later normalization drops the native prefixes. */
-
-static inline bool __stdcall
-is_native_path (const char *path)
-{
- return isdirsep (path[0])
- && (isdirsep (path[1]) || path[1] == '?')
- && (path[2] == '?' || path[2] == '.')
- && isdirsep (path[3])
- && isalpha (path[4]);
-}
-
-static inline bool __stdcall
-is_unc_share (const char *path)
-{
- const char *p;
- return (isdirsep (path[0])
- && isdirsep (path[1])
- && isalnum (path[2])
- && ((p = strpbrk (path + 3, "\\/")) != NULL)
- && isalnum (p[1]));
-}
-
-/* Return true if src_path is a valid, internally supported device name.
- In that case, win32_path gets the corresponding NT device name and
- dev is appropriately filled with device information. */
-
-static bool
-win32_device_name (const char *src_path, char *win32_path, device& dev)
-{
- dev.parse (src_path);
- if (dev == FH_FS || dev == FH_DEV)
- return false;
- strcpy (win32_path, dev.native);
- return true;
-}
-
-inline void
-mount_info::create_root_entry (const PWCHAR root)
-{
- /* Create a default root dir from the path the Cygwin DLL is in. */
- char native_root[PATH_MAX];
- sys_wcstombs (native_root, PATH_MAX, root);
- mount_table->add_item (native_root, "/", MOUNT_SYSTEM | MOUNT_BINARY);
- /* Create a default cygdrive entry. Note that this is a user entry.
- This allows to override it with mount, unless the sysadmin created
- a cygdrive entry in /etc/fstab. */
- cygdrive_flags = MOUNT_BINARY | MOUNT_CYGDRIVE;
- strcpy (cygdrive, CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX "/");
- cygdrive_len = strlen (cygdrive);
-}
-
-/* init: Initialize the mount table. */
-
-void
-mount_info::init ()
-{
- nmounts = 0;
- PWCHAR pathend;
- WCHAR path[PATH_MAX];
-
- pathend = wcpcpy (path, cygwin_shared->installation_root);
- create_root_entry (path);
- pathend = wcpcpy (pathend, L"\\etc\\fstab");
- if (from_fstab (false, path, pathend) /* The single | is correct! */
- | from_fstab (true, path, pathend))
- return;
-
- /* FIXME: Remove warning message before releasing 1.7.0. */
- small_printf ("Huh? No /etc/fstab file in %W? Using default root and cygdrive prefix...\n", path);
-}
-
-static void
-set_flags (unsigned *flags, unsigned val)
-{
- *flags = val;
- if (!(*flags & PATH_BINARY))
- {
- *flags |= PATH_TEXT;
- debug_printf ("flags: text (%p)", *flags & (PATH_TEXT | PATH_BINARY));
- }
- else
- {
- *flags |= PATH_BINARY;
- debug_printf ("flags: binary (%p)", *flags & (PATH_TEXT | PATH_BINARY));
- }
-}
-
-int
-mount_item::build_win32 (char *dst, const char *src, unsigned *outflags, unsigned chroot_pathlen)
-{
- int n, err = 0;
- const char *real_native_path;
- int real_posix_pathlen;
- set_flags (outflags, (unsigned) flags);
- if (!cygheap->root.exists () || posix_pathlen != 1 || posix_path[0] != '/')
- {
- n = native_pathlen;
- real_native_path = native_path;
- real_posix_pathlen = chroot_pathlen ?: posix_pathlen;
- }
- else
- {
- n = cygheap->root.native_length ();
- real_native_path = cygheap->root.native_path ();
- real_posix_pathlen = posix_pathlen;
- }
- memcpy (dst, real_native_path, n + 1);
- const char *p = src + real_posix_pathlen;
- if (*p == '/')
- /* nothing */;
- else if ((isdrive (dst) && !dst[2]) || *p)
- dst[n++] = '\\';
- if ((n + strlen (p)) >= NT_MAX_PATH)
- err = ENAMETOOLONG;
- else
- backslashify (p, dst + n, 0);
- return err;
-}
-
-/* conv_to_win32_path: Ensure src_path is a pure Win32 path and store
- the result in win32_path.
-
- If win32_path != NULL, the relative path, if possible to keep, is
- stored in win32_path. If the relative path isn't possible to keep,
- the full path is stored.
-
- If full_win32_path != NULL, the full path is stored there.
-
- The result is zero for success, or an errno value.
-
- {,full_}win32_path must have sufficient space (i.e. NT_MAX_PATH bytes). */
-
-int
-mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
- unsigned *flags)
-{
- bool chroot_ok = !cygheap->root.exists ();
- while (sys_mount_table_counter < cygwin_shared->sys_mount_table_counter)
- {
- int current = cygwin_shared->sys_mount_table_counter;
- init ();
- sys_mount_table_counter = current;
- }
- MALLOC_CHECK;
-
- dev.devn = FH_FS;
-
- *flags = 0;
- debug_printf ("conv_to_win32_path (%s)", src_path);
-
- int i, rc;
- mount_item *mi = NULL; /* initialized to avoid compiler warning */
-
- /* The path is already normalized, without ../../ stuff, we need to have this
- so that we can move from one mounted directory to another with relative
- stuff.
-
- eg mounting c:/foo /foo
- d:/bar /bar
-
- cd /bar
- ls ../foo
-
- should look in c:/foo, not d:/foo.
-
- converting normalizex UNIX path to a DOS-style path, looking up the
- appropriate drive in the mount table. */
-
- /* See if this is a cygwin "device" */
- if (win32_device_name (src_path, dst, dev))
- {
- *flags = MOUNT_BINARY; /* FIXME: Is this a sensible default for devices? */
- rc = 0;
- goto out_no_chroot_check;
- }
-
- MALLOC_CHECK;
- /* If the path is on a network drive or a //./ resp.//?/ path prefix,
- bypass the mount table. If it's // or //MACHINE, use the netdrive
- device. */
- if (src_path[1] == '/')
- {
- if (!strchr (src_path + 2, '/'))
- {
- dev = *netdrive_dev;
- set_flags (flags, PATH_BINARY);
- }
- backslashify (src_path, dst, 0);
- /* Go through chroot check */
- goto out;
- }
- if (isproc (src_path))
- {
- dev = *proc_dev;
- dev.devn = fhandler_proc::get_proc_fhandler (src_path);
- if (dev.devn == FH_BAD)
- return ENOENT;
- set_flags (flags, PATH_BINARY);
- strcpy (dst, src_path);
- goto out;
- }
- /* Check if the cygdrive prefix was specified. If so, just strip
- off the prefix and transform it into an MS-DOS path. */
- else if (iscygdrive (src_path))
- {
- int n = mount_table->cygdrive_len - 1;
- int unit;
-
- if (!src_path[n])
- {
- unit = 0;
- dst[0] = '\0';
- if (mount_table->cygdrive_len > 1)
- dev = *cygdrive_dev;
- }
- else if (cygdrive_win32_path (src_path, dst, unit))
- {
- set_flags (flags, (unsigned) cygdrive_flags);
- goto out;
- }
- else if (mount_table->cygdrive_len > 1)
- return ENOENT;
- }
-
- int chroot_pathlen;
- chroot_pathlen = 0;
- /* Check the mount table for prefix matches. */
- for (i = 0; i < nmounts; i++)
- {
- const char *path;
- int len;
-
- mi = mount + posix_sorted[i];
- if (!cygheap->root.exists ()
- || (mi->posix_pathlen == 1 && mi->posix_path[0] == '/'))
- {
- path = mi->posix_path;
- len = mi->posix_pathlen;
- }
- else if (cygheap->root.posix_ok (mi->posix_path))
- {
- path = cygheap->root.unchroot (mi->posix_path);
- chroot_pathlen = len = strlen (path);
- }
- else
- {
- chroot_pathlen = 0;
- continue;
- }
-
- if (path_prefix_p (path, src_path, len, mi->flags & MOUNT_NOPOSIX))
- break;
- }
-
- if (i < nmounts)
- {
- int err = mi->build_win32 (dst, src_path, flags, chroot_pathlen);
- if (err)
- return err;
- chroot_ok = true;
- }
- else
- {
- int offset = 0;
- if (src_path[1] != '/' && src_path[1] != ':')
- offset = cygheap->cwd.get_drive (dst);
- backslashify (src_path, dst + offset, 0);
- }
- out:
- MALLOC_CHECK;
- if (chroot_ok || cygheap->root.ischroot_native (dst))
- rc = 0;
- else
- {
- debug_printf ("attempt to access outside of chroot '%s - %s'",
- cygheap->root.posix_path (), cygheap->root.native_path ());
- rc = ENOENT;
- }
-
- out_no_chroot_check:
- debug_printf ("src_path %s, dst %s, flags %p, rc %d", src_path, dst, *flags, rc);
- return rc;
-}
-
-int
-mount_info::get_mounts_here (const char *parent_dir, int parent_dir_len,
- PUNICODE_STRING mount_points,
- PUNICODE_STRING cygd)
-{
- int n_mounts = 0;
-
- for (int i = 0; i < nmounts; i++)
- {
- mount_item *mi = mount + posix_sorted[i];
- char *last_slash = strrchr (mi->posix_path, '/');
- if (!last_slash)
- continue;
- if (last_slash == mi->posix_path)
- {
- if (parent_dir_len == 1 && mi->posix_pathlen > 1)
- RtlCreateUnicodeStringFromAsciiz (&mount_points[n_mounts++],
- last_slash + 1);
- }
- else if (parent_dir_len == last_slash - mi->posix_path
- && strncasematch (parent_dir, mi->posix_path, parent_dir_len))
- RtlCreateUnicodeStringFromAsciiz (&mount_points[n_mounts++],
- last_slash + 1);
- }
- RtlCreateUnicodeStringFromAsciiz (cygd, cygdrive + 1);
- cygd->Length -= 2; // Strip trailing slash
- return n_mounts;
-}
-
-/* cygdrive_posix_path: Build POSIX path used as the
- mount point for cygdrives created when there is no other way to
- obtain a POSIX path from a Win32 one. */
-
-void
-mount_info::cygdrive_posix_path (const char *src, char *dst, int trailing_slash_p)
-{
- int len = cygdrive_len;
-
- memcpy (dst, cygdrive, len + 1);
-
- /* Now finish the path off with the drive letter to be used.
- The cygdrive prefix always ends with a trailing slash so
- the drive letter is added after the path. */
- dst[len++] = cyg_tolower (src[0]);
- if (!src[2] || (isdirsep (src[2]) && !src[3]))
- dst[len++] = '\000';
- else
- {
- int n;
- dst[len++] = '/';
- if (isdirsep (src[2]))
- n = 3;
- else
- n = 2;
- strcpy (dst + len, src + n);
- }
- slashify (dst, dst, trailing_slash_p);
-}
-
-int
-mount_info::cygdrive_win32_path (const char *src, char *dst, int& unit)
-{
- int res;
- const char *p = src + cygdrive_len;
- if (!isalpha (*p) || (!isdirsep (p[1]) && p[1]))
- {
- unit = -1; /* FIXME: should be zero, maybe? */
- dst[0] = '\0';
- res = 0;
- }
- else
- {
- dst[0] = cyg_tolower (*p);
- dst[1] = ':';
- strcpy (dst + 2, p + 1);
- backslashify (dst, dst, !dst[2]);
- unit = dst[0];
- res = 1;
- }
- debug_printf ("src '%s', dst '%s'", src, dst);
- return res;
-}
-
-/* conv_to_posix_path: Ensure src_path is a POSIX path.
-
- The result is zero for success, or an errno value.
- posix_path must have sufficient space (i.e. NT_MAX_PATH bytes).
- If keep_rel_p is non-zero, relative paths stay that way. */
-
-/* TODO: Change conv_to_posix_path to work with native paths. */
-
-/* src_path is a wide Win32 path. */
-int
-mount_info::conv_to_posix_path (PWCHAR src_path, char *posix_path,
- int keep_rel_p)
-{
- bool changed = false;
- if (!wcsncmp (src_path, L"\\\\?\\", 4))
- {
- src_path += 4;
- if (src_path[1] != L':') /* native UNC path */
- {
- *(src_path += 2) = L'\\';
- changed = true;
- }
- }
- tmp_pathbuf tp;
- char *buf = tp.c_get ();
- sys_wcstombs (buf, NT_MAX_PATH, src_path);
- int ret = conv_to_posix_path (buf, posix_path, keep_rel_p);
- if (changed)
- src_path[0] = L'C';
- return ret;
-}
-
-int
-mount_info::conv_to_posix_path (const char *src_path, char *posix_path,
- int keep_rel_p)
-{
- int src_path_len = strlen (src_path);
- int relative_path_p = !isabspath (src_path);
- int trailing_slash_p;
-
- if (src_path_len <= 1)
- trailing_slash_p = 0;
- else
- {
- const char *lastchar = src_path + src_path_len - 1;
- trailing_slash_p = isdirsep (*lastchar) && lastchar[-1] != ':';
- }
-
- debug_printf ("conv_to_posix_path (%s, %s, %s)", src_path,
- keep_rel_p ? "keep-rel" : "no-keep-rel",
- trailing_slash_p ? "add-slash" : "no-add-slash");
- MALLOC_CHECK;
-
- if (src_path_len >= NT_MAX_PATH)
- {
- debug_printf ("ENAMETOOLONG");
- return ENAMETOOLONG;
- }
-
- /* FIXME: For now, if the path is relative and it's supposed to stay
- that way, skip mount table processing. */
-
- if (keep_rel_p && relative_path_p)
- {
- slashify (src_path, posix_path, 0);
- debug_printf ("%s = conv_to_posix_path (%s)", posix_path, src_path);
- return 0;
- }
-
- tmp_pathbuf tp;
- char *pathbuf = tp.c_get ();
- char *tail;
- int rc = normalize_win32_path (src_path, pathbuf, tail);
- if (rc != 0)
- {
- debug_printf ("%d = conv_to_posix_path (%s)", rc, src_path);
- return rc;
- }
-
- int pathbuflen = tail - pathbuf;
- for (int i = 0; i < nmounts; ++i)
- {
- mount_item &mi = mount[native_sorted[i]];
- if (!path_prefix_p (mi.native_path, pathbuf, mi.native_pathlen,
- mi.flags & MOUNT_NOPOSIX))
- continue;
-
- if (cygheap->root.exists () && !cygheap->root.posix_ok (mi.posix_path))
- continue;
-
- /* SRC_PATH is in the mount table. */
- int nextchar;
- const char *p = pathbuf + mi.native_pathlen;
-
- if (!*p || !p[1])
- nextchar = 0;
- else if (isdirsep (*p))
- nextchar = -1;
- else
- nextchar = 1;
-
- int addslash = nextchar > 0 ? 1 : 0;
- if ((mi.posix_pathlen + (pathbuflen - mi.native_pathlen) + addslash) >= NT_MAX_PATH)
- return ENAMETOOLONG;
- strcpy (posix_path, mi.posix_path);
- if (addslash)
- strcat (posix_path, "/");
- if (nextchar)
- slashify (p,
- posix_path + addslash + (mi.posix_pathlen == 1 ? 0 : mi.posix_pathlen),
- trailing_slash_p);
-
- if (cygheap->root.exists ())
- {
- const char *p = cygheap->root.unchroot (posix_path);
- memmove (posix_path, p, strlen (p) + 1);
- }
- goto out;
- }
-
- if (!cygheap->root.exists ())
- /* nothing */;
- else if (!cygheap->root.ischroot_native (pathbuf))
- return ENOENT;
- else
- {
- const char *p = pathbuf + cygheap->root.native_length ();
- if (*p)
- slashify (p, posix_path, trailing_slash_p);
- else
- {
- posix_path[0] = '/';
- posix_path[1] = '\0';
- }
- goto out;
- }
-
- /* Not in the database. This should [theoretically] only happen if either
- the path begins with //, or / isn't mounted, or the path has a drive
- letter not covered by the mount table. If it's a relative path then the
- caller must want an absolute path (otherwise we would have returned
- above). So we always return an absolute path at this point. */
- if (isdrive (pathbuf))
- cygdrive_posix_path (pathbuf, posix_path, trailing_slash_p);
- else
- {
- /* The use of src_path and not pathbuf here is intentional.
- We couldn't translate the path, so just ensure no \'s are present. */
- slashify (src_path, posix_path, trailing_slash_p);
- }
-
-out:
- debug_printf ("%s = conv_to_posix_path (%s)", posix_path, src_path);
- MALLOC_CHECK;
- return 0;
-}
-
-/* Return flags associated with a mount point given the win32 path. */
-
-unsigned
-mount_info::set_flags_from_win32_path (const char *p)
-{
- for (int i = 0; i < nmounts; i++)
- {
- mount_item &mi = mount[native_sorted[i]];
- if (path_prefix_p (mi.native_path, p, mi.native_pathlen,
- mi.flags & MOUNT_NOPOSIX))
- return mi.flags;
- }
- return PATH_BINARY;
-}
-
-inline char *
-skip_ws (char *in)
-{
- while (*in == ' ' || *in == '\t')
- ++in;
- return in;
-}
-
-inline char *
-find_ws (char *in)
-{
- while (*in && *in != ' ' && *in != '\t')
- ++in;
- return in;
-}
-
-inline char *
-conv_fstab_spaces (char *field)
-{
- register char *sp = field;
- while (sp = strstr (sp, "\\040"))
- {
- *sp++ = ' ';
- memmove (sp, sp + 3, strlen (sp + 3) + 1);
- }
- return field;
-}
-
-struct opt
-{
- const char *name;
- unsigned val;
- bool clear;
-} oopts[] =
-{
- {"user", MOUNT_SYSTEM, 1},
- {"nouser", MOUNT_SYSTEM, 0},
- {"binary", MOUNT_BINARY, 0},
- {"text", MOUNT_BINARY, 1},
- {"exec", MOUNT_EXEC, 0},
- {"notexec", MOUNT_NOTEXEC, 0},
- {"cygexec", MOUNT_CYGWIN_EXEC, 0},
- {"nosuid", 0, 0},
- {"acl", MOUNT_NOACL, 1},
- {"noacl", MOUNT_NOACL, 0},
- {"posix=1", MOUNT_NOPOSIX, 1},
- {"posix=0", MOUNT_NOPOSIX, 0}
-};
-
-static bool
-read_flags (char *options, unsigned &flags)
-{
- while (*options)
- {
- char *p = strchr (options, ',');
- if (p)
- *p++ = '\0';
- else
- p = strchr (options, '\0');
-
- for (opt *o = oopts;
- o < (oopts + (sizeof (oopts) / sizeof (oopts[0])));
- o++)
- if (strcmp (options, o->name) == 0)
- {
- if (o->clear)
- flags &= ~o->val;
- else
- flags |= o->val;
- goto gotit;
- }
- system_printf ("invalid fstab option - '%s'", options);
- return false;
-
- gotit:
- options = p;
- }
- return true;
-}
-
-bool
-mount_info::from_fstab_line (char *line, bool user)
-{
- char *native_path, *posix_path, *fs_type;
-
- /* First field: Native path. */
- char *c = skip_ws (line);
- if (!*c || *c == '#')
- return true;
- char *cend = find_ws (c);
- *cend = '\0';
- native_path = conv_fstab_spaces (c);
- /* Second field: POSIX path. */
- c = skip_ws (cend + 1);
- if (!*c)
- return true;
- cend = find_ws (c);
- *cend = '\0';
- posix_path = conv_fstab_spaces (c);
- /* Third field: FS type. */
- c = skip_ws (cend + 1);
- if (!*c)
- return true;
- cend = find_ws (c);
- *cend = '\0';
- fs_type = c;
- /* Forth field: Flags. */
- c = skip_ws (cend + 1);
- if (!*c)
- return true;
- cend = find_ws (c);
- *cend = '\0';
- unsigned mount_flags = MOUNT_SYSTEM | MOUNT_BINARY;
- if (!read_flags (c, mount_flags))
- return true;
- if (user)
- mount_flags &= ~MOUNT_SYSTEM;
- if (!strcmp (fs_type, "cygdrive"))
- {
- cygdrive_flags = mount_flags | MOUNT_CYGDRIVE;
- slashify (posix_path, cygdrive, 1);
- cygdrive_len = strlen (cygdrive);
- }
- else
- {
- int res = mount_table->add_item (native_path, posix_path, mount_flags);
- if (res && get_errno () == EMFILE)
- return false;
- }
- return true;
-}
-
-bool
-mount_info::from_fstab (bool user, WCHAR fstab[], PWCHAR fstab_end)
-{
- UNICODE_STRING upath;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- NTSTATUS status;
- HANDLE fh;
-
- if (user)
- {
- extern void transform_chars (PWCHAR, PWCHAR);
- PWCHAR username;
- sys_mbstowcs (username = wcpcpy (fstab_end, L".d\\"),
- NT_MAX_PATH - (fstab_end - fstab),
- cygheap->user.name ());
- /* Make sure special chars in the username are converted according to
- the rules. */
- transform_chars (username, username + wcslen (username) - 1);
- }
- RtlInitUnicodeString (&upath, fstab);
- InitializeObjectAttributes (&attr, &upath, OBJ_CASE_INSENSITIVE, NULL, NULL);
- debug_printf ("Try to read mounts from %W", fstab);
- status = NtOpenFile (&fh, SYNCHRONIZE | FILE_READ_DATA, &attr, &io,
- FILE_SHARE_VALID_FLAGS, FILE_SYNCHRONOUS_IO_NONALERT);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("NtOpenFile(%S) failed, %p", &upath, status);
- return false;
- }
-
- char buf[NT_MAX_PATH];
- char *got = buf;
- DWORD len = 0;
- unsigned line = 1;
- /* Using buffer size - 2 leaves space to append two \0. */
- while (NT_SUCCESS (NtReadFile (fh, NULL, NULL, NULL, &io, got,
- (sizeof (buf) - 2) - (got - buf), NULL, NULL)))
- {
- char *end;
-
- len = io.Information;
- /* Set end marker. */
- got[len] = got[len + 1] = '\0';
- /* Set len to the absolute len of bytes in buf. */
- len += got - buf;
- /* Reset got to start reading at the start of the buffer again. */
- got = buf;
-retry:
- bool got_nl = false;
- while (got < buf + len && (end = strchr (got, '\n')))
- {
- got_nl = true;
- end[end[-1] == '\r' ? -1 : 0] = '\0';
- if (!from_fstab_line (got, user))
- goto done;
- got = end + 1;
- ++line;
- }
- if (len < (sizeof (buf) - 2))
- break;
- /* Check if the buffer contained at least one \n. If not, the
- line length is > 32K. We don't take such long lines. Print
- a debug message and skip this line entirely. */
- if (!got_nl)
- {
- system_printf ("%W: Line %d too long, skipping...", fstab, line);
- while (NT_SUCCESS (NtReadFile (fh, NULL, NULL, NULL, &io, buf,
- (sizeof (buf) - 2), NULL, NULL)))
- {
- len = io.Information;
- buf[len] = buf[len + 1] = '\0';
- got = strchr (buf, '\n');
- if (got)
- {
- ++got;
- ++line;
- goto retry;
- }
- }
- got = buf;
- break;
- }
- /* We have to read once more. Move remaining bytes to the start of
- the buffer and reposition got so that it points to the end of
- the remaining bytes. */
- len = buf + len - got;
- memmove (buf, got, len);
- got = buf + len;
- buf[len] = buf[len + 1] = '\0';
- }
- /* Catch a last line without trailing \n. */
- if (got > buf)
- from_fstab_line (got, user);
-done:
- NtClose (fh);
- return true;
-}
-
-/* write_cygdrive_info: Store default prefix and flags
- to use when creating cygdrives to the special user shared mem
- location used to store cygdrive information. */
-
-int
-mount_info::write_cygdrive_info (const char *cygdrive_prefix, unsigned flags)
-{
- /* Verify cygdrive prefix starts with a forward slash and if there's
- another character, it's not a slash. */
- if ((cygdrive_prefix == NULL) || (*cygdrive_prefix == 0) ||
- (!isslash (cygdrive_prefix[0])) ||
- ((cygdrive_prefix[1] != '\0') && (isslash (cygdrive_prefix[1]))))
- {
- set_errno (EINVAL);
- return -1;
- }
- /* Don't allow to override a system cygdrive prefix. */
- if (cygdrive_flags & MOUNT_SYSTEM)
- {
- set_errno (EPERM);
- return -1;
- }
-
- slashify (cygdrive_prefix, cygdrive, 1);
- cygdrive_flags = flags & ~MOUNT_SYSTEM;
- cygdrive_len = strlen (cygdrive);
-
- return 0;
-}
-
-int
-mount_info::get_cygdrive_info (char *user, char *system, char *user_flags,
- char *system_flags)
-{
- if (user)
- *user = '\0';
- if (system)
- *system = '\0';
- if (user_flags)
- *user_flags = '\0';
- if (system_flags)
- *system_flags = '\0';
-
- char *path = (cygdrive_flags & MOUNT_SYSTEM) ? system : user;
- char *flags = (cygdrive_flags & MOUNT_SYSTEM) ? system_flags : user_flags;
-
- if (path)
- {
- strcpy (path, cygdrive);
- /* Strip trailing slash for backward compatibility. */
- if (cygdrive_len > 2)
- path[cygdrive_len - 1] = '\0';
- }
- if (flags)
- strcpy (flags, (cygdrive_flags & MOUNT_BINARY) ? "binmode" : "textmode");
- return 0;
-}
-
-static mount_item *mounts_for_sort;
-
-/* sort_by_posix_name: qsort callback to sort the mount entries. Sort
- user mounts ahead of system mounts to the same POSIX path. */
-/* FIXME: should the user should be able to choose whether to
- prefer user or system mounts??? */
-static int
-sort_by_posix_name (const void *a, const void *b)
-{
- mount_item *ap = mounts_for_sort + (*((int*) a));
- mount_item *bp = mounts_for_sort + (*((int*) b));
-
- /* Base weighting on longest posix path first so that the most
- obvious path will be chosen. */
- size_t alen = strlen (ap->posix_path);
- size_t blen = strlen (bp->posix_path);
-
- int res = blen - alen;
-
- if (res)
- return res; /* Path lengths differed */
-
- /* The two paths were the same length, so just determine normal
- lexical sorted order. */
- res = strcmp (ap->posix_path, bp->posix_path);
-
- if (res == 0)
- {
- /* need to select between user and system mount to same POSIX path */
- if (!(bp->flags & MOUNT_SYSTEM)) /* user mount */
- return 1;
- else
- return -1;
- }
-
- return res;
-}
-
-/* sort_by_native_name: qsort callback to sort the mount entries. Sort
- user mounts ahead of system mounts to the same POSIX path. */
-/* FIXME: should the user should be able to choose whether to
- prefer user or system mounts??? */
-static int
-sort_by_native_name (const void *a, const void *b)
-{
- mount_item *ap = mounts_for_sort + (*((int*) a));
- mount_item *bp = mounts_for_sort + (*((int*) b));
-
- /* Base weighting on longest win32 path first so that the most
- obvious path will be chosen. */
- size_t alen = strlen (ap->native_path);
- size_t blen = strlen (bp->native_path);
-
- int res = blen - alen;
-
- if (res)
- return res; /* Path lengths differed */
-
- /* The two paths were the same length, so just determine normal
- lexical sorted order. */
- res = strcmp (ap->native_path, bp->native_path);
-
- if (res == 0)
- {
- /* need to select between user and system mount to same POSIX path */
- if (!(bp->flags & MOUNT_SYSTEM)) /* user mount */
- return 1;
- else
- return -1;
- }
-
- return res;
-}
-
-void
-mount_info::sort ()
-{
- for (int i = 0; i < nmounts; i++)
- native_sorted[i] = posix_sorted[i] = i;
- /* Sort them into reverse length order, otherwise we won't
- be able to look for /foo in /. */
- mounts_for_sort = mount; /* ouch. */
- qsort (posix_sorted, nmounts, sizeof (posix_sorted[0]), sort_by_posix_name);
- qsort (native_sorted, nmounts, sizeof (native_sorted[0]), sort_by_native_name);
-}
-
-/* Add an entry to the mount table.
- Returns 0 on success, -1 on failure and errno is set.
-
- This is where all argument validation is done. It may not make sense to
- do this when called internally, but it's cleaner to keep it all here. */
-
-int
-mount_info::add_item (const char *native, const char *posix,
- unsigned mountflags)
-{
- tmp_pathbuf tp;
- char *nativetmp = tp.c_get ();
- /* FIXME: The POSIX path is stored as value name right now, which is
- restricted to 256 bytes. */
- char posixtmp[CYG_MAX_PATH];
- char *nativetail, *posixtail, error[] = "error";
- int nativeerr, posixerr;
-
- /* Something's wrong if either path is NULL or empty, or if it's
- not a UNC or absolute path. */
-
- if (native == NULL || !isabspath (native) ||
- !(is_native_path (native) || is_unc_share (native) || isdrive (native)))
- nativeerr = EINVAL;
- else
- nativeerr = normalize_win32_path (native, nativetmp, nativetail);
-
- if (posix == NULL || !isabspath (posix) ||
- is_unc_share (posix) || isdrive (posix))
- posixerr = EINVAL;
- else
- posixerr = normalize_posix_path (posix, posixtmp, posixtail);
-
- debug_printf ("%s[%s], %s[%s], %p",
- native, nativeerr ? error : nativetmp,
- posix, posixerr ? error : posixtmp, mountflags);
-
- if (nativeerr || posixerr)
- {
- set_errno (nativeerr?:posixerr);
- return -1;
- }
-
- /* Make sure both paths do not end in /. */
- if (nativetail > nativetmp + 1 && nativetail[-1] == '\\')
- nativetail[-1] = '\0';
- if (posixtail > posixtmp + 1 && posixtail[-1] == '/')
- posixtail[-1] = '\0';
-
- /* Write over an existing mount item with the same POSIX path if
- it exists and is from the same registry area. */
- int i;
- for (i = 0; i < nmounts; i++)
- {
- if (!strcmp (mount[i].posix_path, posixtmp))
- {
- /* Don't allow to override a system mount with a user mount. */
- if ((mount[i].flags & MOUNT_SYSTEM) && !(mountflags & MOUNT_SYSTEM))
- {
- set_errno (EPERM);
- return -1;
- }
- if ((mount[i].flags & MOUNT_SYSTEM) == (mountflags & MOUNT_SYSTEM))
- break;
- }
- }
-
- if (i == nmounts && nmounts == MAX_MOUNTS)
- {
- set_errno (EMFILE);
- return -1;
- }
-
- if (i == nmounts)
- nmounts++;
- mount[i].init (nativetmp, posixtmp, mountflags);
- sort ();
-
- return 0;
-}
-
-/* Delete a mount table entry where path is either a Win32 or POSIX
- path. Since the mount table is really just a table of aliases,
- deleting / is ok (although running without a slash mount is
- strongly discouraged because some programs may run erratically
- without one). If MOUNT_SYSTEM is set in flags, remove from system
- registry, otherwise remove the user registry mount.
-*/
-
-int
-mount_info::del_item (const char *path, unsigned flags)
-{
- tmp_pathbuf tp;
- char *pathtmp = tp.c_get ();
- int posix_path_p = false;
-
- /* Something's wrong if path is NULL or empty. */
- if (path == NULL || *path == 0 || !isabspath (path))
- {
- set_errno (EINVAL);
- return -1;
- }
-
- if (is_unc_share (path) || strpbrk (path, ":\\"))
- backslashify (path, pathtmp, 0);
- else
- {
- slashify (path, pathtmp, 0);
- posix_path_p = true;
- }
- nofinalslash (pathtmp, pathtmp);
-
- for (int i = 0; i < nmounts; i++)
- {
- int ent = native_sorted[i]; /* in the same order as getmntent() */
- if (((posix_path_p)
- ? !strcmp (mount[ent].posix_path, pathtmp)
- : strcasematch (mount[ent].native_path, pathtmp)))
- {
- /* Don't allow to remove a system mount. */
- if ((mount[ent].flags & MOUNT_SYSTEM))
- {
- set_errno (EPERM);
- return -1;
- }
- nmounts--; /* One less mount table entry */
- /* Fill in the hole if not at the end of the table */
- if (ent < nmounts)
- memmove (mount + ent, mount + ent + 1,
- sizeof (mount[ent]) * (nmounts - ent));
- sort (); /* Resort the table */
- return 0;
- }
- }
- set_errno (EINVAL);
- return -1;
-}
-
-/************************* mount_item class ****************************/
-
-static mntent *
-fillout_mntent (const char *native_path, const char *posix_path, unsigned flags)
-{
- struct mntent& ret=_my_tls.locals.mntbuf;
- bool append_bs = false;
-
- /* Remove drivenum from list if we see a x: style path */
- if (strlen (native_path) == 2 && native_path[1] == ':')
- {
- int drivenum = cyg_tolower (native_path[0]) - 'a';
- if (drivenum >= 0 && drivenum <= 31)
- _my_tls.locals.available_drives &= ~(1 << drivenum);
- append_bs = true;
- }
-
- /* Pass back pointers to mount_table strings reserved for use by
- getmntent rather than pointers to strings in the internal mount
- table because the mount table might change, causing weird effects
- from the getmntent user's point of view. */
-
- strcpy (_my_tls.locals.mnt_fsname, native_path);
- ret.mnt_fsname = _my_tls.locals.mnt_fsname;
- strcpy (_my_tls.locals.mnt_dir, posix_path);
- ret.mnt_dir = _my_tls.locals.mnt_dir;
-
- /* Try to give a filesystem type that matches what a Linux application might
- expect. Naturally, this is a moving target, but we can make some
- reasonable guesses for popular types. */
-
- fs_info mntinfo;
- tmp_pathbuf tp;
- UNICODE_STRING unat;
- tp.u_get (&unat);
- get_nt_native_path (native_path, unat);
- if (append_bs)
- RtlAppendUnicodeToString (&unat, L"\\");
- mntinfo.update (&unat, NULL);
-
- if (mntinfo.is_samba())
- strcpy (_my_tls.locals.mnt_type, (char *) "smbfs");
- else if (mntinfo.is_nfs ())
- strcpy (_my_tls.locals.mnt_type, (char *) "nfs");
- else if (mntinfo.is_fat ())
- strcpy (_my_tls.locals.mnt_type, (char *) "vfat");
- else if (mntinfo.is_ntfs ())
- strcpy (_my_tls.locals.mnt_type, (char *) "ntfs");
- else if (mntinfo.is_netapp ())
- strcpy (_my_tls.locals.mnt_type, (char *) "netapp");
- else if (mntinfo.is_cdrom ())
- strcpy (_my_tls.locals.mnt_type, (char *) "iso9660");
- else
- strcpy (_my_tls.locals.mnt_type, (char *) "unknown");
-
- ret.mnt_type = _my_tls.locals.mnt_type;
-
- /* mnt_opts is a string that details mount params such as
- binary or textmode, or exec. We don't print
- `silent' here; it's a magic internal thing. */
-
- if (!(flags & MOUNT_BINARY))
- strcpy (_my_tls.locals.mnt_opts, (char *) "textmode");
- else
- strcpy (_my_tls.locals.mnt_opts, (char *) "binmode");
-
- if (flags & MOUNT_CYGWIN_EXEC)
- strcat (_my_tls.locals.mnt_opts, (char *) ",cygexec");
- else if (flags & MOUNT_EXEC)
- strcat (_my_tls.locals.mnt_opts, (char *) ",exec");
- else if (flags & MOUNT_NOTEXEC)
- strcat (_my_tls.locals.mnt_opts, (char *) ",noexec");
-
- if (flags & MOUNT_NOACL)
- strcat (_my_tls.locals.mnt_opts, (char *) ",noacl");
-
- if (flags & MOUNT_NOPOSIX)
- strcat (_my_tls.locals.mnt_opts, (char *) ",posix=0");
-
- if ((flags & MOUNT_CYGDRIVE)) /* cygdrive */
- strcat (_my_tls.locals.mnt_opts, (char *) ",noumount");
-
- if (!(flags & MOUNT_SYSTEM)) /* user mount */
- strcat (_my_tls.locals.mnt_opts, (char *) ",user");
- else /* system mount */
- strcat (_my_tls.locals.mnt_opts, (char *) ",system");
-
- ret.mnt_opts = _my_tls.locals.mnt_opts;
-
- ret.mnt_freq = 1;
- ret.mnt_passno = 1;
- return &ret;
-}
-
-struct mntent *
-mount_item::getmntent ()
-{
- return fillout_mntent (native_path, posix_path, flags);
-}
-
-static struct mntent *
-cygdrive_getmntent ()
-{
- char native_path[4];
- char posix_path[CYG_MAX_PATH];
- DWORD mask = 1, drive = 'a';
- struct mntent *ret = NULL;
-
- while (_my_tls.locals.available_drives)
- {
- for (/* nothing */; drive <= 'z'; mask <<= 1, drive++)
- if (_my_tls.locals.available_drives & mask)
- break;
-
- __small_sprintf (native_path, "%c:\\", drive);
- if (GetFileAttributes (native_path) == INVALID_FILE_ATTRIBUTES)
- {
- _my_tls.locals.available_drives &= ~mask;
- continue;
- }
- native_path[2] = '\0';
- __small_sprintf (posix_path, "%s%c", mount_table->cygdrive, drive);
- ret = fillout_mntent (native_path, posix_path, mount_table->cygdrive_flags);
- break;
- }
-
- return ret;
-}
-
-struct mntent *
-mount_info::getmntent (int x)
-{
- if (x < 0 || x >= nmounts)
- return cygdrive_getmntent ();
-
- return mount[native_sorted[x]].getmntent ();
-}
-
-/* Fill in the fields of a mount table entry. */
-
-void
-mount_item::init (const char *native, const char *posix, unsigned mountflags)
-{
- strcpy ((char *) native_path, native);
- strcpy ((char *) posix_path, posix);
-
- native_pathlen = strlen (native_path);
- posix_pathlen = strlen (posix_path);
-
- flags = mountflags;
-}
-
-/********************** Mount System Calls **************************/
-
-/* Mount table system calls.
- Note that these are exported to the application. */
-
-/* mount: Add a mount to the mount table in memory and to the registry
- that will cause paths under win32_path to be translated to paths
- under posix_path. */
-
-extern "C" int
-mount (const char *win32_path, const char *posix_path, unsigned flags)
-{
- int res = -1;
- flags &= ~MOUNT_SYSTEM;
-
- myfault efault;
- if (efault.faulted (EFAULT))
- /* errno set */;
- else if (!*posix_path)
- set_errno (EINVAL);
- else if (strpbrk (posix_path, "\\:"))
- set_errno (EINVAL);
- else if (flags & MOUNT_CYGDRIVE) /* normal mount */
- {
- /* When flags include MOUNT_CYGDRIVE, take this to mean that
- we actually want to change the cygdrive prefix and flags
- without actually mounting anything. */
- res = mount_table->write_cygdrive_info (posix_path, flags);
- win32_path = NULL;
- }
- else if (!*win32_path)
- set_errno (EINVAL);
- else
- res = mount_table->add_item (win32_path, posix_path, flags);
-
- syscall_printf ("%d = mount (%s, %s, %p)", res, win32_path, posix_path, flags);
- return res;
-}
-
-/* umount: The standard umount call only has a path parameter. Since
- it is not possible for this call to specify whether to remove the
- mount from the user or global mount registry table, assume the user
- table. */
-
-extern "C" int
-umount (const char *path)
-{
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- if (!*path)
- {
- set_errno (EINVAL);
- return -1;
- }
- return cygwin_umount (path, 0);
-}
-
-/* cygwin_umount: This is like umount but takes an additional flags
- parameter that specifies whether to umount from the user or system-wide
- registry area. */
-
-extern "C" int
-cygwin_umount (const char *path, unsigned flags)
-{
- int res = -1;
-
- if (!(flags & MOUNT_CYGDRIVE))
- res = mount_table->del_item (path, flags & ~MOUNT_SYSTEM);
-
- syscall_printf ("%d = cygwin_umount (%s, %d)", res, path, flags);
- return res;
-}
-
-bool
-is_floppy (const char *dos)
-{
- char dev[256];
- if (!QueryDosDevice (dos, dev, 256))
- return false;
- return ascii_strncasematch (dev, "\\Device\\Floppy", 14);
-}
-
-extern "C" FILE *
-setmntent (const char *filep, const char *)
-{
- _my_tls.locals.iteration = 0;
- _my_tls.locals.available_drives = GetLogicalDrives ();
- /* Filter floppy drives on A: and B: */
- if ((_my_tls.locals.available_drives & 1) && is_floppy ("A:"))
- _my_tls.locals.available_drives &= ~1;
- if ((_my_tls.locals.available_drives & 2) && is_floppy ("B:"))
- _my_tls.locals.available_drives &= ~2;
- return (FILE *) filep;
-}
-
-extern "C" struct mntent *
-getmntent (FILE *)
-{
- return mount_table->getmntent (_my_tls.locals.iteration++);
-}
-
-extern "C" int
-endmntent (FILE *)
-{
- return 1;
-}
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
deleted file mode 100644
index 64d8759b681..00000000000
--- a/winsup/cygwin/path.cc
+++ /dev/null
@@ -1,3627 +0,0 @@
- /* path.cc: path support.
-
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008 Red Hat, Inc.
-
- This file is part of Cygwin.
-
- This software is a copyrighted work licensed under the terms of the
- Cygwin license. Please consult the file "CYGWIN_LICENSE" for
- details. */
-
- /* This module's job is to
- - convert between POSIX and Win32 style filenames,
- - support the `mount' functionality,
- - support symlinks for files and directories
-
- Pathnames are handled as follows:
-
- - A \ or : in a path denotes a pure windows spec.
- - Paths beginning with // (or \\) are not translated (i.e. looked
- up in the mount table) and are assumed to be UNC path names.
-
- The goal in the above set of rules is to allow both POSIX and Win32
- flavors of pathnames without either interfering. The rules are
- intended to be as close to a superset of both as possible.
-
- Note that you can have more than one path to a file. The mount
- table is always prefered when translating Win32 paths to POSIX
- paths. Win32 paths in mount table entries may be UNC paths or
- standard Win32 paths starting with <drive-letter>:
-
- Text vs Binary issues are not considered here in path style
- decisions, although the appropriate flags are retrieved and
- stored in various structures.
-
- Removing mounted filesystem support would simplify things greatly,
- but having it gives us a mechanism of treating disk that lives on a
- UNIX machine as having UNIX semantics [it allows one to edit a text
- file on that disk and not have cr's magically appear and perhaps
- break apps running on UNIX boxes]. It also useful to be able to
- layout a hierarchy without changing the underlying directories.
-
- The semantics of mounting file systems is not intended to precisely
- follow normal UNIX systems.
-
- Each DOS drive is defined to have a current directory. Supporting
- this would complicate things so for now things are defined so that
- c: means c:\.
- */
-
-#include "winsup.h"
-#include "miscfuncs.h"
-#include <ctype.h>
-#include <winioctl.h>
-#include <wingdi.h>
-#include <winuser.h>
-#include <winnetwk.h>
-#include <shlobj.h>
-#include <sys/cygwin.h>
-#include "cygerrno.h"
-#include "security.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "cygheap.h"
-#include "shared_info.h"
-#include "cygtls.h"
-#include "tls_pbuf.h"
-#include "environ.h"
-#include "nfs.h"
-#include <assert.h>
-#include <ntdll.h>
-#include <wchar.h>
-#include <wctype.h>
-
-bool dos_file_warning = true;
-
-struct symlink_info
-{
- char contents[SYMLINK_MAX + 1];
- char *ext_here;
- int extn;
- unsigned pflags;
- DWORD fileattr;
- int issymlink;
- bool ext_tacked_on;
- int error;
- bool isdevice;
- _major_t major;
- _minor_t minor;
- _mode_t mode;
- int check (char *path, const suffix_info *suffixes, unsigned opt,
- fs_info &fs);
- int set (char *path);
- bool parse_device (const char *);
- int check_sysfile (HANDLE h);
- int check_shortcut (HANDLE h);
- int check_reparse_point (HANDLE h);
- int check_nfs_symlink (HANDLE h);
- int posixify (char *srcbuf);
- bool set_error (int);
-};
-
-muto NO_COPY cwdstuff::cwd_lock;
-
-static const GUID GUID_shortcut
- = { 0x00021401L, 0, 0, 0xc0, 0, 0, 0, 0, 0, 0, 0x46 };
-
-enum {
- WSH_FLAG_IDLIST = 0x01, /* Contains an ITEMIDLIST. */
- WSH_FLAG_FILE = 0x02, /* Contains a file locator element. */
- WSH_FLAG_DESC = 0x04, /* Contains a description. */
- WSH_FLAG_RELPATH = 0x08, /* Contains a relative path. */
- WSH_FLAG_WD = 0x10, /* Contains a working dir. */
- WSH_FLAG_CMDLINE = 0x20, /* Contains command line args. */
- WSH_FLAG_ICON = 0x40 /* Contains a custom icon. */
-};
-
-struct win_shortcut_hdr
- {
- DWORD size; /* Header size in bytes. Must contain 0x4c. */
- GUID magic; /* GUID of shortcut files. */
- DWORD flags; /* Content flags. See above. */
-
- /* The next fields from attr to icon_no are always set to 0 in Cygwin
- and U/Win shortcuts. */
- DWORD attr; /* Target file attributes. */
- FILETIME ctime; /* These filetime items are never touched by the */
- FILETIME mtime; /* system, apparently. Values don't matter. */
- FILETIME atime;
- DWORD filesize; /* Target filesize. */
- DWORD icon_no; /* Icon number. */
-
- DWORD run; /* Values defined in winuser.h. Use SW_NORMAL. */
- DWORD hotkey; /* Hotkey value. Set to 0. */
- DWORD dummy[2]; /* Future extension probably. Always 0. */
- };
-
-/* Return non-zero if PATH1 is a prefix of PATH2.
- Both are assumed to be of the same path style and / vs \ usage.
- Neither may be "".
- LEN1 = strlen (PATH1). It's passed because often it's already known.
-
- Examples:
- /foo/ is a prefix of /foo <-- may seem odd, but desired
- /foo is a prefix of /foo/
- / is a prefix of /foo/bar
- / is not a prefix of foo/bar
- foo/ is a prefix foo/bar
- /foo is not a prefix of /foobar
-*/
-
-int
-path_prefix_p (const char *path1, const char *path2, int len1,
- bool caseinsensitive)
-{
- /* Handle case where PATH1 has trailing '/' and when it doesn't. */
- if (len1 > 0 && isdirsep (path1[len1 - 1]))
- len1--;
-
- if (len1 == 0)
- return isdirsep (path2[0]) && !isdirsep (path2[1]);
-
- if (isdirsep (path2[len1]) || path2[len1] == 0 || path1[len1 - 1] == ':')
- return caseinsensitive ? strncasematch (path1, path2, len1)
- : !strncmp (path1, path2, len1);
-
- return 0;
-}
-
-/* Return non-zero if paths match in first len chars.
- Check is dependent of the case sensitivity setting. */
-int
-pathnmatch (const char *path1, const char *path2, int len, bool caseinsensitive)
-{
- return caseinsensitive
- ? strncasematch (path1, path2, len) : !strncmp (path1, path2, len);
-}
-
-/* Return non-zero if paths match. Check is dependent of the case
- sensitivity setting. */
-int
-pathmatch (const char *path1, const char *path2, bool caseinsensitive)
-{
- return caseinsensitive
- ? strcasematch (path1, path2) : !strcmp (path1, path2);
-}
-
-/* TODO: This function is used in mkdir and rmdir to generate correct
- error messages in case of paths ending in /. or /.. components.
- Right now, normalize_posix_path will just normalize
- those components away, which changes the semantics. */
-bool
-has_dot_last_component (const char *dir, bool test_dot_dot)
-{
- /* SUSv3: . and .. are not allowed as last components in various system
- calls. Don't test for backslash path separator since that's a Win32
- path following Win32 rules. */
- const char *last_comp = strrchr (dir, '/');
- if (!last_comp)
- last_comp = dir;
- else {
- /* Check for trailing slash. If so, hop back to the previous slash. */
- if (!last_comp[1])
- while (last_comp > dir)
- if (*--last_comp == '/')
- break;
- if (*last_comp == '/')
- ++last_comp;
- }
- return last_comp[0] == '.'
- && ((last_comp[1] == '\0' || last_comp[1] == '/')
- || (test_dot_dot
- && last_comp[1] == '.'
- && (last_comp[2] == '\0' || last_comp[2] == '/')));
-}
-
-/* Normalize a POSIX path.
- All duplicate /'s, except for 2 leading /'s, are deleted.
- The result is 0 for success, or an errno error value. */
-
-int
-normalize_posix_path (const char *src, char *dst, char *&tail)
-{
- const char *in_src = src;
- char *dst_start = dst;
- syscall_printf ("src %s", src);
-
- if ((isdrive (src) && isdirsep (src[2])) || *src == '\\')
- goto win32_path;
-
- tail = dst;
- if (!isslash (src[0]))
- {
- if (!cygheap->cwd.get (dst))
- return get_errno ();
- tail = strchr (tail, '\0');
- if (isslash (dst[0]) && isslash (dst[1]))
- ++dst_start;
- if (*src == '.')
- {
- if (tail == dst_start + 1 && *dst_start == '/')
- tail--;
- goto sawdot;
- }
- if (tail > dst && !isslash (tail[-1]))
- *tail++ = '/';
- }
- /* Two leading /'s? If so, preserve them. */
- else if (isslash (src[1]) && !isslash (src[2]))
- {
- *tail++ = *src++;
- ++dst_start;
- }
-
- while (*src)
- {
- if (*src == '\\')
- goto win32_path;
- /* Strip runs of /'s. */
- if (!isslash (*src))
- *tail++ = *src++;
- else
- {
- while (*++src)
- {
- if (isslash (*src))
- continue;
-
- if (*src != '.')
- break;
-
- sawdot:
- if (src[1] != '.')
- {
- if (!src[1])
- {
- *tail++ = '/';
- goto done;
- }
- if (!isslash (src[1]))
- break;
- }
- else if (src[2] && !isslash (src[2]))
- break;
- else
- {
- while (tail > dst_start && !isslash (*--tail))
- continue;
- src++;
- }
- }
-
- *tail++ = '/';
- }
- if ((tail - dst) >= NT_MAX_PATH)
- {
- debug_printf ("ENAMETOOLONG = normalize_posix_path (%s)", src);
- return ENAMETOOLONG;
- }
- }
-
-done:
- *tail = '\0';
-
- debug_printf ("%s = normalize_posix_path (%s)", dst, in_src);
- return 0;
-
-win32_path:
- int err = normalize_win32_path (in_src, dst, tail);
- if (!err)
- for (char *p = dst; (p = strchr (p, '\\')); p++)
- *p = '/';
- return err ?: -1;
-}
-
-inline void
-path_conv::add_ext_from_sym (symlink_info &sym)
-{
- if (sym.ext_here && *sym.ext_here)
- {
- known_suffix = path + sym.extn;
- if (sym.ext_tacked_on)
- strcpy (known_suffix, sym.ext_here);
- }
-}
-
-static void __stdcall mkrelpath (char *dst, bool caseinsensitive) __attribute__ ((regparm (2)));
-static void __stdcall
-mkrelpath (char *path, bool caseinsensitive)
-{
- tmp_pathbuf tp;
- char *cwd_win32 = tp.c_get ();
- if (!cygheap->cwd.get (cwd_win32, 0))
- return;
-
- unsigned cwdlen = strlen (cwd_win32);
- if (!path_prefix_p (cwd_win32, path, cwdlen, caseinsensitive))
- return;
-
- size_t n = strlen (path);
- if (n < cwdlen)
- return;
-
- char *tail = path;
- if (n == cwdlen)
- tail += cwdlen;
- else
- tail += isdirsep (cwd_win32[cwdlen - 1]) ? cwdlen : cwdlen + 1;
-
- memmove (path, tail, strlen (tail) + 1);
- if (!*path)
- strcpy (path, ".");
-}
-
-/* Beginning with Samba 3.0.28a, Samba allows to get version information using
- the ExtendedInfo member returned by a FileFsObjectIdInformation request.
- We just store the samba_version information for now. Older versions than
- 3.2 are still guessed at by testing the file system flags. */
-#define SAMBA_EXTENDED_INFO_MAGIC 0x536d4261 /* "SmBa" */
-#define SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH 28
-#pragma pack(push,4)
-struct smb_extended_info {
- DWORD samba_magic; /* Always SAMBA_EXTENDED_INFO_MAGIC */
- DWORD samba_version; /* Major/Minor/Release/Revision */
- DWORD samba_subversion; /* Prerelease/RC/Vendor patch */
- LARGE_INTEGER samba_gitcommitdate;
- char samba_version_string[SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH];
-};
-#pragma pack(pop)
-
-bool
-fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
-{
- NTSTATUS status = STATUS_OBJECT_NAME_NOT_FOUND;
- HANDLE vol;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- bool no_media = false;
- FILE_FS_DEVICE_INFORMATION ffdi;
- FILE_FS_OBJECTID_INFORMATION ffoi;
- struct {
- FILE_FS_ATTRIBUTE_INFORMATION ffai;
- WCHAR buf[NAME_MAX + 1];
- } ffai_buf;
- struct {
- FILE_FS_VOLUME_INFORMATION ffvi;
- WCHAR buf[NAME_MAX + 1];
- } ffvi_buf;
- UNICODE_STRING fsname, testname;
-
- clear ();
- if (in_vol)
- vol = in_vol;
- else
- {
- /* Always caseinsensitive. We really just need access to the drive. */
- InitializeObjectAttributes (&attr, upath, OBJ_CASE_INSENSITIVE, NULL,
- NULL);
- status = NtOpenFile (&vol, READ_CONTROL, &attr, &io,
- FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT);
- while (!NT_SUCCESS (status)
- && (attr.ObjectName->Length > 7 * sizeof (WCHAR)
- || status == STATUS_NO_MEDIA_IN_DEVICE))
- {
- UNICODE_STRING dir;
- RtlSplitUnicodePath (attr.ObjectName, &dir, NULL);
- attr.ObjectName = &dir;
- if (status == STATUS_NO_MEDIA_IN_DEVICE)
- {
- no_media = true;
- dir.Length = 6 * sizeof (WCHAR);
- }
- else if (dir.Length > 7 * sizeof (WCHAR))
- dir.Length -= sizeof (WCHAR);
- status = NtOpenFile (&vol, READ_CONTROL, &attr, &io,
- FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT);
- }
- if (!NT_SUCCESS (status))
- {
- debug_printf ("Cannot access path %S, status %08lx",
- attr.ObjectName, status);
- NtClose (vol);
- return false;
- }
- }
-
- status = NtQueryVolumeInformationFile (vol, &io, &ffvi_buf.ffvi,
- sizeof ffvi_buf,
- FileFsVolumeInformation);
- sernum = NT_SUCCESS (status) ? ffvi_buf.ffvi.VolumeSerialNumber : 0;
- status = NtQueryVolumeInformationFile (vol, &io, &ffdi, sizeof ffdi,
- FileFsDeviceInformation);
- if (!NT_SUCCESS (status))
- ffdi.DeviceType = ffdi.Characteristics = 0;
-
- if (ffdi.Characteristics & FILE_REMOTE_DEVICE
- || (!ffdi.DeviceType
- && RtlEqualUnicodePathPrefix (attr.ObjectName, L"\\??\\UNC\\", TRUE)))
- is_remote_drive (true);
- else
- is_remote_drive (false);
-
- if (!no_media)
- status = NtQueryVolumeInformationFile (vol, &io, &ffai_buf.ffai,
- sizeof ffai_buf,
- FileFsAttributeInformation);
- if (no_media || !NT_SUCCESS (status))
- {
- debug_printf ("Cannot get volume attributes (%S), %08lx",
- attr.ObjectName, status);
- if (!in_vol)
- NtClose (vol);
- return false;
- }
- flags (ffai_buf.ffai.FileSystemAttributes);
- name_len (ffai_buf.ffai.MaximumComponentNameLength);
-/* Should be reevaluated for each new OS. Right now this mask is valid up
- to Vista. The important point here is to test only flags indicating
- capabilities and to ignore flags indicating a specific state of this
- volume. At present these flags to ignore are FILE_VOLUME_IS_COMPRESSED
- and FILE_READ_ONLY_VOLUME. */
-#define GETVOLINFO_VALID_MASK (0x003701ffUL)
-#define TEST_GVI(f,m) (((f) & GETVOLINFO_VALID_MASK) == (m))
-
-/* Volume quotas are potentially supported since Samba 3.0, object ids and
- the unicode on disk flag since Samba 3.2. */
-#define SAMBA_IGNORE (FILE_VOLUME_QUOTAS \
- | FILE_SUPPORTS_OBJECT_IDS \
- | FILE_UNICODE_ON_DISK)
-#define FS_IS_SAMBA TEST_GVI(flags () & ~SAMBA_IGNORE, \
- FILE_CASE_SENSITIVE_SEARCH \
- | FILE_CASE_PRESERVED_NAMES \
- | FILE_PERSISTENT_ACLS)
-#define FS_IS_NETAPP_DATAONTAP TEST_GVI(flags (), \
- FILE_CASE_SENSITIVE_SEARCH \
- | FILE_CASE_PRESERVED_NAMES \
- | FILE_UNICODE_ON_DISK \
- | FILE_PERSISTENT_ACLS \
- | FILE_NAMED_STREAMS)
- RtlInitCountedUnicodeString (&fsname, ffai_buf.ffai.FileSystemName,
- ffai_buf.ffai.FileSystemNameLength);
- is_fat (RtlEqualUnicodePathPrefix (&fsname, L"FAT", TRUE));
- RtlInitUnicodeString (&testname, L"NTFS");
- if (is_remote_drive ())
- {
- /* This always fails on NT4. */
- status = NtQueryVolumeInformationFile (vol, &io, &ffoi, sizeof ffoi,
- FileFsObjectIdInformation);
- if (NT_SUCCESS (status))
- {
- smb_extended_info *extended_info = (smb_extended_info *)
- &ffoi.ExtendedInfo;
- if (extended_info->samba_magic == SAMBA_EXTENDED_INFO_MAGIC)
- {
- is_samba (true);
- samba_version (extended_info->samba_version);
- }
- }
- /* Test for Samba on NT4 or for older Samba releases not supporting
- extended info. */
- if (!is_samba ())
- is_samba (RtlEqualUnicodeString (&fsname, &testname, FALSE)
- && FS_IS_SAMBA);
-
- if (!is_samba ())
- {
- is_netapp (RtlEqualUnicodeString (&fsname, &testname, FALSE)
- && FS_IS_NETAPP_DATAONTAP);
-
- RtlInitUnicodeString (&testname, L"NFS");
- is_nfs (RtlEqualUnicodeString (&fsname, &testname, FALSE));
-
- if (!is_nfs ())
- {
- /* Known remote file systems which can't handle calls to
- NtQueryDirectoryFile(FileIdBothDirectoryInformation) */
- RtlInitUnicodeString (&testname, L"UNIXFS");
- has_buggy_fileid_dirinfo (RtlEqualUnicodeString (&fsname,
- &testname,
- FALSE));
-
- /* Known remote file systems with buggy open calls. Further
- explanation in fhandler.cc (fhandler_disk_file::open). */
- RtlInitUnicodeString (&testname, L"SUNWNFS");
- has_buggy_open (RtlEqualUnicodeString (&fsname, &testname,
- FALSE));
- }
- }
- }
- is_ntfs (RtlEqualUnicodeString (&fsname, &testname, FALSE)
- && !is_samba () && !is_netapp ());
- is_cdrom (ffdi.DeviceType == FILE_DEVICE_CD_ROM);
-
- has_acls (flags () & FS_PERSISTENT_ACLS);
- hasgood_inode (((flags () & FILE_PERSISTENT_ACLS) && !is_netapp ())
- || is_nfs ());
- /* Case sensitivity is supported if FILE_CASE_SENSITIVE_SEARCH is set,
- except on Samba which handles Windows clients case insensitive.
- NFS doesn't set the FILE_CASE_SENSITIVE_SEARCH flag but is case
- sensitive. */
- caseinsensitive ((!(flags () & FILE_CASE_SENSITIVE_SEARCH) || is_samba ())
- && !is_nfs ());
-
- if (!in_vol)
- NtClose (vol);
- return true;
-}
-
-void
-path_conv::fillin (HANDLE h)
-{
- IO_STATUS_BLOCK io;
- FILE_BASIC_INFORMATION fbi;
-
- if (NT_SUCCESS (NtQueryInformationFile (h, &io, &fbi, sizeof fbi,
- FileBasicInformation)))
- fileattr = fbi.FileAttributes;
- else
- fileattr = INVALID_FILE_ATTRIBUTES;
-}
-
-void
-path_conv::set_normalized_path (const char *path_copy)
-{
- char *p = strchr (path_copy, '\0');
- size_t n = 1 + p - path_copy;
-
- normalized_path = path + sizeof (path) - n;
-
- char *eopath = strchr (path, '\0');
- if (normalized_path > eopath)
- normalized_path_size = n;
- else
- {
- normalized_path = (char *) cmalloc_abort (HEAP_STR, n);
- normalized_path_size = 0;
- }
-
- memcpy (normalized_path, path_copy, n);
-}
-
-WCHAR tfx_chars[] NO_COPY = {
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 32, '!', 0xf000 | '"', '#', '$', '%', '&', 39,
- '(', ')', 0xf000 | '*', '+', ',', '-', '.', '\\',
- '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 0xf000 | ':', ';', 0xf000 | '<', '=', 0xf000 | '>', 0xf000 | '?',
- '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
- 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
- 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
- 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
- '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
- 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
- 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
- 'x', 'y', 'z', '{', 0xf000 | '|', '}', '~', 127
-};
-
-void
-transform_chars (PWCHAR path, PWCHAR path_end)
-{
- for (; path <= path_end; ++path)
- if (*path < 128)
- *path = tfx_chars[*path];
-}
-
-static inline
-void
-transform_chars (PUNICODE_STRING upath, USHORT start_idx)
-{
- transform_chars (upath->Buffer + start_idx,
- upath->Buffer + upath->Length / sizeof (WCHAR) - 1);
-}
-
-PUNICODE_STRING
-get_nt_native_path (const char *path, UNICODE_STRING& upath)
-{
- upath.Length = 0;
- if (path[0] == '/') /* special path w/o NT path representation. */
- str2uni_cat (upath, path);
- else if (path[0] != '\\') /* X:\... or relative path. */
- {
- if (path[1] == ':') /* X:\... */
- {
- str2uni_cat (upath, "\\??\\");
- str2uni_cat (upath, path);
- /* The drive letter must be upper case. */
- upath.Buffer[4] = towupper (upath.Buffer[4]);
- }
- else
- str2uni_cat (upath, path);
- transform_chars (&upath, 7);
- }
- else if (path[1] != '\\') /* \Device\... */
- str2uni_cat (upath, path);
- else if ((path[2] != '.' && path[2] != '?')
- || path[3] != '\\') /* \\server\share\... */
- {
- str2uni_cat (upath, "\\??\\UNC\\");
- str2uni_cat (upath, path + 2);
- transform_chars (&upath, 8);
- }
- else /* \\.\device or \\?\foo */
- {
- str2uni_cat (upath, "\\??\\");
- str2uni_cat (upath, path + 4);
- }
- return &upath;
-}
-
-PUNICODE_STRING
-path_conv::get_nt_native_path ()
-{
- if (!wide_path)
- {
- uni_path.Length = 0;
- uni_path.MaximumLength = (strlen (path) + 10) * sizeof (WCHAR);
- wide_path = (PWCHAR) cmalloc_abort (HEAP_STR, uni_path.MaximumLength);
- uni_path.Buffer = wide_path;
- ::get_nt_native_path (path, uni_path);
- }
- return &uni_path;
-}
-
-POBJECT_ATTRIBUTES
-path_conv::get_object_attr (OBJECT_ATTRIBUTES &attr, SECURITY_ATTRIBUTES &sa)
-{
- if (!get_nt_native_path ())
- return NULL;
- InitializeObjectAttributes (&attr, &uni_path,
- objcaseinsensitive ()
- | (sa.bInheritHandle ? OBJ_INHERIT : 0),
- NULL, sa.lpSecurityDescriptor);
- return &attr;
-}
-
-PWCHAR
-path_conv::get_wide_win32_path (PWCHAR wc)
-{
- get_nt_native_path ();
- if (!wide_path || wide_path[1] != L'?') /* Native NT device path */
- return NULL;
- wcscpy (wc, wide_path);
- wc[1] = L'\\';
- return wc;
-}
-
-void
-warn_msdos (const char *src)
-{
- if (user_shared->warned_msdos || !dos_file_warning)
- return;
- tmp_pathbuf tp;
- char *posix_path = tp.c_get ();
- small_printf ("cygwin warning:\n");
- if (cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_RELATIVE, src,
- posix_path, NT_MAX_PATH))
- small_printf (" MS-DOS style path detected: %s\n POSIX equivalent preferred.\n",
- src);
- else
- small_printf (" MS-DOS style path detected: %s\n Preferred POSIX equivalent is: %s\n",
- src, posix_path);
- small_printf (" CYGWIN environment variable option \"nodosfilewarning\" turns off this warning.\n"
- " Consult the user's guide for more details about POSIX paths:\n"
- " http://cygwin.com/cygwin-ug-net/using.html#using-pathnames\n");
- user_shared->warned_msdos = true;
-}
-
-static DWORD
-getfileattr (const char *path, bool caseinsensitive) /* path has to be always absolute. */
-{
- tmp_pathbuf tp;
- UNICODE_STRING upath;
- OBJECT_ATTRIBUTES attr;
- FILE_BASIC_INFORMATION fbi;
- NTSTATUS status;
- IO_STATUS_BLOCK io;
-
- tp.u_get (&upath);
- InitializeObjectAttributes (&attr, &upath,
- caseinsensitive ? OBJ_CASE_INSENSITIVE : 0,
- NULL, NULL);
- get_nt_native_path (path, upath);
-
- status = NtQueryAttributesFile (&attr, &fbi);
- if (NT_SUCCESS (status))
- return fbi.FileAttributes;
-
- if (status != STATUS_OBJECT_NAME_NOT_FOUND
- && status != STATUS_NO_SUCH_FILE) /* File not found on 9x share */
- {
- /* File exists but access denied. Try to get attribute through
- directory query. */
- UNICODE_STRING dirname, basename;
- HANDLE dir;
- FILE_DIRECTORY_INFORMATION fdi;
-
- RtlSplitUnicodePath (&upath, &dirname, &basename);
- InitializeObjectAttributes (&attr, &dirname,
- caseinsensitive ? OBJ_CASE_INSENSITIVE : 0,
- NULL, NULL);
- status = NtOpenFile (&dir, SYNCHRONIZE | FILE_LIST_DIRECTORY,
- &attr, &io, FILE_SHARE_VALID_FLAGS,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT
- | FILE_DIRECTORY_FILE);
- if (NT_SUCCESS (status))
- {
- status = NtQueryDirectoryFile (dir, NULL, NULL, 0, &io,
- &fdi, sizeof fdi,
- FileDirectoryInformation,
- TRUE, &basename, TRUE);
- NtClose (dir);
- if (NT_SUCCESS (status) || status == STATUS_BUFFER_OVERFLOW)
- return fdi.FileAttributes;
- }
- }
- SetLastError (RtlNtStatusToDosError (status));
- return INVALID_FILE_ATTRIBUTES;
-}
-
-/* Convert an arbitrary path SRC to a pure Win32 path, suitable for
- passing to Win32 API routines.
-
- If an error occurs, `error' is set to the errno value.
- Otherwise it is set to 0.
-
- follow_mode values:
- SYMLINK_FOLLOW - convert to PATH symlink points to
- SYMLINK_NOFOLLOW - convert to PATH of symlink itself
- SYMLINK_IGNORE - do not check PATH for symlinks
- SYMLINK_CONTENTS - just return symlink contents
-*/
-
-/* TODO: This implementation is only preliminary. For internal
- purposes it's necessary to have a path_conv::check function which
- takes a UNICODE_STRING src path, otherwise we waste a lot of time
- for converting back and forth. The below implementation does
- realy nothing but converting to char *, until path_conv handles
- wide-char paths directly. */
-void
-path_conv::check (const UNICODE_STRING *src, unsigned opt,
- const suffix_info *suffixes)
-{
- tmp_pathbuf tp;
- char *path = tp.c_get ();
-
- user_shared->warned_msdos = true;
- sys_wcstombs (path, NT_MAX_PATH, src->Buffer, src->Length / sizeof (WCHAR));
- path_conv::check (path, opt, suffixes);
-}
-
-void
-path_conv::check (const char *src, unsigned opt,
- const suffix_info *suffixes)
-{
- /* The tmp_buf array is used when expanding symlinks. It is NT_MAX_PATH * 2
- in length so that we can hold the expanded symlink plus a trailer. */
- tmp_pathbuf tp;
- char *path_copy = tp.c_get ();
- char *pathbuf = tp.c_get ();
- char *tmp_buf = tp.t_get ();
- symlink_info sym;
- bool need_directory = 0;
- bool saw_symlinks = 0;
- bool is_relpath;
- char *tail, *path_end;
-
-#if 0
- static path_conv last_path_conv;
- static char last_src[CYG_MAX_PATH];
-
- if (*last_src && strcmp (last_src, src) == 0)
- {
- *this = last_path_conv;
- return;
- }
-#endif
-
- myfault efault;
- if (efault.faulted ())
- {
- error = EFAULT;
- return;
- }
- int loop = 0;
- path_flags = 0;
- known_suffix = NULL;
- fileattr = INVALID_FILE_ATTRIBUTES;
- caseinsensitive = OBJ_CASE_INSENSITIVE;
- if (wide_path)
- cfree (wide_path);
- wide_path = NULL;
- memset (&dev, 0, sizeof (dev));
- fs.clear ();
- if (!normalized_path_size && normalized_path)
- cfree (normalized_path);
- normalized_path = NULL;
- int component = 0; // Number of translated components
-
- if (!(opt & PC_NULLEMPTY))
- error = 0;
- else if (!*src)
- {
- error = ENOENT;
- return;
- }
-
- bool is_msdos = false;
- /* This loop handles symlink expansion. */
- for (;;)
- {
- MALLOC_CHECK;
- assert (src);
-
- is_relpath = !isabspath (src);
- error = normalize_posix_path (src, path_copy, tail);
- if (error > 0)
- return;
- if (error < 0)
- {
- if (component == 0)
- is_msdos = true;
- error = 0;
- }
-
- /* Detect if the user was looking for a directory. We have to strip the
- trailing slash initially while trying to add extensions but take it
- into account during processing */
- if (tail > path_copy + 2 && isslash (tail[-1]))
- {
- need_directory = 1;
- *--tail = '\0';
- }
- path_end = tail;
-
- /* Scan path_copy from right to left looking either for a symlink
- or an actual existing file. If an existing file is found, just
- return. If a symlink is found, exit the for loop.
- Also: be careful to preserve the errno returned from
- symlink.check as the caller may need it. */
- /* FIXME: Do we have to worry about multiple \'s here? */
- component = 0; // Number of translated components
- sym.contents[0] = '\0';
-
- int symlen = 0;
-
- for (unsigned pflags_or = opt & PC_NO_ACCESS_CHECK; ; pflags_or = 0)
- {
- const suffix_info *suff;
- char *full_path;
-
- /* Don't allow symlink.check to set anything in the path_conv
- class if we're working on an inner component of the path */
- if (component)
- {
- suff = NULL;
- sym.pflags = 0;
- full_path = pathbuf;
- }
- else
- {
- suff = suffixes;
- sym.pflags = path_flags;
- full_path = this->path;
- }
-
- /* Convert to native path spec sans symbolic link info. */
- error = mount_table->conv_to_win32_path (path_copy, full_path, dev,
- &sym.pflags);
-
- if (error)
- return;
-
- sym.pflags |= pflags_or;
-
- if (dev.major == DEV_CYGDRIVE_MAJOR)
- {
- if (!component)
- fileattr = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_READONLY;
- else
- {
- fileattr = getfileattr (this->path,
- sym.pflags & MOUNT_NOPOSIX);
- dev.devn = FH_FS;
- }
- goto out;
- }
- else if (dev == FH_DEV)
- {
- dev.devn = FH_FS;
-#if 0
- fileattr = getfileattr (this->path, sym.pflags & MOUNT_NOPOSIX);
- if (!component && fileattr == INVALID_FILE_ATTRIBUTES)
- {
- fileattr = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_READONLY;
- goto out;
- }
-#endif
- }
- else if (isvirtual_dev (dev.devn))
- {
- /* FIXME: Calling build_fhandler here is not the right way to handle this. */
- fhandler_virtual *fh = (fhandler_virtual *) build_fh_dev (dev, path_copy);
- int file_type = fh->exists ();
- if (file_type == -2)
- {
- fh->fill_filebuf ();
- symlen = sym.set (fh->get_filebuf ());
- }
- delete fh;
- switch (file_type)
- {
- case 1:
- case 2:
- if (component == 0)
- fileattr = FILE_ATTRIBUTE_DIRECTORY;
- break;
- case -1:
- if (component == 0)
- fileattr = 0;
- break;
- case -2: /* /proc/self or /proc/<pid>/symlinks */
- goto is_virtual_symlink;
- case -3: /* /proc/<pid>/fd/pipe:[] */
- if (component == 0)
- {
- fileattr = 0;
- dev.parse (FH_PIPE);
- }
- break;
- case -4: /* /proc/<pid>/fd/socket:[] */
- if (component == 0)
- {
- fileattr = 0;
- dev.parse (FH_TCP);
- }
- break;
- default:
- if (component == 0)
- fileattr = INVALID_FILE_ATTRIBUTES;
- goto virtual_component_retry;
- }
- if (component == 0 || dev.devn != FH_NETDRIVE)
- path_flags |= PATH_RO;
- goto out;
- }
- /* devn should not be a device. If it is, then stop parsing now. */
- else if (dev.devn != FH_FS)
- {
- fileattr = 0;
- path_flags = sym.pflags;
- if (component)
- {
- error = ENOTDIR;
- return;
- }
- goto out; /* Found a device. Stop parsing. */
- }
-
- /* If path is only a drivename, Windows interprets it as the
- current working directory on this drive instead of the root
- dir which is what we want. So we need the trailing backslash
- in this case. */
- if (full_path[0] && full_path[1] == ':' && full_path[2] == '\0')
- {
- full_path[2] = '\\';
- full_path[3] = '\0';
- }
-
- symlen = sym.check (full_path, suff, opt, fs);
-
-is_virtual_symlink:
-
- if (sym.isdevice)
- {
- dev.parse (sym.major, sym.minor);
- dev.setfs (1);
- dev.mode = sym.mode;
- fileattr = sym.fileattr;
- goto out;
- }
-
- if (sym.pflags & PATH_SOCKET)
- {
- if (component)
- {
- error = ENOTDIR;
- return;
- }
- fileattr = sym.fileattr;
- dev.parse (FH_UNIX);
- dev.setfs (1);
- goto out;
- }
-
- if (!component)
- {
- fileattr = sym.fileattr;
- path_flags = sym.pflags;
- if (cygwin_shared->obcaseinsensitive || fs.caseinsensitive ())
- path_flags |= PATH_NOPOSIX;
- caseinsensitive = (path_flags & PATH_NOPOSIX)
- ? OBJ_CASE_INSENSITIVE : 0;
- }
-
- /* If symlink.check found an existing non-symlink file, then
- it sets the appropriate flag. It also sets any suffix found
- into `ext_here'. */
- if (!sym.issymlink && sym.fileattr != INVALID_FILE_ATTRIBUTES)
- {
- error = sym.error;
- if (component == 0)
- add_ext_from_sym (sym);
- else if (!(sym.fileattr & FILE_ATTRIBUTE_DIRECTORY))
- {
- error = ENOTDIR;
- goto out;
- }
- goto out; // file found
- }
- /* Found a symlink if symlen > 0. If component == 0, then the
- src path itself was a symlink. If !follow_mode then
- we're done. Otherwise we have to insert the path found
- into the full path that we are building and perform all of
- these operations again on the newly derived path. */
- else if (symlen > 0)
- {
- saw_symlinks = 1;
- if (component == 0 && !need_directory && !(opt & PC_SYM_FOLLOW))
- {
- set_symlink (symlen); // last component of path is a symlink.
- if (opt & PC_SYM_CONTENTS)
- {
- strcpy (path, sym.contents);
- goto out;
- }
- add_ext_from_sym (sym);
- goto out;
- }
- else
- break;
- }
- else if (sym.error && sym.error != ENOENT && sym.error != ENOSHARE)
- {
- error = sym.error;
- goto out;
- }
- /* No existing file found. */
-
-virtual_component_retry:
- /* Find the new "tail" of the path, e.g. in '/for/bar/baz',
- /baz is the tail. */
- if (tail != path_end)
- *tail = '/';
- while (--tail > path_copy + 1 && *tail != '/') {}
- /* Exit loop if there is no tail or we are at the
- beginning of a UNC path */
- if (tail <= path_copy + 1)
- goto out; // all done
-
- /* Haven't found an existing pathname component yet.
- Pinch off the tail and try again. */
- *tail = '\0';
- component++;
- }
-
- /* Arrive here if above loop detected a symlink. */
- if (++loop > SYMLOOP_MAX)
- {
- error = ELOOP; // Eep.
- return;
- }
-
- MALLOC_CHECK;
-
-
- /* Place the link content, possibly with head and/or tail, in tmp_buf */
-
- char *headptr;
- if (isabspath (sym.contents))
- headptr = tmp_buf; /* absolute path */
- else
- {
- /* Copy the first part of the path (with ending /) and point to the end. */
- char *prevtail = tail;
- while (--prevtail > path_copy && *prevtail != '/') {}
- int headlen = prevtail - path_copy + 1;;
- memcpy (tmp_buf, path_copy, headlen);
- headptr = &tmp_buf[headlen];
- }
-
- /* Make sure there is enough space */
- if (headptr + symlen >= tmp_buf + (2 * NT_MAX_PATH))
- {
- too_long:
- error = ENAMETOOLONG;
- strcpy (path, "::ENAMETOOLONG::");
- return;
- }
-
- /* Copy the symlink contents to the end of tmp_buf.
- Convert slashes. */
- for (char *p = sym.contents; *p; p++)
- *headptr++ = *p == '\\' ? '/' : *p;
- *headptr = '\0';
-
- /* Copy any tail component (with the 0) */
- if (tail++ < path_end)
- {
- /* Add a slash if needed. There is space. */
- if (*(headptr - 1) != '/')
- *headptr++ = '/';
- int taillen = path_end - tail + 1;
- if (headptr + taillen > tmp_buf + (2 * NT_MAX_PATH))
- goto too_long;
- memcpy (headptr, tail, taillen);
- }
-
- /* Evaluate everything all over again. */
- src = tmp_buf;
- }
-
- if (!(opt & PC_SYM_CONTENTS))
- add_ext_from_sym (sym);
-
-out:
- if (dev.devn == FH_NETDRIVE && component)
- {
- /* This case indicates a non-existant resp. a non-retrievable
- share. This happens for instance if the share is a printer.
- In this case the path must not be treated like a FH_NETDRIVE,
- but like a FH_FS instead, so the usual open call for files
- is used on it. */
- dev.parse (FH_FS);
- }
- else if (isvirtual_dev (dev.devn) && fileattr == INVALID_FILE_ATTRIBUTES)
- {
- error = dev.devn == FH_NETDRIVE ? ENOSHARE : ENOENT;
- return;
- }
- else if (!need_directory || error)
- /* nothing to do */;
- else if (fileattr == INVALID_FILE_ATTRIBUTES)
- strcat (path, "\\"); /* Reattach trailing dirsep in native path. */
- else if (fileattr & FILE_ATTRIBUTE_DIRECTORY)
- path_flags &= ~PATH_SYMLINK;
- else
- {
- debug_printf ("%s is a non-directory", path);
- error = ENOTDIR;
- return;
- }
-
- if (dev.isfs ())
- {
- if (strncmp (path, "\\\\.\\", 4))
- {
- if (!tail || tail == path)
- /* nothing */;
- else if (tail[-1] != '\\')
- *tail = '\0';
- else
- {
- error = ENOENT;
- return;
- }
- }
-
- /* FS has been checked already for existing files. */
- if (exists () || fs.update (get_nt_native_path (), NULL))
- {
- debug_printf ("this->path(%s), has_acls(%d)", path, fs.has_acls ());
- if (fs.has_acls ())
- set_exec (0); /* We really don't know if this is executable or not here
- but set it to not executable since it will be figured out
- later by anything which cares about this. */
- }
- if (exec_state () != dont_know_if_executable)
- /* ok */;
- else if (isdir ())
- set_exec (1);
- else if (issymlink () || issocket ())
- set_exec (0);
- }
-
- if (opt & PC_NOFULL)
- {
- if (is_relpath)
- mkrelpath (this->path, !!caseinsensitive);
- if (need_directory)
- {
- size_t n = strlen (this->path);
- /* Do not add trailing \ to UNC device names like \\.\a: */
- if (this->path[n - 1] != '\\' &&
- (strncmp (this->path, "\\\\.\\", 4) != 0))
- {
- this->path[n] = '\\';
- this->path[n + 1] = '\0';
- }
- }
- }
-
- if (saw_symlinks)
- set_has_symlinks ();
-
- if (!error && !isdir () && !(path_flags & PATH_ALL_EXEC))
- {
- const char *p = strchr (path, '\0') - 4;
- if (p >= path &&
- (ascii_strcasematch (".exe", p) ||
- ascii_strcasematch (".bat", p) ||
- ascii_strcasematch (".com", p)))
- path_flags |= PATH_EXEC;
- }
-
- if (!(opt & PC_POSIX))
- normalized_path_size = 0;
- else
- {
- if (tail < path_end && tail > path_copy + 1)
- *tail = '/';
- set_normalized_path (path_copy);
- if (is_msdos && !(opt & PC_NOWARN))
- warn_msdos (src);
- }
-
-#if 0
- if (!error)
- {
- last_path_conv = *this;
- strcpy (last_src, src);
- }
-#endif
-}
-
-path_conv::~path_conv ()
-{
- if (!normalized_path_size && normalized_path)
- {
- cfree (normalized_path);
- normalized_path = NULL;
- }
- if (wide_path)
- {
- cfree (wide_path);
- wide_path = NULL;
- }
-}
-
-bool
-path_conv::is_binary ()
-{
- tmp_pathbuf tp;
- PWCHAR bintest = tp.w_get ();
- DWORD bin;
- /* Do NOT check for .exe suffix, otherwise rename(2) misbehaves
- when renaming files to existing executables with omitted suffix.
- strip(1) is a candidate uncovering wrong behaviour here. */
- return exec_state () == is_executable
- || GetBinaryTypeW (get_wide_win32_path (bintest), &bin);
-}
-
-/* Normalize a Win32 path.
- /'s are converted to \'s in the process.
- All duplicate \'s, except for 2 leading \'s, are deleted.
-
- The result is 0 for success, or an errno error value.
- FIXME: A lot of this should be mergeable with the POSIX critter. */
-int
-normalize_win32_path (const char *src, char *dst, char *&tail)
-{
- const char *src_start = src;
- bool beg_src_slash = isdirsep (src[0]);
-
- tail = dst;
- /* Skip long path name prefixes in Win32 or NT syntax. */
- if (beg_src_slash && (src[1] == '?' || isdirsep (src[1]))
- && src[2] == '?' && isdirsep (src[3]))
- {
- src += 4;
- if (src[1] != ':') /* native UNC path */
- src += 2; /* Fortunately the first char is not copied... */
- else
- beg_src_slash = false;
- }
- if (beg_src_slash && isdirsep (src[1]))
- {
- if (isdirsep (src[2]))
- {
- /* More than two slashes are just folded into one. */
- src += 2;
- while (isdirsep (src[1]))
- ++src;
- }
- else
- {
- /* Two slashes start a network or device path. */
- *tail++ = '\\';
- src++;
- if (src[1] == '.' && isdirsep (src[2]))
- {
- *tail++ = '\\';
- *tail++ = '.';
- src += 2;
- }
- }
- }
- if (tail == dst && !isdrive (src) && *src != '/')
- {
- if (beg_src_slash)
- tail += cygheap->cwd.get_drive (dst);
- else if (!cygheap->cwd.get (dst, 0))
- return get_errno ();
- else
- {
- tail = strchr (tail, '\0');
- *tail++ = '\\';
- }
- }
-
- while (*src)
- {
- /* Strip duplicate /'s. */
- if (isdirsep (src[0]) && isdirsep (src[1]))
- src++;
- /* Ignore "./". */
- else if (src[0] == '.' && isdirsep (src[1])
- && (src == src_start || isdirsep (src[-1])))
- src += 2;
-
- /* Backup if "..". */
- else if (src[0] == '.' && src[1] == '.'
- /* dst must be greater than dst_start */
- && tail[-1] == '\\')
- {
- if (!isdirsep (src[2]) && src[2] != '\0')
- *tail++ = *src++;
- else
- {
- /* Back up over /, but not if it's the first one. */
- if (tail > dst + 1)
- tail--;
- /* Now back up to the next /. */
- while (tail > dst + 1 && tail[-1] != '\\' && tail[-2] != ':')
- tail--;
- src += 2;
- if (isdirsep (*src))
- src++;
- }
- }
- /* Otherwise, add char to result. */
- else
- {
- if (*src == '/')
- *tail++ = '\\';
- else
- *tail++ = *src;
- src++;
- }
- if ((tail - dst) >= NT_MAX_PATH)
- return ENAMETOOLONG;
- }
- if (tail > dst + 1 && tail[-1] == '.' && tail[-2] == '\\')
- tail--;
- *tail = '\0';
- debug_printf ("%s = normalize_win32_path (%s)", dst, src_start);
- return 0;
-}
-
-/* Various utilities. */
-
-/* nofinalslash: Remove trailing / and \ from SRC (except for the
- first one). It is ok for src == dst. */
-
-void __stdcall
-nofinalslash (const char *src, char *dst)
-{
- int len = strlen (src);
- if (src != dst)
- memcpy (dst, src, len + 1);
- while (len > 1 && isdirsep (dst[--len]))
- dst[len] = '\0';
-}
-
-/* conv_path_list: Convert a list of path names to/from Win32/POSIX. */
-
-static int
-conv_path_list (const char *src, char *dst, size_t size, int to_posix)
-{
- tmp_pathbuf tp;
- char src_delim, dst_delim;
- cygwin_conv_path_t conv_fn;
- size_t len;
-
- if (to_posix)
- {
- src_delim = ';';
- dst_delim = ':';
- conv_fn = CCP_WIN_A_TO_POSIX | CCP_RELATIVE;
- }
- else
- {
- src_delim = ':';
- dst_delim = ';';
- conv_fn = CCP_POSIX_TO_WIN_A | CCP_RELATIVE;
- }
-
- char *srcbuf;
- len = strlen (src) + 1;
- if (len <= NT_MAX_PATH * sizeof (WCHAR))
- srcbuf = (char *) tp.w_get ();
- else
- srcbuf = (char *) alloca (len);
-
- int err = 0;
- char *d = dst - 1;
- bool saw_empty = false;
- do
- {
- char *s = strccpy (srcbuf, &src, src_delim);
- size_t len = s - srcbuf;
- if (len >= NT_MAX_PATH)
- {
- err = ENAMETOOLONG;
- break;
- }
- if (len)
- {
- ++d;
- err = cygwin_conv_path (conv_fn, srcbuf, d, size - (d - dst));
- }
- else if (!to_posix)
- {
- ++d;
- err = cygwin_conv_path (conv_fn, ".", d, size - (d - dst));
- }
- else
- {
- if (to_posix == ENV_CVT)
- saw_empty = true;
- continue;
- }
- if (err)
- break;
- d = strchr (d, '\0');
- *d = dst_delim;
- }
- while (*src++);
-
- if (saw_empty)
- err = EIDRM;
-
- if (d < dst)
- d++;
- *d = '\0';
- return err;
-}
-
-/********************** Symbolic Link Support **************************/
-
-/* Create a symlink from FROMPATH to TOPATH. */
-
-/* If TRUE create symlinks as Windows shortcuts, if false create symlinks
- as normal files with magic number and system bit set. */
-bool allow_winsymlinks = false;
-
-extern "C" int
-symlink (const char *oldpath, const char *newpath)
-{
- return symlink_worker (oldpath, newpath, allow_winsymlinks, false);
-}
-
-int
-symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
- bool isdevice)
-{
- int res = -1;
- size_t len;
- path_conv win32_newpath, win32_oldpath;
- char *buf, *cp;
- SECURITY_ATTRIBUTES sa = sec_none_nih;
- security_descriptor sd;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- NTSTATUS status;
- HANDLE fh;
- FILE_BASIC_INFORMATION fbi;
- tmp_pathbuf tp;
-
- /* POSIX says that empty 'newpath' is invalid input while empty
- 'oldpath' is valid -- it's symlink resolver job to verify if
- symlink contents point to existing filesystem object */
- myfault efault;
- if (efault.faulted (EFAULT))
- goto done;
- if (!*oldpath || !*newpath)
- {
- set_errno (ENOENT);
- goto done;
- }
-
- if (strlen (oldpath) > SYMLINK_MAX)
- {
- set_errno (ENAMETOOLONG);
- goto done;
- }
-
- len = strlen (newpath);
- /* Trailing dirsep is a no-no. */
- if (isdirsep (newpath[len - 1]))
- {
- set_errno (ENOENT);
- goto done;
- }
- /* We need the normalized full path below. */
- win32_newpath.check (newpath, PC_SYM_NOFOLLOW | PC_POSIX, stat_suffixes);
- if (use_winsym && !win32_newpath.exists ()
- && (isdevice || !win32_newpath.fs_is_nfs ()))
- {
- char *newplnk = tp.c_get ();
- stpcpy (stpcpy (newplnk, newpath), ".lnk");
- win32_newpath.check (newplnk, PC_SYM_NOFOLLOW | PC_POSIX);
- }
-
- if (win32_newpath.error)
- {
- set_errno (win32_newpath.error);
- goto done;
- }
-
- syscall_printf ("symlink (%s, %S)", oldpath,
- win32_newpath.get_nt_native_path ());
-
- if ((!isdevice && win32_newpath.exists ())
- || win32_newpath.is_auto_device ())
- {
- set_errno (EEXIST);
- goto done;
- }
-
- if (!isdevice && win32_newpath.fs_is_nfs ())
- {
- /* On NFS, create symlinks by calling NtCreateFile with an EA of type
- NfsSymlinkTargetName containing ... the symlink target name. */
- PFILE_FULL_EA_INFORMATION pffei = (PFILE_FULL_EA_INFORMATION) tp.w_get ();
- pffei->NextEntryOffset = 0;
- pffei->Flags = 0;
- pffei->EaNameLength = sizeof (NFS_SYML_TARGET) - 1;
- char *EaValue = stpcpy (pffei->EaName, NFS_SYML_TARGET) + 1;
- pffei->EaValueLength = sizeof (WCHAR) *
- (sys_mbstowcs ((PWCHAR) EaValue, NT_MAX_PATH, oldpath) - 1);
- status = NtCreateFile (&fh, FILE_WRITE_DATA | FILE_WRITE_EA | SYNCHRONIZE,
- win32_newpath.get_object_attr (attr, sa),
- &io, NULL, FILE_ATTRIBUTE_SYSTEM,
- FILE_SHARE_VALID_FLAGS, FILE_CREATE,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT,
- pffei, NT_MAX_PATH * sizeof (WCHAR));
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- goto done;
- }
- NtClose (fh);
- res = 0;
- goto done;
- }
-
- if (use_winsym)
- {
- ITEMIDLIST *pidl = NULL;
- size_t full_len = 0;
- unsigned short oldpath_len, desc_len, relpath_len, pidl_len = 0;
- char desc[MAX_PATH + 1], *relpath;
-
- if (!isdevice)
- {
- /* First create an IDLIST to learn how big our shortcut is
- going to be. */
- IShellFolder *psl;
-
- /* The symlink target is relative to the directory in which
- the symlink gets created, not relative to the cwd. Therefore
- we have to mangle the path quite a bit before calling path_conv. */
- if (!isabspath (oldpath))
- {
- len = strrchr (win32_newpath.normalized_path, '/')
- - win32_newpath.normalized_path + 1;
- char *absoldpath = tp.t_get ();
- stpcpy (stpncpy (absoldpath, win32_newpath.normalized_path, len),
- oldpath);
- win32_oldpath.check (absoldpath, PC_SYM_NOFOLLOW, stat_suffixes);
- }
- else
- win32_oldpath.check (oldpath, PC_SYM_NOFOLLOW, stat_suffixes);
- if (SUCCEEDED (SHGetDesktopFolder (&psl)))
- {
- WCHAR wc_path[win32_oldpath.get_wide_win32_path_len () + 1];
- win32_oldpath.get_wide_win32_path (wc_path);
- /* Amazing but true: Even though the ParseDisplayName method
- takes a wide char path name, it does not understand the
- Win32 prefix for long pathnames! So we have to tack off
- the prefix and convert the path to the "normal" syntax
- for ParseDisplayName. */
- WCHAR *wc = wc_path + 4;
- if (wc[1] != L':') /* native UNC path */
- *(wc += 2) = L'\\';
- HRESULT res;
- if (SUCCEEDED (res = psl->ParseDisplayName (NULL, NULL, wc, NULL,
- &pidl, NULL)))
- {
- ITEMIDLIST *p;
-
- for (p = pidl; p->mkid.cb > 0;
- p = (ITEMIDLIST *)((char *) p + p->mkid.cb))
- ;
- pidl_len = (char *) p - (char *) pidl + 2;
- }
- psl->Release ();
- }
- }
- /* Compute size of shortcut file. */
- full_len = sizeof (win_shortcut_hdr);
- if (pidl_len)
- full_len += sizeof (unsigned short) + pidl_len;
- oldpath_len = strlen (oldpath);
- /* Unfortunately the length of the description is restricted to a
- length of MAX_PATH up to NT4, and to a length of 2000 bytes
- since W2K. We don't want to add considerations for the different
- lengths and even 2000 bytes is not enough for long path names.
- So what we do here is to set the description to the POSIX path
- only if the path is not longer than MAX_PATH characters. We
- append the full path name after the regular shortcut data
- (see below), which works fine with Windows Explorer as well
- as older Cygwin versions (as long as the whole file isn't bigger
- than 8K). The description field is only used for backward
- compatibility to older Cygwin versions and those versions are
- not capable of handling long path names anyway. */
- desc_len = stpcpy (desc, oldpath_len > MAX_PATH
- ? "[path too long]" : oldpath) - desc;
- full_len += sizeof (unsigned short) + desc_len;
- /* Devices get the oldpath string unchanged as relative path. */
- if (isdevice)
- {
- relpath_len = oldpath_len;
- stpcpy (relpath = tp.c_get (), oldpath);
- }
- else
- {
- relpath_len = strlen (win32_oldpath.get_win32 ());
- stpcpy (relpath = tp.c_get (), win32_oldpath.get_win32 ());
- }
- full_len += sizeof (unsigned short) + relpath_len;
- full_len += sizeof (unsigned short) + oldpath_len;
- /* 1 byte more for trailing 0 written by stpcpy. */
- if (full_len < NT_MAX_PATH * sizeof (WCHAR))
- buf = (char *) tp.w_get ();
- else
- buf = (char *) alloca (full_len + 1);
-
- /* Create shortcut header */
- win_shortcut_hdr *shortcut_header = (win_shortcut_hdr *) buf;
- memset (shortcut_header, 0, sizeof *shortcut_header);
- shortcut_header->size = sizeof *shortcut_header;
- shortcut_header->magic = GUID_shortcut;
- shortcut_header->flags = (WSH_FLAG_DESC | WSH_FLAG_RELPATH);
- if (pidl)
- shortcut_header->flags |= WSH_FLAG_IDLIST;
- shortcut_header->run = SW_NORMAL;
- cp = buf + sizeof (win_shortcut_hdr);
-
- /* Create IDLIST */
- if (pidl)
- {
- *(unsigned short *)cp = pidl_len;
- memcpy (cp += 2, pidl, pidl_len);
- cp += pidl_len;
- CoTaskMemFree (pidl);
- }
-
- /* Create description */
- *(unsigned short *)cp = desc_len;
- cp = stpcpy (cp += 2, desc);
-
- /* Create relpath */
- *(unsigned short *)cp = relpath_len;
- cp = stpcpy (cp += 2, relpath);
-
- /* Append the POSIX path after the regular shortcut data for
- the long path support. */
- *(unsigned short *)cp = oldpath_len;
- cp = stpcpy (cp += 2, oldpath);
- }
- else
- {
- /* This is the old technique creating a symlink. */
- buf = tp.c_get ();
- /* Note that the terminating nul is written. */
- cp = stpcpy (stpcpy (buf, SYMLINK_COOKIE), oldpath) + 1;
- }
-
- if (isdevice && win32_newpath.exists ())
- {
- status = NtOpenFile (&fh, FILE_WRITE_ATTRIBUTES,
- win32_newpath.get_object_attr (attr, sa),
- &io, 0, FILE_OPEN_FOR_BACKUP_INTENT);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- goto done;
- }
- fbi.CreationTime.QuadPart = fbi.LastAccessTime.QuadPart
- = fbi.LastWriteTime.QuadPart = fbi.ChangeTime.QuadPart = 0LL;
- fbi.FileAttributes = FILE_ATTRIBUTE_NORMAL;
- status = NtSetInformationFile (fh, &io, &fbi, sizeof fbi,
- FileBasicInformation);
- NtClose (fh);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- goto done;
- }
- }
- if (win32_newpath.has_acls ())
- set_security_attribute (S_IFLNK | STD_RBITS | STD_WBITS,
- &sa, sd);
- status = NtCreateFile (&fh, DELETE | FILE_GENERIC_WRITE,
- win32_newpath.get_object_attr (attr, sa),
- &io, NULL, FILE_ATTRIBUTE_NORMAL,
- FILE_SHARE_VALID_FLAGS,
- isdevice ? FILE_OVERWRITE_IF : FILE_CREATE,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_NON_DIRECTORY_FILE
- | FILE_OPEN_FOR_BACKUP_INTENT,
- NULL, 0);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- goto done;
- }
- status = NtWriteFile (fh, NULL, NULL, NULL, &io, buf, cp - buf, NULL, NULL);
- if (NT_SUCCESS (status) && io.Information == (ULONG) (cp - buf))
- {
- fbi.CreationTime.QuadPart = fbi.LastAccessTime.QuadPart
- = fbi.LastWriteTime.QuadPart = fbi.ChangeTime.QuadPart = 0LL;
- fbi.FileAttributes = use_winsym ? FILE_ATTRIBUTE_READONLY
- : FILE_ATTRIBUTE_SYSTEM;
- status = NtSetInformationFile (fh, &io, &fbi, sizeof fbi,
- FileBasicInformation);
- if (!NT_SUCCESS (status))
- debug_printf ("Setting attributes failed, status = %p", status);
- res = 0;
- }
- else
- {
- __seterrno_from_nt_status (status);
- FILE_DISPOSITION_INFORMATION fdi = { TRUE };
- status = NtSetInformationFile (fh, &io, &fdi, sizeof fdi,
- FileDispositionInformation);
- if (!NT_SUCCESS (status))
- debug_printf ("Setting delete dispostion failed, status = %p", status);
- }
- NtClose (fh);
-
-done:
- syscall_printf ("%d = symlink_worker (%s, %s, %d, %d)", res, oldpath,
- newpath, use_winsym, isdevice);
- return res;
-}
-
-static bool
-cmp_shortcut_header (win_shortcut_hdr *file_header)
-{
- /* A Cygwin or U/Win shortcut only contains a description and a relpath.
- Cygwin shortcuts also might contain an ITEMIDLIST. The run type is
- always set to SW_NORMAL. */
- return file_header->size == sizeof (win_shortcut_hdr)
- && !memcmp (&file_header->magic, &GUID_shortcut, sizeof GUID_shortcut)
- && (file_header->flags & ~WSH_FLAG_IDLIST)
- == (WSH_FLAG_DESC | WSH_FLAG_RELPATH)
- && file_header->run == SW_NORMAL;
-}
-
-int
-symlink_info::check_shortcut (HANDLE in_h)
-{
- tmp_pathbuf tp;
- win_shortcut_hdr *file_header;
- char *buf, *cp;
- unsigned short len;
- int res = 0;
- UNICODE_STRING same = { 0, 0, (PWCHAR) L"" };
- OBJECT_ATTRIBUTES attr;
- NTSTATUS status;
- HANDLE h;
- IO_STATUS_BLOCK io;
- FILE_STANDARD_INFORMATION fsi;
-
- InitializeObjectAttributes (&attr, &same, 0, in_h, NULL);
- status = NtOpenFile (&h, FILE_READ_DATA | SYNCHRONIZE,
- &attr, &io, FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT
- | FILE_SYNCHRONOUS_IO_NONALERT);
- if (!NT_SUCCESS (status))
- {
- set_error (EIO);
- return 0;
- }
- status = NtQueryInformationFile (h, &io, &fsi, sizeof fsi,
- FileStandardInformation);
- if (!NT_SUCCESS (status))
- {
- set_error (EIO);
- goto out;
- }
- if (fsi.EndOfFile.QuadPart <= sizeof (win_shortcut_hdr)
- || fsi.EndOfFile.QuadPart > 4 * 65536)
- goto out;
- if (fsi.EndOfFile.LowPart < NT_MAX_PATH * sizeof (WCHAR))
- buf = (char *) tp.w_get ();
- else
- buf = (char *) alloca (fsi.EndOfFile.LowPart + 1);
- if (!NT_SUCCESS (NtReadFile (h, NULL, NULL, NULL,
- &io, buf, fsi.EndOfFile.LowPart, NULL, NULL)))
- {
- set_error (EIO);
- goto out;
- }
- file_header = (win_shortcut_hdr *) buf;
- if (io.Information != fsi.EndOfFile.LowPart
- || !cmp_shortcut_header (file_header))
- goto file_not_symlink;
- cp = buf + sizeof (win_shortcut_hdr);
- if (file_header->flags & WSH_FLAG_IDLIST) /* Skip ITEMIDLIST */
- cp += *(unsigned short *) cp + 2;
- if (!(len = *(unsigned short *) cp))
- goto file_not_symlink;
- cp += 2;
- /* Check if this is a device file - these start with the sequence :\\ */
- if (strncmp (cp, ":\\", 2) == 0)
- res = strlen (strcpy (contents, cp)); /* Don't mess with device files */
- else
- {
- /* Has appended full path? If so, use it instead of description. */
- unsigned short relpath_len = *(unsigned short *) (cp + len);
- if (cp + len + 2 + relpath_len < buf + fsi.EndOfFile.LowPart)
- {
- cp += len + 2 + relpath_len;
- len = *(unsigned short *) cp;
- cp += 2;
- }
- if (len > SYMLINK_MAX)
- goto file_not_symlink;
- cp[len] = '\0';
- res = posixify (cp);
- }
- if (res) /* It's a symlink. */
- pflags = PATH_SYMLINK | PATH_LNK;
- return res;
-
-file_not_symlink:
- /* Not a symlink, see if executable. */
- if (!(pflags & PATH_ALL_EXEC) && has_exec_chars ((const char *) &file_header, io.Information))
- pflags |= PATH_EXEC;
-
-out:
- NtClose (h);
- return 0;
-}
-
-int
-symlink_info::check_sysfile (HANDLE in_h)
-{
- char cookie_buf[sizeof (SYMLINK_COOKIE) - 1];
- char srcbuf[SYMLINK_MAX + 2];
- int res = 0;
- UNICODE_STRING same = { 0, 0, (PWCHAR) L"" };
- OBJECT_ATTRIBUTES attr;
- NTSTATUS status;
- HANDLE h;
- IO_STATUS_BLOCK io;
-
- InitializeObjectAttributes (&attr, &same, 0, in_h, NULL);
- status = NtOpenFile (&h, FILE_READ_DATA | SYNCHRONIZE,
- &attr, &io, FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT
- | FILE_SYNCHRONOUS_IO_NONALERT);
- if (!NT_SUCCESS (status))
- set_error (EIO);
- else if (!NT_SUCCESS (status = NtReadFile (h, NULL, NULL, NULL, &io,
- cookie_buf, sizeof (cookie_buf),
- NULL, NULL)))
- {
- debug_printf ("ReadFile1 failed");
- if (status != STATUS_END_OF_FILE)
- set_error (EIO);
- }
- else if (io.Information == sizeof (cookie_buf)
- && memcmp (cookie_buf, SYMLINK_COOKIE, sizeof (cookie_buf)) == 0)
- {
- /* It's a symlink. */
- pflags = PATH_SYMLINK;
-
- status = NtReadFile (h, NULL, NULL, NULL, &io, srcbuf,
- SYMLINK_MAX + 2, NULL, NULL);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("ReadFile2 failed");
- if (status != STATUS_END_OF_FILE)
- set_error (EIO);
- }
- else if (io.Information > SYMLINK_MAX + 1)
- debug_printf ("symlink string too long");
- else
- res = posixify (srcbuf);
- }
- else if (io.Information == sizeof (cookie_buf)
- && memcmp (cookie_buf, SOCKET_COOKIE, sizeof (cookie_buf)) == 0)
- pflags |= PATH_SOCKET;
- else
- {
- /* Not a symlink, see if executable. */
- if (pflags & PATH_ALL_EXEC)
- /* Nothing to do */;
- else if (has_exec_chars (cookie_buf, io.Information))
- pflags |= PATH_EXEC;
- else
- pflags |= PATH_NOTEXEC;
- }
- NtClose (h);
- return res;
-}
-
-int
-symlink_info::check_reparse_point (HANDLE h)
-{
- tmp_pathbuf tp;
- NTSTATUS status;
- IO_STATUS_BLOCK io;
- PREPARSE_DATA_BUFFER rp = (PREPARSE_DATA_BUFFER) tp.c_get ();
- char srcbuf[SYMLINK_MAX + 7];
-
- status = NtFsControlFile (h, NULL, NULL, NULL, &io, FSCTL_GET_REPARSE_POINT,
- NULL, 0, (LPVOID) rp,
- MAXIMUM_REPARSE_DATA_BUFFER_SIZE);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("NtFsControlFile(FSCTL_GET_REPARSE_POINT) failed, %p",
- status);
- set_error (EIO);
- return 0;
- }
- if (rp->ReparseTag == IO_REPARSE_TAG_SYMLINK)
- {
- sys_wcstombs (srcbuf, SYMLINK_MAX + 1,
- (WCHAR *)((char *)rp->SymbolicLinkReparseBuffer.PathBuffer
- + rp->SymbolicLinkReparseBuffer.SubstituteNameOffset),
- rp->SymbolicLinkReparseBuffer.SubstituteNameLength / sizeof (WCHAR));
- pflags = PATH_SYMLINK | PATH_REP;
- fileattr &= ~FILE_ATTRIBUTE_DIRECTORY;
- }
- else if (rp->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT)
- {
- if (rp->SymbolicLinkReparseBuffer.PrintNameLength == 0)
- {
- /* Likely a volume mount point. Not treated as symlink. */
- return 0;
- }
- sys_wcstombs (srcbuf, SYMLINK_MAX + 1,
- (WCHAR *)((char *)rp->MountPointReparseBuffer.PathBuffer
- + rp->MountPointReparseBuffer.SubstituteNameOffset),
- rp->MountPointReparseBuffer.SubstituteNameLength / sizeof (WCHAR));
- pflags = PATH_SYMLINK | PATH_REP;
- fileattr &= ~FILE_ATTRIBUTE_DIRECTORY;
- }
- return posixify (srcbuf);
-}
-
-int
-symlink_info::check_nfs_symlink (HANDLE h)
-{
- tmp_pathbuf tp;
- NTSTATUS status;
- IO_STATUS_BLOCK io;
- struct {
- FILE_GET_EA_INFORMATION fgei;
- char buf[sizeof (NFS_SYML_TARGET)];
- } fgei_buf;
- PFILE_FULL_EA_INFORMATION pffei;
- int res = 0;
-
- /* To find out if the file is a symlink and to get the symlink target,
- try to fetch the NfsSymlinkTargetName EA. */
- fgei_buf.fgei.NextEntryOffset = 0;
- fgei_buf.fgei.EaNameLength = sizeof (NFS_SYML_TARGET) - 1;
- stpcpy (fgei_buf.fgei.EaName, NFS_SYML_TARGET);
- pffei = (PFILE_FULL_EA_INFORMATION) tp.w_get ();
- status = NtQueryEaFile (h, &io, pffei, NT_MAX_PATH * sizeof (WCHAR), TRUE,
- &fgei_buf.fgei, sizeof fgei_buf, NULL, TRUE);
- if (NT_SUCCESS (status) && pffei->EaValueLength > 0)
- {
- PWCHAR spath = (PWCHAR)
- (pffei->EaName + pffei->EaNameLength + 1);
- res = sys_wcstombs (contents, SYMLINK_MAX + 1,
- spath, pffei->EaValueLength);
- pflags = PATH_SYMLINK;
- }
- return res;
-}
-
-int
-symlink_info::posixify (char *srcbuf)
-{
- /* The definition for a path in a native symlink is a bit weird. The Flags
- value seem to contain 0 for absolute paths (stored as NT native path)
- and 1 for relative paths. Relative paths are paths not starting with a
- drive letter. These are not converted to NT native, but stored as
- given. A path starting with a single backslash is relative to the
- current drive thus a "relative" value (Flags == 1).
- Funny enough it's possible to store paths with slashes instead of
- backslashes, but they are evaluated incorrectly by subsequent Windows
- calls like CreateFile (ERROR_INVALID_NAME). So, what we do here is to
- take paths starting with slashes at face value, evaluating them as
- Cygwin specific POSIX paths.
- A path starting with two slashes(!) or backslashes is converted into an
- NT UNC path. Unfortunately, in contrast to POSIX rules, paths starting
- with three or more (back)slashes are also converted into UNC paths,
- just incorrectly sticking to one redundant leading backslashe. We go
- along with this behaviour to avoid scenarios in which native tools access
- other files than Cygwin.
- The above rules are used exactly the same way on Cygwin specific symlinks
- (sysfiles and shortcuts) to eliminate non-POSIX paths in the output. */
-
- /* Eliminate native NT prefixes. */
- if (srcbuf[0] == '\\' && !strncmp (srcbuf + 1, "??\\", 3))
- {
- srcbuf += 4;
- if (srcbuf[1] != ':') /* native UNC path */
- *(srcbuf += 2) = '\\';
- }
- if (isdrive (srcbuf))
- mount_table->conv_to_posix_path (srcbuf, contents, 0);
- else if (srcbuf[0] == '\\')
- {
- if (srcbuf[1] == '\\') /* UNC path */
- slashify (srcbuf, contents, 0);
- else /* Paths starting with \ are current drive relative. */
- {
- char cvtbuf[SYMLINK_MAX + 1];
-
- stpcpy (cvtbuf + cygheap->cwd.get_drive (cvtbuf), srcbuf);
- mount_table->conv_to_posix_path (cvtbuf, contents, 0);
- }
- }
- else /* Everything else is taken as is. */
- slashify (srcbuf, contents, 0);
- return strlen (contents);
-}
-
-enum
-{
- SCAN_BEG,
- SCAN_LNK,
- SCAN_HASLNK,
- SCAN_JUSTCHECK,
- SCAN_JUSTCHECKTHIS, /* Never try to append a suffix. */
- SCAN_APPENDLNK,
- SCAN_EXTRALNK,
- SCAN_DONE,
-};
-
-class suffix_scan
-{
- const suffix_info *suffixes, *suffixes_start;
- int nextstate;
- char *eopath;
-public:
- const char *path;
- char *has (const char *, const suffix_info *);
- int next ();
- int lnk_match () {return nextstate >= SCAN_APPENDLNK;}
-};
-
-char *
-suffix_scan::has (const char *in_path, const suffix_info *in_suffixes)
-{
- nextstate = SCAN_BEG;
- suffixes = suffixes_start = in_suffixes;
-
- const char *fname = strrchr (in_path, '\\');
- fname = fname ? fname + 1 : in_path;
- char *ext_here = strrchr (fname, '.');
- path = in_path;
- eopath = strchr (path, '\0');
-
- if (!ext_here)
- goto noext;
-
- if (suffixes)
- {
- /* Check if the extension matches a known extension */
- for (const suffix_info *ex = in_suffixes; ex->name != NULL; ex++)
- if (ascii_strcasematch (ext_here, ex->name))
- {
- nextstate = SCAN_JUSTCHECK;
- suffixes = NULL; /* Has an extension so don't scan for one. */
- goto done;
- }
- }
-
- /* Didn't match. Use last resort -- .lnk. */
- if (ascii_strcasematch (ext_here, ".lnk"))
- {
- nextstate = SCAN_HASLNK;
- suffixes = NULL;
- }
-
- noext:
- ext_here = eopath;
-
- done:
- /* Avoid attaching suffixes if the resulting filename would be invalid. */
- if (eopath - fname > NAME_MAX - 4)
- {
- nextstate = SCAN_JUSTCHECKTHIS;
- suffixes = NULL;
- }
- return ext_here;
-}
-
-int
-suffix_scan::next ()
-{
- for (;;)
- {
- if (!suffixes)
- switch (nextstate)
- {
- case SCAN_BEG:
- suffixes = suffixes_start;
- if (!suffixes)
- {
- nextstate = SCAN_LNK;
- return 1;
- }
- nextstate = SCAN_EXTRALNK;
- /* fall through to suffix checking below */
- break;
- case SCAN_HASLNK:
- nextstate = SCAN_APPENDLNK; /* Skip SCAN_BEG */
- return 1;
- case SCAN_EXTRALNK:
- nextstate = SCAN_DONE;
- *eopath = '\0';
- return 0;
- case SCAN_JUSTCHECK:
- nextstate = SCAN_LNK;
- return 1;
- case SCAN_JUSTCHECKTHIS:
- nextstate = SCAN_DONE;
- return 1;
- case SCAN_LNK:
- case SCAN_APPENDLNK:
- strcat (eopath, ".lnk");
- nextstate = SCAN_DONE;
- return 1;
- default:
- *eopath = '\0';
- return 0;
- }
-
- while (suffixes && suffixes->name)
- if (nextstate == SCAN_EXTRALNK && !suffixes->addon)
- suffixes++;
- else
- {
- strcpy (eopath, suffixes->name);
- if (nextstate == SCAN_EXTRALNK)
- strcat (eopath, ".lnk");
- suffixes++;
- return 1;
- }
- suffixes = NULL;
- }
-}
-
-bool
-symlink_info::set_error (int in_errno)
-{
- bool res;
- if (!(pflags & PATH_NO_ACCESS_CHECK) || in_errno == ENAMETOOLONG || in_errno == EIO)
- {
- error = in_errno;
- res = true;
- }
- else if (in_errno == ENOENT)
- res = true;
- else
- {
- fileattr = FILE_ATTRIBUTE_NORMAL;
- res = false;
- }
- return res;
-}
-
-bool
-symlink_info::parse_device (const char *contents)
-{
- char *endptr;
- _major_t mymajor;
- _major_t myminor;
- _mode_t mymode;
-
- mymajor = strtol (contents += 2, &endptr, 16);
- if (endptr == contents)
- return isdevice = false;
-
- contents = endptr;
- myminor = strtol (++contents, &endptr, 16);
- if (endptr == contents)
- return isdevice = false;
-
- contents = endptr;
- mymode = strtol (++contents, &endptr, 16);
- if (endptr == contents)
- return isdevice = false;
-
- if ((mymode & S_IFMT) == S_IFIFO)
- {
- mymajor = _major (FH_FIFO);
- myminor = _minor (FH_FIFO);
- }
-
- major = mymajor;
- minor = myminor;
- mode = mymode;
- return isdevice = true;
-}
-
-/* Check if PATH is a symlink. PATH must be a valid Win32 path name.
-
- If PATH is a symlink, put the value of the symlink--the file to
- which it points--into BUF. The value stored in BUF is not
- necessarily null terminated. BUFLEN is the length of BUF; only up
- to BUFLEN characters will be stored in BUF. BUF may be NULL, in
- which case nothing will be stored.
-
- Set *SYML if PATH is a symlink.
-
- Set *EXEC if PATH appears to be executable. This is an efficiency
- hack because we sometimes have to open the file anyhow. *EXEC will
- not be set for every executable file.
-
- Return -1 on error, 0 if PATH is not a symlink, or the length
- stored into BUF if PATH is a symlink. */
-
-int
-symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt,
- fs_info &fs)
-{
- HANDLE h = NULL;
- int res = 0;
- suffix_scan suffix;
- contents[0] = '\0';
-
- issymlink = true;
- isdevice = false;
- ext_here = suffix.has (path, suffixes);
- extn = ext_here - path;
- major = 0;
- minor = 0;
- mode = 0;
- pflags &= ~(PATH_SYMLINK | PATH_LNK | PATH_REP);
- ULONG ci_flag = cygwin_shared->obcaseinsensitive || (pflags & PATH_NOPOSIX)
- ? OBJ_CASE_INSENSITIVE : 0;
-
- /* TODO: Temporarily do all char->UNICODE conversion here. This should
- already be slightly faster than using Ascii functions. */
- tmp_pathbuf tp;
- UNICODE_STRING upath;
- OBJECT_ATTRIBUTES attr;
- tp.u_get (&upath);
- InitializeObjectAttributes (&attr, &upath, ci_flag, NULL, NULL);
-
- PVOID eabuf = &nfs_aol_ffei;
- ULONG easize = sizeof nfs_aol_ffei;
-
- while (suffix.next ())
- {
- FILE_BASIC_INFORMATION fbi;
- NTSTATUS status;
- IO_STATUS_BLOCK io;
- bool no_ea = false;
-
- error = 0;
- get_nt_native_path (suffix.path, upath);
- if (h)
- {
- NtClose (h);
- h = NULL;
- }
- /* The EA given to NtCreateFile allows to get a handle to a symlink on
- an NFS share, rather than getting a handle to the target of the
- symlink (which would spoil the task of this method quite a bit).
- Fortunately it's ignored on most other file systems so we don't have
- to special case NFS too much. */
- status = NtCreateFile (&h,
- READ_CONTROL | FILE_READ_ATTRIBUTES | FILE_READ_EA,
- &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL,
- FILE_SHARE_VALID_FLAGS, FILE_OPEN,
- FILE_OPEN_REPARSE_POINT
- | FILE_OPEN_FOR_BACKUP_INTENT,
- eabuf, easize);
- /* No right to access EAs or EAs not supported? */
- if (status == STATUS_ACCESS_DENIED || status == STATUS_EAS_NOT_SUPPORTED)
- {
- no_ea = true;
- /* If EAs are not supported, there's no sense to check them again
- whith suffixes attached. So we set eabuf/easize to 0 here once. */
- if (status == STATUS_EAS_NOT_SUPPORTED)
- {
- eabuf = NULL;
- easize = 0;
- }
- status = NtCreateFile (&h, READ_CONTROL | FILE_READ_ATTRIBUTES,
- &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL,
- FILE_SHARE_VALID_FLAGS, FILE_OPEN,
- FILE_OPEN_REPARSE_POINT
- | FILE_OPEN_FOR_BACKUP_INTENT,
- eabuf, easize);
- }
- if (NT_SUCCESS (status)
- && NT_SUCCESS (status
- = NtQueryInformationFile (h, &io, &fbi, sizeof fbi,
- FileBasicInformation)))
- fileattr = fbi.FileAttributes;
- else
- {
- debug_printf ("%p = NtQueryInformationFile (%S)", status, &upath);
- h = NULL;
- fileattr = INVALID_FILE_ATTRIBUTES;
-
- /* One of the inner path components is invalid, or the path contains
- invalid characters. Bail out with ENOENT.
-
- Note that additional STATUS_OBJECT_PATH_INVALID and
- STATUS_OBJECT_PATH_SYNTAX_BAD status codes exist. The first one
- is seemingly not generated by NtQueryAttributesFile, the latter
- is only generated if the path is no absolute path within the
- NT name space, which should not happen and would point to an
- error in get_nt_native_path. Both status codes are deliberately
- not tested here unless proved necessary. */
- if (status == STATUS_OBJECT_PATH_NOT_FOUND
- || status == STATUS_OBJECT_NAME_INVALID)
- {
- set_error (ENOENT);
- goto file_not_symlink;
- }
- if (status != STATUS_OBJECT_NAME_NOT_FOUND
- && status != STATUS_NO_SUCH_FILE) /* ENOENT on NFS or 9x share */
- {
- /* The file exists, but the user can't access it for one reason
- or the other. To get the file attributes we try to access the
- information by opening the parent directory and getting the
- file attributes using a matching NtQueryDirectoryFile call. */
- UNICODE_STRING dirname, basename;
- OBJECT_ATTRIBUTES dattr;
- HANDLE dir;
- struct {
- FILE_DIRECTORY_INFORMATION fdi;
- WCHAR dummy_buf[NAME_MAX + 1];
- } fdi_buf;
-
- RtlSplitUnicodePath (&upath, &dirname, &basename);
- InitializeObjectAttributes (&dattr, &dirname, ci_flag,
- NULL, NULL);
- status = NtOpenFile (&dir, SYNCHRONIZE | FILE_LIST_DIRECTORY,
- &dattr, &io, FILE_SHARE_VALID_FLAGS,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT
- | FILE_DIRECTORY_FILE);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("%p = NtOpenFile(%S)", status, &dirname);
- fileattr = 0;
- }
- else
- {
- status = NtQueryDirectoryFile (dir, NULL, NULL, 0, &io,
- &fdi_buf, sizeof fdi_buf,
- FileDirectoryInformation,
- TRUE, &basename, TRUE);
- NtClose (dir);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("%p = NtQueryDirectoryFile(%S)",
- status, &dirname);
- if (status == STATUS_NO_SUCH_FILE)
- {
- /* This can happen when trying to access files
- which match DOS device names on SMB shares.
- NtOpenFile failed with STATUS_ACCESS_DENIED,
- but the NtQueryDirectoryFile tells us the
- file doesn't exist. We're suspicious in this
- case and retry with the next suffix instead of
- just giving up. */
- set_error (ENOENT);
- continue;
- }
- fileattr = 0;
- }
- else
- fileattr = fdi_buf.fdi.FileAttributes;
- }
- ext_tacked_on = !!*ext_here;
- goto file_not_symlink;
- }
- set_error (ENOENT);
- continue;
- }
-
- /* Check file system while we're having the file open anyway.
- This speeds up path_conv noticably (~10%). */
- fs.update (&upath, h);
-
- ext_tacked_on = !!*ext_here;
-
- res = -1;
-
- /* Windows shortcuts are potentially treated as symlinks. Valid Cygwin
- & U/WIN shortcuts are R/O, but definitely not directories. */
- if ((fileattr & (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_DIRECTORY))
- == FILE_ATTRIBUTE_READONLY && suffix.lnk_match ())
- {
- res = check_shortcut (h);
- if (!res)
- {
- /* If searching for `foo' and then finding a `foo.lnk' which is
- no shortcut, return the same as if file not found. */
- if (!suffix.lnk_match () || !ext_tacked_on)
- goto file_not_symlink;
-
- /* in case we're going to tack *another* .lnk on this filename. */
- fileattr = INVALID_FILE_ATTRIBUTES;
- continue;
- }
- if (contents[0] == ':' && contents[1] == '\\'
- && parse_device (contents))
- goto file_not_symlink;
- }
-
- /* Reparse points are potentially symlinks. This check must be
- performed before checking the SYSTEM attribute for sysfile
- symlinks, since reparse points can have this flag set, too.
- For instance, Vista starts to create a couple of reparse points
- with SYSTEM and HIDDEN flags set. */
- else if (fileattr & FILE_ATTRIBUTE_REPARSE_POINT)
- {
- res = check_reparse_point (h);
- if (!res)
- goto file_not_symlink;
- }
-
- /* This is the old Cygwin method creating symlinks. A symlink will
- have the `system' file attribute. Only files can be symlinks
- (which can be symlinks to directories). */
- else if ((fileattr & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY))
- == FILE_ATTRIBUTE_SYSTEM)
- {
- res = check_sysfile (h);
- if (!res)
- goto file_not_symlink;
- }
-
- /* If the file could be opened with FILE_READ_EA, and if it's on a
- NFS share, check if it's a symlink. Only files can be symlinks
- (which can be symlinks to directories). */
- else if (fs.is_nfs () && !no_ea && !(fileattr & FILE_ATTRIBUTE_DIRECTORY))
- {
- res = check_nfs_symlink (h);
- if (!res)
- goto file_not_symlink;
- }
-
- /* Normal file. */
- else
- goto file_not_symlink;
-
- break;
-
-
- file_not_symlink:
- issymlink = false;
- syscall_printf ("%s", isdevice ? "is a device" : "not a symlink");
- res = 0;
- break;
- }
-
- if (h)
- NtClose (h);
-
- syscall_printf ("%d = symlink.check (%s, %p) (%p)",
- res, suffix.path, contents, pflags);
- return res;
-}
-
-/* "path" is the path in a virtual symlink. Set a symlink_info struct from
- that and proceed with further path checking afterwards. */
-int
-symlink_info::set (char *path)
-{
- strcpy (contents, path);
- pflags = PATH_SYMLINK;
- fileattr = FILE_ATTRIBUTE_NORMAL;
- error = 0;
- issymlink = true;
- isdevice = false;
- ext_tacked_on = false;
- ext_here = NULL;
- extn = major = minor = mode = 0;
- return strlen (path);
-}
-
-/* readlink system call */
-
-extern "C" ssize_t
-readlink (const char *path, char *buf, size_t buflen)
-{
- if (buflen < 0)
- {
- set_errno (ENAMETOOLONG);
- return -1;
- }
-
- path_conv pathbuf (path, PC_SYM_CONTENTS, stat_suffixes);
-
- if (pathbuf.error)
- {
- set_errno (pathbuf.error);
- syscall_printf ("-1 = readlink (%s, %p, %d)", path, buf, buflen);
- return -1;
- }
-
- if (!pathbuf.exists ())
- {
- set_errno (ENOENT);
- return -1;
- }
-
- if (!pathbuf.issymlink ())
- {
- if (pathbuf.exists ())
- set_errno (EINVAL);
- return -1;
- }
-
- ssize_t len = min (buflen, strlen (pathbuf.get_win32 ()));
- memcpy (buf, pathbuf.get_win32 (), len);
-
- /* errno set by symlink.check if error */
- return len;
-}
-
-/* Some programs rely on st_dev/st_ino being unique for each file.
- Hash the path name and hope for the best. The hash arg is not
- always initialized to zero since readdir needs to compute the
- dirent ino_t based on a combination of the hash of the directory
- done during the opendir call and the hash or the filename within
- the directory. FIXME: Not bullet-proof. */
-/* Cygwin internal */
-__ino64_t __stdcall
-hash_path_name (__ino64_t hash, PUNICODE_STRING name)
-{
- if (name->Length == 0)
- return hash;
-
- /* Build up hash. Name is already normalized */
- USHORT len = name->Length / sizeof (WCHAR);
- for (USHORT idx = 0; idx < len; ++idx)
- hash = RtlUpcaseUnicodeChar (name->Buffer[idx])
- + (hash << 6) + (hash << 16) - hash;
- return hash;
-}
-
-__ino64_t __stdcall
-hash_path_name (__ino64_t hash, PCWSTR name)
-{
- UNICODE_STRING uname;
- RtlInitUnicodeString (&uname, name);
- return hash_path_name (hash, &uname);
-}
-
-__ino64_t __stdcall
-hash_path_name (__ino64_t hash, const char *name)
-{
- UNICODE_STRING uname;
- RtlCreateUnicodeStringFromAsciiz (&uname, name);
- __ino64_t ret = hash_path_name (hash, &uname);
- RtlFreeUnicodeString (&uname);
- return ret;
-}
-
-extern "C" char *
-getcwd (char *buf, size_t ulen)
-{
- char* res = NULL;
- myfault efault;
- if (efault.faulted (EFAULT))
- /* errno set */;
- else if (ulen == 0 && buf)
- set_errno (EINVAL);
- else
- res = cygheap->cwd.get (buf, 1, 1, ulen);
- return res;
-}
-
-/* getwd: Legacy. */
-extern "C" char *
-getwd (char *buf)
-{
- return getcwd (buf, PATH_MAX + 1); /*Per SuSv3!*/
-}
-
-/* chdir: POSIX 5.2.1.1 */
-extern "C" int
-chdir (const char *in_dir)
-{
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- if (!*in_dir)
- {
- set_errno (ENOENT);
- return -1;
- }
-
- syscall_printf ("dir '%s'", in_dir);
-
- /* Convert path. First argument ensures that we don't check for NULL/empty/invalid
- again. */
- path_conv path (PC_NONULLEMPTY, in_dir, PC_SYM_FOLLOW | PC_POSIX);
- if (path.error)
- {
- set_errno (path.error);
- syscall_printf ("-1 = chdir (%s)", in_dir);
- return -1;
- }
-
- int res = -1;
- bool doit = false;
- const char *posix_cwd = NULL;
- int devn = path.get_devn ();
- if (!isvirtual_dev (devn))
- {
- /* The sequence chdir("xx"); chdir(".."); must be a noop if xx
- is not a symlink. This is exploited by find.exe.
- The posix_cwd is just path.normalized_path.
- In other cases we let cwd.set obtain the Posix path through
- the mount table. */
- if (!isdrive(path.normalized_path))
- posix_cwd = path.normalized_path;
- res = 0;
- doit = true;
- }
- else if (!path.exists ())
- set_errno (ENOENT);
- else if (!path.isdir ())
- set_errno (ENOTDIR);
- else
- {
- posix_cwd = path.normalized_path;
- res = 0;
- }
-
- if (!res)
- res = cygheap->cwd.set (path.get_nt_native_path (), posix_cwd, doit);
-
- /* Note that we're accessing cwd.posix without a lock here. I didn't think
- it was worth locking just for strace. */
- syscall_printf ("%d = chdir() cygheap->cwd.posix '%s' native '%S'", res,
- cygheap->cwd.posix, path.get_nt_native_path ());
- MALLOC_CHECK;
- return res;
-}
-
-extern "C" int
-fchdir (int fd)
-{
- int res;
- cygheap_fdget cfd (fd);
- if (cfd >= 0)
- res = chdir (cfd->get_name ());
- else
- res = -1;
-
- syscall_printf ("%d = fchdir (%d)", res, fd);
- return res;
-}
-
-/******************** Exported Path Routines *********************/
-
-/* Cover functions to the path conversion routines.
- These are exported to the world as cygwin_foo by cygwin.din. */
-
-#define return_with_errno(x) \
- do {\
- int err = (x);\
- if (!err)\
- return 0;\
- set_errno (err);\
- return -1;\
- } while (0)
-
-extern "C" ssize_t
-cygwin_conv_path (cygwin_conv_path_t what, const void *from, void *to,
- size_t size)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
-
- path_conv p;
- size_t lsiz = 0;
- char *buf = NULL;
- int error = 0;
- bool relative = !!(what & CCP_RELATIVE);
- what &= ~CCP_RELATIVE;
-
- switch (what)
- {
- case CCP_POSIX_TO_WIN_A:
- p.check ((const char *) from,
- PC_POSIX | PC_SYM_FOLLOW | PC_NO_ACCESS_CHECK | PC_NOWARN
- | (relative ? PC_NOFULL : 0));
- if (p.error)
- return_with_errno (p.error);
- PUNICODE_STRING up = p.get_nt_native_path ();
- buf = tp.c_get ();
- sys_wcstombs (buf, NT_MAX_PATH, up->Buffer, up->Length / sizeof (WCHAR));
- /* Convert native path to standard DOS path. */
- if (!strncmp (buf, "\\??\\", 4))
- {
- buf += 4;
- if (buf[1] != ':') /* native UNC path */
- *(buf += 2) = '\\';
- }
- lsiz = strlen (buf) + 1;
- break;
- case CCP_POSIX_TO_WIN_W:
- p.check ((const char *) from,
- PC_POSIX | PC_SYM_FOLLOW | PC_NO_ACCESS_CHECK | PC_NOWARN
- | (relative ? PC_NOFULL : 0));
- if (p.error)
- return_with_errno (p.error);
- lsiz = (p.get_wide_win32_path_len () + 1) * sizeof (WCHAR);
- break;
- case CCP_WIN_A_TO_POSIX:
- buf = tp.c_get ();
- error = mount_table->conv_to_posix_path ((const char *) from, buf,
- relative);
- if (error)
- return_with_errno (error);
- lsiz = strlen (buf) + 1;
- break;
- case CCP_WIN_W_TO_POSIX:
- buf = tp.c_get ();
- error = mount_table->conv_to_posix_path ((const PWCHAR) from, buf,
- relative);
- if (error)
- return_with_errno (error);
- lsiz = strlen (buf) + 1;
- break;
- default:
- set_errno (EINVAL);
- return -1;
- }
- if (!size)
- return lsiz;
- if (size < lsiz)
- {
- set_errno (ENOSPC);
- return -1;
- }
- switch (what)
- {
- case CCP_POSIX_TO_WIN_A:
- case CCP_WIN_A_TO_POSIX:
- case CCP_WIN_W_TO_POSIX:
- strcpy ((char *) to, buf);
- break;
- case CCP_POSIX_TO_WIN_W:
- p.get_wide_win32_path ((PWCHAR) to);
- break;
- }
- return 0;
-}
-
-extern "C" void *
-cygwin_create_path (cygwin_conv_path_t what, const void *from)
-{
- void *to;
- ssize_t size = cygwin_conv_path (what, from, NULL, 0);
- if (size <= 0)
- return NULL;
- if (!(to = malloc (size)))
- return NULL;
- if (cygwin_conv_path (what, from, to, size) == -1)
- return NULL;
- return to;
-}
-
-
-extern "C" int
-cygwin_conv_to_win32_path (const char *path, char *win32_path)
-{
- return cygwin_conv_path (CCP_POSIX_TO_WIN_A | CCP_RELATIVE, path, win32_path,
- MAX_PATH);
-}
-
-extern "C" int
-cygwin_conv_to_full_win32_path (const char *path, char *win32_path)
-{
- return cygwin_conv_path (CCP_POSIX_TO_WIN_A | CCP_ABSOLUTE, path, win32_path,
- MAX_PATH);
-}
-
-/* This is exported to the world as cygwin_foo by cygwin.din. */
-
-extern "C" int
-cygwin_conv_to_posix_path (const char *path, char *posix_path)
-{
- return cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_RELATIVE, path, posix_path,
- MAX_PATH);
-}
-
-extern "C" int
-cygwin_conv_to_full_posix_path (const char *path, char *posix_path)
-{
- return cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, path, posix_path,
- MAX_PATH);
-}
-
-/* The realpath function is supported on some UNIX systems. */
-
-extern "C" char *
-realpath (const char *path, char *resolved)
-{
- /* Make sure the right errno is returned if path is NULL. */
- if (!path)
- {
- set_errno (EINVAL);
- return NULL;
- }
-
- /* Guard reading from a potentially invalid path and writing to a
- potentially invalid resolved. */
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return NULL;
-
- char *tpath;
- if (isdrive (path))
- {
- tpath = tp.c_get ();
- mount_table->cygdrive_posix_path (path, tpath, 0);
- }
- else
- tpath = (char *) path;
-
- path_conv real_path (tpath, PC_SYM_FOLLOW | PC_POSIX, stat_suffixes);
-
-
- /* Linux has this funny non-standard extension. If "resolved" is NULL,
- realpath mallocs the space by itself and returns it to the application.
- The application is responsible for calling free() then. This extension
- is backed by POSIX, which allows implementation-defined behaviour if
- "resolved" is NULL. That's good enough for us to do the same here. */
-
- if (!real_path.error && real_path.exists ())
- {
- if (!resolved)
- {
- resolved = (char *) malloc (strlen (real_path.normalized_path) + 1);
- if (!resolved)
- return NULL;
- }
- strcpy (resolved, real_path.normalized_path);
- return resolved;
- }
-
- /* FIXME: on error, we are supposed to put the name of the path
- component which could not be resolved into RESOLVED. */
- if (resolved)
- resolved[0] = '\0';
- set_errno (real_path.error ?: ENOENT);
- return NULL;
-}
-
-/* Return non-zero if path is a POSIX path list.
- This is exported to the world as cygwin_foo by cygwin.din.
-
-DOCTOOL-START
-<sect1 id="add-func-cygwin-posix-path-list-p">
- <para>Rather than use a mode to say what the "proper" path list
- format is, we allow any, and give apps the tools they need to
- convert between the two. If a ';' is present in the path list it's
- a Win32 path list. Otherwise, if the first path begins with
- [letter]: (in which case it can be the only element since if it
- wasn't a ';' would be present) it's a Win32 path list. Otherwise,
- it's a POSIX path list.</para>
-</sect1>
-DOCTOOL-END
- */
-
-extern "C" int
-cygwin_posix_path_list_p (const char *path)
-{
- int posix_p = !(strchr (path, ';') || isdrive (path));
- return posix_p;
-}
-
-/* These are used for apps that need to convert env vars like PATH back and
- forth. The conversion is a two step process. First, an upper bound on the
- size of the buffer needed is computed. Then the conversion is done. This
- allows the caller to use alloca if it wants. */
-
-static int
-conv_path_list_buf_size (const char *path_list, bool to_posix)
-{
- int i, num_elms, max_mount_path_len, size;
- const char *p;
-
- path_conv pc(".", PC_POSIX);
- /* The theory is that an upper bound is
- current_size + (num_elms * max_mount_path_len) */
- /* FIXME: This method is questionable in the long run. */
-
- unsigned nrel;
- char delim = to_posix ? ';' : ':';
- for (p = path_list, num_elms = nrel = 0; p; num_elms++)
- {
- if (!isabspath (p))
- nrel++;
- p = strchr (++p, delim);
- }
-
- /* 7: strlen ("//c") + slop, a conservative initial value */
- for (max_mount_path_len = sizeof ("/cygdrive/X"), i = 0;
- i < mount_table->nmounts; i++)
- {
- int mount_len = (to_posix
- ? mount_table->mount[i].posix_pathlen
- : mount_table->mount[i].native_pathlen);
- if (max_mount_path_len < mount_len)
- max_mount_path_len = mount_len;
- }
-
- /* 100: slop */
- size = strlen (path_list)
- + (num_elms * max_mount_path_len)
- + (nrel * strlen (to_posix ? pc.normalized_path : pc.get_win32 ()))
- + 100;
-
- return size;
-}
-
-
-extern "C" int
-cygwin_win32_to_posix_path_list_buf_size (const char *path_list)
-{
- return conv_path_list_buf_size (path_list, true);
-}
-
-extern "C" int
-cygwin_posix_to_win32_path_list_buf_size (const char *path_list)
-{
- return conv_path_list_buf_size (path_list, false);
-}
-
-extern "C" ssize_t
-env_PATH_to_posix (const void *win32, void *posix, size_t size)
-{
- return_with_errno (conv_path_list ((const char *) win32, (char *) posix,
- size, ENV_CVT));
-}
-
-extern "C" int
-cygwin_win32_to_posix_path_list (const char *win32, char *posix)
-{
- return_with_errno (conv_path_list (win32, posix, MAX_PATH, 1));
-}
-
-extern "C" int
-cygwin_posix_to_win32_path_list (const char *posix, char *win32)
-{
- return_with_errno (conv_path_list (posix, win32, MAX_PATH, 0));
-}
-
-extern "C" ssize_t
-cygwin_conv_path_list (cygwin_conv_path_t what, const void *from, void *to,
- size_t size)
-{
- /* FIXME: Path lists are (so far) always retaining relative paths. */
- what &= ~CCP_RELATIVE;
- switch (what)
- {
- case CCP_WIN_W_TO_POSIX:
- case CCP_POSIX_TO_WIN_W:
- /*FIXME*/
- api_fatal ("wide char path lists not yet supported");
- break;
- case CCP_WIN_A_TO_POSIX:
- case CCP_POSIX_TO_WIN_A:
- if (size == 0)
- return conv_path_list_buf_size ((const char *) from,
- what == CCP_WIN_A_TO_POSIX);
- return_with_errno (conv_path_list ((const char *) from, (char *) to,
- size, what == CCP_WIN_A_TO_POSIX));
- break;
- default:
- break;
- }
- set_errno (EINVAL);
- return -1;
-}
-
-/* cygwin_split_path: Split a path into directory and file name parts.
- Buffers DIR and FILE are assumed to be big enough.
-
- Examples (path -> `dir' / `file'):
- / -> `/' / `'
- "" -> `.' / `'
- . -> `.' / `.' (FIXME: should this be `.' / `'?)
- .. -> `.' / `..' (FIXME: should this be `..' / `'?)
- foo -> `.' / `foo'
- foo/bar -> `foo' / `bar'
- foo/bar/ -> `foo' / `bar'
- /foo -> `/' / `foo'
- /foo/bar -> `/foo' / `bar'
- c: -> `c:/' / `'
- c:/ -> `c:/' / `'
- c:foo -> `c:/' / `foo'
- c:/foo -> `c:/' / `foo'
- */
-
-extern "C" void
-cygwin_split_path (const char *path, char *dir, char *file)
-{
- int dir_started_p = 0;
-
- /* Deal with drives.
- Remember that c:foo <==> c:/foo. */
- if (isdrive (path))
- {
- *dir++ = *path++;
- *dir++ = *path++;
- *dir++ = '/';
- if (!*path)
- {
- *dir = 0;
- *file = 0;
- return;
- }
- if (isdirsep (*path))
- ++path;
- dir_started_p = 1;
- }
-
- /* Determine if there are trailing slashes and "delete" them if present.
- We pretend as if they don't exist. */
- const char *end = path + strlen (path);
- /* path + 1: keep leading slash. */
- while (end > path + 1 && isdirsep (end[-1]))
- --end;
-
- /* At this point, END points to one beyond the last character
- (with trailing slashes "deleted"). */
-
- /* Point LAST_SLASH at the last slash (duh...). */
- const char *last_slash;
- for (last_slash = end - 1; last_slash >= path; --last_slash)
- if (isdirsep (*last_slash))
- break;
-
- if (last_slash == path)
- {
- *dir++ = '/';
- *dir = 0;
- }
- else if (last_slash > path)
- {
- memcpy (dir, path, last_slash - path);
- dir[last_slash - path] = 0;
- }
- else
- {
- if (dir_started_p)
- ; /* nothing to do */
- else
- *dir++ = '.';
- *dir = 0;
- }
-
- memcpy (file, last_slash + 1, end - last_slash - 1);
- file[end - last_slash - 1] = 0;
-}
-
-/*****************************************************************************/
-
-static inline PRTL_USER_PROCESS_PARAMETERS
-get_user_proc_parms ()
-{
- return NtCurrentTeb ()->Peb->ProcessParameters;
-}
-
-/* Initialize cygcwd 'muto' for serializing access to cwd info. */
-void
-cwdstuff::init ()
-{
- cwd_lock.init ("cwd_lock");
- /* Initially re-open the cwd to allow POSIX semantics. */
- set (NULL, NULL, true);
-}
-
-/* Chdir and fill out the elements of a cwdstuff struct. */
-int
-cwdstuff::set (PUNICODE_STRING nat_cwd, const char *posix_cwd, bool doit)
-{
- int res = 0;
- UNICODE_STRING upath;
- size_t len = 0;
-
- cwd_lock.acquire ();
-
- if (nat_cwd)
- {
- upath = *nat_cwd;
- if (upath.Buffer[0] == L'/') /* Virtual path. Never use in PEB. */
- doit = false;
- else
- {
- len = upath.Length / sizeof (WCHAR) - 4;
- if (RtlEqualUnicodePathPrefix (&upath, L"\\??\\UNC\\", TRUE))
- len -= 2;
- }
- }
-
- if (doit)
- {
- /* We utilize the user parameter block. The directory is
- stored manually there. Why the hassle?
-
- - SetCurrentDirectory fails for directories with strict
- permissions even for processes with the SE_BACKUP_NAME
- privilege enabled. The reason is apparently that
- SetCurrentDirectory calls NtOpenFile without the
- FILE_OPEN_FOR_BACKUP_INTENT flag set.
-
- - Unlinking a cwd fails because SetCurrentDirectory seems to
- open directories so that deleting the directory is disallowed.
- The below code opens with *all* sharing flags set. */
- HANDLE h;
- NTSTATUS status;
- IO_STATUS_BLOCK io;
- OBJECT_ATTRIBUTES attr;
- PHANDLE phdl;
-
- RtlAcquirePebLock ();
- phdl = &get_user_proc_parms ()->CurrentDirectoryHandle;
- if (!nat_cwd) /* On init, just reopen CWD with desired access flags. */
- RtlInitUnicodeString (&upath, L"");
- /* This is for Win32 apps only. No case sensitivity here... */
- InitializeObjectAttributes (&attr, &upath,
- OBJ_CASE_INSENSITIVE | OBJ_INHERIT,
- nat_cwd ? NULL : *phdl, NULL);
- status = NtOpenFile (&h, SYNCHRONIZE | FILE_TRAVERSE, &attr, &io,
- FILE_SHARE_VALID_FLAGS,
- FILE_DIRECTORY_FILE
- | FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT);
- if (!NT_SUCCESS (status))
- {
- RtlReleasePebLock ();
- __seterrno_from_nt_status (status);
- res = -1;
- goto out;
- }
- /* Workaround a problem in Vista/Longhorn which fails in subsequent
- calls to CreateFile with ERROR_INVALID_HANDLE if the handle in
- CurrentDirectoryHandle changes without calling SetCurrentDirectory,
- and the filename given to CreateFile is a relative path. It looks
- like Vista stores a copy of the CWD handle in some other undocumented
- place. The NtClose/DuplicateHandle reuses the original handle for
- the copy of the new handle and the next CreateFile works.
- Note that this is not thread-safe (yet?) */
- NtClose (*phdl);
- if (DuplicateHandle (GetCurrentProcess (), h, GetCurrentProcess (), phdl,
- 0, TRUE, DUPLICATE_SAME_ACCESS))
- NtClose (h);
- else
- *phdl = h;
- dir = *phdl;
-
- /* No need to set path on init. */
- if (nat_cwd
- /* TODO:
- Check the length of the new CWD. Windows can only handle
- CWDs of up to MAX_PATH length, including a trailing backslash.
- If the path is longer, it's not an error condition for Cygwin,
- so we don't fail. Windows on the other hand has a problem now.
- For now, we just don't store the path in the PEB and proceed as
- usual. */
- && len <= MAX_PATH - (nat_cwd->Buffer[len - 1] == L'\\' ? 1 : 2))
- {
- /* Convert to a Win32 path. */
- upath.Buffer += upath.Length / sizeof (WCHAR) - len;
- if (upath.Buffer[1] == L'\\') /* UNC path */
- upath.Buffer[0] = L'\\';
- upath.Length = len * sizeof (WCHAR);
- /* Append backslash if necessary. */
- if (upath.Buffer[len - 1] != L'\\')
- {
- upath.Buffer[len] = L'\\';
- upath.Length += sizeof (WCHAR);
- }
- RtlCopyUnicodeString (&get_user_proc_parms ()->CurrentDirectoryName,
- &upath);
- }
-
- RtlReleasePebLock ();
- }
-
- if (nat_cwd || !win32.Buffer)
- {
- /* If there is no win32 path */
- if (!nat_cwd)
- {
- PUNICODE_STRING pdir;
-
- RtlAcquirePebLock ();
- pdir = &get_user_proc_parms ()->CurrentDirectoryName;
- RtlInitEmptyUnicodeString (&win32,
- (PWCHAR) crealloc_abort (win32.Buffer,
- pdir->Length + 2),
- pdir->Length + 2);
- RtlCopyUnicodeString (&win32, pdir);
- RtlReleasePebLock ();
- /* Remove trailing slash. */
- if (win32.Length > 3 * sizeof (WCHAR))
- win32.Length -= sizeof (WCHAR);
- posix_cwd = NULL;
- }
- else
- {
- if (upath.Buffer[0] == L'/') /* Virtual path, don't mangle. */
- ;
- else if (!doit)
- {
- /* Convert to a Win32 path. */
- upath.Buffer += upath.Length / sizeof (WCHAR) - len;
- if (upath.Buffer[1] == L'\\') /* UNC path */
- upath.Buffer[0] = L'\\';
- upath.Length = len * sizeof (WCHAR);
- }
- else if (upath.Length > 3 * sizeof (WCHAR))
- upath.Length -= sizeof (WCHAR); /* Strip trailing backslash */
- RtlInitEmptyUnicodeString (&win32,
- (PWCHAR) crealloc_abort (win32.Buffer,
- upath.Length + 2),
- upath.Length + 2);
- RtlCopyUnicodeString (&win32, &upath);
- }
- /* Make sure it's NUL-termniated. */
- win32.Buffer[win32.Length / sizeof (WCHAR)] = L'\0';
- if (!doit) /* Virtual path */
- drive_length = 0;
- else if (win32.Buffer[1] == L':') /* X: */
- drive_length = 2;
- else if (win32.Buffer[1] == L'\\') /* UNC path */
- {
- PWCHAR ptr = wcschr (win32.Buffer + 2, L'\\');
- if (ptr)
- ptr = wcschr (ptr + 1, L'\\');
- if (ptr)
- drive_length = ptr - win32.Buffer;
- else
- drive_length = win32.Length / sizeof (WCHAR);
- }
- else /* Shouldn't happen */
- drive_length = 0;
-
- tmp_pathbuf tp;
- if (!posix_cwd)
- {
- posix_cwd = (const char *) tp.c_get ();
- mount_table->conv_to_posix_path (win32.Buffer, (char *) posix_cwd, 0);
- }
- posix = (char *) crealloc_abort (posix, strlen (posix_cwd) + 1);
- stpcpy (posix, posix_cwd);
- }
-
-out:
- cwd_lock.release ();
- return res;
-}
-
-/* Copy the value for either the posix or the win32 cwd into a buffer. */
-char *
-cwdstuff::get (char *buf, int need_posix, int with_chroot, unsigned ulen)
-{
- MALLOC_CHECK;
-
- tmp_pathbuf tp;
- if (ulen)
- /* nothing */;
- else if (buf == NULL)
- ulen = (unsigned) -1;
- else
- {
- set_errno (EINVAL);
- goto out;
- }
-
- cwd_lock.acquire ();
-
- char *tocopy;
- if (!need_posix)
- {
- tocopy = tp.c_get ();
- sys_wcstombs (tocopy, NT_MAX_PATH, win32.Buffer,
- win32.Length / sizeof (WCHAR));
- }
- else
- tocopy = posix;
-
- debug_printf ("posix %s", posix);
- if (strlen (tocopy) >= ulen)
- {
- set_errno (ERANGE);
- buf = NULL;
- }
- else
- {
- if (!buf)
- buf = (char *) malloc (strlen (tocopy) + 1);
- strcpy (buf, tocopy);
- if (!buf[0]) /* Should only happen when chroot */
- strcpy (buf, "/");
- }
-
- cwd_lock.release ();
-
-out:
- syscall_printf ("(%s) = cwdstuff::get (%p, %d, %d, %d), errno %d",
- buf, buf, ulen, need_posix, with_chroot, errno);
- MALLOC_CHECK;
- return buf;
-}
-
-int etc::curr_ix = 0;
-/* Note that the first elements of the below arrays are unused */
-bool etc::change_possible[MAX_ETC_FILES + 1];
-OBJECT_ATTRIBUTES etc::fn[MAX_ETC_FILES + 1];
-LARGE_INTEGER etc::last_modified[MAX_ETC_FILES + 1];
-
-int
-etc::init (int n, POBJECT_ATTRIBUTES attr)
-{
- if (n > 0)
- /* ok */;
- else if (++curr_ix <= MAX_ETC_FILES)
- n = curr_ix;
- else
- api_fatal ("internal error");
-
- fn[n] = *attr;
- change_possible[n] = false;
- test_file_change (n);
- paranoid_printf ("fn[%d] %S, curr_ix %d", n, fn[n].ObjectName, curr_ix);
- return n;
-}
-
-bool
-etc::test_file_change (int n)
-{
- NTSTATUS status;
- FILE_NETWORK_OPEN_INFORMATION fnoi;
- bool res;
-
- status = NtQueryFullAttributesFile (&fn[n], &fnoi);
- if (!NT_SUCCESS (status))
- {
- res = true;
- memset (last_modified + n, 0, sizeof (last_modified[n]));
- debug_printf ("NtQueryFullAttributesFile (%S) failed, %p",
- fn[n].ObjectName, status);
- }
- else
- {
- res = CompareFileTime ((FILETIME *) &fnoi.LastWriteTime,
- (FILETIME *) last_modified + n) > 0;
- last_modified[n].QuadPart = fnoi.LastWriteTime.QuadPart;
- }
-
- paranoid_printf ("fn[%d] %S res %d", n, fn[n].ObjectName, res);
- return res;
-}
-
-bool
-etc::dir_changed (int n)
-{
- if (!change_possible[n])
- {
- static HANDLE changed_h NO_COPY;
- NTSTATUS status;
- IO_STATUS_BLOCK io;
-
- if (!changed_h)
- {
- OBJECT_ATTRIBUTES attr;
-
- path_conv dir ("/etc");
- status = NtOpenFile (&changed_h, SYNCHRONIZE | FILE_LIST_DIRECTORY,
- dir.get_object_attr (attr, sec_none_nih), &io,
- FILE_SHARE_VALID_FLAGS, FILE_DIRECTORY_FILE);
- if (!NT_SUCCESS (status))
- {
-#ifdef DEBUGGING
- system_printf ("NtOpenFile (%S) failed, %p",
- dir.get_nt_native_path (), status);
-#endif
- changed_h = INVALID_HANDLE_VALUE;
- }
- else
- {
- status = NtNotifyChangeDirectoryFile (changed_h, NULL, NULL,
- NULL, &io, NULL, 0,
- FILE_NOTIFY_CHANGE_LAST_WRITE
- | FILE_NOTIFY_CHANGE_FILE_NAME,
- FALSE);
- if (!NT_SUCCESS (status))
- {
-#ifdef DEBUGGING
- system_printf ("NtNotifyChangeDirectoryFile (1) failed, %p",
- status);
-#endif
- NtClose (changed_h);
- changed_h = INVALID_HANDLE_VALUE;
- }
- }
- memset (change_possible, true, sizeof (change_possible));
- }
-
- if (changed_h == INVALID_HANDLE_VALUE)
- change_possible[n] = true;
- else if (WaitForSingleObject (changed_h, 0) == WAIT_OBJECT_0)
- {
- status = NtNotifyChangeDirectoryFile (changed_h, NULL, NULL,
- NULL, &io, NULL, 0,
- FILE_NOTIFY_CHANGE_LAST_WRITE
- | FILE_NOTIFY_CHANGE_FILE_NAME,
- FALSE);
- if (!NT_SUCCESS (status))
- {
-#ifdef DEBUGGING
- system_printf ("NtNotifyChangeDirectoryFile (2) failed, %p",
- status);
-#endif
- NtClose (changed_h);
- changed_h = INVALID_HANDLE_VALUE;
- }
- memset (change_possible, true, sizeof change_possible);
- }
- }
-
- paranoid_printf ("fn[%d] %S change_possible %d",
- n, fn[n].ObjectName, change_possible[n]);
- return change_possible[n];
-}
-
-bool
-etc::file_changed (int n)
-{
- bool res = false;
- if (dir_changed (n) && test_file_change (n))
- res = true;
- change_possible[n] = false; /* Change is no longer possible */
- paranoid_printf ("fn[%d] %S res %d", n, fn[n].ObjectName, res);
- return res;
-}
-
-/* No need to be reentrant or thread-safe according to SUSv3.
- / and \\ are treated equally. Leading drive specifiers are
- kept intact as far as it makes sense. Everything else is
- POSIX compatible. */
-extern "C" char *
-basename (char *path)
-{
- static char buf[4];
- char *c, *d, *bs = path;
-
- if (!path || !*path)
- return strcpy (buf, ".");
- if (isalpha (path[0]) && path[1] == ':')
- bs += 2;
- else if (strspn (path, "/\\") > 1)
- ++bs;
- c = strrchr (bs, '/');
- if ((d = strrchr (c ?: bs, '\\')) > c)
- c = d;
- if (c)
- {
- /* Trailing (back)slashes are eliminated. */
- while (c && c > bs && c[1] == '\0')
- {
- *c = '\0';
- c = strrchr (bs, '/');
- if ((d = strrchr (c ?: bs, '\\')) > c)
- c = d;
- }
- if (c && (c > bs || c[1]))
- return c + 1;
- }
- else if (!bs[0])
- {
- stpncpy (buf, path, bs - path);
- stpcpy (buf + (bs - path), ".");
- return buf;
- }
- return path;
-}
-
-/* No need to be reentrant or thread-safe according to SUSv3.
- / and \\ are treated equally. Leading drive specifiers and
- leading double (back)slashes are kept intact as far as it
- makes sense. Everything else is POSIX compatible. */
-extern "C" char *
-dirname (char *path)
-{
- static char buf[4];
- char *c, *d, *bs = path;
-
- if (!path || !*path)
- return strcpy (buf, ".");
- if (isalpha (path[0]) && path[1] == ':')
- bs += 2;
- else if (strspn (path, "/\\") > 1)
- ++bs;
- c = strrchr (bs, '/');
- if ((d = strrchr (c ?: bs, '\\')) > c)
- c = d;
- if (c)
- {
- /* Trailing (back)slashes are eliminated. */
- while (c && c > bs && c[1] == '\0')
- {
- *c = '\0';
- c = strrchr (bs, '/');
- if ((d = strrchr (c ?: bs, '\\')) > c)
- c = d;
- }
- if (!c)
- strcpy (bs, ".");
- else if (c > bs)
- {
- /* More trailing (back)slashes are eliminated. */
- while (c > bs && (*c == '/' || *c == '\\'))
- *c-- = '\0';
- }
- else
- c[1] = '\0';
- }
- else
- {
- stpncpy (buf, path, bs - path);
- stpcpy (buf + (bs - path), ".");
- return buf;
- }
- return path;
-}
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
deleted file mode 100644
index 4c6f5cba162..00000000000
--- a/winsup/cygwin/path.h
+++ /dev/null
@@ -1,360 +0,0 @@
-/* path.h: path data structures
-
- Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "devices.h"
-
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#define isproc_dev(devn) \
- (devn == FH_PROC || devn == FH_REGISTRY || devn == FH_PROCESS || \
- devn == FH_PROCNET)
-
-#define isvirtual_dev(devn) \
- (isproc_dev (devn) || devn == FH_CYGDRIVE || devn == FH_NETDRIVE)
-
-inline bool
-has_attribute (DWORD attributes, DWORD attribs_to_test)
-{
- return attributes != INVALID_FILE_ATTRIBUTES
- && (attributes & attribs_to_test);
-}
-
-enum executable_states
-{
- is_executable,
- dont_care_if_executable,
- not_executable = dont_care_if_executable,
- dont_know_if_executable
-};
-
-struct suffix_info
-{
- const char *name;
- int addon;
- suffix_info (const char *s, int addit = 0): name (s), addon (addit) {}
-};
-
-extern suffix_info stat_suffixes[];
-
-enum pathconv_arg
-{
- PC_SYM_FOLLOW = 0x0001,
- PC_SYM_NOFOLLOW = 0x0002,
- PC_SYM_CONTENTS = 0x0008,
- PC_NOFULL = 0x0010,
- PC_NULLEMPTY = 0x0020,
- PC_CHECK_EA = 0x0040,
- PC_POSIX = 0x0080,
- PC_NOWARN = 0x0100,
- PC_NO_ACCESS_CHECK = 0x00800000
-};
-
-#define PC_NONULLEMPTY -1
-
-#include "sys/mount.h"
-
-enum path_types
-{
- PATH_NOTHING = 0,
- PATH_SYMLINK = MOUNT_SYMLINK,
- PATH_BINARY = MOUNT_BINARY,
- PATH_EXEC = MOUNT_EXEC,
- PATH_NOTEXEC = MOUNT_NOTEXEC,
- PATH_CYGWIN_EXEC = MOUNT_CYGWIN_EXEC,
- PATH_RO = MOUNT_RO,
- PATH_NOACL = MOUNT_NOACL,
- PATH_NOPOSIX = MOUNT_NOPOSIX,
- PATH_ALL_EXEC = (PATH_CYGWIN_EXEC | PATH_EXEC),
- PATH_NO_ACCESS_CHECK = PC_NO_ACCESS_CHECK,
- PATH_LNK = 0x01000000,
- PATH_TEXT = 0x02000000,
- PATH_REP = 0x04000000,
- PATH_HAS_SYMLINKS = 0x10000000,
- PATH_SOCKET = 0x40000000
-};
-
-class symlink_info;
-struct fs_info
-{
- private:
- struct status_flags
- {
- ULONG flags; /* Volume flags */
- ULONG samba_version; /* Samba version if available */
- ULONG name_len; /* MaximumComponentNameLength */
- unsigned is_remote_drive : 1;
- unsigned has_buggy_open : 1;
- unsigned has_buggy_fileid_dirinfo : 1;
- unsigned has_acls : 1;
- unsigned hasgood_inode : 1;
- unsigned caseinsensitive : 1;
- unsigned is_fat : 1;
- unsigned is_ntfs : 1;
- unsigned is_samba : 1;
- unsigned is_nfs : 1;
- unsigned is_netapp : 1;
- unsigned is_cdrom : 1;
- } status;
- ULONG sernum;
- public:
- void clear () { memset (&status, 0 , sizeof status); sernum = 0UL; }
- fs_info () { clear (); }
-
- IMPLEMENT_STATUS_FLAG (ULONG, flags)
- IMPLEMENT_STATUS_FLAG (ULONG, samba_version)
- IMPLEMENT_STATUS_FLAG (ULONG, name_len)
- IMPLEMENT_STATUS_FLAG (bool, is_remote_drive)
- IMPLEMENT_STATUS_FLAG (bool, has_buggy_open)
- IMPLEMENT_STATUS_FLAG (bool, has_buggy_fileid_dirinfo)
- IMPLEMENT_STATUS_FLAG (bool, has_acls)
- IMPLEMENT_STATUS_FLAG (bool, hasgood_inode)
- IMPLEMENT_STATUS_FLAG (bool, caseinsensitive)
- IMPLEMENT_STATUS_FLAG (bool, is_fat)
- IMPLEMENT_STATUS_FLAG (bool, is_ntfs)
- IMPLEMENT_STATUS_FLAG (bool, is_samba)
- IMPLEMENT_STATUS_FLAG (bool, is_nfs)
- IMPLEMENT_STATUS_FLAG (bool, is_netapp)
- IMPLEMENT_STATUS_FLAG (bool, is_cdrom)
- ULONG serial_number () const { return sernum; }
-
- bool update (PUNICODE_STRING, HANDLE) __attribute__ ((regparm (3)));
-};
-
-class path_conv
-{
- DWORD fileattr;
- ULONG caseinsensitive;
- fs_info fs;
- PWCHAR wide_path;
- UNICODE_STRING uni_path;
- void add_ext_from_sym (symlink_info&);
- public:
-
- unsigned path_flags;
- char *known_suffix;
- int error;
- device dev;
-
- bool isremote () const {return fs.is_remote_drive ();}
- ULONG objcaseinsensitive () const {return caseinsensitive;}
- bool has_acls () const {return !(path_flags & PATH_NOACL) && fs.has_acls (); }
- bool hasgood_inode () const {return fs.hasgood_inode (); }
- bool isgood_inode (__ino64_t ino) const;
- int has_symlinks () const {return path_flags & PATH_HAS_SYMLINKS;}
- int has_buggy_open () const {return fs.has_buggy_open ();}
- int has_buggy_fileid_dirinfo () const {return fs.has_buggy_fileid_dirinfo ();}
- int binmode () const
- {
- if (path_flags & PATH_BINARY)
- return O_BINARY;
- if (path_flags & PATH_TEXT)
- return O_TEXT;
- return 0;
- }
- int issymlink () const {return path_flags & PATH_SYMLINK;}
- int is_lnk_symlink () const {return path_flags & PATH_LNK;}
- int is_rep_symlink () const {return path_flags & PATH_REP;}
- int isdevice () const {return dev.devn && dev.devn != FH_FS && dev.devn != FH_FIFO;}
- int isfifo () const {return dev == FH_FIFO;}
- int isspecial () const {return dev.devn && dev.devn != FH_FS;}
- int iscygdrive () const {return dev.devn == FH_CYGDRIVE;}
- int is_auto_device () const {return isdevice () && !is_fs_special ();}
- int is_fs_device () const {return isdevice () && is_fs_special ();}
- int is_fs_special () const {return dev.is_fs_special ();}
- int is_lnk_special () const {return is_fs_device () || isfifo () || is_lnk_symlink ();}
- int issocket () const {return dev.devn == FH_UNIX;}
- int iscygexec () const {return path_flags & PATH_CYGWIN_EXEC;}
- void set_cygexec (bool isset)
- {
- if (isset)
- path_flags |= PATH_CYGWIN_EXEC;
- else
- path_flags &= ~PATH_CYGWIN_EXEC;
- }
- bool isro () const {return !!(path_flags & PATH_RO);}
- bool exists () const {return fileattr != INVALID_FILE_ATTRIBUTES;}
- bool has_attribute (DWORD x) const {return exists () && (fileattr & x);}
- int isdir () const {return has_attribute (FILE_ATTRIBUTE_DIRECTORY);}
- executable_states exec_state ()
- {
- extern int _check_for_executable;
- if (path_flags & PATH_ALL_EXEC)
- return is_executable;
- if (path_flags & PATH_NOTEXEC)
- return not_executable;
- if (!_check_for_executable)
- return dont_care_if_executable;
- return dont_know_if_executable;
- }
-
- void set_symlink (DWORD n) {path_flags |= PATH_SYMLINK; symlink_length = n;}
- void set_has_symlinks () {path_flags |= PATH_HAS_SYMLINKS;}
- void set_exec (int x = 1) {path_flags |= x ? PATH_EXEC : PATH_NOTEXEC;}
-
- void check (const UNICODE_STRING *upath, unsigned opt = PC_SYM_FOLLOW,
- const suffix_info *suffixes = NULL) __attribute__ ((regparm(3)));
- void check (const char *src, unsigned opt = PC_SYM_FOLLOW,
- const suffix_info *suffixes = NULL) __attribute__ ((regparm(3)));
-
- path_conv (const device& in_dev)
- : fileattr (INVALID_FILE_ATTRIBUTES), wide_path (NULL), path_flags (0),
- known_suffix (NULL), error (0), dev (in_dev), normalized_path (NULL),
- normalized_path_size (0)
- {
- strcpy (path, in_dev.native);
- }
-
- path_conv (int, const char *src, unsigned opt = PC_SYM_FOLLOW,
- const suffix_info *suffixes = NULL)
- : wide_path (NULL), normalized_path (NULL), normalized_path_size (0)
- {
- check (src, opt, suffixes);
- }
-
- path_conv (const UNICODE_STRING *src, unsigned opt = PC_SYM_FOLLOW,
- const suffix_info *suffixes = NULL)
- : wide_path (NULL), normalized_path (NULL), normalized_path_size (0)
- {
- check (src, opt | PC_NULLEMPTY, suffixes);
- }
-
- path_conv (const char *src, unsigned opt = PC_SYM_FOLLOW,
- const suffix_info *suffixes = NULL)
- : wide_path (NULL), normalized_path (NULL), normalized_path_size (0)
- {
- check (src, opt | PC_NULLEMPTY, suffixes);
- }
-
- path_conv ()
- : fileattr (INVALID_FILE_ATTRIBUTES), wide_path (NULL), path_flags (0),
- known_suffix (NULL), error (0), normalized_path (NULL),
- normalized_path_size (0)
- {
- path[0] = '\0';
- }
-
- ~path_conv ();
- inline char *get_win32 () { return path; }
- PUNICODE_STRING get_nt_native_path ();
- POBJECT_ATTRIBUTES get_object_attr (OBJECT_ATTRIBUTES &attr,
- SECURITY_ATTRIBUTES &sa);
- inline size_t get_wide_win32_path_len ()
- {
- get_nt_native_path ();
- return uni_path.Length / sizeof (WCHAR);
- }
-
- PWCHAR get_wide_win32_path (PWCHAR wc);
- operator DWORD &() {return fileattr;}
- operator int () {return fileattr; }
- path_conv &operator =(path_conv &pc)
- {
- memcpy (this, &pc, pc.size ());
- set_normalized_path (pc.normalized_path);
- wide_path = NULL;
- return *this;
- }
- DWORD get_devn () const {return dev.devn;}
- short get_unitn () const {return dev.minor;}
- DWORD file_attributes () const {return fileattr;}
- void file_attributes (DWORD new_attr) {fileattr = new_attr;}
- DWORD fs_flags () {return fs.flags ();}
- DWORD fs_name_len () {return fs.name_len ();}
- bool fs_is_fat () const {return fs.is_fat ();}
- bool fs_is_ntfs () const {return fs.is_ntfs ();}
- bool fs_is_samba () const {return fs.is_samba ();}
- bool fs_is_nfs () const {return fs.is_nfs ();}
- bool fs_is_netapp () const {return fs.is_netapp ();}
- bool fs_is_cdrom () const {return fs.is_cdrom ();}
- ULONG fs_serial_number () const {return fs.serial_number ();}
- void set_path (const char *p) {strcpy (path, p);}
- void fillin (HANDLE h);
- inline size_t size ()
- {
- return (sizeof (*this) - sizeof (path)) + strlen (path) + 1 + normalized_path_size;
- }
- bool is_binary ();
-
- unsigned __stdcall ndisk_links (DWORD);
- char *normalized_path;
- size_t normalized_path_size;
- void set_normalized_path (const char *) __attribute__ ((regparm (2)));
- DWORD get_symlink_length () { return symlink_length; };
- private:
- DWORD symlink_length;
- char path[NT_MAX_PATH];
-};
-
-/* Symlink marker */
-#define SYMLINK_COOKIE "!<symlink>"
-
-/* Socket marker */
-#define SOCKET_COOKIE "!<socket >"
-
-int __stdcall slash_unc_prefix_p (const char *path) __attribute__ ((regparm(1)));
-
-enum fe_types
-{
- FE_NADA = 0, /* Nothing special */
- FE_NNF = 1, /* Return NULL if not found */
- FE_NATIVE = 2, /* Return native path in path_conv struct */
- FE_CWD = 4, /* Search CWD for program */
- FE_DLL = 8 /* Search for DLLs, not executables. */
-};
-const char *__stdcall find_exec (const char *name, path_conv& buf,
- const char *winenv = "PATH=",
- unsigned opt = FE_NADA,
- const char **known_suffix = NULL)
- __attribute__ ((regparm(3)));
-
-/* Common macros for checking for invalid path names */
-#define isdrive(s) (isalpha (*(s)) && (s)[1] == ':')
-#define iswdrive(s) (iswalpha (*(s)) && (s)[1] == L':')
-
-static inline bool
-has_exec_chars (const char *buf, int len)
-{
- return len >= 2 &&
- ((buf[0] == '#' && buf[1] == '!') ||
- (buf[0] == ':' && buf[1] == '\n') ||
- (buf[0] == 'M' && buf[1] == 'Z'));
-}
-
-int pathmatch (const char *path1, const char *path2, bool caseinsensitive) __attribute__ ((regparm (3)));
-int pathnmatch (const char *path1, const char *path2, int len, bool caseinsensitive) __attribute__ ((regparm (3)));
-bool has_dot_last_component (const char *dir, bool test_dot_dot) __attribute__ ((regparm (2)));
-
-int path_prefix_p (const char *path1, const char *path2, int len1,
- bool caseinsensitive) __attribute__ ((regparm (3)));
-
-bool is_floppy (const char *);
-int normalize_win32_path (const char *, char *, char *&);
-int normalize_posix_path (const char *, char *, char *&);
-PUNICODE_STRING get_nt_native_path (const char *, UNICODE_STRING&);
-
-/* FIXME: Move to own include file eventually */
-
-#define MAX_ETC_FILES 2
-class etc
-{
- friend class dtable;
- static int curr_ix;
- static HANDLE changed_h;
- static bool change_possible[MAX_ETC_FILES + 1];
- static OBJECT_ATTRIBUTES fn[MAX_ETC_FILES + 1];
- static LARGE_INTEGER last_modified[MAX_ETC_FILES + 1];
- static bool dir_changed (int);
- static int init (int, POBJECT_ATTRIBUTES);
- static bool file_changed (int);
- static bool test_file_change (int);
- friend class pwdgrp;
-};
diff --git a/winsup/cygwin/regex/regex.h b/winsup/cygwin/regex/regex.h
deleted file mode 100644
index 03a1825557c..00000000000
--- a/winsup/cygwin/regex/regex.h
+++ /dev/null
@@ -1,76 +0,0 @@
-#ifndef _REGEX_H_
-#define _REGEX_H_ /* never again */
-#include <sys/types.h>
-/* ========= begin header generated by ./mkh ========= */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* === regex2.h === */
-typedef _off_t regoff_t;
-typedef struct {
- int re_magic;
- size_t re_nsub; /* number of parenthesized subexpressions */
- const char *re_endp; /* end pointer for REG_PEND */
- struct re_guts *re_g; /* none of your business :-) */
-} regex_t;
-typedef struct {
- regoff_t rm_so; /* start of match */
- regoff_t rm_eo; /* end of match */
-} regmatch_t;
-
-
-/* === regcomp.c === */
-extern int regcomp(regex_t *, const char *, int);
-#define REG_BASIC 0000
-#define REG_EXTENDED 0001
-#define REG_ICASE 0002
-#define REG_NOSUB 0004
-#define REG_NEWLINE 0010
-#define REG_NOSPEC 0020
-#define REG_PEND 0040
-#define REG_DUMP 0200
-
-
-/* === regerror.c === */
-#define REG_OKAY 0
-#define REG_NOMATCH 1
-#define REG_BADPAT 2
-#define REG_ECOLLATE 3
-#define REG_ECTYPE 4
-#define REG_EESCAPE 5
-#define REG_ESUBREG 6
-#define REG_EBRACK 7
-#define REG_EPAREN 8
-#define REG_EBRACE 9
-#define REG_BADBR 10
-#define REG_ERANGE 11
-#define REG_ESPACE 12
-#define REG_BADRPT 13
-#define REG_EMPTY 14
-#define REG_ASSERT 15
-#define REG_INVARG 16
-#define REG_ATOI 255 /* convert name to number (!) */
-#define REG_ITOA 0400 /* convert number to name (!) */
-extern size_t regerror(int, const regex_t *, char *, size_t);
-
-
-/* === regexec.c === */
-extern int regexec(const regex_t *, const char *, size_t, regmatch_t [], int);
-#define REG_NOTBOL 00001
-#define REG_NOTEOL 00002
-#define REG_STARTEND 00004
-#define REG_TRACE 00400 /* tracing of execution */
-#define REG_LARGE 01000 /* force large representation */
-#define REG_BACKR 02000 /* force use of backref code */
-
-
-/* === regfree.c === */
-extern void regfree(regex_t *);
-
-
-#ifdef __cplusplus
-}
-#endif
-/* ========= end header generated by ./mkh ========= */
-#endif
diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc
deleted file mode 100644
index 5043455735c..00000000000
--- a/winsup/cygwin/sec_auth.cc
+++ /dev/null
@@ -1,1171 +0,0 @@
-/* sec_auth.cc: NT authentication functions
-
- Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "winsup.h"
-#include <stdlib.h>
-#include <wchar.h>
-#include <wininet.h>
-#include <ntsecapi.h>
-#include <dsgetdc.h>
-#include "cygerrno.h"
-#include "security.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "cygheap.h"
-#include "ntdll.h"
-#include "tls_pbuf.h"
-#include <lm.h>
-#include <iptypes.h>
-#include "pwdgrp.h"
-#include "cyglsa.h"
-#include <cygwin/version.h>
-
-extern "C" void
-cygwin_set_impersonation_token (const HANDLE hToken)
-{
- debug_printf ("set_impersonation_token (%d)", hToken);
- cygheap->user.external_token = hToken == INVALID_HANDLE_VALUE ? NO_IMPERSONATION : hToken;
-}
-
-void
-extract_nt_dom_user (const struct passwd *pw, PWCHAR domain, PWCHAR user)
-{
-
- cygsid psid;
- DWORD ulen = UNLEN + 1;
- DWORD dlen = MAX_DOMAIN_NAME_LEN + 1;
- SID_NAME_USE use;
-
- debug_printf ("pw_gecos %x (%s)", pw->pw_gecos, pw->pw_gecos);
-
- if (psid.getfrompw (pw)
- && LookupAccountSidW (NULL, psid, user, &ulen, domain, &dlen, &use))
- return;
-
- char *d, *u, *c;
- domain[0] = L'\0';
- sys_mbstowcs (user, UNLEN + 1, pw->pw_name);
- if ((d = strstr (pw->pw_gecos, "U-")) != NULL &&
- (d == pw->pw_gecos || d[-1] == ','))
- {
- c = strechr (d + 2, ',');
- if ((u = strechr (d + 2, '\\')) >= c)
- u = d + 1;
- else if (u - d <= MAX_DOMAIN_NAME_LEN + 2)
- sys_mbstowcs (domain, MAX_DOMAIN_NAME_LEN + 1, d + 2, u - d - 1);
- if (c - u <= UNLEN + 1)
- sys_mbstowcs (user, UNLEN + 1, u + 1, c - u);
- }
-}
-
-extern "C" HANDLE
-cygwin_logon_user (const struct passwd *pw, const char *password)
-{
- if (!pw || !password)
- {
- set_errno (EINVAL);
- return INVALID_HANDLE_VALUE;
- }
-
- WCHAR nt_domain[MAX_DOMAIN_NAME_LEN + 1];
- WCHAR nt_user[UNLEN + 1];
- PWCHAR passwd;
- HANDLE hToken;
- tmp_pathbuf tp;
-
- extract_nt_dom_user (pw, nt_domain, nt_user);
- debug_printf ("LogonUserW (%W, %W, ...)", nt_user, nt_domain);
- sys_mbstowcs (passwd = tp.w_get (), NT_MAX_PATH, password);
- /* CV 2005-06-08: LogonUser should run under the primary process token,
- otherwise it returns with ERROR_ACCESS_DENIED. */
- cygheap->user.deimpersonate ();
- if (!LogonUserW (nt_user, *nt_domain ? nt_domain : NULL, passwd,
- LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT,
- &hToken))
- {
- __seterrno ();
- hToken = INVALID_HANDLE_VALUE;
- }
- else if (!SetHandleInformation (hToken,
- HANDLE_FLAG_INHERIT,
- HANDLE_FLAG_INHERIT))
- {
- __seterrno ();
- CloseHandle (hToken);
- hToken = INVALID_HANDLE_VALUE;
- }
- cygheap->user.reimpersonate ();
- debug_printf ("%d = logon_user(%s,...)", hToken, pw->pw_name);
- return hToken;
-}
-
-static void
-str2lsa (LSA_STRING &tgt, const char *srcstr)
-{
- tgt.Length = strlen (srcstr);
- tgt.MaximumLength = tgt.Length + 1;
- tgt.Buffer = (PCHAR) srcstr;
-}
-
-static void
-str2buf2lsa (LSA_STRING &tgt, char *buf, const char *srcstr)
-{
- tgt.Length = strlen (srcstr);
- tgt.MaximumLength = tgt.Length + 1;
- tgt.Buffer = (PCHAR) buf;
- memcpy (buf, srcstr, tgt.MaximumLength);
-}
-
-/* The dimension of buf is assumed to be at least strlen(srcstr) + 1,
- The result will be shorter if the input has multibyte chars */
-void
-str2buf2uni (UNICODE_STRING &tgt, WCHAR *buf, const char *srcstr)
-{
- tgt.Buffer = (PWCHAR) buf;
- tgt.MaximumLength = (strlen (srcstr) + 1) * sizeof (WCHAR);
- tgt.Length = sys_mbstowcs (buf, tgt.MaximumLength / sizeof (WCHAR), srcstr)
- * sizeof (WCHAR);
- if (tgt.Length)
- tgt.Length -= sizeof (WCHAR);
-}
-
-void
-str2uni_cat (UNICODE_STRING &tgt, const char *srcstr)
-{
- int len = sys_mbstowcs (tgt.Buffer + tgt.Length / sizeof (WCHAR),
- (tgt.MaximumLength - tgt.Length) / sizeof (WCHAR),
- srcstr);
- if (len)
- tgt.Length += (len - 1) * sizeof (WCHAR);
- else
- tgt.Length = tgt.MaximumLength = 0;
-}
-
-static LSA_HANDLE
-open_local_policy ()
-{
- LSA_OBJECT_ATTRIBUTES oa = { 0, 0, 0, 0, 0, 0 };
- LSA_HANDLE lsa = INVALID_HANDLE_VALUE;
-
- NTSTATUS ret = LsaOpenPolicy (NULL, &oa, POLICY_EXECUTE, &lsa);
- if (ret != STATUS_SUCCESS)
- __seterrno_from_win_error (LsaNtStatusToWinError (ret));
- return lsa;
-}
-
-static void
-close_local_policy (LSA_HANDLE &lsa)
-{
- if (lsa != INVALID_HANDLE_VALUE)
- LsaClose (lsa);
- lsa = INVALID_HANDLE_VALUE;
-}
-
-bool
-get_logon_server (PWCHAR domain, WCHAR *server, bool rediscovery)
-{
- DWORD dret;
- PDOMAIN_CONTROLLER_INFOW pci;
- WCHAR *buf;
- DWORD size = MAX_COMPUTERNAME_LENGTH + 1;
-
- /* Empty domain is interpreted as local system */
- if ((GetComputerNameW (server + 2, &size)) &&
- (!wcscasecmp (domain, server + 2) || !domain[0]))
- {
- server[0] = server[1] = L'\\';
- return true;
- }
-
- /* Try to get any available domain controller for this domain */
- dret = DsGetDcNameW (NULL, domain, NULL, NULL,
- rediscovery ? DS_FORCE_REDISCOVERY : 0, &pci);
- if (dret == ERROR_SUCCESS)
- {
- wcscpy (server, pci->DomainControllerName);
- NetApiBufferFree (pci);
- debug_printf ("DC: rediscovery: %d, server: %W", rediscovery, server);
- return true;
- }
- else if (dret == ERROR_PROC_NOT_FOUND)
- {
- /* NT4 w/o DSClient */
- if (rediscovery)
- dret = NetGetAnyDCName (NULL, domain, (LPBYTE *) &buf);
- else
- dret = NetGetDCName (NULL, domain, (LPBYTE *) &buf);
- if (dret == NERR_Success)
- {
- wcscpy (server, buf);
- NetApiBufferFree (buf);
- debug_printf ("NT: rediscovery: %d, server: %W", rediscovery, server);
- return true;
- }
- }
- __seterrno_from_win_error (dret);
- return false;
-}
-
-static bool
-get_user_groups (WCHAR *logonserver, cygsidlist &grp_list,
- PWCHAR user, PWCHAR domain)
-{
- WCHAR dgroup[MAX_DOMAIN_NAME_LEN + GNLEN + 2];
- LPGROUP_USERS_INFO_0 buf;
- DWORD cnt, tot, len;
- NET_API_STATUS ret;
-
- /* Look only on logonserver */
- ret = NetUserGetGroups (logonserver, user, 0, (LPBYTE *) &buf,
- MAX_PREFERRED_LENGTH, &cnt, &tot);
- if (ret)
- {
- __seterrno_from_win_error (ret);
- /* It's no error when the user name can't be found. */
- return ret == NERR_UserNotFound;
- }
-
- len = wcslen (domain);
- wcscpy (dgroup, domain);
- dgroup[len++] = L'\\';
-
- for (DWORD i = 0; i < cnt; ++i)
- {
- cygsid gsid;
- DWORD glen = MAX_SID_LEN;
- WCHAR dom[MAX_DOMAIN_NAME_LEN + 1];
- DWORD dlen = sizeof (dom);
- SID_NAME_USE use = SidTypeInvalid;
-
- wcscpy (dgroup + len, buf[i].grui0_name);
- if (!LookupAccountNameW (NULL, dgroup, gsid, &glen, dom, &dlen, &use))
- debug_printf ("LookupAccountName(%W), %E", dgroup);
- else if (legal_sid_type (use))
- grp_list += gsid;
- else
- debug_printf ("Global group %W invalid. Use: %d", dgroup, use);
- }
-
- NetApiBufferFree (buf);
- return true;
-}
-
-static bool
-is_group_member (PWCHAR logonserver, PWCHAR group, PSID pusersid,
- cygsidlist &grp_list)
-{
- LPLOCALGROUP_MEMBERS_INFO_1 buf;
- DWORD cnt, tot;
- NET_API_STATUS ret;
-
- /* Members can be users or global groups */
- ret = NetLocalGroupGetMembers (logonserver, group, 1, (LPBYTE *) &buf,
- MAX_PREFERRED_LENGTH, &cnt, &tot, NULL);
- if (ret)
- return false;
-
- bool retval = true;
- for (DWORD bidx = 0; bidx < cnt; ++bidx)
- if (EqualSid (pusersid, buf[bidx].lgrmi1_sid))
- goto done;
- else
- {
- /* The extra test for the group being a global group or a well-known
- group is necessary, since apparently also aliases (for instance
- Administrators or Users) can be members of local groups, even
- though MSDN states otherwise. The GUI refuses to put aliases into
- local groups, but the CLI interface allows it. However, a normal
- logon token does not contain groups, in which the user is only
- indirectly a member by being a member of an alias in this group.
- So we also should not put them into the token group list.
- Note: Allowing those groups in our group list renders external
- tokens invalid, so that it becomes impossible to logon with
- password and valid logon token. */
- for (int glidx = 0; glidx < grp_list.count (); ++glidx)
- if ((buf[bidx].lgrmi1_sidusage == SidTypeGroup
- || buf[bidx].lgrmi1_sidusage == SidTypeWellKnownGroup)
- && EqualSid (grp_list.sids[glidx], buf[bidx].lgrmi1_sid))
- goto done;
- }
-
- retval = false;
- done:
- NetApiBufferFree (buf);
- return retval;
-}
-
-static bool
-get_user_local_groups (PWCHAR logonserver, PWCHAR domain,
- cygsidlist &grp_list, PSID pusersid)
-{
- LPLOCALGROUP_INFO_0 buf;
- DWORD cnt, tot;
- NET_API_STATUS ret;
-
- ret = NetLocalGroupEnum (logonserver, 0, (LPBYTE *) &buf,
- MAX_PREFERRED_LENGTH, &cnt, &tot, NULL);
- if (ret)
- {
- __seterrno_from_win_error (ret);
- return false;
- }
-
- WCHAR domlocal_grp[MAX_DOMAIN_NAME_LEN + GNLEN + 2];
- WCHAR builtin_grp[sizeof ("BUILTIN\\") + GNLEN + 2];
- PWCHAR dg_ptr, bg_ptr;
- SID_NAME_USE use;
-
- dg_ptr = wcpcpy (domlocal_grp, domain);
- *dg_ptr++ = L'\\';
- bg_ptr = wcpcpy (builtin_grp, L"BUILTIN\\");
-
- for (DWORD i = 0; i < cnt; ++i)
- if (is_group_member (logonserver, buf[i].lgrpi0_name, pusersid, grp_list))
- {
- cygsid gsid;
- DWORD glen = MAX_SID_LEN;
- WCHAR dom[MAX_DOMAIN_NAME_LEN + 1];
- DWORD domlen = sizeof (dom);
- bool builtin = false;
-
- use = SidTypeInvalid;
- wcscpy (dg_ptr, buf[i].lgrpi0_name);
- if (!LookupAccountNameW (NULL, domlocal_grp, gsid, &glen,
- dom, &domlen, &use))
- {
- if (GetLastError () != ERROR_NONE_MAPPED)
- debug_printf ("LookupAccountName(%W), %E", domlocal_grp);
- wcscpy (bg_ptr, dg_ptr);
- if (!LookupAccountNameW (NULL, builtin_grp, gsid, &glen,
- dom, &domlen, &use))
- debug_printf ("LookupAccountName(%W), %E", builtin_grp);
- builtin = true;
- }
- if (!legal_sid_type (use))
- debug_printf ("Rejecting local %W. use: %d", dg_ptr, use);
- else if (builtin)
- grp_list *= gsid;
- else
- grp_list += gsid;
- }
- NetApiBufferFree (buf);
- return true;
-}
-
-static bool
-sid_in_token_groups (PTOKEN_GROUPS grps, cygpsid sid)
-{
- if (!grps)
- return false;
- for (DWORD i = 0; i < grps->GroupCount; ++i)
- if (sid == grps->Groups[i].Sid)
- return true;
- return false;
-}
-
-static void
-get_unix_group_sidlist (struct passwd *pw, cygsidlist &grp_list)
-{
- struct __group32 *gr;
- cygsid gsid;
-
- for (int gidx = 0; (gr = internal_getgrent (gidx)); ++gidx)
- {
- if (gr->gr_gid == (__gid32_t) pw->pw_gid)
- goto found;
- else if (gr->gr_mem)
- for (int gi = 0; gr->gr_mem[gi]; ++gi)
- if (strcasematch (pw->pw_name, gr->gr_mem[gi]))
- goto found;
- continue;
- found:
- if (gsid.getfromgr (gr))
- grp_list += gsid;
-
- }
-}
-
-static void
-get_token_group_sidlist (cygsidlist &grp_list, PTOKEN_GROUPS my_grps,
- LUID auth_luid, int &auth_pos)
-{
- auth_pos = -1;
- if (my_grps)
- {
- grp_list += well_known_local_sid;
- if (sid_in_token_groups (my_grps, well_known_dialup_sid))
- grp_list *= well_known_dialup_sid;
- if (sid_in_token_groups (my_grps, well_known_network_sid))
- grp_list *= well_known_network_sid;
- if (sid_in_token_groups (my_grps, well_known_batch_sid))
- grp_list *= well_known_batch_sid;
- grp_list *= well_known_interactive_sid;
- if (sid_in_token_groups (my_grps, well_known_service_sid))
- grp_list *= well_known_service_sid;
- if (sid_in_token_groups (my_grps, well_known_this_org_sid))
- grp_list *= well_known_this_org_sid;
- }
- else
- {
- grp_list += well_known_local_sid;
- grp_list *= well_known_interactive_sid;
- }
- if (get_ll (auth_luid) != 999LL) /* != SYSTEM_LUID */
- {
- for (DWORD i = 0; i < my_grps->GroupCount; ++i)
- if (my_grps->Groups[i].Attributes & SE_GROUP_LOGON_ID)
- {
- grp_list += my_grps->Groups[i].Sid;
- auth_pos = grp_list.count () - 1;
- break;
- }
- }
-}
-
-bool
-get_server_groups (cygsidlist &grp_list, PSID usersid, struct passwd *pw)
-{
- WCHAR user[UNLEN + 1];
- WCHAR domain[MAX_DOMAIN_NAME_LEN + 1];
- WCHAR server[INTERNET_MAX_HOST_NAME_LENGTH + 3];
- DWORD ulen = UNLEN + 1;
- DWORD dlen = MAX_DOMAIN_NAME_LEN + 1;
- SID_NAME_USE use;
-
- if (well_known_system_sid == usersid)
- {
- grp_list *= well_known_admins_sid;
- get_unix_group_sidlist (pw, grp_list);
- return true;
- }
-
- grp_list *= well_known_world_sid;
- grp_list *= well_known_authenticated_users_sid;
-
- if (!LookupAccountSidW (NULL, usersid, user, &ulen, domain, &dlen, &use))
- {
- __seterrno ();
- return false;
- }
- if (get_logon_server (domain, server, false)
- && !get_user_groups (server, grp_list, user, domain)
- && get_logon_server (domain, server, true))
- get_user_groups (server, grp_list, user, domain);
- if (get_user_local_groups (server, domain, grp_list, usersid))
- {
- get_unix_group_sidlist (pw, grp_list);
- return true;
- }
- return false;
-}
-
-static bool
-get_initgroups_sidlist (cygsidlist &grp_list,
- PSID usersid, PSID pgrpsid, struct passwd *pw,
- PTOKEN_GROUPS my_grps, LUID auth_luid, int &auth_pos)
-{
- grp_list *= well_known_world_sid;
- grp_list *= well_known_authenticated_users_sid;
- if (well_known_system_sid == usersid)
- auth_pos = -1;
- else
- get_token_group_sidlist (grp_list, my_grps, auth_luid, auth_pos);
- if (!get_server_groups (grp_list, usersid, pw))
- return false;
-
- /* special_pgrp true if pgrpsid is not in normal groups */
- grp_list += pgrpsid;
- return true;
-}
-
-static void
-get_setgroups_sidlist (cygsidlist &tmp_list, PSID usersid, struct passwd *pw,
- PTOKEN_GROUPS my_grps, user_groups &groups,
- LUID auth_luid, int &auth_pos)
-{
- tmp_list *= well_known_world_sid;
- tmp_list *= well_known_authenticated_users_sid;
- get_token_group_sidlist (tmp_list, my_grps, auth_luid, auth_pos);
- get_server_groups (tmp_list, usersid, pw);
- for (int gidx = 0; gidx < groups.sgsids.count (); gidx++)
- tmp_list += groups.sgsids.sids[gidx];
- tmp_list += groups.pgsid;
-}
-
-static ULONG sys_privs[] = {
- SE_CREATE_TOKEN_PRIVILEGE,
- SE_ASSIGNPRIMARYTOKEN_PRIVILEGE,
- SE_LOCK_MEMORY_PRIVILEGE,
- SE_INCREASE_QUOTA_PRIVILEGE,
- SE_TCB_PRIVILEGE,
- SE_SECURITY_PRIVILEGE,
- SE_TAKE_OWNERSHIP_PRIVILEGE,
- SE_LOAD_DRIVER_PRIVILEGE,
- SE_SYSTEM_PROFILE_PRIVILEGE, /* Vista ONLY */
- SE_SYSTEMTIME_PRIVILEGE,
- SE_PROF_SINGLE_PROCESS_PRIVILEGE,
- SE_INC_BASE_PRIORITY_PRIVILEGE,
- SE_CREATE_PAGEFILE_PRIVILEGE,
- SE_CREATE_PERMANENT_PRIVILEGE,
- SE_BACKUP_PRIVILEGE,
- SE_RESTORE_PRIVILEGE,
- SE_SHUTDOWN_PRIVILEGE,
- SE_DEBUG_PRIVILEGE,
- SE_AUDIT_PRIVILEGE,
- SE_SYSTEM_ENVIRONMENT_PRIVILEGE,
- SE_CHANGE_NOTIFY_PRIVILEGE,
- SE_UNDOCK_PRIVILEGE,
- SE_MANAGE_VOLUME_PRIVILEGE,
- SE_IMPERSONATE_PRIVILEGE,
- SE_CREATE_GLOBAL_PRIVILEGE,
- SE_INCREASE_WORKING_SET_PRIVILEGE,
- SE_TIME_ZONE_PRIVILEGE,
- SE_CREATE_SYMBOLIC_LINK_PRIVILEGE
-};
-
-#define SYSTEM_PRIVILEGES_COUNT (sizeof sys_privs / sizeof *sys_privs)
-
-static PTOKEN_PRIVILEGES
-get_system_priv_list (size_t &size)
-{
- ULONG max_idx = 0;
- while (max_idx < SYSTEM_PRIVILEGES_COUNT
- && sys_privs[max_idx] != wincap.max_sys_priv ())
- ++max_idx;
- if (max_idx >= SYSTEM_PRIVILEGES_COUNT)
- api_fatal ("Coding error: wincap privilege %u doesn't exist in sys_privs",
- wincap.max_sys_priv ());
- size = sizeof (ULONG) + (max_idx + 1) * sizeof (LUID_AND_ATTRIBUTES);
- PTOKEN_PRIVILEGES privs = (PTOKEN_PRIVILEGES) malloc (size);
- if (!privs)
- {
- debug_printf ("malloc (system_privs) failed.");
- return NULL;
- }
- privs->PrivilegeCount = 0;
- for (ULONG i = 0; i <= max_idx; ++i)
- {
- privs->Privileges[privs->PrivilegeCount].Luid.HighPart = 0L;
- privs->Privileges[privs->PrivilegeCount].Luid.LowPart = sys_privs[i];
- privs->Privileges[privs->PrivilegeCount].Attributes =
- SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_ENABLED_BY_DEFAULT;
- ++privs->PrivilegeCount;
- }
- return privs;
-}
-
-static PTOKEN_PRIVILEGES
-get_priv_list (LSA_HANDLE lsa, cygsid &usersid, cygsidlist &grp_list,
- size_t &size)
-{
- PLSA_UNICODE_STRING privstrs;
- ULONG cnt;
- PTOKEN_PRIVILEGES privs = NULL;
- NTSTATUS ret;
-
- if (usersid == well_known_system_sid)
- return get_system_priv_list (size);
-
- for (int grp = -1; grp < grp_list.count (); ++grp)
- {
- if (grp == -1)
- {
- if ((ret = LsaEnumerateAccountRights (lsa, usersid, &privstrs,
- &cnt)) != STATUS_SUCCESS)
- continue;
- }
- else if ((ret = LsaEnumerateAccountRights (lsa, grp_list.sids[grp],
- &privstrs, &cnt))
- != STATUS_SUCCESS)
- continue;
- for (ULONG i = 0; i < cnt; ++i)
- {
- LUID priv;
- PTOKEN_PRIVILEGES tmp;
- DWORD tmp_count;
-
- if (!privilege_luid (privstrs[i].Buffer, &priv))
- continue;
-
- if (privs)
- {
- DWORD pcnt = privs->PrivilegeCount;
- LUID_AND_ATTRIBUTES *p = privs->Privileges;
- for (; pcnt > 0; --pcnt, ++p)
- if (priv.HighPart == p->Luid.HighPart
- && priv.LowPart == p->Luid.LowPart)
- goto next_account_right;
- }
-
- tmp_count = privs ? privs->PrivilegeCount : 0;
- size = sizeof (DWORD)
- + (tmp_count + 1) * sizeof (LUID_AND_ATTRIBUTES);
- tmp = (PTOKEN_PRIVILEGES) realloc (privs, size);
- if (!tmp)
- {
- if (privs)
- free (privs);
- LsaFreeMemory (privstrs);
- debug_printf ("realloc (privs) failed.");
- return NULL;
- }
- tmp->PrivilegeCount = tmp_count;
- privs = tmp;
- privs->Privileges[privs->PrivilegeCount].Luid = priv;
- privs->Privileges[privs->PrivilegeCount].Attributes =
- SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_ENABLED_BY_DEFAULT;
- ++privs->PrivilegeCount;
-
- next_account_right:
- ;
- }
- LsaFreeMemory (privstrs);
- }
- return privs;
-}
-
-/* Accept a token if
- - the requested usersid matches the TokenUser and
- - if setgroups has been called:
- the token groups that are listed in /etc/group match the union of
- the requested primary and supplementary groups in gsids.
- - else the (unknown) implicitly requested supplementary groups and those
- in the token are the groups associated with the usersid. We assume
- they match and verify only the primary groups.
- The requested primary group must appear in the token.
- The primary group in the token is a group associated with the usersid,
- except if the token is internal and the group is in the token SD
- (see create_token). In that latter case that group must match the
- requested primary group. */
-bool
-verify_token (HANDLE token, cygsid &usersid, user_groups &groups, bool *pintern)
-{
- DWORD size;
- bool intern = false;
-
- if (pintern)
- {
- TOKEN_SOURCE ts;
- if (!GetTokenInformation (token, TokenSource,
- &ts, sizeof ts, &size))
- debug_printf ("GetTokenInformation(), %E");
- else
- *pintern = intern = !memcmp (ts.SourceName, "Cygwin.1", 8);
- }
- /* Verify usersid */
- cygsid tok_usersid = NO_SID;
- if (!GetTokenInformation (token, TokenUser,
- &tok_usersid, sizeof tok_usersid, &size))
- debug_printf ("GetTokenInformation(), %E");
- if (usersid != tok_usersid)
- return false;
-
- /* For an internal token, if setgroups was not called and if the sd group
- is not well_known_null_sid, it must match pgrpsid */
- if (intern && !groups.issetgroups ())
- {
- const DWORD sd_buf_siz = MAX_SID_LEN + sizeof (SECURITY_DESCRIPTOR);
- PSECURITY_DESCRIPTOR sd_buf = (PSECURITY_DESCRIPTOR) alloca (sd_buf_siz);
- cygpsid gsid (NO_SID);
- if (!GetKernelObjectSecurity (token, GROUP_SECURITY_INFORMATION,
- sd_buf, sd_buf_siz, &size))
- debug_printf ("GetKernelObjectSecurity(), %E");
- else if (!GetSecurityDescriptorGroup (sd_buf, (PSID *) &gsid,
- (BOOL *) &size))
- debug_printf ("GetSecurityDescriptorGroup(), %E");
- if (well_known_null_sid != gsid)
- return gsid == groups.pgsid;
- }
-
- PTOKEN_GROUPS my_grps;
- bool sawpg = false, ret = false;
-
- if (!GetTokenInformation (token, TokenGroups, NULL, 0, &size) &&
- GetLastError () != ERROR_INSUFFICIENT_BUFFER)
- debug_printf ("GetTokenInformation(token, TokenGroups), %E");
- else if (!(my_grps = (PTOKEN_GROUPS) alloca (size)))
- debug_printf ("alloca (my_grps) failed.");
- else if (!GetTokenInformation (token, TokenGroups, my_grps, size, &size))
- debug_printf ("GetTokenInformation(my_token, TokenGroups), %E");
- else
- {
- if (groups.issetgroups ()) /* setgroups was called */
- {
- cygsid gsid;
- struct __group32 *gr;
- bool saw[groups.sgsids.count ()];
- memset (saw, 0, sizeof(saw));
-
- /* token groups found in /etc/group match the user.gsids ? */
- for (int gidx = 0; (gr = internal_getgrent (gidx)); ++gidx)
- if (gsid.getfromgr (gr) && sid_in_token_groups (my_grps, gsid))
- {
- int pos = groups.sgsids.position (gsid);
- if (pos >= 0)
- saw[pos] = true;
- else if (groups.pgsid == gsid)
- sawpg = true;
-#if 0
- /* With this `else', verify_token returns false if we find
- groups in the token, which are not in the group list set
- with setgroups(). That's rather dangerous. What we're
- really interested in is that all groups in the setgroups()
- list are in the token. A token created through ADVAPI
- should be allowed to contain more groups than requested
- through setgroups(), esecially since Vista and the
- addition of integrity groups. So we disable this statement
- for now. */
- else if (gsid != well_known_world_sid
- && gsid != usersid)
- goto done;
-#endif
- }
- /* user.sgsids groups must be in the token, except for builtin groups.
- These can be different on domain member machines compared to
- domain controllers, so these builtin groups may be validly missing
- from a token created through password or lsaauth logon. */
- for (int gidx = 0; gidx < groups.sgsids.count (); gidx++)
- if (!saw[gidx]
- && !groups.sgsids.sids[gidx].is_well_known_sid ()
- && !sid_in_token_groups (my_grps, groups.sgsids.sids[gidx]))
- goto done;
- }
- /* The primary group must be in the token */
- ret = sawpg
- || sid_in_token_groups (my_grps, groups.pgsid)
- || groups.pgsid == usersid;
- }
-done:
- return ret;
-}
-
-HANDLE
-create_token (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
-{
- NTSTATUS ret;
- LSA_HANDLE lsa = INVALID_HANDLE_VALUE;
-
- cygsidlist tmp_gsids (cygsidlist_auto, 12);
-
- SECURITY_QUALITY_OF_SERVICE sqos =
- { sizeof sqos, SecurityImpersonation, SECURITY_STATIC_TRACKING, FALSE };
- OBJECT_ATTRIBUTES oa = { sizeof oa, 0, 0, 0, 0, &sqos };
- LUID auth_luid = SYSTEM_LUID;
- LARGE_INTEGER exp = { QuadPart:INT64_MAX };
-
- TOKEN_USER user;
- PTOKEN_GROUPS new_tok_gsids = NULL;
- PTOKEN_PRIVILEGES privs = NULL;
- TOKEN_OWNER owner;
- TOKEN_PRIMARY_GROUP pgrp;
- TOKEN_DEFAULT_DACL dacl = {};
- TOKEN_SOURCE source;
- TOKEN_STATISTICS stats;
- memcpy (source.SourceName, "Cygwin.1", 8);
- source.SourceIdentifier.HighPart = 0;
- source.SourceIdentifier.LowPart = 0x0101;
-
- HANDLE token = INVALID_HANDLE_VALUE;
- HANDLE primary_token = INVALID_HANDLE_VALUE;
-
- PTOKEN_GROUPS my_tok_gsids = NULL;
- DWORD size;
- size_t psize = 0;
-
- /* SE_CREATE_TOKEN_NAME privilege needed to call NtCreateToken. */
- push_self_privilege (SE_CREATE_TOKEN_PRIVILEGE, true);
-
- /* Open policy object. */
- if ((lsa = open_local_policy ()) == INVALID_HANDLE_VALUE)
- goto out;
-
- /* User, owner, primary group. */
- user.User.Sid = usersid;
- user.User.Attributes = 0;
- owner.Owner = usersid;
-
- /* Retrieve authentication id and group list from own process. */
- if (hProcToken)
- {
- /* Switching user context to SYSTEM doesn't inherit the authentication
- id of the user account running current process. */
- if (usersid != well_known_system_sid)
- if (!GetTokenInformation (hProcToken, TokenStatistics,
- &stats, sizeof stats, &size))
- debug_printf
- ("GetTokenInformation(hProcToken, TokenStatistics), %E");
- else
- auth_luid = stats.AuthenticationId;
-
- /* Retrieving current processes group list to be able to inherit
- some important well known group sids. */
- if (!GetTokenInformation (hProcToken, TokenGroups, NULL, 0, &size)
- && GetLastError () != ERROR_INSUFFICIENT_BUFFER)
- debug_printf ("GetTokenInformation(hProcToken, TokenGroups), %E");
- else if (!(my_tok_gsids = (PTOKEN_GROUPS) malloc (size)))
- debug_printf ("malloc (my_tok_gsids) failed.");
- else if (!GetTokenInformation (hProcToken, TokenGroups, my_tok_gsids,
- size, &size))
- {
- debug_printf ("GetTokenInformation(hProcToken, TokenGroups), %E");
- free (my_tok_gsids);
- my_tok_gsids = NULL;
- }
- }
-
- /* Create list of groups, the user is member in. */
- int auth_pos;
- if (new_groups.issetgroups ())
- get_setgroups_sidlist (tmp_gsids, usersid, pw, my_tok_gsids, new_groups,
- auth_luid, auth_pos);
- else if (!get_initgroups_sidlist (tmp_gsids, usersid, new_groups.pgsid, pw,
- my_tok_gsids, auth_luid, auth_pos))
- goto out;
-
- /* Primary group. */
- pgrp.PrimaryGroup = new_groups.pgsid;
-
- /* Create a TOKEN_GROUPS list from the above retrieved list of sids. */
- new_tok_gsids = (PTOKEN_GROUPS)
- alloca (sizeof (DWORD) + (tmp_gsids.count () + 1)
- * sizeof (SID_AND_ATTRIBUTES));
- new_tok_gsids->GroupCount = tmp_gsids.count ();
- for (DWORD i = 0; i < new_tok_gsids->GroupCount; ++i)
- {
- new_tok_gsids->Groups[i].Sid = tmp_gsids.sids[i];
- new_tok_gsids->Groups[i].Attributes = SE_GROUP_MANDATORY
- | SE_GROUP_ENABLED_BY_DEFAULT
- | SE_GROUP_ENABLED;
- }
- if (auth_pos >= 0)
- new_tok_gsids->Groups[auth_pos].Attributes |= SE_GROUP_LOGON_ID;
-
- /* On systems supporting Mandatory Integrity Control, add a MIC SID. */
- if (wincap.has_mandatory_integrity_control ())
- {
- new_tok_gsids->Groups[new_tok_gsids->GroupCount].Attributes =
- SE_GROUP_INTEGRITY | SE_GROUP_INTEGRITY_ENABLED;
- if (usersid == well_known_system_sid)
- new_tok_gsids->Groups[new_tok_gsids->GroupCount++].Sid
- = mandatory_system_integrity_sid;
- else if (tmp_gsids.contains (well_known_admins_sid))
- new_tok_gsids->Groups[new_tok_gsids->GroupCount++].Sid
- = mandatory_high_integrity_sid;
- else
- new_tok_gsids->Groups[new_tok_gsids->GroupCount++].Sid
- = mandatory_medium_integrity_sid;
- }
-
- /* Retrieve list of privileges of that user. */
- if (!(privs = get_priv_list (lsa, usersid, tmp_gsids, psize)))
- goto out;
-
- /* Let's be heroic... */
- ret = NtCreateToken (&token, TOKEN_ALL_ACCESS, &oa, TokenImpersonation,
- &auth_luid, &exp, &user, new_tok_gsids, privs, &owner,
- &pgrp, &dacl, &source);
- if (ret)
- __seterrno_from_nt_status (ret);
- else
- {
- /* Convert to primary token. */
- if (!DuplicateTokenEx (token, MAXIMUM_ALLOWED, &sec_none,
- SecurityImpersonation, TokenPrimary,
- &primary_token))
- {
- __seterrno ();
- debug_printf ("DuplicateTokenEx %E");
- }
- }
-
-out:
- pop_self_privilege ();
- if (token != INVALID_HANDLE_VALUE)
- CloseHandle (token);
- if (privs)
- free (privs);
- if (my_tok_gsids)
- free (my_tok_gsids);
- close_local_policy (lsa);
-
- debug_printf ("%p = create_token ()", primary_token);
- return primary_token;
-}
-
-HANDLE
-lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
-{
- cygsidlist tmp_gsids (cygsidlist_auto, 12);
- cygpsid pgrpsid;
- LSA_STRING name;
- HANDLE lsa_hdl = NULL, lsa = INVALID_HANDLE_VALUE;
- LSA_OPERATIONAL_MODE sec_mode;
- NTSTATUS ret, ret2;
- ULONG package_id, size;
- LUID auth_luid = SYSTEM_LUID;
- struct {
- LSA_STRING str;
- CHAR buf[16];
- } origin;
- DWORD ulen = UNLEN + 1;
- DWORD dlen = MAX_DOMAIN_NAME_LEN + 1;
- SID_NAME_USE use;
- cyglsa_t *authinf = NULL;
- ULONG authinf_size;
- TOKEN_SOURCE ts;
- PCYG_TOKEN_GROUPS gsids = NULL;
- PTOKEN_PRIVILEGES privs = NULL;
- PACL dacl = NULL;
- PVOID profile = NULL;
- LUID luid;
- QUOTA_LIMITS quota;
- size_t psize = 0, gsize = 0, dsize = 0;
- OFFSET offset, sids_offset;
- int tmpidx, non_well_known_cnt;
-
- HANDLE user_token = NULL;
-
- push_self_privilege (SE_TCB_PRIVILEGE, true);
-
- /* Register as logon process. */
- str2lsa (name, "Cygwin");
- SetLastError (0);
- ret = LsaRegisterLogonProcess (&name, &lsa_hdl, &sec_mode);
- if (ret != STATUS_SUCCESS)
- {
- debug_printf ("LsaRegisterLogonProcess: %p", ret);
- __seterrno_from_win_error (LsaNtStatusToWinError (ret));
- goto out;
- }
- else if (GetLastError () == ERROR_PROC_NOT_FOUND)
- {
- debug_printf ("Couldn't load Secur32.dll");
- goto out;
- }
- /* Get handle to our own LSA package. */
- str2lsa (name, CYG_LSA_PKGNAME);
- ret = LsaLookupAuthenticationPackage (lsa_hdl, &name, &package_id);
- if (ret != STATUS_SUCCESS)
- {
- debug_printf ("LsaLookupAuthenticationPackage: %p", ret);
- __seterrno_from_win_error (LsaNtStatusToWinError (ret));
- goto out;
- }
-
- /* Open policy object. */
- if ((lsa = open_local_policy ()) == INVALID_HANDLE_VALUE)
- goto out;
-
- /* Create origin. */
- str2buf2lsa (origin.str, origin.buf, "Cygwin");
- /* Create token source. */
- memcpy (ts.SourceName, "Cygwin.1", 8);
- ts.SourceIdentifier.HighPart = 0;
- ts.SourceIdentifier.LowPart = 0x0103;
-
- /* Create list of groups, the user is member in. */
- int auth_pos;
- if (new_groups.issetgroups ())
- get_setgroups_sidlist (tmp_gsids, usersid, pw, NULL, new_groups, auth_luid,
- auth_pos);
- else if (!get_initgroups_sidlist (tmp_gsids, usersid, new_groups.pgsid, pw,
- NULL, auth_luid, auth_pos))
- goto out;
- /* The logon SID entry is not generated automatically on Windows 2000
- and earlier for some reason. So add fake logon sid here, which is
- filled with logon id values in the authentication package. */
- if (wincap.needs_logon_sid_in_sid_list ())
- tmp_gsids += fake_logon_sid;
-
- tmp_gsids.debug_print ("tmp_gsids");
-
- /* Evaluate size of TOKEN_GROUPS list */
- non_well_known_cnt = tmp_gsids.non_well_known_count ();
- gsize = sizeof (DWORD) + non_well_known_cnt * sizeof (SID_AND_ATTRIBUTES);
- tmpidx = -1;
- for (int i = 0; i < non_well_known_cnt; ++i)
- if ((tmpidx = tmp_gsids.next_non_well_known_sid (tmpidx)) >= 0)
- gsize += GetLengthSid (tmp_gsids.sids[tmpidx]);
-
- /* Retrieve list of privileges of that user. */
- if (!(privs = get_priv_list (lsa, usersid, tmp_gsids, psize)))
- goto out;
-
- /* Create DefaultDacl. */
- dsize = sizeof (ACL) + 3 * sizeof (ACCESS_ALLOWED_ACE)
- + GetLengthSid (usersid)
- + GetLengthSid (well_known_admins_sid)
- + GetLengthSid (well_known_system_sid);
- dacl = (PACL) alloca (dsize);
- if (!InitializeAcl (dacl, dsize, ACL_REVISION))
- goto out;
- if (!AddAccessAllowedAce (dacl, ACL_REVISION, GENERIC_ALL, usersid))
- goto out;
- if (!AddAccessAllowedAce (dacl, ACL_REVISION, GENERIC_ALL,
- well_known_admins_sid))
- goto out;
- if (!AddAccessAllowedAce (dacl, ACL_REVISION, GENERIC_ALL,
- well_known_system_sid))
- goto out;
-
- /* Evaluate authinf size and allocate authinf. */
- authinf_size = (authinf->data - (PBYTE) authinf);
- authinf_size += GetLengthSid (usersid); /* User SID */
- authinf_size += gsize; /* Groups + Group SIDs */
- /* When trying to define the admins group as primary group on Vista,
- LsaLogonUser fails with error STATUS_INVALID_OWNER. As workaround
- we define "Local" as primary group here. Seteuid32 sets the primary
- group to the group set in /etc/passwd anyway. */
- if (new_groups.pgsid == well_known_admins_sid)
- pgrpsid = well_known_local_sid;
- else
- pgrpsid = new_groups.pgsid;
-
- authinf_size += GetLengthSid (pgrpsid); /* Primary Group SID */
-
- authinf_size += psize; /* Privileges */
- authinf_size += 0; /* Owner SID */
- authinf_size += dsize; /* Default DACL */
-
- authinf = (cyglsa_t *) alloca (authinf_size);
- authinf->inf_size = authinf_size - ((PBYTE) &authinf->inf - (PBYTE) authinf);
-
- authinf->magic = CYG_LSA_MAGIC;
-
- if (!LookupAccountSidW (NULL, usersid, authinf->username, &ulen,
- authinf->domain, &dlen, &use))
- {
- __seterrno ();
- goto out;
- }
-
- /* Store stuff in authinf with offset relative to start of "inf" member,
- instead of using pointers. */
- offset = authinf->data - (PBYTE) &authinf->inf;
-
- authinf->inf.ExpirationTime.LowPart = 0xffffffffL;
- authinf->inf.ExpirationTime.HighPart = 0x7fffffffL;
- /* User SID */
- authinf->inf.User.User.Sid = offset;
- authinf->inf.User.User.Attributes = 0;
- CopySid (GetLengthSid (usersid), (PSID) ((PBYTE) &authinf->inf + offset),
- usersid);
- offset += GetLengthSid (usersid);
- /* Groups */
- authinf->inf.Groups = offset;
- gsids = (PCYG_TOKEN_GROUPS) ((PBYTE) &authinf->inf + offset);
- sids_offset = offset + sizeof (ULONG) + non_well_known_cnt
- * sizeof (SID_AND_ATTRIBUTES);
- gsids->GroupCount = non_well_known_cnt;
- /* Group SIDs */
- tmpidx = -1;
- for (int i = 0; i < non_well_known_cnt; ++i)
- {
- if ((tmpidx = tmp_gsids.next_non_well_known_sid (tmpidx)) < 0)
- break;
- gsids->Groups[i].Sid = sids_offset;
- gsids->Groups[i].Attributes = SE_GROUP_MANDATORY
- | SE_GROUP_ENABLED_BY_DEFAULT
- | SE_GROUP_ENABLED;
- /* Mark logon SID as logon SID :) */
- if (wincap.needs_logon_sid_in_sid_list ()
- && tmp_gsids.sids[tmpidx] == fake_logon_sid)
- gsids->Groups[i].Attributes += SE_GROUP_LOGON_ID;
- CopySid (GetLengthSid (tmp_gsids.sids[tmpidx]),
- (PSID) ((PBYTE) &authinf->inf + sids_offset),
- tmp_gsids.sids[tmpidx]);
- sids_offset += GetLengthSid (tmp_gsids.sids[tmpidx]);
- }
- offset += gsize;
- /* Primary Group SID */
- authinf->inf.PrimaryGroup.PrimaryGroup = offset;
- CopySid (GetLengthSid (pgrpsid), (PSID) ((PBYTE) &authinf->inf + offset),
- pgrpsid);
- offset += GetLengthSid (pgrpsid);
- /* Privileges */
- authinf->inf.Privileges = offset;
- memcpy ((PBYTE) &authinf->inf + offset, privs, psize);
- offset += psize;
- /* Owner */
- authinf->inf.Owner.Owner = 0;
- /* Default DACL */
- authinf->inf.DefaultDacl.DefaultDacl = offset;
- memcpy ((PBYTE) &authinf->inf + offset, dacl, dsize);
-
- authinf->checksum = CYGWIN_VERSION_MAGIC (CYGWIN_VERSION_DLL_MAJOR,
- CYGWIN_VERSION_DLL_MINOR);
- PDWORD csp = (PDWORD) &authinf->username;
- PDWORD csp_end = (PDWORD) ((PBYTE) authinf + authinf_size);
- while (csp < csp_end)
- authinf->checksum += *csp++;
-
- /* Try to logon... */
- ret = LsaLogonUser (lsa_hdl, (PLSA_STRING) &origin, Interactive, package_id,
- authinf, authinf_size, NULL, &ts, &profile, &size, &luid,
- &user_token, &quota, &ret2);
- if (ret != STATUS_SUCCESS)
- {
- debug_printf ("LsaLogonUser: %p", ret);
- __seterrno_from_win_error (LsaNtStatusToWinError (ret));
- goto out;
- }
- if (profile)
- {
-#ifdef JUST_ANOTHER_NONWORKING_SOLUTION
- /* See ../lsaauth/cyglsa.c. */
- cygprf_t *prf = (cygprf_t *) profile;
- if (prf->magic_pre == MAGIC_PRE && prf->magic_post == MAGIC_POST
- && prf->token)
- {
- CloseHandle (user_token);
- user_token = prf->token;
- system_printf ("Got token through profile: %p", user_token);
- }
-#endif /* JUST_ANOTHER_NONWORKING_SOLUTION */
- LsaFreeReturnBuffer (profile);
- }
-
- if (wincap.has_mandatory_integrity_control ())
- {
- typedef struct _TOKEN_LINKED_TOKEN
- {
- HANDLE LinkedToken;
- } TOKEN_LINKED_TOKEN, *PTOKEN_LINKED_TOKEN;
-# define TokenLinkedToken ((TOKEN_INFORMATION_CLASS) 19)
-
- TOKEN_LINKED_TOKEN linked;
-
- if (GetTokenInformation (user_token, TokenLinkedToken,
- (PVOID) &linked, sizeof linked, &size))
- {
- debug_printf ("Linked Token: %p", linked.LinkedToken);
- if (linked.LinkedToken)
- user_token = linked.LinkedToken;
- }
- }
-
- /* The token returned by LsaLogonUser is not inheritable. Make it so. */
- if (!SetHandleInformation (user_token, HANDLE_FLAG_INHERIT,
- HANDLE_FLAG_INHERIT))
- system_printf ("SetHandleInformation %E");
-
-out:
- if (privs)
- free (privs);
- close_local_policy (lsa);
- if (lsa_hdl)
- LsaDeregisterLogonProcess (lsa_hdl);
- pop_self_privilege ();
-
- debug_printf ("%p = lsaauth ()", user_token);
- return user_token;
-}
diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h
deleted file mode 100644
index 9be7a28e232..00000000000
--- a/winsup/cygwin/security.h
+++ /dev/null
@@ -1,450 +0,0 @@
-/* security.h: security declarations
-
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#ifndef _SECURITY_H
-#define _SECURITY_H
-
-#include <accctrl.h>
-
-#define DEFAULT_UID DOMAIN_USER_RID_ADMIN
-#define UNKNOWN_UID 400 /* Non conflicting number */
-#define UNKNOWN_GID 401
-
-#define MAX_SID_LEN 40
-#define MAX_DACL_LEN(n) (sizeof (ACL) \
- + (n) * (sizeof (ACCESS_ALLOWED_ACE) - sizeof (DWORD) + MAX_SID_LEN))
-#define SD_MIN_SIZE (sizeof (SECURITY_DESCRIPTOR) + MAX_DACL_LEN (1))
-#define ACL_DEFAULT_SIZE 3072
-#define NO_SID ((PSID)NULL)
-
-#ifndef SE_CREATE_TOKEN_PRIVILEGE
-#define SE_CREATE_TOKEN_PRIVILEGE 2UL
-#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3UL
-#define SE_LOCK_MEMORY_PRIVILEGE 4UL
-#define SE_INCREASE_QUOTA_PRIVILEGE 5UL
-#define SE_MACHINE_ACCOUNT_PRIVILEGE 6UL
-#define SE_TCB_PRIVILEGE 7UL
-#define SE_SECURITY_PRIVILEGE 8UL
-#define SE_TAKE_OWNERSHIP_PRIVILEGE 9UL
-#define SE_LOAD_DRIVER_PRIVILEGE 10UL
-#define SE_SYSTEM_PROFILE_PRIVILEGE 11UL
-#define SE_SYSTEMTIME_PRIVILEGE 12UL
-#define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13UL
-#define SE_INC_BASE_PRIORITY_PRIVILEGE 14UL
-#define SE_CREATE_PAGEFILE_PRIVILEGE 15UL
-#define SE_CREATE_PERMANENT_PRIVILEGE 16UL
-#define SE_BACKUP_PRIVILEGE 17UL
-#define SE_RESTORE_PRIVILEGE 18UL
-#define SE_SHUTDOWN_PRIVILEGE 19UL
-#define SE_DEBUG_PRIVILEGE 20UL
-#define SE_AUDIT_PRIVILEGE 21UL
-#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22UL
-#define SE_CHANGE_NOTIFY_PRIVILEGE 23UL
-#define SE_REMOTE_SHUTDOWN_PRIVILEGE 24UL
-/* Starting with Windows 2000 */
-#define SE_UNDOCK_PRIVILEGE 25UL
-#define SE_SYNC_AGENT_PRIVILEGE 26UL
-#define SE_ENABLE_DELEGATION_PRIVILEGE 27UL
-#define SE_MANAGE_VOLUME_PRIVILEGE 28UL
-/* Starting with Windows 2000 SP4, XP SP2, 2003 Server */
-#define SE_IMPERSONATE_PRIVILEGE 29UL
-#define SE_CREATE_GLOBAL_PRIVILEGE 30UL
-/* Starting with Vista */
-#define SE_TRUSTED_CREDMAN_ACCESS_PRIVILEGE 31UL
-#define SE_RELABEL_PRIVILEGE 32UL
-#define SE_INCREASE_WORKING_SET_PRIVILEGE 33UL
-#define SE_TIME_ZONE_PRIVILEGE 34UL
-#define SE_CREATE_SYMBOLIC_LINK_PRIVILEGE 35UL
-
-#define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_SYMBOLIC_LINK_PRIVILEGE
-
-#endif /* ! SE_CREATE_TOKEN_PRIVILEGE */
-
-/* Added for debugging purposes. */
-typedef struct {
- BYTE Revision;
- BYTE SubAuthorityCount;
- SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
- DWORD SubAuthority[8];
-} DBGSID, *PDBGSID;
-
-/* Macro to define variable length SID structures */
-#define MKSID(name, comment, authority, count, rid...) \
-static NO_COPY struct { \
- BYTE Revision; \
- BYTE SubAuthorityCount; \
- SID_IDENTIFIER_AUTHORITY IdentifierAuthority; \
- DWORD SubAuthority[count]; \
-} name##_struct = { SID_REVISION, count, {authority}, {rid}}; \
-cygpsid NO_COPY name = (PSID) &name##_struct;
-
-#define FILE_READ_BITS (FILE_READ_DATA | GENERIC_READ | GENERIC_ALL)
-#define FILE_WRITE_BITS (FILE_WRITE_DATA | GENERIC_WRITE | GENERIC_ALL)
-#define FILE_EXEC_BITS (FILE_EXECUTE | GENERIC_EXECUTE | GENERIC_ALL)
-
-class cygpsid {
-protected:
- PSID psid;
-public:
- cygpsid () {}
- cygpsid (PSID nsid) { psid = nsid; }
- operator PSID () const { return psid; }
- const PSID operator= (PSID nsid) { return psid = nsid;}
- __uid32_t get_id (BOOL search_grp, int *type = NULL);
- int get_uid () { return get_id (FALSE); }
- int get_gid () { return get_id (TRUE); }
-
- PWCHAR string (PWCHAR nsidstr) const;
- char *string (char *nsidstr) const;
-
- bool operator== (const PSID nsid) const
- {
- if (!psid || !nsid)
- return nsid == psid;
- return EqualSid (psid, nsid);
- }
- bool operator!= (const PSID nsid) const
- { return !(*this == nsid); }
- bool operator== (const char *nsidstr) const;
- bool operator!= (const char *nsidstr) const
- { return !(*this == nsidstr); }
-
- void debug_print (const char *prefix = NULL) const
- {
- char buf[256] __attribute__ ((unused));
- debug_printf ("%s %s", prefix ?: "", string (buf) ?: "NULL");
- }
-};
-
-class cygsid : public cygpsid {
- char sbuf[MAX_SID_LEN];
- bool well_known_sid;
-
- const PSID getfromstr (const char *nsidstr, bool well_known);
- PSID get_sid (DWORD s, DWORD cnt, DWORD *r, bool well_known);
-
- inline const PSID assign (const PSID nsid, bool well_known)
- {
- if (!nsid)
- psid = NO_SID;
- else
- {
- psid = (PSID) sbuf;
- CopySid (MAX_SID_LEN, psid, nsid);
- well_known_sid = well_known;
- }
- return psid;
- }
-
-public:
- inline operator const PSID () { return psid; }
- inline bool is_well_known_sid () { return well_known_sid; }
-
- /* Both, = and *= are assignment operators. = creates a "normal" SID,
- *= marks the SID as being a well-known SID. This difference is
- important when creating a SID list for LSA authentication. */
- inline const PSID operator= (cygsid &nsid)
- { return assign (nsid, nsid.well_known_sid); }
- inline const PSID operator= (const PSID nsid)
- { return assign (nsid, false); }
- inline const PSID operator= (const char *nsidstr)
- { return getfromstr (nsidstr, false); }
- inline const PSID operator*= (cygsid &nsid)
- { return assign (nsid, true); }
- inline const PSID operator*= (const PSID nsid)
- { return assign (nsid, true); }
- inline const PSID operator*= (const char *nsidstr)
- { return getfromstr (nsidstr, true); }
-
- inline cygsid () : cygpsid ((PSID) sbuf), well_known_sid (false) {}
- inline cygsid (const PSID nsid) { *this = nsid; }
- inline cygsid (const char *nstrsid) { *this = nstrsid; }
-
- inline PSID set () { return psid = (PSID) sbuf; }
-
- BOOL getfrompw (const struct passwd *pw);
- BOOL getfromgr (const struct __group32 *gr);
-
- void debug_print (const char *prefix = NULL) const
- {
- char buf[256] __attribute__ ((unused));
- debug_printf ("%s %s%s", prefix ?: "", string (buf) ?: "NULL", well_known_sid ? " (*)" : " (+)");
- }
-};
-
-typedef enum { cygsidlist_empty, cygsidlist_alloc, cygsidlist_auto } cygsidlist_type;
-class cygsidlist {
- int maxcnt;
- int cnt;
-
- BOOL add (const PSID nsi, bool well_known); /* Only with auto for now */
-
-public:
- cygsid *sids;
- cygsidlist_type type;
-
- cygsidlist (cygsidlist_type t, int m)
- : maxcnt (m), cnt (0), type (t)
- {
- if (t == cygsidlist_alloc)
- sids = alloc_sids (m);
- else
- sids = new cygsid [m];
- }
- ~cygsidlist () { if (type == cygsidlist_auto) delete [] sids; }
-
- BOOL addfromgr (struct __group32 *gr) /* Only with alloc */
- { return sids[cnt].getfromgr (gr) && ++cnt; }
-
- /* += adds a "normal" SID, *= adds a well-known SID. See comment in class
- cygsid above. */
- BOOL operator+= (cygsid &si) { return add ((PSID) si, false); }
- BOOL operator+= (const char *sidstr) { cygsid nsi (sidstr);
- return add ((PSID) nsi, false); }
- BOOL operator+= (const PSID psid) { return add (psid, false); }
- BOOL operator*= (cygsid &si) { return add ((PSID) si, true); }
- BOOL operator*= (const char *sidstr) { cygsid nsi (sidstr);
- return add ((PSID) nsi, true); }
- BOOL operator*= (const PSID psid) { return add (psid, true); }
-
- void count (int ncnt)
- { cnt = ncnt; }
- int count () const { return cnt; }
- int non_well_known_count () const
- {
- int wcnt = 0;
- for (int i = 0; i < cnt; ++i)
- if (!sids[i].is_well_known_sid ())
- ++wcnt;
- return wcnt;
- }
-
- int position (const PSID sid) const
- {
- for (int i = 0; i < cnt; ++i)
- if (sids[i] == sid)
- return i;
- return -1;
- }
-
- int next_non_well_known_sid (int idx)
- {
- while (++idx < cnt)
- if (!sids[idx].is_well_known_sid ())
- return idx;
- return -1;
- }
- BOOL contains (const PSID sid) const { return position (sid) >= 0; }
- cygsid *alloc_sids (int n);
- void free_sids ();
- void debug_print (const char *prefix = NULL) const
- {
- debug_printf ("-- begin sidlist ---");
- if (!cnt)
- debug_printf ("No elements");
- for (int i = 0; i < cnt; ++i)
- sids[i].debug_print (prefix);
- debug_printf ("-- ende sidlist ---");
- }
-};
-
-/* Wrapper class to allow simple deleting of buffer space allocated
- by read_sd() */
-class security_descriptor {
-protected:
- PSECURITY_DESCRIPTOR psd;
- DWORD sd_size;
-public:
- security_descriptor () : psd (NULL), sd_size (0) {}
- ~security_descriptor () { free (); }
-
- PSECURITY_DESCRIPTOR malloc (size_t nsize);
- PSECURITY_DESCRIPTOR realloc (size_t nsize);
- void free ();
-
- inline DWORD size () const { return sd_size; }
- inline DWORD copy (void *buf, DWORD buf_size) const {
- if (buf_size < size ())
- return sd_size;
- memcpy (buf, psd, sd_size);
- return 0;
- }
- inline operator const PSECURITY_DESCRIPTOR () { return psd; }
- inline operator PSECURITY_DESCRIPTOR *() { return &psd; }
-};
-
-class user_groups {
-public:
- cygsid pgsid;
- cygsidlist sgsids;
- BOOL ischanged;
-
- BOOL issetgroups () const { return (sgsids.type == cygsidlist_alloc); }
- void update_supp (const cygsidlist &newsids)
- {
- sgsids.free_sids ();
- sgsids = newsids;
- ischanged = TRUE;
- }
- void clear_supp ()
- {
- if (issetgroups ())
- {
- sgsids.free_sids ();
- ischanged = TRUE;
- }
- }
- void update_pgrp (const PSID sid)
- {
- pgsid = sid;
- ischanged = TRUE;
- }
-};
-
-extern cygpsid well_known_null_sid;
-extern cygpsid well_known_world_sid;
-extern cygpsid well_known_local_sid;
-extern cygpsid well_known_creator_owner_sid;
-extern cygpsid well_known_creator_group_sid;
-extern cygpsid well_known_dialup_sid;
-extern cygpsid well_known_network_sid;
-extern cygpsid well_known_batch_sid;
-extern cygpsid well_known_interactive_sid;
-extern cygpsid well_known_service_sid;
-extern cygpsid well_known_authenticated_users_sid;
-extern cygpsid well_known_this_org_sid;
-extern cygpsid well_known_system_sid;
-extern cygpsid well_known_admins_sid;
-extern cygpsid fake_logon_sid;
-extern cygpsid mandatory_medium_integrity_sid;
-extern cygpsid mandatory_high_integrity_sid;
-extern cygpsid mandatory_system_integrity_sid;
-
-bool privilege_luid (const PWCHAR pname, LUID *luid);
-
-inline BOOL
-legal_sid_type (SID_NAME_USE type)
-{
- return type == SidTypeUser || type == SidTypeGroup
- || type == SidTypeAlias || type == SidTypeWellKnownGroup;
-}
-
-/* File manipulation */
-int __stdcall get_file_attribute (HANDLE, path_conv &, mode_t *,
- __uid32_t *, __gid32_t *);
-int __stdcall set_file_attribute (HANDLE, path_conv &,
- __uid32_t, __gid32_t, int);
-int __stdcall get_reg_attribute (HKEY hkey, mode_t *, __uid32_t *, __gid32_t *);
-LONG __stdcall get_file_sd (HANDLE fh, path_conv &, security_descriptor &sd);
-LONG __stdcall set_file_sd (HANDLE fh, path_conv &, security_descriptor &sd);
-bool __stdcall add_access_allowed_ace (PACL acl, int offset, DWORD attributes, PSID sid, size_t &len_add, DWORD inherit);
-bool __stdcall add_access_denied_ace (PACL acl, int offset, DWORD attributes, PSID sid, size_t &len_add, DWORD inherit);
-int __stdcall check_file_access (path_conv &, int);
-int __stdcall check_registry_access (HANDLE, int);
-
-void set_security_attribute (int attribute, PSECURITY_ATTRIBUTES psa,
- security_descriptor &sd_buf);
-
-bool get_sids_info (cygpsid, cygpsid, __uid32_t * , __gid32_t *);
-
-/* sec_acl.cc */
-struct __acl32;
-extern "C" int aclsort32 (int, int, __acl32 *);
-extern "C" int acl32 (const char *, int, int, __acl32 *);
-int getacl (HANDLE, path_conv &, int, __acl32 *);
-int setacl (HANDLE, path_conv &, int, __acl32 *, bool &);
-
-struct _UNICODE_STRING;
-void __stdcall str2buf2uni (_UNICODE_STRING &, WCHAR *, const char *) __attribute__ ((regparm (3)));
-void __stdcall str2uni_cat (_UNICODE_STRING &, const char *) __attribute__ ((regparm (2)));
-
-/* Function creating a token by calling NtCreateToken. */
-HANDLE create_token (cygsid &usersid, user_groups &groups, struct passwd * pw);
-/* LSA authentication function. */
-HANDLE lsaauth (cygsid &, user_groups &, struct passwd *);
-/* Verify an existing token */
-bool verify_token (HANDLE token, cygsid &usersid, user_groups &groups, bool *pintern = NULL);
-/* Get groups of a user */
-bool get_server_groups (cygsidlist &grp_list, PSID usersid, struct passwd *pw);
-
-/* Extract U-domain\user field from passwd entry. */
-void extract_nt_dom_user (const struct passwd *pw, PWCHAR domain, PWCHAR user);
-/* Get default logonserver for a domain. */
-bool get_logon_server (PWCHAR domain, PWCHAR wserver, bool rediscovery);
-
-/* sec_helper.cc: Security helper functions. */
-int set_privilege (HANDLE token, DWORD privilege, bool enable);
-void set_cygwin_privileges (HANDLE token);
-
-#define _push_thread_privilege(_priv, _val, _check) { \
- HANDLE _dup_token = NULL; \
- HANDLE _token = (cygheap->user.issetuid () && (_check)) \
- ? cygheap->user.primary_token () : hProcToken; \
- if (!DuplicateTokenEx (_token, MAXIMUM_ALLOWED, NULL, \
- SecurityImpersonation, TokenImpersonation, \
- &_dup_token)) \
- debug_printf ("DuplicateTokenEx: %E"); \
- else if (!ImpersonateLoggedOnUser (_dup_token)) \
- debug_printf ("ImpersonateLoggedOnUser: %E"); \
- else \
- set_privilege (_dup_token, (_priv), (_val));
-
-#define push_thread_privilege(_priv, _val) _push_thread_privilege(_priv,_val,1)
-#define push_self_privilege(_priv, _val) _push_thread_privilege(_priv,_val,0)
-
-#define pop_thread_privilege() \
- if (_dup_token) \
- { \
- if (!cygheap->user.issetuid ()) \
- RevertToSelf (); \
- else \
- cygheap->user.reimpersonate (); \
- CloseHandle (_dup_token); \
- } \
- }
-
-#define pop_self_privilege() pop_thread_privilege()
-
-/* shared.cc: */
-/* Retrieve a security descriptor that allows all access */
-SECURITY_DESCRIPTOR *__stdcall get_null_sd ();
-
-/* Various types of security attributes for use in Create* functions. */
-extern SECURITY_ATTRIBUTES sec_none, sec_none_nih, sec_all, sec_all_nih;
-extern SECURITY_ATTRIBUTES *__stdcall __sec_user (PVOID sa_buf, PSID sid1, PSID sid2,
- DWORD access2, BOOL inherit)
- __attribute__ ((regparm (3)));
-extern PSECURITY_DESCRIPTOR _everyone_sd (void *buf, ACCESS_MASK access);
-#define everyone_sd(access) (_everyone_sd (alloca (SD_MIN_SIZE), (access)))
-
-extern bool sec_acl (PACL acl, bool original, bool admins, PSID sid1 = NO_SID,
- PSID sid2 = NO_SID, DWORD access2 = 0);
-
-ssize_t __stdcall read_ea (HANDLE hdl, path_conv &pc, const char *name,
- char *value, size_t size);
-int __stdcall write_ea (HANDLE hdl, path_conv &pc, const char *name,
- const char *value, size_t size, int flags);
-
-/* Note: sid1 is usually (read: currently always) the current user's
- effective sid (cygheap->user.sid ()). */
-extern inline SECURITY_ATTRIBUTES *
-sec_user_nih (SECURITY_ATTRIBUTES *sa_buf, PSID sid1, PSID sid2 = NULL,
- DWORD access2 = 0)
-{
- return __sec_user (sa_buf, sid1, sid2, access2, FALSE);
-}
-
-extern inline SECURITY_ATTRIBUTES *
-sec_user (SECURITY_ATTRIBUTES *sa_buf, PSID sid1, PSID sid2 = NULL,
- DWORD access2 = 0)
-{
- return __sec_user (sa_buf, sid1, sid2, access2, TRUE);
-}
-#endif /*_SECURITY_H*/
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
deleted file mode 100644
index 6be10ec276a..00000000000
--- a/winsup/cygwin/select.cc
+++ /dev/null
@@ -1,1606 +0,0 @@
-/* select.cc
-
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-/* The following line means that the BSD socket definitions for
- fd_set, FD_ISSET etc. are used in this file. */
-
-#define __INSIDE_CYGWIN_NET__
-
-#include "winsup.h"
-#include <stdlib.h>
-#include "ntdll.h"
-
-#include <wingdi.h>
-#include <winuser.h>
-#include <netdb.h>
-#define USE_SYS_TYPES_FD_SET
-#include <winsock.h>
-#include "cygerrno.h"
-#include "security.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "cygheap.h"
-#include "pinfo.h"
-#include "sigproc.h"
-#include "cygtls.h"
-
-/*
- * All these defines below should be in sys/types.h
- * but because of the includes above, they may not have
- * been included. We create special UNIX_xxxx versions here.
- */
-
-#ifndef NBBY
-#define NBBY 8 /* number of bits in a byte */
-#endif /* NBBY */
-
-/*
- * Select uses bit masks of file descriptors in longs.
- * These macros manipulate such bit fields (the filesystem macros use chars).
- * FD_SETSIZE may be defined by the user, but the default here
- * should be >= NOFILE (param.h).
- */
-
-typedef long fd_mask;
-#define UNIX_NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
-#ifndef unix_howmany
-#define unix_howmany(x,y) (((x)+((y)-1))/(y))
-#endif
-
-#define unix_fd_set fd_set
-
-#define NULL_fd_set ((fd_set *) NULL)
-#define sizeof_fd_set(n) \
- ((unsigned) (NULL_fd_set->fds_bits + unix_howmany ((n), UNIX_NFDBITS)))
-#define UNIX_FD_SET(n, p) \
- ((p)->fds_bits[(n)/UNIX_NFDBITS] |= (1L << ((n) % UNIX_NFDBITS)))
-#define UNIX_FD_CLR(n, p) \
- ((p)->fds_bits[(n)/UNIX_NFDBITS] &= ~(1L << ((n) % UNIX_NFDBITS)))
-#define UNIX_FD_ISSET(n, p) \
- ((p)->fds_bits[(n)/UNIX_NFDBITS] & (1L << ((n) % UNIX_NFDBITS)))
-#define UNIX_FD_ZERO(p, n) \
- bzero ((caddr_t)(p), sizeof_fd_set ((n)))
-
-#define allocfd_set(n) ((fd_set *) memset (alloca (sizeof_fd_set (n)), 0, sizeof_fd_set (n)))
-#define copyfd_set(to, from, n) memcpy (to, from, sizeof_fd_set (n));
-
-#define set_handle_or_return_if_not_open(h, s) \
- h = (s)->fh->get_handle (); \
- if (cygheap->fdtab.not_open ((s)->fd)) \
- { \
- (s)->thread_errno = EBADF; \
- return -1; \
- } \
-
-/* The main select code.
- */
-extern "C" int
-cygwin_select (int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
- struct timeval *to)
-{
- select_stuff sel;
- fd_set *dummy_readfds = allocfd_set (maxfds);
- fd_set *dummy_writefds = allocfd_set (maxfds);
- fd_set *dummy_exceptfds = allocfd_set (maxfds);
-
- select_printf ("%d, %p, %p, %p, %p", maxfds, readfds, writefds, exceptfds, to);
-
- if (!readfds)
- readfds = dummy_readfds;
- if (!writefds)
- writefds = dummy_writefds;
- if (!exceptfds)
- exceptfds = dummy_exceptfds;
-
- for (int i = 0; i < maxfds; i++)
- if (!sel.test_and_set (i, readfds, writefds, exceptfds))
- {
- select_printf ("aborting due to test_and_set error");
- return -1; /* Invalid fd, maybe? */
- }
-
- /* Convert to milliseconds or INFINITE if to == NULL */
- DWORD ms = to ? (to->tv_sec * 1000) + (to->tv_usec / 1000) : INFINITE;
- if (ms == 0 && to->tv_usec)
- ms = 1; /* At least 1 ms granularity */
-
- if (to)
- select_printf ("to->tv_sec %d, to->tv_usec %d, ms %d", to->tv_sec, to->tv_usec, ms);
- else
- select_printf ("to NULL, ms %x", ms);
-
- select_printf ("sel.always_ready %d", sel.always_ready);
-
- int timeout = 0;
- /* Allocate some fd_set structures using the number of fds as a guide. */
- fd_set *r = allocfd_set (maxfds);
- fd_set *w = allocfd_set (maxfds);
- fd_set *e = allocfd_set (maxfds);
-
- /* Degenerate case. No fds to wait for. Just wait. */
- if (sel.start.next == NULL)
- {
- if (WaitForSingleObject (signal_arrived, ms) == WAIT_OBJECT_0)
- {
- select_printf ("signal received");
- set_sig_errno (EINTR);
- return -1;
- }
- timeout = 1;
- }
- else if (sel.always_ready || ms == 0)
- /* Don't bother waiting. */;
- else if ((timeout = sel.wait (r, w, e, ms) < 0))
- return -1; /* some kind of error */
-
- sel.cleanup ();
- copyfd_set (readfds, r, maxfds);
- copyfd_set (writefds, w, maxfds);
- copyfd_set (exceptfds, e, maxfds);
- return timeout ? 0 : sel.poll (readfds, writefds, exceptfds);
-}
-
-extern "C" int
-pselect(int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
- const struct timespec *ts, const sigset_t *set)
-{
- struct timeval tv;
- sigset_t oldset = _my_tls.sigmask;
-
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- if (ts)
- {
- tv.tv_sec = ts->tv_sec;
- tv.tv_usec = ts->tv_nsec / 1000;
- }
- if (set)
- set_signal_mask (*set, _my_tls.sigmask);
- int ret = cygwin_select (maxfds, readfds, writefds, exceptfds,
- ts ? &tv : NULL);
- if (set)
- set_signal_mask (oldset, _my_tls.sigmask);
- return ret;
-}
-
-/* Call cleanup functions for all inspected fds. Gets rid of any
- executing threads. */
-void
-select_stuff::cleanup ()
-{
- select_record *s = &start;
-
- select_printf ("calling cleanup routines");
- while ((s = s->next))
- if (s->cleanup)
- {
- s->cleanup (s, this);
- s->cleanup = NULL;
- }
-}
-
-/* Destroy all storage associated with select stuff. */
-select_stuff::~select_stuff ()
-{
- cleanup ();
- select_record *s = &start;
- select_record *snext = start.next;
-
- select_printf ("deleting select records");
- while ((s = snext))
- {
- snext = s->next;
- delete s;
- }
-}
-
-/* Add a record to the select chain */
-int
-select_stuff::test_and_set (int i, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds)
-{
- select_record *s = NULL;
- if (UNIX_FD_ISSET (i, readfds) && (s = cygheap->fdtab.select_read (i, s)) == NULL)
- return 0; /* error */
- if (UNIX_FD_ISSET (i, writefds) && (s = cygheap->fdtab.select_write (i, s)) == NULL)
- return 0; /* error */
- if (UNIX_FD_ISSET (i, exceptfds) && (s = cygheap->fdtab.select_except (i, s)) == NULL)
- return 0; /* error */
- if (s == NULL)
- return 1; /* nothing to do */
-
- if (s->read_ready || s->write_ready || s->except_ready)
- always_ready = true;
-
- if (s->windows_handle)
- windows_used = true;
-
- s->next = start.next;
- start.next = s;
- return 1;
-}
-
-/* The heart of select. Waits for an fd to do something interesting. */
-int
-select_stuff::wait (fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
- DWORD ms)
-{
- int wait_ret;
- HANDLE w4[MAXIMUM_WAIT_OBJECTS];
- select_record *s = &start;
- int m = 0;
- int res = 0;
-
- w4[m++] = signal_arrived; /* Always wait for the arrival of a signal. */
- /* Loop through the select chain, starting up anything appropriate and
- counting the number of active fds. */
- while ((s = s->next))
- {
- if (m >= MAXIMUM_WAIT_OBJECTS)
- {
- set_sig_errno (EINVAL);
- return -1;
- }
- if (!s->startup (s, this))
- {
- s->set_select_errno ();
- return -1;
- }
- if (s->h == NULL)
- continue;
- for (int i = 1; i < m; i++)
- if (w4[i] == s->h)
- goto next_while;
- w4[m++] = s->h;
- next_while:
- continue;
- }
-
- LONGLONG start_time = gtod.msecs (); /* Record the current time for later use. */
-
- debug_printf ("m %d, ms %u", m, ms);
- for (;;)
- {
- if (!windows_used)
- wait_ret = WaitForMultipleObjects (m, w4, FALSE, ms);
- else
- wait_ret = MsgWaitForMultipleObjects (m, w4, FALSE, ms, QS_ALLINPUT);
-
- switch (wait_ret)
- {
- case WAIT_OBJECT_0:
- select_printf ("signal received");
- set_sig_errno (EINTR);
- return -1;
- case WAIT_FAILED:
- select_printf ("WaitForMultipleObjects failed");
- s->set_select_errno ();
- return -1;
- case WAIT_TIMEOUT:
- select_printf ("timed out");
- res = 1;
- goto out;
- }
-
- select_printf ("woke up. wait_ret %d. verifying", wait_ret);
- s = &start;
- bool gotone = false;
- /* Some types of objects (e.g., consoles) wake up on "inappropriate" events
- like mouse movements. The verify function will detect these situations.
- If it returns false, then this wakeup was a false alarm and we should go
- back to waiting. */
- while ((s = s->next))
- if (s->saw_error ())
- {
- set_errno (s->saw_error ());
- return -1; /* Somebody detected an error */
- }
- else if ((((wait_ret >= m && s->windows_handle) || s->h == w4[wait_ret])) &&
- s->verify (s, readfds, writefds, exceptfds))
- gotone = true;
-
- select_printf ("gotone %d", gotone);
- if (gotone)
- goto out;
-
- if (ms == INFINITE)
- {
- select_printf ("looping");
- continue;
- }
- select_printf ("recalculating ms");
-
- LONGLONG now = gtod.msecs ();
- if (now > (start_time + ms))
- {
- select_printf ("timed out after verification");
- goto out;
- }
- ms -= (now - start_time);
- start_time = now;
- select_printf ("ms now %u", ms);
- }
-
-out:
- select_printf ("returning %d", res);
- return res;
-}
-
-static int
-set_bits (select_record *me, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds)
-{
- int ready = 0;
- fhandler_socket *sock;
- select_printf ("me %p, testing fd %d (%s)", me, me->fd, me->fh->get_name ());
- if (me->read_selected && me->read_ready)
- {
- UNIX_FD_SET (me->fd, readfds);
- ready++;
- }
- if (me->write_selected && me->write_ready)
- {
- UNIX_FD_SET (me->fd, writefds);
- if (me->except_on_write && (sock = me->fh->is_socket ()))
- {
- /* Special AF_LOCAL handling. */
- if (!me->read_ready && sock->connect_state () == connect_pending
- && sock->af_local_connect ())
- {
- if (me->read_selected)
- UNIX_FD_SET (me->fd, readfds);
- sock->connect_state (connect_failed);
- }
- else
- sock->connect_state (connected);
- }
- ready++;
- }
- if (me->except_selected && me->except_ready)
- {
- UNIX_FD_SET (me->fd, exceptfds);
- ready++;
- }
- select_printf ("ready %d", ready);
- return ready;
-}
-
-/* Poll every fd in the select chain. Set appropriate fd in mask. */
-int
-select_stuff::poll (fd_set *readfds, fd_set *writefds, fd_set *exceptfds)
-{
- int n = 0;
- select_record *s = &start;
- while ((s = s->next))
- n += (!s->peek || s->peek (s, true)) ?
- set_bits (s, readfds, writefds, exceptfds) : 0;
- select_printf ("returning %d", n);
- return n;
-}
-
-static int
-verify_true (select_record *, fd_set *, fd_set *, fd_set *)
-{
- return 1;
-}
-
-static int
-verify_ok (select_record *me, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds)
-{
- return set_bits (me, readfds, writefds, exceptfds);
-}
-
-static int
-no_startup (select_record *, select_stuff *)
-{
- return 1;
-}
-
-static int
-no_verify (select_record *, fd_set *, fd_set *, fd_set *)
-{
- return 0;
-}
-
-static int
-peek_pipe (select_record *s, bool from_select)
-{
- int n = 0;
- int gotone = 0;
- fhandler_base *fh = s->fh;
-
- HANDLE h;
- set_handle_or_return_if_not_open (h, s);
-
- /* Don't perform complicated tests if we don't need to. */
- if (!s->read_selected && !s->except_selected)
- goto out;
-
- if (s->read_selected)
- {
- if (s->read_ready)
- {
- select_printf ("%s, already ready for read", fh->get_name ());
- gotone = 1;
- goto out;
- }
-
- switch (fh->get_major ())
- {
- case DEV_TTYM_MAJOR:
- if (((fhandler_pty_master *) fh)->need_nl)
- {
- gotone = s->read_ready = true;
- goto out;
- }
- break;
- default:
- if (fh->get_readahead_valid ())
- {
- select_printf ("readahead");
- gotone = s->read_ready = true;
- goto out;
- }
- }
-
- if (fh->bg_check (SIGTTIN) <= bg_eof)
- {
- gotone = s->read_ready = true;
- goto out;
- }
- }
-
- if (fh->get_device () == FH_PIPEW)
- select_printf ("%s, select for read/except on write end of pipe",
- fh->get_name ());
- else if (!PeekNamedPipe (h, NULL, 0, NULL, (DWORD *) &n, NULL))
- {
- select_printf ("%s, PeekNamedPipe failed, %E", fh->get_name ());
- n = -1;
- }
-
- if (n < 0)
- {
- select_printf ("%s, n %d", fh->get_name (), n);
- if (s->except_selected)
- gotone += s->except_ready = true;
- if (s->read_selected)
- gotone += s->read_ready = true;
- }
- if (n > 0 && s->read_selected)
- {
- select_printf ("%s, ready for read: avail %d", fh->get_name (), n);
- gotone += s->read_ready = true;
- }
- if (!gotone && s->fh->hit_eof ())
- {
- select_printf ("%s, saw EOF", fh->get_name ());
- if (s->except_selected)
- gotone += s->except_ready = true;
- if (s->read_selected)
- gotone += s->read_ready = true;
- }
-
-out:
- if (s->write_selected)
- {
- if (s->write_ready)
- {
- select_printf ("%s, already ready for write", fh->get_name ());
- gotone++;
- }
- /* Do we need to do anything about SIGTTOU here? */
- else if (fh->get_device () == FH_PIPER)
- select_printf ("%s, select for write on read end of pipe",
- fh->get_name ());
- else
- {
-#if 1
-/* FIXME: This code is not quite correct. There's no better solution
- so far but to make simple assumptions based on WriteQuotaAvailable. */
-
- IO_STATUS_BLOCK iosb = {0};
- FILE_PIPE_LOCAL_INFORMATION fpli = {0};
-
- if (NtQueryInformationFile (h,
- &iosb,
- &fpli,
- sizeof (fpli),
- FilePipeLocalInformation))
- {
- /* If NtQueryInformationFile fails, optimistically assume the
- pipe is writable. This could happen if we somehow
- inherit a pipe that doesn't permit FILE_READ_ATTRIBUTES
- access on the write end. */
- select_printf ("%s, NtQueryInformationFile failed",
- fh->get_name ());
- gotone += s->write_ready = true;
- }
- /* If there is anything available in the pipe buffer then signal
- that. This means that a pipe could still block since you could
- be trying to write more to the pipe than is available in the
- buffer but that is the hazard of select(). */
- else if (fpli.WriteQuotaAvailable = (fpli.OutboundQuota - fpli.ReadDataAvailable))
- {
- select_printf ("%s, ready for write: size %lu, avail %lu",
- fh->get_name (),
- fpli.OutboundQuota,
- fpli.WriteQuotaAvailable);
- gotone += s->write_ready = true;
- }
- /* If we somehow inherit a tiny pipe (size < PIPE_BUF), then consider
- the pipe writable only if it is completely empty, to minimize the
- probability that a subsequent write will block. */
- else if (fpli.OutboundQuota < PIPE_BUF &&
- fpli.WriteQuotaAvailable == fpli.OutboundQuota)
- {
- select_printf ("%s, tiny pipe: size %lu, avail %lu",
- fh->get_name (),
- fpli.OutboundQuota,
- fpli.WriteQuotaAvailable);
- gotone += s->write_ready = true;
- }
-#else
- gotone += s->write_ready = true;
-#endif
- }
- }
-
- return gotone;
-}
-
-static int start_thread_pipe (select_record *me, select_stuff *stuff);
-
-struct pipeinf
- {
- cygthread *thread;
- bool stop_thread_pipe;
- select_record *start;
- };
-
-static DWORD WINAPI
-thread_pipe (void *arg)
-{
- pipeinf *pi = (pipeinf *) arg;
- bool gotone = false;
- DWORD sleep_time = 0;
-
- for (;;)
- {
- select_record *s = pi->start;
- while ((s = s->next))
- if (s->startup == start_thread_pipe)
- {
- if (peek_pipe (s, true))
- gotone = true;
- if (pi->stop_thread_pipe)
- {
- select_printf ("stopping");
- goto out;
- }
- }
- /* Paranoid check */
- if (pi->stop_thread_pipe)
- {
- select_printf ("stopping from outer loop");
- break;
- }
- if (gotone)
- break;
- Sleep (sleep_time >> 3);
- if (sleep_time < 80)
- ++sleep_time;
- }
-out:
- return 0;
-}
-
-static int
-start_thread_pipe (select_record *me, select_stuff *stuff)
-{
- if (stuff->device_specific_pipe)
- {
- me->h = *((pipeinf *) stuff->device_specific_pipe)->thread;
- return 1;
- }
- pipeinf *pi = new pipeinf;
- pi->start = &stuff->start;
- pi->stop_thread_pipe = false;
- pi->thread = new cygthread (thread_pipe, 0, pi, "select_pipe");
- me->h = *pi->thread;
- if (!me->h)
- return 0;
- stuff->device_specific_pipe = (void *) pi;
- return 1;
-}
-
-static void
-pipe_cleanup (select_record *, select_stuff *stuff)
-{
- pipeinf *pi = (pipeinf *) stuff->device_specific_pipe;
- if (pi && pi->thread)
- {
- pi->stop_thread_pipe = true;
- pi->thread->detach ();
- delete pi;
- stuff->device_specific_pipe = NULL;
- }
-}
-
-int
-fhandler_pipe::ready_for_read (int fd, DWORD howlong)
-{
- int res;
- if (!howlong)
- res = fhandler_base::ready_for_read (fd, howlong);
- else
- res = 1;
- return res;
-}
-
-select_record *
-fhandler_pipe::select_read (select_record *s)
-{
- if (!s)
- s = new select_record;
- s->startup = start_thread_pipe;
- s->peek = peek_pipe;
- s->verify = verify_ok;
- s->cleanup = pipe_cleanup;
- s->read_selected = true;
- s->read_ready = false;
- return s;
-}
-
-select_record *
-fhandler_pipe::select_write (select_record *s)
-{
- if (!s)
- s = new select_record;
- s->startup = start_thread_pipe;
- s->peek = peek_pipe;
- s->verify = verify_ok;
- s->cleanup = pipe_cleanup;
- s->write_selected = true;
- s->write_ready = false;
- return s;
-}
-
-select_record *
-fhandler_pipe::select_except (select_record *s)
-{
- if (!s)
- s = new select_record;
- s->startup = start_thread_pipe;
- s->peek = peek_pipe;
- s->verify = verify_ok;
- s->cleanup = pipe_cleanup;
- s->except_selected = true;
- s->except_ready = false;
- return s;
-}
-
-static int
-peek_console (select_record *me, bool)
-{
- extern const char * get_nonascii_key (INPUT_RECORD& input_rec, char *);
- fhandler_console *fh = (fhandler_console *) me->fh;
-
- if (!me->read_selected)
- return me->write_ready;
-
- if (fh->get_readahead_valid ())
- {
- select_printf ("readahead");
- return me->read_ready = true;
- }
-
- if (me->read_ready)
- {
- select_printf ("already ready");
- return 1;
- }
-
- INPUT_RECORD irec;
- DWORD events_read;
- HANDLE h;
- char tmpbuf[17];
- set_handle_or_return_if_not_open (h, me);
-
- for (;;)
- if (fh->bg_check (SIGTTIN) <= bg_eof)
- return me->read_ready = true;
- else if (!PeekConsoleInput (h, &irec, 1, &events_read) || !events_read)
- break;
- else
- {
- if (irec.EventType == KEY_EVENT)
- {
- if (irec.Event.KeyEvent.bKeyDown
- && (irec.Event.KeyEvent.uChar.AsciiChar
- || get_nonascii_key (irec, tmpbuf)))
- return me->read_ready = true;
- }
- else
- {
- fh->send_winch_maybe ();
- if (irec.EventType == MOUSE_EVENT
- && fh->mouse_aware ()
- && (irec.Event.MouseEvent.dwEventFlags == 0
- || irec.Event.MouseEvent.dwEventFlags == DOUBLE_CLICK))
- return me->read_ready = true;
- }
-
- /* Read and discard the event */
- ReadConsoleInput (h, &irec, 1, &events_read);
- }
-
- return me->write_ready;
-}
-
-static int
-verify_console (select_record *me, fd_set *rfds, fd_set *wfds,
- fd_set *efds)
-{
- return peek_console (me, true);
-}
-
-
-select_record *
-fhandler_console::select_read (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = verify_console;
- set_cursor_maybe ();
- }
-
- s->peek = peek_console;
- s->h = get_handle ();
- s->read_selected = true;
- s->read_ready = false;
- return s;
-}
-
-select_record *
-fhandler_console::select_write (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = no_verify;
- set_cursor_maybe ();
- }
-
- s->peek = peek_console;
- s->write_selected = true;
- s->write_ready = true;
- return s;
-}
-
-select_record *
-fhandler_console::select_except (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = no_verify;
- set_cursor_maybe ();
- }
-
- s->peek = peek_console;
- s->except_selected = true;
- s->except_ready = false;
- return s;
-}
-
-select_record *
-fhandler_tty_common::select_read (select_record *s)
-{
- return ((fhandler_pipe *) this)->fhandler_pipe::select_read (s);
-}
-
-select_record *
-fhandler_tty_common::select_write (select_record *s)
-{
- return ((fhandler_pipe *) this)->fhandler_pipe::select_write (s);
-}
-
-select_record *
-fhandler_tty_common::select_except (select_record *s)
-{
- return ((fhandler_pipe *) this)->fhandler_pipe::select_except (s);
-}
-
-static int
-verify_tty_slave (select_record *me, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds)
-{
- if (WaitForSingleObject (me->h, 0) == WAIT_OBJECT_0)
- me->read_ready = true;
- return set_bits (me, readfds, writefds, exceptfds);
-}
-
-select_record *
-fhandler_tty_slave::select_read (select_record *s)
-{
- if (!s)
- s = new select_record;
- s->h = input_available_event;
- s->startup = no_startup;
- s->peek = peek_pipe;
- s->verify = verify_tty_slave;
- s->read_selected = true;
- s->read_ready = false;
- s->cleanup = NULL;
- return s;
-}
-
-select_record *
-fhandler_dev_null::select_read (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = no_verify;
- }
- s->h = get_handle ();
- s->read_selected = true;
- s->read_ready = true;
- return s;
-}
-
-select_record *
-fhandler_dev_null::select_write (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = no_verify;
- }
- s->h = get_handle ();
- s->write_selected = true;
- s->write_ready = true;
- return s;
-}
-
-select_record *
-fhandler_dev_null::select_except (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = no_verify;
- }
- s->h = get_handle ();
- s->except_selected = true;
- s->except_ready = false;
- return s;
-}
-
-static int start_thread_serial (select_record *me, select_stuff *stuff);
-
-struct serialinf
- {
- cygthread *thread;
- bool stop_thread_serial;
- select_record *start;
- };
-
-static int
-peek_serial (select_record *s, bool)
-{
- COMSTAT st;
-
- fhandler_serial *fh = (fhandler_serial *) s->fh;
-
- if (fh->get_readahead_valid () || fh->overlapped_armed < 0)
- return s->read_ready = true;
-
- select_printf ("fh->overlapped_armed %d", fh->overlapped_armed);
-
- HANDLE h;
- set_handle_or_return_if_not_open (h, s);
- int ready = 0;
-
- if (s->read_selected && s->read_ready || (s->write_selected && s->write_ready))
- {
- select_printf ("already ready");
- ready = 1;
- goto out;
- }
-
- SetCommMask (h, EV_RXCHAR);
-
- if (!fh->overlapped_armed)
- {
- COMSTAT st;
-
- ResetEvent (fh->io_status.hEvent);
-
- if (!ClearCommError (h, &fh->ev, &st))
- {
- debug_printf ("ClearCommError");
- goto err;
- }
- else if (st.cbInQue)
- return s->read_ready = true;
- else if (WaitCommEvent (h, &fh->ev, &fh->io_status))
- return s->read_ready = true;
- else if (GetLastError () == ERROR_IO_PENDING)
- fh->overlapped_armed = 1;
- else
- {
- debug_printf ("WaitCommEvent");
- goto err;
- }
- }
-
- HANDLE w4[2];
- DWORD to;
-
- w4[0] = fh->io_status.hEvent;
- w4[1] = signal_arrived;
- to = 10;
-
- switch (WaitForMultipleObjects (2, w4, FALSE, to))
- {
- case WAIT_OBJECT_0:
- if (!ClearCommError (h, &fh->ev, &st))
- {
- debug_printf ("ClearCommError");
- goto err;
- }
- else if (!st.cbInQue)
- Sleep (to);
- else
- {
- return s->read_ready = true;
- select_printf ("got something");
- }
- break;
- case WAIT_OBJECT_0 + 1:
- select_printf ("interrupt");
- set_sig_errno (EINTR);
- ready = -1;
- break;
- case WAIT_TIMEOUT:
- break;
- default:
- debug_printf ("WaitForMultipleObjects");
- goto err;
- }
-
-out:
- return ready;
-
-err:
- if (GetLastError () == ERROR_OPERATION_ABORTED)
- {
- select_printf ("operation aborted");
- return ready;
- }
-
- s->set_select_errno ();
- select_printf ("error %E");
- return -1;
-}
-
-static DWORD WINAPI
-thread_serial (void *arg)
-{
- serialinf *si = (serialinf *) arg;
- bool gotone = false;
-
- for (;;)
- {
- select_record *s = si->start;
- while ((s = s->next))
- if (s->startup == start_thread_serial)
- {
- if (peek_serial (s, true))
- gotone = true;
- }
- if (si->stop_thread_serial)
- {
- select_printf ("stopping");
- break;
- }
- if (gotone)
- break;
- }
-
- select_printf ("exiting");
- return 0;
-}
-
-static int
-start_thread_serial (select_record *me, select_stuff *stuff)
-{
- if (stuff->device_specific_serial)
- {
- me->h = *((serialinf *) stuff->device_specific_serial)->thread;
- return 1;
- }
- serialinf *si = new serialinf;
- si->start = &stuff->start;
- si->stop_thread_serial = false;
- si->thread = new cygthread (thread_serial, 0, si, "select_serial");
- me->h = *si->thread;
- stuff->device_specific_serial = (void *) si;
- return 1;
-}
-
-static void
-serial_cleanup (select_record *, select_stuff *stuff)
-{
- serialinf *si = (serialinf *) stuff->device_specific_serial;
- if (si && si->thread)
- {
- si->stop_thread_serial = true;
- si->thread->detach ();
- delete si;
- stuff->device_specific_serial = NULL;
- }
-}
-
-select_record *
-fhandler_serial::select_read (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = start_thread_serial;
- s->verify = verify_ok;
- s->cleanup = serial_cleanup;
- }
- s->peek = peek_serial;
- s->read_selected = true;
- s->read_ready = false;
- return s;
-}
-
-select_record *
-fhandler_serial::select_write (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = verify_ok;
- }
- s->peek = peek_serial;
- s->h = get_handle ();
- s->write_selected = true;
- s->write_ready = true;
- return s;
-}
-
-select_record *
-fhandler_serial::select_except (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = verify_ok;
- }
- s->h = NULL;
- s->peek = peek_serial;
- s->except_selected = false; // Can't do this
- s->except_ready = false;
- return s;
-}
-
-int
-fhandler_base::ready_for_read (int fd, DWORD howlong)
-{
- bool avail = false;
- select_record me (this);
- me.fd = fd;
- while (!avail)
- {
- select_read (&me);
- avail = me.read_ready ?: me.peek (&me, false);
-
- if (fd >= 0 && cygheap->fdtab.not_open (fd))
- {
- set_sig_errno (EBADF);
- avail = false;
- break;
- }
-
- if (howlong != INFINITE)
- {
- if (!avail)
- set_sig_errno (EAGAIN);
- break;
- }
-
- if (WaitForSingleObject (signal_arrived, avail ? 0 : 10) == WAIT_OBJECT_0)
- {
- debug_printf ("interrupted");
- set_sig_errno (EINTR);
- avail = false;
- break;
- }
- }
-
- select_printf ("read_ready %d, avail %d", me.read_ready, avail);
- return avail;
-}
-
-select_record *
-fhandler_base::select_read (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = verify_ok;
- }
- s->h = get_handle ();
- s->read_selected = true;
- s->read_ready = true;
- return s;
-}
-
-select_record *
-fhandler_base::select_write (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = verify_ok;
- }
- s->h = get_handle ();
- s->write_selected = true;
- s->write_ready = true;
- return s;
-}
-
-select_record *
-fhandler_base::select_except (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = verify_ok;
- }
- s->h = NULL;
- s->except_selected = true;
- s->except_ready = false;
- return s;
-}
-
-static int
-peek_socket (select_record *me, bool)
-{
- fhandler_socket *fh = (fhandler_socket *) me->fh;
- long events;
- /* Don't play with the settings again, unless having taken a deep look into
- Richard W. Stevens Network Programming book. Thank you. */
- long evt_mask = (me->read_selected ? (FD_READ | FD_ACCEPT | FD_CLOSE) : 0)
- | (me->write_selected ? (FD_WRITE | FD_CONNECT | FD_CLOSE) : 0)
- | (me->except_selected ? FD_OOB : 0);
- int ret = fh->evaluate_events (evt_mask, events, false);
- if (me->read_selected)
- me->read_ready |= ret || !!(events & (FD_READ | FD_ACCEPT | FD_CLOSE));
- if (me->write_selected)
- me->write_ready |= ret || !!(events & (FD_WRITE | FD_CONNECT | FD_CLOSE));
- if (me->except_selected)
- me->except_ready |= !!(events & FD_OOB);
-
- select_printf ("read_ready: %d, write_ready: %d, except_ready: %d",
- me->read_ready, me->write_ready, me->except_ready);
- return me->read_ready || me->write_ready || me->except_ready;
-}
-
-static int start_thread_socket (select_record *, select_stuff *);
-
-struct socketinf
- {
- cygthread *thread;
- int max_w4;
- int num_w4;
- LONG *ser_num;
- HANDLE *w4;
- select_record *start;
- };
-
-static DWORD WINAPI
-thread_socket (void *arg)
-{
- socketinf *si = (socketinf *) arg;
- DWORD timeout = 64 / (si->max_w4 / MAXIMUM_WAIT_OBJECTS);
- bool event = false;
-
- select_printf ("stuff_start %p", si->start);
- while (!event)
- {
- for (select_record *s = si->start; (s = s->next); )
- if (s->startup == start_thread_socket)
- if (peek_socket (s, false))
- event = true;
- if (!event)
- for (int i = 0; i < si->max_w4; i += MAXIMUM_WAIT_OBJECTS)
- switch (WaitForMultipleObjects (min (si->num_w4 - i,
- MAXIMUM_WAIT_OBJECTS),
- si->w4 + i, FALSE, timeout))
- {
- case WAIT_FAILED:
- goto out;
- case WAIT_OBJECT_0:
- if (!i) /* Socket event set. */
- goto out;
- break;
- case WAIT_TIMEOUT:
- default:
- break;
- }
- }
-out:
- select_printf ("leaving thread_socket");
- return 0;
-}
-
-static int
-start_thread_socket (select_record *me, select_stuff *stuff)
-{
- socketinf *si;
-
- if ((si = (socketinf *) stuff->device_specific_socket))
- {
- me->h = *si->thread;
- return 1;
- }
-
- si = new socketinf;
- si->ser_num = (LONG *) malloc (MAXIMUM_WAIT_OBJECTS * sizeof (LONG));
- si->w4 = (HANDLE *) malloc (MAXIMUM_WAIT_OBJECTS * sizeof (HANDLE));
- if (!si->ser_num || !si->w4)
- return 0;
- si->max_w4 = MAXIMUM_WAIT_OBJECTS;
- select_record *s = &stuff->start;
- if (_my_tls.locals.select_sockevt != INVALID_HANDLE_VALUE)
- si->w4[0] = _my_tls.locals.select_sockevt;
- else if (!(si->w4[0] = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL)))
- return 1;
- else
- _my_tls.locals.select_sockevt = si->w4[0];
- si->num_w4 = 1;
- while ((s = s->next))
- if (s->startup == start_thread_socket)
- {
- /* No event/socket should show up multiple times. Every socket
- is uniquely identified by its serial number in the global
- wsock_events record. */
- const LONG ser_num = ((fhandler_socket *) s->fh)->serial_number ();
- for (int i = 1; i < si->num_w4; ++i)
- if (si->ser_num[i] == ser_num)
- goto continue_outer_loop;
- if (si->num_w4 >= si->max_w4)
- {
- LONG *nser = (LONG *) realloc (si->ser_num,
- (si->max_w4 + MAXIMUM_WAIT_OBJECTS)
- * sizeof (LONG));
- if (!nser)
- return 0;
- si->ser_num = nser;
- HANDLE *nw4 = (HANDLE *) realloc (si->w4,
- (si->max_w4 + MAXIMUM_WAIT_OBJECTS)
- * sizeof (HANDLE));
- if (!nw4)
- return 0;
- si->w4 = nw4;
- si->max_w4 += MAXIMUM_WAIT_OBJECTS;
- }
- si->ser_num[si->num_w4] = ser_num;
- si->w4[si->num_w4++] = ((fhandler_socket *) s->fh)->wsock_event ();
- continue_outer_loop:
- ;
- }
- stuff->device_specific_socket = (void *) si;
- si->start = &stuff->start;
- select_printf ("stuff_start %p", &stuff->start);
- si->thread = new cygthread (thread_socket, 0, si, "select_socket");
- me->h = *si->thread;
- return 1;
-}
-
-void
-socket_cleanup (select_record *, select_stuff *stuff)
-{
- socketinf *si = (socketinf *) stuff->device_specific_socket;
- select_printf ("si %p si->thread %p", si, si ? si->thread : NULL);
- if (si && si->thread)
- {
- SetEvent (si->w4[0]);
- /* Wait for thread to go away */
- si->thread->detach ();
- ResetEvent (si->w4[0]);
- stuff->device_specific_socket = NULL;
- if (si->ser_num)
- free (si->ser_num);
- if (si->w4)
- free (si->w4);
- delete si;
- }
- select_printf ("returning");
-}
-
-select_record *
-fhandler_socket::select_read (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = start_thread_socket;
- s->verify = verify_true;
- s->cleanup = socket_cleanup;
- }
- s->peek = peek_socket;
- s->read_ready = saw_shutdown_read ();
- s->read_selected = true;
- return s;
-}
-
-select_record *
-fhandler_socket::select_write (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = start_thread_socket;
- s->verify = verify_true;
- s->cleanup = socket_cleanup;
- }
- s->peek = peek_socket;
- s->write_ready = saw_shutdown_write () || connect_state () == unconnected;
- s->write_selected = true;
- if (connect_state () != unconnected)
- {
- s->except_ready = saw_shutdown_write () || saw_shutdown_read ();
- s->except_on_write = true;
- }
- return s;
-}
-
-select_record *
-fhandler_socket::select_except (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = start_thread_socket;
- s->verify = verify_true;
- s->cleanup = socket_cleanup;
- }
- s->peek = peek_socket;
- /* FIXME: Is this right? Should these be used as criteria for except? */
- s->except_ready = saw_shutdown_write () || saw_shutdown_read ();
- s->except_selected = true;
- return s;
-}
-
-static int
-peek_windows (select_record *me, bool)
-{
- MSG m;
- HANDLE h;
- set_handle_or_return_if_not_open (h, me);
-
- if (me->read_selected && me->read_ready)
- return 1;
-
- if (PeekMessage (&m, (HWND) h, 0, 0, PM_NOREMOVE))
- {
- me->read_ready = true;
- select_printf ("window %d(%p) ready", me->fd, me->fh->get_handle ());
- return 1;
- }
-
- select_printf ("window %d(%p) not ready", me->fd, me->fh->get_handle ());
- return me->write_ready;
-}
-
-static int
-verify_windows (select_record *me, fd_set *rfds, fd_set *wfds,
- fd_set *efds)
-{
- return peek_windows (me, true);
-}
-
-select_record *
-fhandler_windows::select_read (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- }
- s->verify = verify_windows;
- s->peek = peek_windows;
- s->read_selected = true;
- s->read_ready = false;
- s->h = get_handle ();
- s->windows_handle = true;
- return s;
-}
-
-select_record *
-fhandler_windows::select_write (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = verify_ok;
- }
- s->peek = peek_windows;
- s->h = get_handle ();
- s->write_selected = true;
- s->write_ready = true;
- s->windows_handle = true;
- return s;
-}
-
-select_record *
-fhandler_windows::select_except (select_record *s)
-{
- if (!s)
- {
- s = new select_record;
- s->startup = no_startup;
- s->verify = verify_ok;
- }
- s->peek = peek_windows;
- s->h = get_handle ();
- s->except_selected = true;
- s->except_ready = false;
- s->windows_handle = true;
- return s;
-}
-
-static int
-peek_mailslot (select_record *me, bool)
-{
- HANDLE h;
- set_handle_or_return_if_not_open (h, me);
-
- if (me->read_selected && me->read_ready)
- return 1;
- DWORD msgcnt = 0;
- if (!GetMailslotInfo (h, NULL, NULL, &msgcnt, NULL))
- {
- select_printf ("mailslot %d(%p) error %E", me->fd, h);
- return 1;
- }
- if (msgcnt > 0)
- {
- me->read_ready = true;
- select_printf ("mailslot %d(%p) ready", me->fd, h);
- return 1;
- }
- select_printf ("mailslot %d(%p) not ready", me->fd, h);
- return 0;
-}
-
-static int
-verify_mailslot (select_record *me, fd_set *rfds, fd_set *wfds,
- fd_set *efds)
-{
- return peek_mailslot (me, true);
-}
-
-static int start_thread_mailslot (select_record *me, select_stuff *stuff);
-
-struct mailslotinf
- {
- cygthread *thread;
- bool stop_thread_mailslot;
- select_record *start;
- };
-
-static DWORD WINAPI
-thread_mailslot (void *arg)
-{
- mailslotinf *mi = (mailslotinf *) arg;
- bool gotone = false;
- DWORD sleep_time = 0;
-
- for (;;)
- {
- select_record *s = mi->start;
- while ((s = s->next))
- if (s->startup == start_thread_mailslot)
- {
- if (peek_mailslot (s, true))
- gotone = true;
- if (mi->stop_thread_mailslot)
- {
- select_printf ("stopping");
- goto out;
- }
- }
- /* Paranoid check */
- if (mi->stop_thread_mailslot)
- {
- select_printf ("stopping from outer loop");
- break;
- }
- if (gotone)
- break;
- Sleep (sleep_time >> 3);
- if (sleep_time < 80)
- ++sleep_time;
- }
-out:
- return 0;
-}
-
-static int
-start_thread_mailslot (select_record *me, select_stuff *stuff)
-{
- if (stuff->device_specific_mailslot)
- {
- me->h = *((mailslotinf *) stuff->device_specific_mailslot)->thread;
- return 1;
- }
- mailslotinf *mi = new mailslotinf;
- mi->start = &stuff->start;
- mi->stop_thread_mailslot = false;
- mi->thread = new cygthread (thread_mailslot, 0, mi, "select_mailslot");
- me->h = *mi->thread;
- if (!me->h)
- return 0;
- stuff->device_specific_mailslot = (void *) mi;
- return 1;
-}
-
-static void
-mailslot_cleanup (select_record *, select_stuff *stuff)
-{
- mailslotinf *mi = (mailslotinf *) stuff->device_specific_mailslot;
- if (mi && mi->thread)
- {
- mi->stop_thread_mailslot = true;
- mi->thread->detach ();
- delete mi;
- stuff->device_specific_mailslot = NULL;
- }
-}
-
-select_record *
-fhandler_mailslot::select_read (select_record *s)
-{
- if (!s)
- s = new select_record;
- s->startup = start_thread_mailslot;
- s->peek = peek_mailslot;
- s->verify = verify_mailslot;
- s->cleanup = mailslot_cleanup;
- s->read_selected = true;
- s->read_ready = false;
- return s;
-}
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
deleted file mode 100644
index 5989dbd1a00..00000000000
--- a/winsup/cygwin/shared.cc
+++ /dev/null
@@ -1,431 +0,0 @@
-/* shared.cc: shared data area support.
-
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "winsup.h"
-#include "miscfuncs.h"
-#include <unistd.h>
-#include "cygerrno.h"
-#include "pinfo.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "cygheap.h"
-#include "heap.h"
-#include "shared_info_magic.h"
-#include "registry.h"
-#include "cygwin_version.h"
-#include "pwdgrp.h"
-#include "ntdll.h"
-#include <alloca.h>
-#include <wchar.h>
-
-shared_info NO_COPY *cygwin_shared;
-user_info NO_COPY *user_shared;
-HANDLE NO_COPY cygwin_shared_h;
-HANDLE NO_COPY cygwin_user_h;
-
-/* This function returns a handle to the top-level directory in the global
- NT namespace used to implement global objects including shared memory. */
-extern bool _cygwin_testing;
-
-HANDLE
-get_shared_parent_dir ()
-{
- static HANDLE dir;
- UNICODE_STRING uname;
- OBJECT_ATTRIBUTES attr;
- NTSTATUS status;
-
- if (!dir)
- {
- WCHAR bnoname[MAX_PATH];
- __small_swprintf (bnoname, L"\\BaseNamedObjects\\%s%s",
- cygwin_version.shared_id,
- _cygwin_testing ? cygwin_version.dll_build_date : "");
- RtlInitUnicodeString (&uname, bnoname);
- InitializeObjectAttributes (&attr, &uname, OBJ_INHERIT | OBJ_OPENIF,
- NULL, everyone_sd (CYG_SHARED_DIR_ACCESS));
- status = NtCreateDirectoryObject (&dir, CYG_SHARED_DIR_ACCESS, &attr);
- if (!NT_SUCCESS (status))
- api_fatal ("NtCreateDirectoryObject(%S): %p", &uname, status);
- }
- return dir;
-}
-
-HANDLE
-get_session_parent_dir ()
-{
- static HANDLE dir;
- UNICODE_STRING uname;
- OBJECT_ATTRIBUTES attr;
- NTSTATUS status;
-
- if (!dir)
- {
- PROCESS_SESSION_INFORMATION psi;
- status = NtQueryInformationProcess (GetCurrentProcess (),
- ProcessSessionInformation,
- &psi, sizeof psi, NULL);
- if (!NT_SUCCESS (status) || psi.SessionId == 0)
- dir = get_shared_parent_dir ();
- else
- {
- WCHAR bnoname[MAX_PATH];
- __small_swprintf (bnoname,
- L"\\Sessions\\BNOLINKS\\%d\\%s%s",
- psi.SessionId, cygwin_version.shared_id,
- _cygwin_testing ? cygwin_version.dll_build_date : "");
- RtlInitUnicodeString (&uname, bnoname);
- InitializeObjectAttributes (&attr, &uname, OBJ_INHERIT | OBJ_OPENIF,
- NULL, everyone_sd(CYG_SHARED_DIR_ACCESS));
- status = NtCreateDirectoryObject (&dir, CYG_SHARED_DIR_ACCESS, &attr);
- if (!NT_SUCCESS (status))
- api_fatal ("NtCreateDirectoryObject(%S): %p", &uname, status);
- }
- }
- return dir;
-}
-
-char * __stdcall
-shared_name (char *ret_buf, const char *str, int num)
-{
- __small_sprintf (ret_buf, "%s.%d", str, num);
- return ret_buf;
-}
-
-#define page_const (65535)
-#define pround(n) (((size_t) (n) + page_const) & ~page_const)
-
-static ptrdiff_t offsets[] =
-{
- - pround (sizeof (shared_info))
- - pround (sizeof (user_info))
- - pround (sizeof (console_state))
- - pround (sizeof (_pinfo)),
- - pround (sizeof (user_info))
- - pround (sizeof (console_state))
- - pround (sizeof (_pinfo)),
- - pround (sizeof (console_state))
- - pround (sizeof (_pinfo)),
- - pround (sizeof (_pinfo)),
- 0
-};
-
-#define off_addr(x) ((void *)((caddr_t) cygwin_hmodule + offsets[x]))
-
-void * __stdcall
-open_shared (const char *name, int n, HANDLE& shared_h, DWORD size,
- shared_locations& m, PSECURITY_ATTRIBUTES psa, DWORD access)
-{
- void *shared;
-
- void *addr;
- if (m == SH_JUSTCREATE || m == SH_JUSTOPEN)
- addr = NULL;
- else
- {
- addr = off_addr (m);
- VirtualFree (addr, 0, MEM_RELEASE);
- }
-
- char map_buf[MAX_PATH];
- char *mapname = NULL;
-
- if (shared_h)
- m = SH_JUSTOPEN;
- else
- {
- if (name)
- mapname = shared_name (map_buf, name, n);
- if (m == SH_JUSTOPEN)
- shared_h = OpenFileMapping (access, FALSE, mapname);
- else
- {
- shared_h = CreateFileMapping (INVALID_HANDLE_VALUE, psa,
- PAGE_READWRITE, 0, size, mapname);
- if (GetLastError () == ERROR_ALREADY_EXISTS)
- m = SH_JUSTOPEN;
- }
- if (shared_h)
- /* ok! */;
- else if (m != SH_JUSTOPEN)
- api_fatal ("CreateFileMapping %s, %E. Terminating.", mapname);
- else
- return NULL;
- }
-
- shared = (shared_info *)
- MapViewOfFileEx (shared_h, access, 0, 0, 0, addr);
-
- if (!shared && addr)
- {
- shared = (shared_info *) MapViewOfFileEx (shared_h,
- FILE_MAP_READ|FILE_MAP_WRITE,
- 0, 0, 0, NULL);
-#ifdef DEBUGGING
- system_printf ("relocating shared object %s(%d) from %p to %p", name, n, addr, shared);
-#endif
- offsets[0] = 0;
- }
-
- if (!shared)
- api_fatal ("MapViewOfFileEx '%s'(%p), %E. Terminating.", mapname, shared_h);
-
- if (m == SH_CYGWIN_SHARED && offsets[0])
- {
- ptrdiff_t delta = (caddr_t) shared - (caddr_t) off_addr (0);
- offsets[0] = (caddr_t) shared - (caddr_t) cygwin_hmodule;
- for (int i = SH_USER_SHARED + 1; i < SH_TOTAL_SIZE; i++)
- {
- unsigned size = offsets[i + 1] - offsets[i];
- offsets[i] += delta;
- if (!VirtualAlloc (off_addr (i), size, MEM_RESERVE, PAGE_NOACCESS))
- continue; /* oh well */
- }
- offsets[SH_TOTAL_SIZE] += delta;
- }
-
- debug_printf ("name %s, n %d, shared %p (wanted %p), h %p", mapname, n, shared, addr, shared_h);
-
- return shared;
-}
-
-/* Second half of user shared initialization: Initialize content. */
-void
-user_shared_initialize ()
-{
- DWORD sversion = (DWORD) InterlockedExchange ((LONG *) &user_shared->version, USER_VERSION_MAGIC);
- /* Wait for initialization of the Cygwin per-user shared, if necessary */
- if (!sversion)
- {
- cygpsid sid (cygheap->user.sid ());
- struct passwd *pw = internal_getpwsid (sid);
- /* Correct the user name with what's defined in /etc/passwd before
- loading the user fstab file. */
- if (pw)
- cygheap->user.set_name (pw->pw_name);
- user_shared->mountinfo.init (); /* Initialize the mount table. */
- user_shared->cb = sizeof (*user_shared);
- }
- else
- {
- while (!user_shared->cb)
- low_priority_sleep (0); // Should be hit only very very rarely
- if (user_shared->version != sversion)
- multiple_cygwin_problem ("user shared memory version", user_shared->version, sversion);
- else if (user_shared->cb != sizeof (*user_shared))
- multiple_cygwin_problem ("user shared memory size", user_shared->cb, sizeof (*user_shared));
- }
-}
-
-/* First half of user shared initialization: Create shared mem region. */
-void
-user_shared_create (bool reinit)
-{
- char name[UNLEN + 1] = ""; /* Large enough for SID */
-
- if (reinit)
- {
- if (!UnmapViewOfFile (user_shared))
- debug_printf("UnmapViewOfFile %E");
- if (!ForceCloseHandle (cygwin_user_h))
- debug_printf("CloseHandle %E");
- cygwin_user_h = NULL;
- }
-
- if (!cygwin_user_h)
- cygheap->user.get_windows_id (name);
-
- shared_locations sh_user_shared = SH_USER_SHARED;
- user_shared = (user_info *) open_shared (name, USER_VERSION,
- cygwin_user_h, sizeof (user_info),
- sh_user_shared, &sec_none);
- debug_printf ("opening user shared for '%s' at %p", name, user_shared);
- ProtectHandleINH (cygwin_user_h);
- debug_printf ("user shared version %x", user_shared->version);
- if (reinit)
- user_shared_initialize ();
-}
-
-void __stdcall
-shared_destroy ()
-{
- ForceCloseHandle (cygwin_shared_h);
- UnmapViewOfFile (cygwin_shared);
- ForceCloseHandle (cygwin_user_h);
- UnmapViewOfFile (user_shared);
-}
-
-/* Use absolute path of cygwin1.dll to derive the Win32 dir which
- is our installation root. Note that we can't handle Cygwin installation
- root dirs of more than 4K path length. I assume that's ok... */
-void
-shared_info::init_installation_root ()
-{
- if (!GetModuleFileNameW (cygwin_hmodule, installation_root, PATH_MAX))
- api_fatal ("Can't initialize Cygwin installation root dir.\n"
- "GetModuleFileNameW(%p, %p, %u), %E",
- cygwin_hmodule, installation_root, PATH_MAX);
- PWCHAR p = installation_root;
- if (wcsncmp (p, L"\\\\?\\", 4)) /* No long path prefix. */
- {
- if (!wcsncasecmp (p, L"\\\\", 2)) /* UNC */
- {
- p = wcpcpy (p, L"\\??\\UN");
- GetModuleFileNameW (cygwin_hmodule, p, PATH_MAX - 6);
- *p = L'C';
- }
- else
- {
- p = wcpcpy (p, L"\\??\\");
- GetModuleFileNameW (cygwin_hmodule, p, PATH_MAX - 4);
- }
- }
- installation_root[1] = L'?';
-
- PWCHAR w = wcsrchr (installation_root, L'\\');
- if (w)
- {
- *w = L'\0';
- w = wcsrchr (installation_root, L'\\');
- }
- if (!w)
- api_fatal ("Can't initialize Cygwin installation root dir.\n"
- "Invalid DLL path");
-
- *w = L'\0';
-}
-
-/* Initialize obcaseinsensitive. Default to case insensitive on pre-XP. */
-void
-shared_info::init_obcaseinsensitive ()
-{
- HKEY key;
- DWORD size = sizeof (DWORD);
-
- obcaseinsensitive = 1;
- if (RegOpenKeyEx (HKEY_LOCAL_MACHINE,
- "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\kernel",
- 0, KEY_READ, &key) == ERROR_SUCCESS)
- {
- RegQueryValueEx (key, "obcaseinsensitive", NULL, NULL,
- (LPBYTE) &obcaseinsensitive, &size);
- RegCloseKey (key);
- }
- debug_printf ("obcaseinsensitive set to %d", obcaseinsensitive);
-}
-
-void
-shared_info::initialize ()
-{
- DWORD sversion = (DWORD) InterlockedExchange ((LONG *) &version, SHARED_VERSION_MAGIC);
- if (sversion)
- {
- if (sversion != SHARED_VERSION_MAGIC)
- {
- InterlockedExchange ((LONG *) &version, sversion);
- multiple_cygwin_problem ("system shared memory version", sversion, SHARED_VERSION_MAGIC);
- }
- while (!cb)
- low_priority_sleep (0); // Should be hit only very very rarely
- }
-
- heap_init ();
- get_session_parent_dir (); /* Create session dir if first process. */
-
- if (!sversion)
- {
- init_installation_root ();/* Initialize installation root dir. */
- init_obcaseinsensitive ();/* Initialize obcaseinsensitive. */
- tty.init (); /* Initialize tty table. */
- mt.initialize (); /* Initialize shared tape information. */
- cb = sizeof (*this); /* Do last, after all shared memory initialization */
- }
-
- if (cb != SHARED_INFO_CB)
- system_printf ("size of shared memory region changed from %u to %u",
- SHARED_INFO_CB, cb);
-}
-
-void __stdcall
-memory_init ()
-{
- getpagesize ();
-
- /* Initialize the Cygwin heap, if necessary */
- if (!cygheap)
- {
- cygheap_init ();
- cygheap->user.init ();
- }
-
- /* Initialize general shared memory */
- shared_locations sh_cygwin_shared;
- cygwin_shared = (shared_info *) open_shared ("shared",
- CYGWIN_VERSION_SHARED_DATA,
- cygwin_shared_h,
- sizeof (*cygwin_shared),
- sh_cygwin_shared = SH_CYGWIN_SHARED);
- cygwin_shared->initialize ();
- user_shared_create (false);
-}
-
-unsigned
-shared_info::heap_slop_size ()
-{
- if (!heap_slop_inited)
- {
- /* Fetch from registry, first user then local machine. */
- for (int i = 0; i < 2; i++)
- {
- reg_key reg (i, KEY_READ, NULL);
-
- if ((heap_slop = reg.get_int ("heap_slop_in_mb", 0)))
- break;
- heap_slop = wincap.heapslop ();
- }
- heap_slop <<= 20;
- heap_slop_inited = true;
- }
-
- return heap_slop;
-}
-
-unsigned
-shared_info::heap_chunk_size ()
-{
- if (!heap_chunk)
- {
- /* Fetch from registry, first user then local machine. */
- for (int i = 0; i < 2; i++)
- {
- reg_key reg (i, KEY_READ, NULL);
-
- /* Note that reserving a huge amount of heap space does not result in
- the use of swap since we are not committing it. */
- /* FIXME: We should not be restricted to a fixed size heap no matter
- what the fixed size is. */
-
- if ((heap_chunk = reg.get_int ("heap_chunk_in_mb", 0)))
- break;
- heap_chunk = 384; /* Default */
- }
-
- if (heap_chunk < 4)
- heap_chunk = 4 * 1024 * 1024;
- else
- heap_chunk <<= 20;
- if (!heap_chunk)
- heap_chunk = 384 * 1024 * 1024;
- }
-
- return heap_chunk;
-}
diff --git a/winsup/cygwin/shared_info.h b/winsup/cygwin/shared_info.h
deleted file mode 100644
index 91aca2a5237..00000000000
--- a/winsup/cygwin/shared_info.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/* shared_info.h: shared info for cygwin
-
- Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "tty.h"
-#include "security.h"
-#include "mtinfo.h"
-#include "limits.h"
-
-/* Mount table entry */
-
-class mount_item
-{
- public:
- /* FIXME: Nasty static allocation. Need to have a heap in the shared
- area [with the user being able to configure at runtime the max size]. */
- /* Win32-style mounted partition source ("C:\foo\bar").
- native_path[0] == 0 for unused entries. */
- char native_path[CYG_MAX_PATH];
- int native_pathlen;
-
- /* POSIX-style mount point ("/foo/bar") */
- char posix_path[CYG_MAX_PATH];
- int posix_pathlen;
-
- unsigned flags;
-
- void init (const char *dev, const char *path, unsigned flags);
-
- struct mntent *getmntent ();
- int build_win32 (char *, const char *, unsigned *, unsigned);
-};
-
-/* Warning: Decreasing this value will cause cygwin.dll to ignore existing
- higher numbered registry entries. Don't change this number willy-nilly.
- What we need is to have a more dynamic allocation scheme, but the current
- scheme should be satisfactory for a long while yet. */
-#define MAX_MOUNTS 30
-
-#define USER_VERSION 1 // increment when mount table changes and
-#define USER_VERSION_MAGIC CYGWIN_VERSION_MAGIC (USER_MAGIC, USER_VERSION)
-#define CURR_USER_MAGIC 0xb2232e71U
-
-class reg_key;
-struct device;
-
-/* NOTE: Do not make gratuitous changes to the names or organization of the
- below class. The layout is checksummed to determine compatibility between
- different cygwin versions. */
-class mount_info
-{
- public:
- DWORD sys_mount_table_counter;
- int nmounts;
- mount_item mount[MAX_MOUNTS];
-
- /* cygdrive_prefix is used as the root of the path automatically
- prepended to a path when the path has no associated mount.
- cygdrive_flags are the default flags for the cygdrives. */
- char cygdrive[CYG_MAX_PATH];
- size_t cygdrive_len;
- unsigned cygdrive_flags;
- private:
- int posix_sorted[MAX_MOUNTS];
- int native_sorted[MAX_MOUNTS];
-
- public:
- void init ();
- int add_item (const char *dev, const char *path, unsigned flags);
- int del_item (const char *path, unsigned flags);
-
- unsigned set_flags_from_win32_path (const char *path);
- int conv_to_win32_path (const char *src_path, char *dst, device&,
- unsigned *flags = NULL);
- int conv_to_posix_path (PWCHAR src_path, char *posix_path,
- int keep_rel_p);
- int conv_to_posix_path (const char *src_path, char *posix_path,
- int keep_rel_p);
- struct mntent *getmntent (int x);
-
- int write_cygdrive_info (const char *cygdrive_prefix, unsigned flags);
- int get_cygdrive_info (char *user, char *system, char* user_flags,
- char* system_flags);
- void cygdrive_posix_path (const char *src, char *dst, int trailing_slash_p);
- int get_mounts_here (const char *parent_dir, int,
- PUNICODE_STRING mount_points,
- PUNICODE_STRING cygd);
-
- private:
- void sort ();
- void mount_slash ();
- void mount_info::create_root_entry (const PWCHAR root);
-
- bool from_fstab_line (char *line, bool user);
- bool from_fstab (bool user, WCHAR [], PWCHAR);
-
- int cygdrive_win32_path (const char *src, char *dst, int& unit);
-};
-
-class user_info
-{
-public:
- DWORD version;
- DWORD cb;
- bool warned_msdos;
- mount_info mountinfo;
-};
-/******** Shared Info ********/
-/* Data accessible to all tasks */
-
-#define SHARED_VERSION (unsigned)(cygwin_version.api_major << 8 | \
- cygwin_version.api_minor)
-#define SHARED_VERSION_MAGIC CYGWIN_VERSION_MAGIC (SHARED_MAGIC, SHARED_VERSION)
-
-#define SHARED_INFO_CB 39328
-
-#define CURR_SHARED_MAGIC 0x398d8baU
-
-/* NOTE: Do not make gratuitous changes to the names or organization of the
- below class. The layout is checksummed to determine compatibility between
- different cygwin versions. */
-class shared_info
-{
- DWORD version;
- DWORD cb;
- public:
- unsigned heap_chunk;
- bool heap_slop_inited;
- unsigned heap_slop;
- DWORD sys_mount_table_counter;
- tty_list tty;
- LONG last_used_bindresvport;
- WCHAR installation_root[PATH_MAX];
- DWORD obcaseinsensitive;
- mtinfo mt;
-
- void initialize ();
- void init_installation_root ();
- void init_obcaseinsensitive ();
- unsigned heap_chunk_size ();
- unsigned heap_slop_size ();
-};
-
-extern shared_info *cygwin_shared;
-extern user_info *user_shared;
-#define mount_table (&(user_shared->mountinfo))
-extern HANDLE cygwin_user_h;
-
-enum shared_locations
-{
- SH_CYGWIN_SHARED,
- SH_USER_SHARED,
- SH_SHARED_CONSOLE,
- SH_MYSELF,
- SH_TOTAL_SIZE,
- SH_JUSTCREATE,
- SH_JUSTOPEN
-
-};
-
-void __stdcall memory_init ();
-void __stdcall shared_destroy ();
-
-#define shared_align_past(p) \
- ((char *) (system_info.dwAllocationGranularity * \
- (((DWORD) ((p) + 1) + system_info.dwAllocationGranularity - 1) / \
- system_info.dwAllocationGranularity)))
-
-#ifdef _FHANDLER_H_
-struct console_state
-{
- tty_min tty_min_state;
- dev_console dev_state;
-};
-#endif
-
-HANDLE get_shared_parent_dir ();
-HANDLE get_session_parent_dir ();
-char *__stdcall shared_name (char *, const char *, int);
-void *__stdcall open_shared (const char *name, int n, HANDLE &shared_h, DWORD size,
- shared_locations&, PSECURITY_ATTRIBUTES psa = &sec_all,
- DWORD access = FILE_MAP_READ | FILE_MAP_WRITE);
-extern void user_shared_create (bool reinit);
-extern void user_shared_initialize ();
-
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
deleted file mode 100644
index f98ab6be98c..00000000000
--- a/winsup/cygwin/spawn.cc
+++ /dev/null
@@ -1,1101 +0,0 @@
-/* spawn.cc
-
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#include "winsup.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <process.h>
-#include <sys/wait.h>
-#include <wingdi.h>
-#include <winuser.h>
-#include <wchar.h>
-#include <ctype.h>
-#include "cygerrno.h"
-#include <sys/cygwin.h>
-#include "security.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "sigproc.h"
-#include "cygheap.h"
-#include "child_info.h"
-#include "pinfo.h"
-#include "environ.h"
-#include "cygtls.h"
-#include "tls_pbuf.h"
-#include "winf.h"
-#include "ntdll.h"
-
-static suffix_info exe_suffixes[] =
-{
- suffix_info ("", 1),
- suffix_info (".exe", 1),
- suffix_info (".com"),
- suffix_info (NULL)
-};
-
-static suffix_info dll_suffixes[] =
-{
- suffix_info (".dll"),
- suffix_info ("", 1),
- suffix_info (".exe", 1),
- suffix_info (NULL)
-};
-
-HANDLE hExeced;
-child_info_spawn *chExeced;
-
-/* Add .exe to PROG if not already present and see if that exists.
- If not, return PROG (converted from posix to win32 rules if necessary).
- The result is always BUF.
-
- Returns (possibly NULL) suffix */
-
-static const char *
-perhaps_suffix (const char *prog, path_conv& buf, int& err, unsigned opt)
-{
- char *ext;
-
- err = 0;
- debug_printf ("prog '%s'", prog);
- buf.check (prog, PC_SYM_FOLLOW | PC_NULLEMPTY,
- (opt & FE_DLL) ? dll_suffixes : exe_suffixes);
-
- if (buf.isdir ())
- {
- err = EACCES;
- ext = NULL;
- }
- else if (!buf.exists ())
- {
- err = ENOENT;
- ext = NULL;
- }
- else if (buf.known_suffix)
- ext = buf.get_win32 () + (buf.known_suffix - buf.get_win32 ());
- else
- ext = strchr (buf.get_win32 (), '\0');
-
- debug_printf ("buf %s, suffix found '%s'", (char *) buf.get_win32 (), ext);
- return ext;
-}
-
-/* Find an executable name, possibly by appending known executable
- suffixes to it. The win32-translated name is placed in 'buf'.
- Any found suffix is returned in known_suffix.
-
- If the file is not found and !null_if_not_found then the win32 version
- of name is placed in buf and returned. Otherwise the contents of buf
- is undefined and NULL is returned. */
-
-const char * __stdcall
-find_exec (const char *name, path_conv& buf, const char *mywinenv,
- unsigned opt, const char **known_suffix)
-{
- const char *suffix = "";
- debug_printf ("find_exec (%s)", name);
- const char *retval = buf.get_win32 ();
- tmp_pathbuf tp;
- char *tmp = tp.c_get ();
- const char *posix = (opt & FE_NATIVE) ? NULL : name;
- bool has_slash = strchr (name, '/');
- int err;
-
- /* Check to see if file can be opened as is first.
- Win32 systems always check . first, but PATH may not be set up to
- do this. */
- if ((has_slash || opt & FE_CWD)
- && (suffix = perhaps_suffix (name, buf, err, opt)) != NULL)
- {
- if (posix && !has_slash)
- {
- tmp[0] = '.';
- tmp[1] = '/';
- strcpy (tmp + 2, name);
- posix = tmp;
- }
- goto out;
- }
-
- win_env *winpath;
- const char *path;
- const char *posix_path;
-
- posix = (opt & FE_NATIVE) ? NULL : tmp;
-
- if (strchr (mywinenv, '/'))
- {
- /* it's not really an environment variable at all */
- int n = cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, mywinenv, NULL, 0);
- char *s = (char *) alloca (n);
- if (cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, mywinenv, s, n))
- goto errout;
- path = s;
- posix_path = mywinenv - 1;
- }
- else if (has_slash || strchr (name, '\\') || isdrive (name)
- || !(winpath = getwinenv (mywinenv))
- || !(path = winpath->get_native ()) || *path == '\0')
- /* Return the error condition if this is an absolute path or if there
- is no PATH to search. */
- goto errout;
- else
- posix_path = winpath->get_posix () - 1;
-
- debug_printf ("%s%s", mywinenv, path);
- /* Iterate over the specified path, looking for the file with and without
- executable extensions. */
- do
- {
- posix_path++;
- char *eotmp = strccpy (tmp, &path, ';');
- /* An empty path or '.' means the current directory, but we've
- already tried that. */
- if (opt & FE_CWD && (tmp[0] == '\0' || (tmp[0] == '.' && tmp[1] == '\0')))
- continue;
-
- *eotmp++ = '\\';
- strcpy (eotmp, name);
-
- debug_printf ("trying %s", tmp);
-
- if ((suffix = perhaps_suffix (tmp, buf, err, opt)) != NULL)
- {
- if (buf.has_acls () && check_file_access (buf, X_OK))
- continue;
-
- if (posix == tmp)
- {
- eotmp = strccpy (tmp, &posix_path, ':');
- if (eotmp == tmp)
- *eotmp++ = '.';
- *eotmp++ = '/';
- strcpy (eotmp, name);
- }
- goto out;
- }
- }
- while (*path && *++path && (posix_path = strchr (posix_path, ':')));
-
- errout:
- posix = NULL;
- /* Couldn't find anything in the given path.
- Take the appropriate action based on null_if_not_found. */
- if (opt & FE_NNF)
- retval = NULL;
- else if (opt & FE_NATIVE)
- buf.check (name);
- else
- retval = name;
-
- out:
- if (posix)
- buf.set_path (posix);
- debug_printf ("%s = find_exec (%s)", (char *) buf.get_win32 (), name);
- if (known_suffix)
- *known_suffix = suffix ?: strchr (buf.get_win32 (), '\0');
- if (!retval && err)
- set_errno (err);
- return retval;
-}
-
-/* Utility for spawn_guts. */
-
-static HANDLE
-handle (int fd, bool writing)
-{
- HANDLE h;
- cygheap_fdget cfd (fd);
-
- if (cfd < 0)
- h = INVALID_HANDLE_VALUE;
- else if (cfd->close_on_exec ())
- h = INVALID_HANDLE_VALUE;
- else if (!writing)
- h = cfd->get_handle ();
- else
- h = cfd->get_output_handle ();
-
- return h;
-}
-
-int
-iscmd (const char *argv0, const char *what)
-{
- int n;
- n = strlen (argv0) - strlen (what);
- if (n >= 2 && argv0[1] != ':')
- return 0;
- return n >= 0 && strcasematch (argv0 + n, what) &&
- (n == 0 || isdirsep (argv0[n - 1]));
-}
-
-struct pthread_cleanup
-{
- _sig_func_ptr oldint;
- _sig_func_ptr oldquit;
- sigset_t oldmask;
- pthread_cleanup (): oldint (NULL), oldquit (NULL), oldmask ((sigset_t) -1) {}
-};
-
-static void
-do_cleanup (void *args)
-{
-# define cleanup ((pthread_cleanup *) args)
- if (cleanup->oldmask != (sigset_t) -1)
- {
- signal (SIGINT, cleanup->oldint);
- signal (SIGQUIT, cleanup->oldquit);
- sigprocmask (SIG_SETMASK, &(cleanup->oldmask), NULL);
- }
-# undef cleanup
-}
-
-
-int __stdcall
-spawn_guts (const char *prog_arg, const char *const *argv,
- const char *const envp[], int mode, int __stdin, int __stdout)
-{
- bool rc;
- pid_t cygpid;
- int res = -1;
-
- if (prog_arg == NULL)
- {
- syscall_printf ("prog_arg is NULL");
- set_errno (EINVAL);
- return -1;
- }
-
- syscall_printf ("spawn_guts (%d, %.9500s)", mode, prog_arg);
-
- if (argv == NULL)
- {
- syscall_printf ("argv is NULL");
- set_errno (EINVAL);
- return -1;
- }
-
- /* FIXME: There is a small race here and FIXME: not thread safe! */
-
- pthread_cleanup cleanup;
- if (mode == _P_SYSTEM)
- {
- sigset_t child_block;
- cleanup.oldint = signal (SIGINT, SIG_IGN);
- cleanup.oldquit = signal (SIGQUIT, SIG_IGN);
- sigemptyset (&child_block);
- sigaddset (&child_block, SIGCHLD);
- sigprocmask (SIG_BLOCK, &child_block, &cleanup.oldmask);
- }
- pthread_cleanup_push (do_cleanup, (void *) &cleanup);
- av newargv;
- linebuf one_line;
- child_info_spawn ch;
- PWCHAR envblock = NULL;
- path_conv real_path;
- bool reset_sendsig = false;
-
- tmp_pathbuf tp;
- PWCHAR runpath = tp.w_get ();
- int c_flags;
- bool wascygexec;
- cygheap_exec_info *moreinfo;
-
- bool null_app_name = false;
- STARTUPINFOW si = {0, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL,
- NULL, NULL, NULL};
- int looped = 0;
- HANDLE orig_wr_proc_pipe = NULL;
-
- myfault efault;
- if (efault.faulted ())
- {
- if (get_errno () == ENOMEM)
- set_errno (E2BIG);
- else
- set_errno (EFAULT);
- res = -1;
- goto out;
- }
-
- child_info_types chtype;
- if (mode != _P_OVERLAY)
- chtype = PROC_SPAWN;
- else
- chtype = PROC_EXEC;
-
- moreinfo = (cygheap_exec_info *) ccalloc_abort (HEAP_1_EXEC, 1,
- sizeof (cygheap_exec_info));
- moreinfo->old_title = NULL;
-
- /* CreateProcess takes one long string that is the command line (sigh).
- We need to quote any argument that has whitespace or embedded "'s. */
-
- int ac;
- for (ac = 0; argv[ac]; ac++)
- /* nothing */;
-
- newargv.set (ac, argv);
-
- int err;
- const char *ext;
- if ((ext = perhaps_suffix (prog_arg, real_path, err, FE_NADA)) == NULL)
- {
- set_errno (err);
- res = -1;
- goto out;
- }
-
-
- wascygexec = real_path.iscygexec ();
- res = newargv.fixup (prog_arg, real_path, ext);
-
- if (!real_path.iscygexec ()
- && (cygheap->cwd.drive_length == 0
- || cygheap->cwd.win32.Length >= MAX_PATH * sizeof (WCHAR)))
- {
- small_printf ("Error: Current working directory is a %s.\n"
- "Can't start native Windows application from here.\n\n",
- cygheap->cwd.drive_length == 0
- ? "virtual Cygwin directory"
- : "path longer than allowed for a\n"
- "Win32 working directory");
- set_errno (ENAMETOOLONG);
- res = -1;
- goto out;
- }
-
- if (res)
- goto out;
-
- if (ac == 3 && argv[1][0] == '/' && argv[1][1] == 'c' &&
- (iscmd (argv[0], "command.com") || iscmd (argv[0], "cmd.exe")))
- {
- real_path.check (prog_arg);
- one_line.add ("\"");
- if (!real_path.error)
- one_line.add (real_path.get_win32 ());
- else
- one_line.add (argv[0]);
- one_line.add ("\"");
- one_line.add (" ");
- one_line.add (argv[1]);
- one_line.add (" ");
- one_line.add (argv[2]);
- strcpy (real_path.get_win32 (), argv[0]);
- null_app_name = true;
- }
- else
- {
- if (wascygexec)
- newargv.dup_all ();
- else if (!one_line.fromargv (newargv, real_path.get_win32 (),
- real_path.iscygexec ()))
- {
- res = -1;
- goto out;
- }
-
-
- newargv.all_calloced ();
- moreinfo->argc = newargv.argc;
- moreinfo->argv = newargv;
-
- if (mode != _P_OVERLAY ||
- !DuplicateHandle (hMainProc, myself.shared_handle (), hMainProc,
- &moreinfo->myself_pinfo, 0, TRUE,
- DUPLICATE_SAME_ACCESS))
- moreinfo->myself_pinfo = NULL;
- else
- VerifyHandle (moreinfo->myself_pinfo);
- }
- WCHAR wone_line[one_line.ix + 1];
- sys_mbstowcs (wone_line, one_line.ix + 1, one_line.buf);
-
- PROCESS_INFORMATION pi;
- pi.hProcess = pi.hThread = NULL;
- pi.dwProcessId = pi.dwThreadId = 0;
- si.lpReserved = NULL;
- si.lpDesktop = NULL;
-
- /* Set up needed handles for stdio */
- si.dwFlags = STARTF_USESTDHANDLES;
- si.hStdInput = handle ((__stdin < 0 ? 0 : __stdin), false);
- si.hStdOutput = handle ((__stdout < 0 ? 1 : __stdout), true);
- si.hStdError = handle (2, true);
-
- si.cb = sizeof (si);
-
- c_flags = GetPriorityClass (hMainProc);
- sigproc_printf ("priority class %d", c_flags);
- c_flags |= CREATE_SEPARATE_WOW_VDM | CREATE_UNICODE_ENVIRONMENT;
-
- if (mode == _P_DETACH)
- c_flags |= DETACHED_PROCESS;
- else
- fhandler_console::need_invisible ();
-
- if (mode != _P_OVERLAY)
- myself->exec_sendsig = NULL;
- else
- {
- /* Reset sendsig so that any process which wants to send a signal
- to this pid will wait for the new process to become active.
- Save the old value in case the exec fails. */
- if (!myself->exec_sendsig)
- {
- myself->exec_sendsig = myself->sendsig;
- myself->exec_dwProcessId = myself->dwProcessId;
- myself->sendsig = NULL;
- reset_sendsig = true;
- }
- /* Save a copy of a handle to the current process around the first time we
- exec so that the pid will not be reused. Why did I stop cygwin from
- generating its own pids again? */
- if (cygheap->pid_handle)
- /* already done previously */;
- else if (DuplicateHandle (hMainProc, hMainProc, hMainProc,
- &cygheap->pid_handle, PROCESS_QUERY_INFORMATION,
- TRUE, 0))
- ProtectHandleINH (cygheap->pid_handle);
- else
- system_printf ("duplicate to pid_handle failed, %E");
- }
-
- runpath = null_app_name ? NULL : real_path.get_wide_win32_path (runpath);
- { /* If the executable path length is < MAX_PATH, make sure the long path
- win32 prefix is removed from the path to make subsequent native Win32
- child processes happy which are not long path aware. */
- USHORT len = real_path.get_nt_native_path ()->Length;
- if (len < (MAX_PATH + 4) * sizeof (WCHAR)
- || (runpath[5] != L':' /* UNC path */
- && len < (MAX_PATH + 6) * sizeof (WCHAR)))
- {
- PWCHAR r = runpath + 4;
- if (r[1] != L':') /* UNC path */
- *(r += 2) = L'\\';
- if (!RtlIsDosDeviceName_U (r))
- runpath = r;
- else if (*r == L'\\')
- *r = L'C';
- }
- }
-
- syscall_printf ("null_app_name %d (%W, %.9500W)", null_app_name,
- runpath, wone_line);
-
- cygbench ("spawn-guts");
-
- if (!real_path.iscygexec())
- cygheap->fdtab.set_file_pointers_for_exec ();
-
- moreinfo->envp = build_env (envp, envblock, moreinfo->envc,
- real_path.iscygexec ());
- if (!moreinfo->envp || !envblock)
- {
- set_errno (E2BIG);
- res = -1;
- goto out;
- }
- ch.set (chtype, real_path.iscygexec ());
- ch.moreinfo = moreinfo;
- ch.__stdin = __stdin;
- ch.__stdout = __stdout;
-
- si.lpReserved2 = (LPBYTE) &ch;
- si.cbReserved2 = sizeof (ch);
-
- /* Depends on ch.set call above!
- Some file types might need extra effort in the parent after CreateProcess
- and before copying the datastructures to the child. So we have to start
- the child in suspend state, unfortunately, to avoid a race condition. */
- if (!newargv.win16_exe
- && (!ch.iscygwin () || mode != _P_OVERLAY))
- c_flags |= CREATE_SUSPENDED;
-
- /* When ruid != euid we create the new process under the current original
- account and impersonate in child, this way maintaining the different
- effective vs. real ids.
- FIXME: If ruid != euid and ruid != saved_uid we currently give
- up on ruid. The new process will have ruid == euid. */
-loop:
- cygheap->user.deimpersonate ();
-
- if (!cygheap->user.issetuid ()
- || (cygheap->user.saved_uid == cygheap->user.real_uid
- && cygheap->user.saved_gid == cygheap->user.real_gid
- && !cygheap->user.groups.issetgroups ()))
- {
- rc = CreateProcessW (runpath, /* image name - with full path */
- wone_line, /* what was passed to exec */
- &sec_none_nih, /* process security attrs */
- &sec_none_nih, /* thread security attrs */
- TRUE, /* inherit handles from parent */
- c_flags,
- envblock, /* environment */
- NULL,
- &si,
- &pi);
- }
- else
- {
- /* Give access to myself */
- if (mode == _P_OVERLAY)
- myself.set_acl();
-
- WCHAR wstname[1024] = { L'\0' };
- HWINSTA hwst_orig = NULL, hwst = NULL;
- HDESK hdsk_orig = NULL, hdsk = NULL;
- PSECURITY_ATTRIBUTES sa;
- DWORD n;
-
- hwst_orig = GetProcessWindowStation ();
- hdsk_orig = GetThreadDesktop (GetCurrentThreadId ());
- GetUserObjectInformationW (hwst_orig, UOI_NAME, wstname, 1024, &n);
- /* Prior to Vista it was possible to start a service with the
- "Interact with desktop" flag. This started the service in the
- interactive window station of the console. A big security
- risk, but we don't want to disable this behaviour for older
- OSes because it's still heavily used by some users. They have
- been warned. */
- if (wcscasecmp (wstname, L"WinSta0") != 0)
- {
- WCHAR sid[128];
-
- sa = sec_user ((PSECURITY_ATTRIBUTES) alloca (1024),
- cygheap->user.sid ());
- /* We're creating a window station per user, not per logon session.
- First of all we might not have a valid logon session for
- the user (logon by create_token), and second, it doesn't
- make sense in terms of security to create a new window
- station for every logon of the same user. It just fills up
- the system with window stations for no good reason. */
- hwst = CreateWindowStationW (cygheap->user.get_windows_id (sid), 0,
- GENERIC_READ | GENERIC_WRITE, sa);
- if (!hwst)
- system_printf ("CreateWindowStation failed, %E");
- else if (!SetProcessWindowStation (hwst))
- system_printf ("SetProcessWindowStation failed, %E");
- else if (!(hdsk = CreateDesktopW (L"Default", NULL, NULL, 0,
- GENERIC_ALL, sa)))
- system_printf ("CreateDesktop failed, %E");
- else
- {
- wcpcpy (wcpcpy (wstname, sid), L"\\Default");
- si.lpDesktop = wstname;
- debug_printf ("Desktop: %W", si.lpDesktop);
- }
- }
-
- rc = CreateProcessAsUserW (cygheap->user.primary_token (),
- runpath, /* image name - with full path */
- wone_line, /* what was passed to exec */
- &sec_none_nih, /* process security attrs */
- &sec_none_nih, /* thread security attrs */
- TRUE, /* inherit handles from parent */
- c_flags,
- envblock, /* environment */
- NULL,
- &si,
- &pi);
- if (hwst)
- {
- SetProcessWindowStation (hwst_orig);
- CloseWindowStation (hwst);
- }
- if (hdsk)
- {
- SetThreadDesktop (hdsk_orig);
- CloseDesktop (hdsk);
- }
- }
-
- /* Restore impersonation. In case of _P_OVERLAY this isn't
- allowed since it would overwrite child data. */
- if (mode != _P_OVERLAY || !rc)
- cygheap->user.reimpersonate ();
-
- /* Set errno now so that debugging messages from it appear before our
- final debugging message [this is a general rule for debugging
- messages]. */
- if (!rc)
- {
- __seterrno ();
- syscall_printf ("CreateProcess failed, %E");
- /* If this was a failed exec, restore the saved sendsig. */
- if (reset_sendsig)
- {
- myself->sendsig = myself->exec_sendsig;
- myself->exec_sendsig = NULL;
- }
- res = -1;
- goto out;
- }
-
- if (!(c_flags & CREATE_SUSPENDED))
- strace.write_childpid (ch, pi.dwProcessId);
-
- if (mode != _P_OVERLAY)
- cygpid = cygwin_pid (pi.dwProcessId);
- else
- cygpid = myself->pid;
-
- /* We print the original program name here so the user can see that too. */
- syscall_printf ("%d = spawn_guts (%s, %.9500s)",
- rc ? cygpid : (unsigned int) -1, prog_arg, one_line.buf);
-
- /* Name the handle similarly to proc_subproc. */
- ProtectHandle1 (pi.hProcess, childhProc);
-
- bool synced;
- pid_t pid;
- if (mode == _P_OVERLAY)
- {
- chExeced = &ch; /* FIXME: there's a race here if a user sneaks in CTRL-C */
- myself->dwProcessId = pi.dwProcessId;
- strace.execing = 1;
- myself.hProcess = hExeced = pi.hProcess;
- strcpy (myself->progname, real_path.get_win32 ()); // FIXME: race?
- sigproc_printf ("new process name %s", myself->progname);
- /* If wr_proc_pipe doesn't exist then this process was not started by a cygwin
- process. So, we need to wait around until the process we've just "execed"
- dies. Use our own wait facility to wait for our own pid to exit (there
- is some minor special case code in proc_waiter and friends to accommodate
- this).
-
- If wr_proc_pipe exists, then it should be duplicated to the child.
- If the child has exited already, that's ok. The parent will pick up
- on this fact when we exit. dup_proc_pipe will close our end of the pipe.
- Note that wr_proc_pipe may also be == INVALID_HANDLE_VALUE. That will make
- dup_proc_pipe essentially a no-op. */
- if (!newargv.win16_exe && myself->wr_proc_pipe)
- {
- if (!looped)
- myself->sync_proc_pipe (); /* Make sure that we own wr_proc_pipe
- just in case we've been previously
- execed. */
- orig_wr_proc_pipe = myself->dup_proc_pipe (pi.hProcess);
- }
- pid = myself->pid;
- if (!ch.iscygwin ())
- close_all_files ();
- }
- else
- {
- myself->set_has_pgid_children ();
- ProtectHandle (pi.hThread);
- pinfo child (cygpid, PID_IN_USE);
- if (!child)
- {
- syscall_printf ("pinfo failed");
- if (get_errno () != ENOMEM)
- set_errno (EAGAIN);
- res = -1;
- goto out;
- }
- child->dwProcessId = pi.dwProcessId;
- child.hProcess = pi.hProcess;
-
- strcpy (child->progname, real_path.get_win32 ());
- /* FIXME: This introduces an unreferenced, open handle into the child.
- The purpose is to keep the pid shared memory open so that all of
- the fields filled out by child.remember do not disappear and so there
- is not a brief period during which the pid is not available.
- However, we should try to find another way to do this eventually. */
- DuplicateHandle (hMainProc, child.shared_handle (), pi.hProcess,
- NULL, 0, 0, DUPLICATE_SAME_ACCESS);
- child->start_time = time (NULL); /* Register child's starting time. */
- child->nice = myself->nice;
- if (!child.remember (mode == _P_DETACH))
- {
- /* FIXME: Child in strange state now */
- CloseHandle (pi.hProcess);
- ForceCloseHandle (pi.hThread);
- res = -1;
- goto out;
- }
- pid = child->pid;
- }
-
- /* Start the child running */
- if (c_flags & CREATE_SUSPENDED)
- {
- ResumeThread (pi.hThread);
- strace.write_childpid (ch, pi.dwProcessId);
- }
- ForceCloseHandle (pi.hThread);
-
- sigproc_printf ("spawned windows pid %d", pi.dwProcessId);
-
- if ((mode == _P_DETACH || mode == _P_NOWAIT) && !ch.iscygwin ())
- synced = false;
- else
- synced = ch.sync (pi.dwProcessId, pi.hProcess, INFINITE);
-
- switch (mode)
- {
- case _P_OVERLAY:
- myself.hProcess = pi.hProcess;
- if (!synced)
- {
- if (orig_wr_proc_pipe)
- {
- myself->wr_proc_pipe_owner = GetCurrentProcessId ();
- myself->wr_proc_pipe = orig_wr_proc_pipe;
- }
- if (!ch.proc_retry (pi.hProcess))
- {
- looped++;
- goto loop;
- }
- close_all_files (true);
- }
- else
- {
- close_all_files (true);
- if (!myself->wr_proc_pipe
- && WaitForSingleObject (pi.hProcess, 0) == WAIT_TIMEOUT)
- {
- extern bool is_toplevel_proc;
- is_toplevel_proc = true;
- myself.remember (false);
- waitpid (myself->pid, &res, 0);
- }
- }
- myself.exit (EXITCODE_NOSET);
- break;
- case _P_WAIT:
- case _P_SYSTEM:
- if (waitpid (cygpid, &res, 0) != cygpid)
- res = -1;
- break;
- case _P_DETACH:
- res = 0; /* Lost all memory of this child. */
- break;
- case _P_NOWAIT:
- case _P_NOWAITO:
- case _P_VFORK:
- res = cygpid;
- break;
- default:
- break;
- }
-
-out:
- if (envblock)
- free (envblock);
- pthread_cleanup_pop (1);
- return (int) res;
-#undef ch
-}
-
-extern "C" int
-cwait (int *result, int pid, int)
-{
- return waitpid (pid, result, 0);
-}
-
-/*
-* Helper function for spawn runtime calls.
-* Doesn't search the path.
-*/
-
-extern "C" int
-spawnve (int mode, const char *path, const char *const *argv,
- const char *const *envp)
-{
- int ret;
-#ifdef NEWVFORK
- vfork_save *vf = vfork_storage.val ();
-
- if (vf != NULL && (vf->pid < 0) && mode == _P_OVERLAY)
- mode = _P_NOWAIT;
- else
- vf = NULL;
-#endif
-
- syscall_printf ("spawnve (%s, %s, %x)", path, argv[0], envp);
-
- switch (mode)
- {
- case _P_OVERLAY:
- /* We do not pass _P_SEARCH_PATH here. execve doesn't search PATH.*/
- /* Just act as an exec if _P_OVERLAY set. */
- spawn_guts (path, argv, envp, mode);
- /* Errno should be set by spawn_guts. */
- ret = -1;
- break;
- case _P_VFORK:
- case _P_NOWAIT:
- case _P_NOWAITO:
- case _P_WAIT:
- case _P_DETACH:
- case _P_SYSTEM:
- ret = spawn_guts (path, argv, envp, mode);
-#ifdef NEWVFORK
- if (vf)
- {
- if (ret > 0)
- {
- debug_printf ("longjmping due to vfork");
- vf->restore_pid (ret);
- }
- }
-#endif
- break;
- default:
- set_errno (EINVAL);
- ret = -1;
- break;
- }
- return ret;
-}
-
-/*
-* spawn functions as implemented in the MS runtime library.
-* Most of these based on (and copied from) newlib/libc/posix/execXX.c
-*/
-
-extern "C" int
-spawnl (int mode, const char *path, const char *arg0, ...)
-{
- int i;
- va_list args;
- const char *argv[256];
-
- va_start (args, arg0);
- argv[0] = arg0;
- i = 1;
-
- do
- argv[i] = va_arg (args, const char *);
- while (argv[i++] != NULL);
-
- va_end (args);
-
- return spawnve (mode, path, (char * const *) argv, cur_environ ());
-}
-
-extern "C" int
-spawnle (int mode, const char *path, const char *arg0, ...)
-{
- int i;
- va_list args;
- const char * const *envp;
- const char *argv[256];
-
- va_start (args, arg0);
- argv[0] = arg0;
- i = 1;
-
- do
- argv[i] = va_arg (args, const char *);
- while (argv[i++] != NULL);
-
- envp = va_arg (args, const char * const *);
- va_end (args);
-
- return spawnve (mode, path, (char * const *) argv, (char * const *) envp);
-}
-
-extern "C" int
-spawnlp (int mode, const char *path, const char *arg0, ...)
-{
- int i;
- va_list args;
- const char *argv[256];
-
- va_start (args, arg0);
- argv[0] = arg0;
- i = 1;
-
- do
- argv[i] = va_arg (args, const char *);
- while (argv[i++] != NULL);
-
- va_end (args);
-
- return spawnvpe (mode, path, (char * const *) argv, cur_environ ());
-}
-
-extern "C" int
-spawnlpe (int mode, const char *path, const char *arg0, ...)
-{
- int i;
- va_list args;
- const char * const *envp;
- const char *argv[256];
-
- va_start (args, arg0);
- argv[0] = arg0;
- i = 1;
-
- do
- argv[i] = va_arg (args, const char *);
- while (argv[i++] != NULL);
-
- envp = va_arg (args, const char * const *);
- va_end (args);
-
- return spawnvpe (mode, path, (char * const *) argv, envp);
-}
-
-extern "C" int
-spawnv (int mode, const char *path, const char * const *argv)
-{
- return spawnve (mode, path, argv, cur_environ ());
-}
-
-extern "C" int
-spawnvp (int mode, const char *path, const char * const *argv)
-{
- return spawnvpe (mode, path, argv, cur_environ ());
-}
-
-extern "C" int
-spawnvpe (int mode, const char *file, const char * const *argv,
- const char * const *envp)
-{
- path_conv buf;
- return spawnve (mode, find_exec (file, buf), argv, envp);
-}
-
-int
-av::fixup (const char *prog_arg, path_conv& real_path, const char *ext)
-{
- const char *p;
- bool exeext = ascii_strcasematch (ext, ".exe");
- if (exeext && real_path.iscygexec () || ascii_strcasematch (ext, ".bat"))
- return 0;
- if (!*ext && ((p = ext - 4) > real_path.get_win32 ())
- && (ascii_strcasematch (p, ".bat") || ascii_strcasematch (p, ".cmd")
- || ascii_strcasematch (p, ".btm")))
- return 0;
- while (1)
- {
- char *pgm = NULL;
- char *arg1 = NULL;
- char *ptr, *buf;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- HANDLE h;
- NTSTATUS status;
-
- status = NtOpenFile (&h, SYNCHRONIZE | GENERIC_READ,
- real_path.get_object_attr (attr, sec_none_nih),
- &io, FILE_SHARE_READ | FILE_SHARE_WRITE,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_FOR_BACKUP_INTENT
- | FILE_NON_DIRECTORY_FILE);
- if (!NT_SUCCESS (status))
- goto err;
-
- HANDLE hm = CreateFileMapping (h, &sec_none_nih, PAGE_READONLY, 0, 0, NULL);
- NtClose (h);
- if (!hm)
- {
- /* ERROR_FILE_INVALID indicates very likely an empty file. */
- if (GetLastError () == ERROR_FILE_INVALID)
- {
- debug_printf ("zero length file, treat as script.");
- goto just_shell;
- }
- goto err;
- }
- buf = (char *) MapViewOfFile(hm, FILE_MAP_READ, 0, 0, 0);
- CloseHandle (hm);
- if (!buf)
- goto err;
-
- {
- myfault efault;
- if (efault.faulted ())
- {
- UnmapViewOfFile (buf);
- real_path.set_cygexec (false);
- break;
- }
- if (buf[0] == 'M' && buf[1] == 'Z')
- {
- WORD subsys;
- unsigned off = (unsigned char) buf[0x18] | (((unsigned char) buf[0x19]) << 8);
- win16_exe = off < sizeof (IMAGE_DOS_HEADER);
- if (!win16_exe)
- real_path.set_cygexec (!!hook_or_detect_cygwin (buf, NULL, subsys));
- else
- real_path.set_cygexec (false);
- UnmapViewOfFile (buf);
- break;
- }
- }
-
- debug_printf ("%s is possibly a script", real_path.get_win32 ());
-
- ptr = buf;
- if (*ptr++ == '#' && *ptr++ == '!')
- {
- ptr += strspn (ptr, " \t");
- size_t len = strcspn (ptr, "\r\n");
- if (len)
- {
- char *namebuf = (char *) alloca (len + 1);
- memcpy (namebuf, ptr, len);
- namebuf[len] = '\0';
- for (ptr = pgm = namebuf; *ptr; ptr++)
- if (!arg1 && (*ptr == ' ' || *ptr == '\t'))
- {
- /* Null terminate the initial command and step over any additional white
- space. If we've hit the end of the line, exit the loop. Otherwise,
- we've found the first argument. Position the current pointer on the
- last known white space. */
- *ptr = '\0';
- char *newptr = ptr + 1;
- newptr += strspn (newptr, " \t");
- if (!*newptr)
- break;
- arg1 = newptr;
- ptr = newptr - 1;
- }
- }
- }
- UnmapViewOfFile (buf);
-just_shell:
- if (!pgm)
- {
- if (ascii_strcasematch (ext, ".com"))
- break;
- pgm = (char *) "/bin/sh";
- arg1 = NULL;
- }
-
- /* Replace argv[0] with the full path to the script if this is the
- first time through the loop. */
- replace0_maybe (prog_arg);
-
- /* pointers:
- * pgm interpreter name
- * arg1 optional string
- */
- if (arg1)
- unshift (arg1);
-
- /* FIXME: This should not be using FE_NATIVE. It should be putting
- the posix path on the argv list. */
- find_exec (pgm, real_path, "PATH=", FE_NATIVE, &ext);
- unshift (real_path.get_win32 (), 1);
- }
- return 0;
-
-err:
- __seterrno ();
- return -1;
-}
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
deleted file mode 100644
index 92446bcc043..00000000000
--- a/winsup/cygwin/syscalls.cc
+++ /dev/null
@@ -1,3875 +0,0 @@
-/* syscalls.cc: syscalls
-
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Red Hat, Inc.
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#define fstat __FOOfstat__
-#define lstat __FOOlstat__
-#define stat __FOOstat__
-#define _close __FOO_close__
-#define _lseek __FOO_lseek__
-#define _open __FOO_open__
-#define _read __FOO_read__
-#define _write __FOO_write__
-#define _open64 __FOO_open64__
-#define _lseek64 __FOO_lseek64__
-#define _fstat64 __FOO_fstat64__
-#define pread __FOO_pread
-#define pwrite __FOO_pwrite
-
-#include "winsup.h"
-#include "miscfuncs.h"
-#include <sys/stat.h>
-#include <sys/vfs.h> /* needed for statfs */
-#include <sys/statvfs.h> /* needed for statvfs */
-#include <stdlib.h>
-#include <stdio.h>
-#include <process.h>
-#include <utmp.h>
-#include <utmpx.h>
-#include <sys/uio.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <sys/wait.h>
-#include <rpc.h>
-#include "ntdll.h"
-
-#undef fstat
-#undef lstat
-#undef stat
-#undef pread
-#undef pwrite
-
-#include <cygwin/version.h>
-#include "cygerrno.h"
-#include "perprocess.h"
-#include "security.h"
-#include "path.h"
-#include "fhandler.h"
-#include "dtable.h"
-#include "sigproc.h"
-#include "pinfo.h"
-#include "shared_info.h"
-#include "cygheap.h"
-#include "pwdgrp.h"
-#include "cpuid.h"
-#include "registry.h"
-#include "environ.h"
-#include "tls_pbuf.h"
-
-#undef _close
-#undef _lseek
-#undef _open
-#undef _read
-#undef _write
-#undef _open64
-#undef _lseek64
-#undef _fstat64
-
-suffix_info stat_suffixes[] =
-{
- suffix_info ("", 1),
- suffix_info (".exe", 1),
- suffix_info (NULL)
-};
-
-SYSTEM_INFO system_info;
-
-static int __stdcall mknod_worker (const char *, mode_t, mode_t, _major_t,
- _minor_t);
-
-/* Close all files and process any queued deletions.
- Lots of unix style applications will open a tmp file, unlink it,
- but never call close. This function is called by _exit to
- ensure we don't leave any such files lying around. */
-
-void __stdcall
-close_all_files (bool norelease)
-{
- cygheap->fdtab.lock ();
-
- semaphore::terminate ();
-
- fhandler_base *fh;
- HANDLE h = NULL;
-
- for (int i = 0; i < (int) cygheap->fdtab.size; i++)
- if ((fh = cygheap->fdtab[i]) != NULL)
- {
-#ifdef DEBUGGING
- debug_printf ("closing fd %d", i);
-#endif
- if (i == 2)
- DuplicateHandle (GetCurrentProcess (), fh->get_output_handle (), GetCurrentProcess (), &h, 0, false,
- DUPLICATE_SAME_ACCESS);
- fh->close ();
- if (!norelease)
- cygheap->fdtab.release (i);
- }
-
- if (!hExeced && cygheap->ctty)
- cygheap->close_ctty ();
-
- if (h)
- SetStdHandle (STD_ERROR_HANDLE, h);
- cygheap->fdtab.unlock ();
-}
-
-int
-dup (int fd)
-{
- return cygheap->fdtab.dup2 (fd, cygheap_fdnew ());
-}
-
-int
-dup2 (int oldfd, int newfd)
-{
- return cygheap->fdtab.dup2 (oldfd, newfd);
-}
-
-static char desktop_ini[] =
- "[.ShellClassInfo]\r\nCLSID={645FF040-5081-101B-9F08-00AA002F954E}\r\n";
-static BYTE info2[] =
-{
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x20, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-static void
-try_to_bin (path_conv &win32_path, HANDLE h)
-{
- NTSTATUS status;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- HANDLE rootdir = NULL, recyclerdir = NULL;
- USHORT recycler_base_len = 0, recycler_user_len = 0;
- UNICODE_STRING root, recycler, fname;
- WCHAR recyclerbuf[NAME_MAX + 1]; /* Enough for recycler + SID + filename */
- PFILE_NAME_INFORMATION pfni;
- PFILE_INTERNAL_INFORMATION pfii;
- PFILE_RENAME_INFORMATION pfri;
- BYTE infobuf[sizeof (FILE_NAME_INFORMATION ) + 32767 * sizeof (WCHAR)];
-
- pfni = (PFILE_NAME_INFORMATION) infobuf;
- status = NtQueryInformationFile (h, &io, pfni, sizeof infobuf,
- FileNameInformation);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("NtQueryInformationFile (FileNameInformation) failed, %08x",
- status);
- goto out;
- }
- /* The filename could change, the parent dir not. So we split both paths
- and take the prefix. However, there are two special cases:
- - The handle refers to the root dir of the volume.
- - The handle refers to the recycler or a subdir.
- Both cases are handled by just returning and not even trying to move
- them into the recycler. */
- if (pfni->FileNameLength == 2) /* root dir. */
- goto out;
- /* Initialize recycler path. */
- RtlInitEmptyUnicodeString (&recycler, recyclerbuf, sizeof recyclerbuf);
- if (wincap.has_recycle_dot_bin ()) /* NTFS and FAT since Vista */
- RtlAppendUnicodeToString (&recycler, L"\\$Recycle.Bin\\");
- else if (win32_path.fs_is_ntfs ()) /* NTFS up to 2K3 */
- RtlAppendUnicodeToString (&recycler, L"\\RECYCLER\\");
- else if (win32_path.fs_is_fat ()) /* FAT up to 2K3 */
- RtlAppendUnicodeToString (&recycler, L"\\Recycled\\");
- else
- goto out;
- /* Is the file a subdir of the recycler? */
- RtlInitCountedUnicodeString(&fname, pfni->FileName, pfni->FileNameLength);
- if (RtlEqualUnicodePathPrefix (&fname, recycler.Buffer, TRUE))
- goto out;
- /* Is fname the recycler? Temporarily hide trailing backslash. */
- recycler.Length -= sizeof (WCHAR);
- if (RtlEqualUnicodeString (&fname, &recycler, TRUE))
- goto out;
-
- /* Create root dir path from file name information. */
- RtlSplitUnicodePath (&fname, &fname, NULL);
- RtlSplitUnicodePath (win32_path.get_nt_native_path (), &root, NULL);
- root.Length -= fname.Length - sizeof (WCHAR);
-
- /* Open root directory. All recycler bin ops are caseinsensitive. */
- InitializeObjectAttributes (&attr, &root, OBJ_CASE_INSENSITIVE, NULL, NULL);
- status = NtOpenFile (&rootdir, FILE_TRAVERSE, &attr, &io,
- FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("NtOpenFile (%S) failed, %08x", &root, status);
- goto out;
- }
-
- /* Strip leading backslash */
- ++recycler.Buffer;
- recycler.Length -= sizeof (WCHAR);
- /* Store length of recycler base dir, should it be necessary to create it. */
- recycler_base_len = recycler.Length;
- /* On NTFS the recycler dir contains user specific subdirs, which are the
- actual recycle bins per user. The name if this dir is the string
- representation of the user SID. */
- if (win32_path.fs_is_ntfs ())
- {
- UNICODE_STRING sid;
- WCHAR sidbuf[128];
- /* Unhide trailing backslash. */
- recycler.Length += sizeof (WCHAR);
- RtlInitEmptyUnicodeString (&sid, sidbuf, sizeof sidbuf);
- /* In contrast to what MSDN claims, this function is already available
- since NT4. */
- RtlConvertSidToUnicodeString (&sid, cygheap->user.sid (), FALSE);
- RtlAppendUnicodeStringToString (&recycler, &sid);
- recycler_user_len = recycler.Length;
- }
- /* Create hopefully unique filename. */
- RtlAppendUnicodeToString (&recycler, L"\\cyg");
- pfii = (PFILE_INTERNAL_INFORMATION) infobuf;
- status = NtQueryInformationFile (h, &io, pfii, sizeof infobuf,
- FileInternalInformation);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("NtQueryInformationFile (FileInternalInformation) failed, "
- "%08x", status);
- goto out;
- }
- RtlInt64ToHexUnicodeString (pfii->FileId.QuadPart, &recycler, TRUE);
- /* Shoot. */
- pfri = (PFILE_RENAME_INFORMATION) infobuf;
- pfri->ReplaceIfExists = TRUE;
- pfri->RootDirectory = rootdir;
- pfri->FileNameLength = recycler.Length;
- memcpy (pfri->FileName, recycler.Buffer, recycler.Length);
- status = NtSetInformationFile (h, &io, pfri, sizeof infobuf,
- FileRenameInformation);
- if (status == STATUS_OBJECT_PATH_NOT_FOUND)
- {
- /* Ok, so the recycler and/or the recycler/SID directory don't exist.
- First reopen root dir with permission to create subdirs. */
- NtClose (rootdir);
- status = NtOpenFile (&rootdir, FILE_ADD_SUBDIRECTORY, &attr, &io,
- FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("NtOpenFile (%S) failed, %08x", &recycler, status);
- goto out;
- }
- /* Then check if recycler exists by opening and potentially creating it.
- Yes, we can really do that. Typically the recycle bin is created
- by the first user actually using the bin. The permissions are the
- default permissions propagated from the root directory. */
- InitializeObjectAttributes (&attr, &recycler, OBJ_CASE_INSENSITIVE,
- rootdir, NULL);
- recycler.Length = recycler_base_len;
- status = NtCreateFile (&recyclerdir,
- READ_CONTROL
- | (win32_path.fs_is_ntfs () ? 0 : FILE_ADD_FILE),
- &attr, &io, NULL,
- FILE_ATTRIBUTE_DIRECTORY
- | FILE_ATTRIBUTE_SYSTEM
- | FILE_ATTRIBUTE_HIDDEN,
- FILE_SHARE_VALID_FLAGS, FILE_OPEN_IF,
- FILE_DIRECTORY_FILE, NULL, 0);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("NtCreateFile (%S) failed, %08x", &recycler, status);
- goto out;
- }
- /* Next, if necessary, check if the recycler/SID dir exists and
- create it if not. */
- if (win32_path.fs_is_ntfs ())
- {
- NtClose (recyclerdir);
- recycler.Length = recycler_user_len;
- status = NtCreateFile (&recyclerdir, READ_CONTROL | FILE_ADD_FILE,
- &attr, &io, NULL, FILE_ATTRIBUTE_DIRECTORY
- | FILE_ATTRIBUTE_SYSTEM
- | FILE_ATTRIBUTE_HIDDEN,
- FILE_SHARE_VALID_FLAGS, FILE_OPEN_IF,
- FILE_DIRECTORY_FILE, NULL, 0);
- if (!NT_SUCCESS (status))
- {
- debug_printf ("NtCreateFile (%S) failed, %08x",
- &recycler, status);
- goto out;
- }
- }
- /* The desktop.ini and INFO2 (pre-Vista) files are expected by
- Windows Explorer. Otherwise, the created bin is treated as
- corrupted */
- if (io.Information == FILE_CREATED)
- {
- HANDLE fh;
- RtlInitUnicodeString (&fname, L"desktop.ini");
- InitializeObjectAttributes (&attr, &fname, OBJ_CASE_INSENSITIVE,
- recyclerdir, NULL);
- status = NtCreateFile (&fh, FILE_GENERIC_WRITE, &attr, &io, NULL,
- FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN,
- FILE_SHARE_VALID_FLAGS, FILE_CREATE,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_NON_DIRECTORY_FILE, NULL, 0);
- if (!NT_SUCCESS (status))
- debug_printf ("NtCreateFile (%S) failed, %08x", &recycler, status);
- else
- {
- status = NtWriteFile (fh, NULL, NULL, NULL, &io, desktop_ini,
- sizeof desktop_ini - 1, NULL, NULL);
- if (!NT_SUCCESS (status))
- debug_printf ("NtWriteFile (%S) failed, %08x", &fname, status);
- NtClose (fh);
- }
- if (!wincap.has_recycle_dot_bin ()) /* No INFO2 file since Vista */
- {
- RtlInitUnicodeString (&fname, L"INFO2");
- status = NtCreateFile (&fh, FILE_GENERIC_WRITE, &attr, &io, NULL,
- FILE_ATTRIBUTE_ARCHIVE
- | FILE_ATTRIBUTE_HIDDEN,
- FILE_SHARE_VALID_FLAGS, FILE_CREATE,
- FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_NON_DIRECTORY_FILE, NULL, 0);
- if (!NT_SUCCESS (status))
- debug_printf ("NtCreateFile (%S) failed, %08x",
- &recycler, status);
- else
- {
- status = NtWriteFile (fh, NULL, NULL, NULL, &io, info2,
- sizeof info2, NULL, NULL);
- if (!NT_SUCCESS (status))
- debug_printf ("NtWriteFile (%S) failed, %08x",
- &fname, status);
- NtClose (fh);
- }
- }
- }
- NtClose (recyclerdir);
- /* Shoot again. */
- status = NtSetInformationFile (h, &io, pfri, sizeof infobuf,
- FileRenameInformation);
- }
- if (!NT_SUCCESS (status))
- debug_printf ("Move %S to %S failed, status = %p",
- win32_path.get_nt_native_path (), &recycler, status);
-out:
- if (rootdir)
- NtClose (rootdir);
-}
-
-static NTSTATUS
-check_dir_not_empty (HANDLE dir)
-{
- IO_STATUS_BLOCK io;
- const ULONG bufsiz = 3 * sizeof (FILE_NAMES_INFORMATION)
- + 3 * NAME_MAX * sizeof (WCHAR);
- PFILE_NAMES_INFORMATION pfni = (PFILE_NAMES_INFORMATION)
- alloca (bufsiz);
- NTSTATUS status = NtQueryDirectoryFile (dir, NULL, NULL, 0, &io, pfni,
- bufsiz, FileNamesInformation,
- FALSE, NULL, TRUE);
- if (!NT_SUCCESS (status))
- {
- syscall_printf ("Checking if directory is empty failed, "
- "status = %p", status);
- return status;
- }
- int cnt = 1;
- while (pfni->NextEntryOffset)
- {
- pfni = (PFILE_NAMES_INFORMATION)
- ((caddr_t) pfni + pfni->NextEntryOffset);
- ++cnt;
- }
- if (cnt > 2)
- {
- syscall_printf ("Directory not empty");
- return STATUS_DIRECTORY_NOT_EMPTY;
- }
- return STATUS_SUCCESS;
-}
-
-NTSTATUS
-unlink_nt (path_conv &pc)
-{
- NTSTATUS status;
- HANDLE fh;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- FILE_BASIC_INFORMATION fbi;
-
- ACCESS_MASK access = DELETE;
- /* If the R/O attribute is set, we have to open the file with
- FILE_WRITE_ATTRIBUTES to be able to remove this flags before trying
- to delete it. */
- if (pc.file_attributes () & FILE_ATTRIBUTE_READONLY)
- access |= FILE_WRITE_ATTRIBUTES;
-
- ULONG flags = FILE_OPEN_FOR_BACKUP_INTENT;
- /* Add the reparse point flag to native symlinks, otherwise we remove the
- target, not the symlink. */
- if (pc.is_rep_symlink ())
- flags |= FILE_OPEN_REPARSE_POINT;
-
- pc.get_object_attr (attr, sec_none_nih);
- /* First try to open the file with sharing not allowed. If the file
- has an open handle on it, this will fail. That indicates that the
- file has to be moved to the recycle bin so that it actually disappears
- from its directory even though its in use. Otherwise, if opening
- doesn't fail, the file is not in use and by simply closing the handle
- the file will disappear. */
- bool move_to_bin = false;
- status = NtOpenFile (&fh, access, &attr, &io, 0, flags);
- if (status == STATUS_SHARING_VIOLATION)
- {
- move_to_bin = true;
- if (!pc.isdir () || pc.isremote ())
- status = NtOpenFile (&fh, access, &attr, &io,
- FILE_SHARE_VALID_FLAGS, flags);
- else
- {
- /* It's getting tricky. The directory is opened in some process,
- so we're supposed to move it to the recycler and mark it for
- deletion. But what if the directory is not empty? The move
- will work, but the subsequent delete will fail. So we would
- have to move it back. That's bad, because the directory would
- be moved around which results in a temporary inconsistent state.
- So, what we do here is to test if the directory is empty. If
- not, we bail out with ERROR_DIR_NOT_EMTPY. The below code
- tests for at least three entries in the directory, ".", "..",
- and another one. Three entries means, not empty. This doesn't
- work for the root directory of a drive, but the root dir can
- neither be deleted, nor moved anyway. */
- status = NtOpenFile (&fh, access | FILE_LIST_DIRECTORY | SYNCHRONIZE,
- &attr, &io, FILE_SHARE_VALID_FLAGS,
- flags | FILE_SYNCHRONOUS_IO_NONALERT);
- if (NT_SUCCESS (status))
- {
- status = check_dir_not_empty (fh);
- if (!NT_SUCCESS (status))
- {
- NtClose (fh);
- return status;
- }
- }
- }
- }
- if (!NT_SUCCESS (status))
- {
- if (status == STATUS_DELETE_PENDING)
- {
- syscall_printf ("Delete already pending");
- return 0;
- }
- syscall_printf ("Opening file for delete failed, status = %p", status);
- return status;
- }
-
- if (move_to_bin && !pc.isremote ())
- try_to_bin (pc, fh);
-
- /* Get rid of read-only attribute. */
- if (access & FILE_WRITE_ATTRIBUTES)
- {
- fbi.CreationTime.QuadPart = fbi.LastAccessTime.QuadPart =
- fbi.LastWriteTime.QuadPart = fbi.ChangeTime.QuadPart = 0LL;
- fbi.FileAttributes = (pc.file_attributes () & ~FILE_ATTRIBUTE_READONLY)
- ?: FILE_ATTRIBUTE_NORMAL;
- NtSetInformationFile (fh, &io, &fbi, sizeof fbi, FileBasicInformation);
- }
-
- FILE_DISPOSITION_INFORMATION disp = { TRUE };
- status = NtSetInformationFile (fh, &io, &disp, sizeof disp,
- FileDispositionInformation);
- if (!NT_SUCCESS (status))
- {
- syscall_printf ("Setting delete disposition failed, status = %p", status);
- if (access & FILE_WRITE_ATTRIBUTES)
- {
- /* Restore R/O attributes. */
- fbi.FileAttributes = pc.file_attributes ();
- NtSetInformationFile (fh, &io, &fbi, sizeof fbi,
- FileBasicInformation);
- }
- }
- else if ((access & FILE_WRITE_ATTRIBUTES) && !pc.isdir ())
- {
- /* Restore R/O attribute to accommodate hardlinks. Don't try this
- with directories! For some reason the below NtSetInformationFile
- changes the disposition for delete back to FALSE, at least on XP. */
- fbi.FileAttributes = pc.file_attributes ();
- NtSetInformationFile (fh, &io, &fbi, sizeof fbi,
- FileBasicInformation);
- }
-
- NtClose (fh);
- return status;
-}
-
-extern "C" int
-unlink (const char *ourname)
-{
- int res = -1;
- DWORD devn;
- NTSTATUS status;
-
- path_conv win32_name (ourname, PC_SYM_NOFOLLOW, stat_suffixes);
-
- if (win32_name.error)
- {
- set_errno (win32_name.error);
- goto done;
- }
-
- devn = win32_name.get_devn ();
- if (isproc_dev (devn))
- {
- set_errno (EROFS);
- goto done;
- }
-
- if (!win32_name.exists ())
- {
- syscall_printf ("unlinking a nonexistent file");
- set_errno (ENOENT);
- goto done;
- }
- else if (win32_name.isdir ())
- {
- syscall_printf ("unlinking a directory");
- set_errno (EPERM);
- goto done;
- }
-
- status = unlink_nt (win32_name);
- if (NT_SUCCESS (status))
- res = 0;
- else
- __seterrno_from_nt_status (status);
-
- done:
- syscall_printf ("%d = unlink (%s)", res, ourname);
- return res;
-}
-
-extern "C" int
-_remove_r (struct _reent *, const char *ourname)
-{
- path_conv win32_name (ourname, PC_SYM_NOFOLLOW);
-
- if (win32_name.error)
- {
- set_errno (win32_name.error);
- syscall_printf ("-1 = remove (%s)", ourname);
- return -1;
- }
-
- return win32_name.isdir () ? rmdir (ourname) : unlink (ourname);
-}
-
-extern "C" int
-remove (const char *ourname)
-{
- path_conv win32_name (ourname, PC_SYM_NOFOLLOW);
-
- if (win32_name.error)
- {
- set_errno (win32_name.error);
- syscall_printf ("-1 = remove (%s)", ourname);
- return -1;
- }
-
- return win32_name.isdir () ? rmdir (ourname) : unlink (ourname);
-}
-
-extern "C" pid_t
-getpid ()
-{
- return myself->pid;
-}
-
-extern "C" pid_t
-_getpid_r (struct _reent *)
-{
- return getpid ();
-}
-
-/* getppid: POSIX 4.1.1.1 */
-extern "C" pid_t
-getppid ()
-{
- return myself->ppid;
-}
-
-/* setsid: POSIX 4.3.2.1 */
-extern "C" pid_t
-setsid (void)
-{
-#ifdef NEWVFORK
- vfork_save *vf = vfork_storage.val ();
- /* This is a horrible, horrible kludge */
- if (vf && vf->pid < 0)
- {
- pid_t pid = fork ();
- if (pid > 0)
- {
- syscall_printf ("longjmping due to vfork");
- vf->restore_pid (pid);
- }
- /* assuming that fork was successful */
- }
-#endif
-
- if (myself->pgid == myself->pid)
- syscall_printf ("hmm. pgid %d pid %d", myself->pgid, myself->pid);
- else
- {
- myself->ctty = -1;
- cygheap->manage_console_count ("setsid", 0);
- myself->sid = getpid ();
- myself->pgid = getpid ();
- if (cygheap->ctty)
- cygheap->close_ctty ();
- syscall_printf ("sid %d, pgid %d, %s", myself->sid, myself->pgid, myctty ());
- return myself->sid;
- }
-
- set_errno (EPERM);
- return -1;
-}
-
-extern "C" pid_t
-getsid (pid_t pid)
-{
- pid_t res;
- if (!pid)
- res = myself->sid;
- else
- {
- pinfo p (pid);
- if (p)
- res = p->sid;
- else
- {
- set_errno (ESRCH);
- res = -1;
- }
- }
- return res;
-}
-
-extern "C" ssize_t
-read (int fd, void *ptr, size_t len)
-{
- const iovec iov =
- {
- iov_base: ptr,
- iov_len: len
- };
-
- return readv (fd, &iov, 1);
-}
-
-extern "C" ssize_t
-pread (int fd, void *ptr, size_t len, _off64_t off)
-{
- ssize_t res;
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- res = -1;
- else
- res = cfd->pread (ptr, len, off);
-
- syscall_printf ("%d = pread (%d, %p, %d, %d), errno %d",
- res, fd, ptr, len, off, get_errno ());
- return res;
-}
-
-extern "C" ssize_t
-pwrite (int fd, void *ptr, size_t len, _off64_t off)
-{
- ssize_t res;
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- res = -1;
- else
- res = cfd->pwrite (ptr, len, off);
-
- syscall_printf ("%d = pwrite (%d, %p, %d, %d), errno %d",
- res, fd, ptr, len, off, get_errno ());
- return res;
-}
-
-EXPORT_ALIAS (read, _read)
-
-extern "C" ssize_t
-write (int fd, const void *ptr, size_t len)
-{
- const struct iovec iov =
- {
- iov_base: (void *) ptr, // const_cast
- iov_len: len
- };
-
- return writev (fd, &iov, 1);
-}
-
-EXPORT_ALIAS (write, _write)
-
-extern "C" ssize_t
-readv (int fd, const struct iovec *const iov, const int iovcnt)
-{
- extern int sigcatchers;
- const int e = get_errno ();
-
- int res = -1;
-
- const ssize_t tot = check_iovec_for_read (iov, iovcnt);
-
- if (tot <= 0)
- {
- res = tot;
- goto done;
- }
-
- while (1)
- {
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- break;
-
- if ((cfd->get_flags () & O_ACCMODE) == O_WRONLY)
- {
- set_errno (EBADF);
- break;
- }
-
- DWORD wait = cfd->is_nonblocking () ? 0 : INFINITE;
-
- /* Could block, so let user know we at least got here. */
- syscall_printf ("readv (%d, %p, %d) %sblocking, sigcatchers %d",
- fd, iov, iovcnt, wait ? "" : "non", sigcatchers);
-
- if (wait && (!cfd->is_slow () || cfd->uninterruptible_io ()))
- debug_printf ("no need to call ready_for_read");
- else if (!cfd->ready_for_read (fd, wait))
- {
- res = -1;
- goto out;
- }
-
- /* FIXME: This is not thread safe. We need some method to
- ensure that an fd, closed in another thread, aborts I/O
- operations. */
- if (!cfd.isopen ())
- break;
-
- /* Check to see if this is a background read from a "tty",
- sending a SIGTTIN, if appropriate */
- res = cfd->bg_check (SIGTTIN);
-
- if (!cfd.isopen ())
- {
- res = -1;
- break;
- }
-
- if (res > bg_eof)
- {
- myself->process_state |= PID_TTYIN;
- if (!cfd.isopen ())
- {
- res = -1;
- break;
- }
- res = cfd->readv (iov, iovcnt, tot);
- myself->process_state &= ~PID_TTYIN;
- }
-
- out:
- if (res >= 0 || get_errno () != EINTR || !_my_tls.call_signal_handler ())
- break;
- set_errno (e);
- }
-
-done:
- syscall_printf ("%d = readv (%d, %p, %d), errno %d", res, fd, iov, iovcnt,
- get_errno ());
- MALLOC_CHECK;
- return res;
-}
-
-extern "C" ssize_t
-writev (const int fd, const struct iovec *const iov, const int iovcnt)
-{
- int res = -1;
- const ssize_t tot = check_iovec_for_write (iov, iovcnt);
-
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- goto done;
-
- if (tot <= 0)
- {
- res = tot;
- goto done;
- }
-
- if ((cfd->get_flags () & O_ACCMODE) == O_RDONLY)
- {
- set_errno (EBADF);
- goto done;
- }
-
- /* Could block, so let user know we at least got here. */
- if (fd == 1 || fd == 2)
- paranoid_printf ("writev (%d, %p, %d)", fd, iov, iovcnt);
- else
- syscall_printf ("writev (%d, %p, %d)", fd, iov, iovcnt);
-
- res = cfd->bg_check (SIGTTOU);
-
- if (res > (int) bg_eof)
- {
- myself->process_state |= PID_TTYOU;
- res = cfd->writev (iov, iovcnt, tot);
- myself->process_state &= ~PID_TTYOU;
- }
-
-done:
- if (fd == 1 || fd == 2)
- paranoid_printf ("%d = write (%d, %p, %d), errno %d",
- res, fd, iov, iovcnt, get_errno ());
- else
- syscall_printf ("%d = write (%d, %p, %d), errno %d",
- res, fd, iov, iovcnt, get_errno ());
-
- MALLOC_CHECK;
- return res;
-}
-
-/* _open */
-/* newlib's fcntl.h defines _open as taking variable args so we must
- correspond. The third arg if it exists is: mode_t mode. */
-extern "C" int
-open (const char *unix_path, int flags, ...)
-{
- int res = -1;
- va_list ap;
- mode_t mode = 0;
- sig_dispatch_pending ();
-
- syscall_printf ("open (%s, %p)", unix_path, flags);
- myfault efault;
- if (efault.faulted (EFAULT))
- /* errno already set */;
- else if (!*unix_path)
- set_errno (ENOENT);
- else
- {
- /* check for optional mode argument */
- va_start (ap, flags);
- mode = va_arg (ap, mode_t);
- va_end (ap);
-
- fhandler_base *fh;
- cygheap_fdnew fd;
-
- if (fd >= 0)
- {
- if (!(fh = build_fh_name (unix_path, NULL,
- (flags & (O_NOFOLLOW | O_EXCL))
- ? PC_SYM_NOFOLLOW : PC_SYM_FOLLOW,
- stat_suffixes)))
- res = -1; // errno already set
- else if ((flags & O_NOFOLLOW) && fh->issymlink ())
- {
- delete fh;
- res = -1;
- set_errno (ELOOP);
- }
- else if (((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) && fh->exists ())
- {
- delete fh;
- res = -1;
- set_errno (EEXIST);
- }
- else if (fh->is_fs_special () && fh->device_access_denied (flags))
- {
- delete fh;
- res = -1;
- }
- else if (!fh->open (flags, (mode & 07777) & ~cygheap->umask))
- {
- delete fh;
- res = -1;
- }
- else
- {
- cygheap->fdtab[fd] = fh;
- if ((res = fd) <= 2)
- set_std_handle (res);
- }
- }
- }
-
- syscall_printf ("%d = open (%s, %p)", res, unix_path, flags);
- return res;
-}
-
-EXPORT_ALIAS (open, _open )
-EXPORT_ALIAS (open, _open64 )
-
-extern "C" _off64_t
-lseek64 (int fd, _off64_t pos, int dir)
-{
- _off64_t res;
-
- if (dir != SEEK_SET && dir != SEEK_CUR && dir != SEEK_END)
- {
- set_errno (EINVAL);
- res = -1;
- }
- else
- {
- cygheap_fdget cfd (fd);
- if (cfd >= 0)
- res = cfd->lseek (pos, dir);
- else
- res = -1;
- }
- syscall_printf ("%D = lseek (%d, %D, %d)", res, fd, pos, dir);
-
- return res;
-}
-
-EXPORT_ALIAS (lseek64, _lseek64)
-
-extern "C" _off_t
-lseek (int fd, _off_t pos, int dir)
-{
- return lseek64 (fd, (_off64_t) pos, dir);
-}
-
-EXPORT_ALIAS (lseek, _lseek)
-
-extern "C" int
-close (int fd)
-{
- int res;
-
- syscall_printf ("close (%d)", fd);
-
- MALLOC_CHECK;
- cygheap_fdget cfd (fd, true);
- if (cfd < 0)
- res = -1;
- else
- {
- res = cfd->close ();
- cfd.release ();
- }
-
- syscall_printf ("%d = close (%d)", res, fd);
- MALLOC_CHECK;
- return res;
-}
-
-EXPORT_ALIAS (close, _close)
-
-extern "C" int
-isatty (int fd)
-{
- int res;
-
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- res = 0;
- else
- res = cfd->is_tty ();
- syscall_printf ("%d = isatty (%d)", res, fd);
- return res;
-}
-EXPORT_ALIAS (isatty, _isatty)
-
-/* Under NT, try to make a hard link using backup API. If that
- fails or we are Win 95, just copy the file.
- FIXME: We should actually be checking partition type, not OS.
- Under NTFS, we should support hard links. On FAT partitions,
- we should just copy the file.
-*/
-
-extern "C" int
-link (const char *oldpath, const char *newpath)
-{
- int res = -1;
- fhandler_base *fh;
-
- if (!(fh = build_fh_name (oldpath, NULL, PC_SYM_NOFOLLOW, stat_suffixes)))
- goto error;
-
- if (fh->error ())
- {
- debug_printf ("got %d error from build_fh_name", fh->error ());
- set_errno (fh->error ());
- }
- else
- res = fh->link (newpath);
-
- delete fh;
- error:
- syscall_printf ("%d = link (%s, %s)", res, oldpath, newpath);
- return res;
-}
-
-/* chown: POSIX 5.6.5.1 */
-/*
- * chown () is only implemented for Windows NT. Under other operating
- * systems, it is only a stub that always returns zero.
- */
-static int
-chown_worker (const char *name, unsigned fmode, __uid32_t uid, __gid32_t gid)
-{
- int res = -1;
- fhandler_base *fh;
-
- if (!(fh = build_fh_name (name, NULL, fmode, stat_suffixes)))
- goto error;
-
- if (fh->error ())
- {
- debug_printf ("got %d error from build_fh_name", fh->error ());
- set_errno (fh->error ());
- }
- else
- res = fh->fchown (uid, gid);
-
- delete fh;
- error:
- syscall_printf ("%d = %schown (%s,...)",
- res, (fmode & PC_SYM_NOFOLLOW) ? "l" : "", name);
- return res;
-}
-
-extern "C" int
-chown32 (const char * name, __uid32_t uid, __gid32_t gid)
-{
- return chown_worker (name, PC_SYM_FOLLOW, uid, gid);
-}
-
-extern "C" int
-chown (const char * name, __uid16_t uid, __gid16_t gid)
-{
- return chown_worker (name, PC_SYM_FOLLOW,
- uid16touid32 (uid), gid16togid32 (gid));
-}
-
-extern "C" int
-lchown32 (const char * name, __uid32_t uid, __gid32_t gid)
-{
- return chown_worker (name, PC_SYM_NOFOLLOW, uid, gid);
-}
-
-extern "C" int
-lchown (const char * name, __uid16_t uid, __gid16_t gid)
-{
- return chown_worker (name, PC_SYM_NOFOLLOW,
- uid16touid32 (uid), gid16togid32 (gid));
-}
-
-extern "C" int
-fchown32 (int fd, __uid32_t uid, __gid32_t gid)
-{
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- {
- syscall_printf ("-1 = fchown (%d,...)", fd);
- return -1;
- }
-
- int res = cfd->fchown (uid, gid);
-
- syscall_printf ("%d = fchown (%s,...)", res, cfd->get_name ());
- return res;
-}
-
-extern "C" int
-fchown (int fd, __uid16_t uid, __gid16_t gid)
-{
- return fchown32 (fd, uid16touid32 (uid), gid16togid32 (gid));
-}
-
-/* umask: POSIX 5.3.3.1 */
-extern "C" mode_t
-umask (mode_t mask)
-{
- mode_t oldmask;
-
- oldmask = cygheap->umask;
- cygheap->umask = mask & 0777;
- return oldmask;
-}
-
-int
-chmod_device (path_conv& pc, mode_t mode)
-{
- return mknod_worker (pc.get_win32 (), pc.dev.mode & S_IFMT, mode, pc.dev.major, pc.dev.minor);
-}
-
-#define FILTERED_MODE(m) ((m) & (S_ISUID | S_ISGID | S_ISVTX \
- | S_IRWXU | S_IRWXG | S_IRWXO))
-
-/* chmod: POSIX 5.6.4.1 */
-extern "C" int
-chmod (const char *path, mode_t mode)
-{
- int res = -1;
- fhandler_base *fh;
- if (!(fh = build_fh_name (path, NULL, PC_SYM_FOLLOW, stat_suffixes)))
- goto error;
-
- if (fh->error ())
- {
- debug_printf ("got %d error from build_fh_name", fh->error ());
- set_errno (fh->error ());
- }
- else
- res = fh->fchmod (FILTERED_MODE (mode));
-
- delete fh;
- error:
- syscall_printf ("%d = chmod (%s, %p)", res, path, mode);
- return res;
-}
-
-/* fchmod: P96 5.6.4.1 */
-
-extern "C" int
-fchmod (int fd, mode_t mode)
-{
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- {
- syscall_printf ("-1 = fchmod (%d, 0%o)", fd, mode);
- return -1;
- }
-
- return cfd->fchmod (FILTERED_MODE (mode));
-}
-
-static void
-stat64_to_stat32 (struct __stat64 *src, struct __stat32 *dst)
-{
- dst->st_dev = ((src->st_dev >> 8) & 0xff00) | (src->st_dev & 0xff);
- dst->st_ino = ((unsigned) (src->st_ino >> 32)) | (unsigned) src->st_ino;
- dst->st_mode = src->st_mode;
- dst->st_nlink = src->st_nlink;
- dst->st_uid = src->st_uid;
- dst->st_gid = src->st_gid;
- dst->st_rdev = ((src->st_rdev >> 8) & 0xff00) | (src->st_rdev & 0xff);
- dst->st_size = src->st_size;
- dst->st_atim = src->st_atim;
- dst->st_mtim = src->st_mtim;
- dst->st_ctim = src->st_ctim;
- dst->st_blksize = src->st_blksize;
- dst->st_blocks = src->st_blocks;
-}
-
-extern "C" int
-fstat64 (int fd, struct __stat64 *buf)
-{
- int res;
-
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- res = -1;
- else
- {
- memset (buf, 0, sizeof (struct __stat64));
- res = cfd->fstat (buf);
- if (!res)
- {
- if (!buf->st_ino)
- buf->st_ino = cfd->get_ino ();
- if (!buf->st_dev)
- buf->st_dev = cfd->get_device ();
- if (!buf->st_rdev)
- buf->st_rdev = buf->st_dev;
- }
- }
-
- syscall_printf ("%d = fstat (%d, %p)", res, fd, buf);
- return res;
-}
-
-extern "C" int
-_fstat64_r (struct _reent *ptr, int fd, struct __stat64 *buf)
-{
- int ret;
-
- if ((ret = fstat64 (fd, buf)) == -1)
- ptr->_errno = get_errno ();
- return ret;
-}
-
-extern "C" int
-fstat (int fd, struct __stat32 *buf)
-{
- struct __stat64 buf64;
- int ret = fstat64 (fd, &buf64);
- if (!ret)
- stat64_to_stat32 (&buf64, buf);
- return ret;
-}
-
-extern "C" int
-_fstat_r (struct _reent *ptr, int fd, struct __stat32 *buf)
-{
- int ret;
-
- if ((ret = fstat (fd, buf)) == -1)
- ptr->_errno = get_errno ();
- return ret;
-}
-
-/* fsync: P96 6.6.1.1 */
-extern "C" int
-fsync (int fd)
-{
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- {
- syscall_printf ("-1 = fsync (%d)", fd);
- return -1;
- }
- return cfd->fsync ();
-}
-
-EXPORT_ALIAS (fsync, fdatasync)
-
-static void
-sync_worker (const char *vol)
-{
- HANDLE fh = CreateFileA (vol, GENERIC_WRITE, FILE_SHARE_VALID_FLAGS,
- &sec_none_nih, OPEN_EXISTING, 0, NULL);
- if (fh != INVALID_HANDLE_VALUE)
- {
- FlushFileBuffers (fh);
- CloseHandle (fh);
- }
- else
- debug_printf ("Open failed with %E");
-}
-
-/* sync: SUSv3 */
-extern "C" void
-sync ()
-{
- /* Per MSDN, 50 bytes should be enough here. */
- char vol[MAX_PATH];
-
- if (wincap.has_guid_volumes ()) /* Win2k and newer */
- {
- char a_drive[MAX_PATH] = {0};
- char b_drive[MAX_PATH] = {0};
-
- if (is_floppy ("A:"))
- GetVolumeNameForVolumeMountPointA ("A:\\", a_drive, MAX_PATH);
- if (is_floppy ("B:"))
- GetVolumeNameForVolumeMountPointA ("B:\\", b_drive, MAX_PATH);
-
- HANDLE sh = FindFirstVolumeA (vol, MAX_PATH);
- if (sh != INVALID_HANDLE_VALUE)
- {
- do
- {
- debug_printf ("Try volume %s", vol);
-
- /* Check vol for being a floppy on A: or B:. Skip them. */
- if (strcasematch (vol, a_drive) || strcasematch (vol, b_drive))
- {
- debug_printf ("Is floppy, don't sync");
- continue;
- }
-
- /* Eliminate trailing backslash. */
- vol[strlen (vol) - 1] = '\0';
- sync_worker (vol);
- }
- while (FindNextVolumeA (sh, vol, MAX_PATH));
- FindVolumeClose (sh);
- }
- }
- else
- {
- DWORD drives = GetLogicalDrives ();
- DWORD mask = 1;
- /* Skip floppies on A: and B: as in setmntent. */
- if ((drives & 1) && is_floppy ("A:"))
- drives &= ~1;
- if ((drives & 2) && is_floppy ("B:"))
- drives &= ~2;
- strcpy (vol, "\\\\.\\A:");
- do
- {
- /* Geeh. Try to sync only non-floppy drives. */
- if (drives & mask)
- {
- debug_printf ("Try volume %s", vol);
- sync_worker (vol);
- }
- vol[4]++;
- }
- while ((mask <<= 1) <= 1 << 25);
- }
-}
-
-/* Cygwin internal */
-int __stdcall
-stat_worker (path_conv &pc, struct __stat64 *buf)
-{
- int res = -1;
-
- myfault efault;
- if (efault.faulted (EFAULT))
- goto error;
-
- if (pc.error)
- {
- debug_printf ("got %d error from build_fh_name", pc.error);
- set_errno (pc.error);
- }
- else if (pc.exists ())
- {
- fhandler_base *fh;
-
- if (!(fh = build_fh_pc (pc)))
- goto error;
-
- debug_printf ("(%S, %p, %p), file_attributes %d",
- pc.get_nt_native_path (), buf, fh, (DWORD) *fh);
- memset (buf, 0, sizeof (*buf));
- res = fh->fstat (buf);
- if (!res)
- {
- if (!buf->st_ino)
- buf->st_ino = fh->get_ino ();
- if (!buf->st_dev)
- buf->st_dev = fh->get_device ();
- if (!buf->st_rdev)
- buf->st_rdev = buf->st_dev;
- }
- delete fh;
- }
- else
- set_errno (ENOENT);
-
- error:
- MALLOC_CHECK;
- syscall_printf ("%d = (%S, %p)", res, pc.get_nt_native_path (), buf);
- return res;
-}
-
-extern "C" int
-stat64 (const char *name, struct __stat64 *buf)
-{
- syscall_printf ("entering");
- path_conv pc (name, PC_SYM_FOLLOW | PC_POSIX, stat_suffixes);
- return stat_worker (pc, buf);
-}
-
-extern "C" int
-_stat64_r (struct _reent *ptr, const char *name, struct __stat64 *buf)
-{
- int ret;
-
- if ((ret = stat64 (name, buf)) == -1)
- ptr->_errno = get_errno ();
- return ret;
-}
-
-extern "C" int
-stat (const char *name, struct __stat32 *buf)
-{
- struct __stat64 buf64;
- int ret = stat64 (name, &buf64);
- if (!ret)
- stat64_to_stat32 (&buf64, buf);
- return ret;
-}
-
-extern "C" int
-_stat_r (struct _reent *ptr, const char *name, struct __stat32 *buf)
-{
- int ret;
-
- if ((ret = stat (name, buf)) == -1)
- ptr->_errno = get_errno ();
- return ret;
-}
-
-/* lstat: Provided by SVR4 and 4.3+BSD, POSIX? */
-extern "C" int
-lstat64 (const char *name, struct __stat64 *buf)
-{
- syscall_printf ("entering");
- path_conv pc (name, PC_SYM_NOFOLLOW | PC_POSIX, stat_suffixes);
- return stat_worker (pc, buf);
-}
-
-/* lstat: Provided by SVR4 and 4.3+BSD, POSIX? */
-extern "C" int
-lstat (const char *name, struct __stat32 *buf)
-{
- struct __stat64 buf64;
- int ret = lstat64 (name, &buf64);
- if (!ret)
- stat64_to_stat32 (&buf64, buf);
- return ret;
-}
-
-extern "C" int
-access (const char *fn, int flags)
-{
- // flags were incorrectly specified
- int res = -1;
- if (flags & ~(F_OK|R_OK|W_OK|X_OK))
- set_errno (EINVAL);
- else
- {
- fhandler_base *fh = build_fh_name (fn, NULL, PC_SYM_FOLLOW, stat_suffixes);
- if (fh)
- {
- res = fh->fhaccess (flags);
- delete fh;
- }
- }
- debug_printf ("returning %d", res);
- return res;
-}
-
-static void
-rename_append_suffix (path_conv &pc, const char *path, size_t len,
- const char *suffix)
-{
- char buf[len + 5];
-
- if (ascii_strcasematch (path + len - 4, ".lnk")
- || ascii_strcasematch (path + len - 4, ".exe"))
- len -= 4;
- stpcpy (stpncpy (buf, path, len), suffix);
- pc.check (buf, PC_SYM_NOFOLLOW);
-}
-
-static void
-start_transaction (HANDLE &old_trans, HANDLE &trans)
-{
- NTSTATUS status = NtCreateTransaction (&trans,
- SYNCHRONIZE | TRANSACTION_ALL_ACCESS,
- NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
- if (NT_SUCCESS (status))
- {
- old_trans = RtlGetCurrentTransaction ();
- RtlSetCurrentTransaction (trans);
- }
- else
- {
- debug_printf ("NtCreateTransaction failed, %p", status);
- old_trans = trans = NULL;
- }
-}
-
-static NTSTATUS
-stop_transaction (NTSTATUS status, HANDLE old_trans, HANDLE trans)
-{
- RtlSetCurrentTransaction (old_trans);
- if (NT_SUCCESS (status))
- status = NtCommitTransaction (trans, TRUE);
- else
- status = NtRollbackTransaction (trans, TRUE);
- NtClose (trans);
- return status;
-}
-
-extern "C" int
-rename (const char *oldpath, const char *newpath)
-{
- tmp_pathbuf tp;
- int res = -1;
- char *oldbuf, *newbuf;
- path_conv oldpc, newpc, new2pc, *dstpc, *removepc = NULL;
- bool old_dir_requested = false, new_dir_requested = false;
- bool old_explicit_suffix = false, new_explicit_suffix = false;
- size_t olen, nlen;
- bool equal_path;
- NTSTATUS status = 0;
- HANDLE fh = NULL, nfh;
- HANDLE old_trans = NULL, trans = NULL;
- OBJECT_ATTRIBUTES attr;
- IO_STATUS_BLOCK io;
- ULONG size;
- FILE_STANDARD_INFORMATION ofsi;
- PFILE_RENAME_INFORMATION pfri;
-
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
-
- if (has_dot_last_component (oldpath, true))
- {
- oldpc.check (oldpath, PC_SYM_NOFOLLOW, stat_suffixes);
- set_errno (oldpc.isdir () ? EBUSY : ENOTDIR);
- goto out;
- }
- if (has_dot_last_component (newpath, true))
- {
- newpc.check (newpath, PC_SYM_NOFOLLOW, stat_suffixes);
- set_errno (!newpc.exists () ? ENOENT : newpc.isdir () ? EBUSY : ENOTDIR);
- goto out;
- }
-
- /* A trailing slash requires that the pathname points to an existing
- directory. If it's not, it's a ENOTDIR condition. The same goes
- for newpath a bit further down this function. */
- olen = strlen (oldpath);
- if (isdirsep (oldpath[olen - 1]))
- {
- stpcpy (oldbuf = tp.c_get (), oldpath);
- while (olen > 0 && isdirsep (oldbuf[olen - 1]))
- oldbuf[--olen] = '\0';
- oldpath = oldbuf;
- old_dir_requested = true;
- }
- oldpc.check (oldpath, PC_SYM_NOFOLLOW, stat_suffixes);
- if (oldpc.error)
- {
- set_errno (oldpc.error);
- goto out;
- }
- if (!oldpc.exists ())
- {
- set_errno (ENOENT);
- goto out;
- }
- if (oldpc.isspecial ()) /* No renames from virtual FS */
- {
- set_errno (EROFS);
- goto out;
- }
- if (old_dir_requested && !oldpc.isdir ())
- {
- set_errno (ENOTDIR);
- goto out;
- }
- if (oldpc.known_suffix
- && (ascii_strcasematch (oldpath + olen - 4, ".lnk")
- || ascii_strcasematch (oldpath + olen - 4, ".exe")))
- old_explicit_suffix = true;
-
- nlen = strlen (newpath);
- if (isdirsep (newpath[nlen - 1]))
- {
- stpcpy (newbuf = tp.c_get (), newpath);
- while (nlen > 0 && isdirsep (newbuf[nlen - 1]))
- newbuf[--nlen] = '\0';
- newpath = newbuf;
- new_dir_requested = true;
- }
- newpc.check (newpath, PC_SYM_NOFOLLOW, stat_suffixes);
- if (newpc.error)
- {
- set_errno (newpc.error);
- goto out;
- }
- if (newpc.isspecial ()) /* No renames to virtual FSes */
- {
- set_errno (EROFS);
- goto out;
- }
- if (new_dir_requested && !newpc.isdir ())
- {
- set_errno (ENOTDIR);
- goto out;
- }
- if (newpc.known_suffix
- && (ascii_strcasematch (newpath + nlen - 4, ".lnk")
- || ascii_strcasematch (newpath + nlen - 4, ".exe")))
- new_explicit_suffix = true;
-
- /* This test is necessary in almost every case, so just do it once here. */
- equal_path = RtlEqualUnicodeString (oldpc.get_nt_native_path (),
- newpc.get_nt_native_path (),
- oldpc.objcaseinsensitive ());
-
- /* First check if oldpath and newpath only differ by case. If so, it's
- just a request to change the case of the filename. By simply setting
- the file attributes to INVALID_FILE_ATTRIBUTES (which translates to
- "file doesn't exist"), all later tests are skipped. */
- if (oldpc.objcaseinsensitive () && newpc.exists () && equal_path)
- {
- if (RtlEqualUnicodeString (oldpc.get_nt_native_path (),
- newpc.get_nt_native_path (),
- FALSE))
- {
- res = 0;
- goto out;
- }
- newpc.file_attributes (INVALID_FILE_ATTRIBUTES);
- }
- else if (oldpc.isdir ())
- {
- if (newpc.exists () && !newpc.isdir ())
- {
- set_errno (ENOTDIR);
- goto out;
- }
- /* Check for newpath being a subdir of oldpath. */
- if (RtlPrefixUnicodeString (oldpc.get_nt_native_path (),
- newpc.get_nt_native_path (),
- TRUE)
- && newpc.get_nt_native_path ()->Length >
- oldpc.get_nt_native_path ()->Length
- && *(PWCHAR) ((PBYTE) newpc.get_nt_native_path ()->Buffer
- + oldpc.get_nt_native_path ()->Length) == L'\\')
- {
- set_errno (EINVAL);
- goto out;
- }
- }
- else if (!newpc.exists ())
- {
- if (equal_path && old_explicit_suffix != new_explicit_suffix)
- {
- newpc.check (newpath, PC_SYM_NOFOLLOW);
- if (RtlEqualUnicodeString (oldpc.get_nt_native_path (),
- newpc.get_nt_native_path (),
- oldpc.objcaseinsensitive ()))
- {
- res = 0;
- goto out;
- }
- }
- else if (oldpc.is_lnk_symlink ()
- && !RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
- L".lnk", TRUE))
- rename_append_suffix (newpc, newpath, nlen, ".lnk");
- else if (oldpc.is_binary ()
- && !RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
- L".exe", TRUE))
- /* NOTE: No way to rename an executable foo.exe to foo. */
- rename_append_suffix (newpc, newpath, nlen, ".exe");
- }
- else if (newpc.isdir ())
- {
- set_errno (EISDIR);
- goto out;
- }
- else
- {
- if (equal_path && old_explicit_suffix != new_explicit_suffix)
- {
- newpc.check (newpath, PC_SYM_NOFOLLOW);
- if (RtlEqualUnicodeString (oldpc.get_nt_native_path (),
- newpc.get_nt_native_path (),
- oldpc.objcaseinsensitive ()))
- {
- res = 0;
- goto out;
- }
- }
- else if (oldpc.is_lnk_symlink ())
- {
- if (!newpc.is_lnk_symlink ()
- && !RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
- L".lnk", TRUE))
- {
- rename_append_suffix (new2pc, newpath, nlen, ".lnk");
- removepc = &newpc;
- }
- }
- else if (oldpc.is_binary ())
- {
- if (!RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
- L".exe", TRUE))
- {
- rename_append_suffix (new2pc, newpath, nlen, ".exe");
- removepc = &newpc;
- }
- }
- else
- {
- if ((RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
- L".lnk", TRUE)
- || RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
- L".exe", TRUE))
- && !new_explicit_suffix)
- {
- new2pc.check (newpath, PC_SYM_NOFOLLOW, stat_suffixes);
- newpc.get_nt_native_path ()->Length -= 4 * sizeof (WCHAR);
- if (new2pc.is_binary () || new2pc.is_lnk_symlink ())
- removepc = &new2pc;
- }
- }
- }
- dstpc = (removepc == &newpc) ? &new2pc : &newpc;
-
- /* Opening the file must be part of the transaction. It's not sufficient
- to call only NtSetInformationFile under the transaction. Therefore we
- have to start the transaction here, if necessary. */
- if (wincap.has_transactions ()
- && (dstpc->fs_flags () & FILE_SUPPORTS_TRANSACTIONS)
- && (dstpc->isdir ()
- || (!removepc && dstpc->has_attribute (FILE_ATTRIBUTE_READONLY))))
- start_transaction (old_trans, trans);
-
- /* DELETE is required to rename a file. */
- status = NtOpenFile (&fh, DELETE, oldpc.get_object_attr (attr, sec_none_nih),
- &io, FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT
- | (oldpc.is_rep_symlink () ? FILE_OPEN_REPARSE_POINT : 0));
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- goto out;
- }
-
- /* Renaming a dir to another, existing dir fails always, even if
- ReplaceIfExists is set to TRUE and the existing dir is empty. So
- we have to remove the destination dir first. This also covers the
- case that the destination directory is not empty. In that case,
- unlink_nt returns with STATUS_DIRECTORY_NOT_EMPTY. */
- if (dstpc->isdir ())
- {
- status = unlink_nt (*dstpc);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- goto out;
- }
- }
- /* You can't copy a file if the destination exists and has the R/O
- attribute set. Remove the R/O attribute first. But first check
- if a removepc exists. If so, dstpc points to a non-existing file
- due to a mangled suffix. */
- else if (!removepc && dstpc->has_attribute (FILE_ATTRIBUTE_READONLY))
- {
- status = NtOpenFile (&nfh, FILE_WRITE_ATTRIBUTES,
- dstpc->get_object_attr (attr, sec_none_nih),
- &io, FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT
- | (dstpc->is_rep_symlink ()
- ? FILE_OPEN_REPARSE_POINT : 0));
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- goto out;
- }
- FILE_BASIC_INFORMATION fbi;
- fbi.CreationTime.QuadPart = fbi.LastAccessTime.QuadPart =
- fbi.LastWriteTime.QuadPart = fbi.ChangeTime.QuadPart = 0LL;
- fbi.FileAttributes = (dstpc->file_attributes ()
- & ~FILE_ATTRIBUTE_READONLY)
- ?: FILE_ATTRIBUTE_NORMAL;
- status = NtSetInformationFile (nfh, &io, &fbi, sizeof fbi,
- FileBasicInformation);
- NtClose (nfh);
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- goto out;
- }
- }
-
- /* SUSv3: If the old argument and the new argument resolve to the same
- existing file, rename() shall return successfully and perform no
- other action.
- The test tries to be as quick as possible. First it tests for identical
- volume serial numbers because that information is available anyway.
- Then it tests if oldpath has more than 1 hardlink, then it opens newpath
- and tests for identical file ids. If so, oldpath and newpath refer to
- the same file. */
- if ((removepc || dstpc->exists ())
- && !oldpc.isdir ()
- && dstpc->fs_serial_number () == oldpc.fs_serial_number ()
- && NT_SUCCESS (NtQueryInformationFile (fh, &io, &ofsi, sizeof ofsi,
- FileStandardInformation))
- && ofsi.NumberOfLinks > 1
- && NT_SUCCESS (NtOpenFile (&nfh, READ_CONTROL,
- (removepc ?: dstpc)->get_object_attr (attr, sec_none_nih),
- &io, FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT
- | ((removepc ?: dstpc)->is_rep_symlink ()
- ? FILE_OPEN_REPARSE_POINT : 0))))
- {
- FILE_INTERNAL_INFORMATION ofii, nfii;
-
- if (NT_SUCCESS (NtQueryInformationFile (fh, &io, &ofii, sizeof ofii,
- FileInternalInformation))
- && NT_SUCCESS (NtQueryInformationFile (nfh, &io, &nfii, sizeof nfii,
- FileInternalInformation))
- && ofii.FileId.QuadPart == nfii.FileId.QuadPart)
- {
- debug_printf ("%s and %s are the same file", oldpath, newpath);
- NtClose (nfh);
- res = 0;
- goto out;
- }
- NtClose (nfh);
- }
- size = sizeof (FILE_RENAME_INFORMATION)
- + dstpc->get_nt_native_path ()->Length;
- if (size > NT_MAX_PATH * sizeof (WCHAR)) /* Hopefully very seldom. */
- pfri = (PFILE_RENAME_INFORMATION) alloca (size);
- else
- pfri = (PFILE_RENAME_INFORMATION) tp.w_get ();
- pfri->ReplaceIfExists = TRUE;
- pfri->RootDirectory = NULL;
- pfri->FileNameLength = dstpc->get_nt_native_path ()->Length;
- memcpy (&pfri->FileName, dstpc->get_nt_native_path ()->Buffer,
- pfri->FileNameLength);
- status = NtSetInformationFile (fh, &io, pfri, size, FileRenameInformation);
- /* This happens if the access rights don't allow deleting the destination.
- Even if the handle to the original file is opened with BACKUP
- and/or RECOVERY, these flags don't apply to the destination of the
- rename operation. So, a privileged user can't rename a file to an
- existing file, if the permissions of the existing file aren't right.
- Like directories, we have to handle this separately by removing the
- destination before renaming. */
- if (status == STATUS_ACCESS_DENIED && dstpc->exists () && !dstpc->isdir ())
- {
- if (wincap.has_transactions ()
- && (dstpc->fs_flags () & FILE_SUPPORTS_TRANSACTIONS)
- && !trans)
- {
- start_transaction (old_trans, trans);
- /* As mentioned earlier, opening the file must be part of the
- transaction. Therefore we have to reopen the file here if the
- transaction hasn't been started already. Unfortunately we can't
- use the NT "reopen file from existing handle" feature. In that
- case NtOpenFile returns STATUS_TRANSACTIONAL_CONFLICT. We *have*
- to close the handle to the file first, *then* we can re-open it.
- Fortunately nothing has happened yet, so the atomicity of the
- rename functionality is not spoiled. */
- NtClose (fh);
- status = NtOpenFile (&fh, DELETE,
- oldpc.get_object_attr (attr, sec_none_nih),
- &io, FILE_SHARE_VALID_FLAGS,
- FILE_OPEN_FOR_BACKUP_INTENT
- | (oldpc.is_rep_symlink ()
- ? FILE_OPEN_REPARSE_POINT : 0));
- if (!NT_SUCCESS (status))
- {
- __seterrno_from_nt_status (status);
- goto out;
- }
- }
- if (NT_SUCCESS (status = unlink_nt (*dstpc)))
- status = NtSetInformationFile (fh, &io, pfri, size,
- FileRenameInformation);
- }
- if (NT_SUCCESS (status))
- {
- if (removepc)
- unlink_nt (*removepc);
- res = 0;
- }
- else
- __seterrno_from_nt_status (status);
-
-out:
- if (fh)
- NtClose (fh);
- if (wincap.has_transactions () && trans)
- stop_transaction (status, old_trans, trans);
- syscall_printf ("%d = rename (%s, %s)", res, oldpath, newpath);
- return res;
-}
-
-extern "C" int
-system (const char *cmdstring)
-{
- pthread_testcancel ();
-
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
-
- int res;
- const char* command[4];
-
- if (cmdstring == NULL)
- return 1;
-
- command[0] = "sh";
- command[1] = "-c";
- command[2] = cmdstring;
- command[3] = (const char *) NULL;
-
- if ((res = spawnvp (_P_SYSTEM, "/bin/sh", command)) == -1)
- {
- // when exec fails, return value should be as if shell
- // executed exit (127)
- res = 127;
- }
-
- return res;
-}
-
-extern "C" int
-setdtablesize (int size)
-{
- if (size <= (int)cygheap->fdtab.size || cygheap->fdtab.extend (size - cygheap->fdtab.size))
- return 0;
-
- return -1;
-}
-
-extern "C" int
-getdtablesize ()
-{
- return cygheap->fdtab.size > OPEN_MAX ? cygheap->fdtab.size : OPEN_MAX;
-}
-
-extern "C" size_t
-getpagesize ()
-{
- if (!system_info.dwAllocationGranularity)
- GetSystemInfo (&system_info);
- return (size_t) system_info.dwAllocationGranularity;
-}
-
-size_t
-getsystempagesize ()
-{
- if (!system_info.dwPageSize)
- GetSystemInfo (&system_info);
- return (size_t) system_info.dwPageSize;
-}
-
-/* FIXME: not all values are correct... */
-extern "C" long int
-fpathconf (int fd, int v)
-{
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- return -1;
- return cfd->fpathconf (v);
-}
-
-extern "C" long int
-pathconf (const char *file, int v)
-{
- fhandler_base *fh;
-
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- if (!*file)
- {
- set_errno (ENOENT);
- return -1;
- }
- if (!(fh = build_fh_name (file, NULL, PC_SYM_FOLLOW, stat_suffixes)))
- return -1;
- if (!fh->exists ())
- {
- set_errno (ENOENT);
- return -1;
- }
- return fh->fpathconf (v);
-}
-
-extern "C" int
-ttyname_r (int fd, char *buf, size_t buflen)
-{
- int ret = 0;
- myfault efault;
- if (efault.faulted ())
- ret = EFAULT;
- else
- {
- cygheap_fdget cfd (fd, true);
- if (cfd < 0)
- ret = EBADF;
- else if (!cfd->is_tty ())
- ret = ENOTTY;
- else if (buflen < strlen (cfd->ttyname ()) + 1)
- ret = ERANGE;
- else
- strcpy (buf, cfd->ttyname ());
- }
- debug_printf ("returning %d tty: %s", ret, ret ? "NULL" : buf);
- return ret;
-}
-
-extern "C" char *
-ttyname (int fd)
-{
- static char name[TTY_NAME_MAX];
- int ret = ttyname_r (fd, name, TTY_NAME_MAX);
- if (ret)
- {
- set_errno (ret);
- return NULL;
- }
- return name;
-}
-
-extern "C" char *
-ctermid (char *str)
-{
- static NO_COPY char buf[16];
- if (str == NULL)
- str = buf;
- if (!real_tty_attached (myself))
- strcpy (str, "/dev/conin");
- else
- __small_sprintf (str, "/dev/tty%d", myself->ctty);
- return str;
-}
-
-/* Tells stdio if it should do the cr/lf conversion for this file */
-extern "C" int
-_cygwin_istext_for_stdio (int fd)
-{
- if (CYGWIN_VERSION_OLD_STDIO_CRLF_HANDLING)
- {
- syscall_printf ("fd %d: old API", fd);
- return 0; /* we do it for old apps, due to getc/putc macros */
- }
-
- cygheap_fdget cfd (fd, false, false);
- if (cfd < 0)
- {
- syscall_printf ("fd %d: not open", fd);
- return 0;
- }
-
-#if 0
- if (cfd->get_device () != FH_FS)
- {
- syscall_printf ("fd not disk file. Defaulting to binary.");
- return 0;
- }
-#endif
-
- if (cfd->wbinary () || cfd->rbinary ())
- {
- syscall_printf ("fd %d: opened as binary", fd);
- return 0;
- }
-
- syscall_printf ("fd %d: defaulting to text", fd);
- return 1;
-}
-
-/* internal newlib function */
-extern "C" int _fwalk (struct _reent *ptr, int (*function) (FILE *));
-
-static int
-setmode_helper (FILE *f)
-{
- if (fileno (f) != _my_tls.locals.setmode_file)
- {
- syscall_printf ("improbable, but %d != %d", fileno (f), _my_tls.locals.setmode_file);
- return 0;
- }
- syscall_printf ("file was %s now %s", f->_flags & __SCLE ? "text" : "binary",
- _my_tls.locals.setmode_mode & O_TEXT ? "text" : "binary");
- if (_my_tls.locals.setmode_mode & O_TEXT)
- f->_flags |= __SCLE;
- else
- f->_flags &= ~__SCLE;
- return 0;
-}
-
-extern "C" int
-getmode (int fd)
-{
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- return -1;
-
- return cfd->get_flags () & (O_BINARY | O_TEXT);
-}
-
-/* Set a file descriptor into text or binary mode, returning the
- previous mode. */
-
-extern "C" int
-setmode (int fd, int mode)
-{
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- return -1;
- if (mode != O_BINARY && mode != O_TEXT && mode != 0)
- {
- set_errno (EINVAL);
- return -1;
- }
-
- /* Note that we have no way to indicate the case that writes are
- binary but not reads, or vice-versa. These cases can arise when
- using the tty or console interface. People using those
- interfaces should not use setmode. */
-
- int res;
- if (cfd->wbinary () && cfd->rbinary ())
- res = O_BINARY;
- else if (cfd->wbinset () && cfd->rbinset ())
- res = O_TEXT; /* Specifically set O_TEXT */
- else
- res = 0;
-
- if (!mode)
- cfd->reset_to_open_binmode ();
- else
- cfd->set_flags ((cfd->get_flags () & ~(O_TEXT | O_BINARY)) | mode);
-
- syscall_printf ("(%d<%S>, %p) returning %s", fd,
- cfd->pc.get_nt_native_path (), mode,
- res & O_TEXT ? "text" : "binary");
- return res;
-}
-
-extern "C" int
-cygwin_setmode (int fd, int mode)
-{
- int res = setmode (fd, mode);
- if (res != -1)
- {
- _my_tls.locals.setmode_file = fd;
- if (_cygwin_istext_for_stdio (fd))
- _my_tls.locals.setmode_mode = O_TEXT;
- else
- _my_tls.locals.setmode_mode = O_BINARY;
- _fwalk (_GLOBAL_REENT, setmode_helper);
- }
- return res;
-}
-
-extern "C" int
-posix_fadvise (int fd, _off64_t offset, _off64_t len, int advice)
-{
- int res = -1;
- cygheap_fdget cfd (fd);
- if (cfd >= 0)
- res = cfd->fadvise (offset, len, advice);
- else
- set_errno (EBADF);
- syscall_printf ("%d = posix_fadvice (%d, %D, %D, %d)",
- res, fd, offset, len, advice);
- return res;
-}
-
-extern "C" int
-posix_fallocate (int fd, _off64_t offset, _off64_t len)
-{
- int res = -1;
- if (offset < 0 || len == 0)
- set_errno (EINVAL);
- else
- {
- cygheap_fdget cfd (fd);
- if (cfd >= 0)
- res = cfd->ftruncate (offset + len, false);
- else
- set_errno (EBADF);
- }
- syscall_printf ("%d = posix_fallocate (%d, %D, %D)", res, fd, offset, len);
- return res;
-}
-
-extern "C" int
-ftruncate64 (int fd, _off64_t length)
-{
- int res = -1;
- cygheap_fdget cfd (fd);
- if (cfd >= 0)
- res = cfd->ftruncate (length, true);
- else
- set_errno (EBADF);
- syscall_printf ("%d = ftruncate (%d, %D)", res, fd, length);
- return res;
-}
-
-/* ftruncate: P96 5.6.7.1 */
-extern "C" int
-ftruncate (int fd, _off_t length)
-{
- return ftruncate64 (fd, (_off64_t)length);
-}
-
-/* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */
-extern "C" int
-truncate64 (const char *pathname, _off64_t length)
-{
- int fd;
- int res = -1;
-
- fd = open (pathname, O_RDWR);
-
- if (fd != -1)
- {
- res = ftruncate64 (fd, length);
- close (fd);
- }
- syscall_printf ("%d = truncate (%s, %D)", res, pathname, length);
-
- return res;
-}
-
-/* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */
-extern "C" int
-truncate (const char *pathname, _off_t length)
-{
- return truncate64 (pathname, (_off64_t)length);
-}
-
-extern "C" long
-get_osfhandle (int fd)
-{
- long res;
-
- cygheap_fdget cfd (fd);
- if (cfd >= 0)
- res = (long) cfd->get_handle ();
- else
- res = -1;
-
- syscall_printf ("%d = get_osfhandle (%d)", res, fd);
- return res;
-}
-
-extern "C" int
-fstatvfs (int fd, struct statvfs *sfs)
-{
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
-
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- return -1;
- return cfd->fstatvfs (sfs);
-}
-
-extern "C" int
-statvfs (const char *name, struct statvfs *sfs)
-{
- int res = -1;
- fhandler_base *fh = NULL;
-
- myfault efault;
- if (efault.faulted (EFAULT))
- goto error;
-
- if (!(fh = build_fh_name (name, NULL, PC_SYM_FOLLOW, stat_suffixes)))
- goto error;
-
- if (fh->error ())
- {
- debug_printf ("got %d error from build_fh_name", fh->error ());
- set_errno (fh->error ());
- }
- else if (fh->exists ())
- {
- debug_printf ("(%s, %p), file_attributes %d", name, sfs, (DWORD) *fh);
- res = fh->fstatvfs (sfs);
- }
- else
- set_errno (ENOENT);
-
- delete fh;
- error:
- MALLOC_CHECK;
- syscall_printf ("%d = (%s, %p)", res, name, sfs);
- return res;
-}
-
-extern "C" int
-fstatfs (int fd, struct statfs *sfs)
-{
- struct statvfs vfs;
- int ret = fstatvfs (fd, &vfs);
- if (!ret)
- {
- sfs->f_type = vfs.f_flag;
- sfs->f_bsize = vfs.f_bsize;
- sfs->f_blocks = vfs.f_blocks;
- sfs->f_bavail = vfs.f_bavail;
- sfs->f_bfree = vfs.f_bfree;
- sfs->f_files = -1;
- sfs->f_ffree = -1;
- sfs->f_fsid = vfs.f_fsid;
- sfs->f_namelen = vfs.f_namemax;
- }
- return ret;
-}
-
-extern "C" int
-statfs (const char *fname, struct statfs *sfs)
-{
- struct statvfs vfs;
- int ret = statvfs (fname, &vfs);
- if (!ret)
- {
- sfs->f_type = vfs.f_flag;
- sfs->f_bsize = vfs.f_bsize;
- sfs->f_blocks = vfs.f_blocks;
- sfs->f_bavail = vfs.f_bavail;
- sfs->f_bfree = vfs.f_bfree;
- sfs->f_files = -1;
- sfs->f_ffree = -1;
- sfs->f_fsid = vfs.f_fsid;
- sfs->f_namelen = vfs.f_namemax;
- }
- return ret;
-}
-
-/* setpgid: POSIX 4.3.3.1 */
-extern "C" int
-setpgid (pid_t pid, pid_t pgid)
-{
- int res = -1;
- if (pid == 0)
- pid = getpid ();
- if (pgid == 0)
- pgid = pid;
-
- if (pgid < 0)
- set_errno (EINVAL);
- else
- {
- pinfo p (pid, PID_MAP_RW);
- if (!p)
- set_errno (ESRCH);
- else if (p->pgid == pgid)
- res = 0;
- /* A process may only change the process group of itself and its children */
- else if (p != myself && p->ppid != myself->pid)
- set_errno (EPERM);
- else
- {
- p->pgid = pgid;
- if (p->pid != p->pgid)
- p->set_has_pgid_children (0);
- res = 0;
- }
- }
-
- syscall_printf ("pid %d, pgid %d, res %d", pid, pgid, res);
- return res;
-}
-
-extern "C" pid_t
-getpgid (pid_t pid)
-{
- if (pid == 0)
- pid = getpid ();
-
- pinfo p (pid);
- if (p == 0)
- {
- set_errno (ESRCH);
- return -1;
- }
- return p->pgid;
-}
-
-extern "C" int
-setpgrp (void)
-{
- return setpgid (0, 0);
-}
-
-extern "C" pid_t
-getpgrp (void)
-{
- return getpgid (0);
-}
-
-extern "C" char *
-ptsname (int fd)
-{
- cygheap_fdget cfd (fd);
- if (cfd < 0)
- return 0;
- return (char *) (cfd->ptsname ());
-}
-
-static int __stdcall
-mknod_worker (const char *path, mode_t type, mode_t mode, _major_t major,
- _minor_t minor)
-{
- char buf[sizeof (":\\00000000:00000000:00000000") + PATH_MAX];
- sprintf (buf, ":\\%x:%x:%x", major, minor,
- type | (mode & (S_IRWXU | S_IRWXG | S_IRWXO)));
- return symlink_worker (buf, path, true, true);
-}
-
-extern "C" int
-mknod32 (const char *path, mode_t mode, __dev32_t dev)
-{
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- if (!*path)
- {
- set_errno (ENOENT);
- return -1;
- }
-
- if (strlen (path) >= PATH_MAX)
- return -1;
-
- path_conv w32path (path, PC_SYM_NOFOLLOW);
- if (w32path.exists ())
- {
- set_errno (EEXIST);
- return -1;
- }
-
- mode_t type = mode & S_IFMT;
- _major_t major = _major (dev);
- _minor_t minor = _minor (dev);
- switch (type)
- {
- case S_IFCHR:
- case S_IFBLK:
- break;
-
- case S_IFIFO:
- major = _major (FH_FIFO);
- minor = _minor (FH_FIFO);
- break;
-
- case 0:
- case S_IFREG:
- {
- int fd = open (path, O_CREAT, mode);
- if (fd < 0)
- return -1;
- close (fd);
- return 0;
- }
-
- default:
- set_errno (EINVAL);
- return -1;
- }
-
- return mknod_worker (w32path.get_win32 (), type, mode, major, minor);
-}
-
-extern "C" int
-mknod (const char *_path, mode_t mode, __dev16_t dev)
-{
- return mknod32 (_path, mode, (__dev32_t) dev);
-}
-
-extern "C" int
-mkfifo (const char *path, mode_t mode)
-{
- return mknod32 (path, (mode & ~S_IFMT) | S_IFIFO, 0);
-}
-
-/* seteuid: standards? */
-extern "C" int
-seteuid32 (__uid32_t uid)
-{
- debug_printf ("uid: %u myself->uid: %u myself->gid: %u",
- uid, myself->uid, myself->gid);
-
- if (uid == myself->uid && !cygheap->user.groups.ischanged)
- {
- debug_printf ("Nothing happens");
- return 0;
- }
-
- cygsid usersid;
- user_groups &groups = cygheap->user.groups;
- HANDLE new_token = INVALID_HANDLE_VALUE;
- struct passwd * pw_new;
- bool token_is_internal, issamesid = false;
-
- pw_new = internal_getpwuid (uid);
- if (!usersid.getfrompw (pw_new))
- {
- set_errno (EINVAL);
- return -1;
- }
-
- cygheap->user.deimpersonate ();
-
- /* Verify if the process token is suitable. */
- if (verify_token (hProcToken, usersid, groups))
- new_token = hProcToken;
- /* Verify if the external token is suitable */
- else if (cygheap->user.external_token != NO_IMPERSONATION
- && verify_token (cygheap->user.external_token, usersid, groups))
- new_token = cygheap->user.external_token;
- /* Verify if the current token (internal or former external) is suitable */
- else if (cygheap->user.curr_primary_token != NO_IMPERSONATION
- && cygheap->user.curr_primary_token != cygheap->user.external_token
- && verify_token (cygheap->user.curr_primary_token, usersid, groups,
- &token_is_internal))
- new_token = cygheap->user.curr_primary_token;
- /* Verify if the internal token is suitable */
- else if (cygheap->user.internal_token != NO_IMPERSONATION
- && cygheap->user.internal_token != cygheap->user.curr_primary_token
- && verify_token (cygheap->user.internal_token, usersid, groups,
- &token_is_internal))
- new_token = cygheap->user.internal_token;
-
- debug_printf ("Found token %d", new_token);
-
- /* If no impersonation token is available, try to
- authenticate using NtCreateToken () or LSA authentication. */
- if (new_token == INVALID_HANDLE_VALUE)
- {
- if (!(new_token = lsaauth (usersid, groups, pw_new)))
- {
- debug_printf ("lsaauth failed, try create_token.");
- new_token = create_token (usersid, groups, pw_new);
- if (new_token == INVALID_HANDLE_VALUE)
- {
- debug_printf ("create_token failed, bail out of here");
- cygheap->user.reimpersonate ();
- return -1;
- }
- }
-
- /* Keep at most one internal token */
- if (cygheap->user.internal_token != NO_IMPERSONATION)
- CloseHandle (cygheap->user.internal_token);
- cygheap->user.internal_token = new_token;
- }
-
- if (new_token != hProcToken)
- {
- /* Avoid having HKCU use default user */
- WCHAR name[128];
- load_registry_hive (usersid.string (name));
-
- /* Try setting owner to same value as user. */
- if (!SetTokenInformation (new_token, TokenOwner,
- &usersid, sizeof usersid))
- debug_printf ("SetTokenInformation(user.token, TokenOwner), %E");
- /* Try setting primary group in token to current group */
- if (!SetTokenInformation (new_token, TokenPrimaryGroup,
- &groups.pgsid, sizeof (cygsid)))
- debug_printf ("SetTokenInformation(user.token, TokenPrimaryGroup), %E");
- /* Try setting default DACL */
- PACL dacl_buf = (PACL) alloca (MAX_DACL_LEN (5));
- if (sec_acl (dacl_buf, true, true, usersid))
- {
- TOKEN_DEFAULT_DACL tdacl = { dacl_buf };
- if (!SetTokenInformation (new_token, TokenDefaultDacl,
- &tdacl, sizeof (tdacl)))
- debug_printf ("SetTokenInformation (TokenDefaultDacl), %E");
- }
- }
-
- issamesid = (usersid == cygheap->user.sid ());
- cygheap->user.set_sid (usersid);
- cygheap->user.curr_primary_token = new_token == hProcToken ? NO_IMPERSONATION
- : new_token;
- if (cygheap->user.curr_imp_token != NO_IMPERSONATION)
- {
- CloseHandle (cygheap->user.curr_imp_token);
- cygheap->user.curr_imp_token = NO_IMPERSONATION;
- }
- if (cygheap->user.curr_primary_token != NO_IMPERSONATION)
- {
- if (!DuplicateTokenEx (cygheap->user.curr_primary_token, MAXIMUM_ALLOWED,
- &sec_none, SecurityImpersonation,
- TokenImpersonation, &cygheap->user.curr_imp_token))
- {
- __seterrno ();
- cygheap->user.curr_primary_token = NO_IMPERSONATION;
- return -1;
- }
- set_cygwin_privileges (cygheap->user.curr_imp_token);
- }
- if (!cygheap->user.reimpersonate ())
- {
- __seterrno ();
- return -1;
- }
-
- cygheap->user.set_name (pw_new->pw_name);
- myself->uid = uid;
- groups.ischanged = FALSE;
- if (!issamesid)
- /* Recreate and fill out the user shared region for a new user. */
- user_shared_create (true);
- return 0;
-}
-
-extern "C" int
-seteuid (__uid16_t uid)
-{
- return seteuid32 (uid16touid32 (uid));
-}
-
-/* setuid: POSIX 4.2.2.1 */
-extern "C" int
-setuid32 (__uid32_t uid)
-{
- int ret = seteuid32 (uid);
- if (!ret)
- cygheap->user.real_uid = myself->uid;
- debug_printf ("real: %d, effective: %d", cygheap->user.real_uid, myself->uid);
- return ret;
-}
-
-extern "C" int
-setuid (__uid16_t uid)
-{
- return setuid32 (uid16touid32 (uid));
-}
-
-extern "C" int
-setreuid32 (__uid32_t ruid, __uid32_t euid)
-{
- int ret = 0;
- bool tried = false;
- __uid32_t old_euid = myself->uid;
-
- if (ruid != ILLEGAL_UID && cygheap->user.real_uid != ruid && euid != ruid)
- tried = !(ret = seteuid32 (ruid));
- if (!ret && euid != ILLEGAL_UID)
- ret = seteuid32 (euid);
- if (tried && (ret || euid == ILLEGAL_UID) && seteuid32 (old_euid))
- system_printf ("Cannot restore original euid %u", old_euid);
- if (!ret && ruid != ILLEGAL_UID)
- cygheap->user.real_uid = ruid;
- debug_printf ("real: %u, effective: %u", cygheap->user.real_uid, myself->uid);
- return ret;
-}
-
-extern "C" int
-setreuid (__uid16_t ruid, __uid16_t euid)
-{
- return setreuid32 (uid16touid32 (ruid), uid16touid32 (euid));
-}
-
-/* setegid: from System V. */
-extern "C" int
-setegid32 (__gid32_t gid)
-{
- debug_printf ("new egid: %u current: %u", gid, myself->gid);
-
- if (gid == myself->gid)
- {
- myself->gid = gid;
- return 0;
- }
-
- user_groups * groups = &cygheap->user.groups;
- cygsid gsid;
- struct __group32 * gr = internal_getgrgid (gid);
-
- if (!gsid.getfromgr (gr))
- {
- set_errno (EINVAL);
- return -1;
- }
- myself->gid = gid;
-
- groups->update_pgrp (gsid);
- if (cygheap->user.issetuid ())
- {
- /* If impersonated, update impersonation token... */
- if (!SetTokenInformation (cygheap->user.primary_token (),
- TokenPrimaryGroup, &gsid, sizeof gsid))
- debug_printf ("SetTokenInformation(primary_token, "
- "TokenPrimaryGroup), %E");
- if (!SetTokenInformation (cygheap->user.imp_token (), TokenPrimaryGroup,
- &gsid, sizeof gsid))
- debug_printf ("SetTokenInformation(token, TokenPrimaryGroup), %E");
- }
- cygheap->user.deimpersonate ();
- if (!SetTokenInformation (hProcToken, TokenPrimaryGroup, &gsid, sizeof gsid))
- debug_printf ("SetTokenInformation(hProcToken, TokenPrimaryGroup), %E");
- clear_procimptoken ();
- cygheap->user.reimpersonate ();
- return 0;
-}
-
-extern "C" int
-setegid (__gid16_t gid)
-{
- return setegid32 (gid16togid32 (gid));
-}
-
-/* setgid: POSIX 4.2.2.1 */
-extern "C" int
-setgid32 (__gid32_t gid)
-{
- int ret = setegid32 (gid);
- if (!ret)
- cygheap->user.real_gid = myself->gid;
- return ret;
-}
-
-extern "C" int
-setgid (__gid16_t gid)
-{
- int ret = setegid32 (gid16togid32 (gid));
- if (!ret)
- cygheap->user.real_gid = myself->gid;
- return ret;
-}
-
-extern "C" int
-setregid32 (__gid32_t rgid, __gid32_t egid)
-{
- int ret = 0;
- bool tried = false;
- __gid32_t old_egid = myself->gid;
-
- if (rgid != ILLEGAL_GID && cygheap->user.real_gid != rgid && egid != rgid)
- tried = !(ret = setegid32 (rgid));
- if (!ret && egid != ILLEGAL_GID)
- ret = setegid32 (egid);
- if (tried && (ret || egid == ILLEGAL_GID) && setegid32 (old_egid))
- system_printf ("Cannot restore original egid %u", old_egid);
- if (!ret && rgid != ILLEGAL_GID)
- cygheap->user.real_gid = rgid;
- debug_printf ("real: %u, effective: %u", cygheap->user.real_gid, myself->gid);
- return ret;
-}
-
-extern "C" int
-setregid (__gid16_t rgid, __gid16_t egid)
-{
- return setregid32 (gid16togid32 (rgid), gid16togid32 (egid));
-}
-
-/* chroot: privileged Unix system call. */
-/* FIXME: Not privileged here. How should this be done? */
-extern "C" int
-chroot (const char *newroot)
-{
- path_conv path (newroot, PC_SYM_FOLLOW | PC_POSIX);
-
- int ret = -1;
- if (path.error)
- set_errno (path.error);
- else if (!path.exists ())
- set_errno (ENOENT);
- else if (!path.isdir ())
- set_errno (ENOTDIR);
- else if (path.isspecial ())
- set_errno (EPERM);
- else
- {
- getwinenv("PATH="); /* Save the native PATH */
- cygheap->root.set (path.normalized_path, path.get_win32 (),
- !!path.objcaseinsensitive ());
- ret = 0;
- }
-
- syscall_printf ("%d = chroot (%s)", ret ? get_errno () : 0,
- newroot ? newroot : "NULL");
- return ret;
-}
-
-extern "C" int
-creat (const char *path, mode_t mode)
-{
- return open (path, O_WRONLY | O_CREAT | O_TRUNC, mode);
-}
-
-extern "C" void
-__assertfail ()
-{
- exit (99);
-}
-
-extern "C" int
-vhangup ()
-{
- set_errno (ENOSYS);
- return -1;
-}
-
-extern "C" int
-setpriority (int which, id_t who, int value)
-{
- DWORD prio = nice_to_winprio (value);
- int error = 0;
-
- switch (which)
- {
- case PRIO_PROCESS:
- if (!who)
- who = myself->pid;
- if ((pid_t) who == myself->pid)
- {
- if (!SetPriorityClass (hMainProc, prio))
- {
- set_errno (EACCES);
- return -1;
- }
- myself->nice = value;
- debug_printf ("Set nice to %d", myself->nice);
- return 0;
- }
- break;
- case PRIO_PGRP:
- if (!who)
- who = myself->pgid;
- break;
- case PRIO_USER:
- if (!who)
- who = myself->uid;
- break;
- default:
- set_errno (EINVAL);
- return -1;
- }
- winpids pids ((DWORD) PID_MAP_RW);
- for (DWORD i = 0; i < pids.npids; ++i)
- {
- _pinfo *p = pids[i];
- if (p)
- {
- switch (which)
- {
- case PRIO_PROCESS:
- if ((pid_t) who != p->pid)
- continue;
- break;
- case PRIO_PGRP:
- if ((pid_t) who != p->pgid)
- continue;
- break;
- case PRIO_USER:
- if ((__uid32_t) who != p->uid)
- continue;
- break;
- }
- HANDLE proc_h = OpenProcess (PROCESS_SET_INFORMATION, FALSE,
- p->dwProcessId);
- if (!proc_h)
- error = EPERM;
- else
- {
- if (!SetPriorityClass (proc_h, prio))
- error = EACCES;
- else
- p->nice = value;
- CloseHandle (proc_h);
- }
- }
- }
- pids.reset ();
- if (error)
- {
- set_errno (error);
- return -1;
- }
- return 0;
-}
-
-extern "C" int
-getpriority (int which, id_t who)
-{
- int nice = NZERO * 2; /* Illegal value */
-
- switch (which)
- {
- case PRIO_PROCESS:
- if (!who)
- who = myself->pid;
- if ((pid_t) who == myself->pid)
- return myself->nice;
- break;
- case PRIO_PGRP:
- if (!who)
- who = myself->pgid;
- break;
- case PRIO_USER:
- if (!who)
- who = myself->uid;
- break;
- default:
- set_errno (EINVAL);
- return -1;
- }
- winpids pids ((DWORD) 0);
- for (DWORD i = 0; i < pids.npids; ++i)
- {
- _pinfo *p = pids[i];
- if (p)
- switch (which)
- {
- case PRIO_PROCESS:
- if ((pid_t) who == p->pid)
- {
- nice = p->nice;
- goto out;
- }
- break;
- case PRIO_PGRP:
- if ((pid_t) who == p->pgid && p->nice < nice)
- nice = p->nice;
- break;
- case PRIO_USER:
- if ((__uid32_t) who == p->uid && p->nice < nice)
- nice = p->nice;
- break;
- }
- }
-out:
- pids.reset ();
- if (nice == NZERO * 2)
- {
- set_errno (ESRCH);
- return -1;
- }
- return nice;
-}
-
-extern "C" int
-nice (int incr)
-{
- return setpriority (PRIO_PROCESS, myself->pid, myself->nice + incr);
-}
-
-/*
- * Find the first bit set in I.
- */
-
-extern "C" int
-ffs (int i)
-{
- static const unsigned char table[] =
- {
- 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
- 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
- };
- unsigned long int a;
- unsigned long int x = i & -i;
-
- a = x <= 0xffff ? (x <= 0xff ? 0 : 8) : (x <= 0xffffff ? 16 : 24);
-
- return table[x >> a] + a;
-}
-
-static void
-locked_append (int fd, const void * buf, size_t size)
-{
- struct __flock64 lock_buffer = {F_WRLCK, SEEK_SET, 0, 0, 0};
- int count = 0;
-
- do
- if ((lock_buffer.l_start = lseek64 (fd, 0, SEEK_END)) != (_off64_t) -1
- && fcntl64 (fd, F_SETLKW, &lock_buffer) != -1)
- {
- if (lseek64 (fd, 0, SEEK_END) != (_off64_t) -1)
- write (fd, buf, size);
- lock_buffer.l_type = F_UNLCK;
- fcntl64 (fd, F_SETLK, &lock_buffer);
- break;
- }
- while (count++ < 1000
- && (errno == EACCES || errno == EAGAIN)
- && !usleep (1000));
-}
-
-extern "C" void
-updwtmp (const char *wtmp_file, const struct utmp *ut)
-{
- int fd;
-
- if ((fd = open (wtmp_file, O_WRONLY | O_BINARY, 0)) >= 0)
- {
- locked_append (fd, ut, sizeof *ut);
- close (fd);
- }
-}
-
-static int utmp_fd = -1;
-static bool utmp_readonly = false;
-static char *utmp_file = (char *) _PATH_UTMP;
-
-static void
-internal_setutent (bool force_readwrite)
-{
- if (force_readwrite && utmp_readonly)
- endutent ();
- if (utmp_fd < 0)
- {
- utmp_fd = open (utmp_file, O_RDWR | O_BINARY);
- /* If open fails, we assume an unprivileged process (who?). In this
- case we try again for reading only unless the process calls
- pututline() (==force_readwrite) in which case opening just fails. */
- if (utmp_fd < 0 && !force_readwrite)
- {
- utmp_fd = open (utmp_file, O_RDONLY | O_BINARY);
- if (utmp_fd >= 0)
- utmp_readonly = true;
- }
- }
- else
- lseek (utmp_fd, 0, SEEK_SET);
-}
-
-extern "C" void
-setutent ()
-{
- internal_setutent (false);
-}
-
-extern "C" void
-endutent ()
-{
- if (utmp_fd >= 0)
- {
- close (utmp_fd);
- utmp_fd = -1;
- utmp_readonly = false;
- }
-}
-
-extern "C" void
-utmpname (const char *file)
-{
- myfault efault;
- if (efault.faulted () || !*file)
- {
- debug_printf ("Invalid file");
- return;
- }
- endutent ();
- utmp_file = strdup (file);
- debug_printf ("New UTMP file: %s", utmp_file);
-}
-EXPORT_ALIAS (utmpname, utmpxname)
-
-/* Note: do not make NO_COPY */
-static struct utmp utmp_data_buf[16];
-static unsigned utix = 0;
-#define nutdbuf (sizeof (utmp_data_buf) / sizeof (utmp_data_buf[0]))
-#define utmp_data ({ \
- if (utix > nutdbuf) \
- utix = 0; \
- utmp_data_buf + utix++; \
-})
-
-static struct utmpx *
-copy_ut_to_utx (struct utmp *ut, struct utmpx *utx)
-{
- if (!ut)
- return NULL;
- memcpy (utx, ut, sizeof *ut);
- utx->ut_tv.tv_sec = ut->ut_time;
- utx->ut_tv.tv_usec = 0;
- return utx;
-}
-
-extern "C" struct utmp *
-getutent ()
-{
- if (utmp_fd < 0)
- {
- internal_setutent (false);
- if (utmp_fd < 0)
- return NULL;
- }
-
- utmp *ut = utmp_data;
- if (read (utmp_fd, ut, sizeof *ut) != sizeof *ut)
- return NULL;
- return ut;
-}
-
-extern "C" struct utmp *
-getutid (const struct utmp *id)
-{
- myfault efault;
- if (efault.faulted (EFAULT))
- return NULL;
- if (utmp_fd < 0)
- {
- internal_setutent (false);
- if (utmp_fd < 0)
- return NULL;
- }
-
- utmp *ut = utmp_data;
- while (read (utmp_fd, ut, sizeof *ut) == sizeof *ut)
- {
- switch (id->ut_type)
- {
- case RUN_LVL:
- case BOOT_TIME:
- case OLD_TIME:
- case NEW_TIME:
- if (id->ut_type == ut->ut_type)
- return ut;
- break;
- case INIT_PROCESS:
- case LOGIN_PROCESS:
- case USER_PROCESS:
- case DEAD_PROCESS:
- if (strncmp (id->ut_id, ut->ut_id, UT_IDLEN) == 0)
- return ut;
- break;
- default:
- return NULL;
- }
- }
- return NULL;
-}
-
-extern "C" struct utmp *
-getutline (const struct utmp *line)
-{
- myfault efault;
- if (efault.faulted (EFAULT))
- return NULL;
- if (utmp_fd < 0)
- {
- internal_setutent (false);
- if (utmp_fd < 0)
- return NULL;
- }
-
- utmp *ut = utmp_data;
- while (read (utmp_fd, ut, sizeof *ut) == sizeof *ut)
- if ((ut->ut_type == LOGIN_PROCESS ||
- ut->ut_type == USER_PROCESS) &&
- !strncmp (ut->ut_line, line->ut_line, sizeof (ut->ut_line)))
- return ut;
-
- return NULL;
-}
-
-extern "C" struct utmp *
-pututline (const struct utmp *ut)
-{
- myfault efault;
- if (efault.faulted (EFAULT))
- return NULL;
- internal_setutent (true);
- if (utmp_fd < 0)
- {
- debug_printf ("error: utmp_fd %d", utmp_fd);
- return NULL;
- }
- debug_printf ("ut->ut_type %d, ut->ut_pid %d, ut->ut_line '%s', ut->ut_id '%s'\n",
- ut->ut_type, ut->ut_pid, ut->ut_line, ut->ut_id);
- debug_printf ("ut->ut_user '%s', ut->ut_host '%s'\n",
- ut->ut_user, ut->ut_host);
-
- struct utmp *u;
- if ((u = getutid (ut)))
- {
- lseek (utmp_fd, -sizeof *ut, SEEK_CUR);
- write (utmp_fd, ut, sizeof *ut);
- }
- else
- locked_append (utmp_fd, ut, sizeof *ut);
- /* The documentation says to return a pointer to this which implies that
- this has to be cast from a const. That doesn't seem right but the
- documentation seems pretty clear on this. */
- return (struct utmp *) ut;
-}
-
-extern "C" void
-setutxent ()
-{
- internal_setutent (false);
-}
-
-extern "C" void
-endutxent ()
-{
- endutent ();
-}
-
-extern "C" struct utmpx *
-getutxent ()
-{
- /* UGH. Not thread safe. */
- static struct utmpx utx;
- return copy_ut_to_utx (getutent (), &utx);
-}
-
-extern "C" struct utmpx *
-getutxid (const struct utmpx *id)
-{
- /* UGH. Not thread safe. */
- static struct utmpx utx;
-
- myfault efault;
- if (efault.faulted (EFAULT))
- return NULL;
- ((struct utmpx *)id)->ut_time = id->ut_tv.tv_sec;
- return copy_ut_to_utx (getutid ((struct utmp *) id), &utx);
-}
-
-extern "C" struct utmpx *
-getutxline (const struct utmpx *line)
-{
- /* UGH. Not thread safe. */
- static struct utmpx utx;
-
- myfault efault;
- if (efault.faulted (EFAULT))
- return NULL;
- ((struct utmpx *)line)->ut_time = line->ut_tv.tv_sec;
- return copy_ut_to_utx (getutline ((struct utmp *) line), &utx);
-}
-
-extern "C" struct utmpx *
-pututxline (const struct utmpx *utmpx)
-{
- /* UGH. Not thread safe. */
- static struct utmpx utx;
-
- myfault efault;
- if (efault.faulted (EFAULT))
- return NULL;
- ((struct utmpx *)utmpx)->ut_time = utmpx->ut_tv.tv_sec;
- return copy_ut_to_utx (pututline ((struct utmp *) utmpx), &utx);
-}
-
-extern "C" void
-updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx)
-{
- ((struct utmpx *)utmpx)->ut_time = utmpx->ut_tv.tv_sec;
- updwtmp (wtmpx_file, (const struct utmp *) utmpx);
-}
-
-extern "C"
-long gethostid (void)
-{
- unsigned data[13] = {0x92895012,
- 0x10293412,
- 0x29602018,
- 0x81928167,
- 0x34601329,
- 0x75630198,
- 0x89860395,
- 0x62897564,
- 0x00194362,
- 0x20548593,
- 0x96839102,
- 0x12219854,
- 0x00290012};
-
- bool has_cpuid = false;
-
- DWORD opmask = SetThreadAffinityMask (GetCurrentThread (), 1);
- if (!opmask)
- debug_printf ("SetThreadAffinityMask to 1 failed, %E");
-
- if (!can_set_flag (0x00040000))
- debug_printf ("386 processor - no cpuid");
- else
- {
- debug_printf ("486 processor");
- if (can_set_flag (0x00200000))
- {
- debug_printf ("processor supports CPUID instruction");
- has_cpuid = true;
- }
- else
- debug_printf ("processor does not support CPUID instruction");
- }
- if (has_cpuid)
- {
- unsigned maxf, unused[3];
- cpuid (&maxf, &unused[0], &unused[1], &unused[2], 0);
- maxf &= 0xffff;
- if (maxf >= 1)
- {
- unsigned features;
- cpuid (&data[0], &unused[0], &unused[1], &features, 1);
- if (features & (1 << 18))
- {
- debug_printf ("processor has psn");
- if (maxf >= 3)
- {
- cpuid (&unused[0], &unused[1], &data[1], &data[2], 3);
- debug_printf ("Processor PSN: %04x-%04x-%04x-%04x-%04x-%04x",
- data[0] >> 16, data[0] & 0xffff, data[2] >> 16, data[2] & 0xffff, data[1] >> 16, data[1] & 0xffff);
- }
- }
- else
- debug_printf ("processor does not have psn");
- }
- }
-
- UUID Uuid;
- RPC_STATUS status = UuidCreateSequential (&Uuid);
- if (GetLastError () == ERROR_PROC_NOT_FOUND)
- status = UuidCreate (&Uuid);
- if (status == RPC_S_OK)
- {
- data[4] = *(unsigned *)&Uuid.Data4[2];
- data[5] = *(unsigned short *)&Uuid.Data4[6];
- // Unfortunately Windows will sometimes pick a virtual Ethernet card
- // e.g. VMWare Virtual Ethernet Adaptor
- debug_printf ("MAC address of first Ethernet card: %02x:%02x:%02x:%02x:%02x:%02x",
- Uuid.Data4[2], Uuid.Data4[3], Uuid.Data4[4],
- Uuid.Data4[5], Uuid.Data4[6], Uuid.Data4[7]);
- }
- else
- {
- debug_printf ("no Ethernet card installed");
- }
-
- reg_key key (HKEY_LOCAL_MACHINE, KEY_READ, "SOFTWARE", "Microsoft", "Windows", "CurrentVersion", NULL);
- key.get_string ("ProductId", (char *)&data[6], 24, "00000-000-0000000-00000");
- debug_printf ("Windows Product ID: %s", (char *)&data[6]);
-
- /* Contrary to MSDN, NT4 requires the second argument
- or a STATUS_ACCESS_VIOLATION is generated */
- ULARGE_INTEGER availb;
- GetDiskFreeSpaceEx ("C:\\", &availb, (PULARGE_INTEGER) &data[11], NULL);
-
- debug_printf ("hostid entropy: %08x %08x %08x %08x "
- "%08x %08x %08x %08x "
- "%08x %08x %08x %08x "
- "%08x",
- data[0], data[1],
- data[2], data[3],
- data[4], data[5],
- data[6], data[7],
- data[8], data[9],
- data[10], data[11],
- data[12]);
-
- long hostid = 0x40291372;
- // a random hashing algorithm
- // dependancy on md5 is probably too costly
- for (int i=0;i<13;i++)
- hostid ^= ((data[i] << (i << 2)) | (data[i] >> (32 - (i << 2))));
-
- if (opmask && !SetThreadAffinityMask (GetCurrentThread (), opmask))
- debug_printf ("SetThreadAffinityMask to %p failed, %E", opmask);
-
- debug_printf ("hostid: %08x", hostid);
-
- return hostid;
-}
-
-#define ETC_SHELLS "/etc/shells"
-static int shell_index;
-static struct __sFILE64 *shell_fp;
-
-extern "C" char *
-getusershell ()
-{
- /* List of default shells if no /etc/shells exists, defined as on Linux.
- FIXME: SunOS has a far longer list, containing all shells which
- might be shipped with the OS. Should we do the same for the Cygwin
- distro, adding bash, tcsh, ksh, pdksh and zsh? */
- static NO_COPY const char *def_shells[] = {
- "/bin/sh",
- "/bin/csh",
- "/usr/bin/sh",
- "/usr/bin/csh",
- NULL
- };
- static char buf[PATH_MAX];
- int ch, buf_idx;
-
- if (!shell_fp && !(shell_fp = fopen64 (ETC_SHELLS, "rt")))
- {
- if (def_shells[shell_index])
- return strcpy (buf, def_shells[shell_index++]);
- return NULL;
- }
- /* Skip white space characters. */
- while ((ch = getc (shell_fp)) != EOF && isspace (ch))
- ;
- /* Get each non-whitespace character as part of the shell path as long as
- it fits in buf. */
- for (buf_idx = 0;
- ch != EOF && !isspace (ch) && buf_idx < PATH_MAX;
- buf_idx++, ch = getc (shell_fp))
- buf[buf_idx] = ch;
- /* Skip any trailing non-whitespace character not fitting in buf. If the
- path is longer than PATH_MAX, it's invalid anyway. */
- while (ch != EOF && !isspace (ch))
- ch = getc (shell_fp);
- if (buf_idx)
- {
- buf[buf_idx] = '\0';
- return buf;
- }
- return NULL;
-}
-
-extern "C" void
-setusershell ()
-{
- if (shell_fp)
- fseek (shell_fp, 0L, SEEK_SET);
- shell_index = 0;
-}
-
-extern "C" void
-endusershell ()
-{
- if (shell_fp)
- {
- fclose (shell_fp);
- shell_fp = NULL;
- }
- shell_index = 0;
-}
-
-extern "C" void
-flockfile (FILE *file)
-{
- _flockfile (file);
-}
-
-extern "C" int
-ftrylockfile (FILE *file)
-{
- return _ftrylockfile (file);
-}
-
-extern "C" void
-funlockfile (FILE *file)
-{
- _funlockfile (file);
-}
-
-extern "C" FILE *
-popen (const char *command, const char *in_type)
-{
- const char *type = in_type;
- char rw = *type++;
-
- if (*type == 'b' || *type == 't')
- type++;
- if ((rw != 'r' && rw != 'w') || (*type != '\0'))
- {
- set_errno (EINVAL);
- return NULL;
- }
-
- int fd, other_fd, __stdin, __stdout, stdwhat;
-
- int fds[2];
- if (pipe (fds) < 0)
- return NULL;
-
- switch (rw)
- {
- case 'r':
- __stdin = -1;
- stdwhat = 1;
- other_fd = __stdout = fds[1];
- fd = fds[0];
- break;
- case 'w':
- __stdout = -1;
- stdwhat = 0;
- other_fd = __stdin = fds[0];
- fd = fds[1];
- break;
- default:
- return NULL; /* avoid a compiler warning */
- }
-
- FILE *fp = fdopen (fd, in_type);
- fcntl64 (fd, F_SETFD, fcntl64 (fd, F_GETFD, 0) | FD_CLOEXEC);
-
- if (!fp)
- goto err;
-
- pid_t pid;
- const char *argv[4];
-
- argv[0] = "/bin/sh";
- argv[1] = "-c";
- argv[2] = command;
- argv[3] = NULL;
-
- {
- lock_process now;
- int state = fcntl64 (stdwhat, F_GETFD, 0);
- fcntl64 (stdwhat, F_SETFD, state | FD_CLOEXEC);
- pid = spawn_guts ("/bin/sh", argv, cur_environ (), _P_NOWAIT,
- __stdin, __stdout);
- fcntl64 (stdwhat, F_SETFD, state);
- }
-
- if (pid < 0)
- goto err;
- close (other_fd);
-
- fhandler_pipe *fh = (fhandler_pipe *) cygheap->fdtab[fd];
- fh->set_popen_pid (pid);
-
- return fp;
-
-err:
- int save_errno = get_errno ();
- close (fds[0]);
- close (fds[1]);
- set_errno (save_errno);
- return NULL;
-}
-
-int
-pclose (FILE *fp)
-{
- fhandler_pipe *fh = (fhandler_pipe *) cygheap->fdtab[fileno(fp)];
-
- if (fh->get_device () != FH_PIPEW && fh->get_device () != FH_PIPER)
- {
- set_errno (EBADF);
- return -1;
- }
-
- int pid = fh->get_popen_pid ();
- if (!pid)
- {
- set_errno (ECHILD);
- return -1;
- }
-
- if (fclose (fp))
- return -1;
-
- int status;
- while (1)
- if (waitpid (pid, &status, 0) == pid)
- break;
- else if (get_errno () == EINTR)
- continue;
- else
- return -1;
-
- return status;
-}
-
-/* Preliminary(?) implementation of the openat family of functions. */
-
-static int
-gen_full_path_at (char *path_ret, int dirfd, const char *pathname,
- bool null_pathname_allowed = false)
-{
- /* Set null_pathname_allowed to true to allow GLIBC compatible behaviour
- for NULL pathname. Only used by futimesat. */
- if (!pathname && !null_pathname_allowed)
- {
- set_errno (EFAULT);
- return -1;
- }
- if (pathname)
- {
- if (!*pathname)
- {
- set_errno (ENOENT);
- return -1;
- }
- if (strlen (pathname) >= PATH_MAX)
- {
- set_errno (ENAMETOOLONG);
- return -1;
- }
- }
- if (pathname && isdirsep (*pathname))
- stpcpy (path_ret, pathname);
- else
- {
- char *p;
-
- if (dirfd == AT_FDCWD)
- p = stpcpy (path_ret, cygheap->cwd.posix);
- else
- {
- cygheap_fdget cfd (dirfd);
- if (cfd < 0)
- return -1;
- if (!cfd->pc.isdir ())
- {
- set_errno (ENOTDIR);
- return -1;
- }
- p = stpcpy (path_ret, cfd->get_name ());
- }
- if (!p)
- {
- set_errno (ENOTDIR);
- return -1;
- }
- if (pathname)
- {
- if (p[-1] != '/')
- *p++ = '/';
- stpcpy (p, pathname);
- }
- }
- return 0;
-}
-
-extern "C" int
-openat (int dirfd, const char *pathname, int flags, ...)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *path = tp.c_get ();
- if (gen_full_path_at (path, dirfd, pathname))
- return -1;
-
- va_list ap;
- mode_t mode;
-
- va_start (ap, flags);
- mode = va_arg (ap, mode_t);
- va_end (ap);
- return open (path, flags, mode);
-}
-
-extern "C" int
-faccessat (int dirfd, const char *pathname, int mode, int flags)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
-
- int res = -1;
- char *path = tp.c_get ();
- if (!gen_full_path_at (path, dirfd, pathname))
- {
- if (flags & ~(F_OK|R_OK|W_OK|X_OK))
- set_errno (EINVAL);
- else
- {
- fhandler_base *fh = build_fh_name (path, NULL,
- (flags & AT_SYMLINK_NOFOLLOW)
- ? PC_SYM_NOFOLLOW : PC_SYM_FOLLOW,
- stat_suffixes);
- if (fh)
- {
- res = fh->fhaccess (mode);
- delete fh;
- }
- }
- }
- debug_printf ("returning %d", res);
- return res;
-}
-
-extern "C" int
-fchmodat (int dirfd, const char *pathname, mode_t mode, int flags)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *path = tp.c_get ();
- if (gen_full_path_at (path, dirfd, pathname))
- return -1;
- return chmod (path, mode);
-}
-
-extern "C" int
-fchownat (int dirfd, const char *pathname, __uid32_t uid, __gid32_t gid,
- int flags)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *path = tp.c_get ();
- if (gen_full_path_at (path, dirfd, pathname))
- return -1;
- return chown_worker (path, (flags & AT_SYMLINK_NOFOLLOW)
- ? PC_SYM_NOFOLLOW : PC_SYM_FOLLOW, uid, gid);
-}
-
-extern "C" int
-fstatat (int dirfd, const char *pathname, struct __stat64 *st, int flags)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *path = tp.c_get ();
- if (gen_full_path_at (path, dirfd, pathname))
- return -1;
- return (flags & AT_SYMLINK_NOFOLLOW) ? lstat64 (path, st) : stat64 (path, st);
-}
-
-extern int utimens_worker (path_conv &, const struct timespec *);
-
-extern "C" int
-utimensat (int dirfd, const char *pathname, const struct timespec *times,
- int flags)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *path = tp.c_get ();
- if (gen_full_path_at (path, dirfd, pathname))
- return -1;
- path_conv win32 (path, PC_POSIX | ((flags & AT_SYMLINK_NOFOLLOW)
- ? PC_SYM_NOFOLLOW : PC_SYM_FOLLOW),
- stat_suffixes);
- return utimens_worker (win32, times);
-}
-
-extern "C" int
-futimesat (int dirfd, const char *pathname, const struct timeval *times)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *path = tp.c_get ();
- if (gen_full_path_at (path, dirfd, pathname, true))
- return -1;
- return utimes (path, times);
-}
-
-extern "C" int
-linkat (int olddirfd, const char *oldpathname,
- int newdirfd, const char *newpathname,
- int flags)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *oldpath = tp.c_get ();
- if (gen_full_path_at (oldpath, olddirfd, oldpathname))
- return -1;
- char *newpath = tp.c_get ();
- if (gen_full_path_at (newpath, newdirfd, newpathname))
- return -1;
- if (flags & AT_SYMLINK_FOLLOW)
- {
- path_conv old_name (oldpath, PC_SYM_FOLLOW | PC_POSIX, stat_suffixes);
- if (old_name.error)
- {
- set_errno (old_name.error);
- return -1;
- }
- strcpy (oldpath, old_name.normalized_path);
- }
- return link (oldpath, newpath);
-}
-
-extern "C" int
-mkdirat (int dirfd, const char *pathname, mode_t mode)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *path = tp.c_get ();
- if (gen_full_path_at (path, dirfd, pathname))
- return -1;
- return mkdir (path, mode);
-}
-
-extern "C" int
-mkfifoat (int dirfd, const char *pathname, mode_t mode)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *path = tp.c_get ();
- if (gen_full_path_at (path, dirfd, pathname))
- return -1;
- return mkfifo (path, mode);
-}
-
-extern "C" int
-mknodat (int dirfd, const char *pathname, mode_t mode, __dev32_t dev)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *path = tp.c_get ();
- if (gen_full_path_at (path, dirfd, pathname))
- return -1;
- return mknod32 (path, mode, dev);
-}
-
-extern "C" ssize_t
-readlinkat (int dirfd, const char *pathname, char *buf, size_t bufsize)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *path = tp.c_get ();
- if (gen_full_path_at (path, dirfd, pathname))
- return -1;
- return readlink (path, buf, bufsize);
-}
-
-extern "C" int
-renameat (int olddirfd, const char *oldpathname,
- int newdirfd, const char *newpathname)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *oldpath = tp.c_get ();
- if (gen_full_path_at (oldpath, olddirfd, oldpathname))
- return -1;
- char *newpath = tp.c_get ();
- if (gen_full_path_at (newpath, newdirfd, newpathname))
- return -1;
- return rename (oldpath, newpath);
-}
-
-extern "C" int
-symlinkat (const char *oldpath, int newdirfd, const char *newpathname)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *newpath = tp.c_get ();
- if (gen_full_path_at (newpath, newdirfd, newpathname))
- return -1;
- return symlink (oldpath, newpath);
-}
-
-extern "C" int
-unlinkat (int dirfd, const char *pathname, int flags)
-{
- tmp_pathbuf tp;
- myfault efault;
- if (efault.faulted (EFAULT))
- return -1;
- char *path = tp.c_get ();
- if (gen_full_path_at (path, dirfd, pathname))
- return -1;
- return (flags & AT_REMOVEDIR) ? rmdir (path) : unlink (path);
-}
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
deleted file mode 100644
index 0107cdab228..00000000000
--- a/winsup/mingw/ChangeLog
+++ /dev/null
@@ -1,3903 +0,0 @@
-2008-07-29 Keith Marshall <keithmarshall@users.sourceforge.net>
-
- Replace __mingw_snprintf() with new generic family implementation;
- likewise, replace __mingw_vsnprintf().
-
- * mingwex/stdio/pformat.c mingwex/stdio/pformat.h: New files.
- * mingwex/stdio/snprintf.c mingwex/stdio/vsnprintf.c: New files.
- * mingwex/Makefile.in (STDIO_DISTFILES): Add them.
- (GDTOA_DISTFILES): Remove mingw_snprintf.c
- (STDIO_OBJS): Add pformat.o, snprintf.o and vsnprintf.o
- (GDTOA_OBJS): Remove mingw_snprintf.o
- (PFORMAT_CFLAGS): New macro; define it, as required by...
- (pformat.o): ...this new explicit build target.
- (snprintf.o, vsnprintf.o): Declare prerequisites.
-
- * mingwex/gdtoa/mingw_snprintf.c: Redundant file; delete it.
-
-2008-07-28 Keith Marshall <keithmarshall@users.sourceforge.net>
-
- Lay foundations for new printf() function family implementation.
-
- * ofmt_stub.s: New file; implement forward compatibility stub for...
- (_get_output_format): ...this MSVCR80.DLL and later function.
-
- * Makefile.in (SRCDIST_FILES): Add ofmt_stub.s.
- (NM, OBJCOPY): New macros; define them with AC_SUBSTed values.
- (sym_prefix, NM_LOOKUP, MINGW_REPL_FUNCS): New macros; define them.
- (lib%.a): Include ofmt_stub.o when import library does not already
- advertise availability of the _get_output_format() function;
- Add alias stubs for MINGW_REPL_FUNCS, such that...
- (__msvcrt_printf): ...is an alias for Microsoft's printf().
- (__msvcrt_fprintf): ...is an alias for Microsoft's fprintf().
- (__msvcrt_sprintf): ...is an alias for Microsoft's sprintf().
- (__msvcrt_vprintf): ...is an alias for Microsoft's vprintf().
- (__msvcrt_vfprintf): ...is an alias for Microsoft's vfprintf().
- (__msvcrt_vsprintf): ...is an alias for Microsoft's vsprintf().
- (clean): Add msvcr*.def.
-
- * configure.in (NM, OBJCOPY): Use AC_CHECK_TOOL to specify them.
- * configure: Regenerated.
-
-2008-07-06 Gregory McGarry <gregorymcgarry@users.sourceforge.net>
-
- * include/ctype.h (_imp____mb_cur_max): Correct spelling.
- (_imp____mb_cur_max_dll): Likewise.
-
-2008-07-04 Danny Smith <dannysmith@users,sourceforge.net>
-
- * include/stdio.h (swprintf, vswprintf): Guard with #ifndef __STRICT_ANSI__
- * include/wchar.h (swprintf, vswprintf): Likewise.
-
-2008-07-01 Keith Marshall <keithmarshall@users.sourceforge.net>
-
- * msvcrt.def.in [__msvcr80__, __msvcr80d__, __msvcr90__, __msvcr90d__]
- (_get_output_format, _set_output_format): Add references.
-
- * include/stdio.h [__MSVCRT_VERSION__ >= 0x800]
- (_get_output_format, _set_output_format): Declare prototypes.
- (_TWO_DIGIT_EXPONENT): Define.
- Some other minor formatting adjustments.
-
-2008-06-14 Danny Smith <dannysmith@users.sourceforge.net>
-
- [mingw-Bugs-1801641]
- * include/wchar.h (_wfdopen): Const-ify second arg.
- * include/stdio.h (_wfdopen): Likewise.
- Thanks to <tdragon at users dot sourceforge net>
-
-2008-06-02 Keith Marshall <keithmarshall@users.sourceforge.net>
-
- Avoid precision errors in round(), lround() and llround() functions.
-
- * mingwex/math/round_generic.c: New file; it replaces...
- * mingwex/math/round.c: ...this; delete it.
- * mingwex/math/roundf.c: ...and this; ditto.
- * mingwex/math/roundl.c: ...and this; ditto.
-
- * mingwex/math/lround_generic.c: New file; it replaces...
- * mingwex/math/lround.c: ...this; delete it.
- * mingwex/math/lroundf.c: ...and this; ditto.
- * mingwex/math/lroundl.c: ...and this; ditto.
- * mingwex/math/llround.c: ...and this; ditto.
- * mingwex/math/llroundf.c: ...and this; ditto.
- * mingwex/math/llroundl.c: ...and this; ditto.
-
- * mingwex/math/round_internal.h: New file; it provides generic common
- code, which is shared by `round_generic.c' and `lround_generic.c'; the
- implementation is based on techniques suggested by Danny Smith and
- Greg Chicares.
-
- * mingwex/Makefile.in (MATH_DISTFILES): Remove `round.c', `roundf.c',
- `roundl.c', `lround.c', `lroundf.c', `lroundl.c', `llround.c',
- `llroundf.c' and `llroundl.c'; replace by `round_internal.h',
- `round_generic.c' and `lround_generic.c'.
- (MATH_OBJS): Factor out files listed in...
- (MATH_ROUND_OBJS, MATH_LROUND_OBJS, MATH_LLROUND_OBJS): ...these new
- macros; define them; specify dependencies and build rules; add to...
- (LIB_OBJS): ...this list.
-
-2008-05-22 Danny Smith <dannysmith@users.sourceforge.net>
-
- [ mingw-Bugs-1961893 ]
- * mingwex/gdtoa/mingw_snprint.c (x_sprintf): Always set __ldtoa
- mode to 2 for E format.
-
-2008-05-15 Ramiro Polla <ramiro@lisha.ufsc.br>
-
- * include/stdlib.h: Fix strtod under C++.
-
-2008-05-06 Ramiro Polla <ramiro@lisha.ufsc.br>
-
- * mingwex/gdtoa/strtodnrp.c: Remove alias from strtod to __strtod.
- * include/stdlib.h: Define strtod to __strtod when __NO_ISOCEXT is not set.
-
-2008-05-04 Ramiro Polla <ramiro@lisha.ufsc.br>
-
- * include/sys/types.h (useconds_t): typedef.
- * include/unistd.h (usleep): Add prototype.
- * mingwex/usleep.c: New file.
- * mingwex/makefile.in: Add usleep source and object.
-
-2008-05-02 Ramiro Polla <ramiro@lisha.ufsc.br>
-
- Make strtod() conform to C99.
-
- * include/stdlib.h (strtod): Declare this mingwex function, and...
- (_strtod): rename this MSVCRT counterpart.
-
- * mingwex/gdtoa/strtodnrp.c (strtod): Alias to __strtod.
-
-2008-04-26 Chuck Wilson <cwilso11@users.sourceforge.net>
-
- * Makefile.in: correct issues with mingw10.dll having multiple relocs.
-
-2008-04-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/process.h: Include stdint.h for intptr_t definition.
- (_execl, _execle, _execlp, _execlpe, _execv, _execve, _execvp, _execvpe,
- _spawnl, _spawnle, _spawnlp, _spawnlpe, _spawnv, _spawnve, _spawnvp,
- _spawnvpe): Return intptr_t.
- (execl, execle, execlp, execlpe, execv, execve, execvp, execvpe, spawnl,
- spawnle, spawnlp, spawnlpe, spawnv, spawnve, spawnvp, spawnvpe): Return
- intptr_t.
- * include/wchar.h: Guard wide process.h functions with !__STRICT_ANSI__.
-
- [!_WPROCESS_DEFINED]: Include stdint.h for intptr_t definition.
- (_wexecl, _wexecle, _wexeclp, _wexeclpe, _wexecv, _wexecve, _wexecvp,
- _wexecvpe, _wspawnl, _wspawnle, _wspawnlp, _wspawnlpe, _wspawnv, _wspawnve,
- _wspawnvp, _wspawnvpe): Return intptr_t.
-
-2008-04-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/wchar.h (fwide): Return success code rather than failure in inline
- definition.
- * mingwex/fwide.c (fwide): ANSI-fy. Get rid of Q8 comments. Return success
- code rather than failure.
-
-2008-03-21 Danny Smith
-
- * include/math.h (float_t, double_t): Define.
-
-2008-02-08 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/gdtoa/gdtoaimp.h (USE_LOCALE): Define.
- * mingwex/gdtoa/mingw_snprintf.c: [USE_LOCALE] Include locale.h.
- (x_sprintf): [USE_LOCALE] Use *localeconv()->decimal_point.
-
-2008-02-28 Joseph Myers <joseph@codesourcery.com>
-
- * include/complex.h: Don't condition contents on C99 or not
- __STRICT_ANSI__.
-
-2008-02-01 Brian Dessent <brian@dessent.net>
-
- * Makefile.in: Add rules to generate multiple versions of libmoldname.a for
- the different runtime versions.
-
-2008-01-19 Danny Smith <dannysmithusers.sourceforge.net
-
- * inclue/wchar.h (fwide): Add prototype and guard inline definition.
- (mbsinit): Likewise.
-
-2007-12-27 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * include/_mingw.h: Increment version to 3.14.
-
-2007-11-26 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * Makefile.in: Add libmsvcr90.a and libmsvcr90d.a targets.
- * msvcrt.def.in: Add support for __msvcr90__ and __msvcr90d__ defines.
- * mingwex/math/log10f.S: Correct issue with comments.
- * mingwex/math/log10l.S: Ditto.
- * mingwex/math/log1p.S: Ditto.
- * mingwex/math/log1pf.S: Ditto.
- * mingwex/math/log1pl.S: Ditto.
- * mingwex/math/log2.S: Ditto.
- * mingwex/math/log2f.S: Ditto.
- * mingwex/math/log2l.S: Ditto.
- * mingwex/math/logf.S: Ditto.
- * mingwex/math/logl.S: Ditto.
-
-2007-10-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/gdtoa/mingw_snprintf.c: fixed warning during compile.
-
-2007-10-03 Bernd Becker <hugin@users.sourceforge.net>
-
- * include/io.h (__finddata64_t, __wfinddata64_t): changed member 'size'
- from '_fsize_t' to '__int64' to be consistent with the other ...64
- structures and the value set there is 8 bytes not 4. Add guard for both
- as the are only used by functions available from 6.1 on.
-
- * include/malloc.h (_HEAP_MAXREQ): Define.
- (_aligned_offset_recalloc): Define.
- (_aligned_recalloc()): Define.
-
- * include/math.h: fixed a typo in a comment.
- (atanhf): Fixed declaration.
-
- * include/wchar.h (__wfinddata64_t): changed member 'size' from '_fsize_t'
- to '__int64' to be consistent with the other ...64 structures and the value
- set there is 8 bytes not 4. Added guard as this function is only used by
- functions available from 6.1 on.
-
- * include/sys/stat.h: some members of 'stat' were declared with types with
- a prefixed underscore, while the ones without the underscore should have
- been used. Added guard to '__stat64' as it is only used by functions
- available from 6.1 on. Added the wide character versions of the
- exec()/spawn() family for completion
- (_stati64): changed the type of the 'st_mode' member from 'unsigned int' to
- '_mode_t'
-
- * include/sys/timeb.h (timeb, _timb): changed the type of the 'time' member
- from 'long' to 'time_t'
- (__timeb64): moved declaration of structure directly before the declaration
- of the function '_ftime64()', so it is guarded as well
-
- * include/sys/utime.h (__utimbuf64): moved declaration of structure directly
- before the declaration of the functions using it, so it is guarded as well
-
-2007-09-24 David C. Daeschler <daveregs@rsaisp.com>
-
- * mingwex/gdtoa/mingw_snprintf.c (x_sprintf): Correct LEN_L typo in 'l'
- case. Add missing break in 's'/LEN_S case.
-
-2007-08-25 Keith Marshall <keithmarshall@users.sourceforge.net>
-
- Make snprintf() and vsnprintf() conform to C99.
-
- * include/stdio.h: Add note about incompatibility between...
- (snprintf, vsnprintf): These two mingwex functions, and...
- (_snprintf, _vsnprintf): these MSVCRT counterparts.
-
- * mingwex/Makefile.in (STDIO_OBJS): Remove snprintf.o and vsnprintf.o
- (STDIO_DISTFILES): Remove snprintf.c and vsnprintf.c
-
- * mingwex/stdio/snprintf.c: Delete.
- * mingwex/stdio/vsnprintf.c: Delete.
-
- * mingwex/gdtoa/mingw_snprintf.c (snprintf): Alias to __mingw_snprintf
- (vsnprintf): Alias to __mingw_vsnprintf.
-
-2007-07-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * include/_mingw.h: Increment version to 3.13.
- * Makefile.in: Reset CYGRELEASE to 1
-
-2007-07-23 Keith Marshall <keithmarshall@users.sourceforge.net>
-
- * Makefile.in (SUBDIRS): Delete stray line continuation artifact,
- resulting from incomplete removal of enclosing `for ...; do ...; done'
- loop from compound command; (reported by Greg Chicares).
-
-2007-07-19 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/fcntl.h (_O_WTEXT, _O_U16TEXT, _O_U8TEXT) Define for
- Vista.
-
-2007-07-12 Danny Smith <dannysmith@users.sourceforge.net>
-
- [mingw-Bugs-1734142]
- * include/wchar.h (_wsystem) Declare.
- (_wputenv) Declare.
- (_wgetenv): Declare.
- (_wsearchenv): Declare.
- (_wmakepath): Declare.
- (_wsplitpath): Declare.
- (_wfullpath): Declare.
- * include/stdlib.h (_wsystem) Declare.
- (_wputenv, _wgetenv, _wsearchenv, _wmakepath, _wsplitpath,
- _wfullpath): Move into _WSTDLIB_DEFINED guard.
- * include/tchar.h (_tsystem): New UNICODE mapping define.
-
-2007-06-29 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/gdtoa/mingw_snprintf.c: New file.
- * mingwex/Makefile.in (GDTOA_DISTFILES): Add mingw_snprintf.c.
- (GDTOA_OBJS): Add mingw_snprintf.o.
-
-2007-06-28 Danny Smith <dannysmith@users.sourceforge.net>
-
- * msvcrt.def.in: Update comment.
- Exclude _ctype stub if using msvcr71.dll or newer.
- * include/ctype.h: Don't declare _ctype if using msvcr71.dll or newer.
- * include/wctype.h: Likewise.
-
-2007-06-23 Danny Smith <dannysmith@users.sourceforge.net>
-
- *include/wctype.h: Qualify all functions with __MINGW_NOTHROW.
- *include/dirent.h: Likewise.
-
-2007-06-23 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/assert.h: Qualify all functions with __MINGW_NOTHROW.
- * include/conio.h: Likewise.
- * include/ctype.h: Likewise.
- * include/direct.h: Likewise.
- * include/dos.h: Likewise.
- * include/errno.h: Likewise.
- * include/fenv.h: Likewise.
- * include/float.h: Likewise.
- * include/inttypes.h: Likewise.
- * include/io.h: Likewise.
- * include/libgen.h: Likewise.
- * include/locale.h: Likewise.
- * include/malloc.h: Likewise.
- * include/mbctype.h: Likewise.
- * include/mbstring.h: Likewise.
- * include/process.h: Likewise.
- * include/search.h: Likewise.
- * include/setjmp.h: Likewise.
- * include/signal.h: Likewise.
- * include/stdio.h: Likewise.
- * include/stdlib.h: Likewise.
- * include/string.h: Likewise.
- * include/time.h: Likewise.
- * include/wchar.h: Likewise.
- * include/sys/stat.h: Likewise.
- * include/sys/time.h: Likewise.
- * include/sys/timeb.h: Likewise.
- * include/sys/utime.h: Likewise.
-
-2007-06-22 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/Makefile.in (LIB_OBJS): Revert accidental removal.
-
-2007-06-22 Danny Smith <dannysmith@users.sourceforge.net>
-
- Add POSIX binary tree search API.
-
- * mingwex/tfind.c: New file.
- * mingwex/tdelete.c: New file.
- * mingwex/tsearch.c: New file.
- * mingwex/twalk.c: New file.
- * mingwex/Makefile.in (DISTFILES): Add tsearch.c twalk.c tdelete.c tfind.c.
- * mingwex/Makefile.in (POSIX_OBJS): Add tsearch.o twalk.o tdelete.o tfind.o.
- * include/search.h (tfind): Declare.
- (tdelete): Declare.
- (tsearch): Declare.
- (twalk): Declare.
- (ENTRY): Define.
- (ACTION): Define.
- (VISIT): Define.
- (node_t): Define, on condition of _SEARCH_PRIVATE.
-
-2007-06-22 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (__MINGW_NOTHROW): Define.
-
-2007-06-18 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h (vsnprintf): Remove inline definition.
- Add prototype.
-
-2007-06-16 Danny Smith <dannysmith@users.sourceforge.net>
-
- * CRTfmode.c: Nit-pick comment fix.
-
-2007-06-16 Christopher Faylor <me+cygwin@cgf.cx>
-
- * CRTfmode.c: Fix nested comment.
-
-2007-06-16 Christopher Faylor <me+cygwin@cgf.cx>
-
- * include/string.h (strcasecmp): Fix typo in declaration prototype.
-
-2007-06-14 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/io.h (lseek64) : Add prototype.
-
-2007-06-14 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/string.h (strcasecmp): Add prototype.
- (strncasecmp): Add prototype.
-
-2007-06-13 Danny Smith <dannysmith@users.sourceforge.net>
-
- * Makefile.in (CRT0S): Revert last change.
- * CRTfmode.c. Correct comment.
-
-2007-06-13 Danny Smith <dannysmith@users.sourceforge.net>
-
- * Makefile.in (CRT0S): Add back CRTfmode.o.
-
-2007-06-13 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdlib.h: Don't include stdint.h. Conditionally define intptr_t.
- * include/io.h: Likewise.
-
-2007-06-11 Danny Smith <dannysmith@users.sourceforge.net>
-
- * crt1.c (__mingw_CRTStartup): Add explicit call to gcc's __main.
-
-2007-05-08 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdint.h (intptr_t): Fix typo.
- Thanks to Charles Wilson for report.
-
-2007-05-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdint.h (intptr_t): Protect with _INTPTR_T_DEFINED.
- Condition on _WIN64.
- (uintptr_t): Protect with _UINTPTR_T_DEFINED. Condition on _WIN64.
- (INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX): Condition on _WIN64.
- (PTRDIFF_MIN): Define as INTPTR_MIN.
- (PTRDIFF_MAX): Define as INTPTR_MAX.
- (SIG_ATOMIC_MIN): Define as INTPTR_MIN.
- (SIG_ATOMIC_MAX): Define as INTPTR_MAX.
-
-2007-04-07 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * Makefile.in: Removed mansuffix variable. Changed mansection to support
- Cygwin man page location.
-
-2007-04-05 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * Makefile.in: Added mansection and mansuffix variables. Changed mandir to
- support Cygwin man page location.
-
-2007-03-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * Include/_mingw.h: Increment version to 3.12.
-
-2007-03-22 Brian Ripley <ripleybd@users.sourceforge.net>
-
- * include/_mingw.h (__CRT_INLINE): Make conditional on __GNUC_STDC_INLINE__.
-
-2007-03-20 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * Makefile.in: Tweak srcdist to fix build issue.
-
-2007-03-20 Keith Marshall <keithmarshall@users.sourceforge.net>
-
- Add --enable-mingw-manpage-transform configure option.
-
- * aclocal.m4 (MINGW_AC_MANPAGE_TRANSFORM): New macro.
- * configure.in, Makefile.in: Use it.
- * configure: Regenerated.
-
-2007-03-18 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (__CRT_INLINE): Use __gnu_inline__ for gcc 4.2.x too.
-
-2007-03-10 Keith Marshall <keithmarshall@users.sourceforge.net>
-
- Add manpages for dirname and basename functions.
-
- * man: New directory.
- * man/dirname.man: New file; it sources both manpages.
- * Makefile.in: Add provisional rules to distribute them.
-
-2007-03-08 Keith Marshall <keithmarshall@users.sourceforge.net>
-
- * mingwex/basename.c: Make it work with path names containing
- multibyte character strings.
- * mingwex/dirname.c: Likewise.
-
-2007-03-05 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/io.h (__mingw_access): New static inline wrapper to restore
- pre-Vista 'access (fname, X_OK)' behaviour.
- (__USE_MINGW_ACCESS): Use to map access() to __mingw_access().
-
-2007-03-05 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/fesetround.c (fesetround): Use unsigned int as operand
- to stmxcsr.
- Thanks to Alexey Kuznetsov <ring0_mipt at users dot sf dot net>
-
-2007-02-27 Thorsten Dahlheimer <tdahlheim@gmx.net>
-
- * include/stdio.h (_unlink, unlink): Add prototypes.
-
-2007-02-18 Aurimas Cernius <aurisc4@gmail.com>
-
- * include/excpt.h: Replace "_try1" in comments with "__try1".
-
-2007-02-15 Danny Smith <dannysmith@users.sourceforge.net>
-
- * Makefile.in (ALL_CFLAGS): Put W32API_INCLUDE after INCLUDES.
- (ALL_CXXFLAGS): Likewise.
- * mingwex/Makefile.in (ALL_CFLAGS): Put W32API_INCLUDE after INCLUDES.
- (ALL_CXXFLAGS): Likewise.
- * profile/Makefile.in (ALL_CFLAGS): Put W32API_INCLUDE after INCLUDES.
- (ALL_CXXFLAGS): Likewise.
-
-2007-02-08 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/io.h (X_OK): Revert 2007-01-24 change, but leave comment.
-
-2007-01-27 Danny Smith <dannysmith@users.sourceforge.net>
-
- Expose some more msvcr80.dll functions.
- * include/stdio.h (_fseek_nolock. _ftell_nolock, _fseeki64,
- _ftelli64, _fseeki64_nolock, _ftelli64_nolock) Add prototypes
- * msvcrt.def.in (_fseek_nolock. _ftell_nolock, _fseeki64,
- _ftelli64, _fseeki64_nolock, _ftelli64_nolock) Add stubs.
-
-2007-01-26 Danny Smith <dannysmith@users.sourceforge.net>
-
- Expose some msvcr80.dll functions.
- * include/stdlib.h (_set_abort_behavior): Add prototype.
- (_WRITE_ABORT_MSG, _CALL_REPORTFAULT): Add defines for
- _set_abort_behavior mask argument.
- (_invalid_parameter_handler): Add typedef.
- (_set_invalid_parameter_handler): Add prototype.
- * include/stdio.h (_get_printf_count_output): Add prototype.
- (_set_printf_count_output): Add prototype.
- * msvcrt.def.in (_get_printf_count_output,_set_printf_count_output,
- _set_abort_behavior, _set_invalid_parameter_handler): Add stubs.
-
-2007-01-26 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (CRT_INLINE): Correct typo.
-
-2007-01-24 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/io.h (X_OK): Define to F_OK.
-
-2007-01-19 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h (SEEK_SET, SEEK_CUR, SEEK_END): Define
- unconditionally. Change comment.
- * include/unistd.h (SEEK_SET, SEEK_CUR, SEEK_END): Define
- here too.
- * include/io.h (rename): Declare.
- (remove): Declare.
-
-2006-12-31 Keith Marshall <keithmarshall@users.sourceforge.net>
-
- * include/libgen.h: New file; required by...
- * mingwex/basename.c, mingwex/dirname.c: New files.
- * mingwex/Makefile.in (DISTFILES): Add them...
- (POSIX_OBJS): ...with corresponding basename.o, dirname.o
- (Dependencies): Typo; s/Dependancies/Dependencies/
-
-2006-11-25 Keith Marshall <keithmarshall@users.sourceforge.net>
-
- * Makefile.in (VERSION): Let configure define it.
-
- * aclocal.m4 (MINGW_AC_CONFIG_SRCDIR): New macro.
- * configure.in: Use it.
- Correct quoting of autoconf macro arguments throughout.
- (AC_INIT, AC_OUTPUT): Update to autoconf 2.5x preferred syntax.
- (AR, AS, RANLIB, LD, DLLTOOL, DLLWRAP): Don't need AC_SUBST.
- (AC_ALLOCA): Invalid after GCC_NO_EXECUTABLES; removed.
- (AC_CONFIG_FILES): Add, to generate Makefile.
-
- * configure: Regenerated.
-
-2006-11-21 Danny Smith <dannysmith@users.sourceforge.net>
-
- * Makefile.in: Add aclocal.m4 to source release.
- * mingwex/Makefile.in: Ditto.
- * profile/Makefile.in: Ditto.
-
-2006-11-18 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * Include/_mingw.h: Increment version to 3.11.
- * Makefile.in: Ditto.
-
-2006-11-09 Danny Smith <dannysmith@users.sourceforge.net>
-
- [ mingw-Bugs-1590623 ]
- * include/_mingw.h (__CRT_INLINE): Use __gnu_inline__ attribute
- in C99 mode.
-
-2006-10-04 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in: Semi-revert semi-reversion of 2006-08-30 change, now
- correctly parenthesized.
-
-2006-09-19 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/mb_wc_common.h (get_codepage): Get it
- from __lc_codepage.
-
-2006-09-18 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/gdtoa/g_xfmt.c (g_xfmt): Fix representation of infinity.
- Use fpclassify.
- * mingwex/gdtoa/strtopx (__strtopx): Avoid cast of long double* to
- void*.
- * mingwex/gdtoa/gdtoa.h (__g_fmt): Make declaration consistent with
- others.
-
-2006-09-16 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/gdtoa/strtopx.c (strtopx): Fix long double representation
- of infinity.
-
-2006-09-11 Christopher Faylor <cgf@timesys.com>
-
- * Makefile.in: Semi-revert 2006-08-30 change.
-
-2006-09-10 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (__MINGW_ATTRIB_DEPRECATED): Define.
- (__MINGW_IMPORT): Ansify.
- * include/stdlib.h (_sleep, _beep, _seterrormode): Add
- __MINGW_ATTRIB_DEPRECATED.
-
-2006-09-10 Keith Marshall <keithmarshall@users.sourceforge.net>
-
- * aclocal.m4 (LIB_AC_PROG_CC, LIB_AC_PROG_CC_GNU, LIB_AC_PROG_CXX):
- Redundant macros; deleted.
-
- * configure.in (LIB_AC_PROG_CC): Replaced by...
- (AC_PROG_CC): ...this.
-
- * configure: Regenerated.
-
-2006-09-06 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/gdtoa/misc.c (pow5mult): Restore original code.
- * mingwex/gdtoa/gdtoa.h. Add comment that files have been modified.
- * mingwex/gdtoa/gdtoaimp.h: Include system headers with <> brackets.
-
-2006-09-01 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/gdtoa/(arithchk.c, dmisc.c, dtoa.c, g__fmt.c, g_dfmt.c,
- g_ffmt.c, g_xfmt.c, gd_arith.h, gd_qnan.h, gdtoa.c, gdtoa.h,
- gdtoaimp.h, gethex.c, gmisc.c, hd_init.c, hexnan.c, misc.c, qnan.c,
- README, smisc.c, strtodg.c, strtodnrp.c, strtof.c, strtopx.c, sum.c,
- ulp.c): New files.
- * mingwex/(strtof.c, strtold.c, ldtoa.c): Remove files.
- * mingwex/math/(cephes-emath.c, cephes-emath.h): Remove files.
- * mingwex/mb_wc_common.h (get_cp_from_locale); Rename to get_codepage().
- * mingwex/(btowc.c, wctob.c, mbrtowc.c, wcrtomb.c): Adjust call to get_codepage().
- * mingwex/wcstold.c: Avoid using strtold internals.
- * mingwex/wcstof.c: Rewrite.
- * mingwex/Makefile.in (GDTOA_DISTFILES): Add to distribution.
- (GDTOA_OBJS): Add to library.
- (DISTFILES): Remove strtof.c strtold.c ldtoa.c cephes-emath.c cephes-emath.h.
- (STDLIB_OBJS): Remove.
- (STDLIB_STUB_OBJS): Remove strtof.o wcstof,o.
- (Q8_OBJS): Add wcstof.o wcstold.o.
- * include/stdlib.h (strtof): Remove inline definition.
- (wcstof): Likewise.
- * include/wchar.h (wcstof): Remove inline definition.
-
-2006-08-30 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in: Add with_cross_host to allow more granular checks.
- Set installation directories accordingly. Override CC setting only
- if building a Cygwin target.
- * aclocal.m4: Regenerate.
- * configure.in: Move AC_CANONICAL_SYSTEM check up. Add
- GCC_NO_EXECUTABLES. Substitute with_cross_host in depending files.
- Test AC_ALLOCA only if building on a native system.
- * configure: Regenerate.
-
-2006-08-27 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * include/ctype.h: Fix typo.
-
-2006-08-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/ctype.h: Expose iswblank if __cplusplus.
- * include/wctype.h: Expose iswblank if __cplusplus.
-
-2006-08-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/ctype.h: Remove stray ')';
-
-2006-08-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/ctype.h (_BLANK): Expand comment.
- (isblank): Add prototype and inline definition.
- (iswblank): Add prototype and inline definition.
- * include/wctype.h (iswblank): Add prototype and inline definition.
- * mingwex/isblank.c: New file.
- * mingwex/iswblank.c: New file.
- * mingwex/Makefile.in: Add isblank, iswblank to libmingwex.a
-
-2006-07-06 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h (__INFF,__INFL): Remove '#'.
-
-2006-07-04 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/Makefile.in: Add -I$(srcdir)/.. to INCLUDES.
-
-2006-07-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- Support SSE float environment in fenv.h functions.
- * cpu_features.c: New file.
- * cpu_features.h: New file.
- * crt1.c: Include "cpu_features.h".
- (__mingw_CRTStartup): Call cpu_features_init().
- * Makefile.in (MING_OBJS): Add cpu_features.c.
- (SRCDIST_FILES): Add cpu_features.c, cpu_features.h.
- * include/fenv,h ( fenv_t;): Append __mxcsr field.
- (__MXCSR_EXCEPT_FLAG_SHIFT): New define.
- (__MXCSR_EXCEPT_MASK_SHIFT): New define.
- (__MXCSR_ROUND_FLAG_SHIFT): New define.
- * mingwex/feclearexcept.c: Include "cpu_features.h".
- Handle SSE environment.
- * mingwex/fegetenv.c: Likewise.
- * mingwex/feholdexcept.c: Likewise.
- * mingwex/fesetenv.c: Likewise.
- * mingwex/fesetexceptflag.c: Likewise.
- * mingwex/fesetround.c: Likewise.
- * mingwex/fetestexcept.c: Likewise.
- * mingwex/feupdateenv.c: Likewise.
- * mingwex/fegetround.c: Add comment.
-
-2006-06-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * Include/_mingw.h: Increment version to 3.10.
- * Makefile.in: Ditto.
-
-2006-06-26 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/tgamma.c (SQTPI): Add braces.
-
-2006-06-26 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/wcrtomb.c (wcsrtombs): Fix src end-pointer thinko.
- * mingwex/math/lgamma.c: (LOGPI) Avoid type punning.
- (LS2PI): Likewise.
- * mingwex/math/sf_erf.c (erff): Initialize z.
- (erfcf): Likewise.
- * mingwex/math/tgamma.c (SQTPI): Avoid type punning.
-
-2006-06-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * Include/_mingw.h: Increment version to 3.10.
- * Makefile.in: Ditto.
-
-2006-06-23 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/sys/time.h (struct timezone): Define.
- * include/time.h: Correct comment about timezone.
-
-2006-06-18 Danny Smith <dannysmith@users.sourceforge.net>
-
- * configure.in (AC_CONFIG_AUX_DIR): Remove.
- * configure: Regenerate.
-
-2006-06-18 Chris Sutcliffe <ir0n3h4d@users.sourceforge.net>
-
- * configure: add srcdir as a possible location for install-sh.
-
-2006-06-18 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/dirent.c (_tGetFileAttributes): New helper function.
- (_topendir): Use it.
-
-2006-06-18 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/sys/time.h: Add header guard. Add extern "C" bracketing
- for __cplusplus.
- (gettimeofday): Add prototype.
- * mingwex/gettimeofday.c: New file.
- * mingwex/makefile.in: Add gettimeofday source and object.
-
-2006-06-13 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h (HUGE_VAL): Define as builtin if __GNUC__ >= 3.3,
- else global library variable.
- (HUGEVALF): Likewise.
- (HUGEVALL): Likewise.
- (INFINITY): Likewise.
- (NAN): LiKewise.
-
-2006-06-13 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/wcrtomb.c (wcrtomb_cp): Correct typo.
-
-2006-06-13 Danny Smith <dannysmith@users.sourceforge.net>
-
- * Makefile.in (SUBDIRS): Change to lowercase for autoconf 2.59.
-
-2006-05-24 Christopher Faylor <cgf@timesys.com>
-
- * configure.in: Update to newer autoconf.
- (thanks to Steve Ellcey)
- * mingwex/configure.in: Ditto.
- * profile/configure.in: Ditto.
- * configure: Regenerate.
- * mingwex/configure: Ditto.
- * profile/configure: Ditto.
- * aclocal.m4: New file.
- * mingwex/aclocal.m4: Ditto.
- * profile/aclocal.m4: Ditto.
-
-2006-05-17 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/wcrtomb.c (wcrtomb_cp): Test (wc > 255) only if C locale.
- Use supplied codepage as arg to WideCharToMultiByte.
-
-2006-02-13 Earnie Boyd <earnie@users.sf.net>
-
- * Makefile.in (libmsvcr80.a): Add import lib.
- (libmsvcr80d.a): Ditto.
-
-2006-01-18 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * Makefile.in: Bump cygwin build number.
-
-2005-10-27 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * Include/_mingw.h: Increment version to 3.9.
- * Makefile.in: Ditto.
-
-2005-10-14 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/limits.h (SSIZE_MAX): Define.
- (LLONG_MAX, LLONG_MIN, ULLONG_MAX): Separate from non-ISO names.
-
-2005-10-13 Wu Yongwei <adah@users.sourceforge.net>
-
- * include/tchar.h: Include <wchar.h> when _UNICODE is defined.
- (_TEOF): New macro definition for _UNICODE and non_UNICODE cases.
-
-2005-10-12 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stddef.h: Remove.
- * include/stdarg.h: Remove.
-
-2005-10-12 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/complex/csqrt.c (csqrt): The sign of real part
- of result is positive when real part of arg == 0;
- * mingwex/complex/csqrtf.c (csqrtf): Ditto.
- * mingwex/complex/csqrtl.c (csqrtl): Ditto.
-
-2005-10-12 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/time.h (_time64): Correct prototype.
-
-2005-10-08 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/fegetenv.c (fegetenv): Restore exception masks.
- * mingwex/feholdexcept.c (feholdexcept): Don't set exceptions
- to non-stop. Use "fnclex" to clear exception flags.
-
-2005-09-24 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h (HUGE_VALF, HUGE_VALL, INFINITY, NAN)
- Avoid raising FP exceptions.
-
-2005-09-19 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdlib.h (strtof): Add prototype. Uglify
- parameter names in inline definition.
- (wcstof): Likewise.
- (_Exit): Uglify parameter names in inline definition.
- (llabs): Add prototype.
- (_set_error_mode): Add prototype and input defines.
-
-2005-08-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/fe*.c: Revert previous changes.
- * include/fenv.h: Revert previous changes.
-
-2005-08-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/feclearexcept.c (feclearexcept): Change declaration.
- Do not return a value.
- * mingwex/fegetexceptflag.c (fegetexceptflag): Likewise.
- * mingwex/feraiseexcept.c (feraiseexcept): Likewise.
- * mingwex/fesetexceptflag.c (fesetexceptflag): Likewise.
- * mingwex/fegetenv.c (fegetenv): Likewise.
- * mingwex/fesetenv.c (fesetenv): Likewise.
- * mingwex/feupdateenv.c (feupdateenv): Likewise.
- * include/fenv.h (feclearexcept, fegetexceptflag, feraiseexcept,
- fesetexceptflag, fegetenv, fesetenv, feupdateenv): Correct
- prototypes.
-
-2005-08-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/stdio/fseeko64.c (fseeko64): Flush stream before
- getting filelength for SEEK_END.
-
-2005-08-13 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
-
- * Include/_mingw.h: Increment version to 3.8.
- * Makefile.in: Ditto.
-
-2005-08-10 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/wctype.h (towupper, towlower): Change arg and return value
- types to wint_t.
- * include/ctype.h (towupper, towlower): Likewise.
-
-2005-08-10 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mthr_stub.c (__mingwthr_key_dtor): Replace assert(0) with
- a diagnostic, guarded by #ifdef DEBUG.
- (__mingwthr_remove_key_dtor): Likewise.
-
-2005-08-08 Danny Smith <dannysmith@users.sourceforge.net>
-
- * moldname.def.in (sleep, beep, seterrormode): Remove.
-
-2005-06-16 Danny Smith <dannysmith@users.sourceforge.net>
-
- * profile/profile.h (_MCOUNT_CALL): Define as regparm(2)
- (_MCOUNT_DECL): Use it.
- (MCOUNT): Save and restore eax, ecx, edx registers.
- * profile/mcount.c (_mcount): ANSI-fy.
-
-2005-06-16 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (__MINGW_GNUC_PREREQ): Define. Use to
- guard __MINGW_ATTRIB macro definitions.
- * include/math.h (logb[fl]): Don't define inlines for
- GCC-4.0+ && __FAST_MATH__.
- (rint[fl], lrint[fl], llrint[fl]); Likewise. Clean up
- line-continuation backslashes.
-
-2005-06-06 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (__MINGW_ATTRIBUTE_NONNULL): Fix typo
- in GNUC version guard.
-
-2005-05-20 Danny Smith <dannysmith@users.sourceforge.net>
-
- * crt1.c (_gnu_exception_handler): Handle illegal instruction
- OS exception as a signal if user has defined a SIGILL handler.
-
-2005-05-10 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/nexttoward.c: New file.
- * mingwex/math/nexttowardf.c: New file.
- * mingwex/math/nextafterl.c: Add nexttowardl alias.
- * mingwex/Makefile.in (MATH_DISTFILES): Add nexttoward.c,
- mexttowardf.c,
- (MATH_OBJS): Add nexttoward.o, nexttowardf.o,
- * include/math.h (nexttoward, nextowardf, nexttowardl): Add
- prototypes.
-
-2005-05-09 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/nextafterf.c (nextafterf): Correct
- handling of -0.0.
- * mingwex/math/nextafterl.c: New file.
- * mingwex/Makefile.in (MATH_DISTFILES): Add nextafterl.c.
- (MATH_OBJS): Add nextafterl.o.
- * include/math.h (nextafterl): Uncomment prototype.
-
-2005-05-08 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/erfl.c: New file.
- * mingwex/Makefile.in (MATH_DISTFILES): Add erfl.c.
- (MATH_OBJS): Add erfl.o.
- * include/math.h (erfl, erfcl): Uncomment prototypes.
-
-2005-05-04 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/wchar.h (WCHAR_MAX): Define as 0xffff, so preprocessor
- #if (WCHAR_MAX <= WCHAR_MIN) is false.
- * include/stdint.h (WCHAR_MAX): Likwise.
- (WINT_MAX): Likewise.
-
-2005-05-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/signbit.c (__signbit): Make return value
- consistent with GCC's __builtin_signbit.
- * mingwex/math/signbitf.c (__signbitf): Likewise.
- * mingwex/math/signbitf.c (__signbitl): Likewise.
- * include/math.h (__signbit, __signbitf, __signbitl): Likewise
- for inlines.
-
-2005-05-02 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (__MINGW_ATTRIB_NONNULL): Don't define as
- variadic macro.
- * mingwex/mbrtowc.c (__mbrtowc_cp): Use __MINGW_ATTRIB_NONNULL.
- Remove unused MBTOWC_FLAGS define.
-
-2005-04-23 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/mbrtowc.c: New file.
- * mingwex/wcrtomb.c: New file.
- * mingwex/btowc.c: New file.
- * mingwex/wctob.c: New file.
- * mingwex/mb_wc_common.h: New file.
- * mingwex/Makefile.in (DISTFILES): Add new files.
- (Q8_OBJS): Add new objects.
- * include/wchar.h: Adjust comment about mbrtowc() and related
- funcions. Add __restrict__ to pointer params in prototypes.
- (wmemset. wmemchr, wmemcpy, wmemmove, wcstoll, wcstoull): Remove
- arg names from protototypes.
-
-2005-04-23 Wu Yongwei <adah@sh163.net>
-
- * mingwex/dirent.c: Formatting changes.
- * mingwex/dirent.c (_topendir): Make the end-of-path slash check
- MBCS-safe.
-
-2005-03-31 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (__MINGW_ATTRIB_NONNULL): Define.
-
-2005-03-24 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h (__mingw_fwrite): Change return value to
- size_t.
- * mingwex/mingw-fseek.c (__mingw_fwrite): Likewise.
-
-2005-03-15 Hans Leidekker <hans@it.vu.nl>
-
- * include/malloc.h (_FREEENTRY, _USEDENTRY): Correct defines.
-
-2005-02-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/wctype.h (wctrans): Remove _CRTIMP.
- (towctrans): Likewise.
- (wctype): Likewise,
-
-2005-02-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/wctype.h: Add comment on wctrans, towctrans, wctype.
-
-2005-02-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/wctype.c: New file.
- * mingwex/wctrans.c: New file.
- * mingwex/Makefile.in (DISTFILES): Add wctype.c, wctrans.c.
- * mingwex/Makefile.in (Q8_OBJS): Add wctype.o, wctrans.o.
-
-2005-02-11 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/tchar.h (_tstat64, _tstati64): Add Unicode/ANSI mappings.
-
-2005-02-11 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/assert.h: Remove header guard. #undef assert macro.
- (_assert): Use __MINGW_ATTRIB_NORETURN define.
-
-2005-02-11 Gregory W. Chicares <chicares@cox.net>
- Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h (expm1, expm1f, expmll): Add prototypes.
- * mingwex/Makefile.in (MATH_DISTFILES): Add expm1.c,
- expm1f.c, expm1l.c.
- (MATH_OBJS): Add expm1.o, expm1f.o, expm1l.o.
- * mingwex/math/expm1.c: New file.
- * mingwex/math/expm1f.c: New file.
- * mingwex/math/expm1l.c: New file.
-
-2005-02-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/sys/stat.h (struct stat): Guard with _NO_OLDNAMES.
- * include/wchar.h (struct stat): Likwwise.
- Bug reported to Debian by Anand Kumria <wildfire@progsoc.org>
-
- * include/sys/stat.h: Remove empty __STRICT_ANSI__ guard.
-
-2005-02-01 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/strtold.c (__asctoe64): Set endptr to 'e' if exponent
- string is not valid.
-
-2005-01-26 Oliver Stoeneberg <oliverst@online.de>
-
- * include/malloc.h: Add missing return code defines for
- _heapwalk()
-
-2005-01-17 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/sys/stat.h (struct __stat64): Change st_size type to
- __int64.
- * include/wchar.h (struct __stat64): Change st_size type to __int64.
-
-2005-01-13 Earnie Boyd <earnie@users.sf.net>
-
- * include/sys/stat.h (_S_IFLNK, S_IFLNK, _S_ISLNK, S_ISLNK, _lstat,
- lstat): Remove.
- * include/errno.h (ELOOP): Ditto.
- * include/_mingw.h: Increment version to 3.7.
- * Makefile.in: Ditto.
-
-2005-01-11 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/tchar.h (_tfreopen): Add UNICODE mappings.
-
-2005-01-11 Earnie Boyd <earnie@users.sf.net>
-
- * include/sys/stat.h (_S_IFLNK, S_IFLNK, _S_ISLNK, S_ISLNK, _lstat,
- lstat): Conditionalize defines for __STRICT_ANSI__.
-
-2005-01-10 Earnie Boyd <earnie@users.sf.net>
-
- * include/errno.h (ELOOP): Add definition.
-
-2005-01-10 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/complex/(cabsl.c cacosl.c cacoshl.c cargl.c casinl.c
- casinhl.c catanl.c catanhl.c ccosl.c ccoshl.c cexpl.c cimagl.c
- clogl.c cpowl.c cprojl.c creall.c csinl.c csinhl.c csqrtl.c
- ctanl.c ctanhl.c): New files.
- * mingwex/Makefile.in (COMPLEX_DISTFILES): Adjust.
- (COMPLEX_OBJS): Adjust.
- * include/complex.h (cabsl, cacosl, cacoshl, cargl, casinf.
- casinhl, catanl, catanhl, ccosl, ccoshl, cexpl, cimagl, clogl,
- cpowl, cprojl, creall, csinl, csinhl, csqrtl, ctanl, ctanhl):
- Declare.
-
-2005-01-06 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (__int16): Define as short.
- Thanks to: Leo Yuriev <leoyuriev at users dot sf dot net>
-
-2005-01-06 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h (P_tmpdir): Add define.
-
-2005-01-03 Earnie Boyd <earnie@users.sf.net>
-
- * Makefile.in (inst_docdir): For Cygwin target set to share/doc/.
-
-2005-01-02 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h: Increment version to 3.6
- * Makefile.in: Ditto
-
-2004-12-26 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/complex/(cabsf.c cacosf.c cacoshf.c cargf.c casinf.c
- casinhf.c catanf.c catanhf.c ccosf.c ccoshf.c cexpf.c cimagf.c
- clogf.c cpowf.c cprojf.c crealf.c csinf.c csinhf.c csqrtf.c
- ctanf.c ctanhf.c): New files.
- * mingwex/Makefile.in (COMPLEX_DISTFILES): Adjust.
- (COMPLEX_OBJS): Adjust.
- * include/complex.h (cabsf, cacosf, cacoshf, cargf, casinf.
- casinhf, catanf, catanhf, ccosf, ccoshf, cexpf, cimagf, clogf,
- cpowf, cprojf, crealf, csinf, csinhf, csqrtf, ctanf, ctanhf):
- Declare.
-
-2004-12-20 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/wchar.h (wcsdup): Correct prototype.
- * include/string.h (wcsdup): Correct prototype.
-
-2004-10-14 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/sys/stat.h: Make S_ISLNK comment comply with ISO C90.
-
-2004-10-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/fastmath.h: New file.
- * mingwex/math/asinh.c: New file.
- * mingwex/math/asinhf.c: New file.
- * mingwex/math/asinhl.c: New file.
- * mingwex/math/acosh.c: New file.
- * mingwex/math/acoshf.c: New file.
- * mingwex/math/acoshl.c: New file.
- * mingwex/math/atanh.c: New file.
- * mingwex/math/atanhf.c: New file.
- * include/math.h (asinh, asinhf, asinhl, acosh, acoshf, acoshl,
- atanh, atanhf, atanhl): Add prototypes.
- * mingwex/Makefile.in (MATH_OBJS): Add objects for above to list.
- (MATH_DISTFILES): Add sources for above and fastmath.h to list.
- Specify dependency on fastmath.h for new objects.
-
-2004-09-08 Earnie Boyd <earnie@users.sf.net>
-
- * include/sys/stat.h (_S_IFLNK): Add definition.
- (S_IFLNK) Ditto.
- (_lstat) Ditto.
- (lstat) Ditto.
- (_S_ISLNK) Recode.
- (S_ISLNK) Ditto.
-
-2004-09-08 Earnie Boyd <earnie@users.sf.net>
-
- * include/sys/stat.h (_S_ISLNK): Add definition.
- (S_ISLNK): Ditto.
-
-2004-09-05 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h: Increment minor version for 3.5 release.
- * Makefile.in: Ditto.
- * mingwex/Makefile.in: Correct typo in list of DISTFILES.
-
-2004-08-24 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/malloc.h (__mingw_aligned_offset_malloc,
- __mingw_aligned_offset_realloc, __mingw_aligned_malloc,
- __mingw_aligned_realloc, __mingw_aligned_free): Add
- prototypes.
- * mingwex/Makefile.in (DISTFILES): Add mingw-aligned-malloc.c,
- tst-aligned-malloc.c.
- (REPLACE_OBJS): Add mingw-aligned-malloc.o.
-
-2004-08-24 Steven G. Johnson <stevenj@alum.mit.edu>
-
- * mingwex/mingw-aligned-malloc.c: New file.
- * mingwex/tst-aligned-malloc.c: New file.
-
-2004-08-24 Danny Smith <dannysmith@users.sourceforge.net>
-
- * crt1.c: (__mingw_CRTStartup): Change return to void. Add
- noreturn attribute. Align stack to 16 bytes before passing args
- to main.
- (mainCRTStartup): Change return to void.
- (WinMainCRTStartup): Likewise.
-
-2004-08-15 Danny Smith <dannysmith@users.sourceforge.net>
-
- * profile/COPYING: New file.
- * profile/CYGWIN_LICENSE: New file.
- * profile/Makefile.in (DISTFILES): Add COPYING, CYGWIN_LICENSE.
-
-2004-08-15 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/fopen64.c: Move.
- * mingwex/fseeko64.c: Move.
- * mingwex/ftello64.c: Move.
- * mingwex/lseek64.c: Move.
- * mingwex/stdio/fopen64.c: To here.
- * mingwex/stdio/fseeko64.c: To here.
- * mingwex/stdio/ftello64.c: To here.
- * mingwex/stdio/lseek64.c: To here.
-
-2004-08-15 Danny Smith <dannysmith@users.sourceforge.net>
-
- * profile/gmon.c [__MINGW32__]: Include string.h for
- memset prototype.
-
-2004-08-08 Christopher Faylor <cgf@timesys.com>
-
- * mingwex/stdio/vwscanf.c: Add stdio.h needed after 2004-08-07 change.
-
-2004-08-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/complex.h: Remove __attribute__ ((const)) from
- transcendantal and trig functions. Replace __attribute__ ((const))
- with __MINGW_ATTRIB_CONST on other declarations.
-
-2004-08-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/wchar.h: Reorganize, avoid including other headers.
-
-2004-08-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/string.h (memchr, memcmp, strchr, strcmp, strcspn)
- (strlen, strncmp, strpbrk, strrchr, strspn, strstr): Add pure
- attribute.
-
-2004-07-30 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/dirent.h (struct _wdirent): Remove obsolete comment.
-
-2004-07-30 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/string.h: Revert 2004-07-26 additions of
- __ATTRIBUTE_PURE.
-
-2004-07-28 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/powl.c (powl): Revert change of 2004-02-01.
- (__convert_inf_to_maxnum): New.static inline.
- (reducl): Use it to protect against Inf - Inf.
- (__fast_ldexpl): New function. Use in lieu of ldexpl.
-
-2004-07-27 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/expl.c (expl): Move body of code to new static
- function __expl, removing tests for +/-Inf. Extern function
- expl calls __expl after testing for max, min log thresholds.
-
-2004-07-26 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/stdio/vsscanf.c: Add "edi" to registers-modified field
- * mingwex/stdio/vfscanf.c: Likewise.
- * mingwex/stdio/vswscanf.c: Likewise.
- * mingwex/stdio/vfwscanf.c: Likewise.
-
-2004-07-26 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h: Use only two underscores to uglify
- __MINGW_ATTRIB_* macros.
- * include/stdlib.h: Adjust __MINGW_ATTRIB_* tokens.
- * include/setjmp.h: Likewise.
-
- * include/sting.h: Add __MINGW_ATTRIB_PURE to locale-independent
- string functions.
- (_strdup, strdup): Add __MINGW_ATTRIB_MALLOC.
-
-2004-07-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/string.h: Group wide string functions together,
- and protect with _WSTRING_DEFINED.
-
-2004-07-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (__MINGW_ATTR_*): Replace with
- __MINGW_ATTRIB_*.
- * include/stdlib.h (_ATTRIB_NORETURN): Replace with
- __MINGW_ATTRIB_NORETURN, throughout.
- (malloc): Declare with __MINGW_ATTRIB_MALLOC.
- (calloc): Likewise.
- (abs): Declare with __MINGW_ATTRIB_CONST.
- (labs): Likewise.
- (div): Likewise.
- (ldiv): Likewise.
- (lldiv): Likewise.
- (_rotl): Likewise.
- (_rotr): Likewise.
- (_lrotl): Likewise.
- (_lrotr): Likewise.
- * include/setjmp.h (longjmp): Add __MINGW_ATTRIB_NORETURN.
-
-2004-07-21 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h: Undefine __attribute__.
- (__MINGW_ATTR_NORETURN): New define.
- (__MINGW_ATTR_CONST): New define.
- (__MINGW_ATTR_MALLOC): New define.
- (__MINGW_ATTR_PURE): New define.
- (_CRTIMP, __cdecl, __stdcall, __UNUSED_PARAM): Ansi-fy
- expansions.
-
-2004-07-19 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/time.h (__time64_t): Add missing ';'.
-
-2004-07-17 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/time.h (wcsftime): Move out of !__STRICT_ANSI
- block.
- (struct tm): Protect with _TM_DEFINED.
-
-2004-07-17 Christopher Faylor <cgf@timesys.com>
-
- * Makefile.in (CC): Strip inappropriate include file settings from any
- passed-in CC.
-
-2004-07-15 "dgun" <dgun@umpire.com>
-
- * include/complex.h (conj): Correct typo in prototype.
-
-2004-07-15 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h: Add pragma GCC system_header.
-
-2004-07-15 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/complex/carg.c: New file.
- * mingwex/Makefile.in: Really add carg.o to libmingwex.a.
-
-2004-07-15 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (INCLUDES): Temporarily revert previous change.
- * mingwex/Makefile,in (INCLUDES): Ditto.
- * profile/Makefile,in (INCLUDES): Ditto.
- * mingwex/Makefile,in: Drop carg.o dependency.
-
-2004-07-14 Christopher Faylor <cgf@timesys.com>
-
- * mingwex/fwide.c: Include <stdio.h> to resolve FILE usage.
-
-2004-07-14 Danny Smith <dannysmith@users.sourceforge.net>
-
- * Makefile.in (INCLUDES): Designate $(srcdir)/../include as a
- system dir.
- * mingwex/Makefile,in (INCLUDES): Ditto.
- * profile/Makefile,in (INCLUDES): Ditto.
-
- * mingwex/Makefile,in: Add carg.o to libmingwex.a.
-
-2004-07-13 Earnie Boyd <earnie@users.sourcefourge.net>
-
- * Makefile.in: Move use of --nostdinc++ as GCC3.4 warns to use it
- for C modules.
- * mingwex/Makefile.in: Ditto.
- * profile/Makefile.in: Ditto.
- * include/limits.h: Change to new file header preamble.
- * include/_mingw.h: Increment minor version for 3.4 release.
- * Makefile.in: Ditto.
-
-2004-07-12 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/cephes_emath.h (__etens): Remove declaration.
-
-2004-07-11 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/unistd.h (ftruncate): Add inline definition.
- * mingwex/ftruncate.c: New file.
- * mingwex/Makefile.in: Add ftruncate.o to libmingwex.a.
-
-2004-07-10 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/time.h: Do not include sys/types.h.
-
-2004-07-02 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/Makefile.in (MATH_DISTFILES): Remove pow.c,
- (MATH_OBJS): Remove pow,o.
- * include/math.h (pow): Declare with _CRTIMP.
- Add comment on how to avoid excess precision problems.
-
-2004-06-30 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h (__mingw_fseeko64): Add prototype.
- * mingwex/mingw-fseek.c (__mingw_fseeko64): Add definition.
- (__mingw_fwrite): Handle huge files.
-
-2004-06-30 Kees Zeelenberg <kzlg@users.sourceforge.net>
- Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h (fopen64): Add inline function.
- (fseeko64): Add prototype.
- (ftello64): Add inline function.
- * include/io.h (lseek64): Add inline function.
- * include/sys/types (off64_t): Add typedef.
- (fpos64_t): Add typedef.
- * mingwex/fopen64.c: New file.
- * mingwex/fseeko64.c: New file.
- * mingwex/ftello64.c: New file.
- * mingwex/lseek64.c: New file.
- * mingwex/Makefile.in (STDIO_DISTFILES): Add fopen64.c,
- fseeko.64.c, ftello64.c, lseek64.c.
- (STDIO_OBJS): Add fopen64.o, fseeko.64.o, ftello64.o, lseek64.o.
-
-2004-04-24 Luke Dunstan <infidel@users.sourceforge.net>
-
- * include/limits.h (_I64_MIN, _I64_MAX, _UI64_MAX): Add defines.
-
-2004-04-22 Earnie Boyd <earnie@users.sf.net>
-
- * DISCLAIMER: Add words about "free to use".
- * README: Modify "Win32 runtime" to "Microsoft C Runtime".
- * Makefile.in (SRCDIST_FILES): Add DISCLAIMER and CONTRIBUTORS.
- (inst_docdir): New variable.
- (INSTDOCS): Ditto.
- (FLAGS_TO_PASS): Include inst_docdir.
- (install-dirs): Add inst_docdir.
- (install): Add loop for INSTDOCS.
- * strncasecmp.c: Reword copyright and disclaimer. Move Contributors
- section to CONTRIBUTORS file. Remove RCS tags.
-
-2004-04-22 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/lround.c: Rewrite.
- * mingwex/math/lroundf.c: Rewrite.
- * mingwex/math/lroundl.c: Rewrite.
- * mingwex/math/llround.c: Rewrite.
- * mingwex/math/llroundf.c: Rewrite.
- * mingwex/math/llroundl.c: Rewrite.
-
-2004-04-20 Earnie Boyd <earnie@users.sf.net>
-
- * CONTRIBUTORS: New file.
- * DISCLAIMER: Ditto.
- * CRT_noglob.c: Reword copyright and disclaimer. Move Contributors
- section to CONTRIBUTORS file. Remove RCS tags.
- * CRTFmode.c: Ditto.
- * CRTglob.c: Ditto.
- * CRTinit.c: Ditto.
- * crt1.c: Ditto.
- * crtdll.dev: Ditto.
- * dllcrt1.c: Ditto.
- * dllmain.c: Ditto.
- * gccmain.c: Ditto.
- * init.c: Ditto.
- * isascii.c: Ditto.
- * iscsym.c: Ditto.
- * iscsymf.c: Ditto.
- * jamfile: Ditto.
- * main.c: Ditto.
- * msvcrt.def.in: Ditto.
- * strcasecmp.c: Ditto.
- * toascii.c: Ditto.
- * wcscmpi.c: Ditto.
- * include/assert.h: Ditto.
- * include/conio.h: Ditto.
- * include/ctype.h: Ditto.
- * include/direct.h: Ditto.
- * include/dirent.h: Ditto.
- * include/dos.h: Ditto.
- * include/errno.h: Ditto.
- * include/excpt.h: Ditto.
- * include/fcntl.h: Ditto.
- * include/float.h: Ditto.
- * include/io.h: Ditto.
- * include/locale.h: Ditto.
- * include/malloc.h: Ditto.
- * include/math.h: Ditto.
- * include/process.h: Ditto.
- * include/setjmp.h: Ditto.
- * include/share.h: Ditto.
- * include/signal.h: Ditto.
- * include/stdio.h: Ditto.
- * include/stdlib.h: Ditto.
- * include/string.h: Ditto.
- * include/tchar.h: Ditto.
- * include/time.h: Ditto.
- * include/wchar.h: Ditto.
- * include/sys/locking.h: Ditto.
- * include/sys/param.h: Ditto.
- * include/sys/stat.h: Ditto.
- * include/sys/timeb.h: Ditto.
- * include/sys/types.h: Ditto.
- * include/sys/utime.h: Ditto.
- * mingwex/dirent.c: Ditto.
-
-2004-04-19 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h: Revert to primary release 3 and increment minor
- release to 3.
- * Makefile.in (VERSION): Ditto.
-
-2004-04-01 Danny Smith <dannysmith@users.sourceforge.net>
-
- * crt1.c (_mingw32_init_fmode): Set *_imp___fmode_dll to
- _fmode if not __MSVCRT__.
-
-2004-03-30 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/io.h: (_findfirst): Correct prototype.
-
-2004-03-30 Hans Leidekker <hans@it.vu.nl>
-
- * include/io.h: (_findnext, _findclose): Correct prototype.
-
-2004-03-28 Hans Leidekker <hans@it.vu.nl>
-
- * include/math.h (FP_*): Add defines.
-
-2004-03-29 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/round.c: Rewrite.
- * mingwex/math/roundf.c: Rewrite.
- * mingwex/math/roundl.c: Rewrite.
-
-2004-03-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (__MSVCRT_VERSION__): Define default as 0x0600.
- * include/time.h (__time64_t): Add typedef.
- (_mktime64): Add prototype for __MSVCRT_VERSION__ >= 0x0601.
- (_ctime64): Likewise.
- (_wctime64): Likewise.
- (_gmtime64): Likewise.
- (_localtime64): Likewise.
- (wcsftime): Move into _WTIME_DEFINED block.
- Regroup non-ANSI prototypes.
- * include/io.h: Include <stdint.h>.
- (__finddata64_t): Add struct definition.
- (__wfinddata64_t): Likewise.
- (_findfirst64): Add prototype for __MSVCRT_VERSION__ >= 0x0601.
- (_findnext64): Likewise.
- (_wfindfirst64): Likewise.
- (_wfindnext64): Likewise.
- * include/sys/timeb.h (__timeb64): Add struct definition.
- (_ftime64): Add prototype for __MSVCRT_VERSION__ >= 0x0601.
- * include/sys/utime.h (__utimbuf64): Add struct definition.
- (_utime64): Add prototype for __MSVCRT_VERSION__ >= 0x0601.
- (_futime64): Likewise.
- (_wutime64): Likewise.
- * include/sys/stat.h (__stat64): Add struct definition.
- (_fstat64): Add prototype for __MSVCRT_VERSION__ >= 0x0601.
- (_stat64): Likewise.
- (_wstat64): Likwise.
- * include/sys/types.h (__time64_t): Add typedef.
- * include/wchar.h (__wfinddata64_t): Add structure definition.
- (__stat64): Likewise.
- (_wctime64): Add prototype for __MSVCRT_VERSION__ >= 0x0601.
- (_wfindfirst64): Likewise.
- (_wfindnext64): Likewise.
- (_wutime64): Likewise.
- (_wstat64): Likwise.
- * include/malloc.h (_aligned_free): Add prototype for
- __MSVCRT_VERSION__ >= 0x0700.
- (_aligned_malloc): Likewise.
- (_aligned_offset_malloc): Likewise.
- (_aligned_offset_realloc): Likewise.
- (_aligned_realloc): Likewise.
- * include/string.h (_wcserror): Add prototype for
- __MSVCRT_VERSION__ >= 0x0700.
- (__wcserror): Likewise.
- * include/math.h (_set_SSE2_enable): Add prototype for
- __MSVCRT_VERSION__ >= 0x0701.
-
-2004-03-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h (_fsopen): Add prototype.
- * include/tchar.h (_tfsopen): Add defines.
- Thanks to "Gerik" <gerikr at users dot sourceforge dot net>
-
-2004-03-19 Danny Smith <dannysmith@users.sourceforge.net>
-
- * msvcrt.def.in: Add stubs for msvcrt.dll (version 6.10),
- msvcr70.dll, and msvcr71.dll.
- * Makefile.in (msvcr*.def): Define preprocessor __msvcr*__ constant
- using basename of output def file.
-
-2004-03-13 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/malloc.h: Remove __STRICT_ANSI__ guard.
-
-2004-03-11 Brian Keener <bkeener@thesoftwaresource.com>
-
- * include/process.h: Remove the #endif associated with removal of
- __STRICT_ANSI__ guard from non-ANSI header.
-
-2004-03-10 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/conio.h: Remove __STRICT_ANSI__ guard from non-ANSI header.
- * include/direct.h: Ditto.
- * include/dirent.h: Ditto.
- * include/dos.h: Ditto.
- * include/excpt.h: Ditto.
- * inlude/fcntl,h
- * include/io.h: Ditto.
- * inlude/mem.h: Ditto.
- * include/memory.h: Ditto.
- * include/process.h: Ditto.
- * inlude/search.h: Ditto.
- * include/share.h: Ditto.
- * include/unistd.h: Ditto.
- * include/sys/fcntl.h: Ditto.
- * include/file.h: Ditto.
- * include/sys/locking.h: Ditto.
- * include/sys/param.h: Ditto.
- * include/sys/stat,h
- * include/sys/time.h: Ditto.
- * include/sys/timeb.h: Ditto.
- * include/sys/types.h: Ditto.
- * include/sys/unistd.h: Ditto.
- * include/sys/utime.h: Ditto.
-
-2004-02-21 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (__UNUSED_PARAM): Define macro.
- * include/wchar.h (fwide): Use it.
- (mbsinit): Ditto.
-
-2004-02-05 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/getopt.c: Define IS_POSIXLY_CORRECT as per
- NetBSD getopt_long.c.
-
-2004-02-05 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/strtold.c (__asctoe64) Reorganise. Fix setting error
- codes and handling of special chars.
-
-2004-02-02 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h (feof): Add inlined definition.
- (ferror): Ditto.
-
-2004-02-01 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/ldexpl.c (ldexpl): Call __asm__("fscale")
- directly, rather than via scabnl.
-
-2004-02-01 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/powl.c (powl): Return infinity if
- extended precision multiplication of x by log2(y)
- overflows.
-
-2004-01-31 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/cephes_emath.h (__enan_64): Fix thinko.
- (__enan_NI16): Fix another one.
- (__enan_NBITS): Tidy.
-
-2004-01-16 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdint.h Fix __STDC_CONSTANT_MACROS for 8 and 16 bit
- types. (Thanks to John Maddock for report.)
-
-2004-01-14 Greg Chicares <chicares@users.sourceforge.net>
-
- * include/tchar.h (_puttchar): Define.
-
-2003-12-13 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h:(_fileno): Define macro version after both
- fileno and _fileno functions declared.
-
- * include/stdio.h (_rmtmp, rmtmp): Add prototypes.
- * moldnames.def.in (rmtmp) Add stub.
-
-2003-11-27 Dimitry Sibiryakov <aafemt@users.sourceforge.net>
-
- * include/signal.h (SIG_SGE, SIG_ACK): Add defines.
-
-2003-10-27 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h: Guard ISO C99 additions with __cplusplus
- not __GLIBCPP__.
-
-2003-10-21 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h: Define __attribute__((x)) to nothing
- if not __GNUC__.
-
-2003-10-21 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/complex.h: New file.
- * mingwex/complex: New directory.
- * mingwex/complex/cabs.c: New file.
- * mingwex/complex/cacos.c: New file.
- * mingwex/complex/cacosh.c: New file.
- * mingwex/complex/casin.c: New file.
- * mingwex/complex/casinh.c: New file.
- * mingwex/complex/catan.c: New file.
- * mingwex/complex/catanh.c: New file.
- * mingwex/complex/ccos.c: New file.
- * mingwex/complex/ccosh.c: New file.
- * mingwex/complex/cexp.c: New file.
- * mingwex/complex/cimag.c: New file.
- * mingwex/complex/clog.c: New file.
- * mingwex/complex/cpow.c: New file.
- * mingwex/complex/cproj.c: New file.
- * mingwex/complex/creal.c: New file.
- * mingwex/complex/csin.c: New file.
- * mingwex/complex/csinh.c: New file.
- * mingwex/complex/csqrt.c: New file.
- * mingwex/complex/ctan.c: New file.
- * mingwex/complex/ctanh.c: New file.
- * mingwex/Makefile.in (COMPLEX_DISTFILES): New list of
- files.
- (dist): Use it.
- (COMPLEX_OBJS): New list of objects.
- (LIB_OBJS): Include it in the library.
-
-2003-10-21 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h (cabs): Remove non-ISO prototype.
-
-2003-10-21 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/cephes_mconf.h (NAN, NANF, NANL):
- Use GCC __builtin's if available.
- (INFINITY, INFINITYF, INFINITYL): Likewise.
-
-2003-10-21 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/s_erf.c (erf): Set errno to ERANGE if
- beyond approximation limit.
- * mingwex/math/sf_erf.c (erff): Likewise.
-
-2003-10-17 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h (getc): Cast result to unsigned char before
- return.
- (putc): Likewise
- (getchar): Likewise.
- (putchar): Likewise.
- Thanks to M.Fujii <boochang@m4.kcn.ne.jp>
-
-2003-10-10 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h: Increment version to 3.2.
- * Makefile.in: Ditto.
-
-2003-10-10 Earnie Boyd <earnie@users.sourceforge.net>
-
- * include/sys/types.h: Revert last change.
-
-2003-10-10 Earnie Boyd <earnie@users.sourceforge.net>
-
- * include/sys/types.h (ssize_t): Correct the definition.
-
-2003-10-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h (_filbuf): Add prototype.
- (_flsbuf): Add prototype.
- (getc): Add inline version.
- (putc): Likewise.
- (getchar): Likewise.
- (putchar): Likewise.
-
-2003-10-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/dirent.c (_treaddir): Reset errno to 0 if end
- of directory.
-
-2003-09-29 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdlib.h: Guard non-ISO functions with
- !__STRICT_ANSI__, throughout.
-
-2003-09-24 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/io.h (_fileno): Remove prototype.
- (fileno): Likewise.
- (FILENAME_MAX): Define, if needed.
- Don't include <stdio.h>.
- * include/stdio.h (FILENAME_MAX): Protect against
- prior definition.
- (_fileno): Define macro implementation.
- (fileno): Likewise.
-
-2003-09-24 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/inttypes.h: Include _mingw.h.
-
-2003-09-24 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (__CRT_INLINE): Define.
- * include/ctype.h: Replace 'extern inline' with __CRT_INLINE,
- throughout
- * include/inttypes.h: Likewise.
- * include/math.h: Likewise.
- * include/stdio.h: Likewise.
- * include/stdlib.h: Likewise.
- * include/string.h: Likewise.
- * include/wchar.h: Likewise.
- * include/wctype.h: Likewise.
-
-2003-09-22 Roland Schwingel <rolandschwingel@users.sourceforge.net>
-
- * mingwex/dirent.c (_topendir): Allocate enough memory for
- DIR struct in UNICODE case too.
-
-2003-09-15 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h: Increment version to 3.2.
- * Makefile.in: Ditto.
-
-2003-07-03 Earnie Boyd <earnie@users.sf.net>
-
- * config.guess, config.sub: Update with versions from ftp.gnu.org.
-
-2003-07-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/trunc.c (trunc): Provide lvalue for memory input constraint.
- * mingwex/math/truncf.c (truncf): Likewise.
- * mingwex/math/truncl.c (truncl): Likewise.
- * mingwex/math/modff.c (modff): Likewise.
- * mingwex/math/modfl.c (modfl): Likewise.
-
-2003-07-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/search.h: New file.
- * include/stdlib.h: Add comment about qsort, bsearch in
- search.h.
- * test_headers.c: Include search.h.
- * moldname.def.in (lfind, lsearch): Add.
-
-2003-07-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/process.h (_execv, _execvp, _spawnv, _spawnvp, _execve,
- _execvpe, _spawnve, _spawnvpe, execv, execvp, spawnv, spawnvp,
- execve, execvpe, spawnve, spawnvpe): Const-ify all the char params.
-
-2003-07-01 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h (small, hyper): Change to __small and __hyper to
- avoid user space name conflicts.
-
-2003-07-01 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h (__int32, __int16, __int8, small, hyper): Define.
- Note: Also added to w32api/include/basetyps.h.
- * mingwex/math/tgamma.c, tgammaf.c, tgammal.c (small):
- Rename to Small (case difference).
-
-2003-06-18 Earnie Boyd <earnie@users.sf.net>
-
- * include/dirent.h (dirent): Make d_name and array instead of a pointer.
- * mingwex/dirent.c: Modifications througout to fill d_name array.
- * Makefile.in (LIBS): Add new MSVCRT libraries libmsvcr70 and
- libmsvcr71, including debug versions.
- (msvcr70.def, msvcr70d.def, msvcr71.def, msvcr71.def): New targets.
-
-2003-06-17 Danny Smith <dannysmith@users.sourceforge.net>
-
- * msvcrt.def.in (__badioinfo, __lc_codepage, __lc_handle,
- __pioinfo, __setlc_active, _unguarded_readlc_active, _dstbias):
- Mark as DATA.
- Thanks to: Aaron W LaFramboise <AWLaFramboise@aol.com>
-
-2003-05-30 Sascha Sommer <saschasommer@freenet.de>
-
- * include/sys/types.h (_ssize_t, ssize_t): Add typedefs.
-
-2003-05-15 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdlib.h (_Exit): Move out of __STRICT_ANSI__ block,
- but still protect inline definition with __STRICT_ANSI__.
-
-2003-05-14 Danny Smith <dannysmith@users.sourceforge.net>
-
- * string_old.c: Remove, splitting into...
- * strcasecmp.c: New file.
- * strncasecmp.c: New file.
- * wscmpi.c : New file.
- * ctype_old.c: Remove, splitting into...
- * isascii.c: New file.
- * iscsym.c: New file.
- * iscsymf.c: New file.
- * toascii.c: New file.
- * Makefile.in (MOLD_OBJS): Adjust.
- (SRCDIST_FILES): Adjust.
-
-2003-05-13 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h (fabs) : Remove inline definition.
- (fabsf): Likewise.
- (fabsl): Likewise.
-
-2003-05-06 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h: Change version to 3.0
- * Makefile.in: Ditto.
-
-2003-05-06 Earnie Boyd <earnie@users.sf.net>
-
- * configure.in (W32API_INCLUDE): Need the -I switch in the value.
- * mingwex/configure.in (W32API_INCLUDE): Ditto.
- * profile/configure.in (W32API_INCLUDE): Ditto.
-
-2003-05-06 Earnie Boyd <earnie@users.sf.net>
-
- * configure.in (CFLAGS): Remove -D__USE_CRTIMP=1 due to possibilites
- of multiply defined symbols if the symbols is defined locally. E.G.:
- A local definition of malloc causes this problem.
- * configure: Regenerate.
- * profile/Makefile.in (W32API_INCLUDE): New variable.
- (ALL_CFLAGS): Use W32API_INCLUDE value.
- (ALL_CXXFLAGS): Ditto.
- (gcrt0.o gcrt1.o gcrt2.o): Use ALL_CFLAGS instead of CFLAGS.
- Thanks to Jeff Bonggren <jbon@users.sf.net>.
- * profile/configure.in (W32API_INCLUDE): Set default value.
- * profile/configure: Regenerate.
- * mingwex/Makefile.in (W32API_INCLUDE): New variable.
- (ALL_CFLAGS): Use W32API-INCLUDE value.
- (ALL_CXXFLAGS): Ditto.
- * mingwex/configure.in (W32API_INCLUDE): Set default value.
- * mingwex/configure: Regenerate.
-
-2003-05-05 Earnie Boyd <earnie@users.sf.net>
-
- * Makefile.in (W32API_INCLUDE): New variable.
- (ALL_CFLAGS): Use W32API_INCLUDE value.
- (ALL_CXXFLAGS): Ditto.
- * configure.in (CFLAGS): Add -D__USE_CRTIMP=1 to default values.
- (W32API_INCLUDE): Set default value.
- * configure: Regenerate.
-
-2003-04-11 Earnie Boyd <earnie@users.sf.net>
-
- * configure.in (LIBM_A): Define for cygwin target.
- * configure (LIBM_A): Ditto.
-
-2003-04-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/time.h (strftime): Remove duplicate declaration.
-
-2003-04-01 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (_CRTIMP): Make conditional on __USE_CRTIMP.
-
-2003-03-16 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/dirent.c (_topendir): Eliminate signed/unsigned warning.
- * mingwex/strtoimax.c (strtoimax): Likewise.
- * mingwex/wcstoimax.c (wcstoimax): Likewise.
- * mingwex/wtoll.c (wtoll): Remove unnecessary ';'
- * mingwex/fesentenv.c: Include float.h.
- * mingwex/math/powl.c: Eliminate type punning/strict aliasing
- warning.
- * mingwex/math/tanhl.c: Eliminate signed/unsigned warning in
- constants.
- * mingwex/math/tgammal.c: Likewise.
-
-2003-03-16 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/utime.h: New file, forwarding to sys/utime.h.
-
-2003-03-16 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/sys/param.h (MAXPATHLEN): Define.
-
-2003-03-16 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/tchar.h: Ansi-fy a comment.
-
-2003-03-16 Danny Smith <dannysmith@users.sourceforge.net>
-
- * profile/profile.h (mcount): Use __builtin_return_address
- rather than inline __asm statements.
- * profile/Makefile.in: Remove special rule for mcount.o
- Specify dependencies for mcount.o profil.o gmon.o.
-
-2003-03-10 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdlib.h (qsort): Remove const from first parm.
- Thanks to: Tien-Ren Chen <trchen@sourceforge.users.net>
-
-2003-03-03 Christopher Faylor <cgf@redhat.com>
-
- * mingwex/getopt.c: Refresh from NetBSD sources.
-
-2003-03-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/getopt.c: New file, copied from cygwin srcs.
- * include/getopt.h: New file, copied from cygwin srcs.
- * include/unistd.h: Include getopt.h.
- * mingwex/Makefile.in (DISTFILES): Add getopt.c.
- (POSIX_OBJS): Add getopt.o.
-
-2003-03-02 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h (vscanf): Add prototype.
- (vfscanf): Ditto.
- (vsscanf): Ditto.
- (vwscanf): Ditto.
- (vfwscanf): Ditto.
- (vswscanf): Ditto.
- * include/wchar.h (vwscanf): Add prototype.
- (vfwscanf): Ditto.
- (vswscanf): Ditto.
- * mingwex/snprintf.c: Move to mingwex/stdio.
- * mingwex/vsnprintf.c: Ditto.
- * mingwex/snwprintf.c: Ditto.
- * mingwex/vsnwprintf.c: Ditto.
- * mingwex/Makefile.in (VPATH): Add $(srcdir)/stdio
- (STDIO_DISTFILES): Add.
- (DISTFILES): Adjust.
- (STDIO_STUB_OBJS): Rename to STDIO_OBJS and add v*scanf objects.
- (LIB_OBJS): Adjust.
- (dist): Adjust.
-
-2003-03-02 Aaron W LaFramboise <AWLaFramboise@aol.com>
-
- * mingwex/stdio: New directory
- * mingwex/stdio/vfscanf.c: New file.
- * mingwex/stdio/vfwscanf.c: New file.
- * mingwex/stdio/vscanf.c: New file.
- * mingwex/stdio/vsscanf.c: New file.
- * mingwex/stdio/vswscanf.c: New file.
- * mingwex/stdio/vwscanf.c: New file.
-
-2003-02-25 Earnie Boyd <earnie@users.sf.net>
-
- * Makefile.in (libmsvcrt20.a): Remove target and dependencies.
- (libmsvcrt40.a): Ditto.
-
-2003-02-21 Earnie Boyd <earnie@users.sf.net>
-
- Thanks to David Frasier <davidf@sjsoft.com> who inspired portions of
- this patch.
- * Makefile.in (libmsvcrtd.a): Add target library.
- (libmoldnamed.a): Ditto.
- (msvcrt.def, msvcrtd.def, msvcrt20.def, msvcrt40.def): Use msvcrt.def.in
- template to create.
- ($(srcdir)): Remove explicit reference for depencies of object targets.
- * moldname.def, moldname-msvcrt.def, moldname-crtdll.def, msvcrt.def,
- msvcrt20.def, msvcrt40.def: Remove.
- * msvcrt.def.in: New file (Copy of previous msvcrt.def).
-
-2003-02-20 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in: Make sure libmingwex.a from current build tree is used.
-
-2003-02-14 Christopher Faylor <cgf@redhat.com>
-
- * profile/Makefile.in (mcount.o): Use ALL_CFLAGS for compilation to
- ensure -mno-cygwin where appropriate. Filter out -O2.
-
-2003-02-13 Danny Smith <dannysmith@users.sourceforge.net>
-
- * profile/Makefile.in (mcount.o): Use -O1 optimization
- switch to compile.
-
-2003-02-10 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h: Remove _CRTIMP from pow() prototype,
- unless __NO_ISOCEXT.
-
-2003-02-10 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/cephes_emath.h: Don't redefine INFINITY.
-
-2003-02-10 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h (_CRTIMP): Define for __GNUC__ if
- __declspec(dllimport) supported.
- (__cdecl): Define if not already defined.
- (__stdcall): Likewise.
- * include/dirent.h: Qualify fuctions with __cdecl.
- * include/fenv.h: Likewise.
- * include/inttypes.h: Likewise.
- * include/assert.h: Qualify fuctions with __cdecl. Qualify
- CRT dll imports with _CRTIMP.
- * include/conio.h: Likewise.
- * include/ctype.h: Likewise.
- * include/direct.h: Likewise.
- * include/dos.h: Likewise.
- * include/errno.h: Likewise.
- * include/float.h: Likewise.
- * include/io.h: Likewise.
- * include/locale.h: Likewise.
- * include/malloc.h: Likewise.
- * include/math.h: Likewise.
- * include/mbctype.h: Likewise.
- * include/mbstring.h: Likewise.
- * include/process.h: Likewise.
- * include/setjmp.h: Likewise.
- * include/signal.h: Likewise.
- * include/stdio.h: Likewise.
- * include/stdlib.h: Likewise.
- * include/string.h: Likewise.
- * include/time.h: Likewise.
- * include/wchar.h: Likewise.
- * include/wctype.h: Likewise.
- * include/sys/stat.h: Likewise.
- * include/sys/timeb.h: Likewise.
- * include/sys/utime.h: Likewise.
-
- * include/ctype.h: Guard ctype inlines with __NO_INLINE__.
- * include/wctype.h: Guard wctype inlines with __NO_INLINE__.
-
- * include/stdio.h (__VALIST): Guard against prior definition.
-
-2003-02-08 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h: Change version to 3.0
- * Makefile.in: Ditto.
-
-2003-02-08 Earnie Boyd <earnie@users.sf.net>
-
- * include/stdlib.h: Make words after #endif a comment.
-
-2003-02-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/locale.h: Include stddef.h for definition of NULL.
-
-2003-01-26 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h (tgamma): Correct typo in comment.
-
-2003-01-26 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/mingw-fseek.c (INLINE): Remove define.
- (__mingw_is_win9x): Remove static inline function.
- (_mingw_fwrite): Use _osver instead of __mingw_is_win9x.
-
-2003-01-11 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/llround.c: Correct function name and
- change return value to long long.
-
-2003-01-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/ctype.h (__isascii): Don't cast arg to unsigned.
- (iswascii): Likewise. Correct mask.
- * include/wctype.h (iswascii): Don't cast arg to unsigned.
- Correct mask
-
-2003-01-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdlib.h (_osver, _winver, _winmajor,
- _winminor): Declare as direct imports from dll if
- __DECLSPEC_SUPPORTED.
-
-2003-01-01 Danny Smith <dannysmith@users.sourceforge.net>
-
- * pseudo-reloc.c (do_pseudo_reloc): Make static.
- * pseudo-reloc-list.c: New file.
- * crt1.c (_pei386_runtime_relocator): Declare.
- (__mingw_CRTStartup): Call it.
- * dllcrt1.c (_pei386_runtime_relocator): Declare.
- (DllMainCRTStartup): Call it.
- * Makefile.in: Add pseudo-reloc.o pseude-reloc-list.o to
- libmingw32.a.
-
-2003-01-01 Egor Duda <deo@logos-m.ru>
-
- * pseudo-reloc.c: New file.
-
-2002-12-20 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h: Increment version to 2.4.
- Makefile.in: Ditto.
-
-2002-12-12 Earnie Boyd <earnie@users.sf.net>
-
- * include/malloc.h (_alloca): Add definition.
- (alloca): Ditto.
-
-2002-12-08 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/s_erf.c: New file.
- * mingwex/math/sf_erf.c: New file.
- * mingwex/Makefile.in (MATH_DISTFILES): Add new files.
- (MATH_OBJS): Add new objects.
- * include/math.h (erf[f]): Add prototypes.
- (erfc[f]): Add prototypes.
-
-2002-12-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h: Add traditional/XOPEN math constants.
-
-2002-11-27 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/lgamma.c: New file.
- * mingwex/math/lgammaf.c: New file.
- * mingwex/math/lgammal.c: New file.
- * mingwex/math/tgamma.c: New file.
- * mingwex/math/tgammaf.c: New file.
- * mingwex/math/tgammal.c: New file.
- * mingwex/math/cephes_mconf (polevlf): Add float version.
- (p1evlf): Likewise.
- Define _CEPHES_USE_ERRNO.
- * mingwex/Makefile.in (MATH_DISTFILES): Add new files.
- (MATH_OBJS): Add new objects.
- * include/math.h (lgamma[fl]): Add prototypes.
- (tgamma[fl]): Add prototypes.
-
-2002-11-26 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/strtold.c: New file.
- * mingwex/wcstold.c: New file.
- * mingwex/ldtoa.c: New file.
- * mingwex/math/cephes_emath.h: New file.
- * mingwex/math/cephes_emath.c: New file.
- * mingwex/Makefile.in (DISTFILES): Add new files.
- (MATH_DISTFILES): Ditto.
- (STDLIB_OBJS): New. Define as strtold.c wcstold.c.
- (MATH_OBJS): Add cephes_emath.o.
- (LIB_OBJS): Add $(STDLIB_OBJS).
- * include/stdlib.h (strtold, wcstold): Add prototypes.
- * include/wchar.h (wcstold): Add prototype.
-
-2002-11-09 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h (sqrt): Remove inline definition.
- (sqrtf): Replace inline definition with prototype.
- (sqrtl): Likewise.
- * mingwex/math/sqrtf.c (sqrtf): Set domain error if
- argument less than zero.
- * mingwex/math/sqrtf.c (sqrtl): Likewise.
-
-2002-10-30 Guido Serassio <serassio@libero.it>
-
- * include/stdio.h (_getmaxstdio): Add prototype.
- (_setmaxstdio): Likewise.
-
-2002-10-19 Kang Li <rubylith@users.sourceforge.net>
-
- * include/fcntl.h (O_SEQUENTIAL): Correct typo.
-
-2002-10-19 Danny Smith <dannysmith@users.sourceforge.net>
-
- * crt1.c: Define new macro __IN_MINGW_RUNTIME before including
- stdlib.h.
- Define WIN32_MEAN_AND_LEAN before including windows.h
- * include/stdlib.h (_fmode): Protect declaration as dllimported
- variable with __IN_MINGW_RUNTIME.
-
-2002-10-19 Igor Pechtchanski <pechtcha@cs.nyu.edu>
-
- * crt1.c: Include stdlib.h.
-
-2002-10-19 Danny Smith <dannysmith@users.sourceforge.net>
-
- * Makefile.in (CRT0S): Add txtmode.o binmode.o.
- (MINGW_OBJS): Add txtmode.o.
- (SRCDIST_FILES): Add txtmode.c binmode.c.
- crt1.c: Don't include fcntrl.h, stdlib.h.
- (_fmode): Declare, without dllimport attribute.
- (__p__fmode): Declare access function for dll's _fmode.
- (_mingw32_init_fmode): Sync dll _fmode with staticly linked
- _fmode for app.
- * txtmode.c: New file.
- * binmode.c: New file.
- * samples/fmode/test2.c: New file.
- * samples/fmode/jamfile: Add test2.exe target.
-
-2002-10-11 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdint.h (INT64_C, UINT64_C ): Append suffix to let
- macros work with C89.
- (INTMAX_C, UINTMAX_C): Likewise.
-
-2002-10-11 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/string.h (strcasecmp): Make extern __inline__.
- (strncasecmp): Likewise.
- (wcscmpi): Likewise.
-
-2002-10-08 Heiko Gerdau <hg@technosis.de>
-
- * include/tchar.h (_tchdir. _tgetcwd, _tgetdcwd.
- _tmkdir, _trmdir, _tstat): Add ASCII and UNICODE
- mappings.
-
-2002-10-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/powil.c: Rename powil to __powil.
- * mingwex/math/powl.c: Adjust declaration and call
- to __powil. Remove comment on powil.
- * mingwex/math/powi.c: New file.
- * mingwex/math/powif.c: New file.
- * mingwex/math/pow.c: New file.
- * mingwex/math/cephes_mconf.h. Add double and float
- versions of constants.
- (polevl): Add double precision function.
- (p1evl): Likewise.
- * mingwex/Makefile.in (MATH_DISTFILES): Add pow.c,
- powi.c, powif.c.
- (MATH_OBJS): Add pow.o, powi.o, powif.o.
-
-2002-10-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/cytpe.h (_imp____mbcur_max): Add missing ';'.
- (_imp____mbcur_max_dll): Likewise.
-
-2002-10-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/fcntl.h (_fmode): Remove declarations and
- compatibility defines.
- (_setmode, setmode): Remove prototypes.
- * include/stdlib (_fmode): Add declarations and
- compatibility defines. Change type to int.
- * include/io.h (_setmode, setmode): Add prototypes.
- * samples/fmode/all.c: Adjust includes.
- * samples/fmode/test.c: Likewise.
- * crt1.c (_CRT_fmode): Declare as int.
- * CRTfmode.c (_CRT_fmode): Likewise.
-
- * include/stdlib: Remove comment about MB_CUR_MAX.
-
-2002-10-02 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdlib.h (_imp____mbcur_max): Add missing ';'.
- (_imp____mbcur_max_dll): Likewise.
-
-2002-09-18 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/files.txt: Remove inadvertantly added file.
-
-2002-09-18 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/string.h (_strerror): Move into #ifndef
- __STRICT_ANSI__ block.
-
-2002-09-17 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/time.h (__need_NULL): Define before including
- stddef.h. Thanks to: Rüdiger Dehmel <de@lmnet.de>.
-
-2002-09-16 Ranjit Matthew <rmathew@hotmail.com>
-
- * include/stdio.h: Correct comment about directory separator.
-
-2002-09-12 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/sys/time.h (timeval): Add struct definition and
- associated macros (copied from w32api/include/winsock.h).
-
-2002-09-05 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h: Increment version to 2.3.
- Makefile.in: Ditto.
-
-2002-09-05 Earnie Boyd <earnie@users.sf.net>
-
- * mingwex/fegetenv.c: Change to \n line endings.
- * mingwex/vsnprintf.c: Ditto.
- * mingwex/vsnwprintf.c: Ditto.
-
-2002-09-02 Danny Smith <dannysmith@users.sourceforge.net>
-
- * mingwex/math/hypotl.c: Replace with version based on cephes
- library.
-
-2002-08-28 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/sys/param.h: Add ENDIAN defines.
- * test_headers.c: Include sys/param.h.
-
-2002-08-28 Danny Smith <dannysmith@users.sourceforge.net>
-
- * test_headers.c: Don't include varargs.h.
- * Makefile.in (test_headers): Don't use -std=xx
- with -xc++.
-
-2002-08-21 Earnie Boyd <earnie@users.sf.net>
-
- * include/sys/param.h: New File.
-
-2002-08-21 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/math.h (asm): Change to __asm__ throughout.
- Expose ISO C99 functions if __GLIPCPP__.
- (hypotf): Use hypot, not _hypot in stub.
-
-2002-08-20 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/tchar.h: Ansi-fy another comment.
-
-2002-08-20 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/tchar.h: Ansi-fy comment.
-
-2002-08-20 Danny Smith <dannysmith@users.sourceforge.net>
-
- * test_headers.c : New file.
- * Makefile.in (test_headers): New target, using it,
- (SRCDIST_FILES): Distribute it.
-
-2002-08-20 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h: Increment version to 2.2.
- Makefile.in: Ditto.
-
-2002-08-14 Earnie Boyd <earnie@users.sf.net>
-
- * include/unistd.h: Add include of process.h.
-
-2002-08-03 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdio.h (_fcloseall): Add prototype.
-
-2002-07-29 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/tchar.h (_tfdopen): Correct typo.
-
-2002-07-29 Danny Smith <dannysmith@users.sourceforge.net>
-
- * moldname.def.in (chgsign,scalb,finite,fpclass,logb,
- nextafter): Add non-underscored stubs.
- * moldname-msvcrt.def: Regenerate.
- * moldname-crtdll.def: Regenerate.
- * mingwex/math: New directory.
- * mingwex/rint.c: Move to mingwex/math.
- * mingwex/rintf.c: Ditto.
- * mingwex/rintl.c: Ditto.
- * mingwex/round.c: Ditto.
- * mingwex/roundf.c: Ditto.
- * mingwex/roundl.c: Ditto.
- * mingwex/rint.c: Ditto.
- * mingwex/rintf.c: Ditto.
- * mingwex/rintl.c: Ditto.
- * mingwex/trunc.c: Ditto.
- * mingwex/truncf.c: Ditto.
- * mingwex/truncl.c: Ditto.
- * mingwex/signbit.c: Ditto.
- * mingwex/signbitf.c: Ditto.
- * mingwex/signbitl.c: Ditto.
- * mingwex/copysignl.S: Ditto.
- * mingwex/fdim.c: Ditto.
- * mingwex/fdimf.c: Ditto.
- * mingwex/fdiml.c: Ditto.
- * mingwex/fmin.c: Ditto.
- * mingwex/fminf.c: Ditto.
- * mingwex/fminl.c: Ditto.
- * mingwex/fmax.c: Ditto.
- * mingwex/fmaxf.c: Ditto.
- * mingwex/fmaxl.c: Ditto.
- * mingwex/fma.c: Ditto.
- * mingwex/fmaf.c: Ditto.
- * mingwex/fmal.c: Ditto.
- * mingwex/fpclassify.c: Ditto.
- * mingwex/fpclassifyl.c: Ditto.
- * mingwex/fpclassifyl.c: Ditto.
- * mingwex/isnan.c: Ditto.
- * mingwex/isnanf.c: Ditto.
- * mingwex/isnanl.c: Ditto.
- * mingwex/fucom.c: Ditto.
- * mingwex/fp_consts.c: Ditto. Split out float and long double
- definitions.
- * mingwex/math_stubs.c: Remove.
- * mingwex/log2.c: Remove. Replaced by math/log2.S
- * mingwex/log2f.c: Remove. Replaced by math/log2f.S
- * mingwex/log2l.c: Remove. Replaced by math/log2l.S
- * mingwex/math/acosf.c : New file.
- * mingwex/math/acosl.c: New file.
- * mingwex/math/asinf.c: New file.
- * mingwex/math/asinl.c: New file.
- * mingwex/math/atan2f.c: New file.
- * mingwex/math/atan2l.c: New file.
- * mingwex/math/atanf.c: New file.
- * mingwex/math/atanl.c: New file.
- * mingwex/math/cbrt.c: New file.
- * mingwex/math/cbrtf.c: New file.
- * mingwex/math/cbrtl.c: New file.
- * mingwex/math/ceilf.S: New file.
- * mingwex/math/ceill.S: New file.
- * mingwex/math/cephes_ld.h: New file.
- * mingwex/math/copysign.S: New file.
- * mingwex/math/copysignf.S: New file.
- * mingwex/math/cosf.S: New file.
- * mingwex/math/coshf.c: New file.
- * mingwex/math/coshl.c: New file.
- * mingwex/math/cosl.S: New file.
- * mingwex/math/exp2.S: New file.
- * mingwex/math/exp2f.S: New file.
- * mingwex/math/exp2l.S: New file.
- * mingwex/math/expf.c: New file.
- * mingwex/math/expl.c: New file.
- * mingwex/math/fabs.c: New file.
- * mingwex/math/fabsf.c: New file.
- * mingwex/math/fabsl.c: New file.
- * mingwex/math/floorf.S: New file.
- * mingwex/math/floorl.S: New file.
- * mingwex/math/fmodf.c: New file.
- * mingwex/math/fmodl.c: New file.
- * mingwex/math/fp_consts.h: Ditto.
- * mingwex/math/fp_constsf.c: Ditto.
- * mingwex/math/fp_constsl.c: Ditto.
- * mingwex/math/frexpf.c: New file.
- * mingwex/math/frexpl.S: New file.
- * mingwex/math/hypotf.c: New file.
- * mingwex/math/hypotl.c: New file.
- * mingwex/math/ilogb.S: New file.
- * mingwex/math/ilogbf.S: New file.
- * mingwex/math/ilogbl.S: New file.
- * mingwex/math/ldexpf.c: New file.
- * mingwex/math/ldexpl.c: New file.
- * mingwex/math/llrint.c: New file.
- * mingwex/math/llrintf.c: New file.
- * mingwex/math/llrintl.c: New file.
- * mingwex/math/llround.c: New file.
- * mingwex/math/llroundf.c: New file.
- * mingwex/math/llroundl.c: New file.
- * mingwex/math/log10f.S: New file.
- * mingwex/math/log10l.S: New file.
- * mingwex/math/log1p.S: New file.
- * mingwex/math/log1pf.S: New file.
- * mingwex/math/log1pl.S: New file.
- * mingwex/math/log2.S: New file.
- * mingwex/math/log2f.S: New file.
- * mingwex/math/log2l.S: New file.
- * mingwex/math/logb.c: New file.
- * mingwex/math/logbf.c: New file.
- * mingwex/math/logbl.c: New file.
- * mingwex/math/logf.S: New file.
- * mingwex/math/logl.S: New file.
- * mingwex/math/lrint.c: New file.
- * mingwex/math/lrintf.c: New file.
- * mingwex/math/lrintl.c: New file.
- * mingwex/math/lround.c: New file.
- * mingwex/math/lroundf.c: New file.
- * mingwex/math/lroundl.c: New file.
- * mingwex/math/modff.c: New file.
- * mingwex/math/modfl.c: New file.
- * mingwex/math/nearbyint.S: New file.
- * mingwex/math/nearbyintf.S: New file.
- * mingwex/math/nearbyintl.S: New file.
- * mingwex/math/nextafterf.c: New file.
- * mingwex/math/powf.c: New file.
- * mingwex/math/powl.c: New file.
- * mingwex/math/powil.c: New file.
- * mingwex/math/remainder.S: New file.
- * mingwex/math/remainderf.S: New file.
- * mingwex/math/remainderl.S: New file.
- * mingwex/math/remquo.S: New file.
- * mingwex/math/remquof.S: New file.
- * mingwex/math/remquol.S: New file.
- * mingwex/math/scalbn.S: New file.
- * mingwex/math/scalbnf.S: New file.
- * mingwex/math/scalbnl.S: New file.
- * mingwex/math/sinf.S: New file.
- * mingwex/math/sinhf.c: New file.
- * mingwex/math/sinhl.c: New file.
- * mingwex/math/sinl.S: New file.
- * mingwex/math/sqrt.c: New file.
- * mingwex/math/sqrtf.c: New file.
- * mingwex/math/sqrtl.c: New file.
- * mingwex/math/tanf.S: New file.
- * mingwex/math/tanhf.c: New file.
- * mingwex/math/tanhl.c: New file.
- * mingwex/math/tanl.S: New file.
- * mingwex/Makefile.in: Adjust VPATH for source files in
- mingwex/math.
- Adjust MATH_OBJS.
- Add MATH_DISTFILES and use it to build source distro.
- * include/ math.h: Add protypes for new functions and
- reorganise to reflect ANSI,C99 status.
-
-2002-06-19 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/tchar.h (_getts): Define as _getws for _UNICODE.
- (_putts): Define as _putws for _UNICODE.
- Thanks to: Tomasz Pona <cochisek@poczta.onet.pl> for report.
-
-2002-06-18 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/float.h: #include_next<float.h> before header guard.
-
-2002-06-18 Casper S. Hornstrup <chorns@users.sourceforge.net>
-
- * include/_mingw.h (__MINGW_IMPORT): Check for prior definition before
- defining.
- * include/excpt.h (): Include windef.h not windows.h.
- * include/fcntl.h (_O_SHORT_LIVED): Add define.
- (_chmod): Add prototype.
- (_creat): Correct prototype.
- (SH_DENY*): Rename defines to _SH_DENY*.
- (SH_DENY*): Add Non-ANSI names for _SH_DENY*.
- include/stdio.h (_IOMYBUF, _IOEOF, _IOERR, _IOSTRG,
- _IOAPPEND): Add defines.
- (_wfindfirst): Correct prototype.
- (_wfdopen): Add prototype.
- * include/stdlib.h (_rotl, _rotr, _lrotl, _lrotr): Add
- prototypes.
- * include/string.h (_mbschr, _mbstok, _mbsncat): Remove
- prototypes.
- (_wcsdup): Correct prototype.
- * include/mbstring.h: Remove comments about _mbschr, _mbstok,
- _mbsncat being in string.h.
- * include/wchar.h (_wfindfirst): Correct prototype.
- * include/tchar.h (_tfdopen): Add _UNICODE mappings.
-
-2002-06-15 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h: Increment to version 2.1.
- * Makefile.in: Ditto.
-
-2002-06-15 Earnie Boyd <earnie@users.sf.net>
-
- * Makefile.in (conf_prefix): New variable.
- (dist_prefix): Ditto. Conditionally set to $(conf_prefix).
- (bindist): Use dist_prefix.
-
-2002-06-13 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/_mingw.h: Increment version to 2.0.
- * Makefile.in: Ditto.
-
- Merge in mingwex branch.
-
- 2002-06-11 Danny Smith <dannysmith@users.sourceforge.net>
- * include/math.h (fdim, fdimf, fdiml): Add prototypes.
- * mingwex/fdim.c: New file.
- * mingwex/fdimf.c: New file.
- * mingwex/fdiml.c: New file.
- * mingwex/Makefile.in (DISTFILES): Add fdim.c, fdimf.c,
- fdiml.c.
- (MATHOBJS):Add fdim.o, fdimf.o. fdiml.o.
-
- 2002-05-23 Danny Smith <dannysmith@users.sourceforge.net>
- * mingwex/Makefile.in (DISTFILES): Add truncf.c, truncl.c.
-
- 2002-05-22 Danny Smith <dannysmith@users.sourceforge.net>
- * mingwex/isnanl.c: New file.
-
- 2002-05-21 Danny Smith <dannysmith@users.sourceforge.net>
- * include/stdint.h: Include stddef.h to get
- wchar_t and wint_t.
- (WINT_MAX): Define to ((wint_t)-1).
-
- 2002-05-21 Danny Smith <dannysmith@users.sourceforge.net>
- * include/wctype.h: Replace 'inline' with '__inline__'.
- * include/inttypes.h: Likewise.
-
- 2002-05-16 Danny Smith <dannysmith@users.sourceforge.net>
- * include/_mingw.h (__MINGW_IMPORT): Put extern at start
- to avoid warnings. Thanks to: Oscar Fuentes <ofv@wanadoo.es>.
-
- 2002-05-16 Danny Smith <dannysmith@users.sourceforge.net>
- * mingwex/snprintf.c: Split out vsnprintf to....
- * mingwex/vsnprintf.c: New file.
- * mingwex/snwprintf.c: Split out vsnwprintf to...
- * mingwex/vsnwprintf.c: New file.
- * mingwex/Makefile.in: Adjust DISTFILES and STDIO_STUB_OBJS.
-
- 2002-05-15 Pascal Obry <obry@gnat.com>
- * include/dirent.h (DIR): Change dd_stat type to int.
- (_WDIR): Likewise.
-
- 2002-05-07 Danny Smith <dannysmith@users.sourceforge.net>
- * include/stdio.h (vsnprintf): Change inline to __inline__;
- (vsnwprintf): Likewise.
- * include/wchar.h (vsnwprintf): Likewise.
- (wcstof): Likewise.
- (fwide): Likewise.
- (mbsinit): Likewise.
-
- 2002-04-29 Danny Smith <dannysmith@users.sourceforge.net>
- Change FP default precison from 53 to 64-bit mantissa.
- * Makefile.in (CRT0S): Add CRT_fp8.o.
- (MINGW_OBJS): Replace CRT_fp8.o with CRT_fp10.o.
- * include/float.h: Replace standard float.h defines with
- #include_next<float.h> to use GCC's defines. Adjust comments
- to reflect change.
-
- 2002-04-26 Danny Smith <dannysmith@users.sourceforge.net>
- * include/dos.h: Change prefix "__imp_" to "_imp__" for
- __GNUC__ without __DECLSPEC_SUPPORTED.
- * include/fnctl.h: Likewise.
- * include/math.h: Likewise.
- * include/stdio.h: Likewise.
- * include/stdlib.h: Likewise.
- * include/time.h: Likewise.
- * include/wctype.h: Likewise.
- * include/ctype.h: Likewise.
-
- 2002-04-26 Danny Smith <dannysmith@users.sourceforge.net>
- Add atexit support for dlls.
- * crt1.c (atexit): Force thunk to _imp__atexit.
- (_onexit): Force thunk to _imp___onexit.
- * dllcrt1.c (DllMainCRTStartup): Initialise private atexit
- table on DLL_PROCESS_ATTACH, clean it up on DLL_PROCESS_DETACH.
- (__dll_exit): New function to run atexit-registered functions
- and flush output buffers on DLL_PROCESS_DETACH or failed
- DLL_PROCESS_ATTACH.
- (atexit): Force use of private atexit table via _dllonexit,
- (_onexit): New function. Force use of private atexit table via
- _dllonexit,
- * msvcrt.def (atexit, _onexit): Add DATA keyword so that only
- _imp_<_symbol> is visible in import lib.
- * msvcrt20.def: Likewise.
- * msvcrt40.def: Likewise.
- * crtdll.def: Likewise.
-
- 2002-04-26 Danny Smith <dannysmith@users.sourceforge.net>
- * include/fenv.h: Change header guard macro to _FENV_H_.
- (fenv_t, fexcept_t): Move into block protected by
- #ifndef RC_INVOKED.
- Cleanup some whitespace.
- * include/inttypes.h: Change header guard macro to
- _INTTYPES_H_.
-
- 2002-04-26 Danny Smith <dannysmith@users.sourceforge.net>
- * include/math.h (copysignl): Declare.
- * mingwex/Makefile.in (DISTFILES): Add copysignl.S.
- (MATHOBJS):Add copysignl.o.
-
- 2002-04-24 Danny Smith <dannysmith@users.sourceforge.net>
- * include/math.h (__signbitl, __isnanl): Declare.
-
- 2002-04-24 Danny Smith <dannysmith@users.sourceforge.net>
- * include/math.h (nanl, __fpcassifyl, fminl, fmaxl, rintl,
- roundl, truncl, fmal, log2l): Declare.
- Protect C99 declarations with _STDC_VERSION__ >= 199901L)
- || !defined __STRICT_ANSI__.
- * mingwex/fmax.c (fmax): Call __isnan, not _isnan.
- * mingwex/fmin.c (fmin): Likewise.
- * mingwex/fmaxf.c (fmaxf): Call __isnanf, not _isnan.
- * mingwex/fminf.c (fminf): Likewise.
- * mingwex/fmaxl.c: New file.
- * mingwex/fminl.c: New file.
- * mingwex/fpclassify.c (__fpclassifyf): Split out to ...
- * mingwex/fpclassifyf.c: New file.
- * mingwex/fpclassifyl.c: New file.
- * mingwex/rint.c (rintf): Split out to...
- * mingwex/rintf.c: New file.
- * mingwex/rintl.c: New file.
- * mingwex/round.c (roundf): Split out to...
- * mingwex/roundf.c: New file.
- * mingwex/roundl.c: New file.
- * mingwex/trunc.c (truncf): Split out to...
- * mingwex/truncf.c: New file.
- * mingwex/truncl.c: New file.
- * mingwex/signbit.c (signbitf): Split out to...
- * mingwex/signbitf.c: New file.
- * mingwex/signbitl.c: New file.
- * mingwex/fmal.c: New file.
- * mingwex/copysignl.S: New file.
- * mingwex/log2l.c: New file.
- * mingwex/fp_consts.c: Add nanl definition.
- Comment out unused constants.
- * mingwex/Makefile.in (DISTFILES): Add fmaxl.c, fminl.c,
- fpclassifyf.c, fpclassifyl.c, rintf.c, rintl.c, roundf.c,
- roundl.c, truncf.c truncl.c, signbitf.c signbitl.c,
- fmal.c, log2l.c
- (MATHOBJS): Add fmaxl.o, fminl.o, fpclassifyf.o,
- fpclassifyl.o, rintf.o, rintl.o, roundf.o, roundl.o,
- truncf.o truncl.o, signbitf.o signbitl.o, fmal.o,
- log2l.o.
- * mingwex/snwprintf.c (snwprintf, vsnwprintf): Correct typo.
-
- 2002-04-23 Danny Smith <dannysmith@users.sourceforge.net>
- Make wide char versions of opendir and friends.
- * include/dirent.h (_wdirent, _WDIR): Define wide versions of
- struct dirent, DIR.
- (_wopendir,_wreaddir,_wclosedir,_wrewinddir,_wtelldir,
- _wseekdir): Add prototypes for wide versions of corresponding
- standard functions.
- * include/tchar.h; Add _UNICODE mappings for dirent.h
- structures and functions.
- * mingwex/dirent.c: Make _UNICODE neutral.
- * mingwex/wdirent.c: New file to define _UNICODE before
- including dirent.c.
- * mingwex/Makefile.in (DISTFILES): Add wdirent.c.
- (POSIX_OBJS): Add wdirent.o.
- (wdirent.o): Specify dependency on dirent.c as well as
- wdirent.c.
- * samples/dirent/wtest.c: New file, wide version of test.c.
-
- 2002-04-17 Danny Smith <dannysmith@users.sourceforge.net>
- * Makefile.in (INCLUDES): Add "-iwithprefixbefore include" to
- ensure gcc include dir is searched despite -nostdinc.
- * profile/Makefile.in (INCLUDES): Likewise.
- * mingwex/Makefile.in (INCLUDES): Likewise.
- * include/stdarg.h: Replace with stub that just guards the
- real gcc system header with #ifndef RC_INVOKED
- * include/varargs.h: Likewise.
- * include/stddef.h: Likewise.
- * include/stdio.h: Include stdarg.h after defining
- __need___va_list.
- (__VALIST): Define as __gnuc_va_list if __GNUC__, else char*.
- Replace va_list with __VALIST throughout.
-
- 2002-04-17 Danny Smith <dannysmith@users.sourceforge.net>
- * crt1.c: Revert changes of 2002-04-16. Use _fpreset again.
- * msvcrt.def (_fpreset): Mark as DATA so that only
- _imp___fpreset is exported.
- * msvcrt20.def (_fpreset): Likewise.
- * msvcrt40.def (_fpreset): Likewise.
- * crtdll.def (_fpreset): Likewise.
- * CRT_fp10.c (_fpreset): Overide library _fpreset with one
- that calls fninit.
- (fpreset): Add alias.
- (__CRT_PC): Delete definition. _fpreset does it now.
- * CRT_fp8.c (_fpreset): Force use of library _imp___fpreset.
- (fpreset): Add alias.
- (__CRT_PC): Delete definition.
- * moldname.def.in: Comment out fpreset.
- * moldname-msvcrt.def: Regenerate.
- * moldname-crtdll.def: Regenerate.
- * include/fenv.h (FE_DFL_ENV): Define as (fenv_t*)0.
- * mingwex/fesetenv.c (FE_DFL_ENV): Use it to set environment
- with the _fpreset determined by startup CRT_fp object.
-
- 2002-04-16 Danny Smith <dannysmith@users.sourceforge.net>
- * CRT_fp8.c: New file.
- * CRT_fp10.c: New file.
- * crt1.c (__CRT_PC) Declare.
- (__CRT_fesetenv): New static function, using _CRT_PC.
- (__mingw_CRTStartup):Use __CRT_fesetenv instead of _fpreset.
- (_gnu_exception_handler): Likewise.
- * Makefile.in (CRT0S): Add CRT_fp10.o.
- (MINGW_OBJS): Add CRT_fp8.o.
- (SRCDIST_FILES): Add CRT_fp8.c, CRT_fp10.c.
- Add CRT_fp8.o, CRT_fp10.o dependancies.
- * include/float.h (_fpreset): Expand comment.
- * include/fenv.h (FE_PC64_ENV): New define for Intel x87
- (extended precison) environmemt.
- (FE_PC53_ENV): New define for MSVCRT default environmemt.
- (FE_DFL_ENV): Define as FE_PC53_ENV.
- * mingwex/fesetenv.c: Use FE_PC53_ENV, FE_PC64_ENV to determine
- precision control for default environment.
-
- * include/math.h: Fix long comment line.
- * profile/configure.in (CRT0S): Set to both gcrt1.o and gcrt2.o
- for mingw.
- * profile/configure: Regenerate.
-
- 2002-04-12 Danny Smith <dannysmith@users.sourceforge.net>
- * mingwex/Makefile.in (DISTFILES): Add suffix to wcstof.c.
-
- 2002-04-10 Danny Smith <dannysmith@users.sourceforge.net>
- * mingwex/mingw-fseek.c: New file, based on Mumit Khan
- mingw-local patch to binutils.
- Sun Nov 7 04:27:07 1999 Mumit Khan <khan@xraylith.wisc.edu>
- (__mingw_fseek): New function to work around Win9x f/lseek bug.
- (__mingw_fwrite): Likewise.
- (__mingw_is_win9x): New helper function.
- * include/stdio.h (__USE_MINGW_FSEEK): New define,guarding...
- (__mingw_fseek): New prototype and define to replace fseek.
- (__mingw_fwrite): New prototype and define to replace fwrite.
- * mingwex/Makefile.in: Add mingw-fseek.o to libmingwex.a.
- * moldname-crtdll.def: Remove CR from end of line.
- * moldname-msvcrt.def: Ditto.
-
- 2002-04-09 Danny Smith <dannysmith@users.sourceforge.net>
- * profile/configure.in (CRT0S): Configure name of gcrt?.o
- based on target, building gcrt0.o for cygwin -mno-cygwin.
- * profile/configure: Regenerate.
- * profile/Makefile.in (CRT0S): Use name from configure.
- (gcrt0.o): New rule.
- (ALL_CRT0S): New define, used to cleanup all gcrt?.o's.
-
- 2002-04-04 Danny Smith <dannysmith@users.sourceforge.net>
- * include/math.h (_controlfp, _control87, _clearfp, _statusfp, _fpreset,
- _fpecode): Remove prototypes copied from float.h.
- (nan, nanf): Move into block protected against RC_INVOKED
- and __cplusplus.
- * include/stdlib.h (_Exit): Change from static inline to
- extern inline.
- * mingwex/_Exit.c : New file.
- * mingwex/Makefile.in: Add _Exit.o to libmingwex.a.
-
- 2002-04-04 Danny Smith <dannysmith@users.sourceforge.net>
- Add libgmon.a and libmingwex.a for cygwin -mno-cygwin.
- * configure.in (SUBDIRS): Add profile and mingwex to cygwin target.
- (configdirs): Likewise.
- (LIBGMON_A): Define for cygwin target as well.
- * configure: Regenerate.
- * profile/configure.in (THREAD_DLL): Remove define.
- (LIBM_A): Remove define.
- (LIBGMON_A): Define for cygwin target as well.
- * profile/configure: Regenerate.
- * profile/makefile.in (install): Install to inst_libdir and
- inst_includedir.
- * mingwex/makefile.in (CFLAGS): Move -fomit-frame-pointer to...
- (OPTFLAGS): New define.
- (ALL_CFLAGS): Add $(OPTFLAGS).
- (ALL_CXXFLAGS): Same.
- (.c.o:): Remove ALL_CXXFLAGS.
-
- 2002-03-29 Danny Smith <dannysmith@users.sourceforge.net>
- * include/stdint.h: Add missing newline at eof.
- * include/stdio.h (snprintf): Add prototype.
- (vsnprintf): Add prototype and inline definition.
- (snwprintf): Add prototype.
- (vsnwprintf): Add prototype and inline definition.
- * include/wchar.h (snwprintf): Add prototype.
- (vsnwprintf): Add prototype and inline definition.
- * mingwex/Makefile.in: Add snprintf.o, snwprintf.o
- to libmingwex.a.
- * mingwex/snprintf.c: New file.
- * mingwex/snwprintf.c: New file.
-
- 2002-03-22 Danny Smith <dannysmith@users.sourceforge.net>
- * configure.in: Add mingwex as SUBDIRS and configdirs.
- * configure: Regenerate.
- * Makefile.in (MINGW_OBJS): Remove dirent.o.
- (SRC_DIST_FILES): Remove dirent.c.
- * dirent.c: Remove.
- * include/stdlib.h (_Exit): Add static inline
- function.
- (struct lldiv_t): Define.
- (lldiv): Add prototype.
- (llabs): Add extern inline function.
- (strtoll,strtoull): Add prototypes.
- (wcstol, wcstoul, wcstod): Group together.
- (strtof, wcstof): Add extern inline definitions.
- (atoll,lltoa,ulltoa, wtoll, lltow ulltow): Add prototypes
- and extern inline definitions.
- * include/wchar.h (fwide, wcstoll,wcstoull, wmemchr
- wmemcmp, wmemcpy, wmemmove, wmemset. mbsinit): Add
- prototypes.
- (wcstol, wcstoul,wcstod): Copy prototypes from stdlib.h.
- (wcstof): Add extern inline definition.
- * include/math.h (nan, nanf): Add prototypes.
- (NAN, INFINITE): Define constants.
- (fpclassify, isnan ,signbit): Add macros and supporting float
- and double functions.
- (isfinite, isinf, isnormal): Add macros.
- (isgreater, isless, isgreaterequal, islessequal,islessgreater):
- Add macros.
- (rint, rintf, round, roundf, trunc. truncf, fmax, fmaxf,
- fmin, fminf, fma, fmaf, log2, log2f): Add prototypes.
- (copysign, logb, nextafter, scalb): Add prototypes and
- inline stubs for underscored versions in msvcrt.dll.
- * include/inttypes.h: New file.
- * include/fenv.h: New file
-
- Add new mingwex subdir and files.
- * mingwex: New directory.
- * mingwex/Makefile.in: New file.
- * mingwex/configure.in: New file.
- * mingwex/configure: Generate.
- * mingwex/dirent.c: Moved here from parent dir.
- * mingwex/atoll.c: New file.
- * mingwex/feclearexcept.c: New file.
- * mingwex/fegetenv.c: New file.
- * mingwex/fegetexceptflag.c: New file.
- * mingwex/fegetround.c: New file.
- * mingwex/feholdexcept.c: New file.
- * mingwex/feraiseexcept.c: New file.
- * mingwex/fesetenv.c: New file.
- * mingwex/fesetexceptflag.c: New file.
- * mingwex/fesetround.o: New file.
- * mingwex/fetestexcept.c: New file.
- * mingwex/feupdateenv.c: New file.
- * mingwex/fma.S: New file.
- * mingwex/fmaf.S: New file.
- * mingwex/fmax.c: New file.
- * mingwex/fmaxf.c: New file.
- * mingwex/fmin.c: New file.
- * mingwex/fminf.c: New file.
- * mingwex/fp_consts.c: New file.
- * mingwex/fpclassify.c: New file.
- * mingwex/fucom.c: New file.
- * mingwex/fwide.c: New file.
- * mingwex/imaxabs.c: New file.
- * mingwex/imaxdiv.c: New file.
- * mingwex/isnan.c: New file.
- * mingwex/isnanf.c: New file.
- * mingwex/lltoa.c: New file.
- * mingwex/lltow.c: New file.
- * mingwex/log2.c: New file.
- * mingwex/log2f.c: New file.
- * mingwex/math_stubs.c: New file.
- * mingwex/mbsinit.c: New file.
- * mingwex/rint.c: New file.
- * mingwex/round.c: New file.
- * mingwex/signbit.c: New file.
- * mingwex/sitest.c: New file.
- * mingwex/strtof.c: New file.
- * mingwex/strtoimax.c: New file.
- * mingwex/strtoumax.c: New file.
- * mingwex/testwmem.c: New file.
- * mingwex/trunc.c: New file.
- * mingwex/ulltoa.c: New file.
- * mingwex/ulltow.c: New file.
- * mingwex/wcstof.c: New file.
- * mingwex/wcstoimax.c: New file.
- * mingwex/wcstoumax.c: New file.
- * mingwex/wmemchr.c: New file.
- * mingwex/wmemcmp.c: New file.
- * mingwex/wmemcpy.c: New file.
- * mingwex/wmemmove.c: New file.
- * mingwex/wmemset.c: New file.
- * mingwex/wtoll.c: New file.
-
-2002-04-20 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/mbstring.h: New file.
- * include/mbctype.h: New file.
-
-2002-04-20 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/tchar.h (__TEXT): Make same as define in
- w32api/include/winnt.h.
-
-2002-04-20 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/tchar.h (_tputenv): Add UNICODE mappings.
- (_tsearchenv): Likewise.
- (_tmakepath): Likewise.
- (_tsplitpath): Likewise.
- (_tfullpath): Likewise.
-
-2002-04-18 Pascal Obry <obry@gnat.com>
-
- * dirent.c (opendir): Convert given pathname to
- absolute pathname.
-
-2002-04-09 Earnie Boyd <earnie@users.sf.net>
-
- * include/_mingw.h: Increment version.
- * Makefile.in: Ditto.
-
-2002-04-09 Earnie Boyd <earnie@users.sf.net>
-
- * moldname-crtdll.def: Remove CR from end of line.
- * moldname-msvcrt.def: Ditto.
- * Makefile.in: Use bzip2 compression for Cygwin target.
-
-2002-04-04 Danny Smith <dannysmith@sourceforge.users.net>
-
- * include/math.h (DOMAIN, SING, OVERFLOW, UNDERFLOW,
- TLOSS, PLOSS): Move oldname defines back, following
- the underscored names.
-
-2002-03-29 Danny Smith <dannysmith@sourceforge.users.net>
-
- * include/stdio.h (_snwprintf): Correct spelling.
- (_vsnwprintf): Likewise.
- * include/wchar.h (_snwprintf): Correct spelling.
- (_vsnwprintf): Likewise.
-
-2002-03-26 Danny Smith <dannysmith@users.sourceforge.net>
-
- * moldname.def.in (__MSVCRT__): Replace with !(__CRTDLL__).
- (wpopen): Add if !(__CRTDLL__).
- * Makefile.in (moldname-msvcrt.def rule): Use -C, not -c to
- preserve comments.
- (moldname-crtdll.def rule): Likewise.
- * moldname-msvcrt.def: Regenerate.
- * moldname-crtdll.def: Regenerate.
- * include/stdio.h (wpopen):Use prototype, not a define.
- (_swnprintf): Add prototype.
- (_vswnprintf): Likewise.
- Tidy up whitespace.
- * include/wchar.h (_swnprintf): Add prototype.
- (_vswnprintf): Likewise.
- Tidy up whitespace.
-
-2002-01-28 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/malloc.h (_heapinfo): Correct structure definition.
- (_USEDENTRY,_FREEENTRY): Add defines.
- Add comment on platform support for _heap* functions.
- (_get_sbh_threshold): Add prototype.
- (_set_sbh_threshold): Likewise.
- (_expand): Likewise.
-
-2002-01-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * profile/profil.c: Update copyright info.
- * profile/profil.h: Likewise.
- * profile/gcrt0.c: Likewise.
-
-2002-01-25 Pascal Obry <obry@gnat.com>
-
- * profile/profil.h (PROFADDR): Cast idx to unsigned long long to
- avoid overflow.
- * profile/gmon.c: Define bzero as memset if mingw32.
- (monstartup): Use it.
-
-2002-01-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/tchar.h (_TCHAR): Add missing ;.
-
-2002-01-25 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/tchar.h (_TCHAR): Add typedefs.
-
-2002-01-16 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdlib.h (_onexit_t): Add typedef.
- (_onexit): Add prototype.
-
-2002-01-12 Danny Smith <dannysmith@users.sourceforge.net>
-
- * msvcrt.def: Revert accidental change.
- * include/stdlib.h: Ditto.
-
-2001-12-07 Earnie Boyd <earnie@users.sf.net>
-
- * Makefile.in: Increment VERSION.
- * include/_mingw.h: Ditto.
-
-2001-12-05 Earnie Boyd <earnie@users.sf.net>
-
- * include/strings.h: New File.
-
-2001-12-02 Danny Smith <dannysmith@users.sourceforge.net>
-
- Apply patches from:
- 2001-06-21 Mumit Khan <khan@nanotech.wisc.edu>
-
- * include/math.h (_FPCLASS* ): Add defines from float.h.
- (IEEE recommended functions): Add declarations from float.h.
- * include/float.h (_FPCLASS* ): Protect against redefinition.
-
-2001-11-29 Wu Yongwei <adah@netstd.com>
-
- * include/_mingw.h,assert.h,conio.h,ctype.h,dir.h,direct.h
- dirent.h,dos.h,errno.h,excpt.h,fcntl.h,float.h,io.h,
- limits.h,locale.h,malloc.h,math.h,process.h,setjmp.h,
- share.h,signal.h,stdarg.h,stddef.h,stdint.h,stdio.h,
- stdlib.h,string.h,tchar.h,time.h,varargs.h,wchar.h,
- wctype.h,sys/stat.h,sys/timeb.h,sys/types.h,sys/utime.h:
- Correct spelling of "disclaimed" in comments.
- * include/excpt.h: Another spelling correction.
-
-2001-11-08 Robert Collins <rbtcollins@hotmail.com>
-
- * include/errno.h: Fix "errno is not a prototype" warning.
-
-2001-11-07 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/ctype.h (tolower, toupper,_tolower,_toupper): Comment
- differences between ANSI and non-ANSI versions.
- (_ctype[],_pctype): Declare vars.
- (__ISCTYPE): New helper macro using _pctype.
- (is* ctype functions): Use __ISCTYPE to define inline versions.
- (_toupper, _tolower, __isascii, __toascii, __iscsym, __iscsymf):
- Inline definitions.
- (isw* ctype functions): Inline definitions.
- * include/wctype.h (_ctype[],_pctype): Declare vars.
- (isw* ctype functions): Inline definitions.
-
-
-2001-11-06 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/float.h (_clearfp, _statusfp, _fpreset, fpreset,
- __fpecode): Use __STDC__ prototypes.
-
-
-2001-11-06 Thomas Pfaff <tpfaff@gmx.net>
-
- * mthr_stub.c (__mingwthr_remove_key_dtor) New.
- * mthr_init.c (DllMain) Run dtors if a process terminates.
- * mthr.c (__mingwthr_add_key_dtor) Removed.
- (___mingwthr_add_key_dtor) New.
- (___mingwthr_remove_key_dtor) New.
- (__mingwthr_run_key_dtors) Complete rewrite.
- (__mingwthr_remove_key_dtor) New.
-
-2001-11-05 Egor Duda <deo@logos-m.ru>
-
- * Makefile.in: Delete unused executable after creating base-files.
-
-2001-11-06 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/errno.h (_errno): Use __STDC__ prototype.
- Thanks to: Jim Barton.
-
-2001-11-04 "stefan" <stefan@lkcc.org>
-
- * include/sys/locking.h (_LK_UNLCK, LK_UNLCK): Correct names.
-
-2001-10-30 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/io.h (_commit): Add declaration.
- Thanks to: "stefan" <stefan@lkcc.org>
-
-2001-10-30 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/sys/stat.h: Make S_IS* macros safer.
-
-2001-10-27 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdlib.h (EXIT_FAILURE): Change value to 1.
-
-2001-10-12 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdlib.h (__p__environ, __p__wenviron): Use
- __STDC__ prototypes.
-
-2001-09-19 Earnie Boyd <earnie@SF.net>
-
- * Makefile.in: Remove the /usr from the install target.
- (VERSION): Increment.
- include/_mingw.h: Ditto.
-
-2001-09-17 Earnie Boyd <earnie@SF.net>
-
- * Makefile.in: Increment version.
- * include/_mingw.h: Ditto.
-
-2001-09-10 Earnie Boyd <earnie@SF.net>
-
- * dossh: Remove inadvertantly imported file.
-
-2001-09-10 Danny Smith <dannysmith@users.sourceforge.net>
-
- * dirent.c (opendir): Use GetFileAttributes rather than stat
- to determine if input arg is dir.
-
-2001-08-29 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdarg.h (va_list): Typedef as __builtin_va_list if
- __GNUC__ >= 3.
- * include/varargs.h (va_list): Ditto.
- * include/stdio.h (va_list): Ditto.
-
-2001-08-01 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/stdlib.h (_wpgmptr): Don't declare ifndef __MSVCRT__.
- * include/stdio.h (_IORW): Change constant to 0x0080.
- (TMP_MAX): Add new define.
- (_P_tmpdir): Ditto.
- (_wP_tmpdir): Ditto.
- (L_tmpnam): Change constant to 16.
-
-2001-06-28 Danny Smith <dannysmith@users.sourceforge.net>
-
- * include/malloc.h: Fix non-ANSI comment after #endif.
-
-2001-06-11 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
-
- * profile/configure.in: Make msvcrt.dll version default.
- * profile/makefile.in: Build both gcrt1.o and gcrt2.o.
- * provile/configure: Regenerate.
-
-2001-06-11 Mattia Barbon <mbarbon@dsi.unive.it>
-
- * include/stdio.h (swscanf): Make first arugument const.
- * include/wchar.h (swscanf): Ditto.
- * include/tchar.h (_tfopen): New _UNICODE define.
- (_tgetenv): Ditto.
- (_tsetlocale): Ditto.
-
-2001-06-04 Earnie Boyd <earnie@users.sourceforge.net>
-
- * profile/Makefile.in (mkinstalldirs): Correct relative path.
-
-2001-06-04 Earnie Boyd <earnie@users.sourceforge.net>
-
- * include/_mingw.h: Change version to 1.0.
- Makefile.in: Ditto.
-
-2000-02-21 Earnie Boyd <earnie@users.sourceforge.net>
-
- * include/tchar.h: (__TEXT): Remove undef.
- (_TEXT): Ditto.
- (_T): Ditto.
-
-Fri Feb 2 10:34:07 2001 Earnie Boyd <earnie@users.sourceforge.net>
-
- * include/tchar.h: (__TEXT): Add private macro.
- (_TEXT): Modify definition to use __TEXT.
- (_T): Ditto.
- This change allows the passing of a MACRO as an argument and have that
- MACRO resolved first.
- Thanks to: Eric PAIRE <eric.paire@ri.silicomp.com>
-
-Wed Jan 31 17:12:51 2001 Earnie Boyd <earnie@users.sourceforge.net>
-
- * Makefile.in: Increment version to 0.5
- * include/_mingw.h: Increment minor version
-
-Tue Jan 30 13:01:01 2001 Earnie Boyd <earnie@users.sourceforge.net>
-
- * include/assert.h: (assert): Remove ; from end of definition
- Thanks to: AJ Reins <tbisp@qwest.net>
-
-Tue Jan 30 07:31:22 2001 Earnie Boyd <earnie@users.sourceforge.net>
-
- * include/time.h: (CLOCKS_PER_SEC): Type cast the constant.
- Thanks to: Cosmin Truta <cosmin@cs.toronto.edu>
-
-Mon Jan 29 14:03:07 2001 Earnie Boyd <earnie@users.sourceforge.net>
-
- * time.h: (CLOCKS_PER_SEC) Change from FP to integer constant.
-
-Sun Jan 28 13:01:08 2001 Earnie Boyd <earnie@users.sourceforge.net>
-
- * include/wchar.h: The 2001.01.18 Change was incorrect. The functions
- are actually C functions. These functions are resolved via the
- -lmsvcp60 library and comments were placed in the header.
-
-2001-01-28 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
-
- * include/stdlib.h (__p__pgmptr): add prototype.
- (__p__wpgmptr): likewise.
- (_pgmptr_dll): move declaration from dos.h.
- (_wpgmptr_dll): likewise.
- (_pgmptr): conditional define (MSVCT/CRTDLL).
- (_wpgmptr): likewise.
- * include/dos.h (_base*_dll variables): declare only for CRTDLL.
- (_os*_dll variables): likewise.
- (_pgmptr_dll): remove declaration and associated defines to stdlib.h.
- (_wpgmptr_dll): likewise.
-
-2001-01-22 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
-
- * include/stdint.h: New file.
-
-Thu Jan 18 10:33:01 2001 Earnie Boyd <earnie@users.sourceforge.net>
-
- * include/wchar.h: Protect prototypes only declared in the C++ STL
- from being declared unless __cplusplus is defined.
-
-Tue Jan 16 11:37:31 2001 Earnie Boyd <earnie@users.sourceforge.net>
-
- * include/stdlib.h: Apply Danny Smith patch 102730
- 2000-12-09 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
- (_wgetenv) Correction to return type.
-
-Tue Jan 16 09:41:41 2001 Earnie Boyd <earnie@users.sourceforge.net>
-
- * include/locale.h: Apply Danny Smith patch 101834
- 2000-11-23 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
- (LC_MIN) Add definition.
- (LC_MAX) ditto.
- (_wsetlocale) Add prototype.
-
-2000-11-29 Earnie Boyd <earnie_boyd@yahoo.com>
-
- * Makefile.in: eliminate the need for RUNTIME and CRT_ID.
- Always build crt1.o, dllcrt1.o, crt2.o and dllcrt2.o.
- Create a libcoldname.a for the oldname library for CRTDLL.
- Restrict libmoldname.a for the oldname library for MSVCRT.
- * configure.in: eliminate setting RUNTIME and CRT_ID variables.
- Restructure the $target_os case logic.
- Always name the MinGW thread dll helper mingwm.
- Change Cygwin's HEADER_SUBDIR value from mingw32 to mingw.
- * configure: regenerate.
-
-2000-11-22 Earnie Boyd <earnie_boyd@yahoo.com>
-
- * Makefile.in: Fix bindist target to distribute the correct files.
- Remove the use of SNAPSHOT variable and test SNAPDATE instead.
- Set SNAPDATE within the snapshot target on recursive call to $(MAKE).
-
-2000-11-21 Earnie Boyd <earnie_boyd@yahoo.com>
-
- * Makefile.in: Add missing line continuation `\' for $(SUBDIRS) target.
- Add variables and targets to control binary and source distributions.
- Add variables and targets to control snapshot distribution.
- * profile/gmon.h: Add missing #endif for #ifndef.
- * profile/ChangeLog: Merge entries here and remove.
- * profile/Makefile.in: Add variables and targets to control
- distribution.
- * README: Add.
- * TODO: ditto.
- * config.guess: ditto.
- * config.sub: ditto.
- * mkinstalldirs: ditto.
- * install-sh: ditto.
- * configure: regenerate.
- * profile/configure: ditto.
-
-2000-11-20 Earnie Boyd <earnie_boyd@yahoo.com>
-
- * Merge in changes from
- 2000-10-23 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
- * include/direct.h: add guard around MSVCRT-only prototytpes
- * include/io.h: add __int64 struct definitions and function prototypes;
- add guard for MSVCRT-only prototypes
- * include/limits.h: add ISO C9x macros LLONG_MIN, LLONG_MAX, ULLONG_MAX
- * include/stdio.h: add wchar function prototypes (__MSVCRT__);
- put wchar functions together to make sync with wchar.h easier
- * include/stdlib.h: add wide char functions (__MSVCRT__)
- * include/string.h: add string collation functions ( __MSVCRT__)
- * include/sys/stat.h: add __int64 struct and function ( __MSVCRT__)
- * include/tchar.h: add macros and macro function definitions
- * include/wchar.h: add wide char function prototypes ( __MSVCRT__ );
- enclose more functions in __MSVCRT__ guard;
- some oldname wide char function prototypes #if (0)'d
- * profile/gmon.h: add guard around BSD-ish typedefs
-
-Mon Nov 20 18:58:12 2000 Christopher Faylor <cgf@cygnus.com>
-
- * Makefile.in: Use a different variable name for subdirectory since the
- previous one was used by the top level make.
-
-Sun Nov 19 20:50:51 2000 Christopher Faylor <cgf@cygnus.com>
-
- * Makefile.in: Install mingw stuff in a subdirectory if building under
- cygwin.
-
-Sat Jun 17 21:48:23 2000 Christopher Faylor <cgf@cygnus.com>
-
- * Makefile.in (subdirs): Eliminate for loop.
-
-Sat Jun 17 18:27:59 2000 Christopher Faylor <cgf@cygnus.com>
-
- * Makefile.in (subdirs): Previous change did not fix problem in
- broken shells.
-
-Sat Jun 17 13:49:12 2000 Christopher Faylor <cgf@cygnus.com>
-
- * Makefile.in: Avoid installing dll if we're cross building and the
- cross-host system isn't a Windows system.
- * configure.in: Detect cross-hosting situation and set appropriate
- variables in Makefile.in.
- * configure: Regenerate.
-
-Wed Apr 19 13:10:54 2000 Christopher Faylor <cgf@cygnus.com>
-
- * configure.in: Change HEADER_SUBDIR to mingw32.
- * configure: Regenerate.
-
-Mon Apr 10 17:24:28 2000 Christopher Faylor <cgf@cygnus.com>
-
- * include/string.h: Use proper prototype for _strerror.
-
-2000-03-30 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Makefile.in (subdirs): Workaround for broken shells.
-
-2000-02-03 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Snapshot 2000-02-03.
-
- * include/{assert.h, conio.h, ctype.h, direct.h, dirent.h, fcntl.h,
- float.h, io.h, locale.h, malloc.h, math.h, process.h, signal.h,
- stdio.h, stdlib.h, string.h, time.h, wctype.h, sys/stat.h,
- sys/timeb.h, sys/utime.h}: Remove parameter names to avoid namespace
- pollution.
-
- * Makefile.in (all): Build CRT0S first.
- (libmingwthrd.a): Remove thread support DLL from dependency.
-
-2000-01-21 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Snapshot 2000-01-21.
-
-2000-01-20 Mumit Khan <khan@xraylith.wisc.edu>
-
- Merge in changes from Cygwin:
- * configure.in (HEADER_SUBDIRS): New variable. Substitute.
- (SUBDIRS): Likewise.
- * Makefile.in (HEADER_SUBDIRS): New variable.
- (install): Use to install Mingw headers to a subdirectory if building
- under Cygwin.
- (DLL_CC_STUFF): Add DLL entry point.
- * configure: Regenerate.
-
-2000-01-19 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/stdio.h (fsetpos): Fix prototype.
- (fpos_t): Fix for MSVCRT.
- * include/float.h (fpreset): Add prototype.
- * include/limits.h: Define UINT_MAX, USHRT_MAX and ULONG_MAX with
- constant values.
- * include/time.h: Don't define tzname as a macro for CRTDLL, and
- export using libmoldname.a.
- * crtdll.def: Add DATA tags.
- * msvcrt.def: Likewise.
- * moldname.def.in: Likewise. Add fpreset. Export tzname for
- both MSVCRT and CRTDLL.
- * moldname-crtdll.def: Regenerate.
- * moldname-msvcrt.def: Regenerate.
-
-Tue Dec 21 02:22:14 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Snapshot 1999-12-21.
-
- * include/wctype.h: New file.
- * include/ctype.h (MB_CUR_MAX): Define.
- (wctype_t): Guard.
- * include/stdlib.h (MB_CUR_MAX): Define.
- * include/wchar.h: Define stat, _stat structures here as well.
- * include/float.h: Add invalid subconditions (_SW) and floating
- point error (_FPE) macros.
- * include/time.h (_CLOCK_T): Rename macro to _CLOCK_T_DEFINED.
- (_TIME_T): Rename macro to _TIME_T_DEFINED.
- * include/sys/types.h: Likewise.
-
-Thu Nov 18 00:22:26 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * profile/profil.c (profile_on): Set the profiler thread priority to
- be time critical. Thanks to Pascal Obry <pascal_obry@csi.com>.
- * Snapshot 1999-11-18.
-
-Sun Nov 7 02:50:09 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- Released 1999-11-07.
-
- * Makefile.in (CRT0S): Add crtst.o.
- (install): Install in subdirs as well.
- * dirent.h (struct _stat): Rename from struct stat.
- * include/tchar.h: Add some new macros. Thanks to
- Eric Kohl <ekohl@abo.rhein-zeitung.de>.
- * profile/Makefile.in (install): Fix target.
-
-Thu Nov 4 14:32:58 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Makefile.in: Add support for profile directory.
- * configure.in: Likewise.
- * configure: Regenerate.
-
- * profile: Imported profiling sources from winsup-19991026 snapshot.
- * profile/Makefile.in: New file.
- * profile/configure.in: New file.
- * profile/configure: Generate.
- * profile/gcrt0.c (u_char, u_short, u_int, u_long): typedef for Mingw.
- * profile/gmon.h (u_char, u_short, u_int, u_long): Likewise.
- * profile/gmon.c (unistd.h): Include conditionally.
- (sys/param.h): Likewise.
- * profile/mcount.c (sys/param.h): Likewise.
- * profile/profil.c (profile_on): thread id is DWORD, not int.
-
-
-Wed Nov 3 16:26:44 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/stdlib.h: Add wide character version of argv/environ.
- Formatting changes.
- * include/wchar.h: More wide character prototypes.
- * include/sys/stat.h: Likewise. Add struct stat as well as _stat.
-
- * dllcrt1.c (init.c): Don't include.
- (DllMainCRTStartup): Don't call _mingw32_init_mainargs().
- * Makefile.in: Remove init.c from dllcrt{1,2}.c dependency lists.
-
-Sat Oct 30 03:06:26 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * moldname.def: Remove file.
- * moldname.def.in: And add this.
- * moldname-msvcrt.def: Generate from moldname.def.in.
- * moldname-crtdll.def: Likewise.
-
- * mthr.c: New file for -mthread (thread-safe C++ EH) support.
- * mthr_init.c: New file for -mthread (thread-safe C++ EH) support.
- * mthr_stub.c: New file for -mthread (thread-safe C++ EH) support.
-
- * Makefile.in: Update.
- * configure.in: Likewise. Also add *cygwin* target for building
- under Cygwin winsup.
- * configure: Regenerate.
-
-Fri Oct 1 11:10:30 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/_mingw.h: Add version macros.
- * include/direct.h (_diskfree_t, getdiskfree, getdrives): Add.
- Also add wide character versions shared with wchar.h.
- * include/dos.h (_diskfree_t, getdiskfree, getdrives): Add.
- * include/io.h (sopen, _sopen): Fix prototype.
- Add wide character prototypes.
- * include/wchar.h: Likewise.
- * include/stdlib.h (beep, seterrormode, sleep): Remove non-
- underscored versions. Potential incompatibility.
- * include/time.h (daylight, timezone, tzname): Fix MSVCRT cases.
- Add wide character prototypes.
- * include/sys/timeb.h (struct _timeb): Don't use macro, but real
- definition.
-
-Wed Aug 18 18:38:39 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * configure.in (RUNTIME, CRT_ID): Add to differentiate between
- crtdll and msvcrt runtimes. Remove DLL_ENTRY and DEF_DLL_ENTRY
- macros.
- * configure: Rengerate.
- * Makefile.in (RUNTIME, CRT_ID): Use to generate the correct
- dll name and crt's. CRTDLL and MSVCRT are meant to created
- separately, so remove all the *-msvcrt* targets.
- (libmingwthr.a): New target. Dummy thread support archive.
- (LIBS): Add libmingwthr.a.
- (CRT0S): Use CRT_ID. Add crtmt.o.
- (MINGW_OBJS): Add crtst.o.
- * main.c (WinMain): Fix prototype.
- * crtmt.c: New file.
- * crtst.c: New file.
-
- * include/process.h (_beginthreadex): Fix prototype.
- * include/_mingw.h (__int64): Define for __GNUC__.
- * include/tchar.h (_ttol): Add macro.
- * include/stdlib.h (_wtoi, _wtol, _i64toa, _ui64toa, _atoi64,
- _i64tow, _ui64tow, _wtoi64): Add prototypes.
-
- Reported by Emanuele Aliberti <ea@iol.it>:
- * include/tchar.h (_ttoi): Add macro.
-
- Reported by Ulf Moeller <3umoelle@informatik.uni-hamburg.de>:
- * include/stdio.h (_snprintf): Add prototype.
- (_vsnprintf): Likewise.
-
-Sat Aug 7 18:00:00 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- Reported by Tor Lillqvist <tml@iki.fi>:
- * include/stdlib.h (__p___argv): Fix return type.
-
-Fri Jul 30 22:07:06 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- Add UWIN support.
- * include/errno.h (errno): It's linked in from startup, not imported.
- * include/stdlib.h (errno): Likewise.
- * include/io.h: Guard against conflicting macros and prototypes in
- system headers.
- * include/stdlib.h: Likewise.
- * include/string.h: Likewise.
- * include/time.h: Likewise.
-
-Fri Jul 30 13:47:34 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/io.h (X_OK): Fix definition. Thanks to Jan Nijtmans.
- * include/dos.h: Fix typo __MINGW_EXPORT->__MINGW_IMPORT.
- * Makefile.in (INCLUDES): Remove old windows32 include directory.
-
- * crt1.c (_gnu_exception_handler): Fix prototype.
- (__mingw_CRTStartup): New function based on mainCRTStartup.
- (mainCRTStartup): Set the app type for MSVCRT and call
- __mingw_CRTStartup.
- (WinMainCRTStartup): Likewise.
- * init.c (_startupinfo): Define.
- (_getmainargs): Add 5th parameter.
- (_mingw32_init_mainargs): Use.
-
- * ALL *.c files: Reformat according to GNU coding style.
-
-Fri Jul 16 00:46:04 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Makefile.in (INCLUDES): Add w32api include directory.
-
- * include/_mingw.h: New file.
- * include/{assert.h,conio.h,ctype.h,direct.h,dirent.h,dos.h,
- errno.h,excpt.h,fcntl.h,float.h,io.h,limits.h,locale.h,malloc.h,
- math.h,process.h,setjmp.h,share.h,signal.h,stdarg.h,stdio.h,
- stdlib.h,string.h,tchar.h,time.h,varargs.h,sys/locking.h,
- sys/stat.h,sys/timeb.h,sys/types.h,sys/utime.h}: Include and
- use the macros __DECLSPEC_SUPPORTED and __MINGW_IMPORT.
-
- * include/stdlib.h (atexit): Fix prototype.
-
-Mon Jun 14 18:38:49 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/stdio.h (_tempnam): Fix prototype.
- (tempnam): Likewise.
- * include/stdlib.h: Replace with GCC's version, and guard
- with RC_INVOKED.
-
- From Anders Norlander <anorland@hem2.passagen.se>:
- * include/stdlib.h (__argc): Declare.
- (__argv): Likewise.
-
-Mon Apr 5 13:49:17 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * crt1.c (_gnu_exception_handler): Acknowledge Jacob Navia's
- contribution.
- * Makefile.in (_libm_dummy.o): New target.
- (libm.a): Use.
-
-Tue Mar 16 18:15:26 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Released 1999-03-16 along with egcs-1.1.2.
-
-Wed Feb 17 17:15:56 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Makefile.in (LIBS): Add libm.a.
- (libm.a): Dummy libm.a.
-
- * Makefile.in: Update from winsup 1999-02-08 snapshot.
- Preserve local changes.
- (mkinstalldirs): In ../, not ../../.
- (INCLUDES): Point to local windows32api headers and use -nostdinc.
- (LIBGCC): Delete.
- (LIBS): Add libmoldname-msvc.a.
- (libmoldname-msvc.a): Add target.
- (distclean): Add target.
-
-Tue Feb 9 00:26:05 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/dir.h: Reintroduce as an obsolescent header.
- * crt1.c (signal.h): Include.
- (_gnu_exception_handler): New function to properly handle win32
- asynchronous signals.
- (mainCRTStartup): Use.
-
-Sun Jan 3 23:52:25 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/direct.h: Include io.h instead of dir.h
- * include/dirent.h: Likewise.
- * include/dos.h: Likewise.
- * include/stdio.h: Replace reference to dir.h with io.h.
-
-Thu Dec 31 16:04:55 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * 1999-01-01 release bundled with egcs-1.1.1.
-
- * include/io.h: Incorporate dir.h.
- * include/dir.h: Remove.
- * include/signal.h: Move RC_INVOKED up a bit.
-
-Tue Dec 29 15:04:38 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/signal.h (sig_atomic_t): Define.
- (NSIG): Define.
- * include/malloc.h: Import defs from deprecated alloc.h.
- * include/alloc.h: Remove.
-
- From "Daniel J. Rodriksson" <djr@dit.upm.es>:
- * include/sys/types.h (_dev_t): Should be unsigned int for MSVCRT.
- * include/sys/stat.h (struct stat): st_uid is of type short. Use
- _off_t instead of long for st_size.
-
-Thu Sep 10 22:28:49 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/errno.h (sys_errlist, sys_nerr): Move from here ...
- * include/stdlib.h: Here.
-
- * include/netdb.h: Remove.
- * include/arpa/inet.h: Remove.
- * include/netinet/in.h: Remove.
- * include/sys/socket.h: Remove.
-
-Fri Sep 4 15:09:11 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Release egcs-1.1.
-
- * include/{ctype.h,dos.h,io.h,string.h,time.h,sys/types.h,
- sys/utime.h}: Protect stddef.h in RC_INVOKED macro.
-
-Thu Sep 3 10:43:29 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * setjmp.h (_JBTYPE, _JBLEN): Define correctly.
- (jmpbuf): typedef using above.
- (setjmp, longjmp): Prototype using jmpbuf.
-
- Merge with Colin Peters' 980701 snapshot. I've ignored changes to
- obsolescent imported names, ie., from __imp__ to _imp___.
-
- Also ignored empty include/sys/param.h and incorrect
- include/sys/times.h.
-
- * CRTinit.c: New file.
- * include/{errno.h,fcntl.h,math.h,process.h} (__MSVCRT__): Use #ifdef
- instead of #if.
- * include/io.h (umask): Fix prototype.
- * include/stdlib.h (OS constants): Replace with Colin's.
- * include/time.h (tzset, daylight, timezone): Replace with Colin's.
- * include/sys/state.h: Merge.
-
-Thu Sep 3 09:49:07 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/assert.h (assert): Lose the trailing semicolon.
-
-Thu Jul 30 21:18:49 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/math.h (matherr): Declare.
- * include/stdio.h (fileno, _fileno): Declare.
- * include/stdlib.h (environ, _environ): Fix to use runtime DLL.
-
- From Earnie Boyd:
- * include/stdio.h (fdopen, _fdopen): Add const.
- (getw, putw): Declare.
- * include/stdlib.h (MAX_{DRIVE,DIR,FNAME,EXT}): Fix.
-
-Sat Jun 13 18:19:41 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/time.h (_timezone): Undefine.
- * include/sys/timeb.h (struct timeb): Rename _timezone to timezone.
-
- * include/time.h (_daylight, _timezone, _tzname, _tzset): Remove
- __cdecl for MSVCRT.
- * include/stdlib.h (environ): Use DLL version.
- * init.c (environ): Undefine it before use.
-
-Sun Mar 22 19:59:30 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Update to 980309 snapshot from Colin Peters.
-
- * include/utime.h: remove
- * include/stdlib.h (__imp__osver_dll, __imp__winver_dll,
- __imp__winmajor_dll, __imp__winminor_dll): Apply Jan-Jaap's
- patches to define these.
- * include/time.h (CLK_TCK): Renamed from CLK_TICK.
- (_daylight, _timezone, _tzname, _tzset): Define.
-
- * include/netdb.h: Add from Colin's windows32api changes.
- * include/sys/socket.h: Likewise.
- * include/arpa/inet.h: Likewise.
- * include/netinet/in.h: Likewise.
-
-Wed Feb 4 14:16:44 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Update to 980128 snapshot from Colin Peters.
-
-Sat Dec 6 21:30:35 1997 Mumit Khan <khan@xraylith.wisc.edu>
-
- * configure.in (AC_INIT): Use dllmain.c instead of defunct
- oldnames.c
- * configure: Regenerate.
-
-Fri Dec 5 15:57:36 1997 Mumit Khan <khan@xraylith.wisc.edu>
-
- * Update to 971205 snapshot from Colin Peters. Lots of changes.
- Files renamed and include hierarchy loses directories named
- nonansi.
-
- * include/dos.h: from Jan-Jaap.
-
-Thu Dec 4 21:48:13 1997 Mumit Khan <khan@xraylith.wisc.edu>
-
- Changes to conform to FSF tree.
-
- * crt1.c: Renamed from mcrt0.c.
- * dllcrt1.c: Renamed from dllcrt0.c.
- * Makefile.in: Update above. Also renamed libmoldnames.a to
- libmoldname.a.
-
-Mon Dec 1 16:51:30 1997 Mumit Khan <khan@xraylith.wisc.edu>
-
- * crtdll.def: Export all functions but the ones with funny names.
- * moldnames.def: Add fdopen since fileno is already there.
- * include/nonansi/dos.h: New file from Jan-Jaap.
- * include/errno.h: Add extern decl + various additions from JJ.
- * include/stdio.h: Likewise.
- * include/stdlib.h: Likewise.
- * include/nonansi/io.h: Likewise.
- * include/nonansi/process.h: Likewise.
- * include/sys/types.h: Likewise.
-
-Tue Nov 4 14:51:01 1997 Mumit Khan <khan@xraylith.wisc.edu>
-
- * include/time.h (CLK_TCK): Renamed from CLK_TICK.
- (CLK_TICK): Delete.
- * include/stdlib.h (free): Fix prototype to return void, not void*.
- * include/nonansi/process.h: Add P_* and WAIT_* defs.
-
- * dllcrt0.c: Delete now-unneeded '.section .idata$3' asm hack.
- * mcrt0.c: Likewise.
-
- * Makefile.in (LIBS): Delete moldnames.dll from target libs.
- (libmoldnames.a): Add explicit rule to create it.
-
-Fri Aug 15 18:23:43 1997 Rob Savoye <rob@cygnus.com>
-
- New directory for the minimalist cygwin environment.
-
- * crtglob.c: New file. Turn on file globbing support.
- * crt_noglob.c: New file. Turn off file globbing support.
- * ctype_old.c: New file. Wrappers for functions that don't
- have an underscore.
- * dirent.c: New file. Directory routines readdir, opendir, closedir.
- * dllcrt0.c: New file. Initialization code to use crtdll.dll.
- * dllmain.c: New file. A stub DllMain function.
- * hugeval.c: New file. A gross hack to define HUGE_VAL.
- * init.c: New file. Common code to initialize standard file
- handles and command line arguments.
- * main.c: New file. A main for programs that only call WinMain.
- * mcrt0.c: New file. Default crt0 for mingw32.
- * oldnames.c: New File. Wrappers for functions that don't
- have an underscore.
- * string_old.c: New File.
- * include/{assert.h,ctype.h,errno.h,float.h,limits.h,locale.h
- math.h,nonansi,setjmp.h,signal.h,stdarg.h,stddef.h,stdio.h,stdlib.h
- string.h,tchar.h,time.h,wchar.h}: New header files for mingw.
- * include/sys/types.h: New header file for mingw.
- * include/nonansi/{alloc.h,conio.h,dir.h,direct.h,dirent.h
- fcntl.h,io.h,malloc.h,mem.h,memory.h,process.h,share.h,unistd.h
- utime.h,values.h,varargs.h}: New header files for mingw.
- * include/nonansi/sys/{fcntl.h,locking.h,stat.h,time.h
- timeb.h,unistd.h}: New header files for mingw.
- * Makefile.in,configure.in: Build and configure support.
- * configure: Generated from autoconf 2.12 with Cygnus patches.
diff --git a/winsup/mingw/Makefile.in b/winsup/mingw/Makefile.in
deleted file mode 100644
index c9ced3cf699..00000000000
--- a/winsup/mingw/Makefile.in
+++ /dev/null
@@ -1,538 +0,0 @@
-# Makefile.in for the winsup/mingw directory.
-# Copyright (c) 1995-2008, 1996, 1997, 1998 Cygnus Solutions
-
-# 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 makefile requires GNU make.
-
-PACKAGE = mingw-runtime
-VERSION = @PACKAGE_VERSION@
-CYGRELEASE = 1
-
-VPATH = @srcdir@
-srcdir = @srcdir@
-objdir = .
-
-host_alias = @host_alias@
-build_alias = @build_alias@
-target_alias = @target_alias@
-with_cross_host = @with_cross_host@
-prefix = @prefix@
-conf_prefix = @prefix@
-
-program_transform_name = @program_transform_name@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
-ifneq (,$(findstring cygwin,$(target_alias)))
-mandir = $(prefix)/share/man
-mansection = mingw
-else
-mandir = @mandir@
-mansection = 3
-endif
-manpage_transform = @mingw_manpage_transform@
-ifeq ($(target_alias),$(host_alias))
-ifeq ($(build_alias),$(host_alias))
-tooldir:=$(exec_prefix)
-else
-tooldir:=$(exec_prefix)/$(target_alias)
-endif
-else
-tooldir:=$(exec_prefix)/$(target_alias)
-endif
-datadir = @datadir@
-infodir = @infodir@
-includedir = @includedir@
-ifneq (,$(findstring cygwin,$(target_alias)))
-inst_bindir:=$(tooldir)/bin
-inst_includedir:=$(tooldir)/include/mingw
-inst_libdir:=$(tooldir)/lib/mingw
-inst_docdir:=$(tooldir)/share/doc/mingw-runtime
-else
-ifneq (,$(with_cross_host))
-inst_bindir:=$(tooldir)/bin
-inst_includedir:=$(tooldir)/include
-inst_libdir:=$(tooldir)/lib
-inst_docdir:=$(tooldir)/share/doc/mingw-runtime
-else
-inst_bindir:=$(bindir)
-inst_includedir:=$(includedir)
-inst_libdir:=$(libdir)
-inst_docdir:=$(prefix)/doc/mingw-runtime
-endif
-endif
-
-# The Mingw headers are installed under a subdirectory of
-# $(tooldir)/include when configuring in Cygwin.
-HEADER_SUBDIR = @HEADER_SUBDIR@
-
-SHELL = /bin/sh
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-mkinstalldirs = $(SHELL) @MKINSTALLDIRS@
-
-CC := @CC@
-ifneq (,$(findstring cygwin,$(target_alias)))
-override CC := ${filter-out -L% -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}}
-endif
-# FIXME: Which is it, CC or CC_FOR_TARGET?
-CC_FOR_TARGET = $(CC)
-AS_FOR_TARGET = $(AS)
-CFLAGS = @CFLAGS@
-CXXFLAGS = @CXXFLAGS@
-
-# compiling with Cygwin?
-MNO_CYGWIN = @MNO_CYGWIN@
-ifdef MNO_CYGWIN
- subdirforlib=/mingw
-else
- libdir=
-endif
-
-# Either crtdll (CRT_ID 1) or msvcrt (CRT_ID 2).
-RUNTIME = @RUNTIME@
-CRT_ID = @CRT_ID@
-
-# Needed for threading dll.
-THREAD_DLL = @THREAD_DLL@
-THREAD_DLL_VERSION = 10
-THREAD_DLL_NAME = $(THREAD_DLL)$(THREAD_DLL_VERSION).dll
-
-# Various libraries.
-LIBM_A=@LIBM_A@
-
-W32API_INCLUDE = @W32API_INCLUDE@
-INCLUDES = -I$(srcdir)/include \
- -I$(srcdir)/../include \
- -nostdinc \
- -iwithprefixbefore include
-ALL_CFLAGS = $(CFLAGS) $(INCLUDES) $(W32API_INCLUDE) $(MNO_CYGWIN)
-ALL_CXXFLAGS = $(CXXFLAGS) $(INCLUDES) -nostdinc++ $(W32API_INCLUDE) $(MNO_CYGWIN)
-
-AS = @AS@
-AR = @AR@
-LD = @LD@
-AR_FLAGS = rcv
-RANLIB = @RANLIB@
-DLLTOOL = @DLLTOOL@
-DLLTOOLFLAGS =
-DLLTOOL_FOR_TARGET = $(DLLTOOL)
-DLLTOOL_FLAGS = --as $(AS_FOR_TARGET)
-DLLWRAP = @DLLWRAP@
-DLLWRAP_FOR_TARGET = $(DLLWRAP)
-DLLWRAP_FLAGS = --dlltool $(DLLTOOL) --as $(AS) --driver-name $(CC)
-OBJCOPY = @OBJCOPY@
-NM = @NM@
-
-TAR = tar
-TARFLAGS = z
-TARFILEEXT = .tar.gz
-
-SUBDIRS := @subdirs@
-
-FLAGS_TO_PASS:=\
- AS="$(AS)" \
- CC="$(CC)" \
- CFLAGS="$(CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_CONFIG)" \
- CXXFLAGS="$(CXXFLAGS) $(CFLAGS_COMMON) $(CFLAGS_CONFIG)" \
- EXE_LDFLAGS="$(EXE_LDFLAGS)" \
- AR="$(AR)" \
- RANLIB="$(RANLIB)" \
- LD="$(LD)" \
- DLLTOOL="$(DLLTOOL)" \
- exec_prefix="$(exec_prefix)" \
- bindir="$(bindir)" \
- libdir="$(libdir)" \
- tooldir="$(tooldir)" \
- datadir="$(datadir)" \
- infodir="$(infodir)" \
- includedir="$(includedir)" \
- inst_bindir="$(inst_bindir)" \
- inst_includedir="$(inst_includedir)" \
- inst_libdir="$(inst_libdir)" \
- inst_docdir="$(inst_docdir)" \
- prefix="$(prefix)" \
- target_alias="$(target_alias)" \
- TAR="$(TAR)" \
- TARFLAGS="$(TARFLAGS)" \
- TARFILEEXT="$(TARFILEEXT)"
-
-CRT0S = crt1.o dllcrt1.o crt2.o dllcrt2.o CRT_noglob.o crtmt.o crtst.o \
- CRT_fp8.o CRT_fp10.o txtmode.o binmode.o
-MINGW_OBJS = CRTglob.o CRTfmode.o CRTinit.o dllmain.o gccmain.o \
- main.o crtst.o mthr_stub.o CRT_fp10.o txtmode.o \
- pseudo-reloc.o pseudo-reloc-list.o cpu_features.o
-
-MOLD_OBJS = isascii.o iscsym.o iscsymf.o toascii.o \
- strcasecmp.o strncasecmp.o wcscmpi.o
-
-LIBS = libcrtdll.a \
- libmsvcrt.a libmsvcrtd.a \
- libmsvcr70.a libmsvcr70d.a \
- libmsvcr71.a libmsvcr71d.a \
- libmsvcr80.a libmsvcr80d.a \
- libmsvcr90.a libmsvcr90d.a \
- libmingw32.a \
- libcoldname.a \
- libmoldname.a libmoldnamed.a \
- libmoldname70.a libmoldname70d.a \
- libmoldname71.a libmoldname71d.a \
- libmoldname80.a libmoldname80d.a \
- libmoldname90.a libmoldname90d.a \
- $(LIBM_A) \
- libmingwthrd.a
-
-DLLS = $(THREAD_DLL_NAME)
-
-INSTDOCS = CONTRIBUTORS \
- DISCLAIMER \
- README
-
-SRCDIST_FILES = CRT_noglob.c CRTfmode.c CRTglob.c CRTinit.c ChangeLog \
-Makefile.in README TODO config.guess config.sub configure configure.in \
-aclocal.m4 crt1.c crtdll.def crtmt.c crtst.c dllcrt1.c dllmain.c \
-gccmain.c init.c install-sh jamfile main.c mkinstalldirs \
-moldname.def.in msvcrt.def.in ofmt_stub.s \
-mthr.c mthr_init.c mthr_stub.c readme.txt \
-isascii.c iscsym.c iscsymf.c toascii.c \
-strcasecmp.c strncasecmp.c wcscmpi.c \
-CRT_fp8.c CRT_fp10.c test_headers.c txtmode.c binmode.c pseudo-reloc.c \
-pseudo-reloc-list.c cpu_features.c cpu_features.h \
-DISCLAIMER CONTRIBUTORS
-
-
-all_dlls_host = @all_dlls_host@
-install_dlls_host = @install_dlls_host@
-
-all: $(CRT0S) $(LIBS) $(all_dlls_host)
- @$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS)
-
-all_dlls_host: $(DLLS)
-
-install_dlls_host:
- for i in $(DLLS); do \
- $(INSTALL_PROGRAM) $$i $(inst_bindir)/$$i ; \
- done
-
-_libm_dummy.o:
- rm -f _libm_dummy.c
- echo "static int __mingw_libm_dummy;" > _libm_dummy.c
- $(CC) -c $(ALL_CFLAGS) _libm_dummy.c
- rm -f _libm_dummy.c
-
-libm.a: _libm_dummy.o
- $(AR) rc $@ _libm_dummy.o
- $(RANLIB) $@
-
-libmingwthrd.a: crtmt.o mingwthrd.def
- $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(THREAD_DLL_NAME) \
- --def mingwthrd.def --output-lib $@
- $(AR) $(ARFLAGS) $@ crtmt.o
- $(RANLIB) $@
-
-DLL_OFILES = mthr.o mthr_init.o
-DLL_CC_STUFF = -B./ -shared $(MNO_CYGWIN) -Wl,--image-base,0x6FBC0000 \
- -Wl,--entry,_DllMainCRTStartup@12 \
- $(DLL_OFILES) mingwthrd.def \
- -Lmingwex
-
-$(THREAD_DLL_NAME) mingwthrd.def: $(DLL_OFILES) Makefile $(SUBDIRS)
- $(DLLTOOL) --as $(AS) --output-def mingwthrd.def $(DLL_OFILES)
- $(CC) $(DLL_CC_STUFF) -o $(THREAD_DLL_NAME)
-
-libmingw32.a: $(MINGW_OBJS)
- $(AR) rc $@ $(MINGW_OBJS)
- $(RANLIB) $@
-
-msvcrt.def msvcrtd.def \
-msvcr70.def msvcr70d.def \
-msvcr71.def msvcr71d.def \
-msvcr80.def msvcr80d.def \
-msvcr90.def msvcr90d.def \
-: msvcrt.def.in
- $(CC) -DRUNTIME=$(basename $(notdir $@)) \
- -D__$(basename $(notdir $@))__=1 \
- -D__MSVCRT__ -C -E -P \
- -xc-header $? > $@
-
-moldname-crtdll.def: moldname.def.in
- $(CC) -DRUNTIME=crtdll \
- -D__FILENAME__=moldname-crtdll.def \
- -D__CRTDLL__ -C -E -P \
- -xc-header $? > $@
-
-moldname-msvcrt.def: moldname.def.in
- $(CC) -DRUNTIME=msvcrt \
- -D__FILENAME__=moldname-msvcrt.def \
- -D__MSVCRT__ -C -E -P \
- -xc-header $? > $@
-
-libcoldname.a: moldname-crtdll.def $(MOLD_OBJS)
- $(DLLTOOL) --as $(AS) -k -U \
- --dllname crtdll.dll \
- --def moldname-crtdll.def \
- --output-lib $@
- $(AR) rc $@ $(MOLD_OBJS)
- $(RANLIB) $@
-
-libmoldname.a libmoldnamed.a: moldname-msvcrt.def $(MOLD_OBJS)
- $(DLLTOOL) --as $(AS) -k -U \
- --dllname msvcrt$(@:libmoldname%a=%)dll \
- --def moldname-msvcrt.def \
- --output-lib $@
- $(AR) rc $@ $(MOLD_OBJS)
- $(RANLIB) $@
-
-libmoldname70.a libmoldname70d.a libmoldname71.a libmoldname71d.a libmoldname80.a libmoldname80d.a libmoldname90.a libmoldname90d.a: moldname-msvcrt.def $(MOLD_OBJS)
- $(DLLTOOL) --as $(AS) -k -U \
- --dllname msvcr$(@:libmoldname%a=%)dll \
- --def moldname-msvcrt.def \
- --output-lib $@
- $(AR) rc $@ $(MOLD_OBJS)
- $(RANLIB) $@
-
-# The special rules are necessary.
-crt1.o dllcrt1.o:
- $(CC) -c -D__CRTDLL__ -U__MSVCRT__ $(ALL_CFLAGS) $< -o $@
-
-crt2.o dllcrt2.o:
- $(CC) -c -D__MSVCRT__ -U__CRTDLL__ $(ALL_CFLAGS) $< -o $@
-
-TEST_H_OPTIONS = $(ALL_CFLAGS) -Wall -W -Wsystem-headers -c \
- $(srcdir)/test_headers.c -o test_headers.o
-
-.PHONY: test_headers
-test_headers:
- @echo "Testing runtime headers..."
- @for lang in c c++ objective-c ; do \
- echo "$$lang ..."; \
- $(CC) -x$$lang $(TEST_H_OPTIONS) ; \
- echo "$$lang -ansi"; \
- $(CC) -x$$lang -ansi $(TEST_H_OPTIONS) ; \
- done
-# specify -std=xx only for C
- @for std in gnu89 gnu99 c89 c99 ; do \
- echo "std = $$std"; \
- $(CC) -std=$$std $(TEST_H_OPTIONS) ; \
- done
-
- @rm -f test_headers.o
-
-clean:
- -rm -f *.o *.a *~ core a.out mingwthrd.def mingwthrd.base mingwthrd.exp
- -rm -f $(THREAD_DLL_NAME) mingwthrd_dummy.exe
- -rm -f msvcr*.def moldname-*.def
- @$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS)
-
-distclean: clean
- @$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS)
- -rm -f config.cache config.status config.log
- -rm -f Makefile
-
-ifdef SNAPDATE
- distdir=$(PACKAGE)-$(VERSION)-$(SNAPDATE)
-else
- ifneq (,$(findstring cygwin, $(target_alias)))
- distdir=$(PACKAGE)-$(VERSION)-$(CYGRELEASE)
- else
- distdir=$(PACKAGE)-$(VERSION)
- endif
-endif
-
-ifneq (,$(findstring cygwin, $(target_alias)))
- TARFLAGS = j
- TARFILEEXT = .tar.bz2
-endif
-
-ifneq (,$(findstring mingw, $(target_alias)))
- dist_prefix =
-else
- dist_prefix = $(conf_prefix)
-endif
-
-dist: srcdist bindist
-
-srcdist:
- rm -rf $(distdir)
- mkdir $(distdir)
- chmod 755 $(distdir)
- for i in $(SRCDIST_FILES); do \
- cp -p $(srcdir)/$$i $(distdir)/$$i ; \
- done
- for i in $(SUBDIRS); do \
- (cd $$i; $(MAKE) distdir=../$(distdir) dist); \
- done
-#FIXME this needs to be done with SUBDIRS and Makefiles.
-#
-# Maybe, but this is simpler, and adequate for now!
-# However, as more manpages are added, spanning multiple sections,
-# we'll probably need a separate Makefile to organise them.
-#
- mkdir $(distdir)/include
- mkdir $(distdir)/include/sys
- cp $(srcdir)/include/*.h $(distdir)/include/
- cp $(srcdir)/include/sys/*.h $(distdir)/include/sys/
- mkdir $(distdir)/man
- cp $(srcdir)/man/*.man $(distdir)/man/
-#
-#end FIXME
- rm -f $(distdir)-src.tar.gz
- $(TAR) $(TARFLAGS)cf $(distdir)-src$(TARFILEEXT) $(distdir)
-
-
-bindist:
- rm -rf $(distdir)
- mkdir $(distdir)
- chmod 755 $(distdir)
- $(MAKE) install prefix=$(shell pwd)/$(distdir)$(dist_prefix)
- rm -f $(distdir).tar.gz
- cd $(distdir); \
- $(TAR) $(TARFLAGS)cf ../$(distdir)$(TARFILEEXT) *
-
-snapshot:
- make dist SNAPDATE=$(shell date '+%Y%m%d')
-
-info:
-
-info-html:
-
-install-info: info
-
-install-dirs:
- $(mkinstalldirs) $(inst_bindir)
- $(mkinstalldirs) $(inst_includedir)
- $(mkinstalldirs) $(inst_libdir)
- $(mkinstalldirs) $(inst_docdir)
- $(mkinstalldirs) $(mandir)/man$(mansection)
-
-install: all install-dirs $(install_dlls_host)
- for i in $(LIBS); do \
- $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \
- done
- for i in $(CRT0S); do \
- $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \
- done
- for i in $(INSTDOCS); do \
- $(INSTALL_DATA) $(srcdir)/$$i $(inst_docdir)/$$i ; \
- done
- for sub in . sys ; do \
- dstdir=$(inst_includedir)/$$sub ; \
- $(mkinstalldirs) $$dstdir ; \
- for i in $(srcdir)/include/$$sub/*.h ; do \
- $(INSTALL_DATA) $$i $$dstdir/`basename $$i` ; \
- done ; \
- done
-#
-# This provisional hack installs the only manpage we have at present...
-# It simply CANNOT suffice, when we have more manpages to ship.
-#
- $(mkinstalldirs) $(mandir)/man$(mansection)
- $(INSTALL_DATA) $(srcdir)/man/dirname.man $(mandir)/man$(mansection)/`\
- echo dirname.man|sed '$(manpage_transform);s,man$$,$(mansection),'`
- $(INSTALL_DATA) $(srcdir)/man/dirname.man $(mandir)/man$(mansection)/`\
- echo basename.man|sed '$(manpage_transform);s,man$$,$(mansection),'`
-#
-# End provisional hack.
-#
- @$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS)
-
-subdirs: $(SUBDIRS)
- @true
-
-# The . is here because SUBDIRS may be empty
-
-. $(SUBDIRS): force
- @if [ -d ./$@ ]; then \
- echo "Making $(DO) in $@..." ; \
- if (rootme=`pwd`/ ; export rootme ; \
- rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
- cd ./$@; \
- $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
- else exit 1 ; \
- fi ; \
- else true ; \
- fi
-
-force:
-
-#
-# Dependencies
-#
-libcrtdll.a: crtdll.def
-libmsvcrt.a: msvcrt.def
-libmsvcrtd.a: msvcrtd.def
-CRT_noglob.o: CRT_noglob.c
-CRTfmode.o: CRTfmode.c
-CRTglob.o: CRTglob.c
-CRTinit.o: CRTinit.c
-crt1.o: crt1.c init.c
-crt2.o: crt1.c init.c
-crtmt.o: crtmt.c
-crtst.o: crtst.c
-ctype_old.o: ctype_old.c
-dllcrt1.o: dllcrt1.c
-dllcrt2.o: dllcrt1.c
-dllmain.o: dllmain.c
-main.o: main.c
-oldnames.o: oldnames.c
-string_old.o: string_old.c
-CRT_fp8.o: CRT_fp8.c
-CRT_fp10.o: CRT_fp10.c
-
-
-Makefile: Makefile.in config.status configure
- $(SHELL) config.status
-
-config.status: configure
- $(SHELL) config.status --recheck
-
-.SUFFIXES: .y $(SUFFIXES) .cc .def .a
-
-sym_prefix = __msvcrt
-
-NM_LOOKUP = $(NM) $@ | sed -n \
- -e '/:$$/h;/^[0-7][0-7]* *T */{s///;H;g;s/\n//p' \
- -e '}' | sed -n 's/:_'"$$key"'$$//p'
-
-MINGW_REPL_FUNCS = printf fprintf sprintf vprintf vfprintf vsprintf
-
-lib%.a: %.def
- $(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@ --def $<
- for key in $(MINGW_REPL_FUNCS); do \
- src=`$(NM_LOOKUP)`; \
- if test -n "$$src"; then \
- dst=`echo "$$src" | sed 's/0/4/'`; repl="$$repl $$dst"; \
- tmpfiles="$$tmpfiles $$src $$dst"; \
- $(AR) x $@ $$src; \
- $(OBJCOPY) --redefine-sym _$$key=_$(sym_prefix)_$$key \
- --redefine-sym __imp__$$key=__imp__$(sym_prefix)_$$key \
- $$src $$dst; \
- fi; done; \
- test `key=_get_output_format; $(NM_LOOKUP)` || \
- repl="$$repl ofmt_stub.o"; \
- test -n "$$repl" && $(AR) rcs $@ $$repl; \
- $(RM) $$tmpfiles
-
-libmsvcrt.a libmsvcrtd.a: ofmt_stub.o
-libmsvcr70.a libmsvcr70d.a: ofmt_stub.o
-libmsvcr71.a libmsvcr71d.a: ofmt_stub.o
-libcrtdll.a libcrtdlld.a: ofmt_stub.o
-
-.c.o:
- $(CC) -c $(ALL_CFLAGS) $< -o $@
-
diff --git a/winsup/mingw/configure b/winsup/mingw/configure
deleted file mode 100755
index 7d15f8707d7..00000000000
--- a/winsup/mingw/configure
+++ /dev/null
@@ -1,4351 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for mingw-runtime __MINGW32_VERSION.
-#
-# Copyright (C) 2003 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-exec 6>&1
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_config_libobj_dir=.
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete. It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
-# Identity of this package.
-PACKAGE_NAME='mingw-runtime'
-PACKAGE_TARNAME='mingw-runtime'
-PACKAGE_VERSION='__MINGW32_VERSION'
-PACKAGE_STRING='mingw-runtime __MINGW32_VERSION'
-PACKAGE_BUGREPORT=''
-
-ac_unique_file="include/_mingw.h"
-ac_subdirs_all="$ac_subdirs_all profile mingwex"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT with_cross_host all_dlls_host install_dlls_host AR ac_ct_AR AS ac_ct_AS RANLIB ac_ct_RANLIB LD ac_ct_LD NM ac_ct_NM OBJCOPY ac_ct_OBJCOPY DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP WINDRES ac_ct_WINDRES subdirs THREAD_DLL MKINSTALLDIRS MNO_CYGWIN LIBM_A LIBGMON_A HEADER_SUBDIR W32API_INCLUDE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA mingw_manpage_transform LIBOBJS LTLIBOBJS'
-ac_subst_files=''
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-ac_prev=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_option in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval "enable_$ac_feature=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_$ac_feature='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "with_$ac_package='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval "with_$ac_package=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
- eval "$ac_envvar='$ac_optarg'"
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
- { (exit 1); exit 1; }; }
- else
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
- fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
- { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures mingw-runtime __MINGW32_VERSION to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
- cat <<_ACEOF
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
-_ACEOF
-
- cat <<\_ACEOF
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
- --target=TARGET configure for building compilers for TARGET [HOST]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of mingw-runtime __MINGW32_VERSION:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-mingw-manpage-transform[=SED-SCRIPT]
- apply SED-SCRIPT [s/^/mingw-/] to installed
- manpage names
- --disable-mingw-manpage-transform
- [DEFAULT] don't transform installed manpage
- names
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
- headers in a nonstandard directory <include dir>
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- ac_popdir=`pwd`
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d $ac_dir || continue
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
- cd $ac_dir
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- echo
- $SHELL $ac_srcdir/configure.gnu --help=recursive
- elif test -f $ac_srcdir/configure; then
- echo
- $SHELL $ac_srcdir/configure --help=recursive
- elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
- echo
- $ac_configure --help
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
- cd $ac_popdir
- done
-fi
-
-test -n "$ac_init_help" && exit 0
-if $ac_init_version; then
- cat <<\_ACEOF
-mingw-runtime configure __MINGW32_VERSION
-generated by GNU Autoconf 2.59
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit 0
-fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by mingw-runtime $as_me __MINGW32_VERSION, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_sep=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-{
- (set) 2>&1 |
- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
- ;;
- *)
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-}
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- sed "/^$/d" confdefs.h | sort
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core &&
- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
- ' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . $cache_file;;
- *) . ./$cache_file;;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
- eval ac_new_val="\$ac_env_${ac_var}_value"
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- echo "$as_me:$LINENO: checking package version" >&5
-echo $ECHO_N "checking package version... $ECHO_C" >&6
- PACKAGE_VERSION=`awk '$2 == "'"$PACKAGE_VERSION"'" { print $3 }' ${srcdir}/include/_mingw.h`
- PACKAGE_TARNAME=${PACKAGE_NAME}-${PACKAGE_VERSION}
- echo "$as_me:$LINENO: result: $PACKAGE_VERSION" >&5
-echo "${ECHO_T}$PACKAGE_VERSION" >&6
-
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f $ac_dir/shtool; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
- { (exit 1); exit 1; }; }
-fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
-
-# Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
- { (exit 1); exit 1; }; }
-
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
- ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
-build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
- ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
-host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6
-if test "${ac_cv_target+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_target_alias=$target_alias
-test "x$ac_cv_target_alias" = "x" &&
- ac_cv_target_alias=$ac_cv_host_alias
-ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6
-target=$ac_cv_target
-target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$ac_ct_CC" && break
-done
-
- CC=$ac_ct_CC
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
- "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
- (eval $ac_compiler --version </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
- (eval $ac_compiler -v </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
- (eval $ac_compiler -V </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-# FIXME: Cleanup?
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- gcc_no_link=no
-else
- gcc_no_link=yes
-fi
-
-if test x$gcc_no_link = xyes; then
- # Setting cross_compile will disable run tests; it will
- # also disable AC_CHECK_FILE but that's generally
- # correct if we can't link.
- cross_compiling=yes
- EXEEXT=
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
- (eval $ac_link_default) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Find the output, starting from the most likely. This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
- conftest.$ac_ext )
- # This is the source file.
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
- break;;
- * )
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-fi
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std1 is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std1. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_stdc=$ac_arg
-break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
- x|xno)
- echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
- *)
- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
- CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-# Some people use a C++ compiler to compile C. Since we use `exit',
-# in C++ we need to declare it. In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
- choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- for ac_declaration in \
- '' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);'
-do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-case "$with_cross_host" in
- ""|*cygwin*) all_dlls_host='all_dlls_host'
- install_dlls_host='install_dlls_host';;
-esac
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_AR"; then
- ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AR="ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- AR=$ac_ct_AR
-else
- AR="$ac_cv_prog_AR"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
-set dummy ${ac_tool_prefix}as; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AS+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AS"; then
- ac_cv_prog_AS="$AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AS="${ac_tool_prefix}as"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-AS=$ac_cv_prog_AS
-if test -n "$AS"; then
- echo "$as_me:$LINENO: result: $AS" >&5
-echo "${ECHO_T}$AS" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_AS"; then
- ac_ct_AS=$AS
- # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_AS+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_AS"; then
- ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AS="as"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_AS" && ac_cv_prog_ac_ct_AS="as"
-fi
-fi
-ac_ct_AS=$ac_cv_prog_ac_ct_AS
-if test -n "$ac_ct_AS"; then
- echo "$as_me:$LINENO: result: $ac_ct_AS" >&5
-echo "${ECHO_T}$ac_ct_AS" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- AS=$ac_ct_AS
-else
- AS="$ac_cv_prog_AS"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="ranlib"
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- RANLIB=$ac_ct_RANLIB
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ld; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$LD"; then
- ac_cv_prog_LD="$LD" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_LD="${ac_tool_prefix}ld"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-LD=$ac_cv_prog_LD
-if test -n "$LD"; then
- echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_LD"; then
- ac_ct_LD=$LD
- # Extract the first word of "ld", so it can be a program name with args.
-set dummy ld; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_LD"; then
- ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_LD="ld"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
-fi
-fi
-ac_ct_LD=$ac_cv_prog_ac_ct_LD
-if test -n "$ac_ct_LD"; then
- echo "$as_me:$LINENO: result: $ac_ct_LD" >&5
-echo "${ECHO_T}$ac_ct_LD" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- LD=$ac_ct_LD
-else
- LD="$ac_cv_prog_LD"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nm; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_NM+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$NM"; then
- ac_cv_prog_NM="$NM" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_NM="${ac_tool_prefix}nm"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-NM=$ac_cv_prog_NM
-if test -n "$NM"; then
- echo "$as_me:$LINENO: result: $NM" >&5
-echo "${ECHO_T}$NM" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_NM"; then
- ac_ct_NM=$NM
- # Extract the first word of "nm", so it can be a program name with args.
-set dummy nm; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_NM+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_NM"; then
- ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_NM="nm"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_NM" && ac_cv_prog_ac_ct_NM="nm"
-fi
-fi
-ac_ct_NM=$ac_cv_prog_ac_ct_NM
-if test -n "$ac_ct_NM"; then
- echo "$as_me:$LINENO: result: $ac_ct_NM" >&5
-echo "${ECHO_T}$ac_ct_NM" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- NM=$ac_ct_NM
-else
- NM="$ac_cv_prog_NM"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objcopy; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_OBJCOPY+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$OBJCOPY"; then
- ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-OBJCOPY=$ac_cv_prog_OBJCOPY
-if test -n "$OBJCOPY"; then
- echo "$as_me:$LINENO: result: $OBJCOPY" >&5
-echo "${ECHO_T}$OBJCOPY" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_OBJCOPY"; then
- ac_ct_OBJCOPY=$OBJCOPY
- # Extract the first word of "objcopy", so it can be a program name with args.
-set dummy objcopy; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_OBJCOPY"; then
- ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OBJCOPY="objcopy"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_OBJCOPY" && ac_cv_prog_ac_ct_OBJCOPY="objcopy"
-fi
-fi
-ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY
-if test -n "$ac_ct_OBJCOPY"; then
- echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5
-echo "${ECHO_T}$ac_ct_OBJCOPY" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- OBJCOPY=$ac_ct_OBJCOPY
-else
- OBJCOPY="$ac_cv_prog_OBJCOPY"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_DLLTOOL+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$DLLTOOL"; then
- ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
- echo "$as_me:$LINENO: result: $DLLTOOL" >&5
-echo "${ECHO_T}$DLLTOOL" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
- ac_ct_DLLTOOL=$DLLTOOL
- # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_DLLTOOL"; then
- ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DLLTOOL="dlltool"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_DLLTOOL" && ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-fi
-fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
- echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5
-echo "${ECHO_T}$ac_ct_DLLTOOL" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- DLLTOOL=$ac_ct_DLLTOOL
-else
- DLLTOOL="$ac_cv_prog_DLLTOOL"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_DLLWRAP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$DLLWRAP"; then
- ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DLLWRAP="${ac_tool_prefix}dlltool"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-DLLWRAP=$ac_cv_prog_DLLWRAP
-if test -n "$DLLWRAP"; then
- echo "$as_me:$LINENO: result: $DLLWRAP" >&5
-echo "${ECHO_T}$DLLWRAP" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_DLLWRAP"; then
- ac_ct_DLLWRAP=$DLLWRAP
- # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_DLLWRAP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_DLLWRAP"; then
- ac_cv_prog_ac_ct_DLLWRAP="$ac_ct_DLLWRAP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DLLWRAP="dlltool"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_DLLWRAP" && ac_cv_prog_ac_ct_DLLWRAP="dlltool"
-fi
-fi
-ac_ct_DLLWRAP=$ac_cv_prog_ac_ct_DLLWRAP
-if test -n "$ac_ct_DLLWRAP"; then
- echo "$as_me:$LINENO: result: $ac_ct_DLLWRAP" >&5
-echo "${ECHO_T}$ac_ct_DLLWRAP" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- DLLWRAP=$ac_ct_DLLWRAP
-else
- DLLWRAP="$ac_cv_prog_DLLWRAP"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
-set dummy ${ac_tool_prefix}windres; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_WINDRES+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$WINDRES"; then
- ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-WINDRES=$ac_cv_prog_WINDRES
-if test -n "$WINDRES"; then
- echo "$as_me:$LINENO: result: $WINDRES" >&5
-echo "${ECHO_T}$WINDRES" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_WINDRES"; then
- ac_ct_WINDRES=$WINDRES
- # Extract the first word of "windres", so it can be a program name with args.
-set dummy windres; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_WINDRES"; then
- ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_WINDRES="windres"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_WINDRES" && ac_cv_prog_ac_ct_WINDRES="windres"
-fi
-fi
-ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
-if test -n "$ac_ct_WINDRES"; then
- echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5
-echo "${ECHO_T}$ac_ct_WINDRES" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- WINDRES=$ac_ct_WINDRES
-else
- WINDRES="$ac_cv_prog_WINDRES"
-fi
-
-
-
-
-subdirs="$subdirs profile mingwex"
-
-HEADER_SUBDIR=""
-
-LIBGMON_A=libgmon.a
-
-W32API_INCLUDE='-I $(srcdir)/../w32api/include'
-
-case "$target_os" in
-*cygwin*)
- MNO_CYGWIN=-mno-cygwin
- LIBM_A=libm.a
- # Install mingw headers in mingw subdirectory.
- HEADER_SUBDIR="mingw"
- ;;
-*)
- # Build it for MSVCRT by default.
- MNO_CYGWIN=
- LIBM_A=libm.a
- ;;
-esac
-
-# THREAD_DLL used to be set within the above case and was mingwc for CRTDLL.
-# I can find no reason to do this.
-#
-# FIXME: In the future I would like to change the dll name to mingwthrd to
-# to match the libmingwthrd.a name.
-THREAD_DLL=mingwm
-
-
-MKINSTALLDIRS=$ac_aux_dir/mkinstalldirs
-
-
-
-
-
-
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL=$ac_install_sh
- fi
-fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-# Check whether --enable-mingw-manpage-transform or --disable-mingw-manpage-transform was given.
-if test "${enable_mingw_manpage_transform+set}" = set; then
- enableval="$enable_mingw_manpage_transform"
- case ${enableval} in
- yes) mingw_manpage_transform='s,^,mingw-,' ;;
- no) mingw_manpage_transform='s,x,x,' ;;
- *) mingw_manpage_transform=${enableval} ;;
- esac
-fi;
- mingw_manpage_transform=${mingw_manpage_transform-'s,x,x,'}
-
-
- ac_config_files="$ac_config_files Makefile"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
- (set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-} |
- sed '
- t clear
- : clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
- if test -w $cache_file; then
- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
- cat confcache >$cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ ]*$//;
-}'
-fi
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
-t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
-t quote
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
-t quote
-d
-: quote
-s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output. A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
-
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by mingw-runtime $as_me __MINGW32_VERSION, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-_ACEOF
-
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-mingw-runtime config.status __MINGW32_VERSION
-configured by $0, generated by GNU Autoconf 2.59,
- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- -*)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
- esac
-
- case $ac_option in
- # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1" ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-
-
-
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_config_target in $ac_config_targets
-do
- case "$ac_config_target" in
- # Handling of arguments.
- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@build@,$build,;t t
-s,@build_cpu@,$build_cpu,;t t
-s,@build_vendor@,$build_vendor,;t t
-s,@build_os@,$build_os,;t t
-s,@host@,$host,;t t
-s,@host_cpu@,$host_cpu,;t t
-s,@host_vendor@,$host_vendor,;t t
-s,@host_os@,$host_os,;t t
-s,@target@,$target,;t t
-s,@target_cpu@,$target_cpu,;t t
-s,@target_vendor@,$target_vendor,;t t
-s,@target_os@,$target_os,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@with_cross_host@,$with_cross_host,;t t
-s,@all_dlls_host@,$all_dlls_host,;t t
-s,@install_dlls_host@,$install_dlls_host,;t t
-s,@AR@,$AR,;t t
-s,@ac_ct_AR@,$ac_ct_AR,;t t
-s,@AS@,$AS,;t t
-s,@ac_ct_AS@,$ac_ct_AS,;t t
-s,@RANLIB@,$RANLIB,;t t
-s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s,@LD@,$LD,;t t
-s,@ac_ct_LD@,$ac_ct_LD,;t t
-s,@NM@,$NM,;t t
-s,@ac_ct_NM@,$ac_ct_NM,;t t
-s,@OBJCOPY@,$OBJCOPY,;t t
-s,@ac_ct_OBJCOPY@,$ac_ct_OBJCOPY,;t t
-s,@DLLTOOL@,$DLLTOOL,;t t
-s,@ac_ct_DLLTOOL@,$ac_ct_DLLTOOL,;t t
-s,@DLLWRAP@,$DLLWRAP,;t t
-s,@ac_ct_DLLWRAP@,$ac_ct_DLLWRAP,;t t
-s,@WINDRES@,$WINDRES,;t t
-s,@ac_ct_WINDRES@,$ac_ct_WINDRES,;t t
-s,@subdirs@,$subdirs,;t t
-s,@THREAD_DLL@,$THREAD_DLL,;t t
-s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t
-s,@MNO_CYGWIN@,$MNO_CYGWIN,;t t
-s,@LIBM_A@,$LIBM_A,;t t
-s,@LIBGMON_A@,$LIBGMON_A,;t t
-s,@HEADER_SUBDIR@,$HEADER_SUBDIR,;t t
-s,@W32API_INCLUDE@,$W32API_INCLUDE,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@mingw_manpage_transform@,$mingw_manpage_transform,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
- cat >>$CONFIG_STATUS <<\_ACEOF
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
- fi
-fi # test -n "$CONFIG_FILES"
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
- esac
-
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
-
-done
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
-#
-# CONFIG_SUBDIRS section.
-#
-if test "$no_recursion" != yes; then
-
- # Remove --cache-file and --srcdir arguments so they do not pile up.
- ac_sub_configure_args=
- ac_prev=
- for ac_arg in $ac_configure_args; do
- if test -n "$ac_prev"; then
- ac_prev=
- continue
- fi
- case $ac_arg in
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
- | --c=*)
- ;;
- --config-cache | -C)
- ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- ;;
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- ;;
- *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
- esac
- done
-
- # Always prepend --prefix to ensure using the same prefix
- # in subdir configurations.
- ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args"
-
- ac_popdir=`pwd`
- for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
-
- # Do not complain, so a configure script can configure whichever
- # parts of a large source tree are present.
- test -d $srcdir/$ac_dir || continue
-
- { echo "$as_me:$LINENO: configuring in $ac_dir" >&5
-echo "$as_me: configuring in $ac_dir" >&6;}
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
- cd $ac_dir
-
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'"
- elif test -f $ac_srcdir/configure; then
- ac_sub_configure="$SHELL '$ac_srcdir/configure'"
- elif test -f $ac_srcdir/configure.in; then
- ac_sub_configure=$ac_configure
- else
- { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5
-echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
- ac_sub_configure=
- fi
-
- # The recursion is here.
- if test -n "$ac_sub_configure"; then
- # Make the cache file name correct relative to the subdirectory.
- case $cache_file in
- [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
- *) # Relative path.
- ac_sub_cache_file=$ac_top_builddir$cache_file ;;
- esac
-
- { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
-echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
- # The eval makes quoting arguments work.
- eval $ac_sub_configure $ac_sub_configure_args \
- --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir ||
- { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5
-echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- cd $ac_popdir
- done
-fi
-
-
-# $RCSfile$: end of file
diff --git a/winsup/mingw/configure.in b/winsup/mingw/configure.in
deleted file mode 100644
index 775149b7e10..00000000000
--- a/winsup/mingw/configure.in
+++ /dev/null
@@ -1,86 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-
-dnl This file is part of winsup/mingw
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-AC_PREREQ([2.59])
-AC_INIT([mingw-runtime], [__MINGW32_VERSION])
-MINGW_AC_CONFIG_SRCDIR([$PACKAGE_VERSION], [include/_mingw.h])
-
-AC_CANONICAL_SYSTEM
-GCC_NO_EXECUTABLES
-AC_PROG_CC
-
-case "$with_cross_host" in
- ""|*cygwin*) all_dlls_host='all_dlls_host'
- install_dlls_host='install_dlls_host';;
-esac
-AC_SUBST([with_cross_host])
-AC_SUBST([all_dlls_host])
-AC_SUBST([install_dlls_host])
-
-AC_CHECK_TOOL([AR], [ar], [ar])
-AC_CHECK_TOOL([AS], [as], [as])
-AC_CHECK_TOOL([RANLIB], [ranlib], [ranlib])
-AC_CHECK_TOOL([LD], [ld], [ld])
-AC_CHECK_TOOL([NM], [nm], [nm])
-AC_CHECK_TOOL([OBJCOPY], [objcopy], [objcopy])
-AC_CHECK_TOOL([DLLTOOL], [dlltool], [dlltool])
-AC_CHECK_TOOL([DLLWRAP], [dlltool], [dlltool])
-AC_CHECK_TOOL([WINDRES], [windres], [windres])
-
-AC_CONFIG_SUBDIRS([profile mingwex])
-HEADER_SUBDIR=""
-
-LIBGMON_A=libgmon.a
-
-W32API_INCLUDE='-I $(srcdir)/../w32api/include'
-
-case "$target_os" in
-*cygwin*)
- MNO_CYGWIN=-mno-cygwin
- LIBM_A=libm.a
- # Install mingw headers in mingw subdirectory.
- HEADER_SUBDIR="mingw"
- ;;
-*)
- # Build it for MSVCRT by default.
- MNO_CYGWIN=
- LIBM_A=libm.a
- ;;
-esac
-
-# THREAD_DLL used to be set within the above case and was mingwc for CRTDLL.
-# I can find no reason to do this.
-#
-# FIXME: In the future I would like to change the dll name to mingwthrd to
-# to match the libmingwthrd.a name.
-AC_SUBST([THREAD_DLL], [mingwm])
-
-AC_SUBST([MKINSTALLDIRS], [$ac_aux_dir/mkinstalldirs])
-AC_SUBST([MNO_CYGWIN])
-AC_SUBST([LIBM_A])
-AC_SUBST([LIBGMON_A])
-AC_SUBST([HEADER_SUBDIR])
-AC_SUBST([W32API_INCLUDE])
-
-AC_PROG_INSTALL
-MINGW_AC_MANPAGE_TRANSFORM
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-
-# $RCSfile$: end of file
diff --git a/winsup/mingw/mingwex/Makefile.in b/winsup/mingw/mingwex/Makefile.in
deleted file mode 100644
index 9142576a4cd..00000000000
--- a/winsup/mingw/mingwex/Makefile.in
+++ /dev/null
@@ -1,307 +0,0 @@
-#
-# mingw/mingwex/Makefile.in: This file is part of Mingw runtime.
-#
-# This makefile requires GNU make.
-
-srcdir = @srcdir@
-VPATH = $(srcdir):$(srcdir)/math:$(srcdir)/stdio:$(srcdir)/complex $(srcdir)/gdtoa
-objdir = .
-
-target_alias = @target_alias@
-prefix = @prefix@
-
-program_transform_name = @program_transform_name@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
-tooldir = $(exec_prefix)/$(target_alias)
-datadir = @datadir@
-infodir = @infodir@
-includedir = @includedir@
-
-SHELL = /bin/sh
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs
-
-DISTFILES = \
- Makefile.in configure configure.in aclocal.m4 \
- _Exit.c atoll.c dirent.c feclearexcept.c fegetenv.c \
- fegetexceptflag.c fegetround.c feholdexcept.c feraiseexcept.c \
- fesetenv.c fesetexceptflag.c fesetround.c fetestexcept.c \
- feupdateenv.c ftruncate.c fwide.c getopt.c imaxabs.c imaxdiv.c \
- lltoa.c lltow.c mbsinit.c mingw-aligned-malloc.c \
- mingw-fseek.c sitest.c strtoimax.c strtoumax.c \
- testwmem.c tst-aligned-malloc.c ulltoa.c ulltow.c wcstof.c \
- wcstoimax.c wcstold.c wcstoumax.c wctrans.c wctype.c \
- wdirent.c wmemchr.c wmemcmp.c wmemcpy.c wmemmove.c wmemset.c wtoll.c \
- wcrtomb.c wctob.c mbrtowc.c btowc.c mb_wc_common.h \
- gettimeofday.c isblank.c iswblank.c \
- basename.c dirname.c usleep.c \
- tsearch.c twalk.c tdelete.c tfind.c
-
-MATH_DISTFILES = \
- acosf.c acosl.c asinf.c asinl.c atan2f.c atan2l.c \
- atanf.c atanl.c cbrt.c cbrtf.c cbrtl.c ceilf.S ceill.S \
- cephes_mconf.h \
- copysign.S copysignf.S copysignl.S cosf.S coshf.c coshl.c cosl.S \
- erfl.c exp2.S exp2f.S exp2l.S expf.c expl.c expm1.c expm1l.c expm1f.c \
- fabs.c fabsf.c fabsl.c \
- fdim.c fdimf.c fdiml.c floorf.S floorl.S fma.S fmaf.S fmal.c \
- fmax.c fmaxf.c fmaxl.c fmin.c fminf.c fminl.c fmodf.c \
- fmodl.c fp_consts.c fp_consts.h fp_constsf.c fp_constsl.c \
- fpclassify.c fpclassifyf.c fpclassifyl.c \
- frexpf.c frexpl.S fucom.c hypotf.c hypotl.c ilogb.S ilogbf.S \
- ilogbl.S isnan.c isnanf.c isnanl.c ldexpf.c ldexpl.c \
- lgamma.c lgammaf.c lgammal.c llrint.c llrintf.c llrintl.c \
- log10f.S log10l.S log1p.S log1pf.S log1pl.S log2.S log2f.S \
- log2l.S logb.c logbf.c logbl.c logf.S logl.S lrint.c lrintf.c \
- lrintl.c lround_generic.c modff.c modfl.c \
- nearbyint.S nearbyintf.S nearbyintl.S \
- nextafterf.c nextafterl.c nexttowardf.c nexttoward.c \
- powf.c powi.c powif.c powil.c powl.c \
- remainder.S remainderf.S remainderl.S remquo.S \
- remquof.S remquol.S rint.c rintf.c rintl.c round_internal.h \
- round_generic.c scalbn.S scalbnf.S scalbnl.S s_erf.c sf_erf.c \
- signbit.c signbitf.c signbitl.c sinf.S sinhf.c sinhl.c sinl.S \
- sqrtf.c sqrtl.c tanf.S tanhf.c tanhl.c tanl.S tgamma.c \
- tgammaf.c tgammal.c trunc.c truncf.c truncl.c \
- acosh.c acoshf.c acoshl.c asinh.c asinhf.c asinhl.c \
- atanh.c atanhf.c atanhl.c fastmath.h
-
-STDIO_DISTFILES = \
- fopen64.c fseeko64.c ftello64.c lseek64.c \
- vfscanf.c vfwscanf.c vscanf.c vsscanf.c vswscanf.c vwscanf.c \
- pformat.c pformat.h snprintf.c vsnprintf.c \
- snwprintf.c vsnwprintf.c
-
-COMPLEX_DISTFILES = \
- cabs.c cabsf.c cabsl.c cacos.c cacosf.c cacosl.c cacosh.c \
- cacoshf.c cacoshl.c carg.c cargf.c cargl.c casin.c casinf.c \
- casinl.c casinh.c casinhf.c casinhl.c catan.c catanf.c catanl.c \
- catanh.c catanhf.c catanhl.c ccos.c ccosf.c ccosl.c ccosh.c \
- ccoshf.c ccoshl.c cexp.c cexpf.c cexpl.c cimag.c cimagf.c \
- cimagl.c clog.c clogf.c clogl.c cpow.c cpowf.c cpowl.c cproj.c \
- cprojf.c cprojl.c creal.c crealf.c creall.c csin.c csinf.c \
- csinl.c csinh.c csinhf.c csinhl.c csqrt.c csqrtf.c csqrtl.c \
- ctan.c ctanf.c ctanl.c ctanh.c ctanhf.c ctanhl.c
-
-GDTOA_DISTFILES = \
- arithchk.c dmisc.c dtoa.c g__fmt.c g_dfmt.c g_ffmt.c g_xfmt.c \
- gd_arith.h gd_qnan.h gdtoa.c gdtoa.h gdtoaimp.h gethex.c gmisc.c \
- hd_init.c hexnan.c misc.c qnan.c README smisc.c strtodg.c strtodnrp.c \
- strtof.c strtopx.c sum.c ulp.c
-
-CC = @CC@
-# FIXME: Which is it, CC or CC_FOR_TARGET?
-CC_FOR_TARGET = $(CC)
-AS_FOR_TARGET = $(AS)
-CFLAGS = @CFLAGS@
-CXXFLAGS = @CXXFLAGS@
-OPTFLAGS = -fomit-frame-pointer
-WARNFLAGS = -Wall
-
-
-# compiling with Cygwin?
-MNO_CYGWIN = @MNO_CYGWIN@
-
-W32API_INCLUDE = @W32API_INCLUDE@
-INCLUDES = -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../include \
- -nostdinc \
- -iwithprefixbefore include
-ALL_CFLAGS = $(CFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(INCLUDES) $(W32API_INCLUDE) $(MNO_CYGWIN)
-ALL_CXXFLAGS = $(CXXFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(INCLUDES) -nostdinc++ $(W32API_INCLUDE) $(MNO_CYGWIN)
-
-AS = @AS@
-AR = @AR@
-LD = @LD@
-AR_FLAGS = rcv
-RANLIB = @RANLIB@
-DLLTOOL = @DLLTOOL@
-DLLTOOLFLAGS =
-DLLTOOL_FOR_TARGET = $(DLLTOOL)
-DLLTOOL_FLAGS = --as $(AS_FOR_TARGET)
-
-LIBMINGWEX_A = libmingwex.a
-
-Q8_OBJS = \
- fwide.o imaxabs.o imaxdiv.o mbsinit.o \
- strtoimax.o strtoumax.o wcstoimax.o wcstoumax.o \
- wmemchr.o wmemcmp.o wmemcpy.o wmemmove.o wmemset.o \
- wctrans.o wctype.o wcrtomb.o wctob.o mbrtowc.o btowc.o \
- wcstof.o wcstold.o
-CTYPE_OBJS = \
- isblank.o iswblank.o
-STDLIB_STUB_OBJS = \
- lltoa.o ulltoa.o \
- lltow.o ulltow.o \
- atoll.o wtoll.o \
- _Exit.o
-STDIO_OBJS = \
- fopen64.o fseeko64.o ftello64.o lseek64.o \
- vfscanf.o vfwscanf.o vscanf.o vsscanf.o vswscanf.o vwscanf.o \
- pformat.o snprintf.o vsnprintf.o snwprintf.o vsnwprintf.o
-MATH_OBJS = \
- acosf.o acosl.o asinf.o asinl.o atan2f.o atan2l.o \
- atanf.o atanl.o cbrt.o cbrtf.o cbrtl.o ceilf.o ceill.o \
- copysign.o copysignf.o copysignl.o cosf.o coshf.o coshl.o cosl.o \
- erfl.o exp2.o exp2f.o exp2l.o expf.o expl.o expm1.o expm1l.o expm1f.o \
- fabs.o fabsf.o fabsl.o \
- fdim.o fdimf.o fdiml.o floorf.o floorl.o fma.o fmaf.o fmal.o \
- fmax.o fmaxf.o fmaxl.o fmin.o fminf.o fminl.o fmodf.o \
- fmodl.o fp_consts.o fp_constsf.o fp_constsl.o \
- fpclassify.o fpclassifyf.o fpclassifyl.o \
- frexpf.o frexpl.o fucom.o hypotf.o hypotl.o ilogb.o ilogbf.o \
- ilogbl.o isnan.o isnanf.o isnanl.o ldexpf.o ldexpl.o \
- lgamma.o lgammaf.o lgammal.o llrint.o llrintf.o llrintl.o \
- log10f.o log10l.o log1p.o log1pf.o log1pl.o log2.o log2f.o \
- log2l.o logb.o logbf.o logbl.o logf.o logl.o \
- lrint.o lrintf.o lrintl.o modff.o modfl.o \
- nearbyint.o nearbyintf.o nearbyintl.o \
- nextafterf.o nextafterl.o nexttowardf.o nexttoward.o \
- powf.o powi.o powif.o powil.o powl.o \
- remainder.o remainderf.o remainderl.o remquo.o \
- remquof.o remquol.o rint.o rintf.o rintl.o \
- scalbn.o scalbnf.o scalbnl.o s_erf.o sf_erf.o \
- signbit.o signbitf.o signbitl.o sinf.o sinhf.o sinhl.o sinl.o \
- sqrtf.o sqrtl.o tanf.o tanhf.o tanhl.o tanl.o tgamma.o \
- tgammaf.o tgammal.o trunc.o truncf.o truncl.o \
- acosh.o acoshf.o acoshl.o asinh.o asinhf.o asinhl.o \
- atanh.o atanhf.o atanhl.o
-MATH_ROUND_OBJS = round.o roundf.o roundl.o
-MATH_LROUND_OBJS = lround.o lroundf.o lroundl.o
-MATH_LLROUND_OBJS = llround.o llroundf.o llroundl.o
-FENV_OBJS = fesetround.o fegetround.o \
- fegetenv.o fesetenv.o feupdateenv.o \
- feclearexcept.o feholdexcept.o fegetexceptflag.o \
- feraiseexcept.o fetestexcept.o fesetexceptflag.o
-POSIX_OBJS = \
- dirent.o wdirent.o getopt.o ftruncate.o gettimeofday.o usleep.o \
- basename.o dirname.o tsearch.o twalk.o tdelete.o tfind.o
-REPLACE_OBJS = \
- mingw-aligned-malloc.o mingw-fseek.o
-COMPLEX_OBJS = \
- cabs.o cabsf.o cabsl.o cacos.o cacosf.o cacosl.o cacosh.o \
- cacoshf.o cacoshl.o carg.o cargf.o cargl.o casin.o casinf.o \
- casinl.o casinh.o casinhf.o casinhl.o catan.o catanf.o catanl.o \
- catanh.o catanhf.o catanhl.o ccos.o ccosf.o ccosl.o ccosh.o \
- ccoshf.o ccoshl.o cexp.o cexpf.o cexpl.o cimag.o cimagf.o \
- cimagl.o clog.o clogf.o clogl.o cpow.o cpowf.o cpowl.o cproj.o \
- cprojf.o cprojl.o creal.o crealf.o creall.o csin.o csinf.o \
- csinl.o csinh.o csinhf.o csinhl.o csqrt.o csqrtf.o csqrtl.o \
- ctan.o ctanf.o ctanl.o ctanh.o ctanhf.o ctanhl.o
-GDTOA_OBJS = \
- dmisc.o dtoa.o g__fmt.o g_dfmt.o g_ffmt.o g_xfmt.o gdtoa.o \
- gethex.o gmisc.o hd_init.o hexnan.o misc.o smisc.o \
- strtodg.o strtodnrp.o strtof.o strtopx.o sum.o ulp.o
-
-LIB_OBJS = $(Q8_OBJS) $(CTYPE_OBJS) $(STDLIB_STUB_OBJS) \
- $(STDIO_OBJS) $(MATH_OBJS) $(MATH_ROUND_OBJS) \
- $(MATH_LROUND_OBJS) $(MATH_LLROUND_OBJS) $(FENV_OBJS) \
- $(POSIX_OBJS) $(REPLACE_OBJS) $(COMPLEX_OBJS) \
- $(GDTOA_OBJS)
-
-LIBS = $(LIBMINGWEX_A)
-DLLS =
-
-all: $(LIBMINGWEX_A)
-
-$(LIBMINGWEX_A): $(LIB_OBJS)
- rm -f $(LIBMINGWEX_A)
- $(AR) $(ARFLAGS) $@ $(LIB_OBJS)
- $(RANLIB) $@
-
-$(MATH_ROUND_OBJS): round_generic.c
- $(CC) $(ALL_CFLAGS) -I$(srcdir)/math -c -o $@ \
- -D FUNCTION=$* $(srcdir)/math/round_generic.c
-
-$(MATH_LROUND_OBJS) $(MATH_LLROUND_OBJS): lround_generic.c
- $(CC) $(ALL_CFLAGS) -I$(srcdir)/math -c -o $@ \
- -D FUNCTION=$* $(srcdir)/math/lround_generic.c
-
-Makefile: Makefile.in config.status configure
- $(SHELL) config.status
-
-config.status: configure
- $(SHELL) config.status --recheck
-
-info:
-
-info-html:
-
-install-info: info
-
-install: all
- $(mkinstalldirs) $(inst_libdir)
- for i in $(LIBS); do \
- $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \
- done
-
-clean:
- -rm -f $(LIB_OBJS) $(LIBMINGWEX_A)
-
-distclean:
- -rm -f *.o *.a *~ core a.out
- -rm -f config.cache config.status config.log
- -rm -f Makefile
-.c.o:
- $(CC) -c $(ALL_CFLAGS) $< -o $@
-.S.o:
- $(CC) -c $< -o $@
-.s.o:
- $(CC) -c $< -o $@
-
-# pformat.o needs an explicit build rule; we always build it
-# assuming __MSVCRT_VERSION__ >= 0x0800, relying on ofmt_stub.s
-# (in the parent directory) to maintain forward compatibility
-# for earlier versions of MSVCRT.DLL
-#
-PFORMAT_CFLAGS = $(ALL_CFLAGS) -I $(srcdir)/gdtoa -D__MSVCRT_VERSION__=0x0800
-pformat.o: pformat.c pformat.h
- $(CC) -c $(PFORMAT_CFLAGS) $(srcdir)/stdio/$*.c -o $@
-
-#
-# Dependencies
-#
-wdirent.o: $(srcdir)/dirent.c $(srcdir)/wdirent.c
-
-acosh.o acoshf.o acoshl.o \
-asinh.o asinhf.o asinhl.o \
-atanh.o atanhf.o atanhl.o: fastmath.h
-mbrtowc.o wcrtomb.o wcstof.o wcstold.o: mb_wc_common.h
-
-$(GDTOA_OBJS): gd_arith.h gdtoa.h gdtoaimp.h gd_qnan.h
-
-$(MATH_ROUND_OBJS) $(MATH_LROUND_OBJS) $(MATH_LLROUND_OBJS): round_internal.h
-
-snprintf.o: snprintf.c pformat.h
-vsnprintf.o: vsnprintf.c pformat.h
-
-dist:
- mkdir $(distdir)/mingwex
- chmod 755 $(distdir)/mingwex
- @for i in $(DISTFILES); do\
- cp -p $(srcdir)/$$i $(distdir)/mingwex/$$i ; \
- done
- mkdir $(distdir)/mingwex/math
- chmod 755 $(distdir)/mingwex/math
- @for i in $(MATH_DISTFILES); do\
- cp -p $(srcdir)/math/$$i $(distdir)/mingwex/math/$$i ; \
- done
- mkdir $(distdir)/mingwex/stdio
- chmod 755 $(distdir)/mingwex/stdio
- @for i in $(STDIO_DISTFILES); do\
- cp -p $(srcdir)/stdio/$$i $(distdir)/mingwex/stdio/$$i ; \
- done
- mkdir $(distdir)/mingwex/complex
- chmod 755 $(distdir)/mingwex/complex
- @for i in $(COMPLEX_DISTFILES); do\
- cp -p $(srcdir)/complex/$$i $(distdir)/mingwex/complex/$$i ; \
- done
- mkdir $(distdir)/mingwex/gdtoa
- chmod 755 $(distdir)/mingwex/gdtoa
- @for i in $(GDTOA_DISTFILES); do\
- cp -p $(srcdir)/gdtoa/$$i $(distdir)/mingwex/gdtoa/$$i ; \
- done
diff --git a/winsup/mingw/mingwex/stdio/pformat.c b/winsup/mingw/mingwex/stdio/pformat.c
deleted file mode 100644
index 82dbcd74147..00000000000
--- a/winsup/mingw/mingwex/stdio/pformat.c
+++ /dev/null
@@ -1,2511 +0,0 @@
-/* FIXME: to be removed one day; for now we explicitly are not
- * prepared to support the POSIX-XSI additions to the C99 standard.
- */
-#undef WITH_XSI_FEATURES
-
-/* pformat.c
- *
- * $Id$
- *
- * Provides a core implementation of the formatting capabilities
- * common to the entire `printf()' family of functions; it conforms
- * generally to C99 and SUSv3/POSIX specifications, with extensions
- * to support Microsoft's non-standard format specifications.
- *
- * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- *
- * This is free software. You may redistribute and/or modify it as you
- * see fit, without restriction of copyright.
- *
- * This software is provided "as is", in the hope that it may be useful,
- * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of
- * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no
- * time will the author accept any form of liability for any damages,
- * however caused, resulting from the use of this software.
- *
- * The elements of this implementation which deal with the formatting
- * of floating point numbers, (i.e. the `%e', `%E', `%f', `%F', `%g'
- * and `%G' format specifiers, but excluding the hexadecimal floating
- * point `%a' and `%A' specifiers), make use of the `__gdtoa' function
- * written by David M. Gay, and are modelled on his sample code, which
- * has been deployed under its accompanying terms of use:--
- *
- ******************************************************************
- * Copyright (C) 1997, 1999, 2001 Lucent Technologies
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice appear in all
- * copies and that both that the copyright notice and this
- * permission notice and warranty disclaimer appear in supporting
- * documentation, and that the name of Lucent or any of its entities
- * not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission.
- *
- * LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
- * IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
- * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
- * THIS SOFTWARE.
- ******************************************************************
- *
- */
-#include <stdio.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <locale.h>
-#include <wchar.h>
-#include <math.h>
-
-/* FIXME: The following belongs in values.h, but current MinGW
- * has nothing useful there! OTOH, values.h is not a standard
- * header, and it's use may be considered obsolete; perhaps it
- * is better to just keep these definitions here.
- */
-#ifndef _VALUES_H
-/*
- * values.h
- *
- */
-#define _VALUES_H
-
-#include <limits.h>
-
-#define _TYPEBITS(type) (sizeof(type) * CHAR_BIT)
-
-#define LLONGBITS _TYPEBITS(long long)
-
-#endif /* !defined _VALUES_H -- end of file */
-
-#include "pformat.h"
-
-/* Bit-map constants, defining the internal format control
- * states, which propagate through the flags.
- */
-#define PFORMAT_HASHED 0x0800
-#define PFORMAT_LJUSTIFY 0x0400
-#define PFORMAT_ZEROFILL 0x0200
-
-#define PFORMAT_JUSTIFY (PFORMAT_LJUSTIFY | PFORMAT_ZEROFILL)
-#define PFORMAT_IGNORE -1
-
-#define PFORMAT_SIGNED 0x01C0
-#define PFORMAT_POSITIVE 0x0100
-#define PFORMAT_NEGATIVE 0x0080
-#define PFORMAT_ADDSPACE 0x0040
-
-#define PFORMAT_XCASE 0x0020
-
-#define PFORMAT_LDOUBLE 0x0004
-
-/* `%o' format digit extraction mask, and shift count...
- * (These are constant, and do not propagate through the flags).
- */
-#define PFORMAT_OMASK 0x0007
-#define PFORMAT_OSHIFT 0x0003
-
-/* `%x' and `%X' format digit extraction mask, and shift count...
- * (These are constant, and do not propagate through the flags).
- */
-#define PFORMAT_XMASK 0x000F
-#define PFORMAT_XSHIFT 0x0004
-
-/* The radix point character, used in floating point formats, is
- * localised on the basis of the active LC_NUMERIC locale category.
- * It is stored locally, as a `wchar_t' entity, which is converted
- * to a (possibly multibyte) character on output. Initialisation
- * of the stored `wchar_t' entity, together with a record of its
- * effective multibyte character length, is required each time
- * `__pformat()' is entered, (static storage would not be thread
- * safe), but this initialisation is deferred until it is actually
- * needed; on entry, the effective character length is first set to
- * the following value, (and the `wchar_t' entity is zeroed), to
- * indicate that a call of `localeconv()' is needed, to complete
- * the initialisation.
- */
-#define PFORMAT_RPINIT -3
-
-/* The floating point format handlers return the following value
- * for the radix point position index, when the argument value is
- * infinite, or not a number.
- */
-#define PFORMAT_INFNAN -32768
-
-#ifdef _WIN32
-/*
- * The Microsoft standard for printing `%e' format exponents is
- * with a minimum of three digits, unless explicitly set otherwise,
- * by a prior invocation of the `_set_output_format()' function.
- *
- * The following macro allows us to replicate this behaviour.
- */
-# define PFORMAT_MINEXP __pformat_exponent_digits()
- /*
- * However, this feature is unsupported for versions of the
- * MSVC runtime library prior to msvcr80.dll, and by default,
- * MinGW uses an earlier version, (equivalent to msvcr60.dll),
- * for which `_TWO_DIGIT_EXPONENT' will be undefined.
- */
-# ifndef _TWO_DIGIT_EXPONENT
- /*
- * This hack works around the lack of the `_set_output_format()'
- * feature, when supporting versions of the MSVC runtime library
- * prior to msvcr80.dll; it simply enforces Microsoft's original
- * convention, for all cases where the feature is unsupported.
- */
-# define _get_output_format() 0
-# define _TWO_DIGIT_EXPONENT 1
-# endif
-/*
- * Irrespective of the MSVCRT version supported, *we* will add
- * an additional capability, through the following inline function,
- * which will allow the user to choose his own preferred default
- * for `PRINTF_EXPONENT_DIGITS', through the simple expedient
- * of defining it as an environment variable.
- */
-static __inline__ __attribute__((__always_inline__))
-int __pformat_exponent_digits( void )
-{
- char *exponent_digits = getenv( "PRINTF_EXPONENT_DIGITS" );
- return ((exponent_digits != NULL) && ((unsigned)(*exponent_digits - '0') < 3))
- || (_get_output_format() & _TWO_DIGIT_EXPONENT)
- ? 2
- : 3
- ;
-}
-#else
-/*
- * When we don't care to mimic Microsoft's standard behaviour,
- * we adopt the C99/POSIX standard of two digit exponents.
- */
-# define PFORMAT_MINEXP 2
-#endif
-
-typedef union
-{
- /* A data type agnostic representation,
- * for printf arguments of any integral data type...
- */
- signed long __pformat_long_t;
- signed long long __pformat_llong_t;
- unsigned long __pformat_ulong_t;
- unsigned long long __pformat_ullong_t;
- unsigned short __pformat_ushort_t;
- unsigned char __pformat_uchar_t;
- signed short __pformat_short_t;
- signed char __pformat_char_t;
- void * __pformat_ptr_t;
-} __pformat_intarg_t;
-
-typedef enum
-{
- /* Format interpreter state indices...
- * (used to identify the active phase of format string parsing).
- */
- PFORMAT_INIT = 0,
- PFORMAT_SET_WIDTH,
- PFORMAT_GET_PRECISION,
- PFORMAT_SET_PRECISION,
- PFORMAT_END
-} __pformat_state_t;
-
-typedef enum
-{
- /* Argument length classification indices...
- * (used for arguments representing integer data types).
- */
- PFORMAT_LENGTH_INT = 0,
- PFORMAT_LENGTH_SHORT,
- PFORMAT_LENGTH_LONG,
- PFORMAT_LENGTH_LLONG,
- PFORMAT_LENGTH_CHAR
-} __pformat_length_t;
-/*
- * And a macro to map any arbitrary data type to an appropriate
- * matching index, selected from those above; the compiler should
- * collapse this to a simple assignment.
- */
-#define __pformat_arg_length( type ) \
- sizeof( type ) == sizeof( long long ) ? PFORMAT_LENGTH_LLONG : \
- sizeof( type ) == sizeof( long ) ? PFORMAT_LENGTH_LONG : \
- sizeof( type ) == sizeof( short ) ? PFORMAT_LENGTH_SHORT : \
- sizeof( type ) == sizeof( char ) ? PFORMAT_LENGTH_CHAR : \
- /* should never need this default */ PFORMAT_LENGTH_INT
-
-typedef struct
-{
- /* Formatting and output control data...
- * An instance of this control block is created, (on the stack),
- * for each call to `__pformat()', and is passed by reference to
- * each of the output handlers, as required.
- */
- void * dest;
- int flags;
- int width;
- int precision;
- int rplen;
- wchar_t rpchr;
- int count;
- int quota;
- int expmin;
-} __pformat_t;
-
-static
-void __pformat_putc( int c, __pformat_t *stream )
-{
- /* Place a single character into the `__pformat()' output queue,
- * provided any specified output quota has not been exceeded.
- */
- if( (stream->flags & PFORMAT_NOLIMIT) || (stream->quota > stream->count) )
- {
- /* Either there was no quota specified,
- * or the active quota has not yet been reached.
- */
- if( stream->flags & PFORMAT_TO_FILE )
- /*
- * This is single character output to a FILE stream...
- */
- fputc( c, (FILE *)(stream->dest) );
-
- else
- /* Whereas, this is to an internal memory buffer...
- */
- ((char *)(stream->dest))[stream->count] = c;
- }
- ++stream->count;
-}
-
-static
-void __pformat_putchars( const char *s, int count, __pformat_t *stream )
-{
- /* Handler for `%c' and (indirectly) `%s' conversion specifications.
- *
- * Transfer characters from the string buffer at `s', character by
- * character, up to the number of characters specified by `count', or
- * if `precision' has been explicitly set to a value less than `count',
- * stopping after the number of characters specified for `precision',
- * to the `__pformat()' output stream.
- *
- * Characters to be emitted are passed through `__pformat_putc()', to
- * ensure that any specified output quota is honoured.
- */
- if( (stream->precision >= 0) && (count > stream->precision) )
- /*
- * Ensure that the maximum number of characters transferred doesn't
- * exceed any explicitly set `precision' specification.
- */
- count = stream->precision;
-
- /* Establish the width of any field padding required...
- */
- if( stream->width > count )
- /*
- * as the number of spaces equivalent to the number of characters
- * by which those to be emitted is fewer than the field width...
- */
- stream->width -= count;
-
- else
- /* ignoring any width specification which is insufficient.
- */
- stream->width = PFORMAT_IGNORE;
-
- if( (stream->width > 0) && ((stream->flags & PFORMAT_LJUSTIFY) == 0) )
- /*
- * When not doing flush left justification, (i.e. the `-' flag
- * is not set), any residual unreserved field width must appear
- * as blank padding, to the left of the output string.
- */
- while( stream->width-- )
- __pformat_putc( '\x20', stream );
-
- /* Emit the data...
- */
- while( count-- )
- /*
- * copying the requisite number of characters from the input.
- */
- __pformat_putc( *s++, stream );
-
- /* If we still haven't consumed the entire specified field width,
- * we must be doing flush left justification; any residual width
- * must be filled with blanks, to the right of the output value.
- */
- while( stream->width-- > 0 )
- __pformat_putc( '\x20', stream );
-}
-
-static __inline__
-void __pformat_puts( const char *s, __pformat_t *stream )
-{
- /* Handler for `%s' conversion specifications.
- *
- * Transfer a NUL terminated character string, character by character,
- * stopping when the end of the string is encountered, or if `precision'
- * has been explicitly set, when the specified number of characters has
- * been emitted, if that is less than the length of the input string,
- * to the `__pformat()' output stream.
- *
- * This is implemented as a trivial call to `__pformat_putchars()',
- * passing the length of the input string as the character count.
- */
- __pformat_putchars( s, strlen( s ), stream );
-}
-
-static
-void __pformat_wputchars( const wchar_t *s, int count, __pformat_t *stream )
-{
- /* Handler for `%C'(`%lc') and `%S'(`%ls') conversion specifications;
- * (this is a wide character variant of `__pformat_putchars()').
- *
- * Each multibyte character sequence to be emitted is passed, byte
- * by byte, through `__pformat_putc()', to ensure that any specified
- * output quota is honoured.
- */
- char buf[16]; mbstate_t state; int len = wcrtomb( buf, L'\0', &state );
-
- if( (stream->precision >= 0) && (count > stream->precision) )
- /*
- * Ensure that the maximum number of characters transferred doesn't
- * exceed any explicitly set `precision' specification.
- */
- count = stream->precision;
-
- /* Establish the width of any field padding required...
- */
- if( stream->width > count )
- /*
- * as the number of spaces equivalent to the number of characters
- * by which those to be emitted is fewer than the field width...
- */
- stream->width -= count;
-
- else
- /* ignoring any width specification which is insufficient.
- */
- stream->width = PFORMAT_IGNORE;
-
- if( (stream->width > 0) && ((stream->flags & PFORMAT_LJUSTIFY) == 0) )
- /*
- * When not doing flush left justification, (i.e. the `-' flag
- * is not set), any residual unreserved field width must appear
- * as blank padding, to the left of the output string.
- */
- while( stream->width-- )
- __pformat_putc( '\x20', stream );
-
- /* Emit the data, converting each character from the wide
- * to the multibyte domain as we go...
- */
- while( (count-- > 0) && ((len = wcrtomb( buf, *s++, &state )) > 0) )
- {
- char *p = buf;
- while( len-- > 0 )
- __pformat_putc( *p++, stream );
- }
-
- /* If we still haven't consumed the entire specified field width,
- * we must be doing flush left justification; any residual width
- * must be filled with blanks, to the right of the output value.
- */
- while( stream->width-- > 0 )
- __pformat_putc( '\x20', stream );
-}
-
-static __inline__ __attribute__((__always_inline__))
-void __pformat_wcputs( const wchar_t *s, __pformat_t *stream )
-{
- /* Handler for `%S' (`%ls') conversion specifications.
- *
- * Transfer a NUL terminated wide character string, character by
- * character, converting to its equivalent multibyte representation
- * on output, and stopping when the end of the string is encountered,
- * or if `precision' has been explicitly set, when the specified number
- * of characters has been emitted, if that is less than the length of
- * the input string, to the `__pformat()' output stream.
- *
- * This is implemented as a trivial call to `__pformat_wputchars()',
- * passing the length of the input string as the character count.
- */
- __pformat_wputchars( s, wcslen( s ), stream );
-}
-
-static __inline__
-int __pformat_int_bufsiz( int bias, int size, __pformat_t *stream )
-{
- /* Helper to establish the size of the internal buffer, which
- * is required to queue the ASCII decomposition of an integral
- * data value, prior to transfer to the output stream.
- */
- size = ((size - 1 + LLONGBITS) / size) + bias;
- size += (stream->precision > 0) ? stream->precision : 0;
- return (size > stream->width) ? size : stream->width;
-}
-
-static
-void __pformat_int( __pformat_intarg_t value, __pformat_t *stream )
-{
- /* Handler for `%d', `%i' and `%u' conversion specifications.
- *
- * Transfer the ASCII representation of an integer value parameter,
- * formatted as a decimal number, to the `__pformat()' output queue;
- * output will be truncated, if any specified quota is exceeded.
- */
- char buf[__pformat_int_bufsiz(1, PFORMAT_OSHIFT, stream)];
- char *p = buf; int precision;
-
- if( stream->flags & PFORMAT_NEGATIVE )
- {
- /* The input value might be negative, (i.e. it is a signed value)...
- */
- if( value.__pformat_llong_t < 0LL )
- /*
- * It IS negative, but we want to encode it as unsigned,
- * displayed with a leading minus sign, so convert it...
- */
- value.__pformat_llong_t = -value.__pformat_llong_t;
-
- else
- /* It is unequivocally a POSITIVE value, so turn off the
- * request to prefix it with a minus sign...
- */
- stream->flags &= ~PFORMAT_NEGATIVE;
- }
-
- /* Encode the input value for display...
- */
- while( value.__pformat_ullong_t )
- {
- /* decomposing it into its constituent decimal digits,
- * in order from least significant to most significant, using
- * the local buffer as a LIFO queue in which to store them.
- */
- *p++ = '0' + (unsigned char)(value.__pformat_ullong_t % 10LL);
- value.__pformat_ullong_t /= 10LL;
- }
-
- if( (stream->precision > 0)
- && ((precision = stream->precision - (p - buf)) > 0) )
- /*
- * We have not yet queued sufficient digits to fill the field width
- * specified for minimum `precision'; pad with zeros to achieve this.
- */
- while( precision-- > 0 )
- *p++ = '0';
-
- if( (p == buf) && (stream->precision != 0) )
- /*
- * Input value was zero; make sure we print at least one digit,
- * unless the precision is also explicitly zero.
- */
- *p++ = '0';
-
- if( (stream->width > 0) && ((stream->width -= p - buf) > 0) )
- {
- /* We have now queued sufficient characters to display the input value,
- * at the desired precision, but this will not fill the output field...
- */
- if( stream->flags & PFORMAT_SIGNED )
- /*
- * We will fill one additional space with a sign...
- */
- stream->width--;
-
- if( (stream->precision < 0)
- && ((stream->flags & PFORMAT_JUSTIFY) == PFORMAT_ZEROFILL) )
- /*
- * and the `0' flag is in effect, so we pad the remaining spaces,
- * to the left of the displayed value, with zeroes.
- */
- while( stream->width-- > 0 )
- *p++ = '0';
-
- else if( (stream->flags & PFORMAT_LJUSTIFY) == 0 )
- /*
- * the `0' flag is not in effect, and neither is the `-' flag,
- * so we pad to the left of the displayed value with spaces, so that
- * the value appears right justified within the output field.
- */
- while( stream->width-- > 0 )
- __pformat_putc( '\x20', stream );
- }
-
- if( stream->flags & PFORMAT_NEGATIVE )
- /*
- * A negative value needs a sign...
- */
- *p++ = '-';
-
- else if( stream->flags & PFORMAT_POSITIVE )
- /*
- * A positive value may have an optionally displayed sign...
- */
- *p++ = '+';
-
- else if( stream->flags & PFORMAT_ADDSPACE )
- /*
- * Space was reserved for displaying a sign, but none was emitted...
- */
- *p++ = '\x20';
-
- while( p > buf )
- /*
- * Emit the accumulated constituent digits,
- * in order from most significant to least significant...
- */
- __pformat_putc( *--p, stream );
-
- while( stream->width-- > 0 )
- /*
- * The specified output field has not yet been completely filled;
- * the `-' flag must be in effect, resulting in a displayed value which
- * appears left justified within the output field; we must pad the field
- * to the right of the displayed value, by emitting additional spaces,
- * until we reach the rightmost field boundary.
- */
- __pformat_putc( '\x20', stream );
-}
-
-static
-void __pformat_xint( int fmt, __pformat_intarg_t value, __pformat_t *stream )
-{
- /* Handler for `%o', `%p', `%x' and `%X' conversions.
- *
- * These can be implemented using a simple `mask and shift' strategy;
- * set up the mask and shift values appropriate to the conversion format,
- * and allocate a suitably sized local buffer, in which to queue encoded
- * digits of the formatted value, in preparation for output.
- */
- int width;
- int mask = (fmt == 'o') ? PFORMAT_OMASK : PFORMAT_XMASK;
- int shift = (fmt == 'o') ? PFORMAT_OSHIFT : PFORMAT_XSHIFT;
- char buf[__pformat_int_bufsiz(2, shift, stream)];
- char *p = buf;
-
- while( value.__pformat_ullong_t )
- {
- /* Encode the specified non-zero input value as a sequence of digits,
- * in the appropriate `base' encoding and in reverse digit order, each
- * encoded in its printable ASCII form, with no leading zeros, using
- * the local buffer as a LIFO queue in which to store them.
- */
- char *q;
- if( (*(q = p++) = '0' + (value.__pformat_ullong_t & mask)) > '9' )
- *q = (*q + 'A' - '9' - 1) | (fmt & PFORMAT_XCASE);
- value.__pformat_ullong_t >>= shift;
- }
-
- if( p == buf )
- /*
- * Nothing was queued; input value must be zero, which should never be
- * emitted in the `alternative' PFORMAT_HASHED style.
- */
- stream->flags &= ~PFORMAT_HASHED;
-
- if( ((width = stream->precision) > 0) && ((width -= p - buf) > 0) )
- /*
- * We have not yet queued sufficient digits to fill the field width
- * specified for minimum `precision'; pad with zeros to achieve this.
- */
- while( width-- > 0 )
- *p++ = '0';
-
- else if( (fmt == 'o') && (stream->flags & PFORMAT_HASHED) )
- /*
- * The field width specified for minimum `precision' has already
- * been filled, but the `alternative' PFORMAT_HASHED style for octal
- * output requires at least one initial zero; that will not have
- * been queued, so add it now.
- */
- *p++ = '0';
-
- if( (p == buf) && (stream->precision != 0) )
- /*
- * Still nothing queued for output, but the `precision' has not been
- * explicitly specified as zero, (which is necessary if no output for
- * an input value of zero is desired); queue exactly one zero digit.
- */
- *p++ = '0';
-
- if( stream->width > (width = p - buf) )
- /*
- * Specified field width exceeds the minimum required...
- * Adjust so that we retain only the additional padding width.
- */
- stream->width -= width;
-
- else
- /* Ignore any width specification which is insufficient.
- */
- stream->width = PFORMAT_IGNORE;
-
- if( ((width = stream->width) > 0)
- && (fmt != 'o') && (stream->flags & PFORMAT_HASHED) )
- /*
- * For `%#x' or `%#X' formats, (which have the `#' flag set),
- * further reduce the padding width to accommodate the radix
- * indicating prefix.
- */
- width -= 2;
-
- if( (width > 0) && (stream->precision < 0)
- && ((stream->flags & PFORMAT_JUSTIFY) == PFORMAT_ZEROFILL) )
- /*
- * When the `0' flag is set, and not overridden by the `-' flag,
- * or by a specified precision, add sufficient leading zeroes to
- * consume the remaining field width.
- */
- while( width-- > 0 )
- *p++ = '0';
-
- if( (fmt != 'o') && (stream->flags & PFORMAT_HASHED) )
- {
- /* For formats other than octal, the PFORMAT_HASHED output style
- * requires the addition of a two character radix indicator, as a
- * prefix to the actual encoded numeric value.
- */
- *p++ = fmt;
- *p++ = '0';
- }
-
- if( (width > 0) && ((stream->flags & PFORMAT_LJUSTIFY) == 0) )
- /*
- * When not doing flush left justification, (i.e. the `-' flag
- * is not set), any residual unreserved field width must appear
- * as blank padding, to the left of the output value.
- */
- while( width-- > 0 )
- __pformat_putc( '\x20', stream );
-
- while( p > buf )
- /*
- * Move the queued output from the local buffer to the ultimate
- * destination, in LIFO order.
- */
- __pformat_putc( *--p, stream );
-
- /* If we still haven't consumed the entire specified field width,
- * we must be doing flush left justification; any residual width
- * must be filled with blanks, to the right of the output value.
- */
- while( width-- > 0 )
- __pformat_putc( '\x20', stream );
-}
-
-typedef union
-{
- /* A multifaceted representation of an IEEE extended precision,
- * (80-bit), floating point number, facilitating access to its
- * component parts.
- */
- double __pformat_fpreg_double_t;
- long double __pformat_fpreg_ldouble_t;
- struct
- { unsigned long long __pformat_fpreg_mantissa;
- signed short __pformat_fpreg_exponent;
- };
- unsigned short __pformat_fpreg_bitmap[5];
- unsigned long __pformat_fpreg_bits;
-} __pformat_fpreg_t;
-
-#ifdef _WIN32
-/* TODO: make this unconditional in final release...
- * (see note at head of associated `#else' block.
- */
-#include "gdtoa.h"
-
-static
-char *__pformat_cvt( int mode, __pformat_fpreg_t x, int nd, int *dp, int *sign )
-{
- /* Helper function, derived from David M. Gay's `g_xfmt()', calling
- * his `__gdtoa()' function in a manner to provide extended precision
- * replacements for `ecvt()' and `fcvt()'.
- */
- unsigned int k, e = 0; char *ep;
- static FPI fpi = { 64, 1-16383-64+1, 32766-16383-64+1, FPI_Round_near, 0 };
-
- /* Classify the argument into an appropriate `__gdtoa()' category...
- */
- if( (k = __fpclassifyl( x.__pformat_fpreg_ldouble_t )) & FP_NAN )
- /*
- * identifying infinities or not-a-number...
- */
- k = (k & FP_NORMAL) ? STRTOG_Infinite : STRTOG_NaN;
-
- else if( k & FP_NORMAL )
- {
- /* normal and near-zero `denormals'...
- */
- if( k & FP_ZERO )
- {
- /* with appropriate exponent adjustment for a `denormal'...
- */
- k = STRTOG_Denormal;
- e = 1 - 0x3FFF - 63;
- }
- else
- {
- /* or with `normal' exponent adjustment...
- */
- k = STRTOG_Normal;
- e = (x.__pformat_fpreg_exponent & 0x7FFF) - 0x3FFF - 63;
- }
- }
-
- else
- /* or, if none of the above, it's a zero, (positive or negative).
- */
- k = STRTOG_Zero;
-
- /* Check for negative values, always treating NaN as unsigned...
- * (return value is zero for positive/unsigned; non-zero for negative).
- */
- *sign = (k == STRTOG_NaN) ? 0 : x.__pformat_fpreg_exponent & 0x8000;
-
- /* Finally, get the raw digit string, and radix point position index.
- */
- return __gdtoa( &fpi, e, &x.__pformat_fpreg_bits, &k, mode, nd, dp, &ep );
-}
-
-static __inline__ __attribute__((__always_inline__))
-char *__pformat_ecvt( long double x, int precision, int *dp, int *sign )
-{
- /* A convenience wrapper for the above...
- * it emulates `ecvt()', but takes a `long double' argument.
- */
- __pformat_fpreg_t z; z.__pformat_fpreg_ldouble_t = x;
- return __pformat_cvt( 2, z, precision, dp, sign );
-}
-
-static __inline__ __attribute__((__always_inline__))
-char *__pformat_fcvt( long double x, int precision, int *dp, int *sign )
-{
- /* A convenience wrapper for the above...
- * it emulates `fcvt()', but takes a `long double' argument.
- */
- __pformat_fpreg_t z; z.__pformat_fpreg_ldouble_t = x;
- return __pformat_cvt( 3, z, precision, dp, sign );
-}
-
-/* The following are required, to clean up the `__gdtoa()' memory pool,
- * after processing the data returned by the above.
- */
-#define __pformat_ecvt_release( value ) __freedtoa( value )
-#define __pformat_fcvt_release( value ) __freedtoa( value )
-
-#else
-/*
- * TODO: remove this before final release; it is included here as a
- * convenience for testing, without requiring a working `__gdtoa()'.
- */
-static __inline__
-char *__pformat_ecvt( long double x, int precision, int *dp, int *sign )
-{
- /* Define in terms of `ecvt()'...
- */
- char *retval = ecvt( (double)(x), precision, dp, sign );
- if( isinf( x ) || isnan( x ) )
- {
- /* emulating `__gdtoa()' reporting for infinities and NaN.
- */
- *dp = PFORMAT_INFNAN;
- if( *retval == '-' )
- {
- /* Need to force the `sign' flag, (particularly for NaN).
- */
- ++retval; *sign = 1;
- }
- }
- return retval;
-}
-
-static __inline__
-char *__pformat_fcvt( long double x, int precision, int *dp, int *sign )
-{
- /* Define in terms of `fcvt()'...
- */
- char *retval = fcvt( (double)(x), precision, dp, sign );
- if( isinf( x ) || isnan( x ) )
- {
- /* emulating `__gdtoa()' reporting for infinities and NaN.
- */
- *dp = PFORMAT_INFNAN;
- if( *retval == '-' )
- {
- /* Need to force the `sign' flag, (particularly for NaN).
- */
- ++retval; *sign = 1;
- }
- }
- return retval;
-}
-
-/* No memory pool clean up needed, for these emulated cases...
- */
-#define __pformat_ecvt_release( value ) /* nothing to be done */
-#define __pformat_fcvt_release( value ) /* nothing to be done */
-
-/* TODO: end of conditional to be removed. */
-#endif
-
-static __inline__
-void __pformat_emit_radix_point( __pformat_t *stream )
-{
- /* Helper to place a localised representation of the radix point
- * character at the ultimate destination, when formatting fixed or
- * floating point numbers.
- */
- if( stream->rplen == PFORMAT_RPINIT )
- {
- /* Radix point initialisation not yet completed;
- * establish a multibyte to `wchar_t' converter...
- */
- int len; wchar_t rpchr; mbstate_t state;
-
- /* Initialise the conversion state...
- */
- memset( &state, 0, sizeof( state ) );
-
- /* Fetch and convert the localised radix point representation...
- */
- if( (len = mbrtowc( &rpchr, localeconv()->decimal_point, 16, &state )) > 0 )
- /*
- * and store it, if valid.
- */
- stream->rpchr = rpchr;
-
- /* In any case, store the reported effective multibyte length,
- * (or the error flag), marking initialisation as `done'.
- */
- stream->rplen = len;
- }
-
- if( stream->rpchr != (wchar_t)(0) )
- {
- /* We have a localised radix point mark;
- * establish a converter to make it a multibyte character...
- */
- int len; char buf[len = stream->rplen]; mbstate_t state;
-
- /* Initialise the conversion state...
- */
- memset( &state, 0, sizeof( state ) );
-
- /* Convert the `wchar_t' representation to multibyte...
- */
- if( (len = wcrtomb( buf, stream->rpchr, &state )) > 0 )
- {
- /* and copy to the output destination, when valid...
- */
- char *p = buf;
- while( len-- > 0 )
- __pformat_putc( *p++, stream );
- }
-
- else
- /* otherwise fall back to plain ASCII '.'...
- */
- __pformat_putc( '.', stream );
- }
-
- else
- /* No localisation: just use ASCII '.'...
- */
- __pformat_putc( '.', stream );
-}
-
-static __inline__ __attribute__((__always_inline__))
-void __pformat_emit_numeric_value( int c, __pformat_t *stream )
-{
- /* Convenience helper to transfer numeric data from an internal
- * formatting buffer to the ultimate destination...
- */
- if( c == '.' )
- /*
- * converting this internal representation of the the radix
- * point to the appropriately localised representation...
- */
- __pformat_emit_radix_point( stream );
-
- else
- /* and passing all other characters through, unmodified.
- */
- __pformat_putc( c, stream );
-}
-
-static
-void __pformat_emit_inf_or_nan( int sign, char *value, __pformat_t *stream )
-{
- /* Helper to emit INF or NAN where a floating point value
- * resolves to one of these special states.
- */
- int i;
- char buf[4];
- char *p = buf;
-
- /* We use the string formatting helper to display INF/NAN,
- * but we don't want truncation if the precision set for the
- * original floating point output request was insufficient;
- * ignore it!
- */
- stream->precision = PFORMAT_IGNORE;
-
- if( sign )
- /*
- * Negative infinity: emit the sign...
- */
- *p++ = '-';
-
- else if( stream->flags & PFORMAT_POSITIVE )
- /*
- * Not negative infinity, but '+' flag is in effect;
- * thus, we emit a positive sign...
- */
- *p++ = '+';
-
- else if( stream->flags & PFORMAT_ADDSPACE )
- /*
- * No sign required, but space was reserved for it...
- */
- *p++ = '\x20';
-
- /* Copy the appropriate status indicator, up to a maximum of
- * three characters, transforming to the case corresponding to
- * the format specification...
- */
- for( i = 3; i > 0; --i )
- *p++ = (*value++ & ~PFORMAT_XCASE) | (stream->flags & PFORMAT_XCASE);
-
- /* and emit the result.
- */
- __pformat_putchars( buf, p - buf, stream );
-}
-
-static
-void __pformat_emit_float( int sign, char *value, int len, __pformat_t *stream )
-{
- /* Helper to emit a fixed point representation of numeric data,
- * as encoded by a prior call to `ecvt()' or `fcvt()'; (this does
- * NOT include the exponent, for floating point format).
- */
- if( len > 0 )
- {
- /* The magnitude of `x' is greater than or equal to 1.0...
- * reserve space in the output field, for the required number of
- * decimal digits to be placed before the decimal point...
- */
- if( stream->width > len )
- /*
- * adjusting as appropriate, when width is sufficient...
- */
- stream->width -= len;
-
- else
- /* or simply ignoring the width specification, if not.
- */
- stream->width = PFORMAT_IGNORE;
- }
-
- else if( stream->width > 0 )
- /*
- * The magnitude of `x' is less than 1.0...
- * reserve space for exactly one zero before the decimal point.
- */
- stream->width--;
-
- /* Reserve additional space for the digits which will follow the
- * decimal point...
- */
- if( (stream->width >= 0) && (stream->width > stream->precision) )
- /*
- * adjusting appropriately, when sufficient width remains...
- * (note that we must check both of these conditions, because
- * precision may be more negative than width, as a result of
- * adjustment to provide extra padding when trailing zeroes
- * are to be discarded from "%g" format conversion with a
- * specified field width, but if width itself is negative,
- * then there is explicitly to be no padding anyway).
- */
- stream->width -= stream->precision;
-
- else
- /* or again, ignoring the width specification, if not.
- */
- stream->width = PFORMAT_IGNORE;
-
- /* Reserve space in the output field, for display of the decimal point,
- * unless the precision is explicity zero, with the `#' flag not set.
- */
- if( (stream->width > 0)
- && ((stream->precision > 0) || (stream->flags & PFORMAT_HASHED)) )
- stream->width--;
-
- /* Reserve space in the output field, for display of the sign of the
- * formatted value, if required; (i.e. if the value is negative, or if
- * either the `space' or `+' formatting flags are set).
- */
- if( (stream->width > 0) && (sign || (stream->flags & PFORMAT_SIGNED)) )
- stream->width--;
-
- /* Emit any padding space, as required to correctly right justify
- * the output within the alloted field width.
- */
- if( (stream->width > 0) && ((stream->flags & PFORMAT_JUSTIFY) == 0) )
- while( stream->width-- > 0 )
- __pformat_putc( '\x20', stream );
-
- /* Emit the sign indicator, as appropriate...
- */
- if( sign )
- /*
- * mandatory, for negative values...
- */
- __pformat_putc( '-', stream );
-
- else if( stream->flags & PFORMAT_POSITIVE )
- /*
- * optional, for positive values...
- */
- __pformat_putc( '+', stream );
-
- else if( stream->flags & PFORMAT_ADDSPACE )
- /*
- * or just fill reserved space, when the space flag is in effect.
- */
- __pformat_putc( '\x20', stream );
-
- /* If the `0' flag is in effect, and not overridden by the `-' flag,
- * then zero padding, to fill out the field, goes here...
- */
- if( (stream->width > 0)
- && ((stream->flags & PFORMAT_JUSTIFY) == PFORMAT_ZEROFILL) )
- while( stream->width-- > 0 )
- __pformat_putc( '0', stream );
-
- /* Emit the digits of the encoded numeric value...
- */
- if( len > 0 )
- {
- /* beginning with those which precede the radix point,
- * and appending any necessary significant trailing zeroes.
- */
- while( len-- > 0 )
- __pformat_putc( *value ? *value++ : '0', stream );
-
- /* Unless the encoded value is integral, AND the radix point
- * is not expressly demanded by the `#' flag, we must insert
- * the appropriately localised radix point mark here...
- */
- if( (stream->precision > 0) || (stream->flags & PFORMAT_HASHED) )
- __pformat_emit_radix_point( stream );
- }
-
- else
- {
- /* The magnitude of the encoded value is less than 1.0, so no
- * digits precede the radix point; we emit a mandatory initial
- * zero, followed immediately by the radix point.
- */
- __pformat_putc( '0', stream );
- __pformat_emit_radix_point( stream );
-
- /* The radix point offset, `len', may be negative; this implies
- * that additional zeroes must appear, following the radix point,
- * and preceding the first significant digit. We reduce the
- * precision, (adding a negative value), to allow for these
- * additional zeroes, then emit the zeroes as required.
- */
- stream->precision += len;
- while( len++ < 0 )
- __pformat_putc( '0', stream );
- }
-
- /* Now we emit any remaining significant digits, or trailing zeroes,
- * until the required precision has been achieved.
- */
- while( stream->precision-- > 0 )
- __pformat_putc( *value ? *value++ : '0', stream );
-}
-
-static
-void __pformat_emit_efloat( int sign, char *value, int e, __pformat_t *stream )
-{
- /* Helper to emit a floating point representation of numeric data,
- * as encoded by a prior call to `ecvt()' or `fcvt()'; (this DOES
- * include the following exponent).
- */
- int exp_width = 1;
- __pformat_intarg_t exponent; exponent.__pformat_llong_t = e -= 1;
-
- /* Determine how many digit positions are required for the exponent.
- */
- while( (e /= 10) != 0 )
- exp_width++;
-
- /* Ensure that this is at least as many as the standard requirement.
- */
- if( exp_width < stream->expmin )
- exp_width = stream->expmin;
-
- /* Adjust the residual field width allocation, to allow for the
- * number of exponent digits to be emitted, together with a sign
- * and exponent separator...
- */
- if( stream->width > (exp_width += 2) )
- stream->width -= exp_width;
-
- else
- /* ignoring the field width specification, if insufficient.
- */
- stream->width = PFORMAT_IGNORE;
-
- /* Emit the significand, as a fixed point value with one digit
- * preceding the radix point.
- */
- __pformat_emit_float( sign, value, 1, stream );
-
- /* Reset precision, to ensure the mandatory minimum number of
- * exponent digits will be emitted, and set the flags to ensure
- * the sign is displayed.
- */
- stream->precision = stream->expmin;
- stream->flags |= PFORMAT_SIGNED;
-
- /* Emit the exponent separator.
- */
- __pformat_putc( ('E' | (stream->flags & PFORMAT_XCASE)), stream );
-
- /* Readjust the field width setting, such that it again allows
- * for the digits of the exponent, (which had been discounted when
- * computing any left side padding requirement), so that they are
- * correctly included in the computation of any right side padding
- * requirement, (but here we exclude the exponent separator, which
- * has been emitted, and so counted already).
- */
- stream->width += exp_width - 1;
-
- /* And finally, emit the exponent itself, as a signed integer,
- * with any padding required to achieve flush left justification,
- * (which will be added automatically, by `__pformat_int()').
- */
- __pformat_int( exponent, stream );
-}
-
-static
-void __pformat_float( long double x, __pformat_t *stream )
-{
- /* Handler for `%f' and `%F' format specifiers.
- *
- * This wraps calls to `__pformat_cvt()', `__pformat_emit_float()'
- * and `__pformat_emit_inf_or_nan()', as appropriate, to achieve
- * output in fixed point format.
- */
- int sign, intlen; char *value;
-
- /* Establish the precision for the displayed value, defaulting to six
- * digits following the decimal point, if not explicitly specified.
- */
- if( stream->precision < 0 )
- stream->precision = 6;
-
- /* Encode the input value as ASCII, for display...
- */
- value = __pformat_fcvt( x, stream->precision, &intlen, &sign );
-
- if( intlen == PFORMAT_INFNAN )
- /*
- * handle cases of `infinity' or `not-a-number'...
- */
- __pformat_emit_inf_or_nan( sign, value, stream );
-
- else
- { /* or otherwise, emit the formatted result.
- */
- __pformat_emit_float( sign, value, intlen, stream );
-
- /* and, if there is any residual field width as yet unfilled,
- * then we must be doing flush left justification, so pad out to
- * the right hand field boundary.
- */
- while( stream->width-- > 0 )
- __pformat_putc( '\x20', stream );
- }
-
- /* Clean up `__pformat_fcvt()' memory allocation for `value'...
- */
- __pformat_fcvt_release( value );
-}
-
-static
-void __pformat_efloat( long double x, __pformat_t *stream )
-{
- /* Handler for `%e' and `%E' format specifiers.
- *
- * This wraps calls to `__pformat_cvt()', `__pformat_emit_efloat()'
- * and `__pformat_emit_inf_or_nan()', as appropriate, to achieve
- * output in floating point format.
- */
- int sign, intlen; char *value;
-
- /* Establish the precision for the displayed value, defaulting to six
- * digits following the decimal point, if not explicitly specified.
- */
- if( stream->precision < 0 )
- stream->precision = 6;
-
- /* Encode the input value as ASCII, for display...
- */
- value = __pformat_ecvt( x, stream->precision + 1, &intlen, &sign );
-
- if( intlen == PFORMAT_INFNAN )
- /*
- * handle cases of `infinity' or `not-a-number'...
- */
- __pformat_emit_inf_or_nan( sign, value, stream );
-
- else
- /* or otherwise, emit the formatted result.
- */
- __pformat_emit_efloat( sign, value, intlen, stream );
-
- /* Clean up `__pformat_ecvt()' memory allocation for `value'...
- */
- __pformat_ecvt_release( value );
-}
-
-static
-void __pformat_gfloat( long double x, __pformat_t *stream )
-{
- /* Handler for `%g' and `%G' format specifiers.
- *
- * This wraps calls to `__pformat_cvt()', `__pformat_emit_float()',
- * `__pformat_emit_efloat()' and `__pformat_emit_inf_or_nan()', as
- * appropriate, to achieve output in the more suitable of either
- * fixed or floating point format.
- */
- int sign, intlen; char *value;
-
- /* Establish the precision for the displayed value, defaulting to
- * six significant digits, if not explicitly specified...
- */
- if( stream->precision < 0 )
- stream->precision = 6;
-
- /* or to a minimum of one digit, otherwise...
- */
- else if( stream->precision == 0 )
- stream->precision = 1;
-
- /* Encode the input value as ASCII, for display.
- */
- value = __pformat_ecvt( x, stream->precision, &intlen, &sign );
-
- if( intlen == PFORMAT_INFNAN )
- /*
- * Handle cases of `infinity' or `not-a-number'.
- */
- __pformat_emit_inf_or_nan( sign, value, stream );
-
- else if( (-4 < intlen) && (intlen <= stream->precision) )
- {
- /* Value lies in the acceptable range for fixed point output,
- * (i.e. the exponent is no less than minus four, and the number
- * of significant digits which precede the radix point is fewer
- * than the least number which would overflow the field width,
- * specified or implied by the established precision).
- */
- if( (stream->flags & PFORMAT_HASHED) == PFORMAT_HASHED )
- /*
- * The `#' flag is in effect...
- * Adjust precision to retain the specified number of significant
- * digits, with the proper number preceding the radix point, and
- * the balance following it...
- */
- stream->precision -= intlen;
-
- else
- /* The `#' flag is not in effect...
- * Here we adjust the precision to accommodate all digits which
- * precede the radix point, but we truncate any balance following
- * it, to suppress output of non-significant trailing zeroes...
- */
- if( ((stream->precision = strlen( value ) - intlen) < 0)
- /*
- * This may require a compensating adjustment to the field
- * width, to accommodate significant trailing zeroes, which
- * precede the radix point...
- */
- && (stream->width > 0) )
- stream->width += stream->precision;
-
- /* Now, we format the result as any other fixed point value.
- */
- __pformat_emit_float( sign, value, intlen, stream );
-
- /* If there is any residual field width as yet unfilled, then
- * we must be doing flush left justification, so pad out to the
- * right hand field boundary.
- */
- while( stream->width-- > 0 )
- __pformat_putc( '\x20', stream );
- }
-
- else
- { /* Value lies outside the acceptable range for fixed point;
- * one significant digit will precede the radix point, so we
- * decrement the precision to retain only the appropriate number
- * of additional digits following it, when we emit the result
- * in floating point format.
- */
- if( (stream->flags & PFORMAT_HASHED) == PFORMAT_HASHED )
- /*
- * The `#' flag is in effect...
- * Adjust precision to emit the specified number of significant
- * digits, with one preceding the radix point, and the balance
- * following it, retaining any non-significant trailing zeroes
- * which are required to exactly match the requested precision...
- */
- stream->precision--;
-
- else
- /* The `#' flag is not in effect...
- * Adjust precision to emit only significant digits, with one
- * preceding the radix point, and any others following it, but
- * suppressing non-significant trailing zeroes...
- */
- stream->precision = strlen( value ) - 1;
-
- /* Now, we format the result as any other floating point value.
- */
- __pformat_emit_efloat( sign, value, intlen, stream );
- }
-
- /* Clean up `__pformat_ecvt()' memory allocation for `value'.
- */
- __pformat_ecvt_release( value );
-}
-
-static
-void __pformat_emit_xfloat( __pformat_fpreg_t value, __pformat_t *stream )
-{
- /* Helper for emitting floating point data, originating as
- * either `double' or `long double' type, as a hexadecimal
- * representation of the argument value.
- */
- char buf[18], *p = buf;
- __pformat_intarg_t exponent; short exp_width = 2;
-
- /* The mantissa field of the argument value representation can
- * accommodate at most 16 hexadecimal digits, of which one will
- * be placed before the radix point, leaving at most 15 digits
- * to satisfy any requested precision; thus...
- */
- if( (stream->precision >= 0) && (stream->precision < 15) )
- {
- /* When the user specifies a precision within this range,
- * we want to adjust the mantissa, to retain just the number
- * of digits required, rounding up when the high bit of the
- * leftmost discarded digit is set; (mask of 0x08 accounts
- * for exactly one digit discarded, shifting 4 bits per
- * digit, with up to 14 additional digits, to consume the
- * full availability of 15 precision digits).
- *
- * However, before we perform the rounding operation, we
- * normalise the mantissa, shifting it to the left by as many
- * bit positions may be necessary, until its highest order bit
- * is set, thus preserving the maximum number of bits in the
- * rounded result as possible.
- */
- while( value.__pformat_fpreg_mantissa < (LLONG_MAX + 1ULL) )
- value.__pformat_fpreg_mantissa <<= 1;
-
- /* We then shift the mantissa one bit position back to the
- * right, to guard against possible overflow when the rounding
- * adjustment is added.
- */
- value.__pformat_fpreg_mantissa >>= 1;
-
- /* We now add the rounding adjustment, noting that to keep the
- * 0x08 mask aligned with the shifted mantissa, we also need to
- * shift it right by one bit initially, changing its starting
- * value to 0x04...
- */
- value.__pformat_fpreg_mantissa += 0x04LL << (4 * (14 - stream->precision));
- if( (value.__pformat_fpreg_mantissa & (LLONG_MAX + 1ULL)) == 0ULL )
- /*
- * When the rounding adjustment would not have overflowed,
- * then we shift back to the left again, to fill the vacated
- * bit we reserved to accommodate the carry.
- */
- value.__pformat_fpreg_mantissa <<= 1;
-
- else
- /* Otherwise the rounding adjustment would have overflowed,
- * so the carry has already filled the vacated bit; the effect
- * of this is equivalent to an increment of the exponent.
- */
- value.__pformat_fpreg_exponent++;
-
- /* We now complete the rounding to the required precision, by
- * shifting the unwanted digits out, from the right hand end of
- * the mantissa.
- */
- value.__pformat_fpreg_mantissa >>= 4 * (15 - stream->precision);
- }
-
- /* Encode the significant digits of the mantissa in hexadecimal
- * ASCII notation, ready for transfer to the output stream...
- */
- while( value.__pformat_fpreg_mantissa )
- {
- /* taking the rightmost digit in each pass...
- */
- int c = value.__pformat_fpreg_mantissa & 0xF;
- if( c == value.__pformat_fpreg_mantissa )
- {
- /* inserting the radix point, when we reach the last,
- * (i.e. the most significant digit), unless we found no
- * less significant digits, with no mandatory radix point
- * inclusion, and no additional required precision...
- */
- if( (p > buf)
- || (stream->flags & PFORMAT_HASHED) || (stream->precision > 0) )
- /*
- * Internally, we represent the radix point as an ASCII '.';
- * we will replace it with any locale specific alternative,
- * at the time of transfer to the ultimate destination.
- */
- *p++ = '.';
-
- /* If the most significant hexadecimal digit of the encoded
- * output value is greater than one, then the indicated value
- * will appear too large, by an additional binary exponent
- * corresponding to the number of higher order bit positions
- * which it occupies...
- */
- while( value.__pformat_fpreg_mantissa > 1 )
- {
- /* so reduce the exponent value to compensate...
- */
- value.__pformat_fpreg_exponent--;
- value.__pformat_fpreg_mantissa >>= 1;
- }
- }
-
- else if( stream->precision > 0 )
- /*
- * we have not yet fulfilled the desired precision,
- * and we have not yet found the most significant digit,
- * so account for the current digit, within the field
- * width required to meet the specified precision.
- */
- stream->precision--;
-
- if( (c > 0) || (p > buf) || (stream->precision >= 0) )
- /*
- * Ignoring insignificant trailing zeroes, (unless required to
- * satisfy specified precision), store the current encoded digit
- * into the pending output buffer, in LIFO order, and using the
- * appropriate case for digits in the `A'..`F' range.
- */
- *p++ = c > 9 ? (c - 10 + 'A') | (stream->flags & PFORMAT_XCASE) : c + '0';
-
- /* Shift out the current digit, (4-bit logical shift right),
- * to align the next more significant digit to be extracted,
- * and encoded in the next pass.
- */
- value.__pformat_fpreg_mantissa >>= 4;
- }
-
- if( p == buf )
- {
- /* Nothing has been queued for output...
- * We need at least one zero, and possibly a radix point.
- */
- if( (stream->precision > 0) || (stream->flags & PFORMAT_HASHED) )
- *p++ = '.';
-
- *p++ = '0';
- }
-
- if( stream->width > 0 )
- {
- /* Adjust the user specified field width, to account for the
- * number of digits minimally required, to display the encoded
- * value, at the requested precision.
- *
- * FIXME: this uses the minimum number of digits possible for
- * representation of the binary exponent, in strict conformance
- * with C99 and POSIX specifications. Although there appears to
- * be no Microsoft precedent for doing otherwise, we may wish to
- * relate this to the `_get_output_format()' result, to maintain
- * consistency with `%e', `%f' and `%g' styles.
- */
- int min_width = p - buf;
- int exponent = value.__pformat_fpreg_exponent;
-
- /* If we have not yet queued sufficient digits to fulfil the
- * requested precision, then we must adjust the minimum width
- * specification, to accommodate the additional digits which
- * are required to do so.
- */
- if( stream->precision > 0 )
- min_width += stream->precision;
-
- /* Adjust the minimum width requirement, to accomodate the
- * sign, radix indicator and at least one exponent digit...
- */
- min_width += stream->flags & PFORMAT_SIGNED ? 6 : 5;
- while( (exponent = exponent / 10) != 0 )
- {
- /* and increase as required, if additional exponent digits
- * are needed, also saving the exponent field width adjustment,
- * for later use when that is emitted.
- */
- min_width++;
- exp_width++;
- }
-
- if( stream->width > min_width )
- {
- /* When specified field width exceeds the minimum required,
- * adjust to retain only the excess...
- */
- stream->width -= min_width;
-
- /* and then emit any required left side padding spaces.
- */
- if( (stream->flags & PFORMAT_JUSTIFY) == 0 )
- while( stream->width-- > 0 )
- __pformat_putc( '\x20', stream );
- }
-
- else
- /* Specified field width is insufficient; just ignore it!
- */
- stream->width = PFORMAT_IGNORE;
- }
-
- /* Emit the sign of the encoded value, as required...
- */
- if( stream->flags & PFORMAT_NEGATIVE )
- /*
- * this is mandatory, to indicate a negative value...
- */
- __pformat_putc( '-', stream );
-
- else if( stream->flags & PFORMAT_POSITIVE )
- /*
- * but this is optional, for a positive value...
- */
- __pformat_putc( '+', stream );
-
- else if( stream->flags & PFORMAT_ADDSPACE )
- /*
- * with this optional alternative.
- */
- __pformat_putc( '\x20', stream );
-
- /* Prefix a `0x' or `0X' radix indicator to the encoded value,
- * with case appropriate to the format specification.
- */
- __pformat_putc( '0', stream );
- __pformat_putc( 'X' | (stream->flags & PFORMAT_XCASE), stream );
-
- /* If the `0' flag is in effect...
- * Zero padding, to fill out the field, goes here...
- */
- if( (stream->width > 0) && (stream->flags & PFORMAT_ZEROFILL) )
- while( stream->width-- > 0 )
- __pformat_putc( '0', stream );
-
- /* Next, we emit the encoded value, without its exponent...
- */
- while( p > buf )
- __pformat_emit_numeric_value( *--p, stream );
-
- /* followed by any additional zeroes needed to satisfy the
- * precision specification...
- */
- while( stream->precision-- > 0 )
- __pformat_putc( '0', stream );
-
- /* then the exponent prefix, (C99 and POSIX specify `p'),
- * in the case appropriate to the format specification...
- */
- __pformat_putc( 'P' | (stream->flags & PFORMAT_XCASE), stream );
-
- /* and finally, the decimal representation of the binary exponent,
- * as a signed value with mandatory sign displayed, in a field width
- * adjusted to accommodate it, LEFT justified, with any additional
- * right side padding remaining from the original field width.
- */
- stream->width += exp_width;
- stream->flags |= PFORMAT_SIGNED;
- exponent.__pformat_llong_t = value.__pformat_fpreg_exponent;
- __pformat_int( exponent, stream );
-}
-
-static
-void __pformat_xdouble( double x, __pformat_t *stream )
-{
- /* Handler for `%a' and `%A' format specifiers, (with argument
- * value specified as `double' type).
- */
- unsigned sign_bit = 0;
- __pformat_fpreg_t z; z.__pformat_fpreg_double_t = x;
-
- /* First check for NaN; it is emitted unsigned...
- */
- if( isnan( x ) )
- __pformat_emit_inf_or_nan( sign_bit, "NaN", stream );
-
- else
- { /* Capture the sign bit up-front, so we can show it correctly
- * even when the argument value is zero or infinite.
- */
- if( (sign_bit = (z.__pformat_fpreg_bitmap[3] & 0x8000)) != 0 )
- stream->flags |= PFORMAT_NEGATIVE;
-
- /* Check for infinity, (positive or negative)...
- */
- if( isinf( x ) )
- /*
- * displaying the appropriately signed indicator,
- * when appropriate.
- */
- __pformat_emit_inf_or_nan( sign_bit, "Inf", stream );
-
- else
- { /* The argument value is a representable number...
- * first move its exponent into the appropriate field...
- */
- z.__pformat_fpreg_bitmap[4] = (z.__pformat_fpreg_bitmap[3] >> 4) & 0x7FF;
-
- /* Realign the mantissa, leaving space for a
- * normalised most significant digit...
- */
- z.__pformat_fpreg_mantissa <<= 8;
- z.__pformat_fpreg_bitmap[3] = (z.__pformat_fpreg_bitmap[3] & 0x0FFF);
-
- /* Check for zero value...
- */
- if( z.__pformat_fpreg_exponent || z.__pformat_fpreg_mantissa )
- {
- /* and only when the value is non-zero,
- * eliminate the bias from the exponent...
- */
- z.__pformat_fpreg_exponent -= 0x3FF;
-
- /* Check for a possible denormalised value...
- */
- if( z.__pformat_fpreg_exponent > -126 )
- /*
- * and normalise when it isn't.
- */
- z.__pformat_fpreg_bitmap[3] += 0x1000;
- }
-
- /* Finally, hand the adjusted representation off to the generalised
- * hexadecimal floating point format handler...
- */
- __pformat_emit_xfloat( z, stream );
- }
- }
-}
-
-static
-void __pformat_xldouble( long double x, __pformat_t *stream )
-{
- /* Handler for `%La' and `%LA' format specifiers, (with argument
- * value specified as `long double' type).
- */
- unsigned sign_bit = 0;
- __pformat_fpreg_t z; z.__pformat_fpreg_ldouble_t = x;
-
- /* First check for NaN; it is emitted unsigned...
- */
- if( isnan( x ) )
- __pformat_emit_inf_or_nan( sign_bit, "NaN", stream );
-
- else
- { /* Capture the sign bit up-front, so we can show it correctly
- * even when the argument value is zero or infinite.
- */
- if( (sign_bit = (z.__pformat_fpreg_exponent & 0x8000)) != 0 )
- stream->flags |= PFORMAT_NEGATIVE;
-
- /* Check for infinity, (positive or negative)...
- */
- if( isinf( x ) )
- /*
- * displaying the appropriately signed indicator,
- * when appropriate.
- */
- __pformat_emit_inf_or_nan( sign_bit, "Inf", stream );
-
- else
- { /* The argument value is a representable number...
- * extract the effective value of the biased exponent...
- */
- z.__pformat_fpreg_exponent &= 0x7FFF;
- if( z.__pformat_fpreg_exponent || z.__pformat_fpreg_mantissa )
- /*
- * and if the argument value itself is non-zero,
- * eliminate the bias from the exponent...
- */
- z.__pformat_fpreg_exponent -= 0x3FFF;
-
- /* Finally, hand the adjusted representation off to the
- * generalised hexadecimal floating point format handler...
- */
- __pformat_emit_xfloat( z, stream );
- }
- }
-}
-
-int __pformat( int flags, void *dest, int max, const char *fmt, va_list argv )
-{
- int c;
-
- __pformat_t stream =
- {
- /* Create and initialise a format control block
- * for this output request.
- */
- dest, /* output goes to here */
- flags &= PFORMAT_TO_FILE | PFORMAT_NOLIMIT, /* only these valid initially */
- PFORMAT_IGNORE, /* no field width yet */
- PFORMAT_IGNORE, /* nor any precision spec */
- PFORMAT_RPINIT, /* radix point uninitialised */
- (wchar_t)(0), /* leave it unspecified */
- 0, /* zero output char count */
- max, /* establish output limit */
- PFORMAT_MINEXP /* exponent chars preferred */
- };
-
- format_scan: while( (c = *fmt++) != 0 )
- {
- /* Format string parsing loop...
- * The entry point is labelled, so that we can return to the start state
- * from within the inner `conversion specification' interpretation loop,
- * as soon as a conversion specification has been resolved.
- */
- if( c == '%' )
- {
- /* Initiate parsing of a `conversion specification'...
- */
- __pformat_intarg_t argval;
- __pformat_state_t state = PFORMAT_INIT;
- __pformat_length_t length = PFORMAT_LENGTH_INT;
-
- /* Restart capture for dynamic field width and precision specs...
- */
- int *width_spec = &stream.width;
-
- /* Reset initial state for flags, width and precision specs...
- */
- stream.flags = flags;
- stream.width = stream.precision = PFORMAT_IGNORE;
-
- while( *fmt )
- {
- switch( c = *fmt++ )
- {
- /* Data type specifiers...
- * All are terminal, so exit the conversion spec parsing loop
- * with a `goto format_scan', thus resuming at the outer level
- * in the regular format string parser.
- */
- case '%':
- /*
- * Not strictly a data type specifier...
- * it simply converts as a literal `%' character.
- *
- * FIXME: should we require this to IMMEDIATELY follow the
- * initial `%' of the "conversion spec"? (glibc `printf()'
- * on GNU/Linux does NOT appear to require this, but POSIX
- * and SUSv3 do seem to demand it).
- */
- __pformat_putc( c, &stream );
- goto format_scan;
-
- case 'C':
- /*
- * Equivalent to `%lc'; set `length' accordingly,
- * and simply fall through.
- */
- length = PFORMAT_LENGTH_LONG;
-
- case 'c':
- /*
- * Single, (or single multibyte), character output...
- *
- * We handle these by copying the argument into our local
- * `argval' buffer, and then we pass the address of that to
- * either `__pformat_putchars()' or `__pformat_wputchars()',
- * as appropriate, effectively formatting it as a string of
- * the appropriate type, with a length of one.
- *
- * A side effect of this method of handling character data
- * is that, if the user sets a precision of zero, then no
- * character is actually emitted; we don't want that, so we
- * forcibly override any user specified precision.
- */
- stream.precision = PFORMAT_IGNORE;
-
- /* Now we invoke the appropriate format handler...
- */
- if( (length == PFORMAT_LENGTH_LONG)
- || (length == PFORMAT_LENGTH_LLONG) )
- {
- /* considering any `long' type modifier as a reference to
- * `wchar_t' data, (which is promoted to an `int' argument)...
- */
- argval.__pformat_ullong_t = (wchar_t)(va_arg( argv, int ));
- __pformat_wputchars( (wchar_t *)(&argval), 1, &stream );
- }
-
- else
- { /* while anything else is simply taken as `char', (which
- * is also promoted to an `int' argument)...
- */
- argval.__pformat_uchar_t = (unsigned char)(va_arg( argv, int ));
- __pformat_putchars( (char *)(&argval), 1, &stream );
- }
- goto format_scan;
-
- case 'S':
- /*
- * Equivalent to `%ls'; set `length' accordingly,
- * and simply fall through.
- */
- length = PFORMAT_LENGTH_LONG;
-
- case 's':
- if( (length == PFORMAT_LENGTH_LONG)
- || (length == PFORMAT_LENGTH_LLONG) )
- {
- /* considering any `long' type modifier as a reference to
- * a `wchar_t' string...
- */
- __pformat_wcputs( va_arg( argv, wchar_t * ), &stream );
- }
-
- else
- /* This is normal string output;
- * we simply invoke the appropriate handler...
- */
- __pformat_puts( va_arg( argv, char * ), &stream );
-
- goto format_scan;
-
- case 'o':
- case 'u':
- case 'x':
- case 'X':
- /*
- * Unsigned integer values; octal, decimal or hexadecimal format...
- */
- if( length == PFORMAT_LENGTH_LLONG )
- /*
- * with an `unsigned long long' argument, which we
- * process `as is'...
- */
- argval.__pformat_ullong_t = va_arg( argv, unsigned long long );
-
- else if( length == PFORMAT_LENGTH_LONG )
- /*
- * or with an `unsigned long', which we promote to
- * `unsigned long long'...
- */
- argval.__pformat_ullong_t = va_arg( argv, unsigned long );
-
- else
- { /* or for any other size, which will have been promoted
- * to `unsigned int', we select only the appropriately sized
- * least significant segment, and again promote to the same
- * size as `unsigned long long'...
- */
- argval.__pformat_ullong_t = va_arg( argv, unsigned int );
- if( length == PFORMAT_LENGTH_SHORT )
- /*
- * from `unsigned short'...
- */
- argval.__pformat_ullong_t = argval.__pformat_ushort_t;
-
- else if( length == PFORMAT_LENGTH_CHAR )
- /*
- * or even from `unsigned char'...
- */
- argval.__pformat_ullong_t = argval.__pformat_uchar_t;
- }
-
- /* so we can pass any size of argument to either of two
- * common format handlers...
- */
- if( c == 'u' )
- /*
- * depending on whether output is to be encoded in
- * decimal format...
- */
- __pformat_int( argval, &stream );
-
- else
- /* or in octal or hexadecimal format...
- */
- __pformat_xint( c, argval, &stream );
-
- goto format_scan;
-
- case 'd':
- case 'i':
- /*
- * Signed integer values; decimal format...
- * This is similar to `u', but must process `argval' as signed,
- * and be prepared to handle negative numbers.
- */
- stream.flags |= PFORMAT_NEGATIVE;
-
- if( length == PFORMAT_LENGTH_LLONG )
- /*
- * The argument is a `long long' type...
- */
- argval.__pformat_llong_t = va_arg( argv, long long );
-
- else if( length == PFORMAT_LENGTH_LONG )
- /*
- * or here, a `long' type...
- */
- argval.__pformat_llong_t = va_arg( argv, long );
-
- else
- { /* otherwise, it's an `int' type...
- */
- argval.__pformat_llong_t = va_arg( argv, int );
- if( length == PFORMAT_LENGTH_SHORT )
- /*
- * but it was promoted from a `short' type...
- */
- argval.__pformat_llong_t = argval.__pformat_short_t;
- else if( length == PFORMAT_LENGTH_CHAR )
- /*
- * or even from a `char' type...
- */
- argval.__pformat_llong_t = argval.__pformat_char_t;
- }
-
- /* In any case, all share a common handler...
- */
- __pformat_int( argval, &stream );
- goto format_scan;
-
- case 'p':
- /*
- * Pointer argument; format as hexadecimal, with `0x' prefix...
- */
- stream.flags |= PFORMAT_HASHED;
- argval.__pformat_ullong_t = va_arg( argv, uintptr_t );
- __pformat_xint( 'x', argval, &stream );
- goto format_scan;
-
- case 'e':
- /*
- * Floating point format, with lower case exponent indicator
- * and lower case `inf' or `nan' representation when required;
- * select lower case mode, and simply fall through...
- */
- stream.flags |= PFORMAT_XCASE;
-
- case 'E':
- /*
- * Floating point format, with upper case exponent indicator
- * and upper case `INF' or `NAN' representation when required,
- * (or lower case for all of these, on fall through from above);
- * select lower case mode, and simply fall through...
- */
- if( stream.flags & PFORMAT_LDOUBLE )
- /*
- * for a `long double' argument...
- */
- __pformat_efloat( va_arg( argv, long double ), &stream );
-
- else
- /* or just a `double', which we promote to `long double',
- * so the two may share a common format handler.
- */
- __pformat_efloat( (long double)(va_arg( argv, double )), &stream );
-
- goto format_scan;
-
- case 'f':
- /*
- * Fixed point format, using lower case for `inf' and
- * `nan', when appropriate; select lower case mode, and
- * simply fall through...
- */
- stream.flags |= PFORMAT_XCASE;
-
- case 'F':
- /*
- * Fixed case format using upper case, or lower case on
- * fall through from above, for `INF' and `NAN'...
- */
- if( stream.flags & PFORMAT_LDOUBLE )
- /*
- * for a `long double' argument...
- */
- __pformat_float( va_arg( argv, long double ), &stream );
-
- else
- /* or just a `double', which we promote to `long double',
- * so the two may share a common format handler.
- */
- __pformat_float( (long double)(va_arg( argv, double )), &stream );
-
- goto format_scan;
-
- case 'g':
- /*
- * Generalised floating point format, with lower case
- * exponent indicator when required; select lower case
- * mode, and simply fall through...
- */
- stream.flags |= PFORMAT_XCASE;
-
- case 'G':
- /*
- * Generalised floating point format, with upper case,
- * or on fall through from above, with lower case exponent
- * indicator when required...
- */
- if( stream.flags & PFORMAT_LDOUBLE )
- /*
- * for a `long double' argument...
- */
- __pformat_gfloat( va_arg( argv, long double ), &stream );
-
- else
- /* or just a `double', which we promote to `long double',
- * so the two may share a common format handler.
- */
- __pformat_gfloat( (long double)(va_arg( argv, double )), &stream );
-
- goto format_scan;
-
- case 'a':
- /*
- * Hexadecimal floating point format, with lower case radix
- * and exponent indicators; select the lower case mode, and
- * fall through...
- */
- stream.flags |= PFORMAT_XCASE;
-
- case 'A':
- /*
- * Hexadecimal floating point format; handles radix and
- * exponent indicators in either upper or lower case...
- */
- if( stream.flags & PFORMAT_LDOUBLE )
- /*
- * with a `long double' argument...
- */
- __pformat_xldouble( va_arg( argv, long double ), &stream );
-
- else
- /* or just a `double'.
- */
- __pformat_xdouble( va_arg( argv, double ), &stream );
-
- goto format_scan;
-
- case 'n':
- /*
- * Save current output character count...
- */
- if( length == PFORMAT_LENGTH_CHAR )
- /*
- * to a signed `char' destination...
- */
- *va_arg( argv, char * ) = stream.count;
-
- else if( length == PFORMAT_LENGTH_SHORT )
- /*
- * or to a signed `short'...
- */
- *va_arg( argv, short * ) = stream.count;
-
- else if( length == PFORMAT_LENGTH_LONG )
- /*
- * or to a signed `long'...
- */
- *va_arg( argv, long * ) = stream.count;
-
- else if( length == PFORMAT_LENGTH_LLONG )
- /*
- * or to a signed `long long'...
- */
- *va_arg( argv, long long * ) = stream.count;
-
- else
- /*
- * or, by default, to a signed `int'.
- */
- *va_arg( argv, int * ) = stream.count;
-
- goto format_scan;
-
- /* Argument length modifiers...
- * These are non-terminal; each sets the format parser
- * into the PFORMAT_END state, and ends with a `break'.
- */
- case 'h':
- /*
- * Interpret the argument as explicitly of a `short'
- * or `char' data type, truncated from the standard
- * length defined for integer promotion.
- */
- if( *fmt == 'h' )
- {
- /* Modifier is `hh'; data type is `char' sized...
- * Skip the second `h', and set length accordingly.
- */
- ++fmt;
- length = PFORMAT_LENGTH_CHAR;
- }
-
- else
- /* Modifier is `h'; data type is `short' sized...
- */
- length = PFORMAT_LENGTH_SHORT;
-
- state = PFORMAT_END;
- break;
-
- case 'j':
- /*
- * Interpret the argument as being of the same size as
- * a `intmax_t' entity...
- */
- length = __pformat_arg_length( intmax_t );
- state = PFORMAT_END;
- break;
-
-# ifdef _WIN32
-
- case 'I':
- /*
- * The MSVCRT implementation of the printf() family of
- * functions explicitly uses...
- */
- if( (fmt[0] == '6') && (fmt[1] == '4') )
- {
- /* I64' instead of `ll',
- * when referring to `long long' integer types...
- */
- length = PFORMAT_LENGTH_LLONG;
- fmt += 2;
- }
-
- else if( (fmt[0] == '3') && (fmt[1] == '2') )
- {
- /* and `I32' instead of `l',
- * when referring to `long' integer types...
- */
- length = PFORMAT_LENGTH_LONG;
- fmt += 2;
- }
-
- else
- /* or unqualified `I' instead of `t' or `z',
- * when referring to `ptrdiff_t' or `size_t' entities;
- * (we will choose to map it to `ptrdiff_t').
- */
- length = __pformat_arg_length( ptrdiff_t );
-
- state = PFORMAT_END;
- break;
-
-# endif
-
- case 'l':
- /*
- * Interpret the argument as explicitly of a
- * `long' or `long long' data type.
- */
- if( *fmt == 'l' )
- {
- /* Modifier is `ll'; data type is `long long' sized...
- * Skip the second `l', and set length accordingly.
- */
- ++fmt;
- length = PFORMAT_LENGTH_LLONG;
- }
-
- else
- /* Modifier is `l'; data type is `long' sized...
- */
- length = PFORMAT_LENGTH_LONG;
-
-# ifndef _WIN32
- /*
- * Microsoft's MSVCRT implementation also uses `l'
- * as a modifier for `long double'; if we don't want
- * to support that, we end this case here...
- */
- state = PFORMAT_END;
- break;
-
- /* otherwise, we simply fall through...
- */
-# endif
-
- case 'L':
- /*
- * Identify the appropriate argument as a `long double',
- * when associated with `%a', `%A', `%e', `%E', `%f', `%F',
- * `%g' or `%G' format specifications.
- */
- stream.flags |= PFORMAT_LDOUBLE;
- state = PFORMAT_END;
- break;
-
- case 't':
- /*
- * Interpret the argument as being of the same size as
- * a `ptrdiff_t' entity...
- */
- length = __pformat_arg_length( ptrdiff_t );
- state = PFORMAT_END;
- break;
-
- case 'z':
- /*
- * Interpret the argument as being of the same size as
- * a `size_t' entity...
- */
- length = __pformat_arg_length( size_t );
- state = PFORMAT_END;
- break;
-
- /* Precision indicator...
- * May appear once only; it must precede any modifier
- * for argument length, or any data type specifier.
- */
- case '.':
- if( state < PFORMAT_GET_PRECISION )
- {
- /* We haven't seen a precision specification yet,
- * so initialise it to zero, (in case no digits follow),
- * and accept any following digits as the precision.
- */
- stream.precision = 0;
- width_spec = &stream.precision;
- state = PFORMAT_GET_PRECISION;
- }
-
- else
- /* We've already seen a precision specification,
- * so this is just junk; proceed to end game.
- */
- state = PFORMAT_END;
-
- /* Either way, we must not fall through here.
- */
- break;
-
- /* Variable field width, or precision specification,
- * derived from the argument list...
- */
- case '*':
- /*
- * When this appears...
- */
- if( width_spec
- && ((state == PFORMAT_INIT) || (state == PFORMAT_GET_PRECISION)) )
- {
- /* in proper context; assign to field width
- * or precision, as appropriate.
- */
- if( (*width_spec = va_arg( argv, int )) < 0 )
- {
- /* Assigned value was negative...
- */
- if( state == PFORMAT_INIT )
- {
- /* For field width, this is equivalent to
- * a positive value with the `-' flag...
- */
- stream.flags |= PFORMAT_LJUSTIFY;
- stream.width = -stream.width;
- }
-
- else
- /* while as a precision specification,
- * it should simply be ignored.
- */
- stream.precision = PFORMAT_IGNORE;
- }
- }
-
- else
- /* out of context; give up on width and precision
- * specifications for this conversion.
- */
- state = PFORMAT_END;
-
- /* Mark as processed...
- * we must not see `*' again, in this context.
- */
- width_spec = NULL;
- break;
-
- /* Formatting flags...
- * Must appear while in the PFORMAT_INIT state,
- * and are non-terminal, so again, end with `break'.
- */
- case '#':
- /*
- * Select alternate PFORMAT_HASHED output style.
- */
- if( state == PFORMAT_INIT )
- stream.flags |= PFORMAT_HASHED;
- break;
-
- case '+':
- /*
- * Print a leading sign with numeric output,
- * for both positive and negative values.
- */
- if( state == PFORMAT_INIT )
- stream.flags |= PFORMAT_POSITIVE;
- break;
-
- case '-':
- /*
- * Select left justification of displayed output
- * data, within the output field width, instead of
- * the default flush right justification.
- */
- if( state == PFORMAT_INIT )
- stream.flags |= PFORMAT_LJUSTIFY;
- break;
-
-# ifdef WITH_XSI_FEATURES
-
- case '\'':
- /*
- * This is an XSI extension to the POSIX standard,
- * which we do not support, at present.
- */
- if( state == PFORMAT_INIT )
- stream.flags |= PFORMAT_GROUPED;
- break;
-
-# endif
-
- case '\x20':
- /*
- * Reserve a single space, within the output field,
- * for display of the sign of signed data; this will
- * be occupied by the minus sign, if the data value
- * is negative, or by a plus sign if the data value
- * is positive AND the `+' flag is also present, or
- * by a space otherwise. (Technically, this flag
- * is redundant, if the `+' flag is present).
- */
- if( state == PFORMAT_INIT )
- stream.flags |= PFORMAT_ADDSPACE;
- break;
-
- case '0':
- /*
- * May represent a flag, to activate the `pad with zeroes'
- * option, or it may simply be a digit in a width or in a
- * precision specification...
- */
- if( state == PFORMAT_INIT )
- {
- /* This is the flag usage...
- */
- stream.flags |= PFORMAT_ZEROFILL;
- break;
- }
-
- default:
- /*
- * If we didn't match anything above, then we will check
- * for digits, which we may accumulate to generate field
- * width or precision specifications...
- */
- if( (state < PFORMAT_END) && ('9' >= c) && (c >= '0') )
- {
- if( state == PFORMAT_INIT )
- /*
- * Initial digits explicitly relate to field width...
- */
- state = PFORMAT_SET_WIDTH;
-
- else if( state == PFORMAT_GET_PRECISION )
- /*
- * while those following a precision indicator
- * explicitly relate to precision.
- */
- state = PFORMAT_SET_PRECISION;
-
- if( width_spec )
- {
- /* We are accepting a width or precision specification...
- */
- if( *width_spec < 0 )
- /*
- * and accumulation hasn't started yet; we simply
- * initialise the accumulator with the current digit
- * value, converting from ASCII to decimal.
- */
- *width_spec = c - '0';
-
- else
- /* Accumulation has already started; we perform a
- * `leftwise decimal digit shift' on the accumulator,
- * (i.e. multiply it by ten), then add the decimal
- * equivalent value of the current digit.
- */
- *width_spec = *width_spec * 10 + c - '0';
- }
- }
-
- else
- /* We found a digit out of context, or some other character
- * with no designated meaning; silently reject it, and any
- * further characters other than argument length modifiers,
- * until this format specification is completely resolved.
- */
- state = PFORMAT_END;
- }
- }
- }
-
- else
- /* We just parsed a character which is not included within any format
- * specification; we simply emit it as a literal.
- */
- __pformat_putc( c, &stream );
- }
-
- /* When we have fully dispatched the format string, the return value is the
- * total number of bytes we transferred to the output destination.
- */
- return stream.count;
-}
-
-/* $RCSfile$Revision$: end of file */
diff --git a/winsup/mingw/mingwex/stdio/pformat.h b/winsup/mingw/mingwex/stdio/pformat.h
deleted file mode 100644
index a2ace696c3b..00000000000
--- a/winsup/mingw/mingwex/stdio/pformat.h
+++ /dev/null
@@ -1,90 +0,0 @@
-#ifndef PFORMAT_H
-/*
- * pformat.h
- *
- * $Id$
- *
- * A private header, defining the `pformat' API; it is to be included
- * in each compilation unit implementing any of the `printf' family of
- * functions, but serves no useful purpose elsewhere.
- *
- * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- *
- * This is free software. You may redistribute and/or modify it as you
- * see fit, without restriction of copyright.
- *
- * This software is provided "as is", in the hope that it may be useful,
- * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of
- * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no
- * time will the author accept any form of liability for any damages,
- * however caused, resulting from the use of this software.
- */
-#define PFORMAT_H
-
-/* The following macros reproduce definitions from _mingw.h,
- * so that compilation will not choke, if using any compiler
- * other than the MinGW implementation of GCC.
- */
-#ifndef __cdecl
-# ifdef __GNUC__
-# define __cdecl __attribute__((__cdecl__))
-# else
-# define __cdecl
-# endif
-#endif
-
-#ifndef __MINGW_GNUC_PREREQ
-# if defined __GNUC__ && defined __GNUC_MINOR__
-# define __MINGW_GNUC_PREREQ( major, minor )\
- (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
-# else
-# define __MINGW_GNUC_PREREQ( major, minor )
-# endif
-#endif
-
-#ifndef __MINGW_NOTHROW
-# if __MINGW_GNUC_PREREQ( 3, 3 )
-# define __MINGW_NOTHROW __attribute__((__nothrow__))
-# else
-# define __MINGW_NOTHROW
-# endif
-#endif
-
-/* This isn't currently defined therein,
- * but is a potential candidate for inclusion in _mingw.h
- */
-#ifdef __MINGW32__
-# define __stringify__(NAME) #NAME
-# define __mingw_quoted(NAME) __stringify__(__mingw_##NAME)
-# define __mingw_alias(NAME) __attribute__((alias(__mingw_quoted(NAME)))) NAME
-#else
-# define __mingw_alias(NAME) NAME
-#endif
-
-/* The following are the declarations specific to the `pformat' API...
- */
-#define PFORMAT_TO_FILE 0x1000
-#define PFORMAT_NOLIMIT 0x2000
-
-#ifdef __MINGW32__
- /*
- * Map MinGW specific function names, for use in place of the generic
- * implementation defined equivalent function names.
- */
-# define __pformat __mingw_pformat
-
-# define __printf __mingw_printf
-# define __fprintf __mingw_fprintf
-# define __sprintf __mingw_sprintf
-# define __snprintf __mingw_snprintf
-
-# define __vprintf __mingw_vprintf
-# define __vfprintf __mingw_vfprintf
-# define __vsprintf __mingw_vsprintf
-# define __vsnprintf __mingw_vsnprintf
-
-#endif
-
-int __cdecl __pformat( int, void *, int, const char *, va_list ) __MINGW_NOTHROW;
-
-#endif /* !defined PFORMAT_H: $RCSfile$Revision$: end of file */
diff --git a/winsup/mingw/mingwex/stdio/snprintf.c b/winsup/mingw/mingwex/stdio/snprintf.c
deleted file mode 100644
index 4d022e7dc60..00000000000
--- a/winsup/mingw/mingwex/stdio/snprintf.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* snprintf.c
- *
- * $Id$
- *
- * Provides an implementation of the "snprintf" function, conforming
- * generally to C99 and SUSv3/POSIX specifications, with extensions
- * to support Microsoft's non-standard format specifications. This
- * is included in libmingwex.a, replacing the redirection through
- * libmoldnames.a, to the MSVCRT standard "_snprintf" function; (the
- * standard MSVCRT function remains available, and may be invoked
- * directly, using this fully qualified form of its name).
- *
- * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- *
- * This is free software. You may redistribute and/or modify it as you
- * see fit, without restriction of copyright.
- *
- * This software is provided "as is", in the hope that it may be useful,
- * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of
- * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no
- * time will the author accept any form of liability for any damages,
- * however caused, resulting from the use of this software.
- *
- */
-
-#include <stdio.h>
-#include <stdarg.h>
-
-#include "pformat.h"
-
-int __cdecl __snprintf (char *, size_t, const char *fmt, ...) __MINGW_NOTHROW;
-int __cdecl __mingw_alias(snprintf) (char *, size_t, const char *, ...) __MINGW_NOTHROW;
-
-int __cdecl __vsnprintf (char *, size_t, const char *fmt, va_list) __MINGW_NOTHROW;
-
-int __cdecl __snprintf( char *buf, size_t length, const char *fmt, ... )
-{
- va_list argv; va_start( argv, fmt );
- register int retval = __vsnprintf( buf, length, fmt, argv );
- va_end( argv );
- return retval;
-}
-
-/* $RCSfile$Revision$: end of file */
diff --git a/winsup/mingw/mingwex/stdio/vsnprintf.c b/winsup/mingw/mingwex/stdio/vsnprintf.c
deleted file mode 100644
index a9722c23520..00000000000
--- a/winsup/mingw/mingwex/stdio/vsnprintf.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* vsnprintf.c
- *
- * $Id$
- *
- * Provides an implementation of the "vsnprintf" function, conforming
- * generally to C99 and SUSv3/POSIX specifications, with extensions
- * to support Microsoft's non-standard format specifications. This
- * is included in libmingwex.a, replacing the redirection through
- * libmoldnames.a, to the MSVCRT standard "_vsnprintf" function; (the
- * standard MSVCRT function remains available, and may be invoked
- * directly, using this fully qualified form of its name).
- *
- * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- *
- * This is free software. You may redistribute and/or modify it as you
- * see fit, without restriction of copyright.
- *
- * This software is provided "as is", in the hope that it may be useful,
- * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of
- * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no
- * time will the author accept any form of liability for any damages,
- * however caused, resulting from the use of this software.
- *
- */
-
-#include <stdio.h>
-#include <stdarg.h>
-
-#include "pformat.h"
-
-int __cdecl __vsnprintf (char *, size_t, const char *fmt, va_list) __MINGW_NOTHROW;
-int __cdecl __mingw_alias(vsnprintf) (char *, size_t, const char *, va_list) __MINGW_NOTHROW;
-
-int __cdecl __vsnprintf( char *buf, size_t length, const char *fmt, va_list argv )
-{
- register int retval;
-
- if( length == (size_t)(0) )
- /*
- * No buffer; simply compute and return the size required,
- * without actually emitting any data.
- */
- return __pformat( 0, buf, 0, fmt, argv );
-
- /* If we get to here, then we have a buffer...
- * Emit data up to the limit of buffer length less one,
- * then add the requisite NUL terminator.
- */
- retval = __pformat( 0, buf, --length, fmt, argv );
- buf[retval < length ? retval : length] = '\0';
-
- return retval;
-}
-
-/* $RCSfile$Revision$: end of file */
diff --git a/winsup/mingw/ofmt_stub.s b/winsup/mingw/ofmt_stub.s
deleted file mode 100644
index 388dcb45dfa..00000000000
--- a/winsup/mingw/ofmt_stub.s
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ofmt_stub.s
- *
- * $Id$
- *
- * A trivial stub, to replace the _get_output_format() function.
- *
- * _pformat() requires this function, which is provided by MSVCRT runtimes
- * from msvcr80.dll onwards; add this stub to the import libraries for earlier
- * versions of MSVCRT, (those which do not already advertise availability of
- * any exported _get_output_format() function); this will permit _pformat()
- * to transparently interoperate with all supported versions of MSVCRT.
- * (Likewise for CRTDLL).
- *
- * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Contributed to the MinGW Project, and hereby assigned to the public domain.
- *
- * This is free software. It is provided AS IS, in the hope that it may be
- * useful. There is NO WARRANTY OF ANY KIND, not even an implied warranty of
- * merchantability, nor of fitness for any particular purpose.
- *
- */
- .text
- .p2align 1,,4
-
-.globl __get_output_format
- .def __get_output_format; .scl 2; .type 32; .endef
-
-__get_output_format:
-/*
- * int _get_output_format( void );
- *
- * Implementation is trivial: we immediately return zero, thus matching the
- * default behaviour of Microsoft's own implementation, in the absence of any
- * preceding call to _set_output_format(); (if we are using this stub, then
- * that entire API is unsupported, so no such prior call is possible).
- */
- xorl %eax, %eax
- ret
-
-/* $RCSfile$Revision$: end of file */
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
deleted file mode 100644
index abab8df7cb9..00000000000
--- a/winsup/utils/ChangeLog
+++ /dev/null
@@ -1,2452 +0,0 @@
-2008-08-04 Christopher Faylor <me+cygwin@cgf.cx>
-
- * cygcheck.cc (load_cygwin): Duplicate argv list since it disappears
- when cygwin1.dll is unloaded.
-
-2008-07-30 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
-
- * Makefile.in: Link cygcheck with -lntdll even without mingw-zlib.
-
-2008-07-27 Christopher Faylor <me+cygwin@cgf.cx>
-
- * cygcheck.cc (load_cygwin): Free the cygwin dll after we're done with
- it.
-
-2008-07-25 Christopher Faylor <me+cygwin@cgf.cx>
-
- * mount.cc: Remove non-unix-like options (-x,-t,b) throughout.
- (oopts): Use boolean constants for slightly increased clarity.
-
- * configure.in: Remove apparently unneeded program_transfer_name code.
- * configure: Regenerate.
-
-2008-07-24 Corinna Vinschen <corinna@vinschen.de>
-
- * utils.sgml: Remove useless text.
-
-2008-07-23 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c (main): Fix test for duplicate domain/machine request.
- * mkpasswd.c (main): Ditto.
-
-2008-07-23 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c: Rework to allow per-domain/per-machine id_offset.
- Add -b option to skip builtin groups.
- (main): Simplify code.
- * mkpasswd.c: Rework to allow per-domain/per-machine id_offset.
- (main): Simplify code.
- * utils.sgml: Explain changed mkgroup/mkpasswd -d/-D/-l/-L options.
- Add mkgroup -b option.
-
-2008-07-23 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c: Consolidate variable names.
- (enum_unix_groups): New function.
- (print_special): Use LookupAccountSidW instead of LookupAccountSidA.
- (current_group): Ditto.
- (usage): Add -U option.
- (longopts): Add --unix option.
- (opts): Add -U option.
- (main): Handle -U option. Call enum_unix_groups if set.
- * mkpasswd.c: Consolidate variable names.
- (current_user): Use LookupAccountSidW instead of LookupAccountSidA.
- (enum_unix_users): New function.
- (usage): Add -U option.
- (longopts): Add --unix option.
- (opts): Add -U option.
- (main): Handle -U option. Call enum_unix_groups if set.
- * utils.sgml: Add -U option text to mkgroup and mkpasswd description.
-
-2008-07-22 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c (enum_groups): Create full qualified groupname using
- domain or servername, depending on printing domain or machine accounts.
- * mkpasswd.c (enum_users): Ditto for users.
-
-2008-07-22 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c (main): Remove special root group code. Only print
- SYSTEM group in case of printing local machine or local domain groups.
-
-2008-07-22 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (cygcheck.exe): Link against ntdll.
- * bloda.cc: Use statically linked functions throughout.
- * cygpath.cc: Drop 9x considerations.
- * mkgroup.c: Revamp. Redefine -l and -d options to take optional
- machine and domain parameters. Redefine -c to work always, using
- token information. Add -L, -D, -C to create unique groupnames in
- domain\group syntax. Add -S option to define domain\group separator
- char. Ignore -u and -s options.
- * mkpasswd.c: Revamp. Redefine -l and -d options to take optional
- machine and domain parameters. Redefine -c to work always, using
- token information. Add -L, -D, -C to create unique usernames in
- domain\user syntax. Add -S option to define domain\user separator
- char. Ignore -g and -s options. Prefer to take homedir from $HOME
- over $HOMEDRIVE/$HOMEPATH.
- * path.cc (oopts): Add "acl", "noacl", "posix=0" and "posix=1" options.
- (getmntent): Accomodate throughout.
- * ps.cc: Fix copyright dates.
- * utils.sgml: Fix text for mkgroup and mkpasswd.
-
-2008-07-17 Corinna Vinschen <corinna@vinschen.de>
-
- * mount.cc (do_mount): Remove MOUNT_ENC code.
- (oopts): Remove "managed" option.
- (mount_commands): Drop "managed" handling.
- * path.cc (oopts): Remove "managed" option.
- (getmntent): Remove MOUNT_ENC code.
-
-2008-07-17 Corinna Vinschen <corinna@vinschen.de>
-
- * utils.sgml: Add id's to all examples.
-
-2008-07-09 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c: Use statically linked functions throughout, except for
- DsGetDcNameW. Reformat. Convert to use WCHAR for names throughout.
- Use defines instead of constants throughout.
- (MAX_SID_LEN): Define.
- (load_netapi): Just load DsGetDcNameW pointer.
- (psx_dir): Remove.
- (uni2ansi): Remove.
- (enum_local_users): Take server name and use in Net... call.
- (DBGSID): Define datastructure.
- (MAX_BUILTIN_SIDS): Define.
- (builtin_sid_list): Define global sid list.
- (builtin_sid_cnt): Define counter for global sid list.
- (enum_local_groups): Take server name and use in Net... and Lookup...
- calls. Take offset argument. Use MAX_PREFERRED_LENGTH in call to
- NetLocalGroupEnum. Check for duplicate builtin groups.
- (enum_users): Take server name and use in Net... call.
- (usage): Change text slightly.
- (print_version): Fix copyright.
- (main): Call enum_local_groups for domains as well.
- * mkpasswd.c: Use statically linked functions throughout, except for
- DsGetDcNameW. Reformat. Convert to use WCHAR for names throughout.
- Use defines instead of constants throughout.
- (MAX_SID_LEN): Define.
- (load_netapi): Just load DsGetDcNameW pointer.
- (uni2ansi): Use wcstombs.
- (current_user): Replace "unused_by_nt/2000/xp" by
- just "unused".
- (enum_users): Ditto.
- (print_version): Fix copyright.
-
-2008-05-22 Corinna Vinschen <corinna@vinschen.de>
-
- * setfacl.c (setfacl): Change from void to int. Return 2 in case of
- error.
- (main): Return with error code from setfacl.
-
-2008-05-15 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (CYGWIN_BINS): Remove ipcrm and ipcs.
- * ipcrm.c: Remove.
- * ipcs.c: Remove.
-
-2008-03-23 Corinna Vinschen <corinna@vinschen.de>
-
- * mount.cc (usage): Mark -s and -u as ignored.
- (print_version): Simplify printing copyright dates.
- (main): Remove default_flag. Dont set flags on -s and -u options.
- (mount_commands): Drop handling -s and -u options.
-
-2008-03-22 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (dump_sysinfo): Fix multiple Cygwin DLL test.
- * path.cc: Fetch mount points from fstab files instead of from
- registry. Use adapted functions copied from Cygwin DLL.
- (mnt_t): Drop issys member. Define as "mnt_t" instead of "struct mnt_t"
- subsequently.
- (max_mount_entry): New variable.
- (unconvert_slashes): Move to earlier location in file. Make inline.
- (find2): Remove.
- (get_cygdrive0): Remove.
- (get_cygdrive): Remove.
- (skip_ws): New function.
- (find_ws): Ditto.
- (conv_fstab_spaces): Ditto.
- (read_flags): Ditto.
- (from_fstab_line): Ditto.
- (get_user): Ditto.
- (from_fstab): Ditto.
- (mnt_sort): Ditto.
- (read_mounts): Drop old registry code. Fetch
- "Software\Cygwin\Setup\rootdir" value from HKCU or HKLM key. Use
- rootdir extracted from module path as fallback. Call from_fstab for
- nouser and user mount points.
- (setmntent): Check max_mount_entry to test if read_mounts must be
- called.
- (getmntent): Use MOUNT_SYSTEM flag instead of mnt_t's issys member.
-
-2008-03-16 Brian Dessent <brian@dessent.net>
-
- * path.cc: Include malloc.h for alloca.
- (is_symlink): Rewrite. Just read the whole file in memory rather
- than by parts. Account for an ITEMIDLIST if present, as well as
- the new style of Cygwin shortcut supporting targets > MAX_PATH.
-
-2008-03-12 Corinna Vinschen <corinna@vinschen.de>
-
- * cygpath.cc (do_sysfolders): Use cygwin_conv_path.
- (do_pathconv): Use cygwin_conv_path and cygwin_conv_path_list.
- * dumper.cc (main): Use cygwin_conv_path. Allocate target path
- dynamically.
- * mkpasswd.c (current_user): Use cygwin_conv_path.
- (enum_users): Ditto.
- * ps.cc (NT_MAX_PATH): Define.
- (main): Use cygwin_conv_path.
- * regtool.cc (find_key): Ditto. Allocate target path dynamically.
- (cmd_save): Ditto.
-
-2008-03-11 Brian Dessent <brian@dessent.net>
-
- * cygcheck.cc (find_app_on_path): Make buffer SYMLINK_MAX + 1
- chars.
-
-2008-03-11 Brian Dessent <brian@dessent.net>
-
- * cygcheck.cc (dirname): New static function.
- (find_app_on_path): Use SYMLINK_MAX. Resolve symlink relative
- to link's location. Adjust to the fact that cygpath already
- normalizes its return value.
- * path.cc (rel_vconcat): Add cwd parameter, and use it instead
- of calling GetCurrentDirectory() if possible. Rename throughout.
- (vcygpath): Rename from cygpath and accept cwd and va_list. Pass
- cwd on to rel_vconcat().
- (cygpath_rel): New front end for vcygpath.
- (cygpath): Ditto.
- * path.h (cygpath_rel): Declare.
- (SYMLINK_MAX): Define to 4095.
-
-2008-03-09 Brian Dessent <brian@dessent.net>
-
- * Makefile.in (install): Don't install the testsuite.
-
-2008-03-08 Brian Dessent <brian@dessent.net>
-
- * Makefile.in: Add a 'check' target that builds and runs
- testsuite.exe from path-testsuite.o and testsuite.o.
- * path.cc: Include testsuite.h.
- (struct mnt): Change to a mnt_t typedef and don't define
- mount_table when TESTSUITE is defined.
- (find2): Don't include when TESTSUITE is defined to avoid warning.
- (get_cygdrive0): Ditto.
- (get_cygdrive): Ditto.
- (read_mounts): Provide empty implementation when TESTSUITE is
- defined.
- (vconcat): Use the isslash macro.
- (unconvert_slashes): New helper to convert to backslashses.
- (rel_vconcat): Handle relative paths more gracefully.
- (cygpath): Skip a leading "./" sequence. Avoid double-slashes.
- Normalize final output to backslashes and remove redundant path
- sequences.
- * testsuite.cc: New file implementing testsuite driver.
- * testsuite.h: New header implementing harness mount table and
- series of tests.
-
-2008-03-08 Brian Dessent <brian@dessent.net>
-
- * Makefile.in: Reorganize considerably, using GNU make's
- static pattern rules and target-specific variables.
-
-2008-02-28 Corinna Vinschen <corinna@vinschen.de>
-
- * mkpasswd.c (main): Simplify generating SYSTEM entry. Add entries
- for LocalService and NetworkService accounts. Change comments.
-
-2008-01-13 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (dump_sysinfo): Always try to get a OSVERSIONINFOEX
- first. Load kernel32.dll earlier. Make osname a buffer. Simplify
- Non-NT code. Use GetProductInfo in Vista/2008 case. Clean up
- non-Vista version info. Exit early if not on NT.
-
-2007-12-29 Dave Korn <dave.korn@artimi.com>
-
- * bloda.cc (enum bad_app): Add BYTEMOBILE.
- (dodgy_app_detects[]): Add FILENAME entry to detect bmnet.dll.
- (big_list_of_dodgy_apps[]): Add description for BYTEMOBILE.
-
-2007-12-20 Brian Dessent <brian@dessent.net>
-
- * Makefile.in (cygcheck.exe): Don't link to ntdll.
- * bloda.cc (pNtQuerySystemInformation): Add.
- (pRtlAnsiStringToUnicodeString): Add.
- (get_process_list): Use function pointers for NT functions.
- (dump_dodgy_apps): Skip dodgy app check on non-NT platforms.
- Use GetProcAddress for NT-specific functions.
-
-2007-12-07 Corinna Vinschen <corinna@vinschen.de>
-
- * regtool.cc (opts): Add missing 'W'.
-
-2007-12-06 Corinna Vinschen <corinna@vinschen.de>
-
- * ps.cc: Include limits.h.
- (main): Set file name buffer size to PATH_MAX. Use progname or
- progname_long member of struct external_pinfo dependent of the value of
- the struct's version member.
-
-2007-08-31 Dave Korn <dave.korn@artimi.com>
-
- * mkgroup.c (enum_groups): Use MAX_PREFERRED_LENGTH in netgroupenum
- call so that it will automatically size returned buffer sufficiently.
-
-2007-08-03 Dave Korn <dave.korn@artimi.com>
-
- * Makefile.in (cygcheck.exe): Add bloda.o as prerequisite, adjusting
- dependency-filtering $(wordlist ...) call appropriately. Link ntdll.
- (bloda.o): New rule to build bloda.o
- * cygcheck.cc (dump_sysinfo): Call bloda function dump_dodgy_apps().
- * bloda.cc: New file implements detection of applications from the
- Big List Of Dodgy Apps.
-
-2007-07-24 Corinna Vinschen <corinna@vinschen.de>
-
- * COPYING.dumper: New file.
- * dumper.cc: Change license to plain GPLv2 + later.
- * dumper.h: Ditto.
- * parse_pe.cc: Ditto.
-
-2007-07-23 Christopher Faylor <me+cygwin@cgf.cx>
-
- * strace.cc (create_child): Don't convert a path from cygwin format
- unless it has a slash.
-
-2007-07-09 Christopher Faylor <me+cygwin@cgf.cx>
-
- * strace.cc (usage): Add missing description for -q.
-
-2007-07-09 Christopher Faylor <me+cygwin@cgf.cx>
-
- * Makefile.in (kill.exe): Remove reliance on libiberty.
- * kill.cc (strsigno): New function patterned after libiberty but using
- newly exported cygwin array.
-
-2007-06-03 Christopher Faylor <me+cygwin@cgf.cx>
-
- * cygcheck.cc (pathlike): New class.
- (paths): Redefine as type pathlike.
- (display_error): Declare a few different ways to allow more flexible
- usage throughout.
- (display_error_fmt): New function for those cases where C++ just isn't
- enough.
- (add_path): Rewrite to allocate pathlike paths. Always tack on a
- trailing slash since that's what everyone who uses it wants. NULL
- terminate the path list. Register "it's a system path" field.
- (init_path): Call add_path with info regarding whether path is a system
- path or not.
- (pathlike::check_existence): Move into pathlike class. Accept file and
- extension arguments to build up path on the fly. Modify other
- arguments.
- (find_on_path): Constify return value and appropriate arguments.
- Eliminate short-circuit for fully-qualified paths. Simplify loop which
- iterates over path.
- (already_did): Constify argument.
- (track_down): Ditto. Regularize some error messages.
- (find_app_on_path): Ditto.
- (cygcheck): Constify argument. Use 20th century string handling
- functions.
- (dump_sysinfo): Remove odd inclusion of '\\bin' "Just in case".
- Accommodate change of paths to pathlike.
- * path.cc (isslash): Rename from SLASH_P and use throughout.
- (rel_vconcat): Front-end to vconcat which prepends cwd to path before
- passing along for conversion to native windows.
- (cygpath): Remove "./" test. Call rel_vconcat if filename appears to
- be relative.
-
-2007-05-29 Pedro Alves <pedro_alves@portugalmail.pt>
-
- * dumper.cc (dumper::prepare_core_dump): Record a phdr for each section.
-
-2007-05-29 Corinna Vinschen <corinna@vinschen.de>
-
- * cygpath.cc (do_options): Allow outputflag combined with other
- basic flags. Only check options_from_file_flag if reading options
- from command line.
- (main): Check for NULL argz vector. Don't free argz vector prematurely.
- Don't force flag combination in !options_from_file_flag case.
-
-2007-05-23 Corinna Vinschen <corinna@vinschen.de>
-
- * cygpath.cc: Include argz.h.
- (options_from_file_flag): Move from main to global static variable.
- (mode_flag): Ditto.
- (do_sysfolders): Rename from dowin and accommodate throughout.
- Don't exit from here.
- (do_pathconv): Rename from doit and accommodate throughout.
- (print_version): Change copyright.
- (do_options): New function, centralizing option processing.
- Rework checking options for correctness.
- (action): New function, centralizing calling worker functions.
- (main): Simplify. Move option processing to do_options. Move calling
- worker functions to action. Rework getting arguments from files.
-
-2007-03-30 Mark Mitchell <mark@codesourcery.com>
-
- * utils/cygpath.cc (get_long_path_name_w32impl): Close handles returned
- by FindFirstFile.
-
-2007-03-30 Christopher Faylor <me@cgf.cx>
-
- * mount.cc (main): Turn dos file warnings off since we know what we're
- doing.
-
-2007-02-22 Corinna Vinschen <corinna@vinschen.de>
-
- * ipcs.c (_POSIX2_LINE_MAX): Drop definition.
-
-2007-02-20 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (dump_sysinfo): Add "not supported" to osname on 9x
- machines. Drop "not supported" for Vista. Drop "Longhorn" text
- for now.
-
-2007-01-09 Christian Franke <franke@computer.org>
-
- * cygpath.cc (usage): Add -O and -F, remove tabs.
- (get_special_folder): New function.
- (get_user_folder): New function.
- (dowin): Add -O and -F, better -D, -P error handling.
- (main): Add -O and -F.
- * utils.sgml (cygpath): Document -O and -F.
-
-2006-12-21 Corinna Vinschen <corinna@vinschen.de>
-
- * dumper.cc: Include ansidecl.h before including bfd.h to woraround
- a problem with the order in which system include files are included.
-
-2006-12-11 Christopher Faylor <me@cgf.cx>
-
- * dumper.cc: Add an include to accommodate new include/elf usage.
-
-2006-12-10 Christopher Faylor <me+cygwin@cgf.cx>
-
- * mount.cc (do_mount): Avoid unnecessary cygwin_conv_to_win32_path and
- pass POSIX path directly - this avoids a cygwin DLL warning.
-
-2006-10-21 Corinna Vinschen <corinna@vinschen.de>
-
- * regtool.cc (key_type): Drop.
- (REG_AUTO): Define.
- (value_type): Replace key_type. Use REG_xxx values directly.
- Accomodate change throughout.
- (longopts): Add --dword, --dword-le, --none, --qword and --hex options.
- (opts): Add -d, -D, -n, -Q and -x options.
- (types): Array to convert REG_xxx into strings.
- (hex): New variable to keep value of --hex option.
- (usage): Accomodate new options. Print only the necessary by default.
- Only be verbose in case of -h/--help option.
- (cmd_list): Use key separator from -K option when printing.
- Print value type when verbose option is given. Handle so far not
- handled REG_xxx types.
- (cmd_set): Avoid SEGV due to missing argument. Handle so far not
- handled REG_xxx types.
- (cmd_get): Handle --binary option type agnostic. Handle so far not
- handled REG_xxx types.
- (main): Handle new options.
-
-2006-10-19 Corinna Vinschen <corinna@vinschen.de>
-
- * regtool.cc (longopts): Add --wow32 option.
- (opts): Add -W option.
- (usage): Add text for --wow32/-W option.
- (main): Handle --wow32/-W option.
- * utils.sgml: Document the new -W option.
-
-2006-10-16 Corinna Vinschen <corinna@vinschen.de>
-
- * regtool.cc (KEY_WOW64_64KEY): Drop definition. Instead define
- WINVER to 0x0502 before including windows.h.
-
-2006-10-16 Corinna Vinschen <corinna@vinschen.de>
-
- * regtool.cc (KEY_WOW64_64KEY): Define.
- (longopts): Add --wow64 option.
- (opts): Add -w option.
- (wow64): New variable to control usage of KEY_WOW64_64KEY access flag.
- (usage): Add text for --wow64/-w option.
- (print_version): Fix copyright.
- (find_key): Use wow64 value in calls to RegOpenKeyEx and RegCreateKeyEx.
- (cmd_add): Use wow64 value in call to RegCreateKeyEx.
- (regDeleteKeyEx): New function pointer to load RegDeleteKeyEx function
- dynamically.
- (cmd_remove): Load and use regDeleteKeyEx when wow64 is set.
- (main): Handle --wow64/-w option.
- * utils.sgml: Document the new -w option.
-
-2006-10-05 Igor Peshansky <pechtcha@cs.nyu.edu>
-
- * cygcheck.cc (get_word, get_dword): Move to path.cc.
- (LINK_EXTENSION): New macro.
- (check_existence): New static function.
- (find_on_path): Check for symbolic links if asked.
- (dll_info): New error handling.
- (track_down): Only call dll_info() for executables, display
- an error for symlinks, and print magic number for others.
- (find_app_on_path): New static function.
- (cygcheck, dump_sysinfo): Call find_app_on_path() instead of
- find_on_path().
- * path.cc (cmp_shortcut_header): New static function.
- (get_word, get_dword): Moved from cygcheck.cc.
- (EXE_MAGIC, SHORTCUT_MAGIC, SYMLINK_COOKIE, SYMLINK_MAGIC): New
- macros.
- (is_exe, is_symlink, readlink): New functions.
- * path.h (is_exe, is_symlink, readlink): Declare.
- (get_word, get_dword): Ditto.
-
-2006-09-12 Christopher Faylor <cgf@timesys.com>
-
- * Makefile.in: Fix -ntdll typo.
-
-2006-09-11 Eric Blake <ebb9@byu.net>
-
- * cygcheck.cc (main): Restore POSIXLY_CORRECT before displaying user's
- environment.
-
-2006-08-03 Corinna Vinschen <corinna@vinschen.de>
-
- * path.cc (vconcat): Don't convert backslahes to slashes.
- (cygpath): Return native path with all backslashes.
-
-2006-08-02 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (cygpath.exe): Add rule to link cygpath against ntdll.dll.
- * cygpath.cc: Include DDK headers.
- (RtlAllocateUnicodeString): New static inline function.
- (get_device_name): New static function to evaluate DOS path from
- native NT path.
- (get_device_paths): New function to do the same for path lists.
- (doit): Call get_device_paths/get_device_name where appropriate.
-
-2006-07-30 Ilya Bobir <ilya@po4ta.com>
-
- * cygpath.cc (get_long_name): Fallback to get_long_path_name_w32impl.
-
-2006-07-27 Corinna Vinschen <corinna@vinschen.de>
-
- * cygpath.c (get_long_name): Cover the case that GetLongPathName
- doesn't return valid information for non-existant files. Just return
- incoming filename in that case.
-
-2006-07-03 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
-
- * Makefile.in: Build setmetamode.exe.
- * setmetamode.c: New file.
-
-2006-05-24 Christopher Faylor <cgf@timesys.com>
-
- * configure.in: Update to newer autoconf.
- (thanks to Steve Ellcey)
- * configure: Regenerate.
- * aclocal.m4: New file.
-
-2006-05-24 Christopher Faylor <cgf@timesys.com>
-
- * strace.cc (proc_child): Propagate return code from child process.
- (dostrace): Ditto.
- (main): Ditto.
-
-2006-03-03 Christian Franke <franke@computer.org>
-
- * regtool.cc (options): Add 'binary'.
- (usage): Document 'load|unload|save' and '-b'.
- (find_key): Add 'options' parameter, add load/unload.
- (cmd_set): Add KT_BINARY case.
- (cmd_get): Add hex output in KT_BINARY case.
- (cmd_load): New function.
- (cmd_unload): New function.
- (set_privilege): New function.
- (cmd_save): New function.
- (commands): Add load, unload and save.
- (main): Add '-b'
- * utils.sgml (regtool): Document it.
-
-2006-02-17 Corinna Vinschen <corinna@vinschen.de>
-
- * cygpath.cc (get_long_name): Load GetLongPathNameA instead of incorrect
- GetLongPathName.
- (doit): Create mixed filename after converting to short or long pathname
- respectively.
-
-2006-02-17 Jerry D. Hedden <jerry@hedden.us>
-
- * ps.cc (main): Set aflag if -p option is given.
-
-2006-02-16 Jerry D. Hedden <jerry@hedden.us>
-
- * ps.cc (longopts): Add --process option.
- (opts): Add -p option.
- (usage): Mention -p/--process option.
- (main): Handle -p option.
- * utils.sgml: Describe -p/--process option.
-
-2006-02-15 Igor Peshansky <pechtcha@cs.nyu.edu>
-
- * regtool.cc (usage): Clarify help for "-K".
-
-2006-02-08 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (find_on_path): Update copyright text.
-
-2006-02-08 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (find_on_path): Create copy of rv on successful access
- check, since rv can be reused in subsequent calls.
-
-2006-01-19 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (common_paths): Add "patch".
-
-2006-01-19 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (init_paths): Record first_nonsys_path.
- (find_on_path): Start on first nonsys path when !search_sysdirs.
-
-2006-01-18 Christopher Faylor <cgf@timesys.com>
-
- * Makefile.in (sysconfdir): Remove unneeded variable.
-
- * mkgroup.c: Replace ` with ' throughout.
- * mkpasswd.c: Ditto.
- * setfacl.c: Ditto.
- * ssp.c: Ditto.
-
-2006-01-18 Dave Korn <dave.korn@artimi.com>
-
- * cygpath.cc (dowin): Remove stray debugging printf statement.
-
-2006-01-17 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in: Replace etcdir with sysconfdir.
-
-2006-01-13 Brian Dessent <brian@dessent.net>
-
- * Makefile.in (cygcheck.exe): Do not link against libwininet.a.
- * cygcheck.cc (pInternetCloseHandle): Define global function pointer.
- (display_internet_error): Use it.
- (package_grep): Attempt to load wininet.dll at runtime. Call WinInet
- API through function pointers throughout.
-
-2006-01-13 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (dump_sysinfo): Convert k32 to HMODULE.
-
-2006-01-13 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (dump_sysinfo): Convert osname to const and remove casts
- in subsequent assignments. Recognize Longhorn/Vista and report as not
- yet supported. Recognize when running under WOW64 and report native
- CPU type. Slightly rearrange \n printing.
-
-2006-01-12 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc: Replace ` with ' throughout.
-
-2006-01-05 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (dump_sysinfo): Report the failing drive to prevent
- having to guess.
-
-2005-12-29 Christopher Faylor <cgf@timesys.com>
-
- * strace.cc (nprocesses): Make static global.
- (quiet): New variable.
- (strace_active): Ditto.
- (add_child): Increment nprocesses here. Don't add a child if it is
- already added (windows bug?). Report on child if not quiet.
- (get_child): Just return NULL if child not found.
- (remove_child): Report on child if not quiet.
- (attach_process): Don't complain if given a windows process. Use
- windows pid in error.
- (handle_output_debug_string): Issue error if trying to manipulate a process that we don't know about.
- Handle _STRACE_CHILD_PID - attach to reported child when we get this.
- (proc_child): Move nprocesses to file scope.
- Report on exceptions.
- (longopts): Implement "--quiet".
- (opts): Implement "-q".
- (main): Manipulate quiet flag.
- * utils.sgml (strace): Add words describing '-q'.
-
-2005-12-29 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (common_apps): Add crontab, vi, vim.
-
-2005-12-19 Igor Pechtchanski <pechtcha@cs.nyu.edu>
-
- * dump_setup.cc (package_find): Fix is_alias computation for "/usr/lib".
-
-2005-12-14 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (common_apps): Add a few more binaries to look for.
-
-2005-12-05 Christopher Faylor <cgf@timesys.com>
-
- * strace.cc (show_usecs): Renamed from 'usecs'.
- (main): Use show_usecs rather than usecs. Toggle delta if '-u' is
- specified.
- (handle_output_debug_string): Avoid printing microsecond timestamp if
- show_usecs == 0.
- * utils.sgml (strace): Add words to describe '-u'.
-
-2005-11-22 Brian Dessent <brian@dessent.net>
-
- * Makefile.in: Link cygcheck with libwininet.a.
- * cygcheck.cc: Add includes.
- (grep_packages): New global variable.
- (display_internet_error): New function.
- (safe_chars): New global variable.
- (base_url): Ditto.
- (package_grep): New function.
- (usage): Reword --help output for clarity. Document new argument.
- (longopts): Add 'package-query' option.
- (opts): Add 'p' option, reorder to be consistent with 'longopts'.
- (main): Accommodate new option.
- * utils.sgml (cygcheck): Update --help output. Document new -p option.
-
-2005-09-22 Corinna Vinschen <corinna@vinschen.de>
-
- Align error message handling to mkpasswd's error messages throughout.
- * mkgroup.c (print_win_error): Create macro calling ...
- (_print_win_error): ... this function created from former
- print_win_error. Move up in source.
- (PDOMAIN_CONTROLLER_INFOW): Define return type of DsGetDcNameW.
- (dsgetdcname): New function pointer for DsGetDcNameW.
- (load_netapi): Get DsGetDcNameW address.
- (main): If DsGetDcNameW is available, use it.
- * mkpasswd.c (PDOMAIN_CONTROLLER_INFOW): Define return type of
- DsGetDcNameW.
- (dsgetdcname): New function pointer for DsGetDcNameW.
- (load_netapi): Get DsGetDcNameW address.
- (main): If DsGetDcNameW is available, use it. Rename local variable
- domain_name_specified to domain_specified as in mkgroup.c.
-
-2005-09-08 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * regtool.cc: Extend copyright-years.
- (print_version): Ditto.
- (cmd_list): Don't depend on terminating '\0' being present on
- string-values.
- (cmd_get): Don't attempt to read more than present, but keep
- extra space for terminating '\0'. Really output REG_BINARY.
- Don't leak memory.
- (cmd_set): Include trailing '\0' in string's length.
-
-2005-08-18 Corinna Vinschen <corinna@vinschen.de>
-
- * passwd.c (longopts): Add --logonserver option.
- (opts): Add -d option.
- (GetPW): Add server parameter which is given to Net functions.
- (ChangePW): Ditto.
- (PrintPW): Ditto.
- (SetModals): Ditto.
- (usage): Add description for -d/--logonserver option.
- (main): Add option handling for -d/--logonserver. Use LOGONSERVER
- environment variable content for server to contact, unless
- -d/--logonserver option is given. If both is missing, use NULL.
-
-2005-08-16 Brian Dessent <brian@dessent.net>
-
- * cygcheck.cc (dump_sysinfo_services): Properly null-terminate 'buf'.
- Avoid extraneous cygrunsrv invocation if 'verbose' is true.
-
-2005-08-03 Corinna Vinschen <corinna@vinschen.de>
-
- * mount.cc (longopts): Fix typo which disallows --options option.
-
-2005-07-19 Christopher Faylor <cgf@timesys.com>
- Eric Blake <ebb9@byu.net>
-
- * cygcheck.cc (find_on_path): Perform .exe magic on non-PATH search.
-
-2005-07-05 Eric Blake <ebb9@byu.net>
-
- * cygcheck.cc (track_down, cygcheck): Return true on success.
- (main): Reflect cygcheck failures in exit status.
-
-2005-06-14 Corinna Vinschen <corinna@vinschen.de>
-
- * parse_pe.c (exclusion::sort_and_check): Remove crude cast.
-
-2005-05-30 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (dump_sysinfo): Recognize XP Media Center and Tablet PC
- Editions. Change .NET to 2003 throughout. Recognize 2003 Web Server
- and Datacenter Server. Report when running in terminal server session.
-
-2005-05-27 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (load_cygwin): Make half-hearted attempt to work with
- older DLLs.
- * strace.cc (load_cygwin): Ditto.
-
-2005-05-22 Brian Dessent <brian@dessent.net>
-
- * cygcheck.cc (dump_sysinfo_services): Add new function that uses
- new cygrunsrv options to dump service info.
- (dump_sysinfo): Call dump_sysinfo_services if running under NT.
- Change 'Cygnus' to 'Cygwin' in output.
-
-2005-05-20 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (load_cygwin): Remove debugging statement.
-
-2005-05-20 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (dump_sysinfo): Don't attempt to use path if it is not
- set.
- (nuke): Fix off by one error in allocation of environment variable.
- (load_cygwin): Always set PATH even if cygwin environment is empty.
-
-2005-05-16 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (cygwin_internal): Define as a "C" function.
- * strace.cc (cygwin_internal): Ditto.
-
- * cygpath.cc (print_version): Update copyright.
-
-2005-05-15 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (load_cygwin): Avoid calling putenv with a NULL path.
-
-2005-05-15 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (load_cygwin): Don't touch $PATH for now.
- (print_version): Fix copyright.
- * strace.cc (print_version): Ditto.
-
-2005-05-13 Christopher Faylor <cgf@timesys.com>
-
- * mount.cc (mount_commands): Display "-X" option when appropriate.
-
-2005-05-08 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (nuke): New function.
- (load_cygwin): New function.
- (main): Use load_cygwin to load argv/envp from cygwin environment, if
- appropriate.
-
-2005-05-08 Christopher Faylor <cgf@timesys.com>
-
- * strace.cc (attach_process): Don't call load_cygwin(). Assume that
- it's already happened.
- (dotoggle): Ditto.
- (main): Set argv from cygwin environment, if it exists.
-
-2005-05-01 Christopher Faylor <cgf@timesys.com>
-
- * mount.cc (usage): Clarify action of -m option.
-
-2005-04-29 Dave Korn <dave.korn@artimi.com>
-
- * path.cc (getmntent): Add previously-omitted 'noexec' and 'managed'
- flags to mnt_opts string if present in mount flags.
-
-2005-04-20 Brian Dessent <brian@dessent.net>
-
- * utils.sgml (mount): Clarify setting cygdrive prefix for user
- and system-wide.
-
-2005-03-24 Brian Dessent <brian@dessent.net>
-
- * cygcheck.cc (init_paths): Use full path instead of "." for the
- current directory. Do not add "." if present in $PATH.
- (dump_sysinfo): Skip placeholder first value of paths[].
-
-2005-03-07 Christopher Faylor <cgf@timesys.com>
-
- * kill.cc (getsig): Rectify bug introduced by 2005-02-26 change. Don't
- pad signal name with spaces.
-
-2005-03-07 Corinna Vinschen <corinna@vinschen.de>
-
- * strace.cc (handle_output_debug_string): Fix compiler warning.
-
-2005-03-06 Christopher Faylor <cgf@timesys.com>
-
- * cygpath.cc (usage): Pass in one more copy of program_name to printf
- to avoid a SEGV.
-
-2005-02-27 Christopher Faylor <cgf@timesys.com>
-
- * regtool.cc (opts): The argument to 'K' is not optional.
- (main): Revert previous change. Just let getopt deal with missing
- argument.
-
-2005-02-27 Christopher Faylor <cgf@timesys.com>
-
- * regtool.cc (main): Avoid a SEGV when nothing follows -K.
-
-2005-02-26 Christopher Faylor <cgf@timesys.com>
-
- * kill.cc (getsig): Avoid buffer overflow when generating a signal name.
-
- * strace.cc (handle_output_debug_string): Make error a little more specific.
-
-2005-02-23 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * cygpath.cc (usage): Clarify help output to indicate acceptance
- of multiple file names as arguments.
-
-2005-01-16 Christopher Faylor <cgf@timesys.com>
-
- * ps.cc (main): Eliminate use of PID_ZOMBIE.
- * strace.cc (main): Recognize new option for displaying hex value of
- strace type.
- (handle_output_debug_string): Prepend output with hex value of strace
- message if -H is specified.
-
-2005-01-11 Pierre Humblet <pierre.humblet@ieee.org>
-
- * mkpasswd.c (print_win_error): Transform into macro.
- (_print_win_error): Upgrade former print_win_error by
- printing the line.
- (current_user): Call _print_win_error.
- (enum_users): Print name in case of lookup failure.
- (enum_local_groups): Ditto.
-
-2004-11-18 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (eprintf): New function.
-
-2004-11-16 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (find_on_path): Clear show_error and/or print_failed
- parameters to display_error.
- (rva_to_offset): Ditto.
- (dll_info): Ditto.
- (track_down): Ditto.
-
-2004-11-13 Pierre Humblet <pierre.humblet@ieee.org>
-
- * kill.cc (forcekill): Do not pass negative pids to
- cygwin_internal. Check if sig == 0. Improve error messages.
- (main): Make pid a long long and distinguish between pids, gpids
- (i.e. negative pids) and Win9x pids.
-
-2004-11-11 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc: Change "keyeprint" to "display_error" throughout.
-
-2004-11-11 Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (main): Allow a '-l' without an additional argument.
-
-2004-11-11 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (keyeprint): New optional parameters: show_error and
- print_failed.
-
-2004-10-31 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (get_dword): Fix errormessage.
- (cygwin_info): Ditto.
- (track_down): Ditto.
- (check_keys): Ditto.
-
-2004-10-27 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (dump_sysinfo): Warn about missing or multiple cygwin1
- dlls.
-
-2004-10-25 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (dump_sysinfo): Add leading newline before legend for
- drive-list.
-
-2004-10-22 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (dump_sysinfo): In legend for drive-list: Add ``ram'' and
- ``unk''. Use single puts. Add leading newline. Line up equal-signs.
-
-2004-10-20 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (dump_sysinfo): Allow for larger drives in drive-list.
- Change ``Used'' to ``Free'' in helptext-title for drive-list.
-
-2004-10-18 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (pretty_id): Don't let i become negative. Fix
- printf-format.
-
-2004-10-17 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (pretty_id): Allocate space for ')' in uid and guid.
-
-2004-10-17 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
- Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (pretty_id): Allocate space for trailing '\0' in uid and
- guid.
-
-2004-10-15 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
- Christopher Faylor <cgf@timesys.com>
-
- * cygcheck.cc (pretty_id): Don't exit on id error. Fix size
- calculations.
-
-2004-10-14 Christopher Faylor <cgf@timesys.com>
- Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (pretty_id): Correct column calculations. Abort if id is
- acting funny.
-
-2004-10-10 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (add_path): Don't leak memory when path is already in
- ``paths''.
-
-2004-10-10 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (dump_sysinfo): Warn about trailing (back)slash on mount
- entries.
-
-2004-10-10 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (dump_sysinfo): Don't warn about empty path components,
- just display ``.''.
-
-2004-10-06 Corinna Vinschen <corinna@vinschen.de>
-
- * strace.cc (_impure_ptr): Remove.
-
-2004-10-06 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (dump_sysinfo): Warn about empty path components.
-
-2004-10-04 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * cygcheck.cc (pretty_id): Close pipe.
-
-2004-09-23 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * dump_setup.cc (dump_setup): Remove unneeded strlen when check_files
- is not set.
-
-2004-09-22 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
- Corinna Vinschen <corinna@vinschen.de>
-
- * dump_setup.cc (dump_setup): Avoid trailing spaces on package-list.
-
-2004-09-15 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
-
- * getfacl.c (main): Correct layout when nopt is set.
-
-2004-07-12 Igor Pechtchanski <pechtcha@cs.nyu.edu>
-
- * mkgroup.cc (netapibufferallocate,netgroupgetinfo): New function
- pointers.
- (load_netapi): Load NetApiBufferAllocate and NetGroupGetInfo.
- (enum_local_groups,enum_groups): Add disp_groupname parameter.
- Load info for disp_groupname if specified.
- (usage): Add description of "-g/--group" option.
- (longopts,opts): Add "-g/--group" option.
- (main): Process "-g/--group" option.
- * utils.sgml (mkgroup): Add description of "-g/--group" option
-
-2004-06-15 Alan Modra <amodra@bigpond.net.au>
-
- * dumper.cc (dumper::prepare_core_dump): Use bfd_get_section_size
- instead of _raw_size.
- (dumper::write_core_dump): Likewise.
- * parse_pe.cc (select_data_section): Likewise.
-
-2004-05-29 John Paul Wallington <jpw@gnu.org>
-
- * ssp.c (usage): Add missing linefeed.
-
-2004-05-27 Christopher Faylor <cgf@alum.bu.edu>
-
- * kill.cc (listsig): Fix "kill -l" segv. NSIG includes Signal 0, so we
- need to avoid calling strtosigno with NSIG - 1.
-
-2004-03-21 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc (dump_sysinfo): Remove "Win95/NT" from output.
-
-2004-03-15 Christopher Faylor <cgf@redhat.com>
-
- * cygpath.cc (usage): Don't issue helpful message if -i is used.
- (from Igor Pechtchanski)
-
-2004-03-13 Rob Siklos <rob2@siklos.ca>
-
- * kill.cc (get_debug_priv): New function.
- (forcekill): Call get_debug_priv before trying to kill process.
-
-2004-02-24 Christopher Faylor <cgf@redhat.com>
-
- * cygpath.cc (long_options): Add "mode" option.
- (options): Ditto.
- (usage): Report on new option.
- (report_mode): New function.
- (main): Implement -M option.
-
-2004-02-20 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in (build_dumper): Detect missing iconv library.
-
- * cygpath.cc (dowin): Report on filename conversion errors.
- (doit): Ditto.
-
- * strace.cc (main): Use symbolic constant for _STRACE_ALL when setting
- mask.
-
-2004-02-14 Corinna Vinschen <corinna@vinschen.de>
-
- * ssp.c (opts): Add leading '+' to force posixly correct behaviour.
-
-2004-02-11 Corinna Vinschen <corinna@vinschen.de>
-
- * strace.cc (opts): Add leading '+' to force posixly correct
- behaviour.
- (main): Revert POSIXLY_CORRECT manipulations.
-
-2004-02-10 Christopher Faylor <cgf@redhat.com>
-
- * strace.cc (main): Guard against previous setting of POSIXLY_CORRECT.
-
-2004-02-10 Christopher Faylor <cgf@redhat.com>
-
- * strace.cc: Update copyrights.
- * cygcheck.cc: Update copyrights.
-
-2004-02-10 Christopher Faylor <cgf@redhat.com>
-
- * strace.cc (main): Ensure POSIXLY_CORRECT argument ordering.
- * cygcheck.cc (main): Ditto.
-
-2004-01-23 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc (pretty_id): Make more robust in absence of id.exe.
-
-2004-01-22 Corinna Vinschen <corinna@vinschen.de>
-
- * cygpath.cc (dowin): Revert accidental checkin from November.
-
-2003-11-26 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c (main): Print "root" group with local admins group sid
- and gid 0.
-
-2003-11-19 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in: Add rules to build ipcrm and ipcs.
- * ipcrm.c: New file.
- * ipcs.c: New file.
-
-2003-11-14 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c: Avoid compiler warnings throughout.
- * mkpasswd.c: Ditto.
- * passwd.c: Ditto.
-
-2003-11-07 Mark Blackburn <marklist@fangorn.ca>
-
- * cygpath.cc (main): Allow multiple pathnames on command line.
-
-2003-11-04 Corinna Vinschen <corinna@vinschen.de>
-
- * passwd.c (PrintPW): Turn around meaning printed for "Password not
- required" option to be in line with Windows meaning.
- (main): Use more appropriate 1008 option when calling
- NetUserSetInfo to change flag values.
-
-2003-11-04 Corinna Vinschen <corinna@vinschen.de>
-
- * passwd.c (UF_LOCKOUT): Remove (defined in lmaccess.h).
- (version): Bump version number to 1.5.
- (longopts): Add -c, -C, -e, -E, -p, -P options.
- (opts): Ditto.
- (PrintPW): Print values of UF_PASSWD_CANT_CHANGE and
- UF_DONT_EXPIRE_PASSWD flags. Slightly reformat output. Don't suppress
- correct system password settings just because the account has admin
- privileges.
- (usage): Define as "noreturn" function. Restructure and rephrase
- output. Accommodate new options.
- (print_version): Fix copyright dates.
- (main): Accommodate new options for setting UF_PASSWD_CANT_CHANGE,
- UF_DONT_EXPIRE_PASSWD and UF_PASSWD_NOTREQD settings.
-
-2003-10-17 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc (pretty_id): Don't exec if `id' program is not found.
-
-2003-09-20 Christopher Faylor <cgf@redhat.com>
-
- * kill.cc (main): Allow negative pids (indicates process groups).
-
-2003-09-17 Christopher Faylor <cgf@redhat.com>
-
- * parse_pe.cc (exclusion::sort_and_check): Make error message a little
- more explicit and ignore (hopefully) harmless region overlap.
-
-2003-09-13 Christopher Faylor <cgf@redhat.com>
-
- * kill.c (forcekill): Wait for process to terminate even if
- TerminateProcess says it failed.
-
-2003-09-11 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in: Tweak mingw libz.a detection to make it more reliably
- detect when libz.a is not available.
-
-2003-09-11 Igor Pechtchanski <pechtcha@cs.nyu.edu>
-
- * cygcheck.cc (dump_only): New global variable.
- (usage): Add "--dump-only" option, fix "--verbose" line.
- (longopts, opts): Add "--dump-only" option.
- (main): Process the "--dump-only" flag. Add new semantic check.
- Pass dump_only information to dump_setup().
-
-2003-09-11 Corinna Vinschen <corinna@vinschen.de>
-
- * getfacl (main): Remove extern declaration of optind.
- * setfacl (main): Remove extern declaration of optarg and optind.
-
-2003-09-10 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in (cygcheck.o): Use MINGW_CXX for compilation.
- * cygcheck.cc: Just include <getopt.h> rather than cygwin version.
- (pretty_id): Avoid compiler warnings.
- * cygpath.cc (usage): Ditto.
-
-2003-09-10 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in (MINGW_CXX): Define and use for mingw-compiled files.
- * path.cc: Include more path info in cygwin-specific includes since the
- cygwin directory is no longer included by default.
-
-2003-09-10 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in: More fixups to adjust for the fact that mingw_getopt.o
- is no longer built.
-
-2003-09-10 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in: Remove references to getopt since it is now part of
- mingwex.
-
-2003-09-08 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in: Rename libz.h -> zlib.h.
-
-2003-09-07 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in: Detect existence of mingw zlib headers and libraries.
- Build cygcheck without package checking if they are unavailable.
- * dump_setup.cc: Generate dummy zlib macros when zlib is not available.
- (open_package_list): Use zlib functions to uncompress package lists.
- Return gzFile rather than FILE *.
- (check_package_files): Change fp to gzFile to accommodate zlib
- functions. Use gzgets to read from package file. Use gzclose to close
- the handle.
- (package_list): Ditto.
- (package_find): Ditto.
-
-2003-09-05 Igor Pechtchanski <pechtcha@cs.nyu.edu>
-
- * dump_setup.cc (check_package_files): Don't fail on empty package.
-
-2003-09-01 AJ Reins <reinsaj@yahoo.com>
-
- * mount.cc (mount_commands): Ensure user mode is actually user mode and
- not the default system mode.
-
-2003-08-31 Christopher Faylor <cgf@redhat.com>
-
- * kill.cc (forcekill): Silence some compiler warnings.
-
-2003-08-31 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in: Oops. Put the '...' in the right place.
-
-2003-08-31 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in: Display "..." when not-verbose.
-
- * kill.cc (forcekill): Default to entered pid when pinfo fails. Issue
- some warnings when things don't work.
-
-2003-08-17 David Rothenberger <daveroth@acm.org>
-
- * dump_setup.cc (check_package_files): Strip leading / and ./ from
- package file names.
-
-2003-08-16 David Rothenberger <daveroth@acm.org>
-
- * dump_setup.cc (package_find): Don't stop searching on missing
- file list.
- (package_list): Ditto.
-
-2003-08-16 Igor Pechtchanski <pechtcha@cs.nyu.edu>
-
- * dump_setup.cc: (package_list): Make output terse unless
- verbose requested. Fix formatting.
- (package_find): Ditto.
-
-2003-08-15 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (main): Fix some formatting and help text printing.
-
-2003-08-15 Igor Pechtchanski <pechtcha@cs.nyu.edu>
-
- * cygcheck.cc (find_package,list_package): New global
- variables.
- (usage): Add "--find-package" and "--list-package" options,
- reformat output.
- (longopts, opts): Add "--find-package" and "--list-package"
- options.
- (main): Process the "--find-package" and "--list-package"
- flags. Add new semantic checks. Add calls to find_package()
- and list_package().
- * dump_setup.cc: Fix header comment.
- (match_argv): Change return type to int to distinguish
- between real matches and default ones.
- (open_package_list): New static function.
- (check_package_files): Factor out opening the package list
- file into open_package_list().
- (get_packages): New static function.
- (dump_setup): Factor out getting a list of packages into
- get_packages().
- (package_list, package_find): New global functions.
-
-2003-08-15 Corinna Vinschen <corinna@vinschen.de>
-
- * regtool.cc (usage): Add missing linefeed. Move example to --help
- text. Fix forward slash description.
-
-2003-08-13 Igor Pechtchanski <pechtcha@cs.nyu.edu>
-
- * dump_setup.cc (check_package_files): Fix extra '/' in filename.
- Resize command buffer. Fix buffer overflow bug.
-
-2003-08-09 Igor Pechtchanski <pechtcha@cs.nyu.edu>
- Christopher Faylor <cgf@redhat.com>
-
- * dump_setup.cc (dump_setup): Check for the existence of the package
- list file. Rework slightly to use static buffer for popen commands.
-
-2003-08-07 Igor Pechtchanski <pechtcha@cs.nyu.edu>
- Christopher Faylor <cgf@redhat.com>
-
- * dump_setup.cc (version_len): New static variable.
- (could_not_access,directory_exists): New static function.
- (file_exists): Ditto.
- (check_package_files): Ditto.
- (dump_setup): Check the contents of each package if check_files is true
- and output the result in the "Status" column. Flush output after each
- package.
-
-2003-08-07 Igor Pechtchanski <pechtcha@cs.nyu.edu>
- Christopher Faylor <cgf@redhat.com>
-
- * dump_setup.cc (dump_setup): Remove redundant null check. Add
- informative message if package info not found.
-
-2003-07-26 Christopher Faylor <cgf@redhat.com>
-
- * mount.cc (do_mount): Issue warning when using managed mount option on
- non-empty directory.
-
-2003-07-25 Christopher Faylor <cgf@redhat.com>
-
- * configure.in: Use 'install-sh -c'.
- * configure: Regenerate.
-
-2003-07-25 Christopher Faylor <cgf@redhat.com>
-
- * configure.in: Always use install-sh.
- * configure: Regenerate.
-
-2003-07-03 Christopher Faylor <cgf@redhat.com>
-
- * mount.cc (struct opt): Remove posix option.
-
-2003-07-03 Christopher Faylor <cgf@redhat.com>
-
- * mount.cc (longopts): Add long "options" keyword.
- (opts): Add -o option.
- (usage): Display -o option.
- (struct opt): New.
- (concat3): New function.
- (main): Handle -o flag.
-
-2003-06-12 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc (pretty_id): Rework slightly to not rely on spaces.
-
-2003-06-12 Christopher Faylor <cgf@redhat.com>
-
- * cygpath.cc: Throughout, always return error when GetShortPathName
- returns 0.
-
-2003-04-26 Joshua Daniel Franklin <joshuadfranklin at yahoo dot com>
-
- * mkpasswd.c (usage) Remove extra newline from description output.
-
-2003-04-26 Joshua Daniel Franklin <joshuadfranklin at yahoo dot com>
-
- * cygcheck.cc (usage) Add description output.
- * cygpath.cc (usage) Add description output.
- * dumper.cc (usage) Add newline to description output.
- * kill.cc (usage) Add description output.
- * mkgroup.c (usage) Grammatical change to description output.
- * mkpasswd.c (usage) Grammatical change to description output.
- * mount.cc (usage) Add description output.
- * passwd.c (usage) Add description output.
- * ps.cc (usage) Add description output.
- * regtool.cc (usage) Add description output.
- * setfacl.c (usage) Remove extra newline from description output.
- * ssp.c (usage) Add description output.
- * strace.cc (usage) Add description output.
- * umount.cc (usage) Add description output.
-
-2003-04-10 Pierre Humblet <pierre.humblet@ieee.org>
-
- * mkpasswd.c (current_user): print uid and gid as unsigned.
- (enum_users): Ditto. Do not free servername.
- (usage): Update to allow several domains and improve -p.
- (main): On Win9x limit uids to 1000. Only print specials
- when -l is specified. Add a loop to allow several domains
- and free servername in the loop.
- * mkgroup.c (enum_groups): Do not free servername.
- (usage): Update to allow several domains. Change uid to gid.
- (main): Only print specials when -l is specified. Add a
- loop to allow several domains and free servername in the loop.
-
-2003-03-24 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc (dump_sysinfo): Ensure that CYGWIN environment variable
- is correctly set.
-
-2003-03-09 Corinna Vinschen <corinna@vinschen.de>
-
- * getfacl.c (username): Fix ambiguous printf calls.
- (groupname): Ditto.
- (main): Ditto.
-
-2003-03-04 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in (strace.exe): Include mingw_getopt.o in link line.
- * cygcheck.cc (print_version): Update copyright.
- * strace.cc (print_version): Ditto.
- (main): Allow cygwin paths for -o option.
- (create_child): Allow cygwin path as argv[0].
- * path.cc (path.cc): Allow UNC paths.
-
-2003-03-01 Pierre Humblet <pierre.humblet@ieee.org>
-
- * mkpasswd.cc (main): On Win95, output both a default line and a
- line for the current user (if known) with a pseudorandom uid. If
- the -u switch is given, produce a line for the specified user.
- * mkgroup.cc (main): On Win95 change the group name from "unknown" to
- "all".
-
-2003-02-28 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in (cygcheck.o): Fix so that actual mingw include files are
- used.
- * cygcheck.cc (find_on_path): Translate from cygwin path when qualified
- path name found.
- (pretty_id): New function. Dump output of id command.
- (dump_sysinfo): Call pretty_id for CYGWIN=ntsec and CYGWIN=nontsec cases.
-
-2003-02-12 Christopher Faylor <cgf@redhat.com>
-
- * cygpath.cc (doit): Allocate more space for non-path filename.
-
-2003-02-07 Christopher Faylor <cgf@redhat.com>
-
- * dump_setup.cc (compar): Use case insensitive comparisons.
- (dump_setup): Calculate package_len based on already used "len". Don't
- bother with version_len.
-
-2003-02-07 Igor Pechtchanski <pechtcha@cs.nyu.edu>
-
- * dump_setup.cc (dump_setup): Compute the longest package name
- and align columns properly.
-
-2003-02-06 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc (common_apps): Add some more apps.
- * path.cc (get_cygdrive): Correctly set system flag.
-
-2003-01-22 Corinna Vinschen <corinna@vinschen.de>
-
- * Makefile.in (ALL_LDFLAGS): Remove newlib/libm from tools paths.
- (MINGW_LDFLAGS): Remove in favor of definition from Makefile.common.
-
-2003-01-15 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c: Fix copyright date.
- * mkpasswd.c: Ditto.
- * setfacl.c: Ditto.
-
-2003-01-09 Pierre Humblet <pierre.humblet@ieee.org>
-
- * setfacl.c (usage): Remove double ":" for mask and other.
-
-2003-01-07 Pierre Humblet <pierre.humblet@ieee.org>
-
- * mkpasswd.c (current_user): Create.
- (usage): Reorganize to support Win95/98/ME.
- (main): Add option for -c. Reorganize to parse options for
- Win95/98/ME and to call current_user. Add username in gecos field
- on Win95/98/ME.
- * mkgroup.c (enum_groups): Print gid with %u.
- (print_win_error): Create from passwd.cc.
- (current_group): Create.
- (usage): Reorganize to support Win95/98/ME.
- (main): Add option for -c. Reorganize to parse options for
- Win95/98/ME and to call current_group.
-
-2002-12-14 Pierre Humblet <pierre.humblet@ieee.org>
-
- * setfacl.c (main): Place a single : after other and mask.
- * getfacl.c (getaclentry): Allow both : and :: for other and mask.
- (main): Remove extraneous break.
-
-2002-11-25 Corinna Vinschen <corinna@vinschen.de>
-
- * mkpasswd.c (main): Set pw_passwd field to '*' on 9x/Me.
-
-2002-11-24 Corinna Vinschen <corinna@vinschen.de>
-
- * setfacl.c (getperm): Set only `other' permission bits.
- (getaclentry): Set a_id to -1 by default.
-
-2002-11-24 Corinna Vinschen <corinna@vinschen.de>
-
- * getfacl.c (permstr): Use `other' permission bits for requesting
- ace permissions.
-
-2002-11-08 Corinna Vinschen <corinna@vinschen.de>
-
- * setfacl.c (usage): Add missing LF.
-
-2002-10-30 Christopher Faylor <cgf@redhat.com>
-
- * cygpath.cc (get_long_path_name_w32impl): Define similarly to
- GetLongPathName.
- (get_long_name): Correctly prototype GetLongPathName.
- (get_long_paths): Implement using get_long_name to cut down on code
- duplication.
- (doit): Do various things to make path output work predictably.
-
-2002-10-19 Christopher Faylor <cgf@redhat.com>
-
- * mount.cc (usage): Correctly report default mode.
- * strace.cc (main): Use strtoul as appropriate.
-
-2002-09-29 Christopher Faylor <cgf@redhat.com>
-
- * cygpath.cc (close_arg): Remove unused static.
- * mkgroup.c (enum_local_users): Avoid compiler warning.
- (enum_users): Ditto.
- * mkpasswd.c: Ditto throughout.
- * ssp.c: Ditto throughout.
-
-2002-09-18 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc: Include sys/time.h rather than time.h to avoid a
- compiler error.
-
-2002-09-17 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc: Reorder includes to avoid compiler error.
-
-2002-09-15 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * cygcheck.cc (print_version) Add final newline.
- * getfacl.c (print_version) Add final newline.
- * kill.cc (print_version) Add final newline.
- * mkgroup.c (print_version) Add final newline.
- * mkpasswd.c (print_version) Add final newline.
- * mount.cc (print_version) Add final newline.
- * passwd.c (print_version) Add final newline.
- * ps.cc (print_version) Add final newline.
- * regtool.cc (print_version) Add final newline.
- * setfacl.c (print_version) Add final newline.
- * ssp.c (print_version) Add final newline.
- * strace.cc (print_version) Add final newline.
- * umount.cc (print_version) Add final newline.
-
-2002-09-12 Igor Pechtchanski <pechtcha@cs.nyu.edu>
-
- * cygpath.cc (options) New global variable.
- (main) Make short options global for easier change.
- (print_version) Add a missing newline.
-
-2002-08-07 Igor Pechtchanski <pechtcha@cs.nyu.edu>
-
- * regtool.cc (find_key): Add support for custom key separator.
- (usage): Document it.
-
-2002-08-02 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c (main): Don't print an entry for "Everyone".
- * mkpasswd.c (print_special): Set pw_gid to 544 for SYSTEM user.
- (main): Don't print an entry for "Everyone".
-
-2002-07-06 Christopher Faylor <cgf@redhat.com>
-
- * configure.in: Check for libiconv.a.
- * configure: Regenerate.
- * Makefile.in: Add libiconv.a to libraries required for dumper.exe.
-
-2002-07-06 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in: Use MINGW stuff from Makefile.common.
-
-2002-07-01 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c: Add function pointers for functions from advapi32.dll.
- (load_netapi): Load used functions from advapi32.dll.
- (main): Use function pointers instead of statically linked functions
- from advapi32.dll.
-
-2002-07-01 Christopher Faylor <cgf@redhat.com>
-
- * mount.cc (main): Ensure that mount_already_exists() also gets default
- flag that is passed to do_mount.
-
-2002-06-22 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * cygpath.cc (long_options): Add "dos" and "mixed", correct "close",
- "file" and "type" to use NULL flag.
- (usage): Clean up usage output (more), accomodate new options.
- (main): Add --dos and --mixed options; accomodate all output forms in
- --type. Make UNIXy output default.
-
-2002-06-18 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * cygpath.cc (usage): Clean up usage output.
- (dowin): Correct output of -t mixed for -ADHPSW options.
-
-2002-06-14 Corinna Vinschen <corinna@vinschen.de>
-
- * passwd.c: Rearrange includes to avoid unnecessary warnings.
- (GetPW): Add parameter to (dis)allow printing of Windows username.
- Use defines instead of numerical constants where possible.
- Try avoiding impersonation problem. Rearrange to print Windows
- username only if it's different from Cygwin username.
- (ChangePW): Use defines instead of numerical constants where possible.
- (main): Call GetPW with additional parameter. Change error text.
-
-2002-06-14 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * passwd.c (GetPW): Handle case of user-edited /etc/passwd
- with cygwin_internal (CW_EXTRACT_DOMAIN_AND_USER, ...).
-
-2002-06-09 Christopher Faylor <cgf@redhat.com>
-
- * path.cc (cygpath): Change MOUNT_AUTO to MOUNT_CYGDRIVE.
- (getmntent): Ditto.
-
-2002-06-09 Christopher Faylor <cgf@redhat.com>
-
- * mount.cc (main): Use default system/user flag for cygdrive stuff,
- too.
- (change_cygdrive_prefix): Change MOUNT_AUTO to MOUNT_CYGDRIVE.
- * umount.cc (remove_cygdrive_prefix): Ditto.
- (main): Use default system/user flag for cygdrive stuff, too.
-
-2002-06-08 Christopher Faylor <cgf@redhat.com>
-
- * mount.cc (opts): Remove '-i' option.
- (usage): Ditto.
- (main): Ditto.
- (longopts): Remove --import-old-mounts option.
-
-2002-06-07 David Peterson <chief@mail.idrive.com>
- Christopher Faylor <cgf@redhat.com>
-
- * cygpath.cc: Add option to output windows paths in different formats:
- "dos" and "mixed".
- (main): Process options.
- (doit): Check new options flags.
-
-2002-06-06 Egor Duda <deo@logos-m.ru>
-
- * regtool.cc (Fail): Be more verbose.
- (find_key): Add support for remote registry access.
- (usage): Document it.
- * utils.sgml: Document it.
-
-2002-06-06 Christopher Faylor <cgf@redhat.com>
-
- * strace.cc (main): Make toggle a local variable.
-
-2002-06-07 Conrad Scott <conrad.scott@dsl.pipex.com>
-
- * strace.cc (toggle): New global variable.
- (error): Use exit instead of ExitProcess so that stdio buffers get
- flushed.
- (create_child): Remove command line error checking.
- (dostrace): Ditto.
- (dotoggle): New function.
- (usage): Add entry for new option -T|--toggle. Alphabetize.
- (longopts): Add new option -T|--toggle.
- (opts): Ditto.
- (main): Handle new -T|--toggle option. Move all command line checking
- here from other functions.
- * utils.sgml: Update section for strace.
-
-2002-06-05 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * strace.cc (version): New global variable.
- (usage): Accommodate stdout output.
- (print_version): New function.
-
-2002-06-03 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * ssp.c (version): New global variable.
- (longopts): Ditto.
- (opts): Ditto.
- (run_program): Correct cmd_line typos to cmdline.
- (usage): New function. Standardize usage output. Add ssp.txt to
- --help output.
- (print_version): New function.
- (main): Accommodate getopt.
-
-2002-06-03 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * umount.cc (version): New global variable.
- (longopts): Accommodate new --version option.
- (opts): Ditto.
- (usage): Standardize usage output.
- (print_version): New function.
- (main): Accommodate --help, --version options.
-
-2002-06-02 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * regtool.cc (prog_name): New global variable.
- (longopts): Ditto.
- (opts): Ditto.
- (usage): Standardize usage output. Rearrange/add descriptions.
- (print_version): New function.
- (main): Accommodate longopts and new --help, --version options. Add
- check for (_argv[optind+1] == NULL).
-
-2002-06-02 Christopher Faylor <cgf@redhat.com>
-
- * strace.cc (forkdebug): Make true by default.
- (attach_process): Use window pid if cygwin pid isn't available (yet).
- (create_child): Use either DEBUG_ONLY_THIS_PROCESS or DEBUG_PROCESS,
- exclusively. (Suggested by Conrad.Scott@dsl.pipex.com)
-
-2002-05-30 Christopher Faylor <cgf@redhat.com>
-
- * mkpasswd.cc (main): Don't reset to binmode if stdout is a terminal.
-
-2002-05-29 Christopher Faylor <cgf@redhat.com>
-
- * mount.cc (main): Make -b the default.
-
-2002-05-29 Corinna Vinschen <corinna@vinschen.de>
-
- * ps.cc (main): Use uid or uid32 member of struct external_pinfo
- dependent of the value of the struct's version member.
-
-2002-05-29 Corinna Vinschen <corinna@vinschen.de>
-
- * ps.cc (main): Change print format for uid to unsigned. Use uid32
- member of struct external_pinfo instead of uid.
-
-2002-05-28 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * passwd.c (prog_name): New global variable.
- (longopts): Ditto.
- (opts): Ditto.
- (usage): Standardize output. Accommodate new options.
- (print_version): New function.
- (main): Accommodate longopts and new --help, --version options.
-
-2002-05-28 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * ps.cc (usage): Fix typo.
-
-2002-05-27 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * ps.cc (prog_name): New global variable.
- (longopts): Ditto.
- (opts): Ditto.
- (usage): New function.
- (print_version): New function.
- (main): Accommodate longopts and new --help, --version options.
-
-2002-05-26 Christopher Faylor <cgf@redhat.com>
-
- * strace.cc (attach_process): Don't tell process to start stracing
- here.
- (proc_child): Do it here, instead, after first debug event. This
- should work around inexplicable races with DebugActiveProcess.
- (dostrace): Pass any pid argument to proc_child.
-
-2002-05-23 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * getfacl.c (usage): Standardize usage output. Change return type to
- static void.
- (print_version): New function.
- (longopts): Added longopts for all options.
- (main): Accommodate new help and version options.
-
-2002-05-22 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * mount.cc (version): New global variable.
- (usage): Standardize usage output. Accommodate new version option.
- (print_version): New function.
- (longopts): Accommodate new version option.
- (opts): Ditto.
- (main): Ditto.
-
-2002-05-22 Corinna Vinschen <corinna@vinschen.de>
-
- * cygpath.cc (usage): Change usage output slightly.
-
-2002-05-20 Joerg Schaible <joerg.schaible@gmx.de>
-
- * cygpath.cc (main): Add option l to support conversion to
- Windows long file names. Refactured code for capital options.
- Support of options from file for capital options.
- (dowin): New function. Refactured from main.
- (doit): Call long path conversion.
- (get_long_name): New function.
- (get_long_paths): New function.
- (get_long_path_name_w32impl): New function. Reimplementation
- of Windows API function GetLongPathName (only 98/Me/2000/XP or
- higher).
- (get_short_name): Call GetShortPathName only once.
- (get_short_paths): Fix calculating buffer size.
- * utils.sgml: Update cygpath section for l option.
-
-2002-05-18 Christopher Faylor <cgf@redhat.com>
-
- * strace.cc (add_child): Use calloc since new requires working
- libstdc++.a.
- (remove_child): Ditto for delete/free.
-
-2002-05-15 Mark Blackburn <marklist@fangorn.ca>
-
- * cygpath.cc (get_short_paths): Fix more error checking.
- (get_short_name): Ditto.
-
-2002-05-14 Joerg Schaible <joerg.schaible@gmx.de>
-
- * cygpath.cc (main): Add option H to show the Windows' profiles
- directory. Support short names for options DPSW. Clean up
- copied code lines.
- * utils.sgml: Update cygpath section for H option and s support.
-
-2002-05-14 Mark Blackburn <marklist@fangorn.ca>
-
- * cygpath.cc (get_short_paths): Fix error checking.
-
-2002-05-13 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * kill.cc (prog_name): New global variable.
- (usage): Standardize usage output. Add descriptions.
- (print_version): New function.
- (longopts): Accommodate new version option.
- (opts): Ditto.
- (main): Ditto.
-
-2002-05-13 Christopher Faylor <cgf@redhat.com>
-
- * kill.cc (listsig): Display numeric id when given symbolic input.
-
-2002-05-13 Christopher Faylor <cgf@redhat.com>
-
- * kill.cc (usage): Show new options. Allow specification of output
- stream.
- (main): Implement 'h' option.
-
-2002-05-13 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in (kill.exe): Add as a specific target.
- * kill.cc (longopts): New.
- (opts): Ditto.
- (get_sig): Accept const char * parameter. Return -1 on unknown signal.
- (test_for_unknown_sig): New function.
- (listsig): New function.
- (main): Use getopt_long for option parsing. Implement -l, and -s
- options. Use test_for_unknown_sig() to test for signal validity.
-
- * mount.cc (longopts): Make static.
- (opts): Ditto.
-
-2002-05-12 Christopher Faylor <cgf@redhat.com>
-
- * mount.cc (do_mount): Default to non-exec option for remote drives.
- Report warnings before attempting a mount.
- (longopts): Add no-executable option.
- (mount_commands): Ditto.
- (opts): Ditto.
- (usage): Ditto. Indicate that system mount is now the default.
- (main): Accommodate no-executable option. Make system mount the
- default.
- * umount.cc (usage): Indicate that system umount is now the default.
- (main): Make system umount the default.
-
-2002-05-07 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * dumper.cc (usage): Standardize usage output. Generalize to allow use
- for help.
- (longopts): New struct. Added longopts for all options.
- (print_version): New function.
- (main): Change getopt to getopt_long. Accommodate new help and version
- options.
-
-2002-03-29 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c (main): Change call to exit() to a return statement.
- * mkpasswd.c (main): Ditto.
-
-2002-03-27 Joshua Daniel Franklin joshuadfranklin@yahoo.com
-
- * mkpasswd.c (usage): Simplify usage output. Generalize to allow use
- for help. Correct '?' typo to 'h'.
- (longopts): Add version option.
- (opts): Add 'v' version option.
- (print_version): New function.
- (main): Accommodate new version option. Accommodate usage parameter
- changes.
-
-2002-03-19 Christopher Faylor <cgf@redhat.com>
-
- * mkgroup.c (usage): Use one just fprintf + string concatenation for
- output message.
- (print_version): Add void to function type and update copyright.
-
-2002-03-16 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * mkgroup.c (usage): Simplify usage output. Generalize to allow use
- for help. Correct '?' typo to 'h'.
- (longopts): Add version option.
- (opts): Add 'v' version option.
- (print_version): New function.
- (main): Accommodate new version option. Accommodate usage parameter
- changes. Use usage to output help message.
-
-2002-03-15 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c (main): When generating group 513, check for computer's
- primary domain instead of current user's domain.
-
-2002-03-14 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c (main): When generating group 513, check for domain SID
- if computer name isn't mapped to a SID.
-
-2001-03-11 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * kill.cc (usage): Move to top of file.
- (getsig): Ditto.
- (forcekill): Ditto.
-
-2002-03-06 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc: Reformat.
-
-2002-03-06 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc (longopts): Use correct short option for --version.
-
-2002-03-06 Christopher Faylor <cgf@redhat.com>
-
- * cygpath.cc: Reformat.
-
-2002-02-27 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * cygpath.cc (print_version): New function.
- (main): Accommodate new version function. Initialize 'o' to prevent
- warning.
-
-2002-02-27 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc (main): Eliminate non-GNU formatting glitch.
-
-2002-02-27 Christopher Faylor <cgf@redhat.com>
-
- * ssp.c (help_desk): Fix compiler warning.
-
-2002-02-27 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
- Christopher Faylor <cgf@redhat.com>
-
- Change appropriate globals to statics throughout.
- * cygcheck.cc (usage): Simplify usage output. Generalize to allow use
- for help.
- (longopts): Add version option.
- (opts): Add 'V" version option.
- (print_version): New function.
- (main): Accommodate new version option. Accommodate usage parameter
- changes. Use usage to output help message.
-
-002-02-19 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in (CXXFLAGS): Add override so that HAVE_DECL_GETOPT is
- defined.
- (libbfd): Use -B rather than -L so that bfd from build directory is
- correctly found.
- (libintl): Ditto.
-
-2002-02-15 Christopher Faylor <cgf@redhat.com>
-
- * mount.cc (usage): Fix typo in output.
-
-2002-02-14 Christopher Faylor <cgf@redhat.com>
-
- * strace.cc (attach_process): Change CW_STRACE_ON to CW_STRACE_TOGGLE.
-
-2002-01-31 Corinna Vinschen <corinna@vinschen.de>
-
- * mkpasswd.c (main): Set default home path for 9x/Me if --path-to-home
- isn't given.
-
-2002-01-30 Corinna Vinschen <corinna@vinschen.de>
-
- * passwd.cc (ChangePW): Add parameter to differ between called for
- checking old password and called for changing password. If called
- for checking old password, return non-zero only if password is surely
- incorrect.
- (main): Call ChangePW() with additional parameter.
-
-2002-01-29 Christopher Faylor <cgf@redhat.com>
-
- * dump_setup.cc (parse_filename): Don't consider '_' part of the
- version.
-
-2002-01-28 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc: Fix typo. Remove uid_t kludge. Rely on kludge in
- sys/cygwin.h instead.
- * getfacl.c: Add include to remove warning.
- * mkgroup.c (main): Assign variables outside of parameter passing.
- This seems to eliminate some compiler warnings.
-
-2002-01-28 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc: Use specific cygwin includes, as required.
-
-2002-01-28 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in (MINGW_INCLUDES): Change cygwin include.
- * strace.cc: Use specific cygwin includes, as required.
- (load_cygwin): New function. Loads cygwin DLL, if necessary.
- (attach_process): Attaches strace to a running process.
- (dostrace): Accept pid argument. Attach to pid if supplied.
- (usage): Describe -p option. Correct system description.
- (longopts): Alphabetize.
- (opts): Ditto.
- (main): Ditto. Handle -p option.
-
-2002-01-21 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in (CXXFLAGS): Ensure that important settings are preserved
- even when overriden by command line.
-
-2002-01-21 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in: Build intermediate cygcheck.o to force use of MINGW_CXXFLAGS.
- * cygcheck.cc (cygwin_info): Intitialize variable to quiet g++ warning.
- (dump_sysinfo): Make variables unsigned to quiet g++ warnings.
- * strace.cc (version_string): Rename from SCCSid.
- (add_child): Remove unused variable.
- (version): Use version_string. Avoid use of fprintf.
-
-2002-01-21 DJ Delorie <dj@redhat.com>
-
- * Makefile.in: Use CXX instead of CC to compile C++ sources.
-
-2002-01-17 DJ Delorie <dj@redhat.com>
-
- * cygcheck.cc (already_did): Avoid default constructors, which may
- require exception support.
-
-2001-01-16 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>
-
- * cygpath.cc (main): Add options to show Desktop and Start
- Menu's Programs directory for current user or all users.
- Move bulk of DPWS options outside the getopt case statement.
- * utils.sgml: Update cygpath section for ADPWS options.
-
-2002-01-15 Joerg Schaible <joerg.schaible@gmx.de>
-
- * cygpath.cc (doit): Empty file ignored using option -i.
-
-2002-01-15 Mark Bradshaw <bradshaw@crosswalk.com>
-
- * mkpasswd.c (print_win_error): Add a new function.
- (enum_users): Use print_win_error.
- (enum_local_groups): Ditto.
- (main): Ditto.
-
-2001-12-26 Jonathan Kamens <jik@curl.com>
-
- * cygpath.cc (doit): Detect and warn about an empty path. Detect and
- warn about errors converting a path.
- (main): Set prog_name correctly -- don't leave an extra slash or
- backslash at the beginning of it.
-
-Fri Dec 14 14:04:37 2001 Jason Tishler <jason@tishler.net>
-
- * mkpasswd.c (enum_users): Change to unconditionally use
- the --path-to-home option, if supplied by the user. Use default
- --path-to-home option value, if appropriate.
- (usage): Change usage statement to reflect new semantics.
- (main): Remove defaulting of the --path-to-home option.
-
-Fri Dec 14 12:10:39 2001 Jason Tishler <jason@tishler.net>
-
- * mkpasswd.c (opts): Add indication that '-p' option requires an
- argument.
-
-2001-12-11 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in: Add define to CXXFLAGS.
-
-2001-12-03 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc (usage): Add -c description.
- * cygpath.cc (usage): Alphabetize options.
- * strace.cc (usage): Ditto.
-
-2001-11-21 Christopher Faylor <cgf@redhat.com>
-
- * path.cc (cygpath): Don't consider cygdrive stuff when trying to derive
- native paths.
-
-2001-11-20 Mark Bradshaw <bradshaw@staff.crosswalk.com>
-
- * mkpasswd.c: include lmerr.h
- (main): New -u option to allow specifying a
- specific user. If specified, groups aren't displayed and
- output is limited to only the specified user.
- (enum_users): If specific user is specified, via -u option,
- display only that user's record. With -u use NetUserGetInfo
- instead of NetUserEnum.
- (load_netapi): Added netusergetinfo.
-
-2001-11-15 Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
-
- * strace.cc (main): Change getopt() to getopt_long().
- Add support for help and version info.
- Use new parse_mask() function for -m/--mask option.
- (longopts): Add long options structure.
- (opts): Move options string from getopts call to static var.
- (usage): Print usage information.
- (SCCSid): Version info.
- (version): New function for displaying version info.
- (parse_mask): New function supporting parsing of mnemonics,
- hex, and basic expressions in masks.
- (mnemonic2ul): New mnemonic parsing function.
- (tag_mask_mnemonic): New type.
- (mnemonic_table): New table of mnemonics for mnemonic2ul() to
- search through.
-
-2001-11-12 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (dump_sysinfo): Redefine output format slightly.
- Print correct build number on 9x/ME systems.
-
-2001-11-12 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc (main): Slight formatting tweak.
-
-2001-11-12 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (dump_sysinfo): Add some more details.
-
-2001-11-12 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (dump_sysinfo): Print more detailed OS information string
- using OSVERSIONINFOEX information.
-
-2001-11-11 Christopher Faylor <cgf@redhat.com>
-
- * path.h: New file.
-
-2001-11-11 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc (scan_registry): Open registry with read-only access.
- (main): Reflect argument change for dump_setup.
- * dump_setup.cc (dump_setup): Add preliminary extra argument for future
- use.
- * path.cc (read_mounts): Open registry with read-only access.
-
-2001-11-11 Christopher Faylor <cgf@redhat.com>
-
- * cygcheck.cc (main): Display package info when '-s' is specified.
- * dump_setup.cc (dump_setup): Change header. Remove typo. Always sort
- packages output.
-
-2001-11-11 Christopher Faylor <cgf@redhat.com>
-
- * dump_setup.cc: New file.
- * Makefile.in: Add info for dump_setup.o.
- * cygcheck.cc (main): Recognize '-c' option for checking setup
- installed base.
- * path.cc (cygpath): Read mount table if not loaded.
-
-2001-11-10 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in (cygcheck.exe): Compile as -mno-cygwin executable.
- * path.cc: New file.
- * cygcheck.cc (init_paths): Use MS-DOS path syntax.
- (cygwin_info): Properly display cygwin version numbers. Prettify some
- output.
- (dump_sysinfo): Calculate max names of posix and ms-dos paths for
- prettier output.
-
-2001-11-09 Corinna Vinschen <corinna@vinschen.de>
-
- * cygcheck.cc (dump_sysinfo): Print more detailed OS information string.
-
-2001-11-04 Corinna Vinschen <corinna@vinschen.de>
-
- * getfacl.c (username): New function.
- (groupname): Ditto.
- (usage): Ditto. Add more user friendly help text.
- (main): Add -n and --help option. Print names instead of IDs
- unless -n option is given.
- * setfacl.c (getperm): Tolerate whitespace and comment chars in input.
- (getaclentry): Fix several input string misdetections.
- (getaclentries): Allow - as input file name to read from stdin.
- Tolerate whitespace and comment chars in input.
- (usage): Add more user friendly help text.
- (main): Add --help option.
-
-2001-11-04 Egor Duda <deo@logos-m.ru>
-
- * strace.cc (main): New option '-w'. Start traced process in separate
- window. New option '-S x'. Flush buffered output every x seconds.
- (create_child): Start child process in new window, when requested.
- When requested, periodically flush debugging output.
-
-2001-10-24 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in: Remove EXEEXT consideration. We always need .exe
- extensions.
-
-2001-10-20 Corinna Vinschen <corinna@vinschen.de>
-
- * mkgroup.c: Avoid compiler warnings.
- (print_special): New function.
- (main): Print special accounts by calling print_special().
- * mkpasswd.c: Avoid compiler warnings.
- (enum_users): Print additional U-domain\username info in gecos
- field when SIDs are printed.
- (print_special): New function.
- (main): Print special accounts by calling print_special().
-
-2001-10-15 Christopher Faylor <cgf@redhat.com>
-
- * mkpasswd.cc (enum_users): Shorten "unused" passwd field.
-
-2001-10-13 Christopher Faylor <cgf@redhat.com>
-
- * Makefile.in: Allow stdinc searching for dumper.
-
-Tue Oct 9 21:59:00 2001 Christopher Faylor <cgf@cygnus.com>
-
- * Makefile.in (MINGW_INCLUDES): Accommodate changes in Makefile.common.
-
-Sun Oct 7 23:06:39 2001 Christopher Faylor <cgf@cygnus.com>
-
- * kill.cc (main): Set exit value to 1 on invalid pid. Perform minor
- cleanup.
-
-Fri Sep 21 20:40:30 2001 Christopher Faylor <cgf@cygnus.com>
-
- * Makefile.in (mingw_getopt.o): Ensure that newlib include directories
- are not searched.
-
-Thu Sep 20 21:00:20 2001 Christopher Faylor <cgf@cygnus.com>
-
- * Makefile.in (MINGW_INCLUDES): Still need cygwin/include directory.
-
-Wed Sep 19 12:22:08 2001 Christopher Faylor <cgf@cygnus.com>
-
- * Makefile.in: Filter newlib includes from mingw compilation.
-
-2001-09-14 Egor Duda <deo@logos-m.ru>
-
- * dumper.cc (dumper::dumper): Print error code in case of error.
- (dumper::add_thread): Ditto.
- (dumper::collect_memory_sections): Ditto.
- (dumper::dump_memory_region): Ditto.
- (dumper::collect_process_information): Ditto.
- (print_section_name): Fix formatting.
-
-2001-09-13 Egor Duda <deo@logos-m.ru>
-
- * dumper.cc (main): Properly recognize negative pids (used by w9x).
-
-2001-09-09 Egor Duda <deo@logos-m.ru>
-
- * dumper.cc (main): Change command-line arguments format to be
- similar to gdb. Allow adding error_start=x:\path\to\dumper.exe to
- CYGWIN environment variable to perform core dumping in case of
- program crash.
- (usage): Ditto.
-
-Wed Sep 5 22:37:21 2001 Christopher Faylor <cgf@cygnus.com>
-
- * Makefile.in (dumper): Change logic for libbfd and libintl so that
- they will be found either in the build tree or the installed directory.
- * mkpasswd.c (enum_users): Add a comment as a password for NT.
-
-2001-09-03 Michael A Chase <mchase@ix.netcom.com>
-
- * mount.cc (mount_commands): Don't write /cygdrive/u mount points.
-
-2001-09-03 Michael A Chase <mchase@ix.netcom.com>
-
- * mount.cc (longopts): Add mount-commands to options list.
- (usage): Add mount-commands option.
- (mount_commands): New function. Write commands to recreate current
- mounts.
-
-Sat Sep 1 15:58:11 2001 Christopher Faylor <cgf@cygnus.com>
-
- * mount.cc (main): Eliminate excess arguments in printf.
-
-2001-08-30 Egor Duda <deo@logos-m.ru>
-
- * dumper.h: Update copyright notice.
- * dumper.cc: Ditto.
- * dumper.cc: (dumper::print_core_section_list): New function.
- * dumper.h: (dumper::print_core_section_list): Declare it.
- * dumper.cc (print_section_name): New function.
- (dumper::collect_process_information): Augment debugging output.
- Stop debugee processing if it posts double exception.
- (usage): Fix typo in option name.
-
-Tue Aug 28 14:45:02 2001 Christopher Faylor <cgf@cygnus.com>
-
- * mount.cc (main): Issue correct warning for 'not enough arguments'.
-
-2001-08-14 Joerg Schaible <joerg.schaible@gmx.de>
-
- * cygpath.cc (main): Support -w for Windows (System) directories and
- return physical correct orthography for the Windows System dir.
-
-2001-07-14 Chris Genly <chgenly@alum.mit.edu>
-
- * regtool.cc (find_key): Handle keys with only one subkey.
-
-Wed Jun 27 22:46:10 2001 Christopher Faylor <cgf@cygnus.com>
-
- * regtool.cc (find_key): Revert previous change.
-
-Wed Jun 27 13:37:41 2001 Keith Starsmeare" <keith_starsmeare@yahoo.co.uk>
-
- * regtool.cc (find_key): Allow '/' as a synonym for '\\'.
-
-Fri Jun 15 00:49:21 2001 Christopher Faylor <cgf@cygnus.com>
-
- * mkpasswd.c (main): Output passwd file in binary mode so that there
- are no CRs in the file.
- * umount.cc (remove_all_user_mounts): Don't try to remove /cygdrive
- mounts.
-
-Tue May 1 10:50:48 2001 Christopher Faylor <cgf@cygnus.com>
-
- * mkpasswd.c (enum_users): Use /bin/bash as the default shell.
- (main): Ditto.
-
-Sat Apr 28 22:32:01 2001 Christopher Faylor <cgf@cygnus.com>
-
- * passwd.cc (ttymnam): New function.
- (main): Use ttynam() to report name of tty.
-
-2001-04-19 Egor Duda <deo@logos-m.ru>
-
- * dumper.cc (dumper::init_core_dump): Set architecture field in dump
- header.
-
-Mon Apr 16 15:08:00 2001 Corinna Vinschen <vinschen@redhat.com>
-
- * mkgroup.c: Add function pointers `netlocalgroupgetmembers' and
- `netgroupgetusers'.
- (load_netapi): Load function pointers `netlocalgroupgetmembers'
- and `netgroupgetusers'.
- (enum_local_users): New function.
- (enum_local_groups): Call `enum_local_users' for each group if
- `print_users' is set.
- (enum_users): New function.
- (enum_groups): Call `enum_users' for each group if `print_users' is set.
- (usage): Add usage text for `-u/--users'.
- (longopts): Add option `--users'.
- (opts): Add option character `u'.
- (main): Set `print_users' according to option `-u/--users'.
- Call `enum_local_groups' and `enum_groups' with additional parameter
- `print_users'.
-
-2001-04-15 Michael A Chase <mchase@ix.netcom.com>
-
- * mount.cc (longopts): Add help to options list.
- (opts): Add 'h' to options string.
- * umount.cc (longopts): Add help to options list.
- (opts): Add 'h' to options string and change 'R' to 'A'.
-
-2001-04-13 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
-
- * mkgroup.c (enum_groups): Use RID + offset specified an additional
- argument as ID.
- (usage): Add description of -o option.
- (longopts, opts): Add specifications of -o/--id-offset option.
- (main): Add -o option. Invoke enum_groups with specified offset.
- * mkpasswd.c (enum_users): Just like mkgroup.c.
- (usage, longopts, opts): Ditto.
- (main): Add -o option. Invoke enum_users with specified offset only
- against domain accounts.
-
-2001-04-11 Egor Duda <deo@logos-m.ru>
-
- * mkgroup.c (uni2ansi): Use native method to convert from Unicode
- to multi-byte strings.
- * mkpasswd.c (uni2ansi): Ditto.
- (enum_users): Pass buffer size when converting string.
- (enum_local_groups): Ditto.
- * mkgroup.c (enum_groups): Ditto.
- (enum_local_groups): Ditto.
-
-Mon Apr 2 22:41:33 2001 Christopher Faylor <cgf@cygnus.com>
-
- * mount.cc (main): Use getopt_long for parsing arguments.
- (usage): Reformat, show long and short options.
- * umount.cc (main): Ditto, all of the above.
-
-Mon Apr 2 10:58:26 2001 Christopher Faylor <cgf@cygnus.com>
-
- * mount.cc (show_mounts): Change format string to more closely resemble
- UNIX when displaying mount table.
-
-Sat Mar 17 21:46:06 2001 Christopher Faylor <cgf@cygnus.com>
-
- * kill.cc (forcekill): Use dwProcessId when opening a process, not the
- Cygwin pid.
-
-Mon Mar 5 18:50:00 2001 Corinna Vinschen <vinschen@redhat.com>
-
- * getfacl.c: Add copyright hint.
- * setfacl.c: Ditto.
- * strace.cc: Ditto.
-
-Tue Jan 09 10:26:23 2001 Tony Sideris <tonys1110@home.com>
-
- * regtool.cc (cmd_list): Add new registry display options.
- (cmd_list): Add code to implement -p, -k, and -l options.
-
- * regtool.cc (Fail): Add call to LocalFree to free memory allocated by
- FormatMessage.
-
-Wed Jan 10 09:16:57 2001 Christopher Faylor <cgf@cygnus.com>
-
- * regtool.cc (translate): Ensure that 'c' is initialized.
- (cmd_set): Ditto for rv.
diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in
deleted file mode 100644
index c8dd4c39d06..00000000000
--- a/winsup/utils/Makefile.in
+++ /dev/null
@@ -1,180 +0,0 @@
-# Makefile for Cygwin utilities
-# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008 Red Hat, Inc.
-
-# This file is part of Cygwin.
-
-# This software is a copyrighted work licensed under the terms of the
-# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-# details.
-
-SHELL:=@SHELL@
-
-srcdir:=@srcdir@
-VPATH:=@srcdir@
-prefix:=@prefix@
-exec_prefix:=@exec_prefix@
-
-bindir:=@bindir@
-program_transform_name:=@program_transform_name@
-
-override INSTALL:=@INSTALL@
-override INSTALL_PROGRAM:=@INSTALL_PROGRAM@
-override INSTALL_DATA:=@INSTALL_DATA@
-
-EXEEXT:=@EXEEXT@
-EXEEXT_FOR_BUILD:=@EXEEXT_FOR_BUILD@
-
-CC:=@CC@
-CC_FOR_TARGET:=$(CC)
-CXX:=@CXX@
-CXX_FOR_TARGET:=$(CXX)
-
-CFLAGS:=@CFLAGS@
-CXXFLAGS:=@CXXFLAGS@
-override CXXFLAGS+=-fno-exceptions -fno-rtti -DHAVE_DECL_GETOPT=0
-
-include $(srcdir)/../Makefile.common
-
-.SUFFIXES:
-.NOEXPORT:
-.PHONY: all install clean realclean warn_dumper warn_cygcheck_zlib
-
-ALL_LDLIBS := -lnetapi32 -ladvapi32
-ALL_LDFLAGS := -B$(newlib_build)/libc -B$(w32api_lib) $(LDFLAGS) $(ALL_LDLIBS)
-ALL_DEP_LDLIBS := $(cygwin_build)/libcygwin.a ${patsubst -l%,\
- $(w32api_lib)/lib%.a,$(ALL_LDLIBS) -lkernel32 -luser32}
-
-MINGW_LIB := $(mingw_build)/libmingw32.a
-MINGW_LDLIBS := $(ALL_LDLIBS) $(MINGW_LIB)
-MINGW_DEP_LDLIBS := $(ALL_DEP_LDLIBS) $(MINGW_LIB)
-MINGW_CXX := ${patsubst %/cygwin/include,%/mingw/include,\
- ${filter-out -I$(newlib_source)/%,$(COMPILE_CXX)}} -I$(updir)
-
-# List all binaries to be linked in Cygwin mode. Each binary on this list
-# must have a corresponding .o of the same name.
-CYGWIN_BINS := ${addsuffix .exe,cygpath getfacl kill mkgroup \
- mkpasswd mount passwd ps regtool setfacl setmetamode ssp umount}
-
-# List all binaries to be linked in MinGW mode. Each binary on this list
-# must have a corresponding .o of the same name.
-MINGW_BINS := ${addsuffix .exe,strace cygcheck}
-
-# List all objects to be compiled in MinGW mode. Any object not on this
-# list will will be compiled in Cygwin mode implicitly, so there is no
-# need for a CYGWIN_OBJS.
-MINGW_OBJS := bloda.o cygcheck.o dump_setup.o path.o strace.o
-
-# If a binary should link in any objects besides the .o with the same
-# name as the binary, then list those here.
-strace.exe: path.o
-cygcheck.exe: bloda.o path.o dump_setup.o
-
-# Provide any necessary per-target variable overrides.
-cygcheck.exe: MINGW_LDFLAGS += -lntdll
-cygpath.exe: ALL_LDFLAGS += -lntdll
-
-# Check for dumper's requirements and enable it if found.
-LIBICONV := @libiconv@
-libbfd := ${shell $(CC) -B$(bupdir2)/bfd/ --print-file-name=libbfd.a}
-libintl := ${shell $(CC) -B$(bupdir2)/intl/ --print-file-name=libintl.a}
-build_dumper := ${shell test -r $(libbfd) -a -r $(libintl) -a -n "$(LIBICONV)" && echo 1}
-ifdef build_dumper
-CYGWIN_BINS += dumper.exe
-dumper.o module_info.o parse_pe.o: CXXFLAGS += -I$(bupdir2)/bfd -I$(updir1)/include
-dumper.o parse_pe.o: dumper.h
-dumper.exe: module_info.o parse_pe.o
-dumper.exe: ALL_LDFLAGS += ${libbfd} ${libintl} -L$(bupdir1)/libiberty $(LIBICONV) -liberty
-else
-all: warn_dumper
-endif
-
-# Check for availability of a MinGW libz and enable for cygcheck.
-libz:=${shell x=$$($(CC) -mno-cygwin --print-file-name=libz.a); cd $$(dirname $$x); dir=$$(pwd); case "$$dir" in *mingw*) echo $$dir/libz.a ;; esac}
-ifdef libz
-zlib_h := -include ${patsubst %/lib/mingw/libz.a,%/include/zlib.h,${patsubst %/lib/libz.a,%/include/zlib.h,$(libz)}}
-zconf_h := ${patsubst %/zlib.h,%/zconf.h,$(zlib_h)}
-dump_setup.o: MINGW_CXXFLAGS += $(zconf_h) $(zlib_h)
-cygcheck.exe: MINGW_LDFLAGS += $(libz)
-else
-all: warn_cygcheck_zlib
-endif
-
-all: Makefile $(CYGWIN_BINS) $(MINGW_BINS)
-
-# test harness support (note: the "MINGW_BINS +=" should come after the
-# "all:" above so that the testsuite is not run for "make" but only
-# "make check".)
-MINGW_BINS += testsuite.exe
-MINGW_OBJS += path-testsuite.o testsuite.o
-testsuite.exe: path-testsuite.o
-path-testsuite.cc: path.cc ; @test -L $@ || ln -sf ${filter %.cc,$^} $@
-path-testsuite.o: MINGW_CXXFLAGS += -DTESTSUITE
-# this is necessary because this .c lives in the build dir instead of src
-path-testsuite.o: MINGW_CXX := ${patsubst -I.,-I$(utils_source),$(MINGW_CXX)}
-path-testsuite.cc path.cc testsuite.cc: testsuite.h
-check: testsuite.exe ; $(<D)/$(<F)
-
-# the rest of this file contains generic rules
-
-# how to compile a MinGW object
-$(MINGW_OBJS): %.o: %.cc
-ifdef VERBOSE
- $(MINGW_CXX) $c -o $(@D)/$(basename $@)$o $(MINGW_CXXFLAGS) $<
-else
- @echo $(MINGW_CXX) $c $(MINGW_CXXFLAGS) ... $(*F).cc;\
- $(MINGW_CXX) $c -o $(@D)/$(basename $@)$o $(MINGW_CXXFLAGS) $<
-endif
-
-# how to link a MinGW binary
-$(MINGW_BINS): %.exe: %.o
-ifdef VERBOSE
- $(CXX) $(MINGW_CXXFLAGS) -o $@ ${filter %.o,$^} -B$(mingw_build)/ $(MINGW_LDFLAGS)
-else
- @echo $(CXX) -o $@ ${filter %.o,$^} ${filter-out -B%, $(MINGW_CXXFLAGS) $(MINGW_LDFLAGS)};\
- $(CXX) $(MINGW_CXXFLAGS) -o $@ ${filter %.o,$^} -B$(mingw_build)/ $(MINGW_LDFLAGS)
-endif
-
-# how to link a Cygwin binary
-$(CYGWIN_BINS): %.exe: %.o
-ifdef VERBOSE
- $(CXX) -o $@ ${filter %.o,$^} -B$(cygwin_build)/ $(ALL_LDFLAGS)
-else
- @echo $(CXX) -o $@ ${filter %.o,$^} ... ${filter-out -B%, $(ALL_LDFLAGS)};\
- $(CXX) -o $@ ${filter %.o,$^} -B$(cygwin_build)/ $(ALL_LDFLAGS)
-endif
-
-# note: how to compile a Cygwin object is covered by the pattern rule in Makefile.common
-
-# these dependencies ensure that the required in-tree libs are built first
-$(MINGW_BINS): $(MINGW_DEP_LDLIBS)
-$(CYGWIN_BINS): $(ALL_DEP_LDLIBS)
-
-clean:
- rm -f *.o $(CYGWIN_BINS) $(MINGW_BINS) path-testsuite.cc testsuite.exe
-
-realclean: clean
- rm -f Makefile config.cache
-
-install: all
- $(SHELL) $(updir1)/mkinstalldirs $(bindir)
- for i in $(CYGWIN_BINS) ${filter-out testsuite.exe,$(MINGW_BINS)} ; do \
- n=`echo $$i | sed '$(program_transform_name)'`; \
- $(INSTALL_PROGRAM) $$i $(bindir)/$$n; \
- done
-
-$(cygwin_build)/libcygwin.a: $(cygwin_build)/Makefile
- @$(MAKE) -C $(@D) $(@F)
-
-$(MINGW_LIB): $(mingw_build)/Makefile
- @$(MAKE) -C $(@D) $(@F)
-
-warn_dumper:
- @echo '*** Not building dumper.exe since some required libraries are'
- @echo '*** missing: libbfd.a and libintl.a.'
- @echo '*** If you need this program, check out the naked-bfd and naked-intl'
- @echo '*** sources from sourceware.org. Then, configure and build these'
- @echo '*** libraries. Otherwise, you can safely ignore this warning.'
-
-warn_cygcheck_zlib:
- @echo '*** Building cygcheck without package content checking due to missing mingw libz.a.'
diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc
deleted file mode 100644
index a8a45bcd259..00000000000
--- a/winsup/utils/cygcheck.cc
+++ /dev/null
@@ -1,2183 +0,0 @@
-/* cygcheck.cc
-
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008 Red Hat, Inc.
-
- This file is part of Cygwin.
-
- This software is a copyrighted work licensed under the terms of the
- Cygwin license. Please consult the file "CYGWIN_LICENSE" for
- details. */
-
-#define cygwin_internal cygwin_internal_dontuse
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <sys/time.h>
-#include <ctype.h>
-#include <io.h>
-#include <windows.h>
-#include <wininet.h>
-#include "path.h"
-#include <getopt.h>
-#include "cygwin/include/sys/cygwin.h"
-#include "cygwin/include/mntent.h"
-#undef cygwin_internal
-
-#define alloca __builtin_alloca
-
-int verbose = 0;
-int registry = 0;
-int sysinfo = 0;
-int givehelp = 0;
-int keycheck = 0;
-int check_setup = 0;
-int dump_only = 0;
-int find_package = 0;
-int list_package = 0;
-int grep_packages = 0;
-
-static char emptystr[] = "";
-
-/* This is global because it's used in both internet_display_error as well
- as package_grep. */
-BOOL (WINAPI *pInternetCloseHandle) (HINTERNET);
-
-#ifdef __GNUC__
-typedef long long longlong;
-#else
-typedef __int64 longlong;
-#endif
-
-/* In dump_setup.cc */
-void dump_setup (int, char **, bool);
-void package_find (int, char **);
-void package_list (int, char **);
-/* In bloda.cc */
-void dump_dodgy_apps (int verbose);
-
-
-static const char version[] = "$Revision$";
-
-static const char *known_env_vars[] = {
- "c_include_path",
- "compiler_path",
- "cxx_include_path",
- "cygwin",
- "cygwin32",
- "dejagnu",
- "expect",
- "gcc_default_options",
- "gcc_exec_prefix",
- "home",
- "ld_library_path",
- "library_path",
- "login",
- "lpath",
- "make_mode",
- "makeflags",
- "path",
- "pwd",
- "strace",
- "tcl_library",
- "user",
- 0
-};
-
-struct
-{
- const char *name;
- int missing_is_good;
-}
-static common_apps[] = {
- {"awk", 0},
- {"bash", 0},
- {"cat", 0},
- {"cp", 0},
- {"cpp", 1},
- {"crontab", 0},
- {"find", 0},
- {"gcc", 0},
- {"gdb", 0},
- {"grep", 0},
- {"kill", 0},
- {"ld", 0},
- {"ls", 0},
- {"make", 0},
- {"mv", 0},
- {"patch", 0},
- {"perl", 0},
- {"rm", 0},
- {"sed", 0},
- {"ssh", 0},
- {"sh", 0},
- {"tar", 0},
- {"test", 0},
- {"vi", 0},
- {"vim", 0},
- {0, 0}
-};
-
-static int num_paths, max_paths;
-struct pathlike
-{
- char *dir;
- bool issys;
- void pathlike::check_existence (const char *fn, int showall, int verbose,
- char* first, const char *ext1 = "",
- const char *ext2 = "");
-};
-
-pathlike *paths;
-int first_nonsys_path;
-
-void
-eprintf (const char *format, ...)
-{
- va_list ap;
- va_start (ap, format);
- vfprintf (stderr, format, ap);
- va_end (ap);
-}
-
-/*
- * display_error() is used to report failure modes
- */
-static int
-display_error (const char *name, bool show_error, bool print_failed)
-{
- fprintf (stderr, "cygcheck: %s", name);
- if (show_error)
- fprintf (stderr, "%s: %lu\n",
- print_failed ? " failed" : "", GetLastError ());
- else
- fprintf (stderr, "%s\n",
- print_failed ? " failed" : "");
- return 1;
-}
-
-static int
-display_error (const char *name)
-{
- return display_error (name, true, true);
-}
-
-static int
-display_error (const char *fmt, const char *x)
-{
- char buf[4000];
- sprintf (buf, fmt, x);
- return display_error (buf, false, false);
-}
-
-static int
-display_error_fmt (const char *fmt, ...)
-{
- char buf[4000];
- va_list va;
-
- va_start (va, fmt);
- vsprintf (buf, fmt, va);
- return display_error (buf, false, false);
-}
-
-/* Display a WinInet error message, and close a variable number of handles.
- (Passed a list of handles terminated by NULL.) */
-static int
-display_internet_error (const char *message, ...)
-{
- DWORD err = GetLastError ();
- TCHAR err_buf[256];
- va_list hptr;
- HINTERNET h;
-
- /* in the case of a successful connection but 404 response, there is no
- win32 error message, but we still get passed a message to display. */
- if (err)
- {
- if (FormatMessage (FORMAT_MESSAGE_FROM_HMODULE,
- GetModuleHandle ("wininet.dll"), err, 0, err_buf,
- sizeof (err_buf), NULL) == 0)
- strcpy (err_buf, "(Unknown error)");
-
- fprintf (stderr, "cygcheck: %s: %s (win32 error %d)\n", message,
- err_buf, err);
- }
- else
- fprintf (stderr, "cygcheck: %s\n", message);
-
- va_start (hptr, message);
- while ((h = va_arg (hptr, HINTERNET)) != 0)
- pInternetCloseHandle (h);
- va_end (hptr);
-
- return 1;
-}
-
-static void
-add_path (char *s, int maxlen, bool issys)
-{
- if (num_paths >= max_paths)
- {
- max_paths += 10;
- /* Extend path array */
- paths = (pathlike *) realloc (paths, (1 + max_paths) * sizeof (paths[0]));
- }
-
- pathlike *pth = paths + num_paths;
-
- /* Allocate space for directory in path list */
- char *dir = (char *) calloc (maxlen + 2, sizeof (char));
- if (dir == NULL)
- {
- display_error ("add_path: calloc() failed");
- return;
- }
-
- /* Copy input directory to path list */
- memcpy (dir, s, maxlen);
-
- /* Add a trailing slash by default */
- char *e = strchr (dir, '\0');
- if (e != dir && e[-1] != '\\')
- strcpy (e, "\\");
-
- /* Fill out this element */
- pth->dir = dir;
- pth->issys = issys;
- pth[1].dir = NULL;
- num_paths++;
-}
-
-static void
-init_paths ()
-{
- char tmp[4000], *sl;
- add_path ((char *) ".", 1, true); /* to be replaced later */
-
- if (GetCurrentDirectory (4000, tmp))
- add_path (tmp, strlen (tmp), true);
- else
- display_error ("init_paths: GetCurrentDirectory()");
-
- if (GetSystemDirectory (tmp, 4000))
- add_path (tmp, strlen (tmp), true);
- else
- display_error ("init_paths: GetSystemDirectory()");
- sl = strrchr (tmp, '\\');
- if (sl)
- {
- strcpy (sl, "\\SYSTEM");
- add_path (tmp, strlen (tmp), true);
- }
- GetWindowsDirectory (tmp, 4000);
- add_path (tmp, strlen (tmp), true);
-
- char *wpath = getenv ("PATH");
- if (!wpath)
- display_error ("WARNING: PATH is not set\n", "");
- else
- {
- char *b, *e;
- b = wpath;
- while (1)
- {
- for (e = b; *e && *e != ';'; e++)
- continue; /* loop terminates at first ';' or EOS */
- if (strncmp(b, ".\\", 2) != 0)
- add_path (b, e - b, false);
- if (!*e)
- break;
- b = e + 1;
- }
- }
-}
-
-#define LINK_EXTENSION ".lnk"
-
-void
-pathlike::check_existence (const char *fn, int showall, int verbose,
- char* first, const char *ext1, const char *ext2)
-{
- char file[4000];
- strcpy (file, dir);
- strcat (file, fn);
- strcat (file, ext1);
- strcat (file, ext2);
-
- if (GetFileAttributes (file) != (DWORD) - 1)
- {
- char *lastdot = strrchr (file, '.');
- bool is_link = lastdot && !strcmp (lastdot, LINK_EXTENSION);
- // If file is a link, fix up the extension before printing
- if (is_link)
- *lastdot = '\0';
- if (showall)
- printf ("Found: %s\n", file);
- if (verbose && *first != '\0' && strcasecmp (first, file) != 0)
- {
- char *flastdot = strrchr (first, '.');
- bool f_is_link = flastdot && !strcmp (flastdot, LINK_EXTENSION);
- // if first is a link, fix up the extension before printing
- if (f_is_link)
- *flastdot = '\0';
- printf ("Warning: %s hides %s\n", first, file);
- if (f_is_link)
- *flastdot = '.';
- }
- if (is_link)
- *lastdot = '.';
- if (!*first)
- strcpy (first, file);
- }
-}
-
-static const char *
-find_on_path (const char *in_file, const char *ext, bool showall = false,
- bool search_sys = false, bool checklinks = false)
-{
- static char rv[4000];
-
- /* Sort of a kludge but we've already tested this once, so don't try it again */
- if (in_file == rv)
- return in_file;
-
- static pathlike abspath[2] =
- {
- {emptystr, 0},
- {NULL, 0}
- };
-
- *rv = '\0';
- if (!in_file)
- {
- display_error ("internal error find_on_path: NULL pointer for file", false, false);
- return 0;
- }
-
- if (!ext)
- {
- display_error ("internal error find_on_path: NULL pointer for default_extension", false, false);
- return 0;
- }
-
- const char *file;
- pathlike *search_paths;
- if (!strpbrk (in_file, ":/\\"))
- {
- file = in_file;
- search_paths = paths;
- }
- else
- {
- file = cygpath (in_file, NULL);
- search_paths = abspath;
- showall = false;
- }
-
- if (!file)
- {
- display_error ("internal error find_on_path: cygpath conversion failed for %s\n", in_file);
- return 0;
- }
-
- char *hasext = strrchr (file, '.');
- if (hasext && !strpbrk (hasext, "/\\"))
- ext = "";
-
- for (pathlike *pth = search_paths; pth->dir; pth++)
- if (!pth->issys || search_sys)
- {
- pth->check_existence (file, showall, verbose, rv, ext);
-
- if (checklinks)
- pth->check_existence (file, showall, verbose, rv, ext, LINK_EXTENSION);
-
- if (!*ext)
- continue;
-
- pth->check_existence (file, showall, verbose, rv);
- if (checklinks)
- pth->check_existence (file, showall, verbose, rv, LINK_EXTENSION);
- }
-
- return *rv ? rv : NULL;
-}
-
-#define DID_NEW 1
-#define DID_ACTIVE 2
-#define DID_INACTIVE 3
-
-struct Did
-{
- Did *next;
- char *file;
- int state;
-};
-static Did *did = 0;
-
-static Did *
-already_did (const char *file)
-{
- Did *d;
- for (d = did; d; d = d->next)
- if (strcasecmp (d->file, file) == 0)
- return d;
- d = (Did *) malloc (sizeof (Did));
- d->file = strdup (file);
- d->next = did;
- d->state = DID_NEW;
- did = d;
- return d;
-}
-
-struct Section
-{
- char name[8];
- int virtual_size;
- int virtual_address;
- int size_of_raw_data;
- int pointer_to_raw_data;
-};
-
-static int
-rva_to_offset (int rva, char *sections, int nsections, int *sz)
-{
- int i;
-
- if (sections == NULL)
- {
- display_error ("rva_to_offset: NULL passed for sections", true, false);
- return 0;
- }
-
- for (i = 0; i < nsections; i++)
- {
- Section *s = (Section *) (sections + i * 40);
-#if 0
- printf ("%08x < %08x < %08x ? %08x\n",
- s->virtual_address, rva,
- s->virtual_address + s->virtual_size, s->pointer_to_raw_data);
-#endif
- if (rva >= s->virtual_address
- && rva < s->virtual_address + s->virtual_size)
- {
- if (sz)
- *sz = s->virtual_address + s->virtual_size - rva;
- return rva - s->virtual_address + s->pointer_to_raw_data;
- }
- }
- return 0; /* punt */
-}
-
-struct ExpDirectory
-{
- int flags;
- int timestamp;
- short major_ver;
- short minor_ver;
- int name_rva;
-};
-
-struct ImpDirectory
-{
- unsigned characteristics;
- unsigned timestamp;
- unsigned forwarder_chain;
- unsigned name_rva;
- unsigned iat_rva;
-};
-
-static bool track_down (const char *file, const char *suffix, int lvl);
-
-#define CYGPREFIX (sizeof ("%%% Cygwin ") - 1)
-static void
-cygwin_info (HANDLE h)
-{
- char *buf, *bufend, *buf_start = NULL;
- const char *hello = " Cygwin DLL version info:\n";
- DWORD size = GetFileSize (h, NULL);
- DWORD n;
-
- if (size == 0xffffffff)
- return;
-
- buf_start = buf = (char *) calloc (1, size + 1);
- if (buf == NULL)
- {
- display_error ("cygwin_info: calloc()");
- return;
- }
-
- (void) SetFilePointer (h, 0, NULL, FILE_BEGIN);
- if (!ReadFile (h, buf, size, &n, NULL))
- {
- free (buf_start);
- return;
- }
-
- static char dummy[] = "\0\0\0\0\0\0\0";
- char *dll_major = dummy;
- bufend = buf + size;
- while (buf < bufend)
- if ((buf = (char *) memchr (buf, '%', bufend - buf)) == NULL)
- break;
- else if (strncmp ("%%% Cygwin ", buf, CYGPREFIX) != 0)
- buf++;
- else
- {
- char *p = strchr (buf += CYGPREFIX, '\n');
- if (!p)
- break;
- if (strncasecmp (buf, "dll major:", 10) == 0)
- {
- dll_major = buf + 11;
- continue;
- }
- char *s, pbuf[80];
- int len;
- len = 1 + p - buf;
- if (strncasecmp (buf, "dll minor:", 10) != 0)
- s = buf;
- else
- {
- char c = dll_major[1];
- dll_major[1] = '\0';
- int maj = atoi (dll_major);
- dll_major[1] = c;
- int min = atoi (dll_major + 1);
- sprintf (pbuf, "DLL version: %d.%d.%.*s", maj, min, len - 11,
- buf + 11);
- len = strlen (s = pbuf);
- }
- if (strncmp (s, "dll", 3) == 0)
- memcpy (s, "DLL", 3);
- else if (strncmp (s, "api", 3) == 0)
- memcpy (s, "API", 3);
- else if (islower (*s))
- *s = toupper (*s);
- fprintf (stdout, "%s %.*s", hello, len, s);
- hello = "";
- }
-
- if (!*hello)
- puts ("");
-
- free (buf_start);
- return;
-}
-
-static void
-dll_info (const char *path, HANDLE fh, int lvl, int recurse)
-{
- DWORD junk;
- int i;
- int pe_header_offset = get_dword (fh, 0x3c);
- if (GetLastError () != NO_ERROR)
- display_error ("get_dword");
- int opthdr_ofs = pe_header_offset + 4 + 20;
- unsigned short v[6];
-
- if (path == NULL)
- {
- display_error ("dll_info: NULL passed for path", true, false);
- return;
- }
-
- if (SetFilePointer (fh, opthdr_ofs + 40, 0, FILE_BEGIN) ==
- INVALID_SET_FILE_POINTER && GetLastError () != NO_ERROR)
- display_error ("dll_info: SetFilePointer()");
-
- if (!ReadFile (fh, &v, sizeof (v), &junk, 0))
- display_error ("dll_info: Readfile()");
-
- if (verbose)
- printf (" - os=%d.%d img=%d.%d sys=%d.%d\n",
- v[0], v[1], v[2], v[3], v[4], v[5]);
- else
- printf ("\n");
-
- int num_entries = get_dword (fh, opthdr_ofs + 92);
- if (GetLastError () != NO_ERROR)
- display_error ("get_dword");
- int export_rva = get_dword (fh, opthdr_ofs + 96);
- if (GetLastError () != NO_ERROR)
- display_error ("get_dword");
- int export_size = get_dword (fh, opthdr_ofs + 100);
- if (GetLastError () != NO_ERROR)
- display_error ("get_dword");
- int import_rva = get_dword (fh, opthdr_ofs + 104);
- if (GetLastError () != NO_ERROR)
- display_error ("get_dword");
- int import_size = get_dword (fh, opthdr_ofs + 108);
- if (GetLastError () != NO_ERROR)
- display_error ("get_dword");
-
- int nsections = get_word (fh, pe_header_offset + 4 + 2);
- if (nsections == -1)
- display_error ("get_word");
- char *sections = (char *) malloc (nsections * 40);
-
- if (SetFilePointer (fh, pe_header_offset + 4 + 20 +
- get_word (fh, pe_header_offset + 4 + 16), 0,
- FILE_BEGIN) == INVALID_SET_FILE_POINTER
- && GetLastError () != NO_ERROR)
- display_error ("dll_info: SetFilePointer()");
-
- if (!ReadFile (fh, sections, nsections * 40, &junk, 0))
- display_error ("dll_info: Readfile()");
-
- if (verbose && num_entries >= 1 && export_size > 0)
- {
- int expsz;
- int expbase = rva_to_offset (export_rva, sections, nsections, &expsz);
-
- if (expbase)
- {
- if (SetFilePointer (fh, expbase, 0, FILE_BEGIN) ==
- INVALID_SET_FILE_POINTER && GetLastError () != NO_ERROR)
- display_error ("dll_info: SetFilePointer()");
-
- unsigned char *exp = (unsigned char *) malloc (expsz);
-
- if (!ReadFile (fh, exp, expsz, &junk, 0))
- display_error ("dll_info: Readfile()");
-
- ExpDirectory *ed = (ExpDirectory *) exp;
- int ofs = ed->name_rva - export_rva;
- struct tm *tm = localtime ((const time_t *) &(ed->timestamp));
- if (tm->tm_year < 60)
- tm->tm_year += 2000;
- if (tm->tm_year < 200)
- tm->tm_year += 1900;
- printf ("%*c", lvl + 2, ' ');
- printf ("\"%s\" v%d.%d ts=", exp + ofs,
- ed->major_ver, ed->minor_ver);
- printf ("%d/%d/%d %d:%02d\n",
- tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
- tm->tm_hour, tm->tm_min);
- }
- }
-
- if (num_entries >= 2 && import_size > 0 && recurse)
- {
- int impsz;
- int impbase = rva_to_offset (import_rva, sections, nsections, &impsz);
- if (impbase)
- {
- if (SetFilePointer (fh, impbase, 0, FILE_BEGIN) ==
- INVALID_SET_FILE_POINTER && GetLastError () != NO_ERROR)
- display_error ("dll_info: SetFilePointer()");
-
- unsigned char *imp = (unsigned char *) malloc (impsz);
- if (imp == NULL)
- {
- display_error ("dll_info: malloc()");
- return;
- }
-
- if (!ReadFile (fh, imp, impsz, &junk, 0))
- display_error ("dll_info: Readfile()");
-
- ImpDirectory *id = (ImpDirectory *) imp;
- for (i = 0; id[i].name_rva; i++)
- {
- /* int ofs = id[i].name_rva - import_rva; */
- track_down ((char *) imp + id[i].name_rva - import_rva,
- (char *) ".dll", lvl + 2);
- }
- }
- }
- if (strstr (path, "\\cygwin1.dll"))
- cygwin_info (fh);
-}
-
-// Return true on success, false if error printed
-static bool
-track_down (const char *file, const char *suffix, int lvl)
-{
- if (file == NULL)
- {
- display_error ("track_down: NULL passed for file", true, false);
- return false;
- }
-
- if (suffix == NULL)
- {
- display_error ("track_down: NULL passed for suffix", false, false);
- return false;
- }
-
- const char *path = find_on_path (file, suffix, false, true);
- if (!path)
- {
- display_error ("track_down: could not find %s\n", file);
- return false;
- }
-
- Did *d = already_did (file);
- switch (d->state)
- {
- case DID_NEW:
- break;
- case DID_ACTIVE:
- if (verbose)
- {
- if (lvl)
- printf ("%*c", lvl, ' ');
- printf ("%s", path);
- printf (" (recursive)\n");
- }
- return true;
- case DID_INACTIVE:
- if (verbose)
- {
- if (lvl)
- printf ("%*c", lvl, ' ');
- printf ("%s", path);
- printf (" (already done)\n");
- }
- return true;
- default:
- break;
- }
-
- if (lvl)
- printf ("%*c", lvl, ' ');
-
- if (!path)
- {
- display_error ("file not found - '%s'\n", file);
- return false;
- }
-
- printf ("%s", path);
-
- HANDLE fh =
- CreateFile (path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- if (fh == INVALID_HANDLE_VALUE)
- {
- display_error ("cannot open - '%s'\n", path);
- return false;
- }
-
- d->state = DID_ACTIVE;
-
- if (is_exe (fh))
- dll_info (path, fh, lvl, 1);
- else if (is_symlink (fh))
- display_error ("%s is a symlink instead of a DLL\n", path);
- else
- {
- int magic = get_word (fh, 0x0);
- if (magic == -1)
- display_error ("get_word");
- magic &= 0x00FFFFFF;
- display_error_fmt ("%s is not a DLL: magic number %x (%d) '%s'\n",
- path, magic, magic, (char *)&magic);
- }
-
- d->state = DID_INACTIVE;
- if (!CloseHandle (fh))
- display_error ("track_down: CloseHandle()");
- return true;
-}
-
-static void
-ls (char *f)
-{
- HANDLE h = CreateFile (f, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
- 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
- BY_HANDLE_FILE_INFORMATION info;
-
- if (!GetFileInformationByHandle (h, &info))
- display_error ("ls: GetFileInformationByHandle()");
-
- SYSTEMTIME systime;
-
- if (!FileTimeToSystemTime (&info.ftLastWriteTime, &systime))
- display_error ("ls: FileTimeToSystemTime()");
- printf ("%5dk %04d/%02d/%02d %s",
- (((int) info.nFileSizeLow) + 512) / 1024,
- systime.wYear, systime.wMonth, systime.wDay, f);
- dll_info (f, h, 16, 0);
- if (!CloseHandle (h))
- display_error ("ls: CloseHandle()");
-}
-
-/* Remove filename from 's' and return directory name without trailing
- backslash, or NULL if 's' doesn't seem to have a dirname. */
-static char *
-dirname (const char *s)
-{
- static char buf[MAX_PATH];
-
- if (!s)
- return NULL;
-
- strncpy (buf, s, MAX_PATH);
- buf[MAX_PATH - 1] = '\0'; // in case strlen(s) > MAX_PATH
- char *lastsep = strrchr (buf, '\\');
- if (!lastsep)
- return NULL; // no backslash -> no dirname
- else if (lastsep - buf <= 2 && buf[1] == ':')
- lastsep[1] = '\0'; // can't remove backslash of "x:\"
- else
- *lastsep = '\0';
- return buf;
-}
-
-// Find a real application on the path (possibly following symlinks)
-static const char *
-find_app_on_path (const char *app, bool showall = false)
-{
- const char *papp = find_on_path (app, ".exe", showall, false, true);
-
- HANDLE fh =
- CreateFile (papp, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- if (fh == INVALID_HANDLE_VALUE)
- return NULL;
-
- if (is_symlink (fh))
- {
- static char tmp[SYMLINK_MAX + 1];
- if (!readlink (fh, tmp, SYMLINK_MAX))
- display_error("readlink failed");
-
- /* Resolve the linkname relative to the directory of the link. */
- char *ptr = cygpath_rel (dirname (papp), tmp, NULL);
- printf (" -> %s\n", ptr);
- if (!strchr (ptr, '\\'))
- {
- char *lastsep;
- strncpy (tmp, cygpath (papp, NULL), SYMLINK_MAX);
- lastsep = strrchr (tmp, '\\');
- strncpy (lastsep+1, ptr, SYMLINK_MAX - (lastsep-tmp));
- ptr = tmp;
- }
- if (!CloseHandle (fh))
- display_error ("find_app_on_path: CloseHandle()");
- /* FIXME: We leak the ptr returned by cygpath() here which is a
- malloc()d string. */
- return find_app_on_path (ptr, showall);
- }
-
- if (!CloseHandle (fh))
- display_error ("find_app_on_path: CloseHandle()");
- return papp;
-}
-
-// Return true on success, false if error printed
-static bool
-cygcheck (const char *app)
-{
- const char *papp = find_app_on_path (app, 1);
- if (!papp)
- {
- display_error ("could not find '%s'\n", app);
- return false;
- }
-
- char *s;
- char *sep = strpbrk (papp, ":/\\");
- if (!sep)
- {
- static char dot[] = ".";
- s = dot;
- }
- else
- {
- int n = sep - papp;
- s = (char *) malloc (n + 2);
- memcpy ((char *) s, papp, n);
- strcpy (s + n, "\\");
- }
-
- paths[0].dir = s;
- did = NULL;
- return track_down (papp, ".exe", 0);
-}
-
-
-extern char **environ;
-
-struct RegInfo
-{
- RegInfo *prev;
- char *name;
- HKEY key;
-};
-
-static void
-show_reg (RegInfo * ri, int nest)
-{
- if (!ri)
- return;
- show_reg (ri->prev, 1);
- if (nest)
- printf ("%s\\", ri->name);
- else
- printf ("%s\n", ri->name);
-}
-
-static void
-scan_registry (RegInfo * prev, HKEY hKey, char *name, int cygnus)
-{
- RegInfo ri;
- ri.prev = prev;
- ri.name = name;
- ri.key = hKey;
-
- char *cp;
- for (cp = name; *cp; cp++)
- if (strncasecmp (cp, "cygnus", 6) == 0)
- cygnus = 1;
-
- DWORD num_subkeys, max_subkey_len, num_values;
- DWORD max_value_len, max_valdata_len, i;
- if (RegQueryInfoKey (hKey, 0, 0, 0, &num_subkeys, &max_subkey_len, 0,
- &num_values, &max_value_len, &max_valdata_len, 0, 0)
- != ERROR_SUCCESS)
- {
-#if 0
- char tmp[400];
- FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, 0, GetLastError (),
- MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), tmp, 400, 0);
- printf ("RegQueryInfoKey: %s\n", tmp);
-#endif
- return;
- }
-
- if (cygnus)
- {
- show_reg (&ri, 0);
-
- char *value_name = (char *) malloc (max_value_len + 1);
- if (value_name == NULL)
- {
- display_error ("scan_registry: malloc()");
- return;
- }
-
- char *value_data = (char *) malloc (max_valdata_len + 1);
- if (value_data == NULL)
- {
- display_error ("scan_registry: malloc()");
- return;
- }
-
- for (i = 0; i < num_values; i++)
- {
- DWORD dlen = max_valdata_len + 1;
- DWORD nlen = max_value_len + 1;
- DWORD type;
- RegEnumValue (hKey, i, value_name, &nlen, 0,
- &type, (BYTE *) value_data, &dlen);
- {
- printf (" %s = ", i ? value_name : "(default)");
- switch (type)
- {
- case REG_DWORD:
- printf ("0x%08x\n", *(unsigned *) value_data);
- break;
- case REG_EXPAND_SZ:
- case REG_SZ:
- printf ("'%s'\n", value_data);
- break;
- default:
- printf ("(unsupported type)\n");
- break;
- }
- }
- }
- free (value_name);
- free (value_data);
- }
-
- char *subkey_name = (char *) malloc (max_subkey_len + 1);
- for (i = 0; i < num_subkeys; i++)
- {
- if (RegEnumKey (hKey, i, subkey_name, max_subkey_len + 1) ==
- ERROR_SUCCESS)
- {
- HKEY sKey;
- if (RegOpenKeyEx (hKey, subkey_name, 0, KEY_READ, &sKey)
- == ERROR_SUCCESS)
- {
- scan_registry (&ri, sKey, subkey_name, cygnus);
- if (RegCloseKey (sKey) != ERROR_SUCCESS)
- display_error ("scan_registry: RegCloseKey()");
- }
- }
- }
- free (subkey_name);
-}
-
-void
-pretty_id (const char *s, char *cygwin, size_t cyglen)
-{
- char *groups[16384];
-
- strcpy (cygwin + cyglen++, " ");
- strcpy (cygwin + cyglen, s);
- putenv (cygwin);
-
- char *id = cygpath ("/bin/id.exe", NULL);
- for (char *p = id; (p = strchr (p, '/')); p++)
- *p = '\\';
-
- if (access (id, X_OK))
- {
- fprintf (stderr, "'id' program not found\n");
- return;
- }
-
- FILE *f = popen (id, "rt");
-
- char buf[16384];
- buf[0] = '\0';
- fgets (buf, sizeof (buf), f);
- pclose (f);
- char *uid = strtok (buf, ")");
- if (uid)
- uid += strlen ("uid=");
- else
- {
- fprintf (stderr, "garbled output from 'id' command - no uid= found\n");
- return;
- }
- char *gid = strtok (NULL, ")");
- if (gid)
- gid += strlen ("gid=") + 1;
- else
- {
- fprintf (stderr, "garbled output from 'id' command - no gid= found\n");
- return;
- }
-
- char **ng = groups - 1;
- size_t len_uid = strlen ("UID: )") + strlen (uid);
- size_t len_gid = strlen ("GID: )") + strlen (gid);
- *++ng = groups[0] = (char *) alloca (len_uid + 1);
- *++ng = groups[1] = (char *) alloca (len_gid + 1);
- sprintf (groups[0], "UID: %s)", uid);
- sprintf (groups[1], "GID: %s)", gid);
- size_t sz = max (len_uid, len_gid);
- while ((*++ng = strtok (NULL, ",")))
- {
- char *p = strchr (*ng, '\n');
- if (p)
- *p = '\0';
- if (ng == groups + 2)
- *ng += strlen (" groups=");
- size_t len = strlen (*ng);
- if (sz < len)
- sz = len;
- }
- ng--;
-
- printf ("\nOutput from %s (%s)\n", id, s);
- int n = 80 / (int) ++sz;
- int i = n > 2 ? n - 2 : 0;
- sz = -sz;
- for (char **g = groups; g <= ng; g++)
- if ((g != ng) && (++i < n))
- printf ("%*s", sz, *g);
- else
- {
- puts (*g);
- i = 0;
- }
-}
-
-/* This dumps information about each installed cygwin service, if cygrunsrv
- is available. */
-void
-dump_sysinfo_services ()
-{
- char buf[1024];
- char buf2[1024];
- FILE *f;
- bool no_services = false;
-
- if (givehelp)
- printf ("\nChecking for any Cygwin services... %s\n\n",
- verbose ? "" : "(use -v for more detail)");
- else
- fputc ('\n', stdout);
-
- /* find the location of cygrunsrv.exe */
- char *cygrunsrv = cygpath ("/bin/cygrunsrv.exe", NULL);
- for (char *p = cygrunsrv; (p = strchr (p, '/')); p++)
- *p = '\\';
-
- if (access (cygrunsrv, X_OK))
- {
- puts ("Can't find the cygrunsrv utility, skipping services check.\n");
- return;
- }
-
- /* check for a recent cygrunsrv */
- snprintf (buf, sizeof (buf), "%s --version", cygrunsrv);
- if ((f = popen (buf, "rt")) == NULL)
- {
- printf ("Failed to execute '%s', skipping services check.\n", buf);
- return;
- }
- int maj, min;
- int ret = fscanf (f, "cygrunsrv V%u.%u", &maj, &min);
- if (ferror (f) || feof (f) || ret == EOF || maj < 1 || min < 10)
- {
- puts ("The version of cygrunsrv installed is too old to dump service info.\n");
- return;
- }
- fclose (f);
-
- /* For verbose mode, just run cygrunsrv --list --verbose and copy output
- verbatim; otherwise run cygrunsrv --list and then cygrunsrv --query for
- each service. */
- snprintf (buf, sizeof (buf), (verbose ? "%s --list --verbose" : "%s --list"),
- cygrunsrv);
- if ((f = popen (buf, "rt")) == NULL)
- {
- printf ("Failed to execute '%s', skipping services check.\n", buf);
- return;
- }
-
- if (verbose)
- {
- /* copy output to stdout */
- size_t nchars = 0;
- while (!feof (f) && !ferror (f))
- nchars += fwrite ((void *) buf, 1,
- fread ((void *) buf, 1, sizeof (buf), f), stdout);
-
- /* cygrunsrv outputs nothing if there are no cygwin services found */
- if (nchars < 1)
- no_services = true;
- pclose (f);
- }
- else
- {
- /* read the output of --list, and then run --query for each service */
- size_t nchars = fread ((void *) buf, 1, sizeof (buf) - 1, f);
- buf[nchars] = 0;
- pclose (f);
-
- if (nchars > 0)
- for (char *srv = strtok (buf, "\n"); srv; srv = strtok (NULL, "\n"))
- {
- snprintf (buf2, sizeof (buf2), "%s --query %s", cygrunsrv, srv);
- if ((f = popen (buf2, "rt")) == NULL)
- {
- printf ("Failed to execute '%s', skipping services check.\n", buf2);
- return;
- }
-
- /* copy output to stdout */
- while (!feof (f) && !ferror (f))
- fwrite ((void *) buf2, 1,
- fread ((void *) buf2, 1, sizeof (buf2), f), stdout);
- pclose (f);
- }
- else
- no_services = true;
- }
-
- /* inform the user if nothing found */
- if (no_services)
- puts ("No Cygwin services found.\n");
-}
-
-static void
-dump_sysinfo ()
-{
- int i, j;
- char tmp[4000];
- time_t now;
- char *found_cygwin_dll;
- bool is_nt = false;
- bool more_info = true;
- char osname[80];
-
- printf ("\nCygwin Configuration Diagnostics\n");
- time (&now);
- printf ("Current System Time: %s\n", ctime (&now));
-
- OSVERSIONINFOEX osversion;
- osversion.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
- if (!GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&osversion)))
- {
- more_info = false;
- osversion.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
- if (!GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&osversion)))
- display_error ("dump_sysinfo: GetVersionEx()");
- }
-
- HMODULE k32 = LoadLibrary ("kernel32.dll");
-
- switch (osversion.dwPlatformId)
- {
- case VER_PLATFORM_WIN32s:
- strcpy (osname, "32s (not supported)");
- break;
- case VER_PLATFORM_WIN32_WINDOWS:
- strcpy (osname, "95/98/Me (not supported)");
- break;
- case VER_PLATFORM_WIN32_NT:
- is_nt = true;
- if (osversion.dwMajorVersion == 6)
- {
- BOOL (WINAPI *GetProductInfo) (DWORD, DWORD, DWORD, DWORD, PDWORD) =
- (BOOL (WINAPI *)(DWORD, DWORD, DWORD, DWORD, PDWORD))
- GetProcAddress (k32, "GetProductInfo");
- if (osversion.wProductType == VER_NT_WORKSTATION)
- strcpy (osname, "Vista");
- else
- strcpy (osname, "2008");
- DWORD prod;
- if (GetProductInfo (osversion.dwMajorVersion,
- osversion.dwMinorVersion,
- osversion.wServicePackMajor,
- osversion.wServicePackMinor,
- &prod))
- {
-#define PRODUCT_UNLICENSED 0xabcdabcd
-#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x19
- const char *products[] =
- {
- "",
- " Ultimate Edition",
- " Home Basic Edition",
- " Home Premium Edition",
- " Enterprise Edition",
- " Home Basic N Edition",
- " Business Edition",
- " Server Standard Edition",
- " Server Datacenter Edition",
- " Small Business Server",
- " Server Enterprise Edition",
- " Starter Edition",
- " Server Datacenter Edition Core",
- " Server Standard Edition Core",
- " Server Enterprise Edition Core",
- " Server Enterprise Edition for Itanium-based Systems",
- " Business N Edition",
- " Web Server Edition",
- " Cluster Server Edition",
- " Home Server Edition",
- " Storage Server Express Edition",
- " Storage Server Standard Edition",
- " Storage Server Workgroup Edition",
- " Storage Server Enterprise Edition",
- " Server for Small Business Edition",
- " Small Business Server Premium Edition"
- };
- if (prod == PRODUCT_UNLICENSED)
- strcat (osname, "Unlicensed");
- else if (prod > PRODUCT_SMALLBUSINESS_SERVER_PREMIUM)
- strcat (osname, "");
- else
- strcat (osname, products[prod]);
- }
- else
- {
- }
- }
- else if (osversion.dwMajorVersion == 5)
- {
- if (osversion.dwMinorVersion == 0)
- {
- strcpy (osname, "2000");
- if (osversion.wProductType == VER_NT_WORKSTATION)
- strcat (osname, " Professional");
- else if (osversion.wSuiteMask & VER_SUITE_DATACENTER)
- strcat (osname, " Datacenter Server");
- else if (osversion.wSuiteMask & VER_SUITE_ENTERPRISE)
- strcat (osname, " Advanced Server");
- else
- strcat (osname, " Server");
- }
- else if (osversion.dwMinorVersion == 1)
- {
- strcpy (osname, "XP");
- if (GetSystemMetrics (SM_MEDIACENTER))
- strcat (osname, " Media Center Edition");
- else if (GetSystemMetrics (SM_TABLETPC))
- strcat (osname, " Tablet PC Edition");
- else if (GetSystemMetrics (SM_STARTER))
- strcat (osname, " Starter Edition");
- else if (osversion.wSuiteMask & VER_SUITE_PERSONAL)
- strcat (osname, " Home Edition");
- else
- strcat (osname, " Professional");
- }
- else if (osversion.dwMinorVersion == 2)
- {
- strcpy (osname, "2003 Server");
- if (GetSystemMetrics (SM_SERVERR2))
- strcat (osname, " R2");
- if (osversion.wSuiteMask & VER_SUITE_BLADE)
- strcat (osname, " Web Edition");
- else if (osversion.wSuiteMask & VER_SUITE_DATACENTER)
- strcat (osname, " Datacenter Edition");
- else if (osversion.wSuiteMask & VER_SUITE_ENTERPRISE)
- strcat (osname, " Enterprise Edition");
- else if (osversion.wSuiteMask & VER_SUITE_COMPUTE_SERVER)
- strcat (osname, " Compute Cluster Edition");
- }
- }
- else if (osversion.dwMajorVersion == 4)
- {
- strcpy (osname, "NT 4");
- if (more_info)
- {
- if (osversion.wProductType == VER_NT_WORKSTATION)
- strcat (osname, " Workstation");
- else
- {
- strcat (osname, " Server");
- if (osversion.wSuiteMask & VER_SUITE_ENTERPRISE)
- strcat (osname, " Enterprise Edition");
- }
- }
- }
- else
- strcpy (osname, "NT");
- break;
- default:
- strcpy (osname, "??");
- break;
- }
- printf ("Windows %s Ver %lu.%lu Build %lu %s\n", osname,
- osversion.dwMajorVersion, osversion.dwMinorVersion,
- osversion.dwPlatformId == VER_PLATFORM_WIN32_NT ?
- osversion.dwBuildNumber : (osversion.dwBuildNumber & 0xffff),
- osversion.dwPlatformId == VER_PLATFORM_WIN32_NT ?
- osversion.szCSDVersion : "");
-
- if (osversion.dwPlatformId == VER_PLATFORM_WIN32s
- || osversion.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
- exit (EXIT_FAILURE);
-
- BOOL (WINAPI *wow64_func) (HANDLE, PBOOL) = (BOOL (WINAPI *) (HANDLE, PBOOL))
- GetProcAddress (k32, "IsWow64Process");
- BOOL is_wow64 = FALSE;
- if (wow64_func && wow64_func (GetCurrentProcess (), &is_wow64) && is_wow64)
- {
- void (WINAPI *nativinfo) (LPSYSTEM_INFO) = (void (WINAPI *)
- (LPSYSTEM_INFO)) GetProcAddress (k32, "GetNativeSystemInfo");
- SYSTEM_INFO natinfo;
- nativinfo (&natinfo);
- fputs ("\nRunning under WOW64 on ", stdout);
- switch (natinfo.wProcessorArchitecture)
- {
- case PROCESSOR_ARCHITECTURE_IA64:
- puts ("IA64");
- break;
- case PROCESSOR_ARCHITECTURE_AMD64:
- puts ("AMD64");
- break;
- default:
- puts("??");
- break;
- }
- }
-
- if (GetSystemMetrics (SM_REMOTESESSION))
- printf ("\nRunning in Terminal Service session\n");
-
- printf ("\nPath:");
- char *s = getenv ("PATH"), *e;
- if (!s)
- puts ("");
- else
- {
- char sep = strchr (s, ';') ? ';' : ':';
- int count_path_items = 0;
- while (1)
- {
- for (e = s; *e && *e != sep; e++);
- if (e-s)
- printf ("\t%.*s\n", e - s, s);
- else
- puts ("\t.");
- count_path_items++;
- if (!*e)
- break;
- s = e + 1;
- }
- }
-
- fflush (stdout);
-
- char *cygwin = getenv ("CYGWIN");
- if (cygwin)
- cygwin -= strlen ("CYGWIN=");
- else
- cygwin = const_cast <char *> ("CYGWIN=");
- size_t cyglen = strlen (cygwin);
- cygwin = strcpy ((char *) malloc (cyglen + sizeof (" nontsec")), cygwin);
- pretty_id ("nontsec", cygwin, cyglen);
- pretty_id ("ntsec", cygwin, cyglen);
- cygwin[cyglen] = 0;
- putenv (cygwin);
-
- if (!GetSystemDirectory (tmp, 4000))
- display_error ("dump_sysinfo: GetSystemDirectory()");
- printf ("\nSysDir: %s\n", tmp);
-
- GetWindowsDirectory (tmp, 4000);
- printf ("WinDir: %s\n\n", tmp);
-
-
- if (givehelp)
- printf ("Here's some environment variables that may affect cygwin:\n");
- for (i = 0; environ[i]; i++)
- {
- char *eq = strchr (environ[i], '=');
- if (!eq)
- continue;
- /* int len = eq - environ[i]; */
- for (j = 0; known_env_vars[j]; j++)
- {
- *eq = 0;
- if (strcmp (environ[i], "PATH") == 0)
- continue; /* we handle this one specially */
- if (strcasecmp (environ[i], known_env_vars[j]) == 0)
- printf ("%s = '%s'\n", environ[i], eq + 1);
- *eq = '=';
- }
- }
- printf ("\n");
-
- if (verbose)
- {
- if (givehelp)
- printf ("Here's the rest of your environment variables:\n");
- for (i = 0; environ[i]; i++)
- {
- int found = 0;
- char *eq = strchr (environ[i], '=');
- if (!eq)
- continue;
- /* int len = eq - environ[i]; */
- for (j = 0; known_env_vars[j]; j++)
- {
- *eq = 0;
- if (strcasecmp (environ[i], known_env_vars[j]) == 0)
- found = 1;
- *eq = '=';
- }
- if (!found)
- {
- *eq = 0;
- printf ("%s = '%s'\n", environ[i], eq + 1);
- *eq = '=';
- }
- }
- printf ("\n");
- }
-
- if (registry)
- {
- if (givehelp)
- printf ("Scanning registry for keys with 'Cygnus' in them...\n");
-#if 0
- /* big and not generally useful */
- scan_registry (0, HKEY_CLASSES_ROOT, (char *) "HKEY_CLASSES_ROOT", 0);
-#endif
- scan_registry (0, HKEY_CURRENT_CONFIG,
- (char *) "HKEY_CURRENT_CONFIG", 0);
- scan_registry (0, HKEY_CURRENT_USER, (char *) "HKEY_CURRENT_USER", 0);
- scan_registry (0, HKEY_LOCAL_MACHINE, (char *) "HKEY_LOCAL_MACHINE", 0);
-#if 0
- /* the parts we need are duplicated in HKEY_CURRENT_USER anyway */
- scan_registry (0, HKEY_USERS, (char *) "HKEY_USERS", 0);
-#endif
- printf ("\n");
- }
- else
- printf ("Use '-r' to scan registry\n\n");
-
- if (givehelp)
- {
- printf ("Listing available drives...\n");
- printf ("Drv Type Size Used Flags Name\n");
- }
- int prev_mode =
- SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
- int drivemask = GetLogicalDrives ();
-
- BOOL (WINAPI * gdfse) (LPCSTR, long long *, long long *, long long *) =
- (BOOL (WINAPI *) (LPCSTR, long long *, long long *, long long *))
- GetProcAddress (k32, "GetDiskFreeSpaceExA");
-
- for (i = 0; i < 26; i++)
- {
- if (!(drivemask & (1 << i)))
- continue;
- char drive[4], name[200], fsname[200];
- DWORD serno = 0, maxnamelen = 0, flags = 0;
- name[0] = name[0] = fsname[0] = 0;
- sprintf (drive, "%c:\\", i + 'a');
- /* Report all errors, except if the Volume is ERROR_NOT_READY.
- ERROR_NOT_READY is returned when removeable media drives are empty
- (CD, floppy, etc.) */
- if (!GetVolumeInformation (drive, name, sizeof (name), &serno,
- &maxnamelen, &flags, fsname,
- sizeof (fsname))
- && GetLastError () != ERROR_NOT_READY)
- {
-# define FMT "dump_sysinfo: GetVolumeInformation() for drive %c:"
- char buf[sizeof (FMT)];
- sprintf (buf, FMT, 'A' + i);
- display_error (buf);
-# undef FMT
- }
-
- int dtype = GetDriveType (drive);
- char drive_type[4] = "unk";
- switch (dtype)
- {
- case DRIVE_REMOVABLE:
- strcpy (drive_type, "fd ");
- break;
- case DRIVE_FIXED:
- strcpy (drive_type, "hd ");
- break;
- case DRIVE_REMOTE:
- strcpy (drive_type, "net");
- break;
- case DRIVE_CDROM:
- strcpy (drive_type, "cd ");
- break;
- case DRIVE_RAMDISK:
- strcpy (drive_type, "ram");
- break;
- default:
- strcpy (drive_type, "unk");
- }
-
- long capacity_mb = -1;
- int percent_full = -1;
-
- long long free_me = 0ULL, free_bytes = 0ULL, total_bytes = 1ULL;
- if (gdfse != NULL && gdfse (drive, &free_me, &total_bytes, &free_bytes))
- {
- capacity_mb = total_bytes / (1024L * 1024L);
- percent_full = 100 - (int) ((100.0 * free_me) / total_bytes);
- }
- else
- {
- DWORD spc = 0, bps = 0, fc = 0, tc = 1;
- if (GetDiskFreeSpace (drive, &spc, &bps, &fc, &tc))
- {
- capacity_mb = (spc * bps * tc) / (1024 * 1024);
- percent_full = 100 - (int) ((100.0 * fc) / tc);
- }
- }
-
- printf ("%.2s %s %-6s ", drive, drive_type, fsname);
- if (capacity_mb >= 0)
- printf ("%7dMb %3d%% ", (int) capacity_mb, (int) percent_full);
- else
- printf (" N/A N/A ");
- printf ("%s %s %s %s %s %s %s\n",
- flags & FS_CASE_IS_PRESERVED ? "CP" : " ",
- flags & FS_CASE_SENSITIVE ? "CS" : " ",
- flags & FS_UNICODE_STORED_ON_DISK ? "UN" : " ",
- flags & FS_PERSISTENT_ACLS ? "PA" : " ",
- flags & FS_FILE_COMPRESSION ? "FC" : " ",
- flags & FS_VOL_IS_COMPRESSED ? "VC" : " ",
-#if 0
- flags & FILE_SUPPORTS_ENCRYPTION ? "EN" : " ",
- flags & FILE_SUPPORTS_OBJECT_IDS ? "OI" : " ",
- flags & FILE_SUPPORTS_REPARSE_POINTS ? "RP" : " ",
- flags & FILE_SUPPORTS_SPARSE_FILES ? "SP" : " ",
- flags & FILE_VOLUME_QUOTAS ? "QU" : " ",
-#endif
- name);
- }
-
- if (!FreeLibrary (k32))
- display_error ("dump_sysinfo: FreeLibrary()");
- SetErrorMode (prev_mode);
- if (givehelp)
- {
- puts ("\n"
- "fd = floppy, hd = hard drive, cd = CD-ROM\n"
- "net= Network Share, ram= RAM drive, unk= Unknown\n"
- "CP = Case Preserving, CS = Case Sensitive, UN = Unicode\n"
- "PA = Persistent ACLS, FC = File Compression, VC = Volume Compression");
- }
- printf ("\n");
-
- unsigned ml_fsname = 4, ml_dir = 7, ml_type = 6;
- bool ml_trailing = false;
-
- struct mntent *mnt;
- setmntent (0, 0);
- while ((mnt = getmntent (0)))
- {
- unsigned n = (int) strlen (mnt->mnt_fsname);
- ml_trailing |= (n > 1 && strchr ("\\/", mnt->mnt_fsname[n - 1]));
- if (ml_fsname < n)
- ml_fsname = n;
- n = (int) strlen (mnt->mnt_dir);
- ml_trailing |= (n > 1 && strchr ("\\/", mnt->mnt_dir[n - 1]));
- if (ml_dir < n)
- ml_dir = n;
- }
-
- if (ml_trailing)
- puts ("Warning: Mount entries should not have a trailing (back)slash\n");
-
- if (givehelp)
- {
- printf
- ("Mount entries: these map POSIX directories to your NT drives.\n");
- printf ("%-*s %-*s %-*s %s\n", ml_fsname, "-NT-", ml_dir, "-POSIX-",
- ml_type, "-Type-", "-Flags-");
- }
-
- setmntent (0, 0);
- while ((mnt = getmntent (0)))
- {
- printf ("%-*s %-*s %-*s %s\n",
- ml_fsname, mnt->mnt_fsname,
- ml_dir, mnt->mnt_dir, ml_type, mnt->mnt_type, mnt->mnt_opts);
- }
- printf ("\n");
-
- if (givehelp)
- printf
- ("Looking to see where common programs can be found, if at all...\n");
- for (i = 0; common_apps[i].name; i++)
- if (!find_app_on_path ((char *) common_apps[i].name, 1))
- {
- if (common_apps[i].missing_is_good)
- printf ("Not Found: %s (good!)\n", common_apps[i].name);
- else
- printf ("Not Found: %s\n", common_apps[i].name);
- }
- printf ("\n");
-
- if (givehelp)
- printf ("Looking for various Cygwin DLLs... (-v gives version info)\n");
- int cygwin_dll_count = 0;
- char cygdll_path[32768];
- for (pathlike *pth = paths; pth->dir; pth++)
- {
- WIN32_FIND_DATA ffinfo;
- sprintf (tmp, "%s*.*", pth->dir);
- HANDLE ff = FindFirstFile (tmp, &ffinfo);
- int found = (ff != INVALID_HANDLE_VALUE);
- found_cygwin_dll = NULL;
- while (found)
- {
- char *f = ffinfo.cFileName;
- if (strcasecmp (f + strlen (f) - 4, ".dll") == 0)
- {
- if (strncasecmp (f, "cyg", 3) == 0)
- {
- sprintf (tmp, "%s%s", pth->dir, f);
- if (strcasecmp (f, "cygwin1.dll") == 0)
- {
- if (!cygwin_dll_count)
- strcpy (cygdll_path, pth->dir);
- if (!cygwin_dll_count
- || strcasecmp (cygdll_path, pth->dir) != 0)
- cygwin_dll_count++;
- found_cygwin_dll = strdup (tmp);
- }
- else
- ls (tmp);
- }
- }
- found = FindNextFile (ff, &ffinfo);
- }
- if (found_cygwin_dll)
- {
- ls (found_cygwin_dll);
- free (found_cygwin_dll);
- }
-
- FindClose (ff);
- }
- if (cygwin_dll_count > 1)
- puts ("Warning: There are multiple cygwin1.dlls on your path");
- if (!cygwin_dll_count)
- puts ("Warning: cygwin1.dll not found on your path");
-
- dump_dodgy_apps (verbose);
-
- if (is_nt)
- dump_sysinfo_services ();
-}
-
-static int
-check_keys ()
-{
- HANDLE h = CreateFileA ("CONIN$", GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
- OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-
- if (h == INVALID_HANDLE_VALUE || h == NULL)
- return (display_error ("check_keys: Opening CONIN$"));
-
- DWORD mode;
-
- if (!GetConsoleMode (h, &mode))
- display_error ("check_keys: GetConsoleMode()");
- else
- {
- mode &= ~ENABLE_PROCESSED_INPUT;
- if (!SetConsoleMode (h, mode))
- display_error ("check_keys: SetConsoleMode()");
- }
-
- fputs ("\nThis key check works only in a console window,", stderr);
- fputs (" _NOT_ in a terminal session!\n", stderr);
- fputs ("Abort with Ctrl+C if in a terminal session.\n\n", stderr);
- fputs ("Press 'q' to exit.\n", stderr);
-
- INPUT_RECORD in, prev_in;
-
- // Drop first <RETURN> key
- ReadConsoleInput (h, &in, 1, &mode);
-
- memset (&in, 0, sizeof in);
-
- do
- {
- prev_in = in;
- if (!ReadConsoleInput (h, &in, 1, &mode))
- display_error ("check_keys: ReadConsoleInput()");
-
- if (!memcmp (&in, &prev_in, sizeof in))
- continue;
-
- switch (in.EventType)
- {
- case KEY_EVENT:
- printf ("%s %ux VK: 0x%02x VS: 0x%02x A: 0x%02x CTRL: ",
- in.Event.KeyEvent.bKeyDown ? "Pressed " : "Released",
- in.Event.KeyEvent.wRepeatCount,
- in.Event.KeyEvent.wVirtualKeyCode,
- in.Event.KeyEvent.wVirtualScanCode,
- (unsigned char) in.Event.KeyEvent.uChar.AsciiChar);
- fputs (in.Event.KeyEvent.dwControlKeyState & CAPSLOCK_ON ?
- "CL " : "-- ", stdout);
- fputs (in.Event.KeyEvent.dwControlKeyState & ENHANCED_KEY ?
- "EK " : "-- ", stdout);
- fputs (in.Event.KeyEvent.dwControlKeyState & LEFT_ALT_PRESSED ?
- "LA " : "-- ", stdout);
- fputs (in.Event.KeyEvent.dwControlKeyState & LEFT_CTRL_PRESSED ?
- "LC " : "-- ", stdout);
- fputs (in.Event.KeyEvent.dwControlKeyState & NUMLOCK_ON ?
- "NL " : "-- ", stdout);
- fputs (in.Event.KeyEvent.dwControlKeyState & RIGHT_ALT_PRESSED ?
- "RA " : "-- ", stdout);
- fputs (in.Event.KeyEvent.dwControlKeyState & RIGHT_CTRL_PRESSED ?
- "RC " : "-- ", stdout);
- fputs (in.Event.KeyEvent.dwControlKeyState & SCROLLLOCK_ON ?
- "SL " : "-- ", stdout);
- fputs (in.Event.KeyEvent.dwControlKeyState & SHIFT_PRESSED ?
- "SH " : "-- ", stdout);
- fputc ('\n', stdout);
- break;
-
- default:
- break;
- }
- }
- while (in.EventType != KEY_EVENT ||
- in.Event.KeyEvent.bKeyDown != FALSE ||
- in.Event.KeyEvent.uChar.AsciiChar != 'q');
-
- CloseHandle (h);
- return 0;
-}
-
-/* RFC1738 says that these do not need to be escaped. */
-static const char safe_chars[] = "$-_.+!*'(),";
-
-/* the URL to query. */
-static const char base_url[] =
- "http://cygwin.com/cgi-bin2/package-grep.cgi?text=1&grep=";
-
-/* Queries Cygwin web site for packages containing files matching a regexp.
- Return value is 1 if there was a problem, otherwise 0. */
-static int
-package_grep (char *search)
-{
- char buf[1024];
-
- /* Attempt to dynamically load the necessary WinInet API functions so that
- cygcheck can still function on older systems without IE. */
- HMODULE hWinInet;
- if (!(hWinInet = LoadLibrary ("wininet.dll")))
- {
- fputs ("Unable to locate WININET.DLL. This feature requires Microsoft "
- "Internet Explorer v3 or later to function.\n", stderr);
- return 1;
- }
-
- /* InternetCloseHandle is used outside this function so it is declared
- global. The rest of these functions are only used here, so declare them
- and call GetProcAddress for each of them with the following macro. */
-
- pInternetCloseHandle = (BOOL (WINAPI *) (HINTERNET))
- GetProcAddress (hWinInet, "InternetCloseHandle");
-#define make_func_pointer(name, ret, args) ret (WINAPI * p##name) args = \
- (ret (WINAPI *) args) GetProcAddress (hWinInet, #name);
- make_func_pointer (InternetAttemptConnect, DWORD, (DWORD));
- make_func_pointer (InternetOpenA, HINTERNET, (LPCSTR, DWORD, LPCSTR, LPCSTR,
- DWORD));
- make_func_pointer (InternetOpenUrlA, HINTERNET, (HINTERNET, LPCSTR, LPCSTR,
- DWORD, DWORD, DWORD));
- make_func_pointer (InternetReadFile, BOOL, (HINTERNET, PVOID, DWORD, PDWORD));
- make_func_pointer (HttpQueryInfoA, BOOL, (HINTERNET, DWORD, PVOID, PDWORD,
- PDWORD));
-#undef make_func_pointer
-
- if(!pInternetCloseHandle || !pInternetAttemptConnect || !pInternetOpenA
- || !pInternetOpenUrlA || !pInternetReadFile || !pHttpQueryInfoA)
- {
- fputs ("Unable to load one or more functions from WININET.DLL. This "
- "feature requires Microsoft Internet Explorer v3 or later to "
- "function.\n", stderr);
- return 1;
- }
-
- /* construct the actual URL by escaping */
- char *url = (char *) alloca (sizeof (base_url) + strlen (search) * 3);
- strcpy (url, base_url);
-
- char *dest;
- for (dest = &url[sizeof (base_url) - 1]; *search; search++)
- {
- if (isalnum (*search)
- || memchr (safe_chars, *search, sizeof (safe_chars) - 1))
- {
- *dest++ = *search;
- }
- else
- {
- *dest++ = '%';
- sprintf (dest, "%02x", (unsigned char) *search);
- dest += 2;
- }
- }
- *dest = 0;
-
- /* Connect to the net and open the URL. */
- if (pInternetAttemptConnect (0) != ERROR_SUCCESS)
- {
- fputs ("An internet connection is required for this function.\n", stderr);
- return 1;
- }
-
- /* Initialize WinInet and attempt to fetch our URL. */
- HINTERNET hi = NULL, hurl = NULL;
- if (!(hi = pInternetOpenA ("cygcheck", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0)))
- return display_internet_error ("InternetOpen() failed", NULL);
-
- if (!(hurl = pInternetOpenUrlA (hi, url, NULL, 0, 0, 0)))
- return display_internet_error ("unable to contact cygwin.com site, "
- "InternetOpenUrl() failed", hi, NULL);
-
- /* Check the HTTP response code. */
- DWORD rc = 0, rc_s = sizeof (DWORD);
- if (!pHttpQueryInfoA (hurl, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER,
- (void *) &rc, &rc_s, NULL))
- return display_internet_error ("HttpQueryInfo() failed", hurl, hi, NULL);
-
- if (rc != HTTP_STATUS_OK)
- {
- sprintf (buf, "error retrieving results from cygwin.com site, "
- "HTTP status code %lu", rc);
- return display_internet_error (buf, hurl, hi, NULL);
- }
-
- /* Fetch result and print to stdout. */
- DWORD numread;
- do
- {
- if (!pInternetReadFile (hurl, (void *) buf, sizeof (buf), &numread))
- return display_internet_error ("InternetReadFile failed", hurl, hi, NULL);
- if (numread)
- fwrite ((void *) buf, (size_t) numread, 1, stdout);
- }
- while (numread);
-
- pInternetCloseHandle (hurl);
- pInternetCloseHandle (hi);
- return 0;
-}
-
-static void
-usage (FILE * stream, int status)
-{
- fprintf (stream, "\
-Usage: cygcheck PROGRAM [ -v ] [ -h ]\n\
- cygcheck -c [ PACKAGE ] [ -d ]\n\
- cygcheck -s [ -r ] [ -v ] [ -h ]\n\
- cygcheck -k\n\
- cygcheck -f FILE [ FILE ... ]\n\
- cygcheck -l [ PACKAGE ] [ PACKAGE ... ]\n\
- cygcheck -p REGEXP\n\
-List system information, check installed packages, or query package database.\n\
-\n\
-At least one command option or a PROGRAM is required, as shown above.\n\
-\n\
- PROGRAM list library (DLL) dependencies of PROGRAM\n\
- -c, --check-setup show installed version of PACKAGE and verify integrity\n\
- (or for all installed packages if none specified)\n\
- -d, --dump-only just list packages, do not verify (with -c)\n\
- -s, --sysinfo produce diagnostic system information (implies -c -d)\n\
- -r, --registry also scan registry for Cygwin settings (with -s)\n\
- -k, --keycheck perform a keyboard check session (must be run from a\n\
- plain console only, not from a pty/rxvt/xterm)\n\
- -f, --find-package find the package that FILE belongs to\n\
- -l, --list-package list contents of PACKAGE (or all packages if none given)\n\
- -p, --package-query search for REGEXP in the entire cygwin.com package\n\
- repository (requies internet connectivity)\n\
- -v, --verbose produce more verbose output\n\
- -h, --help annotate output with explanatory comments when given\n\
- with another command, otherwise print this help\n\
- -V, --version print the version of cygcheck and exit\n\
-\n\
-Note: -c, -f, and -l only report on packages that are currently installed. To\n\
- search all official Cygwin packages use -p instead. The -p REGEXP matches\n\
- package names, descriptions, and names of files/paths within all packages.\n\
-\n");
- exit (status);
-}
-
-struct option longopts[] = {
- {"check-setup", no_argument, NULL, 'c'},
- {"dump-only", no_argument, NULL, 'd'},
- {"sysinfo", no_argument, NULL, 's'},
- {"registry", no_argument, NULL, 'r'},
- {"verbose", no_argument, NULL, 'v'},
- {"keycheck", no_argument, NULL, 'k'},
- {"find-package", no_argument, NULL, 'f'},
- {"list-package", no_argument, NULL, 'l'},
- {"package-query", no_argument, NULL, 'p'},
- {"help", no_argument, NULL, 'h'},
- {"version", no_argument, 0, 'V'},
- {0, no_argument, NULL, 0}
-};
-
-static char opts[] = "cdsrvkflphV";
-
-static void
-print_version ()
-{
- const char *v = strchr (version, ':');
- int len;
- if (!v)
- {
- v = "?";
- len = 1;
- }
- else
- {
- v += 2;
- len = strchr (v, ' ') - v;
- }
- printf ("\
-cygcheck version %.*s\n\
-System Checker for Cygwin\n\
-Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Red Hat, Inc.\n\
-Compiled on %s\n\
-", len, v, __DATE__);
-}
-
-void
-nuke (char *ev)
-{
- int n = 1 + strchr (ev, '=') - ev;
- char *s = (char *) alloca (n + 1);
- memcpy (s, ev, n);
- s[n] = '\0';
- putenv (s);
-}
-
-extern "C" {
-unsigned long (*cygwin_internal) (int, ...);
-};
-
-static void
-load_cygwin (int& argc, char **&argv)
-{
- HMODULE h;
-
- if (!(h = LoadLibrary ("cygwin1.dll")))
- return;
- if ((cygwin_internal = (DWORD (*) (int, ...)) GetProcAddress (h, "cygwin_internal")))
- {
- char **av = (char **) cygwin_internal (CW_ARGV);
- if (av && ((DWORD) av != (DWORD) -1))
- {
- /* Copy cygwin's idea of the argument list into this Window application. */
- for (argc = 0; av[argc]; argc++)
- continue;
- argv = (char **) calloc (argc + 1, sizeof (char *));
- for (char **argvp = argv; *av; av++)
- *argvp++ = strdup (*av);
- }
-
-
- char **envp = (char **) cygwin_internal (CW_ENVP);
- if (envp && ((DWORD) envp != (DWORD) -1))
- {
- /* Store path and revert to this value, otherwise path gets overwritten
- by the POSIXy Cygwin variation, which breaks cygcheck.
- Another approach would be to use the Cygwin PATH and convert it to
- Win32 again. */
- char *path = NULL;
- char **env;
- while (*(env = _environ))
- {
- if (strncmp (*env, "PATH=", 5) == 0)
- path = strdup (*env);
- nuke (*env);
- }
- for (char **ev = envp; *ev; ev++)
- if (strncmp (*ev, "PATH=", 5) != 0)
- putenv (*ev);
- if (path)
- putenv (path);
- }
- }
- FreeLibrary (h);
-}
-
-int
-main (int argc, char **argv)
-{
- int i;
- bool ok = true;
- load_cygwin (argc, argv);
-
- /* Need POSIX sorting while parsing args, but don't forget the
- user's original environment. */
- char *posixly = getenv ("POSIXLY_CORRECT");
- if (posixly == NULL)
- (void) putenv("POSIXLY_CORRECT=1");
- while ((i = getopt_long (argc, argv, opts, longopts, NULL)) != EOF)
- switch (i)
- {
- case 's':
- sysinfo = 1;
- break;
- case 'c':
- check_setup = 1;
- break;
- case 'd':
- dump_only = 1;
- break;
- case 'r':
- registry = 1;
- break;
- case 'v':
- verbose = 1;
- break;
- case 'k':
- keycheck = 1;
- break;
- case 'f':
- find_package = 1;
- break;
- case 'l':
- list_package = 1;
- break;
- case 'p':
- grep_packages = 1;
- break;
- case 'h':
- givehelp = 1;
- break;
- case 'V':
- print_version ();
- exit (0);
- default:
- usage (stderr, 1);
- /*NOTREACHED*/}
- argc -= optind;
- argv += optind;
- if (posixly == NULL)
- putenv ("POSIXLY_CORRECT=");
-
- if (argc == 0 && !sysinfo && !keycheck && !check_setup && !list_package)
- if (givehelp)
- usage (stdout, 0);
- else
- usage (stderr, 1);
-
- if ((check_setup || sysinfo || find_package || list_package || grep_packages)
- && keycheck)
- usage (stderr, 1);
-
- if ((find_package || list_package || grep_packages) && check_setup)
- usage (stderr, 1);
-
- if (dump_only && !check_setup)
- usage (stderr, 1);
-
- if (find_package + list_package + grep_packages > 1)
- usage (stderr, 1);
-
- if (keycheck)
- return check_keys ();
- if (grep_packages)
- return package_grep (*argv);
-
- init_paths ();
-
- /* FIXME: Add help for check_setup and {list,find}_package */
- if (argc >= 1 && givehelp && !check_setup && !find_package && !list_package)
- {
- printf("Here is where the OS will find your program%s, and which dlls\n",
- argc > 1 ? "s" : "");
- printf ("will be used for it. Use -v to see DLL version info\n");
-
- if (!sysinfo)
- printf ("\n");
- }
-
- if (check_setup)
- dump_setup (verbose, argv, !dump_only);
- else if (find_package)
- package_find (verbose, argv);
- else if (list_package)
- package_list (verbose, argv);
- else
- for (i = 0; i < argc; i++)
- {
- if (i)
- puts ("");
- ok &= cygcheck (argv[i]);
- }
-
- if (sysinfo)
- {
- dump_sysinfo ();
- if (!check_setup)
- {
- puts ("");
- dump_setup (verbose, NULL, false);
- }
-
- if (!givehelp)
- puts ("Use -h to see help about each section");
- }
-
- return ok ? EXIT_SUCCESS : EXIT_FAILURE;
-}